Version Description
Download this release
Release Info
Developer | gutenbergplugin |
Plugin | Gutenberg |
Version | 14.0.0 |
Comparing to | |
See all releases |
Code changes from version 13.9.0 to 14.0.0
build/block-directory/index.js
CHANGED
@@ -742,6 +742,365 @@ function clearErrorNotice(blockId) {
|
|
742 |
};
|
743 |
}
|
744 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
745 |
;// CONCATENATED MODULE: ./packages/block-directory/build-module/store/resolvers.js
|
746 |
/**
|
747 |
* External dependencies
|
@@ -771,7 +1130,10 @@ const resolvers_getDownloadableBlocks = filterValue => async _ref => {
|
|
771 |
const results = await external_wp_apiFetch_default()({
|
772 |
path: `wp/v2/block-directory/search?term=${filterValue}`
|
773 |
});
|
774 |
-
const blocks = results.map(result => (
|
|
|
|
|
|
|
775 |
dispatch(receiveDownloadableBlocks(blocks, filterValue));
|
776 |
} catch {}
|
777 |
};
|
@@ -965,17 +1327,12 @@ const starEmpty = (0,external_wp_element_namespaceObject.createElement)(external
|
|
965 |
;// CONCATENATED MODULE: ./packages/block-directory/build-module/components/block-ratings/stars.js
|
966 |
|
967 |
|
968 |
-
/**
|
969 |
-
* External dependencies
|
970 |
-
*/
|
971 |
-
|
972 |
/**
|
973 |
* WordPress dependencies
|
974 |
*/
|
975 |
|
976 |
|
977 |
|
978 |
-
|
979 |
function Stars(_ref) {
|
980 |
let {
|
981 |
rating
|
@@ -988,17 +1345,23 @@ function Stars(_ref) {
|
|
988 |
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
|
989 |
/* translators: %s: number of stars. */
|
990 |
(0,external_wp_i18n_namespaceObject.__)('%s out of 5 stars'), stars)
|
991 |
-
},
|
|
|
|
|
992 |
key: `full_stars_${i}`,
|
993 |
className: "block-directory-block-ratings__star-full",
|
994 |
icon: star_filled,
|
995 |
size: 16
|
996 |
-
})),
|
|
|
|
|
997 |
key: `half_stars_${i}`,
|
998 |
className: "block-directory-block-ratings__star-half-full",
|
999 |
icon: star_half,
|
1000 |
size: 16
|
1001 |
-
})),
|
|
|
|
|
1002 |
key: `empty_stars_${i}`,
|
1003 |
className: "block-directory-block-ratings__star-empty",
|
1004 |
icon: star_empty,
|
742 |
};
|
743 |
}
|
744 |
|
745 |
+
;// CONCATENATED MODULE: ./node_modules/tslib/tslib.es6.js
|
746 |
+
/*! *****************************************************************************
|
747 |
+
Copyright (c) Microsoft Corporation.
|
748 |
+
|
749 |
+
Permission to use, copy, modify, and/or distribute this software for any
|
750 |
+
purpose with or without fee is hereby granted.
|
751 |
+
|
752 |
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
753 |
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
754 |
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
755 |
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
756 |
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
757 |
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
758 |
+
PERFORMANCE OF THIS SOFTWARE.
|
759 |
+
***************************************************************************** */
|
760 |
+
/* global Reflect, Promise */
|
761 |
+
|
762 |
+
var extendStatics = function(d, b) {
|
763 |
+
extendStatics = Object.setPrototypeOf ||
|
764 |
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
765 |
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
766 |
+
return extendStatics(d, b);
|
767 |
+
};
|
768 |
+
|
769 |
+
function __extends(d, b) {
|
770 |
+
if (typeof b !== "function" && b !== null)
|
771 |
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
772 |
+
extendStatics(d, b);
|
773 |
+
function __() { this.constructor = d; }
|
774 |
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
775 |
+
}
|
776 |
+
|
777 |
+
var __assign = function() {
|
778 |
+
__assign = Object.assign || function __assign(t) {
|
779 |
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
780 |
+
s = arguments[i];
|
781 |
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
782 |
+
}
|
783 |
+
return t;
|
784 |
+
}
|
785 |
+
return __assign.apply(this, arguments);
|
786 |
+
}
|
787 |
+
|
788 |
+
function __rest(s, e) {
|
789 |
+
var t = {};
|
790 |
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
791 |
+
t[p] = s[p];
|
792 |
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
793 |
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
794 |
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
795 |
+
t[p[i]] = s[p[i]];
|
796 |
+
}
|
797 |
+
return t;
|
798 |
+
}
|
799 |
+
|
800 |
+
function __decorate(decorators, target, key, desc) {
|
801 |
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
802 |
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
803 |
+
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;
|
804 |
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
805 |
+
}
|
806 |
+
|
807 |
+
function __param(paramIndex, decorator) {
|
808 |
+
return function (target, key) { decorator(target, key, paramIndex); }
|
809 |
+
}
|
810 |
+
|
811 |
+
function __metadata(metadataKey, metadataValue) {
|
812 |
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
813 |
+
}
|
814 |
+
|
815 |
+
function __awaiter(thisArg, _arguments, P, generator) {
|
816 |
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
817 |
+
return new (P || (P = Promise))(function (resolve, reject) {
|
818 |
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
819 |
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
820 |
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
821 |
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
822 |
+
});
|
823 |
+
}
|
824 |
+
|
825 |
+
function __generator(thisArg, body) {
|
826 |
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
827 |
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
828 |
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
829 |
+
function step(op) {
|
830 |
+
if (f) throw new TypeError("Generator is already executing.");
|
831 |
+
while (_) try {
|
832 |
+
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;
|
833 |
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
834 |
+
switch (op[0]) {
|
835 |
+
case 0: case 1: t = op; break;
|
836 |
+
case 4: _.label++; return { value: op[1], done: false };
|
837 |
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
838 |
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
839 |
+
default:
|
840 |
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
841 |
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
842 |
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
843 |
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
844 |
+
if (t[2]) _.ops.pop();
|
845 |
+
_.trys.pop(); continue;
|
846 |
+
}
|
847 |
+
op = body.call(thisArg, _);
|
848 |
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
849 |
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
850 |
+
}
|
851 |
+
}
|
852 |
+
|
853 |
+
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
854 |
+
if (k2 === undefined) k2 = k;
|
855 |
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
856 |
+
}) : (function(o, m, k, k2) {
|
857 |
+
if (k2 === undefined) k2 = k;
|
858 |
+
o[k2] = m[k];
|
859 |
+
});
|
860 |
+
|
861 |
+
function __exportStar(m, o) {
|
862 |
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
863 |
+
}
|
864 |
+
|
865 |
+
function __values(o) {
|
866 |
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
867 |
+
if (m) return m.call(o);
|
868 |
+
if (o && typeof o.length === "number") return {
|
869 |
+
next: function () {
|
870 |
+
if (o && i >= o.length) o = void 0;
|
871 |
+
return { value: o && o[i++], done: !o };
|
872 |
+
}
|
873 |
+
};
|
874 |
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
875 |
+
}
|
876 |
+
|
877 |
+
function __read(o, n) {
|
878 |
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
879 |
+
if (!m) return o;
|
880 |
+
var i = m.call(o), r, ar = [], e;
|
881 |
+
try {
|
882 |
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
883 |
+
}
|
884 |
+
catch (error) { e = { error: error }; }
|
885 |
+
finally {
|
886 |
+
try {
|
887 |
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
888 |
+
}
|
889 |
+
finally { if (e) throw e.error; }
|
890 |
+
}
|
891 |
+
return ar;
|
892 |
+
}
|
893 |
+
|
894 |
+
/** @deprecated */
|
895 |
+
function __spread() {
|
896 |
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
897 |
+
ar = ar.concat(__read(arguments[i]));
|
898 |
+
return ar;
|
899 |
+
}
|
900 |
+
|
901 |
+
/** @deprecated */
|
902 |
+
function __spreadArrays() {
|
903 |
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
904 |
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
905 |
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
906 |
+
r[k] = a[j];
|
907 |
+
return r;
|
908 |
+
}
|
909 |
+
|
910 |
+
function __spreadArray(to, from, pack) {
|
911 |
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
912 |
+
if (ar || !(i in from)) {
|
913 |
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
914 |
+
ar[i] = from[i];
|
915 |
+
}
|
916 |
+
}
|
917 |
+
return to.concat(ar || from);
|
918 |
+
}
|
919 |
+
|
920 |
+
function __await(v) {
|
921 |
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
922 |
+
}
|
923 |
+
|
924 |
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
925 |
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
926 |
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
927 |
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
928 |
+
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); }); }; }
|
929 |
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
930 |
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
931 |
+
function fulfill(value) { resume("next", value); }
|
932 |
+
function reject(value) { resume("throw", value); }
|
933 |
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
934 |
+
}
|
935 |
+
|
936 |
+
function __asyncDelegator(o) {
|
937 |
+
var i, p;
|
938 |
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
939 |
+
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; }
|
940 |
+
}
|
941 |
+
|
942 |
+
function __asyncValues(o) {
|
943 |
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
944 |
+
var m = o[Symbol.asyncIterator], i;
|
945 |
+
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);
|
946 |
+
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); }); }; }
|
947 |
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
948 |
+
}
|
949 |
+
|
950 |
+
function __makeTemplateObject(cooked, raw) {
|
951 |
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
952 |
+
return cooked;
|
953 |
+
};
|
954 |
+
|
955 |
+
var __setModuleDefault = Object.create ? (function(o, v) {
|
956 |
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
957 |
+
}) : function(o, v) {
|
958 |
+
o["default"] = v;
|
959 |
+
};
|
960 |
+
|
961 |
+
function __importStar(mod) {
|
962 |
+
if (mod && mod.__esModule) return mod;
|
963 |
+
var result = {};
|
964 |
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
965 |
+
__setModuleDefault(result, mod);
|
966 |
+
return result;
|
967 |
+
}
|
968 |
+
|
969 |
+
function __importDefault(mod) {
|
970 |
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
971 |
+
}
|
972 |
+
|
973 |
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
974 |
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
975 |
+
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");
|
976 |
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
977 |
+
}
|
978 |
+
|
979 |
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
980 |
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
981 |
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
982 |
+
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");
|
983 |
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
984 |
+
}
|
985 |
+
|
986 |
+
;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
|
987 |
+
/**
|
988 |
+
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
989 |
+
*/
|
990 |
+
var SUPPORTED_LOCALE = {
|
991 |
+
tr: {
|
992 |
+
regexp: /\u0130|\u0049|\u0049\u0307/g,
|
993 |
+
map: {
|
994 |
+
İ: "\u0069",
|
995 |
+
I: "\u0131",
|
996 |
+
İ: "\u0069",
|
997 |
+
},
|
998 |
+
},
|
999 |
+
az: {
|
1000 |
+
regexp: /\u0130/g,
|
1001 |
+
map: {
|
1002 |
+
İ: "\u0069",
|
1003 |
+
I: "\u0131",
|
1004 |
+
İ: "\u0069",
|
1005 |
+
},
|
1006 |
+
},
|
1007 |
+
lt: {
|
1008 |
+
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
|
1009 |
+
map: {
|
1010 |
+
I: "\u0069\u0307",
|
1011 |
+
J: "\u006A\u0307",
|
1012 |
+
Į: "\u012F\u0307",
|
1013 |
+
Ì: "\u0069\u0307\u0300",
|
1014 |
+
Í: "\u0069\u0307\u0301",
|
1015 |
+
Ĩ: "\u0069\u0307\u0303",
|
1016 |
+
},
|
1017 |
+
},
|
1018 |
+
};
|
1019 |
+
/**
|
1020 |
+
* Localized lower case.
|
1021 |
+
*/
|
1022 |
+
function localeLowerCase(str, locale) {
|
1023 |
+
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
|
1024 |
+
if (lang)
|
1025 |
+
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
|
1026 |
+
return lowerCase(str);
|
1027 |
+
}
|
1028 |
+
/**
|
1029 |
+
* Lower case as a function.
|
1030 |
+
*/
|
1031 |
+
function lowerCase(str) {
|
1032 |
+
return str.toLowerCase();
|
1033 |
+
}
|
1034 |
+
|
1035 |
+
;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
|
1036 |
+
|
1037 |
+
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
|
1038 |
+
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
1039 |
+
// Remove all non-word characters.
|
1040 |
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
1041 |
+
/**
|
1042 |
+
* Normalize the string into something other libraries can manipulate easier.
|
1043 |
+
*/
|
1044 |
+
function noCase(input, options) {
|
1045 |
+
if (options === void 0) { options = {}; }
|
1046 |
+
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;
|
1047 |
+
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
1048 |
+
var start = 0;
|
1049 |
+
var end = result.length;
|
1050 |
+
// Trim the delimiter from around the output string.
|
1051 |
+
while (result.charAt(start) === "\0")
|
1052 |
+
start++;
|
1053 |
+
while (result.charAt(end - 1) === "\0")
|
1054 |
+
end--;
|
1055 |
+
// Transform each token independently.
|
1056 |
+
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
1057 |
+
}
|
1058 |
+
/**
|
1059 |
+
* Replace `re` in the input string with the replacement value.
|
1060 |
+
*/
|
1061 |
+
function replace(input, re, value) {
|
1062 |
+
if (re instanceof RegExp)
|
1063 |
+
return input.replace(re, value);
|
1064 |
+
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
|
1065 |
+
}
|
1066 |
+
|
1067 |
+
;// CONCATENATED MODULE: ./node_modules/pascal-case/dist.es2015/index.js
|
1068 |
+
|
1069 |
+
|
1070 |
+
function pascalCaseTransform(input, index) {
|
1071 |
+
var firstChar = input.charAt(0);
|
1072 |
+
var lowerChars = input.substr(1).toLowerCase();
|
1073 |
+
if (index > 0 && firstChar >= "0" && firstChar <= "9") {
|
1074 |
+
return "_" + firstChar + lowerChars;
|
1075 |
+
}
|
1076 |
+
return "" + firstChar.toUpperCase() + lowerChars;
|
1077 |
+
}
|
1078 |
+
function dist_es2015_pascalCaseTransformMerge(input) {
|
1079 |
+
return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();
|
1080 |
+
}
|
1081 |
+
function pascalCase(input, options) {
|
1082 |
+
if (options === void 0) { options = {}; }
|
1083 |
+
return noCase(input, __assign({ delimiter: "", transform: pascalCaseTransform }, options));
|
1084 |
+
}
|
1085 |
+
|
1086 |
+
;// CONCATENATED MODULE: ./node_modules/camel-case/dist.es2015/index.js
|
1087 |
+
|
1088 |
+
|
1089 |
+
function camelCaseTransform(input, index) {
|
1090 |
+
if (index === 0)
|
1091 |
+
return input.toLowerCase();
|
1092 |
+
return pascalCaseTransform(input, index);
|
1093 |
+
}
|
1094 |
+
function camelCaseTransformMerge(input, index) {
|
1095 |
+
if (index === 0)
|
1096 |
+
return input.toLowerCase();
|
1097 |
+
return pascalCaseTransformMerge(input);
|
1098 |
+
}
|
1099 |
+
function camelCase(input, options) {
|
1100 |
+
if (options === void 0) { options = {}; }
|
1101 |
+
return pascalCase(input, __assign({ transform: camelCaseTransform }, options));
|
1102 |
+
}
|
1103 |
+
|
1104 |
;// CONCATENATED MODULE: ./packages/block-directory/build-module/store/resolvers.js
|
1105 |
/**
|
1106 |
* External dependencies
|
1130 |
const results = await external_wp_apiFetch_default()({
|
1131 |
path: `wp/v2/block-directory/search?term=${filterValue}`
|
1132 |
});
|
1133 |
+
const blocks = results.map(result => Object.fromEntries(Object.entries(result).map(_ref2 => {
|
1134 |
+
let [key, value] = _ref2;
|
1135 |
+
return [camelCase(key), value];
|
1136 |
+
})));
|
1137 |
dispatch(receiveDownloadableBlocks(blocks, filterValue));
|
1138 |
} catch {}
|
1139 |
};
|
1327 |
;// CONCATENATED MODULE: ./packages/block-directory/build-module/components/block-ratings/stars.js
|
1328 |
|
1329 |
|
|
|
|
|
|
|
|
|
1330 |
/**
|
1331 |
* WordPress dependencies
|
1332 |
*/
|
1333 |
|
1334 |
|
1335 |
|
|
|
1336 |
function Stars(_ref) {
|
1337 |
let {
|
1338 |
rating
|
1345 |
"aria-label": (0,external_wp_i18n_namespaceObject.sprintf)(
|
1346 |
/* translators: %s: number of stars. */
|
1347 |
(0,external_wp_i18n_namespaceObject.__)('%s out of 5 stars'), stars)
|
1348 |
+
}, Array.from({
|
1349 |
+
length: fullStarCount
|
1350 |
+
}).map((_, i) => (0,external_wp_element_namespaceObject.createElement)(icon, {
|
1351 |
key: `full_stars_${i}`,
|
1352 |
className: "block-directory-block-ratings__star-full",
|
1353 |
icon: star_filled,
|
1354 |
size: 16
|
1355 |
+
})), Array.from({
|
1356 |
+
length: halfStarCount
|
1357 |
+
}).map((_, i) => (0,external_wp_element_namespaceObject.createElement)(icon, {
|
1358 |
key: `half_stars_${i}`,
|
1359 |
className: "block-directory-block-ratings__star-half-full",
|
1360 |
icon: star_half,
|
1361 |
size: 16
|
1362 |
+
})), Array.from({
|
1363 |
+
length: emptyStarCount
|
1364 |
+
}).map((_, i) => (0,external_wp_element_namespaceObject.createElement)(icon, {
|
1365 |
key: `empty_stars_${i}`,
|
1366 |
className: "block-directory-block-ratings__star-empty",
|
1367 |
icon: star_empty,
|
build/block-directory/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'wp-a11y', 'wp-api-fetch', 'wp-block-editor', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-core-data', 'wp-data', 'wp-edit-post', 'wp-editor', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-notices', 'wp-plugins', 'wp-polyfill', 'wp-primitives', 'wp-url'), 'version' => '6331e2102e014df79f9e');
|
build/block-directory/index.min.js
CHANGED
@@ -1,20 +1,20 @@
|
|
1 |
-
(()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()
|
2 |
-
(0,v.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),
|
3 |
/* translators: %s: number of stars. */
|
4 |
-
(0,v.__)("%s out of 5 stars"),l)},
|
5 |
/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */
|
6 |
-
(0,v._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,
|
7 |
/* translators: %1$s: block title, %2$s: author name. */
|
8 |
-
(0,v.__)("%1$s <span>by %2$s</span>"),(0,
|
9 |
/* translators: %d: number of available blocks. */
|
10 |
-
(0,v._n)("%d additional block is available to install.","%d additional blocks are available to install.",o),o))}),[o]),(0,
|
11 |
/* translators: %s: Name of the block author. */
|
12 |
-
(0,v.__)("By %s"),o))))}))):null}function
|
13 |
-
(0,v._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},(0,
|
14 |
/* translators: %s: block name */
|
15 |
-
(0,v.__)("Install %s"),l.title))}const
|
16 |
/* translators: %s: block name */
|
17 |
-
(0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),t.title||n);const m=[(0,
|
18 |
/* translators: %s: block name */
|
19 |
-
(0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),t.title||n),m.push((0,
|
20 |
//# sourceMappingURL=index.min.js.map
|
1 |
+
(()=>{"use strict";var e={n:t=>{var l=t&&t.__esModule?()=>t.default:()=>t;return e.d(l,{a:l}),l},d:(t,l)=>{for(var n in l)e.o(l,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:l[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t),r:e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}},t={};e.r(t),e.d(t,{store:()=>W});var l={};e.r(l),e.d(l,{getDownloadableBlocks:()=>g,getErrorNoticeForBlock:()=>f,getErrorNotices:()=>y,getInstalledBlockTypes:()=>_,getNewBlockTypes:()=>w,getUnusedBlockTypes:()=>E,isInstalling:()=>h,isRequestingDownloadableBlocks:()=>b});var n={};e.r(n),e.d(n,{addInstalledBlockType:()=>R,clearErrorNotice:()=>F,fetchDownloadableBlocks:()=>O,installBlockType:()=>A,receiveDownloadableBlocks:()=>C,removeInstalledBlockType:()=>P,setErrorNotice:()=>x,setIsInstalling:()=>M,uninstallBlockType:()=>D});var o={};e.r(o),e.d(o,{getDownloadableBlocks:()=>q});const r=window.wp.element,a=window.wp.plugins,s=window.wp.hooks,i=window.wp.blocks,c=window.wp.data,d=window.wp.editor,u=window.lodash,m=(0,c.combineReducers)({downloadableBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"FETCH_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{isRequesting:!0}};case"RECEIVE_DOWNLOADABLE_BLOCKS":return{...e,[t.filterValue]:{results:t.downloadableBlocks,isRequesting:!1}}}return e},blockManagement:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{installedBlockTypes:[],isInstalling:{}},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"ADD_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:[...e.installedBlockTypes,t.item]};case"REMOVE_INSTALLED_BLOCK_TYPE":return{...e,installedBlockTypes:e.installedBlockTypes.filter((e=>e.name!==t.item.name))};case"SET_INSTALLING_BLOCK":return{...e,isInstalling:{...e.isInstalling,[t.blockId]:t.isInstalling}}}return e},errorNotices:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_ERROR_NOTICE":return{...e,[t.blockId]:{message:t.message,isFatal:t.isFatal}};case"CLEAR_ERROR_NOTICE":return(0,u.omit)(e,t.blockId)}return e}}),p=window.wp.blockEditor;function k(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t.length)return!1;if(t.some((t=>{let{name:l}=t;return l===e.name})))return!0;for(let l=0;l<t.length;l++)if(k(e,t[l].innerBlocks))return!0;return!1}function b(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.isRequesting)&&void 0!==l&&l}function g(e,t){var l,n;return null!==(l=null===(n=e.downloadableBlocks[t])||void 0===n?void 0:n.results)&&void 0!==l?l:[]}function _(e){return e.blockManagement.installedBlockTypes}const w=(0,c.createRegistrySelector)((e=>t=>{const l=e(p.store).getBlocks();return _(t).filter((e=>k(e,l)))})),E=(0,c.createRegistrySelector)((e=>t=>{const l=e(p.store).getBlocks();return _(t).filter((e=>!k(e,l)))}));function h(e,t){return e.blockManagement.isInstalling[t]||!1}function y(e){return e.errorNotices}function f(e,t){return e.errorNotices[t]}const v=window.wp.i18n,B=window.wp.apiFetch;var N=e.n(B);const I=window.wp.notices,T=window.wp.url,L=e=>new Promise(((t,l)=>{const n=document.createElement(e.nodeName);["id","rel","src","href","type"].forEach((t=>{e[t]&&(n[t]=e[t])})),e.innerHTML&&n.appendChild(document.createTextNode(e.innerHTML)),n.onload=()=>t(!0),n.onerror=()=>l(new Error("Error loading asset.")),document.body.appendChild(n),("link"===n.nodeName.toLowerCase()||"script"===n.nodeName.toLowerCase()&&!n.src)&&t()}));function S(e){if(!e)return!1;const t=e.links["wp:plugin"]||e.links.self;return!(!t||!t.length)&&t[0].href}function O(e){return{type:"FETCH_DOWNLOADABLE_BLOCKS",filterValue:e}}function C(e,t){return{type:"RECEIVE_DOWNLOADABLE_BLOCKS",downloadableBlocks:e,filterValue:t}}const A=e=>async t=>{let{registry:l,dispatch:n}=t;const{id:o,name:r}=e;let a=!1;n.clearErrorNotice(o);try{n.setIsInstalling(o,!0);const t=S(e);let s={};t?await N()({method:"PUT",url:t,data:{status:"active"}}):s=(await N()({method:"POST",path:"wp/v2/plugins",data:{slug:o,status:"active"}}))._links,n.addInstalledBlockType({...e,links:{...e.links,...s}});const c=["api_version","title","category","parent","icon","description","keywords","attributes","provides_context","uses_context","supports","styles","example","variations"];if(await N()({path:(0,T.addQueryArgs)(`/wp/v2/block-types/${r}`,{_fields:c})}).catch((()=>{})).then((e=>{e&&(0,i.unstable__bootstrapServerSideBlockDefinitions)({[r]:(0,u.pick)(e,c)})})),await async function(){const e=await N()({url:document.location.href,parse:!1}),t=await e.text(),l=(new window.DOMParser).parseFromString(t,"text/html"),n=Array.from(l.querySelectorAll('link[rel="stylesheet"],script')).filter((e=>e.id&&!document.getElementById(e.id)));for(const e of n)await L(e)}(),!l.select(i.store).getBlockTypes().some((e=>e.name===r)))throw new Error((0,v.__)("Error registering block. Try reloading the page."));l.dispatch(I.store).createInfoNotice((0,v.sprintf)(// translators: %s is the block title.
|
2 |
+
(0,v.__)("Block %s installed and added."),e.title),{speak:!0,type:"snackbar"}),a=!0}catch(e){let t=e.message||(0,v.__)("An error occurred."),r=e instanceof Error;const a={folder_exists:(0,v.__)("This block is already installed. Try reloading the page."),unable_to_connect_to_filesystem:(0,v.__)("Error installing block. You can reload the page and try again.")};a[e.code]&&(r=!0,t=a[e.code]),n.setErrorNotice(o,t,r),l.dispatch(I.store).createErrorNotice(t,{speak:!0,isDismissible:!0})}return n.setIsInstalling(o,!1),a},D=e=>async t=>{let{registry:l,dispatch:n}=t;try{const t=S(e);await N()({method:"PUT",url:t,data:{status:"inactive"}}),await N()({method:"DELETE",url:t}),n.removeInstalledBlockType(e)}catch(e){l.dispatch(I.store).createErrorNotice(e.message||(0,v.__)("An error occurred."))}};function R(e){return{type:"ADD_INSTALLED_BLOCK_TYPE",item:e}}function P(e){return{type:"REMOVE_INSTALLED_BLOCK_TYPE",item:e}}function M(e,t){return{type:"SET_INSTALLING_BLOCK",blockId:e,isInstalling:t}}function x(e,t){let l=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"SET_ERROR_NOTICE",blockId:e,message:t,isFatal:l}}function F(e){return{type:"CLEAR_ERROR_NOTICE",blockId:e}}var V=function(){return(V=Object.assign||function(e){for(var t,l=1,n=arguments.length;l<n;l++)for(var o in t=arguments[l])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function H(e){return e.toLowerCase()}Object.create,Object.create;var $=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],j=/[^A-Z0-9]+/gi;function z(e,t,l){return t instanceof RegExp?e.replace(t,l):t.reduce((function(e,t){return e.replace(t,l)}),e)}function K(e,t){var l=e.charAt(0),n=e.substr(1).toLowerCase();return t>0&&l>="0"&&l<="9"?"_"+l+n:""+l.toUpperCase()+n}function U(e,t){return void 0===t&&(t={}),function(e,t){void 0===t&&(t={});for(var l=t.splitRegexp,n=void 0===l?$:l,o=t.stripRegexp,r=void 0===o?j:o,a=t.transform,s=void 0===a?H:a,i=t.delimiter,c=void 0===i?" ":i,d=z(z(e,n,"$1\0$2"),r,"\0"),u=0,m=d.length;"\0"===d.charAt(u);)u++;for(;"\0"===d.charAt(m-1);)m--;return d.slice(u,m).split("\0").map(s).join(c)}(e,V({delimiter:"",transform:K},t))}function Y(e,t){return 0===t?e.toLowerCase():K(e,t)}const q=e=>async t=>{let{dispatch:l}=t;if(e)try{l(O(e));l(C((await N()({path:`wp/v2/block-directory/search?term=${e}`})).map((e=>Object.fromEntries(Object.entries(e).map((e=>{let[t,l]=e;return[(n=t,void 0===o&&(o={}),U(n,V({transform:Y},o))),l];var n,o}))))),e))}catch{}},G={reducer:m,selectors:l,actions:n,resolvers:o},W=(0,c.createReduxStore)("core/block-directory",G);function Z(){const{uninstallBlockType:e}=(0,c.useDispatch)(W),t=(0,c.useSelect)((e=>{const{isAutosavingPost:t,isSavingPost:l}=e(d.store);return l()&&!t()}),[]),l=(0,c.useSelect)((e=>e(W).getUnusedBlockTypes()),[]);return(0,r.useEffect)((()=>{t&&l.length&&l.forEach((t=>{e(t),(0,i.unregisterBlockType)(t.name)}))}),[t]),null}(0,c.register)(W);const Q=window.wp.components,J=window.wp.compose,X=window.wp.coreData;function ee(){return(ee=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var l=arguments[t];for(var n in l)Object.prototype.hasOwnProperty.call(l,n)&&(e[n]=l[n])}return e}).apply(this,arguments)}const te=window.wp.htmlEntities,le=function(e){let{icon:t,size:l=24,...n}=e;return(0,r.cloneElement)(t,{width:l,height:l,...n})},ne=window.wp.primitives,oe=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{d:"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z"})),re=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{d:"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z"})),ae=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{fillRule:"evenodd",d:"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z",clipRule:"evenodd"})),se=function(e){let{rating:t}=e;const l=.5*Math.round(t/.5),n=Math.floor(t),o=Math.ceil(t-n),a=5-(n+o);return(0,r.createElement)("span",{"aria-label":(0,v.sprintf)(
|
3 |
/* translators: %s: number of stars. */
|
4 |
+
(0,v.__)("%s out of 5 stars"),l)},Array.from({length:n}).map(((e,t)=>(0,r.createElement)(le,{key:`full_stars_${t}`,className:"block-directory-block-ratings__star-full",icon:oe,size:16}))),Array.from({length:o}).map(((e,t)=>(0,r.createElement)(le,{key:`half_stars_${t}`,className:"block-directory-block-ratings__star-half-full",icon:re,size:16}))),Array.from({length:a}).map(((e,t)=>(0,r.createElement)(le,{key:`empty_stars_${t}`,className:"block-directory-block-ratings__star-empty",icon:ae,size:16}))))},ie=e=>{let{rating:t}=e;return(0,r.createElement)("span",{className:"block-directory-block-ratings"},(0,r.createElement)(se,{rating:t}))},ce=function(e){let{icon:t}=e;const l="block-directory-downloadable-block-icon";return null!==t.match(/\.(jpeg|jpg|gif|png|svg)(?:\?.*)?$/)?(0,r.createElement)("img",{className:l,src:t,alt:""}):(0,r.createElement)(p.BlockIcon,{className:l,icon:t,showColors:!0})},de=e=>{let{block:t}=e;const l=(0,c.useSelect)((e=>e(W).getErrorNoticeForBlock(t.id)),[t]);return l?(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice"},(0,r.createElement)("div",{className:"block-directory-downloadable-block-notice__content"},l.message,l.isFatal?" "+(0,v.__)("Try reloading the page."):null)):null};function ue(e,t){let{title:l,rating:n,ratingCount:o}=e,{hasNotice:r,isInstalled:a,isInstalling:s}=t;const i=.5*Math.round(n/.5);return!a&&r?(0,v.sprintf)("Retry installing %s.",(0,te.decodeEntities)(l)):a?(0,v.sprintf)("Add %s.",(0,te.decodeEntities)(l)):s?(0,v.sprintf)("Installing %s.",(0,te.decodeEntities)(l)):o<1?(0,v.sprintf)("Install %s.",(0,te.decodeEntities)(l)):(0,v.sprintf)(
|
5 |
/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */
|
6 |
+
(0,v._n)("Install %1$s. %2$s stars with %3$s review.","Install %1$s. %2$s stars with %3$s reviews.",o),(0,te.decodeEntities)(l),i,o)}const me=function(e){let{composite:t,item:l,onClick:n}=e;const{author:o,description:a,icon:s,rating:d,title:u}=l,m=!!(0,i.getBlockType)(l.name),{hasNotice:p,isInstalling:k,isInstallable:b}=(0,c.useSelect)((e=>{const{getErrorNoticeForBlock:t,isInstalling:n}=e(W),o=t(l.id),r=o&&o.isFatal;return{hasNotice:!!o,isInstalling:n(l.id),isInstallable:!r}}),[l]);let g="";return m?g=(0,v.__)("Installed!"):k&&(g=(0,v.__)("Installing…")),(0,r.createElement)(Q.__unstableCompositeItem,ee({__experimentalIsFocusable:!0,role:"option",as:Q.Button},t,{className:"block-directory-downloadable-block-list-item",onClick:e=>{e.preventDefault(),n()},isBusy:k,disabled:k||!b,label:ue(l,{hasNotice:p,isInstalled:m,isInstalling:k}),showTooltip:!0,tooltipPosition:"top center"}),(0,r.createElement)("div",{className:"block-directory-downloadable-block-list-item__icon"},(0,r.createElement)(ce,{icon:s,title:u}),k?(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__spinner"},(0,r.createElement)(Q.Spinner,null)):(0,r.createElement)(ie,{rating:d})),(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__details"},(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__title"},(0,r.createInterpolateElement)((0,v.sprintf)(
|
7 |
/* translators: %1$s: block title, %2$s: author name. */
|
8 |
+
(0,v.__)("%1$s <span>by %2$s</span>"),(0,te.decodeEntities)(u),o),{span:(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__author"})})),p?(0,r.createElement)(de,{block:l}):(0,r.createElement)(r.Fragment,null,(0,r.createElement)("span",{className:"block-directory-downloadable-block-list-item__desc"},g||(0,te.decodeEntities)(a)),b&&!(m||k)&&(0,r.createElement)(Q.VisuallyHidden,null,(0,v.__)("Install block")))))},pe=()=>{},ke=function(e){let{items:t,onHover:l=pe,onSelect:n}=e;const o=(0,Q.__unstableUseCompositeState)(),{installBlockType:a}=(0,c.useDispatch)(W);return t.length?(0,r.createElement)(Q.__unstableComposite,ee({},o,{role:"listbox",className:"block-directory-downloadable-blocks-list","aria-label":(0,v.__)("Blocks available for install")}),t.map((e=>(0,r.createElement)(me,{key:e.id,composite:o,onClick:()=>{(0,i.getBlockType)(e.name)?n(e):a(e).then((t=>{t&&n(e)})),l(null)},onHover:l,item:e})))):null},be=window.wp.a11y,ge=function(e){let{children:t,downloadableItems:l,hasLocalBlocks:n}=e;const o=l.length;return(0,r.useEffect)((()=>{(0,be.speak)((0,v.sprintf)(
|
9 |
/* translators: %d: number of available blocks. */
|
10 |
+
(0,v._n)("%d additional block is available to install.","%d additional blocks are available to install.",o),o))}),[o]),(0,r.createElement)(r.Fragment,null,!n&&(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel"},(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel__header"},(0,r.createElement)("h2",{className:"block-directory-downloadable-blocks-panel__title"},(0,v.__)("Available to install")),(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__description"},(0,v.__)("Select a block to install and add it to your post."))),t))},_e=(0,r.createElement)(ne.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,r.createElement)(ne.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),we=function(){return(0,r.createElement)(r.Fragment,null,(0,r.createElement)("div",{className:"block-editor-inserter__no-results"},(0,r.createElement)(le,{className:"block-editor-inserter__no-results-icon",icon:_e}),(0,r.createElement)("p",null,(0,v.__)("No results found."))),(0,r.createElement)("div",{className:"block-editor-inserter__tips"},(0,r.createElement)(Q.Tip,null,(0,v.__)("Interested in creating your own block?"),(0,r.createElement)("br",null),(0,r.createElement)(Q.ExternalLink,{href:"https://developer.wordpress.org/block-editor/"},(0,v.__)("Get started here"),"."))))},Ee=(0,J.compose)([(0,c.withSelect)(((e,t)=>{let{filterValue:l,rootClientId:n=null}=t;const{getDownloadableBlocks:o,isRequestingDownloadableBlocks:r}=e(W),{canInsertBlockType:a}=e(p.store),s=e(X.store).canUser("read","block-directory/search");return{downloadableItems:s?o(l).filter((e=>a(e,n,!0))):[],hasPermission:s,isLoading:r(l)}}))])((function(e){let{downloadableItems:t,onSelect:l,onHover:n,hasLocalBlocks:o,hasPermission:a,isLoading:s,isTyping:i}=e;return void 0===a||s||i?(0,r.createElement)(r.Fragment,null,a&&!o&&(0,r.createElement)(r.Fragment,null,(0,r.createElement)("p",{className:"block-directory-downloadable-blocks-panel__no-local"},(0,v.__)("No results available from your installed blocks.")),(0,r.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"})),(0,r.createElement)("div",{className:"block-directory-downloadable-blocks-panel has-blocks-loading"},(0,r.createElement)(Q.Spinner,null))):!1===a?o?null:(0,r.createElement)(we,null):t.length?(0,r.createElement)(ge,{downloadableItems:t,hasLocalBlocks:o},(0,r.createElement)(ke,{items:t,onSelect:l,onHover:n})):!o&&(0,r.createElement)(we,null)})),he=function(){const[e,t]=(0,r.useState)(""),l=(0,u.debounce)(t,400);return(0,r.createElement)(p.__unstableInserterMenuExtension,null,(t=>{let{onSelect:n,onHover:o,filterValue:a,hasItems:s,rootClientId:i}=t;return e!==a&&l(a),e?(0,r.createElement)(Ee,{onSelect:n,onHover:o,rootClientId:i,filterValue:e,hasLocalBlocks:s,isTyping:a!==e}):null}))},ye=window.wp.editPost;function fe(e){let{items:t}=e;return t.length?(0,r.createElement)("ul",{className:"block-directory-compact-list"},t.map((e=>{let{icon:t,id:l,title:n,author:o}=e;return(0,r.createElement)("li",{key:l,className:"block-directory-compact-list__item"},(0,r.createElement)(ce,{icon:t,title:n}),(0,r.createElement)("div",{className:"block-directory-compact-list__item-details"},(0,r.createElement)("div",{className:"block-directory-compact-list__item-title"},n),(0,r.createElement)("div",{className:"block-directory-compact-list__item-author"},(0,v.sprintf)(
|
11 |
/* translators: %s: Name of the block author. */
|
12 |
+
(0,v.__)("By %s"),o))))}))):null}function ve(){const e=(0,c.useSelect)((e=>e(W).getNewBlockTypes()),[]);return e.length?(0,r.createElement)(ye.PluginPrePublishPanel,{icon:_e,title:(0,v.sprintf)(// translators: %d: number of blocks (number).
|
13 |
+
(0,v._n)("Added: %d block","Added: %d blocks",e.length),e.length),initialOpen:!0},(0,r.createElement)("p",{className:"installed-blocks-pre-publish-panel__copy"},(0,v._n)("The following block has been added to your site.","The following blocks have been added to your site.",e.length)),(0,r.createElement)(fe,{items:e})):null}function Be(e){let{attributes:t,block:l,clientId:n}=e;const o=(0,c.useSelect)((e=>e(W).isInstalling(l.id)),[l.id]),{installBlockType:a}=(0,c.useDispatch)(W),{replaceBlock:s}=(0,c.useDispatch)(p.store);return(0,r.createElement)(Q.Button,{onClick:()=>a(l).then((e=>{if(e){const e=(0,i.getBlockType)(l.name),[o]=(0,i.parse)(t.originalContent);o&&e&&s(n,(0,i.createBlock)(e.name,o.attributes,o.innerBlocks))}})),disabled:o,isBusy:o,variant:"primary"},(0,v.sprintf)(
|
14 |
/* translators: %s: block name */
|
15 |
+
(0,v.__)("Install %s"),l.title))}const Ne=e=>{let{originalBlock:t,...l}=e;const{originalName:n,originalUndelimitedContent:o}=l.attributes,{replaceBlock:a}=(0,c.useDispatch)(p.store),s=!!o,d=(0,i.getBlockType)("core/html");let u=(0,v.sprintf)(
|
16 |
/* translators: %s: block name */
|
17 |
+
(0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely."),t.title||n);const m=[(0,r.createElement)(Be,{key:"install",block:t,attributes:l.attributes,clientId:l.clientId})];return s&&d&&(u=(0,v.sprintf)(
|
18 |
/* translators: %s: block name */
|
19 |
+
(0,v.__)("Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely."),t.title||n),m.push((0,r.createElement)(Q.Button,{key:"convert",onClick:()=>{a(l.clientId,(0,i.createBlock)("core/html",{content:o}))},variant:"link"},(0,v.__)("Keep as HTML")))),(0,r.createElement)("div",(0,p.useBlockProps)(),(0,r.createElement)(p.Warning,{actions:m},u),(0,r.createElement)(r.RawHTML,null,o))};(0,a.registerPlugin)("block-directory",{render:()=>(0,r.createElement)(r.Fragment,null,(0,r.createElement)(Z,null),(0,r.createElement)(he,null),(0,r.createElement)(ve,null))}),(0,s.addFilter)("blocks.registerBlockType","block-directory/fallback",((e,t)=>{return"core/missing"!==t||(e.edit=(l=e.edit,e=>{const{originalName:t}=e.attributes,{block:n,hasPermission:o}=(0,c.useSelect)((e=>{const{getDownloadableBlocks:l}=e(W),n=l("block:"+t).filter((e=>{let{name:l}=e;return t===l}));return{hasPermission:e(X.store).canUser("read","block-directory/search"),block:n.length&&n[0]}}),[t]);return o&&n?(0,r.createElement)(Ne,ee({},e,{originalBlock:n})):(0,r.createElement)(l,e)})),e;var l})),(window.wp=window.wp||{}).blockDirectory=t})();
|
20 |
//# sourceMappingURL=index.min.js.map
|
build/block-directory/index.min.js.map
CHANGED
@@ -1 +1 @@
|
|
1 |
-
{"version":3,"file":"./build/block-directory/index.min.js","mappings":"mBACA,IAAIA,EAAsB,CCA1B,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,CAACI,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,CAACM,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClF,EAAyBT,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,wkBCLvD,MAAM,EAA+BC,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAe,OC2GpD,GAAeC,EAAAA,EAAAA,iBAAiB,CAC/BC,mBAzFiC,WAA0B,IAAxBC,EAAwB,uDAAhB,GAAIC,EAAY,uCAC3D,OAASA,EAAOC,MACf,IAAK,4BACJ,MAAO,IACHF,EACH,CAAEC,EAAOE,aAAe,CACvBC,cAAc,IAGjB,IAAK,8BACJ,MAAO,IACHJ,EACH,CAAEC,EAAOE,aAAe,CACvBE,QAASJ,EAAOF,mBAChBK,cAAc,IAIlB,OAAOJ,GAwEPM,gBA7D8B,WAM1B,IALJN,EAKI,uDALI,CACPO,oBAAqB,GACrBC,aAAc,IAEfP,EACI,uCACJ,OAASA,EAAOC,MACf,IAAK,2BACJ,MAAO,IACHF,EACHO,oBAAqB,IACjBP,EAAMO,oBACTN,EAAOQ,OAGV,IAAK,8BACJ,MAAO,IACHT,EACHO,oBAAqBP,EAAMO,oBAAoBG,QAC5CC,GAAeA,EAAUC,OAASX,EAAOQ,KAAKG,QAGnD,IAAK,uBACJ,MAAO,IACHZ,EACHQ,aAAc,IACVR,EAAMQ,aACT,CAAEP,EAAOY,SAAWZ,EAAOO,eAI/B,OAAOR,GA8BPc,aAnB2B,WAA0B,IAAxBd,EAAwB,uDAAhB,GAAIC,EAAY,uCACrD,OAASA,EAAOC,MACf,IAAK,mBACJ,MAAO,IACHF,EACH,CAAEC,EAAOY,SAAW,CACnBE,QAASd,EAAOc,QAChBC,QAASf,EAAOe,UAGnB,IAAK,qBACJ,OAAOC,EAAAA,EAAAA,MAAMjB,EAAOC,EAAOY,SAE7B,OAAOb,KCxGF,EAA+BH,OAAW,GAAe,YCShD,SAASqB,EAAcP,GAAyB,IAAdQ,EAAc,uDAAL,GACzD,IAAOA,EAAOC,OACb,OAAO,EAER,GAAKD,EAAOE,MAAM,QAAE,KAAET,GAAJ,SAAgBA,IAASD,EAAUC,QACpD,OAAO,EAER,IAAM,IAAIU,EAAI,EAAGA,EAAIH,EAAOC,OAAQE,IACnC,GAAKJ,EAAcP,EAAWQ,EAAQG,GAAIC,aACzC,OAAO,EAIT,OAAO,ECHD,SAASC,EAAgCxB,EAAOG,GAAc,QACpE,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCC,oBAAhD,SAWM,SAASqB,EAAuBzB,EAAOG,GAAc,QAC3D,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCE,eAAhD,QAA2D,GAWrD,SAASqB,EAAwB1B,GACvC,OAAOA,EAAMM,gBAAgBC,oBAWvB,MAAMoB,GAAmBC,EAAAA,EAAAA,yBAC7BC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QAAUC,GACpCO,EAAcP,EAAWmB,QAafG,GAAsBL,EAAAA,EAAAA,yBAChCC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QACxBC,IAAiBO,EAAcP,EAAWmB,QAaxC,SAAStB,EAAcR,EAAOa,GACpC,OAAOb,EAAMM,gBAAgBE,aAAcK,KAAa,EAUlD,SAASqB,EAAiBlC,GAChC,OAAOA,EAAMc,aAWP,SAASqB,EAAwBnC,EAAOa,GAC9C,OAAOb,EAAMc,aAAcD,GCrH5B,MAAM,EAA+BhB,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,aCA5D,MAAM,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe1CuC,EAAcC,GACnB,IAAIC,SAAS,CAAEC,EAASC,KAK9B,MAAMC,EAAUC,SAASC,cAAeN,EAAGO,UAE3C,CAAE,KAAM,MAAO,MAAO,OAAQ,QAASC,SAAWC,IAC5CT,EAAIS,KACRL,EAASK,GAAST,EAAIS,OAKnBT,EAAGU,WACPN,EAAQO,YAAaN,SAASO,eAAgBZ,EAAGU,YAGlDN,EAAQS,OAAS,IAAMX,GAAS,GAChCE,EAAQU,QAAU,IAAMX,EAAQ,IAAIY,MAAO,yBAE3CV,SAASW,KAAKL,YAAaP,IAI1B,SAAWA,EAAQG,SAASU,eAC1B,WAAab,EAAQG,SAASU,gBAAmBb,EAAQc,MAE3DhB,OCrCY,SAASiB,EAAcC,GACrC,IAAOA,EACN,OAAO,EAER,MAAMC,EAAOD,EAAME,MAAO,cAAiBF,EAAME,MAAMC,KACvD,SAAKF,IAAQA,EAAKtC,SACVsC,EAAM,GAAIG,KCkBZ,SAASC,EAAyB3D,GACxC,MAAO,CAAED,KAAM,4BAA6BC,YAAAA,GAYtC,SAAS4D,EAA2BhE,EAAoBI,GAC9D,MAAO,CACND,KAAM,8BACNH,mBAAAA,EACAI,YAAAA,GAWK,MAAM6D,EACVP,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,MAAM,GAAEC,EAAF,KAAMxD,GAAS6C,EACrB,IAAIY,GAAU,EACdF,EAASG,iBAAkBF,GAC3B,IACCD,EAASI,gBAAiBH,GAAI,GAG9B,MAAMI,EAAMhB,EAAcC,GAC1B,IAAIE,EAAQ,GACPa,QACEC,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,YASjBjB,SANuBc,GAAAA,CAAU,CAChCC,OAAQ,OACRG,KAAM,gBACNF,KAAM,CAAEG,KAAMV,EAAIQ,OAAQ,aAGVG,OAGlBZ,EAASa,sBAAuB,IAC5BvB,EACHE,MAAO,IAAKF,EAAME,SAAUA,KAI7B,MAAMsB,EAAiB,CACtB,cACA,QACA,WACA,SACA,OACA,cACA,WACA,aACA,mBACA,eACA,WACA,SACA,UACA,cAsBD,SApBMR,GAAAA,CAAU,CACfI,MAAMK,EAAAA,EAAAA,cAAe,sBAAsBtE,IAAS,CACnDuE,QAASF,MAITG,OAAO,SACPC,MAAQC,IACDA,IAGPC,EAAAA,EAAAA,+CAA+C,CAC9C,CAAE3E,IAAQ4E,EAAAA,EAAAA,MAAMF,EAAUL,cFrEzBhB,iBAQN,MAAMqB,QAAiBb,GAAAA,CAAU,CAChCD,IAAK9B,SAAS+C,SAAS5B,KACvB6B,OAAO,IAGFf,QAAaW,EAASK,OAEtBC,GAAM,IAAI/F,OAAOgG,WAAYC,gBAAiBnB,EAAM,aAEpDoB,EAAYC,MAAMC,KACvBL,EAAIM,iBAAkB,kCACrBxF,QAAUyF,GAAWA,EAAM/B,KAAQ1B,SAAS0D,eAAgBD,EAAM/B,MAMpE,IAAM,MAAMiC,KAAYN,QACjB3D,EAAWiE,GE+CVC,IACmBpC,EACvBrC,OAAQ0E,EAAAA,OACRC,gBACsBnF,MAAQC,GAAOA,EAAEV,OAASA,IACjD,MAAM,IAAIwC,OACTqD,EAAAA,EAAAA,IAAI,qDAINvC,EAASC,SAAUuC,EAAAA,OAAeC,kBACjCC,EAAAA,EAAAA;CAECH,EAAAA,EAAAA,IAAI,iCACJhD,EAAMoD,OAEP,CACCC,OAAO,EACP5G,KAAM,aAGRmE,GAAU,EACT,MAAQ0C,GACT,IAAIhG,EAAUgG,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,sBAG/BzF,EAAU+F,aAAiB3D,MAG/B,MAAM4D,EAAiB,CACtBC,eAAeR,EAAAA,EAAAA,IACd,4DAEDS,iCAAiCT,EAAAA,EAAAA,IAChC,mEAIGO,EAAgBD,EAAMI,QAC1BnG,GAAU,EACVD,EAAUiG,EAAgBD,EAAMI,OAGjChD,EAASiD,eAAgBhD,EAAIrD,EAASC,GACtCkD,EAASC,SAAUuC,EAAAA,OAAeW,kBAAmBtG,EAAS,CAC7D+F,OAAO,EACPQ,eAAe,IAIjB,OADAnD,EAASI,gBAAiBH,GAAI,GACvBC,GAQIkD,EACV9D,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,IACC,MAAMK,EAAMhB,EAAcC,SACpBgB,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,oBAEXH,GAAAA,CAAU,CACfC,OAAQ,SACRF,IAAAA,IAEDL,EAASqD,yBAA0B/D,GAClC,MAAQsD,GACT7C,EACEC,SAAUuC,EAAAA,OACVW,kBACAN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAanB,SAASzB,EAAuBvE,GACtC,MAAO,CACNP,KAAM,2BACNO,KAAAA,GAYK,SAAS+G,EAA0B/G,GACzC,MAAO,CACNP,KAAM,8BACNO,KAAAA,GAYK,SAAS8D,EAAiB1D,EAASL,GACzC,MAAO,CACNN,KAAM,uBACNW,QAAAA,EACAL,aAAAA,GAaK,SAAS4G,EAAgBvG,EAASE,GAA2B,IAAlBC,EAAkB,wDACnE,MAAO,CACNd,KAAM,mBACNW,QAAAA,EACAE,QAAAA,EACAC,QAAAA,GAWK,SAASsD,EAAkBzD,GACjC,MAAO,CACNX,KAAM,qBACNW,QAAAA,GC1QK,MAAMY,EACVtB,GACF8D,MAAAA,IAA0B,IAAlB,SAAEE,GAAgB,EACzB,GAAOhE,EAIP,IACCgE,EAAUL,EAAyB3D,IAQnCgE,EAAUJ,SAPYU,GAAAA,CAAU,CAC/BI,KAAO,qCAAqC1E,OAEtBsH,KAAOC,IAC7BC,EAAAA,EAAAA,SAASD,GAAQ,CAAE9H,EAAOb,KAAS6I,EAAAA,EAAAA,WAAW7I,OAGFoB,IAC5C,SCPS0H,EAAc,CAC1BC,QAD0B,EAE1BC,UAF0B,EAG1BC,QAH0B,EAI1BC,UAASA,GAUGC,GAAQC,EAAAA,EAAAA,kBAvBF,uBAuBgCN,GC1BpC,SAASO,IACvB,MAAM,mBAAEb,IAAuBc,EAAAA,EAAAA,aAAaC,GAEtCC,GAAyBC,EAAAA,EAAAA,YAAa3G,IAC3C,MAAM,iBAAE4G,EAAF,aAAoBC,GAAiB7G,EAAQ8G,EAAAA,OACnD,OAAOD,MAAoBD,MACzB,IAEGG,GAAmBJ,EAAAA,EAAAA,YACtB3G,GAAYA,EAAQyG,GAAsBrG,uBAC5C,IAYD,OATA4G,EAAAA,EAAAA,YAAW,KACLN,GAA0BK,EAAiBxH,QAC/CwH,EAAiB/F,SAAWlC,IAC3B4G,EAAoB5G,IACpBmI,EAAAA,EAAAA,qBAAqBnI,EAAUC,WAG/B,CAAE2H,IAEE,MDMRQ,EAAAA,EAAAA,UAAUb,GEzCV,MAAM,EAA+BrI,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA7C,SAASmJ,IAetB,OAdAA,EAAW/J,OAAOgK,QAAU,SAAUC,GACpC,IAAK,IAAI5H,EAAI,EAAGA,EAAI6H,UAAU/H,OAAQE,IAAK,CACzC,IAAI8H,EAASD,UAAU7H,GAEvB,IAAK,IAAIvC,KAAOqK,EACVnK,OAAOM,UAAUC,eAAeC,KAAK2J,EAAQrK,KAC/CmK,EAAOnK,GAAOqK,EAAOrK,IAK3B,OAAOmK,IAGOG,MAAMC,KAAMH,WCf9B,MAAM,EAA+BtJ,OAAW,GAAgB,aCwBhE,EARA,YAA+C,IAAhC,KAAE0J,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBC,EAA+B5J,OAAW,GAAc,WCW9D,GALC,mBAAC,EAAAgK,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,qVCIV,GALC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,4dCQV,GATC,mBAAC,EAAAkL,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CACCC,SAAS,UACTtL,EAAE,+jBACFuL,SAAS,aC4CZ,EA3CA,YAA6B,IAAb,OAAEC,GAAW,EAC5B,MAAMC,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAE7BI,EAAgBF,KAAKG,MAAOL,GAC5BM,EAAgBJ,KAAKK,KAAMP,EAASI,GACpCI,EAAiB,GAAMJ,EAAgBE,GAE7C,OACC,2BACC,cAAa7D,EAAAA,EAAAA;;CAEZH,EAAAA,EAAAA,IAAI,qBACJ2D,KAGCQ,EAAAA,EAAAA,OAAOL,GAAiBjJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,2CACVtB,KAAOuB,EACPtB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOH,GAAiBnJ,IACzB,mBAAC,EAAD,CACCvC,IAAO,cAAcuC,IACrBuJ,UAAU,gDACVtB,KAAOwB,EACPvB,KAAO,QAGPoB,EAAAA,EAAAA,OAAOD,GAAkBrJ,IAC1B,mBAAC,EAAD,CACCvC,IAAO,eAAeuC,IACtBuJ,UAAU,4CACVtB,KAAOyB,EACPxB,KAAO,SCpCZ,GAN4B,QAAE,OAAEW,GAAJ,SAC3B,2BAAMU,UAAU,kCACf,mBAAC,EAAD,CAAOV,OAASA,MCOlB,GATA,YAA2C,IAAX,KAAEZ,GAAS,EAC1C,MAAMsB,EAAY,0CAClB,OAA8D,OAAvDtB,EAAK0B,MAAO,uCAClB,0BAAKJ,UAAYA,EAAYtH,IAAMgG,EAAO2B,IAAI,MAE9C,mBAAC,EAAAC,UAAD,CAAWN,UAAYA,EAAYtB,KAAOA,EAAO6B,YAAU,KCwB7D,GAvBuC,IAAiB,IAAf,MAAE3H,GAAa,EACvD,MAAM4H,GAAc7C,EAAAA,EAAAA,YACjB3G,GACDA,EAAQyG,GAAsBnG,uBAAwBsB,EAAMW,KAC7D,CAAEX,IAGH,OAAO4H,GAKN,0BAAKR,UAAU,8CACd,0BAAKA,UAAU,sDACZQ,EAAYtK,QACZsK,EAAYrK,QACX,KAAMyF,EAAAA,EAAAA,IAAI,2BACV,OATE,MCKT,SAAS6E,GAAT,KAGE,IAFD,MAAEzE,EAAF,OAASsD,EAAT,YAAiBoB,GAEhB,GADD,UAAEC,EAAF,YAAaC,EAAb,aAA0BjL,GACzB,EACD,MAAM4J,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAEnC,OAAOsB,GAAeD,GAEd5E,EAAAA,EAAAA,SAAS,wBAAwB8E,EAAAA,EAAAA,gBAAgB7E,IAGpD4E,GAEG7E,EAAAA,EAAAA,SAAS,WAAW8E,EAAAA,EAAAA,gBAAgB7E,IAGvCrG,GAEGoG,EAAAA,EAAAA,SAAS,kBAAkB8E,EAAAA,EAAAA,gBAAgB7E,IAI9C0E,EAAc,GAEX3E,EAAAA,EAAAA,SAAS,eAAe8E,EAAAA,EAAAA,gBAAgB7E,KAGzCD,EAAAA,EAAAA;;CAEN+E,EAAAA,EAAAA,IACC,6CACA,8CACAJ,IAEDG,EAAAA,EAAAA,gBAAgB7E,GAChBuD,EACAmB,GAoGF,SAhGA,YAAmE,IAA/B,UAAEK,EAAF,KAAanL,EAAb,QAAmBoL,GAAY,EAClE,MAAM,OAAEC,EAAF,YAAUC,EAAV,KAAuBxC,EAAvB,OAA6BY,EAA7B,MAAqCtD,GAAUpG,EAE/CgL,KAAiBO,EAAAA,EAAAA,cAAcvL,EAAKG,OAEpC,UAAE4K,EAAF,aAAahL,EAAb,cAA2ByL,IAAkBzD,EAAAA,EAAAA,YAChD3G,IACD,MAAM,uBAAEM,EAAwB3B,aAAc0L,GAC7CrK,EAAQyG,GACH6D,EAAShK,EAAwB1B,EAAK2D,IACtCgI,EAAWD,GAAUA,EAAOnL,QAClC,MAAO,CACNwK,YAAcW,EACd3L,aAAc0L,EAAmBzL,EAAK2D,IACtC6H,eAAiBG,KAGnB,CAAE3L,IAGH,IAAI4L,EAAa,GAOjB,OANKZ,EACJY,GAAa5F,EAAAA,EAAAA,IAAI,cACNjG,IACX6L,GAAa5F,EAAAA,EAAAA,IAAI,iBAIjB,mBAAC,0BAAD,GACC6F,2BAAyB,EACzBC,KAAK,SACLC,GAAKC,EAAAA,QACAb,EAJN,CAKCf,UAAU,+CACVgB,QAAYa,IACXA,EAAMC,iBACNd,KAEDe,OAASpM,EACTqM,SAAWrM,IAAkByL,EAC7Ba,MAAQxB,GAA2B7K,EAAM,CACxC+K,UAAAA,EACAC,YAAAA,EACAjL,aAAAA,IAEDuM,aAAc,EACdC,gBAAgB,gBAEhB,0BAAKnC,UAAU,uDACd,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,IAC3CrG,GACD,2BAAMqK,UAAU,0DACf,mBAAC,EAAAoC,QAAD,QAGD,mBAAC,GAAD,CAAc9C,OAASA,MAGzB,2BAAMU,UAAU,0DACf,2BAAMA,UAAU,wDACbqC,EAAAA,EAAAA,2BACDtG,EAAAA,EAAAA;;CAECH,EAAAA,EAAAA,IAAI,8BACJiF,EAAAA,EAAAA,gBAAgB7E,GAChBiF,GAED,CACCqB,MACC,2BAAMtC,UAAU,4DAKlBW,GACD,mBAAC,GAAD,CAAyB/H,MAAQhD,KAEjC,oCACC,2BAAMoK,UAAU,sDACVwB,IAEFX,EAAAA,EAAAA,gBAAgBK,IAElBE,KACGR,GAAejL,KAClB,mBAAC,EAAA4M,eAAD,MACG3G,EAAAA,EAAAA,IAAI,sBCrIT4G,GAAO,OA8Cb,GA5CA,YAAuE,IAAtC,MAAEC,EAAF,QAASC,EAAUF,GAAnB,SAAyBG,GAAa,EACtE,MAAM5B,GAAY6B,EAAAA,EAAAA,gCACZ,iBAAEzJ,IAAqBqE,EAAAA,EAAAA,aAAaC,GAE1C,OAAOgF,EAAMlM,QAKZ,mBAAC,sBAAD,KACMwK,EADN,CAECW,KAAK,UACL1B,UAAU,2CACV,cAAapE,EAAAA,EAAAA,IAAI,kCAEf6G,EAAM7F,KAAOhH,IAEb,mBAAC,GAAD,CACC1B,IAAM0B,EAAK2D,GACXwH,UAAYA,EACZC,QAAU,MAIJG,EAAAA,EAAAA,cAAcvL,EAAKG,MACvB4M,EAAU/M,GAEVuD,EAAkBvD,GAAO4E,MAAQhB,IAC3BA,GACJmJ,EAAU/M,MAIb8M,EAAS,OAEVA,QAAUA,EACV9M,KAAOA,OA/BJ,MCxBH,GAA+BZ,OAAW,GAAQ,KCsDxD,GA/CA,YAII,IAJsC,SACzC6N,EADyC,kBAEzCC,EAFyC,eAGzCC,GACG,EACH,MAAMC,EAAQF,EAAkBvM,OAehC,OAdAyH,EAAAA,EAAAA,YAAW,MACV/B,EAAAA,GAAAA,QACCF,EAAAA,EAAAA;;CAEC+E,EAAAA,EAAAA,IACC,+CACA,iDACAkC,GAEDA,MAGA,CAAEA,KAGJ,oCACKD,IACH,wBAAG/C,UAAU,wDACVpE,EAAAA,EAAAA,IAAI,sDAIR,0BAAKoE,UAAU,qDAEf,0BAAKA,UAAU,8CACd,0BAAKA,UAAU,sDACd,yBAAIA,UAAU,qDACXpE,EAAAA,EAAAA,IAAI,0BAEP,wBAAGoE,UAAU,2DACVpE,EAAAA,EAAAA,IACD,wDAIDiH,KCrCN,IALC,mBAAC,EAAA7D,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,EAAAC,KAAD,CAAMrL,EAAE,oLCuBV,GAvBA,WACC,OACC,oCACC,0BAAKkM,UAAU,sCACd,mBAAC,EAAD,CACCA,UAAU,yCACVtB,KAAOuE,MAER,6BAAKrH,EAAAA,EAAAA,IAAI,wBAEV,0BAAKoE,UAAU,gCACd,mBAAC,EAAAkD,IAAD,MACGtH,EAAAA,EAAAA,IAAI,2CACN,+BACA,mBAAC,EAAAuH,aAAD,CAAcnK,KAAK,kDAChB4C,EAAAA,EAAAA,IAAI,oBADP,SCkDL,IAAewH,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAErM,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAegO,EAAe,MAAY,EAC/D,MAAM,sBAAE1M,EAAF,+BAAyBD,GAC9BK,EAAQyG,IACH,mBAAE8F,GAAuBvM,EAAQE,EAAAA,OAEjCsM,EAAgBxM,EAAQyM,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNZ,kBANyBU,EALlB5M,EAMiBtB,GANaO,QAAU+C,GAC9C2K,EAAoB3K,EAAO0K,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiBhN,EAAgCrB,QApBpD,EArDA,YAQI,IAR8B,kBACjCwN,EADiC,SAEjCH,EAFiC,QAGjCD,EAHiC,eAIjCK,EAJiC,cAKjCS,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBT,IACpB,oCACC,wBAAG/C,UAAU,wDACVpE,EAAAA,EAAAA,IACD,sDAGF,0BAAKoE,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAoC,QAAD,SAMC,IAAUoB,EACPT,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkBvM,QAC3B,mBAAC,GAAD,CACCuM,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCN,MAAQK,EACRH,SAAWA,EACXD,QAAUA,MAIVK,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQc,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHvB,EADG,QAEHD,EAFG,YAGHpN,EAHG,SAIH6O,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyBvO,GAC7B0O,EAAyB1O,GAGnBuO,GAKN,mBAAC,GAAD,CACClB,SAAWA,EACXD,QAAUA,EACVY,aAAeA,EACfhO,YAAcuO,EACdd,eAAiBoB,EACjBP,SAAWtO,IAAgBuO,IAVrB,SClCN,GAA+B7O,OAAW,GAAY,SCU7C,SAASoP,GAAT,GAAkC,IAAZ,MAAE3B,GAAU,EAChD,OAAOA,EAAMlM,QAKZ,yBAAIyJ,UAAU,gCACXyC,EAAM7F,KAAK,QAAE,KAAE8B,EAAF,GAAQnF,EAAR,MAAYyC,EAAZ,OAAmBiF,GAArB,SACZ,yBAAI/M,IAAMqF,EAAKyG,UAAU,uCACxB,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO1C,MAAQA,KAE7C,0BAAKgE,UAAU,+CACd,0BAAKA,UAAU,4CACZhE,IAEH,0BAAKgE,UAAU,8CACZjE,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,SACJqF,UAjBC,KCEM,SAASoD,KACvB,MAAMC,GAAgB3G,EAAAA,EAAAA,YACnB3G,GAAYA,EAAQyG,GAAsB3G,oBAC5C,IAGD,OAAOwN,EAAc/N,QAKpB,mBAAC,GAAAgO,sBAAD,CACC7F,KAAOuE,GACPjH,OAAQD,EAAAA,EAAAA;CAEP+E,EAAAA,EAAAA,IACC,kBACA,mBACAwD,EAAc/N,QAEf+N,EAAc/N,QAEfiO,aAAc,IAEd,wBAAGxE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAwD,EAAc/N,UAGhB,mBAAC6N,GAAD,CAAa3B,MAAQ6B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAc9L,EAAd,SAAqB+L,GAAa,EACxE,MAAMC,GAAoBjH,EAAAA,EAAAA,YACvB3G,GAAYA,EAAQyG,GAAsB9H,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqBqE,EAAAA,EAAAA,aAAaC,IACpC,aAAEoH,IAAiBrH,EAAAA,EAAAA,aAAatG,EAAAA,OAEtC,OACC,mBAAC,EAAA0K,OAAD,CACCZ,QAAU,IACT7H,EAAkBP,GAAQ4B,MAAQhB,IACjC,GAAKA,EAAU,CACd,MAAM1D,GAAYqL,EAAAA,EAAAA,cAAcvI,EAAM7C,OAC9B+O,IAAkBjK,EAAAA,EAAAA,OACzB6J,EAAWK,iBAEPD,GAAiBhP,GACrB+O,EACCF,GACAK,EAAAA,EAAAA,aACClP,EAAUC,KACV+O,EAAcJ,WACdI,EAAcpO,kBAOpBsL,SAAW4C,EACX7C,OAAS6C,EACTK,QAAQ,YAENlJ,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BMkJ,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkBlG,GAAa,EAC1D,MAAM,aAAEuG,EAAF,2BAAgBC,GAA+BxG,EAAM8F,YACrD,aAAEG,IAAiBrH,EAAAA,EAAAA,aAAatG,EAAAA,OAUhCmO,IAAgBD,EAChBE,GAAenE,EAAAA,EAAAA,cAAc,aAEnC,IAAIoE,GAAcxJ,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAEDkJ,EAAc9I,OAASmJ,GAExB,MAAMhI,EAAU,EACf,mBAACsH,GAAD,CACCvQ,IAAI,UACJ0E,MAAQkM,EACRJ,WAAa9F,EAAM8F,WACnBC,SAAW/F,EAAM+F,YAmBnB,OAfKU,GAAcC,IAClBC,GAAcxJ,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAEDkJ,EAAc9I,OAASmJ,GAExBhI,EAAQqI,MACP,mBAAC,EAAA5D,OAAD,CAAQ1N,IAAI,UAAU8M,QArCF,KACrB6D,EACCjG,EAAM+F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDrJ,EAAAA,EAAAA,IAAI,oBAMR,0BAAU8J,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASxI,QAAUA,GAAYoI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACvI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC8G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAUjQ,KACX,MAAc,iBAATA,IAGLiQ,EAASC,MDZiBC,ECYSF,EAASC,KDZOrH,IACpD,MAAM,aAAEuG,GAAiBvG,EAAM8F,YAGzB,MAAE9L,EAAF,cAAS4K,IAAkB7F,EAAAA,EAAAA,YAC9B3G,IACD,MAAM,sBAAEJ,GAA0BI,EAAQyG,GACpCnH,EAASM,EACd,SAAWuO,GACVtP,QAAQ,QAAE,KAAEE,GAAJ,SAAgBoP,IAAiBpP,KAC3C,MAAO,CACNyN,cAAexM,EAAQyM,EAAAA,OAAYC,QAClC,OACA,0BAED9K,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAE6O,IAIH,OAAO3B,GAAmB5K,GAInB,mBAACsM,GAAD,KAAsBtG,EAAtB,CAA8BkG,cAAgBlM,MAH7C,mBAACsN,EAAuBtH,MCbvBoH,EDVkBE,IAAAA,M","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/compat get default export","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"plugins\"]","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/external window [\"wp\",\"editor\"]","webpack://wp/external window \"lodash\"","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blockEditor\"]","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/has-block-type.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/selectors.js","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/external window [\"wp\",\"apiFetch\"]","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/load-assets.js","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/get-plugin-url.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/actions.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/resolvers.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/index.js","webpack://wp/./packages/block-directory/build-module/components/auto-block-uninstaller/@wordpress/block-directory/src/components/auto-block-uninstaller/index.js","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://wp/external window [\"wp\",\"htmlEntities\"]","webpack://wp/./packages/icons/build-module/icon/@wordpress/icons/src/icon/index.js","webpack://wp/external window [\"wp\",\"primitives\"]","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-filled.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-half.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-empty.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/stars.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-icon/@wordpress/block-directory/src/components/downloadable-block-icon/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-notice/@wordpress/block-directory/src/components/downloadable-block-notice/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-list-item/@wordpress/block-directory/src/components/downloadable-block-list-item/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-list/@wordpress/block-directory/src/components/downloadable-blocks-list/index.js","webpack://wp/external window [\"wp\",\"a11y\"]","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/inserter-panel.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/block-default.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js","webpack://wp/external window [\"wp\",\"editPost\"]","webpack://wp/./packages/block-directory/build-module/components/compact-list/@wordpress/block-directory/src/components/compact-list/index.js","webpack://wp/./packages/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/install-button.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/index.js","webpack://wp/./packages/block-directory/build-module/plugins/@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\n\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\treturn omit( state, action.blockId );\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Check if a block list contains a specific block type. Recursively searches\n * through `innerBlocks` if they exist.\n *\n * @param {Object} blockType A block object to search for.\n * @param {Object[]} blocks The list of blocks to look through.\n *\n * @return {boolean} Whether the blockType is found.\n */\nexport default function hasBlockType( blockType, blocks = [] ) {\n\tif ( ! blocks.length ) {\n\t\treturn false;\n\t}\n\tif ( blocks.some( ( { name } ) => name === blockType.name ) ) {\n\t\treturn true;\n\t}\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( hasBlockType( blockType, blocks[ i ].innerBlocks ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport hasBlockType from './utils/has-block-type';\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? [];\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter( ( blockType ) =>\n\t\t\thasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter(\n\t\t\t( blockType ) => ! hasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Load an asset for a block.\n *\n * This function returns a Promise that will resolve once the asset is loaded,\n * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.\n *\n * @param {HTMLElement} el A HTML Element asset to inject.\n *\n * @return {Promise} Promise which will resolve when the asset is loaded.\n */\nexport const loadAsset = ( el ) => {\n\treturn new Promise( ( resolve, reject ) => {\n\t\t/*\n\t\t * Reconstruct the passed element, this is required as inserting the Node directly\n\t\t * won't always fire the required onload events, even if the asset wasn't already loaded.\n\t\t */\n\t\tconst newNode = document.createElement( el.nodeName );\n\n\t\t[ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => {\n\t\t\tif ( el[ attr ] ) {\n\t\t\t\tnewNode[ attr ] = el[ attr ];\n\t\t\t}\n\t\t} );\n\n\t\t// Append inline <script> contents.\n\t\tif ( el.innerHTML ) {\n\t\t\tnewNode.appendChild( document.createTextNode( el.innerHTML ) );\n\t\t}\n\n\t\tnewNode.onload = () => resolve( true );\n\t\tnewNode.onerror = () => reject( new Error( 'Error loading asset.' ) );\n\n\t\tdocument.body.appendChild( newNode );\n\n\t\t// Resolve Stylesheets and Inline JavaScript immediately.\n\t\tif (\n\t\t\t'link' === newNode.nodeName.toLowerCase() ||\n\t\t\t( 'script' === newNode.nodeName.toLowerCase() && ! newNode.src )\n\t\t) {\n\t\t\tresolve();\n\t\t}\n\t} );\n};\n\n/**\n * Load the asset files for a block\n */\nexport async function loadAssets() {\n\t/*\n\t * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the\n\t * JavaScript and CSS assets loaded between the pages. This imports the required assets\n\t * for the block into the current page while not requiring that we know them up-front.\n\t * In the future this can be improved by reliance upon block.json and/or a script-loader\n\t * dependency API.\n\t */\n\tconst response = await apiFetch( {\n\t\turl: document.location.href,\n\t\tparse: false,\n\t} );\n\n\tconst data = await response.text();\n\n\tconst doc = new window.DOMParser().parseFromString( data, 'text/html' );\n\n\tconst newAssets = Array.from(\n\t\tdoc.querySelectorAll( 'link[rel=\"stylesheet\"],script' )\n\t).filter( ( asset ) => asset.id && ! document.getElementById( asset.id ) );\n\n\t/*\n\t * Load each asset in order, as they may depend upon an earlier loaded script.\n\t * Stylesheets and Inline Scripts will resolve immediately upon insertion.\n\t */\n\tfor ( const newAsset of newAssets ) {\n\t\tawait loadAsset( newAsset );\n\t}\n}\n","/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n","/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as blocksStore,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { loadAssets } from './load-assets';\nimport getPluginUrl from './utils/get-plugin-url';\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been requested and are loading.\n *\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function fetchDownloadableBlocks( filterValue ) {\n\treturn { type: 'FETCH_DOWNLOADABLE_BLOCKS', filterValue };\n}\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been updated.\n *\n * @param {Array} downloadableBlocks Downloadable blocks.\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function receiveDownloadableBlocks( downloadableBlocks, filterValue ) {\n\treturn {\n\t\ttype: 'RECEIVE_DOWNLOADABLE_BLOCKS',\n\t\tdownloadableBlocks,\n\t\tfilterValue,\n\t};\n}\n\n/**\n * Action triggered to install a block plugin.\n *\n * @param {Object} block The block item returned by search.\n *\n * @return {boolean} Whether the block was successfully installed & loaded.\n */\nexport const installBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\tconst { id, name } = block;\n\t\tlet success = false;\n\t\tdispatch.clearErrorNotice( id );\n\t\ttry {\n\t\t\tdispatch.setIsInstalling( id, true );\n\n\t\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tlet links = {};\n\t\t\tif ( url ) {\n\t\t\t\tawait apiFetch( {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\turl,\n\t\t\t\t\tdata: { status: 'active' },\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tconst response = await apiFetch( {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t\t} );\n\t\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\t\tlinks = response._links;\n\t\t\t}\n\n\t\t\tdispatch.addInstalledBlockType( {\n\t\t\t\t...block,\n\t\t\t\tlinks: { ...block.links, ...links },\n\t\t\t} );\n\n\t\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\t\tconst metadataFields = [\n\t\t\t\t'api_version',\n\t\t\t\t'title',\n\t\t\t\t'category',\n\t\t\t\t'parent',\n\t\t\t\t'icon',\n\t\t\t\t'description',\n\t\t\t\t'keywords',\n\t\t\t\t'attributes',\n\t\t\t\t'provides_context',\n\t\t\t\t'uses_context',\n\t\t\t\t'supports',\n\t\t\t\t'styles',\n\t\t\t\t'example',\n\t\t\t\t'variations',\n\t\t\t];\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t\t_fields: metadataFields,\n\t\t\t\t} ),\n\t\t\t} )\n\t\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t\t.catch( () => {} )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( ! response ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\tawait loadAssets();\n\t\t\tconst registeredBlocks = registry\n\t\t\t\t.select( blocksStore )\n\t\t\t\t.getBlockTypes();\n\t\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s is the block title.\n\t\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\t\tblock.title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tspeak: true,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\tsuccess = true;\n\t\t} catch ( error ) {\n\t\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t\t// Errors we throw are fatal.\n\t\t\tlet isFatal = error instanceof Error;\n\n\t\t\t// Specific API errors that are fatal.\n\t\t\tconst fatalAPIErrors = {\n\t\t\t\tfolder_exists: __(\n\t\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t\t),\n\t\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\t\tisFatal = true;\n\t\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t\t}\n\n\t\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\t\tspeak: true,\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t}\n\t\tdispatch.setIsInstalling( id, false );\n\t\treturn success;\n\t};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\ttry {\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'inactive' },\n\t\t\t} );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\turl,\n\t\t\t} );\n\t\t\tdispatch.removeInstalledBlockType( block );\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\terror.message || __( 'An error occurred.' )\n\t\t\t\t);\n\t\t}\n\t};\n\n/**\n * Returns an action object used to add a block type to the \"newly installed\"\n * tracking list.\n *\n * @param {Object} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function addInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'ADD_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to remove a block type from the \"newly installed\"\n * tracking list.\n *\n * @param {string} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function removeInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'REMOVE_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to indicate install in progress.\n *\n * @param {string} blockId\n * @param {boolean} isInstalling\n *\n * @return {Object} Action object.\n */\nexport function setIsInstalling( blockId, isInstalling ) {\n\treturn {\n\t\ttype: 'SET_INSTALLING_BLOCK',\n\t\tblockId,\n\t\tisInstalling,\n\t};\n}\n\n/**\n * Sets an error notice to be displayed to the user for a given block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n * @param {string} message The message shown in the notice.\n * @param {boolean} isFatal Whether the user can recover from the error.\n *\n * @return {Object} Action object.\n */\nexport function setErrorNotice( blockId, message, isFatal = false ) {\n\treturn {\n\t\ttype: 'SET_ERROR_NOTICE',\n\t\tblockId,\n\t\tmessage,\n\t\tisFatal,\n\t};\n}\n\n/**\n * Sets the error notice to empty for specific block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {Object} Action object.\n */\nexport function clearErrorNotice( blockId ) {\n\treturn {\n\t\ttype: 'CLEAR_ERROR_NOTICE',\n\t\tblockId,\n\t};\n}\n","/**\n * External dependencies\n */\nimport { camelCase, mapKeys } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks =\n\t( filterValue ) =>\n\tasync ( { dispatch } ) => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\t\tconst results = await apiFetch( {\n\t\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t\t} );\n\t\t\tconst blocks = results.map( ( result ) =>\n\t\t\t\tmapKeys( result, ( value, key ) => camelCase( key ) )\n\t\t\t);\n\n\t\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t\t} catch {}\n\t};\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\n\n/**\n * Module Constants\n */\nconst STORE_NAME = 'core/block-directory';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tresolvers,\n};\n\n/**\n * Store definition for the block directory namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\nregister( store );\n","/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props } ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t} );\n}\n\nexport default Icon;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starFilled = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\" />\n\t</SVG>\n);\n\nexport default starFilled;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starHalf = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z\" />\n\t</SVG>\n);\n\nexport default starHalf;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starEmpty = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\td=\"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z\"\n\t\t\tclipRule=\"evenodd\"\n\t\t/>\n\t</SVG>\n);\n\nexport default starEmpty;\n","/**\n * External dependencies\n */\nimport { times } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ times( fullStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( halfStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ times( emptyStarCount, ( i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n","/**\n * Internal dependencies\n */\nimport Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n","/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport const DownloadableBlockNotice = ( { block } ) => {\n\tconst errorNotice = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockDirectoryStore ).getErrorNoticeForBlock( block.id ),\n\t\t[ block ]\n\t);\n\n\tif ( ! errorNotice ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-directory-downloadable-block-notice\">\n\t\t\t<div className=\"block-directory-downloadable-block-notice__content\">\n\t\t\t\t{ errorNotice.message }\n\t\t\t\t{ errorNotice.isFatal\n\t\t\t\t\t? ' ' + __( 'Try reloading the page.' )\n\t\t\t\t\t: null }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DownloadableBlockNotice;\n","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tSpinner,\n\tVisuallyHidden,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockRatings from '../block-ratings';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\nimport DownloadableBlockNotice from '../downloadable-block-notice';\nimport { store as blockDirectoryStore } from '../../store';\n\n// Return the appropriate block item label, given the block data and status.\nfunction getDownloadableBlockLabel(\n\t{ title, rating, ratingCount },\n\t{ hasNotice, isInstalled, isInstalling }\n) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tif ( ! isInstalled && hasNotice ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Retry installing %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalled ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Add %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalling ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Installing %s.', decodeEntities( title ) );\n\t}\n\n\t// No ratings yet, just use the title.\n\tif ( ratingCount < 1 ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Install %s.', decodeEntities( title ) );\n\t}\n\n\treturn sprintf(\n\t\t/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */\n\t\t_n(\n\t\t\t'Install %1$s. %2$s stars with %3$s review.',\n\t\t\t'Install %1$s. %2$s stars with %3$s reviews.',\n\t\t\tratingCount\n\t\t),\n\t\tdecodeEntities( title ),\n\t\tstars,\n\t\tratingCount\n\t);\n}\n\nfunction DownloadableBlockListItem( { composite, item, onClick } ) {\n\tconst { author, description, icon, rating, title } = item;\n\t// getBlockType returns a block object if this block exists, or null if not.\n\tconst isInstalled = !! getBlockType( item.name );\n\n\tconst { hasNotice, isInstalling, isInstallable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getErrorNoticeForBlock, isInstalling: isBlockInstalling } =\n\t\t\t\tselect( blockDirectoryStore );\n\t\t\tconst notice = getErrorNoticeForBlock( item.id );\n\t\t\tconst hasFatal = notice && notice.isFatal;\n\t\t\treturn {\n\t\t\t\thasNotice: !! notice,\n\t\t\t\tisInstalling: isBlockInstalling( item.id ),\n\t\t\t\tisInstallable: ! hasFatal,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\n\tlet statusText = '';\n\tif ( isInstalled ) {\n\t\tstatusText = __( 'Installed!' );\n\t} else if ( isInstalling ) {\n\t\tstatusText = __( 'Installing…' );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\t__experimentalIsFocusable\n\t\t\trole=\"option\"\n\t\t\tas={ Button }\n\t\t\t{ ...composite }\n\t\t\tclassName=\"block-directory-downloadable-block-list-item\"\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tisBusy={ isInstalling }\n\t\t\tdisabled={ isInstalling || ! isInstallable }\n\t\t\tlabel={ getDownloadableBlockLabel( item, {\n\t\t\t\thasNotice,\n\t\t\t\tisInstalled,\n\t\t\t\tisInstalling,\n\t\t\t} ) }\n\t\t\tshowTooltip={ true }\n\t\t\ttooltipPosition=\"top center\"\n\t\t>\n\t\t\t<div className=\"block-directory-downloadable-block-list-item__icon\">\n\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\t\t\t\t{ isInstalling ? (\n\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__spinner\">\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockRatings rating={ rating } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<span className=\"block-directory-downloadable-block-list-item__details\">\n\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__title\">\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %1$s: block title, %2$s: author name. */\n\t\t\t\t\t\t\t__( '%1$s <span>by %2$s</span>' ),\n\t\t\t\t\t\t\tdecodeEntities( title ),\n\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__author\" />\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t\t{ hasNotice ? (\n\t\t\t\t\t<DownloadableBlockNotice block={ item } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__desc\">\n\t\t\t\t\t\t\t{ !! statusText\n\t\t\t\t\t\t\t\t? statusText\n\t\t\t\t\t\t\t\t: decodeEntities( description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isInstallable &&\n\t\t\t\t\t\t\t! ( isInstalled || isInstalling ) && (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'Install block' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</CompositeItem>\n\t);\n}\n\nexport default DownloadableBlockListItem;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockListItem from '../downloadable-block-list-item';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst noop = () => {};\n\nfunction DownloadableBlocksList( { items, onHover = noop, onSelect } ) {\n\tconst composite = useCompositeState();\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-directory-downloadable-blocks-list\"\n\t\t\taria-label={ __( 'Blocks available for install' ) }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlockListItem\n\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Check if the block is registered (`getBlockType`\n\t\t\t\t\t\t\t// will return an object). If so, insert the block.\n\t\t\t\t\t\t\t// This prevents installing existing plugins.\n\t\t\t\t\t\t\tif ( getBlockType( item.name ) ) {\n\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinstallBlockType( item ).then( ( success ) => {\n\t\t\t\t\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default DownloadableBlocksList;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst blockDefault = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z\" />\n\t</SVG>\n);\n\nexport default blockDefault;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t/>\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksPanel( {\n\tdownloadableItems,\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\thasPermission,\n\tisLoading,\n\tisTyping,\n} ) {\n\tif ( typeof hasPermission === 'undefined' || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn !! downloadableItems.length ? (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableItems }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableItems }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t) : (\n\t\t! hasLocalBlocks && <DownloadableBlocksNoResults />\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select, { filterValue, rootClientId = null } ) => {\n\t\tconst { getDownloadableBlocks, isRequestingDownloadableBlocks } =\n\t\t\tselect( blockDirectoryStore );\n\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\n\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t'read',\n\t\t\t'block-directory/search'\n\t\t);\n\n\t\tfunction getInstallableBlocks( term ) {\n\t\t\treturn getDownloadableBlocks( term ).filter( ( block ) =>\n\t\t\t\tcanInsertBlockType( block, rootClientId, true )\n\t\t\t);\n\t\t}\n\n\t\tconst downloadableItems = hasPermission\n\t\t\t? getInstallableBlocks( filterValue )\n\t\t\t: [];\n\t\tconst isLoading = isRequestingDownloadableBlocks( filterValue );\n\n\t\treturn {\n\t\t\tdownloadableItems,\n\t\t\thasPermission,\n\t\t\tisLoading,\n\t\t};\n\t} ),\n] )( DownloadableBlocksPanel );\n","/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( {\n\t\t\t\tonSelect,\n\t\t\t\tonHover,\n\t\t\t\tfilterValue,\n\t\t\t\thasItems,\n\t\t\t\trootClientId,\n\t\t\t} ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ticon={ blockDefault }\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen={ true }\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent } = props.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } variant=\"link\">\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n","/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","omit","hasBlockType","blocks","length","some","i","innerBlocks","isRequestingDownloadableBlocks","getDownloadableBlocks","getInstalledBlockTypes","getNewBlockTypes","createRegistrySelector","select","usedBlockTree","blockEditorStore","getBlocks","getUnusedBlockTypes","getErrorNotices","getErrorNoticeForBlock","loadAsset","el","Promise","resolve","reject","newNode","document","createElement","nodeName","forEach","attr","innerHTML","appendChild","createTextNode","onload","onerror","Error","body","toLowerCase","src","getPluginUrl","block","link","links","self","href","fetchDownloadableBlocks","receiveDownloadableBlocks","installBlockType","async","registry","dispatch","id","success","clearErrorNotice","setIsInstalling","url","apiFetch","method","data","status","path","slug","_links","addInstalledBlockType","metadataFields","addQueryArgs","_fields","catch","then","response","unstable__bootstrapServerSideBlockDefinitions","pick","location","parse","text","doc","DOMParser","parseFromString","newAssets","Array","from","querySelectorAll","asset","getElementById","newAsset","loadAssets","blocksStore","getBlockTypes","__","noticesStore","createInfoNotice","sprintf","title","speak","error","fatalAPIErrors","folder_exists","unable_to_connect_to_filesystem","code","setErrorNotice","createErrorNotice","isDismissible","uninstallBlockType","removeInstalledBlockType","map","result","mapKeys","camelCase","storeConfig","reducer","selectors","actions","resolvers","store","createReduxStore","AutoBlockUninstaller","useDispatch","blockDirectoryStore","shouldRemoveBlockTypes","useSelect","isAutosavingPost","isSavingPost","editorStore","unusedBlockTypes","useEffect","unregisterBlockType","register","_extends","assign","target","arguments","source","apply","this","icon","size","props","cloneElement","width","height","SVG","xmlns","viewBox","Path","fillRule","clipRule","rating","stars","Math","round","fullStarCount","floor","halfStarCount","ceil","emptyStarCount","times","className","starFilled","starHalf","starEmpty","match","alt","BlockIcon","showColors","errorNotice","getDownloadableBlockLabel","ratingCount","hasNotice","isInstalled","decodeEntities","_n","composite","onClick","author","description","getBlockType","isInstallable","isBlockInstalling","notice","hasFatal","statusText","__experimentalIsFocusable","role","as","Button","event","preventDefault","isBusy","disabled","label","showTooltip","tooltipPosition","Spinner","createInterpolateElement","span","VisuallyHidden","noop","items","onHover","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","Tip","ExternalLink","compose","withSelect","rootClientId","canInsertBlockType","hasPermission","coreStore","canUser","isLoading","isTyping","debouncedFilterValue","setFilterValue","useState","debouncedSetFilterValue","debounce","__unstableInserterMenuExtension","hasItems","CompactList","InstalledBlocksPrePublishPanel","newBlockTypes","PluginPrePublishPanel","initialOpen","InstallButton","attributes","clientId","isInstallingBlock","replaceBlock","originalBlock","originalContent","createBlock","variant","ModifiedWarning","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","messageHTML","push","content","useBlockProps","Warning","RawHTML","registerPlugin","render","addFilter","settings","edit","OriginalComponent"],"sourceRoot":""}
|
1 |
+
{"version":3,"file":"./build/block-directory/index.min.js","mappings":"mBACA,IAAIA,EAAsB,CCA1B,EAAyBC,IACxB,IAAIC,EAASD,GAAUA,EAAOE,WAC7B,IAAOF,EAAiB,QACxB,IAAM,EAEP,OADAD,EAAoBI,EAAEF,EAAQ,CAAEG,EAAGH,IAC5BA,GCLR,EAAwB,CAACI,EAASC,KACjC,IAAI,IAAIC,KAAOD,EACXP,EAAoBS,EAAEF,EAAYC,KAASR,EAAoBS,EAAEH,EAASE,IAC5EE,OAAOC,eAAeL,EAASE,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,MCJ3E,EAAwB,CAACM,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClF,EAAyBT,IACH,oBAAXa,QAA0BA,OAAOC,aAC1CV,OAAOC,eAAeL,EAASa,OAAOC,YAAa,CAAEC,MAAO,WAE7DX,OAAOC,eAAeL,EAAS,aAAc,CAAEe,OAAO,M,wkBCLvD,MAAM,EAA+BC,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAS,MCAnD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAU,OCApD,EAA+BA,OAAe,OC2GpD,GAAeC,EAAAA,EAAAA,iBAAiB,CAC/BC,mBAzFiC,WAA0B,IAAxBC,EAAwB,uDAAhB,GAAIC,EAAY,uCAC3D,OAASA,EAAOC,MACf,IAAK,4BACJ,MAAO,IACHF,EACH,CAAEC,EAAOE,aAAe,CACvBC,cAAc,IAGjB,IAAK,8BACJ,MAAO,IACHJ,EACH,CAAEC,EAAOE,aAAe,CACvBE,QAASJ,EAAOF,mBAChBK,cAAc,IAIlB,OAAOJ,GAwEPM,gBA7D8B,WAM1B,IALJN,EAKI,uDALI,CACPO,oBAAqB,GACrBC,aAAc,IAEfP,EACI,uCACJ,OAASA,EAAOC,MACf,IAAK,2BACJ,MAAO,IACHF,EACHO,oBAAqB,IACjBP,EAAMO,oBACTN,EAAOQ,OAGV,IAAK,8BACJ,MAAO,IACHT,EACHO,oBAAqBP,EAAMO,oBAAoBG,QAC5CC,GAAeA,EAAUC,OAASX,EAAOQ,KAAKG,QAGnD,IAAK,uBACJ,MAAO,IACHZ,EACHQ,aAAc,IACVR,EAAMQ,aACT,CAAEP,EAAOY,SAAWZ,EAAOO,eAI/B,OAAOR,GA8BPc,aAnB2B,WAA0B,IAAxBd,EAAwB,uDAAhB,GAAIC,EAAY,uCACrD,OAASA,EAAOC,MACf,IAAK,mBACJ,MAAO,IACHF,EACH,CAAEC,EAAOY,SAAW,CACnBE,QAASd,EAAOc,QAChBC,QAASf,EAAOe,UAGnB,IAAK,qBACJ,OAAOC,EAAAA,EAAAA,MAAMjB,EAAOC,EAAOY,SAE7B,OAAOb,KCxGF,EAA+BH,OAAW,GAAe,YCShD,SAASqB,EAAcP,GAAyB,IAAdQ,EAAc,uDAAL,GACzD,IAAOA,EAAOC,OACb,OAAO,EAER,GAAKD,EAAOE,MAAM,QAAE,KAAET,GAAJ,SAAgBA,IAASD,EAAUC,QACpD,OAAO,EAER,IAAM,IAAIU,EAAI,EAAGA,EAAIH,EAAOC,OAAQE,IACnC,GAAKJ,EAAcP,EAAWQ,EAAQG,GAAIC,aACzC,OAAO,EAIT,OAAO,ECHD,SAASC,EAAgCxB,EAAOG,GAAc,QACpE,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCC,oBAAhD,SAWM,SAASqB,EAAuBzB,EAAOG,GAAc,QAC3D,2BAAOH,EAAMD,mBAAoBI,UAAjC,aAAO,EAAyCE,eAAhD,QAA2D,GAWrD,SAASqB,EAAwB1B,GACvC,OAAOA,EAAMM,gBAAgBC,oBAWvB,MAAMoB,GAAmBC,EAAAA,EAAAA,yBAC7BC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QAAUC,GACpCO,EAAcP,EAAWmB,QAafG,GAAsBL,EAAAA,EAAAA,yBAChCC,GAAc7B,IACf,MAAM8B,EAAgBD,EAAQE,EAAAA,OAAmBC,YAGjD,OAF4BN,EAAwB1B,GAEzBU,QACxBC,IAAiBO,EAAcP,EAAWmB,QAaxC,SAAStB,EAAcR,EAAOa,GACpC,OAAOb,EAAMM,gBAAgBE,aAAcK,KAAa,EAUlD,SAASqB,EAAiBlC,GAChC,OAAOA,EAAMc,aAWP,SAASqB,EAAwBnC,EAAOa,GAC9C,OAAOb,EAAMc,aAAcD,GCrH5B,MAAM,EAA+BhB,OAAW,GAAQ,KCAlD,EAA+BA,OAAW,GAAY,S,aCA5D,MAAM,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAO,ICe1CuC,EAAcC,GACnB,IAAIC,SAAS,CAAEC,EAASC,KAK9B,MAAMC,EAAUC,SAASC,cAAeN,EAAGO,UAE3C,CAAE,KAAM,MAAO,MAAO,OAAQ,QAASC,SAAWC,IAC5CT,EAAIS,KACRL,EAASK,GAAST,EAAIS,OAKnBT,EAAGU,WACPN,EAAQO,YAAaN,SAASO,eAAgBZ,EAAGU,YAGlDN,EAAQS,OAAS,IAAMX,GAAS,GAChCE,EAAQU,QAAU,IAAMX,EAAQ,IAAIY,MAAO,yBAE3CV,SAASW,KAAKL,YAAaP,IAI1B,SAAWA,EAAQG,SAASU,eAC1B,WAAab,EAAQG,SAASU,gBAAmBb,EAAQc,MAE3DhB,OCrCY,SAASiB,EAAcC,GACrC,IAAOA,EACN,OAAO,EAER,MAAMC,EAAOD,EAAME,MAAO,cAAiBF,EAAME,MAAMC,KACvD,SAAKF,IAAQA,EAAKtC,SACVsC,EAAM,GAAIG,KCkBZ,SAASC,EAAyB3D,GACxC,MAAO,CAAED,KAAM,4BAA6BC,YAAAA,GAYtC,SAAS4D,EAA2BhE,EAAoBI,GAC9D,MAAO,CACND,KAAM,8BACNH,mBAAAA,EACAI,YAAAA,GAWK,MAAM6D,EACVP,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,MAAM,GAAEC,EAAF,KAAMxD,GAAS6C,EACrB,IAAIY,GAAU,EACdF,EAASG,iBAAkBF,GAC3B,IACCD,EAASI,gBAAiBH,GAAI,GAG9B,MAAMI,EAAMhB,EAAcC,GAC1B,IAAIE,EAAQ,GACPa,QACEC,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,YASjBjB,SANuBc,GAAAA,CAAU,CAChCC,OAAQ,OACRG,KAAM,gBACNF,KAAM,CAAEG,KAAMV,EAAIQ,OAAQ,aAGVG,OAGlBZ,EAASa,sBAAuB,IAC5BvB,EACHE,MAAO,IAAKF,EAAME,SAAUA,KAI7B,MAAMsB,EAAiB,CACtB,cACA,QACA,WACA,SACA,OACA,cACA,WACA,aACA,mBACA,eACA,WACA,SACA,UACA,cAsBD,SApBMR,GAAAA,CAAU,CACfI,MAAMK,EAAAA,EAAAA,cAAe,sBAAsBtE,IAAS,CACnDuE,QAASF,MAITG,OAAO,SACPC,MAAQC,IACDA,IAGPC,EAAAA,EAAAA,+CAA+C,CAC9C,CAAE3E,IAAQ4E,EAAAA,EAAAA,MAAMF,EAAUL,cFrEzBhB,iBAQN,MAAMqB,QAAiBb,GAAAA,CAAU,CAChCD,IAAK9B,SAAS+C,SAAS5B,KACvB6B,OAAO,IAGFf,QAAaW,EAASK,OAEtBC,GAAM,IAAI/F,OAAOgG,WAAYC,gBAAiBnB,EAAM,aAEpDoB,EAAYC,MAAMC,KACvBL,EAAIM,iBAAkB,kCACrBxF,QAAUyF,GAAWA,EAAM/B,KAAQ1B,SAAS0D,eAAgBD,EAAM/B,MAMpE,IAAM,MAAMiC,KAAYN,QACjB3D,EAAWiE,GE+CVC,IACmBpC,EACvBrC,OAAQ0E,EAAAA,OACRC,gBACsBnF,MAAQC,GAAOA,EAAEV,OAASA,IACjD,MAAM,IAAIwC,OACTqD,EAAAA,EAAAA,IAAI,qDAINvC,EAASC,SAAUuC,EAAAA,OAAeC,kBACjCC,EAAAA,EAAAA;CAECH,EAAAA,EAAAA,IAAI,iCACJhD,EAAMoD,OAEP,CACCC,OAAO,EACP5G,KAAM,aAGRmE,GAAU,EACT,MAAQ0C,GACT,IAAIhG,EAAUgG,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,sBAG/BzF,EAAU+F,aAAiB3D,MAG/B,MAAM4D,EAAiB,CACtBC,eAAeR,EAAAA,EAAAA,IACd,4DAEDS,iCAAiCT,EAAAA,EAAAA,IAChC,mEAIGO,EAAgBD,EAAMI,QAC1BnG,GAAU,EACVD,EAAUiG,EAAgBD,EAAMI,OAGjChD,EAASiD,eAAgBhD,EAAIrD,EAASC,GACtCkD,EAASC,SAAUuC,EAAAA,OAAeW,kBAAmBtG,EAAS,CAC7D+F,OAAO,EACPQ,eAAe,IAIjB,OADAnD,EAASI,gBAAiBH,GAAI,GACvBC,GAQIkD,EACV9D,GACFQ,MAAAA,IAAoC,IAA5B,SAAEC,EAAF,SAAYC,GAAgB,EACnC,IACC,MAAMK,EAAMhB,EAAcC,SACpBgB,GAAAA,CAAU,CACfC,OAAQ,MACRF,IAAAA,EACAG,KAAM,CAAEC,OAAQ,oBAEXH,GAAAA,CAAU,CACfC,OAAQ,SACRF,IAAAA,IAEDL,EAASqD,yBAA0B/D,GAClC,MAAQsD,GACT7C,EACEC,SAAUuC,EAAAA,OACVW,kBACAN,EAAMhG,UAAW0F,EAAAA,EAAAA,IAAI,yBAanB,SAASzB,EAAuBvE,GACtC,MAAO,CACNP,KAAM,2BACNO,KAAAA,GAYK,SAAS+G,EAA0B/G,GACzC,MAAO,CACNP,KAAM,8BACNO,KAAAA,GAYK,SAAS8D,EAAiB1D,EAASL,GACzC,MAAO,CACNN,KAAM,uBACNW,QAAAA,EACAL,aAAAA,GAaK,SAAS4G,EAAgBvG,EAASE,GAA2B,IAAlBC,EAAkB,wDACnE,MAAO,CACNd,KAAM,mBACNW,QAAAA,EACAE,QAAAA,EACAC,QAAAA,GAWK,SAASsD,EAAkBzD,GACjC,MAAO,CACNX,KAAM,qBACNW,QAAAA,GC1PK,IAAI4G,EAAW,WAQlB,OAPAA,EAAWxI,OAAOyI,QAAU,SAAkBC,GAC1C,IAAK,IAAIC,EAAGtG,EAAI,EAAGuG,EAAIC,UAAU1G,OAAQE,EAAIuG,EAAGvG,IAE5C,IAAK,IAAIyG,KADTH,EAAIE,UAAUxG,GACOrC,OAAOM,UAAUC,eAAeC,KAAKmI,EAAGG,KAAIJ,EAAEI,GAAKH,EAAEG,IAE9E,OAAOJ,IAEKK,MAAMC,KAAMH,YCczB,SAASI,EAAUC,GACxB,OAAOA,EAAI7E,cDqDgBrE,OAAOmJ,OAsGXnJ,OAAOmJ,OEvMhC,IAAMC,EAAuB,CAAC,qBAAsB,wBAG9CC,EAAuB,eAgC7B,SAASC,EAAQC,EAAeC,EAAuB7I,GACrD,OAAI6I,aAAcC,OAAeF,EAAMD,QAAQE,EAAI7I,GAC5C6I,EAAGE,QAAO,SAACH,EAAOC,GAAO,OAAAD,EAAMD,QAAQE,EAAI7I,KAAQ4I,GC3CrD,SAASI,EAAoBJ,EAAeK,GACjD,IAAMC,EAAYN,EAAMO,OAAO,GACzBC,EAAaR,EAAMS,OAAO,GAAG3F,cACnC,OAAIuF,EAAQ,GAAKC,GAAa,KAAOA,GAAa,IACzC,IAAIA,EAAYE,EAElB,GAAGF,EAAUI,cAAgBF,EAO/B,SAASG,EAAWX,EAAeY,GACxC,YADwC,IAAAA,IAAAA,EAAA,IDCnC,SAAgBZ,EAAeY,QAAA,IAAAA,IAAAA,EAAA,IAiBpC,IAfE,MAIEA,EAAO,YAJTC,OAAW,IAAG,EAAAhB,EAAoB,EAClC,EAGEe,EAAO,YAHTE,OAAW,IAAG,EAAAhB,EAAoB,EAClC,EAEEc,EAAO,UAFTG,OAAS,IAAG,EAAArB,EAAS,EACrB,EACEkB,EAAO,UADTI,OAAS,IAAG,MAAG,EAGbC,EAASlB,EACXA,EAAQC,EAAOa,EAAa,UAC5BC,EACA,MAEEI,EAAQ,EACRC,EAAMF,EAAOrI,OAGe,OAAzBqI,EAAOV,OAAOW,IAAiBA,IACtC,KAAkC,OAA3BD,EAAOV,OAAOY,EAAM,IAAaA,IAGxC,OAAOF,EAAOG,MAAMF,EAAOC,GAAKE,MAAM,MAAMC,IAAIP,GAAWQ,KAAKP,GCrBzDQ,CAAOxB,EAAO,GACnBgB,UAAW,GACXD,UAAWX,GACRQ,ICZA,SAASa,EAAmBzB,EAAeK,GAChD,OAAc,IAAVA,EAAoBL,EAAMlF,cACvBsF,EAAoBJ,EAAOK,GCI7B,MAAMpH,EACVtB,GACF8D,MAAAA,IAA0B,IAAlB,SAAEE,GAAgB,EACzB,GAAOhE,EAIP,IACCgE,EAAUL,EAAyB3D,IAanCgE,EAAUJ,SAZYU,GAAAA,CAAU,CAC/BI,KAAO,qCAAqC1E,OAEtB2J,KAAOL,GAC7BxK,OAAOiL,YACNjL,OAAOkL,QAASV,GAASK,KAAK,QAAI/K,EAAKa,GAAT,QAAsB,EDV/B4I,ECWTzJ,ODXwB,IAAAqK,IAAAA,EAAA,IAChCD,EAAWX,EAAO,GACvBe,UAAWU,GACRb,KCSDxJ,GDZC,IAAmB4I,EAAeY,QCiBOjJ,IAC5C,SCZSiK,EAAc,CAC1BC,QAD0B,EAE1BC,UAF0B,EAG1BC,QAH0B,EAI1BC,UAASA,GAUGC,GAAQC,EAAAA,EAAAA,kBAvBF,uBAuBgCN,GC1BpC,SAASO,IACvB,MAAM,mBAAEpD,IAAuBqD,EAAAA,EAAAA,aAAaC,GAEtCC,GAAyBC,EAAAA,EAAAA,YAAalJ,IAC3C,MAAM,iBAAEmJ,EAAF,aAAoBC,GAAiBpJ,EAAQqJ,EAAAA,OACnD,OAAOD,MAAoBD,MACzB,IAEGG,GAAmBJ,EAAAA,EAAAA,YACtBlJ,GAAYA,EAAQgJ,GAAsB5I,uBAC5C,IAYD,OATAmJ,EAAAA,EAAAA,YAAW,KACLN,GAA0BK,EAAiB/J,QAC/C+J,EAAiBtI,SAAWlC,IAC3B4G,EAAoB5G,IACpB0K,EAAAA,EAAAA,qBAAqB1K,EAAUC,WAG/B,CAAEkK,IAEE,MDMRQ,EAAAA,EAAAA,UAAUb,GEzCV,MAAM,EAA+B5K,OAAW,GAAc,WCAxD,EAA+BA,OAAW,GAAW,QCArD,EAA+BA,OAAW,GAAY,SCA7C,SAAS0L,KAetB,OAdAA,GAAWtM,OAAOyI,QAAU,SAAU8D,GACpC,IAAK,IAAIlK,EAAI,EAAGA,EAAIwG,UAAU1G,OAAQE,IAAK,CACzC,IAAImK,EAAS3D,UAAUxG,GAEvB,IAAK,IAAIvC,KAAO0M,EACVxM,OAAOM,UAAUC,eAAeC,KAAKgM,EAAQ1M,KAC/CyM,EAAOzM,GAAO0M,EAAO1M,IAK3B,OAAOyM,IAGOxD,MAAMC,KAAMH,WCf9B,MAAM,GAA+BjI,OAAW,GAAgB,aCwBhE,GARA,YAA+C,IAAhC,KAAE6L,EAAF,KAAQC,EAAO,MAAOC,GAAU,EAC9C,OAAOC,EAAAA,EAAAA,cAAcH,EAAM,CAC1BI,MAAOH,EACPI,OAAQJ,KACLC,KCpBC,GAA+B/L,OAAW,GAAc,WCW9D,IALC,mBAAC,GAAAmM,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,qVCIV,IALC,mBAAC,GAAAqN,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,4dCQV,IATC,mBAAC,GAAAqN,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CACCC,SAAS,UACTzN,EAAE,+jBACF0N,SAAS,aCuCZ,GA3CA,YAA6B,IAAb,OAAEC,GAAW,EAC5B,MAAMC,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAE7BI,EAAgBF,KAAKG,MAAOL,GAC5BM,EAAgBJ,KAAKK,KAAMP,EAASI,GACpCI,EAAiB,GAAMJ,EAAgBE,GAE7C,OACC,2BACC,cAAahG,EAAAA,EAAAA;;CAEZH,EAAAA,EAAAA,IAAI,qBACJ8F,IAGCvG,MAAMC,KAAM,CAAE7E,OAAQsL,IAAkB5C,KAAK,CAAEiD,EAAGzL,KACnD,mBAAC,GAAD,CACCvC,IAAO,cAAcuC,IACrB0L,UAAU,2CACVtB,KAAOuB,GACPtB,KAAO,OAGP3F,MAAMC,KAAM,CAAE7E,OAAQwL,IAAkB9C,KAAK,CAAEiD,EAAGzL,KACnD,mBAAC,GAAD,CACCvC,IAAO,cAAcuC,IACrB0L,UAAU,gDACVtB,KAAOwB,GACPvB,KAAO,OAGP3F,MAAMC,KAAM,CAAE7E,OAAQ0L,IAAmBhD,KAAK,CAAEiD,EAAGzL,KACpD,mBAAC,GAAD,CACCvC,IAAO,eAAeuC,IACtB0L,UAAU,4CACVtB,KAAOyB,GACPxB,KAAO,SC/BZ,GAN4B,QAAE,OAAEW,GAAJ,SAC3B,2BAAMU,UAAU,kCACf,mBAAC,GAAD,CAAOV,OAASA,MCOlB,GATA,YAA2C,IAAX,KAAEZ,GAAS,EAC1C,MAAMsB,EAAY,0CAClB,OAA8D,OAAvDtB,EAAK0B,MAAO,uCAClB,0BAAKJ,UAAYA,EAAYzJ,IAAMmI,EAAO2B,IAAI,MAE9C,mBAAC,EAAAC,UAAD,CAAWN,UAAYA,EAAYtB,KAAOA,EAAO6B,YAAU,KCwB7D,GAvBuC,IAAiB,IAAf,MAAE9J,GAAa,EACvD,MAAM+J,GAAczC,EAAAA,EAAAA,YACjBlJ,GACDA,EAAQgJ,GAAsB1I,uBAAwBsB,EAAMW,KAC7D,CAAEX,IAGH,OAAO+J,GAKN,0BAAKR,UAAU,8CACd,0BAAKA,UAAU,sDACZQ,EAAYzM,QACZyM,EAAYxM,QACX,KAAMyF,EAAAA,EAAAA,IAAI,2BACV,OATE,MCKT,SAASgH,GAAT,KAGE,IAFD,MAAE5G,EAAF,OAASyF,EAAT,YAAiBoB,GAEhB,GADD,UAAEC,EAAF,YAAaC,EAAb,aAA0BpN,GACzB,EACD,MAAM+L,EAAqC,GAA7BC,KAAKC,MAAOH,EAAS,IAEnC,OAAOsB,GAAeD,GAEd/G,EAAAA,EAAAA,SAAS,wBAAwBiH,EAAAA,GAAAA,gBAAgBhH,IAGpD+G,GAEGhH,EAAAA,EAAAA,SAAS,WAAWiH,EAAAA,GAAAA,gBAAgBhH,IAGvCrG,GAEGoG,EAAAA,EAAAA,SAAS,kBAAkBiH,EAAAA,GAAAA,gBAAgBhH,IAI9C6G,EAAc,GAEX9G,EAAAA,EAAAA,SAAS,eAAeiH,EAAAA,GAAAA,gBAAgBhH,KAGzCD,EAAAA,EAAAA;;CAENkH,EAAAA,EAAAA,IACC,6CACA,8CACAJ,IAEDG,EAAAA,GAAAA,gBAAgBhH,GAChB0F,EACAmB,GAoGF,SAhGA,YAAmE,IAA/B,UAAEK,EAAF,KAAatN,EAAb,QAAmBuN,GAAY,EAClE,MAAM,OAAEC,EAAF,YAAUC,EAAV,KAAuBxC,EAAvB,OAA6BY,EAA7B,MAAqCzF,GAAUpG,EAE/CmN,KAAiBO,EAAAA,EAAAA,cAAc1N,EAAKG,OAEpC,UAAE+M,EAAF,aAAanN,EAAb,cAA2B4N,IAAkBrD,EAAAA,EAAAA,YAChDlJ,IACD,MAAM,uBAAEM,EAAwB3B,aAAc6N,GAC7CxM,EAAQgJ,GACHyD,EAASnM,EAAwB1B,EAAK2D,IACtCmK,EAAWD,GAAUA,EAAOtN,QAClC,MAAO,CACN2M,YAAcW,EACd9N,aAAc6N,EAAmB5N,EAAK2D,IACtCgK,eAAiBG,KAGnB,CAAE9N,IAGH,IAAI+N,EAAa,GAOjB,OANKZ,EACJY,GAAa/H,EAAAA,EAAAA,IAAI,cACNjG,IACXgO,GAAa/H,EAAAA,EAAAA,IAAI,iBAIjB,mBAAC,0BAAD,IACCgI,2BAAyB,EACzBC,KAAK,SACLC,GAAKC,EAAAA,QACAb,EAJN,CAKCf,UAAU,+CACVgB,QAAYa,IACXA,EAAMC,iBACNd,KAEDe,OAASvO,EACTwO,SAAWxO,IAAkB4N,EAC7Ba,MAAQxB,GAA2BhN,EAAM,CACxCkN,UAAAA,EACAC,YAAAA,EACApN,aAAAA,IAED0O,aAAc,EACdC,gBAAgB,gBAEhB,0BAAKnC,UAAU,uDACd,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO7E,MAAQA,IAC3CrG,GACD,2BAAMwM,UAAU,0DACf,mBAAC,EAAAoC,QAAD,QAGD,mBAAC,GAAD,CAAc9C,OAASA,MAGzB,2BAAMU,UAAU,0DACf,2BAAMA,UAAU,wDACbqC,EAAAA,EAAAA,2BACDzI,EAAAA,EAAAA;;CAECH,EAAAA,EAAAA,IAAI,8BACJoH,EAAAA,GAAAA,gBAAgBhH,GAChBoH,GAED,CACCqB,MACC,2BAAMtC,UAAU,4DAKlBW,GACD,mBAAC,GAAD,CAAyBlK,MAAQhD,KAEjC,oCACC,2BAAMuM,UAAU,sDACVwB,IAEFX,EAAAA,GAAAA,gBAAgBK,IAElBE,KACGR,GAAepN,KAClB,mBAAC,EAAA+O,eAAD,MACG9I,EAAAA,EAAAA,IAAI,sBCrIT+I,GAAO,OA8Cb,GA5CA,YAAuE,IAAtC,MAAEC,EAAF,QAASC,EAAUF,GAAnB,SAAyBG,GAAa,EACtE,MAAM5B,GAAY6B,EAAAA,EAAAA,gCACZ,iBAAE5L,IAAqB4G,EAAAA,EAAAA,aAAaC,GAE1C,OAAO4E,EAAMrO,QAKZ,mBAAC,sBAAD,MACM2M,EADN,CAECW,KAAK,UACL1B,UAAU,2CACV,cAAavG,EAAAA,EAAAA,IAAI,kCAEfgJ,EAAM3F,KAAOrJ,IAEb,mBAAC,GAAD,CACC1B,IAAM0B,EAAK2D,GACX2J,UAAYA,EACZC,QAAU,MAIJG,EAAAA,EAAAA,cAAc1N,EAAKG,MACvB+O,EAAUlP,GAEVuD,EAAkBvD,GAAO4E,MAAQhB,IAC3BA,GACJsL,EAAUlP,MAIbiP,EAAS,OAEVA,QAAUA,EACVjP,KAAOA,OA/BJ,MCxBH,GAA+BZ,OAAW,GAAQ,KCsDxD,GA/CA,YAII,IAJsC,SACzCgQ,EADyC,kBAEzCC,EAFyC,eAGzCC,GACG,EACH,MAAMC,EAAQF,EAAkB1O,OAehC,OAdAgK,EAAAA,EAAAA,YAAW,MACVtE,EAAAA,GAAAA,QACCF,EAAAA,EAAAA;;CAECkH,EAAAA,EAAAA,IACC,+CACA,iDACAkC,GAEDA,MAGA,CAAEA,KAGJ,oCACKD,IACH,wBAAG/C,UAAU,wDACVvG,EAAAA,EAAAA,IAAI,sDAIR,0BAAKuG,UAAU,qDAEf,0BAAKA,UAAU,8CACd,0BAAKA,UAAU,sDACd,yBAAIA,UAAU,qDACXvG,EAAAA,EAAAA,IAAI,0BAEP,wBAAGuG,UAAU,2DACVvG,EAAAA,EAAAA,IACD,wDAIDoJ,KCrCN,IALC,mBAAC,GAAA7D,IAAD,CAAKC,MAAM,6BAA6BC,QAAQ,cAC/C,mBAAC,GAAAC,KAAD,CAAMxN,EAAE,oLCuBV,GAvBA,WACC,OACC,oCACC,0BAAKqO,UAAU,sCACd,mBAAC,GAAD,CACCA,UAAU,yCACVtB,KAAOuE,MAER,6BAAKxJ,EAAAA,EAAAA,IAAI,wBAEV,0BAAKuG,UAAU,gCACd,mBAAC,EAAAkD,IAAD,MACGzJ,EAAAA,EAAAA,IAAI,2CACN,+BACA,mBAAC,EAAA0J,aAAD,CAActM,KAAK,kDAChB4C,EAAAA,EAAAA,IAAI,oBADP,SCkDL,IAAe2J,EAAAA,EAAAA,SAAS,EACvBC,EAAAA,EAAAA,aAAY,CAAExO,EAAF,KAAoD,IAA1C,YAAE1B,EAAF,aAAemQ,EAAe,MAAY,EAC/D,MAAM,sBAAE7O,EAAF,+BAAyBD,GAC9BK,EAAQgJ,IACH,mBAAE0F,GAAuB1O,EAAQE,EAAAA,OAEjCyO,EAAgB3O,EAAQ4O,EAAAA,OAAYC,QACzC,OACA,0BAcD,MAAO,CACNZ,kBANyBU,EALlB/O,EAMiBtB,GANaO,QAAU+C,GAC9C8M,EAAoB9M,EAAO6M,GAAc,KAMxC,GAKFE,cAAAA,EACAG,UALiBnP,EAAgCrB,QApBpD,EArDA,YAQI,IAR8B,kBACjC2P,EADiC,SAEjCH,EAFiC,QAGjCD,EAHiC,eAIjCK,EAJiC,cAKjCS,EALiC,UAMjCG,EANiC,SAOjCC,GACG,EACH,YAA8B,IAAlBJ,GAAiCG,GAAaC,GAExD,mCACGJ,IAAmBT,IACpB,oCACC,wBAAG/C,UAAU,wDACVvG,EAAAA,EAAAA,IACD,sDAGF,0BAAKuG,UAAU,sDAGjB,0BAAKA,UAAU,iEACd,mBAAC,EAAAoC,QAAD,SAMC,IAAUoB,EACPT,EAIA,MAHC,mBAAC,GAAD,MAMCD,EAAkB1O,QAC3B,mBAAC,GAAD,CACC0O,kBAAoBA,EACpBC,eAAiBA,IAEjB,mBAAC,GAAD,CACCN,MAAQK,EACRH,SAAWA,EACXD,QAAUA,MAIVK,IAAkB,mBAAC,GAAD,SCftB,GApCA,WACC,MAAQc,EAAsBC,IAAmBC,EAAAA,EAAAA,UAAU,IACrDC,GAA0BC,EAAAA,EAAAA,UAAUH,EAAgB,KAE1D,OACC,mBAAC,EAAAI,gCAAD,MACG,IAMK,IANH,SACHvB,EADG,QAEHD,EAFG,YAGHvP,EAHG,SAIHgR,EAJG,aAKHb,GACM,EAKN,OAJKO,IAAyB1Q,GAC7B6Q,EAAyB7Q,GAGnB0Q,GAKN,mBAAC,GAAD,CACClB,SAAWA,EACXD,QAAUA,EACVY,aAAeA,EACfnQ,YAAc0Q,EACdd,eAAiBoB,EACjBP,SAAWzQ,IAAgB0Q,IAVrB,SClCN,GAA+BhR,OAAW,GAAY,SCU7C,SAASuR,GAAT,GAAkC,IAAZ,MAAE3B,GAAU,EAChD,OAAOA,EAAMrO,QAKZ,yBAAI4L,UAAU,gCACXyC,EAAM3F,KAAK,QAAE,KAAE4B,EAAF,GAAQtH,EAAR,MAAYyC,EAAZ,OAAmBoH,GAArB,SACZ,yBAAIlP,IAAMqF,EAAK4I,UAAU,uCACxB,mBAAC,GAAD,CAAuBtB,KAAOA,EAAO7E,MAAQA,KAE7C,0BAAKmG,UAAU,+CACd,0BAAKA,UAAU,4CACZnG,IAEH,0BAAKmG,UAAU,8CACZpG,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,SACJwH,UAjBC,KCEM,SAASoD,KACvB,MAAMC,GAAgBvG,EAAAA,EAAAA,YACnBlJ,GAAYA,EAAQgJ,GAAsBlJ,oBAC5C,IAGD,OAAO2P,EAAclQ,QAKpB,mBAAC,GAAAmQ,sBAAD,CACC7F,KAAOuE,GACPpJ,OAAQD,EAAAA,EAAAA;CAEPkH,EAAAA,EAAAA,IACC,kBACA,mBACAwD,EAAclQ,QAEfkQ,EAAclQ,QAEfoQ,aAAc,IAEd,wBAAGxE,UAAU,6CACVc,EAAAA,EAAAA,IACD,mDACA,qDACAwD,EAAclQ,UAGhB,mBAACgQ,GAAD,CAAa3B,MAAQ6B,KAxBf,KCPM,SAASG,GAAT,GAA0D,IAAlC,WAAEC,EAAF,MAAcjO,EAAd,SAAqBkO,GAAa,EACxE,MAAMC,GAAoB7G,EAAAA,EAAAA,YACvBlJ,GAAYA,EAAQgJ,GAAsBrK,aAAciD,EAAMW,KAChE,CAAEX,EAAMW,MAEH,iBAAEJ,IAAqB4G,EAAAA,EAAAA,aAAaC,IACpC,aAAEgH,IAAiBjH,EAAAA,EAAAA,aAAa7I,EAAAA,OAEtC,OACC,mBAAC,EAAA6M,OAAD,CACCZ,QAAU,IACThK,EAAkBP,GAAQ4B,MAAQhB,IACjC,GAAKA,EAAU,CACd,MAAM1D,GAAYwN,EAAAA,EAAAA,cAAc1K,EAAM7C,OAC9BkR,IAAkBpM,EAAAA,EAAAA,OACzBgM,EAAWK,iBAEPD,GAAiBnR,GACrBkR,EACCF,GACAK,EAAAA,EAAAA,aACCrR,EAAUC,KACVkR,EAAcJ,WACdI,EAAcvQ,kBAOpByN,SAAW4C,EACX7C,OAAS6C,EACTK,QAAQ,YAENrL,EAAAA,EAAAA;;CAEDH,EAAAA,EAAAA,IAAI,cACJhD,EAAMoD,QC9BV,MA6BMqL,GAAkB,IAAmC,IAAjC,cAAEJ,KAAkBlG,GAAa,EAC1D,MAAM,aAAEuG,EAAF,2BAAgBC,GAA+BxG,EAAM8F,YACrD,aAAEG,IAAiBjH,EAAAA,EAAAA,aAAa7I,EAAAA,OAUhCsQ,IAAgBD,EAChBE,GAAenE,EAAAA,EAAAA,cAAc,aAEnC,IAAIoE,GAAc3L,EAAAA,EAAAA;;CAEjBH,EAAAA,EAAAA,IACC,+GAEDqL,EAAcjL,OAASsL,GAExB,MAAM5H,EAAU,EACf,mBAACkH,GAAD,CACC1S,IAAI,UACJ0E,MAAQqO,EACRJ,WAAa9F,EAAM8F,WACnBC,SAAW/F,EAAM+F,YAmBnB,OAfKU,GAAcC,IAClBC,GAAc3L,EAAAA,EAAAA;;CAEbH,EAAAA,EAAAA,IACC,mJAEDqL,EAAcjL,OAASsL,GAExB5H,EAAQiI,MACP,mBAAC,EAAA5D,OAAD,CAAQ7P,IAAI,UAAUiP,QArCF,KACrB6D,EACCjG,EAAM+F,UACNK,EAAAA,EAAAA,aAAa,YAAa,CACzBS,QAASL,MAiCsCH,QAAQ,SACrDxL,EAAAA,EAAAA,IAAI,oBAMR,0BAAUiM,EAAAA,EAAAA,kBACT,mBAAC,EAAAC,QAAD,CAASpI,QAAUA,GAAYgI,IAC/B,mBAAC,EAAAK,QAAD,KAAWR,MCrFdS,EAAAA,EAAAA,gBAAgB,kBAAmB,CAClCC,OAAM,KAEJ,oCACC,mBAACnI,EAAD,OACA,mBAAC,GAAD,OACA,mBAAC0G,GAAD,UAMJ0B,EAAAA,EAAAA,WACC,2BACA,4BACA,CAAEC,EAAUpS,KACX,MAAc,iBAATA,IAGLoS,EAASC,MDZiBC,ECYSF,EAASC,KDZOrH,IACpD,MAAM,aAAEuG,GAAiBvG,EAAM8F,YAGzB,MAAEjO,EAAF,cAAS+M,IAAkBzF,EAAAA,EAAAA,YAC9BlJ,IACD,MAAM,sBAAEJ,GAA0BI,EAAQgJ,GACpC1J,EAASM,EACd,SAAW0Q,GACVzR,QAAQ,QAAE,KAAEE,GAAJ,SAAgBuR,IAAiBvR,KAC3C,MAAO,CACN4P,cAAe3O,EAAQ4O,EAAAA,OAAYC,QAClC,OACA,0BAEDjN,MAAOtC,EAAOC,QAAUD,EAAQ,MAGlC,CAAEgR,IAIH,OAAO3B,GAAmB/M,GAInB,mBAACyO,GAAD,MAAsBtG,EAAtB,CAA8BkG,cAAgBrO,MAH7C,mBAACyP,EAAuBtH,MCbvBoH,EDVkBE,IAAAA,M","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/compat get default export","webpack://wp/webpack/runtime/define property getters","webpack://wp/webpack/runtime/hasOwnProperty shorthand","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"element\"]","webpack://wp/external window [\"wp\",\"plugins\"]","webpack://wp/external window [\"wp\",\"hooks\"]","webpack://wp/external window [\"wp\",\"blocks\"]","webpack://wp/external window [\"wp\",\"data\"]","webpack://wp/external window [\"wp\",\"editor\"]","webpack://wp/external window \"lodash\"","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/reducer.js","webpack://wp/external window [\"wp\",\"blockEditor\"]","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/has-block-type.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/selectors.js","webpack://wp/external window [\"wp\",\"i18n\"]","webpack://wp/external window [\"wp\",\"apiFetch\"]","webpack://wp/external window [\"wp\",\"notices\"]","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/load-assets.js","webpack://wp/./packages/block-directory/build-module/store/utils/@wordpress/block-directory/src/store/utils/get-plugin-url.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/actions.js","webpack://wp/./node_modules/tslib/tslib.es6.js","webpack://wp/./node_modules/lower-case/src/index.ts","webpack://wp/./node_modules/no-case/src/index.ts","webpack://wp/./node_modules/pascal-case/src/index.ts","webpack://wp/./node_modules/camel-case/src/index.ts","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/resolvers.js","webpack://wp/./packages/block-directory/build-module/store/@wordpress/block-directory/src/store/index.js","webpack://wp/./packages/block-directory/build-module/components/auto-block-uninstaller/@wordpress/block-directory/src/components/auto-block-uninstaller/index.js","webpack://wp/external window [\"wp\",\"components\"]","webpack://wp/external window [\"wp\",\"compose\"]","webpack://wp/external window [\"wp\",\"coreData\"]","webpack://wp/./node_modules/@babel/runtime/helpers/esm/extends.js","webpack://wp/external window [\"wp\",\"htmlEntities\"]","webpack://wp/./packages/icons/build-module/icon/@wordpress/icons/src/icon/index.js","webpack://wp/external window [\"wp\",\"primitives\"]","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-filled.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-half.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/star-empty.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/stars.js","webpack://wp/./packages/block-directory/build-module/components/block-ratings/@wordpress/block-directory/src/components/block-ratings/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-icon/@wordpress/block-directory/src/components/downloadable-block-icon/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-notice/@wordpress/block-directory/src/components/downloadable-block-notice/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-block-list-item/@wordpress/block-directory/src/components/downloadable-block-list-item/index.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-list/@wordpress/block-directory/src/components/downloadable-blocks-list/index.js","webpack://wp/external window [\"wp\",\"a11y\"]","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/inserter-panel.js","webpack://wp/./packages/icons/build-module/library/@wordpress/icons/src/library/block-default.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/no-results.js","webpack://wp/./packages/block-directory/build-module/components/downloadable-blocks-panel/@wordpress/block-directory/src/components/downloadable-blocks-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/inserter-menu-downloadable-blocks-panel/@wordpress/block-directory/src/plugins/inserter-menu-downloadable-blocks-panel/index.js","webpack://wp/external window [\"wp\",\"editPost\"]","webpack://wp/./packages/block-directory/build-module/components/compact-list/@wordpress/block-directory/src/components/compact-list/index.js","webpack://wp/./packages/block-directory/build-module/plugins/installed-blocks-pre-publish-panel/@wordpress/block-directory/src/plugins/installed-blocks-pre-publish-panel/index.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/install-button.js","webpack://wp/./packages/block-directory/build-module/plugins/get-install-missing/@wordpress/block-directory/src/plugins/get-install-missing/index.js","webpack://wp/./packages/block-directory/build-module/plugins/@wordpress/block-directory/src/plugins/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// getDefaultExport function for compatibility with non-harmony modules\n__webpack_require__.n = (module) => {\n\tvar getter = module && module.__esModule ?\n\t\t() => (module['default']) :\n\t\t() => (module);\n\t__webpack_require__.d(getter, { a: getter });\n\treturn getter;\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"element\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"plugins\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"hooks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blocks\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"data\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editor\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"lodash\"];","/**\n * External dependencies\n */\n\nimport { omit } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { combineReducers } from '@wordpress/data';\n\n/**\n * Reducer returning an array of downloadable blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const downloadableBlocks = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'FETCH_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tisRequesting: true,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'RECEIVE_DOWNLOADABLE_BLOCKS':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.filterValue ]: {\n\t\t\t\t\tresults: action.downloadableBlocks,\n\t\t\t\t\tisRequesting: false,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer managing the installation and deletion of blocks.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const blockManagement = (\n\tstate = {\n\t\tinstalledBlockTypes: [],\n\t\tisInstalling: {},\n\t},\n\taction\n) => {\n\tswitch ( action.type ) {\n\t\tcase 'ADD_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: [\n\t\t\t\t\t...state.installedBlockTypes,\n\t\t\t\t\taction.item,\n\t\t\t\t],\n\t\t\t};\n\t\tcase 'REMOVE_INSTALLED_BLOCK_TYPE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tinstalledBlockTypes: state.installedBlockTypes.filter(\n\t\t\t\t\t( blockType ) => blockType.name !== action.item.name\n\t\t\t\t),\n\t\t\t};\n\t\tcase 'SET_INSTALLING_BLOCK':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\tisInstalling: {\n\t\t\t\t\t...state.isInstalling,\n\t\t\t\t\t[ action.blockId ]: action.isInstalling,\n\t\t\t\t},\n\t\t\t};\n\t}\n\treturn state;\n};\n\n/**\n * Reducer returning an object of error notices.\n *\n * @param {Object} state Current state.\n * @param {Object} action Dispatched action.\n *\n * @return {Object} Updated state.\n */\nexport const errorNotices = ( state = {}, action ) => {\n\tswitch ( action.type ) {\n\t\tcase 'SET_ERROR_NOTICE':\n\t\t\treturn {\n\t\t\t\t...state,\n\t\t\t\t[ action.blockId ]: {\n\t\t\t\t\tmessage: action.message,\n\t\t\t\t\tisFatal: action.isFatal,\n\t\t\t\t},\n\t\t\t};\n\t\tcase 'CLEAR_ERROR_NOTICE':\n\t\t\treturn omit( state, action.blockId );\n\t}\n\treturn state;\n};\n\nexport default combineReducers( {\n\tdownloadableBlocks,\n\tblockManagement,\n\terrorNotices,\n} );\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"blockEditor\"];","/**\n * Check if a block list contains a specific block type. Recursively searches\n * through `innerBlocks` if they exist.\n *\n * @param {Object} blockType A block object to search for.\n * @param {Object[]} blocks The list of blocks to look through.\n *\n * @return {boolean} Whether the blockType is found.\n */\nexport default function hasBlockType( blockType, blocks = [] ) {\n\tif ( ! blocks.length ) {\n\t\treturn false;\n\t}\n\tif ( blocks.some( ( { name } ) => name === blockType.name ) ) {\n\t\treturn true;\n\t}\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( hasBlockType( blockType, blocks[ i ].innerBlocks ) ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\n\treturn false;\n}\n","/**\n * WordPress dependencies\n */\nimport { createRegistrySelector } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport hasBlockType from './utils/has-block-type';\n\n/**\n * Returns true if application is requesting for downloadable blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {boolean} Whether a request is in progress for the blocks list.\n */\nexport function isRequestingDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.isRequesting ?? false;\n}\n\n/**\n * Returns the available uninstalled blocks.\n *\n * @param {Object} state Global application state.\n * @param {string} filterValue Search string.\n *\n * @return {Array} Downloadable blocks.\n */\nexport function getDownloadableBlocks( state, filterValue ) {\n\treturn state.downloadableBlocks[ filterValue ]?.results ?? [];\n}\n\n/**\n * Returns the block types that have been installed on the server in this\n * session.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items\n */\nexport function getInstalledBlockTypes( state ) {\n\treturn state.blockManagement.installedBlockTypes;\n}\n\n/**\n * Returns block types that have been installed on the server and used in the\n * current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getNewBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter( ( blockType ) =>\n\t\t\thasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns the block types that have been installed on the server but are not\n * used in the current post.\n *\n * @param {Object} state Global application state.\n *\n * @return {Array} Block type items.\n */\nexport const getUnusedBlockTypes = createRegistrySelector(\n\t( select ) => ( state ) => {\n\t\tconst usedBlockTree = select( blockEditorStore ).getBlocks();\n\t\tconst installedBlockTypes = getInstalledBlockTypes( state );\n\n\t\treturn installedBlockTypes.filter(\n\t\t\t( blockType ) => ! hasBlockType( blockType, usedBlockTree )\n\t\t);\n\t}\n);\n\n/**\n * Returns true if a block plugin install is in progress.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId Id of the block.\n *\n * @return {boolean} Whether this block is currently being installed.\n */\nexport function isInstalling( state, blockId ) {\n\treturn state.blockManagement.isInstalling[ blockId ] || false;\n}\n\n/**\n * Returns all block error notices.\n *\n * @param {Object} state Global application state.\n *\n * @return {Object} Object with error notices.\n */\nexport function getErrorNotices( state ) {\n\treturn state.errorNotices;\n}\n\n/**\n * Returns the error notice for a given block.\n *\n * @param {Object} state Global application state.\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {string|boolean} The error text, or false if no error.\n */\nexport function getErrorNoticeForBlock( state, blockId ) {\n\treturn state.errorNotices[ blockId ];\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"i18n\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"apiFetch\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"notices\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Load an asset for a block.\n *\n * This function returns a Promise that will resolve once the asset is loaded,\n * or in the case of Stylesheets and Inline JavaScript, will resolve immediately.\n *\n * @param {HTMLElement} el A HTML Element asset to inject.\n *\n * @return {Promise} Promise which will resolve when the asset is loaded.\n */\nexport const loadAsset = ( el ) => {\n\treturn new Promise( ( resolve, reject ) => {\n\t\t/*\n\t\t * Reconstruct the passed element, this is required as inserting the Node directly\n\t\t * won't always fire the required onload events, even if the asset wasn't already loaded.\n\t\t */\n\t\tconst newNode = document.createElement( el.nodeName );\n\n\t\t[ 'id', 'rel', 'src', 'href', 'type' ].forEach( ( attr ) => {\n\t\t\tif ( el[ attr ] ) {\n\t\t\t\tnewNode[ attr ] = el[ attr ];\n\t\t\t}\n\t\t} );\n\n\t\t// Append inline <script> contents.\n\t\tif ( el.innerHTML ) {\n\t\t\tnewNode.appendChild( document.createTextNode( el.innerHTML ) );\n\t\t}\n\n\t\tnewNode.onload = () => resolve( true );\n\t\tnewNode.onerror = () => reject( new Error( 'Error loading asset.' ) );\n\n\t\tdocument.body.appendChild( newNode );\n\n\t\t// Resolve Stylesheets and Inline JavaScript immediately.\n\t\tif (\n\t\t\t'link' === newNode.nodeName.toLowerCase() ||\n\t\t\t( 'script' === newNode.nodeName.toLowerCase() && ! newNode.src )\n\t\t) {\n\t\t\tresolve();\n\t\t}\n\t} );\n};\n\n/**\n * Load the asset files for a block\n */\nexport async function loadAssets() {\n\t/*\n\t * Fetch the current URL (post-new.php, or post.php?post=1&action=edit) and compare the\n\t * JavaScript and CSS assets loaded between the pages. This imports the required assets\n\t * for the block into the current page while not requiring that we know them up-front.\n\t * In the future this can be improved by reliance upon block.json and/or a script-loader\n\t * dependency API.\n\t */\n\tconst response = await apiFetch( {\n\t\turl: document.location.href,\n\t\tparse: false,\n\t} );\n\n\tconst data = await response.text();\n\n\tconst doc = new window.DOMParser().parseFromString( data, 'text/html' );\n\n\tconst newAssets = Array.from(\n\t\tdoc.querySelectorAll( 'link[rel=\"stylesheet\"],script' )\n\t).filter( ( asset ) => asset.id && ! document.getElementById( asset.id ) );\n\n\t/*\n\t * Load each asset in order, as they may depend upon an earlier loaded script.\n\t * Stylesheets and Inline Scripts will resolve immediately upon insertion.\n\t */\n\tfor ( const newAsset of newAssets ) {\n\t\tawait loadAsset( newAsset );\n\t}\n}\n","/**\n * Get the plugin's direct API link out of a block-directory response.\n *\n * @param {Object} block The block object\n *\n * @return {string} The plugin URL, if exists.\n */\nexport default function getPluginUrl( block ) {\n\tif ( ! block ) {\n\t\treturn false;\n\t}\n\tconst link = block.links[ 'wp:plugin' ] || block.links.self;\n\tif ( link && link.length ) {\n\t\treturn link[ 0 ].href;\n\t}\n\treturn false;\n}\n","/**\n * External dependencies\n */\nimport { pick } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as blocksStore,\n\tunstable__bootstrapServerSideBlockDefinitions, // eslint-disable-line camelcase\n} from '@wordpress/blocks';\nimport { __, sprintf } from '@wordpress/i18n';\nimport apiFetch from '@wordpress/api-fetch';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport { loadAssets } from './load-assets';\nimport getPluginUrl from './utils/get-plugin-url';\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been requested and are loading.\n *\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function fetchDownloadableBlocks( filterValue ) {\n\treturn { type: 'FETCH_DOWNLOADABLE_BLOCKS', filterValue };\n}\n\n/**\n * Returns an action object used in signalling that the downloadable blocks\n * have been updated.\n *\n * @param {Array} downloadableBlocks Downloadable blocks.\n * @param {string} filterValue Search string.\n *\n * @return {Object} Action object.\n */\nexport function receiveDownloadableBlocks( downloadableBlocks, filterValue ) {\n\treturn {\n\t\ttype: 'RECEIVE_DOWNLOADABLE_BLOCKS',\n\t\tdownloadableBlocks,\n\t\tfilterValue,\n\t};\n}\n\n/**\n * Action triggered to install a block plugin.\n *\n * @param {Object} block The block item returned by search.\n *\n * @return {boolean} Whether the block was successfully installed & loaded.\n */\nexport const installBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\tconst { id, name } = block;\n\t\tlet success = false;\n\t\tdispatch.clearErrorNotice( id );\n\t\ttry {\n\t\t\tdispatch.setIsInstalling( id, true );\n\n\t\t\t// If we have a wp:plugin link, the plugin is installed but inactive.\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tlet links = {};\n\t\t\tif ( url ) {\n\t\t\t\tawait apiFetch( {\n\t\t\t\t\tmethod: 'PUT',\n\t\t\t\t\turl,\n\t\t\t\t\tdata: { status: 'active' },\n\t\t\t\t} );\n\t\t\t} else {\n\t\t\t\tconst response = await apiFetch( {\n\t\t\t\t\tmethod: 'POST',\n\t\t\t\t\tpath: 'wp/v2/plugins',\n\t\t\t\t\tdata: { slug: id, status: 'active' },\n\t\t\t\t} );\n\t\t\t\t// Add the `self` link for newly-installed blocks.\n\t\t\t\tlinks = response._links;\n\t\t\t}\n\n\t\t\tdispatch.addInstalledBlockType( {\n\t\t\t\t...block,\n\t\t\t\tlinks: { ...block.links, ...links },\n\t\t\t} );\n\n\t\t\t// Ensures that the block metadata is propagated to the editor when registered on the server.\n\t\t\tconst metadataFields = [\n\t\t\t\t'api_version',\n\t\t\t\t'title',\n\t\t\t\t'category',\n\t\t\t\t'parent',\n\t\t\t\t'icon',\n\t\t\t\t'description',\n\t\t\t\t'keywords',\n\t\t\t\t'attributes',\n\t\t\t\t'provides_context',\n\t\t\t\t'uses_context',\n\t\t\t\t'supports',\n\t\t\t\t'styles',\n\t\t\t\t'example',\n\t\t\t\t'variations',\n\t\t\t];\n\t\t\tawait apiFetch( {\n\t\t\t\tpath: addQueryArgs( `/wp/v2/block-types/${ name }`, {\n\t\t\t\t\t_fields: metadataFields,\n\t\t\t\t} ),\n\t\t\t} )\n\t\t\t\t// Ignore when the block is not registered on the server.\n\t\t\t\t.catch( () => {} )\n\t\t\t\t.then( ( response ) => {\n\t\t\t\t\tif ( ! response ) {\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tunstable__bootstrapServerSideBlockDefinitions( {\n\t\t\t\t\t\t[ name ]: pick( response, metadataFields ),\n\t\t\t\t\t} );\n\t\t\t\t} );\n\n\t\t\tawait loadAssets();\n\t\t\tconst registeredBlocks = registry\n\t\t\t\t.select( blocksStore )\n\t\t\t\t.getBlockTypes();\n\t\t\tif ( ! registeredBlocks.some( ( i ) => i.name === name ) ) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t__( 'Error registering block. Try reloading the page.' )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\tregistry.dispatch( noticesStore ).createInfoNotice(\n\t\t\t\tsprintf(\n\t\t\t\t\t// translators: %s is the block title.\n\t\t\t\t\t__( 'Block %s installed and added.' ),\n\t\t\t\t\tblock.title\n\t\t\t\t),\n\t\t\t\t{\n\t\t\t\t\tspeak: true,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t}\n\t\t\t);\n\t\t\tsuccess = true;\n\t\t} catch ( error ) {\n\t\t\tlet message = error.message || __( 'An error occurred.' );\n\n\t\t\t// Errors we throw are fatal.\n\t\t\tlet isFatal = error instanceof Error;\n\n\t\t\t// Specific API errors that are fatal.\n\t\t\tconst fatalAPIErrors = {\n\t\t\t\tfolder_exists: __(\n\t\t\t\t\t'This block is already installed. Try reloading the page.'\n\t\t\t\t),\n\t\t\t\tunable_to_connect_to_filesystem: __(\n\t\t\t\t\t'Error installing block. You can reload the page and try again.'\n\t\t\t\t),\n\t\t\t};\n\n\t\t\tif ( fatalAPIErrors[ error.code ] ) {\n\t\t\t\tisFatal = true;\n\t\t\t\tmessage = fatalAPIErrors[ error.code ];\n\t\t\t}\n\n\t\t\tdispatch.setErrorNotice( id, message, isFatal );\n\t\t\tregistry.dispatch( noticesStore ).createErrorNotice( message, {\n\t\t\t\tspeak: true,\n\t\t\t\tisDismissible: true,\n\t\t\t} );\n\t\t}\n\t\tdispatch.setIsInstalling( id, false );\n\t\treturn success;\n\t};\n\n/**\n * Action triggered to uninstall a block plugin.\n *\n * @param {Object} block The blockType object.\n */\nexport const uninstallBlockType =\n\t( block ) =>\n\tasync ( { registry, dispatch } ) => {\n\t\ttry {\n\t\t\tconst url = getPluginUrl( block );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'PUT',\n\t\t\t\turl,\n\t\t\t\tdata: { status: 'inactive' },\n\t\t\t} );\n\t\t\tawait apiFetch( {\n\t\t\t\tmethod: 'DELETE',\n\t\t\t\turl,\n\t\t\t} );\n\t\t\tdispatch.removeInstalledBlockType( block );\n\t\t} catch ( error ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice(\n\t\t\t\t\terror.message || __( 'An error occurred.' )\n\t\t\t\t);\n\t\t}\n\t};\n\n/**\n * Returns an action object used to add a block type to the \"newly installed\"\n * tracking list.\n *\n * @param {Object} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function addInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'ADD_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to remove a block type from the \"newly installed\"\n * tracking list.\n *\n * @param {string} item The block item with the block id and name.\n *\n * @return {Object} Action object.\n */\nexport function removeInstalledBlockType( item ) {\n\treturn {\n\t\ttype: 'REMOVE_INSTALLED_BLOCK_TYPE',\n\t\titem,\n\t};\n}\n\n/**\n * Returns an action object used to indicate install in progress.\n *\n * @param {string} blockId\n * @param {boolean} isInstalling\n *\n * @return {Object} Action object.\n */\nexport function setIsInstalling( blockId, isInstalling ) {\n\treturn {\n\t\ttype: 'SET_INSTALLING_BLOCK',\n\t\tblockId,\n\t\tisInstalling,\n\t};\n}\n\n/**\n * Sets an error notice to be displayed to the user for a given block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n * @param {string} message The message shown in the notice.\n * @param {boolean} isFatal Whether the user can recover from the error.\n *\n * @return {Object} Action object.\n */\nexport function setErrorNotice( blockId, message, isFatal = false ) {\n\treturn {\n\t\ttype: 'SET_ERROR_NOTICE',\n\t\tblockId,\n\t\tmessage,\n\t\tisFatal,\n\t};\n}\n\n/**\n * Sets the error notice to empty for specific block.\n *\n * @param {string} blockId The ID of the block plugin. eg: my-block\n *\n * @return {Object} Action object.\n */\nexport function clearErrorNotice( blockId ) {\n\treturn {\n\t\ttype: 'CLEAR_ERROR_NOTICE',\n\t\tblockId,\n\t};\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n 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;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n 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;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nexport function __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || from);\r\n}\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n 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); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n 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; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n 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);\r\n 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); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n 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\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n 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\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n","/**\n * Locale character mapping rules.\n */\ninterface Locale {\n regexp: RegExp;\n map: Record<string, string>;\n}\n\n/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nconst SUPPORTED_LOCALE: Record<string, Locale> = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str: string, locale: string) {\n const lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang) return lowerCase(str.replace(lang.regexp, (m) => lang.map[m]));\n return lowerCase(str);\n}\n\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str: string) {\n return str.toLowerCase();\n}\n","import { lowerCase } from \"lower-case\";\n\nexport interface Options {\n splitRegexp?: RegExp | RegExp[];\n stripRegexp?: RegExp | RegExp[];\n delimiter?: string;\n transform?: (part: string, index: number, parts: string[]) => string;\n}\n\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nconst DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n\n// Remove all non-word characters.\nconst DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input: string, options: Options = {}) {\n const {\n splitRegexp = DEFAULT_SPLIT_REGEXP,\n stripRegexp = DEFAULT_STRIP_REGEXP,\n transform = lowerCase,\n delimiter = \" \",\n } = options;\n\n let result = replace(\n replace(input, splitRegexp, \"$1\\0$2\"),\n stripRegexp,\n \"\\0\"\n );\n let start = 0;\n let end = result.length;\n\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\") start++;\n while (result.charAt(end - 1) === \"\\0\") end--;\n\n // Transform each token independently.\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input: string, re: RegExp | RegExp[], value: string) {\n if (re instanceof RegExp) return input.replace(re, value);\n return re.reduce((input, re) => input.replace(re, value), input);\n}\n","import { noCase, Options } from \"no-case\";\n\nexport { Options };\n\nexport function pascalCaseTransform(input: string, index: number) {\n const firstChar = input.charAt(0);\n const lowerChars = input.substr(1).toLowerCase();\n if (index > 0 && firstChar >= \"0\" && firstChar <= \"9\") {\n return `_${firstChar}${lowerChars}`;\n }\n return `${firstChar.toUpperCase()}${lowerChars}`;\n}\n\nexport function pascalCaseTransformMerge(input: string) {\n return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();\n}\n\nexport function pascalCase(input: string, options: Options = {}) {\n return noCase(input, {\n delimiter: \"\",\n transform: pascalCaseTransform,\n ...options,\n });\n}\n","import {\n pascalCase,\n pascalCaseTransform,\n pascalCaseTransformMerge,\n Options,\n} from \"pascal-case\";\n\nexport { Options };\n\nexport function camelCaseTransform(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransform(input, index);\n}\n\nexport function camelCaseTransformMerge(input: string, index: number) {\n if (index === 0) return input.toLowerCase();\n return pascalCaseTransformMerge(input);\n}\n\nexport function camelCase(input: string, options: Options = {}) {\n return pascalCase(input, {\n transform: camelCaseTransform,\n ...options,\n });\n}\n","/**\n * External dependencies\n */\nimport { camelCase } from 'change-case';\n\n/**\n * WordPress dependencies\n */\nimport apiFetch from '@wordpress/api-fetch';\n\n/**\n * Internal dependencies\n */\nimport { fetchDownloadableBlocks, receiveDownloadableBlocks } from './actions';\n\nexport const getDownloadableBlocks =\n\t( filterValue ) =>\n\tasync ( { dispatch } ) => {\n\t\tif ( ! filterValue ) {\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tdispatch( fetchDownloadableBlocks( filterValue ) );\n\t\t\tconst results = await apiFetch( {\n\t\t\t\tpath: `wp/v2/block-directory/search?term=${ filterValue }`,\n\t\t\t} );\n\t\t\tconst blocks = results.map( ( result ) =>\n\t\t\t\tObject.fromEntries(\n\t\t\t\t\tObject.entries( result ).map( ( [ key, value ] ) => [\n\t\t\t\t\t\tcamelCase( key ),\n\t\t\t\t\t\tvalue,\n\t\t\t\t\t] )\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tdispatch( receiveDownloadableBlocks( blocks, filterValue ) );\n\t\t} catch {}\n\t};\n","/**\n * WordPress dependencies\n */\nimport { createReduxStore, register } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport reducer from './reducer';\nimport * as selectors from './selectors';\nimport * as actions from './actions';\nimport * as resolvers from './resolvers';\n\n/**\n * Module Constants\n */\nconst STORE_NAME = 'core/block-directory';\n\n/**\n * Block editor data store configuration.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore\n *\n * @type {Object}\n */\nexport const storeConfig = {\n\treducer,\n\tselectors,\n\tactions,\n\tresolvers,\n};\n\n/**\n * Store definition for the block directory namespace.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore\n *\n * @type {Object}\n */\nexport const store = createReduxStore( STORE_NAME, storeConfig );\n\nregister( store );\n","/**\n * WordPress dependencies\n */\nimport { unregisterBlockType } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useEffect } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function AutoBlockUninstaller() {\n\tconst { uninstallBlockType } = useDispatch( blockDirectoryStore );\n\n\tconst shouldRemoveBlockTypes = useSelect( ( select ) => {\n\t\tconst { isAutosavingPost, isSavingPost } = select( editorStore );\n\t\treturn isSavingPost() && ! isAutosavingPost();\n\t}, [] );\n\n\tconst unusedBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getUnusedBlockTypes(),\n\t\t[]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldRemoveBlockTypes && unusedBlockTypes.length ) {\n\t\t\tunusedBlockTypes.forEach( ( blockType ) => {\n\t\t\t\tuninstallBlockType( blockType );\n\t\t\t\tunregisterBlockType( blockType.name );\n\t\t\t} );\n\t\t}\n\t}, [ shouldRemoveBlockTypes ] );\n\n\treturn null;\n}\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"components\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"compose\"];","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"coreData\"];","export default function _extends() {\n _extends = Object.assign || function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i];\n\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key];\n }\n }\n }\n\n return target;\n };\n\n return _extends.apply(this, arguments);\n}","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"htmlEntities\"];","/**\n * WordPress dependencies\n */\nimport { cloneElement } from '@wordpress/element';\n\n/** @typedef {{icon: JSX.Element, size?: number} & import('@wordpress/primitives').SVGProps} IconProps */\n\n/**\n * Return an SVG icon.\n *\n * @param {IconProps} props icon is the SVG component to render\n * size is a number specifiying the icon size in pixels\n * Other props will be passed to wrapped SVG component\n *\n * @return {JSX.Element} Icon component\n */\nfunction Icon( { icon, size = 24, ...props } ) {\n\treturn cloneElement( icon, {\n\t\twidth: size,\n\t\theight: size,\n\t\t...props,\n\t} );\n}\n\nexport default Icon;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"primitives\"];","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starFilled = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M11.776 4.454a.25.25 0 01.448 0l2.069 4.192a.25.25 0 00.188.137l4.626.672a.25.25 0 01.139.426l-3.348 3.263a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.362.263l-4.138-2.175a.25.25 0 00-.232 0l-4.138 2.175a.25.25 0 01-.363-.263l.79-4.607a.25.25 0 00-.071-.222L4.754 9.881a.25.25 0 01.139-.426l4.626-.672a.25.25 0 00.188-.137l2.069-4.192z\" />\n\t</SVG>\n);\n\nexport default starFilled;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starHalf = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9.518 8.783a.25.25 0 00.188-.137l2.069-4.192a.25.25 0 01.448 0l2.07 4.192a.25.25 0 00.187.137l4.626.672a.25.25 0 01.139.427l-3.347 3.262a.25.25 0 00-.072.222l.79 4.607a.25.25 0 01-.363.264l-4.137-2.176a.25.25 0 00-.233 0l-4.138 2.175a.25.25 0 01-.362-.263l.79-4.607a.25.25 0 00-.072-.222L4.753 9.882a.25.25 0 01.14-.427l4.625-.672zM12 14.533c.28 0 .559.067.814.2l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39v7.143z\" />\n\t</SVG>\n);\n\nexport default starHalf;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst starEmpty = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path\n\t\t\tfillRule=\"evenodd\"\n\t\t\td=\"M9.706 8.646a.25.25 0 01-.188.137l-4.626.672a.25.25 0 00-.139.427l3.348 3.262a.25.25 0 01.072.222l-.79 4.607a.25.25 0 00.362.264l4.138-2.176a.25.25 0 01.233 0l4.137 2.175a.25.25 0 00.363-.263l-.79-4.607a.25.25 0 01.072-.222l3.347-3.262a.25.25 0 00-.139-.427l-4.626-.672a.25.25 0 01-.188-.137l-2.069-4.192a.25.25 0 00-.448 0L9.706 8.646zM12 7.39l-.948 1.921a1.75 1.75 0 01-1.317.957l-2.12.308 1.534 1.495c.412.402.6.982.503 1.55l-.362 2.11 1.896-.997a1.75 1.75 0 011.629 0l1.895.997-.362-2.11a1.75 1.75 0 01.504-1.55l1.533-1.495-2.12-.308a1.75 1.75 0 01-1.317-.957L12 7.39z\"\n\t\t\tclipRule=\"evenodd\"\n\t\t/>\n\t</SVG>\n);\n\nexport default starEmpty;\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, starEmpty, starFilled, starHalf } from '@wordpress/icons';\n\nfunction Stars( { rating } ) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tconst fullStarCount = Math.floor( rating );\n\tconst halfStarCount = Math.ceil( rating - fullStarCount );\n\tconst emptyStarCount = 5 - ( fullStarCount + halfStarCount );\n\n\treturn (\n\t\t<span\n\t\t\taria-label={ sprintf(\n\t\t\t\t/* translators: %s: number of stars. */\n\t\t\t\t__( '%s out of 5 stars' ),\n\t\t\t\tstars\n\t\t\t) }\n\t\t>\n\t\t\t{ Array.from( { length: fullStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `full_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-full\"\n\t\t\t\t\ticon={ starFilled }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: halfStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `half_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-half-full\"\n\t\t\t\t\ticon={ starHalf }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ Array.from( { length: emptyStarCount } ).map( ( _, i ) => (\n\t\t\t\t<Icon\n\t\t\t\t\tkey={ `empty_stars_${ i }` }\n\t\t\t\t\tclassName=\"block-directory-block-ratings__star-empty\"\n\t\t\t\t\ticon={ starEmpty }\n\t\t\t\t\tsize={ 16 }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t</span>\n\t);\n}\n\nexport default Stars;\n","/**\n * Internal dependencies\n */\nimport Stars from './stars';\n\nexport const BlockRatings = ( { rating } ) => (\n\t<span className=\"block-directory-block-ratings\">\n\t\t<Stars rating={ rating } />\n\t</span>\n);\n\nexport default BlockRatings;\n","/**\n * WordPress dependencies\n */\nimport { BlockIcon } from '@wordpress/block-editor';\n\nfunction DownloadableBlockIcon( { icon } ) {\n\tconst className = 'block-directory-downloadable-block-icon';\n\treturn icon.match( /\\.(jpeg|jpg|gif|png|svg)(?:\\?.*)?$/ ) !== null ? (\n\t\t<img className={ className } src={ icon } alt=\"\" />\n\t) : (\n\t\t<BlockIcon className={ className } icon={ icon } showColors />\n\t);\n}\n\nexport default DownloadableBlockIcon;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport const DownloadableBlockNotice = ( { block } ) => {\n\tconst errorNotice = useSelect(\n\t\t( select ) =>\n\t\t\tselect( blockDirectoryStore ).getErrorNoticeForBlock( block.id ),\n\t\t[ block ]\n\t);\n\n\tif ( ! errorNotice ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<div className=\"block-directory-downloadable-block-notice\">\n\t\t\t<div className=\"block-directory-downloadable-block-notice__content\">\n\t\t\t\t{ errorNotice.message }\n\t\t\t\t{ errorNotice.isFatal\n\t\t\t\t\t? ' ' + __( 'Try reloading the page.' )\n\t\t\t\t\t: null }\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\nexport default DownloadableBlockNotice;\n","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport {\n\tButton,\n\tSpinner,\n\tVisuallyHidden,\n\t__unstableCompositeItem as CompositeItem,\n} from '@wordpress/components';\nimport { createInterpolateElement } from '@wordpress/element';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport BlockRatings from '../block-ratings';\nimport DownloadableBlockIcon from '../downloadable-block-icon';\nimport DownloadableBlockNotice from '../downloadable-block-notice';\nimport { store as blockDirectoryStore } from '../../store';\n\n// Return the appropriate block item label, given the block data and status.\nfunction getDownloadableBlockLabel(\n\t{ title, rating, ratingCount },\n\t{ hasNotice, isInstalled, isInstalling }\n) {\n\tconst stars = Math.round( rating / 0.5 ) * 0.5;\n\n\tif ( ! isInstalled && hasNotice ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Retry installing %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalled ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Add %s.', decodeEntities( title ) );\n\t}\n\n\tif ( isInstalling ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Installing %s.', decodeEntities( title ) );\n\t}\n\n\t// No ratings yet, just use the title.\n\tif ( ratingCount < 1 ) {\n\t\t/* translators: %1$s: block title */\n\t\treturn sprintf( 'Install %s.', decodeEntities( title ) );\n\t}\n\n\treturn sprintf(\n\t\t/* translators: %1$s: block title, %2$s: average rating, %3$s: total ratings count. */\n\t\t_n(\n\t\t\t'Install %1$s. %2$s stars with %3$s review.',\n\t\t\t'Install %1$s. %2$s stars with %3$s reviews.',\n\t\t\tratingCount\n\t\t),\n\t\tdecodeEntities( title ),\n\t\tstars,\n\t\tratingCount\n\t);\n}\n\nfunction DownloadableBlockListItem( { composite, item, onClick } ) {\n\tconst { author, description, icon, rating, title } = item;\n\t// getBlockType returns a block object if this block exists, or null if not.\n\tconst isInstalled = !! getBlockType( item.name );\n\n\tconst { hasNotice, isInstalling, isInstallable } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getErrorNoticeForBlock, isInstalling: isBlockInstalling } =\n\t\t\t\tselect( blockDirectoryStore );\n\t\t\tconst notice = getErrorNoticeForBlock( item.id );\n\t\t\tconst hasFatal = notice && notice.isFatal;\n\t\t\treturn {\n\t\t\t\thasNotice: !! notice,\n\t\t\t\tisInstalling: isBlockInstalling( item.id ),\n\t\t\t\tisInstallable: ! hasFatal,\n\t\t\t};\n\t\t},\n\t\t[ item ]\n\t);\n\n\tlet statusText = '';\n\tif ( isInstalled ) {\n\t\tstatusText = __( 'Installed!' );\n\t} else if ( isInstalling ) {\n\t\tstatusText = __( 'Installing…' );\n\t}\n\n\treturn (\n\t\t<CompositeItem\n\t\t\t__experimentalIsFocusable\n\t\t\trole=\"option\"\n\t\t\tas={ Button }\n\t\t\t{ ...composite }\n\t\t\tclassName=\"block-directory-downloadable-block-list-item\"\n\t\t\tonClick={ ( event ) => {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tisBusy={ isInstalling }\n\t\t\tdisabled={ isInstalling || ! isInstallable }\n\t\t\tlabel={ getDownloadableBlockLabel( item, {\n\t\t\t\thasNotice,\n\t\t\t\tisInstalled,\n\t\t\t\tisInstalling,\n\t\t\t} ) }\n\t\t\tshowTooltip={ true }\n\t\t\ttooltipPosition=\"top center\"\n\t\t>\n\t\t\t<div className=\"block-directory-downloadable-block-list-item__icon\">\n\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\t\t\t\t{ isInstalling ? (\n\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__spinner\">\n\t\t\t\t\t\t<Spinner />\n\t\t\t\t\t</span>\n\t\t\t\t) : (\n\t\t\t\t\t<BlockRatings rating={ rating } />\n\t\t\t\t) }\n\t\t\t</div>\n\t\t\t<span className=\"block-directory-downloadable-block-list-item__details\">\n\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__title\">\n\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\tsprintf(\n\t\t\t\t\t\t\t/* translators: %1$s: block title, %2$s: author name. */\n\t\t\t\t\t\t\t__( '%1$s <span>by %2$s</span>' ),\n\t\t\t\t\t\t\tdecodeEntities( title ),\n\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tspan: (\n\t\t\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__author\" />\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t</span>\n\t\t\t\t{ hasNotice ? (\n\t\t\t\t\t<DownloadableBlockNotice block={ item } />\n\t\t\t\t) : (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<span className=\"block-directory-downloadable-block-list-item__desc\">\n\t\t\t\t\t\t\t{ !! statusText\n\t\t\t\t\t\t\t\t? statusText\n\t\t\t\t\t\t\t\t: decodeEntities( description ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t{ isInstallable &&\n\t\t\t\t\t\t\t! ( isInstalled || isInstalling ) && (\n\t\t\t\t\t\t\t\t<VisuallyHidden>\n\t\t\t\t\t\t\t\t\t{ __( 'Install block' ) }\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</span>\n\t\t</CompositeItem>\n\t);\n}\n\nexport default DownloadableBlockListItem;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport {\n\t__unstableComposite as Composite,\n\t__unstableUseCompositeState as useCompositeState,\n} from '@wordpress/components';\nimport { getBlockType } from '@wordpress/blocks';\nimport { useDispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockListItem from '../downloadable-block-list-item';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst noop = () => {};\n\nfunction DownloadableBlocksList( { items, onHover = noop, onSelect } ) {\n\tconst composite = useCompositeState();\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Composite\n\t\t\t{ ...composite }\n\t\t\trole=\"listbox\"\n\t\t\tclassName=\"block-directory-downloadable-blocks-list\"\n\t\t\taria-label={ __( 'Blocks available for install' ) }\n\t\t>\n\t\t\t{ items.map( ( item ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlockListItem\n\t\t\t\t\t\tkey={ item.id }\n\t\t\t\t\t\tcomposite={ composite }\n\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t// Check if the block is registered (`getBlockType`\n\t\t\t\t\t\t\t// will return an object). If so, insert the block.\n\t\t\t\t\t\t\t// This prevents installing existing plugins.\n\t\t\t\t\t\t\tif ( getBlockType( item.name ) ) {\n\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tinstallBlockType( item ).then( ( success ) => {\n\t\t\t\t\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\t\t\t\t\tonSelect( item );\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonHover( null );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\titem={ item }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</Composite>\n\t);\n}\n\nexport default DownloadableBlocksList;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"a11y\"];","/**\n * WordPress dependencies\n */\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { speak } from '@wordpress/a11y';\n\nfunction DownloadableBlocksInserterPanel( {\n\tchildren,\n\tdownloadableItems,\n\thasLocalBlocks,\n} ) {\n\tconst count = downloadableItems.length;\n\tuseEffect( () => {\n\t\tspeak(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %d: number of available blocks. */\n\t\t\t\t_n(\n\t\t\t\t\t'%d additional block is available to install.',\n\t\t\t\t\t'%d additional blocks are available to install.',\n\t\t\t\t\tcount\n\t\t\t\t),\n\t\t\t\tcount\n\t\t\t)\n\t\t);\n\t}, [ count ] );\n\n\treturn (\n\t\t<>\n\t\t\t{ ! hasLocalBlocks && (\n\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t{ __( 'No results available from your installed blocks.' ) }\n\t\t\t\t</p>\n\t\t\t) }\n\n\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\n\t\t\t<div className=\"block-directory-downloadable-blocks-panel\">\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel__header\">\n\t\t\t\t\t<h2 className=\"block-directory-downloadable-blocks-panel__title\">\n\t\t\t\t\t\t{ __( 'Available to install' ) }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Select a block to install and add it to your post.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</p>\n\t\t\t\t</div>\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksInserterPanel;\n","/**\n * WordPress dependencies\n */\nimport { SVG, Path } from '@wordpress/primitives';\n\nconst blockDefault = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z\" />\n\t</SVG>\n);\n\nexport default blockDefault;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Icon, blockDefault } from '@wordpress/icons';\nimport { Tip, ExternalLink } from '@wordpress/components';\n\nfunction DownloadableBlocksNoResults() {\n\treturn (\n\t\t<>\n\t\t\t<div className=\"block-editor-inserter__no-results\">\n\t\t\t\t<Icon\n\t\t\t\t\tclassName=\"block-editor-inserter__no-results-icon\"\n\t\t\t\t\ticon={ blockDefault }\n\t\t\t\t/>\n\t\t\t\t<p>{ __( 'No results found.' ) }</p>\n\t\t\t</div>\n\t\t\t<div className=\"block-editor-inserter__tips\">\n\t\t\t\t<Tip>\n\t\t\t\t\t{ __( 'Interested in creating your own block?' ) }\n\t\t\t\t\t<br />\n\t\t\t\t\t<ExternalLink href=\"https://developer.wordpress.org/block-editor/\">\n\t\t\t\t\t\t{ __( 'Get started here' ) }.\n\t\t\t\t\t</ExternalLink>\n\t\t\t\t</Tip>\n\t\t\t</div>\n\t\t</>\n\t);\n}\n\nexport default DownloadableBlocksNoResults;\n","/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Spinner } from '@wordpress/components';\nimport { compose } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { withSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksList from '../downloadable-blocks-list';\nimport DownloadableBlocksInserterPanel from './inserter-panel';\nimport DownloadableBlocksNoResults from './no-results';\nimport { store as blockDirectoryStore } from '../../store';\n\nfunction DownloadableBlocksPanel( {\n\tdownloadableItems,\n\tonSelect,\n\tonHover,\n\thasLocalBlocks,\n\thasPermission,\n\tisLoading,\n\tisTyping,\n} ) {\n\tif ( typeof hasPermission === 'undefined' || isLoading || isTyping ) {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ hasPermission && ! hasLocalBlocks && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<p className=\"block-directory-downloadable-blocks-panel__no-local\">\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'No results available from your installed blocks.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</p>\n\t\t\t\t\t\t<div className=\"block-editor-inserter__quick-inserter-separator\" />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<div className=\"block-directory-downloadable-blocks-panel has-blocks-loading\">\n\t\t\t\t\t<Spinner />\n\t\t\t\t</div>\n\t\t\t</>\n\t\t);\n\t}\n\n\tif ( false === hasPermission ) {\n\t\tif ( ! hasLocalBlocks ) {\n\t\t\treturn <DownloadableBlocksNoResults />;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\treturn !! downloadableItems.length ? (\n\t\t<DownloadableBlocksInserterPanel\n\t\t\tdownloadableItems={ downloadableItems }\n\t\t\thasLocalBlocks={ hasLocalBlocks }\n\t\t>\n\t\t\t<DownloadableBlocksList\n\t\t\t\titems={ downloadableItems }\n\t\t\t\tonSelect={ onSelect }\n\t\t\t\tonHover={ onHover }\n\t\t\t/>\n\t\t</DownloadableBlocksInserterPanel>\n\t) : (\n\t\t! hasLocalBlocks && <DownloadableBlocksNoResults />\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select, { filterValue, rootClientId = null } ) => {\n\t\tconst { getDownloadableBlocks, isRequestingDownloadableBlocks } =\n\t\t\tselect( blockDirectoryStore );\n\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\n\t\tconst hasPermission = select( coreStore ).canUser(\n\t\t\t'read',\n\t\t\t'block-directory/search'\n\t\t);\n\n\t\tfunction getInstallableBlocks( term ) {\n\t\t\treturn getDownloadableBlocks( term ).filter( ( block ) =>\n\t\t\t\tcanInsertBlockType( block, rootClientId, true )\n\t\t\t);\n\t\t}\n\n\t\tconst downloadableItems = hasPermission\n\t\t\t? getInstallableBlocks( filterValue )\n\t\t\t: [];\n\t\tconst isLoading = isRequestingDownloadableBlocks( filterValue );\n\n\t\treturn {\n\t\t\tdownloadableItems,\n\t\t\thasPermission,\n\t\t\tisLoading,\n\t\t};\n\t} ),\n] )( DownloadableBlocksPanel );\n","/**\n * External dependencies\n */\nimport { debounce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { __unstableInserterMenuExtension } from '@wordpress/block-editor';\nimport { useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlocksPanel from '../../components/downloadable-blocks-panel';\n\nfunction InserterMenuDownloadableBlocksPanel() {\n\tconst [ debouncedFilterValue, setFilterValue ] = useState( '' );\n\tconst debouncedSetFilterValue = debounce( setFilterValue, 400 );\n\n\treturn (\n\t\t<__unstableInserterMenuExtension>\n\t\t\t{ ( {\n\t\t\t\tonSelect,\n\t\t\t\tonHover,\n\t\t\t\tfilterValue,\n\t\t\t\thasItems,\n\t\t\t\trootClientId,\n\t\t\t} ) => {\n\t\t\t\tif ( debouncedFilterValue !== filterValue ) {\n\t\t\t\t\tdebouncedSetFilterValue( filterValue );\n\t\t\t\t}\n\n\t\t\t\tif ( ! debouncedFilterValue ) {\n\t\t\t\t\treturn null;\n\t\t\t\t}\n\n\t\t\t\treturn (\n\t\t\t\t\t<DownloadableBlocksPanel\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\tonHover={ onHover }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tfilterValue={ debouncedFilterValue }\n\t\t\t\t\t\thasLocalBlocks={ hasItems }\n\t\t\t\t\t\tisTyping={ filterValue !== debouncedFilterValue }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t</__unstableInserterMenuExtension>\n\t);\n}\n\nexport default InserterMenuDownloadableBlocksPanel;\n","const __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"editPost\"];","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport DownloadableBlockIcon from '../downloadable-block-icon';\n\nexport default function CompactList( { items } ) {\n\tif ( ! items.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ul className=\"block-directory-compact-list\">\n\t\t\t{ items.map( ( { icon, id, title, author } ) => (\n\t\t\t\t<li key={ id } className=\"block-directory-compact-list__item\">\n\t\t\t\t\t<DownloadableBlockIcon icon={ icon } title={ title } />\n\n\t\t\t\t\t<div className=\"block-directory-compact-list__item-details\">\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-title\">\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div className=\"block-directory-compact-list__item-author\">\n\t\t\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: Name of the block author. */\n\t\t\t\t\t\t\t\t__( 'By %s' ),\n\t\t\t\t\t\t\t\tauthor\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t) ) }\n\t\t</ul>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { _n, sprintf } from '@wordpress/i18n';\nimport { PluginPrePublishPanel } from '@wordpress/edit-post';\nimport { useSelect } from '@wordpress/data';\nimport { blockDefault } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport CompactList from '../../components/compact-list';\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstalledBlocksPrePublishPanel() {\n\tconst newBlockTypes = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).getNewBlockTypes(),\n\t\t[]\n\t);\n\n\tif ( ! newBlockTypes.length ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PluginPrePublishPanel\n\t\t\ticon={ blockDefault }\n\t\t\ttitle={ sprintf(\n\t\t\t\t// translators: %d: number of blocks (number).\n\t\t\t\t_n(\n\t\t\t\t\t'Added: %d block',\n\t\t\t\t\t'Added: %d blocks',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t),\n\t\t\t\tnewBlockTypes.length\n\t\t\t) }\n\t\t\tinitialOpen={ true }\n\t\t>\n\t\t\t<p className=\"installed-blocks-pre-publish-panel__copy\">\n\t\t\t\t{ _n(\n\t\t\t\t\t'The following block has been added to your site.',\n\t\t\t\t\t'The following blocks have been added to your site.',\n\t\t\t\t\tnewBlockTypes.length\n\t\t\t\t) }\n\t\t\t</p>\n\t\t\t<CompactList items={ newBlockTypes } />\n\t\t</PluginPrePublishPanel>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType, parse } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { store as blockDirectoryStore } from '../../store';\n\nexport default function InstallButton( { attributes, block, clientId } ) {\n\tconst isInstallingBlock = useSelect(\n\t\t( select ) => select( blockDirectoryStore ).isInstalling( block.id ),\n\t\t[ block.id ]\n\t);\n\tconst { installBlockType } = useDispatch( blockDirectoryStore );\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\n\treturn (\n\t\t<Button\n\t\t\tonClick={ () =>\n\t\t\t\tinstallBlockType( block ).then( ( success ) => {\n\t\t\t\t\tif ( success ) {\n\t\t\t\t\t\tconst blockType = getBlockType( block.name );\n\t\t\t\t\t\tconst [ originalBlock ] = parse(\n\t\t\t\t\t\t\tattributes.originalContent\n\t\t\t\t\t\t);\n\t\t\t\t\t\tif ( originalBlock && blockType ) {\n\t\t\t\t\t\t\treplaceBlock(\n\t\t\t\t\t\t\t\tclientId,\n\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\tblockType.name,\n\t\t\t\t\t\t\t\t\toriginalBlock.attributes,\n\t\t\t\t\t\t\t\t\toriginalBlock.innerBlocks\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} )\n\t\t\t}\n\t\t\tdisabled={ isInstallingBlock }\n\t\t\tisBusy={ isInstallingBlock }\n\t\t\tvariant=\"primary\"\n\t\t>\n\t\t\t{ sprintf(\n\t\t\t\t/* translators: %s: block name */\n\t\t\t\t__( 'Install %s' ),\n\t\t\t\tblock.title\n\t\t\t) }\n\t\t</Button>\n\t);\n}\n","/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { createBlock, getBlockType } from '@wordpress/blocks';\nimport { RawHTML } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tWarning,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport InstallButton from './install-button';\nimport { store as blockDirectoryStore } from '../../store';\n\nconst getInstallMissing = ( OriginalComponent ) => ( props ) => {\n\tconst { originalName } = props.attributes;\n\t// Disable reason: This is a valid component, but it's mistaken for a callback.\n\t// eslint-disable-next-line react-hooks/rules-of-hooks\n\tconst { block, hasPermission } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getDownloadableBlocks } = select( blockDirectoryStore );\n\t\t\tconst blocks = getDownloadableBlocks(\n\t\t\t\t'block:' + originalName\n\t\t\t).filter( ( { name } ) => originalName === name );\n\t\t\treturn {\n\t\t\t\thasPermission: select( coreStore ).canUser(\n\t\t\t\t\t'read',\n\t\t\t\t\t'block-directory/search'\n\t\t\t\t),\n\t\t\t\tblock: blocks.length && blocks[ 0 ],\n\t\t\t};\n\t\t},\n\t\t[ originalName ]\n\t);\n\n\t// The user can't install blocks, or the block isn't available for download.\n\tif ( ! hasPermission || ! block ) {\n\t\treturn <OriginalComponent { ...props } />;\n\t}\n\n\treturn <ModifiedWarning { ...props } originalBlock={ block } />;\n};\n\nconst ModifiedWarning = ( { originalBlock, ...props } ) => {\n\tconst { originalName, originalUndelimitedContent } = props.attributes;\n\tconst { replaceBlock } = useDispatch( blockEditorStore );\n\tconst convertToHTML = () => {\n\t\treplaceBlock(\n\t\t\tprops.clientId,\n\t\t\tcreateBlock( 'core/html', {\n\t\t\t\tcontent: originalUndelimitedContent,\n\t\t\t} )\n\t\t);\n\t};\n\n\tconst hasContent = !! originalUndelimitedContent;\n\tconst hasHTMLBlock = getBlockType( 'core/html' );\n\n\tlet messageHTML = sprintf(\n\t\t/* translators: %s: block name */\n\t\t__(\n\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block or remove it entirely.'\n\t\t),\n\t\toriginalBlock.title || originalName\n\t);\n\tconst actions = [\n\t\t<InstallButton\n\t\t\tkey=\"install\"\n\t\t\tblock={ originalBlock }\n\t\t\tattributes={ props.attributes }\n\t\t\tclientId={ props.clientId }\n\t\t/>,\n\t];\n\n\tif ( hasContent && hasHTMLBlock ) {\n\t\tmessageHTML = sprintf(\n\t\t\t/* translators: %s: block name */\n\t\t\t__(\n\t\t\t\t'Your site doesn’t include support for the %s block. You can try installing the block, convert it to a Custom HTML block, or remove it entirely.'\n\t\t\t),\n\t\t\toriginalBlock.title || originalName\n\t\t);\n\t\tactions.push(\n\t\t\t<Button key=\"convert\" onClick={ convertToHTML } variant=\"link\">\n\t\t\t\t{ __( 'Keep as HTML' ) }\n\t\t\t</Button>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div { ...useBlockProps() }>\n\t\t\t<Warning actions={ actions }>{ messageHTML }</Warning>\n\t\t\t<RawHTML>{ originalUndelimitedContent }</RawHTML>\n\t\t</div>\n\t);\n};\n\nexport default getInstallMissing;\n","/**\n * WordPress dependencies\n */\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport AutoBlockUninstaller from '../components/auto-block-uninstaller';\nimport InserterMenuDownloadableBlocksPanel from './inserter-menu-downloadable-blocks-panel';\nimport InstalledBlocksPrePublishPanel from './installed-blocks-pre-publish-panel';\nimport getInstallMissing from './get-install-missing';\n\nregisterPlugin( 'block-directory', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<AutoBlockUninstaller />\n\t\t\t\t<InserterMenuDownloadableBlocksPanel />\n\t\t\t\t<InstalledBlocksPrePublishPanel />\n\t\t\t</>\n\t\t);\n\t},\n} );\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'block-directory/fallback',\n\t( settings, name ) => {\n\t\tif ( name !== 'core/missing' ) {\n\t\t\treturn settings;\n\t\t}\n\t\tsettings.edit = getInstallMissing( settings.edit );\n\n\t\treturn settings;\n\t}\n);\n"],"names":["__webpack_require__","module","getter","__esModule","d","a","exports","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","Symbol","toStringTag","value","window","combineReducers","downloadableBlocks","state","action","type","filterValue","isRequesting","results","blockManagement","installedBlockTypes","isInstalling","item","filter","blockType","name","blockId","errorNotices","message","isFatal","omit","hasBlockType","blocks","length","some","i","innerBlocks","isRequestingDownloadableBlocks","getDownloadableBlocks","getInstalledBlockTypes","getNewBlockTypes","createRegistrySelector","select","usedBlockTree","blockEditorStore","getBlocks","getUnusedBlockTypes","getErrorNotices","getErrorNoticeForBlock","loadAsset","el","Promise","resolve","reject","newNode","document","createElement","nodeName","forEach","attr","innerHTML","appendChild","createTextNode","onload","onerror","Error","body","toLowerCase","src","getPluginUrl","block","link","links","self","href","fetchDownloadableBlocks","receiveDownloadableBlocks","installBlockType","async","registry","dispatch","id","success","clearErrorNotice","setIsInstalling","url","apiFetch","method","data","status","path","slug","_links","addInstalledBlockType","metadataFields","addQueryArgs","_fields","catch","then","response","unstable__bootstrapServerSideBlockDefinitions","pick","location","parse","text","doc","DOMParser","parseFromString","newAssets","Array","from","querySelectorAll","asset","getElementById","newAsset","loadAssets","blocksStore","getBlockTypes","__","noticesStore","createInfoNotice","sprintf","title","speak","error","fatalAPIErrors","folder_exists","unable_to_connect_to_filesystem","code","setErrorNotice","createErrorNotice","isDismissible","uninstallBlockType","removeInstalledBlockType","__assign","assign","t","s","n","arguments","p","apply","this","lowerCase","str","create","DEFAULT_SPLIT_REGEXP","DEFAULT_STRIP_REGEXP","replace","input","re","RegExp","reduce","pascalCaseTransform","index","firstChar","charAt","lowerChars","substr","toUpperCase","pascalCase","options","splitRegexp","stripRegexp","transform","delimiter","result","start","end","slice","split","map","join","noCase","camelCaseTransform","fromEntries","entries","storeConfig","reducer","selectors","actions","resolvers","store","createReduxStore","AutoBlockUninstaller","useDispatch","blockDirectoryStore","shouldRemoveBlockTypes","useSelect","isAutosavingPost","isSavingPost","editorStore","unusedBlockTypes","useEffect","unregisterBlockType","register","_extends","target","source","icon","size","props","cloneElement","width","height","SVG","xmlns","viewBox","Path","fillRule","clipRule","rating","stars","Math","round","fullStarCount","floor","halfStarCount","ceil","emptyStarCount","_","className","starFilled","starHalf","starEmpty","match","alt","BlockIcon","showColors","errorNotice","getDownloadableBlockLabel","ratingCount","hasNotice","isInstalled","decodeEntities","_n","composite","onClick","author","description","getBlockType","isInstallable","isBlockInstalling","notice","hasFatal","statusText","__experimentalIsFocusable","role","as","Button","event","preventDefault","isBusy","disabled","label","showTooltip","tooltipPosition","Spinner","createInterpolateElement","span","VisuallyHidden","noop","items","onHover","onSelect","useCompositeState","children","downloadableItems","hasLocalBlocks","count","blockDefault","Tip","ExternalLink","compose","withSelect","rootClientId","canInsertBlockType","hasPermission","coreStore","canUser","isLoading","isTyping","debouncedFilterValue","setFilterValue","useState","debouncedSetFilterValue","debounce","__unstableInserterMenuExtension","hasItems","CompactList","InstalledBlocksPrePublishPanel","newBlockTypes","PluginPrePublishPanel","initialOpen","InstallButton","attributes","clientId","isInstallingBlock","replaceBlock","originalBlock","originalContent","createBlock","variant","ModifiedWarning","originalName","originalUndelimitedContent","hasContent","hasHTMLBlock","messageHTML","push","content","useBlockProps","Warning","RawHTML","registerPlugin","render","addFilter","settings","edit","OriginalComponent"],"sourceRoot":""}
|
build/block-editor/index.js
CHANGED
@@ -1731,6 +1731,432 @@ var TextareaAutosize_1 = __webpack_require__(5438);
|
|
1731 |
exports.Z = TextareaAutosize_1.TextareaAutosize;
|
1732 |
|
1733 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1734 |
/***/ }),
|
1735 |
|
1736 |
/***/ 3124:
|
@@ -2242,6 +2668,7 @@ __webpack_require__.d(__webpack_exports__, {
|
|
2242 |
"__experimentalPublishDateTimePicker": () => (/* reexport */ publish_date_time_picker),
|
2243 |
"__experimentalRecursionProvider": () => (/* reexport */ RecursionProvider),
|
2244 |
"__experimentalResponsiveBlockControl": () => (/* reexport */ responsive_block_control),
|
|
|
2245 |
"__experimentalTextDecorationControl": () => (/* reexport */ TextDecorationControl),
|
2246 |
"__experimentalTextTransformControl": () => (/* reexport */ TextTransformControl),
|
2247 |
"__experimentalUnitControl": () => (/* reexport */ UnitControl),
|
@@ -6738,12 +7165,10 @@ const getBlockTransformItems = rememo(function (state, blocks) {
|
|
6738 |
buildScope: 'transform'
|
6739 |
});
|
6740 |
const blockTypeTransformItems = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)).map(buildBlockTypeTransformItem);
|
6741 |
-
const itemsByName = (
|
6742 |
-
let
|
6743 |
-
|
6744 |
-
|
6745 |
-
return name;
|
6746 |
-
}); // Consider unwraping the highest priority.
|
6747 |
|
6748 |
itemsByName['*'] = {
|
6749 |
frecency: +Infinity,
|
@@ -8196,6 +8621,7 @@ const __unstableExpandSelection = () => _ref14 => {
|
|
8196 |
|
8197 |
const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref15 => {
|
8198 |
let {
|
|
|
8199 |
select,
|
8200 |
dispatch
|
8201 |
} = _ref15;
|
@@ -8206,14 +8632,35 @@ const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref15 => {
|
|
8206 |
});
|
8207 |
const [clientIdA, clientIdB] = blocks;
|
8208 |
const blockA = select.getBlock(clientIdA);
|
8209 |
-
const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name);
|
|
|
|
|
8210 |
|
8211 |
if (blockAType && !blockAType.merge) {
|
8212 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8213 |
return;
|
8214 |
}
|
8215 |
|
8216 |
-
const blockB = select.getBlock(clientIdB);
|
8217 |
const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name);
|
8218 |
const {
|
8219 |
clientId,
|
@@ -9158,6 +9605,10 @@ const arrowDown = (0,external_wp_element_namespaceObject.createElement)(external
|
|
9158 |
/* harmony default export */ const arrow_down = (arrowDown);
|
9159 |
|
9160 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/utils.js
|
|
|
|
|
|
|
|
|
9161 |
/**
|
9162 |
* Utility to generate the proper CSS selector for layout styles.
|
9163 |
*
|
@@ -9166,6 +9617,7 @@ const arrowDown = (0,external_wp_element_namespaceObject.createElement)(external
|
|
9166 |
*
|
9167 |
* @return {string} - CSS selector.
|
9168 |
*/
|
|
|
9169 |
function appendSelectors(selectors) {
|
9170 |
let append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
9171 |
// Ideally we shouldn't need the `.editor-styles-wrapper` increased specificity here
|
@@ -9205,6 +9657,41 @@ function getBlockGapCSS(selector, layoutDefinitions, layoutType, blockGapValue)
|
|
9205 |
|
9206 |
return output;
|
9207 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9208 |
|
9209 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/provider/block-refs-provider.js
|
9210 |
|
@@ -9341,6 +9828,181 @@ function useBlockElement(clientId) {
|
|
9341 |
|
9342 |
|
9343 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9344 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/use-setting/index.js
|
9345 |
/**
|
9346 |
* External dependencies
|
@@ -9910,13 +10572,15 @@ function usePopoverScroll(scrollableRef) {
|
|
9910 |
|
9911 |
|
9912 |
|
|
|
9913 |
/**
|
9914 |
* Internal dependencies
|
9915 |
*/
|
9916 |
|
9917 |
|
9918 |
|
9919 |
-
|
|
|
9920 |
let {
|
9921 |
clientId,
|
9922 |
bottomClientId,
|
@@ -9929,7 +10593,7 @@ function BlockPopover(_ref) {
|
|
9929 |
} = _ref;
|
9930 |
const selectedElement = useBlockElement(clientId);
|
9931 |
const lastSelectedElement = useBlockElement(bottomClientId !== null && bottomClientId !== void 0 ? bottomClientId : clientId);
|
9932 |
-
const
|
9933 |
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
9934 |
if (!selectedElement || lastSelectedElement !== selectedElement) {
|
9935 |
return {};
|
@@ -9951,7 +10615,7 @@ function BlockPopover(_ref) {
|
|
9951 |
bottom: lastSelectedElement
|
9952 |
};
|
9953 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
|
9954 |
-
ref:
|
9955 |
animate: false,
|
9956 |
position: "top right left",
|
9957 |
focusOnMount: false,
|
@@ -9970,6 +10634,501 @@ function BlockPopover(_ref) {
|
|
9970 |
}, children), !__unstableCoverTarget && children);
|
9971 |
}
|
9972 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9973 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/margin.js
|
9974 |
|
9975 |
|
@@ -9989,6 +11148,8 @@ function BlockPopover(_ref) {
|
|
9989 |
|
9990 |
|
9991 |
|
|
|
|
|
9992 |
/**
|
9993 |
* Determines if there is margin support.
|
9994 |
*
|
@@ -10063,7 +11224,7 @@ function useIsMarginDisabled() {
|
|
10063 |
*/
|
10064 |
|
10065 |
function MarginEdit(props) {
|
10066 |
-
var _style$spacing;
|
10067 |
|
10068 |
const {
|
10069 |
name: blockName,
|
@@ -10072,6 +11233,7 @@ function MarginEdit(props) {
|
|
10072 |
},
|
10073 |
setAttributes
|
10074 |
} = props;
|
|
|
10075 |
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
10076 |
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
10077 |
});
|
@@ -10094,7 +11256,7 @@ function MarginEdit(props) {
|
|
10094 |
};
|
10095 |
|
10096 |
return external_wp_element_namespaceObject.Platform.select({
|
10097 |
-
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
10098 |
values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.margin,
|
10099 |
onChange: onChange,
|
10100 |
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
@@ -10102,6 +11264,14 @@ function MarginEdit(props) {
|
|
10102 |
units: units,
|
10103 |
allowReset: false,
|
10104 |
splitOnAxis: splitOnAxis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10105 |
})),
|
10106 |
native: null
|
10107 |
});
|
@@ -10114,18 +11284,21 @@ function MarginVisualizer(_ref2) {
|
|
10114 |
attributes
|
10115 |
} = _ref2;
|
10116 |
const margin = attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$spa = _attributes$style.spacing) === null || _attributes$style$spa === void 0 ? void 0 : _attributes$style$spa.margin;
|
|
|
10117 |
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
10118 |
-
|
10119 |
-
|
|
|
|
|
10120 |
return {
|
10121 |
-
borderTopWidth:
|
10122 |
-
borderRightWidth:
|
10123 |
-
borderBottomWidth:
|
10124 |
-
borderLeftWidth:
|
10125 |
-
top:
|
10126 |
-
right:
|
10127 |
-
bottom:
|
10128 |
-
left:
|
10129 |
};
|
10130 |
}, [margin]);
|
10131 |
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
|
@@ -10155,7 +11328,7 @@ function MarginVisualizer(_ref2) {
|
|
10155 |
return null;
|
10156 |
}
|
10157 |
|
10158 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
10159 |
clientId: clientId,
|
10160 |
__unstableCoverTarget: true,
|
10161 |
__unstableRefreshSize: margin
|
@@ -10184,6 +11357,8 @@ function MarginVisualizer(_ref2) {
|
|
10184 |
|
10185 |
|
10186 |
|
|
|
|
|
10187 |
/**
|
10188 |
* Determines if there is padding support.
|
10189 |
*
|
@@ -10258,7 +11433,7 @@ function useIsPaddingDisabled() {
|
|
10258 |
*/
|
10259 |
|
10260 |
function PaddingEdit(props) {
|
10261 |
-
var _style$spacing;
|
10262 |
|
10263 |
const {
|
10264 |
name: blockName,
|
@@ -10267,6 +11442,7 @@ function PaddingEdit(props) {
|
|
10267 |
},
|
10268 |
setAttributes
|
10269 |
} = props;
|
|
|
10270 |
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
10271 |
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
10272 |
});
|
@@ -10289,7 +11465,7 @@ function PaddingEdit(props) {
|
|
10289 |
};
|
10290 |
|
10291 |
return external_wp_element_namespaceObject.Platform.select({
|
10292 |
-
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
10293 |
values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.padding,
|
10294 |
onChange: onChange,
|
10295 |
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
@@ -10297,6 +11473,14 @@ function PaddingEdit(props) {
|
|
10297 |
units: units,
|
10298 |
allowReset: false,
|
10299 |
splitOnAxis: splitOnAxis
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
10300 |
})),
|
10301 |
native: null
|
10302 |
});
|
@@ -10310,13 +11494,11 @@ function PaddingVisualizer(_ref2) {
|
|
10310 |
} = _ref2;
|
10311 |
const padding = attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$spa = _attributes$style.spacing) === null || _attributes$style$spa === void 0 ? void 0 : _attributes$style$spa.padding;
|
10312 |
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
10313 |
-
var _padding$top, _padding$right, _padding$bottom, _padding$left;
|
10314 |
-
|
10315 |
return {
|
10316 |
-
borderTopWidth: (
|
10317 |
-
borderRightWidth: (
|
10318 |
-
borderBottomWidth: (
|
10319 |
-
borderLeftWidth: (
|
10320 |
};
|
10321 |
}, [padding]);
|
10322 |
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
|
@@ -10346,7 +11528,7 @@ function PaddingVisualizer(_ref2) {
|
|
10346 |
return null;
|
10347 |
}
|
10348 |
|
10349 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
10350 |
clientId: clientId,
|
10351 |
__unstableCoverTarget: true,
|
10352 |
__unstableRefreshSize: padding
|
@@ -10359,6 +11541,10 @@ function PaddingVisualizer(_ref2) {
|
|
10359 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/dimensions.js
|
10360 |
|
10361 |
|
|
|
|
|
|
|
|
|
10362 |
/**
|
10363 |
* WordPress dependencies
|
10364 |
*/
|
@@ -10366,6 +11552,7 @@ function PaddingVisualizer(_ref2) {
|
|
10366 |
|
10367 |
|
10368 |
|
|
|
10369 |
/**
|
10370 |
* Internal dependencies
|
10371 |
*/
|
@@ -10374,8 +11561,9 @@ function PaddingVisualizer(_ref2) {
|
|
10374 |
|
10375 |
|
10376 |
|
|
|
10377 |
const SPACING_SUPPORT_KEY = 'spacing';
|
10378 |
-
const
|
10379 |
const AXIAL_SIDES = ['vertical', 'horizontal'];
|
10380 |
/**
|
10381 |
* Inspector controls for dimensions support.
|
@@ -10391,6 +11579,7 @@ function DimensionsPanel(props) {
|
|
10391 |
const isMarginDisabled = useIsMarginDisabled(props);
|
10392 |
const isDisabled = useIsDimensionsDisabled(props);
|
10393 |
const isSupported = hasDimensionsSupport(props.name);
|
|
|
10394 |
|
10395 |
if (isDisabled || !isSupported) {
|
10396 |
return null;
|
@@ -10413,6 +11602,9 @@ function DimensionsPanel(props) {
|
|
10413 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
10414 |
__experimentalGroup: "dimensions"
|
10415 |
}, !isPaddingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
|
|
|
|
|
|
10416 |
hasValue: () => hasPaddingValue(props),
|
10417 |
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
10418 |
onDeselect: () => resetPadding(props),
|
@@ -10420,6 +11612,9 @@ function DimensionsPanel(props) {
|
|
10420 |
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.padding,
|
10421 |
panelId: props.clientId
|
10422 |
}, (0,external_wp_element_namespaceObject.createElement)(PaddingEdit, props)), !isMarginDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
|
|
|
|
|
|
10423 |
hasValue: () => hasMarginValue(props),
|
10424 |
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
10425 |
onDeselect: () => resetMargin(props),
|
@@ -10512,7 +11707,7 @@ function useCustomSides(blockName, feature) {
|
|
10512 |
function useIsDimensionsSupportValid(blockName, feature) {
|
10513 |
const sides = useCustomSides(blockName, feature);
|
10514 |
|
10515 |
-
if (sides && sides.some(side =>
|
10516 |
// eslint-disable-next-line no-console
|
10517 |
console.warn(`The ${feature} support for the "${blockName}" block can not be configured to support both axial and arbitrary sides.`);
|
10518 |
return false;
|
@@ -10539,6 +11734,7 @@ function useIsDimensionsSupportValid(blockName, feature) {
|
|
10539 |
|
10540 |
|
10541 |
|
|
|
10542 |
/**
|
10543 |
* Determines if there is gap support.
|
10544 |
*
|
@@ -10578,8 +11774,8 @@ function getGapBoxControlValueFromStyle(blockGapValue) {
|
|
10578 |
|
10579 |
const isValueString = typeof blockGapValue === 'string';
|
10580 |
return {
|
10581 |
-
top: isValueString ? blockGapValue : blockGapValue === null || blockGapValue === void 0 ? void 0 : blockGapValue.top,
|
10582 |
-
left: isValueString ? blockGapValue : blockGapValue === null || blockGapValue === void 0 ? void 0 : blockGapValue.left
|
10583 |
};
|
10584 |
}
|
10585 |
/**
|
@@ -11065,7 +12261,7 @@ const flexWrapOptions = ['wrap', 'nowrap'];
|
|
11065 |
} = layout; // If a block's block.json skips serialization for spacing or spacing.blockGap,
|
11066 |
// don't apply the user-defined value to the styles.
|
11067 |
|
11068 |
-
const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap) : undefined;
|
11069 |
const justifyContent = justifyContentMap[layout.justifyContent];
|
11070 |
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
|
11071 |
const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment];
|
@@ -11284,6 +12480,102 @@ function OrientationControl(_ref8) {
|
|
11284 |
}));
|
11285 |
}
|
11286 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
11287 |
;// CONCATENATED MODULE: ./packages/icons/build-module/icon/index.js
|
11288 |
/**
|
11289 |
* WordPress dependencies
|
@@ -11383,11 +12675,11 @@ function generateRule(style, options, path, ruleKey) {
|
|
11383 |
/**
|
11384 |
* Returns a JSON representation of the generated CSS rules taking into account box model properties, top, right, bottom, left.
|
11385 |
*
|
11386 |
-
* @param
|
11387 |
-
* @param
|
11388 |
-
* @param
|
11389 |
-
* @param
|
11390 |
-
* @param
|
11391 |
*
|
11392 |
* @return GeneratedCSSRule[] CSS rules.
|
11393 |
*/
|
@@ -11653,6 +12945,12 @@ const fontWeight = {
|
|
11653 |
return generateRule(style, options, ['typography', 'fontWeight'], 'fontWeight');
|
11654 |
}
|
11655 |
};
|
|
|
|
|
|
|
|
|
|
|
|
|
11656 |
const letterSpacing = {
|
11657 |
name: 'letterSpacing',
|
11658 |
generate: (style, options) => {
|
@@ -11677,7 +12975,7 @@ const textTransform = {
|
|
11677 |
return generateRule(style, options, ['typography', 'textTransform'], 'textTransform');
|
11678 |
}
|
11679 |
};
|
11680 |
-
/* harmony default export */ const typography = ([fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textDecoration, textTransform]);
|
11681 |
|
11682 |
;// CONCATENATED MODULE: ./packages/style-engine/build-module/styles/index.js
|
11683 |
/**
|
@@ -11702,13 +13000,14 @@ const styleDefinitions = [...border, ...styles_color, ...spacing, ...typography]
|
|
11702 |
/**
|
11703 |
* Generates a stylesheet for a given style object and selector.
|
11704 |
*
|
11705 |
-
* @param style Style object.
|
11706 |
* @param options Options object with settings to adjust how the styles are generated.
|
11707 |
*
|
11708 |
* @return generated stylesheet.
|
11709 |
*/
|
11710 |
|
11711 |
-
function
|
|
|
11712 |
const rules = getCSSRules(style, options); // If no selector is provided, treat generated rules as inline styles to be returned as a single string.
|
11713 |
|
11714 |
if (!(options !== null && options !== void 0 && options.selector)) {
|
@@ -11729,13 +13028,14 @@ function generate(style, options) {
|
|
11729 |
/**
|
11730 |
* Returns a JSON representation of the generated CSS rules.
|
11731 |
*
|
11732 |
-
* @param style Style object.
|
11733 |
* @param options Options object with settings to adjust how the styles are generated.
|
11734 |
*
|
11735 |
* @return generated styles.
|
11736 |
*/
|
11737 |
|
11738 |
-
function getCSSRules(style
|
|
|
11739 |
const rules = [];
|
11740 |
styleDefinitions.forEach(definition => {
|
11741 |
if (typeof definition.generate === 'function') {
|
@@ -11745,7 +13045,7 @@ function getCSSRules(style, options) {
|
|
11745 |
return rules;
|
11746 |
}
|
11747 |
|
11748 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/
|
11749 |
|
11750 |
|
11751 |
/**
|
@@ -11763,9 +13063,9 @@ function getCSSRules(style, options) {
|
|
11763 |
|
11764 |
|
11765 |
|
11766 |
-
/* harmony default export */ const
|
11767 |
-
name: '
|
11768 |
-
label: (0,external_wp_i18n_namespaceObject.__)('
|
11769 |
inspectorControls: function DefaultLayoutInspectorControls(_ref) {
|
11770 |
let {
|
11771 |
layout,
|
@@ -11885,7 +13185,7 @@ function getCSSRules(style, options) {
|
|
11885 |
|
11886 |
|
11887 |
if (hasBlockGapSupport && blockGapValue) {
|
11888 |
-
output += getBlockGapCSS(selector, layoutDefinitions, '
|
11889 |
}
|
11890 |
|
11891 |
return output;
|
@@ -11942,41 +13242,6 @@ function getCSSRules(style, options) {
|
|
11942 |
}
|
11943 |
|
11944 |
});
|
11945 |
-
/**
|
11946 |
-
* Helper method to assign contextual info to clarify
|
11947 |
-
* alignment settings.
|
11948 |
-
*
|
11949 |
-
* Besides checking if `contentSize` and `wideSize` have a
|
11950 |
-
* value, we now show this information only if their values
|
11951 |
-
* are not a `css var`. This needs to change when parsing
|
11952 |
-
* css variables land.
|
11953 |
-
*
|
11954 |
-
* @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752
|
11955 |
-
*
|
11956 |
-
* @param {Object} layout The layout object.
|
11957 |
-
* @return {Object} An object with contextual info per alignment.
|
11958 |
-
*/
|
11959 |
-
|
11960 |
-
function getAlignmentsInfo(layout) {
|
11961 |
-
const {
|
11962 |
-
contentSize,
|
11963 |
-
wideSize
|
11964 |
-
} = layout;
|
11965 |
-
const alignmentInfo = {};
|
11966 |
-
const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;
|
11967 |
-
|
11968 |
-
if (sizeRegex.test(contentSize)) {
|
11969 |
-
// translators: %s: container size (i.e. 600px etc)
|
11970 |
-
alignmentInfo.none = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), contentSize);
|
11971 |
-
}
|
11972 |
-
|
11973 |
-
if (sizeRegex.test(wideSize)) {
|
11974 |
-
// translators: %s: container size (i.e. 600px etc)
|
11975 |
-
alignmentInfo.wide = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), wideSize);
|
11976 |
-
}
|
11977 |
-
|
11978 |
-
return alignmentInfo;
|
11979 |
-
}
|
11980 |
|
11981 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/index.js
|
11982 |
/**
|
@@ -11984,7 +13249,8 @@ function getAlignmentsInfo(layout) {
|
|
11984 |
*/
|
11985 |
|
11986 |
|
11987 |
-
|
|
|
11988 |
/**
|
11989 |
* Retrieves a layout type by name.
|
11990 |
*
|
@@ -12122,7 +13388,7 @@ function useAvailableAlignments() {
|
|
12122 |
} // Starting here, it's the fallback for themes not supporting the layout config.
|
12123 |
|
12124 |
|
12125 |
-
if (layoutType.name !== 'default') {
|
12126 |
return [];
|
12127 |
}
|
12128 |
|
@@ -12945,16 +14211,11 @@ function addTransforms(result, source, index, results) {
|
|
12945 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/color/addTransforms', addTransforms);
|
12946 |
|
12947 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/generated-class-name.js
|
12948 |
-
/**
|
12949 |
-
* External dependencies
|
12950 |
-
*/
|
12951 |
-
|
12952 |
/**
|
12953 |
* WordPress dependencies
|
12954 |
*/
|
12955 |
|
12956 |
|
12957 |
-
|
12958 |
/**
|
12959 |
* Override props assigned to save component to inject generated className if
|
12960 |
* block supports it. This is only applied if the block's save result is an
|
@@ -12972,7 +14233,7 @@ function addGeneratedClassName(extraProps, blockType) {
|
|
12972 |
if (typeof extraProps.className === 'string') {
|
12973 |
// We have some extra classes and want to add the default classname
|
12974 |
// We use uniq to prevent duplicate classnames.
|
12975 |
-
extraProps.className = (
|
12976 |
} else {
|
12977 |
// There is no string in the className variable,
|
12978 |
// so we just dump the default name in there.
|
@@ -18102,7 +19363,7 @@ function useFocusFirstElement(clientId) {
|
|
18102 |
ownerDocument
|
18103 |
} = ref.current; // Do not focus the block if it already contains the active element.
|
18104 |
|
18105 |
-
if (ref.current
|
18106 |
return;
|
18107 |
} // Find all tabbables within node.
|
18108 |
|
@@ -19747,9 +21008,11 @@ function useMultiSelection() {
|
|
19747 |
// able to select across instances immediately.
|
19748 |
|
19749 |
|
19750 |
-
node.contentEditable = true;
|
19751 |
-
|
|
|
19752 |
node.focus();
|
|
|
19753 |
}, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId, initialPosition, isFullSelection]);
|
19754 |
}
|
19755 |
|
@@ -20231,25 +21494,22 @@ function useSelectAll() {
|
|
20231 |
return;
|
20232 |
}
|
20233 |
|
|
|
20234 |
const [firstSelectedClientId] = selectedClientIds;
|
20235 |
const rootClientId = getBlockRootClientId(firstSelectedClientId);
|
20236 |
-
|
20237 |
// level. See: https://github.com/WordPress/gutenberg/pull/31859/
|
20238 |
|
20239 |
if (selectedClientIds.length === blockClientIds.length) {
|
20240 |
-
|
20241 |
-
|
20242 |
-
|
20243 |
-
|
20244 |
-
const lastClientId = (0,external_lodash_namespaceObject.last)(blockClientIds);
|
20245 |
|
20246 |
-
if (firstClientId === lastClientId) {
|
20247 |
-
selectBlock(firstClientId);
|
20248 |
return;
|
20249 |
}
|
20250 |
|
20251 |
-
multiSelect(
|
20252 |
-
event.preventDefault();
|
20253 |
}
|
20254 |
|
20255 |
node.addEventListener('keydown', onKeyDown);
|
@@ -20422,7 +21682,11 @@ function extractSelectionStartNode(selection) {
|
|
20422 |
return anchorNode;
|
20423 |
}
|
20424 |
|
20425 |
-
|
|
|
|
|
|
|
|
|
20426 |
}
|
20427 |
/**
|
20428 |
* Extract the selection end node from the selection. When the focus node is not
|
@@ -20445,7 +21709,11 @@ function extractSelectionEndNode(selection) {
|
|
20445 |
return focusNode;
|
20446 |
}
|
20447 |
|
20448 |
-
|
|
|
|
|
|
|
|
|
20449 |
}
|
20450 |
|
20451 |
function findDepth(a, b) {
|
@@ -22662,9 +23930,9 @@ function getValuesFromColors() {
|
|
22662 |
/**
|
22663 |
* SVG and stylesheet needed for rendering the duotone filter.
|
22664 |
*
|
22665 |
-
* @param {Object}
|
22666 |
-
* @param {string}
|
22667 |
-
* @param {string}
|
22668 |
*
|
22669 |
* @return {WPElement} Duotone element.
|
22670 |
*/
|
@@ -22684,8 +23952,8 @@ ${selector} {
|
|
22684 |
/**
|
22685 |
* Stylesheet for disabling a global styles duotone filter.
|
22686 |
*
|
22687 |
-
* @param {Object}
|
22688 |
-
* @param {string}
|
22689 |
*
|
22690 |
* @return {WPElement} Filter none style element.
|
22691 |
*/
|
@@ -24157,10 +25425,96 @@ function useInsertionPoint(_ref) {
|
|
24157 |
|
24158 |
/* harmony default export */ const use_insertion_point = (useInsertionPoint);
|
24159 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24160 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inserter/search-items.js
|
24161 |
/**
|
24162 |
* External dependencies
|
24163 |
*/
|
|
|
|
|
24164 |
// Default search helpers.
|
24165 |
|
24166 |
const defaultGetName = item => item.name || '';
|
@@ -24187,7 +25541,7 @@ function normalizeSearchInput() {
|
|
24187 |
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
24188 |
// Disregard diacritics.
|
24189 |
// Input: "média"
|
24190 |
-
input = (
|
24191 |
// Input: "/media"
|
24192 |
|
24193 |
input = input.replace(/^\//, ''); // Lowercase.
|
@@ -24196,6 +25550,19 @@ function normalizeSearchInput() {
|
|
24196 |
input = input.toLowerCase();
|
24197 |
return input;
|
24198 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
24199 |
/**
|
24200 |
* Converts the search term into a list of normalized terms.
|
24201 |
*
|
@@ -24207,8 +25574,7 @@ function normalizeSearchInput() {
|
|
24207 |
|
24208 |
const getNormalizedSearchTerms = function () {
|
24209 |
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
24210 |
-
|
24211 |
-
return (0,external_lodash_namespaceObject.words)(normalizeSearchInput(input));
|
24212 |
};
|
24213 |
|
24214 |
const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => {
|
@@ -24314,7 +25680,7 @@ function getItemSearchRank(item, searchTerm) {
|
|
24314 |
rank += 20;
|
24315 |
} else {
|
24316 |
const terms = [name, title, description, ...keywords, category, collection].join(' ');
|
24317 |
-
const normalizedSearchTerms = (
|
24318 |
const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms);
|
24319 |
|
24320 |
if (unmatchedTerms.length === 0) {
|
@@ -26027,9 +27393,11 @@ function BlockPopoverInbetween(_ref) {
|
|
26027 |
ownerDocument
|
26028 |
};
|
26029 |
}, [previousElement, nextElement]);
|
26030 |
-
const popoverScrollRef = use_popover_scroll(__unstableContentRef);
|
|
|
|
|
26031 |
|
26032 |
-
if (!previousElement
|
26033 |
return null;
|
26034 |
}
|
26035 |
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
@@ -28821,11 +30189,8 @@ const BlockSwitcherDropdownMenu = _ref => {
|
|
28821 |
canRemove,
|
28822 |
hasBlockStyles,
|
28823 |
icon,
|
28824 |
-
blockTitle,
|
28825 |
patterns
|
28826 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
28827 |
-
var _getBlockType2;
|
28828 |
-
|
28829 |
const {
|
28830 |
getBlockRootClientId,
|
28831 |
getBlockTransformItems,
|
@@ -28854,12 +30219,12 @@ const BlockSwitcherDropdownMenu = _ref => {
|
|
28854 |
} else {
|
28855 |
var _getBlockType;
|
28856 |
|
28857 |
-
const isSelectionOfSameType = (
|
28858 |
let {
|
28859 |
name
|
28860 |
} = _ref2;
|
28861 |
return name;
|
28862 |
-
})).
|
28863 |
// appropriate icon to communicate the non-uniformity.
|
28864 |
|
28865 |
_icon = isSelectionOfSameType ? (_getBlockType = getBlockType(firstBlockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon : library_copy;
|
@@ -28870,10 +30235,13 @@ const BlockSwitcherDropdownMenu = _ref => {
|
|
28870 |
canRemove: canRemoveBlocks(clientIds, rootClientId),
|
28871 |
hasBlockStyles: !!(styles !== null && styles !== void 0 && styles.length),
|
28872 |
icon: _icon,
|
28873 |
-
blockTitle: (_getBlockType2 = getBlockType(firstBlockName)) === null || _getBlockType2 === void 0 ? void 0 : _getBlockType2.title,
|
28874 |
patterns: __experimentalGetPatternTransformItems(blocks, rootClientId)
|
28875 |
};
|
28876 |
}, [clientIds, blocks, blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon]);
|
|
|
|
|
|
|
|
|
28877 |
const isReusable = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]);
|
28878 |
const isTemplate = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]); // Simple block tranformation based on the `Block Transforms` API.
|
28879 |
|
@@ -28901,10 +30269,7 @@ const BlockSwitcherDropdownMenu = _ref => {
|
|
28901 |
showColors: true
|
28902 |
}), (isReusable || isTemplate) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
28903 |
className: "block-editor-block-switcher__toggle-text"
|
28904 |
-
},
|
28905 |
-
clientId: clientIds,
|
28906 |
-
maximumLength: 35
|
28907 |
-
})))
|
28908 |
}));
|
28909 |
}
|
28910 |
|
@@ -28929,10 +30294,7 @@ const BlockSwitcherDropdownMenu = _ref => {
|
|
28929 |
showColors: true
|
28930 |
}), (isReusable || isTemplate) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
28931 |
className: "block-editor-block-switcher__toggle-text"
|
28932 |
-
},
|
28933 |
-
clientId: clientIds,
|
28934 |
-
maximumLength: 35
|
28935 |
-
}))),
|
28936 |
toggleProps: {
|
28937 |
describedBy: blockSwitcherDescription,
|
28938 |
...toggleProps
|
@@ -29232,6 +30594,12 @@ function useClipboardHandler() {
|
|
29232 |
blocks = [head, ...inBetweenBlocks, tail];
|
29233 |
}
|
29234 |
|
|
|
|
|
|
|
|
|
|
|
|
|
29235 |
const serialized = (0,external_wp_blocks_namespaceObject.serialize)(blocks);
|
29236 |
event.clipboardData.setData('text/plain', toPlainText(serialized));
|
29237 |
event.clipboardData.setData('text/html', serialized);
|
@@ -30343,63 +31711,6 @@ function BlockSettingsDropdown(_ref2) {
|
|
30343 |
}
|
30344 |
/* harmony default export */ const block_settings_dropdown = (BlockSettingsDropdown);
|
30345 |
|
30346 |
-
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-settings-menu/block-edit-visually-button.js
|
30347 |
-
|
30348 |
-
|
30349 |
-
|
30350 |
-
/**
|
30351 |
-
* WordPress dependencies
|
30352 |
-
*/
|
30353 |
-
|
30354 |
-
|
30355 |
-
|
30356 |
-
|
30357 |
-
|
30358 |
-
/**
|
30359 |
-
* Internal dependencies
|
30360 |
-
*/
|
30361 |
-
|
30362 |
-
|
30363 |
-
function BlockEditVisuallyButton(_ref) {
|
30364 |
-
let {
|
30365 |
-
clientIds,
|
30366 |
-
...props
|
30367 |
-
} = _ref;
|
30368 |
-
const {
|
30369 |
-
block,
|
30370 |
-
shouldRender
|
30371 |
-
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
30372 |
-
const firstBlockClientId = clientIds[0];
|
30373 |
-
const {
|
30374 |
-
isBlockMultiSelected,
|
30375 |
-
getBlockMode,
|
30376 |
-
getBlock
|
30377 |
-
} = select(store);
|
30378 |
-
const isSingleSelected = !isBlockMultiSelected(firstBlockClientId);
|
30379 |
-
const isHtmlMode = getBlockMode(firstBlockClientId) === 'html';
|
30380 |
-
return {
|
30381 |
-
block: getBlock(firstBlockClientId),
|
30382 |
-
shouldRender: isSingleSelected && isHtmlMode
|
30383 |
-
};
|
30384 |
-
}, [clientIds[0]]);
|
30385 |
-
const {
|
30386 |
-
replaceBlocks
|
30387 |
-
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
30388 |
-
const onClick = (0,external_wp_element_namespaceObject.useCallback)(() => {
|
30389 |
-
replaceBlocks(block.clientId, (0,external_wp_blocks_namespaceObject.rawHandler)({
|
30390 |
-
HTML: (0,external_wp_blocks_namespaceObject.getBlockContent)(block)
|
30391 |
-
}));
|
30392 |
-
}, [block]);
|
30393 |
-
|
30394 |
-
if (!shouldRender) {
|
30395 |
-
return null;
|
30396 |
-
}
|
30397 |
-
|
30398 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, _extends({
|
30399 |
-
onClick: onClick
|
30400 |
-
}, props), (0,external_wp_i18n_namespaceObject.__)('Edit visually')));
|
30401 |
-
}
|
30402 |
-
|
30403 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-settings-menu/index.js
|
30404 |
|
30405 |
|
@@ -30413,18 +31724,15 @@ function BlockEditVisuallyButton(_ref) {
|
|
30413 |
*/
|
30414 |
|
30415 |
|
30416 |
-
|
30417 |
function BlockSettingsMenu(_ref) {
|
30418 |
let {
|
30419 |
clientIds,
|
30420 |
...props
|
30421 |
} = _ref;
|
30422 |
-
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.
|
30423 |
-
clientIds: clientIds
|
30424 |
-
}, props)), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, toggleProps => (0,external_wp_element_namespaceObject.createElement)(block_settings_dropdown, _extends({
|
30425 |
clientIds: clientIds,
|
30426 |
toggleProps: toggleProps
|
30427 |
-
}, props))))
|
30428 |
}
|
30429 |
/* harmony default export */ const block_settings_menu = (BlockSettingsMenu);
|
30430 |
|
@@ -30633,6 +31941,42 @@ function BlockGroupToolbar() {
|
|
30633 |
|
30634 |
/* harmony default export */ const toolbar = (BlockGroupToolbar);
|
30635 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30636 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/block-name-context.js
|
30637 |
/**
|
30638 |
* WordPress dependencies
|
@@ -30676,6 +32020,7 @@ const __unstableBlockNameContext = (0,external_wp_element_namespaceObject.create
|
|
30676 |
|
30677 |
|
30678 |
|
|
|
30679 |
const BlockToolbar = _ref => {
|
30680 |
let {
|
30681 |
hideDragHandle
|
@@ -30783,7 +32128,9 @@ const BlockToolbar = _ref => {
|
|
30783 |
className: "block-editor-block-toolbar__slot"
|
30784 |
}), (0,external_wp_element_namespaceObject.createElement)(block_name_context.Provider, {
|
30785 |
value: blockType === null || blockType === void 0 ? void 0 : blockType.name
|
30786 |
-
}, (0,external_wp_element_namespaceObject.createElement)(block_toolbar_last_item.Slot, null))), (0,external_wp_element_namespaceObject.createElement)(
|
|
|
|
|
30787 |
clientIds: blockClientIds
|
30788 |
}));
|
30789 |
};
|
@@ -30873,9 +32220,125 @@ function BlockContextualToolbar(_ref) {
|
|
30873 |
|
30874 |
/* harmony default export */ const block_contextual_toolbar = (BlockContextualToolbar);
|
30875 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
30876 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/selected-block-popover.js
|
30877 |
|
30878 |
|
|
|
30879 |
/**
|
30880 |
* External dependencies
|
30881 |
*/
|
@@ -30899,6 +32362,7 @@ function BlockContextualToolbar(_ref) {
|
|
30899 |
|
30900 |
|
30901 |
|
|
|
30902 |
function selected_block_popover_selector(select) {
|
30903 |
const {
|
30904 |
isNavigationMode,
|
@@ -30969,12 +32433,16 @@ function SelectedBlockPopover(_ref) {
|
|
30969 |
// to it when re-mounting.
|
30970 |
|
30971 |
const initialToolbarItemIndexRef = (0,external_wp_element_namespaceObject.useRef)();
|
|
|
|
|
|
|
|
|
30972 |
|
30973 |
if (!shouldShowBreadcrumb && !shouldShowContextualToolbar) {
|
30974 |
return null;
|
30975 |
}
|
30976 |
|
30977 |
-
return (0,external_wp_element_namespaceObject.createElement)(
|
30978 |
clientId: capturingClientId || clientId,
|
30979 |
bottomClientId: lastClientId,
|
30980 |
className: classnames_default()('block-editor-block-list__block-popover', {
|
@@ -30982,7 +32450,7 @@ function SelectedBlockPopover(_ref) {
|
|
30982 |
}),
|
30983 |
__unstablePopoverSlot: __unstablePopoverSlot,
|
30984 |
__unstableContentRef: __unstableContentRef
|
30985 |
-
}, shouldShowContextualToolbar && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar // If the toolbar is being shown because of being forced
|
30986 |
// it should focus the toolbar right after the mount.
|
30987 |
, {
|
30988 |
focusOnMount: isToolbarForced.current,
|
@@ -32165,31 +33633,28 @@ function BlockListItems(props) {
|
|
32165 |
* @return {any} The item with the most occurrences.
|
32166 |
*/
|
32167 |
|
32168 |
-
function
|
32169 |
const arr = [...inputArray];
|
32170 |
return arr.sort((a, b) => inputArray.filter(v => v === b).length - inputArray.filter(v => v === a).length).shift();
|
32171 |
}
|
32172 |
/**
|
32173 |
-
* Returns the most common CSS unit
|
32174 |
-
* Falls back to `px` as a default unit.
|
32175 |
*
|
32176 |
-
*
|
32177 |
-
*
|
|
|
|
|
|
|
|
|
32178 |
*/
|
32179 |
|
32180 |
function getAllUnit() {
|
32181 |
-
let
|
32182 |
-
|
32183 |
-
|
32184 |
-
|
32185 |
-
|
32186 |
-
|
32187 |
-
|
32188 |
-
const allUnits = Object.values(values).map(value => {
|
32189 |
-
const [, unit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(value);
|
32190 |
-
return unit;
|
32191 |
-
});
|
32192 |
-
return mode(allUnits) || 'px';
|
32193 |
}
|
32194 |
/**
|
32195 |
* Gets the 'all' input value and unit from values data.
|
@@ -32218,7 +33683,7 @@ function getAllValue() {
|
|
32218 |
});
|
32219 |
const allUnits = parsedQuantitiesAndUnits.map(value => value[1]);
|
32220 |
const value = allValues.every(v => v === allValues[0]) ? allValues[0] : '';
|
32221 |
-
const unit =
|
32222 |
const allValue = value === 0 || value ? `${value}${unit}` : undefined;
|
32223 |
return allValue;
|
32224 |
}
|
@@ -32274,22 +33739,50 @@ function hasDefinedValues(values) {
|
|
32274 |
*/
|
32275 |
|
32276 |
|
32277 |
-
function
|
32278 |
let {
|
32279 |
onChange,
|
|
|
|
|
32280 |
values,
|
32281 |
...props
|
32282 |
} = _ref;
|
32283 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32284 |
const hasValues = hasDefinedValues(values);
|
32285 |
const isMixed = hasValues && hasMixedValues(values);
|
32286 |
-
const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)('Mixed') : null;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32287 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, {
|
32288 |
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Border radius'),
|
32289 |
disableUnits: isMixed,
|
32290 |
isOnly: true,
|
32291 |
value: allValue,
|
32292 |
-
onChange:
|
|
|
32293 |
placeholder: allPlaceholder
|
32294 |
}));
|
32295 |
}
|
@@ -32309,9 +33802,11 @@ const CORNERS = {
|
|
32309 |
bottomLeft: (0,external_wp_i18n_namespaceObject.__)('Bottom left'),
|
32310 |
bottomRight: (0,external_wp_i18n_namespaceObject.__)('Bottom right')
|
32311 |
};
|
32312 |
-
function
|
32313 |
let {
|
32314 |
onChange,
|
|
|
|
|
32315 |
values: valuesProp,
|
32316 |
...props
|
32317 |
} = _ref;
|
@@ -32319,11 +33814,21 @@ function BoxInputControls(_ref) {
|
|
32319 |
const createHandleOnChange = corner => next => {
|
32320 |
if (!onChange) {
|
32321 |
return;
|
32322 |
-
}
|
|
|
32323 |
|
|
|
|
|
32324 |
onChange({ ...values,
|
32325 |
-
[corner]:
|
32326 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32327 |
}; // For shorthand style & backwards compatibility, handle flat string value.
|
32328 |
|
32329 |
|
@@ -32339,51 +33844,24 @@ function BoxInputControls(_ref) {
|
|
32339 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
32340 |
className: "components-border-radius-control__input-controls-wrapper"
|
32341 |
}, Object.entries(CORNERS).map(_ref2 => {
|
32342 |
-
let [
|
|
|
|
|
32343 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
|
32344 |
text: label,
|
32345 |
position: "top",
|
32346 |
-
key:
|
32347 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
32348 |
className: "components-border-radius-control__tooltip-wrapper"
|
32349 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, {
|
32350 |
"aria-label": label,
|
32351 |
-
value:
|
32352 |
-
onChange: createHandleOnChange(
|
|
|
32353 |
}))));
|
32354 |
}));
|
32355 |
}
|
32356 |
|
32357 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/link.js
|
32358 |
-
|
32359 |
-
|
32360 |
-
/**
|
32361 |
-
* WordPress dependencies
|
32362 |
-
*/
|
32363 |
-
|
32364 |
-
const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
32365 |
-
xmlns: "http://www.w3.org/2000/svg",
|
32366 |
-
viewBox: "0 0 24 24"
|
32367 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
32368 |
-
d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"
|
32369 |
-
}));
|
32370 |
-
/* harmony default export */ const library_link = (link_link);
|
32371 |
-
|
32372 |
-
;// CONCATENATED MODULE: ./packages/icons/build-module/library/link-off.js
|
32373 |
-
|
32374 |
-
|
32375 |
-
/**
|
32376 |
-
* WordPress dependencies
|
32377 |
-
*/
|
32378 |
-
|
32379 |
-
const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
32380 |
-
xmlns: "http://www.w3.org/2000/svg",
|
32381 |
-
viewBox: "0 0 24 24"
|
32382 |
-
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
32383 |
-
d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"
|
32384 |
-
}));
|
32385 |
-
/* harmony default export */ const link_off = (linkOff);
|
32386 |
-
|
32387 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/linked-button.js
|
32388 |
|
32389 |
|
@@ -32394,7 +33872,7 @@ const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_w
|
|
32394 |
|
32395 |
|
32396 |
|
32397 |
-
function
|
32398 |
let {
|
32399 |
isLinked,
|
32400 |
...props
|
@@ -32431,11 +33909,11 @@ function LinkedButton(_ref) {
|
|
32431 |
|
32432 |
|
32433 |
|
32434 |
-
const
|
32435 |
-
topLeft:
|
32436 |
-
topRight:
|
32437 |
-
bottomLeft:
|
32438 |
-
bottomRight:
|
32439 |
};
|
32440 |
const MIN_BORDER_RADIUS_VALUE = 0;
|
32441 |
const MAX_BORDER_RADIUS_VALUES = {
|
@@ -32458,11 +33936,21 @@ function BorderRadiusControl(_ref) {
|
|
32458 |
onChange,
|
32459 |
values
|
32460 |
} = _ref;
|
32461 |
-
const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!hasDefinedValues(values) || !hasMixedValues(values));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
32462 |
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
32463 |
availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem']
|
32464 |
});
|
32465 |
-
const unit = getAllUnit(
|
32466 |
const unitConfig = units && units.find(item => item.value === unit);
|
32467 |
const step = (unitConfig === null || unitConfig === void 0 ? void 0 : unitConfig.step) || 1;
|
32468 |
const [allValue] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(getAllValue(values));
|
@@ -32479,11 +33967,13 @@ function BorderRadiusControl(_ref) {
|
|
32479 |
as: "legend"
|
32480 |
}, (0,external_wp_i18n_namespaceObject.__)('Radius')), (0,external_wp_element_namespaceObject.createElement)("div", {
|
32481 |
className: "components-border-radius-control__wrapper"
|
32482 |
-
}, isLinked ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(
|
32483 |
className: "components-border-radius-control__unit-control",
|
32484 |
values: values,
|
32485 |
min: MIN_BORDER_RADIUS_VALUE,
|
32486 |
onChange: onChange,
|
|
|
|
|
32487 |
units: units
|
32488 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
32489 |
label: (0,external_wp_i18n_namespaceObject.__)('Border radius'),
|
@@ -32496,12 +33986,14 @@ function BorderRadiusControl(_ref) {
|
|
32496 |
withInputField: false,
|
32497 |
onChange: handleSliderChange,
|
32498 |
step: step
|
32499 |
-
})) : (0,external_wp_element_namespaceObject.createElement)(
|
32500 |
min: MIN_BORDER_RADIUS_VALUE,
|
32501 |
onChange: onChange,
|
32502 |
-
|
|
|
|
|
32503 |
units: units
|
32504 |
-
}), (0,external_wp_element_namespaceObject.createElement)(
|
32505 |
onClick: toggleLinked,
|
32506 |
isLinked: isLinked
|
32507 |
})));
|
@@ -32535,16 +34027,11 @@ function BorderRadiusEdit(props) {
|
|
32535 |
} = props;
|
32536 |
|
32537 |
const onChange = newRadius => {
|
32538 |
-
|
32539 |
border: { ...(style === null || style === void 0 ? void 0 : style.border),
|
32540 |
radius: newRadius
|
32541 |
}
|
32542 |
-
};
|
32543 |
-
|
32544 |
-
if (newRadius === undefined || newRadius === '') {
|
32545 |
-
newStyle = cleanEmptyObject(newStyle);
|
32546 |
-
}
|
32547 |
-
|
32548 |
setAttributes({
|
32549 |
style: newStyle
|
32550 |
});
|
@@ -33079,10 +34566,10 @@ function BorderPanel(props) {
|
|
33079 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBorderBoxControl, {
|
33080 |
colors: colors,
|
33081 |
enableAlpha: true,
|
|
|
33082 |
onChange: onBorderChange,
|
33083 |
-
popoverPlacement: "left-start",
|
33084 |
popoverOffset: 40,
|
33085 |
-
|
33086 |
value: hydratedBorder,
|
33087 |
__experimentalHasMultipleOrigins: true,
|
33088 |
__experimentalIsRenderedInSidebar: true
|
@@ -34318,8 +35805,11 @@ function ColorEdit(props) {
|
|
34318 |
};
|
34319 |
};
|
34320 |
|
34321 |
-
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient);
|
34322 |
const defaultColorControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [COLOR_SUPPORT_KEY, '__experimentalDefaultControls']);
|
|
|
|
|
|
|
|
|
34323 |
return (0,external_wp_element_namespaceObject.createElement)(ColorPanel, {
|
34324 |
enableContrastChecking: enableContrastChecking,
|
34325 |
clientId: props.clientId,
|
@@ -35086,7 +36576,7 @@ function FontFamilyControl(_ref) {
|
|
35086 |
};
|
35087 |
})];
|
35088 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, _extends({
|
35089 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Font
|
35090 |
options: options,
|
35091 |
value: value,
|
35092 |
onChange: onChange,
|
@@ -36373,21 +37863,6 @@ function useIsTypographyDisabled() {
|
|
36373 |
const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
|
36374 |
|
36375 |
const hasStyleSupport = blockType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, key));
|
36376 |
-
|
36377 |
-
const style_VARIABLE_REFERENCE_PREFIX = 'var:';
|
36378 |
-
const style_VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';
|
36379 |
-
const style_VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';
|
36380 |
-
|
36381 |
-
function compileStyleValue(uncompiledValue) {
|
36382 |
-
var _uncompiledValue$star;
|
36383 |
-
|
36384 |
-
if (uncompiledValue !== null && uncompiledValue !== void 0 && (_uncompiledValue$star = uncompiledValue.startsWith) !== null && _uncompiledValue$star !== void 0 && _uncompiledValue$star.call(uncompiledValue, style_VARIABLE_REFERENCE_PREFIX)) {
|
36385 |
-
const variable = uncompiledValue.slice(style_VARIABLE_REFERENCE_PREFIX.length).split(style_VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE).join(style_VARIABLE_PATH_SEPARATOR_TOKEN_STYLE);
|
36386 |
-
return `var(--wp--${variable})`;
|
36387 |
-
}
|
36388 |
-
|
36389 |
-
return uncompiledValue;
|
36390 |
-
}
|
36391 |
/**
|
36392 |
* Returns the inline styles to add depending on the style object
|
36393 |
*
|
@@ -36399,41 +37874,10 @@ function compileStyleValue(uncompiledValue) {
|
|
36399 |
|
36400 |
function getInlineStyles() {
|
36401 |
let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
36402 |
-
const
|
36403 |
-
const output = {};
|
36404 |
-
Object.keys(external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY).forEach(propKey => {
|
36405 |
-
if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[propKey].rootOnly) {
|
36406 |
-
return;
|
36407 |
-
}
|
36408 |
-
|
36409 |
-
const path = external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[propKey].value;
|
36410 |
-
const subPaths = external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[propKey].properties; // Ignore styles on elements because they are handled on the server.
|
36411 |
-
|
36412 |
-
if ((0,external_lodash_namespaceObject.has)(styles, path) && 'elements' !== (path === null || path === void 0 ? void 0 : path[0])) {
|
36413 |
-
// Checking if style value is a string allows for shorthand css
|
36414 |
-
// option and backwards compatibility for border radius support.
|
36415 |
-
const styleValue = (0,external_lodash_namespaceObject.get)(styles, path);
|
36416 |
-
|
36417 |
-
if (!external_wp_blocks_namespaceObject.__EXPERIMENTAL_STYLE_PROPERTY[propKey].useEngine) {
|
36418 |
-
if (!!subPaths && typeof styleValue !== 'string') {
|
36419 |
-
Object.entries(subPaths).forEach(entry => {
|
36420 |
-
const [name, subPath] = entry;
|
36421 |
-
const value = (0,external_lodash_namespaceObject.get)(styleValue, [subPath]);
|
36422 |
-
|
36423 |
-
if (value) {
|
36424 |
-
output[name] = compileStyleValue(value);
|
36425 |
-
}
|
36426 |
-
});
|
36427 |
-
} else if (!ignoredStyles.includes(path.join('.'))) {
|
36428 |
-
output[propKey] = compileStyleValue((0,external_lodash_namespaceObject.get)(styles, path));
|
36429 |
-
}
|
36430 |
-
}
|
36431 |
-
}
|
36432 |
-
}); // The goal is to move everything to server side generated engine styles
|
36433 |
// This is temporary as we absorb more and more styles into the engine.
|
36434 |
|
36435 |
-
|
36436 |
-
extraRules.forEach(rule => {
|
36437 |
output[rule.key] = rule.value;
|
36438 |
});
|
36439 |
return output;
|
@@ -36591,7 +38035,7 @@ const withBlockControls = (0,external_wp_compose_namespaceObject.createHigherOrd
|
|
36591 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, shouldDisplayControls && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ColorEdit, props), (0,external_wp_element_namespaceObject.createElement)(TypographyPanel, props), (0,external_wp_element_namespaceObject.createElement)(BorderPanel, props), (0,external_wp_element_namespaceObject.createElement)(DimensionsPanel, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props));
|
36592 |
}, 'withToolbarControls');
|
36593 |
/**
|
36594 |
-
* Override the default block element to include
|
36595 |
*
|
36596 |
* @param {Function} BlockListBlock Original component
|
36597 |
* @return {Function} Wrapped component
|
@@ -36619,7 +38063,7 @@ const withElementsStyles = (0,external_wp_compose_namespaceObject.createHigherOr
|
|
36619 |
};
|
36620 |
|
36621 |
for (const [elementName, elementStyles] of Object.entries(filteredElementsStyles)) {
|
36622 |
-
const cssRule =
|
36623 |
// The .editor-styles-wrapper selector is required on elements styles. As it is
|
36624 |
// added to all other editor styles, not providing it causes reset and global
|
36625 |
// styles to override element styles because of higher specificity.
|
@@ -36806,10 +38250,10 @@ k([names]);
|
|
36806 |
/**
|
36807 |
* SVG and stylesheet needed for rendering the duotone filter.
|
36808 |
*
|
36809 |
-
* @param {Object}
|
36810 |
-
* @param {string}
|
36811 |
-
* @param {string}
|
36812 |
-
* @param {string[]|"unset"} props.colors
|
36813 |
*
|
36814 |
* @return {WPElement} Duotone element.
|
36815 |
*/
|
@@ -37065,7 +38509,7 @@ function useLayoutClasses(layout, layoutDefinitions) {
|
|
37065 |
layoutClassnames.push(layoutDefinitions === null || layoutDefinitions === void 0 ? void 0 : (_layoutDefinitions2 = layoutDefinitions[(layout === null || layout === void 0 ? void 0 : layout.type) || 'default']) === null || _layoutDefinitions2 === void 0 ? void 0 : _layoutDefinitions2.className);
|
37066 |
}
|
37067 |
|
37068 |
-
if ((layout !== null && layout !== void 0 && layout.inherit || layout !== null && layout !== void 0 && layout.contentSize) && rootPaddingAlignment) {
|
37069 |
layoutClassnames.push('has-global-padding');
|
37070 |
}
|
37071 |
|
@@ -37112,26 +38556,28 @@ function LayoutPanel(_ref) {
|
|
37112 |
return null;
|
37113 |
} // Only show the inherit toggle if it's supported,
|
37114 |
// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),
|
37115 |
-
// and
|
37116 |
|
37117 |
|
37118 |
-
const showInheritToggle = !!(allowInheriting && !!defaultThemeLayout && (!(layout !== null && layout !== void 0 && layout.type) || (layout === null || layout === void 0 ? void 0 : layout.type) === 'default' || layout !== null && layout !== void 0 && layout.inherit));
|
37119 |
const usedLayout = layout || defaultBlockLayout || {};
|
37120 |
const {
|
37121 |
inherit = false,
|
37122 |
-
type = 'default'
|
|
|
37123 |
} = usedLayout;
|
37124 |
/**
|
37125 |
-
* `themeSupportsLayout` is only relevant to the `default/flow`
|
37126 |
-
*
|
37127 |
* `layout` types are used.
|
37128 |
*/
|
37129 |
|
37130 |
-
if (type === 'default' && !themeSupportsLayout) {
|
37131 |
return null;
|
37132 |
}
|
37133 |
|
37134 |
const layoutType = getLayoutType(type);
|
|
|
37135 |
|
37136 |
const onChangeType = newType => setAttributes({
|
37137 |
layout: {
|
@@ -37146,19 +38592,23 @@ function LayoutPanel(_ref) {
|
|
37146 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(inspector_controls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
|
37147 |
title: (0,external_wp_i18n_namespaceObject.__)('Layout')
|
37148 |
}, showInheritToggle && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
|
37149 |
-
label: (0,external_wp_i18n_namespaceObject.__)('Inner blocks
|
37150 |
-
checked:
|
37151 |
onChange: () => setAttributes({
|
37152 |
layout: {
|
37153 |
-
|
37154 |
}
|
37155 |
})
|
37156 |
}), (0,external_wp_element_namespaceObject.createElement)("p", {
|
37157 |
className: "block-editor-hooks__layout-controls-helptext"
|
37158 |
-
}, !!inherit ? (0,external_wp_i18n_namespaceObject.__)('Nested blocks use theme content width with options for full and wide widths.') : (0,external_wp_i18n_namespaceObject.__)('Nested blocks will fill the width of this container.'))), !inherit && allowSwitching && (0,external_wp_element_namespaceObject.createElement)(LayoutTypeSwitcher, {
|
37159 |
type: type,
|
37160 |
onChange: onChangeType
|
37161 |
-
}),
|
|
|
|
|
|
|
|
|
37162 |
layout: usedLayout,
|
37163 |
onChange: onChangeLayout,
|
37164 |
layoutBlockSupport: layoutBlockSupport
|
@@ -37259,7 +38709,9 @@ const withLayoutStyles = (0,external_wp_compose_namespaceObject.createHigherOrde
|
|
37259 |
const {
|
37260 |
default: defaultBlockLayout
|
37261 |
} = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {};
|
37262 |
-
const usedLayout = layout !== null && layout !== void 0 && layout.inherit
|
|
|
|
|
37263 |
const layoutClasses = hasLayoutBlockSupport ? useLayoutClasses(usedLayout, defaultThemeLayout === null || defaultThemeLayout === void 0 ? void 0 : defaultThemeLayout.definitions) : null;
|
37264 |
const selector = `.${(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name)}.wp-container-${id}`;
|
37265 |
const blockGapSupport = useSetting('spacing.blockGap');
|
@@ -37577,6 +39029,18 @@ function useCachedTruthy(value) {
|
|
37577 |
|
37578 |
|
37579 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37580 |
/**
|
37581 |
* Higher order component factory for injecting the `colorsArray` argument as
|
37582 |
* the colors prop in the `withCustomColors` HOC.
|
@@ -37586,6 +39050,7 @@ function useCachedTruthy(value) {
|
|
37586 |
* @return {Function} The higher order component.
|
37587 |
*/
|
37588 |
|
|
|
37589 |
const withCustomColorPalette = colorsArray => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, props, {
|
37590 |
colors: colorsArray
|
37591 |
})), 'withCustomColorPalette');
|
@@ -37648,7 +39113,7 @@ function createColorHOC(colorTypes, withColorPalette) {
|
|
37648 |
|
37649 |
createSetters() {
|
37650 |
return (0,external_lodash_namespaceObject.reduce)(colorMap, (settersAccumulator, colorContext, colorAttributeName) => {
|
37651 |
-
const upperFirstColorAttributeName = (
|
37652 |
const customColorAttributeName = `custom${upperFirstColorAttributeName}`;
|
37653 |
settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(colorAttributeName, customColorAttributeName);
|
37654 |
return settersAccumulator;
|
@@ -37665,13 +39130,13 @@ function createColorHOC(colorTypes, withColorPalette) {
|
|
37665 |
};
|
37666 |
}
|
37667 |
|
37668 |
-
static getDerivedStateFromProps(
|
37669 |
let {
|
37670 |
attributes,
|
37671 |
colors
|
37672 |
-
} =
|
37673 |
return (0,external_lodash_namespaceObject.reduce)(colorMap, (newState, colorContext, colorAttributeName) => {
|
37674 |
-
const colorObject = getColorObjectByAttributeValues(colors, attributes[colorAttributeName], attributes[`custom${(
|
37675 |
const previousColorObject = previousState[colorAttributeName];
|
37676 |
const previousColor = previousColorObject === null || previousColorObject === void 0 ? void 0 : previousColorObject.color;
|
37677 |
/**
|
@@ -37801,6 +39266,18 @@ function withColors() {
|
|
37801 |
|
37802 |
|
37803 |
const DEFAULT_FONT_SIZES = [];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37804 |
/**
|
37805 |
* Higher-order component, which handles font size logic for class generation,
|
37806 |
* font size value retrieval, and font size change handling.
|
@@ -37812,6 +39289,7 @@ const DEFAULT_FONT_SIZES = [];
|
|
37812 |
* @return {Function} Higher-order component.
|
37813 |
*/
|
37814 |
|
|
|
37815 |
/* harmony default export */ const with_font_sizes = (function () {
|
37816 |
for (var _len = arguments.length, fontSizeNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
37817 |
fontSizeNames[_key] = arguments[_key];
|
@@ -37823,7 +39301,7 @@ const DEFAULT_FONT_SIZES = [];
|
|
37823 |
* Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized.
|
37824 |
*/
|
37825 |
const fontSizeAttributeNames = (0,external_lodash_namespaceObject.reduce)(fontSizeNames, (fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => {
|
37826 |
-
fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${(
|
37827 |
return fontSizeAttributeNamesAccumulator;
|
37828 |
}, {});
|
37829 |
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => {
|
@@ -37841,7 +39319,7 @@ const DEFAULT_FONT_SIZES = [];
|
|
37841 |
|
37842 |
createSetters() {
|
37843 |
return (0,external_lodash_namespaceObject.reduce)(fontSizeAttributeNames, (settersAccumulator, customFontSizeAttributeName, fontSizeAttributeName) => {
|
37844 |
-
const upperFirstFontSizeAttributeName = (
|
37845 |
settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName);
|
37846 |
return settersAccumulator;
|
37847 |
}, {});
|
@@ -37859,11 +39337,11 @@ const DEFAULT_FONT_SIZES = [];
|
|
37859 |
};
|
37860 |
}
|
37861 |
|
37862 |
-
static getDerivedStateFromProps(
|
37863 |
let {
|
37864 |
attributes,
|
37865 |
fontSizes
|
37866 |
-
} =
|
37867 |
|
37868 |
const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => {
|
37869 |
if (previousState[fontSizeAttributeName]) {
|
@@ -38895,8 +40373,11 @@ function ListViewBlockSelectButton(_ref, ref) {
|
|
38895 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
|
38896 |
ellipsizeMode: "auto"
|
38897 |
}, blockTitle)), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
38898 |
-
className: "block-editor-list-view-block-select-button__anchor"
|
38899 |
-
},
|
|
|
|
|
|
|
38900 |
className: "block-editor-list-view-block-select-button__lock"
|
38901 |
}, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
38902 |
icon: library_lock
|
@@ -39559,10 +41040,6 @@ function ListViewDropIndicator(_ref) {
|
|
39559 |
}
|
39560 |
|
39561 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/use-block-selection.js
|
39562 |
-
/**
|
39563 |
-
* External dependencies
|
39564 |
-
*/
|
39565 |
-
|
39566 |
/**
|
39567 |
* WordPress dependencies
|
39568 |
*/
|
@@ -39572,7 +41049,6 @@ function ListViewDropIndicator(_ref) {
|
|
39572 |
|
39573 |
|
39574 |
|
39575 |
-
|
39576 |
/**
|
39577 |
* Internal dependencies
|
39578 |
*/
|
@@ -39661,7 +41137,7 @@ function useBlockSelection() {
|
|
39661 |
return;
|
39662 |
}
|
39663 |
|
39664 |
-
const selectionDiff =
|
39665 |
let label;
|
39666 |
|
39667 |
if (selectionDiff.length === 1) {
|
@@ -41039,17 +42515,12 @@ const external_wp_date_namespaceObject = window["wp"]["date"];
|
|
41039 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/date-format-picker/index.js
|
41040 |
|
41041 |
|
41042 |
-
/**
|
41043 |
-
* External dependencies
|
41044 |
-
*/
|
41045 |
-
|
41046 |
/**
|
41047 |
* WordPress dependencies
|
41048 |
*/
|
41049 |
|
41050 |
|
41051 |
|
41052 |
-
|
41053 |
// So that we can illustrate the different formats in the dropdown properly,
|
41054 |
// show a date that has a day greater than 12 and a month with more than three
|
41055 |
// letters. Here we're using 2022-01-25 which is when WordPress 5.9 was
|
@@ -41115,7 +42586,7 @@ function NonDefaultControls(_ref2) {
|
|
41115 |
// 2022) in German (de). The resultant array is de-duplicated as some
|
41116 |
// languages will use the same format string for short, medium, and long
|
41117 |
// formats.
|
41118 |
-
const suggestedFormats = (
|
41119 |
const suggestedOptions = suggestedFormats.map((suggestedFormat, index) => ({
|
41120 |
key: `suggested-${index}`,
|
41121 |
name: (0,external_wp_date_namespaceObject.dateI18n)(suggestedFormat, EXAMPLE_DATE),
|
@@ -41131,6 +42602,7 @@ function NonDefaultControls(_ref2) {
|
|
41131 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
|
41132 |
className: "block-editor-date-format-picker__custom-format-select-control"
|
41133 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CustomSelectControl, {
|
|
|
41134 |
label: (0,external_wp_i18n_namespaceObject.__)('Choose a format'),
|
41135 |
options: [...suggestedOptions, customOption],
|
41136 |
value: isCustom ? customOption : (_suggestedOptions$fin = suggestedOptions.find(option => option.format === format)) !== null && _suggestedOptions$fin !== void 0 ? _suggestedOptions$fin : customOption,
|
@@ -43503,7 +44975,7 @@ class URLInput extends external_wp_element_namespaceObject.Component {
|
|
43503 |
// Ensure input always has an accessible label
|
43504 |
'aria-expanded': showSuggestions,
|
43505 |
'aria-autocomplete': 'list',
|
43506 |
-
'aria-
|
43507 |
'aria-activedescendant': selectedSuggestion !== null ? `${suggestionOptionIdPrefix}-${selectedSuggestion}` : undefined,
|
43508 |
ref: this.inputRef
|
43509 |
};
|
@@ -44338,7 +45810,6 @@ function LinkPreview(_ref) {
|
|
44338 |
|
44339 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
44340 |
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Currently selected'),
|
44341 |
-
"aria-selected": "true",
|
44342 |
className: classnames_default()('block-editor-link-control__search-item', {
|
44343 |
'is-current': true,
|
44344 |
'is-rich': hasRichData,
|
@@ -46695,10 +48166,6 @@ function useInputRules(props) {
|
|
46695 |
* WordPress dependencies
|
46696 |
*/
|
46697 |
|
46698 |
-
/**
|
46699 |
-
* WordPress dependencies
|
46700 |
-
*/
|
46701 |
-
|
46702 |
|
46703 |
|
46704 |
|
@@ -46814,10 +48281,6 @@ function useEnter(props) {
|
|
46814 |
}
|
46815 |
|
46816 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-format-types.js
|
46817 |
-
/**
|
46818 |
-
* External dependencies
|
46819 |
-
*/
|
46820 |
-
|
46821 |
/**
|
46822 |
* WordPress dependencies
|
46823 |
*/
|
@@ -46825,7 +48288,6 @@ function useEnter(props) {
|
|
46825 |
|
46826 |
|
46827 |
|
46828 |
-
|
46829 |
function formatTypesSelector(select) {
|
46830 |
return select(external_wp_richText_namespaceObject.store).getFormatTypes();
|
46831 |
}
|
@@ -46842,7 +48304,10 @@ function prefixSelectKeys(selected, prefix) {
|
|
46842 |
if (typeof selected !== 'object') return {
|
46843 |
[prefix]: selected
|
46844 |
};
|
46845 |
-
return (
|
|
|
|
|
|
|
46846 |
}
|
46847 |
|
46848 |
function getPrefixedSelectKeys(selected, prefix) {
|
@@ -46864,20 +48329,20 @@ function getPrefixedSelectKeys(selected, prefix) {
|
|
46864 |
*/
|
46865 |
|
46866 |
|
46867 |
-
function useFormatTypes(
|
46868 |
let {
|
46869 |
clientId,
|
46870 |
identifier,
|
46871 |
withoutInteractiveFormatting,
|
46872 |
allowedFormats
|
46873 |
-
} =
|
46874 |
const allFormatTypes = (0,external_wp_data_namespaceObject.useSelect)(formatTypesSelector, []);
|
46875 |
const formatTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
46876 |
-
return allFormatTypes.filter(
|
46877 |
let {
|
46878 |
name,
|
46879 |
tagName
|
46880 |
-
} =
|
46881 |
|
46882 |
if (allowedFormats && !allowedFormats.includes(name)) {
|
46883 |
return false;
|
@@ -49838,6 +51303,7 @@ function PublishDateTimePicker(_ref, ref) {
|
|
49838 |
|
49839 |
|
49840 |
|
|
|
49841 |
|
49842 |
|
49843 |
|
1731 |
exports.Z = TextareaAutosize_1.TextareaAutosize;
|
1732 |
|
1733 |
|
1734 |
+
/***/ }),
|
1735 |
+
|
1736 |
+
/***/ 4793:
|
1737 |
+
/***/ ((module) => {
|
1738 |
+
|
1739 |
+
var characterMap = {
|
1740 |
+
"À": "A",
|
1741 |
+
"Á": "A",
|
1742 |
+
"Â": "A",
|
1743 |
+
"Ã": "A",
|
1744 |
+
"Ä": "A",
|
1745 |
+
"Å": "A",
|
1746 |
+
"Ấ": "A",
|
1747 |
+
"Ắ": "A",
|
1748 |
+
"Ẳ": "A",
|
1749 |
+
"Ẵ": "A",
|
1750 |
+
"Ặ": "A",
|
1751 |
+
"Æ": "AE",
|
1752 |
+
"Ầ": "A",
|
1753 |
+
"Ằ": "A",
|
1754 |
+
"Ȃ": "A",
|
1755 |
+
"Ç": "C",
|
1756 |
+
"Ḉ": "C",
|
1757 |
+
"È": "E",
|
1758 |
+
"É": "E",
|
1759 |
+
"Ê": "E",
|
1760 |
+
"Ë": "E",
|
1761 |
+
"Ế": "E",
|
1762 |
+
"Ḗ": "E",
|
1763 |
+
"Ề": "E",
|
1764 |
+
"Ḕ": "E",
|
1765 |
+
"Ḝ": "E",
|
1766 |
+
"Ȇ": "E",
|
1767 |
+
"Ì": "I",
|
1768 |
+
"Í": "I",
|
1769 |
+
"Î": "I",
|
1770 |
+
"Ï": "I",
|
1771 |
+
"Ḯ": "I",
|
1772 |
+
"Ȋ": "I",
|
1773 |
+
"Ð": "D",
|
1774 |
+
"Ñ": "N",
|
1775 |
+
"Ò": "O",
|
1776 |
+
"Ó": "O",
|
1777 |
+
"Ô": "O",
|
1778 |
+
"Õ": "O",
|
1779 |
+
"Ö": "O",
|
1780 |
+
"Ø": "O",
|
1781 |
+
"Ố": "O",
|
1782 |
+
"Ṍ": "O",
|
1783 |
+
"Ṓ": "O",
|
1784 |
+
"Ȏ": "O",
|
1785 |
+
"Ù": "U",
|
1786 |
+
"Ú": "U",
|
1787 |
+
"Û": "U",
|
1788 |
+
"Ü": "U",
|
1789 |
+
"Ý": "Y",
|
1790 |
+
"à": "a",
|
1791 |
+
"á": "a",
|
1792 |
+
"â": "a",
|
1793 |
+
"ã": "a",
|
1794 |
+
"ä": "a",
|
1795 |
+
"å": "a",
|
1796 |
+
"ấ": "a",
|
1797 |
+
"ắ": "a",
|
1798 |
+
"ẳ": "a",
|
1799 |
+
"ẵ": "a",
|
1800 |
+
"ặ": "a",
|
1801 |
+
"æ": "ae",
|
1802 |
+
"ầ": "a",
|
1803 |
+
"ằ": "a",
|
1804 |
+
"ȃ": "a",
|
1805 |
+
"ç": "c",
|
1806 |
+
"ḉ": "c",
|
1807 |
+
"è": "e",
|
1808 |
+
"é": "e",
|
1809 |
+
"ê": "e",
|
1810 |
+
"ë": "e",
|
1811 |
+
"ế": "e",
|
1812 |
+
"ḗ": "e",
|
1813 |
+
"ề": "e",
|
1814 |
+
"ḕ": "e",
|
1815 |
+
"ḝ": "e",
|
1816 |
+
"ȇ": "e",
|
1817 |
+
"ì": "i",
|
1818 |
+
"í": "i",
|
1819 |
+
"î": "i",
|
1820 |
+
"ï": "i",
|
1821 |
+
"ḯ": "i",
|
1822 |
+
"ȋ": "i",
|
1823 |
+
"ð": "d",
|
1824 |
+
"ñ": "n",
|
1825 |
+
"ò": "o",
|
1826 |
+
"ó": "o",
|
1827 |
+
"ô": "o",
|
1828 |
+
"õ": "o",
|
1829 |
+
"ö": "o",
|
1830 |
+
"ø": "o",
|
1831 |
+
"ố": "o",
|
1832 |
+
"ṍ": "o",
|
1833 |
+
"ṓ": "o",
|
1834 |
+
"ȏ": "o",
|
1835 |
+
"ù": "u",
|
1836 |
+
"ú": "u",
|
1837 |
+
"û": "u",
|
1838 |
+
"ü": "u",
|
1839 |
+
"ý": "y",
|
1840 |
+
"ÿ": "y",
|
1841 |
+
"Ā": "A",
|
1842 |
+
"ā": "a",
|
1843 |
+
"Ă": "A",
|
1844 |
+
"ă": "a",
|
1845 |
+
"Ą": "A",
|
1846 |
+
"ą": "a",
|
1847 |
+
"Ć": "C",
|
1848 |
+
"ć": "c",
|
1849 |
+
"Ĉ": "C",
|
1850 |
+
"ĉ": "c",
|
1851 |
+
"Ċ": "C",
|
1852 |
+
"ċ": "c",
|
1853 |
+
"Č": "C",
|
1854 |
+
"č": "c",
|
1855 |
+
"C̆": "C",
|
1856 |
+
"c̆": "c",
|
1857 |
+
"Ď": "D",
|
1858 |
+
"ď": "d",
|
1859 |
+
"Đ": "D",
|
1860 |
+
"đ": "d",
|
1861 |
+
"Ē": "E",
|
1862 |
+
"ē": "e",
|
1863 |
+
"Ĕ": "E",
|
1864 |
+
"ĕ": "e",
|
1865 |
+
"Ė": "E",
|
1866 |
+
"ė": "e",
|
1867 |
+
"Ę": "E",
|
1868 |
+
"ę": "e",
|
1869 |
+
"Ě": "E",
|
1870 |
+
"ě": "e",
|
1871 |
+
"Ĝ": "G",
|
1872 |
+
"Ǵ": "G",
|
1873 |
+
"ĝ": "g",
|
1874 |
+
"ǵ": "g",
|
1875 |
+
"Ğ": "G",
|
1876 |
+
"ğ": "g",
|
1877 |
+
"Ġ": "G",
|
1878 |
+
"ġ": "g",
|
1879 |
+
"Ģ": "G",
|
1880 |
+
"ģ": "g",
|
1881 |
+
"Ĥ": "H",
|
1882 |
+
"ĥ": "h",
|
1883 |
+
"Ħ": "H",
|
1884 |
+
"ħ": "h",
|
1885 |
+
"Ḫ": "H",
|
1886 |
+
"ḫ": "h",
|
1887 |
+
"Ĩ": "I",
|
1888 |
+
"ĩ": "i",
|
1889 |
+
"Ī": "I",
|
1890 |
+
"ī": "i",
|
1891 |
+
"Ĭ": "I",
|
1892 |
+
"ĭ": "i",
|
1893 |
+
"Į": "I",
|
1894 |
+
"į": "i",
|
1895 |
+
"İ": "I",
|
1896 |
+
"ı": "i",
|
1897 |
+
"IJ": "IJ",
|
1898 |
+
"ij": "ij",
|
1899 |
+
"Ĵ": "J",
|
1900 |
+
"ĵ": "j",
|
1901 |
+
"Ķ": "K",
|
1902 |
+
"ķ": "k",
|
1903 |
+
"Ḱ": "K",
|
1904 |
+
"ḱ": "k",
|
1905 |
+
"K̆": "K",
|
1906 |
+
"k̆": "k",
|
1907 |
+
"Ĺ": "L",
|
1908 |
+
"ĺ": "l",
|
1909 |
+
"Ļ": "L",
|
1910 |
+
"ļ": "l",
|
1911 |
+
"Ľ": "L",
|
1912 |
+
"ľ": "l",
|
1913 |
+
"Ŀ": "L",
|
1914 |
+
"ŀ": "l",
|
1915 |
+
"Ł": "l",
|
1916 |
+
"ł": "l",
|
1917 |
+
"Ḿ": "M",
|
1918 |
+
"ḿ": "m",
|
1919 |
+
"M̆": "M",
|
1920 |
+
"m̆": "m",
|
1921 |
+
"Ń": "N",
|
1922 |
+
"ń": "n",
|
1923 |
+
"Ņ": "N",
|
1924 |
+
"ņ": "n",
|
1925 |
+
"Ň": "N",
|
1926 |
+
"ň": "n",
|
1927 |
+
"ʼn": "n",
|
1928 |
+
"N̆": "N",
|
1929 |
+
"n̆": "n",
|
1930 |
+
"Ō": "O",
|
1931 |
+
"ō": "o",
|
1932 |
+
"Ŏ": "O",
|
1933 |
+
"ŏ": "o",
|
1934 |
+
"Ő": "O",
|
1935 |
+
"ő": "o",
|
1936 |
+
"Œ": "OE",
|
1937 |
+
"œ": "oe",
|
1938 |
+
"P̆": "P",
|
1939 |
+
"p̆": "p",
|
1940 |
+
"Ŕ": "R",
|
1941 |
+
"ŕ": "r",
|
1942 |
+
"Ŗ": "R",
|
1943 |
+
"ŗ": "r",
|
1944 |
+
"Ř": "R",
|
1945 |
+
"ř": "r",
|
1946 |
+
"R̆": "R",
|
1947 |
+
"r̆": "r",
|
1948 |
+
"Ȓ": "R",
|
1949 |
+
"ȓ": "r",
|
1950 |
+
"Ś": "S",
|
1951 |
+
"ś": "s",
|
1952 |
+
"Ŝ": "S",
|
1953 |
+
"ŝ": "s",
|
1954 |
+
"Ş": "S",
|
1955 |
+
"Ș": "S",
|
1956 |
+
"ș": "s",
|
1957 |
+
"ş": "s",
|
1958 |
+
"Š": "S",
|
1959 |
+
"š": "s",
|
1960 |
+
"Ţ": "T",
|
1961 |
+
"ţ": "t",
|
1962 |
+
"ț": "t",
|
1963 |
+
"Ț": "T",
|
1964 |
+
"Ť": "T",
|
1965 |
+
"ť": "t",
|
1966 |
+
"Ŧ": "T",
|
1967 |
+
"ŧ": "t",
|
1968 |
+
"T̆": "T",
|
1969 |
+
"t̆": "t",
|
1970 |
+
"Ũ": "U",
|
1971 |
+
"ũ": "u",
|
1972 |
+
"Ū": "U",
|
1973 |
+
"ū": "u",
|
1974 |
+
"Ŭ": "U",
|
1975 |
+
"ŭ": "u",
|
1976 |
+
"Ů": "U",
|
1977 |
+
"ů": "u",
|
1978 |
+
"Ű": "U",
|
1979 |
+
"ű": "u",
|
1980 |
+
"Ų": "U",
|
1981 |
+
"ų": "u",
|
1982 |
+
"Ȗ": "U",
|
1983 |
+
"ȗ": "u",
|
1984 |
+
"V̆": "V",
|
1985 |
+
"v̆": "v",
|
1986 |
+
"Ŵ": "W",
|
1987 |
+
"ŵ": "w",
|
1988 |
+
"Ẃ": "W",
|
1989 |
+
"ẃ": "w",
|
1990 |
+
"X̆": "X",
|
1991 |
+
"x̆": "x",
|
1992 |
+
"Ŷ": "Y",
|
1993 |
+
"ŷ": "y",
|
1994 |
+
"Ÿ": "Y",
|
1995 |
+
"Y̆": "Y",
|
1996 |
+
"y̆": "y",
|
1997 |
+
"Ź": "Z",
|
1998 |
+
"ź": "z",
|
1999 |
+
"Ż": "Z",
|
2000 |
+
"ż": "z",
|
2001 |
+
"Ž": "Z",
|
2002 |
+
"ž": "z",
|
2003 |
+
"ſ": "s",
|
2004 |
+
"ƒ": "f",
|
2005 |
+
"Ơ": "O",
|
2006 |
+
"ơ": "o",
|
2007 |
+
"Ư": "U",
|
2008 |
+
"ư": "u",
|
2009 |
+
"Ǎ": "A",
|
2010 |
+
"ǎ": "a",
|
2011 |
+
"Ǐ": "I",
|
2012 |
+
"ǐ": "i",
|
2013 |
+
"Ǒ": "O",
|
2014 |
+
"ǒ": "o",
|
2015 |
+
"Ǔ": "U",
|
2016 |
+
"ǔ": "u",
|
2017 |
+
"Ǖ": "U",
|
2018 |
+
"ǖ": "u",
|
2019 |
+
"Ǘ": "U",
|
2020 |
+
"ǘ": "u",
|
2021 |
+
"Ǚ": "U",
|
2022 |
+
"ǚ": "u",
|
2023 |
+
"Ǜ": "U",
|
2024 |
+
"ǜ": "u",
|
2025 |
+
"Ứ": "U",
|
2026 |
+
"ứ": "u",
|
2027 |
+
"Ṹ": "U",
|
2028 |
+
"ṹ": "u",
|
2029 |
+
"Ǻ": "A",
|
2030 |
+
"ǻ": "a",
|
2031 |
+
"Ǽ": "AE",
|
2032 |
+
"ǽ": "ae",
|
2033 |
+
"Ǿ": "O",
|
2034 |
+
"ǿ": "o",
|
2035 |
+
"Þ": "TH",
|
2036 |
+
"þ": "th",
|
2037 |
+
"Ṕ": "P",
|
2038 |
+
"ṕ": "p",
|
2039 |
+
"Ṥ": "S",
|
2040 |
+
"ṥ": "s",
|
2041 |
+
"X́": "X",
|
2042 |
+
"x́": "x",
|
2043 |
+
"Ѓ": "Г",
|
2044 |
+
"ѓ": "г",
|
2045 |
+
"Ќ": "К",
|
2046 |
+
"ќ": "к",
|
2047 |
+
"A̋": "A",
|
2048 |
+
"a̋": "a",
|
2049 |
+
"E̋": "E",
|
2050 |
+
"e̋": "e",
|
2051 |
+
"I̋": "I",
|
2052 |
+
"i̋": "i",
|
2053 |
+
"Ǹ": "N",
|
2054 |
+
"ǹ": "n",
|
2055 |
+
"Ồ": "O",
|
2056 |
+
"ồ": "o",
|
2057 |
+
"Ṑ": "O",
|
2058 |
+
"ṑ": "o",
|
2059 |
+
"Ừ": "U",
|
2060 |
+
"ừ": "u",
|
2061 |
+
"Ẁ": "W",
|
2062 |
+
"ẁ": "w",
|
2063 |
+
"Ỳ": "Y",
|
2064 |
+
"ỳ": "y",
|
2065 |
+
"Ȁ": "A",
|
2066 |
+
"ȁ": "a",
|
2067 |
+
"Ȅ": "E",
|
2068 |
+
"ȅ": "e",
|
2069 |
+
"Ȉ": "I",
|
2070 |
+
"ȉ": "i",
|
2071 |
+
"Ȍ": "O",
|
2072 |
+
"ȍ": "o",
|
2073 |
+
"Ȑ": "R",
|
2074 |
+
"ȑ": "r",
|
2075 |
+
"Ȕ": "U",
|
2076 |
+
"ȕ": "u",
|
2077 |
+
"B̌": "B",
|
2078 |
+
"b̌": "b",
|
2079 |
+
"Č̣": "C",
|
2080 |
+
"č̣": "c",
|
2081 |
+
"Ê̌": "E",
|
2082 |
+
"ê̌": "e",
|
2083 |
+
"F̌": "F",
|
2084 |
+
"f̌": "f",
|
2085 |
+
"Ǧ": "G",
|
2086 |
+
"ǧ": "g",
|
2087 |
+
"Ȟ": "H",
|
2088 |
+
"ȟ": "h",
|
2089 |
+
"J̌": "J",
|
2090 |
+
"ǰ": "j",
|
2091 |
+
"Ǩ": "K",
|
2092 |
+
"ǩ": "k",
|
2093 |
+
"M̌": "M",
|
2094 |
+
"m̌": "m",
|
2095 |
+
"P̌": "P",
|
2096 |
+
"p̌": "p",
|
2097 |
+
"Q̌": "Q",
|
2098 |
+
"q̌": "q",
|
2099 |
+
"Ř̩": "R",
|
2100 |
+
"ř̩": "r",
|
2101 |
+
"Ṧ": "S",
|
2102 |
+
"ṧ": "s",
|
2103 |
+
"V̌": "V",
|
2104 |
+
"v̌": "v",
|
2105 |
+
"W̌": "W",
|
2106 |
+
"w̌": "w",
|
2107 |
+
"X̌": "X",
|
2108 |
+
"x̌": "x",
|
2109 |
+
"Y̌": "Y",
|
2110 |
+
"y̌": "y",
|
2111 |
+
"A̧": "A",
|
2112 |
+
"a̧": "a",
|
2113 |
+
"B̧": "B",
|
2114 |
+
"b̧": "b",
|
2115 |
+
"Ḑ": "D",
|
2116 |
+
"ḑ": "d",
|
2117 |
+
"Ȩ": "E",
|
2118 |
+
"ȩ": "e",
|
2119 |
+
"Ɛ̧": "E",
|
2120 |
+
"ɛ̧": "e",
|
2121 |
+
"Ḩ": "H",
|
2122 |
+
"ḩ": "h",
|
2123 |
+
"I̧": "I",
|
2124 |
+
"i̧": "i",
|
2125 |
+
"Ɨ̧": "I",
|
2126 |
+
"ɨ̧": "i",
|
2127 |
+
"M̧": "M",
|
2128 |
+
"m̧": "m",
|
2129 |
+
"O̧": "O",
|
2130 |
+
"o̧": "o",
|
2131 |
+
"Q̧": "Q",
|
2132 |
+
"q̧": "q",
|
2133 |
+
"U̧": "U",
|
2134 |
+
"u̧": "u",
|
2135 |
+
"X̧": "X",
|
2136 |
+
"x̧": "x",
|
2137 |
+
"Z̧": "Z",
|
2138 |
+
"z̧": "z",
|
2139 |
+
};
|
2140 |
+
|
2141 |
+
var chars = Object.keys(characterMap).join('|');
|
2142 |
+
var allAccents = new RegExp(chars, 'g');
|
2143 |
+
var firstAccent = new RegExp(chars, '');
|
2144 |
+
|
2145 |
+
var removeAccents = function(string) {
|
2146 |
+
return string.replace(allAccents, function(match) {
|
2147 |
+
return characterMap[match];
|
2148 |
+
});
|
2149 |
+
};
|
2150 |
+
|
2151 |
+
var hasAccents = function(string) {
|
2152 |
+
return !!string.match(firstAccent);
|
2153 |
+
};
|
2154 |
+
|
2155 |
+
module.exports = removeAccents;
|
2156 |
+
module.exports.has = hasAccents;
|
2157 |
+
module.exports.remove = removeAccents;
|
2158 |
+
|
2159 |
+
|
2160 |
/***/ }),
|
2161 |
|
2162 |
/***/ 3124:
|
2668 |
"__experimentalPublishDateTimePicker": () => (/* reexport */ publish_date_time_picker),
|
2669 |
"__experimentalRecursionProvider": () => (/* reexport */ RecursionProvider),
|
2670 |
"__experimentalResponsiveBlockControl": () => (/* reexport */ responsive_block_control),
|
2671 |
+
"__experimentalSpacingSizesControl": () => (/* reexport */ SpacingSizesControl),
|
2672 |
"__experimentalTextDecorationControl": () => (/* reexport */ TextDecorationControl),
|
2673 |
"__experimentalTextTransformControl": () => (/* reexport */ TextTransformControl),
|
2674 |
"__experimentalUnitControl": () => (/* reexport */ UnitControl),
|
7165 |
buildScope: 'transform'
|
7166 |
});
|
7167 |
const blockTypeTransformItems = (0,external_wp_blocks_namespaceObject.getBlockTypes)().filter(blockType => canIncludeBlockTypeInInserter(state, blockType, rootClientId)).map(buildBlockTypeTransformItem);
|
7168 |
+
const itemsByName = Object.fromEntries(Object.entries(blockTypeTransformItems).map(_ref5 => {
|
7169 |
+
let [, value] = _ref5;
|
7170 |
+
return [value.name, value];
|
7171 |
+
})); // Consider unwraping the highest priority.
|
|
|
|
|
7172 |
|
7173 |
itemsByName['*'] = {
|
7174 |
frecency: +Infinity,
|
8621 |
|
8622 |
const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref15 => {
|
8623 |
let {
|
8624 |
+
registry,
|
8625 |
select,
|
8626 |
dispatch
|
8627 |
} = _ref15;
|
8632 |
});
|
8633 |
const [clientIdA, clientIdB] = blocks;
|
8634 |
const blockA = select.getBlock(clientIdA);
|
8635 |
+
const blockAType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockA.name);
|
8636 |
+
if (!blockAType) return;
|
8637 |
+
const blockB = select.getBlock(clientIdB);
|
8638 |
|
8639 |
if (blockAType && !blockAType.merge) {
|
8640 |
+
// If there's no merge function defined, attempt merging inner
|
8641 |
+
// blocks.
|
8642 |
+
const blocksWithTheSameType = (0,external_wp_blocks_namespaceObject.switchToBlockType)(blockB, blockAType.name); // Only focus the previous block if it's not mergeable.
|
8643 |
+
|
8644 |
+
if ((blocksWithTheSameType === null || blocksWithTheSameType === void 0 ? void 0 : blocksWithTheSameType.length) !== 1) {
|
8645 |
+
dispatch.selectBlock(blockA.clientId);
|
8646 |
+
return;
|
8647 |
+
}
|
8648 |
+
|
8649 |
+
const [blockWithSameType] = blocksWithTheSameType;
|
8650 |
+
|
8651 |
+
if (blockWithSameType.innerBlocks.length < 1) {
|
8652 |
+
dispatch.selectBlock(blockA.clientId);
|
8653 |
+
return;
|
8654 |
+
}
|
8655 |
+
|
8656 |
+
registry.batch(() => {
|
8657 |
+
dispatch.insertBlocks(blockWithSameType.innerBlocks, undefined, clientIdA);
|
8658 |
+
dispatch.removeBlock(clientIdB);
|
8659 |
+
dispatch.selectBlock(blockWithSameType.innerBlocks[0].clientId);
|
8660 |
+
});
|
8661 |
return;
|
8662 |
}
|
8663 |
|
|
|
8664 |
const blockBType = (0,external_wp_blocks_namespaceObject.getBlockType)(blockB.name);
|
8665 |
const {
|
8666 |
clientId,
|
9605 |
/* harmony default export */ const arrow_down = (arrowDown);
|
9606 |
|
9607 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/utils.js
|
9608 |
+
/**
|
9609 |
+
* WordPress dependencies
|
9610 |
+
*/
|
9611 |
+
|
9612 |
/**
|
9613 |
* Utility to generate the proper CSS selector for layout styles.
|
9614 |
*
|
9617 |
*
|
9618 |
* @return {string} - CSS selector.
|
9619 |
*/
|
9620 |
+
|
9621 |
function appendSelectors(selectors) {
|
9622 |
let append = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
9623 |
// Ideally we shouldn't need the `.editor-styles-wrapper` increased specificity here
|
9657 |
|
9658 |
return output;
|
9659 |
}
|
9660 |
+
/**
|
9661 |
+
* Helper method to assign contextual info to clarify
|
9662 |
+
* alignment settings.
|
9663 |
+
*
|
9664 |
+
* Besides checking if `contentSize` and `wideSize` have a
|
9665 |
+
* value, we now show this information only if their values
|
9666 |
+
* are not a `css var`. This needs to change when parsing
|
9667 |
+
* css variables land.
|
9668 |
+
*
|
9669 |
+
* @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752
|
9670 |
+
*
|
9671 |
+
* @param {Object} layout The layout object.
|
9672 |
+
* @return {Object} An object with contextual info per alignment.
|
9673 |
+
*/
|
9674 |
+
|
9675 |
+
function getAlignmentsInfo(layout) {
|
9676 |
+
const {
|
9677 |
+
contentSize,
|
9678 |
+
wideSize
|
9679 |
+
} = layout;
|
9680 |
+
const alignmentInfo = {};
|
9681 |
+
const sizeRegex = /^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;
|
9682 |
+
|
9683 |
+
if (sizeRegex.test(contentSize)) {
|
9684 |
+
// translators: %s: container size (i.e. 600px etc)
|
9685 |
+
alignmentInfo.none = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), contentSize);
|
9686 |
+
}
|
9687 |
+
|
9688 |
+
if (sizeRegex.test(wideSize)) {
|
9689 |
+
// translators: %s: container size (i.e. 600px etc)
|
9690 |
+
alignmentInfo.wide = (0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Max %s wide'), wideSize);
|
9691 |
+
}
|
9692 |
+
|
9693 |
+
return alignmentInfo;
|
9694 |
+
}
|
9695 |
|
9696 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/provider/block-refs-provider.js
|
9697 |
|
9828 |
|
9829 |
|
9830 |
|
9831 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/utils.js
|
9832 |
+
/**
|
9833 |
+
* External dependencies
|
9834 |
+
*/
|
9835 |
+
|
9836 |
+
/**
|
9837 |
+
* WordPress dependencies
|
9838 |
+
*/
|
9839 |
+
|
9840 |
+
|
9841 |
+
/**
|
9842 |
+
* Checks is given value is a spacing preset.
|
9843 |
+
*
|
9844 |
+
* @param {string} value Value to check
|
9845 |
+
*
|
9846 |
+
* @return {boolean} Return true if value is string in format var:preset|spacing|.
|
9847 |
+
*/
|
9848 |
+
|
9849 |
+
function isValueSpacingPreset(value) {
|
9850 |
+
if (!(value !== null && value !== void 0 && value.includes)) {
|
9851 |
+
return false;
|
9852 |
+
}
|
9853 |
+
|
9854 |
+
return value === '0' || value.includes('var:preset|spacing|');
|
9855 |
+
}
|
9856 |
+
/**
|
9857 |
+
* Converts a spacing preset into a custom value.
|
9858 |
+
*
|
9859 |
+
* @param {string} value Value to convert
|
9860 |
+
* @param {Array} spacingSizes Array of the current spacing preset objects
|
9861 |
+
*
|
9862 |
+
* @return {string} Mapping of the spacing preset to its equivalent custom value.
|
9863 |
+
*/
|
9864 |
+
|
9865 |
+
function getCustomValueFromPreset(value, spacingSizes) {
|
9866 |
+
if (!isValueSpacingPreset(value)) {
|
9867 |
+
return value;
|
9868 |
+
}
|
9869 |
+
|
9870 |
+
const slug = getSpacingPresetSlug(value);
|
9871 |
+
const spacingSize = spacingSizes.find(size => String(size.slug) === slug);
|
9872 |
+
return spacingSize === null || spacingSize === void 0 ? void 0 : spacingSize.size;
|
9873 |
+
}
|
9874 |
+
/**
|
9875 |
+
* Converts a spacing preset into a custom value.
|
9876 |
+
*
|
9877 |
+
* @param {string} value Value to convert.
|
9878 |
+
*
|
9879 |
+
* @return {string} CSS var string for given spacing preset value.
|
9880 |
+
*/
|
9881 |
+
|
9882 |
+
function getSpacingPresetCssVar(value) {
|
9883 |
+
if (!value) {
|
9884 |
+
return;
|
9885 |
+
}
|
9886 |
+
|
9887 |
+
const slug = value.match(/var:preset\|spacing\|(.+)/);
|
9888 |
+
|
9889 |
+
if (!slug) {
|
9890 |
+
return value;
|
9891 |
+
}
|
9892 |
+
|
9893 |
+
return `var(--wp--preset--spacing--${slug[1]})`;
|
9894 |
+
}
|
9895 |
+
/**
|
9896 |
+
* Returns the slug section of the given spacing preset string.
|
9897 |
+
*
|
9898 |
+
* @param {string} value Value to extract slug from.
|
9899 |
+
*
|
9900 |
+
* @return {number} The int value of the slug from given spacing preset.
|
9901 |
+
*/
|
9902 |
+
|
9903 |
+
function getSpacingPresetSlug(value) {
|
9904 |
+
if (!value) {
|
9905 |
+
return;
|
9906 |
+
}
|
9907 |
+
|
9908 |
+
if (value === '0' || value === 'default') {
|
9909 |
+
return value;
|
9910 |
+
}
|
9911 |
+
|
9912 |
+
const slug = value.match(/var:preset\|spacing\|(.+)/);
|
9913 |
+
return slug ? slug[1] : undefined;
|
9914 |
+
}
|
9915 |
+
/**
|
9916 |
+
* Converts spacing preset value into a Range component value .
|
9917 |
+
*
|
9918 |
+
* @param {string} presetValue Value to convert to Range value.
|
9919 |
+
* @param {Array} spacingSizes Array of current spacing preset value objects.
|
9920 |
+
*
|
9921 |
+
* @return {number} The int value for use in Range control.
|
9922 |
+
*/
|
9923 |
+
|
9924 |
+
function getSliderValueFromPreset(presetValue, spacingSizes) {
|
9925 |
+
if (presetValue === undefined) {
|
9926 |
+
return 0;
|
9927 |
+
}
|
9928 |
+
|
9929 |
+
const slug = parseFloat(presetValue, 10) === 0 ? '0' : getSpacingPresetSlug(presetValue);
|
9930 |
+
const sliderValue = spacingSizes.findIndex(spacingSize => {
|
9931 |
+
return String(spacingSize.slug) === slug;
|
9932 |
+
}); // Returning NaN rather than undefined as undefined makes range control thumb sit in center
|
9933 |
+
|
9934 |
+
return sliderValue !== -1 ? sliderValue : NaN;
|
9935 |
+
}
|
9936 |
+
const LABELS = {
|
9937 |
+
all: (0,external_wp_i18n_namespaceObject.__)('All sides'),
|
9938 |
+
top: (0,external_wp_i18n_namespaceObject.__)('Top'),
|
9939 |
+
bottom: (0,external_wp_i18n_namespaceObject.__)('Bottom'),
|
9940 |
+
left: (0,external_wp_i18n_namespaceObject.__)('Left'),
|
9941 |
+
right: (0,external_wp_i18n_namespaceObject.__)('Right'),
|
9942 |
+
mixed: (0,external_wp_i18n_namespaceObject.__)('Mixed'),
|
9943 |
+
vertical: (0,external_wp_i18n_namespaceObject.__)('Vertical'),
|
9944 |
+
horizontal: (0,external_wp_i18n_namespaceObject.__)('Horizontal')
|
9945 |
+
};
|
9946 |
+
const DEFAULT_VALUES = {
|
9947 |
+
top: undefined,
|
9948 |
+
right: undefined,
|
9949 |
+
bottom: undefined,
|
9950 |
+
left: undefined
|
9951 |
+
};
|
9952 |
+
const ALL_SIDES = ['top', 'right', 'bottom', 'left'];
|
9953 |
+
/**
|
9954 |
+
* Gets an items with the most occurrence within an array
|
9955 |
+
* https://stackoverflow.com/a/20762713
|
9956 |
+
*
|
9957 |
+
* @param {Array<any>} arr Array of items to check.
|
9958 |
+
* @return {any} The item with the most occurrences.
|
9959 |
+
*/
|
9960 |
+
|
9961 |
+
function mode(arr) {
|
9962 |
+
return arr.sort((a, b) => arr.filter(v => v === a).length - arr.filter(v => v === b).length).pop();
|
9963 |
+
}
|
9964 |
+
/**
|
9965 |
+
* Gets the 'all' input value from values data.
|
9966 |
+
*
|
9967 |
+
* @param {Object} values Box spacing values
|
9968 |
+
*
|
9969 |
+
* @return {string} The most common value from all sides of box.
|
9970 |
+
*/
|
9971 |
+
|
9972 |
+
|
9973 |
+
function getAllRawValue() {
|
9974 |
+
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9975 |
+
return mode(Object.values(values));
|
9976 |
+
}
|
9977 |
+
/**
|
9978 |
+
* Checks to determine if values are mixed.
|
9979 |
+
*
|
9980 |
+
* @param {Object} values Box values.
|
9981 |
+
* @param {Array} sides Sides that values relate to.
|
9982 |
+
*
|
9983 |
+
* @return {boolean} Whether values are mixed.
|
9984 |
+
*/
|
9985 |
+
|
9986 |
+
function isValuesMixed() {
|
9987 |
+
let values = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
9988 |
+
let sides = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : ALL_SIDES;
|
9989 |
+
return Object.values(values).length >= 1 && Object.values(values).length < sides.length || new Set(Object.values(values)).size > 1;
|
9990 |
+
}
|
9991 |
+
/**
|
9992 |
+
* Checks to determine if values are defined.
|
9993 |
+
*
|
9994 |
+
* @param {Object} values Box values.
|
9995 |
+
*
|
9996 |
+
* @return {boolean} Whether values are defined.
|
9997 |
+
*/
|
9998 |
+
|
9999 |
+
function isValuesDefined(values) {
|
10000 |
+
return values !== undefined && !(0,external_lodash_namespaceObject.isEmpty)(Object.values(values).filter( // Switching units when input is empty causes values only
|
10001 |
+
// containing units. This gives false positive on mixed values
|
10002 |
+
// unless filtered.
|
10003 |
+
value => !!value && /\d/.test(value)));
|
10004 |
+
}
|
10005 |
+
|
10006 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/use-setting/index.js
|
10007 |
/**
|
10008 |
* External dependencies
|
10572 |
|
10573 |
|
10574 |
|
10575 |
+
|
10576 |
/**
|
10577 |
* Internal dependencies
|
10578 |
*/
|
10579 |
|
10580 |
|
10581 |
|
10582 |
+
|
10583 |
+
function BlockPopover(_ref, ref) {
|
10584 |
let {
|
10585 |
clientId,
|
10586 |
bottomClientId,
|
10593 |
} = _ref;
|
10594 |
const selectedElement = useBlockElement(clientId);
|
10595 |
const lastSelectedElement = useBlockElement(bottomClientId !== null && bottomClientId !== void 0 ? bottomClientId : clientId);
|
10596 |
+
const mergedRefs = (0,external_wp_compose_namespaceObject.useMergeRefs)([ref, use_popover_scroll(__unstableContentRef)]);
|
10597 |
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
10598 |
if (!selectedElement || lastSelectedElement !== selectedElement) {
|
10599 |
return {};
|
10615 |
bottom: lastSelectedElement
|
10616 |
};
|
10617 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
|
10618 |
+
ref: mergedRefs,
|
10619 |
animate: false,
|
10620 |
position: "top right left",
|
10621 |
focusOnMount: false,
|
10634 |
}, children), !__unstableCoverTarget && children);
|
10635 |
}
|
10636 |
|
10637 |
+
/* harmony default export */ const block_popover = ((0,external_wp_element_namespaceObject.forwardRef)(BlockPopover));
|
10638 |
+
|
10639 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/settings.js
|
10640 |
+
|
10641 |
+
|
10642 |
+
/**
|
10643 |
+
* WordPress dependencies
|
10644 |
+
*/
|
10645 |
+
|
10646 |
+
const settings_settings = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
10647 |
+
xmlns: "http://www.w3.org/2000/svg",
|
10648 |
+
viewBox: "0 0 24 24"
|
10649 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
10650 |
+
d: "M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"
|
10651 |
+
}));
|
10652 |
+
/* harmony default export */ const library_settings = (settings_settings);
|
10653 |
+
|
10654 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/spacing-input-control.js
|
10655 |
+
|
10656 |
+
|
10657 |
+
/**
|
10658 |
+
* External dependencies
|
10659 |
+
*/
|
10660 |
+
|
10661 |
+
/**
|
10662 |
+
* WordPress dependencies
|
10663 |
+
*/
|
10664 |
+
|
10665 |
+
|
10666 |
+
|
10667 |
+
|
10668 |
+
|
10669 |
+
|
10670 |
+
/**
|
10671 |
+
* Internal dependencies
|
10672 |
+
*/
|
10673 |
+
|
10674 |
+
|
10675 |
+
|
10676 |
+
|
10677 |
+
function SpacingInputControl(_ref) {
|
10678 |
+
var _spacingSizes$current;
|
10679 |
+
|
10680 |
+
let {
|
10681 |
+
spacingSizes,
|
10682 |
+
value,
|
10683 |
+
side,
|
10684 |
+
onChange,
|
10685 |
+
isMixed = false,
|
10686 |
+
type,
|
10687 |
+
minimumCustomValue
|
10688 |
+
} = _ref;
|
10689 |
+
let selectListSizes = spacingSizes;
|
10690 |
+
const showRangeControl = spacingSizes.length <= 8;
|
10691 |
+
const disableCustomSpacingSizes = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
10692 |
+
const editorSettings = select(store).getSettings();
|
10693 |
+
return editorSettings === null || editorSettings === void 0 ? void 0 : editorSettings.disableCustomSpacingSizes;
|
10694 |
+
});
|
10695 |
+
const [showCustomValueControl, setShowCustomValueControl] = (0,external_wp_element_namespaceObject.useState)(!disableCustomSpacingSizes && value !== undefined && !isValueSpacingPreset(value));
|
10696 |
+
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
10697 |
+
availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem']
|
10698 |
+
});
|
10699 |
+
let currentValue = null;
|
10700 |
+
const showCustomValueInSelectList = !showRangeControl && !showCustomValueControl && value !== undefined && (!isValueSpacingPreset(value) || isValueSpacingPreset(value) && isMixed);
|
10701 |
+
|
10702 |
+
if (showCustomValueInSelectList) {
|
10703 |
+
selectListSizes = [...spacingSizes, {
|
10704 |
+
name: !isMixed ? // translators: A custom measurement, eg. a number followed by a unit like 12px.
|
10705 |
+
(0,external_wp_i18n_namespaceObject.sprintf)((0,external_wp_i18n_namespaceObject.__)('Custom (%s)'), value) : (0,external_wp_i18n_namespaceObject.__)('Mixed'),
|
10706 |
+
slug: 'custom',
|
10707 |
+
size: value
|
10708 |
+
}];
|
10709 |
+
currentValue = selectListSizes.length - 1;
|
10710 |
+
} else if (!isMixed) {
|
10711 |
+
currentValue = !showCustomValueControl ? getSliderValueFromPreset(value, spacingSizes) : getCustomValueFromPreset(value, spacingSizes);
|
10712 |
+
}
|
10713 |
+
|
10714 |
+
const selectedUnit = (0,external_wp_element_namespaceObject.useMemo)(() => (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(currentValue), [currentValue])[1] || units[0].value;
|
10715 |
+
|
10716 |
+
const setInitialValue = () => {
|
10717 |
+
if (value === undefined) {
|
10718 |
+
onChange('0');
|
10719 |
+
}
|
10720 |
+
};
|
10721 |
+
|
10722 |
+
const customTooltipContent = newValue => {
|
10723 |
+
var _spacingSizes$newValu;
|
10724 |
+
|
10725 |
+
return value === undefined ? undefined : (_spacingSizes$newValu = spacingSizes[newValue]) === null || _spacingSizes$newValu === void 0 ? void 0 : _spacingSizes$newValu.name;
|
10726 |
+
};
|
10727 |
+
|
10728 |
+
const customRangeValue = parseInt(currentValue, 10);
|
10729 |
+
|
10730 |
+
const getNewCustomValue = newSize => {
|
10731 |
+
const isNumeric = !isNaN(parseFloat(newSize));
|
10732 |
+
const nextValue = isNumeric ? newSize : undefined;
|
10733 |
+
return nextValue;
|
10734 |
+
};
|
10735 |
+
|
10736 |
+
const getNewPresetValue = (newSize, controlType) => {
|
10737 |
+
var _spacingSizes$newSize;
|
10738 |
+
|
10739 |
+
const size = parseInt(newSize, 10);
|
10740 |
+
|
10741 |
+
if (controlType === 'selectList') {
|
10742 |
+
if (size === 0) {
|
10743 |
+
return undefined;
|
10744 |
+
}
|
10745 |
+
|
10746 |
+
if (size === 1) {
|
10747 |
+
return '0';
|
10748 |
+
}
|
10749 |
+
} else if (size === 0) {
|
10750 |
+
return '0';
|
10751 |
+
}
|
10752 |
+
|
10753 |
+
return `var:preset|spacing|${(_spacingSizes$newSize = spacingSizes[newSize]) === null || _spacingSizes$newSize === void 0 ? void 0 : _spacingSizes$newSize.slug}`;
|
10754 |
+
};
|
10755 |
+
|
10756 |
+
const handleCustomValueSliderChange = next => {
|
10757 |
+
onChange([next, selectedUnit].join(''));
|
10758 |
+
};
|
10759 |
+
|
10760 |
+
const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)('Mixed') : null;
|
10761 |
+
const currentValueHint = !isMixed ? customTooltipContent(currentValue) : (0,external_wp_i18n_namespaceObject.__)('Mixed');
|
10762 |
+
const options = selectListSizes.map((size, index) => ({
|
10763 |
+
key: index,
|
10764 |
+
name: size.name
|
10765 |
+
}));
|
10766 |
+
const marks = spacingSizes.map((newValue, index) => ({
|
10767 |
+
value: index,
|
10768 |
+
label: undefined
|
10769 |
+
}));
|
10770 |
+
const ariaLabel = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: 1: The side of the block being modified (top, bottom, left, etc.). 2. Type of spacing being modified (Padding, margin, etc)
|
10771 |
+
(0,external_wp_i18n_namespaceObject.__)('%1$s %2$s'), LABELS[side], type === null || type === void 0 ? void 0 : type.toLowerCase());
|
10772 |
+
const showHint = showRangeControl && !showCustomValueControl && currentValueHint !== undefined;
|
10773 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, side !== 'all' && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalHStack, {
|
10774 |
+
className: "components-spacing-sizes-control__side-labels"
|
10775 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
|
10776 |
+
className: "components-spacing-sizes-control__side-label"
|
10777 |
+
}, LABELS[side]), showHint && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
|
10778 |
+
className: "components-spacing-sizes-control__hint-single"
|
10779 |
+
}, currentValueHint)), side === 'all' && showHint && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
|
10780 |
+
className: "components-spacing-sizes-control__hint-all"
|
10781 |
+
}, currentValueHint), !disableCustomSpacingSizes && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
10782 |
+
label: showCustomValueControl ? (0,external_wp_i18n_namespaceObject.__)('Use size preset') : (0,external_wp_i18n_namespaceObject.__)('Set custom size'),
|
10783 |
+
icon: library_settings,
|
10784 |
+
onClick: () => {
|
10785 |
+
setShowCustomValueControl(!showCustomValueControl);
|
10786 |
+
},
|
10787 |
+
isPressed: showCustomValueControl,
|
10788 |
+
isSmall: true,
|
10789 |
+
className: classnames_default()({
|
10790 |
+
'components-spacing-sizes-control__custom-toggle-all': side === 'all',
|
10791 |
+
'components-spacing-sizes-control__custom-toggle-single': side !== 'all'
|
10792 |
+
}),
|
10793 |
+
iconSize: 24
|
10794 |
+
}), showCustomValueControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, {
|
10795 |
+
onChange: newSize => onChange(getNewCustomValue(newSize)),
|
10796 |
+
value: currentValue,
|
10797 |
+
units: units,
|
10798 |
+
min: minimumCustomValue,
|
10799 |
+
placeholder: allPlaceholder,
|
10800 |
+
disableUnits: isMixed,
|
10801 |
+
label: ariaLabel,
|
10802 |
+
hideLabelFromVision: true,
|
10803 |
+
className: "components-spacing-sizes-control__custom-value-input"
|
10804 |
+
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
10805 |
+
value: customRangeValue,
|
10806 |
+
min: 0,
|
10807 |
+
max: 100,
|
10808 |
+
withInputField: false,
|
10809 |
+
onChange: handleCustomValueSliderChange,
|
10810 |
+
className: "components-spacing-sizes-control__custom-value-range"
|
10811 |
+
})), showRangeControl && !showCustomValueControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
10812 |
+
className: "components-spacing-sizes-control__range-control",
|
10813 |
+
value: currentValue,
|
10814 |
+
onChange: newSize => onChange(getNewPresetValue(newSize)),
|
10815 |
+
onMouseDown: event => {
|
10816 |
+
var _event$nativeEvent;
|
10817 |
+
|
10818 |
+
// If mouse down is near start of range set initial value to 0, which
|
10819 |
+
// prevents the user have to drag right then left to get 0 setting.
|
10820 |
+
if ((event === null || event === void 0 ? void 0 : (_event$nativeEvent = event.nativeEvent) === null || _event$nativeEvent === void 0 ? void 0 : _event$nativeEvent.offsetX) < 35) {
|
10821 |
+
setInitialValue();
|
10822 |
+
}
|
10823 |
+
},
|
10824 |
+
withInputField: false,
|
10825 |
+
"aria-valuenow": currentValue,
|
10826 |
+
"aria-valuetext": (_spacingSizes$current = spacingSizes[currentValue]) === null || _spacingSizes$current === void 0 ? void 0 : _spacingSizes$current.name,
|
10827 |
+
renderTooltipContent: customTooltipContent,
|
10828 |
+
min: 0,
|
10829 |
+
max: spacingSizes.length - 1,
|
10830 |
+
marks: marks,
|
10831 |
+
label: ariaLabel,
|
10832 |
+
hideLabelFromVision: true
|
10833 |
+
}), !showRangeControl && !showCustomValueControl && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CustomSelectControl, {
|
10834 |
+
className: "components-spacing-sizes-control__custom-select-control",
|
10835 |
+
value: options.find(option => option.key === currentValue) || '' // passing undefined here causes a downshift controlled/uncontrolled warning
|
10836 |
+
,
|
10837 |
+
onChange: selection => {
|
10838 |
+
onChange(getNewPresetValue(selection.selectedItem.key, 'selectList'));
|
10839 |
+
},
|
10840 |
+
options: options,
|
10841 |
+
label: ariaLabel,
|
10842 |
+
hideLabelFromVision: true,
|
10843 |
+
__nextUnconstrainedWidth: true
|
10844 |
+
}));
|
10845 |
+
}
|
10846 |
+
|
10847 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/all-input-control.js
|
10848 |
+
|
10849 |
+
|
10850 |
+
/**
|
10851 |
+
* WordPress dependencies
|
10852 |
+
*/
|
10853 |
+
|
10854 |
+
/**
|
10855 |
+
* Internal dependencies
|
10856 |
+
*/
|
10857 |
+
|
10858 |
+
|
10859 |
+
|
10860 |
+
function AllInputControl(_ref) {
|
10861 |
+
let {
|
10862 |
+
onChange,
|
10863 |
+
values,
|
10864 |
+
sides,
|
10865 |
+
spacingSizes,
|
10866 |
+
type,
|
10867 |
+
minimumCustomValue
|
10868 |
+
} = _ref;
|
10869 |
+
const allValue = getAllRawValue(values);
|
10870 |
+
const hasValues = isValuesDefined(values);
|
10871 |
+
const isMixed = hasValues && isValuesMixed(values, sides);
|
10872 |
+
|
10873 |
+
const handleOnChange = next => {
|
10874 |
+
const nextValues = (0,external_wp_components_namespaceObject.__experimentalApplyValueToSides)(values, next, sides);
|
10875 |
+
onChange(nextValues);
|
10876 |
+
};
|
10877 |
+
|
10878 |
+
return (0,external_wp_element_namespaceObject.createElement)(SpacingInputControl, {
|
10879 |
+
value: allValue,
|
10880 |
+
onChange: handleOnChange,
|
10881 |
+
side: 'all',
|
10882 |
+
spacingSizes: spacingSizes,
|
10883 |
+
isMixed: isMixed,
|
10884 |
+
type: type,
|
10885 |
+
minimumCustomValue: minimumCustomValue
|
10886 |
+
});
|
10887 |
+
}
|
10888 |
+
|
10889 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/input-controls.js
|
10890 |
+
|
10891 |
+
|
10892 |
+
/**
|
10893 |
+
* Internal dependencies
|
10894 |
+
*/
|
10895 |
+
|
10896 |
+
|
10897 |
+
function BoxInputControls(_ref) {
|
10898 |
+
let {
|
10899 |
+
values,
|
10900 |
+
sides,
|
10901 |
+
onChange,
|
10902 |
+
spacingSizes,
|
10903 |
+
type,
|
10904 |
+
minimumCustomValue
|
10905 |
+
} = _ref;
|
10906 |
+
// Filter sides if custom configuration provided, maintaining default order.
|
10907 |
+
const filteredSides = sides !== null && sides !== void 0 && sides.length ? ALL_SIDES.filter(side => sides.includes(side)) : ALL_SIDES;
|
10908 |
+
|
10909 |
+
const createHandleOnChange = side => next => {
|
10910 |
+
const nextValues = { ...values
|
10911 |
+
};
|
10912 |
+
nextValues[side] = next;
|
10913 |
+
onChange(nextValues);
|
10914 |
+
};
|
10915 |
+
|
10916 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, filteredSides.map(side => {
|
10917 |
+
return (0,external_wp_element_namespaceObject.createElement)(SpacingInputControl, {
|
10918 |
+
value: values[side],
|
10919 |
+
label: LABELS[side],
|
10920 |
+
key: `spacing-sizes-control-${side}`,
|
10921 |
+
withInputField: false,
|
10922 |
+
side: side,
|
10923 |
+
onChange: createHandleOnChange(side),
|
10924 |
+
spacingSizes: spacingSizes,
|
10925 |
+
type: type,
|
10926 |
+
minimumCustomValue: minimumCustomValue
|
10927 |
+
});
|
10928 |
+
}));
|
10929 |
+
}
|
10930 |
+
|
10931 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/axial-input-controls.js
|
10932 |
+
|
10933 |
+
|
10934 |
+
/**
|
10935 |
+
* Internal dependencies
|
10936 |
+
*/
|
10937 |
+
|
10938 |
+
|
10939 |
+
const groupedSides = ['vertical', 'horizontal'];
|
10940 |
+
function AxialInputControls(_ref) {
|
10941 |
+
let {
|
10942 |
+
onChange,
|
10943 |
+
values,
|
10944 |
+
sides,
|
10945 |
+
spacingSizes,
|
10946 |
+
type,
|
10947 |
+
minimumCustomValue
|
10948 |
+
} = _ref;
|
10949 |
+
|
10950 |
+
const createHandleOnChange = side => next => {
|
10951 |
+
if (!onChange) {
|
10952 |
+
return;
|
10953 |
+
}
|
10954 |
+
|
10955 |
+
const nextValues = { ...values
|
10956 |
+
};
|
10957 |
+
|
10958 |
+
if (side === 'vertical') {
|
10959 |
+
nextValues.top = next;
|
10960 |
+
nextValues.bottom = next;
|
10961 |
+
}
|
10962 |
+
|
10963 |
+
if (side === 'horizontal') {
|
10964 |
+
nextValues.left = next;
|
10965 |
+
nextValues.right = next;
|
10966 |
+
}
|
10967 |
+
|
10968 |
+
onChange(nextValues);
|
10969 |
+
}; // Filter sides if custom configuration provided, maintaining default order.
|
10970 |
+
|
10971 |
+
|
10972 |
+
const filteredSides = sides !== null && sides !== void 0 && sides.length ? groupedSides.filter(side => sides.includes(side)) : groupedSides;
|
10973 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, filteredSides.map(side => {
|
10974 |
+
const axisValue = side === 'vertical' ? values.top : values.left;
|
10975 |
+
return (0,external_wp_element_namespaceObject.createElement)(SpacingInputControl, {
|
10976 |
+
value: axisValue,
|
10977 |
+
onChange: createHandleOnChange(side),
|
10978 |
+
label: LABELS[side],
|
10979 |
+
key: `spacing-sizes-control-${side}`,
|
10980 |
+
withInputField: false,
|
10981 |
+
side: side,
|
10982 |
+
spacingSizes: spacingSizes,
|
10983 |
+
type: type,
|
10984 |
+
minimumCustomValue: minimumCustomValue
|
10985 |
+
});
|
10986 |
+
}));
|
10987 |
+
}
|
10988 |
+
|
10989 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/link.js
|
10990 |
+
|
10991 |
+
|
10992 |
+
/**
|
10993 |
+
* WordPress dependencies
|
10994 |
+
*/
|
10995 |
+
|
10996 |
+
const link_link = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
10997 |
+
xmlns: "http://www.w3.org/2000/svg",
|
10998 |
+
viewBox: "0 0 24 24"
|
10999 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
11000 |
+
d: "M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"
|
11001 |
+
}));
|
11002 |
+
/* harmony default export */ const library_link = (link_link);
|
11003 |
+
|
11004 |
+
;// CONCATENATED MODULE: ./packages/icons/build-module/library/link-off.js
|
11005 |
+
|
11006 |
+
|
11007 |
+
/**
|
11008 |
+
* WordPress dependencies
|
11009 |
+
*/
|
11010 |
+
|
11011 |
+
const linkOff = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
|
11012 |
+
xmlns: "http://www.w3.org/2000/svg",
|
11013 |
+
viewBox: "0 0 24 24"
|
11014 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
|
11015 |
+
d: "M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"
|
11016 |
+
}));
|
11017 |
+
/* harmony default export */ const link_off = (linkOff);
|
11018 |
+
|
11019 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/linked-button.js
|
11020 |
+
|
11021 |
+
|
11022 |
+
/**
|
11023 |
+
* WordPress dependencies
|
11024 |
+
*/
|
11025 |
+
|
11026 |
+
|
11027 |
+
|
11028 |
+
function LinkedButton(_ref) {
|
11029 |
+
let {
|
11030 |
+
isLinked,
|
11031 |
+
onClick
|
11032 |
+
} = _ref;
|
11033 |
+
const label = isLinked ? (0,external_wp_i18n_namespaceObject.__)('Unlink Sides') : (0,external_wp_i18n_namespaceObject.__)('Link Sides');
|
11034 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
|
11035 |
+
text: label
|
11036 |
+
}, (0,external_wp_element_namespaceObject.createElement)("span", {
|
11037 |
+
className: "component-spacing-sizes-control__linked-button"
|
11038 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
|
11039 |
+
variant: isLinked ? 'primary' : 'secondary',
|
11040 |
+
isSmall: true,
|
11041 |
+
icon: isLinked ? library_link : link_off,
|
11042 |
+
iconSize: 16,
|
11043 |
+
"aria-label": label,
|
11044 |
+
onClick: onClick
|
11045 |
+
})));
|
11046 |
+
}
|
11047 |
+
|
11048 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/spacing-sizes-control/index.js
|
11049 |
+
|
11050 |
+
|
11051 |
+
|
11052 |
+
/**
|
11053 |
+
* WordPress dependencies
|
11054 |
+
*/
|
11055 |
+
|
11056 |
+
|
11057 |
+
|
11058 |
+
/**
|
11059 |
+
* Internal dependencies
|
11060 |
+
*/
|
11061 |
+
|
11062 |
+
|
11063 |
+
|
11064 |
+
|
11065 |
+
|
11066 |
+
|
11067 |
+
|
11068 |
+
function SpacingSizesControl(_ref) {
|
11069 |
+
let {
|
11070 |
+
inputProps,
|
11071 |
+
onChange,
|
11072 |
+
label = (0,external_wp_i18n_namespaceObject.__)('Spacing Control'),
|
11073 |
+
values,
|
11074 |
+
sides,
|
11075 |
+
splitOnAxis = false,
|
11076 |
+
useSelect,
|
11077 |
+
minimumCustomValue = 0
|
11078 |
+
} = _ref;
|
11079 |
+
const spacingSizes = [{
|
11080 |
+
name: 0,
|
11081 |
+
slug: '0',
|
11082 |
+
size: 0
|
11083 |
+
}, ...(useSetting('spacing.spacingSizes') || [])];
|
11084 |
+
|
11085 |
+
if (spacingSizes.length > 8) {
|
11086 |
+
spacingSizes.unshift({
|
11087 |
+
name: (0,external_wp_i18n_namespaceObject.__)('Default'),
|
11088 |
+
slug: 'default',
|
11089 |
+
size: undefined
|
11090 |
+
});
|
11091 |
+
}
|
11092 |
+
|
11093 |
+
const inputValues = values || DEFAULT_VALUES;
|
11094 |
+
const hasInitialValue = isValuesDefined(values);
|
11095 |
+
const hasOneSide = (sides === null || sides === void 0 ? void 0 : sides.length) === 1;
|
11096 |
+
const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!hasInitialValue || !isValuesMixed(inputValues, sides) || hasOneSide);
|
11097 |
+
|
11098 |
+
const toggleLinked = () => {
|
11099 |
+
setIsLinked(!isLinked);
|
11100 |
+
};
|
11101 |
+
|
11102 |
+
const handleOnChange = nextValue => {
|
11103 |
+
const newValues = { ...values,
|
11104 |
+
...nextValue
|
11105 |
+
};
|
11106 |
+
onChange(newValues);
|
11107 |
+
};
|
11108 |
+
|
11109 |
+
const inputControlProps = { ...inputProps,
|
11110 |
+
onChange: handleOnChange,
|
11111 |
+
isLinked,
|
11112 |
+
sides,
|
11113 |
+
values: inputValues,
|
11114 |
+
spacingSizes,
|
11115 |
+
useSelect,
|
11116 |
+
type: label,
|
11117 |
+
minimumCustomValue
|
11118 |
+
};
|
11119 |
+
return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
|
11120 |
+
role: "region",
|
11121 |
+
className: "component-spacing-sizes-control"
|
11122 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalText, {
|
11123 |
+
as: "legend"
|
11124 |
+
}, label), !hasOneSide && (0,external_wp_element_namespaceObject.createElement)(LinkedButton, {
|
11125 |
+
onClick: toggleLinked,
|
11126 |
+
isLinked: isLinked
|
11127 |
+
}), isLinked && (0,external_wp_element_namespaceObject.createElement)(AllInputControl, _extends({
|
11128 |
+
"aria-label": label
|
11129 |
+
}, inputControlProps)), !isLinked && splitOnAxis && (0,external_wp_element_namespaceObject.createElement)(AxialInputControls, inputControlProps), !isLinked && !splitOnAxis && (0,external_wp_element_namespaceObject.createElement)(BoxInputControls, inputControlProps));
|
11130 |
+
}
|
11131 |
+
|
11132 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/margin.js
|
11133 |
|
11134 |
|
11148 |
|
11149 |
|
11150 |
|
11151 |
+
|
11152 |
+
|
11153 |
/**
|
11154 |
* Determines if there is margin support.
|
11155 |
*
|
11224 |
*/
|
11225 |
|
11226 |
function MarginEdit(props) {
|
11227 |
+
var _style$spacing, _style$spacing2;
|
11228 |
|
11229 |
const {
|
11230 |
name: blockName,
|
11233 |
},
|
11234 |
setAttributes
|
11235 |
} = props;
|
11236 |
+
const spacingSizes = useSetting('spacing.spacingSizes');
|
11237 |
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
11238 |
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
11239 |
});
|
11256 |
};
|
11257 |
|
11258 |
return external_wp_element_namespaceObject.Platform.select({
|
11259 |
+
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (!spacingSizes || (spacingSizes === null || spacingSizes === void 0 ? void 0 : spacingSizes.length) === 0) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
11260 |
values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.margin,
|
11261 |
onChange: onChange,
|
11262 |
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
11264 |
units: units,
|
11265 |
allowReset: false,
|
11266 |
splitOnAxis: splitOnAxis
|
11267 |
+
}), (spacingSizes === null || spacingSizes === void 0 ? void 0 : spacingSizes.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(SpacingSizesControl, {
|
11268 |
+
values: style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.margin,
|
11269 |
+
onChange: onChange,
|
11270 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
11271 |
+
sides: sides,
|
11272 |
+
units: units,
|
11273 |
+
allowReset: false,
|
11274 |
+
splitOnAxis: false
|
11275 |
})),
|
11276 |
native: null
|
11277 |
});
|
11284 |
attributes
|
11285 |
} = _ref2;
|
11286 |
const margin = attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$spa = _attributes$style.spacing) === null || _attributes$style$spa === void 0 ? void 0 : _attributes$style$spa.margin;
|
11287 |
+
const spacingSizes = useSetting('spacing.spacingSizes');
|
11288 |
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
11289 |
+
const marginTop = margin !== null && margin !== void 0 && margin.top ? getCustomValueFromPreset(margin === null || margin === void 0 ? void 0 : margin.top, spacingSizes) : 0;
|
11290 |
+
const marginRight = margin !== null && margin !== void 0 && margin.right ? getCustomValueFromPreset(margin === null || margin === void 0 ? void 0 : margin.right, spacingSizes) : 0;
|
11291 |
+
const marginBottom = margin !== null && margin !== void 0 && margin.bottom ? getCustomValueFromPreset(margin === null || margin === void 0 ? void 0 : margin.bottom, spacingSizes) : 0;
|
11292 |
+
const marginLeft = margin !== null && margin !== void 0 && margin.left ? getCustomValueFromPreset(margin === null || margin === void 0 ? void 0 : margin.left, spacingSizes) : 0;
|
11293 |
return {
|
11294 |
+
borderTopWidth: marginTop,
|
11295 |
+
borderRightWidth: marginRight,
|
11296 |
+
borderBottomWidth: marginBottom,
|
11297 |
+
borderLeftWidth: marginLeft,
|
11298 |
+
top: marginTop !== 0 ? `-${marginTop}` : 0,
|
11299 |
+
right: marginRight !== 0 ? `-${marginRight}` : 0,
|
11300 |
+
bottom: marginBottom !== 0 ? `-${marginBottom}` : 0,
|
11301 |
+
left: marginLeft !== 0 ? `-${marginLeft}` : 0
|
11302 |
};
|
11303 |
}, [margin]);
|
11304 |
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
|
11328 |
return null;
|
11329 |
}
|
11330 |
|
11331 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_popover, {
|
11332 |
clientId: clientId,
|
11333 |
__unstableCoverTarget: true,
|
11334 |
__unstableRefreshSize: margin
|
11357 |
|
11358 |
|
11359 |
|
11360 |
+
|
11361 |
+
|
11362 |
/**
|
11363 |
* Determines if there is padding support.
|
11364 |
*
|
11433 |
*/
|
11434 |
|
11435 |
function PaddingEdit(props) {
|
11436 |
+
var _style$spacing, _style$spacing2;
|
11437 |
|
11438 |
const {
|
11439 |
name: blockName,
|
11442 |
},
|
11443 |
setAttributes
|
11444 |
} = props;
|
11445 |
+
const spacingSizes = useSetting('spacing.spacingSizes');
|
11446 |
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
11447 |
availableUnits: useSetting('spacing.units') || ['%', 'px', 'em', 'rem', 'vw']
|
11448 |
});
|
11465 |
};
|
11466 |
|
11467 |
return external_wp_element_namespaceObject.Platform.select({
|
11468 |
+
web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (!spacingSizes || (spacingSizes === null || spacingSizes === void 0 ? void 0 : spacingSizes.length) === 0) && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
|
11469 |
values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.padding,
|
11470 |
onChange: onChange,
|
11471 |
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
11473 |
units: units,
|
11474 |
allowReset: false,
|
11475 |
splitOnAxis: splitOnAxis
|
11476 |
+
}), (spacingSizes === null || spacingSizes === void 0 ? void 0 : spacingSizes.length) > 0 && (0,external_wp_element_namespaceObject.createElement)(SpacingSizesControl, {
|
11477 |
+
values: style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.padding,
|
11478 |
+
onChange: onChange,
|
11479 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
11480 |
+
sides: sides,
|
11481 |
+
units: units,
|
11482 |
+
allowReset: false,
|
11483 |
+
splitOnAxis: splitOnAxis
|
11484 |
})),
|
11485 |
native: null
|
11486 |
});
|
11494 |
} = _ref2;
|
11495 |
const padding = attributes === null || attributes === void 0 ? void 0 : (_attributes$style = attributes.style) === null || _attributes$style === void 0 ? void 0 : (_attributes$style$spa = _attributes$style.spacing) === null || _attributes$style$spa === void 0 ? void 0 : _attributes$style$spa.padding;
|
11496 |
const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
|
|
|
|
11497 |
return {
|
11498 |
+
borderTopWidth: isValueSpacingPreset(padding === null || padding === void 0 ? void 0 : padding.top) ? getSpacingPresetCssVar(padding === null || padding === void 0 ? void 0 : padding.top) : padding === null || padding === void 0 ? void 0 : padding.top,
|
11499 |
+
borderRightWidth: isValueSpacingPreset(padding === null || padding === void 0 ? void 0 : padding.right) ? getSpacingPresetCssVar(padding === null || padding === void 0 ? void 0 : padding.right) : padding === null || padding === void 0 ? void 0 : padding.right,
|
11500 |
+
borderBottomWidth: isValueSpacingPreset(padding === null || padding === void 0 ? void 0 : padding.bottom) ? getSpacingPresetCssVar(padding === null || padding === void 0 ? void 0 : padding.bottom) : padding === null || padding === void 0 ? void 0 : padding.bottom,
|
11501 |
+
borderLeftWidth: isValueSpacingPreset(padding === null || padding === void 0 ? void 0 : padding.left) ? getSpacingPresetCssVar(padding === null || padding === void 0 ? void 0 : padding.left) : padding === null || padding === void 0 ? void 0 : padding.left
|
11502 |
};
|
11503 |
}, [padding]);
|
11504 |
const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
|
11528 |
return null;
|
11529 |
}
|
11530 |
|
11531 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_popover, {
|
11532 |
clientId: clientId,
|
11533 |
__unstableCoverTarget: true,
|
11534 |
__unstableRefreshSize: padding
|
11541 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/dimensions.js
|
11542 |
|
11543 |
|
11544 |
+
/**
|
11545 |
+
* External dependencies
|
11546 |
+
*/
|
11547 |
+
|
11548 |
/**
|
11549 |
* WordPress dependencies
|
11550 |
*/
|
11552 |
|
11553 |
|
11554 |
|
11555 |
+
|
11556 |
/**
|
11557 |
* Internal dependencies
|
11558 |
*/
|
11561 |
|
11562 |
|
11563 |
|
11564 |
+
|
11565 |
const SPACING_SUPPORT_KEY = 'spacing';
|
11566 |
+
const dimensions_ALL_SIDES = ['top', 'right', 'bottom', 'left'];
|
11567 |
const AXIAL_SIDES = ['vertical', 'horizontal'];
|
11568 |
/**
|
11569 |
* Inspector controls for dimensions support.
|
11579 |
const isMarginDisabled = useIsMarginDisabled(props);
|
11580 |
const isDisabled = useIsDimensionsDisabled(props);
|
11581 |
const isSupported = hasDimensionsSupport(props.name);
|
11582 |
+
const spacingSizes = useSetting('spacing.spacingSizes');
|
11583 |
|
11584 |
if (isDisabled || !isSupported) {
|
11585 |
return null;
|
11602 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
|
11603 |
__experimentalGroup: "dimensions"
|
11604 |
}, !isPaddingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
11605 |
+
className: classnames_default()({
|
11606 |
+
'tools-panel-item-spacing': spacingSizes && spacingSizes.length > 0
|
11607 |
+
}),
|
11608 |
hasValue: () => hasPaddingValue(props),
|
11609 |
label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
|
11610 |
onDeselect: () => resetPadding(props),
|
11612 |
isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.padding,
|
11613 |
panelId: props.clientId
|
11614 |
}, (0,external_wp_element_namespaceObject.createElement)(PaddingEdit, props)), !isMarginDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
|
11615 |
+
className: classnames_default()({
|
11616 |
+
'tools-panel-item-spacing': spacingSizes && spacingSizes.length > 0
|
11617 |
+
}),
|
11618 |
hasValue: () => hasMarginValue(props),
|
11619 |
label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
|
11620 |
onDeselect: () => resetMargin(props),
|
11707 |
function useIsDimensionsSupportValid(blockName, feature) {
|
11708 |
const sides = useCustomSides(blockName, feature);
|
11709 |
|
11710 |
+
if (sides && sides.some(side => dimensions_ALL_SIDES.includes(side)) && sides.some(side => AXIAL_SIDES.includes(side))) {
|
11711 |
// eslint-disable-next-line no-console
|
11712 |
console.warn(`The ${feature} support for the "${blockName}" block can not be configured to support both axial and arbitrary sides.`);
|
11713 |
return false;
|
11734 |
|
11735 |
|
11736 |
|
11737 |
+
|
11738 |
/**
|
11739 |
* Determines if there is gap support.
|
11740 |
*
|
11774 |
|
11775 |
const isValueString = typeof blockGapValue === 'string';
|
11776 |
return {
|
11777 |
+
top: isValueString ? getSpacingPresetCssVar(blockGapValue) : getSpacingPresetCssVar(blockGapValue === null || blockGapValue === void 0 ? void 0 : blockGapValue.top),
|
11778 |
+
left: isValueString ? getSpacingPresetCssVar(blockGapValue) : getSpacingPresetCssVar(blockGapValue === null || blockGapValue === void 0 ? void 0 : blockGapValue.left)
|
11779 |
};
|
11780 |
}
|
11781 |
/**
|
12261 |
} = layout; // If a block's block.json skips serialization for spacing or spacing.blockGap,
|
12262 |
// don't apply the user-defined value to the styles.
|
12263 |
|
12264 |
+
const blockGapValue = style !== null && style !== void 0 && (_style$spacing = style.spacing) !== null && _style$spacing !== void 0 && _style$spacing.blockGap && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? getGapCSSValue(style === null || style === void 0 ? void 0 : (_style$spacing2 = style.spacing) === null || _style$spacing2 === void 0 ? void 0 : _style$spacing2.blockGap, '0.5em') : undefined;
|
12265 |
const justifyContent = justifyContentMap[layout.justifyContent];
|
12266 |
const flexWrap = flexWrapOptions.includes(layout.flexWrap) ? layout.flexWrap : 'wrap';
|
12267 |
const verticalAlignment = verticalAlignmentMap[layout.verticalAlignment];
|
12480 |
}));
|
12481 |
}
|
12482 |
|
12483 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/flow.js
|
12484 |
+
/**
|
12485 |
+
* WordPress dependencies
|
12486 |
+
*/
|
12487 |
+
|
12488 |
+
/**
|
12489 |
+
* Internal dependencies
|
12490 |
+
*/
|
12491 |
+
|
12492 |
+
|
12493 |
+
|
12494 |
+
|
12495 |
+
/* harmony default export */ const flow = ({
|
12496 |
+
name: 'default',
|
12497 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Flow'),
|
12498 |
+
inspectorControls: function DefaultLayoutInspectorControls() {
|
12499 |
+
return null;
|
12500 |
+
},
|
12501 |
+
toolBarControls: function DefaultLayoutToolbarControls() {
|
12502 |
+
return null;
|
12503 |
+
},
|
12504 |
+
getLayoutStyle: function getLayoutStyle(_ref) {
|
12505 |
+
var _style$spacing;
|
12506 |
+
|
12507 |
+
let {
|
12508 |
+
selector,
|
12509 |
+
style,
|
12510 |
+
blockName,
|
12511 |
+
hasBlockGapSupport,
|
12512 |
+
layoutDefinitions
|
12513 |
+
} = _ref;
|
12514 |
+
const blockGapStyleValue = getGapBoxControlValueFromStyle(style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap); // If a block's block.json skips serialization for spacing or
|
12515 |
+
// spacing.blockGap, don't apply the user-defined value to the styles.
|
12516 |
+
|
12517 |
+
const blockGapValue = blockGapStyleValue !== null && blockGapStyleValue !== void 0 && blockGapStyleValue.top && !shouldSkipSerialization(blockName, 'spacing', 'blockGap') ? blockGapStyleValue === null || blockGapStyleValue === void 0 ? void 0 : blockGapStyleValue.top : '';
|
12518 |
+
let output = ''; // Output blockGap styles based on rules contained in layout definitions in theme.json.
|
12519 |
+
|
12520 |
+
if (hasBlockGapSupport && blockGapValue) {
|
12521 |
+
output += getBlockGapCSS(selector, layoutDefinitions, 'default', blockGapValue);
|
12522 |
+
}
|
12523 |
+
|
12524 |
+
return output;
|
12525 |
+
},
|
12526 |
+
|
12527 |
+
getOrientation() {
|
12528 |
+
return 'vertical';
|
12529 |
+
},
|
12530 |
+
|
12531 |
+
getAlignments(layout) {
|
12532 |
+
const alignmentInfo = getAlignmentsInfo(layout);
|
12533 |
+
|
12534 |
+
if (layout.alignments !== undefined) {
|
12535 |
+
if (!layout.alignments.includes('none')) {
|
12536 |
+
layout.alignments.unshift('none');
|
12537 |
+
}
|
12538 |
+
|
12539 |
+
return layout.alignments.map(alignment => ({
|
12540 |
+
name: alignment,
|
12541 |
+
info: alignmentInfo[alignment]
|
12542 |
+
}));
|
12543 |
+
}
|
12544 |
+
|
12545 |
+
const {
|
12546 |
+
contentSize,
|
12547 |
+
wideSize
|
12548 |
+
} = layout;
|
12549 |
+
const alignments = [{
|
12550 |
+
name: 'left'
|
12551 |
+
}, {
|
12552 |
+
name: 'center'
|
12553 |
+
}, {
|
12554 |
+
name: 'right'
|
12555 |
+
}];
|
12556 |
+
|
12557 |
+
if (contentSize) {
|
12558 |
+
alignments.unshift({
|
12559 |
+
name: 'full'
|
12560 |
+
});
|
12561 |
+
}
|
12562 |
+
|
12563 |
+
if (wideSize) {
|
12564 |
+
alignments.unshift({
|
12565 |
+
name: 'wide',
|
12566 |
+
info: alignmentInfo.wide
|
12567 |
+
});
|
12568 |
+
}
|
12569 |
+
|
12570 |
+
alignments.unshift({
|
12571 |
+
name: 'none',
|
12572 |
+
info: alignmentInfo.none
|
12573 |
+
});
|
12574 |
+
return alignments;
|
12575 |
+
}
|
12576 |
+
|
12577 |
+
});
|
12578 |
+
|
12579 |
;// CONCATENATED MODULE: ./packages/icons/build-module/icon/index.js
|
12580 |
/**
|
12581 |
* WordPress dependencies
|
12675 |
/**
|
12676 |
* Returns a JSON representation of the generated CSS rules taking into account box model properties, top, right, bottom, left.
|
12677 |
*
|
12678 |
+
* @param style Style object.
|
12679 |
+
* @param options Options object with settings to adjust how the styles are generated.
|
12680 |
+
* @param path An array of strings representing the path to the style value in the style object.
|
12681 |
+
* @param ruleKeys An array of CSS property keys and patterns.
|
12682 |
+
* @param individualProperties The "sides" or individual properties for which to generate rules.
|
12683 |
*
|
12684 |
* @return GeneratedCSSRule[] CSS rules.
|
12685 |
*/
|
12945 |
return generateRule(style, options, ['typography', 'fontWeight'], 'fontWeight');
|
12946 |
}
|
12947 |
};
|
12948 |
+
const fontFamily = {
|
12949 |
+
name: 'fontFamily',
|
12950 |
+
generate: (style, options) => {
|
12951 |
+
return generateRule(style, options, ['typography', 'fontFamily'], 'fontFamily');
|
12952 |
+
}
|
12953 |
+
};
|
12954 |
const letterSpacing = {
|
12955 |
name: 'letterSpacing',
|
12956 |
generate: (style, options) => {
|
12975 |
return generateRule(style, options, ['typography', 'textTransform'], 'textTransform');
|
12976 |
}
|
12977 |
};
|
12978 |
+
/* harmony default export */ const typography = ([fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textDecoration, textTransform]);
|
12979 |
|
12980 |
;// CONCATENATED MODULE: ./packages/style-engine/build-module/styles/index.js
|
12981 |
/**
|
13000 |
/**
|
13001 |
* Generates a stylesheet for a given style object and selector.
|
13002 |
*
|
13003 |
+
* @param style Style object, for example, the value of a block's attributes.style object or the top level styles in theme.json
|
13004 |
* @param options Options object with settings to adjust how the styles are generated.
|
13005 |
*
|
13006 |
* @return generated stylesheet.
|
13007 |
*/
|
13008 |
|
13009 |
+
function compileCSS(style) {
|
13010 |
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
13011 |
const rules = getCSSRules(style, options); // If no selector is provided, treat generated rules as inline styles to be returned as a single string.
|
13012 |
|
13013 |
if (!(options !== null && options !== void 0 && options.selector)) {
|
13028 |
/**
|
13029 |
* Returns a JSON representation of the generated CSS rules.
|
13030 |
*
|
13031 |
+
* @param style Style object, for example, the value of a block's attributes.style object or the top level styles in theme.json
|
13032 |
* @param options Options object with settings to adjust how the styles are generated.
|
13033 |
*
|
13034 |
* @return generated styles.
|
13035 |
*/
|
13036 |
|
13037 |
+
function getCSSRules(style) {
|
13038 |
+
let options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
13039 |
const rules = [];
|
13040 |
styleDefinitions.forEach(definition => {
|
13041 |
if (typeof definition.generate === 'function') {
|
13045 |
return rules;
|
13046 |
}
|
13047 |
|
13048 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/constrained.js
|
13049 |
|
13050 |
|
13051 |
/**
|
13063 |
|
13064 |
|
13065 |
|
13066 |
+
/* harmony default export */ const constrained = ({
|
13067 |
+
name: 'constrained',
|
13068 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Constrained'),
|
13069 |
inspectorControls: function DefaultLayoutInspectorControls(_ref) {
|
13070 |
let {
|
13071 |
layout,
|
13185 |
|
13186 |
|
13187 |
if (hasBlockGapSupport && blockGapValue) {
|
13188 |
+
output += getBlockGapCSS(selector, layoutDefinitions, 'constrained', blockGapValue);
|
13189 |
}
|
13190 |
|
13191 |
return output;
|
13242 |
}
|
13243 |
|
13244 |
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13245 |
|
13246 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/index.js
|
13247 |
/**
|
13249 |
*/
|
13250 |
|
13251 |
|
13252 |
+
|
13253 |
+
const layoutTypes = [flow, flex, constrained];
|
13254 |
/**
|
13255 |
* Retrieves a layout type by name.
|
13256 |
*
|
13388 |
} // Starting here, it's the fallback for themes not supporting the layout config.
|
13389 |
|
13390 |
|
13391 |
+
if (layoutType.name !== 'default' && layoutType.name !== 'constrained') {
|
13392 |
return [];
|
13393 |
}
|
13394 |
|
14211 |
(0,external_wp_hooks_namespaceObject.addFilter)('blocks.switchToBlockType.transformedBlock', 'core/color/addTransforms', addTransforms);
|
14212 |
|
14213 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/generated-class-name.js
|
|
|
|
|
|
|
|
|
14214 |
/**
|
14215 |
* WordPress dependencies
|
14216 |
*/
|
14217 |
|
14218 |
|
|
|
14219 |
/**
|
14220 |
* Override props assigned to save component to inject generated className if
|
14221 |
* block supports it. This is only applied if the block's save result is an
|
14233 |
if (typeof extraProps.className === 'string') {
|
14234 |
// We have some extra classes and want to add the default classname
|
14235 |
// We use uniq to prevent duplicate classnames.
|
14236 |
+
extraProps.className = [...new Set([(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(blockType.name), ...extraProps.className.split(' ')])].join(' ').trim();
|
14237 |
} else {
|
14238 |
// There is no string in the className variable,
|
14239 |
// so we just dump the default name in there.
|
19363 |
ownerDocument
|
19364 |
} = ref.current; // Do not focus the block if it already contains the active element.
|
19365 |
|
19366 |
+
if (isInsideRootBlock(ref.current, ownerDocument.activeElement)) {
|
19367 |
return;
|
19368 |
} // Find all tabbables within node.
|
19369 |
|
21008 |
// able to select across instances immediately.
|
21009 |
|
21010 |
|
21011 |
+
node.contentEditable = true; // For some browsers, like Safari, it is important that focus
|
21012 |
+
// happens BEFORE selection removal.
|
21013 |
+
|
21014 |
node.focus();
|
21015 |
+
defaultView.getSelection().removeAllRanges();
|
21016 |
}, [hasMultiSelection, isMultiSelecting, multiSelectedBlockClientIds, selectedBlockClientId, initialPosition, isFullSelection]);
|
21017 |
}
|
21018 |
|
21494 |
return;
|
21495 |
}
|
21496 |
|
21497 |
+
event.preventDefault();
|
21498 |
const [firstSelectedClientId] = selectedClientIds;
|
21499 |
const rootClientId = getBlockRootClientId(firstSelectedClientId);
|
21500 |
+
const blockClientIds = getBlockOrder(rootClientId); // If we have selected all sibling nested blocks, try selecting up a
|
21501 |
// level. See: https://github.com/WordPress/gutenberg/pull/31859/
|
21502 |
|
21503 |
if (selectedClientIds.length === blockClientIds.length) {
|
21504 |
+
if (rootClientId) {
|
21505 |
+
node.ownerDocument.defaultView.getSelection().removeAllRanges();
|
21506 |
+
selectBlock(rootClientId);
|
21507 |
+
}
|
|
|
21508 |
|
|
|
|
|
21509 |
return;
|
21510 |
}
|
21511 |
|
21512 |
+
multiSelect((0,external_lodash_namespaceObject.first)(blockClientIds), (0,external_lodash_namespaceObject.last)(blockClientIds));
|
|
|
21513 |
}
|
21514 |
|
21515 |
node.addEventListener('keydown', onKeyDown);
|
21682 |
return anchorNode;
|
21683 |
}
|
21684 |
|
21685 |
+
if (anchorOffset === 0) {
|
21686 |
+
return anchorNode;
|
21687 |
+
}
|
21688 |
+
|
21689 |
+
return anchorNode.childNodes[anchorOffset - 1];
|
21690 |
}
|
21691 |
/**
|
21692 |
* Extract the selection end node from the selection. When the focus node is not
|
21709 |
return focusNode;
|
21710 |
}
|
21711 |
|
21712 |
+
if (focusOffset === focusNode.childNodes.length) {
|
21713 |
+
return focusNode;
|
21714 |
+
}
|
21715 |
+
|
21716 |
+
return focusNode.childNodes[focusOffset];
|
21717 |
}
|
21718 |
|
21719 |
function findDepth(a, b) {
|
23930 |
/**
|
23931 |
* SVG and stylesheet needed for rendering the duotone filter.
|
23932 |
*
|
23933 |
+
* @param {Object} props Duotone props.
|
23934 |
+
* @param {string} props.selector Selector to apply the filter to.
|
23935 |
+
* @param {string} props.id Unique id for this duotone filter.
|
23936 |
*
|
23937 |
* @return {WPElement} Duotone element.
|
23938 |
*/
|
23952 |
/**
|
23953 |
* Stylesheet for disabling a global styles duotone filter.
|
23954 |
*
|
23955 |
+
* @param {Object} props Duotone props.
|
23956 |
+
* @param {string} props.selector Selector to disable the filter for.
|
23957 |
*
|
23958 |
* @return {WPElement} Filter none style element.
|
23959 |
*/
|
25425 |
|
25426 |
/* harmony default export */ const use_insertion_point = (useInsertionPoint);
|
25427 |
|
25428 |
+
;// CONCATENATED MODULE: ./node_modules/lower-case/dist.es2015/index.js
|
25429 |
+
/**
|
25430 |
+
* Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt
|
25431 |
+
*/
|
25432 |
+
var SUPPORTED_LOCALE = {
|
25433 |
+
tr: {
|
25434 |
+
regexp: /\u0130|\u0049|\u0049\u0307/g,
|
25435 |
+
map: {
|
25436 |
+
İ: "\u0069",
|
25437 |
+
I: "\u0131",
|
25438 |
+
İ: "\u0069",
|
25439 |
+
},
|
25440 |
+
},
|
25441 |
+
az: {
|
25442 |
+
regexp: /\u0130/g,
|
25443 |
+
map: {
|
25444 |
+
İ: "\u0069",
|
25445 |
+
I: "\u0131",
|
25446 |
+
İ: "\u0069",
|
25447 |
+
},
|
25448 |
+
},
|
25449 |
+
lt: {
|
25450 |
+
regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g,
|
25451 |
+
map: {
|
25452 |
+
I: "\u0069\u0307",
|
25453 |
+
J: "\u006A\u0307",
|
25454 |
+
Į: "\u012F\u0307",
|
25455 |
+
Ì: "\u0069\u0307\u0300",
|
25456 |
+
Í: "\u0069\u0307\u0301",
|
25457 |
+
Ĩ: "\u0069\u0307\u0303",
|
25458 |
+
},
|
25459 |
+
},
|
25460 |
+
};
|
25461 |
+
/**
|
25462 |
+
* Localized lower case.
|
25463 |
+
*/
|
25464 |
+
function localeLowerCase(str, locale) {
|
25465 |
+
var lang = SUPPORTED_LOCALE[locale.toLowerCase()];
|
25466 |
+
if (lang)
|
25467 |
+
return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));
|
25468 |
+
return lowerCase(str);
|
25469 |
+
}
|
25470 |
+
/**
|
25471 |
+
* Lower case as a function.
|
25472 |
+
*/
|
25473 |
+
function lowerCase(str) {
|
25474 |
+
return str.toLowerCase();
|
25475 |
+
}
|
25476 |
+
|
25477 |
+
;// CONCATENATED MODULE: ./node_modules/no-case/dist.es2015/index.js
|
25478 |
+
|
25479 |
+
// Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case").
|
25480 |
+
var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];
|
25481 |
+
// Remove all non-word characters.
|
25482 |
+
var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;
|
25483 |
+
/**
|
25484 |
+
* Normalize the string into something other libraries can manipulate easier.
|
25485 |
+
*/
|
25486 |
+
function noCase(input, options) {
|
25487 |
+
if (options === void 0) { options = {}; }
|
25488 |
+
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;
|
25489 |
+
var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0");
|
25490 |
+
var start = 0;
|
25491 |
+
var end = result.length;
|
25492 |
+
// Trim the delimiter from around the output string.
|
25493 |
+
while (result.charAt(start) === "\0")
|
25494 |
+
start++;
|
25495 |
+
while (result.charAt(end - 1) === "\0")
|
25496 |
+
end--;
|
25497 |
+
// Transform each token independently.
|
25498 |
+
return result.slice(start, end).split("\0").map(transform).join(delimiter);
|
25499 |
+
}
|
25500 |
+
/**
|
25501 |
+
* Replace `re` in the input string with the replacement value.
|
25502 |
+
*/
|
25503 |
+
function replace(input, re, value) {
|
25504 |
+
if (re instanceof RegExp)
|
25505 |
+
return input.replace(re, value);
|
25506 |
+
return re.reduce(function (input, re) { return input.replace(re, value); }, input);
|
25507 |
+
}
|
25508 |
+
|
25509 |
+
// EXTERNAL MODULE: ./node_modules/remove-accents/index.js
|
25510 |
+
var remove_accents = __webpack_require__(4793);
|
25511 |
+
var remove_accents_default = /*#__PURE__*/__webpack_require__.n(remove_accents);
|
25512 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inserter/search-items.js
|
25513 |
/**
|
25514 |
* External dependencies
|
25515 |
*/
|
25516 |
+
|
25517 |
+
|
25518 |
// Default search helpers.
|
25519 |
|
25520 |
const defaultGetName = item => item.name || '';
|
25541 |
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
25542 |
// Disregard diacritics.
|
25543 |
// Input: "média"
|
25544 |
+
input = remove_accents_default()(input); // Accommodate leading slash, matching autocomplete expectations.
|
25545 |
// Input: "/media"
|
25546 |
|
25547 |
input = input.replace(/^\//, ''); // Lowercase.
|
25550 |
input = input.toLowerCase();
|
25551 |
return input;
|
25552 |
}
|
25553 |
+
/**
|
25554 |
+
* Extracts words from an input string.
|
25555 |
+
*
|
25556 |
+
* @param {string} input The input string.
|
25557 |
+
*
|
25558 |
+
* @return {Array} Words, extracted from the input string.
|
25559 |
+
*/
|
25560 |
+
|
25561 |
+
|
25562 |
+
function extractWords() {
|
25563 |
+
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
25564 |
+
return noCase(input).split(' ').filter(Boolean);
|
25565 |
+
}
|
25566 |
/**
|
25567 |
* Converts the search term into a list of normalized terms.
|
25568 |
*
|
25574 |
|
25575 |
const getNormalizedSearchTerms = function () {
|
25576 |
let input = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
25577 |
+
return extractWords(normalizeSearchInput(input));
|
|
|
25578 |
};
|
25579 |
|
25580 |
const removeMatchingTerms = (unmatchedTerms, unprocessedTerms) => {
|
25680 |
rank += 20;
|
25681 |
} else {
|
25682 |
const terms = [name, title, description, ...keywords, category, collection].join(' ');
|
25683 |
+
const normalizedSearchTerms = extractWords(normalizedSearchInput);
|
25684 |
const unmatchedTerms = removeMatchingTerms(normalizedSearchTerms, terms);
|
25685 |
|
25686 |
if (unmatchedTerms.length === 0) {
|
27393 |
ownerDocument
|
27394 |
};
|
27395 |
}, [previousElement, nextElement]);
|
27396 |
+
const popoverScrollRef = use_popover_scroll(__unstableContentRef); // If there's either a previous or a next element, show the inbetween popover.
|
27397 |
+
// Note that drag and drop uses the inbetween popover to show the drop indicator
|
27398 |
+
// before the first block and after the last block.
|
27399 |
|
27400 |
+
if (!previousElement && !nextElement || !isVisible) {
|
27401 |
return null;
|
27402 |
}
|
27403 |
/* eslint-disable jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */
|
30189 |
canRemove,
|
30190 |
hasBlockStyles,
|
30191 |
icon,
|
|
|
30192 |
patterns
|
30193 |
} = (0,external_wp_data_namespaceObject.useSelect)(select => {
|
|
|
|
|
30194 |
const {
|
30195 |
getBlockRootClientId,
|
30196 |
getBlockTransformItems,
|
30219 |
} else {
|
30220 |
var _getBlockType;
|
30221 |
|
30222 |
+
const isSelectionOfSameType = new Set(blocks.map(_ref2 => {
|
30223 |
let {
|
30224 |
name
|
30225 |
} = _ref2;
|
30226 |
return name;
|
30227 |
+
})).size === 1; // When selection consists of blocks of multiple types, display an
|
30228 |
// appropriate icon to communicate the non-uniformity.
|
30229 |
|
30230 |
_icon = isSelectionOfSameType ? (_getBlockType = getBlockType(firstBlockName)) === null || _getBlockType === void 0 ? void 0 : _getBlockType.icon : library_copy;
|
30235 |
canRemove: canRemoveBlocks(clientIds, rootClientId),
|
30236 |
hasBlockStyles: !!(styles !== null && styles !== void 0 && styles.length),
|
30237 |
icon: _icon,
|
|
|
30238 |
patterns: __experimentalGetPatternTransformItems(blocks, rootClientId)
|
30239 |
};
|
30240 |
}, [clientIds, blocks, blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.icon]);
|
30241 |
+
const blockTitle = useBlockDisplayTitle({
|
30242 |
+
clientId: Array.isArray(clientIds) ? clientIds[0] : clientIds,
|
30243 |
+
maximumLength: 35
|
30244 |
+
});
|
30245 |
const isReusable = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isReusableBlock)(blocks[0]);
|
30246 |
const isTemplate = blocks.length === 1 && (0,external_wp_blocks_namespaceObject.isTemplatePart)(blocks[0]); // Simple block tranformation based on the `Block Transforms` API.
|
30247 |
|
30269 |
showColors: true
|
30270 |
}), (isReusable || isTemplate) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
30271 |
className: "block-editor-block-switcher__toggle-text"
|
30272 |
+
}, blockTitle))
|
|
|
|
|
|
|
30273 |
}));
|
30274 |
}
|
30275 |
|
30294 |
showColors: true
|
30295 |
}), (isReusable || isTemplate) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
30296 |
className: "block-editor-block-switcher__toggle-text"
|
30297 |
+
}, blockTitle)),
|
|
|
|
|
|
|
30298 |
toggleProps: {
|
30299 |
describedBy: blockSwitcherDescription,
|
30300 |
...toggleProps
|
30594 |
blocks = [head, ...inBetweenBlocks, tail];
|
30595 |
}
|
30596 |
|
30597 |
+
const wrapperBlockName = event.clipboardData.getData('__unstableWrapperBlockName');
|
30598 |
+
|
30599 |
+
if (wrapperBlockName) {
|
30600 |
+
blocks = (0,external_wp_blocks_namespaceObject.createBlock)(wrapperBlockName, JSON.parse(event.clipboardData.getData('__unstableWrapperBlockAttributes')), blocks);
|
30601 |
+
}
|
30602 |
+
|
30603 |
const serialized = (0,external_wp_blocks_namespaceObject.serialize)(blocks);
|
30604 |
event.clipboardData.setData('text/plain', toPlainText(serialized));
|
30605 |
event.clipboardData.setData('text/html', serialized);
|
31711 |
}
|
31712 |
/* harmony default export */ const block_settings_dropdown = (BlockSettingsDropdown);
|
31713 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
31714 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-settings-menu/index.js
|
31715 |
|
31716 |
|
31724 |
*/
|
31725 |
|
31726 |
|
|
|
31727 |
function BlockSettingsMenu(_ref) {
|
31728 |
let {
|
31729 |
clientIds,
|
31730 |
...props
|
31731 |
} = _ref;
|
31732 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarItem, null, toggleProps => (0,external_wp_element_namespaceObject.createElement)(block_settings_dropdown, _extends({
|
|
|
|
|
31733 |
clientIds: clientIds,
|
31734 |
toggleProps: toggleProps
|
31735 |
+
}, props))));
|
31736 |
}
|
31737 |
/* harmony default export */ const block_settings_menu = (BlockSettingsMenu);
|
31738 |
|
31941 |
|
31942 |
/* harmony default export */ const toolbar = (BlockGroupToolbar);
|
31943 |
|
31944 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-edit-visually-button/index.js
|
31945 |
+
|
31946 |
+
|
31947 |
+
/**
|
31948 |
+
* WordPress dependencies
|
31949 |
+
*/
|
31950 |
+
|
31951 |
+
|
31952 |
+
|
31953 |
+
/**
|
31954 |
+
* Internal dependencies
|
31955 |
+
*/
|
31956 |
+
|
31957 |
+
|
31958 |
+
function BlockEditVisuallyButton(_ref) {
|
31959 |
+
let {
|
31960 |
+
clientIds
|
31961 |
+
} = _ref;
|
31962 |
+
// Edit visually only works for single block selection.
|
31963 |
+
const clientId = clientIds.length === 1 ? clientIds[0] : undefined;
|
31964 |
+
const canEditVisually = (0,external_wp_data_namespaceObject.useSelect)(select => !!clientId && select(store).getBlockMode(clientId) === 'html', [clientId]);
|
31965 |
+
const {
|
31966 |
+
toggleBlockMode
|
31967 |
+
} = (0,external_wp_data_namespaceObject.useDispatch)(store);
|
31968 |
+
|
31969 |
+
if (!canEditVisually) {
|
31970 |
+
return null;
|
31971 |
+
}
|
31972 |
+
|
31973 |
+
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarGroup, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToolbarButton, {
|
31974 |
+
onClick: () => {
|
31975 |
+
toggleBlockMode(clientId);
|
31976 |
+
}
|
31977 |
+
}, (0,external_wp_i18n_namespaceObject.__)('Edit visually')));
|
31978 |
+
}
|
31979 |
+
|
31980 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-toolbar/block-name-context.js
|
31981 |
/**
|
31982 |
* WordPress dependencies
|
32020 |
|
32021 |
|
32022 |
|
32023 |
+
|
32024 |
const BlockToolbar = _ref => {
|
32025 |
let {
|
32026 |
hideDragHandle
|
32128 |
className: "block-editor-block-toolbar__slot"
|
32129 |
}), (0,external_wp_element_namespaceObject.createElement)(block_name_context.Provider, {
|
32130 |
value: blockType === null || blockType === void 0 ? void 0 : blockType.name
|
32131 |
+
}, (0,external_wp_element_namespaceObject.createElement)(block_toolbar_last_item.Slot, null))), (0,external_wp_element_namespaceObject.createElement)(BlockEditVisuallyButton, {
|
32132 |
+
clientIds: blockClientIds
|
32133 |
+
}), (0,external_wp_element_namespaceObject.createElement)(block_settings_menu, {
|
32134 |
clientIds: blockClientIds
|
32135 |
}));
|
32136 |
};
|
32220 |
|
32221 |
/* harmony default export */ const block_contextual_toolbar = (BlockContextualToolbar);
|
32222 |
|
32223 |
+
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/use-block-toolbar-popover-props.js
|
32224 |
+
/**
|
32225 |
+
* WordPress dependencies
|
32226 |
+
*/
|
32227 |
+
|
32228 |
+
|
32229 |
+
|
32230 |
+
/**
|
32231 |
+
* Internal dependencies
|
32232 |
+
*/
|
32233 |
+
|
32234 |
+
|
32235 |
+
// By default the toolbar sets the `shift` prop. If the user scrolls the page
|
32236 |
+
// down the toolbar will stay on screen by adopting a sticky position at the
|
32237 |
+
// top of the viewport.
|
32238 |
+
|
32239 |
+
const use_block_toolbar_popover_props_DEFAULT_PROPS = {
|
32240 |
+
__unstableForcePosition: true,
|
32241 |
+
__unstableShift: true
|
32242 |
+
}; // When there isn't enough height between the top of the block and the editor
|
32243 |
+
// canvas, the `shift` prop is set to `false`, as it will cause the block to be
|
32244 |
+
// obscured. The `flip` behavior is enabled (by setting `forcePosition` to
|
32245 |
+
// `false`), which positions the toolbar below the block.
|
32246 |
+
|
32247 |
+
const RESTRICTED_HEIGHT_PROPS = {
|
32248 |
+
__unstableForcePosition: false,
|
32249 |
+
__unstableShift: false
|
32250 |
+
};
|
32251 |
+
/**
|
32252 |
+
* Get the popover props for the block toolbar, determined by the space at the top of the canvas and the toolbar height.
|
32253 |
+
*
|
32254 |
+
* @param {Element} contentElement The DOM element that represents the editor content or canvas.
|
32255 |
+
* @param {Element} selectedBlockElement The outer DOM element of the first selected block.
|
32256 |
+
* @param {number} toolbarHeight The height of the toolbar in pixels.
|
32257 |
+
*
|
32258 |
+
* @return {Object} The popover props used to determine the position of the toolbar.
|
32259 |
+
*/
|
32260 |
+
|
32261 |
+
function getProps(contentElement, selectedBlockElement, toolbarHeight) {
|
32262 |
+
if (!contentElement || !selectedBlockElement) {
|
32263 |
+
return use_block_toolbar_popover_props_DEFAULT_PROPS;
|
32264 |
+
}
|
32265 |
+
|
32266 |
+
const blockRect = selectedBlockElement.getBoundingClientRect();
|
32267 |
+
const contentRect = contentElement.getBoundingClientRect();
|
32268 |
+
|
32269 |
+
if (blockRect.top - contentRect.top > toolbarHeight) {
|
32270 |
+
return use_block_toolbar_popover_props_DEFAULT_PROPS;
|
32271 |
+
}
|
32272 |
+
|
32273 |
+
return RESTRICTED_HEIGHT_PROPS;
|
32274 |
+
}
|
32275 |
+
/**
|
32276 |
+
* Determines the desired popover positioning behavior, returning a set of appropriate props.
|
32277 |
+
*
|
32278 |
+
* @param {Object} elements
|
32279 |
+
* @param {Element} elements.contentElement The DOM element that represents the editor content or canvas.
|
32280 |
+
* @param {string} elements.clientId The clientId of the first selected block.
|
32281 |
+
*
|
32282 |
+
* @return {Object} The popover props used to determine the position of the toolbar.
|
32283 |
+
*/
|
32284 |
+
|
32285 |
+
|
32286 |
+
function useBlockToolbarPopoverProps(_ref) {
|
32287 |
+
let {
|
32288 |
+
contentElement,
|
32289 |
+
clientId
|
32290 |
+
} = _ref;
|
32291 |
+
const selectedBlockElement = useBlockElement(clientId);
|
32292 |
+
const [toolbarHeight, setToolbarHeight] = (0,external_wp_element_namespaceObject.useState)(0);
|
32293 |
+
const [props, setProps] = (0,external_wp_element_namespaceObject.useState)(() => getProps(contentElement, selectedBlockElement, toolbarHeight));
|
32294 |
+
const blockIndex = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlockIndex(clientId), [clientId]);
|
32295 |
+
const popoverRef = (0,external_wp_compose_namespaceObject.useRefEffect)(popoverNode => {
|
32296 |
+
setToolbarHeight(popoverNode.offsetHeight);
|
32297 |
+
}, []);
|
32298 |
+
const updateProps = (0,external_wp_element_namespaceObject.useCallback)(() => setProps(getProps(contentElement, selectedBlockElement, toolbarHeight)), [contentElement, selectedBlockElement, toolbarHeight]); // Update props when the block is moved. This also ensures the props are
|
32299 |
+
// correct on initial mount, and when the selected block or content element
|
32300 |
+
// changes (since the callback ref will update).
|
32301 |
+
|
32302 |
+
(0,external_wp_element_namespaceObject.useLayoutEffect)(updateProps, [blockIndex, updateProps]); // Update props when the viewport is resized or the block is resized.
|
32303 |
+
|
32304 |
+
(0,external_wp_element_namespaceObject.useLayoutEffect)(() => {
|
32305 |
+
var _contentElement$owner, _contentView$addEvent, _selectedBlockElement;
|
32306 |
+
|
32307 |
+
if (!contentElement || !selectedBlockElement) {
|
32308 |
+
return;
|
32309 |
+
} // Update the toolbar props on viewport resize.
|
32310 |
+
|
32311 |
+
|
32312 |
+
const contentView = contentElement === null || contentElement === void 0 ? void 0 : (_contentElement$owner = contentElement.ownerDocument) === null || _contentElement$owner === void 0 ? void 0 : _contentElement$owner.defaultView;
|
32313 |
+
contentView === null || contentView === void 0 ? void 0 : (_contentView$addEvent = contentView.addEventHandler) === null || _contentView$addEvent === void 0 ? void 0 : _contentView$addEvent.call(contentView, 'resize', updateProps); // Update the toolbar props on block resize.
|
32314 |
+
|
32315 |
+
let resizeObserver;
|
32316 |
+
const blockView = selectedBlockElement === null || selectedBlockElement === void 0 ? void 0 : (_selectedBlockElement = selectedBlockElement.ownerDocument) === null || _selectedBlockElement === void 0 ? void 0 : _selectedBlockElement.defaultView;
|
32317 |
+
|
32318 |
+
if (blockView.ResizeObserver) {
|
32319 |
+
resizeObserver = new blockView.ResizeObserver(updateProps);
|
32320 |
+
resizeObserver.observe(selectedBlockElement);
|
32321 |
+
}
|
32322 |
+
|
32323 |
+
return () => {
|
32324 |
+
var _contentView$removeEv;
|
32325 |
+
|
32326 |
+
contentView === null || contentView === void 0 ? void 0 : (_contentView$removeEv = contentView.removeEventHandler) === null || _contentView$removeEv === void 0 ? void 0 : _contentView$removeEv.call(contentView, 'resize', updateProps);
|
32327 |
+
|
32328 |
+
if (resizeObserver) {
|
32329 |
+
resizeObserver.disconnect();
|
32330 |
+
}
|
32331 |
+
};
|
32332 |
+
}, [updateProps, contentElement, selectedBlockElement]);
|
32333 |
+
return { ...props,
|
32334 |
+
ref: popoverRef
|
32335 |
+
};
|
32336 |
+
}
|
32337 |
+
|
32338 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/selected-block-popover.js
|
32339 |
|
32340 |
|
32341 |
+
|
32342 |
/**
|
32343 |
* External dependencies
|
32344 |
*/
|
32362 |
|
32363 |
|
32364 |
|
32365 |
+
|
32366 |
function selected_block_popover_selector(select) {
|
32367 |
const {
|
32368 |
isNavigationMode,
|
32433 |
// to it when re-mounting.
|
32434 |
|
32435 |
const initialToolbarItemIndexRef = (0,external_wp_element_namespaceObject.useRef)();
|
32436 |
+
const popoverProps = useBlockToolbarPopoverProps({
|
32437 |
+
contentElement: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current,
|
32438 |
+
clientId
|
32439 |
+
});
|
32440 |
|
32441 |
if (!shouldShowBreadcrumb && !shouldShowContextualToolbar) {
|
32442 |
return null;
|
32443 |
}
|
32444 |
|
32445 |
+
return (0,external_wp_element_namespaceObject.createElement)(block_popover, _extends({
|
32446 |
clientId: capturingClientId || clientId,
|
32447 |
bottomClientId: lastClientId,
|
32448 |
className: classnames_default()('block-editor-block-list__block-popover', {
|
32450 |
}),
|
32451 |
__unstablePopoverSlot: __unstablePopoverSlot,
|
32452 |
__unstableContentRef: __unstableContentRef
|
32453 |
+
}, popoverProps), shouldShowContextualToolbar && (0,external_wp_element_namespaceObject.createElement)(block_contextual_toolbar // If the toolbar is being shown because of being forced
|
32454 |
// it should focus the toolbar right after the mount.
|
32455 |
, {
|
32456 |
focusOnMount: isToolbarForced.current,
|
33633 |
* @return {any} The item with the most occurrences.
|
33634 |
*/
|
33635 |
|
33636 |
+
function utils_mode(inputArray) {
|
33637 |
const arr = [...inputArray];
|
33638 |
return arr.sort((a, b) => inputArray.filter(v => v === b).length - inputArray.filter(v => v === a).length).shift();
|
33639 |
}
|
33640 |
/**
|
33641 |
+
* Returns the most common CSS unit from the current CSS unit selections.
|
|
|
33642 |
*
|
33643 |
+
* - If a single flat border radius is set, its unit will be used
|
33644 |
+
* - If individual corner selections, the most common of those will be used
|
33645 |
+
* - Failing any unit selections a default of 'px' is returned.
|
33646 |
+
*
|
33647 |
+
* @param {Object} selectedUnits Unit selections for flat radius & each corner.
|
33648 |
+
* @return {string} Most common CSS unit from current selections. Default: `px`.
|
33649 |
*/
|
33650 |
|
33651 |
function getAllUnit() {
|
33652 |
+
let selectedUnits = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
33653 |
+
const {
|
33654 |
+
flat,
|
33655 |
+
...cornerUnits
|
33656 |
+
} = selectedUnits;
|
33657 |
+
return flat || utils_mode(Object.values(cornerUnits).filter(Boolean)) || 'px';
|
|
|
|
|
|
|
|
|
|
|
|
|
33658 |
}
|
33659 |
/**
|
33660 |
* Gets the 'all' input value and unit from values data.
|
33683 |
});
|
33684 |
const allUnits = parsedQuantitiesAndUnits.map(value => value[1]);
|
33685 |
const value = allValues.every(v => v === allValues[0]) ? allValues[0] : '';
|
33686 |
+
const unit = utils_mode(allUnits);
|
33687 |
const allValue = value === 0 || value ? `${value}${unit}` : undefined;
|
33688 |
return allValue;
|
33689 |
}
|
33739 |
*/
|
33740 |
|
33741 |
|
33742 |
+
function all_input_control_AllInputControl(_ref) {
|
33743 |
let {
|
33744 |
onChange,
|
33745 |
+
selectedUnits,
|
33746 |
+
setSelectedUnits,
|
33747 |
values,
|
33748 |
...props
|
33749 |
} = _ref;
|
33750 |
+
let allValue = getAllValue(values);
|
33751 |
+
|
33752 |
+
if (allValue === undefined) {
|
33753 |
+
// If we don't have any value set the unit to any current selection
|
33754 |
+
// or the most common unit from the individual radii values.
|
33755 |
+
allValue = getAllUnit(selectedUnits);
|
33756 |
+
}
|
33757 |
+
|
33758 |
const hasValues = hasDefinedValues(values);
|
33759 |
const isMixed = hasValues && hasMixedValues(values);
|
33760 |
+
const allPlaceholder = isMixed ? (0,external_wp_i18n_namespaceObject.__)('Mixed') : null; // Filter out CSS-unit-only values to prevent invalid styles.
|
33761 |
+
|
33762 |
+
const handleOnChange = next => {
|
33763 |
+
const isNumeric = !isNaN(parseFloat(next));
|
33764 |
+
const nextValue = isNumeric ? next : undefined;
|
33765 |
+
onChange(nextValue);
|
33766 |
+
}; // Store current unit selection for use as fallback for individual
|
33767 |
+
// radii controls.
|
33768 |
+
|
33769 |
+
|
33770 |
+
const handleOnUnitChange = unit => {
|
33771 |
+
setSelectedUnits({
|
33772 |
+
topLeft: unit,
|
33773 |
+
topRight: unit,
|
33774 |
+
bottomLeft: unit,
|
33775 |
+
bottomRight: unit
|
33776 |
+
});
|
33777 |
+
};
|
33778 |
+
|
33779 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, {
|
33780 |
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Border radius'),
|
33781 |
disableUnits: isMixed,
|
33782 |
isOnly: true,
|
33783 |
value: allValue,
|
33784 |
+
onChange: handleOnChange,
|
33785 |
+
onUnitChange: handleOnUnitChange,
|
33786 |
placeholder: allPlaceholder
|
33787 |
}));
|
33788 |
}
|
33802 |
bottomLeft: (0,external_wp_i18n_namespaceObject.__)('Bottom left'),
|
33803 |
bottomRight: (0,external_wp_i18n_namespaceObject.__)('Bottom right')
|
33804 |
};
|
33805 |
+
function input_controls_BoxInputControls(_ref) {
|
33806 |
let {
|
33807 |
onChange,
|
33808 |
+
selectedUnits,
|
33809 |
+
setSelectedUnits,
|
33810 |
values: valuesProp,
|
33811 |
...props
|
33812 |
} = _ref;
|
33814 |
const createHandleOnChange = corner => next => {
|
33815 |
if (!onChange) {
|
33816 |
return;
|
33817 |
+
} // Filter out CSS-unit-only values to prevent invalid styles.
|
33818 |
+
|
33819 |
|
33820 |
+
const isNumeric = !isNaN(parseFloat(next));
|
33821 |
+
const nextValue = isNumeric ? next : undefined;
|
33822 |
onChange({ ...values,
|
33823 |
+
[corner]: nextValue
|
33824 |
});
|
33825 |
+
};
|
33826 |
+
|
33827 |
+
const createHandleOnUnitChange = side => next => {
|
33828 |
+
const newUnits = { ...selectedUnits
|
33829 |
+
};
|
33830 |
+
newUnits[side] = next;
|
33831 |
+
setSelectedUnits(newUnits);
|
33832 |
}; // For shorthand style & backwards compatibility, handle flat string value.
|
33833 |
|
33834 |
|
33844 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
33845 |
className: "components-border-radius-control__input-controls-wrapper"
|
33846 |
}, Object.entries(CORNERS).map(_ref2 => {
|
33847 |
+
let [corner, label] = _ref2;
|
33848 |
+
const [parsedQuantity, parsedUnit] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values[corner]);
|
33849 |
+
const computedUnit = values[corner] ? parsedUnit : selectedUnits[corner] || selectedUnits.flat;
|
33850 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Tooltip, {
|
33851 |
text: label,
|
33852 |
position: "top",
|
33853 |
+
key: corner
|
33854 |
}, (0,external_wp_element_namespaceObject.createElement)("div", {
|
33855 |
className: "components-border-radius-control__tooltip-wrapper"
|
33856 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalUnitControl, _extends({}, props, {
|
33857 |
"aria-label": label,
|
33858 |
+
value: [parsedQuantity, computedUnit].join(''),
|
33859 |
+
onChange: createHandleOnChange(corner),
|
33860 |
+
onUnitChange: createHandleOnUnitChange(corner)
|
33861 |
}))));
|
33862 |
}));
|
33863 |
}
|
33864 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
33865 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-radius-control/linked-button.js
|
33866 |
|
33867 |
|
33872 |
|
33873 |
|
33874 |
|
33875 |
+
function linked_button_LinkedButton(_ref) {
|
33876 |
let {
|
33877 |
isLinked,
|
33878 |
...props
|
33909 |
|
33910 |
|
33911 |
|
33912 |
+
const border_radius_control_DEFAULT_VALUES = {
|
33913 |
+
topLeft: undefined,
|
33914 |
+
topRight: undefined,
|
33915 |
+
bottomLeft: undefined,
|
33916 |
+
bottomRight: undefined
|
33917 |
};
|
33918 |
const MIN_BORDER_RADIUS_VALUE = 0;
|
33919 |
const MAX_BORDER_RADIUS_VALUES = {
|
33936 |
onChange,
|
33937 |
values
|
33938 |
} = _ref;
|
33939 |
+
const [isLinked, setIsLinked] = (0,external_wp_element_namespaceObject.useState)(!hasDefinedValues(values) || !hasMixedValues(values)); // Tracking selected units via internal state allows filtering of CSS unit
|
33940 |
+
// only values from being saved while maintaining preexisting unit selection
|
33941 |
+
// behaviour. Filtering CSS unit only values prevents invalid style values.
|
33942 |
+
|
33943 |
+
const [selectedUnits, setSelectedUnits] = (0,external_wp_element_namespaceObject.useState)({
|
33944 |
+
flat: typeof values === 'string' ? (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values)[1] : undefined,
|
33945 |
+
topLeft: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values === null || values === void 0 ? void 0 : values.topLeft)[1],
|
33946 |
+
topRight: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values === null || values === void 0 ? void 0 : values.topRight)[1],
|
33947 |
+
bottomLeft: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values === null || values === void 0 ? void 0 : values.bottomLeft)[1],
|
33948 |
+
bottomRight: (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(values === null || values === void 0 ? void 0 : values.bottomRight)[1]
|
33949 |
+
});
|
33950 |
const units = (0,external_wp_components_namespaceObject.__experimentalUseCustomUnits)({
|
33951 |
availableUnits: useSetting('spacing.units') || ['px', 'em', 'rem']
|
33952 |
});
|
33953 |
+
const unit = getAllUnit(selectedUnits);
|
33954 |
const unitConfig = units && units.find(item => item.value === unit);
|
33955 |
const step = (unitConfig === null || unitConfig === void 0 ? void 0 : unitConfig.step) || 1;
|
33956 |
const [allValue] = (0,external_wp_components_namespaceObject.__experimentalParseQuantityAndUnitFromRawValue)(getAllValue(values));
|
33967 |
as: "legend"
|
33968 |
}, (0,external_wp_i18n_namespaceObject.__)('Radius')), (0,external_wp_element_namespaceObject.createElement)("div", {
|
33969 |
className: "components-border-radius-control__wrapper"
|
33970 |
+
}, isLinked ? (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(all_input_control_AllInputControl, {
|
33971 |
className: "components-border-radius-control__unit-control",
|
33972 |
values: values,
|
33973 |
min: MIN_BORDER_RADIUS_VALUE,
|
33974 |
onChange: onChange,
|
33975 |
+
selectedUnits: selectedUnits,
|
33976 |
+
setSelectedUnits: setSelectedUnits,
|
33977 |
units: units
|
33978 |
}), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.RangeControl, {
|
33979 |
label: (0,external_wp_i18n_namespaceObject.__)('Border radius'),
|
33986 |
withInputField: false,
|
33987 |
onChange: handleSliderChange,
|
33988 |
step: step
|
33989 |
+
})) : (0,external_wp_element_namespaceObject.createElement)(input_controls_BoxInputControls, {
|
33990 |
min: MIN_BORDER_RADIUS_VALUE,
|
33991 |
onChange: onChange,
|
33992 |
+
selectedUnits: selectedUnits,
|
33993 |
+
setSelectedUnits: setSelectedUnits,
|
33994 |
+
values: values || border_radius_control_DEFAULT_VALUES,
|
33995 |
units: units
|
33996 |
+
}), (0,external_wp_element_namespaceObject.createElement)(linked_button_LinkedButton, {
|
33997 |
onClick: toggleLinked,
|
33998 |
isLinked: isLinked
|
33999 |
})));
|
34027 |
} = props;
|
34028 |
|
34029 |
const onChange = newRadius => {
|
34030 |
+
const newStyle = cleanEmptyObject({ ...style,
|
34031 |
border: { ...(style === null || style === void 0 ? void 0 : style.border),
|
34032 |
radius: newRadius
|
34033 |
}
|
34034 |
+
});
|
|
|
|
|
|
|
|
|
|
|
34035 |
setAttributes({
|
34036 |
style: newStyle
|
34037 |
});
|
34566 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBorderBoxControl, {
|
34567 |
colors: colors,
|
34568 |
enableAlpha: true,
|
34569 |
+
enableStyle: isStyleSupported,
|
34570 |
onChange: onBorderChange,
|
|
|
34571 |
popoverOffset: 40,
|
34572 |
+
popoverPlacement: "left-start",
|
34573 |
value: hydratedBorder,
|
34574 |
__experimentalHasMultipleOrigins: true,
|
34575 |
__experimentalIsRenderedInSidebar: true
|
35805 |
};
|
35806 |
};
|
35807 |
|
|
|
35808 |
const defaultColorControls = (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [COLOR_SUPPORT_KEY, '__experimentalDefaultControls']);
|
35809 |
+
const enableContrastChecking = external_wp_element_namespaceObject.Platform.OS === 'web' && !gradient && !(style !== null && style !== void 0 && (_style$color6 = style.color) !== null && _style$color6 !== void 0 && _style$color6.gradient) && // Contrast checking is enabled by default.
|
35810 |
+
// Deactivating it requires `enableContrastChecker` to have
|
35811 |
+
// an explicit value of `false`.
|
35812 |
+
false !== (0,external_wp_blocks_namespaceObject.getBlockSupport)(props.name, [COLOR_SUPPORT_KEY, 'enableContrastChecker']);
|
35813 |
return (0,external_wp_element_namespaceObject.createElement)(ColorPanel, {
|
35814 |
enableContrastChecking: enableContrastChecking,
|
35815 |
clientId: props.clientId,
|
36576 |
};
|
36577 |
})];
|
36578 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SelectControl, _extends({
|
36579 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Font'),
|
36580 |
options: options,
|
36581 |
value: value,
|
36582 |
onChange: onChange,
|
37863 |
const styleSupportKeys = [...TYPOGRAPHY_SUPPORT_KEYS, BORDER_SUPPORT_KEY, COLOR_SUPPORT_KEY, SPACING_SUPPORT_KEY];
|
37864 |
|
37865 |
const hasStyleSupport = blockType => styleSupportKeys.some(key => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, key));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37866 |
/**
|
37867 |
* Returns the inline styles to add depending on the style object
|
37868 |
*
|
37874 |
|
37875 |
function getInlineStyles() {
|
37876 |
let styles = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
37877 |
+
const output = {}; // The goal is to move everything to server side generated engine styles
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
37878 |
// This is temporary as we absorb more and more styles into the engine.
|
37879 |
|
37880 |
+
getCSSRules(styles).forEach(rule => {
|
|
|
37881 |
output[rule.key] = rule.value;
|
37882 |
});
|
37883 |
return output;
|
38035 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, shouldDisplayControls && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(ColorEdit, props), (0,external_wp_element_namespaceObject.createElement)(TypographyPanel, props), (0,external_wp_element_namespaceObject.createElement)(BorderPanel, props), (0,external_wp_element_namespaceObject.createElement)(DimensionsPanel, props)), (0,external_wp_element_namespaceObject.createElement)(BlockEdit, props));
|
38036 |
}, 'withToolbarControls');
|
38037 |
/**
|
38038 |
+
* Override the default block element to include elements styles.
|
38039 |
*
|
38040 |
* @param {Function} BlockListBlock Original component
|
38041 |
* @return {Function} Wrapped component
|
38063 |
};
|
38064 |
|
38065 |
for (const [elementName, elementStyles] of Object.entries(filteredElementsStyles)) {
|
38066 |
+
const cssRule = compileCSS(elementStyles, {
|
38067 |
// The .editor-styles-wrapper selector is required on elements styles. As it is
|
38068 |
// added to all other editor styles, not providing it causes reset and global
|
38069 |
// styles to override element styles because of higher specificity.
|
38250 |
/**
|
38251 |
* SVG and stylesheet needed for rendering the duotone filter.
|
38252 |
*
|
38253 |
+
* @param {Object} props Duotone props.
|
38254 |
+
* @param {string} props.selector Selector to apply the filter to.
|
38255 |
+
* @param {string} props.id Unique id for this duotone filter.
|
38256 |
+
* @param {string[]|"unset"} props.colors Array of RGB color strings ordered from dark to light.
|
38257 |
*
|
38258 |
* @return {WPElement} Duotone element.
|
38259 |
*/
|
38509 |
layoutClassnames.push(layoutDefinitions === null || layoutDefinitions === void 0 ? void 0 : (_layoutDefinitions2 = layoutDefinitions[(layout === null || layout === void 0 ? void 0 : layout.type) || 'default']) === null || _layoutDefinitions2 === void 0 ? void 0 : _layoutDefinitions2.className);
|
38510 |
}
|
38511 |
|
38512 |
+
if ((layout !== null && layout !== void 0 && layout.inherit || layout !== null && layout !== void 0 && layout.contentSize || (layout === null || layout === void 0 ? void 0 : layout.type) === 'constrained') && rootPaddingAlignment) {
|
38513 |
layoutClassnames.push('has-global-padding');
|
38514 |
}
|
38515 |
|
38556 |
return null;
|
38557 |
} // Only show the inherit toggle if it's supported,
|
38558 |
// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),
|
38559 |
+
// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.
|
38560 |
|
38561 |
|
38562 |
+
const showInheritToggle = !!(allowInheriting && !!defaultThemeLayout && (!(layout !== null && layout !== void 0 && layout.type) || (layout === null || layout === void 0 ? void 0 : layout.type) === 'default' || (layout === null || layout === void 0 ? void 0 : layout.type) === 'constrained' || layout !== null && layout !== void 0 && layout.inherit));
|
38563 |
const usedLayout = layout || defaultBlockLayout || {};
|
38564 |
const {
|
38565 |
inherit = false,
|
38566 |
+
type = 'default',
|
38567 |
+
contentSize = null
|
38568 |
} = usedLayout;
|
38569 |
/**
|
38570 |
+
* `themeSupportsLayout` is only relevant to the `default/flow` or
|
38571 |
+
* `constrained` layouts and it should not be taken into account when other
|
38572 |
* `layout` types are used.
|
38573 |
*/
|
38574 |
|
38575 |
+
if ((type === 'default' || type === 'constrained') && !themeSupportsLayout) {
|
38576 |
return null;
|
38577 |
}
|
38578 |
|
38579 |
const layoutType = getLayoutType(type);
|
38580 |
+
const constrainedType = getLayoutType('constrained');
|
38581 |
|
38582 |
const onChangeType = newType => setAttributes({
|
38583 |
layout: {
|
38592 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(inspector_controls, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.PanelBody, {
|
38593 |
title: (0,external_wp_i18n_namespaceObject.__)('Layout')
|
38594 |
}, showInheritToggle && (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.ToggleControl, {
|
38595 |
+
label: (0,external_wp_i18n_namespaceObject.__)('Inner blocks respect content width'),
|
38596 |
+
checked: (layoutType === null || layoutType === void 0 ? void 0 : layoutType.name) === 'constrained' || !!inherit || !!contentSize,
|
38597 |
onChange: () => setAttributes({
|
38598 |
layout: {
|
38599 |
+
type: (layoutType === null || layoutType === void 0 ? void 0 : layoutType.name) === 'constrained' ? 'default' : 'constrained'
|
38600 |
}
|
38601 |
})
|
38602 |
}), (0,external_wp_element_namespaceObject.createElement)("p", {
|
38603 |
className: "block-editor-hooks__layout-controls-helptext"
|
38604 |
+
}, !!inherit || (layoutType === null || layoutType === void 0 ? void 0 : layoutType.name) === 'constrained' ? (0,external_wp_i18n_namespaceObject.__)('Nested blocks use theme content width with options for full and wide widths.') : (0,external_wp_i18n_namespaceObject.__)('Nested blocks will fill the width of this container.'))), !inherit && allowSwitching && (0,external_wp_element_namespaceObject.createElement)(LayoutTypeSwitcher, {
|
38605 |
type: type,
|
38606 |
onChange: onChangeType
|
38607 |
+
}), layoutType && layoutType.name !== 'default' && (0,external_wp_element_namespaceObject.createElement)(layoutType.inspectorControls, {
|
38608 |
+
layout: usedLayout,
|
38609 |
+
onChange: onChangeLayout,
|
38610 |
+
layoutBlockSupport: layoutBlockSupport
|
38611 |
+
}), constrainedType && !!contentSize && (0,external_wp_element_namespaceObject.createElement)(constrainedType.inspectorControls, {
|
38612 |
layout: usedLayout,
|
38613 |
onChange: onChangeLayout,
|
38614 |
layoutBlockSupport: layoutBlockSupport
|
38709 |
const {
|
38710 |
default: defaultBlockLayout
|
38711 |
} = (0,external_wp_blocks_namespaceObject.getBlockSupport)(name, layoutBlockSupportKey) || {};
|
38712 |
+
const usedLayout = layout !== null && layout !== void 0 && layout.inherit || layout !== null && layout !== void 0 && layout.contentSize || layout !== null && layout !== void 0 && layout.wideSize ? { ...layout,
|
38713 |
+
type: 'constrained'
|
38714 |
+
} : layout || defaultBlockLayout || {};
|
38715 |
const layoutClasses = hasLayoutBlockSupport ? useLayoutClasses(usedLayout, defaultThemeLayout === null || defaultThemeLayout === void 0 ? void 0 : defaultThemeLayout.definitions) : null;
|
38716 |
const selector = `.${(0,external_wp_blocks_namespaceObject.getBlockDefaultClassName)(name)}.wp-container-${id}`;
|
38717 |
const blockGapSupport = useSetting('spacing.blockGap');
|
39029 |
|
39030 |
|
39031 |
|
39032 |
+
/**
|
39033 |
+
* Capitalizes the first letter in a string.
|
39034 |
+
*
|
39035 |
+
* @param {string} str The string whose first letter the function will capitalize.
|
39036 |
+
*
|
39037 |
+
* @return {string} Capitalized string.
|
39038 |
+
*/
|
39039 |
+
|
39040 |
+
const with_colors_upperFirst = _ref => {
|
39041 |
+
let [firstLetter, ...rest] = _ref;
|
39042 |
+
return firstLetter.toUpperCase() + rest.join('');
|
39043 |
+
};
|
39044 |
/**
|
39045 |
* Higher order component factory for injecting the `colorsArray` argument as
|
39046 |
* the colors prop in the `withCustomColors` HOC.
|
39050 |
* @return {Function} The higher order component.
|
39051 |
*/
|
39052 |
|
39053 |
+
|
39054 |
const withCustomColorPalette = colorsArray => (0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => (0,external_wp_element_namespaceObject.createElement)(WrappedComponent, _extends({}, props, {
|
39055 |
colors: colorsArray
|
39056 |
})), 'withCustomColorPalette');
|
39113 |
|
39114 |
createSetters() {
|
39115 |
return (0,external_lodash_namespaceObject.reduce)(colorMap, (settersAccumulator, colorContext, colorAttributeName) => {
|
39116 |
+
const upperFirstColorAttributeName = with_colors_upperFirst(colorAttributeName);
|
39117 |
const customColorAttributeName = `custom${upperFirstColorAttributeName}`;
|
39118 |
settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(colorAttributeName, customColorAttributeName);
|
39119 |
return settersAccumulator;
|
39130 |
};
|
39131 |
}
|
39132 |
|
39133 |
+
static getDerivedStateFromProps(_ref2, previousState) {
|
39134 |
let {
|
39135 |
attributes,
|
39136 |
colors
|
39137 |
+
} = _ref2;
|
39138 |
return (0,external_lodash_namespaceObject.reduce)(colorMap, (newState, colorContext, colorAttributeName) => {
|
39139 |
+
const colorObject = getColorObjectByAttributeValues(colors, attributes[colorAttributeName], attributes[`custom${with_colors_upperFirst(colorAttributeName)}`]);
|
39140 |
const previousColorObject = previousState[colorAttributeName];
|
39141 |
const previousColor = previousColorObject === null || previousColorObject === void 0 ? void 0 : previousColorObject.color;
|
39142 |
/**
|
39266 |
|
39267 |
|
39268 |
const DEFAULT_FONT_SIZES = [];
|
39269 |
+
/**
|
39270 |
+
* Capitalizes the first letter in a string.
|
39271 |
+
*
|
39272 |
+
* @param {string} str The string whose first letter the function will capitalize.
|
39273 |
+
*
|
39274 |
+
* @return {string} Capitalized string.
|
39275 |
+
*/
|
39276 |
+
|
39277 |
+
const with_font_sizes_upperFirst = _ref => {
|
39278 |
+
let [firstLetter, ...rest] = _ref;
|
39279 |
+
return firstLetter.toUpperCase() + rest.join('');
|
39280 |
+
};
|
39281 |
/**
|
39282 |
* Higher-order component, which handles font size logic for class generation,
|
39283 |
* font size value retrieval, and font size change handling.
|
39289 |
* @return {Function} Higher-order component.
|
39290 |
*/
|
39291 |
|
39292 |
+
|
39293 |
/* harmony default export */ const with_font_sizes = (function () {
|
39294 |
for (var _len = arguments.length, fontSizeNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
39295 |
fontSizeNames[_key] = arguments[_key];
|
39301 |
* Custom font size is automatically compted by appending custom followed by the font size attribute name in with the first letter capitalized.
|
39302 |
*/
|
39303 |
const fontSizeAttributeNames = (0,external_lodash_namespaceObject.reduce)(fontSizeNames, (fontSizeAttributeNamesAccumulator, fontSizeAttributeName) => {
|
39304 |
+
fontSizeAttributeNamesAccumulator[fontSizeAttributeName] = `custom${with_font_sizes_upperFirst(fontSizeAttributeName)}`;
|
39305 |
return fontSizeAttributeNamesAccumulator;
|
39306 |
}, {});
|
39307 |
return (0,external_wp_compose_namespaceObject.createHigherOrderComponent)((0,external_wp_compose_namespaceObject.compose)([(0,external_wp_compose_namespaceObject.createHigherOrderComponent)(WrappedComponent => props => {
|
39319 |
|
39320 |
createSetters() {
|
39321 |
return (0,external_lodash_namespaceObject.reduce)(fontSizeAttributeNames, (settersAccumulator, customFontSizeAttributeName, fontSizeAttributeName) => {
|
39322 |
+
const upperFirstFontSizeAttributeName = with_font_sizes_upperFirst(fontSizeAttributeName);
|
39323 |
settersAccumulator[`set${upperFirstFontSizeAttributeName}`] = this.createSetFontSize(fontSizeAttributeName, customFontSizeAttributeName);
|
39324 |
return settersAccumulator;
|
39325 |
}, {});
|
39337 |
};
|
39338 |
}
|
39339 |
|
39340 |
+
static getDerivedStateFromProps(_ref2, previousState) {
|
39341 |
let {
|
39342 |
attributes,
|
39343 |
fontSizes
|
39344 |
+
} = _ref2;
|
39345 |
|
39346 |
const didAttributesChange = (customFontSizeAttributeName, fontSizeAttributeName) => {
|
39347 |
if (previousState[fontSizeAttributeName]) {
|
40373 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
|
40374 |
ellipsizeMode: "auto"
|
40375 |
}, blockTitle)), (blockInformation === null || blockInformation === void 0 ? void 0 : blockInformation.anchor) && (0,external_wp_element_namespaceObject.createElement)("span", {
|
40376 |
+
className: "block-editor-list-view-block-select-button__anchor-wrapper"
|
40377 |
+
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalTruncate, {
|
40378 |
+
className: "block-editor-list-view-block-select-button__anchor",
|
40379 |
+
ellipsizeMode: "auto"
|
40380 |
+
}, blockInformation.anchor)), isLocked && (0,external_wp_element_namespaceObject.createElement)("span", {
|
40381 |
className: "block-editor-list-view-block-select-button__lock"
|
40382 |
}, (0,external_wp_element_namespaceObject.createElement)(build_module_icon, {
|
40383 |
icon: library_lock
|
41040 |
}
|
41041 |
|
41042 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/use-block-selection.js
|
|
|
|
|
|
|
|
|
41043 |
/**
|
41044 |
* WordPress dependencies
|
41045 |
*/
|
41049 |
|
41050 |
|
41051 |
|
|
|
41052 |
/**
|
41053 |
* Internal dependencies
|
41054 |
*/
|
41137 |
return;
|
41138 |
}
|
41139 |
|
41140 |
+
const selectionDiff = selectedBlocks.filter(blockId => !updatedSelectedBlocks.includes(blockId));
|
41141 |
let label;
|
41142 |
|
41143 |
if (selectionDiff.length === 1) {
|
42515 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/date-format-picker/index.js
|
42516 |
|
42517 |
|
|
|
|
|
|
|
|
|
42518 |
/**
|
42519 |
* WordPress dependencies
|
42520 |
*/
|
42521 |
|
42522 |
|
42523 |
|
|
|
42524 |
// So that we can illustrate the different formats in the dropdown properly,
|
42525 |
// show a date that has a day greater than 12 and a month with more than three
|
42526 |
// letters. Here we're using 2022-01-25 which is when WordPress 5.9 was
|
42586 |
// 2022) in German (de). The resultant array is de-duplicated as some
|
42587 |
// languages will use the same format string for short, medium, and long
|
42588 |
// formats.
|
42589 |
+
const suggestedFormats = [...new Set(['Y-m-d', (0,external_wp_i18n_namespaceObject._x)('n/j/Y', 'short date format'), (0,external_wp_i18n_namespaceObject._x)('n/j/Y g:i A', 'short date format with time'), (0,external_wp_i18n_namespaceObject._x)('M j, Y', 'medium date format'), (0,external_wp_i18n_namespaceObject._x)('M j, Y g:i A', 'medium date format with time'), (0,external_wp_i18n_namespaceObject._x)('F j, Y', 'long date format'), (0,external_wp_i18n_namespaceObject._x)('M j', 'short date format without the year')])];
|
42590 |
const suggestedOptions = suggestedFormats.map((suggestedFormat, index) => ({
|
42591 |
key: `suggested-${index}`,
|
42592 |
name: (0,external_wp_date_namespaceObject.dateI18n)(suggestedFormat, EXAMPLE_DATE),
|
42602 |
return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.BaseControl, {
|
42603 |
className: "block-editor-date-format-picker__custom-format-select-control"
|
42604 |
}, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.CustomSelectControl, {
|
42605 |
+
__nextUnconstrainedWidth: true,
|
42606 |
label: (0,external_wp_i18n_namespaceObject.__)('Choose a format'),
|
42607 |
options: [...suggestedOptions, customOption],
|
42608 |
value: isCustom ? customOption : (_suggestedOptions$fin = suggestedOptions.find(option => option.format === format)) !== null && _suggestedOptions$fin !== void 0 ? _suggestedOptions$fin : customOption,
|
44975 |
// Ensure input always has an accessible label
|
44976 |
'aria-expanded': showSuggestions,
|
44977 |
'aria-autocomplete': 'list',
|
44978 |
+
'aria-controls': suggestionsListboxId,
|
44979 |
'aria-activedescendant': selectedSuggestion !== null ? `${suggestionOptionIdPrefix}-${selectedSuggestion}` : undefined,
|
44980 |
ref: this.inputRef
|
44981 |
};
|
45810 |
|
45811 |
return (0,external_wp_element_namespaceObject.createElement)("div", {
|
45812 |
"aria-label": (0,external_wp_i18n_namespaceObject.__)('Currently selected'),
|
|
|
45813 |
className: classnames_default()('block-editor-link-control__search-item', {
|
45814 |
'is-current': true,
|
45815 |
'is-rich': hasRichData,
|
48166 |
* WordPress dependencies
|
48167 |
*/
|
48168 |
|
|
|
|
|
|
|
|
|
48169 |
|
48170 |
|
48171 |
|
48281 |
}
|
48282 |
|
48283 |
;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/rich-text/use-format-types.js
|
|
|
|
|
|
|
|
|
48284 |
/**
|
48285 |
* WordPress dependencies
|
48286 |
*/
|
48288 |
|
48289 |
|
48290 |
|
|
|
48291 |
function formatTypesSelector(select) {
|
48292 |
return select(external_wp_richText_namespaceObject.store).getFormatTypes();
|
48293 |
}
|
48304 |
if (typeof selected !== 'object') return {
|
48305 |
[prefix]: selected
|
48306 |
};
|
48307 |
+
return Object.fromEntries(Object.entries(selected).map(_ref => {
|
48308 |
+
let [key, value] = _ref;
|
48309 |
+
return [`${prefix}.${key}`, value];
|
48310 |
+
}));
|
48311 |
}
|
48312 |
|
48313 |
function getPrefixedSelectKeys(selected, prefix) {
|
48329 |
*/
|
48330 |
|
48331 |
|
48332 |
+
function useFormatTypes(_ref2) {
|
48333 |
let {
|
48334 |
clientId,
|
48335 |
identifier,
|
48336 |
withoutInteractiveFormatting,
|
48337 |
allowedFormats
|
48338 |
+
} = _ref2;
|
48339 |
const allFormatTypes = (0,external_wp_data_namespaceObject.useSelect)(formatTypesSelector, []);
|
48340 |
const formatTypes = (0,external_wp_element_namespaceObject.useMemo)(() => {
|
48341 |
+
return allFormatTypes.filter(_ref3 => {
|
48342 |
let {
|
48343 |
name,
|
48344 |
tagName
|
48345 |
+
} = _ref3;
|
48346 |
|
48347 |
if (allowedFormats && !allowedFormats.includes(name)) {
|
48348 |
return false;
|
51303 |
|
51304 |
|
51305 |
|
51306 |
+
|
51307 |
|
51308 |
|
51309 |
|
build/block-editor/index.min.asset.php
CHANGED
@@ -1 +1 @@
|
|
1 |
-
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '
|
1 |
+
<?php return array('dependencies' => array('lodash', 'react', 'react-dom', 'wp-a11y', 'wp-api-fetch', 'wp-blob', 'wp-blocks', 'wp-components', 'wp-compose', 'wp-data', 'wp-date', 'wp-deprecated', 'wp-dom', 'wp-element', 'wp-hooks', 'wp-html-entities', 'wp-i18n', 'wp-is-shallow-equal', 'wp-keyboard-shortcuts', 'wp-keycodes', 'wp-notices', 'wp-polyfill', 'wp-primitives', 'wp-rich-text', 'wp-shortcode', 'wp-token-list', 'wp-url', 'wp-warning', 'wp-wordcount'), 'version' => '5bb12521fe6a7b1d7159');
|
build/block-editor/index.min.js
CHANGED
@@ -1,113 +1,115 @@
|
|
1 |
-
(()=>{var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();g()||e()}),0)}();else for(;u<=d;){var h=g();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:(e,t,n)=>{"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),g=o.offset(e),h=o.outerHeight(e),f=o.outerWidth(e),v=void 0,b=void 0,k=void 0,_=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.top+h-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.top+h-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,_.top+y.top):!1===i?o.scrollTop(t,_.top+E.top):y.top<0?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,_.top+y.top):o.scrollTop(t,_.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,_.left+y.left):!1===s?o.scrollLeft(t,_.left+E.left):y.left<0?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,_.left+y.left):o.scrollLeft(t,_.left+E.left)))}},5425:(e,t,n)=>{"use strict";e.exports=n(1345)},5022:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function g(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function k(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function _(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&_(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);f["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=g(t,["padding","border"],n)),_(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===_(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(_(e,l))||0,o[l]=r+t[l]-n[l]);_(e,o)}(e,t)},isWindow:h,each:u,css:_,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},f)},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:(e,t,n)=>{var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:(e,t,n)=>{"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:(e,t,n)=>{e.exports=n(5372)()},9567:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:e=>{var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},g=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>hb,AlignmentToolbar:()=>fb,Autocomplete:()=>Bb,BlockAlignmentControl:()=>hl,BlockAlignmentToolbar:()=>fl,BlockBreadcrumb:()=>Lb,BlockColorsStyleSelector:()=>Ob,BlockContextProvider:()=>Tl,BlockControls:()=>po,BlockEdit:()=>Rl,BlockEditorKeyboardShortcuts:()=>CE,BlockEditorProvider:()=>pu,BlockFormatControls:()=>uo,BlockIcon:()=>su,BlockInspector:()=>bE,BlockList:()=>ph,BlockMover:()=>Im,BlockNavigationDropdown:()=>rk,BlockPreview:()=>Ud,BlockSelectionClearer:()=>hu,BlockSettingsMenu:()=>Mg,BlockSettingsMenuControls:()=>xg,BlockStyles:()=>ck,BlockTitle:()=>pm,BlockToolbar:()=>Gg,BlockTools:()=>kE,BlockVerticalAlignmentControl:()=>kr,BlockVerticalAlignmentToolbar:()=>_r,ButtonBlockAppender:()=>tm,ButtonBlockerAppender:()=>em,ColorPalette:()=>Bk,ColorPaletteControl:()=>Ik,ContrastChecker:()=>cf,CopyHandler:()=>cg,DefaultBlockAppender:()=>Xp,FontSizePicker:()=>Yf,InnerBlocks:()=>ah,Inserter:()=>Qp,InspectorAdvancedControls:()=>Ho,InspectorControls:()=>Go,JustifyContentControl:()=>Cr,JustifyToolbar:()=>Sr,LineHeightControl:()=>Pf,MediaPlaceholder:()=>cy,MediaReplaceFlow:()=>oy,MediaUpload:()=>J_,MediaUploadCheck:()=>ey,MultiSelectScrollIntoView:()=>SE,NavigableToolbar:()=>fm,ObserveTyping:()=>xE,PanelColorSettings:()=>uy,PlainText:()=>Wy,RichText:()=>Hy,RichTextShortcut:()=>Ky,RichTextToolbarButton:()=>qy,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>pE,ToolSelector:()=>Qy,Typewriter:()=>LE,URLInput:()=>S_,URLInputButton:()=>tE,URLPopover:()=>iy,Warning:()=>Al,WritingFlow:()=>Tu,__experimentalBlockAlignmentMatrixControl:()=>Nb,__experimentalBlockFullHeightAligmentControl:()=>xb,__experimentalBlockPatternSetup:()=>yk,__experimentalBlockPatternsList:()=>dp,__experimentalBlockVariationPicker:()=>dk,__experimentalBlockVariationTransforms:()=>Sk,__experimentalBorderRadiusControl:()=>Ih,__experimentalColorGradientControl:()=>of,__experimentalColorGradientSettingsDropdown:()=>af,__experimentalDateFormatPicker:()=>Nk,__experimentalDuotoneControl:()=>Ov,__experimentalFontAppearanceControl:()=>Nf,__experimentalFontFamilyControl:()=>Hf,__experimentalGetBorderClassesAndStyles:()=>Yv,__experimentalGetColorClassesAndStyles:()=>Qv,__experimentalGetElementClassName:()=>VE,__experimentalGetGapCSSValue:()=>ur,__experimentalGetGradientClass:()=>jh,__experimentalGetGradientObjectByGradientValue:()=>qh,__experimentalGetMatchingVariation:()=>GE,__experimentalGetSpacingClassesAndStyles:()=>eb,__experimentalImageEditingProvider:()=>n_,__experimentalImageEditor:()=>p_,__experimentalImageSizeControl:()=>h_,__experimentalImageURLInputUI:()=>cE,__experimentalInspectorPopoverHeader:()=>OE,__experimentalLayoutStyle:()=>rl,__experimentalLetterSpacingControl:()=>vv,__experimentalLibrary:()=>yE,__experimentalLinkControl:()=>Y_,__experimentalLinkControlSearchInput:()=>V_,__experimentalLinkControlSearchItem:()=>I_,__experimentalLinkControlSearchResults:()=>R_,__experimentalListView:()=>nk,__experimentalPanelColorGradientSettings:()=>Dk,__experimentalPreviewOptions:()=>uE,__experimentalPublishDateTimePicker:()=>FE,__experimentalRecursionProvider:()=>ME,__experimentalResponsiveBlockControl:()=>jy,__experimentalTextDecorationControl:()=>lv,__experimentalTextTransformControl:()=>mv,__experimentalUnitControl:()=>Xy,__experimentalUseBlockOverlayActive:()=>Rb,__experimentalUseBlockPreview:()=>Wd,__experimentalUseBorderProps:()=>Zv,__experimentalUseColorProps:()=>Jv,__experimentalUseCustomSides:()=>ir,__experimentalUseGradient:()=>Zh,__experimentalUseHasRecursion:()=>AE,__experimentalUseMultipleOriginColorsAndGradients:()=>Rh,__experimentalUseResizeCanvas:()=>dE,__unstableBlockNameContext:()=>Hg,__unstableBlockSettingsMenuFirstItem:()=>fg,__unstableBlockToolbarLastItem:()=>og,__unstableDuotoneFilter:()=>Fd,__unstableDuotoneStylesheet:()=>Dd,__unstableDuotoneUnsetStylesheet:()=>Od,__unstableEditorStyles:()=>Md,__unstableGetValuesFromColors:()=>Ad,__unstableIframe:()=>Lu,__unstableInserterMenuExtension:()=>Vp,__unstablePresetDuotoneFilter:()=>zd,__unstableRichTextInputEvent:()=>Yy,__unstableUseBlockSelectionClearer:()=>gu,__unstableUseClipboardHandler:()=>ag,__unstableUseMouseMoveTypingReset:()=>BE,__unstableUseTypewriter:()=>PE,__unstableUseTypingObserver:()=>IE,createCustomColorsHOC:()=>lb,getColorClassName:()=>Ph,getColorObjectByAttributeValues:()=>Th,getColorObjectByColorValue:()=>Nh,getFontSize:()=>jf,getFontSizeClass:()=>qf,getFontSizeObjectByValue:()=>Kf,getGradientSlugByValue:()=>Yh,getGradientValueBySlug:()=>Kh,getPxFromCssUnit:()=>XE,store:()=>to,storeConfig:()=>eo,transformStyles:()=>Pd,useBlockDisplayInformation:()=>um,useBlockEditContext:()=>lo,useBlockProps:()=>Zc,useCachedTruthy:()=>tb,useInnerBlocksProps:()=>sh,useSetting:()=>To,withColorContext:()=>wk,withColors:()=>ib,withFontSizes:()=>ab});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Ft,__experimentalGetAllowedBlocks:()=>bt,__experimentalGetAllowedPatterns:()=>Et,__experimentalGetBlockListSettingsForBlocks:()=>xt,__experimentalGetDirectInsertBlock:()=>kt,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Pt,__experimentalGetParsedPattern:()=>_t,__experimentalGetPatternTransformItems:()=>St,__experimentalGetPatternsByBlockTypes:()=>Ct,__experimentalGetReusableBlockTitle:()=>Tt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetVisibleBlocks:()=>Ht,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Nt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Le,areInnerBlocksControlled:()=>Ot,canEditBlock:()=>at,canInsertBlockType:()=>nt,canInsertBlocks:()=>ot,canLockBlockType:()=>ct,canMoveBlock:()=>it,canMoveBlocks:()=>st,canRemoveBlock:()=>rt,canRemoveBlocks:()=>lt,didAutomaticChange:()=>At,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>Ae,getBlockInsertionPoint:()=>Ye,getBlockListSettings:()=>wt,getBlockMode:()=>Ge,getBlockName:()=>U,getBlockOrder:()=>Me,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>le,getBlockTransformItems:()=>ft,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Q,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>$e,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ht,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>_e,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>ke,getSelectionEnd:()=>re,getSelectionStart:()=>oe,getSettings:()=>Bt,getTemplate:()=>Xe,getTemplateLock:()=>Je,hasBlockMovingClientId:()=>Mt,hasInserterItems:()=>vt,hasMultiSelection:()=>ze,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>Oe,isAncestorBeingDragged:()=>Ke,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>je,isBlockHighlighted:()=>Dt,isBlockInsertionPointVisible:()=>Ze,isBlockMultiSelected:()=>Be,isBlockSelected:()=>De,isBlockValid:()=>W,isBlockVisible:()=>Vt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>qe,isDraggingBlocks:()=>We,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>It,isMultiSelecting:()=>Ve,isNavigationMode:()=>Rt,isSelectionEnabled:()=>He,isTyping:()=>Ue,isValidTemplate:()=>Qe,wasBlockJustInserted:()=>zt});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>En,__unstableExpandSelection:()=>Sn,__unstableMarkAutomaticChange:()=>Un,__unstableMarkLastChangeAsPersistent:()=>Hn,__unstableMarkNextChangeAsNotPersistent:()=>Gn,__unstableSaveReusableBlock:()=>Vn,__unstableSplitSelection:()=>Cn,clearSelectedBlock:()=>rn,duplicateBlocks:()=>jn,enterFormattedText:()=>Mn,exitFormattedText:()=>An,flashBlock:()=>Zn,hideInsertionPoint:()=>bn,insertAfterBlock:()=>qn,insertBeforeBlock:()=>Kn,insertBlock:()=>hn,insertBlocks:()=>fn,insertDefaultBlock:()=>On,mergeBlocks:()=>wn,moveBlockToPosition:()=>gn,moveBlocksDown:()=>dn,moveBlocksToPosition:()=>mn,moveBlocksUp:()=>pn,multiSelect:()=>on,receiveBlocks:()=>Yt,removeBlock:()=>In,removeBlocks:()=>Bn,replaceBlock:()=>cn,replaceBlocks:()=>an,replaceInnerBlocks:()=>xn,resetBlocks:()=>jt,resetSelection:()=>qt,selectBlock:()=>Xt,selectNextBlock:()=>en,selectPreviousBlock:()=>Jt,selectionChange:()=>Dn,setBlockMovingClientId:()=>$n,setBlockVisibility:()=>Xn,setHasControlledInnerBlocks:()=>Qn,setNavigationMode:()=>Wn,setTemplateValidity:()=>kn,showInsertionPoint:()=>vn,startDraggingBlocks:()=>Ln,startMultiSelect:()=>tn,startTyping:()=>Nn,stopDraggingBlocks:()=>Rn,stopMultiSelect:()=>nn,stopTyping:()=>Pn,synchronizeTemplate:()=>yn,toggleBlockHighlight:()=>Yn,toggleBlockMode:()=>Tn,toggleSelection:()=>ln,updateBlock:()=>Qt,updateBlockAttributes:()=>Zt,updateBlockListSettings:()=>Fn,updateSettings:()=>zn,validateBlocksToTemplate:()=>Kt});const r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,g={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},h=window.wp.i18n,f={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,h.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,h.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,h.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,h.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,h.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,h.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,h.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function k(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}const _=e=>e;function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,y(r,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:_;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})},l.tree={...l.tree,...(0,u.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),e}),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{},visibility:{}},o=I(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=y(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=y(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:k(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:k(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:k(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=y(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...E(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const P=(0,m.combineReducers)({blocks:T,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:N(r.selectionStart,l),selectionEnd:N(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}});var L={};function R(e){return[e]}function M(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function A(e,t){var n,o=t||R;function r(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(L)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(L,l)),s.get(L)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!M(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(M(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),F=window.wp.richText,z=window.wp.deprecated;var V=n.n(z);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const G=[];function U(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function $(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function j(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ot(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||G}const Y=A(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Me(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Me(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Me(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=A(((e,t)=>{if(!t)return G;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:G}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>j(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Me(e,t).length}function oe(e){return e.selection.selectionStart}function re(e){return e.selection.selectionEnd}function le(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?j(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:U(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],r=[...pe(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function ke(e){return e.initialPosition}const _e=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return G;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return G;const r=Me(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?G:_e(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):G}),(e=>[..._e.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return(0,u.first)(ye(e))||null}function Se(e){return(0,u.last)(ye(e))||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Le(e,t){const n=oe(e),o=re(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=de(e,n.clientId);if(l!==de(e,o.clientId))return!1;const i=Me(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=j(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=j(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Re=e=>{const t=oe(e),n=re(e);if(t.clientId===n.clientId)return G;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return G;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return G;const l=Me(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,r.getBlockType)(u.name),p=j(e,c.clientId),m=(0,r.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,F.create)({html:g,...H(f)}),k=(0,F.create)({html:h,...H(v)});return b=(0,F.remove)(b,0,a.offset),k=(0,F.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,F.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,F.toHTMLString)({value:k,...H(v)})}}]};function Me(e,t){return e.blocks.order[t||""]||G}function Ae(e,t){return Me(e,de(e,t)).indexOf(t)}function De(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Oe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Me(e,t),(t=>De(e,t)||Be(e,t)||n&&Oe(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Ve(e){return e.isMultiSelecting}function He(e){return e.isSelectionEnabled}function Ge(e,t){return e.blocksMode[t]||"visual"}function Ue(e){return e.isTyping}function We(e){return!!e.draggedBlocks.length}function $e(e){return e.draggedBlocks}function je(e,t){return e.draggedBlocks.includes(t)}function Ke(e,t){if(!We(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>je(e,t)))}function qe(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ye(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=Ae(e,r.clientId)+1):n=Me(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Qe(e){return e.template.isValid}function Xe(e){return e.settings.template}function Je(e,t){if(!t)return e.settings.templateLock;const n=wt(e,t);return n?n.templateLock:null}const et=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},tt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=Bt(e),s=et(i,t,!0);if(!s)return!1;const a=!!Je(e,o);if(a)return!1;const c=wt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=et(d,t),m=n.parent,g=U(e,o),h=et(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,u.some)(t,(t=>et(v,U(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},nt=A(tt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>nt(e,U(e,t),n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Je(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>rt(e,t,n)))}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return;const{lock:r}=o,l="all"===Je(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>it(e,t,n)))}function at(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ct(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function ut(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const dt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&tt(e,t.name,n),pt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=ut(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:mt(r,l)}},mt=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},gt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=ut(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:mt(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ht=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=gt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=O;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=ut(e,l)||{},c=mt(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>dt(e,n,t))).map(n),a=tt(e,"core/block",t)?Lt(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=pt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),ft=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=gt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>dt(e,t,o))).map(s),c=(0,u.mapKeys)(a,(e=>{let{name:t}=e;return t}));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>dt(e,n,t)));if(n)return!0;const o=tt(e,"core/block",t)&&Lt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>dt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),kt=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(j(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),_t=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),yt=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=Bt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return _t(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!et(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Et=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=yt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return nt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),Ct=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;const o=Et(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...Et.getDependants(e,t)])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return G;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ot(e,n)})))return G;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Ct(e,o,n)}),((e,t)=>[...Ct.getDependants(e,t)]));function wt(e,t){return e.blockListSettings[t]}function Bt(e){return e.settings}function It(e){return e.blocks.isPersistentChange}const xt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Tt=A(((e,t)=>{var n;const o=(0,u.find)(Lt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Lt(e)]));function Nt(e){return e.blocks.isIgnoredChange}function Pt(e){return e.lastBlockAttributesChange}function Lt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:G}function Rt(e){return e.isNavigationMode}function Mt(e){return e.hasBlockMovingClientId}function At(e){return!!e.automaticChangeStatus}function Dt(e,t){return e.highlightedBlock===t}function Ot(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Ft=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(U(e,n)))return n;const o=ye(e),r=me(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function zt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Vt(e,t){var n,o;return null===(n=null===(o=e.blocks.visibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ht=A((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility])),Gt=window.wp.a11y,Ut="";function Wt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Ut)}))}const $t=e=>Array.isArray(e)?e:[e],jt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Kt(e))},Kt=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function qt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Yt(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Zt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:$t(e),attributes:t,uniqueByBlock:n}}function Qt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Xt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Jt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},en=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function tn(){return{type:"START_MULTI_SELECT"}}function nn(){return{type:"STOP_MULTI_SELECT"}}const on=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Gt.speak)((0,h.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
-
(0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function rn(){return{type:"CLEAR_SELECTED_BLOCK"}}function ln(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function sn(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const an=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=$t(e),t=sn($t(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function cn(e,t){return an(e,t)}const un=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:$t(t),rootClientId:n})},dn=un("MOVE_BLOCKS_DOWN"),pn=un("MOVE_BLOCKS_UP"),mn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function gn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return mn([e],t,n,o)}function hn(e,t,n,o,r){return fn([e],t,n,o,0,r)}const fn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==r&&"object"==typeof r&&(l=r,r=0,V()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=sn($t(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function vn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function bn(){return{type:"HIDE_INSERTION_POINT"}}function kn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const yn=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},En=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,r.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,r.getBlockType)(v.name),k=o.getBlock(f.clientId),_=(0,r.getBlockType)(k.name),y=v.attributes[h.attributeKey],E=k.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=_.attributes[f.attributeKey];let w=(0,F.create)({html:y,...H(C)}),B=(0,F.create)({html:E,...H(S)});w=(0,F.remove)(w,h.offset,w.text.length),B=(0,F.insert)(B,Ut,0,f.offset);const I=(0,r.cloneBlock)(v,{[h.attributeKey]:(0,F.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(k,{[f.attributeKey]:(0,F.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===k.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const L=Wt(P),R=P[L],M=(0,F.create)({html:R,...H(g.attributes[L])}),A=M.text.indexOf(Ut),D=(0,F.remove)(M,A,A+1),O=(0,F.toHTMLString)({value:D,...H(g.attributes[L])});P[L]=O;const z=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,L,A,A),l.replaceBlocks(z,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Cn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,r.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=h.attributes[d.attributeKey];let _=(0,F.create)({html:f,...H(b)}),y=(0,F.create)({html:v,...H(k)});_=(0,F.remove)(_,u.offset,_.text.length),y=(0,F.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,F.toHTMLString)({value:_,...H(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,F.toHTMLString)({value:y,...H(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Sn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},wn=(e,t)=>n=>{let{select:o,dispatch:l}=n;const i=[e,t];l({type:"MERGE_BLOCKS",blocks:i});const[s,a]=i,c=o.getBlock(s),u=(0,r.getBlockType)(c.name);if(u&&!u.merge)return void l.selectBlock(c.clientId);const d=o.getBlock(a),p=(0,r.getBlockType)(d.name),{clientId:m,attributeKey:g,offset:h}=o.getSelectionStart(),f=(m===s?u:p).attributes[g],v=(m===s||m===a)&&void 0!==g&&void 0!==h&&!!f;f||("number"==typeof g?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof g):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const b=(0,r.cloneBlock)(c),k=(0,r.cloneBlock)(d);if(v){const e=m===s?b:k,t=e.attributes[g],n=(0,F.insert)((0,F.create)({html:t,...H(f)}),Ut,h,h);e.attributes[g]=(0,F.toHTMLString)({value:n,...H(f)})}const _=c.name===d.name?[k]:(0,r.switchToBlockType)(k,c.name);if(!_||!_.length)return;const y=u.merge(b.attributes,_[0].attributes);if(v){const e=Wt(y),t=y[e],n=(0,F.create)({html:t,...H(u.attributes[e])}),o=n.text.indexOf(Ut),r=(0,F.remove)(n,o,o+1),i=(0,F.toHTMLString)({value:r,...H(u.attributes[e])});y[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,d.clientId],[{...c,attributes:{...c.attributes,...y}},..._.slice(1)],0)},Bn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=$t(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function In(e,t){return Bn([e],t)}function xn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function Tn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Nn(){return{type:"START_TYPING"}}function Pn(){return{type:"STOP_TYPING"}}function Ln(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Rn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Mn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function An(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Dn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const On=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Fn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function zn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Vn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Hn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Gn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Un=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Wn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Gt.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Gt.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},$n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Gt.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},jn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=$t(e),c=o.getBlockIndex(a[a.length-1]),u=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(u,c+1,s,t),u.length>1&&t&&l.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},Kn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},qn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function Yn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Zn=e=>async t=>{let{dispatch:n}=t;n(Yn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Yn(e,!1))};function Qn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Xn(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}const Jn="core/block-editor",eo={reducer:P,selectors:e,actions:t},to=(0,m.createReduxStore)(Jn,{...eo,persist:["preferences"]});(0,m.registerStore)(Jn,{...eo,persist:["preferences"]});const no={name:"",isSelected:!1},oo=(0,s.createContext)(no),{Provider:ro}=oo;function lo(){return(0,s.useContext)(oo)}function io(){const{isSelected:e,clientId:t,name:n}=lo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(to);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function so(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=io(),{clientId:o}=lo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(to),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:l?g.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function ao(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=g[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const co=so;co.Slot=ao;const uo=e=>(0,s.createElement)(so,i({group:"inline"},e));uo.Slot=e=>(0,s.createElement)(ao,i({group:"inline"},e));const po=co,mo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),go=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ho=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),fo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),vo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function ko(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function _o(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${ko(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}const yo=(0,s.createContext)({refs:new Map,callbacks:new Map});function Eo(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(yo.Provider,{value:n},t)}function Co(e){const{refs:t,callbacks:n}=(0,s.useContext)(yo),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function So(e){const{refs:t}=(0,s.useContext)(yo),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function wo(e){const{callbacks:t}=(0,s.useContext)(yo),n=So(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}const Bo=["color","border","typography","spacing"],Io={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},xo={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function To(e){const{name:t,clientId:n}=lo();return(0,m.useSelect)((o=>{if(Bo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>xo[e]||e)(e);[...o(to).getBlockParents(n),n].forEach((e=>{const n=o(to).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(to).getBlockAttributes(e),r=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const s=o(to).getSettings();if(void 0===l){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=l.custom)&&void 0!==d?d:l.theme)&&void 0!==c?c:l.default:l;const p=Io[i]?Io[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;const No={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Po(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=io(),l=null===(t=No[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const Lo=e=>e,Ro=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Ro),Lo);return(0,u.isEmpty)(t)?void 0:t};function Mo(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Ao(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:Mo(c.attributes,e,t)})}))})),c}function Do(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function Oo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(to),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(to),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Ro(r.style)},t[n]=r})),r(n,t,!0)}),[Ro,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Fo(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function zo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=No[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(Oo,{group:n,label:o},(0,s.createElement)(Fo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Vo=Po;Vo.Slot=zo;const Ho=e=>(0,s.createElement)(Po,i({},e,{__experimentalGroup:"advanced"}));Ho.Slot=e=>(0,s.createElement)(zo,i({},e,{__experimentalGroup:"advanced"})),Ho.slotName="InspectorAdvancedControls";const Go=Vo,Uo=window.wp.isShallowEqual;var Wo=n.n(Uo);const $o=function(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])};function jo(e){let{clientId:t,bottomClientId:n,children:o,__unstableRefreshSize:r,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:u,...d}=e;const m=wo(t),g=wo(null!=n?n:t),h=$o(u),f=(0,s.useMemo)((()=>m&&g===m?{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}:{}),[m,g,r]);if(!m||n&&!g)return null;const v={top:m,bottom:g};return(0,s.createElement)(p.Popover,i({ref:h,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:v,__unstableSlotName:a||null,__unstableObserveElement:m,__unstableForcePosition:!0,__unstableShift:!0},d,{className:c()("block-editor-block-popover",d.className)}),l&&(0,s.createElement)("div",{style:f},o),!l&&o)}function Ko(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.margin)}function qo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.margin"),n=!sr(e,"margin");return!Ko(e)||t||n}function Yo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),i=ir(n,"margin"),a=i&&i.some((e=>or.includes(e)));return qo(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.margin,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,margin:e}};r({style:Ro(t)})},label:(0,h.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Zo(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0,top:null!=l&&l.top?`-${l.top}`:0,right:null!=l&&l.right?`-${l.right}`:0,bottom:null!=l&&l.bottom?`-${l.bottom}`:0,left:null!=l&&l.left?`-${l.left}`:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Wo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(jo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}function Qo(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.padding)}function Xo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.padding"),n=!sr(e,"padding");return!Qo(e)||t||n}function Jo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),i=ir(n,"padding"),a=i&&i.some((e=>or.includes(e)));return Xo(e)?null:s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalBoxControl,{values:null==o||null===(t=o.spacing)||void 0===t?void 0:t.padding,onChange:e=>{const t={...o,spacing:{...null==o?void 0:o.spacing,padding:e}};r({style:Ro(t)})},label:(0,h.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function er(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>{var e,t,n,o;return{borderTopWidth:null!==(e=null==l?void 0:l.top)&&void 0!==e?e:0,borderRightWidth:null!==(t=null==l?void 0:l.right)&&void 0!==t?t:0,borderBottomWidth:null!==(n=null==l?void 0:l.bottom)&&void 0!==n?n:0,borderLeftWidth:null!==(o=null==l?void 0:l.left)&&void 0!==o?o:0}}),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(Wo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(jo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const tr="spacing",nr=["top","right","bottom","left"],or=["vertical","horizontal"];function rr(e){const t=dr(e),n=Xo(e),o=qo(e),l=lr(e),i=(a=e.name,"web"===s.Platform.OS&&(ar(a)||Qo(a)||Ko(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[tr,"__experimentalDefaultControls"]),u=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Go,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:u("padding"),isShownByDefault:null==c?void 0:c.padding,panelId:e.clientId},(0,s.createElement)(Jo,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:u("margin"),isShownByDefault:null==c?void 0:c.margin,panelId:e.clientId},(0,s.createElement)(Yo,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:u("blockGap"),isShownByDefault:null==c?void 0:c.blockGap,panelId:e.clientId},(0,s.createElement)(pr,e))),!n&&(0,s.createElement)(er,e),!o&&(0,s.createElement)(Zo,e))}const lr=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=dr(e),n=Xo(e),o=qo(e);return t&&n&&o};function ir(e,t){var n;const o=(0,r.getBlockSupport)(e,tr);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function sr(e,t){const n=ir(e,t);return!(n&&n.some((e=>nr.includes(e)))&&n.some((e=>or.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function ar(e){const t=(0,r.getBlockSupport)(e,tr);return!!(!0===t||null!=t&&t.blockGap)}function cr(e){if(!e)return null;const t="string"==typeof e;return{top:t?e:null==e?void 0:e.top,left:t?e:null==e?void 0:e.left}}function ur(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=cr(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function dr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.blockGap");return!ar(e)||t}function pr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]}),a=ir(r,"blockGap"),c=So(n);if(dr(e))return null;const u=a&&a.some((e=>or.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...cr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Ro(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=cr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:g,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:g})),native:null})}const mr=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),gr=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),hr={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:gr,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:mr,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},fr=["top","center","bottom"],vr={isAlternate:!0},br=function(e){let{value:t,onChange:n,controls:o=fr,isCollapsed:r=!0,isToolbar:l}=e;const a=hr[t],c=hr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:vr,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...hr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},kr=e=>(0,s.createElement)(br,i({},e,{isToolbar:!1})),_r=e=>(0,s.createElement)(br,i({},e,{isToolbar:!0})),yr={left:mo,center:go,right:ho,"space-between":fo},Er=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?yr[r]:yr.left,d=[{name:"left",icon:mo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:go,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ho,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:fo,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},Cr=e=>(0,s.createElement)(Er,i({},e,{isToolbar:!1})),Sr=e=>(0,s.createElement)(Er,i({},e,{isToolbar:!0})),wr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Br={left:"flex-start",right:"flex-end",center:"center"},Ir={top:"flex-start",center:"center",bottom:"flex-end"},xr=["wrap","nowrap"],Tr={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Pr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(Rr,{layout:t,onChange:n}))),(0,s.createElement)(Lr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Pr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Nr,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Do(i,"spacing","blockGap")?ur(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap):void 0,d=wr[r.justifyContent],p=xr.includes(r.flexWrap)?r.flexWrap:"wrap",m=Ir[r.verticalAlignment],g=Br[r.justifyContent]||Br.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${ko(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=_o(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Nr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=Ir.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(kr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Pr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(Cr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:mo,label:(0,h.__)("Justify items left")},{value:"center",icon:go,label:(0,h.__)("Justify items center")},{value:"right",icon:ho,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:fo,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Lr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Rr(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,h.__)("Orientation")),(0,s.createElement)(p.Button,{label:(0,h.__)("Horizontal"),icon:vo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:(0,h.__)("Vertical"),icon:bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const Mr=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},Ar=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Dr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),Or="var:";function Fr(e,t,n,o){const r=(0,u.get)(e,n);return r?[{selector:null==t?void 0:t.selector,key:o,value:Vr(r)}]:[]}function zr(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const l=(0,u.get)(e,n);if(!l)return[];const i=[];if("string"==typeof l)i.push({selector:null==t?void 0:t.selector,key:o.default,value:l});else{const e=r.reduce(((e,n)=>{const r=Vr((0,u.get)(l,[n]));return r&&e.push({selector:null==t?void 0:t.selector,key:null==o?void 0:o.individual.replace("%s",Hr(n)),value:r}),e}),[]);i.push(...e)}return i}function Vr(e){return"string"==typeof e&&e.startsWith(Or)?`var(--wp--${e.slice(Or.length).split("|").join("--")})`:e}function Hr(e){let[t,...n]=e;return t.toUpperCase()+n.join("")}const Gr={name:"radius",generate:(e,t)=>zr(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},Ur=[{name:"color",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","color"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderColor";return Fr(e,t,n,o)}},{name:"style",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","style"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderStyle";return Fr(e,t,n,o)}},{name:"width",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","width"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderWidth";return Fr(e,t,n,o)}}],Wr=e=>(t,n)=>{var o;const r=null==t||null===(o=t.border)||void 0===o?void 0:o[e];return r?Ur.reduce(((o,l)=>{const i=l.name;if(r.hasOwnProperty(i)&&"function"==typeof l.generate){const r=`border${Hr(e)}${Hr(i)}`;o.push(...l.generate(t,n,["border",e,i],r))}return o}),[]):[]},$r={name:"borderTop",generate:Wr("top")},jr={name:"borderRight",generate:Wr("right")},Kr={name:"borderBottom",generate:Wr("bottom")},qr={name:"borderLeft",generate:Wr("left")},Yr=[...Ur,Gr,$r,jr,Kr,qr,{name:"text",generate:(e,t)=>Fr(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>Fr(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>Fr(e,t,["color","background"],"backgroundColor")},{name:"margin",generate:(e,t)=>zr(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(e,t)=>zr(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},{name:"fontSize",generate:(e,t)=>Fr(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>Fr(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>Fr(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>Fr(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"letterSpacing",generate:(e,t)=>Fr(e,t,["typography","lineHeight"],"lineHeight")},{name:"textDecoration",generate:(e,t)=>Fr(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>Fr(e,t,["typography","textTransform"],"textTransform")}];function Zr(e,t){const n=Qr(e,t);if(null==t||!t.selector){const e=[];return n.forEach((t=>{e.push(`${(0,u.kebabCase)(t.key)}: ${t.value};`)})),e.join(" ")}const o=(0,u.groupBy)(n,"selector");return Object.keys(o).reduce(((e,t)=>(e.push(`${t} { ${o[t].map((e=>`${(0,u.kebabCase)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]).join("\n")}function Qr(e,t){const n=[];return Yr.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}const Xr=[{name:"default",label:(0,h.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(Mr,{icon:Ar})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(Mr,{icon:Dr}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u}=r,d=cr(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap),p=null!=d&&d.top&&!Do(i,"spacing","blockGap")?null==d?void 0:d.top:"";let m=c||u?`\n\t\t\t\t\t${ko(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${ko(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding&&Qr(l).forEach((e=>{"paddingRight"===e.key?m+=`\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(m+=`\n\t\t\t\t\t${ko(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),s&&p&&(m+=_o(o,a,"default",p)),m},getOrientation:()=>"vertical",getAlignments(e){const t=function(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
-
o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},Tr];function Jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Xr.find((t=>t.name===e))}const el={type:"default"},tl=(0,s.createContext)(el),nl=tl.Provider;function ol(){return(0,s.useContext)(tl)}function rl(e){let{layout:t={},css:n,...o}=e;const r=Jr(t.type),l=null!==To("spacing.blockGap");if(r){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const ll=["none","left","center","right","wide","full"],il=["wide","full"];function sl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:ll;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(to),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=ol(),r=Jr(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name)return[];const{alignments:i=ll}=o,s=e.filter((e=>(o.alignments||t||!il.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const al=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),cl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),ul=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),dl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),pl={none:{icon:al,title:(0,h._x)("None","Alignment option")},left:{icon:cl,title:(0,h.__)("Align left")},center:{icon:Ar,title:(0,h.__)("Align center")},right:{icon:ul,title:(0,h.__)("Align right")},wide:{icon:Dr,title:(0,h.__)("Wide width")},full:{icon:dl,title:(0,h.__)("Full width")}},ml={isAlternate:!0},gl=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=sl(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=pl[t],m=pl.none,g=r?p.ToolbarGroup:p.ToolbarDropdownMenu,f={popoverProps:ml,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...pl[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=pl[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(g,i({},f,v))},hl=e=>(0,s.createElement)(gl,i({},e,{isToolbar:!1})),fl=e=>(0,s.createElement)(gl,i({},e,{isToolbar:!0})),vl=["left","center","right","wide","full"],bl=["wide","full"];function kl(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?vl.filter((t=>e.includes(t))):!0===e?[...vl]:[],!o||!0===e&&!n?(0,u.without)(t,...bl):t}const _l=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=sl(kl((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(hl,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),yl=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=sl(kl((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...vl,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",yl),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",_l),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return kl((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const El=/[\s#]/g,Cl={type:"string",source:"attribute",attribute:"id",selector:"*"},Sl=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(El,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Go,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Go,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:Cl}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Sl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const wl={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:wl}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const Bl=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(Go,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",Bl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=(0,u.uniq)([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")]).join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const Il=window.wp.dom,xl=(0,s.createContext)({});function Tl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(xl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(xl.Provider,{value:r,children:n})}const Nl=xl,Pl={},Ll=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(Nl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):Pl),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function Rl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(ro,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(Ll,e))}const Ml=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),Al=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:Ml,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))};var Dl=n(1973);function Ol(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,Il.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}const Fl=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,g=a,(0,Dl.Kx)(m,g).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(Ol,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(Ol,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},zl=e=>(0,r.rawHandler)({HTML:e.originalContent}),Vl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(to).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(to);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,zl(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),g=(0,s.useMemo)((()=>[{
|
|
|
|
|
8 |
// translators: Button to fix block content
|
9 |
-
title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(
|
10 |
-
(0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(Fl,{block:i,onKeep:t,onConvert:n,convertor:zl,convertButtonText:(0,h.__)("Convert to Blocks")})))})),Hl=(0,s.createElement)(Al,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),Gl=()=>Hl;class Ul extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const Wl=Ul;var $l=n(773);const jl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(to).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)($l.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),[c]=n?(0,r.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let Kl=ci();const ql=e=>li(e,Kl);let Yl=ci();ql.write=e=>li(e,Yl);let Zl=ci();ql.onStart=e=>li(e,Zl);let Ql=ci();ql.onFrame=e=>li(e,Ql);let Xl=ci();ql.onFinish=e=>li(e,Xl);let Jl=[];ql.setTimeout=(e,t)=>{let n=ql.now()+t,o=()=>{let e=Jl.findIndex((e=>e.cancel==o));~e&&Jl.splice(e,1),oi-=~e?1:0},r={time:n,handler:e,cancel:o};return Jl.splice(ei(n),0,r),oi+=1,ii(),r};let ei=e=>~(~Jl.findIndex((t=>t.time>e))||~Jl.length);ql.cancel=e=>{Zl.delete(e),Ql.delete(e),Kl.delete(e),Yl.delete(e),Xl.delete(e)},ql.sync=e=>{ri=!0,ql.batchedUpdates(e),ri=!1},ql.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,ql.onStart(n)}return o.handler=e,o.cancel=()=>{Zl.delete(n),t=null},o};let ti="undefined"!=typeof window?window.requestAnimationFrame:()=>{};ql.use=e=>ti=e,ql.now="undefined"!=typeof performance?()=>performance.now():Date.now,ql.batchedUpdates=e=>e(),ql.catch=console.error,ql.frameLoop="always",ql.advance=()=>{"demand"!==ql.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):ai()};let ni=-1,oi=0,ri=!1;function li(e,t){ri?(t.delete(e),e(0)):(t.add(e),ii())}function ii(){ni<0&&(ni=0,"demand"!==ql.frameLoop&&ti(si))}function si(){~ni&&(ti(si),ql.batchedUpdates(ai))}function ai(){let e=ni;ni=ql.now();let t=ei(ni);t&&(ui(Jl.splice(0,t),(e=>e.handler())),oi-=t),Zl.flush(),Kl.flush(e?Math.min(64,ni-e):16.667),Ql.flush(),Yl.flush(),Xl.flush(),oi||(ni=-1)}function ci(){let e=new Set,t=e;return{add(n){oi+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(oi-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,oi-=t.size,ui(t,(t=>t(n)&&e.add(t))),oi+=e.size,t=e)}}}function ui(e,t){e.forEach((e=>{try{t(e)}catch(e){ql.catch(e)}}))}var di=n(9196),pi=n.n(di);function mi(){}const gi={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function hi(e,t){if(gi.arr(e)){if(!gi.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const fi=(e,t)=>e.forEach(t);function vi(e,t,n){if(gi.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const bi=e=>gi.und(e)?[]:gi.arr(e)?e:[e];function ki(e,t){if(e.size){const n=Array.from(e);e.clear(),fi(n,t)}}const _i=(e,...t)=>ki(e,(e=>e(...t))),yi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Ei,Ci,Si=null,wi=!1,Bi=mi;var Ii=Object.freeze({__proto__:null,get createStringInterpolator(){return Ei},get to(){return Ci},get colors(){return Si},get skipAnimation(){return wi},get willAdvance(){return Bi},assign:e=>{e.to&&(Ci=e.to),e.now&&(ql.now=e.now),void 0!==e.colors&&(Si=e.colors),null!=e.skipAnimation&&(wi=e.skipAnimation),e.createStringInterpolator&&(Ei=e.createStringInterpolator),e.requestAnimationFrame&&ql.use(e.requestAnimationFrame),e.batchedUpdates&&(ql.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Bi=e.willAdvance),e.frameLoop&&(ql.frameLoop=e.frameLoop)}});const xi=new Set;let Ti=[],Ni=[],Pi=0;const Li={get idle(){return!xi.size&&!Ti.length},start(e){Pi>e.priority?(xi.add(e),ql.onStart(Ri)):(Mi(e),ql(Di))},advance:Di,sort(e){if(Pi)ql.onFrame((()=>Li.sort(e)));else{const t=Ti.indexOf(e);~t&&(Ti.splice(t,1),Ai(e))}},clear(){Ti=[],xi.clear()}};function Ri(){xi.forEach(Mi),xi.clear(),ql(Di)}function Mi(e){Ti.includes(e)||Ai(e)}function Ai(e){Ti.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Ti),0,e)}function Di(e){const t=Ni;for(let n=0;n<Ti.length;n++){const o=Ti[n];Pi=o.priority,o.idle||(Bi(o),o.advance(e),o.idle||t.push(o))}return Pi=0,Ni=Ti,Ni.length=0,Ti=t,Ti.length>0}const Oi="[-+]?\\d*\\.?\\d+",Fi=Oi+"%";function zi(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const Vi=new RegExp("rgb"+zi(Oi,Oi,Oi)),Hi=new RegExp("rgba"+zi(Oi,Oi,Oi,Oi)),Gi=new RegExp("hsl"+zi(Oi,Fi,Fi)),Ui=new RegExp("hsla"+zi(Oi,Fi,Fi,Oi)),Wi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,$i=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ji=/^#([0-9a-fA-F]{6})$/,Ki=/^#([0-9a-fA-F]{8})$/;function qi(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function Yi(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=qi(r,o,e+1/3),i=qi(r,o,e),s=qi(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Zi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Qi(e){return(parseFloat(e)%360+360)%360/360}function Xi(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Ji(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function es(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=ji.exec(e))?parseInt(t[1]+"ff",16)>>>0:Si&&void 0!==Si[e]?Si[e]:(t=Vi.exec(e))?(Zi(t[1])<<24|Zi(t[2])<<16|Zi(t[3])<<8|255)>>>0:(t=Hi.exec(e))?(Zi(t[1])<<24|Zi(t[2])<<16|Zi(t[3])<<8|Xi(t[4]))>>>0:(t=Wi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=Ki.exec(e))?parseInt(t[1],16)>>>0:(t=$i.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=Gi.exec(e))?(255|Yi(Qi(t[1]),Ji(t[2]),Ji(t[3])))>>>0:(t=Ui.exec(e))?(Yi(Qi(t[1]),Ji(t[2]),Ji(t[3]))|Xi(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const ts=(e,t,n)=>{if(gi.fun(e))return e;if(gi.arr(e))return ts({range:e,output:t,extrapolate:n});if(gi.str(e.output[0]))return Ei(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function ns(){return(ns=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const os=Symbol.for("FluidValue.get"),rs=Symbol.for("FluidValue.observers"),ls=e=>Boolean(e&&e[os]),is=e=>e&&e[os]?e[os]():e,ss=e=>e[rs]||null;function as(e,t){let n=e[rs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class cs{constructor(e){if(this[os]=void 0,this[rs]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");us(this,e)}}const us=(e,t)=>ms(e,os,t);function ds(e,t){if(e[os]){let n=e[rs];n||ms(e,rs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function ps(e,t){let n=e[rs];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[rs]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const ms=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),gs=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,hs=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,fs=new RegExp(`(${gs.source})(%|[a-z]+)`,"i"),vs=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,bs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,ks=e=>{const[t,n]=_s(e);if(!t||yi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&bs.test(n)?ks(n):n||e},_s=e=>{const t=bs.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let ys;const Es=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Cs=e=>{ys||(ys=Si?new RegExp(`(${Object.keys(Si).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>is(e).replace(bs,ks).replace(hs,es).replace(ys,es))),n=t.map((e=>e.match(gs).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>ts(ns({},e,{output:t}))));return e=>{var n;const r=!fs.test(t[0])&&(null==(n=t.find((e=>fs.test(e))))?void 0:n.replace(gs,""));let l=0;return t[0].replace(gs,(()=>`${o[l++](e)}${r||""}`)).replace(vs,Es)}},Ss="react-spring: ",ws=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Ss}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},Bs=ws(console.warn),Is=ws(console.warn);function xs(e){return gi.str(e)&&("#"==e[0]||/\d/.test(e)||!yi()&&bs.test(e)||e in(Si||{}))}const Ts="undefined"!=typeof window&&window.document&&window.document.createElement?di.useLayoutEffect:di.useEffect;function Ns(){const e=(0,di.useState)()[1],t=(()=>{const e=(0,di.useRef)(!1);return Ts((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Ps=e=>(0,di.useEffect)(e,Ls),Ls=[];function Rs(e){const t=(0,di.useRef)();return(0,di.useEffect)((()=>{t.current=e})),t.current}const Ms=Symbol.for("Animated:node"),As=e=>e&&e[Ms],Ds=(e,t)=>{return n=e,o=Ms,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},Os=e=>e&&e[Ms]&&e[Ms].getPayload();class Fs{constructor(){this.payload=void 0,Ds(this,this)}getPayload(){return this.payload||[]}}class zs extends Fs{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,gi.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new zs(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return gi.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,gi.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class Vs extends zs{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=ts({output:[e,e]})}static create(e){return new Vs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(gi.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=ts({output:[this.getValue(),e]})),this._value=0,super.reset()}}const Hs={dependencies:null};class Gs extends Fs{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return vi(this.source,((n,o)=>{var r;(r=n)&&r[Ms]===r?t[o]=n.getValue(e):ls(n)?t[o]=is(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&fi(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return vi(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){Hs.dependencies&&ls(e)&&Hs.dependencies.add(e);const t=Os(e);t&&fi(t,(e=>this.add(e)))}}class Us extends Gs{constructor(e){super(e)}static create(e){return new Us(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(Ws)),!0)}}function Ws(e){return(xs(e)?Vs:zs).create(e)}function $s(e){const t=As(e);return t?t.constructor:gi.arr(e)?Us:xs(e)?Vs:zs}function js(){return(js=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const Ks=(e,t)=>{const n=!gi.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,di.forwardRef)(((o,r)=>{const l=(0,di.useRef)(null),i=n&&(0,di.useCallback)((e=>{l.current=function(e,t){return e&&(gi.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return Hs.dependencies=n,e.style&&(e=js({},e,{style:t.createAnimatedStyle(e.style)})),e=new Gs(e),Hs.dependencies=null,[e,n]}(o,t),c=Ns(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new qs(u,a),p=(0,di.useRef)();Ts((()=>(p.current=d,fi(a,(e=>ds(e,d))),()=>{p.current&&(fi(p.current.deps,(e=>ps(e,p.current))),ql.cancel(p.current.update))}))),(0,di.useEffect)(u,[]),Ps((()=>()=>{const e=p.current;fi(e.deps,(t=>ps(t,e)))}));const m=t.getComponentProps(s.getValue());return di.createElement(e,js({},m,{ref:i}))}))};class qs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&ql.write(this.update)}}const Ys=Symbol.for("AnimatedComponent"),Zs=e=>gi.str(e)?e:e&&gi.str(e.displayName)?e.displayName:gi.fun(e)&&e.name||null;function Qs(){return(Qs=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function Xs(e,...t){return gi.fun(e)?e(...t):e}const Js=(e,t)=>!0===e||!!(t&&e&&(gi.fun(e)?e(t):bi(e).includes(t))),ea=(e,t)=>gi.obj(e)?t&&e[t]:e,ta=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,na=e=>e,oa=(e,t=na)=>{let n=ra;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);gi.und(n)||(o[r]=n)}return o},ra=["config","onProps","onStart","onChange","onPause","onResume","onRest"],la={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function ia(e){const t=function(e){const t={};let n=0;if(vi(e,((e,o)=>{la[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return vi(e,((e,o)=>o in t||(n[o]=e))),n}return Qs({},e)}function sa(e){return e=is(e),gi.arr(e)?e.map(sa):xs(e)?Ii.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function aa(e){for(const t in e)return!0;return!1}function ca(e){return gi.fun(e)||gi.arr(e)&&gi.obj(e[0])}function ua(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function da(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const pa=Qs({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class ma{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,pa)}}function ga(e,t){if(gi.und(t.decay)){const n=!gi.und(t.tension)||!gi.und(t.friction);!n&&gi.und(t.frequency)&&gi.und(t.damping)&&gi.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const ha=[];class fa{constructor(){this.changed=!1,this.values=ha,this.toValues=null,this.fromValues=ha,this.to=void 0,this.from=void 0,this.config=new ma,this.immediate=!1}}function va(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Js(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{gi.und(n.pause)||(r.paused=Js(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Js(e,t)),c=Xs(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-ql.now()}function m(){c>0&&!Ii.skipAnimation?(r.delayed=!0,u=ql.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Qs({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const ba=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?ya(e.get()):t.every((e=>e.noop))?ka(e.get()):_a(e.get(),t.every((e=>e.finished))),ka=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),_a=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),ya=e=>({value:e,cancelled:!0,finished:!1});function Ea(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=oa(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&ya(o)||r!==n.asyncId&&_a(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new Sa,i=new wa;return(async()=>{if(Ii.skipAnimation)throw Ca(n),i.result=_a(o,!1),d(i),i;m(l);const s=gi.obj(e)?Qs({},e):Qs({},t,{to:e});s.parentId=r,vi(c,((e,t)=>{gi.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(Ii.skipAnimation)return Ca(n),_a(o,!1);try{let t;t=gi.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=_a(o.get(),!0,!1)}catch(e){if(e instanceof Sa)h=e.result;else{if(!(e instanceof wa))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return gi.fun(i)&&ql.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function Ca(e,t){ki(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Sa extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class wa extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ba=e=>e instanceof xa;let Ia=1;class xa extends cs{constructor(...e){super(...e),this.id=Ia++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=As(this);return e&&e.getValue()}to(...e){return Ii.to(this,e)}interpolate(...e){return Bs(`${Ss}The "interpolate" function is deprecated in v9 (use "to" instead)`),Ii.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){as(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||Li.sort(this),as(this,{type:"priority",parent:this,priority:e})}}const Ta=Symbol.for("SpringPhase"),Na=e=>(1&e[Ta])>0,Pa=e=>(2&e[Ta])>0,La=e=>(4&e[Ta])>0,Ra=(e,t)=>t?e[Ta]|=3:e[Ta]&=-3,Ma=(e,t)=>t?e[Ta]|=4:e[Ta]&=-5;class Aa extends xa{constructor(e,t){if(super(),this.key=void 0,this.animation=new fa,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!gi.und(e)||!gi.und(t)){const n=gi.obj(e)?Qs({},e):Qs({},t,{from:e});gi.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Pa(this)||this._state.asyncTo)||La(this)}get goal(){return is(this.animation.to)}get velocity(){const e=As(this);return e instanceof zs?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Na(this)}get isAnimating(){return Pa(this)}get isPaused(){return La(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=Os(o.to);!i&&ls(o.to)&&(l=bi(is(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==Vs?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=gi.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(gi.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!gi.und(a),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*f,d+=i*f}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=As(this),a=s.getValue();if(t){const e=is(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return ql.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Pa(this)){const{to:e,config:t}=this.animation;ql.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return gi.und(e)?(n=this.queue||[],this.queue=[]):n=[gi.obj(e)?e:Qs({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>ba(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Ca(this._state,e&&this._lastCallId),ql.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=gi.obj(n)?n[t]:n,(null==n||ca(n))&&(n=void 0),o=gi.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Na(this)||(e.reverse&&([n,o]=[o,n]),o=is(o),gi.und(o)?As(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Qs({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,oa(n,((e,t)=>/^on/.test(t)?ea(e,o):e))),Ga(this,n,"onProps"),Ua(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return va(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{La(this)||(Ma(this,!0),_i(i.pauseQueue),Ua(this,"onPause",_a(this,Da(this,this.animation.to)),this))},resume:()=>{La(this)&&(Ma(this,!1),Pa(this)&&this._resume(),_i(i.resumeQueue),Ua(this,"onResume",_a(this,Da(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=Oa(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(ya(this));const o=!gi.und(e.to),r=!gi.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(ya(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!gi.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!hi(d,c);p&&(s.from=d),d=is(d);const m=!hi(u,a);m&&this._focus(u);const g=ca(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(ga(n=Qs({},n),t),t=Qs({},n,t)),ga(e,t),Object.assign(e,t);for(const t in pa)null==e[t]&&(e[t]=pa[t]);let{mass:o,frequency:r,damping:l}=e;gi.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,Xs(t.config,l),t.config!==i.config?Xs(i.config,l):void 0);let b=As(this);if(!b||gi.und(u))return n(_a(this,!0));const k=gi.und(t.reset)?r&&!t.default:!gi.und(d)&&Js(t.reset,l),_=k?d:this.get(),y=sa(u),E=gi.num(y)||gi.arr(y)||xs(y),C=!g&&(!E||Js(i.immediate||t.immediate,l));if(m){const e=$s(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=ls(u),B=!1;if(!w){const e=k||!Na(this)&&p;(m||e)&&(B=hi(sa(_),y),w=!B),(hi(s.immediate,C)||C)&&hi(h.decay,f)&&hi(h.velocity,v)||(w=!0)}if(B&&Pa(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!g&&((w||ls(a))&&(s.values=b.getPayload(),s.toValues=ls(u)?null:S==Vs?[1]:bi(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;fi(Ha,(e=>Ga(this,t,e)));const o=_a(this,Da(this,a));_i(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&ql.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Xs(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),g?n(Ea(t.to,t,this._state,this)):w?this._start():Pa(this)&&!m?this._pendingCalls.add(n):n(ka(_))}_focus(e){const t=this.animation;e!==t.to&&(ss(this)&&this._detach(),t.to=e,ss(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;ls(t)&&(ds(t,this),Ba(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;ls(e)&&ps(e,this)}_set(e,t=!0){const n=is(e);if(!gi.und(n)){const e=As(this);if(!e||!hi(n,e.getValue())){const o=$s(n);e&&e.constructor==o?e.setValue(n):Ds(this,o.create(n)),e&&ql.batchedUpdates((()=>{this._onChange(n,t)}))}}return As(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,Ua(this,"onStart",_a(this,Da(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Xs(this.animation.onChange,e,this)),Xs(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;As(this).reset(is(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Pa(this)||(Ra(this,!0),La(this)||this._resume())}_resume(){Ii.skipAnimation?this.finish():Li.start(this)}_stop(e,t){if(Pa(this)){Ra(this,!1);const n=this.animation;fi(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),as(this,{type:"idle",parent:this});const o=t?ya(this.get()):_a(this.get(),Da(this,null!=e?e:n.to));_i(this._pendingCalls,o),n.changed&&(n.changed=!1,Ua(this,"onRest",o,this))}}}function Da(e,t){const n=sa(t);return hi(sa(e.get()),n)}function Oa(e,t=e.loop,n=e.to){let o=Xs(t);if(o){const r=!0!==o&&ia(o),l=(r||e).reverse,i=!r||r.reset;return Fa(Qs({},e,{loop:t,default:!1,pause:void 0,to:!l||ca(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function Fa(e){const{to:t,from:n}=e=ia(e),o=new Set;return gi.obj(t)&&Va(t,o),gi.obj(n)&&Va(n,o),e.keys=o.size?Array.from(o):null,e}function za(e){const t=Fa(e);return gi.und(t.default)&&(t.default=oa(t)),t}function Va(e,t){vi(e,((e,n)=>null!=e&&t.add(n)))}const Ha=["onStart","onRest","onChange","onPause","onResume"];function Ga(e,t,n){e.animation[n]=t[n]!==ta(t,n)?ea(t[n],e.key):void 0}function Ua(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const Wa=["onStart","onChange","onRest"];let $a=1;class ja{constructor(e,t){this.id=$a++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(Qs({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];gi.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(Fa(e)),this}start(e){let{queue:t}=this;return e?t=bi(e).map(Fa):this.queue=[],this._flush?this._flush(this,t):(Ja(this,t),Ka(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;fi(bi(t),(t=>n[t].stop(!!e)))}else Ca(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(gi.und(e))this.start({pause:!0});else{const t=this.springs;fi(bi(e),(e=>t[e].pause()))}return this}resume(e){if(gi.und(e))this.start({pause:!1});else{const t=this.springs;fi(bi(e),(e=>t[e].resume()))}return this}each(e){vi(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,ki(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&ki(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,ki(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}ql.onFrame(this._onFrame)}}function Ka(e,t){return Promise.all(t.map((t=>qa(e,t)))).then((t=>ba(e,t)))}async function qa(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=gi.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=gi.arr(r)||gi.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):fi(Wa,(n=>{const o=t[n];if(gi.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,_i(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===ta(t,"cancel");(u||m&&d.asyncId)&&p.push(va(++e._lastAsyncId,{props:t,state:d,actions:{pause:mi,resume:mi,start(t,n){m?(Ca(d,e._lastAsyncId),n(ya(e))):(t.onRest=s,n(Ea(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=ba(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=Oa(t,i,r);if(n)return Ja(e,[n]),qa(e,n,!0)}return a&&ql.batchedUpdates((()=>a(g,e,e.item))),g}function Ya(e,t){const n=Qs({},e.springs);return t&&fi(bi(t),(e=>{gi.und(e.keys)&&(e=Fa(e)),gi.obj(e.to)||(e=Qs({},e,{to:void 0})),Xa(n,e,(e=>Qa(e)))})),Za(e,n),n}function Za(e,t){vi(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,ds(t,e))}))}function Qa(e,t){const n=new Aa;return n.key=e,t&&ds(n,t),n}function Xa(e,t,n){t.keys&&fi(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ja(e,t){fi(t,(t=>{Xa(e.springs,t,(t=>Qa(t,e)))}))}const ec=["children"],tc=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,ec);const o=(0,di.useContext)(nc),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,di.useState)((()=>({inputs:t,result:e()}))),o=(0,di.useRef)(),r=o.current;let l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,di.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=nc;return di.createElement(i,{value:n},t)},nc=(oc=tc,rc={},Object.assign(oc,di.createContext(rc)),oc.Provider._context=oc,oc.Consumer._context=oc,oc);var oc,rc;tc.Provider=nc.Provider,tc.Consumer=nc.Consumer;const lc=()=>{const e=[],t=function(t){Is(`${Ss}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return fi(e,((e,r)=>{if(gi.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return fi(e,(e=>e.pause(...arguments))),this},t.resume=function(){return fi(e,(e=>e.resume(...arguments))),this},t.set=function(t){fi(e,(e=>e.set(t)))},t.start=function(t){const n=[];return fi(e,((e,o)=>{if(gi.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return fi(e,(e=>e.stop(...arguments))),this},t.update=function(t){return fi(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return gi.fun(e)?e(n,t):e};return t._getProps=n,t};function ic(e,t,n){const o=gi.fun(t)&&t;o&&!n&&(n=[]);const r=(0,di.useMemo)((()=>o||3==arguments.length?lc():void 0),[]),l=(0,di.useRef)(0),i=Ns(),s=(0,di.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Ya(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ka(e,t):new Promise((o=>{Za(e,n),s.queue.push((()=>{o(Ka(e,t))})),i()}))}})),[]),a=(0,di.useRef)([...s.ctrls]),c=[],u=Rs(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new ja(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=za(n))}}(0,di.useMemo)((()=>{fi(a.current.slice(e,u),(e=>{ua(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,di.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Ya(e,c[t]))),m=(0,di.useContext)(tc),g=Rs(m),h=m!==g&&aa(m);Ts((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],fi(e,(e=>e()))),fi(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(da(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Ps((()=>()=>{fi(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>Qs({},e)));return r?[f,r]:f}let sc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(sc||(sc={}));class ac extends xa{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=ts(...t);const n=this._get(),o=$s(n);Ds(this,o.create(n))}advance(e){const t=this._get();hi(t,this.get())||(As(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&uc(this._active)&&dc(this)}_get(){const e=gi.arr(this.source)?this.source.map(is):bi(is(this.source));return this.calc(...e)}_start(){this.idle&&!uc(this._active)&&(this.idle=!1,fi(Os(this),(e=>{e.done=!1})),Ii.skipAnimation?(ql.batchedUpdates((()=>this.advance())),dc(this)):Li.start(this))}_attach(){let e=1;fi(bi(this.source),(t=>{ls(t)&&ds(t,this),Ba(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){fi(bi(this.source),(e=>{ls(e)&&ps(e,this)})),this._active.clear(),dc(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=bi(this.source).reduce(((e,t)=>Math.max(e,(Ba(t)?t.priority:0)+1)),0))}}function cc(e){return!1!==e.idle}function uc(e){return!e.size||Array.from(e).every(cc)}function dc(e){e.idle||(e.idle=!0,fi(Os(e),(e=>{e.done=!0})),as(e,{type:"idle",parent:e}))}Ii.assign({createStringInterpolator:Cs,to:(e,t)=>new ac(e,t)}),Li.advance;const pc=window.ReactDOM;function mc(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const gc=["style","children","scrollTop","scrollLeft"],hc=/^--/;function fc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||hc.test(e)||bc.hasOwnProperty(e)&&bc[e]?(""+t).trim():t+"px"}const vc={};let bc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const kc=["Webkit","Ms","Moz","O"];bc=Object.keys(bc).reduce(((e,t)=>(kc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),bc);const _c=["x","y","z"],yc=/^(matrix|translate|scale|rotate|skew)/,Ec=/^(translate)/,Cc=/^(rotate|skew)/,Sc=(e,t)=>gi.num(e)&&0!==e?e+t:e,wc=(e,t)=>gi.arr(e)?e.every((e=>wc(e,t))):gi.num(e)?e===t:parseFloat(e)===t;class Bc extends Gs{constructor(e){let{x:t,y:n,z:o}=e,r=mc(e,_c);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Sc(e,"px"))).join(",")})`,wc(e,0)]))),vi(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(yc.test(t)){if(delete r[t],gi.und(e))return;const n=Ec.test(t)?"px":Cc.test(t)?"deg":"";l.push(bi(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Sc(r,n)})`,wc(r,0)]:e=>[`${t}(${e.map((e=>Sc(e,n))).join(",")})`,wc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Ic(l,i)),super(r)}}class Ic extends cs{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return fi(this.inputs,((n,o)=>{const r=is(n[0]),[l,i]=this.transforms[o](gi.arr(r)?r:n.map(is));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&fi(this.inputs,(e=>fi(e,(e=>ls(e)&&ds(e,this)))))}observerRemoved(e){0==e&&fi(this.inputs,(e=>fi(e,(e=>ls(e)&&ps(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),as(this,e)}}const xc=["scrollTop","scrollLeft"];Ii.assign({batchedUpdates:pc.unstable_batchedUpdates,createStringInterpolator:Cs,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const Tc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new Gs(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=Zs(e)||"Anonymous";return(e=gi.str(e)?l[e]||(l[e]=Ks(e,r)):e[Ys]||(e[Ys]=Ks(e,r))).displayName=`Animated(${t})`,e};return vi(e,((t,n)=>{gi.arr(e)&&(n=Zs(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=mc(o,gc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:vc[t]||(vc[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=fc(t,r[t]);hc.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new Bc(e),getComponentProps:e=>mc(e,xc)}).animated,Nc=e=>e+1,Pc=e=>({top:e.offsetTop,left:e.offsetLeft}),Lc=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(Nc,0),[u,p]=(0,s.useReducer)(Nc,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?Pc(l.current):null),[r]),f=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Il.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",f()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();l.current.style.transform="";const e=Pc(l.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=gi.fun(e),[[o],r]=ic(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l},Rc=".block-editor-block-list__block",Mc=".block-list-appender",Ac=".block-editor-button-block-appender";function Dc(e,t){return t.closest([Rc,Mc,Ac].join(","))===e}function Oc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(Rc);return t?t.id.slice("block-".length):void 0}function Fc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(to);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(to);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(t.current.contains(l.activeElement))return;const i=Il.focus.tabbable.find(t.current).filter((e=>(0,Il.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(Dc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Il.focus.tabbable.findNext(t.current);if(e&&Dc(t.current,e)&&(0,Il.isFormElement)(e))return void e.focus()}(0,Il.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function zc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function Vc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(to);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",zc),t.addEventListener("mouseover",zc),()=>{t.removeEventListener("mouseout",zc),t.removeEventListener("mouseover",zc),t.classList.remove("is-hovered")}}),[e])}function Hc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p}=t(to),{outlineMode:m}=a(),g=n(e),h=l(e),f=s(e),v=u(e,!0),b=i(e);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":b,"is-partially-selected":b&&!p(),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(f)),"is-dragging":g,"has-child-selected":v,"remove-outline":h&&m&&d()})}),[e])}function Gc(e){return(0,m.useSelect)((t=>{const n=t(to).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function Uc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(to),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function Wc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(to);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function $c(e){const{isBlockSelected:t}=(0,m.useSelect)(to),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):Dc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}const jc=window.wp.keycodes;function Kc(e){const t=(0,m.useSelect)((t=>t(to).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(to),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==jc.ENTER&&s!==jc.BACKSPACE&&s!==jc.DELETE||a!==i||(0,Il.isTextField)(a)||(t.preventDefault(),s===jc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function qc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(to),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function Yc(){const e=(0,s.useContext)(uh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function Zc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:l,wrapperProps:i={},isAligned:a}=(0,s.useContext)(Qc),{index:u,mode:p,name:g,blockApiVersion:f,blockTitle:v,isPartOfSelection:b,adjustScrolling:k,enableAnimation:_}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(to),p=a(o),m=c(o)||u(o),g=l(o),h=(0,r.getBlockType)(g);return{index:t(o),mode:n(o),name:g,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(o),enableAnimation:!i()&&s()<=200}}),[o]),y=(0,h.sprintf)((0,h.__)("Block: %s"),v),E="html"!==p||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,Fc(o),Co(o),$c(o),Kc(o),qc(o),Vc(),Yc(),Lc({isSelected:b,adjustScrolling:k,enableAnimation:_,triggerAnimationOnChange:u}),(0,d.useDisabled)({isDisabled:!n})]),S=lo();return f<2&&o===S.clientId&&"undefined"!=typeof process&&process.env,{...i,...e,ref:C,id:`block-${o}${E}`,tabIndex:0,role:"document","aria-label":y,"data-block":o,"data-type":g,"data-title":v,className:c()(c()("block-editor-block-list__block",{"wp-block":!a}),l,e.className,i.className,Hc(o),Gc(o),Uc(o),Wc(o)),style:{...i.style,...e.style}}}Zc.save=r.__unstableGetBlockProps;const Qc=(0,s.createContext)();function Xc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",Zc(o,{__unstableIsHtml:n}),t)}const Jc=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(to),d=a(n),p=r(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),eu=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(to);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(to),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(to),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n,rootClientId:l}=t,{getPreviousBlockClientId:i,getNextBlockClientId:c,getBlock:u}=o(to);if(e){const e=c(n);e&&s(n,e)}else{const e=i(n);if(e)s(e,n);else if(l){const e=(0,r.switchToBlockType)(u(l),"*");e&&e.length&&a(l,e,0)}}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}})),tu=(0,d.compose)(d.pure,Jc,eu,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:g,name:h,isValid:f,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(to),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(Rl,{name:h,isSelected:d,attributes:v,setAttributes:k,insertBlocksAfter:l?void 0:y,onReplace:i?_:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(h);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),f)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(Xc,{isHtml:!0},(0,s.createElement)(jl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(Xc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(Xc,{className:"has-warning"},(0,s.createElement)(Vl,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Il.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(g,`align${b["data-align"]}`):g,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},L=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Qc.Provider,{value:L},(0,s.createElement)(Wl,{fallback:(0,s.createElement)(Xc,{className:"has-warning"},(0,s.createElement)(Gl,null))},N))})),nu=window.wp.htmlEntities,ou=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),ru=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")],lu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*ru.length));return(0,s.createElement)(p.Tip,null,ru[e])},iu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),su=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:iu});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),au=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(su,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))},cu=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(Jn,eo),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider"),uu=()=>{};function du(e){let{clientId:t=null,value:n,selection:o,onChange:l=uu,onInput:i=uu}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:g,__unstableMarkNextChangeAsNotPersistent:h}=a.dispatch(to),{getBlockName:f,getBlocks:v}=a.select(to),b=(0,m.useSelect)((e=>!t||e(to).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{g(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),h(),p(t,e)})):(_.current&&(k.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{k.current.outgoing.includes(n)?(0,u.last)(k.current.outgoing)===n&&(k.current.outgoing=[]):v(t)!==n&&(k.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(k.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(to);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===f(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(k.current.incoming||l()))return k.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,k.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}const pu=cu((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o(n)}),[n]),du(e),(0,s.createElement)(Eo,null,t)}));function mu(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)(ph,null)))}function gu(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(to),{clearSelectedBlock:n}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function hu(e){return(0,s.createElement)("div",i({ref:gu()},e))}function fu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(to);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function vu(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(fu,[]);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,s.getSelection().removeAllRanges(),r.focus())}),[o,t,n,r,e,l])}function bu(e,t,n,o){let r,l=Il.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(!Il.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function ku(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,m.useSelect)(to),{selectBlock:l}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===jc.UP,p=c===jc.DOWN,m=c===jc.LEFT,g=c===jc.RIGHT,h=d||m,f=m||g,v=d||p,b=f||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?Il.isVerticalEdge:Il.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(o()){if(!r())return;if(a.defaultPrevented)return;if(!b)return;if(k)return;return a.preventDefault(),void(h?l(e()):l(t(),-1))}if(v?s||(s=(0,Il.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===jc.UP||t===jc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(u,c,_))return;const S=(0,Il.isRTL)(u)?!h:h,{keepCaretInsideBlock:w}=n();if(k)(function(e,t){const n=bu(e,t,i);return n&&Oc(n)})(u,h)&&y(u,h)&&(i.contentEditable=!0,i.focus());else if(v&&(0,Il.isVerticalEdge)(u,h)&&!w){const e=bu(u,h,i,!0);e&&((0,Il.placeCaretAtVerticalEdge)(e,h,s),a.preventDefault())}else if(f&&C.getSelection().isCollapsed&&(0,Il.isHorizontalEdge)(u,S)&&!w){const e=bu(u,S,i);(0,Il.placeCaretAtHorizontalEdge)(e,h),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const _u=window.wp.keyboardShortcuts;function yu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(to),{multiSelect:o,selectBlock:r}=(0,m.useDispatch)(to),l=(0,_u.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((i=>{function s(i){if(!l("core/block-editor/select-all",i))return;const s=t();if(s.length<2&&!(0,Il.isEntirelySelected)(i.target))return;const[a]=s,c=n(a);let d=e(c);s.length===d.length&&(d=e(n(c)));const p=(0,u.first)(d),m=(0,u.last)(d);p!==m?(o(p,m),i.preventDefault()):r(p)}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function Eu(e,t){e.contentEditable=t,t&&e.focus()}function Cu(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(to),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,m.useSelect)(to);return(0,d.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;Eu(l,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),Eu(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function Su(e,t){e.contentEditable=t,t&&e.focus()}function wu(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(to),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(to);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return;const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void Su(n,!1);let c=Oc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(s)),u=Oc(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(s));if(a){const e=r(),t=Oc(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else Su(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function Bu(){const{selectBlock:e}=(0,m.useDispatch)(to),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(to);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=Oc(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Iu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(to),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===jc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===jc.BACKSPACE||d.keyCode===jc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===jc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===jc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function xu(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(to),{setNavigationMode:a}=(0,m.useDispatch)(to),c=(0,m.useSelect)((e=>e(to).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Il.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===jc.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==jc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Il.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Il.isFormElement)(Il.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==jc.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=Il.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,m.useSelect)((e=>e(to).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Iu(),Cu(),wu(),Bu(),vu(),yu(),ku(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}const Tu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=xu();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)})),Nu="editor-styles-wrapper";function Pu(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const Lu=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[g,f]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Pu(null==a?void 0:a.styles),_=Pu(null==a?void 0:a.scripts),y=gu(),[E,C,S]=xu(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),f(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{_.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]),x=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(`.${Nu}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),k.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),g&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Nu,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:g},o))),g.documentElement)),l>=0&&S)}));var Ru={grad:.9,turn:360,rad:360/(2*Math.PI)},Mu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},Au=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},Du=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},Ou=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},Fu=function(e){return{r:Du(e.r,0,255),g:Du(e.g,0,255),b:Du(e.b,0,255),a:Du(e.a)}},zu=function(e){return{r:Au(e.r),g:Au(e.g),b:Au(e.b),a:Au(e.a,3)}},Vu=/^#([0-9a-f]{3,8})$/i,Hu=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},Gu=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},Uu=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},Wu=function(e){return{h:Ou(e.h),s:Du(e.s,0,100),l:Du(e.l,0,100),a:Du(e.a)}},$u=function(e){return{h:Au(e.h),s:Au(e.s),l:Au(e.l),a:Au(e.a,3)}},ju=function(e){return Uu((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},Ku=function(e){return{h:(t=Gu(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},qu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Yu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Zu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Qu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xu={string:[[function(e){var t=Vu.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?Au(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?Au(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=Zu.exec(e)||Qu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:Fu({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=qu.exec(e)||Yu.exec(e);if(!t)return null;var n,o,r=Wu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Ru[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ju(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return Mu(t)&&Mu(n)&&Mu(o)?Fu({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!Mu(t)||!Mu(n)||!Mu(o))return null;var i=Wu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ju(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!Mu(t)||!Mu(n)||!Mu(o))return null;var i=function(e){return{h:Ou(e.h),s:Du(e.s,0,100),v:Du(e.v,0,100),a:Du(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return Uu(i)},"hsv"]]},Ju=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},ed=function(e,t){var n=Ku(e);return{h:n.h,s:Du(n.s+100*t,0,100),l:n.l,a:n.a}},td=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},nd=function(e,t){var n=Ku(e);return{h:n.h,s:n.s,l:Du(n.l+100*t,0,100),a:n.a}},od=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Ju(e.trim(),Xu.string):"object"==typeof e&&null!==e?Ju(e,Xu.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return Au(td(this.rgba),2)},e.prototype.isDark=function(){return td(this.rgba)<.5},e.prototype.isLight=function(){return td(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=zu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?Hu(Au(255*r)):"","#"+Hu(t)+Hu(n)+Hu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return zu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=zu(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return $u(Ku(this.rgba))},e.prototype.toHslString=function(){return t=(e=$u(Ku(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=Gu(this.rgba),{h:Au(e.h),s:Au(e.s),v:Au(e.v),a:Au(e.a,3)};var e},e.prototype.invert=function(){return rd({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),rd(ed(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),rd(ed(this.rgba,-e))},e.prototype.grayscale=function(){return rd(ed(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),rd(nd(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),rd(nd(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?rd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Au(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=Ku(this.rgba);return"number"==typeof e?rd({h:e,s:t.s,l:t.l,a:t.a}):Au(t.h)},e.prototype.isEqual=function(e){return this.toHex()===rd(e).toHex()},e}(),rd=function(e){return e instanceof od?e:new od(e)},ld=[],id=function(e){e.forEach((function(e){ld.indexOf(e)<0&&(e(od,Xu),ld.push(e))}))};function sd(e,t){var n={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"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var ad=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},cd=function(e){return.2126*ad(e.r)+.7152*ad(e.g)+.0722*ad(e.b)};function ud(e){e.prototype.luminance=function(){return e=cd(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=cd(l))>(a=cd(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var dd=n(3124),pd=n.n(dd);const md=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function gd(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return hd(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=hd(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(md,""),value:n?hd(n[0]).replace(md,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function k(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const _=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=g();for(;r=k();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=hd(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:hd(t[1]),media:hd(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=hd(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||_()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=hd(t[1]),o=hd(t[2]);if(!c())return a("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return fd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function hd(e){return e?e.replace(/^\s+|\s+$/g,""):""}function fd(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){fd(e,o)})):n&&"object"==typeof n&&fd(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var vd=n(8575),bd=n.n(vd);const kd=_d;function _d(e){this.options=e||{}}_d.prototype.emit=function(e){return e},_d.prototype.visit=function(e){return this[e.type](e)},_d.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};const yd=Ed;function Ed(e){kd.call(this,e)}bd()(Ed,kd),Ed.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Ed.prototype.comment=function(e){return this.emit("",e.position)},Ed.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Ed.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Ed.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Ed.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Ed.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Ed.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Ed.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Ed.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Ed.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Ed.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},Ed.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const Cd=Sd;function Sd(e){e=e||{},kd.call(this,e),this.indentation=e.indent}bd()(Sd,kd),Sd.prototype.compile=function(e){return this.stylesheet(e)},Sd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Sd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Sd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Sd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Sd.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Sd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Sd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Sd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Sd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},Sd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},Sd.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Sd.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},Sd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},Sd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Sd.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},Sd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Sd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const wd=function(e,t){try{const r=gd(e);return n=pd().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new yd(o):new Cd(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function Bd(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function Id(e,t){return new URL(e,t).toString()}const xd=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};Bd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Id(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t},Td=/^(body|html|:root).*$/,Nd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(Td)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Pd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Nd(t)),o&&r.push(xd(o)),r.length?wd(n,(0,d.compose)(r)):n}))},Ld=".editor-styles-wrapper";function Rd(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Ld);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=rd(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function Md(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Pd(t,Ld)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Rd(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function Ad(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=rd(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function Dd(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function Od(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function Fd(e){let{id:t,colors:n}=e;const o=Ad(n);return(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:t},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function zd(e){let{preset:t}=e;return(0,s.createElement)(Fd,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let Vd;id([sd,ud]);const Hd=2e3,Gd=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u,duotone:g}=(0,m.useSelect)((e=>{var t,n;const o=e(to).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),h=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]),f=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==g?void 0:g.default)&&void 0!==e?e:[],...null!==(t=null==g?void 0:g.theme)&&void 0!==t?t:[]]}),[g]);Vd=Vd||(0,d.pure)(ph);const v=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${v})`,height:a*v,maxHeight:a>Hd?Hd*v:void 0,minHeight:o}},(0,s.createElement)(Lu,{head:(0,s.createElement)(Md,{styles:h}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:a,pointerEvents:"none",maxHeight:Hd,minHeight:0!==v&&v<1&&o?o/v:o}},i,f.map((e=>(0,s.createElement)(zd,{preset:e,key:e.slug}))),(0,s.createElement)(Vd,{renderAppender:!1}))))},Ud=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,m.useSelect)((e=>e(to).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(pu,{value:d,settings:c},r?(0,s.createElement)(mu,{onClick:l}):(0,s.createElement)(Gd,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function Wd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(to).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(pu,{value:p,settings:a},(0,s.createElement)(gh,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?g:null}}const $d=function(e){var t;let{item:n}=e;const{name:o,title:l,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,r.isReusableBlock)(n);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(Ud,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,r.getBlockFromExample)(n.name,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,r.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(au,{title:l,icon:i,description:a}))},jd=(0,s.createContext)(),Kd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(jd);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))})),qd=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function Yd(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(su,{icon:n}):(0,h.sprintf)(
|
11 |
/* translators: %d: Number of blocks. */
|
12 |
-
(0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(
|
13 |
/* translators: %s: block pattern title. */
|
14 |
-
(0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function
|
15 |
-
(0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,
|
16 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
17 |
-
(0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const
|
18 |
/* translators: %d: number of results. */
|
19 |
-
(0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(
|
20 |
/* translators: %d: number of results. */
|
21 |
-
(0,h._n)("%d result found.","%d results found.",e),e);
|
22 |
/* translators: Blocks tab title in the block inserter. */
|
23 |
-
title:(0,h.__)("Blocks")},
|
24 |
/* translators: Patterns tab title in the block inserter. */
|
25 |
-
title:(0,h.__)("Patterns")}
|
26 |
/* translators: Reusable blocks tab title in the block inserter. */
|
27 |
-
title:(0,h.__)("Reusable")},
|
28 |
-
(0,h._x)("Add %s","directly add the only allowed block"),l):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:
|
29 |
-
(0,h.__)("%s block added"),a.title);(0,
|
30 |
-
(0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!m;let f=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Mr,{icon:ou}));return(g||m)&&(f=(0,s.createElement)(p.Tooltip,{text:n},f)),f},isAppender:!0})}const em=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Jp(e,t)))),tm=(0,s.forwardRef)(Jp),nm=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(to);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(Xp,{rootClientId:n}):(0,s.createElement)(tm,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));(0,s.createContext)();const om=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d,isVisible:g}=(0,m.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(to),s=l(t);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t]),f=wo(t),v=wo(n),b="vertical"===u,k=(0,s.useMemo)((()=>{if(!f&&!v||!g)return{};const e=f?f.getBoundingClientRect():null,t=v?v.getBoundingClientRect():null;if(b)return{width:f?f.offsetWidth:v.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:v.offsetHeight}}),[f,v,b]),_=(0,s.useCallback)((()=>{if(!f&&!v||!g)return{};const{ownerDocument:e}=f||v,t=f?f.getBoundingClientRect():null,n=v?v.getBoundingClientRect():null;return b?(0,h.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:(0,h.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}}),[f,v]),y=$o(l);return f&&v&&g?(0,s.createElement)(p.Popover,i({ref:y,animate:!1,getAnchorRect:_,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),__unstableForcePosition:!0}),(0,s.createElement)("div",{style:k},o)):null},rm=(0,s.createContext)();function lm(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(to),l=(0,s.useContext)(rm),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(to),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),k={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.4:0}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},_={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(om,{previousClientId:u,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(p.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:"block-editor-block-list__insertion-point-indicator"}),f&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Qp,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function im(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(to).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(rm.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(lm,n),t)}function sm(){const e=(0,s.useContext)(rm),t=(0,m.useSelect)((e=>e(to).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(to),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",g=t.target.getBoundingClientRect(),h=t.clientY-g.top,f=t.clientX-g.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>f));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const k=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>k.bottom||t.clientY<k.top)||"vertical"===m&&(t.clientX>k.right||t.clientX<k.left))return void(l()&&p());const _=r(b);0!==_?u(d,_,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const am="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,cm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function um(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(to),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description,anchor:null==c?void 0:c.anchor}:d}),[e])}function dm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:l,name:i,reusableBlockTitle:s}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(to),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),a=um(t);if(!i||!a)return null;const c=(0,r.getBlockType)(i),u=c?(0,r.__experimentalGetBlockLabel)(c,l,o):null,d=s||u,p=d&&d!==c.title?d:a.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function pm(e){let{clientId:t,maximumLength:n,context:o}=e;return dm({clientId:t,maximumLength:n,context:o})}const mm=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(to),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,Il.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(to);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const k={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:k,onDragStart:e=>{v(n),d.current=!0,g(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(Yd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},gm=function(e){let{clientId:t,rootClientId:n}=e;const o=um(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(to),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:a,name:u,attributes:d,blockMovingMode:g,orientation:f}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(to),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,f);(0,s.useEffect)((()=>{k.current.focus(),(0,Gt.speak)(y)}),[y]);const E=wo(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N}=(0,m.useSelect)(to),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:M}=(0,m.useDispatch)(to),A=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),D=(0,h.__)("Drag");return(0,s.createElement)("div",{className:A},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(su,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(mm,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:qd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:k,onClick:()=>v(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===jc.UP,r=n===jc.DOWN,l=n===jc.LEFT,i=n===jc.RIGHT,s=n===jc.TAB,a=n===jc.ESCAPE,c=n===jc.ENTER,u=n===jc.SPACE,d=e.shiftKey;if(n===jc.BACKSPACE||n===jc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),g=T(m||p),h=N(m||p),f=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(f)y=g;else if(v)y=h;else if(k){var A;y=null!==(A=w(p))&&void 0!==A?A:p}else if(_){var D;y=null!==(D=B([p])[0])&&void 0!==D?D:p}const O=C();if(a&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=w(O),t=w(p),n=S(O);let o=S(p);n<o&&e===t&&(o-=1),M(O,e,t,o),P(O),R(null)}if(v||f||k||_)if(y)e.preventDefault(),P(y);else if(s&&p){let t;if(v){t=E;do{t=Il.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=Il.focus.tabbable.findNext(t))}else t=Il.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),L())}},label:y,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(pm,{clientId:t,maximumLength:35})))))};function hm(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const fm=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!Il.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Il.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,_u.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=hm(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=hm(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},vm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),bm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),km=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),_m=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),ym=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const Em=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?vm:bm:km:"down"===e?"horizontal"===t?(0,h.isRTL)()?bm:vm:_m:null,Cm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,Sm=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const g=(0,d.useInstanceId)(Sm),f=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:k,isFirst:_,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(to),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),g=t(p),h=t((0,u.last)(d)),f=s(m),v=a(p),b=0===g,k=h===f.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:g,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(to),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${g}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Em(o,C),label:Cm(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,k),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(p.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=ym("down",l);if("down"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
31 |
(0,h.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
32 |
(0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
33 |
-
(0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=
|
34 |
(0,h.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
35 |
(0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
36 |
-
(0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=
|
37 |
-
(0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=
|
38 |
(0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
39 |
(0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
40 |
-
(0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=
|
41 |
(0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
42 |
(0,h.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
-
(0,h.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=
|
44 |
(0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
45 |
(0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
46 |
-
(0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=
|
47 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
48 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
49 |
-
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,
|
50 |
/* translators: %s: Name of the block's parent. */
|
51 |
-
(0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(
|
52 |
/* translators: %s: block title. */
|
53 |
-
(0,h.__)("%s: Change block type or style"),
|
54 |
/* translators: %d: number of blocks. */
|
55 |
-
(0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||k
|
56 |
(0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
57 |
(0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
|
58 |
(0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
|
59 |
-
(0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function
|
60 |
/* translators: %s: Name of the block. */
|
61 |
-
(0,h.__)("Lock %s"),
|
62 |
/* translators: %s: block name */
|
63 |
-
(0,h.__)("Remove %s"),B),T=1===c?x:(0,h.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=
|
64 |
/* translators: %s: Name of the block's parent. */
|
65 |
-
(0,h.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(
|
66 |
/* translators: %s: block name */
|
67 |
-
(0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(
|
68 |
-
/* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(Gg,{hideDragHandle:n}))};function Wg(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(to);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function $g(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:g,lastClientId:h}=(0,m.useSelect)(Wg,[]),f=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(to);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),v=(0,d.useViewportMatch)("medium"),b=(0,s.useRef)(!1),{stopTyping:k}=(0,m.useDispatch)(to),_=a,y=!a&&!g&&v&&!u&&!(!p&&!a&&o)&&!p,E=!(a||y||g||o);(0,_u.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,k(!0)}),{isDisabled:!E}),(0,s.useEffect)((()=>{b.current=!1}));const C=(0,s.useRef)();return _||y?(0,s.createElement)(jo,{clientId:r||t,bottomClientId:h,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":f}),__unstablePopoverSlot:l,__unstableContentRef:i},y&&(0,s.createElement)(Ug,{focusOnMount:b.current,__experimentalInitialIndex:C.current,__experimentalOnIndexChange:e=>{C.current=e},key:t}),_&&(0,s.createElement)(gm,{clientId:t,rootClientId:n})):null}function jg(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(to),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Kg(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(jg,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)($g,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function qg(e){let{children:t}=e;const n=(0,s.useContext)(rm),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(im,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Kg,{__unstablePopoverSlot:"block-toolbar"}),t))}const Yg=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=lo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Zg=Yg((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(tm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Qg=(0,d.compose)([Yg,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(to),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(Xp,{rootClientId:t})})),Xg=new WeakMap;function Jg(e,t){const n=(0,m.useSelect)((e=>e(to).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(to),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(to),d=function(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),g=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,Il.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?g(n):t.length?p(t):d(e)}}function eh(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function th(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=eh(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function nh(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=th(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function oh(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(to);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(to),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(to),a=Jg(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=nh(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function rh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(to),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(to).getBlockRootClientId(e);return{blockListSettings:t(to).getBlockListSettings(e),parentLock:t(to).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=Jr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Wo()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(to),{replaceInnerBlocks:i}=(0,m.useDispatch)(to),a=(0,m.useSelect)((t=>t(to).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const k=(0,m.useSelect)((e=>{const n=e(to).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Xg.has(t)||Xg.set(t,new WeakMap);const n=Xg.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(Tl,{value:k},(0,s.createElement)(gh,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function lh(e){return du(e),(0,s.createElement)(rh,e)}const ih=(0,s.forwardRef)(((e,t)=>{const n=sh({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function sh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=lo(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(to),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,oh({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},g=p.value&&p.onChange?lh:rh;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},p,{clientId:n})):(0,s.createElement)(gh,t)}}sh.save=r.__unstableGetInnerBlocksProps,ih.DefaultBlockAppender=Qg,ih.ButtonBlockAppender=Zg,ih.Content=()=>sh.save().children;const ah=ih,ch=(0,s.createContext)(),uh=(0,s.createContext)();function dh(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(to),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),{setBlockVisibility:p}=(0,m.useDispatch)(to),g=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;p(t)}))}),[]),h=sh({ref:(0,d.useMergeRefs)([gu(),sm(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(ch.Provider,{value:o},(0,s.createElement)(uh.Provider,{value:g},(0,s.createElement)("div",h)))}function ph(e){return function(){const e=(0,m.useSelect)((e=>e(to).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(to).__experimentalGetParsedPattern(e[n].name),t=am(o))};return t=am(o),()=>cm(t)}),[e])}(),(0,s.createElement)(qg,null,(0,s.createElement)(ro,{value:no},(0,s.createElement)(dh,e)))}function mh(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=el}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(to);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(nl,{value:l},i.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(tu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(nm,{tagName:r,rootClientId:n,renderAppender:o}))}function gh(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(mh,e))}function hh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function fh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=hh(o),i=0===r||r?`${r}${l}`:void 0;return i}function vh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=fh(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function bh(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function kh(e){let{onChange:t,values:n,...o}=e;const r=fh(n),l=bh(n)&&vh(n),a=l?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,h.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}ph.__unstableElementContext=ch;const _h={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function yh(e){let{onChange:t,values:n,...o}=e;const r="string"!=typeof n?n:{topLeft:n,topRight:n,bottomLeft:n,bottomRight:n};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(_h).map((e=>{let[n,l]=e;return(0,s.createElement)(p.Tooltip,{text:l,position:"top",key:n},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}))));var a})))}const Eh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),Ch=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function Sh(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?Eh:Ch,iconSize:16,"aria-label":o})))}const wh={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Bh={px:100,em:20,rem:20};function Ih(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!bh(n)||!vh(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["px","em","rem"]}),i=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e){const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t||"px"}return hh(Object.values(e).map((e=>{const[,t]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e);return t})))||"px"}(n),a=l&&l.find((e=>e.value===i)),c=(null==a?void 0:a.step)||1,[u]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(fh(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(p.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(kh,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Bh[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(yh,{min:0,onChange:t,values:n||wh,units:l}),(0,s.createElement)(Sh,{onClick:()=>r(!o),isLinked:o})))}function xh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Ih,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{let t={...n,border:{...null==n?void 0:n.border,radius:e}};void 0!==e&&""!==e||(t=Ro(t)),o({style:t})}})}id([sd,ud]);const Th=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Nh=(e,t)=>(0,u.find)(e,{color:t});function Ph(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function Lh(){return{disableCustomColors:!To("color.custom"),disableCustomGradients:!To("color.customGradient")}}function Rh(){const e=Lh(),t=To("color.palette.custom"),n=To("color.palette.theme"),o=To("color.palette.default"),r=To("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=To("color.gradients.custom"),i=To("color.gradients.theme"),a=To("color.gradients.default"),c=To("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const Mh="__experimentalBorder",Ah=["top","right","bottom","left"],Dh=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},Oh=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Fh=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Oh(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Oh(t,"color",o)||{color:o}};function zh(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function Vh(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Rh(),a=Hh(e.name),c=To("border.color")&&Hh(e.name,"color"),u=To("border.radius")&&Hh(e.name,"radius"),d=To("border.style")&&Hh(e.name,"style"),m=To("border.width")&&Hh(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[Mh,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=Fh({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Ah.forEach((e=>{var n;const o=zh(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Fh({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Go,{__experimentalGroup:"border"},(m||c)&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,p.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Ro({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:Dh,panelId:n},(0,s.createElement)(p.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,onChange:e=>{var t;let n,r={...e};if((0,p.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},Ah.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Fh({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(r[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=Fh({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Ro({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverPlacement:"left-start",popoverOffset:40,showStyle:d,value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Gh(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(xh,e)))}function Hh(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,Mh);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function Gh(e,t){return Ro({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Uh(e,t,n){if(!Hh(t,"color")||Do(t,Mh,"color"))return e;const o=Wh(n),r=c()(e.className,o);return e.className=r||void 0,e}function Wh(e){var t;const{borderColor:n,style:o}=e,r=Ph("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const $h=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=Rh();if(!Hh(m,"color")||Do(m,Mh,"color"))return(0,s.createElement)(e,t);const{color:b}=Fh({colors:v,namedColor:h}),{color:k}=Fh({colors:v,namedColor:zh(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=Fh({colors:v,namedColor:zh(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Fh({colors:v,namedColor:zh(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=Fh({colors:v,namedColor:zh(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:k||b,borderRightColor:_||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function jh(e){if(e)return`has-${e}-gradient-background`}function Kh(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function qh(e,t){return(0,u.find)(e,["gradient",t])}function Yh(e,t){const n=qh(e,t);return n&&n.slug}function Zh(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=lo(),o=To("color.gradients.custom"),r=To("color.gradients.theme"),l=To("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(to),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(to),d=(0,s.useCallback)((o=>{const r=Yh(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=jh(a);let g;return g=a?Kh(i,a):c,{gradientClass:p,gradientValue:g,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return Hh(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Uh),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!Hh(e,"color")||Do(e,Mh,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Uh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",$h);const Qh=["colors","disableCustomColors","gradients","disableCustomGradients"],Xh={name:"color",title:"Solid",value:"color"},Jh={name:"gradient",title:"Gradient",value:"gradient"},ef=[Xh,Jh];function tf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:k}=e;const _=m&&(!(0,u.isEmpty)(t)||!o),y=g&&(!(0,u.isEmpty)(n)||!r);if(!_&&!y)return null;const E={[Xh.value]:(0,s.createElement)(p.ColorPalette,{value:h,onChange:y?e=>{m(e),g()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:k}),[Jh.value]:(0,s.createElement)(p.GradientPicker,{value:f,onChange:_?e=>{g(e),m()}:g,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v})},C=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},E[e]);return(0,s.createElement)(p.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},b&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),_&&y&&(0,s.createElement)(p.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:ef,initialTabName:f?Jh.value:!!_&&Xh.value},(e=>C(e.value))),!y&&C(Xh.value),!_&&C(Jh.value))))}function nf(e){const t={};return t.colors=To("color.palette"),t.gradients=To("color.gradients"),t.disableCustomColors=!To("color.custom"),t.disableCustomGradients=!To("color.customGradient"),(0,s.createElement)(tf,i({},t,e))}const of=function(e){return(0,u.every)(Qh,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(tf,e):(0,s.createElement)(nf,e)},rf=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},lf=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(p.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},sf=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(p.Button,i,(0,s.createElement)(lf,{colorValue:r,label:l}))};function af(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...m}=e;return d&&(t={placement:"left-start",offset:36,__unstableShift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(rf,i({key:c,setting:e},m),(0,s.createElement)(p.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:sf(f),renderContent:()=>(0,s.createElement)(p.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(of,h)))}))})))}id([sd,ud]);const cf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,g=c||r;if(!m&&!g)return null;const f=[{color:m,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=rd(d),b=v.alpha()<1,k=v.brightness(),_={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of f){if(!e.color)continue;const t=rd(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
69 |
(0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
70 |
-
(0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,
|
71 |
/* translators: 1: Font weight name. 2: Font style name. */
|
72 |
-
(0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return
|
73 |
(0,h.__)("Currently selected font appearance: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
|
74 |
(0,h.__)("Currently selected font style: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
|
75 |
-
(0,h.__)("Currently selected font weight: %s"),g.name):(0,h.__)("No selected font appearance"),options:m,value:g,onChange:e=>{let{selectedItem:n}=e;return t(n.style)},__nextUnconstrainedWidth:!0}))}const Pf=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px",...l}=e;const a=function(e){return void 0!==e&&""!==e}(t),c=a?t:"";o||V()("Bottom margin styles for wp.blockEditor.LineHeightControl",{since:"6.0",version:"6.4",hint:"Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version"});const u=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:u},(0,s.createElement)(p.__experimentalNumberControl,i({},l,{__unstableInputWidth:r,__unstableStateReducer:(e,t)=>{var n;const o=["insertText","insertFromPaste"].includes(null===(n=t.payload.event.nativeEvent)||void 0===n?void 0:n.inputType),r=((e,t)=>{if(a)return e;switch(`${e}`){case"0.1":return 1.6;case"0":return t?e:1.4;case"":return 1.5;default:return e}})(e.value,o);return{...e,value:r}},onChange:n,label:(0,h.__)("Line height"),placeholder:1.5,step:.1,value:c,min:0})))},Lf="typography.lineHeight";function Rf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Pf,{__unstableInputWidth:"100%",__nextHasNoMarginBottom:!0,value:null==n||null===(t=n.typography)||void 0===t?void 0:t.lineHeight,onChange:e=>{const t={...n,typography:{...null==n?void 0:n.typography,lineHeight:e}};o({style:Ro(t)})}})}function Mf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Lf)||t}const Af="typography.__experimentalFontStyle",Df="typography.__experimentalFontWeight";function Of(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Ff(e),i=!zf(e),a=null==o||null===(t=o.typography)||void 0===t?void 0:t.fontStyle,c=null==o||null===(n=o.typography)||void 0===n?void 0:n.fontWeight;return(0,s.createElement)(Nf,{onChange:e=>{r({style:Ro({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Ff(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Af),n=To("typography.fontStyle");return!t||!n}function zf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Df),n=To("typography.fontWeight");return!t||!n}function Vf(e){const t=Ff(e),n=zf(e);return t&&n}function Hf(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=To("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,h.__)("Default")},...o.map((e=>{let{fontFamily:t,name:n}=e;return{value:t,label:n||t}}))];return(0,s.createElement)(p.SelectControl,i({label:(0,h.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Gf="typography.__experimentalFontFamily";function Uf(e,t,n){if(!(0,r.hasBlockSupport)(t,Gf))return e;if(Do(t,yv,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(Vm())(e.className);o.add(`has-${(0,u.kebabCase)(null==n?void 0:n.fontFamily)}-font-family`);const l=o.value;return e.className=l||void 0,e}function Wf(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=To("typography.fontFamilies"),l=null===(t=(0,u.find)(r,(e=>{let{slug:t}=e;return o===t})))||void 0===t?void 0:t.fontFamily;return(0,s.createElement)(Hf,{className:"block-editor-hooks-font-family-control",fontFamilies:r,value:l,onChange:function(e){const t=(0,u.find)(r,(t=>{let{fontFamily:n}=t;return n===e}));n({fontFamily:null==t?void 0:t.slug})}})}function $f(e){let{name:t}=e;const n=To("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Gf)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Gf)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Uf),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Gf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Uf(o,e,n)},e}));const jf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function Kf(e,t){return(0,u.find)(e,{size:t})||{size:t}}function qf(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}const Yf=function(e){const t=To("typography.fontSizes"),n=!To("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))},Zf="typography.fontSize";function Qf(e,t,n){if(!(0,r.hasBlockSupport)(t,Zf))return e;if(Do(t,yv,"fontSize"))return e;const o=new(Vm())(e.className);o.add(qf(n.fontSize));const l=o.value;return e.className=l||void 0,e}function Xf(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=To("typography.fontSizes"),a=jf(i,o,null==r||null===(t=r.typography)||void 0===t?void 0:t.fontSize),c=(null==a?void 0:a.size)||(null==r||null===(n=r.typography)||void 0===n?void 0:n.fontSize)||o;return(0,s.createElement)(Yf,{onChange:e=>{const t=Kf(i,e).slug;l({style:Ro({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function Jf(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=To("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,Zf)||!n}const ev=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=To("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,Zf)||Do(i,yv,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=jf(l,a,null==c||null===(o=c.typography)||void 0===o?void 0:o.fontSize).size,p={...t,wrapperProps:{...u,style:{fontSize:d,...null==u?void 0:u.style}}};return(0,s.createElement)(e,p)}),"withFontSizeInlineStyles"),tv={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Zf)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",Qf),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Zf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Qf(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ev),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Ao({fontSize:(0,r.hasBlockSupport)(l,Zf)},tv,e,t,n,o)}));const nv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 18v1h10v-1H7zm5-2c1.5 0 2.6-.4 3.4-1.2.8-.8 1.1-2 1.1-3.5V5H15v5.8c0 1.2-.2 2.1-.6 2.8-.4.7-1.2 1-2.4 1s-2-.3-2.4-1c-.4-.7-.6-1.6-.6-2.8V5H7.5v6.2c0 1.5.4 2.7 1.1 3.5.8.9 1.9 1.3 3.4 1.3z"})),ov=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z"})),rv=[{name:(0,h.__)("Underline"),value:"underline",icon:nv},{name:(0,h.__)("Strikethrough"),value:"line-through",icon:ov}];function lv(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)(p.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},rv.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===t,onClick:()=>n(e.value===t?void 0:e.value),"aria-label":e.name})))))}const iv="typography.__experimentalTextDecoration";function sv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(lv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Ro({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function av(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,iv),n=To("typography.textDecoration");return t||!n}const cv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6.1 6.8L2.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H6.1zm-.8 6.8L7 8.9l1.7 4.7H5.3zm15.1-.7c-.4-.5-.9-.8-1.6-1 .4-.2.7-.5.8-.9.2-.4.3-.9.3-1.4 0-.9-.3-1.6-.8-2-.6-.5-1.3-.7-2.4-.7h-3.5V18h4.2c1.1 0 2-.3 2.6-.8.6-.6 1-1.4 1-2.4-.1-.8-.3-1.4-.6-1.9zm-5.7-4.7h1.8c.6 0 1.1.1 1.4.4.3.2.5.7.5 1.3 0 .6-.2 1.1-.5 1.3-.3.2-.8.4-1.4.4h-1.8V8.2zm4 8c-.4.3-.9.5-1.5.5h-2.6v-3.8h2.6c1.4 0 2 .6 2 1.9.1.6-.1 1-.5 1.4z"})),uv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 16.8c-.1-.1-.2-.3-.3-.5v-2.6c0-.9-.1-1.7-.3-2.2-.2-.5-.5-.9-.9-1.2-.4-.2-.9-.3-1.6-.3-.5 0-1 .1-1.5.2s-.9.3-1.2.6l.2 1.2c.4-.3.7-.4 1.1-.5.3-.1.7-.2 1-.2.6 0 1 .1 1.3.4.3.2.4.7.4 1.4-1.2 0-2.3.2-3.3.7s-1.4 1.1-1.4 2.1c0 .7.2 1.2.7 1.6.4.4 1 .6 1.8.6.9 0 1.7-.4 2.4-1.2.1.3.2.5.4.7.1.2.3.3.6.4.3.1.6.1 1.1.1h.1l.2-1.2h-.1c-.4.1-.6 0-.7-.1zM9.2 16c-.2.3-.5.6-.9.8-.3.1-.7.2-1.1.2-.4 0-.7-.1-.9-.3-.2-.2-.3-.5-.3-.9 0-.6.2-1 .7-1.3.5-.3 1.3-.4 2.5-.5v2zm10.6-3.9c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2s-.2 1.4-.6 2z"})),dv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7.1 6.8L3.1 18h1.6l1.1-3h4.3l1.1 3h1.6l-4-11.2H7.1zm-.8 6.8L8 8.9l1.7 4.7H6.3zm14.5-1.5c-.3-.6-.7-1.1-1.2-1.5-.6-.4-1.2-.6-1.9-.6-.5 0-.9.1-1.4.3-.4.2-.8.5-1.1.8V6h-1.4v12h1.3l.2-1c.2.4.6.6 1 .8.4.2.9.3 1.4.3.7 0 1.2-.2 1.8-.5.5-.4 1-.9 1.3-1.5.3-.6.5-1.3.5-2.1-.1-.6-.2-1.3-.5-1.9zm-1.7 4c-.4.5-.9.8-1.6.8s-1.2-.2-1.7-.7c-.4-.5-.7-1.2-.7-2.1 0-.9.2-1.6.7-2.1.4-.5 1-.7 1.7-.7s1.2.3 1.6.8c.4.5.6 1.2.6 2 .1.8-.2 1.4-.6 2z"})),pv=[{name:(0,h.__)("Uppercase"),value:"uppercase",icon:cv},{name:(0,h.__)("Lowercase"),value:"lowercase",icon:uv},{name:(0,h.__)("Capitalize"),value:"capitalize",icon:dv}];function mv(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)(p.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},pv.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:t===e.value,"aria-label":e.name,onClick:()=>n(t===e.value?void 0:e.value)})))))}const gv="typography.__experimentalTextTransform";function hv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(mv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Ro({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function fv(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,gv),n=To("typography.textTransform");return t||!n}function vv(e){let{value:t,onChange:n,__unstableInputWidth:o="60px",...r}=e;const l=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,i({},r,{label:(0,h.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:l,onChange:n}))}const bv="typography.__experimentalLetterSpacing";function kv(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(vv,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Ro({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function _v(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,bv),n=To("typography.letterSpacing");return t||!n}const yv="typography",Ev=[Lf,Zf,Af,Df,Gf,iv,gv,bv];function Cv(e){const{clientId:t}=e,n=$f(e),o=Jf(e),l=Vf(e),i=Mf(e),a=av(e),c=fv(e),u=_v(e),d=!Ff(e),m=!zf(e),g=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Vf(e),Jf(e),Mf(e),$f(e),av(e),fv(e),_v(e)];return t.filter(Boolean).length===t.length}(e),f=Sv(e.name);if(g||!f)return null;const v=(0,r.getBlockSupport)(e.name,[yv,"__experimentalDefaultControls"]),b=e=>t=>{var n;return{...t,style:{...t.style,typography:{...null===(n=t.style)||void 0===n?void 0:n.typography,[e]:void 0}}}};return(0,s.createElement)(Go,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,h.__)("Font family"),onDeselect:()=>function(e){let{setAttributes:t}=e;t({fontFamily:void 0})}(e),isShownByDefault:null==v?void 0:v.fontFamily,resetAllFilter:e=>({...e,fontFamily:void 0}),panelId:t},(0,s.createElement)(Wf,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t;const{fontSize:n,style:o}=e.attributes;return!!n||!(null==o||null===(t=o.typography)||void 0===t||!t.fontSize)}(e)
|
76 |
-
/* translators: Ensure translation is distinct from "Letter case" */,label:(0,h.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Ro({...o,typography:{...null==o?void 0:o.typography,fontSize:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontSize,resetAllFilter:e=>{var t;return{...e,fontSize:void 0,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontSize:void 0}}}},panelId:t},(0,s.createElement)(Xf,e)),!l&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t;const{fontStyle:n,fontWeight:o}=(null===(t=e.attributes.style)||void 0===t?void 0:t.typography)||{};return!!n||!!o}(e),label:Tf(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...o,typography:{...null==o?void 0:o.typography,fontStyle:void 0,fontWeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.fontAppearance,resetAllFilter:e=>{var t;return{...e,style:{...e.style,typography:{...null===(t=e.style)||void 0===t?void 0:t.typography,fontStyle:void 0,fontWeight:void 0}}}},panelId:t},(0,s.createElement)(Of,e)),!i&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.lineHeight)}(e),label:(0,h.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...o,typography:{...null==o?void 0:o.typography,lineHeight:void 0}})})}(e),isShownByDefault:null==v?void 0:v.lineHeight,resetAllFilter:b("lineHeight"),panelId:t},(0,s.createElement)(Rf,e)),!a&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textDecoration)}(e),label:(0,h.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...o,typography:{...null==o?void 0:o.typography,textDecoration:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textDecoration,resetAllFilter:b("textDecoration"),panelId:t},(0,s.createElement)(sv,e)),!c&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.textTransform)}(e)
|
77 |
-
/* translators: Ensure translation is distinct from "Font size" */,label:(0,h.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...o,typography:{...null==o?void 0:o.typography,textTransform:void 0}})})}(e),isShownByDefault:null==v?void 0:v.textTransform,resetAllFilter:b("textTransform"),panelId:t},(0,s.createElement)(hv,e)),!u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:"single-column",hasValue:()=>function(e){var t,n;return!(null===(t=e.attributes.style)||void 0===t||null===(n=t.typography)||void 0===n||!n.letterSpacing)}(e),label:(0,h.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Ro({...o,typography:{...null==o?void 0:o.typography,letterSpacing:void 0}})})}(e),isShownByDefault:null==v?void 0:v.letterSpacing,resetAllFilter:b("letterSpacing"),panelId:t},(0,s.createElement)(kv,e)))}const Sv=e=>Ev.some((t=>(0,r.hasBlockSupport)(e,t))),wv=[...Ev,Mh,pf,tr],Bv=e=>wv.some((t=>(0,r.hasBlockSupport)(e,t))),Iv="var:";function xv(e){var t;return null!=e&&null!==(t=e.startsWith)&&void 0!==t&&t.call(e,Iv)?`var(--wp--${e.slice(Iv.length).split("|").join("--")})`:e}function Tv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{if(r.__EXPERIMENTAL_STYLE_PROPERTY[o].rootOnly)return;const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(null==l?void 0:l[0])){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&"string"!=typeof s?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=xv(r))})):t.includes(l.join("."))||(n[o]=xv((0,u.get)(e,l))))}}));const o=Qr(e);return o.forEach((e=>{n[e.key]=e.value})),n}const Nv={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[pf],[`${yv}.__experimentalSkipSerialization`]:[yv],[`${tr}.__experimentalSkipSerialization`]:["spacing"]},Pv={...Nv,[`${tr}`]:["spacing.blockGap"]},Lv={gradients:"gradient"};function Rv(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Pv;if(!Bv(t))return e;let{style:l}=n;return Object.entries(o).forEach((e=>{let[n,o]=e;const i=(0,r.getBlockSupport)(t,n);!0===i&&(l=(0,u.omit)(l,o)),Array.isArray(i)&&i.forEach((e=>{const t=Lv[e]||e;l=(0,u.omit)(l,[[...o,t]])}))})),e.style={...Tv(l),...e.style},e}const Mv=(0,d.createHigherOrderComponent)((e=>t=>{const n=io();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Sf,t),(0,s.createElement)(Cv,t),(0,s.createElement)(Vh,t),(0,s.createElement)(rr,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Av=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=Do(t.name,pf,"link"),u=(0,s.useMemo)((()=>{var e;const n=null===(e=t.attributes.style)||void 0===e?void 0:e.elements,o=[];if(n&&Object.keys(n).length>0){var i;const e={...n,link:{...n.link,color:a||null===(i=n.link)||void 0===i?void 0:i.color}};for(const[t,n]of Object.entries(e)){const e=Zr(n,{selector:`.editor-styles-wrapper .${l} ${r.__EXPERIMENTAL_ELEMENTS[t]}`});e&&o.push(e)}}return o.length>0?o:void 0}),[null===(n=t.attributes.style)||void 0===n?void 0:n.elements]),p=(0,s.useContext)(ph.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,u&&p&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:u}}),p),(0,s.createElement)(e,i({},t,{className:null!==(o=t.attributes.style)&&void 0!==o&&o.elements?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Bv(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Rv),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Bv(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Rv(o,e,n,Nv)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Mv),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Av),(0,l.addFilter)("blocks.registerBlockType","core/settings/addAttribute",(function(e){var t,n;return n=e,(0,r.hasBlockSupport)(n,"__experimentalSettings",!1)?(null!=e&&null!==(t=e.attributes)&&void 0!==t&&t.settings||(e.attributes={...e.attributes,settings:{type:"object"}}),e):e}));const Dv=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),Ov=function(e){let t,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}=e;return t="unset"===i?(0,s.createElement)(p.ColorIndicator,{className:"block-editor-duotone-control__unset-indicator"}):i?(0,s.createElement)(p.DuotoneSwatch,{values:i}):(0,s.createElement)(Mr,{icon:Dv}),(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,h.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:o,"aria-haspopup":"true","aria-expanded":n,onKeyDown:e=>{n||e.keyCode!==jc.DOWN||(e.preventDefault(),o())},label:(0,h.__)("Apply duotone filter"),icon:t})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,h.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:n,duotonePalette:o,disableCustomColors:r,disableCustomDuotone:l,value:i,onChange:a}))})},Fv=[];function zv(e){let{selector:t,id:n,colors:o}=e;return"unset"===o?(0,s.createElement)(Od,{selector:t}):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Fd,{id:n,colors:o}),(0,s.createElement)(Dd,{id:n,selector:t}))}function Vv(e){let{presetSetting:t,defaultSetting:n}=e;const o=!To(n),r=To(`${t}.custom`)||Fv,l=To(`${t}.theme`)||Fv,i=To(`${t}.default`)||Fv;return(0,s.useMemo)((()=>[...r,...l,...o?Fv:i]),[o,r,l,i])}function Hv(e){var t;let{attributes:n,setAttributes:o}=e;const r=null==n?void 0:n.style,l=null==r||null===(t=r.color)||void 0===t?void 0:t.duotone,i=Vv({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Vv({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!To("color.custom"),u=!To("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Ov,{duotonePalette:i,colorPalette:a,disableCustomDuotone:u,disableCustomColors:c,value:l,onChange:e=>{const t={...r,color:{...null==r?void 0:r.color,duotone:e}};o({style:t})}}))}id([sd]);const Gv=(0,d.createHigherOrderComponent)((e=>t=>{const n=(0,r.hasBlockSupport)(t.name,"color.__experimentalDuotone");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Hv,t))}),"withDuotoneControls"),Uv=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,l;const a=(0,r.getBlockSupport)(t.name,"color.__experimentalDuotone"),u=null==t||null===(n=t.attributes)||void 0===n||null===(o=n.style)||void 0===o||null===(l=o.color)||void 0===l?void 0:l.duotone;if(!a||!u)return(0,s.createElement)(e,t);const p=`wp-duotone-${(0,d.useInstanceId)(e)}`,m=function(e,t){const n=e.split(","),o=t.split(","),r=[];return n.forEach((e=>{o.forEach((t=>{r.push(`${e.trim()} ${t.trim()}`)}))})),r.join(", ")}(`.editor-styles-wrapper .${p}`,a),g=c()(null==t?void 0:t.className,p),h=(0,s.useContext)(ph.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,h&&(0,s.createPortal)((0,s.createElement)(zv,{selector:m,id:p,colors:u}),h),(0,s.createElement)(e,i({},t,{className:g})))}),"withDuotoneStyles");(0,l.addFilter)("blocks.registerBlockType","core/editor/duotone/add-attributes",(function(e){return(0,r.hasBlockSupport)(e,"color.__experimentalDuotone")?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("editor.BlockEdit","core/editor/duotone/with-editor-controls",Gv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",Uv);const Wv="__experimentalLayout";function $v(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=To("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,Wv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:g=!0,default:f}=c;if(!d)return null;const v=!(!g||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||f||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Jr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Go,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Layout")},v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Inner blocks use full width"),checked:!k,onChange:()=>t({layout:{inherit:!k}})}),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},k?(0,h.__)("Nested blocks use theme content width with options for full and wide widths."):(0,h.__)("Nested blocks will fill the width of this container."))),!k&&u&&(0,s.createElement)(jv,{type:_,onChange:e=>t({layout:{type:e}})}),!k&&y&&(0,s.createElement)(y.inspectorControls,{layout:b,onChange:E,layoutBlockSupport:c}))),!k&&y&&(0,s.createElement)(y.toolBarControls,{layout:b,onChange:E,layoutBlockSupport:c}))}function jv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Xr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const Kv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,Wv)&&(0,s.createElement)($v,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),qv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,Wv),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return!!t().disableLayoutStyles})),p=l&&!a,g=(0,d.useInstanceId)(e),h=To("layout")||{},f=(0,s.useContext)(ph.__unstableElementContext),{layout:v}=o,{default:b}=(0,r.getBlockSupport)(n,Wv)||{},k=null!=v&&v.inherit?h:v||b||{},_=l?function(e,t){var n;const o=(0,m.useSelect)((e=>{var t;const{getSettings:n}=e(to);return null===(t=n().__experimentalFeatures)||void 0===t?void 0:t.useRootPaddingAwareAlignments}),[]),r=[];var l;return null!=t&&null!==(n=t[(null==e?void 0:e.type)||"default"])&&void 0!==n&&n.className&&r.push(null==t||null===(l=t[(null==e?void 0:e.type)||"default"])||void 0===l?void 0:l.className),(null!=e&&e.inherit||null!=e&&e.contentSize)&&o&&r.push("has-global-padding"),null!=e&&e.orientation&&r.push(`is-${(0,u.kebabCase)(e.orientation)}`),null!=e&&e.justifyContent&&r.push(`is-content-justification-${(0,u.kebabCase)(e.justifyContent)}`),null!=e&&e.flexWrap&&"nowrap"===e.flexWrap&&r.push("is-nowrap"),r}(k,null==h?void 0:h.definitions):null,y=`.${(0,r.getBlockDefaultClassName)(n)}.wp-container-${g}`,E=null!==To("spacing.blockGap");let C;if(p){var S;const e=Jr((null==k?void 0:k.type)||"default");C=null==e||null===(S=e.getLayoutStyle)||void 0===S?void 0:S.call(e,{blockName:n,selector:y,layout:k,layoutDefinitions:null==h?void 0:h.definitions,style:null==o?void 0:o.style,hasBlockGapSupport:E})}const w=c()(null==t?void 0:t.className,{[`wp-container-${g}`]:p&&!!C},_);return(0,s.createElement)(s.Fragment,null,p&&f&&!!C&&(0,s.createPortal)((0,s.createElement)(rl,
|
1 |
+
(()=>{var e={6411:function(e,t){var n,o;void 0===(o="function"==typeof(n=function(e,t){"use strict";var n,o,r="function"==typeof Map?new Map:(n=[],o=[],{has:function(e){return n.indexOf(e)>-1},get:function(e){return o[n.indexOf(e)]},set:function(e,t){-1===n.indexOf(e)&&(n.push(e),o.push(t))},delete:function(e){var t=n.indexOf(e);t>-1&&(n.splice(t,1),o.splice(t,1))}}),l=function(e){return new Event(e,{bubbles:!0})};try{new Event("test")}catch(e){l=function(e){var t=document.createEvent("Event");return t.initEvent(e,!0,!1),t}}function i(e){if(e&&e.nodeName&&"TEXTAREA"===e.nodeName&&!r.has(e)){var t=null,n=null,o=null,i=function(){e.clientWidth!==n&&d()},s=function(t){window.removeEventListener("resize",i,!1),e.removeEventListener("input",d,!1),e.removeEventListener("keyup",d,!1),e.removeEventListener("autosize:destroy",s,!1),e.removeEventListener("autosize:update",d,!1),Object.keys(t).forEach((function(n){e.style[n]=t[n]})),r.delete(e)}.bind(e,{height:e.style.height,resize:e.style.resize,overflowY:e.style.overflowY,overflowX:e.style.overflowX,wordWrap:e.style.wordWrap});e.addEventListener("autosize:destroy",s,!1),"onpropertychange"in e&&"oninput"in e&&e.addEventListener("keyup",d,!1),window.addEventListener("resize",i,!1),e.addEventListener("input",d,!1),e.addEventListener("autosize:update",d,!1),e.style.overflowX="hidden",e.style.wordWrap="break-word",r.set(e,{destroy:s,update:d}),"vertical"===(a=window.getComputedStyle(e,null)).resize?e.style.resize="none":"both"===a.resize&&(e.style.resize="horizontal"),t="content-box"===a.boxSizing?-(parseFloat(a.paddingTop)+parseFloat(a.paddingBottom)):parseFloat(a.borderTopWidth)+parseFloat(a.borderBottomWidth),isNaN(t)&&(t=0),d()}var a;function c(t){var n=e.style.width;e.style.width="0px",e.offsetWidth,e.style.width=n,e.style.overflowY=t}function u(){if(0!==e.scrollHeight){var o=function(e){for(var t=[];e&&e.parentNode&&e.parentNode instanceof Element;)e.parentNode.scrollTop&&t.push({node:e.parentNode,scrollTop:e.parentNode.scrollTop}),e=e.parentNode;return t}(e),r=document.documentElement&&document.documentElement.scrollTop;e.style.height="",e.style.height=e.scrollHeight+t+"px",n=e.clientWidth,o.forEach((function(e){e.node.scrollTop=e.scrollTop})),r&&(document.documentElement.scrollTop=r)}}function d(){u();var t=Math.round(parseFloat(e.style.height)),n=window.getComputedStyle(e,null),r="content-box"===n.boxSizing?Math.round(parseFloat(n.height)):e.offsetHeight;if(r<t?"hidden"===n.overflowY&&(c("scroll"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight):"hidden"!==n.overflowY&&(c("hidden"),u(),r="content-box"===n.boxSizing?Math.round(parseFloat(window.getComputedStyle(e,null).height)):e.offsetHeight),o!==r){o=r;var i=l("autosize:resized");try{e.dispatchEvent(i)}catch(e){}}}}function s(e){var t=r.get(e);t&&t.destroy()}function a(e){var t=r.get(e);t&&t.update()}var c=null;"undefined"==typeof window||"function"!=typeof window.getComputedStyle?((c=function(e){return e}).destroy=function(e){return e},c.update=function(e){return e}):((c=function(e,t){return e&&Array.prototype.forEach.call(e.length?e:[e],(function(e){return i(e)})),e}).destroy=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],s),e},c.update=function(e){return e&&Array.prototype.forEach.call(e.length?e:[e],a),e}),t.default=c,e.exports=t.default})?n.apply(t,[e,t]):n)||(e.exports=o)},4403:(e,t)=>{var n;!function(){"use strict";var o={}.hasOwnProperty;function r(){for(var e=[],t=0;t<arguments.length;t++){var n=arguments[t];if(n){var l=typeof n;if("string"===l||"number"===l)e.push(n);else if(Array.isArray(n)){if(n.length){var i=r.apply(null,n);i&&e.push(i)}}else if("object"===l)if(n.toString===Object.prototype.toString)for(var s in n)o.call(n,s)&&n[s]&&e.push(s);else e.push(n.toString())}}return e.join(" ")}e.exports?(r.default=r,e.exports=r):void 0===(n=function(){return r}.apply(t,[]))||(e.exports=n)}()},4827:e=>{e.exports=function(e,t,n){return((n=window.getComputedStyle)?n(e):e.currentStyle)[t.replace(/-(\w)/gi,(function(e,t){return t.toUpperCase()}))]}},1198:(e,t)=>{"use strict";function n(){}function o(e,t,n,o,r){for(var l=0,i=t.length,s=0,a=0;l<i;l++){var c=t[l];if(c.removed){if(c.value=e.join(o.slice(a,a+c.count)),a+=c.count,l&&t[l-1].added){var u=t[l-1];t[l-1]=t[l],t[l]=u}}else{if(!c.added&&r){var d=n.slice(s,s+c.count);d=d.map((function(e,t){var n=o[a+t];return n.length>e.length?n:e})),c.value=e.join(d)}else c.value=e.join(n.slice(s,s+c.count));s+=c.count,c.added||(a+=c.count)}}var p=t[i-1];return i>1&&"string"==typeof p.value&&(p.added||p.removed)&&e.equals("",p.value)&&(t[i-2].value+=p.value,t.pop()),t}function r(e){return{newPos:e.newPos,components:e.components.slice(0)}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=n,n.prototype={diff:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=n.callback;"function"==typeof n&&(l=n,n={}),this.options=n;var i=this;function s(e){return l?(setTimeout((function(){l(void 0,e)}),0),!0):e}e=this.castInput(e),t=this.castInput(t),e=this.removeEmpty(this.tokenize(e));var a=(t=this.removeEmpty(this.tokenize(t))).length,c=e.length,u=1,d=a+c,p=[{newPos:-1,components:[]}],m=this.extractCommon(p[0],t,e,0);if(p[0].newPos+1>=a&&m+1>=c)return s([{value:this.join(t),count:t.length}]);function g(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],g=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var h=d&&d.newPos+1<a,f=m&&0<=g&&g<c;if(h||f){if(!h||f&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),g=i.extractCommon(l,t,e,n),l.newPos+1>=a&&g+1>=c)return s(o(i,l.components,t,e,i.useLongestToken));p[n]=l}else p[n]=void 0}u++}if(l)!function e(){setTimeout((function(){if(u>d)return l();g()||e()}),0)}();else for(;u<=d;){var h=g();if(h)return h}},pushComponent:function(e,t,n){var o=e[e.length-1];o&&o.added===t&&o.removed===n?e[e.length-1]={count:o.count+1,added:t,removed:n}:e.push({count:1,added:t,removed:n})},extractCommon:function(e,t,n,o){for(var r=t.length,l=n.length,i=e.newPos,s=i-o,a=0;i+1<r&&s+1<l&&this.equals(t[i+1],n[s+1]);)i++,s++,a++;return a&&e.components.push({count:a}),e.newPos=i,s},equals:function(e,t){return this.options.comparator?this.options.comparator(e,t):e===t||this.options.ignoreCase&&e.toLowerCase()===t.toLowerCase()},removeEmpty:function(e){for(var t=[],n=0;n<e.length;n++)e[n]&&t.push(e[n]);return t},castInput:function(e){return e},tokenize:function(e){return e.split("")},join:function(e){return e.join("")}}},1973:(e,t,n)=>{"use strict";var o;t.Kx=function(e,t,n){return r.diff(e,t,n)};var r=new(((o=n(1198))&&o.__esModule?o:{default:o}).default)},1345:(e,t,n)=>{"use strict";var o=n(5022);e.exports=function(e,t,n){n=n||{},9===t.nodeType&&(t=o.getWindow(t));var r=n.allowHorizontalScroll,l=n.onlyScrollIfNeeded,i=n.alignWithTop,s=n.alignWithLeft,a=n.offsetTop||0,c=n.offsetLeft||0,u=n.offsetBottom||0,d=n.offsetRight||0;r=void 0===r||r;var p=o.isWindow(t),m=!(!p||!t.frameElement),g=o.offset(e),h=o.outerHeight(e),f=o.outerWidth(e),v=void 0,b=void 0,_=void 0,k=void 0,y=void 0,E=void 0,C=void 0,S=void 0,w=void 0,B=void 0;m&&(t=t.document.scrollingElement||t.document.body),p||m?(C=t,B=o.height(C),w=o.width(C),S={left:o.scrollLeft(C),top:o.scrollTop(C)},y={left:g.left-S.left-c,top:g.top-S.top-a},E={left:g.left+f-(S.left+w)+d,top:g.top+h-(S.top+B)+u},k=S):(v=o.offset(t),b=t.clientHeight,_=t.clientWidth,k={left:t.scrollLeft,top:t.scrollTop},y={left:g.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:g.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:g.left+f-(v.left+_+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:g.top+h-(v.top+b+(parseFloat(o.css(t,"borderBottomWidth"))||0))+u}),y.top<0||E.top>0?!0===i?o.scrollTop(t,k.top+y.top):!1===i?o.scrollTop(t,k.top+E.top):y.top<0?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top):l||((i=void 0===i||!!i)?o.scrollTop(t,k.top+y.top):o.scrollTop(t,k.top+E.top)),r&&(y.left<0||E.left>0?!0===s?o.scrollLeft(t,k.left+y.left):!1===s?o.scrollLeft(t,k.left+E.left):y.left<0?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left):l||((s=void 0===s||!!s)?o.scrollLeft(t,k.left+y.left):o.scrollLeft(t,k.left+E.left)))}},5425:(e,t,n)=>{"use strict";e.exports=n(1345)},5022:e=>{"use strict";var t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol?"symbol":typeof e};function o(e,t){var n=e["page"+(t?"Y":"X")+"Offset"],o="scroll"+(t?"Top":"Left");if("number"!=typeof n){var r=e.document;"number"!=typeof(n=r.documentElement[o])&&(n=r.body[o])}return n}function r(e){return o(e)}function l(e){return o(e,!0)}function i(e){var t=function(e){var t,n=void 0,o=void 0,r=e.ownerDocument,l=r.body,i=r&&r.documentElement;return n=(t=e.getBoundingClientRect()).left,o=t.top,{left:n-=i.clientLeft||l.clientLeft||0,top:o-=i.clientTop||l.clientTop||0}}(e),n=e.ownerDocument,o=n.defaultView||n.parentWindow;return t.left+=r(o),t.top+=l(o),t}var s=new RegExp("^("+/[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source+")(?!px)[a-z%]+$","i"),a=/^(top|right|bottom|left)$/,c=void 0;function u(e,t){for(var n=0;n<e.length;n++)t(e[n])}function d(e){return"border-box"===c(e,"boxSizing")}"undefined"!=typeof window&&(c=window.getComputedStyle?function(e,t,n){var o="",r=e.ownerDocument,l=n||r.defaultView.getComputedStyle(e,null);return l&&(o=l.getPropertyValue(t)||l[t]),o}:function(e,t){var n=e.currentStyle&&e.currentStyle[t];if(s.test(n)&&!a.test(t)){var o=e.style,r=o.left,l=e.runtimeStyle.left;e.runtimeStyle.left=e.currentStyle.left,o.left="fontSize"===t?"1em":n||0,n=o.pixelLeft+"px",o.left=r,e.runtimeStyle.left=l}return""===n?"auto":n});var p=["margin","border","padding"];function m(e,t,n){var o={},r=e.style,l=void 0;for(l in t)t.hasOwnProperty(l)&&(o[l]=r[l],r[l]=t[l]);for(l in n.call(e),t)t.hasOwnProperty(l)&&(r[l]=o[l])}function g(e,t,n){var o=0,r=void 0,l=void 0,i=void 0;for(l=0;l<t.length;l++)if(r=t[l])for(i=0;i<n.length;i++){var s;s="border"===r?r+n[i]+"Width":r+n[i],o+=parseFloat(c(e,s))||0}return o}function h(e){return null!=e&&e==e.window}var f={};function v(e,t,n){if(h(e))return"width"===t?f.viewportWidth(e):f.viewportHeight(e);if(9===e.nodeType)return"width"===t?f.docWidth(e):f.docHeight(e);var o="width"===t?["Left","Right"]:["Top","Bottom"],r="width"===t?e.offsetWidth:e.offsetHeight,l=(c(e),d(e)),i=0;(null==r||r<=0)&&(r=void 0,(null==(i=c(e,t))||Number(i)<0)&&(i=e.style[t]||0),i=parseFloat(i)||0),void 0===n&&(n=l?1:-1);var s=void 0!==r||l,a=r||i;if(-1===n)return s?a-g(e,["border","padding"],o):i;if(s){var u=2===n?-g(e,["border"],o):g(e,["margin"],o);return a+(1===n?0:u)}return i+g(e,p.slice(n),o)}u(["Width","Height"],(function(e){f["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],f["viewport"+e](n))},f["viewport"+e]=function(t){var n="client"+e,o=t.document,r=o.body,l=o.documentElement[n];return"CSS1Compat"===o.compatMode&&l||r&&r[n]||l}}));var b={position:"absolute",visibility:"hidden",display:"block"};function _(e){var t=void 0,n=arguments;return 0!==e.offsetWidth?t=v.apply(void 0,n):m(e,b,(function(){t=v.apply(void 0,n)})),t}function k(e,t,o){var r=o;if("object"!==(void 0===t?"undefined":n(t)))return void 0!==r?("number"==typeof r&&(r+="px"),void(e.style[t]=r)):c(e,t);for(var l in t)t.hasOwnProperty(l)&&k(e,l,t[l])}u(["width","height"],(function(e){var t=e.charAt(0).toUpperCase()+e.slice(1);f["outer"+t]=function(t,n){return t&&_(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];f[e]=function(t,o){return void 0===o?t&&_(t,e,-1):t?(c(t),d(t)&&(o+=g(t,["padding","border"],n)),k(t,e,o)):void 0}})),e.exports=t({getWindow:function(e){var t=e.ownerDocument||e;return t.defaultView||t.parentWindow},offset:function(e,t){if(void 0===t)return i(e);!function(e,t){"static"===k(e,"position")&&(e.style.position="relative");var n=i(e),o={},r=void 0,l=void 0;for(l in t)t.hasOwnProperty(l)&&(r=parseFloat(k(e,l))||0,o[l]=r+t[l]-n[l]);k(e,o)}(e,t)},isWindow:h,each:u,css:k,clone:function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);if(e.overflow)for(var n in e)e.hasOwnProperty(n)&&(t.overflow[n]=e.overflow[n]);return t},scrollLeft:function(e,t){if(h(e)){if(void 0===t)return r(e);window.scrollTo(t,l(e))}else{if(void 0===t)return e.scrollLeft;e.scrollLeft=t}},scrollTop:function(e,t){if(h(e)){if(void 0===t)return l(e);window.scrollTo(r(e),t)}else{if(void 0===t)return e.scrollTop;e.scrollTop=t}},viewportWidth:0,viewportHeight:0},f)},8575:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},9894:(e,t,n)=>{var o=n(4827);e.exports=function(e){var t=o(e,"line-height"),n=parseFloat(t,10);if(t===n+""){var r=e.style.lineHeight;e.style.lineHeight=t+"em",t=o(e,"line-height"),n=parseFloat(t,10),r?e.style.lineHeight=r:delete e.style.lineHeight}if(-1!==t.indexOf("pt")?(n*=4,n/=3):-1!==t.indexOf("mm")?(n*=96,n/=25.4):-1!==t.indexOf("cm")?(n*=96,n/=2.54):-1!==t.indexOf("in")?n*=96:-1!==t.indexOf("pc")&&(n*=16),n=Math.round(n),"normal"===t){var l=e.nodeName,i=document.createElement(l);i.innerHTML=" ","TEXTAREA"===l.toUpperCase()&&i.setAttribute("rows","1");var s=o(e,"font-size");i.style.fontSize=s,i.style.padding="0px",i.style.border="0px";var a=document.body;a.appendChild(i),n=i.offsetHeight,a.removeChild(i)}return n}},5372:(e,t,n)=>{"use strict";var o=n(9567);function r(){}function l(){}l.resetWarningCache=r,e.exports=function(){function e(e,t,n,r,l,i){if(i!==o){var s=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw s.name="Invariant Violation",s}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:l,resetWarningCache:r};return n.PropTypes=n,n}},2652:(e,t,n)=>{e.exports=n(5372)()},9567:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},5438:function(e,t,n){"use strict";var o,r=this&&this.__extends||(o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function __(){this.constructor=e}o(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}),l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},i=this&&this.__rest||function(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(o=Object.getOwnPropertySymbols(e);r<o.length;r++)t.indexOf(o[r])<0&&(n[o[r]]=e[o[r]])}return n};t.__esModule=!0;var s=n(9196),a=n(2652),c=n(6411),u=n(9894),d="autosize:resized",p=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={lineHeight:null},t.textarea=null,t.onResize=function(e){t.props.onResize&&t.props.onResize(e)},t.updateLineHeight=function(){t.textarea&&t.setState({lineHeight:u(t.textarea)})},t.onChange=function(e){var n=t.props.onChange;t.currentValue=e.currentTarget.value,n&&n(e)},t}return r(t,e),t.prototype.componentDidMount=function(){var e=this,t=this.props,n=t.maxRows,o=t.async;"number"==typeof n&&this.updateLineHeight(),"number"==typeof n||o?setTimeout((function(){return e.textarea&&c(e.textarea)})):this.textarea&&c(this.textarea),this.textarea&&this.textarea.addEventListener(d,this.onResize)},t.prototype.componentWillUnmount=function(){this.textarea&&(this.textarea.removeEventListener(d,this.onResize),c.destroy(this.textarea))},t.prototype.render=function(){var e=this,t=this.props,n=(t.onResize,t.maxRows),o=(t.onChange,t.style),r=(t.innerRef,t.children),a=i(t,["onResize","maxRows","onChange","style","innerRef","children"]),c=this.state.lineHeight,u=n&&c?c*n:null;return s.createElement("textarea",l({},a,{onChange:this.onChange,style:u?l({},o,{maxHeight:u}):o,ref:function(t){e.textarea=t,"function"==typeof e.props.innerRef?e.props.innerRef(t):e.props.innerRef&&(e.props.innerRef.current=t)}}),r)},t.prototype.componentDidUpdate=function(){this.textarea&&c.update(this.textarea)},t.defaultProps={rows:1,async:!1},t.propTypes={rows:a.number,maxRows:a.number,onResize:a.func,innerRef:a.any,async:a.bool},t}(s.Component);t.TextareaAutosize=s.forwardRef((function(e,t){return s.createElement(p,l({},e,{innerRef:t}))}))},773:(e,t,n)=>{"use strict";var o=n(5438);t.Z=o.TextareaAutosize},4793:e=>{var t={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",Ấ:"A",Ắ:"A",Ẳ:"A",Ẵ:"A",Ặ:"A",Æ:"AE",Ầ:"A",Ằ:"A",Ȃ:"A",Ç:"C",Ḉ:"C",È:"E",É:"E",Ê:"E",Ë:"E",Ế:"E",Ḗ:"E",Ề:"E",Ḕ:"E",Ḝ:"E",Ȇ:"E",Ì:"I",Í:"I",Î:"I",Ï:"I",Ḯ:"I",Ȋ:"I",Ð:"D",Ñ:"N",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",Ố:"O",Ṍ:"O",Ṓ:"O",Ȏ:"O",Ù:"U",Ú:"U",Û:"U",Ü:"U",Ý:"Y",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",ấ:"a",ắ:"a",ẳ:"a",ẵ:"a",ặ:"a",æ:"ae",ầ:"a",ằ:"a",ȃ:"a",ç:"c",ḉ:"c",è:"e",é:"e",ê:"e",ë:"e",ế:"e",ḗ:"e",ề:"e",ḕ:"e",ḝ:"e",ȇ:"e",ì:"i",í:"i",î:"i",ï:"i",ḯ:"i",ȋ:"i",ð:"d",ñ:"n",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",ố:"o",ṍ:"o",ṓ:"o",ȏ:"o",ù:"u",ú:"u",û:"u",ü:"u",ý:"y",ÿ:"y",Ā:"A",ā:"a",Ă:"A",ă:"a",Ą:"A",ą:"a",Ć:"C",ć:"c",Ĉ:"C",ĉ:"c",Ċ:"C",ċ:"c",Č:"C",č:"c",C̆:"C",c̆:"c",Ď:"D",ď:"d",Đ:"D",đ:"d",Ē:"E",ē:"e",Ĕ:"E",ĕ:"e",Ė:"E",ė:"e",Ę:"E",ę:"e",Ě:"E",ě:"e",Ĝ:"G",Ǵ:"G",ĝ:"g",ǵ:"g",Ğ:"G",ğ:"g",Ġ:"G",ġ:"g",Ģ:"G",ģ:"g",Ĥ:"H",ĥ:"h",Ħ:"H",ħ:"h",Ḫ:"H",ḫ:"h",Ĩ:"I",ĩ:"i",Ī:"I",ī:"i",Ĭ:"I",ĭ:"i",Į:"I",į:"i",İ:"I",ı:"i",IJ:"IJ",ij:"ij",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",Ḱ:"K",ḱ:"k",K̆:"K",k̆:"k",Ĺ:"L",ĺ:"l",Ļ:"L",ļ:"l",Ľ:"L",ľ:"l",Ŀ:"L",ŀ:"l",Ł:"l",ł:"l",Ḿ:"M",ḿ:"m",M̆:"M",m̆:"m",Ń:"N",ń:"n",Ņ:"N",ņ:"n",Ň:"N",ň:"n",ʼn:"n",N̆:"N",n̆:"n",Ō:"O",ō:"o",Ŏ:"O",ŏ:"o",Ő:"O",ő:"o",Œ:"OE",œ:"oe",P̆:"P",p̆:"p",Ŕ:"R",ŕ:"r",Ŗ:"R",ŗ:"r",Ř:"R",ř:"r",R̆:"R",r̆:"r",Ȓ:"R",ȓ:"r",Ś:"S",ś:"s",Ŝ:"S",ŝ:"s",Ş:"S",Ș:"S",ș:"s",ş:"s",Š:"S",š:"s",Ţ:"T",ţ:"t",ț:"t",Ț:"T",Ť:"T",ť:"t",Ŧ:"T",ŧ:"t",T̆:"T",t̆:"t",Ũ:"U",ũ:"u",Ū:"U",ū:"u",Ŭ:"U",ŭ:"u",Ů:"U",ů:"u",Ű:"U",ű:"u",Ų:"U",ų:"u",Ȗ:"U",ȗ:"u",V̆:"V",v̆:"v",Ŵ:"W",ŵ:"w",Ẃ:"W",ẃ:"w",X̆:"X",x̆:"x",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Y̆:"Y",y̆:"y",Ź:"Z",ź:"z",Ż:"Z",ż:"z",Ž:"Z",ž:"z",ſ:"s",ƒ:"f",Ơ:"O",ơ:"o",Ư:"U",ư:"u",Ǎ:"A",ǎ:"a",Ǐ:"I",ǐ:"i",Ǒ:"O",ǒ:"o",Ǔ:"U",ǔ:"u",Ǖ:"U",ǖ:"u",Ǘ:"U",ǘ:"u",Ǚ:"U",ǚ:"u",Ǜ:"U",ǜ:"u",Ứ:"U",ứ:"u",Ṹ:"U",ṹ:"u",Ǻ:"A",ǻ:"a",Ǽ:"AE",ǽ:"ae",Ǿ:"O",ǿ:"o",Þ:"TH",þ:"th",Ṕ:"P",ṕ:"p",Ṥ:"S",ṥ:"s",X́:"X",x́:"x",Ѓ:"Г",ѓ:"г",Ќ:"К",ќ:"к",A̋:"A",a̋:"a",E̋:"E",e̋:"e",I̋:"I",i̋:"i",Ǹ:"N",ǹ:"n",Ồ:"O",ồ:"o",Ṑ:"O",ṑ:"o",Ừ:"U",ừ:"u",Ẁ:"W",ẁ:"w",Ỳ:"Y",ỳ:"y",Ȁ:"A",ȁ:"a",Ȅ:"E",ȅ:"e",Ȉ:"I",ȉ:"i",Ȍ:"O",ȍ:"o",Ȑ:"R",ȑ:"r",Ȕ:"U",ȕ:"u",B̌:"B",b̌:"b",Č̣:"C",č̣:"c",Ê̌:"E",ê̌:"e",F̌:"F",f̌:"f",Ǧ:"G",ǧ:"g",Ȟ:"H",ȟ:"h",J̌:"J",ǰ:"j",Ǩ:"K",ǩ:"k",M̌:"M",m̌:"m",P̌:"P",p̌:"p",Q̌:"Q",q̌:"q",Ř̩:"R",ř̩:"r",Ṧ:"S",ṧ:"s",V̌:"V",v̌:"v",W̌:"W",w̌:"w",X̌:"X",x̌:"x",Y̌:"Y",y̌:"y",A̧:"A",a̧:"a",B̧:"B",b̧:"b",Ḑ:"D",ḑ:"d",Ȩ:"E",ȩ:"e",Ɛ̧:"E",ɛ̧:"e",Ḩ:"H",ḩ:"h",I̧:"I",i̧:"i",Ɨ̧:"I",ɨ̧:"i",M̧:"M",m̧:"m",O̧:"O",o̧:"o",Q̧:"Q",q̧:"q",U̧:"U",u̧:"u",X̧:"X",x̧:"x",Z̧:"Z",z̧:"z"},n=Object.keys(t).join("|"),o=new RegExp(n,"g"),r=new RegExp(n,""),l=function(e){return e.replace(o,(function(e){return t[e]}))};e.exports=l,e.exports.has=function(e){return!!e.match(r)},e.exports.remove=l},3124:e=>{var t=e.exports=function(e){return new n(e)};function n(e){this.value=e}function o(e,t,n){var o=[],i=[],u=!0;return function e(d){var p=n?r(d):d,m={},g=!0,h={node:p,node_:d,path:[].concat(o),parent:i[i.length-1],parents:i,key:o.slice(-1)[0],isRoot:0===o.length,level:o.length,circular:null,update:function(e,t){h.isRoot||(h.parent.node[h.key]=e),h.node=e,t&&(g=!1)},delete:function(e){delete h.parent.node[h.key],e&&(g=!1)},remove:function(e){s(h.parent.node)?h.parent.node.splice(h.key,1):delete h.parent.node[h.key],e&&(g=!1)},keys:null,before:function(e){m.before=e},after:function(e){m.after=e},pre:function(e){m.pre=e},post:function(e){m.post=e},stop:function(){u=!1},block:function(){g=!1}};if(!u)return h;function f(){if("object"==typeof h.node&&null!==h.node){h.keys&&h.node_===h.node||(h.keys=l(h.node)),h.isLeaf=0==h.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){h.circular=i[e];break}}else h.isLeaf=!0,h.keys=null;h.notLeaf=!h.isLeaf,h.notRoot=!h.isRoot}f();var v=t.call(h,h.node);return void 0!==v&&h.update&&h.update(v),m.before&&m.before.call(h,h.node),g?("object"!=typeof h.node||null===h.node||h.circular||(i.push(h),f(),a(h.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(h,h.node[t],t);var l=e(h.node[t]);n&&c.call(h.node,t)&&(h.node[t]=l.node),l.isLast=r==h.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(h,l),o.pop()})),i.pop()),m.after&&m.after.call(h,h.node),h):h}(e).node}function r(e){if("object"==typeof e&&null!==e){var t;if(s(e))t=[];else if("[object Date]"===i(e))t=new Date(e.getTime?e.getTime():e);else if("[object RegExp]"===i(e))t=new RegExp(e);else if(function(e){return"[object Error]"===i(e)}(e))t={message:e.message};else if(function(e){return"[object Boolean]"===i(e)}(e))t=new Boolean(e);else if(function(e){return"[object Number]"===i(e)}(e))t=new Number(e);else if(function(e){return"[object String]"===i(e)}(e))t=new String(e);else if(Object.create&&Object.getPrototypeOf)t=Object.create(Object.getPrototypeOf(e));else if(e.constructor===Object)t={};else{var n=e.constructor&&e.constructor.prototype||e.__proto__||{},o=function(){};o.prototype=n,t=new o}return a(l(e),(function(n){t[n]=e[n]})),t}return e}n.prototype.get=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o)){t=void 0;break}t=t[o]}return t},n.prototype.has=function(e){for(var t=this.value,n=0;n<e.length;n++){var o=e[n];if(!t||!c.call(t,o))return!1;t=t[o]}return!0},n.prototype.set=function(e,t){for(var n=this.value,o=0;o<e.length-1;o++){var r=e[o];c.call(n,r)||(n[r]={}),n=n[r]}return n[e[o]]=t,t},n.prototype.map=function(e){return o(this.value,e,!0)},n.prototype.forEach=function(e){return this.value=o(this.value,e,!1),this.value},n.prototype.reduce=function(e,t){var n=1===arguments.length,o=n?this.value:t;return this.forEach((function(t){this.isRoot&&n||(o=e.call(this,o,t))})),o},n.prototype.paths=function(){var e=[];return this.forEach((function(t){e.push(this.path)})),e},n.prototype.nodes=function(){var e=[];return this.forEach((function(t){e.push(this.node)})),e},n.prototype.clone=function(){var e=[],t=[];return function n(o){for(var i=0;i<e.length;i++)if(e[i]===o)return t[i];if("object"==typeof o&&null!==o){var s=r(o);return e.push(o),t.push(s),a(l(o),(function(e){s[e]=n(o[e])})),e.pop(),t.pop(),s}return o}(this.value)};var l=Object.keys||function(e){var t=[];for(var n in e)t.push(n);return t};function i(e){return Object.prototype.toString.call(e)}var s=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},a=function(e,t){if(e.forEach)return e.forEach(t);for(var n=0;n<e.length;n++)t(e[n],n,e)};a(l(n.prototype),(function(e){t[e]=function(t){var o=[].slice.call(arguments,1),r=new n(t);return r[e].apply(r,o)}}));var c=Object.hasOwnProperty||function(e,t){return t in e}},9196:e=>{"use strict";e.exports=window.React}},t={};function n(o){var r=t[o];if(void 0!==r)return r.exports;var l=t[o]={exports:{}};return e[o].call(l.exports,l,l.exports,n),l.exports}n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var o in t)n.o(t,o)&&!n.o(e,o)&&Object.defineProperty(e,o,{enumerable:!0,get:t[o]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};(()=>{"use strict";n.r(o),n.d(o,{AlignmentControl:()=>Kb,AlignmentToolbar:()=>qb,Autocomplete:()=>r_,BlockAlignmentControl:()=>Ol,BlockAlignmentToolbar:()=>Fl,BlockBreadcrumb:()=>u_,BlockColorsStyleSelector:()=>h_,BlockContextProvider:()=>Ql,BlockControls:()=>po,BlockEdit:()=>ti,BlockEditorKeyboardShortcuts:()=>tC,BlockEditorProvider:()=>Mu,BlockFormatControls:()=>uo,BlockIcon:()=>Tu,BlockInspector:()=>ZE,BlockList:()=>$h,BlockMover:()=>og,BlockNavigationDropdown:()=>O_,BlockPreview:()=>dp,BlockSelectionClearer:()=>Ou,BlockSettingsMenu:()=>ch,BlockSettingsMenuControls:()=>rh,BlockStyles:()=>U_,BlockTitle:()=>Um,BlockToolbar:()=>bh,BlockTools:()=>QE,BlockVerticalAlignmentControl:()=>Vr,BlockVerticalAlignmentToolbar:()=>Hr,ButtonBlockAppender:()=>Pm,ButtonBlockerAppender:()=>Nm,ColorPalette:()=>lk,ColorPaletteControl:()=>ik,ContrastChecker:()=>Hf,CopyHandler:()=>zg,DefaultBlockAppender:()=>xm,FontSizePicker:()=>Iv,InnerBlocks:()=>Hh,Inserter:()=>Im,InspectorAdvancedControls:()=>Xo,InspectorControls:()=>Jo,JustifyContentControl:()=>Wr,JustifyToolbar:()=>$r,LineHeightControl:()=>cv,MediaPlaceholder:()=>Hy,MediaReplaceFlow:()=>Ay,MediaUpload:()=>Py,MediaUploadCheck:()=>Ly,MultiSelectScrollIntoView:()=>nC,NavigableToolbar:()=>jm,ObserveTyping:()=>iC,PanelColorSettings:()=>Uy,PlainText:()=>EE,RichText:()=>_E,RichTextShortcut:()=>wE,RichTextToolbarButton:()=>BE,SETTINGS_DEFAULTS:()=>v,SkipToSelectedBlock:()=>WE,ToolSelector:()=>TE,Typewriter:()=>uC,URLInput:()=>ny,URLInputButton:()=>RE,URLPopover:()=>Fy,Warning:()=>oi,WritingFlow:()=>Qu,__experimentalBlockAlignmentMatrixControl:()=>a_,__experimentalBlockFullHeightAligmentControl:()=>i_,__experimentalBlockPatternSetup:()=>ek,__experimentalBlockPatternsList:()=>Rp,__experimentalBlockVariationPicker:()=>W_,__experimentalBlockVariationTransforms:()=>ok,__experimentalBorderRadiusControl:()=>lf,__experimentalColorGradientControl:()=>Df,__experimentalColorGradientSettingsDropdown:()=>Vf,__experimentalDateFormatPicker:()=>ck,__experimentalDuotoneControl:()=>mb,__experimentalFontAppearanceControl:()=>av,__experimentalFontFamilyControl:()=>_v,__experimentalGetBorderClassesAndStyles:()=>wb,__experimentalGetColorClassesAndStyles:()=>Ib,__experimentalGetElementClassName:()=>bC,__experimentalGetGapCSSValue:()=>Pr,__experimentalGetGradientClass:()=>wf,__experimentalGetGradientObjectByGradientValue:()=>If,__experimentalGetMatchingVariation:()=>kC,__experimentalGetSpacingClassesAndStyles:()=>Nb,__experimentalImageEditingProvider:()=>Ak,__experimentalImageEditor:()=>$k,__experimentalImageSizeControl:()=>qk,__experimentalImageURLInputUI:()=>HE,__experimentalInspectorPopoverHeader:()=>hC,__experimentalLayoutStyle:()=>Bl,__experimentalLetterSpacingControl:()=>Yv,__experimentalLibrary:()=>JE,__experimentalLinkControl:()=>Iy,__experimentalLinkControlSearchInput:()=>by,__experimentalLinkControlSearchItem:()=>ly,__experimentalLinkControlSearchResults:()=>dy,__experimentalListView:()=>A_,__experimentalPanelColorGradientSettings:()=>hk,__experimentalPreviewOptions:()=>UE,__experimentalPublishDateTimePicker:()=>fC,__experimentalRecursionProvider:()=>pC,__experimentalResponsiveBlockControl:()=>SE,__experimentalSpacingSizesControl:()=>mr,__experimentalTextDecorationControl:()=>Ov,__experimentalTextTransformControl:()=>$v,__experimentalUnitControl:()=>NE,__experimentalUseBlockOverlayActive:()=>d_,__experimentalUseBlockPreview:()=>pp,__experimentalUseBorderProps:()=>Bb,__experimentalUseColorProps:()=>Tb,__experimentalUseCustomSides:()=>Ir,__experimentalUseGradient:()=>Tf,__experimentalUseHasRecursion:()=>mC,__experimentalUseMultipleOriginColorsAndGradients:()=>pf,__experimentalUseResizeCanvas:()=>GE,__unstableBlockNameContext:()=>vh,__unstableBlockSettingsMenuFirstItem:()=>jg,__unstableBlockToolbarLastItem:()=>Rg,__unstableDuotoneFilter:()=>ip,__unstableDuotoneStylesheet:()=>rp,__unstableDuotoneUnsetStylesheet:()=>lp,__unstableEditorStyles:()=>np,__unstableGetValuesFromColors:()=>op,__unstableIframe:()=>ed,__unstableInserterMenuExtension:()=>fm,__unstablePresetDuotoneFilter:()=>sp,__unstableRichTextInputEvent:()=>IE,__unstableUseBlockSelectionClearer:()=>Du,__unstableUseClipboardHandler:()=>Fg,__unstableUseMouseMoveTypingReset:()=>rC,__unstableUseTypewriter:()=>cC,__unstableUseTypingObserver:()=>lC,createCustomColorsHOC:()=>Db,getColorClassName:()=>uf,getColorObjectByAttributeValues:()=>af,getColorObjectByColorValue:()=>cf,getFontSize:()=>Sv,getFontSizeClass:()=>Bv,getFontSizeObjectByValue:()=>wv,getGradientSlugByValue:()=>xf,getGradientValueBySlug:()=>Bf,getPxFromCssUnit:()=>NC,store:()=>to,storeConfig:()=>eo,transformStyles:()=>Jd,useBlockDisplayInformation:()=>Vm,useBlockEditContext:()=>lo,useBlockProps:()=>bu,useCachedTruthy:()=>Pb,useInnerBlocksProps:()=>Vh,useSetting:()=>Vo,withColorContext:()=>rk,withColors:()=>Ob,withFontSizes:()=>Vb});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:()=>Ft,__experimentalGetAllowedBlocks:()=>bt,__experimentalGetAllowedPatterns:()=>Et,__experimentalGetBlockListSettingsForBlocks:()=>xt,__experimentalGetDirectInsertBlock:()=>_t,__experimentalGetGlobalBlocksByName:()=>ee,__experimentalGetLastBlockAttributeChanges:()=>Pt,__experimentalGetParsedPattern:()=>kt,__experimentalGetPatternTransformItems:()=>St,__experimentalGetPatternsByBlockTypes:()=>Ct,__experimentalGetReusableBlockTitle:()=>Tt,__unstableGetBlockWithoutInnerBlocks:()=>K,__unstableGetClientIdWithClientIdsTree:()=>Y,__unstableGetClientIdsTree:()=>Z,__unstableGetSelectedBlocksWithPartialSelection:()=>Re,__unstableGetVisibleBlocks:()=>Ht,__unstableIsFullySelected:()=>Ne,__unstableIsLastBlockChangeIgnored:()=>Nt,__unstableIsSelectionCollapsed:()=>Pe,__unstableIsSelectionMergeable:()=>Le,areInnerBlocksControlled:()=>Ot,canEditBlock:()=>at,canInsertBlockType:()=>nt,canInsertBlocks:()=>ot,canLockBlockType:()=>ct,canMoveBlock:()=>it,canMoveBlocks:()=>st,canRemoveBlock:()=>rt,canRemoveBlocks:()=>lt,didAutomaticChange:()=>At,getAdjacentBlockClientId:()=>fe,getBlock:()=>j,getBlockAttributes:()=>$,getBlockCount:()=>ne,getBlockHierarchyRootClientId:()=>ge,getBlockIndex:()=>Ae,getBlockInsertionPoint:()=>Ye,getBlockListSettings:()=>wt,getBlockMode:()=>Ue,getBlockName:()=>G,getBlockOrder:()=>Me,getBlockParents:()=>pe,getBlockParentsByBlockName:()=>me,getBlockRootClientId:()=>de,getBlockSelectionEnd:()=>ie,getBlockSelectionStart:()=>le,getBlockTransformItems:()=>ft,getBlocks:()=>q,getBlocksByClientId:()=>te,getClientIdsOfDescendants:()=>Q,getClientIdsWithDescendants:()=>X,getDraggedBlockClientIds:()=>$e,getFirstMultiSelectedBlockClientId:()=>Ce,getGlobalBlockCount:()=>J,getInserterItems:()=>ht,getLastMultiSelectedBlockClientId:()=>Se,getLowestCommonAncestorWithSelectedBlock:()=>he,getMultiSelectedBlockClientIds:()=>ye,getMultiSelectedBlocks:()=>Ee,getMultiSelectedBlocksEndClientId:()=>Te,getMultiSelectedBlocksStartClientId:()=>xe,getNextBlockClientId:()=>be,getPreviousBlockClientId:()=>ve,getSelectedBlock:()=>ue,getSelectedBlockClientId:()=>ce,getSelectedBlockClientIds:()=>ke,getSelectedBlockCount:()=>se,getSelectedBlocksInitialCaretPosition:()=>_e,getSelectionEnd:()=>re,getSelectionStart:()=>oe,getSettings:()=>Bt,getTemplate:()=>Xe,getTemplateLock:()=>Je,hasBlockMovingClientId:()=>Mt,hasInserterItems:()=>vt,hasMultiSelection:()=>ze,hasSelectedBlock:()=>ae,hasSelectedInnerBlock:()=>Oe,isAncestorBeingDragged:()=>Ke,isAncestorMultiSelected:()=>Ie,isBlockBeingDragged:()=>je,isBlockHighlighted:()=>Dt,isBlockInsertionPointVisible:()=>Ze,isBlockMultiSelected:()=>Be,isBlockSelected:()=>De,isBlockValid:()=>W,isBlockVisible:()=>Vt,isBlockWithinSelection:()=>Fe,isCaretWithinFormattedText:()=>qe,isDraggingBlocks:()=>We,isFirstMultiSelectedBlock:()=>we,isLastBlockChangePersistent:()=>It,isMultiSelecting:()=>Ve,isNavigationMode:()=>Rt,isSelectionEnabled:()=>He,isTyping:()=>Ge,isValidTemplate:()=>Qe,wasBlockJustInserted:()=>zt});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:()=>En,__unstableExpandSelection:()=>Sn,__unstableMarkAutomaticChange:()=>Gn,__unstableMarkLastChangeAsPersistent:()=>Hn,__unstableMarkNextChangeAsNotPersistent:()=>Un,__unstableSaveReusableBlock:()=>Vn,__unstableSplitSelection:()=>Cn,clearSelectedBlock:()=>rn,duplicateBlocks:()=>jn,enterFormattedText:()=>Mn,exitFormattedText:()=>An,flashBlock:()=>Zn,hideInsertionPoint:()=>bn,insertAfterBlock:()=>qn,insertBeforeBlock:()=>Kn,insertBlock:()=>hn,insertBlocks:()=>fn,insertDefaultBlock:()=>On,mergeBlocks:()=>wn,moveBlockToPosition:()=>gn,moveBlocksDown:()=>dn,moveBlocksToPosition:()=>mn,moveBlocksUp:()=>pn,multiSelect:()=>on,receiveBlocks:()=>Yt,removeBlock:()=>In,removeBlocks:()=>Bn,replaceBlock:()=>cn,replaceBlocks:()=>an,replaceInnerBlocks:()=>xn,resetBlocks:()=>jt,resetSelection:()=>qt,selectBlock:()=>Xt,selectNextBlock:()=>en,selectPreviousBlock:()=>Jt,selectionChange:()=>Dn,setBlockMovingClientId:()=>$n,setBlockVisibility:()=>Xn,setHasControlledInnerBlocks:()=>Qn,setNavigationMode:()=>Wn,setTemplateValidity:()=>kn,showInsertionPoint:()=>vn,startDraggingBlocks:()=>Ln,startMultiSelect:()=>tn,startTyping:()=>Nn,stopDraggingBlocks:()=>Rn,stopMultiSelect:()=>nn,stopTyping:()=>Pn,synchronizeTemplate:()=>yn,toggleBlockHighlight:()=>Yn,toggleBlockMode:()=>Tn,toggleSelection:()=>ln,updateBlock:()=>Qt,updateBlockAttributes:()=>Zt,updateBlockListSettings:()=>Fn,updateSettings:()=>zn,validateBlocksToTemplate:()=>Kt});const r=window.wp.blocks,l=window.wp.hooks;function i(){return(i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}(0,l.addFilter)("blocks.registerBlockType","core/compat/migrateLightBlockWrapper",(function(e){const{apiVersion:t=1}=e;return t<2&&(0,r.hasBlockSupport)(e,"lightBlockWrapper",!1)&&(e.apiVersion=2),e}));const s=window.wp.element;var a=n(4403),c=n.n(a);const u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,g={default:(0,p.createSlotFill)("BlockControls"),block:(0,p.createSlotFill)("BlockControlsBlock"),inline:(0,p.createSlotFill)("BlockFormatControls"),other:(0,p.createSlotFill)("BlockControlsOther"),parent:(0,p.createSlotFill)("BlockControlsParent")},h=window.wp.i18n,f={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,h.__)("Black"),slug:"black",color:"#000000"},{name:(0,h.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,h.__)("White"),slug:"white",color:"#ffffff"},{name:(0,h.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,h.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,h.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,h.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,h.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,h.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,h.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,h.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,h.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,h._x)("Small","font size name"),size:13,slug:"small"},{name:(0,h._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,h._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,h._x)("Large","font size name"),size:36,slug:"large"},{name:(0,h._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,h.__)("Thumbnail")},{slug:"medium",name:(0,h.__)("Medium")},{slug:"large",name:(0,h.__)("Large")},{slug:"full",name:(0,h.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,h.__)("Vivid cyan blue to vivid purple"),gradient:"linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)",slug:"vivid-cyan-blue-to-vivid-purple"},{name:(0,h.__)("Light green cyan to vivid green cyan"),gradient:"linear-gradient(135deg,rgb(122,220,180) 0%,rgb(0,208,130) 100%)",slug:"light-green-cyan-to-vivid-green-cyan"},{name:(0,h.__)("Luminous vivid amber to luminous vivid orange"),gradient:"linear-gradient(135deg,rgba(252,185,0,1) 0%,rgba(255,105,0,1) 100%)",slug:"luminous-vivid-amber-to-luminous-vivid-orange"},{name:(0,h.__)("Luminous vivid orange to vivid red"),gradient:"linear-gradient(135deg,rgba(255,105,0,1) 0%,rgb(207,46,46) 100%)",slug:"luminous-vivid-orange-to-vivid-red"},{name:(0,h.__)("Very light gray to cyan bluish gray"),gradient:"linear-gradient(135deg,rgb(238,238,238) 0%,rgb(169,184,195) 100%)",slug:"very-light-gray-to-cyan-bluish-gray"},{name:(0,h.__)("Cool to warm spectrum"),gradient:"linear-gradient(135deg,rgb(74,234,220) 0%,rgb(151,120,209) 20%,rgb(207,42,186) 40%,rgb(238,44,130) 60%,rgb(251,105,98) 80%,rgb(254,248,76) 100%)",slug:"cool-to-warm-spectrum"},{name:(0,h.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,h.__)("Blush bordeaux"),gradient:"linear-gradient(135deg,rgb(254,205,165) 0%,rgb(254,45,45) 50%,rgb(107,0,62) 100%)",slug:"blush-bordeaux"},{name:(0,h.__)("Luminous dusk"),gradient:"linear-gradient(135deg,rgb(255,203,112) 0%,rgb(199,81,192) 50%,rgb(65,88,208) 100%)",slug:"luminous-dusk"},{name:(0,h.__)("Pale ocean"),gradient:"linear-gradient(135deg,rgb(255,245,203) 0%,rgb(182,227,212) 50%,rgb(51,167,181) 100%)",slug:"pale-ocean"},{name:(0,h.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,h.__)("Midnight"),gradient:"linear-gradient(135deg,rgb(2,3,129) 0%,rgb(40,116,252) 100%)",slug:"midnight"}],__unstableResolvedAssets:{styles:[],scripts:[]}};function b(e,t,n){return[...e.slice(0,n),...(0,u.castArray)(t),...e.slice(n)]}function _(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1;const r=[...e];return r.splice(t,o),b(r,e.slice(t,t+o),n)}const k=e=>e;function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n={[t]:[]};return e.forEach((e=>{const{clientId:o,innerBlocks:r}=e;n[t].push(o),Object.assign(n,y(r,o))})),n}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},E(n.innerBlocks,n.clientId))),{})}function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:k;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function S(e){return C(e,(e=>(0,u.omit)(e,"attributes")))}function w(e){return C(e,(e=>e.attributes))}function B(e,t){return"UPDATE_BLOCK_ATTRIBUTES"===e.type&&void 0!==t&&"UPDATE_BLOCK_ATTRIBUTES"===t.type&&(0,u.isEqual)(e.clientIds,t.clientIds)&&function(e,t){return(0,u.isEqual)(Object.keys(e),Object.keys(t))}(e.attributes,t.attributes)}function I(e,t){const n={},o=[...t],r=[...t];for(;o.length;){const e=o.shift();o.push(...e.innerBlocks),r.push(...e.innerBlocks)}for(const e of r)n[e.clientId]={};for(const t of r)n[t.clientId]=Object.assign(n[t.clientId],{...e.byClientId[t.clientId],attributes:e.attributes[t.clientId],innerBlocks:t.innerBlocks.map((e=>n[e.clientId]))});return n}function x(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=new Set([]),l=new Set;for(const t of n){let n=o?t:e.parents[t];do{if(e.controlledInnerBlocks[n]){l.add(n);break}r.add(n),n=e.parents[n]}while(void 0!==n)}for(const e of r)t[e]={...t[e]};for(const n of r)t[n].innerBlocks=(e.order[n]||[]).map((e=>t[e]));for(const n of l)t["controlled||"+n]={innerBlocks:(e.order[n]||[]).map((e=>t[e]))};return t}const T=(0,u.flow)(m.combineReducers,(e=>(t,n)=>{if(t&&"SAVE_REUSABLE_BLOCK_SUCCESS"===n.type){const{id:e,updatedId:o}=n;if(e===o)return t;(t={...t}).attributes=(0,u.mapValues)(t.attributes,((n,r)=>{const{name:l}=t.byClientId[r];return"core/block"===l&&n.ref===e?{...n,ref:o}:n}))}return e(t,n)}),(e=>function(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;const o=e(t,n);if(o===t)return t;switch(o.tree=t.tree?t.tree:{},n.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":{const e=I(o,n.blocks);o.tree=x(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=x(o,{...o.tree,[n.clientId]:{...o.tree[n.clientId],...o.byClientId[n.clientId],attributes:o.attributes[n.clientId]}},[n.clientId],!1);break;case"UPDATE_BLOCK_ATTRIBUTES":{const e=n.clientIds.reduce(((e,t)=>(e[t]={...o.tree[t],attributes:o.attributes[t]},e)),{});o.tree=x(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=I(o,n.blocks);o.tree=x(o,{...(0,u.omit)(o.tree,n.replacedClientIds.concat(n.replacedClientIds.filter((t=>!e[t])).map((e=>"controlled||"+e)))),...e},n.blocks.map((e=>e.clientId)),!1);const r=[];for(const e of n.clientIds)void 0===t.parents[e]||""!==t.parents[e]&&!o.byClientId[t.parents[e]]||r.push(t.parents[e]);o.tree=x(o,o.tree,r,!0);break}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":const e=[];for(const r of n.clientIds)void 0===t.parents[r]||""!==t.parents[r]&&!o.byClientId[t.parents[r]]||e.push(t.parents[r]);o.tree=x(o,(0,u.omit)(o.tree,n.removedClientIds.concat(n.removedClientIds.map((e=>"controlled||"+e)))),e,!0);break;case"MOVE_BLOCKS_TO_POSITION":{const e=[];n.fromRootClientId?e.push(n.fromRootClientId):e.push(""),n.toRootClientId&&e.push(n.toRootClientId),o.tree=x(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=x(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=Object.keys((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=x(o,{...o.tree,...e.reduce(((e,t)=>(e[t]={...o.byClientId[t],attributes:o.attributes[t],innerBlocks:o.tree[t].innerBlocks},e)),{})},e,!1)}}return o}),(e=>(t,n)=>{const o=e=>{let o=e;for(let r=0;r<o.length;r++)!t.order[o[r]]||n.keepControlledInnerBlocks&&n.keepControlledInnerBlocks[o[r]]||(o===e&&(o=[...o]),o.push(...t.order[o[r]]));return o};if(t)switch(n.type){case"REMOVE_BLOCKS":n={...n,type:"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN",removedClientIds:o(n.clientIds)};break;case"REPLACE_BLOCKS":n={...n,type:"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN",replacedClientIds:o(n.clientIds)}}return e(t,n)}),(e=>(t,n)=>{if("REPLACE_INNER_BLOCKS"!==n.type)return e(t,n);const o={};if(Object.keys(t.controlledInnerBlocks).length){const e=[...n.blocks];for(;e.length;){const{innerBlocks:n,...r}=e.shift();e.push(...n),t.controlledInnerBlocks[r.clientId]&&(o[r.clientId]=!0)}}let r=t;t.order[n.rootClientId]&&(r=e(r,{type:"REMOVE_BLOCKS",keepControlledInnerBlocks:o,clientIds:t.order[n.rootClientId]}));let l=r;return n.blocks.length&&(l=e(l,{...n,type:"INSERT_BLOCKS",index:0}),l.order={...l.order,...(0,u.reduce)(o,((e,n,o)=>(t.order[o]&&(e[o]=t.order[o]),e)),{})},l.tree={...l.tree,...(0,u.reduce)(o,((e,n,o)=>{const r=`controlled||${o}`;return t.tree[r]&&(e[r]=t.tree[r]),e}),{})}),l}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:S(n.blocks),attributes:w(n.blocks),order:y(n.blocks),parents:E(n.blocks),controlledInnerBlocks:{},visibility:{}},o=I(e,n.blocks);return e.tree={...o,"":{innerBlocks:n.blocks.map((e=>o[e.clientId]))}},e}return e(t,n)}),(function(e){let t,n=!1;return(o,r)=>{let l=e(o,r);const i="MARK_LAST_CHANGE_AS_PERSISTENT"===r.type||n;if(o===l&&!i){var s;n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type;const e=null===(s=null==o?void 0:o.isPersistentChange)||void 0===s||s;return o.isPersistentChange===e?o:{...l,isPersistentChange:e}}return l={...l,isPersistentChange:i?!n:!B(r,t)},t=r,n="MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"===r.type,l}}),(function(e){const t=new Set(["RECEIVE_BLOCKS"]);return(n,o)=>{const r=e(n,o);return r!==n&&(r.isIgnoredChange=t.has(o.type)),r}}),(e=>(t,n)=>{if("SET_HAS_CONTROLLED_INNER_BLOCKS"===n.type){const o=e(t,{type:"REPLACE_INNER_BLOCKS",rootClientId:n.clientId,blocks:[]});return e(o,n)}return e(t,n)}))({byClientId(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...S(t.blocks)};case"UPDATE_BLOCK":if(!e[t.clientId])return e;const n=(0,u.omit)(t.updates,"attributes");return(0,u.isEmpty)(n)?e:{...e,[t.clientId]:{...e[t.clientId],...n}};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...S(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},attributes(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":case"INSERT_BLOCKS":return{...e,...w(t.blocks)};case"UPDATE_BLOCK":return e[t.clientId]&&t.updates.attributes?{...e,[t.clientId]:{...e[t.clientId],...t.updates.attributes}}:e;case"UPDATE_BLOCK_ATTRIBUTES":{if(t.clientIds.every((t=>!e[t])))return e;const n=t.clientIds.reduce(((n,o)=>({...n,[o]:(0,u.reduce)(t.uniqueByBlock?t.attributes[o]:t.attributes,((t,n,r)=>{var l,i;return n!==t[r]&&((t=(l=e[o])===(i=t)?{...l}:i)[r]=n),t}),e[o])})),{});return t.clientIds.every((t=>n[t]===e[t]))?e:{...e,...n}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return t.blocks?{...(0,u.omit)(e,t.replacedClientIds),...w(t.blocks)}:e;case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},order(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":{const n=y(t.blocks);return{...e,...(0,u.omit)(n,""),"":((null==e?void 0:e[""])||[]).concat(n[""])}}case"INSERT_BLOCKS":{const{rootClientId:n=""}=t,o=e[n]||[],r=y(t.blocks,n),{index:l=o.length}=t;return{...e,...r,[n]:b(o,r[n],l)}}case"MOVE_BLOCKS_TO_POSITION":{const{fromRootClientId:n="",toRootClientId:o="",clientIds:r}=t,{index:l=e[o].length}=t;if(n===o){const t=e[o].indexOf(r[0]);return{...e,[o]:_(e[o],t,l,r.length)}}return{...e,[n]:(0,u.without)(e[n],...r),[o]:b(e[o],r,l)}}case"MOVE_BLOCKS_UP":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=e[o];if(!l.length||r===(0,u.first)(l))return e;const i=l.indexOf(r);return{...e,[o]:_(l,i,i-1,n.length)}}case"MOVE_BLOCKS_DOWN":{const{clientIds:n,rootClientId:o=""}=t,r=(0,u.first)(n),l=(0,u.last)(n),i=e[o];if(!i.length||l===(0,u.last)(i))return e;const s=i.indexOf(r);return{...e,[o]:_(i,s,s+1,n.length)}}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const{clientIds:n}=t;if(!t.blocks)return e;const o=y(t.blocks);return(0,u.flow)([e=>(0,u.omit)(e,t.replacedClientIds),e=>({...e,...(0,u.omit)(o,"")}),e=>(0,u.mapValues)(e,(e=>(0,u.reduce)(e,((e,t)=>t===n[0]?[...e,...o[""]]:(-1===n.indexOf(t)&&e.push(t),e)),[])))])(e)}case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.flow)([e=>(0,u.omit)(e,t.removedClientIds),e=>(0,u.mapValues)(e,(e=>(0,u.without)(e,...t.removedClientIds)))])(e)}return e},parents(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"RECEIVE_BLOCKS":return{...e,...E(t.blocks)};case"INSERT_BLOCKS":return{...e,...E(t.blocks,t.rootClientId||"")};case"MOVE_BLOCKS_TO_POSITION":return{...e,...t.clientIds.reduce(((e,n)=>(e[n]=t.toRootClientId||"",e)),{})};case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":return{...(0,u.omit)(e,t.replacedClientIds),...E(t.blocks,e[t.clientIds[0]])};case"REMOVE_BLOCKS_AUGMENTED_WITH_CHILDREN":return(0,u.omit)(e,t.removedClientIds)}return e},controlledInnerBlocks(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{type:t,clientId:n,hasControlledInnerBlocks:o}=arguments.length>1?arguments[1]:void 0;return"SET_HAS_CONTROLLED_INNER_BLOCKS"===t?{...e,[n]:o}:e},visibility(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_VISIBILITY"===t.type?{...e,...t.updates}:e}});function N(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"CLEAR_SELECTED_BLOCK":return e.clientId?{}:e;case"SELECT_BLOCK":return t.clientId===e.clientId?e:{clientId:t.clientId};case"REPLACE_INNER_BLOCKS":case"INSERT_BLOCKS":return t.updateSelection&&t.blocks.length?{clientId:t.blocks[0].clientId}:e;case"REMOVE_BLOCKS":return t.clientIds&&t.clientIds.length&&-1!==t.clientIds.indexOf(e.clientId)?{}:e;case"REPLACE_BLOCKS":{if(-1===t.clientIds.indexOf(e.clientId))return e;const n=t.blocks[t.indexToSelect]||t.blocks[t.blocks.length-1];return n?n.clientId===e.clientId?e:{clientId:n.clientId}:{}}}return e}const P=(0,m.combineReducers)({blocks:T,isTyping:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_TYPING":return!0;case"STOP_TYPING":return!1}return e},draggedBlocks:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_DRAGGING_BLOCKS":return t.clientIds;case"STOP_DRAGGING_BLOCKS":return[]}return e},selection:function(){var e,t,n,o;let r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},l=arguments.length>1?arguments[1]:void 0;switch(l.type){case"SELECTION_CHANGE":return l.clientId?{selectionStart:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.startOffset},selectionEnd:{clientId:l.clientId,attributeKey:l.attributeKey,offset:l.endOffset}}:{selectionStart:l.start||r.selectionStart,selectionEnd:l.end||r.selectionEnd};case"RESET_SELECTION":const{selectionStart:i,selectionEnd:s}=l;return{selectionStart:i,selectionEnd:s};case"MULTI_SELECT":const{start:a,end:c}=l;return a===(null===(e=r.selectionStart)||void 0===e?void 0:e.clientId)&&c===(null===(t=r.selectionEnd)||void 0===t?void 0:t.clientId)?r:{selectionStart:{clientId:a},selectionEnd:{clientId:c}};case"RESET_BLOCKS":const u=null==r||null===(n=r.selectionStart)||void 0===n?void 0:n.clientId,d=null==r||null===(o=r.selectionEnd)||void 0===o?void 0:o.clientId;if(!u&&!d)return r;if(!l.blocks.some((e=>e.clientId===u)))return{selectionStart:{},selectionEnd:{}};if(!l.blocks.some((e=>e.clientId===d)))return{...r,selectionEnd:r.selectionStart}}return{selectionStart:N(r.selectionStart,l),selectionEnd:N(r.selectionEnd,l)}},isMultiSelecting:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"START_MULTI_SELECT":return!0;case"STOP_MULTI_SELECT":return!1}return e},isSelectionEnabled:function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"TOGGLE_SELECTION":return t.isSelectionEnabled}return e},initialPosition:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"REPLACE_BLOCKS"===t.type&&void 0!==t.initialPosition||["MULTI_SELECT","SELECT_BLOCK","RESET_SELECTION","INSERT_BLOCKS","REPLACE_INNER_BLOCKS"].includes(t.type)?t.initialPosition:e},blocksMode:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;if("TOGGLE_BLOCK_MODE"===t.type){const{clientId:n}=t;return{...e,[n]:e[n]&&"html"===e[n]?"visual":"html"}}return e},blockListSettings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"REPLACE_BLOCKS":case"REMOVE_BLOCKS":return(0,u.omit)(e,t.clientIds);case"UPDATE_BLOCK_LIST_SETTINGS":{const{clientId:n}=t;return t.settings?(0,u.isEqual)(e[n],t.settings)?e:{...e,[n]:t.settings}:e.hasOwnProperty(n)?(0,u.omit)(e,n):e}}return e},insertionPoint:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SHOW_INSERTION_POINT":const{rootClientId:e,index:n,__unstableWithInserter:o}=t;return{rootClientId:e,index:n,__unstableWithInserter:o};case"HIDE_INSERTION_POINT":return null}return e},template:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{isValid:!0},t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"SET_TEMPLATE_VALIDITY":return{...e,isValid:t.isValid}}return e},settings:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:v,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"UPDATE_SETTINGS":return{...e,...t.settings}}return e},preferences:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:f,t=arguments.length>1?arguments[1]:void 0;switch(t.type){case"INSERT_BLOCKS":case"REPLACE_BLOCKS":return t.blocks.reduce(((e,n)=>{const{attributes:o,name:l}=n,i=(0,m.select)(r.store).getActiveBlockVariation(l,o);let s=null!=i&&i.name?`${l}/${i.name}`:l;const a={name:s};return"core/block"===l&&(a.ref=o.ref,s+="/"+o.ref),{...e,insertUsage:{...e.insertUsage,[s]:{time:t.time,count:e.insertUsage[s]?e.insertUsage[s].count+1:1,insert:a}}}}),e)}return e},lastBlockAttributesChange:function(e,t){switch(t.type){case"UPDATE_BLOCK":if(!t.updates.attributes)break;return{[t.clientId]:t.updates.attributes};case"UPDATE_BLOCK_ATTRIBUTES":return t.clientIds.reduce(((e,n)=>({...e,[n]:t.uniqueByBlock?t.attributes[n]:t.attributes})),{})}return null},isNavigationMode:function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=arguments.length>1?arguments[1]:void 0;return"INSERT_BLOCKS"!==t.type&&("SET_NAVIGATION_MODE"===t.type?t.isNavigationMode:e)},hasBlockMovingClientId:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=arguments.length>1?arguments[1]:void 0;return"SET_BLOCK_MOVING_MODE"===t.type?t.hasBlockMovingClientId:"SET_NAVIGATION_MODE"===t.type?null:e},automaticChangeStatus:function(e,t){switch(t.type){case"MARK_AUTOMATIC_CHANGE":return"pending";case"MARK_AUTOMATIC_CHANGE_FINAL":return"pending"===e?"final":void 0;case"SELECTION_CHANGE":return"final"!==e?e:void 0;case"SET_BLOCK_VISIBILITY":case"START_TYPING":case"STOP_TYPING":return e}},highlightedBlock:function(e,t){switch(t.type){case"TOGGLE_BLOCK_HIGHLIGHT":const{clientId:n,isHighlighted:o}=t;return o?n:e===n?null:e;case"SELECT_BLOCK":if(t.clientId!==e)return null}return e},lastBlockInserted:function(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;switch(n.type){case"INSERT_BLOCKS":return n.blocks.length?{clientId:n.blocks[0].clientId,source:null===(e=n.meta)||void 0===e?void 0:e.source}:t;case"RESET_BLOCKS":return{}}return t}});var L={};function R(e){return[e]}function M(e,t,n){var o;if(e.length!==t.length)return!1;for(o=n;o<e.length;o++)if(e[o]!==t[o])return!1;return!0}function A(e,t){var n,o=t||R;function r(e){var t,o,r,l,i,s=n,a=!0;for(t=0;t<e.length;t++){if(!(i=o=e[t])||"object"!=typeof i){a=!1;break}s.has(o)?s=s.get(o):(r=new WeakMap,s.set(o,r),s=r)}return s.has(L)||((l=function(){var e={clear:function(){e.head=null}};return e}()).isUniqueByDependants=a,s.set(L,l)),s.get(L)}function l(){n=new WeakMap}function i(){var t,n,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for((t=r(s=o.apply(null,i))).isUniqueByDependants||(t.lastDependants&&!M(s,t.lastDependants,0)&&t.clear(),t.lastDependants=s),n=t.head;n;){if(M(n.args,i,1))return n!==t.head&&(n.prev.next=n.next,n.next&&(n.next.prev=n.prev),n.next=t.head,n.prev=null,t.head.prev=n,t.head=n),n.val;n=n.next}return n={val:e.apply(null,i)},i[0]=null,n.args=i,t.head&&(t.head.prev=n,n.next=t.head),t.head=n,n.val}return i.getDependants=o,i.clear=l,l(),i}const D=window.wp.primitives,O=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M21.3 10.8l-5.6-5.6c-.7-.7-1.8-.7-2.5 0l-5.6 5.6c-.7.7-.7 1.8 0 2.5l5.6 5.6c.3.3.8.5 1.2.5s.9-.2 1.2-.5l5.6-5.6c.8-.7.8-1.9.1-2.5zm-1 1.4l-5.6 5.6c-.1.1-.3.1-.4 0l-5.6-5.6c-.1-.1-.1-.3 0-.4l5.6-5.6s.1-.1.2-.1.1 0 .2.1l5.6 5.6c.1.1.1.3 0 .4zm-16.6-.4L10 5.5l-1-1-6.3 6.3c-.7.7-.7 1.8 0 2.5L9 19.5l1.1-1.1-6.3-6.3c-.2 0-.2-.2-.1-.3z"})),F=window.wp.richText,z=window.wp.deprecated;var V=n.n(z);function H(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const U=[];function G(e,t){const n=e.blocks.byClientId[t],o="core/social-link";if("web"!==s.Platform.OS&&(null==n?void 0:n.name)===o){const n=e.blocks.attributes[t],{service:r}=n;return r?`core/social-link-${r}`:o}return n?n.name:null}function W(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function $(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function j(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const K=A(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:$(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function q(e,t){var n;const o=t&&Ot(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||U}const Y=A(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Me(e,t),(t=>Y(e,t)))}),(e=>[e.blocks.order])),Q=A(((e,t)=>{const n=[];for(const o of t)for(const t of Me(e,o))n.push(t,...Q(e,[t]));return n}),(e=>[e.blocks.order])),X=A((e=>{const t=[];for(const n of Me(e))t.push(n,...Q(e,[n]));return t}),(e=>[e.blocks.order])),J=A(((e,t)=>{const n=X(e);return t?(0,u.reduce)(n,((n,o)=>e.blocks.byClientId[o].name===t?n+1:n),0):n.length}),(e=>[e.blocks.order,e.blocks.byClientId])),ee=A(((e,t)=>{if(!t)return U;const n=X(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:U}),(e=>[e.blocks.order,e.blocks.byClientId])),te=A(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>j(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function ne(e,t){return Me(e,t).length}function oe(e){return e.selection.selectionStart}function re(e){return e.selection.selectionEnd}function le(e){return e.selection.selectionStart.clientId}function ie(e){return e.selection.selectionEnd.clientId}function se(e){return ye(e).length||(e.selection.selectionStart.clientId?1:0)}function ae(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function ue(e){const t=ce(e);return t?j(e,t):null}function de(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const pe=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=[];let r=t;for(;e.blocks.parents[r];)r=e.blocks.parents[r],o.push(r);return n?o:o.reverse()}),(e=>[e.blocks.parents])),me=A((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=pe(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:G(e,t)}))),(e=>{let{name:t}=e;return Array.isArray(n)?n.includes(t):t===n})),(e=>{let{id:t}=e;return t}))}),(e=>[e.blocks.parents]));function ge(e,t){let n,o=t;do{n=o,o=e.blocks.parents[o]}while(o);return n}function he(e,t){const n=ce(e),o=[...pe(e,t),t],r=[...pe(e,n),n];let l;const i=Math.min(o.length,r.length);for(let e=0;e<i&&o[e]===r[e];e++)l=o[e];return l}function fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ce(e)),void 0===t&&(t=n<0?Ce(e):Se(e)),!t)return null;const o=de(e,t);if(null===o)return null;const{order:r}=e.blocks,l=r[o],i=l.indexOf(t),s=i+1*n;return s<0||s===l.length?null:l[s]}function ve(e,t){return fe(e,t,-1)}function be(e,t){return fe(e,t,1)}function _e(e){return e.initialPosition}const ke=A((e=>{const{selectionStart:t,selectionEnd:n}=e.selection;if(void 0===t.clientId||void 0===n.clientId)return U;if(t.clientId===n.clientId)return[t.clientId];const o=de(e,t.clientId);if(null===o)return U;const r=Me(e,o),l=r.indexOf(t.clientId),i=r.indexOf(n.clientId);return l>i?r.slice(i,l+1):r.slice(l,i+1)}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function ye(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?U:ke(e)}const Ee=A((e=>{const t=ye(e);return t.length?t.map((t=>j(e,t))):U}),(e=>[...ke.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Ce(e){return(0,u.first)(ye(e))||null}function Se(e){return(0,u.last)(ye(e))||null}function we(e,t){return Ce(e)===t}function Be(e,t){return-1!==ye(e).indexOf(t)}const Ie=A(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=de(e,n),o=Be(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function xe(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Ne(e){const t=oe(e),n=re(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Pe(e){const t=oe(e),n=re(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Le(e,t){const n=oe(e),o=re(e);if(n.clientId===o.clientId)return!1;if(!n.attributeKey||!o.attributeKey||void 0===n.offset||void 0===o.offset)return!1;const l=de(e,n.clientId);if(l!==de(e,o.clientId))return!1;const i=Me(e,l);let s,a;i.indexOf(n.clientId)>i.indexOf(o.clientId)?(s=o,a=n):(s=n,a=o);const c=t?a.clientId:s.clientId,u=t?s.clientId:a.clientId,d=j(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=j(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Re=e=>{const t=oe(e),n=re(e);if(t.clientId===n.clientId)return U;if(!t.attributeKey||!n.attributeKey||void 0===t.offset||void 0===n.offset)return U;const o=de(e,t.clientId);if(o!==de(e,n.clientId))return U;const l=Me(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=j(e,a.clientId),d=(0,r.getBlockType)(u.name),p=j(e,c.clientId),m=(0,r.getBlockType)(p.name),g=u.attributes[a.attributeKey],h=p.attributes[c.attributeKey],f=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,F.create)({html:g,...H(f)}),_=(0,F.create)({html:h,...H(v)});return b=(0,F.remove)(b,0,a.offset),_=(0,F.remove)(_,c.offset,_.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,F.toHTMLString)({value:b,...H(f)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,F.toHTMLString)({value:_,...H(v)})}}]};function Me(e,t){return e.blocks.order[t||""]||U}function Ae(e,t){return Me(e,de(e,t)).indexOf(t)}function De(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Oe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Me(e,t),(t=>De(e,t)||Be(e,t)||n&&Oe(e,t,n)))}function Fe(e,t){if(!t)return!1;const n=ye(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function ze(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function Ve(e){return e.isMultiSelecting}function He(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function Ge(e){return e.isTyping}function We(e){return!!e.draggedBlocks.length}function $e(e){return e.draggedBlocks}function je(e,t){return e.draggedBlocks.includes(t)}function Ke(e,t){if(!We(e))return!1;const n=pe(e,t);return(0,u.some)(n,(t=>je(e,t)))}function qe(){return V()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Ye(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=de(e,l)||void 0,n=Ae(e,r.clientId)+1):n=Me(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Qe(e){return e.template.isValid}function Xe(e){return e.settings.template}function Je(e,t){if(!t)return e.settings.templateLock;const n=wt(e,t);return n?n.templateLock:null}const et=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return"boolean"==typeof e?e:Array.isArray(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},tt=function(e,t){let n,o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(t&&"object"==typeof t?(n=t,t=n.name):n=(0,r.getBlockType)(t),!n)return!1;const{allowedBlockTypes:i}=Bt(e),s=et(i,t,!0);if(!s)return!1;const a=!!Je(e,o);if(a)return!1;const c=wt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=et(d,t),m=n.parent,g=G(e,o),h=et(m,g);let f=!0;const v=n.ancestor;if(v){const t=[o,...pe(e,o)];f=(0,u.some)(t,(t=>et(v,G(e,t))))}const b=f&&(null===p&&null===h||!0===p||!0===h);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:j.bind(null,e),getBlockParentsByBlockName:me.bind(null,e)}):b},nt=A(tt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function ot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>nt(e,G(e,t),n)))}function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return!0;const{lock:r}=o,l=!!Je(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>rt(e,t,n)))}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=$(e,t);if(null===o)return;const{lock:r}=o,l="all"===Je(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>it(e,t,n)))}function at(e,t){const n=$(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ct(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function ut(e,t){var n,o;return null!==(n=null===(o=e.preferences.insertUsage)||void 0===o?void 0:o[t])&&void 0!==n?n:null}const dt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&tt(e,t.name,n),pt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=ut(e,o)||{};return{...t,id:o,icon:n.icon||t.icon,title:n.title||t.title,description:n.description||t.description,category:n.category||t.category,example:n.hasOwnProperty("example")?n.example:t.example,initialAttributes:{...t.initialAttributes,...n.attributes},innerBlocks:n.innerBlocks,keywords:n.keywords||t.keywords,frecency:mt(r,l)}},mt=(e,t)=>{if(!e)return t;const n=Date.now()-e;switch(!0){case n<36e5:return 4*t;case n<864e5:return 2*t;case n<6048e5:return t/2;default:return t/4}},gt=(e,t)=>{let{buildScope:n="inserter"}=t;return t=>{const o=t.name;let l=!1;(0,r.hasBlockSupport)(t.name,"multiple",!0)||(l=(0,u.some)(te(e,X(e)),{name:t.name}));const{time:i,count:s=0}=ut(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:mt(i,s)};if("transform"===n)return a;const c=(0,r.getBlockVariations)(t.name,"inserter");return{...a,initialAttributes:{},description:t.description,category:t.category,keywords:t.keywords,variations:c,example:t.example,utility:1}}},ht=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=gt(e,{buildScope:"inserter"}),o=/^\s*<!--\s+(\/)?wp:([a-z][a-z0-9_-]*\/)?([a-z][a-z0-9_-]*)\s+({(?:(?=([^}]+|}+(?=})|(?!}\s+\/?-->)[^])*)\5|[^]*?)}\s+)?(\/)?-->/,l=t=>{let n=O;if("web"===s.Platform.OS){const e=("string"==typeof t.content.raw?t.content.raw:t.content).match(o);if(e){const[,,t="core/",o]=e,l=(0,r.getBlockType)(t+o);l&&(n=l.icon)}}const l=`core/block/${t.id}`,{time:i,count:a=0}=ut(e,l)||{},c=mt(i,a);return{id:l,name:"core/block",initialAttributes:{ref:t.id},title:t.title.raw,icon:n,category:"reusable",keywords:[],isDisabled:!1,utility:1,frecency:c}},i=(0,r.getBlockTypes)().filter((n=>dt(e,n,t))).map(n),a=tt(e,"core/block",t)?Lt(e).map(l):[],c=i.reduce(((t,n)=>{const{variations:o=[]}=n;if(o.some((e=>{let{isDefault:t}=e;return t}))||t.push(n),o.length){const r=pt(e,n);t.push(...o.map(r))}return t}),[]),u=(e,t)=>{const{core:n,noncore:o}=e;return(t.name.startsWith("core/")?n:o).push(t),e},{core:d,noncore:p}=c.reduce(u,{core:[],noncore:[]}),m=[...d,...p];return[...m,...a]}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.blocks.order,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),ft=A((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const l=(0,u.castArray)(t),[i]=l,s=gt(e,{buildScope:"transform"}),a=(0,r.getBlockTypes)().filter((t=>dt(e,t,o))).map(s),c=Object.fromEntries(Object.entries(a).map((e=>{let[,t]=e;return[t.name,t]})));c["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,h.__)("Unwrap"),icon:null===(n=c[null==i?void 0:i.name])||void 0===n?void 0:n.icon};const d=(0,r.getPossibleBlockTransformations)(l).reduce(((e,t)=>("*"===t?e.push(c["*"]):c[null==t?void 0:t.name]&&e.push(c[t.name]),e)),[]);return(0,u.orderBy)(d,(e=>c[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),vt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>dt(e,n,t)));if(n)return!0;const o=tt(e,"core/block",t)&&Lt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Lt(e),(0,r.getBlockTypes)()])),bt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>dt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),_t=A((function(e){var t,n;let o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(!o)return;const r=null===(t=e.blockListSettings[o])||void 0===t?void 0:t.__experimentalDefaultBlock,l=null===(n=e.blockListSettings[o])||void 0===n?void 0:n.__experimentalDirectInsert;return r&&l?"function"==typeof l?l(j(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),kt=A(((e,t)=>{const n=e.settings.__experimentalBlockPatterns.find((e=>{let{name:n}=e;return n===t}));return n?{...n,blocks:(0,r.parse)(n.content,{__unstableSkipMigrationLogs:!0})}:null}),(e=>[e.settings.__experimentalBlockPatterns])),yt=A((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=Bt(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return kt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if("boolean"==typeof t)return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!et(t,e.name||e.blockName,!0))return!1;null===(o=e.innerBlocks)||void 0===o||o.forEach((e=>{n.push(e)}))}return!0})(t,n)}))}),(e=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes])),Et=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=yt(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return nt(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),Ct=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return U;const o=Et(e,n),r=Array.isArray(t)?t:[t];return o.filter((e=>{var t,n;return null==e||null===(t=e.blockTypes)||void 0===t||null===(n=t.some)||void 0===n?void 0:n.call(t,(e=>r.includes(e)))}))}),((e,t)=>[...Et.getDependants(e,t)])),St=A((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return U;if(t.some((t=>{let{clientId:n,innerBlocks:o}=t;return o.length||Ot(e,n)})))return U;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return Ct(e,o,n)}),((e,t)=>[...Ct.getDependants(e,t)]));function wt(e,t){return e.blockListSettings[t]}function Bt(e){return e.settings}function It(e){return e.blocks.isPersistentChange}const xt=A((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return t.reduce(((t,n)=>e.blockListSettings[n]?{...t,[n]:e.blockListSettings[n]}:t),{})}),(e=>[e.blockListSettings])),Tt=A(((e,t)=>{var n;const o=(0,u.find)(Lt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Lt(e)]));function Nt(e){return e.blocks.isIgnoredChange}function Pt(e){return e.lastBlockAttributesChange}function Lt(e){var t,n;return null!==(t=null==e||null===(n=e.settings)||void 0===n?void 0:n.__experimentalReusableBlocks)&&void 0!==t?t:U}function Rt(e){return e.isNavigationMode}function Mt(e){return e.hasBlockMovingClientId}function At(e){return!!e.automaticChangeStatus}function Dt(e,t){return e.highlightedBlock===t}function Ot(e,t){return!!e.blocks.controlledInnerBlocks[t]}const Ft=A(((e,t)=>{if(!t.length)return null;const n=ce(e);if(t.includes(G(e,n)))return n;const o=ye(e),r=me(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function zt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}function Vt(e,t){var n,o;return null===(n=null===(o=e.blocks.visibility)||void 0===o?void 0:o[t])||void 0===n||n}const Ht=A((e=>new Set(Object.keys(e.blocks.visibility).filter((t=>e.blocks.visibility[t])))),(e=>[e.blocks.visibility])),Ut=window.wp.a11y,Gt="";function Wt(e){if(e)return Object.keys(e).find((t=>{const n=e[t];return"string"==typeof n&&-1!==n.indexOf(Gt)}))}const $t=e=>Array.isArray(e)?e:[e],jt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Kt(e))},Kt=e=>t=>{let{select:n,dispatch:o}=t;const l=n.getTemplate(),i=n.getTemplateLock(),s=!l||"all"!==i||(0,r.doBlocksMatchTemplate)(e,l);if(s!==n.isValidTemplate())return o.setTemplateValidity(s),s};function qt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function Yt(e){return V()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function Zt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:$t(e),attributes:t,uniqueByBlock:n}}function Qt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function Xt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Jt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},en=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function tn(){return{type:"START_MULTI_SELECT"}}function nn(){return{type:"STOP_MULTI_SELECT"}}const on=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return o=>{let{select:r,dispatch:l}=o;if(r.getBlockRootClientId(e)!==r.getBlockRootClientId(t))return;l({type:"MULTI_SELECT",start:e,end:t,initialPosition:n});const i=r.getSelectedBlockCount();(0,Ut.speak)((0,h.sprintf)(
|
2 |
/* translators: %s: number of selected blocks */
|
3 |
+
(0,h._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function rn(){return{type:"CLEAR_SELECTED_BLOCK"}}function ln(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function sn(e,t){var n,o;const l=null!==(n=null==t||null===(o=t.__experimentalPreferredStyleVariations)||void 0===o?void 0:o.value)&&void 0!==n?n:{};return e.map((e=>{var t;const n=e.name;if(!(0,r.hasBlockSupport)(n,"defaultStylePicker",!0))return e;if(!l[n])return e;const o=null===(t=e.attributes)||void 0===t?void 0:t.className;if(null!=o&&o.includes("is-style-"))return e;const{attributes:i={}}=e,s=l[n];return{...e,attributes:{...i,className:`${o||""} is-style-${s}`.trim()}}}))}const an=function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,r=arguments.length>4?arguments[4]:void 0;return l=>{let{select:i,dispatch:s}=l;e=$t(e),t=sn($t(t),i.getSettings());const a=i.getBlockRootClientId(e[0]);for(let e=0;e<t.length;e++){const n=t[e];if(!i.canInsertBlockType(n.name,a))return}s({type:"REPLACE_BLOCKS",clientIds:e,blocks:t,time:Date.now(),indexToSelect:n,initialPosition:o,meta:r}),s((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()}))}};function cn(e,t){return an(e,t)}const un=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:$t(t),rootClientId:n})},dn=un("MOVE_BLOCKS_DOWN"),pn=un("MOVE_BLOCKS_UP"),mn=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return r=>{let{select:l,dispatch:i}=r;if(l.canMoveBlocks(e,t)){if(t!==n){if(!l.canRemoveBlocks(e,t))return;if(!l.canInsertBlocks(e,n))return}i({type:"MOVE_BLOCKS_TO_POSITION",fromRootClientId:t,toRootClientId:n,clientIds:e,index:o})}}};function gn(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",o=arguments.length>3?arguments[3]:void 0;return mn([e],t,n,o)}function hn(e,t,n,o,r){return fn([e],t,n,o,0,r)}const fn=function(e,t,n){let o=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:0,l=arguments.length>5?arguments[5]:void 0;return i=>{let{select:s,dispatch:a}=i;null!==r&&"object"==typeof r&&(l=r,r=0,V()("meta argument in wp.data.dispatch('core/block-editor')",{since:"5.8",hint:"The meta argument is now the 6th argument of the function"})),e=sn($t(e),s.getSettings());const c=[];for(const t of e)s.canInsertBlockType(t.name,n)&&c.push(t);c.length&&a({type:"INSERT_BLOCKS",blocks:c,index:t,rootClientId:n,time:Date.now(),updateSelection:o,initialPosition:o?r:null,meta:l})}};function vn(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{__unstableWithInserter:o}=n;return{type:"SHOW_INSERTION_POINT",rootClientId:e,index:t,__unstableWithInserter:o}}function bn(){return{type:"HIDE_INSERTION_POINT"}}function kn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const yn=()=>e=>{let{select:t,dispatch:n}=e;n({type:"SYNCHRONIZE_TEMPLATE"});const o=t.getBlocks(),l=t.getTemplate(),i=(0,r.synchronizeBlocksWithTemplate)(o,l);n.resetBlocks(i)},En=e=>t=>{let{registry:n,select:o,dispatch:l}=t;const i=o.getSelectionStart(),s=o.getSelectionEnd();if(i.clientId===s.clientId)return;if(!i.attributeKey||!s.attributeKey||void 0===i.offset||void 0===s.offset)return!1;const a=o.getBlockRootClientId(i.clientId);if(a!==o.getBlockRootClientId(s.clientId))return;const c=o.getBlockOrder(a);let u,d;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(u=s,d=i):(u=i,d=s);const p=e?d:u,m=o.getBlock(p.clientId),g=(0,r.getBlockType)(m.name);if(!g.merge)return;const h=u,f=d,v=o.getBlock(h.clientId),b=(0,r.getBlockType)(v.name),_=o.getBlock(f.clientId),k=(0,r.getBlockType)(_.name),y=v.attributes[h.attributeKey],E=_.attributes[f.attributeKey],C=b.attributes[h.attributeKey],S=k.attributes[f.attributeKey];let w=(0,F.create)({html:y,...H(C)}),B=(0,F.create)({html:E,...H(S)});w=(0,F.remove)(w,h.offset,w.text.length),B=(0,F.insert)(B,Gt,0,f.offset);const I=(0,r.cloneBlock)(v,{[h.attributeKey]:(0,F.toHTMLString)({value:w,...H(C)})}),x=(0,r.cloneBlock)(_,{[f.attributeKey]:(0,F.toHTMLString)({value:B,...H(S)})}),T=e?I:x,N=v.name===_.name?[T]:(0,r.switchToBlockType)(T,g.name);if(!N||!N.length)return;let P;if(e){const e=N.pop();P=g.merge(e.attributes,x.attributes)}else{const e=N.shift();P=g.merge(I.attributes,e.attributes)}const L=Wt(P),R=P[L],M=(0,F.create)({html:R,...H(g.attributes[L])}),A=M.text.indexOf(Gt),D=(0,F.remove)(M,A,A+1),O=(0,F.toHTMLString)({value:D,...H(g.attributes[L])});P[L]=O;const z=o.getSelectedBlockClientIds(),V=[...e?N:[],{...m,attributes:{...m.attributes,...P}},...e?[]:N];n.batch((()=>{l.selectionChange(m.clientId,L,A,A),l.replaceBlocks(z,V,0,o.getSelectedBlocksInitialCaretPosition())}))},Cn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),l=t.getSelectionEnd();if(o.clientId===l.clientId)return;if(!o.attributeKey||!l.attributeKey||void 0===o.offset||void 0===l.offset)return;const i=t.getBlockRootClientId(o.clientId);if(i!==t.getBlockRootClientId(l.clientId))return;const s=t.getBlockOrder(i);let a,c;s.indexOf(o.clientId)>s.indexOf(l.clientId)?(a=l,c=o):(a=o,c=l);const u=a,d=c,p=t.getBlock(u.clientId),m=(0,r.getBlockType)(p.name),g=t.getBlock(d.clientId),h=(0,r.getBlockType)(g.name),f=p.attributes[u.attributeKey],v=g.attributes[d.attributeKey],b=m.attributes[u.attributeKey],_=h.attributes[d.attributeKey];let k=(0,F.create)({html:f,...H(b)}),y=(0,F.create)({html:v,...H(_)});k=(0,F.remove)(k,u.offset,k.text.length),y=(0,F.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,F.toHTMLString)({value:k,...H(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...g,attributes:{...g.attributes,[d.attributeKey]:(0,F.toHTMLString)({value:y,...H(_)})}}],1,t.getSelectedBlocksInitialCaretPosition())},Sn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},wn=(e,t)=>n=>{let{registry:o,select:l,dispatch:i}=n;const s=[e,t];i({type:"MERGE_BLOCKS",blocks:s});const[a,c]=s,u=l.getBlock(a),d=(0,r.getBlockType)(u.name);if(!d)return;const p=l.getBlock(c);if(d&&!d.merge){const e=(0,r.switchToBlockType)(p,d.name);if(1!==(null==e?void 0:e.length))return void i.selectBlock(u.clientId);const[t]=e;return t.innerBlocks.length<1?void i.selectBlock(u.clientId):void o.batch((()=>{i.insertBlocks(t.innerBlocks,void 0,a),i.removeBlock(c),i.selectBlock(t.innerBlocks[0].clientId)}))}const m=(0,r.getBlockType)(p.name),{clientId:g,attributeKey:h,offset:f}=l.getSelectionStart(),v=(g===a?d:m).attributes[h],b=(g===a||g===c)&&void 0!==h&&void 0!==f&&!!v;v||("number"==typeof h?window.console.error("RichText needs an identifier prop that is the block attribute key of the attribute it controls. Its type is expected to be a string, but was "+typeof h):window.console.error("The RichText identifier prop does not match any attributes defined by the block."));const _=(0,r.cloneBlock)(u),k=(0,r.cloneBlock)(p);if(b){const e=g===a?_:k,t=e.attributes[h],n=(0,F.insert)((0,F.create)({html:t,...H(v)}),Gt,f,f);e.attributes[h]=(0,F.toHTMLString)({value:n,...H(v)})}const y=u.name===p.name?[k]:(0,r.switchToBlockType)(k,u.name);if(!y||!y.length)return;const E=d.merge(_.attributes,y[0].attributes);if(b){const e=Wt(E),t=E[e],n=(0,F.create)({html:t,...H(d.attributes[e])}),o=n.text.indexOf(Gt),r=(0,F.remove)(n,o,o+1),l=(0,F.toHTMLString)({value:r,...H(d.attributes[e])});E[e]=l,i.selectionChange(u.clientId,e,o,o)}i.replaceBlocks([u.clientId,p.clientId],[{...u,attributes:{...u.attributes,...E}},...y.slice(1)],0)},Bn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:r}=n;if(!e||!e.length)return;e=$t(e);const l=o.getBlockRootClientId(e[0]);o.canRemoveBlocks(e,l)&&(t&&r.selectPreviousBlock(e[0]),r({type:"REMOVE_BLOCKS",clientIds:e}),r((e=>{let{select:t,dispatch:n}=e;if(t.getBlockCount()>0)return;const{__unstableHasCustomAppender:o}=t.getSettings();o||n.insertDefaultBlock()})))}};function In(e,t){return Bn([e],t)}function xn(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;return{type:"REPLACE_INNER_BLOCKS",rootClientId:e,blocks:t,updateSelection:n,initialPosition:n?o:null,time:Date.now()}}function Tn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Nn(){return{type:"START_TYPING"}}function Pn(){return{type:"STOP_TYPING"}}function Ln(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Rn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Mn(){return V()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function An(){return V()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Dn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const On=(e,t,n)=>o=>{let{dispatch:l}=o;const i=(0,r.getDefaultBlockName)();if(!i)return;const s=(0,r.createBlock)(i,e);return l.insertBlock(s,n,t)};function Fn(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function zn(e){return{type:"UPDATE_SETTINGS",settings:e}}function Vn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function Hn(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Un(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const Gn=()=>e=>{let{dispatch:t}=e;t({type:"MARK_AUTOMATIC_CHANGE"});const{requestIdleCallback:n=(e=>setTimeout(e,100))}=window;n((()=>{t({type:"MARK_AUTOMATIC_CHANGE_FINAL"})}))},Wn=function(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return t=>{let{dispatch:n}=t;n({type:"SET_NAVIGATION_MODE",isNavigationMode:e}),e?(0,Ut.speak)((0,h.__)("You are currently in navigation mode. Navigate blocks using the Tab key and Arrow keys. Use Left and Right Arrow keys to move between nesting levels. To exit navigation mode and edit the selected block, press Enter.")):(0,Ut.speak)((0,h.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},$n=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;return t=>{let{dispatch:n}=t;n({type:"SET_BLOCK_MOVING_MODE",hasBlockMovingClientId:e}),e&&(0,Ut.speak)((0,h.__)("Use the Tab key and Arrow keys to choose new block location. Use Left and Right Arrow keys to move between nesting levels. Once location is selected press Enter or Space to move the block."))}},jn=function(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return n=>{let{select:o,dispatch:l}=n;if(!e||!e.length)return;const i=o.getBlocksByClientId(e);if(i.some((e=>!e)))return;if(i.map((e=>e.name)).some((e=>!(0,r.hasBlockSupport)(e,"multiple",!0))))return;const s=o.getBlockRootClientId(e[0]),a=$t(e),c=o.getBlockIndex(a[a.length-1]),u=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(u,c+1,s,t),u.length>1&&t&&l.multiSelect(u[0].clientId,u[u.length-1].clientId),u.map((e=>e.clientId))}},Kn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l)},qn=e=>t=>{let{select:n,dispatch:o}=t;if(!e)return;const r=n.getBlockRootClientId(e);if(n.getTemplateLock(r))return;const l=n.getBlockIndex(e);return o.insertDefaultBlock({},r,l+1)};function Yn(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const Zn=e=>async t=>{let{dispatch:n}=t;n(Yn(e,!0)),await new Promise((e=>setTimeout(e,150))),n(Yn(e,!1))};function Qn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}function Xn(e){return{type:"SET_BLOCK_VISIBILITY",updates:e}}const Jn="core/block-editor",eo={reducer:P,selectors:e,actions:t},to=(0,m.createReduxStore)(Jn,{...eo,persist:["preferences"]});(0,m.registerStore)(Jn,{...eo,persist:["preferences"]});const no={name:"",isSelected:!1},oo=(0,s.createContext)(no),{Provider:ro}=oo;function lo(){return(0,s.useContext)(oo)}function io(){const{isSelected:e,clientId:t,name:n}=lo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(to);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function so(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=io(),{clientId:o}=lo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(to),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=g[e])||void 0===i?void 0:i.Fill:l?g.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(i,null,(e=>{const r=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolbarContext.Provider,{value:r},"default"===t&&(0,s.createElement)(p.ToolbarGroup,{controls:n}),o)}))):null}function ao(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=g[t].Slot,l=(0,p.__experimentalUseSlot)(r.__unstableName);return Boolean(l.fills&&l.fills.length)?"default"===t?(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o})):(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(r,i({},n,{bubblesVirtually:!0,fillProps:o}))):null}const co=so;co.Slot=ao;const uo=e=>(0,s.createElement)(so,i({group:"inline"},e));uo.Slot=e=>(0,s.createElement)(ao,i({group:"inline"},e));const po=co,mo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),go=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ho=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),fo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),vo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.3 6.7l-1.1 1.1 4 4H4v1.5h13.3l-4.1 4.4 1.1 1.1 5.8-6.3z"})),bo=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.2 13.2l-4 4V4h-1.5v13.3l-4.5-4.1-1 1.1 6.2 5.8 5.8-5.8-1-1.1z"}));function _o(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e}${t?` ${t}`:""}`)).join(",")}function ko(e,t,n,o){var r,l;let i="";return null!=t&&null!==(r=t[n])&&void 0!==r&&null!==(l=r.spacingStyles)&&void 0!==l&&l.length&&o&&t[n].spacingStyles.forEach((t=>{i+=`${_o(e,t.selector.trim())} { `,i+=Object.entries(t.rules).map((e=>{let[t,n]=e;return`${t}: ${n||o}`})).join("; "),i+="; }"})),i}function yo(e){const{contentSize:t,wideSize:n}=e,o={},r=/^(?!0)\d+(px|em|rem|vw|vh|%)?$/i;return r.test(t)&&(
|
4 |
// translators: %s: container size (i.e. 600px etc)
|
5 |
o.none=(0,h.sprintf)((0,h.__)("Max %s wide"),t)),r.test(n)&&(
|
6 |
// translators: %s: container size (i.e. 600px etc)
|
7 |
+
o.wide=(0,h.sprintf)((0,h.__)("Max %s wide"),n)),o}const Eo=(0,s.createContext)({refs:new Map,callbacks:new Map});function Co(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(Eo.Provider,{value:n},t)}function So(e){const{refs:t,callbacks:n}=(0,s.useContext)(Eo),o=(0,s.useRef)();return(0,s.useLayoutEffect)((()=>(t.set(o,e),()=>{t.delete(o)})),[e]),(0,d.useRefEffect)((t=>{o.current=t,n.forEach(((n,o)=>{e===n&&o(t)}))}),[e])}function wo(e){const{refs:t}=(0,s.useContext)(Eo),n=(0,s.useRef)();return n.current=e,(0,s.useMemo)((()=>({get current(){let e=null;for(const[o,r]of t.entries())r===n.current&&o.current&&(e=o.current);return e}})),[])}function Bo(e){const{callbacks:t}=(0,s.useContext)(Eo),n=wo(e),[o,r]=(0,s.useState)(null);return(0,s.useLayoutEffect)((()=>{if(e)return t.set(r,e),()=>{t.delete(r)}}),[e]),n.current||o}function Io(e){return!(null==e||!e.includes)&&("0"===e||e.includes("var:preset|spacing|"))}function xo(e,t){if(!Io(e))return e;const n=No(e),o=t.find((e=>String(e.slug)===n));return null==o?void 0:o.size}function To(e){if(!e)return;const t=e.match(/var:preset\|spacing\|(.+)/);return t?`var(--wp--preset--spacing--${t[1]})`:e}function No(e){if(!e)return;if("0"===e||"default"===e)return e;const t=e.match(/var:preset\|spacing\|(.+)/);return t?t[1]:void 0}const Po={all:(0,h.__)("All sides"),top:(0,h.__)("Top"),bottom:(0,h.__)("Bottom"),left:(0,h.__)("Left"),right:(0,h.__)("Right"),mixed:(0,h.__)("Mixed"),vertical:(0,h.__)("Vertical"),horizontal:(0,h.__)("Horizontal")},Lo={top:void 0,right:void 0,bottom:void 0,left:void 0},Ro=["top","right","bottom","left"];function Mo(e){return e.sort(((t,n)=>e.filter((e=>e===t)).length-e.filter((e=>e===n)).length)).pop()}function Ao(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ro;return Object.values(e).length>=1&&Object.values(e).length<t.length||new Set(Object.values(e)).size>1}function Do(e){return void 0!==e&&!(0,u.isEmpty)(Object.values(e).filter((e=>!!e&&/\d/.test(e))))}const Oo=["color","border","typography","spacing"],Fo={"color.palette":e=>void 0===e.colors?void 0:e.colors,"color.gradients":e=>void 0===e.gradients?void 0:e.gradients,"color.custom":e=>void 0===e.disableCustomColors?void 0:!e.disableCustomColors,"color.customGradient":e=>void 0===e.disableCustomGradients?void 0:!e.disableCustomGradients,"typography.fontSizes":e=>void 0===e.fontSizes?void 0:e.fontSizes,"typography.customFontSize":e=>void 0===e.disableCustomFontSizes?void 0:!e.disableCustomFontSizes,"typography.lineHeight":e=>e.enableCustomLineHeight,"spacing.units":e=>{if(void 0!==e.enableCustomUnits)return!0===e.enableCustomUnits?["px","em","rem","vh","vw","%"]:e.enableCustomUnits},"spacing.padding":e=>e.enableCustomSpacing},zo={"border.customColor":"border.color","border.customStyle":"border.style","border.customWidth":"border.width","typography.customFontStyle":"typography.fontStyle","typography.customFontWeight":"typography.fontWeight","typography.customLetterSpacing":"typography.letterSpacing","typography.customTextDecorations":"typography.textDecoration","typography.customTextTransforms":"typography.textTransform","border.customRadius":"border.radius","spacing.customMargin":"spacing.margin","spacing.customPadding":"spacing.padding","typography.customLineHeight":"typography.lineHeight"};function Vo(e){const{name:t,clientId:n}=lo();return(0,m.useSelect)((o=>{if(Oo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");let l;const i=(e=>zo[e]||e)(e);[...o(to).getBlockParents(n),n].forEach((e=>{const n=o(to).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(to).getBlockAttributes(e),r=null!==(s=(0,u.get)(n,`settings.blocks.${t}.${i}`))&&void 0!==s?s:(0,u.get)(n,`settings.${i}`);void 0!==r&&(l=r)}}));const s=o(to).getSettings();if(void 0===l){var a;const e=`__experimentalFeatures.${i}`,n=`__experimentalFeatures.blocks.${t}.${i}`;l=null!==(a=(0,u.get)(s,n))&&void 0!==a?a:(0,u.get)(s,e)}var c,d;if(void 0!==l)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(c=null!==(d=l.custom)&&void 0!==d?d:l.theme)&&void 0!==c?c:l.default:l;const p=Fo[i]?Fo[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;const Ho={default:(0,p.createSlotFill)("InspectorControls"),advanced:(0,p.createSlotFill)("InspectorAdvancedControls"),border:(0,p.createSlotFill)("InspectorControlsBorder"),color:(0,p.createSlotFill)("InspectorControlsColor"),dimensions:(0,p.createSlotFill)("InspectorControlsDimensions"),typography:(0,p.createSlotFill)("InspectorControlsTypography")};function Uo(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=io(),l=null===(t=Ho[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(l,null,(e=>{const t=(0,u.isEmpty)(e)?null:e;return(0,s.createElement)(p.__experimentalToolsPanelContext.Provider,{value:t},o)}))):null:("undefined"!=typeof process&&process.env,null)}const Go=e=>e,Wo=e=>{if(null===e||"object"!=typeof e||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Wo),Go);return(0,u.isEmpty)(t)?void 0:t};function $o(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function jo(e,t,n,o,r,l){var i;if((0,u.every)(e,(e=>!e)))return n;if(1===l.length&&n.innerBlocks.length===o.length)return n;let s=null===(i=o[0])||void 0===i?void 0:i.attributes;if(l.length>1&&o.length>1){if(!o[r])return n;var a;s=null===(a=o[r])||void 0===a?void 0:a.attributes}let c=n;return(0,u.forEach)(e,((e,n)=>{e&&t[n].forEach((e=>{const t=(0,u.get)(s,e);t&&(c={...c,attributes:$o(c.attributes,e,t)})}))})),c}function Ko(e,t,n){const o=(0,r.getBlockSupport)(e,t),l=null==o?void 0:o.__experimentalSkipSerialization;return Array.isArray(l)?l.includes(n):l}function qo(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(to),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(to),u=a(),d=(0,s.useCallback)((function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={},n=c()?i():[u];n.forEach((n=>{const{style:o}=l(n);let r={style:o};e.forEach((e=>{r={...r,...e(r)}})),r={...r,style:Wo(r.style)},t[n]=r})),r(n,t,!0)}),[Wo,l,i,c,u,r]);return(0,s.createElement)(p.__experimentalToolsPanel,{className:`${n}-block-support-panel`,label:o,resetAll:d,key:u,panelId:u,hasInnerWrapper:!0,shouldRenderPlaceholderItems:!0,__experimentalFirstVisibleItemClass:"first",__experimentalLastVisibleItemClass:"last"},t)}function Yo(e){let{Slot:t,...n}=e;const o=(0,s.useContext)(p.__experimentalToolsPanelContext);return(0,s.createElement)(t,i({},n,{fillProps:o,bubblesVirtually:!0}))}function Zo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=Ho[n])||void 0===t?void 0:t.Slot,a=(0,p.__experimentalUseSlot)(null==l?void 0:l.__unstableName);return l&&a?Boolean(a.fills&&a.fills.length)?o?(0,s.createElement)(qo,{group:n,label:o},(0,s.createElement)(Yo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Qo=Uo;Qo.Slot=Zo;const Xo=e=>(0,s.createElement)(Uo,i({},e,{__experimentalGroup:"advanced"}));Xo.Slot=e=>(0,s.createElement)(Zo,i({},e,{__experimentalGroup:"advanced"})),Xo.slotName="InspectorAdvancedControls";const Jo=Qo,er=window.wp.isShallowEqual;var tr=n.n(er);const nr=function(e){return(0,d.useRefEffect)((t=>{if(!e)return;function n(t){const{deltaX:n,deltaY:o}=t;e.current.scrollBy(n,o)}const o={passive:!0};return t.addEventListener("wheel",n,o),()=>{t.removeEventListener("wheel",n,o)}}),[e])},or=(0,s.forwardRef)((function(e,t){let{clientId:n,bottomClientId:o,children:r,__unstableRefreshSize:l,__unstableCoverTarget:a=!1,__unstablePopoverSlot:u,__unstableContentRef:m,...g}=e;const h=Bo(n),f=Bo(null!=o?o:n),v=(0,d.useMergeRefs)([t,nr(m)]),b=(0,s.useMemo)((()=>h&&f===h?{position:"absolute",width:h.offsetWidth,height:h.offsetHeight}:{}),[h,f,l]);if(!h||o&&!f)return null;const _={top:h,bottom:f};return(0,s.createElement)(p.Popover,i({ref:v,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:_,__unstableSlotName:u||null,__unstableObserveElement:h,__unstableForcePosition:!0,__unstableShift:!0},g,{className:c()("block-editor-block-popover",g.className)}),a&&(0,s.createElement)("div",{style:b},r),!a&&r)})),rr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.5 13.8c-1.1 0-2.1.7-2.4 1.8H4V17h8.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20v-1.5h-3.1c-.3-1-1.3-1.7-2.4-1.7zM11.9 7c-.3-1-1.3-1.8-2.4-1.8S7.4 6 7.1 7H4v1.5h3.1c.3 1 1.3 1.8 2.4 1.8s2.1-.7 2.4-1.8H20V7h-8.1z"}));function lr(e){var t;let{spacingSizes:n,value:o,side:r,onChange:l,isMixed:i=!1,type:a,minimumCustomValue:u}=e,d=n;const g=n.length<=8,f=(0,m.useSelect)((e=>{const t=e(to).getSettings();return null==t?void 0:t.disableCustomSpacingSizes})),[v,b]=(0,s.useState)(!f&&void 0!==o&&!Io(o)),_=(0,p.__experimentalUseCustomUnits)({availableUnits:Vo("spacing.units")||["px","em","rem"]});let k=null;g||v||void 0===o||!(!Io(o)||Io(o)&&i)?i||(k=v?xo(o,n):function(e,t){if(void 0===e)return 0;const n=0===parseFloat(e,10)?"0":No(e),o=t.findIndex((e=>String(e.slug)===n));return-1!==o?o:NaN}(o,n)):(d=[...n,{name:i?(0,h.__)("Mixed"):// translators: A custom measurement, eg. a number followed by a unit like 12px.
|
8 |
+
(0,h.sprintf)((0,h.__)("Custom (%s)"),o),slug:"custom",size:o}],k=d.length-1);const y=(0,s.useMemo)((()=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(k)),[k])[1]||_[0].value,E=e=>{var t;return void 0===o||null===(t=n[e])||void 0===t?void 0:t.name},C=parseInt(k,10),S=(e,t)=>{var o;const r=parseInt(e,10);if("selectList"===t){if(0===r)return;if(1===r)return"0"}else if(0===r)return"0";return`var:preset|spacing|${null===(o=n[e])||void 0===o?void 0:o.slug}`},w=i?(0,h.__)("Mixed"):null,B=i?(0,h.__)("Mixed"):E(k),I=d.map(((e,t)=>({key:t,name:e.name}))),x=n.map(((e,t)=>({value:t,label:void 0}))),T=(0,h.sprintf)(// translators: 1: The side of the block being modified (top, bottom, left, etc.). 2. Type of spacing being modified (Padding, margin, etc)
|
9 |
+
(0,h.__)("%1$s %2$s"),Po[r],null==a?void 0:a.toLowerCase()),N=g&&!v&&void 0!==B;return(0,s.createElement)(s.Fragment,null,"all"!==r&&(0,s.createElement)(p.__experimentalHStack,{className:"components-spacing-sizes-control__side-labels"},(0,s.createElement)(p.__experimentalText,{className:"components-spacing-sizes-control__side-label"},Po[r]),N&&(0,s.createElement)(p.__experimentalText,{className:"components-spacing-sizes-control__hint-single"},B)),"all"===r&&N&&(0,s.createElement)(p.__experimentalText,{className:"components-spacing-sizes-control__hint-all"},B),!f&&(0,s.createElement)(p.Button,{label:v?(0,h.__)("Use size preset"):(0,h.__)("Set custom size"),icon:rr,onClick:()=>{b(!v)},isPressed:v,isSmall:!0,className:c()({"components-spacing-sizes-control__custom-toggle-all":"all"===r,"components-spacing-sizes-control__custom-toggle-single":"all"!==r}),iconSize:24}),v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalUnitControl,{onChange:e=>l((e=>isNaN(parseFloat(e))?void 0:e)(e)),value:k,units:_,min:u,placeholder:w,disableUnits:i,label:T,hideLabelFromVision:!0,className:"components-spacing-sizes-control__custom-value-input"}),(0,s.createElement)(p.RangeControl,{value:C,min:0,max:100,withInputField:!1,onChange:e=>{l([e,y].join(""))},className:"components-spacing-sizes-control__custom-value-range"})),g&&!v&&(0,s.createElement)(p.RangeControl,{className:"components-spacing-sizes-control__range-control",value:k,onChange:e=>l(S(e)),onMouseDown:e=>{var t;(null==e||null===(t=e.nativeEvent)||void 0===t?void 0:t.offsetX)<35&&void 0===o&&l("0")},withInputField:!1,"aria-valuenow":k,"aria-valuetext":null===(t=n[k])||void 0===t?void 0:t.name,renderTooltipContent:E,min:0,max:n.length-1,marks:x,label:T,hideLabelFromVision:!0}),!g&&!v&&(0,s.createElement)(p.CustomSelectControl,{className:"components-spacing-sizes-control__custom-select-control",value:I.find((e=>e.key===k))||"",onChange:e=>{l(S(e.selectedItem.key,"selectList"))},options:I,label:T,hideLabelFromVision:!0,__nextUnconstrainedWidth:!0}))}function ir(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Mo(Object.values(e))}(n),c=Do(n)&&Ao(n,o);return(0,s.createElement)(lr,{value:a,onChange:e=>{const r=(0,p.__experimentalApplyValueToSides)(n,e,o);t(r)},side:"all",spacingSizes:r,isMixed:c,type:l,minimumCustomValue:i})}function sr(e){let{values:t,sides:n,onChange:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=null!=n&&n.length?Ro.filter((e=>n.includes(e))):Ro,c=e=>n=>{const r={...t};r[e]=n,o(r)};return(0,s.createElement)(s.Fragment,null,a.map((e=>(0,s.createElement)(lr,{value:t[e],label:Po[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,onChange:c(e),spacingSizes:r,type:l,minimumCustomValue:i}))))}const ar=["vertical","horizontal"];function cr(e){let{onChange:t,values:n,sides:o,spacingSizes:r,type:l,minimumCustomValue:i}=e;const a=e=>o=>{if(!t)return;const r={...n};"vertical"===e&&(r.top=o,r.bottom=o),"horizontal"===e&&(r.left=o,r.right=o),t(r)},c=null!=o&&o.length?ar.filter((e=>o.includes(e))):ar;return(0,s.createElement)(s.Fragment,null,c.map((e=>{const t="vertical"===e?n.top:n.left;return(0,s.createElement)(lr,{value:t,onChange:a(e),label:Po[e],key:`spacing-sizes-control-${e}`,withInputField:!1,side:e,spacingSizes:r,type:l,minimumCustomValue:i})})))}const ur=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.2H14v1.5h1.6c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.8 0 5.2-2.3 5.2-5.2 0-2.9-2.3-5.2-5.2-5.2zM4.7 12.4c0-2 1.7-3.7 3.7-3.7H10V7.2H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H10v-1.5H8.4c-2 0-3.7-1.7-3.7-3.7zm4.6.9h5.3v-1.5H9.3v1.5z"})),dr=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M15.6 7.3h-.7l1.6-3.5-.9-.4-3.9 8.5H9v1.5h2l-1.3 2.8H8.4c-2 0-3.7-1.7-3.7-3.7s1.7-3.7 3.7-3.7H10V7.3H8.4c-2.9 0-5.2 2.3-5.2 5.2 0 2.9 2.3 5.2 5.2 5.2H9l-1.4 3.2.9.4 5.7-12.5h1.4c2 0 3.7 1.7 3.7 3.7s-1.7 3.7-3.7 3.7H14v1.5h1.6c2.9 0 5.2-2.3 5.2-5.2 0-2.9-2.4-5.2-5.2-5.2z"}));function pr(e){let{isLinked:t,onClick:n}=e;const o=t?(0,h.__)("Unlink Sides"):(0,h.__)("Link Sides");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)("span",{className:"component-spacing-sizes-control__linked-button"},(0,s.createElement)(p.Button,{variant:t?"primary":"secondary",isSmall:!0,icon:t?ur:dr,iconSize:16,"aria-label":o,onClick:n})))}function mr(e){let{inputProps:t,onChange:n,label:o=(0,h.__)("Spacing Control"),values:r,sides:l,splitOnAxis:a=!1,useSelect:c,minimumCustomValue:u=0}=e;const d=[{name:0,slug:"0",size:0},...Vo("spacing.spacingSizes")||[]];d.length>8&&d.unshift({name:(0,h.__)("Default"),slug:"default",size:void 0});const m=r||Lo,g=Do(r),f=1===(null==l?void 0:l.length),[v,b]=(0,s.useState)(!g||!Ao(m,l)||f),_={...t,onChange:e=>{const t={...r,...e};n(t)},isLinked:v,sides:l,values:m,spacingSizes:d,useSelect:c,type:o,minimumCustomValue:u};return(0,s.createElement)("fieldset",{role:"region",className:"component-spacing-sizes-control"},(0,s.createElement)(p.__experimentalText,{as:"legend"},o),!f&&(0,s.createElement)(pr,{onClick:()=>{b(!v)},isLinked:v}),v&&(0,s.createElement)(ir,i({"aria-label":o},_)),!v&&a&&(0,s.createElement)(cr,_),!v&&!a&&(0,s.createElement)(sr,_))}function gr(e){const t=(0,r.getBlockSupport)(e,Er);return!!(!0===t||null!=t&&t.margin)}function hr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Vo("spacing.margin"),n=!xr(e,"margin");return!gr(e)||t||n}function fr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l}=e,i=Vo("spacing.spacingSizes"),a=(0,p.__experimentalUseCustomUnits)({availableUnits:Vo("spacing.units")||["%","px","em","rem","vw"]}),c=Ir(o,"margin"),u=c&&c.some((e=>Sr.includes(e)));if(hr(e))return null;const d=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,margin:e}};l({style:Wo(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(p.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(mr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.margin,onChange:d,label:(0,h.__)("Margin"),sides:c,units:a,allowReset:!1,splitOnAxis:!1})),native:null})}function vr(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin,i=Vo("spacing.spacingSizes"),a=(0,s.useMemo)((()=>{const e=null!=l&&l.top?xo(null==l?void 0:l.top,i):0,t=null!=l&&l.right?xo(null==l?void 0:l.right,i):0,n=null!=l&&l.bottom?xo(null==l?void 0:l.bottom,i):0,o=null!=l&&l.left?xo(null==l?void 0:l.left,i):0;return{borderTopWidth:e,borderRightWidth:t,borderBottomWidth:n,borderLeftWidth:o,top:0!==e?`-${e}`:0,right:0!==t?`-${t}`:0,bottom:0!==n?`-${n}`:0,left:0!==o?`-${o}`:0}}),[l]),[c,u]=(0,s.useState)(!1),d=(0,s.useRef)(l),p=(0,s.useRef)(),m=()=>{p.current&&window.clearTimeout(p.current)};return(0,s.useEffect)((()=>(tr()(l,d.current)||(u(!0),d.current=l,m(),p.current=setTimeout((()=>{u(!1)}),400)),()=>m())),[l]),c?(0,s.createElement)(or,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:a})):null}function br(e){const t=(0,r.getBlockSupport)(e,Er);return!!(!0===t||null!=t&&t.padding)}function _r(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Vo("spacing.padding"),n=!xr(e,"padding");return!br(e)||t||n}function kr(e){var t,n;const{name:o,attributes:{style:r},setAttributes:l}=e,i=Vo("spacing.spacingSizes"),a=(0,p.__experimentalUseCustomUnits)({availableUnits:Vo("spacing.units")||["%","px","em","rem","vw"]}),c=Ir(o,"padding"),u=c&&c.some((e=>Sr.includes(e)));if(_r(e))return null;const d=e=>{const t={...r,spacing:{...null==r?void 0:r.spacing,padding:e}};l({style:Wo(t)})};return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,(!i||0===(null==i?void 0:i.length))&&(0,s.createElement)(p.__experimentalBoxControl,{values:null==r||null===(t=r.spacing)||void 0===t?void 0:t.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u}),(null==i?void 0:i.length)>0&&(0,s.createElement)(mr,{values:null==r||null===(n=r.spacing)||void 0===n?void 0:n.padding,onChange:d,label:(0,h.__)("Padding"),sides:c,units:a,allowReset:!1,splitOnAxis:u})),native:null})}function yr(e){var t,n;let{clientId:o,attributes:r}=e;const l=null==r||null===(t=r.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding,i=(0,s.useMemo)((()=>({borderTopWidth:Io(null==l?void 0:l.top)?To(null==l?void 0:l.top):null==l?void 0:l.top,borderRightWidth:Io(null==l?void 0:l.right)?To(null==l?void 0:l.right):null==l?void 0:l.right,borderBottomWidth:Io(null==l?void 0:l.bottom)?To(null==l?void 0:l.bottom):null==l?void 0:l.bottom,borderLeftWidth:Io(null==l?void 0:l.left)?To(null==l?void 0:l.left):null==l?void 0:l.left})),[l]),[a,c]=(0,s.useState)(!1),u=(0,s.useRef)(l),d=(0,s.useRef)(),p=()=>{d.current&&window.clearTimeout(d.current)};return(0,s.useEffect)((()=>(tr()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(or,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Er="spacing",Cr=["top","right","bottom","left"],Sr=["vertical","horizontal"];function wr(e){const t=Lr(e),n=_r(e),o=hr(e),l=Br(e),i=(u=e.name,"web"===s.Platform.OS&&(Tr(u)||br(u)||gr(u))),a=Vo("spacing.spacingSizes");var u;if(l||!i)return null;const d=(0,r.getBlockSupport)(e.name,[Er,"__experimentalDefaultControls"]),m=e=>t=>{var n;return{...t,style:{...t.style,spacing:{...null===(n=t.style)||void 0===n?void 0:n.spacing,[e]:void 0}}}};return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Jo,{__experimentalGroup:"dimensions"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:c()({"tools-panel-item-spacing":a&&a.length>0}),hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.padding)}(e),label:(0,h.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Wo({...o,spacing:{...null==o?void 0:o.spacing,padding:void 0}})})}(e),resetAllFilter:m("padding"),isShownByDefault:null==d?void 0:d.padding,panelId:e.clientId},(0,s.createElement)(kr,e)),!o&&(0,s.createElement)(p.__experimentalToolsPanelItem,{className:c()({"tools-panel-item-spacing":a&&a.length>0}),hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.margin)}(e),label:(0,h.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Wo({...o,spacing:{...null==o?void 0:o.spacing,margin:void 0}})})}(e),resetAllFilter:m("margin"),isShownByDefault:null==d?void 0:d.margin,panelId:e.clientId},(0,s.createElement)(fr,e)),!t&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;return void 0!==(null===(t=e.attributes.style)||void 0===t||null===(n=t.spacing)||void 0===n?void 0:n.blockGap)}(e),label:(0,h.__)("Block spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:{...o,spacing:{...null==o?void 0:o.spacing,blockGap:void 0}}})}(e),resetAllFilter:m("blockGap"),isShownByDefault:null==d?void 0:d.blockGap,panelId:e.clientId},(0,s.createElement)(Rr,e))),!n&&(0,s.createElement)(yr,e),!o&&(0,s.createElement)(vr,e))}const Br=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Lr(e),n=_r(e),o=hr(e);return t&&n&&o};function Ir(e,t){var n;const o=(0,r.getBlockSupport)(e,Er);if(o&&"boolean"!=typeof o[t])return Array.isArray(o[t])?o[t]:null!==(n=o[t])&&void 0!==n&&n.sides?o[t].sides:void 0}function xr(e,t){const n=Ir(e,t);return!(n&&n.some((e=>Cr.includes(e)))&&n.some((e=>Sr.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function Tr(e){const t=(0,r.getBlockSupport)(e,Er);return!!(!0===t||null!=t&&t.blockGap)}function Nr(e){if(!e)return null;const t="string"==typeof e;return{top:To(t?e:null==e?void 0:e.top),left:To(t?e:null==e?void 0:e.left)}}function Pr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=Nr(e);if(!n)return null;const o=(null==n?void 0:n.top)||t,r=(null==n?void 0:n.left)||t;return o===r?o:`${o} ${r}`}function Lr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Vo("spacing.blockGap");return!Tr(e)||t}function Rr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:Vo("spacing.units")||["%","px","em","rem","vw"]}),a=Ir(r,"blockGap"),c=wo(n);if(Lr(e))return null;const u=a&&a.some((e=>Sr.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...Nr(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Wo(r)});const i=(null===(t=window)||void 0===t?void 0:t.navigator.userAgent)&&window.navigator.userAgent.includes("Safari")&&!window.navigator.userAgent.includes("Chrome ")&&!window.navigator.userAgent.includes("Chromium ");var s;c.current&&i&&(null===(s=c.current.parentNode)||void 0===s||s.replaceChild(c.current,c.current))},m=Nr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),g=u?{...m,right:null==m?void 0:m.left,bottom:null==m?void 0:m.top}:null==m?void 0:m.top;return s.Platform.select({web:(0,s.createElement)(s.Fragment,null,u?(0,s.createElement)(p.__experimentalBoxControl,{label:(0,h.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:g,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:g})),native:null})}const Mr=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z"})),Ar=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z"})),Dr={top:{icon:(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9 20h6V9H9v11zM4 4v1.5h16V4H4z"})),title:(0,h._x)("Align top","Block vertical alignment setting")},center:{icon:Ar,title:(0,h._x)("Align middle","Block vertical alignment setting")},bottom:{icon:Mr,title:(0,h._x)("Align bottom","Block vertical alignment setting")}},Or=["top","center","bottom"],Fr={isAlternate:!0},zr=function(e){let{value:t,onChange:n,controls:o=Or,isCollapsed:r=!0,isToolbar:l}=e;const a=Dr[t],c=Dr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:Fr,icon:a?a.icon:c.icon,label:(0,h._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...Dr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))},Vr=e=>(0,s.createElement)(zr,i({},e,{isToolbar:!1})),Hr=e=>(0,s.createElement)(zr,i({},e,{isToolbar:!0})),Ur={left:mo,center:go,right:ho,"space-between":fo},Gr=function(e){let{allowedControls:t=["left","center","right","space-between"],isCollapsed:n=!0,onChange:o,value:r,popoverProps:l,isToolbar:a}=e;const c=e=>{o(e===r?void 0:e)},u=r?Ur[r]:Ur.left,d=[{name:"left",icon:mo,title:(0,h.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:go,title:(0,h.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ho,title:(0,h.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:fo,title:(0,h.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,g=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,h.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},g))},Wr=e=>(0,s.createElement)(Gr,i({},e,{isToolbar:!1})),$r=e=>(0,s.createElement)(Gr,i({},e,{isToolbar:!0})),jr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},Kr={left:"flex-start",right:"flex-end",center:"center"},qr={top:"flex-start",center:"center",bottom:"flex-end"},Yr=["wrap","nowrap"],Zr={name:"flex",label:(0,h.__)("Flex"),inspectorControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o={}}=e;const{allowOrientation:r=!0}=o;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Flex,null,(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Xr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(el,{layout:t,onChange:n}))),(0,s.createElement)(Jr,{layout:t,onChange:n}))},toolBarControls:function(e){let{layout:t={},onChange:n,layoutBlockSupport:o}=e;if(null!=o&&o.allowSwitching)return null;const{allowVerticalAlignment:r=!0}=o;return(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Xr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Qr,{layout:t,onChange:n,isToolbar:!0}))},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{orientation:c="horizontal"}=r,u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Ko(i,"spacing","blockGap")?Pr(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):void 0,d=jr[r.justifyContent],p=Yr.includes(r.flexWrap)?r.flexWrap:"wrap",m=qr[r.verticalAlignment],g=Kr[r.justifyContent]||Kr.left;let h="";const f=[];return p&&"wrap"!==p&&f.push(`flex-wrap: ${p}`),"horizontal"===c?(m&&f.push(`align-items: ${m}`),d&&f.push(`justify-content: ${d}`)):(f.push("flex-direction: column"),f.push(`align-items: ${g}`)),f.length&&(h=`${_o(o)} {\n\t\t\t\t${f.join("; ")};\n\t\t\t}`),s&&u&&(h+=ko(o,a,"flex",u)),h},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Qr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=qr.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(Vr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,h.__)("Align items top")},{value:"center",label:(0,h.__)("Align items center")},{value:"flex-end",label:(0,h.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,h.__)("Vertical alignment")),(0,s.createElement)("div",null,i.map(((e,t,n)=>(0,s.createElement)(p.Button,{key:e,label:n,icon:t,isPressed:r===e,onClick:()=>l(e)})))))}function Xr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{justifyContent:r="left",orientation:l="horizontal"}=t,i=e=>{n({...t,justifyContent:e})},a=["left","center","right"];if("horizontal"===l&&a.push("space-between"),o)return(0,s.createElement)(Wr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:mo,label:(0,h.__)("Justify items left")},{value:"center",icon:go,label:(0,h.__)("Justify items center")},{value:"right",icon:ho,label:(0,h.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:fo,label:(0,h.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,h.__)("Justification")),(0,s.createElement)("div",null,c.map((e=>{let{value:t,icon:n,label:o}=e;return(0,s.createElement)(p.Button,{key:t,label:o,icon:n,isPressed:r===t,onClick:()=>i(t)})}))))}function Jr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,h.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function el(e){let{layout:t,onChange:n}=e;const{orientation:o="horizontal"}=t;return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-orientation-controls"},(0,s.createElement)("legend",null,(0,h.__)("Orientation")),(0,s.createElement)(p.Button,{label:(0,h.__)("Horizontal"),icon:vo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:(0,h.__)("Vertical"),icon:bo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}const tl={name:"default",label:(0,h.__)("Flow"),inspectorControls:function(){return null},toolBarControls:function(){return null},getLayoutStyle:function(e){var t;let{selector:n,style:o,blockName:r,hasBlockGapSupport:l,layoutDefinitions:i}=e;const s=Nr(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),a=null!=s&&s.top&&!Ko(r,"spacing","blockGap")?null==s?void 0:s.top:"";let c="";return l&&a&&(c+=ko(n,i,"default",a)),c},getOrientation:()=>"vertical",getAlignments(e){const t=yo(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}},nl=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},ol=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),rl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),ll="var:";function il(e,t,n,o){const r=(0,u.get)(e,n);return r?[{selector:null==t?void 0:t.selector,key:o,value:al(r)}]:[]}function sl(e,t,n,o){let r=arguments.length>4&&void 0!==arguments[4]?arguments[4]:["top","right","bottom","left"];const l=(0,u.get)(e,n);if(!l)return[];const i=[];if("string"==typeof l)i.push({selector:null==t?void 0:t.selector,key:o.default,value:l});else{const e=r.reduce(((e,n)=>{const r=al((0,u.get)(l,[n]));return r&&e.push({selector:null==t?void 0:t.selector,key:null==o?void 0:o.individual.replace("%s",cl(n)),value:r}),e}),[]);i.push(...e)}return i}function al(e){return"string"==typeof e&&e.startsWith(ll)?`var(--wp--${e.slice(ll.length).split("|").join("--")})`:e}function cl(e){let[t,...n]=e;return t.toUpperCase()+n.join("")}const ul={name:"radius",generate:(e,t)=>sl(e,t,["border","radius"],{default:"borderRadius",individual:"border%sRadius"},["topLeft","topRight","bottomLeft","bottomRight"])},dl=[{name:"color",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","color"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderColor";return il(e,t,n,o)}},{name:"style",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","style"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderStyle";return il(e,t,n,o)}},{name:"width",generate:function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["border","width"],o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"borderWidth";return il(e,t,n,o)}}],pl=e=>(t,n)=>{var o;const r=null==t||null===(o=t.border)||void 0===o?void 0:o[e];return r?dl.reduce(((o,l)=>{const i=l.name;if(r.hasOwnProperty(i)&&"function"==typeof l.generate){const r=`border${cl(e)}${cl(i)}`;o.push(...l.generate(t,n,["border",e,i],r))}return o}),[]):[]},ml={name:"borderTop",generate:pl("top")},gl={name:"borderRight",generate:pl("right")},hl={name:"borderBottom",generate:pl("bottom")},fl={name:"borderLeft",generate:pl("left")},vl=[...dl,ul,ml,gl,hl,fl,{name:"text",generate:(e,t)=>il(e,t,["color","text"],"color")},{name:"gradient",generate:(e,t)=>il(e,t,["color","gradient"],"background")},{name:"background",generate:(e,t)=>il(e,t,["color","background"],"backgroundColor")},{name:"margin",generate:(e,t)=>sl(e,t,["spacing","margin"],{default:"margin",individual:"margin%s"})},{name:"padding",generate:(e,t)=>sl(e,t,["spacing","padding"],{default:"padding",individual:"padding%s"})},{name:"fontFamily",generate:(e,t)=>il(e,t,["typography","fontFamily"],"fontFamily")},{name:"fontSize",generate:(e,t)=>il(e,t,["typography","fontSize"],"fontSize")},{name:"fontStyle",generate:(e,t)=>il(e,t,["typography","fontStyle"],"fontStyle")},{name:"fontWeight",generate:(e,t)=>il(e,t,["typography","fontWeight"],"fontWeight")},{name:"letterSpacing",generate:(e,t)=>il(e,t,["typography","letterSpacing"],"letterSpacing")},{name:"letterSpacing",generate:(e,t)=>il(e,t,["typography","lineHeight"],"lineHeight")},{name:"textDecoration",generate:(e,t)=>il(e,t,["typography","textDecoration"],"textDecoration")},{name:"textTransform",generate:(e,t)=>il(e,t,["typography","textTransform"],"textTransform")}];function bl(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=_l(e,t);if(null==t||!t.selector){const e=[];return n.forEach((t=>{e.push(`${(0,u.kebabCase)(t.key)}: ${t.value};`)})),e.join(" ")}const o=(0,u.groupBy)(n,"selector"),r=Object.keys(o).reduce(((e,t)=>(e.push(`${t} { ${o[t].map((e=>`${(0,u.kebabCase)(e.key)}: ${e.value};`)).join(" ")} }`),e)),[]);return r.join("\n")}function _l(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=[];return vl.forEach((o=>{"function"==typeof o.generate&&n.push(...o.generate(e,t))})),n}const kl=[tl,Zr,{name:"constrained",label:(0,h.__)("Constrained"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Vo("spacing.units")||["%","px","em","rem","vw"]});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls"},(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Content"),labelPosition:"top",__unstableInputWidth:"80px",value:r||o||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,contentSize:e})},units:l}),(0,s.createElement)(nl,{icon:ol})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,h.__)("Wide"),labelPosition:"top",__unstableInputWidth:"80px",value:o||r||"",onChange:e=>{e=0>parseFloat(e)?"0":e,n({...t,wideSize:e})},units:l}),(0,s.createElement)(nl,{icon:rl}))),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-reset"},(0,s.createElement)(p.Button,{variant:"secondary",isSmall:!0,disabled:!r&&!o,onClick:()=>n({contentSize:void 0,wideSize:void 0,inherit:!1})},(0,h.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,h.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},getLayoutStyle:function(e){var t,n;let{selector:o,layout:r={},style:l,blockName:i,hasBlockGapSupport:s,layoutDefinitions:a}=e;const{contentSize:c,wideSize:u}=r,d=Nr(null==l||null===(t=l.spacing)||void 0===t?void 0:t.blockGap),p=null!=d&&d.top&&!Ko(i,"spacing","blockGap")?null==d?void 0:d.top:"";let m=c||u?`\n\t\t\t\t\t${_o(o,"> :where(:not(.alignleft):not(.alignright):not(.alignfull))")} {\n\t\t\t\t\t\tmax-width: ${null!=c?c:u};\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\t\t\t\t\t${_o(o,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=u?u:c};\n\t\t\t\t\t}\n\t\t\t\t\t${_o(o,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return null!=l&&null!==(n=l.spacing)&&void 0!==n&&n.padding&&_l(l).forEach((e=>{"paddingRight"===e.key?m+=`\n\t\t\t\t\t${_o(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-right: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`:"paddingLeft"===e.key&&(m+=`\n\t\t\t\t\t${_o(o,"> .alignfull")} {\n\t\t\t\t\t\tmargin-left: calc(${e.value} * -1);\n\t\t\t\t\t}\n\t\t\t\t\t`)})),s&&p&&(m+=ko(o,a,"constrained",p)),m},getOrientation:()=>"vertical",getAlignments(e){const t=yo(e);if(void 0!==e.alignments)return e.alignments.includes("none")||e.alignments.unshift("none"),e.alignments.map((e=>({name:e,info:t[e]})));const{contentSize:n,wideSize:o}=e,r=[{name:"left"},{name:"center"},{name:"right"}];return n&&r.unshift({name:"full"}),o&&r.unshift({name:"wide",info:t.wide}),r.unshift({name:"none",info:t.none}),r}}];function yl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return kl.find((t=>t.name===e))}const El={type:"default"},Cl=(0,s.createContext)(El),Sl=Cl.Provider;function wl(){return(0,s.useContext)(Cl)}function Bl(e){let{layout:t={},css:n,...o}=e;const r=yl(t.type),l=null!==Vo("spacing.blockGap");if(r){var i;if(n)return(0,s.createElement)("style",null,n);const e=null===(i=r.getLayoutStyle)||void 0===i?void 0:i.call(r,{hasBlockGapSupport:l,layout:t,...o});if(e)return(0,s.createElement)("style",null,e)}return null}const Il=["none","left","center","right","wide","full"],xl=["wide","full"];function Tl(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Il;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(to),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=wl(),r=yl(null==o?void 0:o.type),l=r.getAlignments(o);if(n){const t=l.filter((t=>{let{name:n}=t;return e.includes(n)}));return 1===t.length&&"none"===t[0].name?[]:t}if("default"!==r.name&&"constrained"!==r.name)return[];const{alignments:i=Il}=o,s=e.filter((e=>(o.alignments||t||!xl.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Nl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Pl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Ll=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Rl=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),Ml={none:{icon:Nl,title:(0,h._x)("None","Alignment option")},left:{icon:Pl,title:(0,h.__)("Align left")},center:{icon:ol,title:(0,h.__)("Align center")},right:{icon:Ll,title:(0,h.__)("Align right")},wide:{icon:rl,title:(0,h.__)("Wide width")},full:{icon:Rl,title:(0,h.__)("Full width")}},Al={isAlternate:!0},Dl=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Tl(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Ml[t],m=Ml.none,g=r?p.ToolbarGroup:p.ToolbarDropdownMenu,f={popoverProps:Al,icon:d?d.icon:m.icon,label:(0,h.__)("Align"),toggleProps:{describedBy:(0,h.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...Ml[n],isActive:t===n||!t&&"none"===n,role:l?"menuitemradio":void 0,onClick:()=>u(n)}}))}:{children:e=>{let{onClose:n}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-alignment-control__menu-group"},a.map((e=>{let{name:o,info:r}=e;const{icon:l,title:i}=Ml[o],a=o===t||!t&&"none"===o;return(0,s.createElement)(p.MenuItem,{key:o,icon:l,iconPosition:"left",className:c()("components-dropdown-menu__menu-item",{"is-active":a}),isSelected:a,onClick:()=>{u(o),n()},role:"menuitemradio",info:r},i)}))))}};return(0,s.createElement)(g,i({},f,v))},Ol=e=>(0,s.createElement)(Dl,i({},e,{isToolbar:!1})),Fl=e=>(0,s.createElement)(Dl,i({},e,{isToolbar:!0})),zl=["left","center","right","wide","full"],Vl=["wide","full"];function Hl(e){let t,n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],o=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];return t=Array.isArray(e)?zl.filter((t=>e.includes(t))):!0===e?[...zl]:[],!o||!0===e&&!n?(0,u.without)(t,...Vl):t}const Ul=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Tl(Hl((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0))).map((e=>{let{name:t}=e;return t}));return(0,s.createElement)(s.Fragment,null,!!o.length&&(0,s.createElement)(po,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Ol,{value:t.attributes.align,onChange:e=>{if(!e){var n,o;const l=(0,r.getBlockType)(t.name);(null==l||null===(n=l.attributes)||void 0===n||null===(o=n.align)||void 0===o?void 0:o.default)&&(e="")}t.setAttributes({align:e})},controls:o})),(0,s.createElement)(e,t))}),"withToolbarControls"),Gl=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Tl(Hl((0,r.getBlockSupport)(n,"align"),(0,r.hasBlockSupport)(n,"alignWide",!0)));if(void 0===l)return(0,s.createElement)(e,t);let c=t.wrapperProps;return a.some((e=>e.name===l))&&(c={...c,"data-align":l}),(0,s.createElement)(e,i({},t,{wrapperProps:c}))}));(0,l.addFilter)("blocks.registerBlockType","core/align/addAttribute",(function(e){return(0,u.has)(e.attributes,["align","type"])||(0,r.hasBlockSupport)(e,"align")&&(e.attributes={...e.attributes,align:{type:"string",enum:[...zl,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Gl),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Ul),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Hl((0,r.getBlockSupport)(t,"align"),(0,r.hasBlockSupport)(t,"alignWide",!0)).includes(o)&&(e.className=c()(`align${o}`,e.className)),e})),(0,l.addFilter)("blocks.registerBlockType","core/lock/addAttribute",(function(e){return(0,u.has)(e.attributes,["lock","type"])||(e.attributes={...e.attributes,lock:{type:"object"}}),e}));const Wl=/[\s#]/g,$l={type:"string",source:"attribute",attribute:"id",selector:"*"},jl=(0,d.createHigherOrderComponent)((e=>t=>{if((0,r.hasBlockSupport)(t.name,"anchor")&&t.isSelected){const n="web"===s.Platform.OS,o=(0,s.createElement)(p.TextControl,{className:"html-anchor-control",label:(0,h.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,h.__)("Enter a word or two — without spaces — to make a unique web address just for this block, called an “anchor.” Then, you’ll be able to link directly to this section of your page."),n&&(0,s.createElement)(p.ExternalLink,{href:(0,h.__)("https://wordpress.org/support/article/page-jumps/")},(0,h.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,h.__)("Add an anchor"),onChange:e=>{e=e.replace(Wl,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Jo,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Jo,null,(0,s.createElement)(p.PanelBody,{title:(0,h.__)("Heading settings")},o)))}return(0,s.createElement)(e,t)}),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/anchor/attribute",(function(e){return(0,u.has)(e.attributes,["anchor","type"])||(0,r.hasBlockSupport)(e,"anchor")&&(e.attributes={...e.attributes,anchor:$l}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",jl),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/anchor/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"anchor")&&(e.id=""===n.anchor?null:n.anchor),e}));const Kl={type:"string",source:"attribute",attribute:"aria-label",selector:"*"};(0,l.addFilter)("blocks.registerBlockType","core/ariaLabel/attribute",(function(e){var t,n;return null!=e&&null!==(t=e.attributes)&&void 0!==t&&null!==(n=t.ariaLabel)&&void 0!==n&&n.type||(0,r.hasBlockSupport)(e,"ariaLabel")&&(e.attributes={...e.attributes,ariaLabel:Kl}),e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/ariaLabel/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"ariaLabel")&&(e["aria-label"]=""===n.ariaLabel?null:n.ariaLabel),e}));const ql=(0,d.createHigherOrderComponent)((e=>t=>(0,r.hasBlockSupport)(t.name,"customClassName",!0)&&t.isSelected?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),(0,s.createElement)(Jo,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,h.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,h.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");(0,l.addFilter)("blocks.registerBlockType","core/custom-class-name/attribute",(function(e){return(0,r.hasBlockSupport)(e,"customClassName",!0)&&(e.attributes={...e.attributes,className:{type:"string"}}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/custom-class-name/with-inspector-control",ql),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/custom-class-name/save-props",(function(e,t,n){return(0,r.hasBlockSupport)(t,"customClassName",!0)&&n.className&&(e.className=c()(e.className,n.className)),e})),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){if(!(0,r.hasBlockSupport)(e.name,"customClassName",!0))return e;if(1===o.length&&e.innerBlocks.length===t.length)return e;if(1===o.length&&t.length>1||o.length>1&&1===t.length)return e;if(t[n]){var l;const o=null===(l=t[n])||void 0===l?void 0:l.attributes.className;if(o)return{...e,attributes:{...e.attributes,className:o}}}return e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/generated-class-name/save-props",(function(e,t){return(0,r.hasBlockSupport)(t,"className",!0)&&("string"==typeof e.className?e.className=[...new Set([(0,r.getBlockDefaultClassName)(t.name),...e.className.split(" ")])].join(" ").trim():e.className=(0,r.getBlockDefaultClassName)(t.name)),e}));const Yl=window.wp.dom,Zl=(0,s.createContext)({});function Ql(e){let{value:t,children:n}=e;const o=(0,s.useContext)(Zl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(Zl.Provider,{value:r,children:n})}const Xl=Zl,Jl={},ei=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(Xl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):Jl),[o,l]);if(!o)return null;const d=o.edit||o.save;if(o.apiVersion>1)return(0,s.createElement)(d,i({},e,{context:a}));const p=(0,r.hasBlockSupport)(o,"className",!0)?(0,r.getBlockDefaultClassName)(n):null,m=c()(p,t.className);return(0,s.createElement)(d,i({},e,{context:a,className:m}))}));function ti(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(ro,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(ei,e))}const ni=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),oi=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(0,s.createElement)("div",{style:{display:"contents",all:"initial"}},(0,s.createElement)("div",{className:c()(t,"block-editor-warning")},(0,s.createElement)("div",{className:"block-editor-warning__contents"},(0,s.createElement)("p",{className:"block-editor-warning__message"},o),(s.Children.count(n)>0||r)&&(0,s.createElement)("div",{className:"block-editor-warning__actions"},s.Children.count(n)>0&&s.Children.map(n,((e,t)=>(0,s.createElement)("span",{key:t,className:"block-editor-warning__action"},e))),r&&(0,s.createElement)(p.DropdownMenu,{className:"block-editor-warning__secondary",icon:ni,label:(0,h.__)("More options"),popoverProps:{position:"bottom left",className:"block-editor-warning__dropdown"},noIcons:!0},(()=>(0,s.createElement)(p.MenuGroup,null,r.map(((e,t)=>(0,s.createElement)(p.MenuItem,{onClick:e.onClick,key:t},e.title))))))))))};var ri=n(1973);function li(e){let{title:t,rawContent:n,renderedContent:o,action:r,actionText:l,className:i}=e;return(0,s.createElement)("div",{className:i},(0,s.createElement)("div",{className:"block-editor-block-compare__content"},(0,s.createElement)("h2",{className:"block-editor-block-compare__heading"},t),(0,s.createElement)("div",{className:"block-editor-block-compare__html"},n),(0,s.createElement)("div",{className:"block-editor-block-compare__preview edit-post-visual-editor"},(0,s.createElement)(s.RawHTML,null,(0,Yl.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}const ii=function(e){let{block:t,onKeep:n,onConvert:o,convertor:l,convertButtonText:i}=e;const a=(d=l(t),(0,u.castArray)(d).map((e=>(0,r.getSaveContent)(e.name,e.attributes,e.innerBlocks))).join(""));var d;const p=(m=t.originalContent,g=a,(0,ri.Kx)(m,g).map(((e,t)=>{const n=c()({"block-editor-block-compare__added":e.added,"block-editor-block-compare__removed":e.removed});return(0,s.createElement)("span",{key:t,className:n},e.value)})));var m,g;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(li,{title:(0,h.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,h.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(li,{title:(0,h.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))},si=e=>(0,r.rawHandler)({HTML:e.originalContent}),ai=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(to).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(to);return{convertToClassic(){o(n.clientId,(e=>(0,r.createBlock)("core/freeform",{content:e.originalContent}))(n))},convertToHTML(){o(n.clientId,(e=>(0,r.createBlock)("core/html",{content:e.originalContent}))(n))},convertToBlocks(){o(n.clientId,si(n))},attemptBlockRecovery(){o(n.clientId,(e=>{let{name:t,attributes:n,innerBlocks:o}=e;return(0,r.createBlock)(t,n,o)})(n))}}}))])((function(e){let{convertToHTML:t,convertToBlocks:n,convertToClassic:o,attemptBlockRecovery:l,block:i}=e;const a=!!(0,r.getBlockType)("core/html"),[c,u]=(0,s.useState)(!1),d=(0,s.useCallback)((()=>u(!0)),[]),m=(0,s.useCallback)((()=>u(!1)),[]),g=(0,s.useMemo)((()=>[{
|
10 |
// translators: Button to fix block content
|
11 |
+
title:(0,h._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,h.__)("Convert to HTML"),onClick:t},{title:(0,h.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(oi,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,h.__)("Attempt Block Recovery"))],secondaryActions:g},(0,h.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
|
12 |
+
(0,h.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(ii,{block:i,onKeep:t,onConvert:n,convertor:si,convertButtonText:(0,h.__)("Convert to Blocks")})))})),ci=(0,s.createElement)(oi,{className:"block-editor-block-list__block-crash-warning"},(0,h.__)("This block has encountered an error and cannot be previewed.")),ui=()=>ci;class di extends s.Component{constructor(){super(...arguments),this.state={hasError:!1}}componentDidCatch(){this.setState({hasError:!0})}render(){return this.state.hasError?this.props.fallback:this.props.children}}const pi=di;var mi=n(773);const gi=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(to).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(mi.Z,{className:"block-editor-block-list__block-html-textarea",value:n,onBlur:()=>{const e=(0,r.getBlockType)(l.name);if(!e)return;const s=(0,r.getBlockAttributes)(e,n,l.attributes),a=n||(0,r.getSaveContent)(e,s),[c]=n?(0,r.validateBlock)({...l,attributes:s,originalContent:a}):[!0];i(t,{attributes:s,originalContent:a,isValid:c}),n||o({content:a})},onChange:e=>o(e.target.value)})};let hi=Pi();const fi=e=>Ii(e,hi);let vi=Pi();fi.write=e=>Ii(e,vi);let bi=Pi();fi.onStart=e=>Ii(e,bi);let _i=Pi();fi.onFrame=e=>Ii(e,_i);let ki=Pi();fi.onFinish=e=>Ii(e,ki);let yi=[];fi.setTimeout=(e,t)=>{let n=fi.now()+t,o=()=>{let e=yi.findIndex((e=>e.cancel==o));~e&&yi.splice(e,1),wi-=~e?1:0},r={time:n,handler:e,cancel:o};return yi.splice(Ei(n),0,r),wi+=1,xi(),r};let Ei=e=>~(~yi.findIndex((t=>t.time>e))||~yi.length);fi.cancel=e=>{bi.delete(e),_i.delete(e),hi.delete(e),vi.delete(e),ki.delete(e)},fi.sync=e=>{Bi=!0,fi.batchedUpdates(e),Bi=!1},fi.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,fi.onStart(n)}return o.handler=e,o.cancel=()=>{bi.delete(n),t=null},o};let Ci="undefined"!=typeof window?window.requestAnimationFrame:()=>{};fi.use=e=>Ci=e,fi.now="undefined"!=typeof performance?()=>performance.now():Date.now,fi.batchedUpdates=e=>e(),fi.catch=console.error,fi.frameLoop="always",fi.advance=()=>{"demand"!==fi.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ni()};let Si=-1,wi=0,Bi=!1;function Ii(e,t){Bi?(t.delete(e),e(0)):(t.add(e),xi())}function xi(){Si<0&&(Si=0,"demand"!==fi.frameLoop&&Ci(Ti))}function Ti(){~Si&&(Ci(Ti),fi.batchedUpdates(Ni))}function Ni(){let e=Si;Si=fi.now();let t=Ei(Si);t&&(Li(yi.splice(0,t),(e=>e.handler())),wi-=t),bi.flush(),hi.flush(e?Math.min(64,Si-e):16.667),_i.flush(),vi.flush(),ki.flush(),wi||(Si=-1)}function Pi(){let e=new Set,t=e;return{add(n){wi+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(wi-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,wi-=t.size,Li(t,(t=>t(n)&&e.add(t))),wi+=e.size,t=e)}}}function Li(e,t){e.forEach((e=>{try{t(e)}catch(e){fi.catch(e)}}))}var Ri=n(9196),Mi=n.n(Ri);function Ai(){}const Di={arr:Array.isArray,obj:e=>!!e&&"Object"===e.constructor.name,fun:e=>"function"==typeof e,str:e=>"string"==typeof e,num:e=>"number"==typeof e,und:e=>void 0===e};function Oi(e,t){if(Di.arr(e)){if(!Di.arr(t)||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}return e===t}const Fi=(e,t)=>e.forEach(t);function zi(e,t,n){if(Di.arr(e))for(let o=0;o<e.length;o++)t.call(n,e[o],`${o}`);else for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Vi=e=>Di.und(e)?[]:Di.arr(e)?e:[e];function Hi(e,t){if(e.size){const n=Array.from(e);e.clear(),Fi(n,t)}}const Ui=(e,...t)=>Hi(e,(e=>e(...t))),Gi=()=>"undefined"==typeof window||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent);let Wi,$i,ji=null,Ki=!1,qi=Ai;var Yi=Object.freeze({__proto__:null,get createStringInterpolator(){return Wi},get to(){return $i},get colors(){return ji},get skipAnimation(){return Ki},get willAdvance(){return qi},assign:e=>{e.to&&($i=e.to),e.now&&(fi.now=e.now),void 0!==e.colors&&(ji=e.colors),null!=e.skipAnimation&&(Ki=e.skipAnimation),e.createStringInterpolator&&(Wi=e.createStringInterpolator),e.requestAnimationFrame&&fi.use(e.requestAnimationFrame),e.batchedUpdates&&(fi.batchedUpdates=e.batchedUpdates),e.willAdvance&&(qi=e.willAdvance),e.frameLoop&&(fi.frameLoop=e.frameLoop)}});const Zi=new Set;let Qi=[],Xi=[],Ji=0;const es={get idle(){return!Zi.size&&!Qi.length},start(e){Ji>e.priority?(Zi.add(e),fi.onStart(ts)):(ns(e),fi(rs))},advance:rs,sort(e){if(Ji)fi.onFrame((()=>es.sort(e)));else{const t=Qi.indexOf(e);~t&&(Qi.splice(t,1),os(e))}},clear(){Qi=[],Zi.clear()}};function ts(){Zi.forEach(ns),Zi.clear(),fi(rs)}function ns(e){Qi.includes(e)||os(e)}function os(e){Qi.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(Qi),0,e)}function rs(e){const t=Xi;for(let n=0;n<Qi.length;n++){const o=Qi[n];Ji=o.priority,o.idle||(qi(o),o.advance(e),o.idle||t.push(o))}return Ji=0,Xi=Qi,Xi.length=0,Qi=t,Qi.length>0}const ls="[-+]?\\d*\\.?\\d+",is=ls+"%";function ss(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const as=new RegExp("rgb"+ss(ls,ls,ls)),cs=new RegExp("rgba"+ss(ls,ls,ls,ls)),us=new RegExp("hsl"+ss(ls,is,is)),ds=new RegExp("hsla"+ss(ls,is,is,ls)),ps=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,ms=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,gs=/^#([0-9a-fA-F]{6})$/,hs=/^#([0-9a-fA-F]{8})$/;function fs(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+6*(t-e)*n:n<.5?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function vs(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=fs(r,o,e+1/3),i=fs(r,o,e),s=fs(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function bs(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function _s(e){return(parseFloat(e)%360+360)%360/360}function ks(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ys(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Es(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=gs.exec(e))?parseInt(t[1]+"ff",16)>>>0:ji&&void 0!==ji[e]?ji[e]:(t=as.exec(e))?(bs(t[1])<<24|bs(t[2])<<16|bs(t[3])<<8|255)>>>0:(t=cs.exec(e))?(bs(t[1])<<24|bs(t[2])<<16|bs(t[3])<<8|ks(t[4]))>>>0:(t=ps.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=hs.exec(e))?parseInt(t[1],16)>>>0:(t=ms.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=us.exec(e))?(255|vs(_s(t[1]),ys(t[2]),ys(t[3])))>>>0:(t=ds.exec(e))?(vs(_s(t[1]),ys(t[2]),ys(t[3]))|ks(t[4]))>>>0:null}(e);return null===t?e:(t=t||0,`rgba(${(4278190080&t)>>>24}, ${(16711680&t)>>>16}, ${(65280&t)>>>8}, ${(255&t)/255})`)}const Cs=(e,t,n)=>{if(Di.fun(e))return e;if(Di.arr(e))return Cs({range:e,output:t,extrapolate:n});if(Di.str(e.output[0]))return Wi(e);const o=e,r=o.output,l=o.range||[0,1],i=o.extrapolateLeft||o.extrapolate||"extend",s=o.extrapolateRight||o.extrapolate||"extend",a=o.easing||(e=>e);return e=>{const t=function(e,t){for(var n=1;n<t.length-1&&!(t[n]>=e);++n);return n-1}(e,l);return function(e,t,n,o,r,l,i,s,a){let c=a?a(e):e;if(c<t){if("identity"===i)return c;"clamp"===i&&(c=t)}if(c>n){if("identity"===s)return c;"clamp"===s&&(c=n)}return o===r?o:t===n?e<=t?o:r:(t===-1/0?c=-c:n===1/0?c-=t:c=(c-t)/(n-t),c=l(c),o===-1/0?c=-c:r===1/0?c+=o:c=c*(r-o)+o,c)}(e,l[t],l[t+1],r[t],r[t+1],a,i,s,o.map)}};function Ss(){return(Ss=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const ws=Symbol.for("FluidValue.get"),Bs=Symbol.for("FluidValue.observers"),Is=e=>Boolean(e&&e[ws]),xs=e=>e&&e[ws]?e[ws]():e,Ts=e=>e[Bs]||null;function Ns(e,t){let n=e[Bs];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Ps{constructor(e){if(this[ws]=void 0,this[Bs]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Ls(this,e)}}const Ls=(e,t)=>As(e,ws,t);function Rs(e,t){if(e[ws]){let n=e[Bs];n||As(e,Bs,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Ms(e,t){let n=e[Bs];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Bs]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const As=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Ds=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Os=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,Fs=new RegExp(`(${Ds.source})(%|[a-z]+)`,"i"),zs=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Vs=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,Hs=e=>{const[t,n]=Us(e);if(!t||Gi())return e;const o=window.getComputedStyle(document.documentElement).getPropertyValue(t);if(o)return o.trim();if(n&&n.startsWith("--")){return window.getComputedStyle(document.documentElement).getPropertyValue(n)||e}return n&&Vs.test(n)?Hs(n):n||e},Us=e=>{const t=Vs.exec(e);if(!t)return[,];const[,n,o]=t;return[n,o]};let Gs;const Ws=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,$s=e=>{Gs||(Gs=ji?new RegExp(`(${Object.keys(ji).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>xs(e).replace(Vs,Hs).replace(Os,Es).replace(Gs,Es))),n=t.map((e=>e.match(Ds).map(Number))),o=n[0].map(((e,t)=>n.map((e=>{if(!(t in e))throw Error('The arity of each "output" value must be equal');return e[t]})))).map((t=>Cs(Ss({},e,{output:t}))));return e=>{var n;const r=!Fs.test(t[0])&&(null==(n=t.find((e=>Fs.test(e))))?void 0:n.replace(Ds,""));let l=0;return t[0].replace(Ds,(()=>`${o[l++](e)}${r||""}`)).replace(zs,Ws)}},js="react-spring: ",Ks=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${js}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},qs=Ks(console.warn),Ys=Ks(console.warn);function Zs(e){return Di.str(e)&&("#"==e[0]||/\d/.test(e)||!Gi()&&Vs.test(e)||e in(ji||{}))}const Qs="undefined"!=typeof window&&window.document&&window.document.createElement?Ri.useLayoutEffect:Ri.useEffect;function Xs(){const e=(0,Ri.useState)()[1],t=(()=>{const e=(0,Ri.useRef)(!1);return Qs((()=>(e.current=!0,()=>{e.current=!1})),[]),e})();return()=>{t.current&&e(Math.random())}}const Js=e=>(0,Ri.useEffect)(e,ea),ea=[];function ta(e){const t=(0,Ri.useRef)();return(0,Ri.useEffect)((()=>{t.current=e})),t.current}const na=Symbol.for("Animated:node"),oa=e=>e&&e[na],ra=(e,t)=>{return n=e,o=na,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},la=e=>e&&e[na]&&e[na].getPayload();class ia{constructor(){this.payload=void 0,ra(this,this)}getPayload(){return this.payload||[]}}class sa extends ia{constructor(e){super(),this.done=!0,this.elapsedTime=void 0,this.lastPosition=void 0,this.lastVelocity=void 0,this.v0=void 0,this.durationProgress=0,this._value=e,Di.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new sa(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Di.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value!==e&&(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,Di.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class aa extends sa{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Cs({output:[e,e]})}static create(e){return new aa(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Di.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else{if(!super.setValue(e))return!1;this._string=null}return!0}reset(e){e&&(this._toString=Cs({output:[this.getValue(),e]})),this._value=0,super.reset()}}const ca={dependencies:null};class ua extends ia{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return zi(this.source,((n,o)=>{var r;(r=n)&&r[na]===r?t[o]=n.getValue(e):Is(n)?t[o]=xs(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Fi(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return zi(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){ca.dependencies&&Is(e)&&ca.dependencies.add(e);const t=la(e);t&&Fi(t,(e=>this.add(e)))}}class da extends ua{constructor(e){super(e)}static create(e){return new da(e)}getValue(){return this.source.map((e=>e.getValue()))}setValue(e){const t=this.getPayload();return e.length==t.length?t.map(((t,n)=>t.setValue(e[n]))).some(Boolean):(super.setValue(e.map(pa)),!0)}}function pa(e){return(Zs(e)?aa:sa).create(e)}function ma(e){const t=oa(e);return t?t.constructor:Di.arr(e)?da:Zs(e)?aa:sa}function ga(){return(ga=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}const ha=(e,t)=>{const n=!Di.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Ri.forwardRef)(((o,r)=>{const l=(0,Ri.useRef)(null),i=n&&(0,Ri.useCallback)((e=>{l.current=function(e,t){return e&&(Di.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return ca.dependencies=n,e.style&&(e=ga({},e,{style:t.createAnimatedStyle(e.style)})),e=new ua(e),ca.dependencies=null,[e,n]}(o,t),c=Xs(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new fa(u,a),p=(0,Ri.useRef)();Qs((()=>(p.current=d,Fi(a,(e=>Rs(e,d))),()=>{p.current&&(Fi(p.current.deps,(e=>Ms(e,p.current))),fi.cancel(p.current.update))}))),(0,Ri.useEffect)(u,[]),Js((()=>()=>{const e=p.current;Fi(e.deps,(t=>Ms(t,e)))}));const m=t.getComponentProps(s.getValue());return Ri.createElement(e,ga({},m,{ref:i}))}))};class fa{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&fi.write(this.update)}}const va=Symbol.for("AnimatedComponent"),ba=e=>Di.str(e)?e:e&&Di.str(e.displayName)?e.displayName:Di.fun(e)&&e.name||null;function _a(){return(_a=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e}).apply(this,arguments)}function ka(e,...t){return Di.fun(e)?e(...t):e}const ya=(e,t)=>!0===e||!!(t&&e&&(Di.fun(e)?e(t):Vi(e).includes(t))),Ea=(e,t)=>Di.obj(e)?t&&e[t]:e,Ca=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Sa=e=>e,wa=(e,t=Sa)=>{let n=Ba;e.default&&!0!==e.default&&(e=e.default,n=Object.keys(e));const o={};for(const r of n){const n=t(e[r],r);Di.und(n)||(o[r]=n)}return o},Ba=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ia={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function xa(e){const t=function(e){const t={};let n=0;if(zi(e,((e,o)=>{Ia[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return zi(e,((e,o)=>o in t||(n[o]=e))),n}return _a({},e)}function Ta(e){return e=xs(e),Di.arr(e)?e.map(Ta):Zs(e)?Yi.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Na(e){for(const t in e)return!0;return!1}function Pa(e){return Di.fun(e)||Di.arr(e)&&Di.obj(e[0])}function La(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Ra(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}Math.PI,Math.PI;const Ma=_a({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Aa{constructor(){this.tension=void 0,this.friction=void 0,this.frequency=void 0,this.damping=void 0,this.mass=void 0,this.velocity=0,this.restVelocity=void 0,this.precision=void 0,this.progress=void 0,this.duration=void 0,this.easing=void 0,this.clamp=void 0,this.bounce=void 0,this.decay=void 0,this.round=void 0,Object.assign(this,Ma)}}function Da(e,t){if(Di.und(t.decay)){const n=!Di.und(t.tension)||!Di.und(t.friction);!n&&Di.und(t.frequency)&&Di.und(t.damping)&&Di.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Oa=[];class Fa{constructor(){this.changed=!1,this.values=Oa,this.toValues=null,this.fromValues=Oa,this.to=void 0,this.from=void 0,this.config=new Aa,this.immediate=!1}}function za(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=ya(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)g();else{Di.und(n.pause)||(r.paused=ya(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||ya(e,t)),c=ka(n.delay||0,t),e?(r.resumeQueue.add(m),l.pause()):(l.resume(),m())}function p(){r.resumeQueue.add(m),r.timeouts.delete(u),u.cancel(),c=u.time-fi.now()}function m(){c>0&&!Yi.skipAnimation?(r.delayed=!0,u=fi.setTimeout(g,c),r.pauseQueue.add(p),r.timeouts.add(u)):g()}function g(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(_a({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Va=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Ga(e.get()):t.every((e=>e.noop))?Ha(e.get()):Ua(e.get(),t.every((e=>e.finished))),Ha=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ua=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Ga=e=>({value:e,cancelled:!0,finished:!1});function Wa(e,t,n,o){const{callId:r,parentId:l,onRest:i}=t,{asyncTo:s,promise:a}=n;return l||e!==s||t.reset?n.promise=(async()=>{n.asyncId=r,n.asyncTo=e;const c=wa(t,((e,t)=>"onRest"===t?void 0:e));let u,d;const p=new Promise(((e,t)=>(u=e,d=t))),m=e=>{const t=r<=(n.cancelId||0)&&Ga(o)||r!==n.asyncId&&Ua(o,!1);if(t)throw e.result=t,d(e),e},g=(e,t)=>{const l=new ja,i=new Ka;return(async()=>{if(Yi.skipAnimation)throw $a(n),i.result=Ua(o,!1),d(i),i;m(l);const s=Di.obj(e)?_a({},e):_a({},t,{to:e});s.parentId=r,zi(c,((e,t)=>{Di.und(s[t])&&(s[t]=e)}));const a=await o.start(s);return m(l),n.paused&&await new Promise((e=>{n.resumeQueue.add(e)})),a})()};let h;if(Yi.skipAnimation)return $a(n),Ua(o,!1);try{let t;t=Di.arr(e)?(async e=>{for(const t of e)await g(t)})(e):Promise.resolve(e(g,o.stop.bind(o))),await Promise.all([t.then(u),p]),h=Ua(o.get(),!0,!1)}catch(e){if(e instanceof ja)h=e.result;else{if(!(e instanceof Ka))throw e;h=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Di.fun(i)&&fi.batchedUpdates((()=>{i(h,o,o.item)})),h})():a}function $a(e,t){Hi(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class ja extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise."),this.result=void 0}}class Ka extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const qa=e=>e instanceof Za;let Ya=1;class Za extends Ps{constructor(...e){super(...e),this.id=Ya++,this.key=void 0,this._priority=0}get priority(){return this._priority}set priority(e){this._priority!=e&&(this._priority=e,this._onPriorityChange(e))}get(){const e=oa(this);return e&&e.getValue()}to(...e){return Yi.to(this,e)}interpolate(...e){return qs(`${js}The "interpolate" function is deprecated in v9 (use "to" instead)`),Yi.to(this,e)}toJSON(){return this.get()}observerAdded(e){1==e&&this._attach()}observerRemoved(e){0==e&&this._detach()}_attach(){}_detach(){}_onChange(e,t=!1){Ns(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||es.sort(this),Ns(this,{type:"priority",parent:this,priority:e})}}const Qa=Symbol.for("SpringPhase"),Xa=e=>(1&e[Qa])>0,Ja=e=>(2&e[Qa])>0,ec=e=>(4&e[Qa])>0,tc=(e,t)=>t?e[Qa]|=3:e[Qa]&=-3,nc=(e,t)=>t?e[Qa]|=4:e[Qa]&=-5;class oc extends Za{constructor(e,t){if(super(),this.key=void 0,this.animation=new Fa,this.queue=void 0,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Di.und(e)||!Di.und(t)){const n=Di.obj(e)?_a({},e):_a({},t,{from:e});Di.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(Ja(this)||this._state.asyncTo)||ec(this)}get goal(){return xs(this.animation.to)}get velocity(){const e=oa(this);return e instanceof sa?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Xa(this)}get isAnimating(){return Ja(this)}get isPaused(){return ec(this)}get isDelayed(){return this._state.delayed}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=la(o.to);!i&&Is(o.to)&&(l=Vi(xs(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==aa?1:i?i[a].lastPosition:l[a];let u=o.immediate,d=c;if(!u){if(d=s.lastPosition,r.tension<=0)return void(s.done=!0);let t=s.elapsedTime+=e;const n=o.fromValues[a],l=null!=s.v0?s.v0:s.v0=Di.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Di.und(r.duration))if(r.decay){const e=!0===r.decay?.998:r.decay,o=Math.exp(-(1-e)*t);d=n+l/(1-e)*(1-o),u=Math.abs(s.lastPosition-d)<.1,i=l*o}else{i=null==s.lastVelocity?l:s.lastVelocity;const t=r.precision||(n==c?.005:Math.min(1,.001*Math.abs(c-n))),o=r.restVelocity||t/10,a=r.clamp?0:r.bounce,p=!Di.und(a),m=n==c?s.v0>0:n<c;let g,h=!1;const f=1,v=Math.ceil(e/f);for(let e=0;e<v&&(g=Math.abs(i)>o,g||(u=Math.abs(c-d)<=t,!u));++e)p&&(h=d==c||d>c==m,h&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*f,d+=i*f}else{let o=1;r.duration>0&&(this._memoizedDuration!==r.duration&&(this._memoizedDuration=r.duration,s.durationProgress>0&&(s.elapsedTime=r.duration*s.durationProgress,t=s.elapsedTime+=e)),o=(r.progress||0)+t/this._memoizedDuration,o=o>1?1:o<0?0:o,s.durationProgress=o),d=n+r.easing(o)*(c-n),i=(d-s.lastPosition)/e,u=1==o}s.lastVelocity=i,Number.isNaN(d)&&(console.warn("Got NaN while animating:",this),u=!0)}i&&!i[a].done&&(u=!1),u?s.done=!0:t=!1,s.setValue(d,r.round)&&(n=!0)}));const s=oa(this),a=s.getValue();if(t){const e=xs(o.to);a===e&&!n||r.decay?n&&r.decay&&this._onChange(a):(s.setValue(e),this._onChange(e)),this._stop()}else n&&this._onChange(a)}set(e){return fi.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(Ja(this)){const{to:e,config:t}=this.animation;fi.batchedUpdates((()=>{this._onStart(),t.decay||this._set(e,!1),this._stop()}))}return this}update(e){return(this.queue||(this.queue=[])).push(e),this}start(e,t){let n;return Di.und(e)?(n=this.queue||[],this.queue=[]):n=[Di.obj(e)?e:_a({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Va(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),$a(this._state,e&&this._lastCallId),fi.batchedUpdates((()=>this._stop(t,e))),this}reset(){this._update({reset:!0})}eventObserved(e){"change"==e.type?this._start():"priority"==e.type&&(this.priority=e.priority+1)}_prepareNode(e){const t=this.key||"";let{to:n,from:o}=e;n=Di.obj(n)?n[t]:n,(null==n||Pa(n))&&(n=void 0),o=Di.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Xa(this)||(e.reverse&&([n,o]=[o,n]),o=xs(o),Di.und(o)?oa(this)||this._set(n):this._set(o)),r}_update(e,t){let n=_a({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,wa(n,((e,t)=>/^on/.test(t)?Ea(e,o):e))),uc(this,n,"onProps"),dc(this,"onProps",n,this);const l=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const i=this._state;return za(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ec(this)||(nc(this,!0),Ui(i.pauseQueue),dc(this,"onPause",Ua(this,rc(this,this.animation.to)),this))},resume:()=>{ec(this)&&(nc(this,!1),Ja(this)&&this._resume(),Ui(i.resumeQueue),dc(this,"onResume",Ua(this,rc(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=lc(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Ga(this));const o=!Di.und(e.to),r=!Di.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Ga(this));this._lastToId=t.callId}const{key:l,defaultProps:i,animation:s}=this,{to:a,from:c}=s;let{to:u=a,from:d=c}=e;!r||o||t.default&&!Di.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Oi(d,c);p&&(s.from=d),d=xs(d);const m=!Oi(u,a);m&&this._focus(u);const g=Pa(t.to),{config:h}=s,{decay:f,velocity:v}=h;(o||r)&&(h.velocity=0),t.config&&!g&&function(e,t,n){n&&(Da(n=_a({},n),t),t=_a({},n,t)),Da(e,t),Object.assign(e,t);for(const t in Ma)null==e[t]&&(e[t]=Ma[t]);let{mass:o,frequency:r,damping:l}=e;Di.und(r)||(r<.01&&(r=.01),l<0&&(l=0),e.tension=Math.pow(2*Math.PI/r,2)*o,e.friction=4*Math.PI*l*o/r)}(h,ka(t.config,l),t.config!==i.config?ka(i.config,l):void 0);let b=oa(this);if(!b||Di.und(u))return n(Ua(this,!0));const _=Di.und(t.reset)?r&&!t.default:!Di.und(d)&&ya(t.reset,l),k=_?d:this.get(),y=Ta(u),E=Di.num(y)||Di.arr(y)||Zs(y),C=!g&&(!E||ya(i.immediate||t.immediate,l));if(m){const e=ma(u);if(e!==b.constructor){if(!C)throw Error(`Cannot animate between ${b.constructor.name} and ${e.name}, as the "to" prop suggests`);b=this._set(y)}}const S=b.constructor;let w=Is(u),B=!1;if(!w){const e=_||!Xa(this)&&p;(m||e)&&(B=Oi(Ta(k),y),w=!B),(Oi(s.immediate,C)||C)&&Oi(h.decay,f)&&Oi(h.velocity,v)||(w=!0)}if(B&&Ja(this)&&(s.changed&&!_?w=!0:w||this._stop(a)),!g&&((w||Is(a))&&(s.values=b.getPayload(),s.toValues=Is(u)?null:S==aa?[1]:Vi(y)),s.immediate!=C&&(s.immediate=C,C||_||this._set(a)),w)){const{onRest:e}=s;Fi(cc,(e=>uc(this,t,e)));const o=Ua(this,rc(this,a));Ui(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&fi.batchedUpdates((()=>{s.changed=!_,null==e||e(o,this),_?ka(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}_&&this._set(k),g?n(Wa(t.to,t,this._state,this)):w?this._start():Ja(this)&&!m?this._pendingCalls.add(n):n(Ha(k))}_focus(e){const t=this.animation;e!==t.to&&(Ts(this)&&this._detach(),t.to=e,Ts(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Is(t)&&(Rs(t,this),qa(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Is(e)&&Ms(e,this)}_set(e,t=!0){const n=xs(e);if(!Di.und(n)){const e=oa(this);if(!e||!Oi(n,e.getValue())){const o=ma(n);e&&e.constructor==o?e.setValue(n):ra(this,o.create(n)),e&&fi.batchedUpdates((()=>{this._onChange(n,t)}))}}return oa(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,dc(this,"onStart",Ua(this,rc(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ka(this.animation.onChange,e,this)),ka(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;oa(this).reset(xs(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),Ja(this)||(tc(this,!0),ec(this)||this._resume())}_resume(){Yi.skipAnimation?this.finish():es.start(this)}_stop(e,t){if(Ja(this)){tc(this,!1);const n=this.animation;Fi(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Ns(this,{type:"idle",parent:this});const o=t?Ga(this.get()):Ua(this.get(),rc(this,null!=e?e:n.to));Ui(this._pendingCalls,o),n.changed&&(n.changed=!1,dc(this,"onRest",o,this))}}}function rc(e,t){const n=Ta(t);return Oi(Ta(e.get()),n)}function lc(e,t=e.loop,n=e.to){let o=ka(t);if(o){const r=!0!==o&&xa(o),l=(r||e).reverse,i=!r||r.reset;return ic(_a({},e,{loop:t,default:!1,pause:void 0,to:!l||Pa(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ic(e){const{to:t,from:n}=e=xa(e),o=new Set;return Di.obj(t)&&ac(t,o),Di.obj(n)&&ac(n,o),e.keys=o.size?Array.from(o):null,e}function sc(e){const t=ic(e);return Di.und(t.default)&&(t.default=wa(t)),t}function ac(e,t){zi(e,((e,n)=>null!=e&&t.add(n)))}const cc=["onStart","onRest","onChange","onPause","onResume"];function uc(e,t,n){e.animation[n]=t[n]!==Ca(t,n)?Ea(t[n],e.key):void 0}function dc(e,t,...n){var o,r,l,i;null==(o=(r=e.animation)[t])||o.call(r,...n),null==(l=(i=e.defaultProps)[t])||l.call(i,...n)}const pc=["onStart","onChange","onRest"];let mc=1;class gc{constructor(e,t){this.id=mc++,this.springs={},this.queue=[],this.ref=void 0,this._flush=void 0,this._initialProps=void 0,this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._item=void 0,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),t&&(this._flush=t),e&&this.start(_a({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle&&!e.isDelayed&&!e.isPaused))}get item(){return this._item}set item(e){this._item=e}get(){const e={};return this.each(((t,n)=>e[n]=t.get())),e}set(e){for(const t in e){const n=e[t];Di.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ic(e)),this}start(e){let{queue:t}=this;return e?t=Vi(e).map(ic):this.queue=[],this._flush?this._flush(this,t):(yc(this,t),hc(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Fi(Vi(t),(t=>n[t].stop(!!e)))}else $a(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Di.und(e))this.start({pause:!0});else{const t=this.springs;Fi(Vi(e),(e=>t[e].pause()))}return this}resume(e){if(Di.und(e))this.start({pause:!1});else{const t=this.springs;Fi(Vi(e),(e=>t[e].resume()))}return this}each(e){zi(this.springs,e)}_onFrame(){const{onStart:e,onChange:t,onRest:n}=this._events,o=this._active.size>0,r=this._changed.size>0;(o&&!this._started||r&&!this._started)&&(this._started=!0,Hi(e,(([e,t])=>{t.value=this.get(),e(t,this,this._item)})));const l=!o&&this._started,i=r||l&&n.size?this.get():null;r&&t.size&&Hi(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Hi(n,(([e,t])=>{t.value=i,e(t,this,this._item)})))}eventObserved(e){if("change"==e.type)this._changed.add(e.parent),e.idle||this._active.add(e.parent);else{if("idle"!=e.type)return;this._active.delete(e.parent)}fi.onFrame(this._onFrame)}}function hc(e,t){return Promise.all(t.map((t=>fc(e,t)))).then((t=>Va(e,t)))}async function fc(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Di.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Di.arr(r)||Di.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Fi(pc,(n=>{const o=t[n];if(Di.fun(o)){const r=e._events[n];t[n]=({finished:e,cancelled:t})=>{const n=r.get(o);n?(e||(n.finished=!1),t&&(n.cancelled=!0)):r.set(o,{value:null,finished:e||!1,cancelled:t||!1})},c&&(c[n]=t[n])}}));const d=e._state;t.pause===!d.paused?(d.paused=t.pause,Ui(t.pause?d.pauseQueue:d.resumeQueue)):d.paused&&(t.pause=!0);const p=(o||Object.keys(e.springs)).map((n=>e.springs[n].start(t))),m=!0===t.cancel||!0===Ca(t,"cancel");(u||m&&d.asyncId)&&p.push(za(++e._lastAsyncId,{props:t,state:d,actions:{pause:Ai,resume:Ai,start(t,n){m?($a(d,e._lastAsyncId),n(Ga(e))):(t.onRest=s,n(Wa(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const g=Va(e,await Promise.all(p));if(i&&g.finished&&(!n||!g.noop)){const n=lc(t,i,r);if(n)return yc(e,[n]),fc(e,n,!0)}return a&&fi.batchedUpdates((()=>a(g,e,e.item))),g}function vc(e,t){const n=_a({},e.springs);return t&&Fi(Vi(t),(e=>{Di.und(e.keys)&&(e=ic(e)),Di.obj(e.to)||(e=_a({},e,{to:void 0})),kc(n,e,(e=>_c(e)))})),bc(e,n),n}function bc(e,t){zi(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Rs(t,e))}))}function _c(e,t){const n=new oc;return n.key=e,t&&Rs(n,t),n}function kc(e,t,n){t.keys&&Fi(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function yc(e,t){Fi(t,(t=>{kc(e.springs,t,(t=>_c(t,e)))}))}const Ec=["children"],Cc=e=>{let{children:t}=e,n=function(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}(e,Ec);const o=(0,Ri.useContext)(Sc),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Ri.useState)((()=>({inputs:t,result:e()}))),o=(0,Ri.useRef)(),r=o.current;let l=r;return l?Boolean(t&&l.inputs&&function(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(t,l.inputs))||(l={inputs:t,result:e()}):l=n,(0,Ri.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Sc;return Ri.createElement(i,{value:n},t)},Sc=(wc=Cc,Bc={},Object.assign(wc,Ri.createContext(Bc)),wc.Provider._context=wc,wc.Consumer._context=wc,wc);var wc,Bc;Cc.Provider=Sc.Provider,Cc.Consumer=Sc.Consumer;const Ic=()=>{const e=[],t=function(t){Ys(`${js}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`);const o=[];return Fi(e,((e,r)=>{if(Di.und(t))o.push(e.start());else{const l=n(t,e,r);l&&o.push(e.start(l))}})),o};t.current=e,t.add=function(t){e.includes(t)||e.push(t)},t.delete=function(t){const n=e.indexOf(t);~n&&e.splice(n,1)},t.pause=function(){return Fi(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Fi(e,(e=>e.resume(...arguments))),this},t.set=function(t){Fi(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Fi(e,((e,o)=>{if(Di.und(t))n.push(e.start());else{const r=this._getProps(t,e,o);r&&n.push(e.start(r))}})),n},t.stop=function(){return Fi(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Fi(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Di.fun(e)?e(n,t):e};return t._getProps=n,t};function xc(e,t,n){const o=Di.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Ri.useMemo)((()=>o||3==arguments.length?Ic():void 0),[]),l=(0,Ri.useRef)(0),i=Xs(),s=(0,Ri.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=vc(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?hc(e,t):new Promise((o=>{bc(e,n),s.queue.push((()=>{o(hc(e,t))})),i()}))}})),[]),a=(0,Ri.useRef)([...s.ctrls]),c=[],u=ta(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new gc(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=sc(n))}}(0,Ri.useMemo)((()=>{Fi(a.current.slice(e,u),(e=>{La(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Ri.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>vc(e,c[t]))),m=(0,Ri.useContext)(Cc),g=ta(m),h=m!==g&&Na(m);Qs((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Fi(e,(e=>e()))),Fi(a.current,((e,t)=>{null==r||r.add(e),h&&e.start({default:m});const n=c[t];n&&(Ra(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Js((()=>()=>{Fi(s.ctrls,(e=>e.stop(!0)))}));const f=p.map((e=>_a({},e)));return r?[f,r]:f}let Tc;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Tc||(Tc={}));class Nc extends Za{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Cs(...t);const n=this._get(),o=ma(n);ra(this,o.create(n))}advance(e){const t=this._get();Oi(t,this.get())||(oa(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Lc(this._active)&&Rc(this)}_get(){const e=Di.arr(this.source)?this.source.map(xs):Vi(xs(this.source));return this.calc(...e)}_start(){this.idle&&!Lc(this._active)&&(this.idle=!1,Fi(la(this),(e=>{e.done=!1})),Yi.skipAnimation?(fi.batchedUpdates((()=>this.advance())),Rc(this)):es.start(this))}_attach(){let e=1;Fi(Vi(this.source),(t=>{Is(t)&&Rs(t,this),qa(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Fi(Vi(this.source),(e=>{Is(e)&&Ms(e,this)})),this._active.clear(),Rc(this)}eventObserved(e){"change"==e.type?e.idle?this.advance():(this._active.add(e.parent),this._start()):"idle"==e.type?this._active.delete(e.parent):"priority"==e.type&&(this.priority=Vi(this.source).reduce(((e,t)=>Math.max(e,(qa(t)?t.priority:0)+1)),0))}}function Pc(e){return!1!==e.idle}function Lc(e){return!e.size||Array.from(e).every(Pc)}function Rc(e){e.idle||(e.idle=!0,Fi(la(e),(e=>{e.done=!0})),Ns(e,{type:"idle",parent:e}))}Yi.assign({createStringInterpolator:$s,to:(e,t)=>new Nc(e,t)}),es.advance;const Mc=window.ReactDOM;function Ac(e,t){if(null==e)return{};var n,o,r={},l=Object.keys(e);for(o=0;o<l.length;o++)n=l[o],t.indexOf(n)>=0||(r[n]=e[n]);return r}const Dc=["style","children","scrollTop","scrollLeft"],Oc=/^--/;function Fc(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Oc.test(e)||Vc.hasOwnProperty(e)&&Vc[e]?(""+t).trim():t+"px"}const zc={};let Vc={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};const Hc=["Webkit","Ms","Moz","O"];Vc=Object.keys(Vc).reduce(((e,t)=>(Hc.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Vc);const Uc=["x","y","z"],Gc=/^(matrix|translate|scale|rotate|skew)/,Wc=/^(translate)/,$c=/^(rotate|skew)/,jc=(e,t)=>Di.num(e)&&0!==e?e+t:e,Kc=(e,t)=>Di.arr(e)?e.every((e=>Kc(e,t))):Di.num(e)?e===t:parseFloat(e)===t;class qc extends ua{constructor(e){let{x:t,y:n,z:o}=e,r=Ac(e,Uc);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>jc(e,"px"))).join(",")})`,Kc(e,0)]))),zi(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Gc.test(t)){if(delete r[t],Di.und(e))return;const n=Wc.test(t)?"px":$c.test(t)?"deg":"";l.push(Vi(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${jc(r,n)})`,Kc(r,0)]:e=>[`${t}(${e.map((e=>jc(e,n))).join(",")})`,Kc(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Yc(l,i)),super(r)}}class Yc extends Ps{constructor(e,t){super(),this._value=null,this.inputs=e,this.transforms=t}get(){return this._value||(this._value=this._get())}_get(){let e="",t=!0;return Fi(this.inputs,((n,o)=>{const r=xs(n[0]),[l,i]=this.transforms[o](Di.arr(r)?r:n.map(xs));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Fi(this.inputs,(e=>Fi(e,(e=>Is(e)&&Rs(e,this)))))}observerRemoved(e){0==e&&Fi(this.inputs,(e=>Fi(e,(e=>Is(e)&&Ms(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Ns(this,e)}}const Zc=["scrollTop","scrollLeft"];Yi.assign({batchedUpdates:Mc.unstable_batchedUpdates,createStringInterpolator:$s,colors:{transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199}});const Qc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ua(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=ba(e)||"Anonymous";return(e=Di.str(e)?l[e]||(l[e]=ha(e,r)):e[va]||(e[va]=ha(e,r))).displayName=`Animated(${t})`,e};return zi(e,((t,n)=>{Di.arr(e)&&(n=ba(t)),l[n]=l(t)})),{animated:l}})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"],{applyAnimatedValues:function(e,t){if(!e.nodeType||!e.setAttribute)return!1;const n="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName,o=t,{style:r,children:l,scrollTop:i,scrollLeft:s}=o,a=Ac(o,Dc),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:zc[t]||(zc[t]=t.replace(/([A-Z])/g,(e=>"-"+e.toLowerCase())))));void 0!==l&&(e.textContent=l);for(let t in r)if(r.hasOwnProperty(t)){const n=Fc(t,r[t]);Oc.test(t)?e.style.setProperty(t,n):e.style[t]=n}u.forEach(((t,n)=>{e.setAttribute(t,c[n])})),void 0!==i&&(e.scrollTop=i),void 0!==s&&(e.scrollLeft=s)},createAnimatedStyle:e=>new qc(e),getComponentProps:e=>Ac(e,Zc)}).animated,Xc=e=>e+1,Jc=e=>({top:e.offsetTop,left:e.offsetLeft}),eu=function(e){let{isSelected:t,adjustScrolling:n,enableAnimation:o,triggerAnimationOnChange:r}=e;const l=(0,s.useRef)(),i=(0,d.useReducedMotion)()||!o,[a,c]=(0,s.useReducer)(Xc,0),[u,p]=(0,s.useReducer)(Xc,0),[m,g]=(0,s.useState)({x:0,y:0}),h=(0,s.useMemo)((()=>l.current?Jc(l.current):null),[r]),f=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Yl.getScrollContainer)(l.current);if(!e)return()=>{};const t=l.current.getBoundingClientRect();return()=>{const n=l.current.getBoundingClientRect().top-t.top;n&&(e.scrollTop+=n)}}),[r,n]);function v(e){let{value:n}=e,{x:o,y:r}=n;o=Math.round(o),r=Math.round(r),o===v.x&&r===v.y||(function(e){let{x:n,y:o}=e;if(!l.current)return;const r=0===n&&0===o;l.current.style.transformOrigin=r?"":"center",l.current.style.transform=r?"":`translate3d(${n}px,${o}px,0)`,l.current.style.zIndex=!t||r?"":"1",f()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!h)return;if(i)return void f();l.current.style.transform="";const e=Jc(l.current);c(),g({x:Math.round(h.left-e.left),y:Math.round(h.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Di.fun(e),[[o],r]=xc(1,n?e:[e],n?t||[]:t)}({from:{x:m.x,y:m.y},to:{x:0,y:0},reset:a!==u,config:{mass:5,tension:2e3,friction:200},immediate:i,onChange:v}),l},tu=".block-editor-block-list__block",nu=".block-list-appender",ou=".block-editor-button-block-appender";function ru(e,t){return t.closest([tu,nu,ou].join(","))===e}function lu(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(tu);return t?t.id.slice("block-".length):void 0}function iu(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(to);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(to);return(0,s.useEffect)((()=>{if(!o(e)||r())return;if(null==n)return;if(!t.current)return;const{ownerDocument:l}=t.current;if(ru(t.current,l.activeElement))return;const i=Yl.focus.tabbable.find(t.current).filter((e=>(0,Yl.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(ru(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=Yl.focus.tabbable.findNext(t.current);if(e&&ru(t.current,e)&&(0,Yl.isFormElement)(e))return void e.focus()}(0,Yl.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function su(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function au(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(to);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",su),t.addEventListener("mouseover",su),()=>{t.removeEventListener("mouseout",su),t.removeEventListener("mouseover",su),t.classList.remove("is-hovered")}}),[e])}function cu(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__unstableIsFullySelected:p}=t(to),{outlineMode:m}=a(),g=n(e),h=l(e),f=s(e),v=u(e,!0),b=i(e);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":b,"is-partially-selected":b&&!p(),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(f)),"is-dragging":g,"has-child-selected":v,"remove-outline":h&&m&&d()})}),[e])}function uu(e){return(0,m.useSelect)((t=>{const n=t(to).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function du(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(to),l=o(e);if(null==l||!l.className)return;const i=(0,r.getBlockType)(n(e));return(null==i?void 0:i.apiVersion)>1?l.className:void 0}),[e])}function pu(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(to);if(!i(e))return;const s=n();return s?c()("is-block-moving-mode",{"can-insert-moving-block":o(r(s),l(e))}):void 0}),[e])}function mu(e){const{isBlockSelected:t}=(0,m.useSelect)(to),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):ru(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}const gu=window.wp.keycodes;function hu(e){const t=(0,m.useSelect)((t=>t(to).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(to),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((i=>{if(t)return i.addEventListener("keydown",s),i.addEventListener("dragstart",a),()=>{i.removeEventListener("keydown",s),i.removeEventListener("dragstart",a)};function s(t){const{keyCode:s,target:a}=t;s!==gu.ENTER&&s!==gu.BACKSPACE&&s!==gu.DELETE||a!==i||(0,Yl.isTextField)(a)||(t.preventDefault(),s===gu.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function fu(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(to),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((l=>{function i(l){t()&&!l.defaultPrevented&&(l.preventDefault(),n(e)?o(!1):r(e))}return l.addEventListener("mousedown",i),()=>{l.addEventListener("mousedown",i)}}),[e,t,n,o])}function vu(){const e=(0,s.useContext)(Gh);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function bu(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t,__unstableIsDisabled:n=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:o,className:l,wrapperProps:i={},isAligned:a}=(0,s.useContext)(_u),{index:u,mode:p,name:g,blockApiVersion:f,blockTitle:v,isPartOfSelection:b,adjustScrolling:_,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:n,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(to),p=a(o),m=c(o)||u(o),g=l(o),h=(0,r.getBlockType)(g);return{index:t(o),mode:n(o),name:g,blockApiVersion:(null==h?void 0:h.apiVersion)||1,blockTitle:null==h?void 0:h.title,isPartOfSelection:p||m,adjustScrolling:p||d(o),enableAnimation:!i()&&s()<=200}}),[o]),y=(0,h.sprintf)((0,h.__)("Block: %s"),v),E="html"!==p||t?"":"-visual",C=(0,d.useMergeRefs)([e.ref,iu(o),So(o),mu(o),hu(o),fu(o),au(),vu(),eu({isSelected:b,adjustScrolling:_,enableAnimation:k,triggerAnimationOnChange:u}),(0,d.useDisabled)({isDisabled:!n})]),S=lo();return f<2&&o===S.clientId&&"undefined"!=typeof process&&process.env,{...i,...e,ref:C,id:`block-${o}${E}`,tabIndex:0,role:"document","aria-label":y,"data-block":o,"data-type":g,"data-title":v,className:c()(c()("block-editor-block-list__block",{"wp-block":!a}),l,e.className,i.className,cu(o),uu(o),du(o),pu(o)),style:{...i.style,...e.style}}}bu.save=r.__unstableGetBlockProps;const _u=(0,s.createContext)();function ku(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",bu(o,{__unstableIsHtml:n}),t)}const yu=(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{isBlockSelected:r,getBlockMode:l,isSelectionEnabled:i,getTemplateLock:s,__unstableGetBlockWithoutInnerBlocks:a,canRemoveBlock:c,canMoveBlock:u}=e(to),d=a(n),p=r(n),m=s(o),g=c(n,o),h=u(n,o),{name:f,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:g,canMove:h,block:d,name:f,attributes:v,isValid:b,isSelected:p}})),Eu=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(to);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(to),r=n(),{clientId:i}=t,s=r.length?r:[i];l(s,e)},onInsertBlocks(e,n){const{rootClientId:o}=t;i(e,n,o)},onInsertBlocksAfter(e){const{clientId:n,rootClientId:r}=t,{getBlockIndex:l}=o(to),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n,rootClientId:l}=t,{getPreviousBlockClientId:i,getNextBlockClientId:c,getBlock:u}=o(to);if(e){const e=c(n);e&&s(n,e)}else{const e=i(n);if(e)s(e,n);else if(l){const e=(0,r.switchToBlockType)(u(l),"*");e&&e.length&&a(l,e,0)}}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}})),Cu=(0,d.compose)(d.pure,yu,Eu,(0,d.ifCondition)((e=>{let{block:t}=e;return!!t})),(0,p.withFilters)("editor.BlockListBlock"))((function(e){var t;let{block:{__unstableBlockSource:n},mode:o,isLocked:l,canRemove:i,clientId:a,isSelected:d,isSelectionEnabled:p,className:g,name:h,isValid:f,attributes:v,wrapperProps:b,setAttributes:_,onReplace:k,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(to);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(to),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(ti,{name:h,isSelected:d,attributes:v,setAttributes:_,insertBlocksAfter:l?void 0:y,onReplace:i?k:void 0,onRemove:i?B:void 0,mergeBlocks:i?E:void 0,clientId:a,isSelectionEnabled:p,toggleSelection:C});const x=(0,r.getBlockType)(h);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return null!=e&&e.className&&null!=t&&t.className&&(n.className=c()(e.className,t.className)),null!=e&&e.style&&null!=t&&t.style&&(n.style={...e.style,...t.style}),n}(b,x.getEditWrapperProps(v)));const T=b&&!!b["data-align"]&&!S;let N;if(T&&(I=(0,s.createElement)("div",{className:"wp-block","data-align":b["data-align"]},I)),f)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(ku,{isHtml:!0},(0,s.createElement)(gi,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(ku,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(ku,{className:"has-warning"},(0,s.createElement)(ai,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Yl.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(g,`align${b["data-align"]}`):g,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},L=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(_u.Provider,{value:L},(0,s.createElement)(pi,{fallback:(0,s.createElement)(ku,{className:"has-warning"},(0,s.createElement)(ui,null))},N))})),Su=window.wp.htmlEntities,wu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"})),Bu=[(0,s.createInterpolateElement)((0,h.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,h.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,h.__)("Drag files into the editor to automatically insert media blocks."),(0,h.__)("Change a block's type by pressing the block icon on the toolbar.")],Iu=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Bu.length));return(0,s.createElement)(p.Tip,null,Bu[e])},xu=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z"})),Tu=(0,s.memo)((function(e){var t;let{icon:n,showColors:o=!1,className:r}=e;"block-default"===(null===(t=n)||void 0===t?void 0:t.src)&&(n={src:xu});const l=(0,s.createElement)(p.Icon,{icon:n&&n.src?n.src:n}),i=o?{backgroundColor:n&&n.background,color:n&&n.foreground}:{};return(0,s.createElement)("span",{style:i,className:c()("block-editor-block-icon",r,{"has-colors":o})},l)})),Nu=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(V()("`blockType` property in `BlockCard component`",{since:"5.7",alternative:"`title, icon and description` properties"}),({title:t,icon:n,description:o}=r)),(0,s.createElement)("div",{className:"block-editor-block-card"},(0,s.createElement)(Tu,{icon:n,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-block-card__content"},(0,s.createElement)("h2",{className:"block-editor-block-card__title"},t),(0,s.createElement)("span",{className:"block-editor-block-card__description"},o)))},Pu=(0,d.createHigherOrderComponent)((e=>(0,m.withRegistry)((t=>{let{useSubRegistry:n=!0,registry:o,...r}=t;if(!n)return(0,s.createElement)(e,i({registry:o},r));const[l,a]=(0,s.useState)(null);return(0,s.useEffect)((()=>{const e=(0,m.createRegistry)({},o);e.registerStore(Jn,eo),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider"),Lu=()=>{};function Ru(e){let{clientId:t=null,value:n,selection:o,onChange:l=Lu,onInput:i=Lu}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:g,__unstableMarkNextChangeAsNotPersistent:h}=a.dispatch(to),{getBlockName:f,getBlocks:v}=a.select(to),b=(0,m.useSelect)((e=>!t||e(to).areInnerBlocksControlled(t)),[t]),_=(0,s.useRef)({incoming:null,outgoing:[]}),k=(0,s.useRef)(!1),y=()=>{n&&(h(),t?a.batch((()=>{g(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));k.current&&(_.current.incoming=e),h(),p(t,e)})):(k.current&&(_.current.incoming=n),c(n)))},E=(0,s.useRef)(i),C=(0,s.useRef)(l);(0,s.useEffect)((()=>{E.current=i,C.current=l}),[i,l]),(0,s.useEffect)((()=>{_.current.outgoing.includes(n)?(0,u.last)(_.current.outgoing)===n&&(_.current.outgoing=[]):v(t)!==n&&(_.current.outgoing=[],y(),o&&d(o.selectionStart,o.selectionEnd,o.initialPosition))}),[n,t]),(0,s.useEffect)((()=>{b||(_.current.outgoing=[],y())}),[b]),(0,s.useEffect)((()=>{const{getSelectionStart:e,getSelectionEnd:n,getSelectedBlocksInitialCaretPosition:o,isLastBlockChangePersistent:r,__unstableIsLastBlockChangeIgnored:l,areInnerBlocksControlled:i}=a.select(to);let s=v(t),c=r(),u=!1;k.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===f(t))return;if(t&&!i(t))return;const a=r(),d=v(t),p=d!==s;if(s=d,p&&(_.current.incoming||l()))return _.current.incoming=null,void(c=a);(p||u&&!p&&a&&!c)&&(c=a,_.current.outgoing.push(s),(c?C.current:E.current)(s,{selection:{selectionStart:e(),selectionEnd:n(),initialPosition:o()}})),u=p}));return()=>d()}),[a,t])}const Mu=Pu((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(to);return(0,s.useEffect)((()=>{o(n)}),[n]),Ru(e),(0,s.createElement)(Co,null,t)}));function Au(e){let{onClick:t}=e;return(0,s.createElement)("div",{tabIndex:0,role:"button",onClick:t,onKeyPress:t},(0,s.createElement)(p.Disabled,null,(0,s.createElement)($h,null)))}function Du(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(to),{clearSelectedBlock:n}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((o=>{function r(r){(e()||t())&&r.target===o&&n()}return o.addEventListener("mousedown",r),()=>{o.removeEventListener("mousedown",r)}}),[e,t,n])}function Ou(e){return(0,s.createElement)("div",i({ref:Du()},e))}function Fu(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(to);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function zu(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Fu,[]);return(0,d.useRefEffect)((r=>{const{ownerDocument:i}=r,{defaultView:s}=i;if(null==e)return;if(!o||t)return;const{length:a}=n;a<2||l&&(r.contentEditable=!0,r.focus(),s.getSelection().removeAllRanges())}),[o,t,n,r,e,l])}function Vu(e,t,n,o){let r,l=Yl.focus.focusable.find(n);return t&&l.reverse(),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),l.find((function(e){if(!Yl.focus.tabbable.isTabbableIndex(e))return!1;if(e.isContentEditable&&"true"!==e.contentEditable)return!1;if(o){const t=e.getBoundingClientRect();if(t.left>=r.right||t.right<=r.left)return!1}return!0}))}function Hu(){const{getMultiSelectedBlocksStartClientId:e,getMultiSelectedBlocksEndClientId:t,getSettings:n,hasMultiSelection:o,__unstableIsFullySelected:r}=(0,m.useSelect)(to),{selectBlock:l}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===gu.UP,p=c===gu.DOWN,m=c===gu.LEFT,g=c===gu.RIGHT,h=d||m,f=m||g,v=d||p,b=f||v,_=a.shiftKey,k=_||a.ctrlKey||a.altKey||a.metaKey,y=v?Yl.isVerticalEdge:Yl.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(o()){if(!r())return;if(a.defaultPrevented)return;if(!b)return;if(_)return;return a.preventDefault(),void(h?l(e()):l(t(),-1))}if(v?s||(s=(0,Yl.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===gu.UP||t===gu.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"===o?["button","checkbox","color","file","image","radio","reset","submit"].includes(e.getAttribute("type")):"TEXTAREA"!==o}(u,c,k))return;const S=(0,Yl.isRTL)(u)?!h:h,{keepCaretInsideBlock:w}=n();if(_)(function(e,t){const n=Vu(e,t,i);return n&&lu(n)})(u,h)&&y(u,h)&&(i.contentEditable=!0,i.focus());else if(v&&(0,Yl.isVerticalEdge)(u,h)&&!w){const e=Vu(u,h,i,!0);e&&((0,Yl.placeCaretAtVerticalEdge)(e,h,s),a.preventDefault())}else if(f&&C.getSelection().isCollapsed&&(0,Yl.isHorizontalEdge)(u,S)&&!w){const e=Vu(u,S,i);(0,Yl.placeCaretAtHorizontalEdge)(e,h),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}const Uu=window.wp.keyboardShortcuts;function Gu(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(to),{multiSelect:o,selectBlock:r}=(0,m.useDispatch)(to),l=(0,Uu.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((i=>{function s(s){if(!l("core/block-editor/select-all",s))return;const a=t();if(a.length<2&&!(0,Yl.isEntirelySelected)(s.target))return;s.preventDefault();const[c]=a,d=n(c),p=e(d);a.length!==p.length?o((0,u.first)(p),(0,u.last)(p)):d&&(i.ownerDocument.defaultView.getSelection().removeAllRanges(),r(d))}return i.addEventListener("keydown",s),()=>{i.removeEventListener("keydown",s)}}),[])}function Wu(e,t){e.contentEditable=t,t&&e.focus()}function $u(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(to),{isSelectionEnabled:n,hasMultiSelection:o,isDraggingBlocks:r}=(0,m.useSelect)(to);return(0,d.useRefEffect)((l=>{const{ownerDocument:i}=l,{defaultView:s}=i;let a,c;function u(){t(),s.removeEventListener("mouseup",u),c=s.requestAnimationFrame((()=>{if(o())return;Wu(l,!1);const e=s.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);a.contains(t)&&a.focus()}}))}function d(t){let{buttons:o,target:c}=t;r()||1===o&&c.getAttribute("contenteditable")&&n()&&(a=i.activeElement,e(),s.addEventListener("mouseup",u),Wu(l,!0))}return l.addEventListener("mouseout",d),()=>{l.removeEventListener("mouseout",d),s.removeEventListener("mouseup",u),s.cancelAnimationFrame(c)}}),[e,t,n,o])}function ju(e,t){e.contentEditable=t,t&&e.focus()}function Ku(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(to),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(to);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return;const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void ju(n,!1);let c=lu(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE||0===n?t:t.childNodes[n-1]}(s)),u=lu(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE||n===t.childNodes.length?t:t.childNodes[n]}(s));if(a){const e=r(),t=lu(l.target),n=t!==u;(c===u&&s.isCollapsed||!u||n)&&(u=t),c!==e&&(c=e)}if(void 0!==c||void 0!==u)if(c===u)t(c);else{const t=[...o(c),c],n=[...o(u),u],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}else ju(n,!1)}function a(){l.addEventListener("selectionchange",s),i.addEventListener("mouseup",s)}function c(){l.removeEventListener("selectionchange",s),i.removeEventListener("mouseup",s)}function u(){c(),a()}return a(),n.addEventListener("focusin",u),()=>{c(),n.removeEventListener("focusin",u)}}),[e,t,n,o])}function qu(){const{selectBlock:e}=(0,m.useDispatch)(to),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(to);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=lu(l.target);l.shiftKey?i!==s&&(r.contentEditable=!0,r.focus()):o()&&e(s)}return r.addEventListener("mousedown",l),()=>{r.removeEventListener("mousedown",l)}}),[e,t,n,o])}function Yu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(to),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((u=>{function d(e){var t;o()&&null!==(t=e.inputType)&&void 0!==t&&t.startsWith("format")&&e.preventDefault()}function p(d){d.defaultPrevented||o()&&(d.keyCode===gu.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===gu.BACKSPACE||d.keyCode===gu.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===gu.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===gu.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function m(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("beforeinput",d),u.addEventListener("keydown",p),u.addEventListener("compositionstart",m),()=>{u.removeEventListener("beforeinput",d),u.removeEventListener("keydown",p),u.removeEventListener("compositionstart",m)}}),[])}function Zu(){const[e,t,n]=function(){const e=(0,s.useRef)(),t=(0,s.useRef)(),n=(0,s.useRef)(),o=(0,s.useRef)(),{hasMultiSelection:r,getSelectedBlockClientId:l,getBlockCount:i}=(0,m.useSelect)(to),{setNavigationMode:a}=(0,m.useDispatch)(to),c=(0,m.useSelect)((e=>e(to).isNavigationMode()),[])?void 0:"0",u=(0,s.useRef)();function p(t){if(u.current)u.current=null;else if(r())e.current.focus();else if(l())o.current.focus();else{a(!0);const n=t.target.compareDocumentPosition(e.current)&t.target.DOCUMENT_POSITION_FOLLOWING?"findNext":"findPrevious";Yl.focus.tabbable[n](t.target).focus()}}const g=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),h=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),f=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===gu.ESCAPE)return e.preventDefault(),void a(!0);if(e.keyCode!==gu.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Yl.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Yl.isFormElement)(Yl.focus.tabbable[i](e.target)))return;const c=o?t:n;u.current=!0,c.current.focus({preventScroll:!0})}function d(e){o.current=e.target;const{ownerDocument:t}=s;e.relatedTarget||t.activeElement!==t.body||0!==i()||s.focus()}function p(o){var r;if(o.keyCode!==gu.TAB)return;if("region"===(null===(r=o.target)||void 0===r?void 0:r.getAttribute("role")))return;if(e.current===o.target)return;const l=o.shiftKey?"findPrevious":"findNext",i=Yl.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:g}=m;return g.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{g.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[g,(0,d.useMergeRefs)([e,f]),h]}(),o=(0,m.useSelect)((e=>e(to).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Yu(),$u(),Ku(),qu(),zu(),Gu(),Hu(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,h.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}const Qu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=Zu();return(0,s.createElement)(s.Fragment,null,r,(0,s.createElement)("div",i({},o,{ref:(0,d.useMergeRefs)([l,t]),className:c()(o.className,"block-editor-writing-flow")}),n),a)})),Xu="editor-styles-wrapper";function Ju(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}const ed=(0,s.forwardRef)((function(e,t){let{contentRef:n,children:o,head:r,tabIndex:l=0,assets:a,...u}=e;const[,m]=(0,s.useReducer)((()=>({}))),[g,f]=(0,s.useState)(),[v,b]=(0,s.useState)([]),_=Ju(null==a?void 0:a.styles),k=Ju(null==a?void 0:a.scripts),y=Du(),[E,C,S]=Zu(),w=(0,d.useRefEffect)((e=>{function t(){const{contentDocument:t,ownerDocument:n}=e,{readyState:o,documentElement:r}=t;return("interactive"===o||"complete"===o)&&(function(e){const{defaultView:t}=e,{frameElement:n}=t;function o(e){const o=Object.getPrototypeOf(e).constructor.name,r=window[o],l={};for(const t in e)l[t]=e[t];if(e instanceof t.MouseEvent){const e=n.getBoundingClientRect();l.clientX+=e.left,l.clientY+=e.top}const i=new r(e.type,l);!n.dispatchEvent(i)&&e.preventDefault()}const r=["dragover"];for(const t of r)e.addEventListener(t,o)}(t),f(t),y(r),b(Array.from(n.body.classList).filter((e=>e.startsWith("admin-color-")||e.startsWith("post-type-")||"wp-embed-responsive"===e))),t.dir=n.dir,r.removeChild(t.head),r.removeChild(t.body),!0)}return e.addEventListener("load",t),()=>e.removeEventListener("load",t)}),[]),B=(0,d.useRefEffect)((e=>{k.reduce(((t,n)=>t.then((()=>async function(e,t){let{id:n,src:o}=t;return new Promise(((t,r)=>{const l=e.ownerDocument.createElement("script");l.id=n,o?(l.src=o,l.onload=()=>t(),l.onerror=()=>r()):t(),e.appendChild(l)}))}(e,n)))),Promise.resolve()).finally((()=>{m()}))}),[]),I=(0,d.useMergeRefs)([n,y,C]),x=(0,d.useRefEffect)((e=>{Array.from(document.styleSheets).forEach((t=>{try{t.cssRules}catch(e){return}const{ownerNode:n,cssRules:o}=t;if(o&&"LINK"===n.tagName&&"wp-reset-editor-styles-css"!==n.id&&function e(t){return Array.from(t).find((t=>{let{selectorText:n,conditionText:o,cssRules:r}=t;return o?e(r):n&&(n.includes(`.${Xu}`)||n.includes(".wp-block"))}))}(o)&&!e.ownerDocument.getElementById(n.id)){e.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.appendChild(o.cloneNode(!0))}}))}),[]);return r=(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",null,"body{margin:0}"),_.map((e=>{let{tagName:t,href:n,id:o,rel:r,media:l,textContent:i}=e;const a=t.toLowerCase();return"style"===a?(0,s.createElement)(a,{id:o,key:o},i):(0,s.createElement)(a,{href:n,id:o,rel:r,media:l,key:o})})),r),(0,s.createElement)(s.Fragment,null,l>=0&&E,(0,s.createElement)("iframe",i({},u,{ref:(0,d.useMergeRefs)([t,w]),tabIndex:l,srcDoc:"<!doctype html>",title:(0,h.__)("Editor canvas")}),g&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Xu,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:g},o))),g.documentElement)),l>=0&&S)}));var td={grad:.9,turn:360,rad:360/(2*Math.PI)},nd=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},od=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},rd=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},ld=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},id=function(e){return{r:rd(e.r,0,255),g:rd(e.g,0,255),b:rd(e.b,0,255),a:rd(e.a)}},sd=function(e){return{r:od(e.r),g:od(e.g),b:od(e.b),a:od(e.a,3)}},ad=/^#([0-9a-f]{3,8})$/i,cd=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},ud=function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=Math.max(t,n,o),i=l-Math.min(t,n,o),s=i?l===t?(n-o)/i:l===n?2+(o-t)/i:4+(t-n)/i:0;return{h:60*(s<0?s+6:s),s:l?i/l*100:0,v:l/255*100,a:r}},dd=function(e){var t=e.h,n=e.s,o=e.v,r=e.a;t=t/360*6,n/=100,o/=100;var l=Math.floor(t),i=o*(1-n),s=o*(1-(t-l)*n),a=o*(1-(1-t+l)*n),c=l%6;return{r:255*[o,s,i,i,a,o][c],g:255*[a,o,o,s,i,i][c],b:255*[i,i,a,o,o,s][c],a:r}},pd=function(e){return{h:ld(e.h),s:rd(e.s,0,100),l:rd(e.l,0,100),a:rd(e.a)}},md=function(e){return{h:od(e.h),s:od(e.s),l:od(e.l),a:od(e.a,3)}},gd=function(e){return dd((n=(t=e).s,{h:t.h,s:(n*=((o=t.l)<50?o:100-o)/100)>0?2*n/(o+n)*100:0,v:o+n,a:t.a}));var t,n,o},hd=function(e){return{h:(t=ud(e)).h,s:(r=(200-(n=t.s))*(o=t.v)/100)>0&&r<200?n*o/100/(r<=100?r:200-r)*100:0,l:r/2,a:t.a};var t,n,o,r},fd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vd=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bd=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,_d=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,kd={string:[[function(e){var t=ad.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?od(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?od(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=bd.exec(e)||_d.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:id({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=fd.exec(e)||vd.exec(e);if(!t)return null;var n,o,r=pd({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(td[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return gd(r)},"hsl"]],object:[[function(e){var t=e.r,n=e.g,o=e.b,r=e.a,l=void 0===r?1:r;return nd(t)&&nd(n)&&nd(o)?id({r:Number(t),g:Number(n),b:Number(o),a:Number(l)}):null},"rgb"],[function(e){var t=e.h,n=e.s,o=e.l,r=e.a,l=void 0===r?1:r;if(!nd(t)||!nd(n)||!nd(o))return null;var i=pd({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return gd(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!nd(t)||!nd(n)||!nd(o))return null;var i=function(e){return{h:ld(e.h),s:rd(e.s,0,100),v:rd(e.v,0,100),a:rd(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return dd(i)},"hsv"]]},yd=function(e,t){for(var n=0;n<t.length;n++){var o=t[n][0](e);if(o)return[o,t[n][1]]}return[null,void 0]},Ed=function(e,t){var n=hd(e);return{h:n.h,s:rd(n.s+100*t,0,100),l:n.l,a:n.a}},Cd=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Sd=function(e,t){var n=hd(e);return{h:n.h,s:n.s,l:rd(n.l+100*t,0,100),a:n.a}},wd=function(){function e(e){this.parsed=function(e){return"string"==typeof e?yd(e.trim(),kd.string):"object"==typeof e&&null!==e?yd(e,kd.object):[null,void 0]}(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return e.prototype.isValid=function(){return null!==this.parsed},e.prototype.brightness=function(){return od(Cd(this.rgba),2)},e.prototype.isDark=function(){return Cd(this.rgba)<.5},e.prototype.isLight=function(){return Cd(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=sd(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?cd(od(255*r)):"","#"+cd(t)+cd(n)+cd(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return sd(this.rgba)},e.prototype.toRgbString=function(){return t=(e=sd(this.rgba)).r,n=e.g,o=e.b,(r=e.a)<1?"rgba("+t+", "+n+", "+o+", "+r+")":"rgb("+t+", "+n+", "+o+")";var e,t,n,o,r},e.prototype.toHsl=function(){return md(hd(this.rgba))},e.prototype.toHslString=function(){return t=(e=md(hd(this.rgba))).h,n=e.s,o=e.l,(r=e.a)<1?"hsla("+t+", "+n+"%, "+o+"%, "+r+")":"hsl("+t+", "+n+"%, "+o+"%)";var e,t,n,o,r},e.prototype.toHsv=function(){return e=ud(this.rgba),{h:od(e.h),s:od(e.s),v:od(e.v),a:od(e.a,3)};var e},e.prototype.invert=function(){return Bd({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),Bd(Ed(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Bd(Ed(this.rgba,-e))},e.prototype.grayscale=function(){return Bd(Ed(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Bd(Sd(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Bd(Sd(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?Bd({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):od(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=hd(this.rgba);return"number"==typeof e?Bd({h:e,s:t.s,l:t.l,a:t.a}):od(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Bd(e).toHex()},e}(),Bd=function(e){return e instanceof wd?e:new wd(e)},Id=[],xd=function(e){e.forEach((function(e){Id.indexOf(e)<0&&(e(wd,kd),Id.push(e))}))};function Td(e,t){var n={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"},o={};for(var r in n)o[n[r]]=r;var l={};e.prototype.toName=function(t){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var r,i,s=o[this.toHex()];if(s)return s;if(null==t?void 0:t.closest){var a=this.toRgb(),c=1/0,u="black";if(!l.length)for(var d in n)l[d]=new e(n[d]).toRgb();for(var p in n){var m=(r=a,i=l[p],Math.pow(r.r-i.r,2)+Math.pow(r.g-i.g,2)+Math.pow(r.b-i.b,2));m<c&&(c=m,u=p)}return u}},t.string.push([function(t){var o=t.toLowerCase(),r="transparent"===o?"#0000":n[o];return r?new e(r).toRgb():null},"name"])}var Nd=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Pd=function(e){return.2126*Nd(e.r)+.7152*Nd(e.g)+.0722*Nd(e.b)};function Ld(e){e.prototype.luminance=function(){return e=Pd(this.rgba),void 0===(t=2)&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0;var e,t,n},e.prototype.contrast=function(t){void 0===t&&(t="#FFF");var n,o,r,l,i,s,a,c=t instanceof e?t:new e(t);return l=this.rgba,i=c.toRgb(),n=(s=Pd(l))>(a=Pd(i))?(s+.05)/(a+.05):(a+.05)/(s+.05),void 0===(o=2)&&(o=0),void 0===r&&(r=Math.pow(10,o)),Math.floor(r*n)/r+0},e.prototype.isReadable=function(e,t){return void 0===e&&(e="#FFF"),void 0===t&&(t={}),this.contrast(e)>=(i=void 0===(l=(n=t).size)?"normal":l,"AAA"===(r=void 0===(o=n.level)?"AA":o)&&"normal"===i?7:"AA"===r&&"large"===i?3:4.5);var n,o,r,l,i}}var Rd=n(3124),Md=n.n(Rd);const Ad=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Dd(e,t){t=t||{};let n=1,o=1;function r(e){const t=e.match(/\n/g);t&&(n+=t.length);const r=e.lastIndexOf("\n");o=~r?e.length-r:o+e.length}function l(){const e={line:n,column:o};return function(t){return t.position=new i(e),m(),t}}function i(e){this.start=e,this.end={line:n,column:o},this.source=t.source}i.prototype.content=e;const s=[];function a(r){const l=new Error(t.source+":"+n+":"+o+": "+r);if(l.reason=r,l.filename=t.source,l.line=n,l.column=o,l.source=e,!t.silent)throw l;s.push(l)}function c(){return p(/^{\s*/)}function u(){return p(/^}/)}function d(){let t;const n=[];for(m(),g(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),g(n));return n}function p(t){const n=t.exec(e);if(!n)return;const o=n[0];return r(o),e=e.slice(o.length),n}function m(){p(/^\s*/)}function g(e){let t;for(e=e||[];t=h();)!1!==t&&e.push(t);return e}function h(){const t=l();if("/"!==e.charAt(0)||"*"!==e.charAt(1))return;let n=2;for(;""!==e.charAt(n)&&("*"!==e.charAt(n)||"/"!==e.charAt(n+1));)++n;if(n+=2,""===e.charAt(n-1))return a("End of comment missing");const i=e.slice(2,n-2);return o+=2,r(i),e=e.slice(n),o+=2,t({type:"comment",comment:i})}function f(){const e=p(/^([^{]+)/);if(e)return Od(e[0]).replace(/\/\*([^*]|[\r\n]|(\*+([^*/]|[\r\n])))*\*\/+/g,"").replace(/"(?:\\"|[^"])*"|'(?:\\'|[^'])*'/g,(function(e){return e.replace(/,/g,"")})).split(/\s*(?![^(]*\)),\s*/).map((function(e){return e.replace(/\u200C/g,",")}))}function v(){const e=l();let t=p(/^(\*?[-#\/\*\\\w]+(\[[0-9a-z_-]+\])?)\s*/);if(!t)return;if(t=Od(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ad,""),value:n?Od(n[0]).replace(Ad,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(g(e);t=v();)!1!==t&&(e.push(t),g(e));return u()?e:a("missing '}'")}function _(){let e;const t=[],n=l();for(;e=p(/^((\d+\.\d+|\.\d+|\d+)%?|[a-z]+)\s*/);)t.push(e[1]),p(/^,\s*/);if(t.length)return n({type:"keyframe",values:t,declarations:b()})}const k=C("import"),y=C("charset"),E=C("namespace");function C(e){const t=new RegExp("^@"+e+"\\s*([^;]+);");return function(){const n=l(),o=p(t);if(!o)return;const r={type:e};return r[e]=o[1].trim(),n(r)}}function S(){if("@"===e[0])return function(){const e=l();let t=p(/^@([-\w]+)?keyframes\s*/);if(!t)return;const n=t[1];if(t=p(/^([-\w]+)\s*/),!t)return a("@keyframes missing name");const o=t[1];if(!c())return a("@keyframes missing '{'");let r,i=g();for(;r=_();)i.push(r),i=i.concat(g());return u()?e({type:"keyframes",name:o,vendor:n,keyframes:i}):a("@keyframes missing '}'")}()||function(){const e=l(),t=p(/^@media *([^{]+)/);if(!t)return;const n=Od(t[1]);if(!c())return a("@media missing '{'");const o=g().concat(d());return u()?e({type:"media",media:n,rules:o}):a("@media missing '}'")}()||function(){const e=l(),t=p(/^@custom-media\s+(--[^\s]+)\s*([^{;]+);/);if(t)return e({type:"custom-media",name:Od(t[1]),media:Od(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Od(t[1]);if(!c())return a("@supports missing '{'");const o=g().concat(d());return u()?e({type:"supports",supports:n,rules:o}):a("@supports missing '}'")}()||k()||y()||E()||function(){const e=l(),t=p(/^@([-\w]+)?document *([^{]+)/);if(!t)return;const n=Od(t[1]),o=Od(t[2]);if(!c())return a("@document missing '{'");const r=g().concat(d());return u()?e({type:"document",document:o,vendor:n,rules:r}):a("@document missing '}'")}()||function(){const e=l();if(!p(/^@page */))return;const t=f()||[];if(!c())return a("@page missing '{'");let n,o=g();for(;n=v();)o.push(n),o=o.concat(g());return u()?e({type:"page",selectors:t,declarations:o}):a("@page missing '}'")}()||function(){const e=l();if(!p(/^@host\s*/))return;if(!c())return a("@host missing '{'");const t=g().concat(d());return u()?e({type:"host",rules:t}):a("@host missing '}'")}()||function(){const e=l();if(!p(/^@font-face\s*/))return;if(!c())return a("@font-face missing '{'");let t,n=g();for(;t=v();)n.push(t),n=n.concat(g());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=f();return t?(g(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Fd(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Od(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Fd(e,t){const n=e&&"string"==typeof e.type,o=n?e:t;for(const t in e){const n=e[t];Array.isArray(n)?n.forEach((function(e){Fd(e,o)})):n&&"object"==typeof n&&Fd(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var zd=n(8575),Vd=n.n(zd);const Hd=Ud;function Ud(e){this.options=e||{}}Ud.prototype.emit=function(e){return e},Ud.prototype.visit=function(e){return this[e.type](e)},Ud.prototype.mapVisit=function(e,t){let n="";t=t||"";for(let o=0,r=e.length;o<r;o++)n+=this.visit(e[o]),t&&o<r-1&&(n+=this.emit(t));return n};const Gd=Wd;function Wd(e){Hd.call(this,e)}Vd()(Wd,Hd),Wd.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Wd.prototype.comment=function(e){return this.emit("",e.position)},Wd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Wd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Wd.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Wd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Wd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Wd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Wd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Wd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Wd.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", "):"";return this.emit("@page "+t,e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Wd.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Wd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Wd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Wd.prototype.rule=function(e){const t=e.declarations;return t.length?this.emit(e.selectors.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}"):""},Wd.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};const $d=jd;function jd(e){e=e||{},Hd.call(this,e),this.indentation=e.indent}Vd()(jd,Hd),jd.prototype.compile=function(e){return this.stylesheet(e)},jd.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},jd.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},jd.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},jd.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},jd.prototype.document=function(e){const t="@"+(e.vendor||"")+"document "+e.document;return this.emit(t,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},jd.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},jd.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},jd.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},jd.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.keyframes,"\n")+this.emit(this.indent(-1)+"}")},jd.prototype.keyframe=function(e){const t=e.declarations;return this.emit(this.indent())+this.emit(e.values.join(", "),e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(t,"\n")+this.emit(this.indent(-1)+"\n"+this.indent()+"}\n")},jd.prototype.page=function(e){const t=e.selectors.length?e.selectors.join(", ")+" ":"";return this.emit("@page "+t,e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},jd.prototype["font-face"]=function(e){return this.emit("@font-face ",e.position)+this.emit("{\n")+this.emit(this.indent(1))+this.mapVisit(e.declarations,"\n")+this.emit(this.indent(-1))+this.emit("\n}")},jd.prototype.host=function(e){return this.emit("@host",e.position)+this.emit(" {\n"+this.indent(1))+this.mapVisit(e.rules,"\n\n")+this.emit(this.indent(-1)+"\n}")},jd.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},jd.prototype.rule=function(e){const t=this.indent(),n=e.declarations;return n.length?this.emit(e.selectors.map((function(e){return t+e})).join(",\n"),e.position)+this.emit(" {\n")+this.emit(this.indent(1))+this.mapVisit(n,"\n")+this.emit(this.indent(-1))+this.emit("\n"+this.indent()+"}"):""},jd.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},jd.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};const Kd=function(e,t){try{const r=Dd(e);return n=Md().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Gd(o):new $d(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function qd(e){return 0!==e.value.indexOf("data:")&&0!==e.value.indexOf("#")&&(t=e.value,!/^\/(?!\/)/.test(t)&&!function(e){return/^(?:https?:)?\/\//.test(e)}(e.value));var t}function Yd(e,t){return new URL(e,t).toString()}const Zd=e=>t=>{if("declaration"===t.type){const l=function(e){const t=/url\((\s*)(['"]?)(.+?)\2(\s*)\)/g;let n;const o=[];for(;null!==(n=t.exec(e));){const e={source:n[0],before:n[1],quote:n[2],value:n[3],after:n[4]};qd(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Yd(e.value,r)+e.quote+e.after+")"})));return{...t,value:(n=t.value,o=l,o.forEach((e=>{n=n.replace(e.source,e.newUrl)})),n)}}var n,o,r;return t},Qd=/^(body|html|:root).*$/,Xd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return n=>"rule"===n.type?{...n,selectors:n.selectors.map((n=>t.includes(n.trim())?n:n.match(Qd)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Jd=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(e,(e=>{let{css:n,baseURL:o}=e;const r=[];return t&&r.push(Xd(t)),o&&r.push(Zd(o)),r.length?Kd(n,(0,d.compose)(r)):n}))},ep=".editor-styles-wrapper";function tp(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(ep);let l;if(r)l=n.getComputedStyle(r,null).getPropertyValue("background-color");else{const e=t.createElement("div");e.classList.add("editor-styles-wrapper"),o.appendChild(e),l=n.getComputedStyle(e,null).getPropertyValue("background-color"),o.removeChild(e)}const i=Bd(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function np(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Jd(t,ep)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:tp(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}function op(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Bd(e).toRgb();t.r.push(n.r/255),t.g.push(n.g/255),t.b.push(n.b/255),t.a.push(n.a)})),t}function rp(e){let{selector:t,id:n}=e;const o=`\n${t} {\n\tfilter: url( #${n} );\n}\n`;return(0,s.createElement)("style",null,o)}function lp(e){let{selector:t}=e;const n=`\n${t} {\n\tfilter: none;\n}\n`;return(0,s.createElement)("style",null,n)}function ip(e){let{id:t,colors:n}=e;const o=op(n);return(0,s.createElement)(p.SVG,{xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 0 0",width:"0",height:"0",focusable:"false",role:"none",style:{visibility:"hidden",position:"absolute",left:"-9999px",overflow:"hidden"}},(0,s.createElement)("defs",null,(0,s.createElement)("filter",{id:t},(0,s.createElement)("feColorMatrix",{colorInterpolationFilters:"sRGB",type:"matrix",values:" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "}),(0,s.createElement)("feComponentTransfer",{colorInterpolationFilters:"sRGB"},(0,s.createElement)("feFuncR",{type:"table",tableValues:o.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:o.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:o.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:o.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function sp(e){let{preset:t}=e;return(0,s.createElement)(ip,{id:`wp-duotone-${t.slug}`,colors:t.colors})}let ap;xd([Td,Ld]);const cp=2e3,up=function(e){let{viewportWidth:t,__experimentalPadding:n,__experimentalMinHeight:o}=e;const[r,{width:l}]=(0,d.useResizeObserver)(),[i,{height:a}]=(0,d.useResizeObserver)(),{styles:c,assets:u,duotone:g}=(0,m.useSelect)((e=>{var t,n;const o=e(to).getSettings();return{styles:o.styles,assets:o.__unstableResolvedAssets,duotone:null===(t=o.__experimentalFeatures)||void 0===t||null===(n=t.color)||void 0===n?void 0:n.duotone}}),[]),h=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]),f=(0,s.useMemo)((()=>{var e,t;return[...null!==(e=null==g?void 0:g.default)&&void 0!==e?e:[],...null!==(t=null==g?void 0:g.theme)&&void 0!==t?t:[]]}),[g]);ap=ap||(0,d.pure)($h);const v=l/t;return(0,s.createElement)("div",{className:"block-editor-block-preview__container"},r,(0,s.createElement)(p.Disabled,{className:"block-editor-block-preview__content",style:{transform:`scale(${v})`,height:a*v,maxHeight:a>cp?cp*v:void 0,minHeight:o}},(0,s.createElement)(ed,{head:(0,s.createElement)(np,{styles:h}),assets:u,contentRef:(0,d.useRefEffect)((e=>{const{ownerDocument:{documentElement:t}}=e;t.classList.add("block-editor-block-preview__content-iframe"),t.style.position="absolute",t.style.width="100%",e.style.padding=n+"px",e.style.position="relative"}),[]),"aria-hidden":!0,tabIndex:-1,style:{position:"absolute",width:t,height:a,pointerEvents:"none",maxHeight:cp,minHeight:0!==v&&v<1&&o?o/v:o}},i,f.map((e=>(0,s.createElement)(sp,{preset:e,key:e.slug}))),(0,s.createElement)(ap,{renderAppender:!1}))))},dp=(0,s.memo)((function(e){let{blocks:t,__experimentalPadding:n=0,viewportWidth:o=1200,__experimentalLive:r=!1,__experimentalOnClick:l,__experimentalMinHeight:i}=e;const a=(0,m.useSelect)((e=>e(to).getSettings()),[]),c=(0,s.useMemo)((()=>{const e={...a};return e.__experimentalBlockPatterns=[],e}),[a]),d=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]);return t&&0!==t.length?(0,s.createElement)(Mu,{value:d,settings:c},r?(0,s.createElement)(Au,{onClick:l}):(0,s.createElement)(up,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function pp(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(to).getSettings()),[]),l=(0,d.useDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),g=(0,s.createElement)(Mu,{value:p,settings:a},(0,s.createElement)(Kh,{renderAppender:!1,__experimentalLayout:o}));return{...n,ref:i,className:c()(n.className,"block-editor-block-preview__live-content","components-disabled"),children:null!=t&&t.length?g:null}}const mp=function(e){var t;let{item:n}=e;const{name:o,title:l,icon:i,description:a,initialAttributes:c,example:u}=n,d=(0,r.isReusableBlock)(n);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},d||u?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(dp,{__experimentalPadding:16,viewportWidth:null!==(t=null==u?void 0:u.viewportWidth)&&void 0!==t?t:500,blocks:u?(0,r.getBlockFromExample)(n.name,{attributes:{...u.attributes,...c},innerBlocks:u.innerBlocks}):(0,r.createBlock)(o,c)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,h.__)("No Preview Available."))),!d&&(0,s.createElement)(Nu,{title:l,icon:i,description:a}))},gp=(0,s.createContext)(),hp=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(gp);return(0,s.createElement)(p.__unstableCompositeItem,i({ref:t,state:a,role:"option",focusable:!0},l),(e=>{const t={...e,tabIndex:n?0:e.tabIndex};return o?(0,s.createElement)(o,t,r):"function"==typeof r?r(t):(0,s.createElement)(p.Button,t,r)}))})),fp=(0,s.createElement)(D.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function vp(e){let{count:t,icon:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-draggable-chip-wrapper"},(0,s.createElement)("div",{className:"block-editor-block-draggable-chip"},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-draggable-chip__content"},(0,s.createElement)(p.FlexItem,null,n?(0,s.createElement)(Tu,{icon:n}):(0,h.sprintf)(
|
13 |
/* translators: %d: Number of blocks. */
|
14 |
+
(0,h._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Tu,{icon:fp})))))}const bp=e=>{let{isEnabled:t,blocks:n,icon:o,children:r}=e;const l={type:"inserter",blocks:n};return(0,s.createElement)(p.Draggable,{__experimentalTransferDataType:"wp-blocks",transferData:l,__experimentalDragComponent:(0,s.createElement)(vp,{count:n.length,icon:o})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return r({draggable:t,onDragStart:t?n:void 0,onDragEnd:t?o:void 0})}))},_p=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const m=(0,s.useRef)(!1),g=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},h=(0,s.useMemo)((()=>[(0,r.createBlock)(o.name,o.initialAttributes,(0,r.createBlocksFromInnerBlocksTemplate)(o.innerBlocks))]),[o.name,o.initialAttributes,o.initialAttributes]);return(0,s.createElement)(bp,{isEnabled:u&&!o.disabled,blocks:h,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:h}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{m.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{m.current=!1,h&&h(e)}},(0,s.createElement)(hp,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,(0,gu.isAppleOS)()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===gu.ENTER&&(e.preventDefault(),l(o,(0,gu.isAppleOS)()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{m.current||a(o)},onMouseEnter:()=>{m.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:g},(0,s.createElement)(Tu,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},(0,s.createElement)(p.__experimentalTruncate,{numberOfLines:3},o.title))))}))})),kp=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Ut.speak)((0,h.__)("Use left and right arrow keys to move through blocks"))}),[n]),(0,s.createElement)("div",i({ref:t,role:"listbox","aria-orientation":"horizontal",onFocus:()=>{o(!0)},onBlur:e=>{!e.currentTarget.contains(e.relatedTarget)&&o(!1)}},e))})),yp=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(gp);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Ep=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(kp,{className:"block-editor-block-types-list","aria-label":i},function(e,t){const n=[];for(let t=0,o=e.length;t<o;t+=3)n.push(e.slice(t,t+3));return n}(t).map(((e,t)=>(0,s.createElement)(yp,{key:t},e.map(((e,l)=>(0,s.createElement)(_p,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a&&!e.isDisabled,isFirst:0===t&&0===l})))))),l)},Cp=function(e){let{title:t,icon:n,children:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__panel-header"},(0,s.createElement)("h2",{className:"block-editor-inserter__panel-title"},t),(0,s.createElement)(p.Icon,{icon:n})),(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},o))},Sp=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(to),{getCategories:o,getCollections:l}=t(r.store);return{categories:o(),collections:l(),items:n(e)}}),[e]);return[l,n,o,(0,s.useCallback)(((e,n)=>{let{name:o,initialAttributes:l,innerBlocks:i}=e;const s=(0,r.createBlock)(o,l,(0,r.createBlocksFromInnerBlocksTemplate)(i));t(s,void 0,n)}),[t])]},wp=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(gp.Provider,{value:n},t)},Bp=[],Ip=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=Sp(t,n),p=(0,s.useMemo)((()=>(0,u.orderBy)(l,["frecency"],["desc"]).slice(0,6)),[l]),m=(0,s.useMemo)((()=>l.filter((e=>!e.category))),[l]),g=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),f=(0,s.useMemo)((()=>{const e={...a};return Object.keys(a).forEach((t=>{e[t]=l.filter((e=>(e=>e.name.split("/")[0])(e)===t)),0===e[t].length&&delete e[t]})),e}),[l,a]);(0,s.useEffect)((()=>()=>o(null)),[]);const v=(0,d.useAsyncList)(i),b=i.length===v.length,_=(0,s.useMemo)((()=>Object.entries(a)),[a]),k=(0,d.useAsyncList)(b?_:Bp);return(0,s.createElement)(wp,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Cp,{title:(0,h._x)("Most used","blocks")},(0,s.createElement)(Ep,{items:p,onSelect:c,onHover:o,label:(0,h._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=g[e.slug];return t&&t.length?(0,s.createElement)(Cp,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Ep,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Cp,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,h.__)("Uncategorized")},(0,s.createElement)(Ep,{items:m,onSelect:c,onHover:o,label:(0,h.__)("Uncategorized")})),(0,u.map)(k,(e=>{let[t,n]=e;const r=f[t];return r&&r.length?(0,s.createElement)(Cp,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Ep,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},xp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,openPatternExplorer:r}=e;const l=(0,d.useViewportMatch)("medium","<"),i=c()("block-editor-inserter__panel-header","block-editor-inserter__panel-header-patterns");return(0,s.createElement)(p.Flex,{justify:"space-between",align:"start",gap:"4",className:i},(0,s.createElement)(p.FlexItem,{isBlock:!0},(0,s.createElement)(p.SelectControl,{className:"block-editor-inserter__panel-dropdown",label:(0,h.__)("Filter patterns"),hideLabelFromVision:!0,value:t.name,onChange:e=>{o(n.find((t=>e===t.name)))},onBlur:e=>{null!=e&&e.relatedTarget||e.stopPropagation()},options:(()=>{const e=[];return n.map((t=>e.push({value:t.name,label:t.label}))),e})()})),!l&&(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-inserter__patterns-explorer-expand",label:(0,h.__)("Explore all patterns"),onClick:()=>r()},(0,h._x)("Explore","Label for showing all block patterns"))))},Tp=window.wp.notices,Np=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(to);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Tp.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,h.sprintf)(
|
15 |
/* translators: %s: block pattern title. */
|
16 |
+
(0,h.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function Pp(e){let{isDraggable:t,pattern:n,onClick:o,composite:r}=e;const{blocks:l,viewportWidth:a}=n,c=`block-editor-block-patterns-list__item-description-${(0,d.useInstanceId)(Pp)}`;return(0,s.createElement)(bp,{isEnabled:t,blocks:l},(e=>{let{draggable:t,onDragStart:u,onDragEnd:d}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__list-item","aria-label":n.title,"aria-describedby":n.description?c:void 0,draggable:t,onDragStart:u,onDragEnd:d},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},r,{className:"block-editor-block-patterns-list__item",onClick:()=>o(n,l)}),(0,s.createElement)(dp,{blocks:l,viewportWidth:a}),(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item-title"},n.title),!!n.description&&(0,s.createElement)(p.VisuallyHidden,{id:c},n.description)))}))}function Lp(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}const Rp=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,h.__)("Block Patterns")}=e;const c=(0,p.__unstableUseCompositeState)({orientation:l});return(0,s.createElement)(p.__unstableComposite,i({},c,{role:"listbox",className:"block-editor-block-patterns-list","aria-label":a}),n.map((e=>o.includes(e)?(0,s.createElement)(Pp,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Lp,{key:e.name}))))};function Mp(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o}=e;const r="block-editor-block-patterns-explorer__sidebar";return(0,s.createElement)("div",{className:`${r}__categories-list`},n.map((e=>{let{name:n,label:l}=e;return(0,s.createElement)(p.Button,{key:n,label:l,className:`${r}__categories-list__item`,isPressed:t===n,onClick:()=>{o(n)}},l)})))}function Ap(e){let{filterValue:t,setFilterValue:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__search"},(0,s.createElement)(p.SearchControl,{onChange:n,value:t,label:(0,h.__)("Search for patterns"),placeholder:(0,h.__)("Search")}))}const Dp=function(e){let{selectedCategory:t,patternCategories:n,onClickCategory:o,filterValue:r,setFilterValue:l}=e;return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__sidebar"},(0,s.createElement)(Ap,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Mp,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Op=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(nl,{className:"block-editor-inserter__no-results-icon",icon:xu}),(0,s.createElement)("p",null,(0,h.__)("No results found.")))},Fp=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(to),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(to),c=r();let u,d=t;return void 0!==n?u=n:o?u=s(o):!l&&c?(d=i(c),u=s(c)+1):u=a(d).length,{destinationRootClientId:d,destinationIndex:u}}),[t,n,o,l]),{replaceBlocks:g,insertBlocks:f,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(to),_=(0,s.useCallback)((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];const o=c();!l&&o&&(0,r.isUnmodifiedDefaultBlock)(o)?g(o.clientId,e,null,a||n?0:null,t):f(e,p,d,!0,a||n?0:null,t);const s=(0,h.sprintf)(// translators: %d: the name of the block that has been added
|
17 |
+
(0,h._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Ut.speak)(s),i&&i()}),[l,c,g,f,d,p,i,a]),k=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,_,k]};function zp(e){return e.toLowerCase()}var Vp=[/([a-z0-9])([A-Z])/g,/([A-Z])([A-Z][a-z])/g],Hp=/[^A-Z0-9]+/gi;function Up(e,t){void 0===t&&(t={});for(var n=t.splitRegexp,o=void 0===n?Vp:n,r=t.stripRegexp,l=void 0===r?Hp:r,i=t.transform,s=void 0===i?zp:i,a=t.delimiter,c=void 0===a?" ":a,u=Gp(Gp(e,o,"$1\0$2"),l,"\0"),d=0,p=u.length;"\0"===u.charAt(d);)d++;for(;"\0"===u.charAt(p-1);)p--;return u.slice(d,p).split("\0").map(s).join(c)}function Gp(e,t,n){return t instanceof RegExp?e.replace(t,n):t.reduce((function(e,t){return e.replace(t,n)}),e)}var Wp=n(4793),$p=n.n(Wp);const jp=e=>e.name||"",Kp=e=>e.title,qp=e=>e.description||"",Yp=e=>e.keywords||[],Zp=e=>e.category,Qp=()=>null;function Xp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=$p()(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}function Jp(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Up(e).split(" ").filter(Boolean)}const em=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Jp(Xp(e))},tm=(e,t)=>e.filter((e=>!em(t).some((t=>t.includes(e))))),nm=(e,t,n,o)=>0===em(o).length?e:om(e,o,{getCategory:e=>{var n;return null===(n=(0,u.find)(t,{slug:e.category}))||void 0===n?void 0:n.title},getCollection:e=>{var t;return null===(t=n[e.name.split("/")[0]])||void 0===t?void 0:t.title}}),om=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const o=em(t);if(0===o.length)return e;const r=e.map((e=>[e,rm(e,t,n)])).filter((e=>{let[,t]=e;return t>0}));return r.sort(((e,t)=>{let[,n]=e,[,o]=t;return o-n})),r.map((e=>{let[t]=e;return t}))};function rm(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=jp,getTitle:r=Kp,getDescription:l=qp,getKeywords:i=Yp,getCategory:s=Zp,getCollection:a=Qp}=n,c=o(e),u=r(e),d=l(e),p=i(e),m=s(e),g=a(e),h=Xp(t),f=Xp(u);let v=0;if(h===f)v+=30;else if(f.startsWith(h))v+=20;else{const e=[c,u,d,...p,m,g].join(" "),t=Jp(h);0===tm(t,e).length&&(v+=10)}return 0!==v&&c.startsWith("core/")&&(v+=c!==e.id?1:2),v}function lm(e){let{filterValue:t,filteredBlockPatternsLength:n}=e;return t?(0,s.createElement)(p.__experimentalHeading,{level:2,lineHeight:"48px",className:"block-editor-block-patterns-explorer__search-results-count"},(0,h.sprintf)(
|
18 |
/* translators: %d: number of patterns. %s: block pattern search query */
|
19 |
+
(0,h._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}const im=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ut.speak,500),[l,i]=Fp({shouldFocusBlock:!0}),[a,,c]=Np(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?om(a,t):a.filter((e=>{var t,o;return"uncategorized"===n?!(null!==(t=e.categories)&&void 0!==t&&t.length)||e.categories.every((e=>!u.includes(e))):null===(o=e.categories)||void 0===o?void 0:o.includes(n)}))),[t,n,a]);(0,s.useEffect)((()=>{if(!t)return;const e=p.length,n=(0,h.sprintf)(
|
20 |
/* translators: %d: number of results. */
|
21 |
+
(0,h._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),g=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},g&&(0,s.createElement)(lm,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(wp,null,!g&&(0,s.createElement)(Op,null),g&&(0,s.createElement)(Rp,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function sm(e){let{initialCategory:t,patternCategories:n}=e;const[o,r]=(0,s.useState)(""),[l,i]=(0,s.useState)(null==t?void 0:t.name);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer"},(0,s.createElement)(Dp,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(im,{filterValue:o,selectedCategory:l,patternCategories:n}))}const am=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,h.__)("Patterns"),closeLabel:(0,h.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(sm,n))};function cm(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Np(n,t),a=(0,s.useCallback)((e=>{var t;if(null===(t=e.categories)||void 0===t||!t.length)return 1/0;const n=r.reduce(((e,t,n)=>{let{name:o}=t;return e[o]=n,e}),{});return Math.min(...e.categories.map((e=>void 0!==n[e]?n[e]:1/0)))}),[r]),c=(0,s.useMemo)((()=>l.filter((e=>{var t;return"uncategorized"===o.name?a(e)===1/0:null===(t=e.categories)||void 0===t?void 0:t.includes(o.name)}))),[l,o]),u=(0,s.useMemo)((()=>c.sort(((e,t)=>a(e)-a(t)))),[c,a]),p=(0,d.useAsyncList)(u);return c.length?(0,s.createElement)("div",{className:"block-editor-inserter__panel-content"},(0,s.createElement)(Rp,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}const um=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Np(),u=(0,s.useCallback)((e=>!(!e.categories||!e.categories.length)&&e.categories.some((e=>c.some((t=>t.name===e))))),[c]),d=(0,s.useMemo)((()=>{const e=c.filter((e=>a.some((t=>{var n;return null===(n=t.categories)||void 0===n?void 0:n.includes(e.name)})))).sort(((e,t)=>{let{name:n}=e,{name:o}=t;return[n,o].includes("featured")?"featured"===n?-1:1:0}));return a.some((e=>!u(e)))&&!e.find((e=>"uncategorized"===e.name))&&e.push({name:"uncategorized",label:(0,h._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(xp,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(cm,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(am,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},dm=window.wp.url;function pm(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=Sp(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(Op,null):(0,s.createElement)(Cp,{title:(0,h.__)("Reusable blocks")},(0,s.createElement)(Ep,{items:i,onSelect:l,onHover:t,label:(0,h.__)("Reusable blocks")}))}const mm=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(pm,{onHover:o,onInsert:n,rootClientId:t}),(0,s.createElement)("div",{className:"block-editor-inserter__manage-reusable-blocks-container"},(0,s.createElement)("a",{className:"block-editor-inserter__manage-reusable-blocks",href:(0,dm.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,h.__)("Manage Reusable blocks"))))},{Fill:gm,Slot:hm}=(0,p.createSlotFill)("__unstableInserterMenuExtension");gm.Slot=hm;const fm=gm,vm=[],bm=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:g=!1,isDraggable:f=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const _=(0,d.useDebounce)(Ut.speak,500),[k,y]=Fp({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=Sp(k,y),[B,,I]=Np(y,k),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=om(B,t);return void 0!==c?e.slice(0,c):e}),[t,B,c]);let T=m;b&&x.length>2&&(T=0);const N=(0,s.useMemo)((()=>{if(0===T)return[];const e=nm((0,u.orderBy)(E,["frecency"],["desc"]),C,S,t);return void 0!==T?e.slice(0,T):e}),[t,E,C,S,m]);(0,s.useEffect)((()=>{if(!t)return;const e=N.length+x.length,n=(0,h.sprintf)(
|
22 |
/* translators: %d: number of results. */
|
23 |
+
(0,h._n)("%d result found.","%d results found.",e),e);_(n)}),[t,_]);const P=(0,d.useAsyncList)(N,{step:9}),L=(0,d.useAsyncList)(P.length===N.length?x:vm),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),M=!!N.length&&(0,s.createElement)(Cp,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Blocks"))},(0,s.createElement)(Ep,{items:P,onSelect:w,onHover:o,label:(0,h.__)("Blocks"),isDraggable:f})),A=!!x.length&&(0,s.createElement)(Cp,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,h.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Rp,{shownPatterns:L,blockPatterns:x,onClickPattern:I,isDraggable:f})));return(0,s.createElement)(wp,null,!g&&!R&&(0,s.createElement)(Op,null),b?A:M,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?M:A,g&&(0,s.createElement)(fm.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:k}},(e=>e.length?e:R?null:(0,s.createElement)(Op,null))))},_m={name:"blocks",
|
24 |
/* translators: Blocks tab title in the block inserter. */
|
25 |
+
title:(0,h.__)("Blocks")},km={name:"patterns",
|
26 |
/* translators: Patterns tab title in the block inserter. */
|
27 |
+
title:(0,h.__)("Patterns")},ym={name:"reusable",
|
28 |
/* translators: Reusable blocks tab title in the block inserter. */
|
29 |
+
title:(0,h.__)("Reusable")},Em=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[_m];return n&&e.push(km),o&&e.push(ym),e}),[_m,n,km,o,ym]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},Cm=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,onSelect:i,showInserterHelpPanel:a,showMostUsedBlocks:c,__experimentalFilterValue:u="",shouldFocusBlock:d=!0}=e;const[g,f]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[_,k]=(0,s.useState)(null),[y,E,C]=Fp({rootClientId:n,clientId:o,isAppender:r,insertionIndex:l,shouldFocusBlock:d}),{showPatterns:S,hasReusableBlocks:w}=(0,m.useSelect)((e=>{var t;const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(to);return{showPatterns:!!n(y).length,hasReusableBlocks:!(null===(t=o().__experimentalReusableBlocks)||void 0===t||!t.length)}}),[y]),B=(0,s.useCallback)(((e,t,n)=>{E(e,t,n),i()}),[E,i]),I=(0,s.useCallback)(((e,t)=>{E(e,{patternName:t}),i()}),[E,i]),x=(0,s.useCallback)((e=>{C(!!e),b(e)}),[C,b]),T=(0,s.useCallback)((e=>{k(e)}),[k]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(Ip,{rootClientId:y,onInsert:B,onHover:x,showMostUsedBlocks:c})),a&&(0,s.createElement)("div",{className:"block-editor-inserter__tips"},(0,s.createElement)(p.VisuallyHidden,{as:"h2"},(0,h.__)("A tip for using the block editor")),(0,s.createElement)(Iu,null)))),[y,B,x,g,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(um,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:_})),[y,I,T,_]),L=(0,s.useMemo)((()=>(0,s.createElement)(mm,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:L),[N,P,L]),M=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{M.current.focus()}}))),(0,s.createElement)("div",{className:"block-editor-inserter__menu"},(0,s.createElement)("div",{className:"block-editor-inserter__main-area"},(0,s.createElement)("div",{className:"block-editor-inserter__content"},(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",onChange:e=>{v&&b(null),f(e)},value:g,label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search"),ref:M}),!!g&&(0,s.createElement)(bm,{filterValue:g,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!g&&(S||w)&&(0,s.createElement)(Em,{showPatterns:S,showReusableBlocks:w},R),!g&&!S&&!w&&N)),a&&v&&(0,s.createElement)(mp,{item:v}))}));function Sm(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,a]=(0,s.useState)(""),[u,d]=Fp({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[g]=Sp(u,d),[f]=Np(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(to),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),_=f.length&&(!!i||l),k=_&&f.length>6||g.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return _&&(y=l?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":k,"has-expand":v})},k&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,h.__)("Search for blocks and patterns"),placeholder:(0,h.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(bm,{filterValue:i,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:l})),v&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{v({rootClientId:n,insertionIndex:b,filterValue:i})},"aria-label":(0,h.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,h.__)("Browse all")))}const wm=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
|
30 |
+
(0,h._x)("Add %s","directly add the only allowed block"),l):u?(0,h.__)("Add pattern"):(0,h._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:wu,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),d&&d(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},m))};class Bm extends s.Component{constructor(){super(...arguments),this.onToggle=this.onToggle.bind(this),this.renderToggle=this.renderToggle.bind(this),this.renderContent=this.renderContent.bind(this)}onToggle(e){const{onToggle:t}=this.props;t&&t(e)}renderToggle(e){let{onToggle:t,isOpen:n}=e;const{disabled:o,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,hasItems:a,renderToggle:c=wm,prioritizePatterns:u}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s,prioritizePatterns:u})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i,prioritizePatterns:a}=this.props;return i?(0,s.createElement)(Sm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a}):(0,s.createElement)(Cm,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l})}render(){const{position:e,hasSingleBlockType:t,directInsertBlock:n,insertOnlyAllowedBlock:o,__experimentalIsQuick:r,onSelectOrClose:l}=this.props;return t||n?this.renderToggle({onToggle:o}):(0,s.createElement)(p.Dropdown,{className:"block-editor-inserter",contentClassName:c()("block-editor-inserter__popover",{"is-quick":r}),position:e,onToggle:this.onToggle,expandOnMobile:!0,headerTitle:(0,h.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}const Im=(0,d.compose)([(0,m.withSelect)(((e,t)=>{var n;let{clientId:o,rootClientId:l}=t;const{getBlockRootClientId:i,hasInserterItems:s,__experimentalGetAllowedBlocks:a,__experimentalGetDirectInsertBlock:c,getBlockIndex:u,getBlockCount:d,getSettings:p}=e(to),{getBlockVariations:m}=e(r.store);l=l||i(o)||void 0;const g=a(l),h=c(l),f=u(o),v=d(),b=p(),_=1===(null==g?void 0:g.length)&&0===(null===(n=m(g[0].name,"inserter"))||void 0===n?void 0:n.length);let k=!1;return _&&(k=g[0]),{hasItems:s(l),hasSingleBlockType:_,blockTitle:k?k.title:"",allowedBlockType:k,directInsertBlock:h,rootClientId:l,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!l&&f>0&&(f<v||0===v)}})),(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;return{insertOnlyAllowedBlock(){const{rootClientId:n,clientId:l,isAppender:i,hasSingleBlockType:s,allowedBlockType:a,directInsertBlock:c,onSelectOrClose:u}=t;if(!s&&!c)return;const{insertBlock:d}=e(to);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(to);if(!e||!l&&!n)return{};const i={};let s={};if(l){const e=t(l),n=t(r(l));(null==e?void 0:e.name)===(null==n?void 0:n.name)&&(s=(null==n?void 0:n.attributes)||{})}else{var a;const e=t(n);if(null!=e&&null!==(a=e.innerBlocks)&&void 0!==a&&a.length){const t=e.innerBlocks[e.innerBlocks.length-1];c&&(null==c?void 0:c.name)===t.name&&(s=t.attributes)}}return e.forEach((e=>{s.hasOwnProperty(e)&&(i[e]=s[e])})),i}(c.attributesToCopy);p=(0,r.createBlock)(c.name,{...c.attributes||{},...e})}else p=(0,r.createBlock)(a.name);d(p,function(){const{getBlockIndex:e,getBlockSelectionEnd:t,getBlockOrder:r,getBlockRootClientId:s}=o(to);if(l)return e(l);const a=t();return!i&&a&&s(a)===n?e(a)+1:r(n).length}(),n),u&&u();const m=(0,h.sprintf)(// translators: %s: the name of the block that has been added
|
31 |
+
(0,h.__)("%s block added"),a.title);(0,Ut.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(Bm),xm=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(to),l=!n(t.rootClientId),{bodyPlaceholder:i}=o();return{showPrompt:l,isLocked:!!r(t.rootClientId),placeholder:i}})),(0,m.withDispatch)(((e,t)=>{const{insertDefaultBlock:n,startTyping:o}=e(to);return{onAppend(){const{rootClientId:e}=t;n(void 0,e),o()}}})))((function(e){let{isLocked:t,onAppend:n,showPrompt:o,placeholder:r,rootClientId:l}=e;if(t)return null;const i=(0,Su.decodeEntities)(r)||(0,h.__)("Type / to choose a block");return(0,s.createElement)("div",{"data-root-client-id":l||"",className:c()("block-editor-default-block-appender",{"has-visible-prompt":o})},(0,s.createElement)("p",{tabIndex:"0",role:"button","aria-label":(0,h.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{gu.ENTER!==e.keyCode&&gu.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(Im,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Tm(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(Im,{position:"bottom center",rootClientId:n,__experimentalIsQuick:!0,renderToggle:e=>{let n,{onToggle:i,disabled:a,isOpen:u,blockTitle:d,hasSingleBlockType:m}=e;n=m?(0,h.sprintf)(// translators: %s: the name of the block when there is only one
|
32 |
+
(0,h._x)("Add %s","directly add the only allowed block"),d):(0,h._x)("Add block","Generic label for block inserter button");const g=!m;let f=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":g?"true":void 0,"aria-expanded":g?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(nl,{icon:wu}));return(g||m)&&(f=(0,s.createElement)(p.Tooltip,{text:n},f)),f},isAppender:!0})}const Nm=(0,s.forwardRef)(((e,t)=>(V()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Tm(e,t)))),Pm=(0,s.forwardRef)(Tm),Lm=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(to);return{isLocked:!!l(n),canInsertDefaultBlock:o((0,r.getDefaultBlockName)(),n),selectedBlockClientId:i()}}))((function(e){let t,{rootClientId:n,canInsertDefaultBlock:o,isLocked:r,renderAppender:l,className:i,selectedBlockClientId:a,tagName:u="div"}=e;if(r||!1===l)return null;if(l)t=(0,s.createElement)(l,null);else{if(a!==n&&(n||a))return null;t=o?(0,s.createElement)(xm,{rootClientId:n}):(0,s.createElement)(Pm,{rootClientId:n,className:"block-list-appender__toggle"})}return(0,s.createElement)(u,{tabIndex:-1,className:c()("block-list-appender wp-block",i),contentEditable:!1,"data-block":!0},t)}));(0,s.createContext)();const Rm=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d,isVisible:g}=(0,m.useSelect)((e=>{var o;const{getBlockListSettings:r,getBlockRootClientId:l,isBlockVisible:i}=e(to),s=l(t);return{orientation:(null===(o=r(s))||void 0===o?void 0:o.orientation)||"vertical",rootClientId:s,isVisible:i(t)&&i(n)}}),[t]),f=Bo(t),v=Bo(n),b="vertical"===u,_=(0,s.useMemo)((()=>{if(!f&&!v||!g)return{};const e=f?f.getBoundingClientRect():null,t=v?v.getBoundingClientRect():null;if(b)return{width:f?f.offsetWidth:v.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,h.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:v.offsetHeight}}),[f,v,b]),k=(0,s.useCallback)((()=>{if(!f&&!v||!g)return{};const{ownerDocument:e}=f||v,t=f?f.getBoundingClientRect():null,n=v?v.getBoundingClientRect():null;return b?(0,h.isRTL)()?{top:t?t.bottom:n.top,left:t?t.right:n.right,right:t?t.left:n.left,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.bottom:n.top,left:t?t.left:n.left,right:t?t.right:n.right,bottom:n?n.top:t.bottom,height:0,width:0,ownerDocument:e}:(0,h.isRTL)()?{top:t?t.top:n.top,left:t?t.left:n.right,right:n?n.right:t.left,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}:{top:t?t.top:n.top,left:t?t.right:n.left,right:n?n.left:t.right,bottom:t?t.bottom:n.bottom,height:0,width:0,ownerDocument:e}}),[f,v]),y=nr(l);return(f||v)&&g?(0,s.createElement)(p.Popover,i({ref:y,animate:!1,getAnchorRect:k,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover","block-editor-block-popover__inbetween",a.className),__unstableForcePosition:!0}),(0,s.createElement)("div",{style:_},o)):null},Mm=(0,s.createContext)();function Am(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(to),l=(0,s.useContext)(Mm),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:g,rootClientId:h,isInserterShown:f}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(to),a=r(),c=n(a.rootClientId);if(!c.length)return{};let u=c[a.index-1],d=c[a.index];for(;l(u);)u=i(u);for(;l(d);)d=s(d);return{previousClientId:u,nextClientId:d,orientation:(null===(t=o(a.rootClientId))||void 0===t?void 0:t.orientation)||"vertical",rootClientId:a.rootClientId,isInserterShown:null==a?void 0:a.__unstableWithInserter}}),[]),v="vertical"===a,b=(0,d.useReducedMotion)(),_={start:{...v?{height:0,left:"50%",right:"50%",y:0}:{width:0,top:"50%",bottom:"50%",x:0},opacity:0},rest:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:f?.4:0}},hover:{...v?{height:4,left:0,right:0,y:-2}:{width:4,top:0,bottom:0,x:-2},opacity:1,borderRadius:"2px",transition:{delay:.4}}},k={start:{scale:b?1:0},rest:{scale:1,transition:{delay:.2}}},y=c()("block-editor-block-list__insertion-point","is-"+a);return(0,s.createElement)(Rm,{previousClientId:u,nextClientId:g,__unstablePopoverSlot:t,__unstableContentRef:n},(0,s.createElement)(p.__unstableMotion.div,{layout:!b,initial:b?"rest":"start",animate:"rest",whileHover:"hover",whileTap:"pressed",exit:"start",ref:i,tabIndex:-1,onClick:function(e){e.target===i.current&&g&&o(g,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":f}),onHoverEnd:function(e){e.target!==i.current||l.current||r()}},(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:"block-editor-block-list__insertion-point-indicator"}),f&&(0,s.createElement)(p.__unstableMotion.div,{variants:k,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(Im,{position:"bottom center",clientId:g,rootClientId:h,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Dm(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(to).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Mm.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(Am,n),t)}function Om(){const e=(0,s.useContext)(Mm),t=(0,m.useSelect)((e=>e(to).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(to),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(to);return(0,d.useRefEffect)((o=>{if(!t)return o.addEventListener("mousemove",s),()=>{o.removeEventListener("mousemove",s)};function s(t){var o,s;if(e.current)return;if(i())return;if(!t.target.classList.contains("block-editor-block-list__layout"))return void(l()&&p());let d;if(t.target.classList.contains("is-root-container")||(d=(t.target.getAttribute("data-block")?t.target:t.target.closest("[data-block]")).getAttribute("data-block")),c(d))return;const m=(null===(o=n(d))||void 0===o?void 0:o.orientation)||"vertical",g=t.target.getBoundingClientRect(),h=t.clientY-g.top,f=t.clientX-g.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>h||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>f));if(!v)return;if(!v.id&&(v=v.firstElementChild,!v))return;if(null===(s=v.parentElement)||void 0===s?void 0:s.closest(".block-editor-block-content-overlay"))return;const b=v.id.slice("block-".length);if(!b)return;if(a().includes(b))return;const _=v.getBoundingClientRect();if("horizontal"===m&&(t.clientY>_.bottom||t.clientY<_.top)||"vertical"===m&&(t.clientX>_.right||t.clientX<_.left))return void(l()&&p());const k=r(b);0!==k?u(d,k,{__unstableWithInserter:!0}):l()&&p()}}),[e,n,o,r,l,i,u,p,a])}const Fm="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,zm="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Vm(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(to),{getBlockType:l,getActiveBlockVariation:i}=t(r.store),s=n(e),a=l(s);if(!a)return null;const c=o(e),u=i(s,c),d={title:a.title,icon:a.icon,description:a.description,anchor:null==c?void 0:c.anchor};return u?{title:u.title||a.title,icon:u.icon||a.icon,description:u.description||a.description,anchor:null==c?void 0:c.anchor}:d}),[e])}function Hm(e){let{clientId:t,maximumLength:n,context:o}=e;const{attributes:l,name:i,reusableBlockTitle:s}=(0,m.useSelect)((e=>{if(!t)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=e(to),i=n(t);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(t),name:i,reusableBlockTitle:s&&l(o(t).ref)}}),[t]),a=Vm(t);if(!i||!a)return null;const c=(0,r.getBlockType)(i),u=c?(0,r.__experimentalGetBlockLabel)(c,l,o):null,d=s||u,p=d&&d!==c.title?d:a.title;if(n&&n>0&&p.length>n){const e="...";return p.slice(0,n-e.length)+e}return p}function Um(e){let{clientId:t,maximumLength:n,context:o}=e;return Hm({clientId:t,maximumLength:n,context:o})}const Gm=e=>{let{children:t,clientIds:n,cloneClassname:o,onDragStart:l,onDragEnd:i}=e;const{srcRootClientId:a,isDraggable:c,icon:u}=(0,m.useSelect)((e=>{var t;const{canMoveBlocks:o,getBlockRootClientId:l,getBlockName:i}=e(to),s=l(n[0]),a=i(n[0]);return{srcRootClientId:s,isDraggable:o(n,s),icon:null===(t=(0,r.getBlockType)(a))||void 0===t?void 0:t.icon}}),[n]),d=(0,s.useRef)(!1),[g,h,f]=function(){const e=(0,s.useRef)(null),t=(0,s.useRef)(null),n=(0,s.useRef)(null),o=(0,s.useRef)(null);return(0,s.useEffect)((()=>()=>{o.current&&(clearInterval(o.current),o.current=null)}),[]),[(0,s.useCallback)((r=>{e.current=r.clientY,n.current=(0,Yl.getScrollContainer)(r.target),o.current=setInterval((()=>{if(n.current&&t.current){const e=n.current.scrollTop+t.current;n.current.scroll({top:e})}}),25)}),[]),(0,s.useCallback)((o=>{if(!n.current)return;const r=n.current.offsetHeight,l=e.current-n.current.offsetTop,i=o.clientY-n.current.offsetTop;if(o.clientY>l){const e=Math.max(r-l-50,0),n=Math.max(i-l-50,0)/e;t.current=25*n}else if(o.clientY<l){const e=Math.max(l-50,0),n=Math.max(l-i-50,0)/e;t.current=-25*n}else t.current=0}),[]),()=>{e.current=null,n.current=null,o.current&&(clearInterval(o.current),o.current=null)}]}(),{startDraggingBlocks:v,stopDraggingBlocks:b}=(0,m.useDispatch)(to);if((0,s.useEffect)((()=>()=>{d.current&&b()}),[]),!c)return t({isDraggable:!1});const _={type:"block",srcClientIds:n,srcRootClientId:a};return(0,s.createElement)(p.Draggable,{cloneClassname:o,__experimentalTransferDataType:"wp-blocks",transferData:_,onDragStart:e=>{v(n),d.current=!0,g(e),l&&l()},onDragOver:h,onDragEnd:()=>{b(),d.current=!1,f(),i&&i()},__experimentalDragComponent:(0,s.createElement)(vp,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Wm=function(e){let{clientId:t,rootClientId:n}=e;const o=Vm(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(to),a=l(t),{name:c,attributes:u}=r(t);return{index:a,name:c,attributes:u,blockMovingMode:i(),orientation:null===(o=s(n))||void 0===o?void 0:o.orientation}}),[t,n]),{index:a,name:u,attributes:d,blockMovingMode:g,orientation:f}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(to),_=(0,s.useRef)(),k=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(k,d,a+1,f);(0,s.useEffect)((()=>{_.current.focus(),(0,Ut.speak)(y)}),[y]);const E=Bo(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N}=(0,m.useSelect)(to),{selectBlock:P,clearSelectedBlock:L,setBlockMovingClientId:R,moveBlockToPosition:M}=(0,m.useDispatch)(to),A=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!g}),D=(0,h.__)("Drag");return(0,s.createElement)("div",{className:A},(0,s.createElement)(p.Flex,{justify:"center",className:"block-editor-block-list__block-selection-button__content"},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Tu,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Gm,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:fp,className:"block-selection-button_drag-handle","aria-hidden":"true",label:D,tabIndex:"-1"},e))))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{ref:_,onClick:()=>v(!1),onKeyDown:function(e){const{keyCode:n}=e,o=n===gu.UP,r=n===gu.DOWN,l=n===gu.LEFT,i=n===gu.RIGHT,s=n===gu.TAB,a=n===gu.ESCAPE,c=n===gu.ENTER,u=n===gu.SPACE,d=e.shiftKey;if(n===gu.BACKSPACE||n===gu.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),g=T(m||p),h=N(m||p),f=s&&d||o,v=s&&!d||r,_=l,k=i;let y;if(f)y=g;else if(v)y=h;else if(_){var A;y=null!==(A=w(p))&&void 0!==A?A:p}else if(k){var D;y=null!==(D=B([p])[0])&&void 0!==D?D:p}const O=C();if(a&&O&&!e.defaultPrevented&&(R(null),e.preventDefault()),(c||u)&&O){const e=w(O),t=w(p),n=S(O);let o=S(p);n<o&&e===t&&(o-=1),M(O,e,t,o),P(O),R(null)}if(v||f||_||k)if(y)e.preventDefault(),P(y);else if(s&&p){let t;if(v){t=E;do{t=Yl.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=Yl.focus.tabbable.findNext(t))}else t=Yl.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),L())}},label:y,showTooltip:!1,className:"block-selection-button_select-button"},(0,s.createElement)(Um,{clientId:t,maximumLength:35})))))};function $m(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}const jm=function(e){let{children:t,focusOnMount:n,__experimentalInitialIndex:o,__experimentalOnIndexChange:r,...l}=e;const a=(0,s.useRef)(),c=function(e){const[t,n]=(0,s.useState)(!0),o=(0,s.useCallback)((()=>{const t=!Yl.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||V()("Using custom components as toolbar controls",{since:"5.6",alternative:"ToolbarItem, ToolbarButton or ToolbarDropdownMenu components",link:"https://developer.wordpress.org/block-editor/components/toolbar-button/#inside-blockcontrols"}),n(t)}),[]);return(0,s.useLayoutEffect)((()=>{const t=new window.MutationObserver(o);return t.observe(e.current,{childList:!0,subtree:!0}),()=>t.disconnect()}),[t]),t}(a);return function(e,t,n,o,r){const[l]=(0,s.useState)(t),[i]=(0,s.useState)(o),a=(0,s.useCallback)((()=>{!function(e){const[t]=Yl.focus.tabbable.find(e);t&&t.focus({preventScroll:!0})}(e.current)}),[]);(0,Uu.useShortcut)("core/block-editor/focus-toolbar",a),(0,s.useEffect)((()=>{l&&a()}),[n,l,a]),(0,s.useEffect)((()=>{let t=0;return i&&!l&&(t=window.requestAnimationFrame((()=>{const t=$m(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus({preventScroll:!0})}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=$m(e.current).findIndex((e=>0===e.tabIndex));r(n)}}),[i,l])}(a,n,c,o,r),c?(0,s.createElement)(p.Toolbar,i({label:l["aria-label"],ref:a},l),t):(0,s.createElement)(p.NavigableMenu,i({orientation:"horizontal",role:"toolbar",ref:a},l),t)},Km=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),qm=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Ym=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Zm=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"})),Qm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===t?(0,h.isRTL)()?"left":"right":"down":null;const Xm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?Km:qm:Ym:"down"===e?"horizontal"===t?(0,h.isRTL)()?qm:Km:Zm:null,Jm=(e,t)=>"up"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move right"):(0,h.__)("Move left"):(0,h.__)("Move up"):"down"===e?"horizontal"===t?(0,h.isRTL)()?(0,h.__)("Move left"):(0,h.__)("Move right"):(0,h.__)("Move down"):null,eg=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const g=(0,d.useInstanceId)(eg),f=(0,u.castArray)(n).length,{blockType:v,isDisabled:b,rootClientId:_,isFirst:k,isLast:y,firstIndex:E,orientation:C="vertical"}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockRootClientId:i,getBlockOrder:s,getBlock:a,getBlockListSettings:c}=e(to),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),g=t(p),h=t((0,u.last)(d)),f=s(m),v=a(p),b=0===g,_=h===f.length-1,{orientation:k}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:_,rootClientId:m,firstIndex:g,isFirst:b,isLast:_,orientation:l||k}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(to),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${g}`;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,i({ref:t,className:c()("block-editor-block-mover-button",`is-${o}-button`),icon:Xm(o,C),label:Jm(o,C),"aria-describedby":I},a,{onClick:b?null:e=>{B(n,_),a.onClick&&a.onClick(e)},disabled:b,__experimentalIsFocusable:!0})),(0,s.createElement)(p.VisuallyHidden,{id:I},function(e,t,n,o,r,l,i){const s=n+1;if(e>1)return function(e,t,n,o,r,l){const i=t+1;if(n&&o)return(0,h.__)("All blocks are selected, and cannot be moved");if(r>0&&!o){const t=Qm("down",l);if("down"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
33 |
(0,h.__)("Move %1$d blocks from position %2$d down by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
34 |
(0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
35 |
+
(0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r>0&&o){const e=Qm("down",l);if("down"===e)return(0,h.__)("Blocks cannot be moved down as they are already at the bottom");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}if(r<0&&!n){const t=Qm("up",l);if("up"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
36 |
(0,h.__)("Move %1$d blocks from position %2$d up by one place"),e,i);if("left"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
37 |
(0,h.__)("Move %1$d blocks from position %2$d left by one place"),e,i);if("right"===t)return(0,h.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
|
38 |
+
(0,h.__)("Move %1$d blocks from position %2$d right by one place"),e,i)}if(r<0&&n){const e=Qm("up",l);if("up"===e)return(0,h.__)("Blocks cannot be moved up as they are already at the top");if("left"===e)return(0,h.__)("Blocks cannot be moved left as they are already are at the leftmost position");if("right"===e)return(0,h.__)("Blocks cannot be moved right as they are already are at the rightmost position")}}(e,n,o,r,l,i);if(o&&r)return(0,h.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
|
39 |
+
(0,h.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=Qm("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
40 |
(0,h.__)("Move %1$s block from position %2$d down to position %3$d"),t,s,s+1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
41 |
(0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s+1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
42 |
+
(0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s+1)}if(l>0&&r){const e=Qm("down",i);if("down"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
43 |
(0,h.__)("Block %1$s is at the end of the content and can’t be moved down"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
44 |
(0,h.__)("Block %1$s is at the end of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
45 |
+
(0,h.__)("Block %1$s is at the end of the content and can’t be moved right"),t)}if(l<0&&!o){const e=Qm("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
46 |
(0,h.__)("Move %1$s block from position %2$d up to position %3$d"),t,s,s-1);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
47 |
(0,h.__)("Move %1$s block from position %2$d left to position %3$d"),t,s,s-1);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
|
48 |
+
(0,h.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=Qm("up",i);if("up"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
49 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
50 |
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,h.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
|
51 |
+
(0,h.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(f,v&&v.title,E,k,y,"up"===o?-1:1,C)))})),tg=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(eg,i({direction:"up",ref:t},e)))),ng=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(eg,i({direction:"down",ref:t},e)))),og=function(e){let{clientIds:t,hideDragHandle:n}=e;const{canMove:o,rootClientId:r,isFirst:l,isLast:a,orientation:d}=(0,m.useSelect)((e=>{var n;const{getBlockIndex:o,getBlockListSettings:r,canMoveBlocks:l,getBlockOrder:i,getBlockRootClientId:s}=e(to),a=(0,u.castArray)(t),c=(0,u.first)(a),d=s((0,u.first)(a)),p=o(c),m=o((0,u.last)(a)),g=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===g.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const g=(0,h.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(Gm,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:fp,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:g,tabIndex:"-1"},e)))),(0,s.createElement)("div",{className:"block-editor-block-mover__move-button-container"},(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(tg,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(ng,i({clientIds:t},e))))))},{clearTimeout:rg,setTimeout:lg}=window,ig=()=>{},sg=200;function ag(e){let{ref:t,isFocused:n,debounceTimeout:o=sg,onChange:r=ig}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},u=()=>{const e=a.current;e&&rg&&rg(e)};return(0,s.useEffect)((()=>()=>{c(!1),u()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),u(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),u(),a.current=lg((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function cg(e){let{ref:t,debounceTimeout:n=sg,onChange:o=ig}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=ag({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),u=(0,s.useRef)(!1),d=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{d()&&(l(!0),a())},o=()=>{d()||(l(!1),c())};return e&&!u.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),u.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,u,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function ug(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(to),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(to),{hasBlockSupport:i}=e(r.store),s=n(o()),a=s[s.length-1],c=t(a),u=(0,r.getBlockType)(c),d=l();return{firstParentClientId:a,shouldHide:!i(u,"__experimentalParentSelector",!0),hasReducedUI:d.hasReducedUI}}),[]),a=Vm(n),c=(0,s.useRef)(),{gestures:u}=cg({ref:c,onChange(e){e&&l||t(n,e)}});return o||void 0===n?null:(0,s.createElement)("div",i({className:"block-editor-block-parent-selector",key:n,ref:c},u),(0,s.createElement)(p.ToolbarButton,{className:"block-editor-block-parent-selector__button",onClick:()=>e(n),label:(0,h.sprintf)(
|
52 |
/* translators: %s: Name of the block's parent. */
|
53 |
+
(0,h.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(Tu,{icon:a.icon})}))}const dg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M20.2 8v11c0 .7-.6 1.2-1.2 1.2H6v1.5h13c1.5 0 2.7-1.2 2.7-2.8V8zM18 16.4V4.6c0-.9-.7-1.6-1.6-1.6H4.6C3.7 3 3 3.7 3 4.6v11.8c0 .9.7 1.6 1.6 1.6h11.8c.9 0 1.6-.7 1.6-1.6zm-13.5 0V4.6c0-.1.1-.1.1-.1h11.8c.1 0 .1.1.1.1v11.8c0 .1-.1.1-.1.1H4.6l-.1-.1z"}));function pg(e){let{blocks:t}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right",focusOnMount:!1},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,h.__)("Preview")),(0,s.createElement)(dp,{viewportWidth:500,blocks:t})))))}const mg=e=>{let{className:t,possibleBlockTransformations:n,onSelect:o,blocks:l}=e;const[i,a]=(0,s.useState)();return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Transform to"),className:t},i&&(0,s.createElement)(pg,{blocks:(0,r.switchToBlockType)(l,i)}),n.map((e=>{const{name:t,icon:n,title:l,isDisabled:i}=e;return(0,s.createElement)(p.MenuItem,{key:t,className:(0,r.getBlockMenuDefaultClassName)(t),onClick:e=>{e.preventDefault(),o(t)},disabled:i,onMouseLeave:()=>a(null),onMouseEnter:()=>a(t)},(0,s.createElement)(Tu,{icon:n,showColors:!0}),l)})))},gg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),hg=window.wp.tokenList;var fg=n.n(hg);function vg(e,t,n){const o=new(fg())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function bg(e){return(0,u.find)(e,"isDefault")}function _g(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(to),o=n(t);if(!o)return{};const l=(0,r.getBlockType)(o.name),{getBlockStyles:i}=e(r.store);return{block:o,blockType:l,styles:i(o.name),className:o.attributes.className||""}}),[t]),{updateBlockAttributes:c}=(0,m.useDispatch)(to),d=function(e){return e&&0!==e.length?bg(e)?e:[{name:"default",label:(0,h._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(fg())(t).values()){if(-1===n.indexOf("is-style-"))continue;const t=n.substring(9),o=(0,u.find)(e,{name:t});if(o)return o}return(0,u.find)(e,"isDefault")}(d,a),g=function(e,t){return(0,s.useMemo)((()=>{const n=null==t?void 0:t.example,o=null==t?void 0:t.name;return n&&o?(0,r.getBlockFromExample)(o,{attributes:n.attributes,innerBlocks:n.innerBlocks}):e?(0,r.cloneBlock)(e):void 0}),[null!=t&&t.example?null==e?void 0:e.name:e,t])}(l,i);return{onSelect:e=>{const o=vg(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:g,className:a}}const kg=()=>{};function yg(e){let{clientId:t,onSwitch:n=kg}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=_g({clientId:t,onSwitch:n});return r&&0!==r.length?(0,s.createElement)(s.Fragment,null,r.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.MenuItem,{key:e.name,icon:l.name===e.name?gg:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function Eg(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,h.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(yg,{clientId:o,onSwitch:n}))}const Cg=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:new Set;const{clientId:o,name:r,innerBlocks:l=[]}=e;if(!n.has(o)){if(r===t)return e;for(const e of l){const o=Cg(e,t,n);if(o)return o}}},Sg=(e,t)=>{const n=((e,t)=>{const n=(0,r.__experimentalGetBlockAttributesNamesByRole)(e,"content");return null!=n&&n.length?n.reduce(((e,n)=>(t[n]&&(e[n]=t[n]),e)),{}):t})(t.name,t.attributes);e.attributes={...e.attributes,...n}};function wg(e){let{patterns:t,onSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__parent"},(0,s.createElement)("div",{className:"block-editor-block-switcher__popover__preview__container"},(0,s.createElement)(p.Popover,{className:"block-editor-block-switcher__preview__popover",position:"bottom right"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview"},(0,s.createElement)("div",{className:"block-editor-block-switcher__preview-title"},(0,h.__)("Preview")),(0,s.createElement)(Bg,{patterns:t,onSelect:n})))))}function Bg(e){let{patterns:t,onSelect:n}=e;const o=(0,p.__unstableUseCompositeState)();return(0,s.createElement)(p.__unstableComposite,i({},o,{role:"listbox",className:"block-editor-block-switcher__preview-patterns-container","aria-label":(0,h.__)("Patterns list")}),t.map((e=>(0,s.createElement)(Ig,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function Ig(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(Ig,`${r}-list__item-description`);return(0,s.createElement)("div",{className:`${r}-list__list-item`,"aria-label":t.title,"aria-describedby":t.description?l:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}-list__item`,onClick:()=>n(t.transformedBlocks)}),(0,s.createElement)(dp,{blocks:t.transformedBlocks,viewportWidth:t.viewportWidth||500}),(0,s.createElement)("div",{className:`${r}-list__item-title`},t.title)),!!t.description&&(0,s.createElement)(p.VisuallyHidden,{id:l},t.description))}const xg=function(e){let{blocks:t,patterns:n,onSelect:o}=e;const[l,i]=(0,s.useState)(!1),a=((e,t)=>(0,s.useMemo)((()=>e.reduce(((e,n)=>{const o=((e,t)=>{const n=t.map((e=>(0,r.cloneBlock)(e))),o=new Set;for(const t of e){let e=!1;for(const r of n){const n=Cg(r,t.name,o);if(n){e=!0,o.add(n.clientId),Sg(n,t);break}}if(!e)return}return n})(t,n.blocks);return o&&e.push({...n,transformedBlocks:o}),e}),[])),[e,t]))(n,t);return a.length?(0,s.createElement)(p.MenuGroup,{className:"block-editor-block-switcher__pattern__transforms__menugroup"},l&&(0,s.createElement)(wg,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:Km},(0,h.__)("Patterns"))):null},Tg=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(to),l=Vm(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,patterns:g}=(0,m.useSelect)((e=>{const{getBlockRootClientId:o,getBlockTransformItems:i,__experimentalGetPatternTransformItems:s}=e(to),{getBlockStyles:a,getBlockType:c}=e(r.store),{canRemoveBlocks:d}=e(to),p=o((0,u.castArray)(t)[0]),[{name:m}]=n,g=1===n.length,h=g&&a(m);let f;var v;g?f=null==l?void 0:l.icon:f=1===new Set(n.map((e=>{let{name:t}=e;return t}))).size?null===(v=c(m))||void 0===v?void 0:v.icon:dg;return{possibleBlockTransformations:i(n,p),canRemove:d(t,p),hasBlockStyles:!(null==h||!h.length),icon:f,patterns:s(n,p)}}),[t,n,null==l?void 0:l.icon]),f=Hm({clientId:Array.isArray(t)?t[0]:t,maximumLength:35}),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),_=!!i.length&&a&&!b,k=!(null==g||!g.length)&&a;if(!c&&!_)return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{disabled:!0,className:"block-editor-block-switcher__no-switcher-icon",title:f,icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Tu,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f))}));const y=f,E=1===n.length?(0,h.sprintf)(
|
54 |
/* translators: %s: block title. */
|
55 |
+
(0,h.__)("%s: Change block type or style"),f):(0,h.sprintf)(
|
56 |
/* translators: %d: number of blocks. */
|
57 |
+
(0,h._n)("Change type of %d block","Change type of %d blocks",n.length),n.length),C=c||_||k;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(p.DropdownMenu,{className:"block-editor-block-switcher",label:y,popoverProps:{position:"bottom right",isAlternate:!0,className:"block-editor-block-switcher__popover"},icon:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Tu,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},f)),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},k&&(0,s.createElement)(xg,{blocks:n,patterns:g,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),_&&(0,s.createElement)(mg,{className:"block-editor-block-switcher__transforms__menugroup",possibleBlockTransformations:i,blocks:n,onSelect:e=>{(e=>{o(t,(0,r.switchToBlockType)(n,e))})(e),l()}}),c&&(0,s.createElement)(Eg,{hoveredBlock:n[0],onSwitch:l}))})))))},Ng=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(to).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(Tg,{clientIds:t,blocks:n})},{Fill:Pg,Slot:Lg}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");Pg.Slot=Lg;const Rg=Pg,Mg=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),Ag=window.wp.blob;function Dg(e,t){if(t&&1===(null==e?void 0:e.length)&&0===e[0].type.indexOf("image/")){var n;const e=/<\s*img\b/gi;if(1!==(null===(n=t.match(e))||void 0===n?void 0:n.length))return!0;const o=/<\s*img\b[^>]*\bsrc="file:\/\//i;if(t.match(o))return!0}return!1}function Og(){const{getBlockName:e}=(0,m.useSelect)(to),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Tp.store);return(0,s.useCallback)(((o,r)=>{let l="";if(1===r.length){var i;const n=r[0],s=null===(i=t(e(n)))||void 0===i?void 0:i.title;l="copy"===o?(0,h.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
|
58 |
(0,h.__)('Copied "%s" to clipboard.'),s):(0,h.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
|
59 |
(0,h.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,h.sprintf)(// Translators: %d: Number of blocks being copied.
|
60 |
(0,h._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,h.sprintf)(// Translators: %d: Number of blocks being cut.
|
61 |
+
(0,h._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Fg(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(to),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:g,__unstableExpandSelection:h}=(0,m.useDispatch)(to),f=Og();return(0,d.useRefEffect)((d=>{function m(m){const v=t();if(0===v.length)return;if(!n()){const{target:e}=m,{ownerDocument:t}=e;if("copy"===m.type||"cut"===m.type?(0,Yl.documentHasUncollapsedSelection)(t):(0,Yl.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const _=s(),k=i()||l(),y=!k&&!_;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)h();else{let t;if(f(m.type,v),k)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=m.clipboardData.getData("__unstableWrapperBlockName");n&&(t=(0,r.createBlock)(n,JSON.parse(m.clipboardData.getData("__unstableWrapperBlockAttributes")),t));const o=(0,r.serialize)(t);m.clipboardData.setData("text/plain",(E=(E=o).replace(/<br>/g,"\n"),(0,Yl.__unstableStripHTML)(E).trim().replace(/\n\n+/g,"\n\n"))),m.clipboardData.setData("text/html",o)}var E;if("cut"===m.type)k&&!y?u(v):g();else if("paste"===m.type){if(b)return;const{__experimentalCanUserUseUnfilteredHTML:e}=o(),{plainText:t,html:n}=function(e){let{clipboardData:t}=e,n="",o="";try{n=t.getData("text/plain"),o=t.getData("text/html")}catch(e){try{o=t.getData("Text")}catch(e){return}}const r=(0,Yl.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Dg(r,o)&&(o=r.map((e=>`<img src="${(0,Ag.createBlobURL)(e)}">`)).join(""),n=""),{html:o,plainText:n}}(m),l=(0,r.pasteHandler)({HTML:n,plainText:t,mode:"BLOCKS",canUserUseUnfilteredHTML:e});p(v,l,l.length-1,-1)}}return d.ownerDocument.addEventListener("copy",m),d.ownerDocument.addEventListener("cut",m),d.ownerDocument.addEventListener("paste",m),()=>{d.ownerDocument.removeEventListener("copy",m),d.ownerDocument.removeEventListener("cut",m),d.ownerDocument.removeEventListener("paste",m)}}),[])}const zg=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Fg()},t)};function Vg(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(to),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),g=s(t),h=i(t[0]),f=(0,u.every)(g,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,h))),v=l(d(),h),b=a(t,h),_=c(t,h),{removeBlocks:k,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(to),T=Og();return n({canDuplicate:f,canInsertDefaultBlock:v,canMove:b,canRemove:_,rootClientId:h,blocks:g,onDuplicate:()=>E(t,o),onRemove:()=>k(t,o),onInsertBefore(){S((0,u.first)((0,u.castArray)(t)))},onInsertAfter(){C((0,u.last)((0,u.castArray)(t)))},onMoveTo(){I(!0),x(t[0]),B(t[0])},onGroup(){if(!g.length)return;const e=p(),n=(0,r.switchToBlockType)(g,e);n&&y(t,n)},onUngroup(){if(!g.length)return;const e=g[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=g.map((e=>{let{clientId:t}=e;return t}));1===g.length&&w(e[0]),T("copy",e)}})}const Hg=()=>{},Ug=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(to),s=o(n),a=i().codeEditingEnabled;return{mode:l(n),blockType:s?(0,r.getBlockType)(s.name):null,isCodeEditingEnabled:a}})),(0,m.withDispatch)(((e,t)=>{let{onToggle:n=Hg,clientId:o}=t;return{onToggleMode(){e(to).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!t||!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,h.__)("Edit as HTML"):(0,h.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),Gg=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(to).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(to).replaceBlocks(n.clientId,(0,r.rawHandler)({HTML:(0,r.getBlockContent)(n)}))}})))((function(e){let{shouldRender:t,onClick:n,small:o}=e;if(!t)return null;const r=(0,h.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)})),{Fill:Wg,Slot:$g}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Wg.Slot=$g;const jg=Wg;function Kg(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(to);return n||o?(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=(0,r.switchToBlockType)(l,i);e&&c(t,e)})(),a()}},(0,h._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,h._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function qg(){const{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}=(0,m.useSelect)((e=>{var t;const{getBlockRootClientId:n,getBlocksByClientId:o,canInsertBlockType:l,getSelectedBlockClientIds:i}=e(to),{getGroupingBlockName:s}=e(r.store),a=i(),c=s(),u=l(c,null!=a&&a.length?n(a[0]):void 0),d=o(a),p=1===d.length&&(null===(t=d[0])||void 0===t?void 0:t.name)===c;return{clientIds:a,isGroupable:u&&d.length,isUngroupable:p&&!!d[0].innerBlocks.length,blocksSelection:d,groupingBlockName:c}}),[]);return{clientIds:e,isGroupable:t,isUngroupable:n,blocksSelection:o,groupingBlockName:l}}function Yg(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(to),a=s(e),c=n(e),u=o(e,a),d=r(e,a);return{canEdit:c,canMove:u,canRemove:d,canLock:l(i(e)),isLocked:!c||!u||!d}}),[e])}const Zg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8h1.5c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1z"})),Qg=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M17 10h-1.2V7c0-2.1-1.7-3.8-3.8-3.8-2.1 0-3.8 1.7-3.8 3.8v3H7c-.6 0-1 .4-1 1v8c0 .6.4 1 1 1h10c.6 0 1-.4 1-1v-8c0-.6-.4-1-1-1zm-2.8 0H9.8V7c0-1.2 1-2.2 2.2-2.2s2.2 1 2.2 2.2v3z"}));function Xg(e){return e.remove&&e.move?"all":!(!e.remove||e.move)&&"insert"}function Jg(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=Yg(t),{isReusable:u,templateLock:g,hasTemplateLock:f}=(0,m.useSelect)((e=>{var n,o;const{getBlockName:l,getBlockAttributes:i}=e(to),s=l(t),a=(0,r.getBlockType)(s);return{isReusable:(0,r.isReusableBlock)(a),templateLock:null===(n=i(t))||void 0===n?void 0:n.templateLock,hasTemplateLock:!(null==a||null===(o=a.attributes)||void 0===o||!o.templateLock)}}),[t]),[v,b]=(0,s.useState)(!!g),{updateBlockAttributes:_}=(0,m.useDispatch)(to),k=Vm(t),y=(0,d.useInstanceId)(Jg,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const E=Object.values(o).every(Boolean),C=Object.values(o).some(Boolean)&&!E;return(0,s.createElement)(p.Modal,{title:(0,h.sprintf)(
|
62 |
/* translators: %s: Name of the block. */
|
63 |
+
(0,h.__)("Lock %s"),k.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,h.__)("Close"),onRequestClose:n},(0,s.createElement)("p",null,(0,h.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),_([t],{lock:o,templateLock:v?Xg(o):void 0}),n()}},(0,s.createElement)("div",{role:"group","aria-labelledby":y,className:"block-editor-block-lock-modal__options"},(0,s.createElement)(p.CheckboxControl,{className:"block-editor-block-lock-modal__options-title",label:(0,s.createElement)("span",{id:y},(0,h.__)("Lock all")),checked:E,indeterminate:C,onChange:e=>l({move:e,remove:e,...u?{edit:e}:{}})}),(0,s.createElement)("ul",{className:"block-editor-block-lock-modal__checklist"},u&&(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?Qg:Zg})),checked:!!o.edit,onChange:e=>l((t=>({...t,edit:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?Qg:Zg})),checked:o.move,onChange:e=>l((t=>({...t,move:e})))})),(0,s.createElement)("li",{className:"block-editor-block-lock-modal__checklist-item"},(0,s.createElement)(p.CheckboxControl,{label:(0,s.createElement)(s.Fragment,null,(0,h.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?Qg:Zg})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))}))),f&&(0,s.createElement)(p.ToggleControl,{className:"block-editor-block-lock-modal__template-lock",label:(0,h.__)("Apply to all blocks inside"),checked:v,disabled:o.move&&!o.remove,onChange:()=>b(!v)})),(0,s.createElement)(p.Flex,{className:"block-editor-block-lock-modal__actions",justify:"flex-end",expanded:!1},(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"tertiary",onClick:n},(0,h.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,h.__)("Apply"))))))}function eh(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Yg(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,h.__)("Unlock"):(0,h.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?Zg:Qg,onClick:l},i),r&&(0,s.createElement)(Jg,{clientId:t,onClose:l}))}const{Fill:th,Slot:nh}=(0,p.createSlotFill)("BlockSettingsMenuControls");function oh(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document},(0,s.createElement)(th,t))}oh.Slot=e=>{let{fillProps:t,clientIds:n=null}=e;const{selectedBlocks:o,selectedClientIds:r,canRemove:l}=(0,m.useSelect)((e=>{const{getBlocksByClientId:t,getSelectedBlockClientIds:o,canRemoveBlocks:r}=e(to),l=null!==n?n:o();return{selectedBlocks:(0,u.map)(t(l).filter(Boolean),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),{canLock:a}=Yg(r[0]),c=1===r.length&&a,d=qg(),{isGroupable:g,isUngroupable:h}=d,f=(g||h)&&l;return(0,s.createElement)(nh,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!f&&!c?null:(0,s.createElement)(p.MenuGroup,null,c&&(0,s.createElement)(eh,{clientId:r[0]}),e,f&&(0,s.createElement)(Kg,i({},d,{onClose:null==t?void 0:t.onClose})))))};const rh=oh,lh=()=>{},ih={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function sh(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n),l=t.length>1?(0,h.__)("Copy blocks"):(0,h.__)("Copy block");return(0,s.createElement)(p.MenuItem,{ref:o},l)}const ah=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:g,hasReducedUI:f,onlyBlock:v,parentBlockType:b,previousBlockClientId:_,nextBlockClientId:k,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(to),c=o(d),u=c[c.length-1],p=n(u);return{firstParentClientId:u,hasReducedUI:a().hasReducedUI,onlyBlock:1===t(),parentBlockType:(0,r.getBlockType)(p),previousBlockClientId:l(d),nextBlockClientId:i(d),selectedBlockClientIds:s()}}),[d]),E=(0,m.useSelect)((e=>{const{getShortcutRepresentation:t}=e(Uu.store);return{duplicate:t("core/block-editor/duplicate"),remove:t("core/block-editor/remove"),insertAfter:t("core/block-editor/insert-after"),insertBefore:t("core/block-editor/insert-before")}}),[]),{selectBlock:C,toggleBlockHighlight:S}=(0,m.useDispatch)(to),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:lh,[n]),B=Hm({clientId:d,maximumLength:25}),I=(0,s.useCallback)(n?()=>{const e=_||k;e&&y.includes(d)&&!y.includes(e)&&n(e)}:lh,[n,_,k,y]),x=(0,h.sprintf)(
|
64 |
/* translators: %s: block name */
|
65 |
+
(0,h.__)("Remove %s"),B),T=1===c?x:(0,h.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=cg({ref:N,onChange(e){e&&f||S(g,e)}});return(0,s.createElement)(Vg,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:f,onInsertAfter:_,onInsertBefore:k,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:Mg,label:(0,h.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:ih,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(jg.Slot,{fillProps:{onClose:l}}),void 0!==g&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(Tu,{icon:b.icon}),onClick:()=>C(g)}),(0,h.sprintf)(
|
66 |
/* translators: %s: Name of the block's parent. */
|
67 |
+
(0,h.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(Gg,{clientId:d}),(0,s.createElement)(sh,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,f,w),shortcut:E.duplicate},(0,h.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertBefore},(0,h.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertAfter},(0,h.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,h.__)("Move to")),1===c&&(0,s.createElement)(Ug,{clientId:d,onToggle:l})),(0,s.createElement)(rh.Slot,{fillProps:{onClose:l},clientIds:t}),"function"==typeof o?o({onClose:l}):s.Children.map((e=>(0,s.cloneElement)(e,{onClose:l}))),m&&(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,y,I),shortcut:E.remove},T)))}))}))},ch=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(ah,i({clientIds:t,toggleProps:e},n)))))};function uh(e){let{clientId:t}=e;const n=Vm(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Yg(t),[a,c]=(0,s.useReducer)((e=>!e),!1);return i?o&&r&&l?null:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-lock-toolbar"},(0,s.createElement)(p.ToolbarButton,{icon:Qg,label:(0,h.sprintf)(
|
68 |
/* translators: %s: block name */
|
69 |
+
(0,h.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Jg,{clientId:t,onClose:c})):null}const dh=(0,s.createElement)(D.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(D.Path,{d:"M18 4h-7c-1.1 0-2 .9-2 2v3H6c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2v-3h3c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-4.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-7c0-.3.2-.5.5-.5h3V13c0 1.1.9 2 2 2h2.5v3zm0-4.5H11c-.3 0-.5-.2-.5-.5v-2.5H13c.3 0 .5.2.5.5v2.5zm5-.5c0 .3-.2.5-.5.5h-3V11c0-1.1-.9-2-2-2h-2.5V6c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v7z"})),ph=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M9.2 6.5H4V8h5.2c.3 0 .5.2.5.5v7c0 .3-.2.5-.5.5H4v1.5h5.2c1.1 0 2-.9 2-2v-7c0-1.1-.8-2-2-2zM14.8 8H20V6.5h-5.2c-1.1 0-2 .9-2 2v7c0 1.1.9 2 2 2H20V16h-5.2c-.3 0-.5-.2-.5-.5v-7c-.1-.3.2-.5.5-.5z"})),mh=(0,s.createElement)(D.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(D.Path,{d:"M16 4v5.2c0 .3-.2.5-.5.5h-7c-.3.1-.5-.2-.5-.5V4H6.5v5.2c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V4H16zm-.5 8.8h-7c-1.1 0-2 .9-2 2V20H8v-5.2c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5V20h1.5v-5.2c0-1.2-.9-2-2-2z"})),gh={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}},hh=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=qg(),{replaceBlocks:l}=(0,m.useDispatch)(to),{canRemove:i,variations:a}=(0,m.useSelect)((e=>{const{canRemoveBlocks:o}=e(to),{getBlockVariations:l}=e(r.store);return{canRemove:o(t),variations:l(n,"transform")}}),[t,n]),c=function(){let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"group";const i=(0,r.switchToBlockType)(e,n);i&&i.length>0&&(i[0].attributes.layout=gh[o],l(t,i))};if(!o||!i)return null;const u=!!a.find((e=>{let{name:t}=e;return"group-row"===t})),d=!!a.find((e=>{let{name:t}=e;return"group-stack"===t}));return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:dh,label:(0,h._x)("Group","verb"),onClick:c}),u&&(0,s.createElement)(p.ToolbarButton,{icon:ph,label:(0,h._x)("Row","single horizontal line"),onClick:()=>c("row")}),d&&(0,s.createElement)(p.ToolbarButton,{icon:mh,label:(0,h._x)("Stack","verb"),onClick:()=>c("stack")}))};function fh(e){let{clientIds:t}=e;const n=1===t.length?t[0]:void 0,o=(0,m.useSelect)((e=>!!n&&"html"===e(to).getBlockMode(n)),[n]),{toggleBlockMode:r}=(0,m.useDispatch)(to);return o?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{onClick:()=>{r(n)}},(0,h.__)("Edit visually"))):null}const vh=(0,s.createContext)(""),bh=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:g,isVisual:h}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(to),a=o(),c=a[0],u=i(c),d=s();return{blockClientIds:a,blockClientId:c,blockType:c&&(0,r.getBlockType)(t(c)),hasFixedToolbar:d.hasFixedToolbar,hasReducedUI:d.hasReducedUI,rootClientId:u,isValid:a.every((e=>l(e))),isVisual:a.every((e=>"visual"===n(e)))}}),[]),{toggleBlockHighlight:f}=(0,m.useDispatch)(to),v=(0,s.useRef)(),{showMovers:b,gestures:_}=cg({ref:v,onChange(e){e&&u||f(o,e)}}),k=(0,d.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=k||b;if(0===n.length)return null;const E=g&&h,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!k&&(0,s.createElement)(ug,{clientIds:n}),(0,s.createElement)("div",i({ref:v},_),(E||C)&&(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(Ng,{clientIds:n}),!C&&(0,s.createElement)(uh,{clientId:n[0]}),(0,s.createElement)(og,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(hh,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(po.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(po.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(vh.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(Rg.Slot,null))),(0,s.createElement)(fh,{clientIds:n}),(0,s.createElement)(ch,{clientIds:n}))},_h=function(e){let{focusOnMount:t,isFixed:n,...o}=e;const{blockType:l,hasParents:a,showParentSelector:u}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientIds:o}=e(to),{getBlockType:l}=e(r.store),i=o(),s=i[0],a=n(s),c=l(t(a[a.length-1]));return{blockType:s&&l(t(s)),hasParents:a.length,showParentSelector:c&&(0,r.hasBlockSupport)(c,"__experimentalParentSelector",!0)&&i.length<=1}}),[]);if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const d=c()("block-editor-block-contextual-toolbar",{"has-parent":a&&u,"is-fixed":n});return(0,s.createElement)(jm,i({focusOnMount:t,className:d
|
70 |
+
/* translators: accessibility text for the block toolbar */,"aria-label":(0,h.__)("Block tools")},o),(0,s.createElement)(bh,{hideDragHandle:n}))},kh={__unstableForcePosition:!0,__unstableShift:!0},yh={__unstableForcePosition:!1,__unstableShift:!1};function Eh(e,t,n){if(!e||!t)return kh;const o=t.getBoundingClientRect(),r=e.getBoundingClientRect();return o.top-r.top>n?kh:yh}function Ch(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(to);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function Sh(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:a}=e;const{isNavigationMode:u,isMultiSelecting:p,isTyping:g,hasFixedToolbar:h,lastClientId:f}=(0,m.useSelect)(Ch,[]),v=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(to);if(!n())return!1;const l=o();return r(l.rootClientId)[l.index]===t}),[t]),b=(0,d.useViewportMatch)("medium"),_=(0,s.useRef)(!1),{stopTyping:k}=(0,m.useDispatch)(to),y=u,E=!u&&!h&&b&&!p&&!(!g&&!u&&o)&&!g,C=!(u||E||h||o);(0,Uu.useShortcut)("core/block-editor/focus-toolbar",(()=>{_.current=!0,k(!0)}),{isDisabled:!C}),(0,s.useEffect)((()=>{_.current=!1}));const S=(0,s.useRef)(),w=function(e){let{contentElement:t,clientId:n}=e;const o=Bo(n),[r,l]=(0,s.useState)(0),[i,a]=(0,s.useState)((()=>Eh(t,o,r))),c=(0,m.useSelect)((e=>e(to).getBlockIndex(n)),[n]),u=(0,d.useRefEffect)((e=>{l(e.offsetHeight)}),[]),p=(0,s.useCallback)((()=>a(Eh(t,o,r))),[t,o,r]);return(0,s.useLayoutEffect)(p,[c,p]),(0,s.useLayoutEffect)((()=>{var e,n,r;if(!t||!o)return;const l=null==t||null===(e=t.ownerDocument)||void 0===e?void 0:e.defaultView;let i;null==l||null===(n=l.addEventHandler)||void 0===n||n.call(l,"resize",p);const s=null==o||null===(r=o.ownerDocument)||void 0===r?void 0:r.defaultView;return s.ResizeObserver&&(i=new s.ResizeObserver(p),i.observe(o)),()=>{var e;null==l||null===(e=l.removeEventHandler)||void 0===e||e.call(l,"resize",p),i&&i.disconnect()}}),[p,t,o]),{...i,ref:u}}({contentElement:null==a?void 0:a.current,clientId:t});return y||E?(0,s.createElement)(or,i({clientId:r||t,bottomClientId:f,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":v}),__unstablePopoverSlot:l,__unstableContentRef:a},w),E&&(0,s.createElement)(_h,{focusOnMount:_.current,__experimentalInitialIndex:S.current,__experimentalOnIndexChange:e=>{S.current=e},key:t}),y&&(0,s.createElement)(Wm,{clientId:t,rootClientId:n})):null}function wh(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(to),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),g=(0,u.find)(p,(e=>{var t;return null===(t=m[e])||void 0===t?void 0:t.__experimentalCaptureToolbars}));return{clientId:a,rootClientId:o(a),name:c,isEmptyDefaultBlock:c&&(0,r.isUnmodifiedDefaultBlock)({name:c,attributes:d}),capturingClientId:g}}function Bh(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(wh,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(Sh,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function Ih(e){let{children:t}=e;const n=(0,s.useContext)(Mm),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(V()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Dm,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(Bh,{__unstablePopoverSlot:"block-toolbar"}),t))}const xh=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=lo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),Th=xh((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Pm,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),Nh=(0,d.compose)([xh,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(to),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(xm,{rootClientId:t})})),Ph=new WeakMap;function Lh(e,t){const n=(0,m.useSelect)((e=>e(to).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(to),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(to),d=function(e,t,n,o,l,i,s){return a=>{const{srcRootClientId:c,srcClientIds:u,type:d,blocks:p}=function(e){let t={srcRootClientId:null,srcClientIds:null,srcIndex:null,type:null,blocks:null};if(!e.dataTransfer)return t;try{t=Object.assign(t,JSON.parse(e.dataTransfer.getData("wp-blocks")))}catch(e){return t}return t}(a);if("inserter"===d){s();const n=p.map((e=>(0,r.cloneBlock)(e)));i(n,t,e,!0,null)}if("block"===d){const r=n(u[0]);if(c===e&&r===t)return;if(u.includes(e)||o(u).some((t=>t===e)))return;const i=c===e,s=u.length;l(u,c,e,i&&r<t?t-s:t)}}}(e,t,l,i,a,s,u),p=function(e,t,n,o,l,i){return s=>{if(!n)return;const a=(0,r.findTransform)((0,r.getBlockTransforms)("from"),(t=>"files"===t.type&&l(t.blockName,e)&&t.isMatch(s)));if(a){const n=a.transform(s,o);i(n,t,e)}}}(e,t,n,c,o,s),g=function(e,t,n){return o=>{const l=(0,r.pasteHandler)({HTML:o,mode:"BLOCKS"});l.length&&n(l,t,e)}}(e,t,s);return e=>{const t=(0,Yl.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?g(n):t.length?p(t):d(e)}}function Rh(e,t,n){const o="top"===n||"bottom"===n,{x:r,y:l}=e,i=o?r:l,s=o?l:r,a=o?t.left:t.top,c=o?t.right:t.bottom,u=t[n];let d;return d=i>=a&&i<=c?i:i<c?a:c,Math.sqrt((i-d)**2+(s-u)**2)}function Mh(e,t){let n,o,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["top","bottom","left","right"];return r.forEach((r=>{const l=Rh(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function Ah(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,h.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=Mh(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function Dh(){let{rootClientId:e=""}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const[t,n]=(0,s.useState)(null),o=(0,m.useSelect)((t=>{const{getTemplateLock:n}=t(to);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(to),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(to),a=Lh(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=Ah(Array.from(o.children).filter((e=>e.classList.contains("wp-block"))),{x:t.clientX,y:t.clientY},null===(i=r(e))||void 0===i?void 0:i.orientation);n(void 0===s?0:s),null!==s&&l(e,s)}),[]),200);return(0,d.__experimentalUseDropZone)({isDisabled:o,onDrop:a,onDragOver(e){c(e,e.currentTarget)},onDragLeave(){c.cancel(),i(),n(null)},onDragEnd(){c.cancel(),i(),n(null)}})}function Oh(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:g,renderAppender:h,orientation:f,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(to),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(to).getBlockRootClientId(e);return{blockListSettings:t(to).getBlockListSettings(e),parentLock:t(to).getTemplateLock(n)}}),[e]),p=(0,s.useMemo)((()=>t),t);(0,s.useLayoutEffect)((()=>{const t={allowedBlocks:p,templateLock:void 0===r?d:r};if(void 0!==l&&(t.__experimentalCaptureToolbars=l),void 0!==i)t.orientation=i;else{const e=yl(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),tr()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,f,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(to),{replaceInnerBlocks:i}=(0,m.useDispatch)(to),a=(0,m.useSelect)((t=>t(to).getBlocks(e)),[e]),c=(0,s.useRef)(null);(0,s.useLayoutEffect)((()=>{if((0===a.length||"all"===n)&&!(0,u.isEqual)(t,c.current)){c.current=t;const n=(0,r.synchronizeBlocksWithTemplate)(a,t);(0,u.isEqual)(n,a)||i(e,n,0===a.length&&o&&0!==n.length,l())}}),[a,t,n,e])}(t,i,a,d);const _=(0,m.useSelect)((e=>{const n=e(to).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){Ph.has(t)||Ph.set(t,new WeakMap);const n=Ph.get(t);if(!n.has(e)){const o=(0,u.mapValues)(t.providesContext,(t=>e[t]));n.set(e,o)}return n.get(e)}(n.attributes,o)}),[t]);return(0,s.createElement)(Ql,{value:_},(0,s.createElement)(Kh,{rootClientId:t,renderAppender:h,__experimentalAppenderTagName:g,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Fh(e){return Ru(e),(0,s.createElement)(Oh,e)}const zh=(0,s.forwardRef)(((e,t)=>{const n=Vh({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Vh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=lo(),o=(0,d.useViewportMatch)("medium","<"),{__experimentalCaptureToolbars:l,hasOverlay:a}=(0,m.useSelect)((e=>{if(!n)return{};const{getBlockName:t,isBlockSelected:l,hasSelectedInnerBlock:i,isNavigationMode:s}=e(to),a=t(n),c=s()||o;return{__experimentalCaptureToolbars:e(r.store).hasBlockSupport(a,"__experimentalExposeControlsToChildren",!1),hasOverlay:"core/template"!==a&&!l(n)&&!i(n,!0)&&c}}),[n,o]),u=(0,d.useMergeRefs)([e.ref,Dh({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},g=p.value&&p.onChange?Fh:Oh;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(g,i({},p,{clientId:n})):(0,s.createElement)(Kh,t)}}Vh.save=r.__unstableGetInnerBlocksProps,zh.DefaultBlockAppender=Nh,zh.ButtonBlockAppender=Th,zh.Content=()=>Vh.save().children;const Hh=zh,Uh=(0,s.createContext)(),Gh=(0,s.createContext)();function Wh(e){let{className:t,...n}=e;const[o,r]=(0,s.useState)(),l=(0,d.useViewportMatch)("medium"),{isOutlineMode:i,isFocusMode:a,isNavigationMode:u}=(0,m.useSelect)((e=>{const{getSettings:t,isNavigationMode:n}=e(to),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),{setBlockVisibility:p}=(0,m.useDispatch)(to),g=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{const t={};for(const n of e)t[n.target.getAttribute("data-block")]=n.isIntersecting;p(t)}))}),[]),h=Vh({ref:(0,d.useMergeRefs)([Du(),Om(),r]),className:c()("is-root-container",t,{"is-outline-mode":i,"is-focus-mode":a&&l,"is-navigate-mode":u})},n);return(0,s.createElement)(Uh.Provider,{value:o},(0,s.createElement)(Gh.Provider,{value:g},(0,s.createElement)("div",h)))}function $h(e){return function(){const e=(0,m.useSelect)((e=>e(to).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(to).__experimentalGetParsedPattern(e[n].name),t=Fm(o))};return t=Fm(o),()=>zm(t)}),[e])}(),(0,s.createElement)(Ih,null,(0,s.createElement)(ro,{value:no},(0,s.createElement)(Wh,e)))}function jh(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=El}=e;const{order:i,selectedBlocks:a,visibleBlocks:c}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o,__unstableGetVisibleBlocks:r}=e(to);return{order:t(n),selectedBlocks:o(),visibleBlocks:r()}}),[n]);return(0,s.createElement)(Sl,{value:l},i.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!c.has(e)&&!a.includes(e)},(0,s.createElement)(Cu,{rootClientId:n,clientId:e})))),i.length<1&&t,(0,s.createElement)(Lm,{tagName:r,rootClientId:n,renderAppender:o}))}function Kh(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(jh,e))}function qh(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Yh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{flat:t,...n}=e;return t||qh(Object.values(n).filter(Boolean))||"px"}function Zh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if("string"==typeof e)return e;const t=Object.values(e).map((e=>(0,p.__experimentalParseQuantityAndUnitFromRawValue)(e))),n=t.map((e=>{var t;return null!==(t=e[0])&&void 0!==t?t:""})),o=t.map((e=>e[1])),r=n.every((e=>e===n[0]))?n[0]:"",l=qh(o),i=0===r||r?`${r}${l}`:void 0;return i}function Qh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Zh(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Xh(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Jh(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e,a=Zh(r);void 0===a&&(a=Yh(n));const c=Xh(r)&&Qh(r),u=c?(0,h.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},l,{"aria-label":(0,h.__)("Border radius"),disableUnits:c,isOnly:!0,value:a,onChange:e=>{const n=!isNaN(parseFloat(e));t(n?e:void 0)},onUnitChange:e=>{o({topLeft:e,topRight:e,bottomLeft:e,bottomRight:e})},placeholder:u}))}$h.__unstableElementContext=Uh;const ef={topLeft:(0,h.__)("Top left"),topRight:(0,h.__)("Top right"),bottomLeft:(0,h.__)("Bottom left"),bottomRight:(0,h.__)("Bottom right")};function tf(e){let{onChange:t,selectedUnits:n,setSelectedUnits:o,values:r,...l}=e;const a=e=>n=>{if(!t)return;const o=isNaN(parseFloat(n))?void 0:n;t({...c,[e]:o})},c="string"!=typeof r?r:{topLeft:r,topRight:r,bottomLeft:r,bottomRight:r};return(0,s.createElement)("div",{className:"components-border-radius-control__input-controls-wrapper"},Object.entries(ef).map((e=>{let[t,r]=e;const[u,d]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(c[t]),m=c[t]?d:n[t]||n.flat;return(0,s.createElement)(p.Tooltip,{text:r,position:"top",key:t},(0,s.createElement)("div",{className:"components-border-radius-control__tooltip-wrapper"},(0,s.createElement)(p.__experimentalUnitControl,i({},l,{"aria-label":r,value:[u,m].join(""),onChange:a(t),onUnitChange:(g=t,e=>{const t={...n};t[g]=e,o(t)})}))));var g})))}function nf(e){let{isLinked:t,...n}=e;const o=t?(0,h.__)("Unlink Radii"):(0,h.__)("Link Radii");return(0,s.createElement)(p.Tooltip,{text:o},(0,s.createElement)(p.Button,i({},n,{className:"component-border-radius-control__linked-button",isPrimary:t,isSecondary:!t,isSmall:!0,icon:t?ur:dr,iconSize:16,"aria-label":o})))}const of={topLeft:void 0,topRight:void 0,bottomLeft:void 0,bottomRight:void 0},rf={px:100,em:20,rem:20};function lf(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Xh(n)||!Qh(n)),[l,i]=(0,s.useState)({flat:"string"==typeof n?(0,p.__experimentalParseQuantityAndUnitFromRawValue)(n)[1]:void 0,topLeft:(0,p.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topLeft)[1],topRight:(0,p.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.topRight)[1],bottomLeft:(0,p.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomLeft)[1],bottomRight:(0,p.__experimentalParseQuantityAndUnitFromRawValue)(null==n?void 0:n.bottomRight)[1]}),a=(0,p.__experimentalUseCustomUnits)({availableUnits:Vo("spacing.units")||["px","em","rem"]}),c=Yh(l),u=a&&a.find((e=>e.value===c)),d=(null==u?void 0:u.step)||1,[m]=(0,p.__experimentalParseQuantityAndUnitFromRawValue)(Zh(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)(p.BaseControl.VisualLabel,{as:"legend"},(0,h.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Jh,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,units:a}),(0,s.createElement)(p.RangeControl,{label:(0,h.__)("Border radius"),hideLabelFromVision:!0,className:"components-border-radius-control__range-control",value:null!=m?m:"",min:0,max:rf[c],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${c}`:void 0)},step:d})):(0,s.createElement)(tf,{min:0,onChange:t,selectedUnits:l,setSelectedUnits:i,values:n||of,units:a}),(0,s.createElement)(nf,{onClick:()=>r(!o),isLinked:o})))}function sf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(lf,{values:null==n||null===(t=n.border)||void 0===t?void 0:t.radius,onChange:e=>{const t=Wo({...n,border:{...null==n?void 0:n.border,radius:e}});o({style:t})}})}xd([Td,Ld]);const af=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},cf=(e,t)=>(0,u.find)(e,{color:t});function uf(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function df(){return{disableCustomColors:!Vo("color.custom"),disableCustomGradients:!Vo("color.customGradient")}}function pf(){const e=df(),t=Vo("color.palette.custom"),n=Vo("color.palette.theme"),o=Vo("color.palette.default"),r=Vo("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,h._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=Vo("color.gradients.custom"),i=Vo("color.gradients.theme"),a=Vo("color.gradients.default"),c=Vo("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,h._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,h._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,h._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const mf="__experimentalBorder",gf=["top","right","bottom","left"],hf=e=>{var t,n;return{...e,borderColor:void 0,style:{...e.style,border:{radius:null===(t=e.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius}}}},ff=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},vf=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=ff(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return ff(t,"color",o)||{color:o}};function bf(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function _f(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=pf(),a=kf(e.name),c=Vo("border.color")&&kf(e.name,"color"),u=Vo("border.radius")&&kf(e.name,"radius"),d=Vo("border.style")&&kf(e.name,"style"),m=Vo("border.width")&&kf(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const g=(0,r.getBlockSupport)(e.name,[mf,"__experimentalDefaultControls"]),f=(null==g?void 0:g.color)||(null==g?void 0:g.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=vf({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return gf.forEach((e=>{var n;const o=bf(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=vf({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Jo,{__experimentalGroup:"border"},(m||c)&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>(e=>{const{borderColor:t,style:n}=e.attributes;return(0,p.__experimentalIsDefinedBorder)(null==n?void 0:n.border)||!!t})(e),label:(0,h.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Wo({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:f,resetAllFilter:hf,panelId:n},(0,s.createElement)(p.__experimentalBorderBoxControl,{colors:i,enableAlpha:!0,enableStyle:d,onChange:e=>{var t;let n,r={...e};if((0,p.__experimentalHasSplitBorders)(e))r={top:{...e.top},right:{...e.right},bottom:{...e.bottom},left:{...e.left}},gf.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=vf({colors:i,customColor:null===(o=e[t])||void 0===o?void 0:o.color});n.slug&&(r[t].color=`var:preset|color|${n.slug}`)}}));else if(null!=e&&e.color){const t=null==e?void 0:e.color,o=vf({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Wo({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverOffset:40,popoverPlacement:"left-start",value:v,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0})),u&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){var t,n;const o=null===(t=e.attributes.style)||void 0===t||null===(n=t.border)||void 0===n?void 0:n.radius;return"object"==typeof o?Object.entries(o).some(Boolean):!!o}(e),label:(0,h.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:yf(o,"radius")})}(e),isShownByDefault:null==g?void 0:g.radius,resetAllFilter:e=>{var t;return{...e,style:{...e.style,border:{...null===(t=e.style)||void 0===t?void 0:t.border,radius:void 0}}}},panelId:n},(0,s.createElement)(sf,e)))}function kf(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";if("web"!==s.Platform.OS)return!1;const n=(0,r.getBlockSupport)(e,mf);return!!(!0===n||("any"===t?null!=n&&n.color||null!=n&&n.radius||null!=n&&n.width||null!=n&&n.style:null!=n&&n[t]))}function yf(e,t){return Wo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function Ef(e,t,n){if(!kf(t,"color")||Ko(t,mf,"color"))return e;const o=Cf(n),r=c()(e.className,o);return e.className=r||void 0,e}function Cf(e){var t;const{borderColor:n,style:o}=e,r=uf("border-color",n);return c()({"has-border-color":n||(null==o||null===(t=o.border)||void 0===t?void 0:t.color),[r]:!!r})}const Sf=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:g}=t,{borderColor:h,style:f}=g,{colors:v}=pf();if(!kf(m,"color")||Ko(m,mf,"color"))return(0,s.createElement)(e,t);const{color:b}=vf({colors:v,namedColor:h}),{color:_}=vf({colors:v,namedColor:bf(null==f||null===(n=f.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:k}=vf({colors:v,namedColor:bf(null==f||null===(r=f.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=vf({colors:v,namedColor:bf(null==f||null===(a=f.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=vf({colors:v,namedColor:bf(null==f||null===(u=f.border)||void 0===u||null===(d=u.left)||void 0===d?void 0:d.color)}),C={borderTopColor:_||b,borderRightColor:k||b,borderBottomColor:y||b,borderLeftColor:E||b};let S=t.wrapperProps;return S={...t.wrapperProps,style:{...null===(p=t.wrapperProps)||void 0===p?void 0:p.style,...C}},(0,s.createElement)(e,i({},t,{wrapperProps:S}))}));function wf(e){if(e)return`has-${e}-gradient-background`}function Bf(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function If(e,t){return(0,u.find)(e,["gradient",t])}function xf(e,t){const n=If(e,t);return n&&n.slug}function Tf(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=lo(),o=Vo("color.gradients.custom"),r=Vo("color.gradients.theme"),l=Vo("color.gradients.default"),i=(0,s.useMemo)((()=>[...o||[],...r||[],...l||[]]),[o,r,l]),{gradient:a,customGradient:c}=(0,m.useSelect)((o=>{const{getBlockAttributes:r}=o(to),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(to),d=(0,s.useCallback)((o=>{const r=xf(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=wf(a);let g;return g=a?Bf(i,a):c,{gradientClass:p,gradientValue:g,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return kf(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",Ef),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!kf(e,"color")||Ko(e,mf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ef(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",Sf);const Nf=["colors","disableCustomColors","gradients","disableCustomGradients"],Pf={name:"color",title:"Solid",value:"color"},Lf={name:"gradient",title:"Gradient",value:"gradient"},Rf=[Pf,Lf];function Mf(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:g,colorValue:h,gradientValue:f,clearable:v,showTitle:b=!0,enableAlpha:_}=e;const k=m&&(!(0,u.isEmpty)(t)||!o),y=g&&(!(0,u.isEmpty)(n)||!r);if(!k&&!y)return null;const E={[Pf.value]:(0,s.createElement)(p.ColorPalette,{value:h,onChange:y?e=>{m(e),g()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v,enableAlpha:_}),[Lf.value]:(0,s.createElement)(p.GradientPicker,{value:f,onChange:k?e=>{g(e),m()}:g,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:v})},C=e=>(0,s.createElement)("div",{className:"block-editor-color-gradient-control__panel"},E[e]);return(0,s.createElement)(p.BaseControl,{__nextHasNoMarginBottom:!0,className:c()("block-editor-color-gradient-control",a)},(0,s.createElement)("fieldset",{className:"block-editor-color-gradient-control__fieldset"},(0,s.createElement)(p.__experimentalVStack,{spacing:1},b&&(0,s.createElement)("legend",null,(0,s.createElement)("div",{className:"block-editor-color-gradient-control__color-indicator"},(0,s.createElement)(p.BaseControl.VisualLabel,null,d))),k&&y&&(0,s.createElement)(p.TabPanel,{className:"block-editor-color-gradient-control__tabs",tabs:Rf,initialTabName:f?Lf.value:!!k&&Pf.value},(e=>C(e.value))),!y&&C(Pf.value),!k&&C(Lf.value))))}function Af(e){const t={};return t.colors=Vo("color.palette"),t.gradients=Vo("color.gradients"),t.disableCustomColors=!Vo("color.custom"),t.disableCustomGradients=!Vo("color.customGradient"),(0,s.createElement)(Mf,i({},t,e))}const Df=function(e){return(0,u.every)(Nf,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Mf,e):(0,s.createElement)(Af,e)},Of=e=>{let{setting:t,children:n,panelId:o,...r}=e;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:()=>!!t.colorValue||!!t.gradientValue,label:t.label,onDeselect:()=>{t.colorValue?t.onColorChange():t.gradientValue&&t.onGradientChange()},isShownByDefault:void 0===t.isShownByDefault||t.isShownByDefault},r,{className:"block-editor-tools-panel-color-gradient-settings__item",panelId:o,resetAllFilter:t.resetAllFilter}),n)},Ff=e=>{let{colorValue:t,label:n}=e;return(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:t}),(0,s.createElement)(p.FlexItem,{className:"block-editor-panel-color-gradient-settings__color-name",title:n},n))},zf=e=>t=>{let{onToggle:n,isOpen:o}=t;const{colorValue:r,label:l}=e,i={onClick:n,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":o}),"aria-expanded":o};return(0,s.createElement)(p.Button,i,(0,s.createElement)(Ff,{colorValue:r,label:l}))};function Vf(e){let t,{colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradients:a,settings:c,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...m}=e;return d&&(t={placement:"left-start",offset:36,__unstableShift:!0}),(0,s.createElement)(s.Fragment,null,c.map(((e,c)=>{var g;const h={clearable:!1,colorValue:e.colorValue,colors:n,disableCustomColors:o,disableCustomGradients:r,enableAlpha:l,gradientValue:e.gradientValue,gradients:a,label:e.label,onColorChange:e.onColorChange,onGradientChange:e.onGradientChange,showTitle:!1,__experimentalHasMultipleOrigins:u,__experimentalIsRenderedInSidebar:d,...e},f={colorValue:null!==(g=e.gradientValue)&&void 0!==g?g:e.colorValue,label:e.label};return e&&(0,s.createElement)(Of,i({key:c,setting:e},m),(0,s.createElement)(p.Dropdown,{popoverProps:t,className:"block-editor-tools-panel-color-gradient-settings__dropdown",renderToggle:zf(f),renderContent:()=>(0,s.createElement)(p.__experimentalDropdownContentWrapper,{paddingSize:"none"},(0,s.createElement)("div",{className:"block-editor-panel-color-gradient-settings__dropdown-content"},(0,s.createElement)(Df,h)))}))})))}xd([Td,Ld]);const Hf=function(e){let{backgroundColor:t,fallbackBackgroundColor:n,fallbackTextColor:o,fallbackLinkColor:r,fontSize:l,isLargeText:i,textColor:a,linkColor:c,enableAlphaChecker:u=!1}=e;const d=t||n;if(!d)return null;const m=a||o,g=c||r;if(!m&&!g)return null;const f=[{color:m,description:(0,h.__)("text color")},{color:g,description:(0,h.__)("link color")}],v=Bd(d),b=v.alpha()<1,_=v.brightness(),k={level:"AA",size:i||!1!==i&&l>=24?"large":"small"};let y="",E="";for(const e of f){if(!e.color)continue;const t=Bd(e.color),n=t.isReadable(v,k),o=t.alpha()<1;if(!n){if(b||o)continue;y=_<t.brightness()?(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
71 |
(0,h.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,h.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
|
72 |
+
(0,h.__)("This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s."),e.description),E=(0,h.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,h.__)("Transparent text may be hard for people to read."),E=(0,h.__)("Transparent text may be hard for people to read."))}return y?((0,Ut.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};function Uf(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function Gf(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,a]=(0,s.useState)(),[c,u]=(0,s.useState)(),[d,p]=(0,s.useState)(),m=wo(o);(0,s.useEffect)((()=>{var e;if(!r)return;if(!m.current)return;u(Uf(m.current).color);const t=null===(e=m.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&p(Uf(t).color);let n=m.current,o=Uf(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=Uf(n).backgroundColor;a(o)}));const g=pf();return(0,s.createElement)(Jo,{__experimentalGroup:"color"},(0,s.createElement)(Vf,i({enableAlpha:t,panelId:o,settings:n,__experimentalIsItemGroup:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0},g)),r&&(0,s.createElement)(Hf,{backgroundColor:l,textColor:c,enableAlphaChecker:t,linkColor:d}))}const Wf="color",$f=e=>{const t=(0,r.getBlockSupport)(e,Wf);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},jf=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,Wf);return null!==t&&"object"==typeof t&&!!t.link},Kf=e=>{const t=(0,r.getBlockSupport)(e,Wf);return null!==t&&"object"==typeof t&&!!t.gradients},qf=e=>{const t=(0,r.getBlockSupport)(e,Wf);return t&&!1!==t.background},Yf=e=>{const t=(0,r.getBlockSupport)(e,Wf);return t&&!1!==t.text},Zf=(e,t)=>Wo($o(t,e,void 0)),Qf=e=>({textColor:void 0,style:Zf(["color","text"],e.style)}),Xf=e=>({style:Zf(["elements","link","color","text"],e.style)}),Jf=e=>{var t;return{backgroundColor:void 0,gradient:void 0,style:{...e.style,color:{...null===(t=e.style)||void 0===t?void 0:t.color,background:void 0,gradient:void 0}}}};function ev(e,t,n){var o,r,l,i,s,a;if(!$f(t)||Ko(t,Wf))return e;const u=Kf(t),{backgroundColor:d,textColor:p,gradient:m,style:g}=n,h=e=>!Ko(t,Wf,e),f=h("text")?uf("color",p):void 0,v=h("gradients")?wf(m):void 0,b=h("background")?uf("background-color",d):void 0,_=h("background")||h("gradients"),k=d||(null==g||null===(o=g.color)||void 0===o?void 0:o.background)||u&&(m||(null==g||null===(r=g.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,f,v,{[b]:!(u&&null!=g&&null!==(l=g.color)&&void 0!==l&&l.gradient||!b),"has-text-color":h("text")&&(p||(null==g||null===(i=g.color)||void 0===i?void 0:i.text)),"has-background":_&&k,"has-link-color":h("link")&&(null==g||null===(s=g.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const tv=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?af(e,n[1]).color:t};function nv(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,g=Vo("color.palette.custom"),f=Vo("color.palette.theme"),v=Vo("color.palette.default"),b=(0,s.useMemo)((()=>[...g||[],...f||[],...v||[]]),[g,f,v]),_=Vo("color.gradients.custom"),k=Vo("color.gradients.theme"),y=Vo("color.gradients.default"),E=(0,s.useMemo)((()=>[..._||[],...k||[],...y||[]]),[_,k,y]),C=Vo("color.custom"),S=Vo("color.customGradient"),w=Vo("color.background"),B=Vo("color.link"),I=Vo("color.text"),x=C||!f||(null==f?void 0:f.length)>0,T=S||!k||(null==k?void 0:k.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!$f(p))return null;const P=jf(p)&&B&&x,L=Yf(p)&&I&&x,R=qf(p)&&w&&x,M=Kf(p)&&T;if(!(P||L||R||M))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(M&&F)z=Bf(E,F);else if(M){var V;z=null==A||null===(V=A.color)||void 0===V?void 0:V.gradient}const H=t=>n=>{var o,r;const l=cf(b,n),i=t+"Color",s={...N.current.style,color:{...null===(o=N.current)||void 0===o||null===(r=o.style)||void 0===r?void 0:r.color,[t]:null!=l&&l.slug?void 0:n}},a=null!=l&&l.slug?l.slug:void 0,c={style:Wo(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},U=(0,r.getBlockSupport)(e.name,[Wf,"__experimentalDefaultControls"]),G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient||!1===(0,r.getBlockSupport)(e.name,[Wf,"enableContrastChecker"]));return(0,s.createElement)(Gf,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...L?[{label:(0,h.__)("Text"),onColorChange:H("text"),colorValue:af(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,resetAllFilter:Qf}]:[],...R||M?[{label:(0,h.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:af(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:M?t=>{const n=xf(E,t);let o;if(n){var r,l,i;const e={...null===(r=N.current)||void 0===r?void 0:r.style,color:{...null===(l=N.current)||void 0===l||null===(i=l.style)||void 0===i?void 0:i.color,gradient:void 0}};o={style:Wo(e),gradient:n}}else{var s,a,c;const e={...null===(s=N.current)||void 0===s?void 0:s.style,color:{...null===(a=N.current)||void 0===a||null===(c=a.style)||void 0===c?void 0:c.color,gradient:t}};o={style:Wo(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,resetAllFilter:Jf}]:[],...P?[{label:(0,h.__)("Link"),onColorChange:t=>{var n;const o=cf(b,t),r=null!=o&&o.slug?`var:preset|color|${o.slug}`:t,l=Wo($o(null===(n=N.current)||void 0===n?void 0:n.style,["elements","link","color","text"],r));e.setAttributes({style:l}),N.current={...N.current,style:l}},colorValue:tv(b,null==A||null===(l=A.elements)||void 0===l||null===(i=l.link)||void 0===i||null===(a=i.color)||void 0===a?void 0:a.text),clearable:!(null==A||null===(c=A.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text),isShownByDefault:null==U?void 0:U.link,resetAllFilter:Xf}]:[]]})}const ov=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=Vo("color.palette.custom")||[],u=Vo("color.palette.theme")||[],d=Vo("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!$f(o)||Ko(o,Wf))return(0,s.createElement)(e,t);const m={};var g,h;a&&!Ko(o,Wf,"text")&&(m.color=null===(g=af(p,a))||void 0===g?void 0:g.color),l&&!Ko(o,Wf,"background")&&(m.backgroundColor=null===(h=af(p,l))||void 0===h?void 0:h.color);let f=t.wrapperProps;return f={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:f}))})),rv={linkColor:[["style","elements","link","color","text"]],textColor:[["textColor"],["style","color","text"]],backgroundColor:[["backgroundColor"],["style","color","background"]],gradient:[["gradient"],["style","color","gradient"]]};(0,l.addFilter)("blocks.registerBlockType","core/color/addAttribute",(function(e){return $f(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Kf(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",ev),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!$f(e)||Ko(e,Wf))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ev(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",ov),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return jo({linkColor:jf(r),textColor:Yf(r),backgroundColor:qf(r),gradient:Kf(r)},rv,e,t,n,o)}));const lv=[{name:(0,h._x)("Regular","font style"),value:"normal"},{name:(0,h._x)("Italic","font style"),value:"italic"}],iv=[{name:(0,h._x)("Thin","font weight"),value:"100"},{name:(0,h._x)("Extra Light","font weight"),value:"200"},{name:(0,h._x)("Light","font weight"),value:"300"},{name:(0,h._x)("Regular","font weight"),value:"400"},{name:(0,h._x)("Medium","font weight"),value:"500"},{name:(0,h._x)("Semi Bold","font weight"),value:"600"},{name:(0,h._x)("Bold","font weight"),value:"700"},{name:(0,h._x)("Extra Bold","font weight"),value:"800"},{name:(0,h._x)("Black","font weight"),value:"900"}],sv=(e,t)=>e?t?(0,h.__)("Appearance"):(0,h.__)("Font style"):(0,h.__)("Font weight");function av(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l},...a}=e,c=n||o,u=sv(n,o),d={key:"default",name:(0,h.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},m=(0,s.useMemo)((()=>n&&o?(()=>{const e=[d];return lv.forEach((t=>{let{name:n,value:o}=t;iv.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,h.sprintf)(
|
73 |
/* translators: 1: Font weight name. 2: Font style name. */
|
74 |
+
(0,h.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[d];return lv.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[d];return iv.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),g=m.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||m[0];return c&&(0,s.createElement)(p.CustomSelectControl,i({},a,{className:"components-font-appearance-control",label:u,describedBy:g?n?o?(0,h.sprintf)(// translators: %s: Currently selected font appearance.
|
75 |
(0,h.__)("Currently selected font appearance: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font style.
|
76 |
(0,h.__)("Currently selected font style: %s"),g.name):(0,h.sprintf)(// translators: %s: Currently selected font weight.
|
|
|
|
|
|