Gutenberg - Version 13.2.0

Version Description

Download this release

Release Info

Developer gutenbergplugin
Plugin Icon 128x128 Gutenberg
Version 13.2.0
Comparing to
See all releases

Code changes from version 13.1.0 to 13.2.0

build/admin-manifest/index.js DELETED
@@ -1,207 +0,0 @@
1
- /******/ (function() { // webpackBootstrap
2
- /******/ "use strict";
3
- /******/ // The require scope
4
- /******/ var __webpack_require__ = {};
5
- /******/
6
- /************************************************************************/
7
- /******/ /* webpack/runtime/make namespace object */
8
- /******/ !function() {
9
- /******/ // define __esModule on exports
10
- /******/ __webpack_require__.r = function(exports) {
11
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
12
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
13
- /******/ }
14
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
15
- /******/ };
16
- /******/ }();
17
- /******/
18
- /************************************************************************/
19
- var __webpack_exports__ = {};
20
- // ESM COMPAT FLAG
21
- __webpack_require__.r(__webpack_exports__);
22
-
23
- ;// CONCATENATED MODULE: external ["wp","url"]
24
- var external_wp_url_namespaceObject = window["wp"]["url"];
25
- ;// CONCATENATED MODULE: ./packages/admin-manifest/build-module/index.js
26
- /**
27
- * WordPress dependencies
28
- */
29
-
30
-
31
- function addManifest(manifest) {
32
- const link = document.createElement('link');
33
- link.rel = 'manifest';
34
- link.href = `data:application/manifest+json,${encodeURIComponent(JSON.stringify(manifest))}`;
35
- document.head.appendChild(link);
36
- }
37
-
38
- function addAppleTouchIcon(size, base64data) {
39
- const iconLink = document.createElement('link');
40
- iconLink.rel = 'apple-touch-icon';
41
- iconLink.href = base64data;
42
- iconLink.sizes = '180x180';
43
- document.head.insertBefore(iconLink, document.head.firstElementChild);
44
- }
45
-
46
- function createSvgElement(html) {
47
- const doc = document.implementation.createHTMLDocument('');
48
- doc.body.innerHTML = html;
49
- const {
50
- firstElementChild: svgElement
51
- } = doc.body;
52
- svgElement.setAttribute('viewBox', '0 0 80 80');
53
- return svgElement;
54
- }
55
-
56
- function createIcon(_ref) {
57
- let {
58
- svgElement,
59
- size,
60
- color,
61
- backgroundColor,
62
- circle
63
- } = _ref;
64
- return new Promise(resolve => {
65
- const canvas = document.createElement('canvas');
66
- const context = canvas.getContext('2d'); // Leave 1/8th padding around the logo.
67
-
68
- const padding = size / 8; // Which leaves 3/4ths of space for the icon.
69
-
70
- const logoSize = padding * 6; // Resize the SVG logo.
71
-
72
- svgElement.setAttribute('width', logoSize);
73
- svgElement.setAttribute('height', logoSize); // Color in the background.
74
-
75
- svgElement.querySelectorAll('path').forEach(path => {
76
- path.setAttribute('fill', backgroundColor);
77
- }); // Resize the canvas.
78
-
79
- canvas.width = size;
80
- canvas.height = size; // If we're not drawing a circle, set the background color.
81
-
82
- if (!circle) {
83
- context.fillStyle = backgroundColor;
84
- context.fillRect(0, 0, canvas.width, canvas.height);
85
- } // Fill in the letter (W) and circle around it.
86
-
87
-
88
- context.fillStyle = color;
89
- context.beginPath();
90
- context.arc(size / 2, size / 2, logoSize / 2 - 1, 0, 2 * Math.PI);
91
- context.closePath();
92
- context.fill(); // Create a URL for the SVG to load in an image element.
93
-
94
- const svgBlob = new window.Blob([svgElement.outerHTML], {
95
- type: 'image/svg+xml'
96
- });
97
- const url = URL.createObjectURL(svgBlob);
98
- const image = document.createElement('img');
99
- image.src = url;
100
- image.width = logoSize;
101
- image.height = logoSize;
102
-
103
- image.onload = () => {
104
- // Once the image is loaded, draw it onto the canvas.
105
- context.drawImage(image, padding, padding); // Export it to a blob.
106
-
107
- canvas.toBlob(imageBlob => {
108
- // We no longer need the SVG blob url.
109
- URL.revokeObjectURL(url); // Unfortunately blob URLs don't seem to work, so we have to use
110
- // base64 encoded data URLs.
111
-
112
- const reader = new window.FileReader();
113
- reader.readAsDataURL(imageBlob);
114
-
115
- reader.onloadend = () => {
116
- resolve(reader.result);
117
- };
118
- });
119
- };
120
- });
121
- }
122
-
123
- function getAdminBarColors() {
124
- const adminBarDummy = document.createElement('div');
125
- adminBarDummy.id = 'wpadminbar';
126
- document.body.appendChild(adminBarDummy);
127
- const {
128
- color,
129
- backgroundColor
130
- } = window.getComputedStyle(adminBarDummy);
131
- document.body.removeChild(adminBarDummy); // Fall back to black and white if no admin/color stylesheet was loaded.
132
-
133
- return {
134
- color: color || 'white',
135
- backgroundColor: backgroundColor || 'black'
136
- };
137
- }
138
-
139
- window.addEventListener('load', () => {
140
- if (!('serviceWorker' in window.navigator)) {
141
- return;
142
- }
143
-
144
- const {
145
- logo,
146
- siteTitle,
147
- adminUrl
148
- } = window.wpAdminManifestL10n;
149
- const manifest = {
150
- name: siteTitle,
151
- display: 'standalone',
152
- orientation: 'portrait',
153
- start_url: adminUrl,
154
- // Open front-end, login page, and any external URLs in a browser
155
- // modal.
156
- scope: adminUrl,
157
- icons: []
158
- };
159
- const {
160
- color,
161
- backgroundColor
162
- } = getAdminBarColors();
163
- const svgElement = createSvgElement(logo);
164
- Promise.all([// The maskable icon should have its background filled. This is used
165
- // for iOS. To do: check which sizes are really needed.
166
- ...[180, 192, 512].map(size => createIcon({
167
- svgElement,
168
- size,
169
- color,
170
- backgroundColor
171
- }).then(base64data => {
172
- manifest.icons.push({
173
- src: base64data,
174
- sizes: size + 'x' + size,
175
- type: 'image/png',
176
- purpose: 'maskable'
177
- }); // iOS doesn't seem to look at the manifest.
178
-
179
- if (size === 180) {
180
- addAppleTouchIcon(size, base64data);
181
- }
182
- })), // The "normal" icon should be round. This is used for Chrome
183
- // Desktop PWAs. To do: check which sizes are really needed.
184
- ...[180, 192, 512].map(size => createIcon({
185
- svgElement,
186
- size,
187
- color,
188
- backgroundColor,
189
- circle: true
190
- }).then(base64data => {
191
- manifest.icons.push({
192
- src: base64data,
193
- sizes: size + 'x' + size,
194
- type: 'image/png',
195
- purpose: 'any'
196
- });
197
- }))]).then(() => {
198
- addManifest(manifest);
199
- window.navigator.serviceWorker.register((0,external_wp_url_namespaceObject.addQueryArgs)(adminUrl, {
200
- 'service-worker': true
201
- }));
202
- });
203
- });
204
-
205
- (window.wp = window.wp || {}).adminManifest = __webpack_exports__;
206
- /******/ })()
207
- ;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
build/admin-manifest/index.min.asset.php DELETED
@@ -1 +0,0 @@
1
- <?php return array('dependencies' => array('wp-polyfill', 'wp-url'), 'version' => '69cf68c5058c105a891f84697db3f0e0');
 
build/admin-manifest/index.min.js DELETED
@@ -1,2 +0,0 @@
1
- !function(){"use strict";var e={};(function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})})(e);var t=window.wp.url;function o(e){let{svgElement:t,size:o,color:n,backgroundColor:i,circle:r}=e;return new Promise((e=>{const l=document.createElement("canvas"),a=l.getContext("2d"),c=o/8,d=6*c;t.setAttribute("width",d),t.setAttribute("height",d),t.querySelectorAll("path").forEach((e=>{e.setAttribute("fill",i)})),l.width=o,l.height=o,r||(a.fillStyle=i,a.fillRect(0,0,l.width,l.height)),a.fillStyle=n,a.beginPath(),a.arc(o/2,o/2,d/2-1,0,2*Math.PI),a.closePath(),a.fill();const s=new window.Blob([t.outerHTML],{type:"image/svg+xml"}),u=URL.createObjectURL(s),m=document.createElement("img");m.src=u,m.width=d,m.height=d,m.onload=()=>{a.drawImage(m,c,c),l.toBlob((t=>{URL.revokeObjectURL(u);const o=new window.FileReader;o.readAsDataURL(t),o.onloadend=()=>{e(o.result)}}))}}))}window.addEventListener("load",(()=>{if(!("serviceWorker"in window.navigator))return;const{logo:e,siteTitle:n,adminUrl:i}=window.wpAdminManifestL10n,r={name:n,display:"standalone",orientation:"portrait",start_url:i,scope:i,icons:[]},{color:l,backgroundColor:a}=function(){const e=document.createElement("div");e.id="wpadminbar",document.body.appendChild(e);const{color:t,backgroundColor:o}=window.getComputedStyle(e);return document.body.removeChild(e),{color:t||"white",backgroundColor:o||"black"}}(),c=function(e){const t=document.implementation.createHTMLDocument("");t.body.innerHTML=e;const{firstElementChild:o}=t.body;return o.setAttribute("viewBox","0 0 80 80"),o}(e);Promise.all([...[180,192,512].map((e=>o({svgElement:c,size:e,color:l,backgroundColor:a}).then((t=>{r.icons.push({src:t,sizes:e+"x"+e,type:"image/png",purpose:"maskable"}),180===e&&function(e,t){const o=document.createElement("link");o.rel="apple-touch-icon",o.href=t,o.sizes="180x180",document.head.insertBefore(o,document.head.firstElementChild)}(0,t)})))),...[180,192,512].map((e=>o({svgElement:c,size:e,color:l,backgroundColor:a,circle:!0}).then((t=>{r.icons.push({src:t,sizes:e+"x"+e,type:"image/png",purpose:"any"})}))))]).then((()=>{!function(e){const t=document.createElement("link");t.rel="manifest",t.href=`data:application/manifest+json,${encodeURIComponent(JSON.stringify(e))}`,document.head.appendChild(t)}(r),window.navigator.serviceWorker.register((0,t.addQueryArgs)(i,{"service-worker":!0}))}))})),(window.wp=window.wp||{}).adminManifest=e}();
2
- //# sourceMappingURL=index.min.js.map
 
 
build/admin-manifest/index.min.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"./build/admin-manifest/index.min.js","mappings":"yBACA,I,MCAwB,SAASA,GACX,oBAAXC,QAA0BA,OAAOC,aAC1CC,OAAOC,eAAeJ,EAASC,OAAOC,YAAa,CAAEG,MAAO,WAE7DF,OAAOC,eAAeJ,EAAS,aAAc,CAAEK,OAAO,K,ICLvD,IAAI,EAA+BC,OAAW,GAAO,IC8BrD,SAASC,EAAT,GAA4E,IAAvD,WAAEC,EAAF,KAAcC,EAAd,MAAoBC,EAApB,gBAA2BC,EAA3B,OAA4CC,GAAW,EAC3E,OAAO,IAAIC,SAAWC,IACrB,MAAMC,EAASC,SAASC,cAAe,UACjCC,EAAUH,EAAOI,WAAY,MAG7BC,EAAUX,EAAO,EAEjBY,EAAqB,EAAVD,EAGjBZ,EAAWc,aAAc,QAASD,GAClCb,EAAWc,aAAc,SAAUD,GAGnCb,EAAWe,iBAAkB,QAASC,SAAWC,IAChDA,EAAKH,aAAc,OAAQX,MAI5BI,EAAOW,MAAQjB,EACfM,EAAOY,OAASlB,EAGTG,IACNM,EAAQU,UAAYjB,EACpBO,EAAQW,SAAU,EAAG,EAAGd,EAAOW,MAAOX,EAAOY,SAI9CT,EAAQU,UAAYlB,EACpBQ,EAAQY,YACRZ,EAAQa,IAAKtB,EAAO,EAAGA,EAAO,EAAGY,EAAW,EAAI,EAAG,EAAG,EAAIW,KAAKC,IAC/Df,EAAQgB,YACRhB,EAAQiB,OAGR,MAAMC,EAAU,IAAI9B,OAAO+B,KAAM,CAAE7B,EAAW8B,WAAa,CAC1DC,KAAM,kBAEDC,EAAMC,IAAIC,gBAAiBN,GAC3BO,EAAQ3B,SAASC,cAAe,OAEtC0B,EAAMC,IAAMJ,EACZG,EAAMjB,MAAQL,EACdsB,EAAMhB,OAASN,EACfsB,EAAME,OAAS,KAEd3B,EAAQ4B,UAAWH,EAAOvB,EAASA,GAEnCL,EAAOgC,QAAUC,IAEhBP,IAAIQ,gBAAiBT,GAGrB,MAAMU,EAAS,IAAI5C,OAAO6C,WAC1BD,EAAOE,cAAeJ,GACtBE,EAAOG,UAAY,KAClBvC,EAASoC,EAAOI,gBAoBrBhD,OAAOiD,iBAAkB,QAAQ,KAChC,KAAS,kBAAmBjD,OAAOkD,WAClC,OAGD,MAAM,KAAEC,EAAF,UAAQC,EAAR,SAAmBC,GAAarD,OAAOsD,oBACvCC,EAAW,CAChBC,KAAMJ,EACNK,QAAS,aACTC,YAAa,WACbC,UAAWN,EAGXO,MAAOP,EACPQ,MAAO,KAGF,MAAEzD,EAAF,gBAASC,GA9BhB,WACC,MAAMyD,EAAgBpD,SAASC,cAAe,OAC9CmD,EAAcC,GAAK,aACnBrD,SAASsD,KAAKC,YAAaH,GAC3B,MAAM,MAAE1D,EAAF,gBAASC,GAAoBL,OAAOkE,iBAAkBJ,GAG5D,OAFApD,SAASsD,KAAKG,YAAaL,GAEpB,CACN1D,MAAOA,GAAS,QAChBC,gBAAiBA,GAAmB,SAqBF+D,GAC7BlE,EAxGP,SAA2BmE,GAC1B,MAAMC,EAAM5D,SAAS6D,eAAeC,mBAAoB,IACxDF,EAAIN,KAAKS,UAAYJ,EACrB,MAAQK,kBAAmBxE,GAAeoE,EAAIN,KAE9C,OADA9D,EAAWc,aAAc,UAAW,aAC7Bd,EAmGYyE,CAAkBxB,GAErC5C,QAAQqE,IAAK,IAGT,CAAE,IAAK,IAAK,KAAMC,KAAO1E,GAC3BF,EAAY,CACXC,WAAAA,EACAC,KAAAA,EACAC,MAAAA,EACAC,gBAAAA,IACGyE,MAAQC,IACXxB,EAASM,MAAMmB,KAAM,CACpB1C,IAAKyC,EACLE,MAAO9E,EAAO,IAAMA,EACpB8B,KAAM,YACNiD,QAAS,aAII,MAAT/E,GApIT,SAA4BA,EAAM4E,GACjC,MAAMI,EAAWzE,SAASC,cAAe,QACzCwE,EAASC,IAAM,mBACfD,EAASE,KAAON,EAChBI,EAASF,MAAQ,UACjBvE,SAAS4E,KAAKC,aAAcJ,EAAUzE,SAAS4E,KAAKZ,mBAgIhDc,CAAmBrF,EAAM4E,WAMzB,CAAE,IAAK,IAAK,KAAMF,KAAO1E,GAC3BF,EAAY,CACXC,WAAAA,EACAC,KAAAA,EACAC,MAAAA,EACAC,gBAAAA,EACAC,QAAQ,IACLwE,MAAQC,IACXxB,EAASM,MAAMmB,KAAM,CACpB1C,IAAKyC,EACLE,MAAO9E,EAAO,IAAMA,EACpB8B,KAAM,YACNiD,QAAS,eAITJ,MAAM,MApKX,SAAsBvB,GACrB,MAAMkC,EAAO/E,SAASC,cAAe,QACrC8E,EAAKL,IAAM,WACXK,EAAKJ,KAAQ,kCAAkCK,mBAC9CC,KAAKC,UAAWrC,MAEjB7C,SAAS4E,KAAKrB,YAAawB,GA+J1BI,CAAatC,GACbvD,OAAOkD,UAAU4C,cAAcC,UAC9BC,EAAAA,EAAAA,cAAc3C,EAAU,CAAE,kBAAkB,Y","sources":["webpack://wp/webpack/bootstrap","webpack://wp/webpack/runtime/make namespace object","webpack://wp/external window [\"wp\",\"url\"]","webpack://wp/./packages/admin-manifest/build-module/@wordpress/admin-manifest/src/index.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\n","// define __esModule on exports\n__webpack_require__.r = function(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};","var __WEBPACK_NAMESPACE_OBJECT__ = window[\"wp\"][\"url\"];","/**\n * WordPress dependencies\n */\nimport { addQueryArgs } from '@wordpress/url';\n\nfunction addManifest( manifest ) {\n\tconst link = document.createElement( 'link' );\n\tlink.rel = 'manifest';\n\tlink.href = `data:application/manifest+json,${ encodeURIComponent(\n\t\tJSON.stringify( manifest )\n\t) }`;\n\tdocument.head.appendChild( link );\n}\n\nfunction addAppleTouchIcon( size, base64data ) {\n\tconst iconLink = document.createElement( 'link' );\n\ticonLink.rel = 'apple-touch-icon';\n\ticonLink.href = base64data;\n\ticonLink.sizes = '180x180';\n\tdocument.head.insertBefore( iconLink, document.head.firstElementChild );\n}\n\nfunction createSvgElement( html ) {\n\tconst doc = document.implementation.createHTMLDocument( '' );\n\tdoc.body.innerHTML = html;\n\tconst { firstElementChild: svgElement } = doc.body;\n\tsvgElement.setAttribute( 'viewBox', '0 0 80 80' );\n\treturn svgElement;\n}\n\nfunction createIcon( { svgElement, size, color, backgroundColor, circle } ) {\n\treturn new Promise( ( resolve ) => {\n\t\tconst canvas = document.createElement( 'canvas' );\n\t\tconst context = canvas.getContext( '2d' );\n\n\t\t// Leave 1/8th padding around the logo.\n\t\tconst padding = size / 8;\n\t\t// Which leaves 3/4ths of space for the icon.\n\t\tconst logoSize = padding * 6;\n\n\t\t// Resize the SVG logo.\n\t\tsvgElement.setAttribute( 'width', logoSize );\n\t\tsvgElement.setAttribute( 'height', logoSize );\n\n\t\t// Color in the background.\n\t\tsvgElement.querySelectorAll( 'path' ).forEach( ( path ) => {\n\t\t\tpath.setAttribute( 'fill', backgroundColor );\n\t\t} );\n\n\t\t// Resize the canvas.\n\t\tcanvas.width = size;\n\t\tcanvas.height = size;\n\n\t\t// If we're not drawing a circle, set the background color.\n\t\tif ( ! circle ) {\n\t\t\tcontext.fillStyle = backgroundColor;\n\t\t\tcontext.fillRect( 0, 0, canvas.width, canvas.height );\n\t\t}\n\n\t\t// Fill in the letter (W) and circle around it.\n\t\tcontext.fillStyle = color;\n\t\tcontext.beginPath();\n\t\tcontext.arc( size / 2, size / 2, logoSize / 2 - 1, 0, 2 * Math.PI );\n\t\tcontext.closePath();\n\t\tcontext.fill();\n\n\t\t// Create a URL for the SVG to load in an image element.\n\t\tconst svgBlob = new window.Blob( [ svgElement.outerHTML ], {\n\t\t\ttype: 'image/svg+xml',\n\t\t} );\n\t\tconst url = URL.createObjectURL( svgBlob );\n\t\tconst image = document.createElement( 'img' );\n\n\t\timage.src = url;\n\t\timage.width = logoSize;\n\t\timage.height = logoSize;\n\t\timage.onload = () => {\n\t\t\t// Once the image is loaded, draw it onto the canvas.\n\t\t\tcontext.drawImage( image, padding, padding );\n\t\t\t// Export it to a blob.\n\t\t\tcanvas.toBlob( ( imageBlob ) => {\n\t\t\t\t// We no longer need the SVG blob url.\n\t\t\t\tURL.revokeObjectURL( url );\n\t\t\t\t// Unfortunately blob URLs don't seem to work, so we have to use\n\t\t\t\t// base64 encoded data URLs.\n\t\t\t\tconst reader = new window.FileReader();\n\t\t\t\treader.readAsDataURL( imageBlob );\n\t\t\t\treader.onloadend = () => {\n\t\t\t\t\tresolve( reader.result );\n\t\t\t\t};\n\t\t\t} );\n\t\t};\n\t} );\n}\n\nfunction getAdminBarColors() {\n\tconst adminBarDummy = document.createElement( 'div' );\n\tadminBarDummy.id = 'wpadminbar';\n\tdocument.body.appendChild( adminBarDummy );\n\tconst { color, backgroundColor } = window.getComputedStyle( adminBarDummy );\n\tdocument.body.removeChild( adminBarDummy );\n\t// Fall back to black and white if no admin/color stylesheet was loaded.\n\treturn {\n\t\tcolor: color || 'white',\n\t\tbackgroundColor: backgroundColor || 'black',\n\t};\n}\n\nwindow.addEventListener( 'load', () => {\n\tif ( ! ( 'serviceWorker' in window.navigator ) ) {\n\t\treturn;\n\t}\n\n\tconst { logo, siteTitle, adminUrl } = window.wpAdminManifestL10n;\n\tconst manifest = {\n\t\tname: siteTitle,\n\t\tdisplay: 'standalone',\n\t\torientation: 'portrait',\n\t\tstart_url: adminUrl,\n\t\t// Open front-end, login page, and any external URLs in a browser\n\t\t// modal.\n\t\tscope: adminUrl,\n\t\ticons: [],\n\t};\n\n\tconst { color, backgroundColor } = getAdminBarColors();\n\tconst svgElement = createSvgElement( logo );\n\n\tPromise.all( [\n\t\t// The maskable icon should have its background filled. This is used\n\t\t// for iOS. To do: check which sizes are really needed.\n\t\t...[ 180, 192, 512 ].map( ( size ) =>\n\t\t\tcreateIcon( {\n\t\t\t\tsvgElement,\n\t\t\t\tsize,\n\t\t\t\tcolor,\n\t\t\t\tbackgroundColor,\n\t\t\t} ).then( ( base64data ) => {\n\t\t\t\tmanifest.icons.push( {\n\t\t\t\t\tsrc: base64data,\n\t\t\t\t\tsizes: size + 'x' + size,\n\t\t\t\t\ttype: 'image/png',\n\t\t\t\t\tpurpose: 'maskable',\n\t\t\t\t} );\n\n\t\t\t\t// iOS doesn't seem to look at the manifest.\n\t\t\t\tif ( size === 180 ) {\n\t\t\t\t\taddAppleTouchIcon( size, base64data );\n\t\t\t\t}\n\t\t\t} )\n\t\t),\n\t\t// The \"normal\" icon should be round. This is used for Chrome\n\t\t// Desktop PWAs. To do: check which sizes are really needed.\n\t\t...[ 180, 192, 512 ].map( ( size ) =>\n\t\t\tcreateIcon( {\n\t\t\t\tsvgElement,\n\t\t\t\tsize,\n\t\t\t\tcolor,\n\t\t\t\tbackgroundColor,\n\t\t\t\tcircle: true,\n\t\t\t} ).then( ( base64data ) => {\n\t\t\t\tmanifest.icons.push( {\n\t\t\t\t\tsrc: base64data,\n\t\t\t\t\tsizes: size + 'x' + size,\n\t\t\t\t\ttype: 'image/png',\n\t\t\t\t\tpurpose: 'any',\n\t\t\t\t} );\n\t\t\t} )\n\t\t),\n\t] ).then( () => {\n\t\taddManifest( manifest );\n\t\twindow.navigator.serviceWorker.register(\n\t\t\taddQueryArgs( adminUrl, { 'service-worker': true } )\n\t\t);\n\t} );\n} );\n"],"names":["exports","Symbol","toStringTag","Object","defineProperty","value","window","createIcon","svgElement","size","color","backgroundColor","circle","Promise","resolve","canvas","document","createElement","context","getContext","padding","logoSize","setAttribute","querySelectorAll","forEach","path","width","height","fillStyle","fillRect","beginPath","arc","Math","PI","closePath","fill","svgBlob","Blob","outerHTML","type","url","URL","createObjectURL","image","src","onload","drawImage","toBlob","imageBlob","revokeObjectURL","reader","FileReader","readAsDataURL","onloadend","result","addEventListener","navigator","logo","siteTitle","adminUrl","wpAdminManifestL10n","manifest","name","display","orientation","start_url","scope","icons","adminBarDummy","id","body","appendChild","getComputedStyle","removeChild","getAdminBarColors","html","doc","implementation","createHTMLDocument","innerHTML","firstElementChild","createSvgElement","all","map","then","base64data","push","sizes","purpose","iconLink","rel","href","head","insertBefore","addAppleTouchIcon","link","encodeURIComponent","JSON","stringify","addManifest","serviceWorker","register","addQueryArgs"],"sourceRoot":""}
 
build/block-editor/index.js CHANGED
@@ -2211,7 +2211,6 @@ __webpack_require__.d(__webpack_exports__, {
2211
  "__experimentalBlockVariationPicker": function() { return /* reexport */ block_variation_picker; },
2212
  "__experimentalBlockVariationTransforms": function() { return /* reexport */ block_variation_transforms; },
2213
  "__experimentalBorderRadiusControl": function() { return /* reexport */ BorderRadiusControl; },
2214
- "__experimentalBorderStyleControl": function() { return /* reexport */ BorderStyleControl; },
2215
  "__experimentalColorGradientControl": function() { return /* reexport */ control; },
2216
  "__experimentalColorGradientSettingsDropdown": function() { return /* reexport */ ColorGradientSettingsDropdown; },
2217
  "__experimentalDateFormatPicker": function() { return /* reexport */ DateFormatPicker; },
@@ -2672,7 +2671,6 @@ const SETTINGS_DEFAULTS = {
2672
  __mobileEnablePageTemplates: false,
2673
  __experimentalBlockPatterns: [],
2674
  __experimentalBlockPatternCategories: [],
2675
- __experimentalSpotlightEntityBlocks: [],
2676
  __unstableGalleryWithImageBlocks: false,
2677
  generateAnchors: false,
2678
  // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
@@ -6653,26 +6651,28 @@ const getInserterItems = rememo(function (state) {
6653
  *
6654
  * Items are returned ordered descendingly by their 'frecency'.
6655
  *
6656
- * @param {Object} state Editor state.
6657
- * @param {?string} rootClientId Optional root client ID of block list.
 
6658
  *
6659
  * @return {WPEditorTransformItem[]} Items that appear in inserter.
6660
  *
6661
  * @typedef {Object} WPEditorTransformItem
6662
- * @property {string} id Unique identifier for the item.
6663
- * @property {string} name The type of block to create.
6664
- * @property {string} title Title of the item, as it appears in the inserter.
6665
- * @property {string} icon Dashicon for the item, as it appears in the inserter.
6666
- * @property {boolean} isDisabled Whether or not the user should be prevented from inserting
6667
- * this item.
6668
- * @property {number} frecency Heuristic that combines frequency and recency.
6669
  */
6670
 
6671
  const getBlockTransformItems = rememo(function (state, blocks) {
6672
  var _itemsByName$sourceBl;
6673
 
6674
  let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6675
- const [sourceBlock] = blocks;
 
6676
  const buildBlockTypeTransformItem = buildBlockTypeItem(state, {
6677
  buildScope: 'transform'
6678
  });
@@ -6690,9 +6690,9 @@ const getBlockTransformItems = rememo(function (state, blocks) {
6690
  isDisabled: false,
6691
  name: '*',
6692
  title: (0,external_wp_i18n_namespaceObject.__)('Unwrap'),
6693
- icon: (_itemsByName$sourceBl = itemsByName[sourceBlock.name]) === null || _itemsByName$sourceBl === void 0 ? void 0 : _itemsByName$sourceBl.icon
6694
  };
6695
- const possibleTransforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)(blocks).reduce((accumulator, block) => {
6696
  if (block === '*') {
6697
  accumulator.push(itemsByName['*']);
6698
  } else if (itemsByName[block === null || block === void 0 ? void 0 : block.name]) {
@@ -8956,96 +8956,6 @@ BlockFormatControls.Slot = props => {
8956
 
8957
  /* harmony default export */ var block_controls = (BlockControls);
8958
 
8959
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/align-none.js
8960
-
8961
-
8962
- /**
8963
- * WordPress dependencies
8964
- */
8965
-
8966
- const alignNone = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
8967
- xmlns: "http://www.w3.org/2000/svg",
8968
- viewBox: "0 0 24 24"
8969
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
8970
- d: "M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"
8971
- }));
8972
- /* harmony default export */ var align_none = (alignNone);
8973
-
8974
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/position-left.js
8975
-
8976
-
8977
- /**
8978
- * WordPress dependencies
8979
- */
8980
-
8981
- const positionLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
8982
- xmlns: "http://www.w3.org/2000/svg",
8983
- viewBox: "0 0 24 24"
8984
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
8985
- d: "M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"
8986
- }));
8987
- /* harmony default export */ var position_left = (positionLeft);
8988
-
8989
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/position-center.js
8990
-
8991
-
8992
- /**
8993
- * WordPress dependencies
8994
- */
8995
-
8996
- const positionCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
8997
- xmlns: "http://www.w3.org/2000/svg",
8998
- viewBox: "0 0 24 24"
8999
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
9000
- d: "M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"
9001
- }));
9002
- /* harmony default export */ var position_center = (positionCenter);
9003
-
9004
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/position-right.js
9005
-
9006
-
9007
- /**
9008
- * WordPress dependencies
9009
- */
9010
-
9011
- const positionRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
9012
- xmlns: "http://www.w3.org/2000/svg",
9013
- viewBox: "0 0 24 24"
9014
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
9015
- d: "M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"
9016
- }));
9017
- /* harmony default export */ var position_right = (positionRight);
9018
-
9019
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/stretch-wide.js
9020
-
9021
-
9022
- /**
9023
- * WordPress dependencies
9024
- */
9025
-
9026
- const stretchWide = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
9027
- xmlns: "http://www.w3.org/2000/svg",
9028
- viewBox: "0 0 24 24"
9029
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
9030
- d: "M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"
9031
- }));
9032
- /* harmony default export */ var stretch_wide = (stretchWide);
9033
-
9034
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/stretch-full-width.js
9035
-
9036
-
9037
- /**
9038
- * WordPress dependencies
9039
- */
9040
-
9041
- const stretchFullWidth = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
9042
- xmlns: "http://www.w3.org/2000/svg",
9043
- viewBox: "0 0 24 24"
9044
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
9045
- d: "M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"
9046
- }));
9047
- /* harmony default export */ var stretch_full_width = (stretchFullWidth);
9048
-
9049
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/justify-left.js
9050
 
9051
 
@@ -9369,8 +9279,10 @@ const removeCustomPrefixes = path => {
9369
  return prefixedFlags[path] || path;
9370
  };
9371
  /**
9372
- * Hook that retrieves the editor setting.
9373
- * It works with nested objects using by finding the value at path.
 
 
9374
  *
9375
  * @param {string} path The path to the setting.
9376
  * @return {any} Returns the value defined for the setting.
@@ -9383,48 +9295,70 @@ const removeCustomPrefixes = path => {
9383
 
9384
  function useSetting(path) {
9385
  const {
9386
- name: blockName
 
9387
  } = useBlockEditContext();
9388
  const setting = (0,external_wp_data_namespaceObject.useSelect)(select => {
9389
- var _get;
9390
-
9391
  if (blockedPaths.includes(path)) {
9392
  // eslint-disable-next-line no-console
9393
  console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.');
9394
  return undefined;
9395
  }
9396
 
9397
- const settings = select(store).getSettings(); // 1 - Use __experimental features, if available.
9398
- // We cascade to the all value if the block one is not available.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9399
 
9400
- const normalizedPath = removeCustomPrefixes(path);
9401
- const defaultsPath = `__experimentalFeatures.${normalizedPath}`;
9402
- const blockPath = `__experimentalFeatures.blocks.${blockName}.${normalizedPath}`;
9403
- const experimentalFeaturesResult = (_get = (0,external_lodash_namespaceObject.get)(settings, blockPath)) !== null && _get !== void 0 ? _get : (0,external_lodash_namespaceObject.get)(settings, defaultsPath);
9404
 
9405
- if (experimentalFeaturesResult !== undefined) {
 
9406
  if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_PATHS_WITH_MERGE[normalizedPath]) {
9407
- var _ref, _experimentalFeatures;
9408
 
9409
- return (_ref = (_experimentalFeatures = experimentalFeaturesResult.custom) !== null && _experimentalFeatures !== void 0 ? _experimentalFeatures : experimentalFeaturesResult.theme) !== null && _ref !== void 0 ? _ref : experimentalFeaturesResult.default;
9410
  }
9411
 
9412
- return experimentalFeaturesResult;
9413
- } // 2 - Use deprecated settings, otherwise.
9414
 
9415
 
9416
  const deprecatedSettingsValue = deprecatedFlags[normalizedPath] ? deprecatedFlags[normalizedPath](settings) : undefined;
9417
 
9418
  if (deprecatedSettingsValue !== undefined) {
9419
  return deprecatedSettingsValue;
9420
- } // 3 - Fall back for typography.dropCap:
9421
  // This is only necessary to support typography.dropCap.
9422
  // when __experimentalFeatures are not present (core without plugin).
9423
  // To remove when __experimentalFeatures are ported to core.
9424
 
9425
 
9426
  return normalizedPath === 'typography.dropCap' ? true : undefined;
9427
- }, [blockName, path]);
9428
  return setting;
9429
  }
9430
 
@@ -9774,6 +9708,136 @@ InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
9774
 
9775
  /* harmony default export */ var inspector_controls = (InspectorControls);
9776
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9777
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/margin.js
9778
 
9779
 
@@ -9784,6 +9848,7 @@ InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
9784
 
9785
 
9786
 
 
9787
  /**
9788
  * Internal dependencies
9789
  */
@@ -9791,6 +9856,7 @@ InspectorAdvancedControls.slotName = 'InspectorAdvancedControls';
9791
 
9792
 
9793
 
 
9794
  /**
9795
  * Determines if there is margin support.
9796
  *
@@ -9895,22 +9961,10 @@ function MarginEdit(props) {
9895
  });
9896
  };
9897
 
9898
- const onChangeShowVisualizer = next => {
9899
- const newStyle = { ...style,
9900
- visualizers: {
9901
- margin: next
9902
- }
9903
- };
9904
- setAttributes({
9905
- style: cleanEmptyObject(newStyle)
9906
- });
9907
- };
9908
-
9909
  return external_wp_element_namespaceObject.Platform.select({
9910
  web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
9911
  values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.margin,
9912
  onChange: onChange,
9913
- onChangeShowVisualizer: onChangeShowVisualizer,
9914
  label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
9915
  sides: sides,
9916
  units: units,
@@ -9920,6 +9974,64 @@ function MarginEdit(props) {
9920
  native: null
9921
  });
9922
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9923
 
9924
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/padding.js
9925
 
@@ -9931,6 +10043,7 @@ function MarginEdit(props) {
9931
 
9932
 
9933
 
 
9934
  /**
9935
  * Internal dependencies
9936
  */
@@ -9938,6 +10051,7 @@ function MarginEdit(props) {
9938
 
9939
 
9940
 
 
9941
  /**
9942
  * Determines if there is padding support.
9943
  *
@@ -10042,22 +10156,10 @@ function PaddingEdit(props) {
10042
  });
10043
  };
10044
 
10045
- const onChangeShowVisualizer = next => {
10046
- const newStyle = { ...style,
10047
- visualizers: {
10048
- padding: next
10049
- }
10050
- };
10051
- setAttributes({
10052
- style: cleanEmptyObject(newStyle)
10053
- });
10054
- };
10055
-
10056
  return external_wp_element_namespaceObject.Platform.select({
10057
  web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
10058
  values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.padding,
10059
  onChange: onChange,
10060
- onChangeShowVisualizer: onChangeShowVisualizer,
10061
  label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
10062
  sides: sides,
10063
  units: units,
@@ -10067,6 +10169,60 @@ function PaddingEdit(props) {
10067
  native: null
10068
  });
10069
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
10070
 
10071
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/dimensions.js
10072
 
@@ -10122,7 +10278,7 @@ function DimensionsPanel(props) {
10122
  };
10123
  };
10124
 
10125
- return (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
10126
  __experimentalGroup: "dimensions"
10127
  }, !isPaddingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
10128
  hasValue: () => hasPaddingValue(props),
@@ -10145,7 +10301,7 @@ function DimensionsPanel(props) {
10145
  resetAllFilter: createResetAllFilter('blockGap'),
10146
  isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.blockGap,
10147
  panelId: props.clientId
10148
- }, (0,external_wp_element_namespaceObject.createElement)(GapEdit, props)));
10149
  }
10150
  /**
10151
  * Determine whether there is dimensions related block support.
@@ -11008,6 +11164,36 @@ function Icon(_ref) {
11008
 
11009
  /* harmony default export */ var build_module_icon = (Icon);
11010
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11011
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/flow.js
11012
 
11013
 
@@ -11393,28 +11579,73 @@ function useAvailableAlignments() {
11393
  return enabledControls;
11394
  }
11395
 
11396
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-alignment-control/ui.js
 
11397
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11398
 
11399
 
11400
  /**
11401
- * External dependencies
11402
  */
11403
 
 
 
 
 
 
 
 
 
 
 
 
11404
  /**
11405
  * WordPress dependencies
11406
  */
11407
 
 
 
 
 
 
 
 
 
 
11408
 
11409
 
 
 
 
11410
 
 
 
 
 
 
 
 
11411
 
 
11412
  /**
11413
- * Internal dependencies
11414
  */
11415
 
11416
 
11417
- const ui_BLOCK_ALIGNMENTS_CONTROLS = {
11418
  none: {
11419
  icon: align_none,
11420
  title: (0,external_wp_i18n_namespaceObject._x)('None', 'Alignment option')
@@ -11440,11 +11671,32 @@ const ui_BLOCK_ALIGNMENTS_CONTROLS = {
11440
  title: (0,external_wp_i18n_namespaceObject.__)('Full width')
11441
  }
11442
  };
11443
- const ui_DEFAULT_CONTROL = 'none';
11444
- const ui_POPOVER_PROPS = {
11445
  isAlternate: true
11446
  };
11447
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11448
  function BlockAlignmentUI(_ref) {
11449
  let {
11450
  value,
@@ -11464,24 +11716,24 @@ function BlockAlignmentUI(_ref) {
11464
  onChange([value, 'none'].includes(align) ? undefined : align);
11465
  }
11466
 
11467
- const activeAlignmentControl = ui_BLOCK_ALIGNMENTS_CONTROLS[value];
11468
- const defaultAlignmentControl = ui_BLOCK_ALIGNMENTS_CONTROLS[ui_DEFAULT_CONTROL];
11469
  const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
11470
  const commonProps = {
11471
- popoverProps: ui_POPOVER_PROPS,
11472
  icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon,
11473
  label: (0,external_wp_i18n_namespaceObject.__)('Align'),
11474
  toggleProps: {
11475
  describedBy: (0,external_wp_i18n_namespaceObject.__)('Change alignment')
11476
  }
11477
  };
11478
- const extraProps = isToolbar || external_wp_element_namespaceObject.Platform.isNative ? {
11479
- isCollapsed: isToolbar ? isCollapsed : undefined,
11480
  controls: enabledControls.map(_ref2 => {
11481
  let {
11482
  name: controlName
11483
  } = _ref2;
11484
- return { ...ui_BLOCK_ALIGNMENTS_CONTROLS[controlName],
11485
  isActive: value === controlName || !value && controlName === 'none',
11486
  role: isCollapsed ? 'menuitemradio' : undefined,
11487
  onClick: () => onChangeAlignment(controlName)
@@ -11502,7 +11754,7 @@ function BlockAlignmentUI(_ref) {
11502
  const {
11503
  icon,
11504
  title
11505
- } = ui_BLOCK_ALIGNMENTS_CONTROLS[controlName]; // If no value is provided, mark as selected the `none` option.
11506
 
11507
  const isSelected = controlName === value || !value && controlName === 'none';
11508
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
@@ -12232,8 +12484,6 @@ function getCSSRules(style, options) {
12232
  return rules;
12233
  }
12234
 
12235
- ;// CONCATENATED MODULE: external ["wp","dom"]
12236
- var external_wp_dom_namespaceObject = window["wp"]["dom"];
12237
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-context/index.js
12238
 
12239
 
@@ -17251,11 +17501,9 @@ function useBlockClassNames(clientId) {
17251
  getBlockName,
17252
  getSettings,
17253
  hasSelectedInnerBlock,
17254
- isTyping,
17255
- __experimentalGetActiveBlockIdByBlockNames: getActiveBlockIdByBlockNames
17256
  } = select(store);
17257
  const {
17258
- __experimentalSpotlightEntityBlocks: spotlightEntityBlocks,
17259
  outlineMode
17260
  } = getSettings();
17261
  const isDragging = isBlockBeingDragged(clientId);
@@ -17264,7 +17512,6 @@ function useBlockClassNames(clientId) {
17264
  const checkDeep = true; // "ancestor" is the more appropriate label due to "deep" check.
17265
 
17266
  const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep);
17267
- const activeEntityBlockId = getActiveBlockIdByBlockNames(spotlightEntityBlocks);
17268
  return classnames_default()({
17269
  'is-selected': isSelected,
17270
  'is-highlighted': isBlockHighlighted(clientId),
@@ -17272,9 +17519,6 @@ function useBlockClassNames(clientId) {
17272
  'is-reusable': (0,external_wp_blocks_namespaceObject.isReusableBlock)((0,external_wp_blocks_namespaceObject.getBlockType)(name)),
17273
  'is-dragging': isDragging,
17274
  'has-child-selected': isAncestorOfSelectedBlock,
17275
- 'has-active-entity': activeEntityBlockId,
17276
- // Determine if there is an active entity area to spotlight.
17277
- 'is-active-entity': activeEntityBlockId === clientId,
17278
  'remove-outline': isSelected && outlineMode && isTyping()
17279
  });
17280
  }, [clientId]);
@@ -19524,7 +19768,8 @@ function useSelectionObserver() {
19524
  selectionChange
19525
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
19526
  const {
19527
- getBlockParents
 
19528
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
19529
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
19530
  const {
@@ -19534,23 +19779,63 @@ function useSelectionObserver() {
19534
  defaultView
19535
  } = ownerDocument;
19536
 
19537
- function onSelectionChange() {
19538
  const selection = defaultView.getSelection(); // If no selection is found, end multi selection and disable the
19539
  // contentEditable wrapper.
19540
 
19541
- if (!selection.rangeCount || selection.isCollapsed) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19542
  use_selection_observer_setContentEditableWrapper(node, false);
19543
  return;
19544
  }
19545
 
19546
- const clientId = getBlockClientId(extractSelectionStartNode(selection));
19547
- const endClientId = getBlockClientId(extractSelectionEndNode(selection));
19548
- const isSingularSelection = clientId === endClientId;
19549
 
19550
  if (isSingularSelection) {
19551
- selectBlock(clientId);
19552
  } else {
19553
- const startPath = [...getBlockParents(clientId), clientId];
19554
  const endPath = [...getBlockParents(endClientId), endClientId];
19555
  const depth = findDepth(startPath, endPath);
19556
  multiSelect(startPath[depth], endPath[depth]);
@@ -19598,12 +19883,10 @@ function useSelectionObserver() {
19598
 
19599
  function useClickSelection() {
19600
  const {
19601
- multiSelect,
19602
  selectBlock
19603
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
19604
  const {
19605
  isSelectionEnabled,
19606
- getBlockParents,
19607
  getBlockSelectionStart,
19608
  hasMultiSelection
19609
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
@@ -19639,7 +19922,7 @@ function useClickSelection() {
19639
  return () => {
19640
  node.removeEventListener('mousedown', onMouseDown);
19641
  };
19642
- }, [multiSelect, selectBlock, isSelectionEnabled, getBlockParents, getBlockSelectionStart, hasMultiSelection]);
19643
  }
19644
 
19645
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-input.js
@@ -19847,63 +20130,63 @@ const BLOCK_PREFIX = 'wp-block';
19847
  *
19848
  * Ideally, this hook should be removed in the future and styles should be added
19849
  * explicitly as editor styles.
19850
- *
19851
- * @param {Document} doc The document to append cloned stylesheets to.
19852
  */
19853
 
19854
- function styleSheetsCompat(doc) {
19855
- // Search the document for stylesheets targetting the editor canvas.
19856
- Array.from(document.styleSheets).forEach(styleSheet => {
19857
- try {
19858
- // May fail for external styles.
19859
- // eslint-disable-next-line no-unused-expressions
19860
- styleSheet.cssRules;
19861
- } catch (e) {
19862
- return;
19863
- }
 
19864
 
19865
- const {
19866
- ownerNode,
19867
- cssRules
19868
- } = styleSheet;
19869
 
19870
- if (!cssRules) {
19871
- return;
19872
- } // Generally, ignore inline styles. We add inline styles belonging to a
19873
- // stylesheet later, which may or may not match the selectors.
19874
 
19875
 
19876
- if (ownerNode.tagName !== 'LINK') {
19877
- return;
19878
- } // Don't try to add the reset styles, which were removed as a dependency
19879
- // from `edit-blocks` for the iframe since we don't need to reset admin
19880
- // styles.
19881
 
19882
 
19883
- if (ownerNode.id === 'wp-reset-editor-styles-css') {
19884
- return;
19885
- }
19886
 
19887
- const isMatch = Array.from(cssRules).find(_ref => {
19888
- let {
19889
- selectorText
19890
- } = _ref;
19891
- return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`));
19892
- });
19893
 
19894
- if (isMatch && !doc.getElementById(ownerNode.id)) {
19895
- // Display warning once we have a way to add style dependencies to the editor.
19896
- // See: https://github.com/WordPress/gutenberg/pull/37466.
19897
- doc.head.appendChild(ownerNode.cloneNode(true)); // Add inline styles belonging to the stylesheet.
19898
 
19899
- const inlineCssId = ownerNode.id.replace('-css', '-inline-css');
19900
- const inlineCssElement = document.getElementById(inlineCssId);
19901
 
19902
- if (inlineCssElement) {
19903
- doc.head.appendChild(inlineCssElement.cloneNode(true));
 
19904
  }
19905
- }
19906
- });
19907
  }
19908
  /**
19909
  * Bubbles some event types (keydown, keypress, and dragover) to parent document
@@ -20043,11 +20326,7 @@ function Iframe(_ref3, ref) {
20043
  });
20044
  }, []);
20045
  const bodyRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([contentRef, clearerRef, writingFlowRef]);
20046
- (0,external_wp_element_namespaceObject.useEffect)(() => {
20047
- if (iframeDocument) {
20048
- styleSheetsCompat(iframeDocument);
20049
- }
20050
- }, [iframeDocument]);
20051
  head = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("style", null, 'body{margin:0}'), styles.map(_ref4 => {
20052
  let {
20053
  tagName,
@@ -20085,7 +20364,12 @@ function Iframe(_ref3, ref) {
20085
  }, head), (0,external_wp_element_namespaceObject.createElement)("body", {
20086
  ref: bodyRef,
20087
  className: classnames_default()(BODY_CLASS_NAME, ...bodyClasses)
20088
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
 
 
 
 
 
20089
  document: iframeDocument
20090
  }, children))), iframeDocument.documentElement)), tabIndex >= 0 && after);
20091
  }
@@ -23917,7 +24201,8 @@ function QuickInserter(_ref) {
23917
  onSelect,
23918
  rootClientId,
23919
  clientId,
23920
- isAppender
 
23921
  } = _ref;
23922
  const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
23923
  const [destinationRootClientId, onInsertBlocks] = use_insertion_point({
@@ -23930,8 +24215,7 @@ function QuickInserter(_ref) {
23930
  const [patterns] = use_patterns_state(onInsertBlocks, destinationRootClientId);
23931
  const {
23932
  setInserterIsOpened,
23933
- insertionIndex,
23934
- prioritizePatterns
23935
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
23936
  const {
23937
  getSettings,
@@ -23943,10 +24227,9 @@ function QuickInserter(_ref) {
23943
  const blockCount = getBlockCount();
23944
  return {
23945
  setInserterIsOpened: settings.__experimentalSetIsInserterOpened,
23946
- prioritizePatterns: settings.__experimentalPreferPatternsOnRoot && !rootClientId && index > 0 && (index < blockCount || blockCount === 0),
23947
  insertionIndex: index === -1 ? blockCount : index
23948
  };
23949
- }, [clientId, rootClientId]);
23950
  const showPatterns = patterns.length && (!!filterValue || prioritizePatterns);
23951
  const showSearch = showPatterns && patterns.length > SEARCH_THRESHOLD || blockTypes.length > SEARCH_THRESHOLD;
23952
  (0,external_wp_element_namespaceObject.useEffect)(() => {
@@ -24038,13 +24321,16 @@ const defaultRenderToggle = _ref => {
24038
  isOpen,
24039
  blockTitle,
24040
  hasSingleBlockType,
24041
- toggleProps = {}
 
24042
  } = _ref;
24043
  let label;
24044
 
24045
  if (hasSingleBlockType) {
24046
  label = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block when there is only one
24047
  (0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle);
 
 
24048
  } else {
24049
  label = (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button');
24050
  }
@@ -24117,7 +24403,8 @@ class Inserter extends external_wp_element_namespaceObject.Component {
24117
  directInsertBlock,
24118
  toggleProps,
24119
  hasItems,
24120
- renderToggle = defaultRenderToggle
 
24121
  } = this.props;
24122
  return renderToggle({
24123
  onToggle,
@@ -24126,7 +24413,8 @@ class Inserter extends external_wp_element_namespaceObject.Component {
24126
  blockTitle,
24127
  hasSingleBlockType,
24128
  directInsertBlock,
24129
- toggleProps
 
24130
  });
24131
  }
24132
  /**
@@ -24151,7 +24439,8 @@ class Inserter extends external_wp_element_namespaceObject.Component {
24151
  showInserterHelpPanel,
24152
  // This prop is experimental to give some time for the quick inserter to mature
24153
  // Feel free to make them stable after a few releases.
24154
- __experimentalIsQuick: isQuick
 
24155
  } = this.props;
24156
 
24157
  if (isQuick) {
@@ -24161,7 +24450,8 @@ class Inserter extends external_wp_element_namespaceObject.Component {
24161
  },
24162
  rootClientId: rootClientId,
24163
  clientId: clientId,
24164
- isAppender: isAppender
 
24165
  });
24166
  }
24167
 
@@ -24218,7 +24508,10 @@ class Inserter extends external_wp_element_namespaceObject.Component {
24218
  getBlockRootClientId,
24219
  hasInserterItems,
24220
  __experimentalGetAllowedBlocks,
24221
- __experimentalGetDirectInsertBlock
 
 
 
24222
  } = select(store);
24223
  const {
24224
  getBlockVariations
@@ -24229,6 +24522,9 @@ class Inserter extends external_wp_element_namespaceObject.Component {
24229
 
24230
  const directInsertBlock = __experimentalGetDirectInsertBlock(rootClientId);
24231
 
 
 
 
24232
  const hasSingleBlockType = (0,external_lodash_namespaceObject.size)(allowedBlocks) === 1 && (0,external_lodash_namespaceObject.size)(getBlockVariations(allowedBlocks[0].name, 'inserter')) === 0;
24233
  let allowedBlockType = false;
24234
 
@@ -24242,7 +24538,8 @@ class Inserter extends external_wp_element_namespaceObject.Component {
24242
  blockTitle: allowedBlockType ? allowedBlockType.title : '',
24243
  allowedBlockType,
24244
  directInsertBlock,
24245
- rootClientId
 
24246
  };
24247
  }), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, _ref5) => {
24248
  let {
@@ -24684,47 +24981,6 @@ function BlockListAppender(_ref) {
24684
  };
24685
  })(BlockListAppender));
24686
 
24687
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/use-popover-scroll.js
24688
- /**
24689
- * WordPress dependencies
24690
- */
24691
-
24692
- /**
24693
- * Allow scrolling "through" popovers over the canvas. This is only called for
24694
- * as long as the pointer is over a popover. Do not use React events because it
24695
- * will bubble through portals.
24696
- *
24697
- * @param {Object} scrollableRef
24698
- */
24699
-
24700
- function usePopoverScroll(scrollableRef) {
24701
- return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
24702
- if (!scrollableRef) {
24703
- return;
24704
- }
24705
-
24706
- function onWheel(event) {
24707
- const {
24708
- deltaX,
24709
- deltaY
24710
- } = event;
24711
- scrollableRef.current.scrollBy(deltaX, deltaY);
24712
- } // Tell the browser that we do not call event.preventDefault
24713
- // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
24714
-
24715
-
24716
- const options = {
24717
- passive: true
24718
- };
24719
- node.addEventListener('wheel', onWheel, options);
24720
- return () => {
24721
- node.removeEventListener('wheel', onWheel, options);
24722
- };
24723
- }, [scrollableRef]);
24724
- }
24725
-
24726
- /* harmony default export */ var use_popover_scroll = (usePopoverScroll);
24727
-
24728
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/inbetween.js
24729
 
24730
 
@@ -29483,74 +29739,6 @@ function BlockContextualToolbar(_ref) {
29483
 
29484
  /* harmony default export */ var block_contextual_toolbar = (BlockContextualToolbar);
29485
 
29486
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/index.js
29487
-
29488
-
29489
-
29490
- /**
29491
- * External dependencies
29492
- */
29493
-
29494
- /**
29495
- * WordPress dependencies
29496
- */
29497
-
29498
-
29499
-
29500
- /**
29501
- * Internal dependencies
29502
- */
29503
-
29504
-
29505
-
29506
- function BlockPopover(_ref) {
29507
- let {
29508
- clientId,
29509
- bottomClientId,
29510
- children,
29511
- __unstablePopoverSlot,
29512
- __unstableContentRef,
29513
- ...props
29514
- } = _ref;
29515
- const selectedElement = useBlockElement(clientId);
29516
- const lastSelectedElement = useBlockElement(bottomClientId !== null && bottomClientId !== void 0 ? bottomClientId : clientId);
29517
- const popoverScrollRef = use_popover_scroll(__unstableContentRef);
29518
-
29519
- if (!selectedElement || bottomClientId && !lastSelectedElement) {
29520
- return null;
29521
- }
29522
-
29523
- const anchorRef = {
29524
- top: selectedElement,
29525
- bottom: lastSelectedElement
29526
- };
29527
- const {
29528
- ownerDocument
29529
- } = selectedElement;
29530
- const stickyBoundaryElement = ownerDocument.defaultView.frameElement || (0,external_wp_dom_namespaceObject.getScrollContainer)(selectedElement) || ownerDocument.body;
29531
- return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
29532
- ref: popoverScrollRef,
29533
- noArrow: true,
29534
- animate: false,
29535
- position: "top right left",
29536
- focusOnMount: false,
29537
- anchorRef: anchorRef,
29538
- __unstableStickyBoundaryElement: stickyBoundaryElement // Render in the old slot if needed for backward compatibility,
29539
- // otherwise render in place (not in the the default popover slot).
29540
- ,
29541
- __unstableSlotName: __unstablePopoverSlot || null,
29542
- __unstableBoundaryParent: true // Observe movement for block animations (especially horizontal).
29543
- ,
29544
- __unstableObserveElement: selectedElement,
29545
- shouldAnchorIncludePadding: true // Used to safeguard sticky position behavior against cases where it would permanently
29546
- // obscure specific sections of a block.
29547
- ,
29548
- __unstableEditorCanvasWrapper: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current
29549
- }, props, {
29550
- className: classnames_default()('block-editor-block-popover', props.className)
29551
- }), children);
29552
- }
29553
-
29554
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/selected-block-popover.js
29555
 
29556
 
@@ -29912,9 +30100,6 @@ const default_block_appender_DefaultBlockAppender = _ref => {
29912
  };
29913
  })])(default_block_appender_DefaultBlockAppender));
29914
 
29915
- ;// CONCATENATED MODULE: external ["wp","isShallowEqual"]
29916
- var external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
29917
- var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
29918
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inner-blocks/use-nested-settings-update.js
29919
  /**
29920
  * WordPress dependencies
@@ -35298,6 +35483,36 @@ const withElementsStyles = (0,external_wp_compose_namespaceObject.createHigherOr
35298
  (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/style/with-block-controls', withBlockControls);
35299
  (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/with-elements-styles', withElementsStyles);
35300
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
35301
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/filter.js
35302
 
35303
 
@@ -36195,6 +36410,7 @@ function useCachedTruthy(value) {
36195
 
36196
 
36197
 
 
36198
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/with-colors.js
36199
 
36200
 
@@ -36623,7 +36839,7 @@ const DEFAULT_ALIGNMENT_CONTROLS = [{
36623
  title: (0,external_wp_i18n_namespaceObject.__)('Align text right'),
36624
  align: 'right'
36625
  }];
36626
- const alignment_control_ui_POPOVER_PROPS = {
36627
  position: 'bottom right',
36628
  isAlternate: true
36629
  };
@@ -36660,7 +36876,7 @@ function AlignmentUI(_ref) {
36660
  toggleProps: {
36661
  describedBy
36662
  },
36663
- popoverProps: alignment_control_ui_POPOVER_PROPS,
36664
  controls: alignmentControls.map(control => {
36665
  const {
36666
  align
@@ -37321,6 +37537,7 @@ function BlockContentOverlay(_ref) {
37321
 
37322
 
37323
 
 
37324
  const ColorSelectorSVGIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
37325
  xmlns: "https://www.w3.org/2000/svg",
37326
  viewBox: "0 0 20 20"
@@ -37394,6 +37611,11 @@ const BlockColorsStyleSelector = _ref4 => {
37394
  children,
37395
  ...other
37396
  } = _ref4;
 
 
 
 
 
37397
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
37398
  position: "bottom right",
37399
  className: "block-library-colors-selector",
@@ -37680,10 +37902,7 @@ const ListViewBlockContents = (0,external_wp_element_namespaceObject.forwardRef)
37680
  * WordPress dependencies
37681
  */
37682
 
37683
- const ListViewContext = (0,external_wp_element_namespaceObject.createContext)({
37684
- __experimentalFeatures: false,
37685
- __experimentalPersistentListViewFeatures: false
37686
- });
37687
  const useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(ListViewContext);
37688
 
37689
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/utils.js
@@ -37753,6 +37972,7 @@ function getCommonDepthClientIds(startId, endId, startParents, endParents) {
37753
 
37754
 
37755
 
 
37756
  /**
37757
  * Internal dependencies
37758
  */
@@ -37795,6 +38015,11 @@ function ListViewBlock(_ref) {
37795
  toggleBlockHighlight
37796
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
37797
  const blockInformation = useBlockDisplayInformation(clientId);
 
 
 
 
 
37798
  const {
37799
  isLocked
37800
  } = useBlockLock(clientId);
@@ -37813,9 +38038,6 @@ function ListViewBlock(_ref) {
37813
  const settingsAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block.
37814
  (0,external_wp_i18n_namespaceObject.__)('Options for %s block'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Options');
37815
  const {
37816
- __experimentalFeatures: withExperimentalFeatures,
37817
- __experimentalPersistentListViewFeatures: withExperimentalPersistentListViewFeatures,
37818
- __experimentalHideContainerBlockActions: hideContainerBlockActions,
37819
  isTreeGridMounted,
37820
  expand,
37821
  collapse
@@ -37832,19 +38054,18 @@ function ListViewBlock(_ref) {
37832
  // try to steal the focus from the editor canvas.
37833
 
37834
  (0,external_wp_element_namespaceObject.useEffect)(() => {
37835
- if (withExperimentalPersistentListViewFeatures && !isTreeGridMounted && isSelected) {
37836
  cellRef.current.focus();
37837
  }
37838
  }, []);
37839
- const highlightBlock = withExperimentalPersistentListViewFeatures ? toggleBlockHighlight : () => {};
37840
  const onMouseEnter = (0,external_wp_element_namespaceObject.useCallback)(() => {
37841
  setIsHovered(true);
37842
- highlightBlock(clientId, true);
37843
- }, [clientId, setIsHovered, highlightBlock]);
37844
  const onMouseLeave = (0,external_wp_element_namespaceObject.useCallback)(() => {
37845
  setIsHovered(false);
37846
- highlightBlock(clientId, false);
37847
- }, [clientId, setIsHovered, highlightBlock]);
37848
  const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(event => {
37849
  selectBlock(event, clientId);
37850
  event.preventDefault();
@@ -37863,14 +38084,11 @@ function ListViewBlock(_ref) {
37863
  expand(clientId);
37864
  }
37865
  }, [clientId, expand, collapse, isExpanded]);
37866
- const showBlockActions = withExperimentalFeatures && ( // hide actions for blocks like core/widget-areas
37867
- !hideContainerBlockActions || hideContainerBlockActions && level > 1);
37868
- const hideBlockActions = withExperimentalFeatures && !showBlockActions;
37869
  let colSpan;
37870
 
37871
  if (hasRenderedMovers) {
37872
  colSpan = 2;
37873
- } else if (hideBlockActions) {
37874
  colSpan = 3;
37875
  }
37876
 
@@ -37878,9 +38096,9 @@ function ListViewBlock(_ref) {
37878
  'is-selected': isSelected,
37879
  'is-first-selected': isFirstSelectedBlock,
37880
  'is-last-selected': isLastSelectedBlock,
37881
- 'is-branch-selected': withExperimentalPersistentListViewFeatures && isBranchSelected,
37882
  'is-dragging': isDragged,
37883
- 'has-single-cell': hideBlockActions
37884
  }); // Only include all selected blocks if the currently clicked on block
37885
  // is one of the selected blocks. This ensures that if a user attempts
37886
  // to alter a block that isn't part of the selection, they're still able
@@ -38066,19 +38284,17 @@ function ListViewBranch(props) {
38066
  blocks,
38067
  selectBlock,
38068
  showBlockMovers,
38069
- showNestedBlocks,
38070
  selectedClientIds,
38071
  level = 1,
38072
  path = '',
38073
  isBranchSelected = false,
38074
  listPosition = 0,
38075
  fixedListWindow,
38076
- expandNested
38077
  } = props;
38078
  const {
38079
  expandedState,
38080
- draggedClientIds,
38081
- __experimentalPersistentListViewFeatures
38082
  } = useListViewContext();
38083
  const filteredBlocks = (0,external_lodash_namespaceObject.compact)(blocks);
38084
  const blockCount = filteredBlocks.length;
@@ -38092,18 +38308,17 @@ function ListViewBranch(props) {
38092
  } = block;
38093
 
38094
  if (index > 0) {
38095
- nextPosition += countBlocks(filteredBlocks[index - 1], expandedState, draggedClientIds, expandNested);
38096
  }
38097
 
38098
- const usesWindowing = __experimentalPersistentListViewFeatures;
38099
  const {
38100
  itemInView
38101
  } = fixedListWindow;
38102
- const blockInView = !usesWindowing || itemInView(nextPosition);
38103
  const position = index + 1;
38104
  const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`;
38105
- const hasNestedBlocks = showNestedBlocks && !!innerBlocks && !!innerBlocks.length;
38106
- const isExpanded = hasNestedBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client : expandNested : undefined;
38107
  const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId));
38108
  const showBlock = isDragged || blockInView; // Make updates to the selected or dragged blocks synchronous,
38109
  // but asynchronous for any other block.
@@ -38125,23 +38340,22 @@ function ListViewBranch(props) {
38125
  siblingBlockCount: blockCount,
38126
  showBlockMovers: showBlockMovers,
38127
  path: updatedPath,
38128
- isExpanded: isExpanded,
38129
  listPosition: nextPosition,
38130
  selectedClientIds: selectedClientIds
38131
  }), !showBlock && (0,external_wp_element_namespaceObject.createElement)("tr", null, (0,external_wp_element_namespaceObject.createElement)("td", {
38132
  className: "block-editor-list-view-placeholder"
38133
- })), hasNestedBlocks && isExpanded && !isDragged && (0,external_wp_element_namespaceObject.createElement)(ListViewBranch, {
38134
  blocks: innerBlocks,
38135
  selectBlock: selectBlock,
38136
  showBlockMovers: showBlockMovers,
38137
- showNestedBlocks: showNestedBlocks,
38138
  level: level + 1,
38139
  path: updatedPath,
38140
  listPosition: nextPosition + 1,
38141
  fixedListWindow: fixedListWindow,
38142
  isBranchSelected: isSelectedBranch,
38143
  selectedClientIds: selectedClientIds,
38144
- expandNested: expandNested
38145
  }));
38146
  }));
38147
  }
@@ -38705,7 +38919,6 @@ function useListViewExpandSelectedItem(_ref) {
38705
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/index.js
38706
 
38707
 
38708
-
38709
  /**
38710
  * WordPress dependencies
38711
  */
@@ -38741,33 +38954,22 @@ const expanded = (state, action) => {
38741
 
38742
  const BLOCK_LIST_ITEM_HEIGHT = 36;
38743
  /**
38744
- * Wrap `ListViewRows` with `TreeGrid`. ListViewRows is a
38745
- * recursive component (it renders itself), so this ensures TreeGrid is only
38746
- * present at the very top of the navigation grid.
38747
  *
38748
- * @param {Object} props Components props.
38749
- * @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy.
38750
- * @param {boolean} props.showNestedBlocks Flag to enable displaying nested blocks.
38751
- * @param {boolean} props.showBlockMovers Flag to enable block movers
38752
- * @param {boolean} props.__experimentalFeatures Flag to enable experimental features.
38753
- * @param {boolean} props.__experimentalPersistentListViewFeatures Flag to enable features for the Persistent List View experiment.
38754
- * @param {boolean} props.__experimentalHideContainerBlockActions Flag to hide actions of top level blocks (like core/widget-area)
38755
- * @param {string} props.id Unique identifier for the root list element (primarily for a11y purposes).
38756
- * @param {boolean} props.expandNested Flag to determine whether nested levels are expanded by default.
38757
- * @param {Object} ref Forwarded ref
38758
  */
38759
 
38760
  function ListView(_ref, ref) {
38761
  let {
38762
- blocks,
38763
- __experimentalFeatures,
38764
- __experimentalPersistentListViewFeatures,
38765
- __experimentalHideContainerBlockActions,
38766
- showNestedBlocks,
38767
- showBlockMovers,
38768
  id,
38769
- expandNested = false,
38770
- ...props
 
38771
  } = _ref;
38772
  const {
38773
  clientIdsTree,
@@ -38814,7 +39016,7 @@ function ListView(_ref, ref) {
38814
  // See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.
38815
 
38816
  const [fixedListWindow] = (0,external_wp_compose_namespaceObject.__experimentalUseFixedWindowList)(elementRef, BLOCK_LIST_ITEM_HEIGHT, visibleBlockCount, {
38817
- useWindowing: __experimentalPersistentListViewFeatures,
38818
  windowOverscan: 40
38819
  });
38820
  const expand = (0,external_wp_element_namespaceObject.useCallback)(clientId => {
@@ -38855,15 +39057,12 @@ function ListView(_ref, ref) {
38855
  }
38856
  }, [updateBlockSelection]);
38857
  const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
38858
- __experimentalFeatures,
38859
- __experimentalPersistentListViewFeatures,
38860
- __experimentalHideContainerBlockActions,
38861
  isTreeGridMounted: isMounted.current,
38862
  draggedClientIds,
38863
  expandedState,
38864
  expand,
38865
  collapse
38866
- }), [__experimentalFeatures, __experimentalPersistentListViewFeatures, __experimentalHideContainerBlockActions, isMounted.current, draggedClientIds, expandedState, expand, collapse]);
38867
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, {
38868
  value: true
38869
  }, (0,external_wp_element_namespaceObject.createElement)(ListViewDropIndicator, {
@@ -38879,15 +39078,14 @@ function ListView(_ref, ref) {
38879
  onFocusRow: focusRow
38880
  }, (0,external_wp_element_namespaceObject.createElement)(ListViewContext.Provider, {
38881
  value: contextValue
38882
- }, (0,external_wp_element_namespaceObject.createElement)(branch, _extends({
38883
  blocks: clientIdsTree,
38884
  selectBlock: selectEditorBlock,
38885
- showNestedBlocks: showNestedBlocks,
38886
  showBlockMovers: showBlockMovers,
38887
  fixedListWindow: fixedListWindow,
38888
  selectedClientIds: selectedClientIds,
38889
- expandNested: expandNested
38890
- }, props)))));
38891
  }
38892
 
38893
  /* harmony default export */ var components_list_view = ((0,external_wp_element_namespaceObject.forwardRef)(ListView));
@@ -38900,6 +39098,11 @@ function ListView(_ref, ref) {
38900
  * WordPress dependencies
38901
  */
38902
 
 
 
 
 
 
38903
 
38904
 
38905
 
@@ -38936,9 +39139,12 @@ function BlockNavigationDropdownToggle(_ref) {
38936
  function BlockNavigationDropdown(_ref2, ref) {
38937
  let {
38938
  isDisabled,
38939
- __experimentalFeatures,
38940
  ...props
38941
  } = _ref2;
 
 
 
 
38942
  const hasBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(store).getBlockCount(), []);
38943
  const isEnabled = hasBlocks && !isDisabled;
38944
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
@@ -38960,10 +39166,7 @@ function BlockNavigationDropdown(_ref2, ref) {
38960
  className: "block-editor-block-navigation__container"
38961
  }, (0,external_wp_element_namespaceObject.createElement)("p", {
38962
  className: "block-editor-block-navigation__label"
38963
- }, (0,external_wp_i18n_namespaceObject.__)('List view')), (0,external_wp_element_namespaceObject.createElement)(components_list_view, {
38964
- showNestedBlocks: true,
38965
- __experimentalFeatures: __experimentalFeatures
38966
- }))
38967
  });
38968
  }
38969
 
@@ -39693,112 +39896,6 @@ function __experimentalBlockVariationTransforms(_ref4) {
39693
 
39694
  /* harmony default export */ var block_variation_transforms = (__experimentalBlockVariationTransforms);
39695
 
39696
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/line-solid.js
39697
-
39698
-
39699
- /**
39700
- * WordPress dependencies
39701
- */
39702
-
39703
- const lineSolid = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
39704
- xmlns: "http://www.w3.org/2000/svg",
39705
- width: "24",
39706
- height: "24",
39707
- fill: "none"
39708
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
39709
- d: "M5 11.25h14v1.5H5z"
39710
- }));
39711
- /* harmony default export */ var line_solid = (lineSolid);
39712
-
39713
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/line-dashed.js
39714
-
39715
-
39716
- /**
39717
- * WordPress dependencies
39718
- */
39719
-
39720
- const lineDashed = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
39721
- xmlns: "http://www.w3.org/2000/svg",
39722
- width: "24",
39723
- height: "24",
39724
- fill: "none"
39725
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
39726
- fillRule: "evenodd",
39727
- d: "M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",
39728
- clipRule: "evenodd"
39729
- }));
39730
- /* harmony default export */ var line_dashed = (lineDashed);
39731
-
39732
- ;// CONCATENATED MODULE: ./packages/icons/build-module/library/line-dotted.js
39733
-
39734
-
39735
- /**
39736
- * WordPress dependencies
39737
- */
39738
-
39739
- const lineDotted = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
39740
- xmlns: "http://www.w3.org/2000/svg",
39741
- width: "24",
39742
- height: "24",
39743
- fill: "none"
39744
- }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
39745
- fillRule: "evenodd",
39746
- d: "M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",
39747
- clipRule: "evenodd"
39748
- }));
39749
- /* harmony default export */ var line_dotted = (lineDotted);
39750
-
39751
- ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/border-style-control/index.js
39752
-
39753
-
39754
- /**
39755
- * WordPress dependencies
39756
- */
39757
-
39758
-
39759
-
39760
- const BORDER_STYLES = [{
39761
- label: (0,external_wp_i18n_namespaceObject.__)('Solid'),
39762
- icon: line_solid,
39763
- value: 'solid'
39764
- }, {
39765
- label: (0,external_wp_i18n_namespaceObject.__)('Dashed'),
39766
- icon: line_dashed,
39767
- value: 'dashed'
39768
- }, {
39769
- label: (0,external_wp_i18n_namespaceObject.__)('Dotted'),
39770
- icon: line_dotted,
39771
- value: 'dotted'
39772
- }];
39773
- /**
39774
- * Control to display border style options.
39775
- *
39776
- * @param {Object} props Component props.
39777
- * @param {Function} props.onChange Handler for changing border style selection.
39778
- * @param {string} props.value Currently selected border style value.
39779
- *
39780
- * @return {WPElement} Custom border style segmented control.
39781
- */
39782
-
39783
- function BorderStyleControl(_ref) {
39784
- let {
39785
- onChange,
39786
- value
39787
- } = _ref;
39788
- return (0,external_wp_element_namespaceObject.createElement)("fieldset", {
39789
- className: "components-border-style-control"
39790
- }, (0,external_wp_element_namespaceObject.createElement)("legend", null, (0,external_wp_i18n_namespaceObject.__)('Style')), (0,external_wp_element_namespaceObject.createElement)("div", {
39791
- className: "components-border-style-control__buttons"
39792
- }, BORDER_STYLES.map(borderStyle => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Button, {
39793
- key: borderStyle.value,
39794
- icon: borderStyle.icon,
39795
- isSmall: true,
39796
- isPressed: borderStyle.value === value,
39797
- onClick: () => onChange(borderStyle.value === value ? undefined : borderStyle.value),
39798
- "aria-label": borderStyle.label
39799
- }))));
39800
- }
39801
-
39802
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/color-palette/with-color-context.js
39803
 
39804
 
@@ -41168,7 +41265,7 @@ function (_super) {
41168
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/image-editor/constants.js
41169
  const constants_MIN_ZOOM = 100;
41170
  const constants_MAX_ZOOM = 300;
41171
- const constants_POPOVER_PROPS = {
41172
  position: 'bottom right',
41173
  isAlternate: true
41174
  };
@@ -41529,7 +41626,7 @@ function ZoomDropdown() {
41529
  } = useImageEditingContext();
41530
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
41531
  contentClassName: "wp-block-image__zoom",
41532
- popoverProps: constants_POPOVER_PROPS,
41533
  renderToggle: _ref => {
41534
  let {
41535
  isOpen,
@@ -41625,7 +41722,7 @@ function AspectRatioDropdown(_ref3) {
41625
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
41626
  icon: aspect_ratio,
41627
  label: (0,external_wp_i18n_namespaceObject.__)('Aspect Ratio'),
41628
- popoverProps: constants_POPOVER_PROPS,
41629
  toggleProps: toggleProps,
41630
  className: "wp-block-image__aspect-ratio"
41631
  }, _ref4 => {
@@ -42380,7 +42477,7 @@ class URLInput extends external_wp_element_namespaceObject.Component {
42380
 
42381
  renderControl() {
42382
  const {
42383
- label,
42384
  className,
42385
  isFullWidth,
42386
  instanceId,
@@ -42395,14 +42492,17 @@ class URLInput extends external_wp_element_namespaceObject.Component {
42395
  suggestionsListboxId,
42396
  suggestionOptionIdPrefix
42397
  } = this.state;
 
42398
  const controlProps = {
42399
- id: `url-input-control-${instanceId}`,
 
42400
  label,
42401
  className: classnames_default()('block-editor-url-input', className, {
42402
  'is-full-width': isFullWidth
42403
  })
42404
  };
42405
  const inputProps = {
 
42406
  value,
42407
  required: true,
42408
  className: 'block-editor-url-input__input',
@@ -42412,7 +42512,8 @@ class URLInput extends external_wp_element_namespaceObject.Component {
42412
  placeholder,
42413
  onKeyDown: this.onKeyDown,
42414
  role: 'combobox',
42415
- 'aria-label': (0,external_wp_i18n_namespaceObject.__)('URL'),
 
42416
  'aria-expanded': showSuggestions,
42417
  'aria-autocomplete': 'list',
42418
  'aria-owns': suggestionsListboxId,
@@ -48401,7 +48502,6 @@ function useNoRecursiveRenders(uniqueId) {
48401
 
48402
 
48403
 
48404
-
48405
 
48406
 
48407
 
2211
  "__experimentalBlockVariationPicker": function() { return /* reexport */ block_variation_picker; },
2212
  "__experimentalBlockVariationTransforms": function() { return /* reexport */ block_variation_transforms; },
2213
  "__experimentalBorderRadiusControl": function() { return /* reexport */ BorderRadiusControl; },
 
2214
  "__experimentalColorGradientControl": function() { return /* reexport */ control; },
2215
  "__experimentalColorGradientSettingsDropdown": function() { return /* reexport */ ColorGradientSettingsDropdown; },
2216
  "__experimentalDateFormatPicker": function() { return /* reexport */ DateFormatPicker; },
2671
  __mobileEnablePageTemplates: false,
2672
  __experimentalBlockPatterns: [],
2673
  __experimentalBlockPatternCategories: [],
 
2674
  __unstableGalleryWithImageBlocks: false,
2675
  generateAnchors: false,
2676
  // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
6651
  *
6652
  * Items are returned ordered descendingly by their 'frecency'.
6653
  *
6654
+ * @param {Object} state Editor state.
6655
+ * @param {Object|Object[]} blocks Block object or array objects.
6656
+ * @param {?string} rootClientId Optional root client ID of block list.
6657
  *
6658
  * @return {WPEditorTransformItem[]} Items that appear in inserter.
6659
  *
6660
  * @typedef {Object} WPEditorTransformItem
6661
+ * @property {string} id Unique identifier for the item.
6662
+ * @property {string} name The type of block to create.
6663
+ * @property {string} title Title of the item, as it appears in the inserter.
6664
+ * @property {string} icon Dashicon for the item, as it appears in the inserter.
6665
+ * @property {boolean} isDisabled Whether or not the user should be prevented from inserting
6666
+ * this item.
6667
+ * @property {number} frecency Heuristic that combines frequency and recency.
6668
  */
6669
 
6670
  const getBlockTransformItems = rememo(function (state, blocks) {
6671
  var _itemsByName$sourceBl;
6672
 
6673
  let rootClientId = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
6674
+ const normalizedBlocks = (0,external_lodash_namespaceObject.castArray)(blocks);
6675
+ const [sourceBlock] = normalizedBlocks;
6676
  const buildBlockTypeTransformItem = buildBlockTypeItem(state, {
6677
  buildScope: 'transform'
6678
  });
6690
  isDisabled: false,
6691
  name: '*',
6692
  title: (0,external_wp_i18n_namespaceObject.__)('Unwrap'),
6693
+ icon: (_itemsByName$sourceBl = itemsByName[sourceBlock === null || sourceBlock === void 0 ? void 0 : sourceBlock.name]) === null || _itemsByName$sourceBl === void 0 ? void 0 : _itemsByName$sourceBl.icon
6694
  };
6695
+ const possibleTransforms = (0,external_wp_blocks_namespaceObject.getPossibleBlockTransformations)(normalizedBlocks).reduce((accumulator, block) => {
6696
  if (block === '*') {
6697
  accumulator.push(itemsByName['*']);
6698
  } else if (itemsByName[block === null || block === void 0 ? void 0 : block.name]) {
8956
 
8957
  /* harmony default export */ var block_controls = (BlockControls);
8958
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8959
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/justify-left.js
8960
 
8961
 
9279
  return prefixedFlags[path] || path;
9280
  };
9281
  /**
9282
+ * Hook that retrieves the given setting for the block instance in use.
9283
+ *
9284
+ * It looks up the settings first in the block instance hierarchy.
9285
+ * If none is found, it'll look it up in the block editor store.
9286
  *
9287
  * @param {string} path The path to the setting.
9288
  * @return {any} Returns the value defined for the setting.
9295
 
9296
  function useSetting(path) {
9297
  const {
9298
+ name: blockName,
9299
+ clientId
9300
  } = useBlockEditContext();
9301
  const setting = (0,external_wp_data_namespaceObject.useSelect)(select => {
 
 
9302
  if (blockedPaths.includes(path)) {
9303
  // eslint-disable-next-line no-console
9304
  console.warn('Top level useSetting paths are disabled. Please use a subpath to query the information needed.');
9305
  return undefined;
9306
  }
9307
 
9308
+ let result;
9309
+ const normalizedPath = removeCustomPrefixes(path); // 1. Take settings from the block instance or its ancestors.
9310
+
9311
+ const candidates = [...select(store).getBlockParents(clientId), clientId // The current block is added last, so it overwrites any ancestor.
9312
+ ];
9313
+ candidates.forEach(candidateClientId => {
9314
+ const candidateBlockName = select(store).getBlockName(candidateClientId);
9315
+
9316
+ if ((0,external_wp_blocks_namespaceObject.hasBlockSupport)(candidateBlockName, '__experimentalSettings', false)) {
9317
+ var _get;
9318
+
9319
+ const candidateAtts = select(store).getBlockAttributes(candidateClientId);
9320
+ const candidateResult = (_get = (0,external_lodash_namespaceObject.get)(candidateAtts, `settings.blocks.${blockName}.${normalizedPath}`)) !== null && _get !== void 0 ? _get : (0,external_lodash_namespaceObject.get)(candidateAtts, `settings.${normalizedPath}`);
9321
+
9322
+ if (candidateResult !== undefined) {
9323
+ result = candidateResult;
9324
+ }
9325
+ }
9326
+ }); // 2. Fall back to the settings from the block editor store (__experimentalFeatures).
9327
+
9328
+ const settings = select(store).getSettings();
9329
+
9330
+ if (result === undefined) {
9331
+ var _get2;
9332
 
9333
+ const defaultsPath = `__experimentalFeatures.${normalizedPath}`;
9334
+ const blockPath = `__experimentalFeatures.blocks.${blockName}.${normalizedPath}`;
9335
+ result = (_get2 = (0,external_lodash_namespaceObject.get)(settings, blockPath)) !== null && _get2 !== void 0 ? _get2 : (0,external_lodash_namespaceObject.get)(settings, defaultsPath);
9336
+ } // Return if the setting was found in either the block instance or the store.
9337
 
9338
+
9339
+ if (result !== undefined) {
9340
  if (external_wp_blocks_namespaceObject.__EXPERIMENTAL_PATHS_WITH_MERGE[normalizedPath]) {
9341
+ var _ref, _result$custom;
9342
 
9343
+ return (_ref = (_result$custom = result.custom) !== null && _result$custom !== void 0 ? _result$custom : result.theme) !== null && _ref !== void 0 ? _ref : result.default;
9344
  }
9345
 
9346
+ return result;
9347
+ } // 3. Otherwise, use deprecated settings.
9348
 
9349
 
9350
  const deprecatedSettingsValue = deprecatedFlags[normalizedPath] ? deprecatedFlags[normalizedPath](settings) : undefined;
9351
 
9352
  if (deprecatedSettingsValue !== undefined) {
9353
  return deprecatedSettingsValue;
9354
+ } // 4. Fallback for typography.dropCap:
9355
  // This is only necessary to support typography.dropCap.
9356
  // when __experimentalFeatures are not present (core without plugin).
9357
  // To remove when __experimentalFeatures are ported to core.
9358
 
9359
 
9360
  return normalizedPath === 'typography.dropCap' ? true : undefined;
9361
+ }, [blockName, clientId, path]);
9362
  return setting;
9363
  }
9364
 
9708
 
9709
  /* harmony default export */ var inspector_controls = (InspectorControls);
9710
 
9711
+ ;// CONCATENATED MODULE: external ["wp","isShallowEqual"]
9712
+ var external_wp_isShallowEqual_namespaceObject = window["wp"]["isShallowEqual"];
9713
+ var external_wp_isShallowEqual_default = /*#__PURE__*/__webpack_require__.n(external_wp_isShallowEqual_namespaceObject);
9714
+ ;// CONCATENATED MODULE: external ["wp","dom"]
9715
+ var external_wp_dom_namespaceObject = window["wp"]["dom"];
9716
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/use-popover-scroll.js
9717
+ /**
9718
+ * WordPress dependencies
9719
+ */
9720
+
9721
+ /**
9722
+ * Allow scrolling "through" popovers over the canvas. This is only called for
9723
+ * as long as the pointer is over a popover. Do not use React events because it
9724
+ * will bubble through portals.
9725
+ *
9726
+ * @param {Object} scrollableRef
9727
+ */
9728
+
9729
+ function usePopoverScroll(scrollableRef) {
9730
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
9731
+ if (!scrollableRef) {
9732
+ return;
9733
+ }
9734
+
9735
+ function onWheel(event) {
9736
+ const {
9737
+ deltaX,
9738
+ deltaY
9739
+ } = event;
9740
+ scrollableRef.current.scrollBy(deltaX, deltaY);
9741
+ } // Tell the browser that we do not call event.preventDefault
9742
+ // See https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#improving_scrolling_performance_with_passive_listeners
9743
+
9744
+
9745
+ const options = {
9746
+ passive: true
9747
+ };
9748
+ node.addEventListener('wheel', onWheel, options);
9749
+ return () => {
9750
+ node.removeEventListener('wheel', onWheel, options);
9751
+ };
9752
+ }, [scrollableRef]);
9753
+ }
9754
+
9755
+ /* harmony default export */ var use_popover_scroll = (usePopoverScroll);
9756
+
9757
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/index.js
9758
+
9759
+
9760
+
9761
+ /**
9762
+ * External dependencies
9763
+ */
9764
+
9765
+ /**
9766
+ * WordPress dependencies
9767
+ */
9768
+
9769
+
9770
+
9771
+
9772
+ /**
9773
+ * Internal dependencies
9774
+ */
9775
+
9776
+
9777
+
9778
+ function BlockPopover(_ref) {
9779
+ let {
9780
+ clientId,
9781
+ bottomClientId,
9782
+ children,
9783
+ __unstableRefreshSize,
9784
+ __unstableCoverTarget = false,
9785
+ __unstablePopoverSlot,
9786
+ __unstableContentRef,
9787
+ ...props
9788
+ } = _ref;
9789
+ const selectedElement = useBlockElement(clientId);
9790
+ const lastSelectedElement = useBlockElement(bottomClientId !== null && bottomClientId !== void 0 ? bottomClientId : clientId);
9791
+ const popoverScrollRef = use_popover_scroll(__unstableContentRef);
9792
+ const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
9793
+ if (!selectedElement || lastSelectedElement !== selectedElement) {
9794
+ return {};
9795
+ }
9796
+
9797
+ return {
9798
+ position: 'absolute',
9799
+ width: selectedElement.offsetWidth,
9800
+ height: selectedElement.offsetHeight
9801
+ };
9802
+ }, [selectedElement, lastSelectedElement, __unstableRefreshSize]);
9803
+
9804
+ if (!selectedElement || bottomClientId && !lastSelectedElement) {
9805
+ return null;
9806
+ }
9807
+
9808
+ const anchorRef = {
9809
+ top: selectedElement,
9810
+ bottom: lastSelectedElement
9811
+ };
9812
+ const {
9813
+ ownerDocument
9814
+ } = selectedElement;
9815
+ const stickyBoundaryElement = ownerDocument.defaultView.frameElement || (0,external_wp_dom_namespaceObject.getScrollContainer)(selectedElement) || ownerDocument.body;
9816
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Popover, _extends({
9817
+ ref: popoverScrollRef,
9818
+ noArrow: true,
9819
+ animate: false,
9820
+ position: "top right left",
9821
+ focusOnMount: false,
9822
+ anchorRef: anchorRef,
9823
+ __unstableStickyBoundaryElement: __unstableCoverTarget ? undefined : stickyBoundaryElement // Render in the old slot if needed for backward compatibility,
9824
+ // otherwise render in place (not in the the default popover slot).
9825
+ ,
9826
+ __unstableSlotName: __unstablePopoverSlot || null,
9827
+ __unstableBoundaryParent: true // Observe movement for block animations (especially horizontal).
9828
+ ,
9829
+ __unstableObserveElement: selectedElement // Used to safeguard sticky position behavior against cases where it would permanently
9830
+ // obscure specific sections of a block.
9831
+ ,
9832
+ __unstableEditorCanvasWrapper: __unstableContentRef === null || __unstableContentRef === void 0 ? void 0 : __unstableContentRef.current,
9833
+ __unstableForcePosition: __unstableCoverTarget
9834
+ }, props, {
9835
+ className: classnames_default()('block-editor-block-popover', props.className)
9836
+ }), __unstableCoverTarget && (0,external_wp_element_namespaceObject.createElement)("div", {
9837
+ style: style
9838
+ }, children), !__unstableCoverTarget && children);
9839
+ }
9840
+
9841
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/margin.js
9842
 
9843
 
9848
 
9849
 
9850
 
9851
+
9852
  /**
9853
  * Internal dependencies
9854
  */
9856
 
9857
 
9858
 
9859
+
9860
  /**
9861
  * Determines if there is margin support.
9862
  *
9961
  });
9962
  };
9963
 
 
 
 
 
 
 
 
 
 
 
 
9964
  return external_wp_element_namespaceObject.Platform.select({
9965
  web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
9966
  values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.margin,
9967
  onChange: onChange,
 
9968
  label: (0,external_wp_i18n_namespaceObject.__)('Margin'),
9969
  sides: sides,
9970
  units: units,
9974
  native: null
9975
  });
9976
  }
9977
+ function MarginVisualizer(_ref2) {
9978
+ var _attributes$style, _attributes$style$spa;
9979
+
9980
+ let {
9981
+ clientId,
9982
+ attributes
9983
+ } = _ref2;
9984
+ 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;
9985
+ const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
9986
+ var _margin$top, _margin$right, _margin$bottom, _margin$left;
9987
+
9988
+ return {
9989
+ borderTopWidth: (_margin$top = margin === null || margin === void 0 ? void 0 : margin.top) !== null && _margin$top !== void 0 ? _margin$top : 0,
9990
+ borderRightWidth: (_margin$right = margin === null || margin === void 0 ? void 0 : margin.right) !== null && _margin$right !== void 0 ? _margin$right : 0,
9991
+ borderBottomWidth: (_margin$bottom = margin === null || margin === void 0 ? void 0 : margin.bottom) !== null && _margin$bottom !== void 0 ? _margin$bottom : 0,
9992
+ borderLeftWidth: (_margin$left = margin === null || margin === void 0 ? void 0 : margin.left) !== null && _margin$left !== void 0 ? _margin$left : 0,
9993
+ top: margin !== null && margin !== void 0 && margin.top ? `-${margin.top}` : 0,
9994
+ right: margin !== null && margin !== void 0 && margin.right ? `-${margin.right}` : 0,
9995
+ bottom: margin !== null && margin !== void 0 && margin.bottom ? `-${margin.bottom}` : 0,
9996
+ left: margin !== null && margin !== void 0 && margin.left ? `-${margin.left}` : 0
9997
+ };
9998
+ }, [margin]);
9999
+ const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
10000
+ const valueRef = (0,external_wp_element_namespaceObject.useRef)(margin);
10001
+ const timeoutRef = (0,external_wp_element_namespaceObject.useRef)();
10002
+
10003
+ const clearTimer = () => {
10004
+ if (timeoutRef.current) {
10005
+ window.clearTimeout(timeoutRef.current);
10006
+ }
10007
+ };
10008
+
10009
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
10010
+ if (!external_wp_isShallowEqual_default()(margin, valueRef.current)) {
10011
+ setIsActive(true);
10012
+ valueRef.current = margin;
10013
+ clearTimer();
10014
+ timeoutRef.current = setTimeout(() => {
10015
+ setIsActive(false);
10016
+ }, 400);
10017
+ }
10018
+
10019
+ return () => clearTimer();
10020
+ }, [margin]);
10021
+
10022
+ if (!isActive) {
10023
+ return null;
10024
+ }
10025
+
10026
+ return (0,external_wp_element_namespaceObject.createElement)(BlockPopover, {
10027
+ clientId: clientId,
10028
+ __unstableCoverTarget: true,
10029
+ __unstableRefreshSize: margin
10030
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
10031
+ className: "block-editor__padding-visualizer",
10032
+ style: style
10033
+ }));
10034
+ }
10035
 
10036
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/padding.js
10037
 
10043
 
10044
 
10045
 
10046
+
10047
  /**
10048
  * Internal dependencies
10049
  */
10051
 
10052
 
10053
 
10054
+
10055
  /**
10056
  * Determines if there is padding support.
10057
  *
10156
  });
10157
  };
10158
 
 
 
 
 
 
 
 
 
 
 
 
10159
  return external_wp_element_namespaceObject.Platform.select({
10160
  web: (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalBoxControl, {
10161
  values: style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.padding,
10162
  onChange: onChange,
 
10163
  label: (0,external_wp_i18n_namespaceObject.__)('Padding'),
10164
  sides: sides,
10165
  units: units,
10169
  native: null
10170
  });
10171
  }
10172
+ function PaddingVisualizer(_ref2) {
10173
+ var _attributes$style, _attributes$style$spa;
10174
+
10175
+ let {
10176
+ clientId,
10177
+ attributes
10178
+ } = _ref2;
10179
+ 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;
10180
+ const style = (0,external_wp_element_namespaceObject.useMemo)(() => {
10181
+ var _padding$top, _padding$right, _padding$bottom, _padding$left;
10182
+
10183
+ return {
10184
+ borderTopWidth: (_padding$top = padding === null || padding === void 0 ? void 0 : padding.top) !== null && _padding$top !== void 0 ? _padding$top : 0,
10185
+ borderRightWidth: (_padding$right = padding === null || padding === void 0 ? void 0 : padding.right) !== null && _padding$right !== void 0 ? _padding$right : 0,
10186
+ borderBottomWidth: (_padding$bottom = padding === null || padding === void 0 ? void 0 : padding.bottom) !== null && _padding$bottom !== void 0 ? _padding$bottom : 0,
10187
+ borderLeftWidth: (_padding$left = padding === null || padding === void 0 ? void 0 : padding.left) !== null && _padding$left !== void 0 ? _padding$left : 0
10188
+ };
10189
+ }, [padding]);
10190
+ const [isActive, setIsActive] = (0,external_wp_element_namespaceObject.useState)(false);
10191
+ const valueRef = (0,external_wp_element_namespaceObject.useRef)(padding);
10192
+ const timeoutRef = (0,external_wp_element_namespaceObject.useRef)();
10193
+
10194
+ const clearTimer = () => {
10195
+ if (timeoutRef.current) {
10196
+ window.clearTimeout(timeoutRef.current);
10197
+ }
10198
+ };
10199
+
10200
+ (0,external_wp_element_namespaceObject.useEffect)(() => {
10201
+ if (!external_wp_isShallowEqual_default()(padding, valueRef.current)) {
10202
+ setIsActive(true);
10203
+ valueRef.current = padding;
10204
+ clearTimer();
10205
+ timeoutRef.current = setTimeout(() => {
10206
+ setIsActive(false);
10207
+ }, 400);
10208
+ }
10209
+
10210
+ return () => clearTimer();
10211
+ }, [padding]);
10212
+
10213
+ if (!isActive) {
10214
+ return null;
10215
+ }
10216
+
10217
+ return (0,external_wp_element_namespaceObject.createElement)(BlockPopover, {
10218
+ clientId: clientId,
10219
+ __unstableCoverTarget: true,
10220
+ __unstableRefreshSize: padding
10221
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
10222
+ className: "block-editor__padding-visualizer",
10223
+ style: style
10224
+ }));
10225
+ }
10226
 
10227
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/dimensions.js
10228
 
10278
  };
10279
  };
10280
 
10281
+ return (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)(inspector_controls, {
10282
  __experimentalGroup: "dimensions"
10283
  }, !isPaddingDisabled && (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalToolsPanelItem, {
10284
  hasValue: () => hasPaddingValue(props),
10301
  resetAllFilter: createResetAllFilter('blockGap'),
10302
  isShownByDefault: defaultSpacingControls === null || defaultSpacingControls === void 0 ? void 0 : defaultSpacingControls.blockGap,
10303
  panelId: props.clientId
10304
+ }, (0,external_wp_element_namespaceObject.createElement)(GapEdit, props))), !isPaddingDisabled && (0,external_wp_element_namespaceObject.createElement)(PaddingVisualizer, props), !isMarginDisabled && (0,external_wp_element_namespaceObject.createElement)(MarginVisualizer, props));
10305
  }
10306
  /**
10307
  * Determine whether there is dimensions related block support.
11164
 
11165
  /* harmony default export */ var build_module_icon = (Icon);
11166
 
11167
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/position-center.js
11168
+
11169
+
11170
+ /**
11171
+ * WordPress dependencies
11172
+ */
11173
+
11174
+ const positionCenter = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
11175
+ xmlns: "http://www.w3.org/2000/svg",
11176
+ viewBox: "0 0 24 24"
11177
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
11178
+ d: "M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"
11179
+ }));
11180
+ /* harmony default export */ var position_center = (positionCenter);
11181
+
11182
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/stretch-wide.js
11183
+
11184
+
11185
+ /**
11186
+ * WordPress dependencies
11187
+ */
11188
+
11189
+ const stretchWide = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
11190
+ xmlns: "http://www.w3.org/2000/svg",
11191
+ viewBox: "0 0 24 24"
11192
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
11193
+ d: "M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"
11194
+ }));
11195
+ /* harmony default export */ var stretch_wide = (stretchWide);
11196
+
11197
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/layouts/flow.js
11198
 
11199
 
11579
  return enabledControls;
11580
  }
11581
 
11582
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/align-none.js
11583
+
11584
 
11585
+ /**
11586
+ * WordPress dependencies
11587
+ */
11588
+
11589
+ const alignNone = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
11590
+ xmlns: "http://www.w3.org/2000/svg",
11591
+ viewBox: "0 0 24 24"
11592
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
11593
+ d: "M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"
11594
+ }));
11595
+ /* harmony default export */ var align_none = (alignNone);
11596
+
11597
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/position-left.js
11598
 
11599
 
11600
  /**
11601
+ * WordPress dependencies
11602
  */
11603
 
11604
+ const positionLeft = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
11605
+ xmlns: "http://www.w3.org/2000/svg",
11606
+ viewBox: "0 0 24 24"
11607
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
11608
+ d: "M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"
11609
+ }));
11610
+ /* harmony default export */ var position_left = (positionLeft);
11611
+
11612
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/position-right.js
11613
+
11614
+
11615
  /**
11616
  * WordPress dependencies
11617
  */
11618
 
11619
+ const positionRight = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
11620
+ xmlns: "http://www.w3.org/2000/svg",
11621
+ viewBox: "0 0 24 24"
11622
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
11623
+ d: "M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"
11624
+ }));
11625
+ /* harmony default export */ var position_right = (positionRight);
11626
+
11627
+ ;// CONCATENATED MODULE: ./packages/icons/build-module/library/stretch-full-width.js
11628
 
11629
 
11630
+ /**
11631
+ * WordPress dependencies
11632
+ */
11633
 
11634
+ const stretchFullWidth = (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.SVG, {
11635
+ xmlns: "http://www.w3.org/2000/svg",
11636
+ viewBox: "0 0 24 24"
11637
+ }, (0,external_wp_element_namespaceObject.createElement)(external_wp_primitives_namespaceObject.Path, {
11638
+ d: "M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"
11639
+ }));
11640
+ /* harmony default export */ var stretch_full_width = (stretchFullWidth);
11641
 
11642
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-alignment-control/constants.js
11643
  /**
11644
+ * WordPress dependencies
11645
  */
11646
 
11647
 
11648
+ const constants_BLOCK_ALIGNMENTS_CONTROLS = {
11649
  none: {
11650
  icon: align_none,
11651
  title: (0,external_wp_i18n_namespaceObject._x)('None', 'Alignment option')
11671
  title: (0,external_wp_i18n_namespaceObject.__)('Full width')
11672
  }
11673
  };
11674
+ const constants_DEFAULT_CONTROL = 'none';
11675
+ const constants_POPOVER_PROPS = {
11676
  isAlternate: true
11677
  };
11678
 
11679
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-alignment-control/ui.js
11680
+
11681
+
11682
+
11683
+ /**
11684
+ * External dependencies
11685
+ */
11686
+
11687
+ /**
11688
+ * WordPress dependencies
11689
+ */
11690
+
11691
+
11692
+
11693
+ /**
11694
+ * Internal dependencies
11695
+ */
11696
+
11697
+
11698
+
11699
+
11700
  function BlockAlignmentUI(_ref) {
11701
  let {
11702
  value,
11716
  onChange([value, 'none'].includes(align) ? undefined : align);
11717
  }
11718
 
11719
+ const activeAlignmentControl = constants_BLOCK_ALIGNMENTS_CONTROLS[value];
11720
+ const defaultAlignmentControl = constants_BLOCK_ALIGNMENTS_CONTROLS[constants_DEFAULT_CONTROL];
11721
  const UIComponent = isToolbar ? external_wp_components_namespaceObject.ToolbarGroup : external_wp_components_namespaceObject.ToolbarDropdownMenu;
11722
  const commonProps = {
11723
+ popoverProps: constants_POPOVER_PROPS,
11724
  icon: activeAlignmentControl ? activeAlignmentControl.icon : defaultAlignmentControl.icon,
11725
  label: (0,external_wp_i18n_namespaceObject.__)('Align'),
11726
  toggleProps: {
11727
  describedBy: (0,external_wp_i18n_namespaceObject.__)('Change alignment')
11728
  }
11729
  };
11730
+ const extraProps = isToolbar ? {
11731
+ isCollapsed,
11732
  controls: enabledControls.map(_ref2 => {
11733
  let {
11734
  name: controlName
11735
  } = _ref2;
11736
+ return { ...constants_BLOCK_ALIGNMENTS_CONTROLS[controlName],
11737
  isActive: value === controlName || !value && controlName === 'none',
11738
  role: isCollapsed ? 'menuitemradio' : undefined,
11739
  onClick: () => onChangeAlignment(controlName)
11754
  const {
11755
  icon,
11756
  title
11757
+ } = constants_BLOCK_ALIGNMENTS_CONTROLS[controlName]; // If no value is provided, mark as selected the `none` option.
11758
 
11759
  const isSelected = controlName === value || !value && controlName === 'none';
11760
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.MenuItem, {
12484
  return rules;
12485
  }
12486
 
 
 
12487
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-context/index.js
12488
 
12489
 
17501
  getBlockName,
17502
  getSettings,
17503
  hasSelectedInnerBlock,
17504
+ isTyping
 
17505
  } = select(store);
17506
  const {
 
17507
  outlineMode
17508
  } = getSettings();
17509
  const isDragging = isBlockBeingDragged(clientId);
17512
  const checkDeep = true; // "ancestor" is the more appropriate label due to "deep" check.
17513
 
17514
  const isAncestorOfSelectedBlock = hasSelectedInnerBlock(clientId, checkDeep);
 
17515
  return classnames_default()({
17516
  'is-selected': isSelected,
17517
  'is-highlighted': isBlockHighlighted(clientId),
17519
  'is-reusable': (0,external_wp_blocks_namespaceObject.isReusableBlock)((0,external_wp_blocks_namespaceObject.getBlockType)(name)),
17520
  'is-dragging': isDragging,
17521
  'has-child-selected': isAncestorOfSelectedBlock,
 
 
 
17522
  'remove-outline': isSelected && outlineMode && isTyping()
17523
  });
17524
  }, [clientId]);
19768
  selectionChange
19769
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
19770
  const {
19771
+ getBlockParents,
19772
+ getBlockSelectionStart
19773
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
19774
  return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
19775
  const {
19779
  defaultView
19780
  } = ownerDocument;
19781
 
19782
+ function onSelectionChange(event) {
19783
  const selection = defaultView.getSelection(); // If no selection is found, end multi selection and disable the
19784
  // contentEditable wrapper.
19785
 
19786
+ if (!selection.rangeCount) {
19787
+ use_selection_observer_setContentEditableWrapper(node, false);
19788
+ return;
19789
+ } // If selection is collapsed and we haven't used `shift+click`,
19790
+ // end multi selection and disable the contentEditable wrapper.
19791
+ // We have to check about `shift+click` case because elements
19792
+ // that don't support text selection might be involved, and we might
19793
+ // update the clientIds to multi-select blocks.
19794
+ // For now we check if the event is a `mouse` event.
19795
+
19796
+
19797
+ const isClickShift = event.shiftKey && event.type === 'mouseup';
19798
+
19799
+ if (selection.isCollapsed && !isClickShift) {
19800
+ use_selection_observer_setContentEditableWrapper(node, false);
19801
+ return;
19802
+ }
19803
+
19804
+ let startClientId = getBlockClientId(extractSelectionStartNode(selection));
19805
+ let endClientId = getBlockClientId(extractSelectionEndNode(selection)); // If the selection has changed and we had pressed `shift+click`,
19806
+ // we need to check if in an element that doesn't support
19807
+ // text selection has been clicked.
19808
+
19809
+ if (isClickShift) {
19810
+ const selectedClientId = getBlockSelectionStart();
19811
+ const clickedClientId = getBlockClientId(event.target); // `endClientId` is not defined if we end the selection by clicking a non-selectable block.
19812
+ // We need to check if there was already a selection with a non-selectable focusNode.
19813
+
19814
+ const focusNodeIsNonSelectable = clickedClientId !== endClientId;
19815
+
19816
+ if (startClientId === endClientId && selection.isCollapsed || !endClientId || focusNodeIsNonSelectable) {
19817
+ endClientId = clickedClientId;
19818
+ } // Handle the case when we have a non-selectable block
19819
+ // selected and click another one.
19820
+
19821
+
19822
+ if (startClientId !== selectedClientId) {
19823
+ startClientId = selectedClientId;
19824
+ }
19825
+ } // If the selection did not involve a block, return.
19826
+
19827
+
19828
+ if (startClientId === undefined && endClientId === undefined) {
19829
  use_selection_observer_setContentEditableWrapper(node, false);
19830
  return;
19831
  }
19832
 
19833
+ const isSingularSelection = startClientId === endClientId;
 
 
19834
 
19835
  if (isSingularSelection) {
19836
+ selectBlock(startClientId);
19837
  } else {
19838
+ const startPath = [...getBlockParents(startClientId), startClientId];
19839
  const endPath = [...getBlockParents(endClientId), endClientId];
19840
  const depth = findDepth(startPath, endPath);
19841
  multiSelect(startPath[depth], endPath[depth]);
19883
 
19884
  function useClickSelection() {
19885
  const {
 
19886
  selectBlock
19887
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
19888
  const {
19889
  isSelectionEnabled,
 
19890
  getBlockSelectionStart,
19891
  hasMultiSelection
19892
  } = (0,external_wp_data_namespaceObject.useSelect)(store);
19922
  return () => {
19923
  node.removeEventListener('mousedown', onMouseDown);
19924
  };
19925
+ }, [selectBlock, isSelectionEnabled, getBlockSelectionStart, hasMultiSelection]);
19926
  }
19927
 
19928
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/writing-flow/use-input.js
20130
  *
20131
  * Ideally, this hook should be removed in the future and styles should be added
20132
  * explicitly as editor styles.
 
 
20133
  */
20134
 
20135
+ function useStylesCompatibility() {
20136
+ return (0,external_wp_compose_namespaceObject.useRefEffect)(node => {
20137
+ // Search the document for stylesheets targetting the editor canvas.
20138
+ Array.from(document.styleSheets).forEach(styleSheet => {
20139
+ try {
20140
+ // May fail for external styles.
20141
+ // eslint-disable-next-line no-unused-expressions
20142
+ styleSheet.cssRules;
20143
+ } catch (e) {
20144
+ return;
20145
+ }
20146
 
20147
+ const {
20148
+ ownerNode,
20149
+ cssRules
20150
+ } = styleSheet;
20151
 
20152
+ if (!cssRules) {
20153
+ return;
20154
+ } // Generally, ignore inline styles. We add inline styles belonging to a
20155
+ // stylesheet later, which may or may not match the selectors.
20156
 
20157
 
20158
+ if (ownerNode.tagName !== 'LINK') {
20159
+ return;
20160
+ } // Don't try to add the reset styles, which were removed as a dependency
20161
+ // from `edit-blocks` for the iframe since we don't need to reset admin
20162
+ // styles.
20163
 
20164
 
20165
+ if (ownerNode.id === 'wp-reset-editor-styles-css') {
20166
+ return;
20167
+ }
20168
 
20169
+ const isMatch = Array.from(cssRules).find(_ref => {
20170
+ let {
20171
+ selectorText
20172
+ } = _ref;
20173
+ return selectorText && (selectorText.includes(`.${BODY_CLASS_NAME}`) || selectorText.includes(`.${BLOCK_PREFIX}`));
20174
+ });
20175
 
20176
+ if (isMatch && !node.ownerDocument.getElementById(ownerNode.id)) {
20177
+ // Display warning once we have a way to add style dependencies to the editor.
20178
+ // See: https://github.com/WordPress/gutenberg/pull/37466.
20179
+ node.appendChild(ownerNode.cloneNode(true)); // Add inline styles belonging to the stylesheet.
20180
 
20181
+ const inlineCssId = ownerNode.id.replace('-css', '-inline-css');
20182
+ const inlineCssElement = document.getElementById(inlineCssId);
20183
 
20184
+ if (inlineCssElement) {
20185
+ node.appendChild(inlineCssElement.cloneNode(true));
20186
+ }
20187
  }
20188
+ });
20189
+ }, []);
20190
  }
20191
  /**
20192
  * Bubbles some event types (keydown, keypress, and dragover) to parent document
20326
  });
20327
  }, []);
20328
  const bodyRef = (0,external_wp_compose_namespaceObject.useMergeRefs)([contentRef, clearerRef, writingFlowRef]);
20329
+ const styleCompatibilityRef = useStylesCompatibility();
 
 
 
 
20330
  head = (0,external_wp_element_namespaceObject.createElement)(external_wp_element_namespaceObject.Fragment, null, (0,external_wp_element_namespaceObject.createElement)("style", null, 'body{margin:0}'), styles.map(_ref4 => {
20331
  let {
20332
  tagName,
20364
  }, head), (0,external_wp_element_namespaceObject.createElement)("body", {
20365
  ref: bodyRef,
20366
  className: classnames_default()(BODY_CLASS_NAME, ...bodyClasses)
20367
+ }, (0,external_wp_element_namespaceObject.createElement)("div", {
20368
+ style: {
20369
+ display: 'none'
20370
+ },
20371
+ ref: styleCompatibilityRef
20372
+ }), (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.__experimentalStyleProvider, {
20373
  document: iframeDocument
20374
  }, children))), iframeDocument.documentElement)), tabIndex >= 0 && after);
20375
  }
24201
  onSelect,
24202
  rootClientId,
24203
  clientId,
24204
+ isAppender,
24205
+ prioritizePatterns
24206
  } = _ref;
24207
  const [filterValue, setFilterValue] = (0,external_wp_element_namespaceObject.useState)('');
24208
  const [destinationRootClientId, onInsertBlocks] = use_insertion_point({
24215
  const [patterns] = use_patterns_state(onInsertBlocks, destinationRootClientId);
24216
  const {
24217
  setInserterIsOpened,
24218
+ insertionIndex
 
24219
  } = (0,external_wp_data_namespaceObject.useSelect)(select => {
24220
  const {
24221
  getSettings,
24227
  const blockCount = getBlockCount();
24228
  return {
24229
  setInserterIsOpened: settings.__experimentalSetIsInserterOpened,
 
24230
  insertionIndex: index === -1 ? blockCount : index
24231
  };
24232
+ }, [clientId]);
24233
  const showPatterns = patterns.length && (!!filterValue || prioritizePatterns);
24234
  const showSearch = showPatterns && patterns.length > SEARCH_THRESHOLD || blockTypes.length > SEARCH_THRESHOLD;
24235
  (0,external_wp_element_namespaceObject.useEffect)(() => {
24321
  isOpen,
24322
  blockTitle,
24323
  hasSingleBlockType,
24324
+ toggleProps = {},
24325
+ prioritizePatterns
24326
  } = _ref;
24327
  let label;
24328
 
24329
  if (hasSingleBlockType) {
24330
  label = (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: the name of the block when there is only one
24331
  (0,external_wp_i18n_namespaceObject._x)('Add %s', 'directly add the only allowed block'), blockTitle);
24332
+ } else if (prioritizePatterns) {
24333
+ label = (0,external_wp_i18n_namespaceObject.__)('Add pattern');
24334
  } else {
24335
  label = (0,external_wp_i18n_namespaceObject._x)('Add block', 'Generic label for block inserter button');
24336
  }
24403
  directInsertBlock,
24404
  toggleProps,
24405
  hasItems,
24406
+ renderToggle = defaultRenderToggle,
24407
+ prioritizePatterns
24408
  } = this.props;
24409
  return renderToggle({
24410
  onToggle,
24413
  blockTitle,
24414
  hasSingleBlockType,
24415
  directInsertBlock,
24416
+ toggleProps,
24417
+ prioritizePatterns
24418
  });
24419
  }
24420
  /**
24439
  showInserterHelpPanel,
24440
  // This prop is experimental to give some time for the quick inserter to mature
24441
  // Feel free to make them stable after a few releases.
24442
+ __experimentalIsQuick: isQuick,
24443
+ prioritizePatterns
24444
  } = this.props;
24445
 
24446
  if (isQuick) {
24450
  },
24451
  rootClientId: rootClientId,
24452
  clientId: clientId,
24453
+ isAppender: isAppender,
24454
+ prioritizePatterns: prioritizePatterns
24455
  });
24456
  }
24457
 
24508
  getBlockRootClientId,
24509
  hasInserterItems,
24510
  __experimentalGetAllowedBlocks,
24511
+ __experimentalGetDirectInsertBlock,
24512
+ getBlockIndex,
24513
+ getBlockCount,
24514
+ getSettings
24515
  } = select(store);
24516
  const {
24517
  getBlockVariations
24522
 
24523
  const directInsertBlock = __experimentalGetDirectInsertBlock(rootClientId);
24524
 
24525
+ const index = getBlockIndex(clientId);
24526
+ const blockCount = getBlockCount();
24527
+ const settings = getSettings();
24528
  const hasSingleBlockType = (0,external_lodash_namespaceObject.size)(allowedBlocks) === 1 && (0,external_lodash_namespaceObject.size)(getBlockVariations(allowedBlocks[0].name, 'inserter')) === 0;
24529
  let allowedBlockType = false;
24530
 
24538
  blockTitle: allowedBlockType ? allowedBlockType.title : '',
24539
  allowedBlockType,
24540
  directInsertBlock,
24541
+ rootClientId,
24542
+ prioritizePatterns: settings.__experimentalPreferPatternsOnRoot && !rootClientId && index > 0 && (index < blockCount || blockCount === 0)
24543
  };
24544
  }), (0,external_wp_data_namespaceObject.withDispatch)((dispatch, ownProps, _ref5) => {
24545
  let {
24981
  };
24982
  })(BlockListAppender));
24983
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24984
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-popover/inbetween.js
24985
 
24986
 
29739
 
29740
  /* harmony default export */ var block_contextual_toolbar = (BlockContextualToolbar);
29741
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29742
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/block-tools/selected-block-popover.js
29743
 
29744
 
30100
  };
30101
  })])(default_block_appender_DefaultBlockAppender));
30102
 
 
 
 
30103
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/inner-blocks/use-nested-settings-update.js
30104
  /**
30105
  * WordPress dependencies
35483
  (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockEdit', 'core/style/with-block-controls', withBlockControls);
35484
  (0,external_wp_hooks_namespaceObject.addFilter)('editor.BlockListBlock', 'core/editor/with-elements-styles', withElementsStyles);
35485
 
35486
+ ;// CONCATENATED MODULE: ./packages/block-editor/build-module/hooks/settings.js
35487
+ /**
35488
+ * WordPress dependencies
35489
+ */
35490
+
35491
+
35492
+
35493
+ const hasSettingsSupport = blockType => (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockType, '__experimentalSettings', false);
35494
+
35495
+ function settings_addAttribute(settings) {
35496
+ var _settings$attributes;
35497
+
35498
+ if (!hasSettingsSupport(settings)) {
35499
+ return settings;
35500
+ } // Allow blocks to specify their own attribute definition with default values if needed.
35501
+
35502
+
35503
+ if (!(settings !== null && settings !== void 0 && (_settings$attributes = settings.attributes) !== null && _settings$attributes !== void 0 && _settings$attributes.settings)) {
35504
+ settings.attributes = { ...settings.attributes,
35505
+ settings: {
35506
+ type: 'object'
35507
+ }
35508
+ };
35509
+ }
35510
+
35511
+ return settings;
35512
+ }
35513
+
35514
+ (0,external_wp_hooks_namespaceObject.addFilter)('blocks.registerBlockType', 'core/settings/addAttribute', settings_addAttribute);
35515
+
35516
  ;// CONCATENATED MODULE: ./packages/icons/build-module/library/filter.js
35517
 
35518
 
36410
 
36411
 
36412
 
36413
+
36414
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/colors/with-colors.js
36415
 
36416
 
36839
  title: (0,external_wp_i18n_namespaceObject.__)('Align text right'),
36840
  align: 'right'
36841
  }];
36842
+ const ui_POPOVER_PROPS = {
36843
  position: 'bottom right',
36844
  isAlternate: true
36845
  };
36876
  toggleProps: {
36877
  describedBy
36878
  },
36879
+ popoverProps: ui_POPOVER_PROPS,
36880
  controls: alignmentControls.map(control => {
36881
  const {
36882
  align
37537
 
37538
 
37539
 
37540
+
37541
  const ColorSelectorSVGIcon = () => (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.SVG, {
37542
  xmlns: "https://www.w3.org/2000/svg",
37543
  viewBox: "0 0 20 20"
37611
  children,
37612
  ...other
37613
  } = _ref4;
37614
+ external_wp_deprecated_default()(`wp.blockEditor.BlockColorsStyleSelector`, {
37615
+ alternative: 'block supports API',
37616
+ since: '6.1',
37617
+ version: '6.3'
37618
+ });
37619
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
37620
  position: "bottom right",
37621
  className: "block-library-colors-selector",
37902
  * WordPress dependencies
37903
  */
37904
 
37905
+ const ListViewContext = (0,external_wp_element_namespaceObject.createContext)({});
 
 
 
37906
  const useListViewContext = () => (0,external_wp_element_namespaceObject.useContext)(ListViewContext);
37907
 
37908
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/utils.js
37972
 
37973
 
37974
 
37975
+
37976
  /**
37977
  * Internal dependencies
37978
  */
38015
  toggleBlockHighlight
38016
  } = (0,external_wp_data_namespaceObject.useDispatch)(store);
38017
  const blockInformation = useBlockDisplayInformation(clientId);
38018
+ const blockName = (0,external_wp_data_namespaceObject.useSelect)(select => select(store).getBlockName(clientId), [clientId]); // When a block hides its toolbar it also hides the block settings menu,
38019
+ // since that menu is part of the toolbar in the editor canvas.
38020
+ // List View respects this by also hiding the block settings menu.
38021
+
38022
+ const showBlockActions = (0,external_wp_blocks_namespaceObject.hasBlockSupport)(blockName, '__experimentalToolbar', true);
38023
  const {
38024
  isLocked
38025
  } = useBlockLock(clientId);
38038
  const settingsAriaLabel = blockInformation ? (0,external_wp_i18n_namespaceObject.sprintf)( // translators: %s: The title of the block.
38039
  (0,external_wp_i18n_namespaceObject.__)('Options for %s block'), blockInformation.title) : (0,external_wp_i18n_namespaceObject.__)('Options');
38040
  const {
 
 
 
38041
  isTreeGridMounted,
38042
  expand,
38043
  collapse
38054
  // try to steal the focus from the editor canvas.
38055
 
38056
  (0,external_wp_element_namespaceObject.useEffect)(() => {
38057
+ if (!isTreeGridMounted && isSelected) {
38058
  cellRef.current.focus();
38059
  }
38060
  }, []);
 
38061
  const onMouseEnter = (0,external_wp_element_namespaceObject.useCallback)(() => {
38062
  setIsHovered(true);
38063
+ toggleBlockHighlight(clientId, true);
38064
+ }, [clientId, setIsHovered, toggleBlockHighlight]);
38065
  const onMouseLeave = (0,external_wp_element_namespaceObject.useCallback)(() => {
38066
  setIsHovered(false);
38067
+ toggleBlockHighlight(clientId, false);
38068
+ }, [clientId, setIsHovered, toggleBlockHighlight]);
38069
  const selectEditorBlock = (0,external_wp_element_namespaceObject.useCallback)(event => {
38070
  selectBlock(event, clientId);
38071
  event.preventDefault();
38084
  expand(clientId);
38085
  }
38086
  }, [clientId, expand, collapse, isExpanded]);
 
 
 
38087
  let colSpan;
38088
 
38089
  if (hasRenderedMovers) {
38090
  colSpan = 2;
38091
+ } else if (!showBlockActions) {
38092
  colSpan = 3;
38093
  }
38094
 
38096
  'is-selected': isSelected,
38097
  'is-first-selected': isFirstSelectedBlock,
38098
  'is-last-selected': isLastSelectedBlock,
38099
+ 'is-branch-selected': isBranchSelected,
38100
  'is-dragging': isDragged,
38101
+ 'has-single-cell': !showBlockActions
38102
  }); // Only include all selected blocks if the currently clicked on block
38103
  // is one of the selected blocks. This ensures that if a user attempts
38104
  // to alter a block that isn't part of the selection, they're still able
38284
  blocks,
38285
  selectBlock,
38286
  showBlockMovers,
 
38287
  selectedClientIds,
38288
  level = 1,
38289
  path = '',
38290
  isBranchSelected = false,
38291
  listPosition = 0,
38292
  fixedListWindow,
38293
+ isExpanded
38294
  } = props;
38295
  const {
38296
  expandedState,
38297
+ draggedClientIds
 
38298
  } = useListViewContext();
38299
  const filteredBlocks = (0,external_lodash_namespaceObject.compact)(blocks);
38300
  const blockCount = filteredBlocks.length;
38308
  } = block;
38309
 
38310
  if (index > 0) {
38311
+ nextPosition += countBlocks(filteredBlocks[index - 1], expandedState, draggedClientIds, isExpanded);
38312
  }
38313
 
 
38314
  const {
38315
  itemInView
38316
  } = fixedListWindow;
38317
+ const blockInView = itemInView(nextPosition);
38318
  const position = index + 1;
38319
  const updatedPath = path.length > 0 ? `${path}_${position}` : `${position}`;
38320
+ const hasNestedBlocks = !!(innerBlocks !== null && innerBlocks !== void 0 && innerBlocks.length);
38321
+ const shouldExpand = hasNestedBlocks ? (_expandedState$client = expandedState[clientId]) !== null && _expandedState$client !== void 0 ? _expandedState$client : isExpanded : undefined;
38322
  const isDragged = !!(draggedClientIds !== null && draggedClientIds !== void 0 && draggedClientIds.includes(clientId));
38323
  const showBlock = isDragged || blockInView; // Make updates to the selected or dragged blocks synchronous,
38324
  // but asynchronous for any other block.
38340
  siblingBlockCount: blockCount,
38341
  showBlockMovers: showBlockMovers,
38342
  path: updatedPath,
38343
+ isExpanded: shouldExpand,
38344
  listPosition: nextPosition,
38345
  selectedClientIds: selectedClientIds
38346
  }), !showBlock && (0,external_wp_element_namespaceObject.createElement)("tr", null, (0,external_wp_element_namespaceObject.createElement)("td", {
38347
  className: "block-editor-list-view-placeholder"
38348
+ })), hasNestedBlocks && shouldExpand && !isDragged && (0,external_wp_element_namespaceObject.createElement)(ListViewBranch, {
38349
  blocks: innerBlocks,
38350
  selectBlock: selectBlock,
38351
  showBlockMovers: showBlockMovers,
 
38352
  level: level + 1,
38353
  path: updatedPath,
38354
  listPosition: nextPosition + 1,
38355
  fixedListWindow: fixedListWindow,
38356
  isBranchSelected: isSelectedBranch,
38357
  selectedClientIds: selectedClientIds,
38358
+ isExpanded: isExpanded
38359
  }));
38360
  }));
38361
  }
38919
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/list-view/index.js
38920
 
38921
 
 
38922
  /**
38923
  * WordPress dependencies
38924
  */
38954
 
38955
  const BLOCK_LIST_ITEM_HEIGHT = 36;
38956
  /**
38957
+ * Show a hierarchical list of blocks.
 
 
38958
  *
38959
+ * @param {Object} props Components props.
38960
+ * @param {string} props.id An HTML element id for the root element of ListView.
38961
+ * @param {Array} props.blocks Custom subset of block client IDs to be used instead of the default hierarchy.
38962
+ * @param {boolean} props.showBlockMovers Flag to enable block movers
38963
+ * @param {boolean} props.isExpanded Flag to determine whether nested levels are expanded by default.
38964
+ * @param {Object} ref Forwarded ref
 
 
 
 
38965
  */
38966
 
38967
  function ListView(_ref, ref) {
38968
  let {
 
 
 
 
 
 
38969
  id,
38970
+ blocks,
38971
+ showBlockMovers = false,
38972
+ isExpanded = false
38973
  } = _ref;
38974
  const {
38975
  clientIdsTree,
39016
  // See: https://github.com/WordPress/gutenberg/pull/35230 for additional context.
39017
 
39018
  const [fixedListWindow] = (0,external_wp_compose_namespaceObject.__experimentalUseFixedWindowList)(elementRef, BLOCK_LIST_ITEM_HEIGHT, visibleBlockCount, {
39019
+ useWindowing: true,
39020
  windowOverscan: 40
39021
  });
39022
  const expand = (0,external_wp_element_namespaceObject.useCallback)(clientId => {
39057
  }
39058
  }, [updateBlockSelection]);
39059
  const contextValue = (0,external_wp_element_namespaceObject.useMemo)(() => ({
 
 
 
39060
  isTreeGridMounted: isMounted.current,
39061
  draggedClientIds,
39062
  expandedState,
39063
  expand,
39064
  collapse
39065
+ }), [isMounted.current, draggedClientIds, expandedState, expand, collapse]);
39066
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_data_namespaceObject.AsyncModeProvider, {
39067
  value: true
39068
  }, (0,external_wp_element_namespaceObject.createElement)(ListViewDropIndicator, {
39078
  onFocusRow: focusRow
39079
  }, (0,external_wp_element_namespaceObject.createElement)(ListViewContext.Provider, {
39080
  value: contextValue
39081
+ }, (0,external_wp_element_namespaceObject.createElement)(branch, {
39082
  blocks: clientIdsTree,
39083
  selectBlock: selectEditorBlock,
 
39084
  showBlockMovers: showBlockMovers,
39085
  fixedListWindow: fixedListWindow,
39086
  selectedClientIds: selectedClientIds,
39087
+ isExpanded: isExpanded
39088
+ }))));
39089
  }
39090
 
39091
  /* harmony default export */ var components_list_view = ((0,external_wp_element_namespaceObject.forwardRef)(ListView));
39098
  * WordPress dependencies
39099
  */
39100
 
39101
+ /**
39102
+ * WordPress dependencies
39103
+ */
39104
+
39105
+
39106
 
39107
 
39108
 
39139
  function BlockNavigationDropdown(_ref2, ref) {
39140
  let {
39141
  isDisabled,
 
39142
  ...props
39143
  } = _ref2;
39144
+ external_wp_deprecated_default()('wp.blockEditor.BlockNavigationDropdown', {
39145
+ since: '6.1',
39146
+ alternative: 'wp.components.Dropdown and wp.blockEditor.ListView'
39147
+ });
39148
  const hasBlocks = (0,external_wp_data_namespaceObject.useSelect)(select => !!select(store).getBlockCount(), []);
39149
  const isEnabled = hasBlocks && !isDisabled;
39150
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
39166
  className: "block-editor-block-navigation__container"
39167
  }, (0,external_wp_element_namespaceObject.createElement)("p", {
39168
  className: "block-editor-block-navigation__label"
39169
+ }, (0,external_wp_i18n_namespaceObject.__)('List view')), (0,external_wp_element_namespaceObject.createElement)(components_list_view, null))
 
 
 
39170
  });
39171
  }
39172
 
39896
 
39897
  /* harmony default export */ var block_variation_transforms = (__experimentalBlockVariationTransforms);
39898
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39899
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/color-palette/with-color-context.js
39900
 
39901
 
41265
  ;// CONCATENATED MODULE: ./packages/block-editor/build-module/components/image-editor/constants.js
41266
  const constants_MIN_ZOOM = 100;
41267
  const constants_MAX_ZOOM = 300;
41268
+ const image_editor_constants_POPOVER_PROPS = {
41269
  position: 'bottom right',
41270
  isAlternate: true
41271
  };
41626
  } = useImageEditingContext();
41627
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.Dropdown, {
41628
  contentClassName: "wp-block-image__zoom",
41629
+ popoverProps: image_editor_constants_POPOVER_PROPS,
41630
  renderToggle: _ref => {
41631
  let {
41632
  isOpen,
41722
  return (0,external_wp_element_namespaceObject.createElement)(external_wp_components_namespaceObject.DropdownMenu, {
41723
  icon: aspect_ratio,
41724
  label: (0,external_wp_i18n_namespaceObject.__)('Aspect Ratio'),
41725
+ popoverProps: image_editor_constants_POPOVER_PROPS,
41726
  toggleProps: toggleProps,
41727
  className: "wp-block-image__aspect-ratio"
41728
  }, _ref4 => {
42477
 
42478
  renderControl() {
42479
  const {
42480
+ label = null,
42481
  className,
42482
  isFullWidth,
42483
  instanceId,
42492
  suggestionsListboxId,
42493
  suggestionOptionIdPrefix
42494
  } = this.state;
42495
+ const inputId = `url-input-control-${instanceId}`;
42496
  const controlProps = {
42497
+ id: inputId,
42498
+ // Passes attribute to label for the for attribute
42499
  label,
42500
  className: classnames_default()('block-editor-url-input', className, {
42501
  'is-full-width': isFullWidth
42502
  })
42503
  };
42504
  const inputProps = {
42505
+ id: inputId,
42506
  value,
42507
  required: true,
42508
  className: 'block-editor-url-input__input',
42512
  placeholder,
42513
  onKeyDown: this.onKeyDown,
42514
  role: 'combobox',
42515
+ 'aria-label': label ? undefined : (0,external_wp_i18n_namespaceObject.__)('URL'),
42516
+ // Ensure input always has an accessible label
42517
  'aria-expanded': showSuggestions,
42518
  'aria-autocomplete': 'list',
42519
  'aria-owns': suggestionsListboxId,
48502
 
48503
 
48504
 
 
48505
 
48506
 
48507
 
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' => '0ea1dd48a433c928965110278f528535');
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' => 'a93c1602c5b58c0c16963c79f0e31df7');
build/block-editor/index.min.js CHANGED
@@ -1,33 +1,33 @@
1
- !function(){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:function(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:function(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:function(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 f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+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();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},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:function(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:function(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),f=o.offset(e),g=o.outerHeight(e),h=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:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(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:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(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 f(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 g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.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-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["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);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(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:g,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(g(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(g(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},h)},8575:function(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:function(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="&nbsp;","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:function(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:function(e,t,n){e.exports=n(5372)()},9567:function(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:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(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={},f=!0,g={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){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!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(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(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:function(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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Iv},AlignmentToolbar:function(){return xv},Autocomplete:function(){return Ov},BlockAlignmentControl:function(){return Vr},BlockAlignmentToolbar:function(){return Hr},BlockBreadcrumb:function(){return Gv},BlockColorsStyleSelector:function(){return Kv},BlockContextProvider:function(){return nl},BlockControls:function(){return io},BlockEdit:function(){return il},BlockEditorKeyboardShortcuts:function(){return yy},BlockEditorProvider:function(){return Rc},BlockFormatControls:function(){return lo},BlockIcon:function(){return Nc},BlockInspector:function(){return vy},BlockList:function(){return Bf},BlockMover:function(){return Up},BlockNavigationDropdown:function(){return mb},BlockPreview:function(){return rd},BlockSelectionClearer:function(){return Dc},BlockSettingsMenu:function(){return Wm},BlockSettingsMenuControls:function(){return Vm},BlockStyles:function(){return vb},BlockTitle:function(){return Tp},BlockToolbar:function(){return Xm},BlockTools:function(){return by},BlockVerticalAlignmentControl:function(){return dr},BlockVerticalAlignmentToolbar:function(){return pr},ButtonBlockAppender:function(){return vp},ButtonBlockerAppender:function(){return hp},ColorPalette:function(){return zb},ColorPaletteControl:function(){return Vb},ContrastChecker:function(){return dg},CopyHandler:function(){return Cm},DefaultBlockAppender:function(){return fp},FontSizePicker:function(){return oh},InnerBlocks:function(){return Ef},Inserter:function(){return mp},InspectorAdvancedControls:function(){return Vo},InspectorControls:function(){return Ho},JustifyContentControl:function(){return gr},JustifyToolbar:function(){return hr},LineHeightControl:function(){return zg},MediaPlaceholder:function(){return m_},MediaReplaceFlow:function(){return a_},MediaUpload:function(){return i_},MediaUploadCheck:function(){return s_},MultiSelectScrollIntoView:function(){return Ey},NavigableToolbar:function(){return Rp},ObserveTyping:function(){return By},PanelColorSettings:function(){return f_},PlainText:function(){return U_},RichText:function(){return V_},RichTextShortcut:function(){return j_},RichTextToolbarButton:function(){return K_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return dy},ToolSelector:function(){return Q_},Typewriter:function(){return Ny},URLInput:function(){return Ok},URLInputButton:function(){return ey},URLPopover:function(){return d_},Warning:function(){return al},WritingFlow:function(){return Yc},__experimentalBlockAlignmentMatrixControl:function(){return Vv},__experimentalBlockContentOverlay:function(){return Uv},__experimentalBlockFullHeightAligmentControl:function(){return zv},__experimentalBlockPatternSetup:function(){return Tb},__experimentalBlockPatternsList:function(){return Id},__experimentalBlockVariationPicker:function(){return kb},__experimentalBlockVariationTransforms:function(){return Mb},__experimentalBorderRadiusControl:function(){return Hf},__experimentalBorderStyleControl:function(){return Ob},__experimentalColorGradientControl:function(){return gg},__experimentalColorGradientSettingsDropdown:function(){return $b},__experimentalDateFormatPicker:function(){return Ub},__experimentalDuotoneControl:function(){return $h},__experimentalFontAppearanceControl:function(){return Fg},__experimentalFontFamilyControl:function(){return Yg},__experimentalGetBorderClassesAndStyles:function(){return sv},__experimentalGetColorClassesAndStyles:function(){return cv},__experimentalGetGradientClass:function(){return ig},__experimentalGetGradientObjectByGradientValue:function(){return ag},__experimentalGetMatchingVariation:function(){return Ly},__experimentalGetSpacingClassesAndStyles:function(){return pv},__experimentalImageEditingProvider:function(){return kk},__experimentalImageEditor:function(){return Tk},__experimentalImageSizeControl:function(){return Pk},__experimentalImageURLInputUI:function(){return ay},__experimentalLayoutStyle:function(){return Rr},__experimentalLetterSpacingControl:function(){return wh},__experimentalLibrary:function(){return ky},__experimentalLinkControl:function(){return o_},__experimentalLinkControlSearchInput:function(){return Yk},__experimentalLinkControlSearchItem:function(){return Vk},__experimentalLinkControlSearchResults:function(){return Uk},__experimentalListView:function(){return db},__experimentalPanelColorGradientSettings:function(){return Jb},__experimentalPreviewOptions:function(){return cy},__experimentalResponsiveBlockControl:function(){return $_},__experimentalTextDecorationControl:function(){return mh},__experimentalTextTransformControl:function(){return yh},__experimentalToolsPanelColorDropdown:function(){return hg},__experimentalUnitControl:function(){return Z_},__experimentalUseBlockPreview:function(){return ld},__experimentalUseBorderProps:function(){return av},__experimentalUseColorProps:function(){return dv},__experimentalUseCustomSides:function(){return Jo},__experimentalUseGradient:function(){return ug},__experimentalUseNoRecursiveRenders:function(){return Ry},__experimentalUseResizeCanvas:function(){return uy},__unstableBlockNameContext:function(){return Zm},__unstableBlockSettingsMenuFirstItem:function(){return Tm},__unstableBlockToolbarLastItem:function(){return vm},__unstableEditorStyles:function(){return ed},__unstableIframe:function(){return Xc},__unstableInserterMenuExtension:function(){return np},__unstablePresetDuotoneFilter:function(){return tv},__unstableRichTextInputEvent:function(){return q_},__unstableUseBlockSelectionClearer:function(){return Ac},__unstableUseClipboardHandler:function(){return Em},__unstableUseMouseMoveTypingReset:function(){return Sy},__unstableUseTypewriter:function(){return Ty},__unstableUseTypingObserver:function(){return wy},createCustomColorsHOC:function(){return vv},getColorClassName:function(){return $f},getColorObjectByAttributeValues:function(){return Uf},getColorObjectByColorValue:function(){return Wf},getFontSize:function(){return eh},getFontSizeClass:function(){return nh},getFontSizeObjectByValue:function(){return th},getGradientSlugByValue:function(){return cg},getGradientValueBySlug:function(){return sg},getPxFromCssUnit:function(){return Wy},store:function(){return Qn},storeConfig:function(){return Yn},transformStyles:function(){return Zu},useBlockDisplayInformation:function(){return Ip},useBlockEditContext:function(){return eo},useBlockProps:function(){return kc},useCachedTruthy:function(){return mv},useInnerBlocksProps:function(){return yf},useSetting:function(){return To},withColorContext:function(){return Fb},withColors:function(){return bv},withFontSizes:function(){return _v}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return zt},__experimentalGetAllowedBlocks:function(){return kt},__experimentalGetAllowedPatterns:function(){return Ct},__experimentalGetBlockListSettingsForBlocks:function(){return Tt},__experimentalGetDirectInsertBlock:function(){return _t},__experimentalGetGlobalBlocksByName:function(){return te},__experimentalGetLastBlockAttributeChanges:function(){return Mt},__experimentalGetParsedPattern:function(){return yt},__experimentalGetPatternTransformItems:function(){return wt},__experimentalGetPatternsByBlockTypes:function(){return St},__experimentalGetReusableBlockTitle:function(){return Nt},__unstableGetBlockWithoutInnerBlocks:function(){return q},__unstableGetClientIdWithClientIdsTree:function(){return Q},__unstableGetClientIdsTree:function(){return Z},__unstableGetSelectedBlocksWithPartialSelection:function(){return Le},__unstableIsFullySelected:function(){return Pe},__unstableIsLastBlockChangeIgnored:function(){return Pt},__unstableIsSelectionCollapsed:function(){return Me},__unstableIsSelectionMergeable:function(){return Re},areInnerBlocksControlled:function(){return Ft},canEditBlock:function(){return ct},canInsertBlockType:function(){return ot},canInsertBlocks:function(){return rt},canLockBlockType:function(){return ut},canMoveBlock:function(){return st},canMoveBlocks:function(){return at},canRemoveBlock:function(){return lt},canRemoveBlocks:function(){return it},didAutomaticChange:function(){return Dt},getAdjacentBlockClientId:function(){return ve},getBlock:function(){return K},getBlockAttributes:function(){return j},getBlockCount:function(){return oe},getBlockHierarchyRootClientId:function(){return ge},getBlockIndex:function(){return De},getBlockInsertionPoint:function(){return Qe},getBlockListSettings:function(){return Bt},getBlockMode:function(){return Ue},getBlockName:function(){return W},getBlockOrder:function(){return Ae},getBlockParents:function(){return me},getBlockParentsByBlockName:function(){return fe},getBlockRootClientId:function(){return pe},getBlockSelectionEnd:function(){return se},getBlockSelectionStart:function(){return ie},getBlockTransformItems:function(){return vt},getBlocks:function(){return Y},getBlocksByClientId:function(){return ne},getClientIdsOfDescendants:function(){return X},getClientIdsWithDescendants:function(){return J},getDraggedBlockClientIds:function(){return je},getFirstMultiSelectedBlockClientId:function(){return Se},getGlobalBlockCount:function(){return ee},getInserterItems:function(){return ht},getLastMultiSelectedBlockClientId:function(){return we},getLowestCommonAncestorWithSelectedBlock:function(){return he},getMultiSelectedBlockClientIds:function(){return Ee},getMultiSelectedBlocks:function(){return Ce},getMultiSelectedBlocksEndClientId:function(){return Ne},getMultiSelectedBlocksStartClientId:function(){return Te},getNextBlockClientId:function(){return ke},getPreviousBlockClientId:function(){return be},getSelectedBlock:function(){return de},getSelectedBlockClientId:function(){return ue},getSelectedBlockClientIds:function(){return ye},getSelectedBlockCount:function(){return ae},getSelectedBlocksInitialCaretPosition:function(){return _e},getSelectionEnd:function(){return le},getSelectionStart:function(){return re},getSettings:function(){return It},getTemplate:function(){return Je},getTemplateLock:function(){return et},hasBlockMovingClientId:function(){return At},hasInserterItems:function(){return bt},hasMultiSelection:function(){return Ve},hasSelectedBlock:function(){return ce},hasSelectedInnerBlock:function(){return Fe},isAncestorBeingDragged:function(){return qe},isAncestorMultiSelected:function(){return xe},isBlockBeingDragged:function(){return Ke},isBlockHighlighted:function(){return Ot},isBlockInsertionPointVisible:function(){return Ze},isBlockMultiSelected:function(){return Ie},isBlockSelected:function(){return Oe},isBlockValid:function(){return $},isBlockWithinSelection:function(){return ze},isCaretWithinFormattedText:function(){return Ye},isDraggingBlocks:function(){return $e},isFirstMultiSelectedBlock:function(){return Be},isLastBlockChangePersistent:function(){return xt},isMultiSelecting:function(){return He},isNavigationMode:function(){return Lt},isSelectionEnabled:function(){return Ge},isTyping:function(){return We},isValidTemplate:function(){return Xe},wasBlockJustInserted:function(){return Vt}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return vn},__unstableExpandSelection:function(){return kn},__unstableMarkAutomaticChange:function(){return zn},__unstableMarkLastChangeAsPersistent:function(){return On},__unstableMarkNextChangeAsNotPersistent:function(){return Fn},__unstableSaveReusableBlock:function(){return Dn},__unstableSplitSelection:function(){return bn},clearSelectedBlock:function(){return en},duplicateBlocks:function(){return Gn},enterFormattedText:function(){return Nn},exitFormattedText:function(){return Pn},flashBlock:function(){return jn},hideInsertionPoint:function(){return fn},insertAfterBlock:function(){return Wn},insertBeforeBlock:function(){return Un},insertBlock:function(){return dn},insertBlocks:function(){return pn},insertDefaultBlock:function(){return Rn},mergeBlocks:function(){return yn},moveBlockToPosition:function(){return un},moveBlocksDown:function(){return sn},moveBlocksToPosition:function(){return cn},moveBlocksUp:function(){return an},multiSelect:function(){return Jt},receiveBlocks:function(){return $t},removeBlock:function(){return Cn},removeBlocks:function(){return En},replaceBlock:function(){return rn},replaceBlocks:function(){return on},replaceInnerBlocks:function(){return Sn},resetBlocks:function(){return Gt},resetSelection:function(){return Wt},selectBlock:function(){return qt},selectNextBlock:function(){return Qt},selectPreviousBlock:function(){return Yt},selectionChange:function(){return Mn},setBlockMovingClientId:function(){return Hn},setHasControlledInnerBlocks:function(){return Kn},setNavigationMode:function(){return Vn},setTemplateValidity:function(){return gn},showInsertionPoint:function(){return mn},startDraggingBlocks:function(){return xn},startMultiSelect:function(){return Zt},startTyping:function(){return Bn},stopDraggingBlocks:function(){return Tn},stopMultiSelect:function(){return Xt},stopTyping:function(){return In},synchronizeTemplate:function(){return hn},toggleBlockHighlight:function(){return $n},toggleBlockMode:function(){return wn},toggleSelection:function(){return tn},updateBlock:function(){return Kt},updateBlockAttributes:function(){return jt},updateBlockListSettings:function(){return Ln},updateSettings:function(){return An},validateBlocksToTemplate:function(){return Ut}});var 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}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={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")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("Full Size")}],imageEditing:!0,maxWidth:580,allowedBlockTypes:!0,maxUploadFileSize:0,allowedMimeTypes:null,canLockBlocks:!0,__experimentalCanUserUseUnfilteredHTML:!1,__experimentalBlockDirectory:!1,__mobileEnablePageTemplates:!1,__experimentalBlockPatterns:[],__experimentalBlockPatternCategories:[],__experimentalSpotlightEntityBlocks:[],__unstableGalleryWithImageBlocks:!1,generateAnchors:!1,gradients:[{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("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)}function _(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,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(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)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(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 I(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 x=(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=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(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=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(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=I(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=I(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),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(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}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(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:!w(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,...C(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),...C(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,...S(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),...S(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=_(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=_(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=_(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,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(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),...y(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}});function T(){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}var N,P,M=(0,m.combineReducers)({blocks:x,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:T(r.selectionStart,l),selectionEnd:T(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]:h,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"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}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(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 D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(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(N)||((l=L()).isUniqueByDependants=a,s.set(N,l)),s.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),z=window.wp.richText,V=window.wp.deprecated,H=n.n(V);function G(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const U=[];function W(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 $(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function j(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function K(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const q=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:j(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function Y(e,t){var n;const o=t&&Ft(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||U}const Q=D(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Ae(e,t),(t=>Q(e,t)))}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...X(e,[t]));return n}),(e=>[e.blocks.order])),J=D((e=>{const t=[];for(const n of Ae(e))t.push(n,...X(e,[n]));return t}),(e=>[e.blocks.order])),ee=D(((e,t)=>{const n=J(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])),te=D(((e,t)=>{if(!t)return U;const n=J(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:U}),(e=>[e.blocks.order,e.blocks.byClientId])),ne=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>K(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function oe(e,t){return Ae(e,t).length}function re(e){return e.selection.selectionStart}function le(e){return e.selection.selectionEnd}function ie(e){return e.selection.selectionStart.clientId}function se(e){return e.selection.selectionEnd.clientId}function ae(e){return Ee(e).length||(e.selection.selectionStart.clientId?1:0)}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ue(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function de(e){const t=ue(e);return t?K(e,t):null}function pe(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const me=D((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])),fe=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=me(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:W(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=ue(e),o=[...me(e,t),t],r=[...me(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 ve(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ue(e)),void 0===t&&(t=n<0?Se(e):we(e)),!t)return null;const o=pe(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 be(e,t){return ve(e,t,-1)}function ke(e,t){return ve(e,t,1)}function _e(e){return e.initialPosition}const ye=D((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=pe(e,t.clientId);if(null===o)return U;const r=Ae(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 Ee(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?U:ye(e)}const Ce=D((e=>{const t=Ee(e);return t.length?t.map((t=>K(e,t))):U}),(e=>[...ye.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Se(e){return(0,u.first)(Ee(e))||null}function we(e){return(0,u.last)(Ee(e))||null}function Be(e,t){return Se(e)===t}function Ie(e,t){return-1!==Ee(e).indexOf(t)}const xe=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=pe(e,n),o=Ie(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Ne(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Pe(e){const t=re(e),n=le(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Me(e){const t=re(e),n=le(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Re(e,t){const n=re(e),o=le(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=pe(e,n.clientId);if(l!==pe(e,o.clientId))return!1;const i=Ae(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=K(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=K(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Le=e=>{const t=re(e),n=le(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=pe(e,t.clientId);if(o!==pe(e,n.clientId))return U;const l=Ae(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=K(e,a.clientId),d=(0,r.getBlockType)(u.name),p=K(e,c.clientId),m=(0,r.getBlockType)(p.name),f=u.attributes[a.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:f,...G(h)}),k=(0,z.create)({html:g,...G(v)});return b=(0,z.remove)(b,0,a.offset),k=(0,z.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,z.toHTMLString)({value:b,...G(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:k,...G(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||U}function De(e,t){return Ae(e,pe(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Ae(e,t),(t=>Oe(e,t)||Ie(e,t)||n&&Fe(e,t,n)))}function ze(e,t){if(!t)return!1;const n=Ee(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function He(e){return e.isMultiSelecting}function Ge(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function We(e){return e.isTyping}function $e(e){return!!e.draggedBlocks.length}function je(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!$e(e))return!1;const n=me(e,t);return(0,u.some)(n,(t=>Ke(e,t)))}function Ye(){return H()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=pe(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock:null}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},nt=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}=It(e),s=tt(i,t,!0);if(!s)return!1;const a=!!et(e,o);if(a)return!1;const c=Bt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=tt(d,t),m=n.parent,f=W(e,o),g=tt(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...me(e,o)];h=(0,u.some)(t,(t=>tt(v,W(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:K.bind(null,e),getBlockParentsByBlockName:fe.bind(null,e)}):b},ot=D(nt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,W(e,t),n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return!0;const{lock:r}=o,l=!!et(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return;const{lock:r}=o,l="all"===et(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>st(e,t,n)))}function ct(e,t){const n=j(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ut(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function dt(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 pt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&nt(e,t.name,n),mt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=dt(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:ft(r,l)}},ft=(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)(ne(e,J(e)),{name:t.name}));const{time:i,count:s=0}=dt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ft(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=D((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=F;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}=dt(e,l)||{},c=ft(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=>pt(e,n,t))).map(n),a=nt(e,"core/block",t)?Rt(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=mt(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,Rt(e),(0,r.getBlockTypes)()])),vt=D((function(e,t){var n;let o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const[l]=t,i=gt(e,{buildScope:"transform"}),s=(0,r.getBlockTypes)().filter((t=>pt(e,t,o))).map(i),a=(0,u.mapKeys)(s,(e=>{let{name:t}=e;return t}));a["*"]={frecency:1/0,id:"*",isDisabled:!1,name:"*",title:(0,g.__)("Unwrap"),icon:null===(n=a[l.name])||void 0===n?void 0:n.icon};const c=(0,r.getPossibleBlockTransformations)(t).reduce(((e,t)=>("*"===t?e.push(a["*"]):a[null==t?void 0:t.name]&&e.push(a[t.name]),e)),[]);return(0,u.orderBy)(c,(e=>a[e.name].frecency),"desc")}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.preferences.insertUsage,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>pt(e,n,t)));if(n)return!0;const o=nt(e,"core/block",t)&&Rt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Rt(e),(0,r.getBlockTypes)()])),kt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>pt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),_t=D((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(K(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),yt=D(((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])),Et=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!tt(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])),Ct=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Et(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return ot(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),St=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return U;const o=Ct(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)=>[...Ct.getDependants(e,t)])),wt=D((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||Ft(e,n)})))return U;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=D((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])),Nt=D(((e,t)=>{var n;const o=(0,u.find)(Rt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Rt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Mt(e){return e.lastBlockAttributesChange}function Rt(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 Lt(e){return e.isNavigationMode}function At(e){return e.hasBlockMovingClientId}function Dt(e){return!!e.automaticChangeStatus}function Ot(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const zt=D(((e,t)=>{if(!t.length)return null;const n=ue(e);if(t.includes(W(e,n)))return n;const o=Ee(e),r=fe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Vt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Ht=window.wp.a11y;const Gt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Ut(e))},Ut=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 Wt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function $t(e){return H()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function jt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Kt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function qt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Zt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Jt=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,Ht.speak)((0,g.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
- (0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function en(){return{type:"CLEAR_SELECTED_BLOCK"}}function tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function nn(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 on=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=(0,u.castArray)(e),t=nn((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));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 rn(e,t){return on(e,t)}const ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},sn=ln("MOVE_BLOCKS_DOWN"),an=ln("MOVE_BLOCKS_UP"),cn=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 un(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 cn([e],t,n,o)}function dn(e,t,n,o,r){return pn([e],t,n,o,0,r)}const pn=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;(0,u.isObject)(r)&&(l=r,r=0,H()("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=nn((0,u.castArray)(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 mn(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 fn(){return{type:"HIDE_INSERTION_POINT"}}function gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const hn=()=>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)},vn=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 d,p;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(d=s,p=i):(d=i,p=s);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],S=k.attributes[h.attributeKey],w=y.attributes[v.attributeKey];let B=(0,z.create)({html:E,...G(S)}),I=(0,z.create)({html:C,...G(w)});B=(0,z.remove)(B,h.offset,B.text.length),I=(0,z.insert)(I,"†",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...G(S)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,z.toHTMLString)({value:I,...G(w)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=g.merge(e.attributes,T.attributes)}else{const e=P.shift();M=g.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),L=M[R],A=(0,z.create)({html:L,...G(g.attributes[R])}),D=A.text.indexOf("†"),O=(0,z.remove)(A,D,D+1),F=(0,z.toHTMLString)({value:O,...G(g.attributes[R])});M[R]=F;const V=o.getSelectedBlockClientIds(),H=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(V,H,0,o.getSelectedBlocksInitialCaretPosition())}))},bn=()=>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),f=t.getBlock(d.clientId),g=(0,r.getBlockType)(f.name),h=p.attributes[u.attributeKey],v=f.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=g.attributes[d.attributeKey];let _=(0,z.create)({html:h,...G(b)}),y=(0,z.create)({html:v,...G(k)});_=(0,z.remove)(_,u.offset,_.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:_,...G(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...G(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},kn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},yn=(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),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("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 k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],n=(0,z.insert)((0,z.create)({html:t,...G(v)}),"†",h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...G(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),t=E[e],n=(0,z.create)({html:t,...G(d.attributes[e])}),o=n.text.indexOf("†"),r=(0,z.remove)(n,o,o+1),i=(0,z.toHTMLString)({value:r,...G(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},En=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=(0,u.castArray)(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 Cn(e,t){return En([e],t)}function Sn(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 wn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Bn(){return{type:"START_TYPING"}}function In(){return{type:"STOP_TYPING"}}function xn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Tn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Nn(){return H()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Pn(){return H()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Mn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Rn=(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 Ln(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function An(e){return{type:"UPDATE_SETTINGS",settings:e}}function Dn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function On(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Fn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const zn=()=>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"})}))},Vn=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,Ht.speak)((0,g.__)("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,Ht.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Hn=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,Ht.speak)((0,g.__)("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."))}},Gn=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((0,u.some)(i,(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=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Un=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)},Wn=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 $n(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const jn=e=>async t=>{let{dispatch:n}=t;n($n(e,!0)),await new Promise((e=>setTimeout(e,150))),n($n(e,!1))};function Kn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const qn="core/block-editor",Yn={reducer:M,selectors:e,actions:t},Qn=(0,m.createReduxStore)(qn,{...Yn,persist:["preferences"]});(0,m.registerStore)(qn,{...Yn,persist:["preferences"]});const Zn={name:"",isSelected:!1},Xn=(0,s.createContext)(Zn),{Provider:Jn}=Xn;function eo(){return(0,s.useContext)(Xn)}function to(){const{isSelected:e,clientId:t,name:n}=eo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Qn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function no(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=to(),{clientId:o}=eo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Qn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document: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 oo(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[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 ro=no;ro.Slot=oo;const lo=e=>(0,s.createElement)(no,i({group:"inline"},e));lo.Slot=e=>(0,s.createElement)(oo,i({group:"inline"},e));var io=ro,so=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),ao=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),co=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),uo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),po=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"})),mo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"})),fo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),go=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),ho=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),vo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),bo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),ko=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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}`)).join(",")}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}=eo();return(0,m.useSelect)((n=>{var o;if(Bo.includes(e))return void console.warn("Top level useSetting paths are disabled. Please use a subpath to query the information needed.");const l=n(Qn).getSettings(),i=(e=>xo[e]||e)(e),s=`__experimentalFeatures.${i}`,a=`__experimentalFeatures.blocks.${t}.${i}`,c=null!==(o=(0,u.get)(l,a))&&void 0!==o?o:(0,u.get)(l,s);var d,p;if(void 0!==c)return r.__EXPERIMENTAL_PATHS_WITH_MERGE[i]?null!==(d=null!==(p=c.custom)&&void 0!==p?p:c.theme)&&void 0!==d?d:c.default:c;const m=Io[i]?Io[i](l):void 0;return void 0!==m?m:"typography.dropCap"===i||void 0}),[t,e])}window.wp.warning;var 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=to(),l=null===(t=No[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document: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 Mo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Mo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Ro(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function Lo(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:Ro(c.attributes,e,t)})}))})),c}function Ao(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 Do(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Qn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Qn),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:Mo(r.style)},t[n]=r})),r(n,t,!0)}),[Mo,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 Oo(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 Fo(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)(Do,{group:n,label:o},(0,s.createElement)(Oo,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const zo=Po;zo.Slot=Fo;const Vo=e=>(0,s.createElement)(Po,i({},e,{__experimentalGroup:"advanced"}));Vo.Slot=e=>(0,s.createElement)(Fo,i({},e,{__experimentalGroup:"advanced"})),Vo.slotName="InspectorAdvancedControls";var Ho=zo;function Go(e){const t=(0,r.getBlockSupport)(e,qo);return!!(!0===t||null!=t&&t.margin)}function Uo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.margin"),n=!er(e,"margin");return!Go(e)||t||n}function Wo(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=Jo(n,"margin"),a=i&&i.some((e=>Qo.includes(e)));return Uo(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:Mo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{margin:e}};r({style:Mo(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function $o(e){const t=(0,r.getBlockSupport)(e,qo);return!!(!0===t||null!=t&&t.padding)}function jo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("spacing.padding"),n=!er(e,"padding");return!$o(e)||t||n}function Ko(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=Jo(n,"padding"),a=i&&i.some((e=>Qo.includes(e)));return jo(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:Mo(t)})},onChangeShowVisualizer:e=>{const t={...o,visualizers:{padding:e}};r({style:Mo(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}const qo="spacing",Yo=["top","right","bottom","left"],Qo=["vertical","horizontal"];function Zo(e){const t=or(e),n=jo(e),o=Uo(e),l=Xo(e),i=(a=e.name,"web"===s.Platform.OS&&(tr(a)||$o(a)||Go(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[qo,"__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)(Ho,{__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,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Ko,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,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Wo,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,g.__)("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)(rr,e)))}const Xo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=or(e),n=jo(e),o=Uo(e);return t&&n&&o};function Jo(e,t){const n=(0,r.getBlockSupport)(e,qo);if(n&&"boolean"!=typeof n[t])return n[t]}function er(e,t){const n=Jo(e,t);return!(n&&n.some((e=>Yo.includes(e)))&&n.some((e=>Qo.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,qo);return!!(!0===t||null!=t&&t.blockGap)}function nr(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 or(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("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:To("spacing.units")||["%","px","em","rem","vw"]}),a=Jo(r,"blockGap"),c=So(n);if(or(e))return null;const u=a&&a.some((e=>Qo.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:Mo(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),f=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,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const lr=(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"})),ir=(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"})),sr={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,g._x)("Align top","Block vertical alignment setting")},center:{icon:ir,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:lr,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},ar=["top","center","bottom"],cr={isAlternate:!0};var ur=function(e){let{value:t,onChange:n,controls:o=ar,isCollapsed:r=!0,isToolbar:l}=e;const a=sr[t],c=sr.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:cr,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...sr[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const dr=e=>(0,s.createElement)(ur,i({},e,{isToolbar:!1})),pr=e=>(0,s.createElement)(ur,i({},e,{isToolbar:!0})),mr={left:fo,center:go,right:ho,"space-between":vo};var fr=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?mr[r]:mr.left,d=[{name:"left",icon:fo,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:go,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:ho,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:vo,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const gr=e=>(0,s.createElement)(fr,i({},e,{isToolbar:!1})),hr=e=>(0,s.createElement)(fr,i({},e,{isToolbar:!0})),vr={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},br={left:"flex-start",right:"flex-end",center:"center"},kr={top:"flex-start",center:"center",bottom:"flex-end"},_r=["wrap","nowrap"];var yr={name:"flex",label:(0,g.__)("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)(Cr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(wr,{layout:t,onChange:n}))),(0,s.createElement)(Sr,{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)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Cr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Er,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i}=e;const{orientation:a="horizontal"}=r,c=null!==To("spacing.blockGap"),u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!Ao(i,"spacing","blockGap")?function(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}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):"var( --wp--style--block-gap, 0.5em )",d=vr[r.justifyContent]||vr.left,p=_r.includes(r.flexWrap)?r.flexWrap:"wrap",m=`\n\t\tflex-direction: row;\n\t\talign-items: ${kr[r.verticalAlignment]||kr.center};\n\t\tjustify-content: ${d};\n\t\t`,f=`\n\t\tflex-direction: column;\n\t\talign-items: ${br[r.justifyContent]||br.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${_o(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${p};\n\t\t\t\t\tgap: ${c?u:"0.5em"};\n\t\t\t\t\t${"horizontal"===a?m:f}\n\t\t\t\t}\n\n\t\t\t\t${_o(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Er(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=kr.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(dr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,g.__)("Align items top")},{value:"center",label:(0,g.__)("Align items center")},{value:"flex-end",label:(0,g.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,g.__)("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 Cr(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)(gr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:fo,label:(0,g.__)("Justify items left")},{value:"center",icon:go,label:(0,g.__)("Justify items center")},{value:"right",icon:ho,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:vo,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("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 Sr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function wr(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,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:bo,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:ko,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var Br=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})};const Ir=[{name:"default",label:(0,g.__)("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,g.__)("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)(Br,{icon:co})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("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)(Br,{icon:po}))),(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,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:a}=o,c=null!==To("spacing.blockGap"),u=nr(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!Ao(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${_o(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\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(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${_o(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${_o(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${_o(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${_o(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${_o(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${_o(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},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,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
- o.wide=(0,g.sprintf)((0,g.__)("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}},yr];function xr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Ir.find((t=>t.name===e))}const Tr={type:"default"},Nr=(0,s.createContext)(Tr),Pr=Nr.Provider;function Mr(){return(0,s.useContext)(Nr)}function Rr(e){let{layout:t={},...n}=e;const o=xr(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Lr=["none","left","center","right","wide","full"],Ar=["wide","full"];function Dr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Lr;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Mr(),r=xr(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=Lr}=o,s=e.filter((e=>(o.alignments||t||!Ar.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}const Or={none:{icon:so,title:(0,g._x)("None","Alignment option")},left:{icon:ao,title:(0,g.__)("Align left")},center:{icon:co,title:(0,g.__)("Align center")},right:{icon:uo,title:(0,g.__)("Align right")},wide:{icon:po,title:(0,g.__)("Wide width")},full:{icon:mo,title:(0,g.__)("Full width")}},Fr={isAlternate:!0};var zr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=Dr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Or[t],m=Or.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:Fr,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r||s.Platform.isNative?{isCollapsed:r?l:void 0,controls:a.map((e=>{let{name:n}=e;return{...Or[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}=Or[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)(f,i({},h,v))};const Vr=e=>(0,s.createElement)(zr,i({},e,{isToolbar:!1})),Hr=e=>(0,s.createElement)(zr,i({},e,{isToolbar:!0})),Gr=["left","center","right","wide","full"],Ur=["wide","full"];function Wr(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)?Gr.filter((t=>e.includes(t))):!0===e?[...Gr]:[],!o||!0===e&&!n?(0,u.without)(t,...Ur):t}const $r=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=Dr(Wr((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)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Vr,{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"),jr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=Dr(Wr((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:[...Gr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",jr),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",$r),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Wr((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 Kr=/[\s#]/g,qr={type:"string",source:"attribute",attribute:"id",selector:"*"},Yr=(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,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("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,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("Add an anchor"),onChange:e=>{e=e.replace(Kr,"-"),t.setAttributes({anchor:e})},autoCapitalize:"none",autoComplete:"off"});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(e,t),n&&(0,s.createElement)(Ho,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Ho,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("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:qr}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",Yr),(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 Qr=(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)(Ho,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");function Zr(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}(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",Qr),(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 Xr=[{name:"margin",generate:(e,t)=>Zr(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>Zr(e,t,["spacing","padding"],"padding")}];function Jr(e,t){const n=[];return Xr.forEach((o=>{n.push(...o.generate(e,t))})),n}var el=window.wp.dom;const tl=(0,s.createContext)({});function nl(e){let{value:t,children:n}=e;const o=(0,s.useContext)(tl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(tl.Provider,{value:r,children:n})}var ol=tl;const rl={};var ll=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(ol),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):rl),[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 il(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Jn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(ll,e))}var sl=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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",{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:sl,label:(0,g.__)("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)))))))))},cl=n(1973);function ul(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,el.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var dl=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,f=a,(0,cl.Kx)(m,f).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,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(ul,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(ul,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const pl=e=>(0,r.rawHandler)({HTML:e.originalContent});var ml=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Qn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Qn);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,pl(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)),[]),f=(0,s.useMemo)((()=>[{
8
  // translators: Button to fix block content
9
- title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(al,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
10
- (0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(dl,{block:i,onKeep:t,onConvert:n,convertor:pl,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const fl=(0,s.createElement)(al,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var gl=()=>fl;class hl 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}}var vl=hl,bl=n(773),kl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Qn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(bl.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 _l=Al();const yl=e=>Pl(e,_l);let El=Al();yl.write=e=>Pl(e,El);let Cl=Al();yl.onStart=e=>Pl(e,Cl);let Sl=Al();yl.onFrame=e=>Pl(e,Sl);let wl=Al();yl.onFinish=e=>Pl(e,wl);let Bl=[];yl.setTimeout=(e,t)=>{let n=yl.now()+t,o=()=>{let e=Bl.findIndex((e=>e.cancel==o));~e&&Bl.splice(e,1),Ol.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Bl.splice(Il(n),0,r),Ol.count+=1,Ml(),r};let Il=e=>~(~Bl.findIndex((t=>t.time>e))||~Bl.length);yl.cancel=e=>{_l.delete(e),El.delete(e)},yl.sync=e=>{Nl=!0,yl.batchedUpdates(e),Nl=!1},yl.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,yl.onStart(n)}return o.handler=e,o.cancel=()=>{Cl.delete(n),t=null},o};let xl="undefined"!=typeof window?window.requestAnimationFrame:()=>{};yl.use=e=>xl=e,yl.now="undefined"!=typeof performance?()=>performance.now():Date.now,yl.batchedUpdates=e=>e(),yl.catch=console.error,yl.frameLoop="always",yl.advance=()=>{"demand"!==yl.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Ll()};let Tl=-1,Nl=!1;function Pl(e,t){Nl?(t.delete(e),e(0)):(t.add(e),Ml())}function Ml(){Tl<0&&(Tl=0,"demand"!==yl.frameLoop&&xl(Rl))}function Rl(){~Tl&&(xl(Rl),yl.batchedUpdates(Ll))}function Ll(){let e=Tl;Tl=yl.now();let t=Il(Tl);t&&(Dl(Bl.splice(0,t),(e=>e.handler())),Ol.count-=t),Cl.flush(),_l.flush(e?Math.min(64,Tl-e):16.667),Sl.flush(),El.flush(),wl.flush()}function Al(){let e=new Set,t=e;return{add(n){Ol.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Ol.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Ol.count-=t.size,Dl(t,(t=>t(n)&&e.add(t))),Ol.count+=e.size,t=e)}}}function Dl(e,t){e.forEach((e=>{try{t(e)}catch(e){yl.catch(e)}}))}const Ol={count:0,clear(){Tl=-1,Bl=[],Cl=Al(),_l=Al(),Sl=Al(),El=Al(),wl=Al(),Ol.count=0}};var Fl=n(9196),zl=n.n(Fl);function Vl(){}const Hl={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 Gl(e,t){if(Hl.arr(e)){if(!Hl.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 Ul=(e,t)=>e.forEach(t);function Wl(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const $l=e=>Hl.und(e)?[]:Hl.arr(e)?e:[e];function jl(e,t){if(e.size){const n=Array.from(e);e.clear(),Ul(n,t)}}const Kl=(e,...t)=>jl(e,(e=>e(...t)));let ql,Yl,Ql=null,Zl=!1,Xl=Vl;var Jl=Object.freeze({__proto__:null,get createStringInterpolator(){return ql},get to(){return Yl},get colors(){return Ql},get skipAnimation(){return Zl},get willAdvance(){return Xl},assign:e=>{e.to&&(Yl=e.to),e.now&&(yl.now=e.now),void 0!==e.colors&&(Ql=e.colors),null!=e.skipAnimation&&(Zl=e.skipAnimation),e.createStringInterpolator&&(ql=e.createStringInterpolator),e.requestAnimationFrame&&yl.use(e.requestAnimationFrame),e.batchedUpdates&&(yl.batchedUpdates=e.batchedUpdates),e.willAdvance&&(Xl=e.willAdvance),e.frameLoop&&(yl.frameLoop=e.frameLoop)}});const ei=new Set;let ti=[],ni=[],oi=0;const ri={get idle(){return!ei.size&&!ti.length},start(e){oi>e.priority?(ei.add(e),yl.onStart(li)):(ii(e),yl(ai))},advance:ai,sort(e){if(oi)yl.onFrame((()=>ri.sort(e)));else{const t=ti.indexOf(e);~t&&(ti.splice(t,1),si(e))}},clear(){ti=[],ei.clear()}};function li(){ei.forEach(ii),ei.clear(),yl(ai)}function ii(e){ti.includes(e)||si(e)}function si(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 ai(e){const t=ni;for(let n=0;n<ti.length;n++){const o=ti[n];oi=o.priority,o.idle||(Xl(o),o.advance(e),o.idle||t.push(o))}return oi=0,ni=ti,ni.length=0,ti=t,ti.length>0}const ci="[-+]?\\d*\\.?\\d+",ui=ci+"%";function di(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const pi=new RegExp("rgb"+di(ci,ci,ci)),mi=new RegExp("rgba"+di(ci,ci,ci,ci)),fi=new RegExp("hsl"+di(ci,ui,ui)),gi=new RegExp("hsla"+di(ci,ui,ui,ci)),hi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,vi=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,bi=/^#([0-9a-fA-F]{6})$/,ki=/^#([0-9a-fA-F]{8})$/;function _i(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=_i(r,o,e+1/3),i=_i(r,o,e),s=_i(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function Ei(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Ci(e){return(parseFloat(e)%360+360)%360/360}function Si(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function wi(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Bi(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=bi.exec(e))?parseInt(t[1]+"ff",16)>>>0:Ql&&void 0!==Ql[e]?Ql[e]:(t=pi.exec(e))?(Ei(t[1])<<24|Ei(t[2])<<16|Ei(t[3])<<8|255)>>>0:(t=mi.exec(e))?(Ei(t[1])<<24|Ei(t[2])<<16|Ei(t[3])<<8|Si(t[4]))>>>0:(t=hi.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=vi.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=fi.exec(e))?(255|yi(Ci(t[1]),wi(t[2]),wi(t[3])))>>>0:(t=gi.exec(e))?(yi(Ci(t[1]),wi(t[2]),wi(t[3]))|Si(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 Ii=(e,t,n)=>{if(Hl.fun(e))return e;if(Hl.arr(e))return Ii({range:e,output:t,extrapolate:n});if(Hl.str(e.output[0]))return ql(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 xi(){return(xi=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 Ti=Symbol.for("FluidValue.get"),Ni=Symbol.for("FluidValue.observers"),Pi=e=>Boolean(e&&e[Ti]),Mi=e=>e&&e[Ti]?e[Ti]():e,Ri=e=>e[Ni]||null;function Li(e,t){let n=e[Ni];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Ai{constructor(e){if(this[Ti]=void 0,this[Ni]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Di(this,e)}}const Di=(e,t)=>zi(e,Ti,t);function Oi(e,t){if(e[Ti]){let n=e[Ni];n||zi(e,Ni,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Fi(e,t){let n=e[Ni];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Ni]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const zi=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),Vi=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Hi=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let Gi;const Ui=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Wi=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,$i=e=>{Gi||(Gi=Ql?new RegExp(`(${Object.keys(Ql).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Mi(e).replace(Hi,Bi).replace(Gi,Bi))),n=t.map((e=>e.match(Vi).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=>Ii(xi({},e,{output:t}))));return e=>{let n=0;return t[0].replace(Vi,(()=>String(o[n++](e)))).replace(Ui,Wi)}},ji="react-spring: ",Ki=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${ji}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},qi=Ki(console.warn),Yi=Ki(console.warn);function Qi(e){return Hl.str(e)&&("#"==e[0]||/\d/.test(e)||e in(Ql||{}))}const Zi=e=>(0,Fl.useEffect)(e,Xi),Xi=[];function Ji(){const e=(0,Fl.useState)()[1],t=(0,Fl.useState)(es)[0];return Zi(t.unmount),()=>{t.current&&e({})}}function es(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function ts(e){const t=(0,Fl.useRef)();return(0,Fl.useEffect)((()=>{t.current=e})),t.current}const ns="undefined"!=typeof window&&window.document&&window.document.createElement?Fl.useLayoutEffect:Fl.useEffect,os=Symbol.for("Animated:node"),rs=e=>e&&e[os],ls=(e,t)=>{return n=e,o=os,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},is=e=>e&&e[os]&&e[os].getPayload();class ss{constructor(){this.payload=void 0,ls(this,this)}getPayload(){return this.payload||[]}}class as extends ss{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,Hl.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new as(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Hl.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,Hl.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class cs extends as{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Ii({output:[e,e]})}static create(e){return new cs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Hl.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=Ii({output:[this.getValue(),e]})),this._value=0,super.reset()}}const us={dependencies:null};class ds extends ss{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Wl(this.source,((n,o)=>{var r;(r=n)&&r[os]===r?t[o]=n.getValue(e):Pi(n)?t[o]=Mi(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Ul(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Wl(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){us.dependencies&&Pi(e)&&us.dependencies.add(e);const t=is(e);t&&Ul(t,(e=>this.add(e)))}}class ps extends ds{constructor(e){super(e)}static create(e){return new ps(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(ms)),!0)}}function ms(e){return(Qi(e)?cs:as).create(e)}function fs(e){const t=rs(e);return t?t.constructor:Hl.arr(e)?ps:Qi(e)?cs:as}function gs(){return(gs=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 hs=(e,t)=>{const n=!Hl.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Fl.forwardRef)(((o,r)=>{const l=(0,Fl.useRef)(null),i=n&&(0,Fl.useCallback)((e=>{l.current=function(e,t){return e&&(Hl.fun(e)?e(t):e.current=t),t}(r,e)}),[r]),[s,a]=function(e,t){const n=new Set;return us.dependencies=n,e.style&&(e=gs({},e,{style:t.createAnimatedStyle(e.style)})),e=new ds(e),us.dependencies=null,[e,n]}(o,t),c=Ji(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new vs(u,a),p=(0,Fl.useRef)();ns((()=>{const e=p.current;p.current=d,Ul(a,(e=>Oi(e,d))),e&&(Ul(e.deps,(t=>Fi(t,e))),yl.cancel(e.update))})),(0,Fl.useEffect)(u,[]),Zi((()=>()=>{const e=p.current;Ul(e.deps,(t=>Fi(t,e)))}));const m=t.getComponentProps(s.getValue());return Fl.createElement(e,gs({},m,{ref:i}))}))};class vs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&yl.write(this.update)}}const bs=Symbol.for("AnimatedComponent"),ks=e=>Hl.str(e)?e:e&&Hl.str(e.displayName)?e.displayName:Hl.fun(e)&&e.name||null;function _s(){return(_s=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 ys(e,...t){return Hl.fun(e)?e(...t):e}const Es=(e,t)=>!0===e||!!(t&&e&&(Hl.fun(e)?e(t):$l(e).includes(t))),Cs=(e,t)=>Hl.obj(e)?t&&e[t]:e,Ss=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,ws=e=>e,Bs=(e,t=ws)=>{let n=Is;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);Hl.und(n)||(o[r]=n)}return o},Is=["config","onProps","onStart","onChange","onPause","onResume","onRest"],xs={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 Ts(e){const t=function(e){const t={};let n=0;if(Wl(e,((e,o)=>{xs[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Wl(e,((e,o)=>o in t||(n[o]=e))),n}return _s({},e)}function Ns(e){return e=Mi(e),Hl.arr(e)?e.map(Ns):Qi(e)?Jl.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Ps(e){for(const t in e)return!0;return!1}function Ms(e){return Hl.fun(e)||Hl.arr(e)&&Hl.obj(e[0])}function Rs(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Ls(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const As=_s({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Ds{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,As)}}function Os(e,t){if(Hl.und(t.decay)){const n=!Hl.und(t.tension)||!Hl.und(t.friction);!n&&Hl.und(t.frequency)&&Hl.und(t.damping)&&Hl.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Fs=[];class zs{constructor(){this.changed=!1,this.values=Fs,this.toValues=null,this.fromValues=Fs,this.to=void 0,this.from=void 0,this.config=new Ds,this.immediate=!1}}function Vs(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=Es(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Hl.und(n.pause)||(r.paused=Es(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||Es(e,t)),c=ys(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-yl.now()}function m(){c>0?(u=yl.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(_s({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Hs=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Ws(e.get()):t.every((e=>e.noop))?Gs(e.get()):Us(e.get(),t.every((e=>e.finished))),Gs=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Us=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Ws=e=>({value:e,cancelled:!0,finished:!1});function $s(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=Bs(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)&&Ws(o)||r!==n.asyncId&&Us(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Ks,i=new qs;return(async()=>{if(Jl.skipAnimation)throw js(n),i.result=Us(o,!1),d(i),i;m(l);const s=Hl.obj(e)?_s({},e):_s({},t,{to:e});s.parentId=r,Wl(c,((e,t)=>{Hl.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 g;if(Jl.skipAnimation)return js(n),Us(o,!1);try{let t;t=Hl.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Us(o.get(),!0,!1)}catch(e){if(e instanceof Ks)g=e.result;else{if(!(e instanceof qs))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Hl.fun(i)&&yl.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function js(e,t){jl(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Ks 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 qs extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const Ys=e=>e instanceof Zs;let Qs=1;class Zs extends Ai{constructor(...e){super(...e),this.id=Qs++,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=rs(this);return e&&e.getValue()}to(...e){return Jl.to(this,e)}interpolate(...e){return qi(`${ji}The "interpolate" function is deprecated in v9 (use "to" instead)`),Jl.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){Li(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ri.sort(this),Li(this,{type:"priority",parent:this,priority:e})}}const Xs=Symbol.for("SpringPhase"),Js=e=>(1&e[Xs])>0,ea=e=>(2&e[Xs])>0,ta=e=>(4&e[Xs])>0,na=(e,t)=>t?e[Xs]|=3:e[Xs]&=-3,oa=(e,t)=>t?e[Xs]|=4:e[Xs]&=-5;class ra extends Zs{constructor(e,t){if(super(),this.key=void 0,this.animation=new zs,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Hl.und(e)||!Hl.und(t)){const n=Hl.obj(e)?_s({},e):_s({},t,{from:e});Hl.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(ea(this)||this._state.asyncTo)||ta(this)}get goal(){return Mi(this.animation.to)}get velocity(){const e=rs(this);return e instanceof as?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return Js(this)}get isAnimating(){return ea(this)}get isPaused(){return ta(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=is(o.to);!i&&Pi(o.to)&&(l=$l(Mi(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==cs?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=Hl.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Hl.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=!Hl.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}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=rs(this),a=s.getValue();if(t){const e=Mi(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 yl.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ea(this)){const{to:e,config:t}=this.animation;yl.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 Hl.und(e)?(n=this.queue||[],this.queue=[]):n=[Hl.obj(e)?e:_s({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Hs(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),js(this._state,e&&this._lastCallId),yl.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=Hl.obj(n)?n[t]:n,(null==n||Ms(n))&&(n=void 0),o=Hl.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return Js(this)||(e.reverse&&([n,o]=[o,n]),o=Mi(o),Hl.und(o)?rs(this)||this._set(n):this._set(o)),r}_update(e,t){let n=_s({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Bs(n,((e,t)=>/^on/.test(t)?Cs(e,o):e))),da(this,n,"onProps"),pa(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 Vs(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{ta(this)||(oa(this,!0),Kl(i.pauseQueue),pa(this,"onPause",Us(this,la(this,this.animation.to)),this))},resume:()=>{ta(this)&&(oa(this,!1),ea(this)&&this._resume(),Kl(i.resumeQueue),pa(this,"onResume",Us(this,la(this,this.animation.to)),this))},start:this._merge.bind(this,l)}}).then((e=>{if(n.loop&&e.finished&&(!t||!e.noop)){const e=ia(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Ws(this));const o=!Hl.und(e.to),r=!Hl.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Ws(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&&!Hl.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!Gl(d,c);p&&(s.from=d),d=Mi(d);const m=!Gl(u,a);m&&this._focus(u);const f=Ms(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Os(n=_s({},n),t),t=_s({},n,t)),Os(e,t),Object.assign(e,t);for(const t in As)null==e[t]&&(e[t]=As[t]);let{mass:o,frequency:r,damping:l}=e;Hl.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)}(g,ys(t.config,l),t.config!==i.config?ys(i.config,l):void 0);let b=rs(this);if(!b||Hl.und(u))return n(Us(this,!0));const k=Hl.und(t.reset)?r&&!t.default:!Hl.und(d)&&Es(t.reset,l),_=k?d:this.get(),y=Ns(u),E=Hl.num(y)||Hl.arr(y)||Qi(y),C=!f&&(!E||Es(i.immediate||t.immediate,l));if(m){const e=fs(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=Pi(u),B=!1;if(!w){const e=k||!Js(this)&&p;(m||e)&&(B=Gl(Ns(_),y),w=!B),(Gl(s.immediate,C)||C)&&Gl(g.decay,h)&&Gl(g.velocity,v)||(w=!0)}if(B&&ea(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Pi(a))&&(s.values=b.getPayload(),s.toValues=Pi(u)?null:S==cs?[1]:$l(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Ul(ua,(e=>da(this,t,e)));const o=Us(this,la(this,a));Kl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&yl.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?ys(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n($s(t.to,t,this._state,this)):w?this._start():ea(this)&&!m?this._pendingCalls.add(n):n(Gs(_))}_focus(e){const t=this.animation;e!==t.to&&(Ri(this)&&this._detach(),t.to=e,Ri(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Pi(t)&&(Oi(t,this),Ys(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Pi(e)&&Fi(e,this)}_set(e,t=!0){const n=Mi(e);if(!Hl.und(n)){const e=rs(this);if(!e||!Gl(n,e.getValue())){const o=fs(n);e&&e.constructor==o?e.setValue(n):ls(this,o.create(n)),e&&yl.batchedUpdates((()=>{this._onChange(n,t)}))}}return rs(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,pa(this,"onStart",Us(this,la(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),ys(this.animation.onChange,e,this)),ys(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;rs(this).reset(Mi(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),ea(this)||(na(this,!0),ta(this)||this._resume())}_resume(){Jl.skipAnimation?this.finish():ri.start(this)}_stop(e,t){if(ea(this)){na(this,!1);const n=this.animation;Ul(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Li(this,{type:"idle",parent:this});const o=t?Ws(this.get()):Us(this.get(),la(this,null!=e?e:n.to));Kl(this._pendingCalls,o),n.changed&&(n.changed=!1,pa(this,"onRest",o,this))}}}function la(e,t){const n=Ns(t);return Gl(Ns(e.get()),n)}function ia(e,t=e.loop,n=e.to){let o=ys(t);if(o){const r=!0!==o&&Ts(o),l=(r||e).reverse,i=!r||r.reset;return sa(_s({},e,{loop:t,default:!1,pause:void 0,to:!l||Ms(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function sa(e){const{to:t,from:n}=e=Ts(e),o=new Set;return Hl.obj(t)&&ca(t,o),Hl.obj(n)&&ca(n,o),e.keys=o.size?Array.from(o):null,e}function aa(e){const t=sa(e);return Hl.und(t.default)&&(t.default=Bs(t)),t}function ca(e,t){Wl(e,((e,n)=>null!=e&&t.add(n)))}const ua=["onStart","onRest","onChange","onPause","onResume"];function da(e,t,n){e.animation[n]=t[n]!==Ss(t,n)?Cs(t[n],e.key):void 0}function pa(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 ma=["onStart","onChange","onRest"];let fa=1;class ga{constructor(e,t){this.id=fa++,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(_s({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}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];Hl.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(sa(e)),this}start(e){let{queue:t}=this;return e?t=$l(e).map(sa):this.queue=[],this._flush?this._flush(this,t):(Ea(this,t),ha(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Ul($l(t),(t=>n[t].stop(!!e)))}else js(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Hl.und(e))this.start({pause:!0});else{const t=this.springs;Ul($l(e),(e=>t[e].pause()))}return this}resume(e){if(Hl.und(e))this.start({pause:!1});else{const t=this.springs;Ul($l(e),(e=>t[e].resume()))}return this}each(e){Wl(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,jl(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&&jl(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,jl(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)}yl.onFrame(this._onFrame)}}function ha(e,t){return Promise.all(t.map((t=>va(e,t)))).then((t=>Hs(e,t)))}async function va(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Hl.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Hl.arr(r)||Hl.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Ul(ma,(n=>{const o=t[n];if(Hl.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,Kl(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===Ss(t,"cancel");(u||m&&d.asyncId)&&p.push(Vs(++e._lastAsyncId,{props:t,state:d,actions:{pause:Vl,resume:Vl,start(t,n){m?(js(d,e._lastAsyncId),n(Ws(e))):(t.onRest=s,n($s(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Hs(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=ia(t,i,r);if(n)return Ea(e,[n]),va(e,n,!0)}return a&&yl.batchedUpdates((()=>a(f,e,e.item))),f}function ba(e,t){const n=_s({},e.springs);return t&&Ul($l(t),(e=>{Hl.und(e.keys)&&(e=sa(e)),Hl.obj(e.to)||(e=_s({},e,{to:void 0})),ya(n,e,(e=>_a(e)))})),ka(e,n),n}function ka(e,t){Wl(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Oi(t,e))}))}function _a(e,t){const n=new ra;return n.key=e,t&&Oi(n,t),n}function ya(e,t,n){t.keys&&Ul(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function Ea(e,t){Ul(t,(t=>{ya(e.springs,t,(t=>_a(t,e)))}))}const Ca=["children"],Sa=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,Ca);const o=(0,Fl.useContext)(wa),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Fl.useState)((()=>({inputs:t,result:e()}))),o=(0,Fl.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,Fl.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=wa;return Fl.createElement(i,{value:n},t)},wa=(Ba=Sa,Ia={},Object.assign(Ba,Fl.createContext(Ia)),Ba.Provider._context=Ba,Ba.Consumer._context=Ba,Ba);var Ba,Ia;Sa.Provider=wa.Provider,Sa.Consumer=wa.Consumer;const xa=()=>{const e=[],t=function(t){Yi(`${ji}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 Ul(e,((e,r)=>{if(Hl.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 Ul(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Ul(e,(e=>e.resume(...arguments))),this},t.set=function(t){Ul(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Ul(e,((e,o)=>{if(Hl.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 Ul(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Ul(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Hl.fun(e)?e(n,t):e};return t._getProps=n,t};function Ta(e,t,n){const o=Hl.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Fl.useMemo)((()=>o||3==arguments.length?xa():void 0),[]),l=(0,Fl.useRef)(0),i=Ji(),s=(0,Fl.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=ba(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?ha(e,t):new Promise((o=>{ka(e,n),s.queue.push((()=>{o(ha(e,t))})),i()}))}})),[]),a=(0,Fl.useRef)([...s.ctrls]),c=[],u=ts(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new ga(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=aa(n))}}(0,Fl.useMemo)((()=>{Ul(a.current.slice(e,u),(e=>{Rs(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Fl.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>ba(e,c[t]))),m=(0,Fl.useContext)(Sa),f=ts(m),g=m!==f&&Ps(m);ns((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Ul(e,(e=>e()))),Ul(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Ls(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),Zi((()=>()=>{Ul(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>_s({},e)));return r?[h,r]:h}let Na;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Na||(Na={}));class Pa extends Zs{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Ii(...t);const n=this._get(),o=fs(n);ls(this,o.create(n))}advance(e){const t=this._get();Gl(t,this.get())||(rs(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&Ra(this._active)&&La(this)}_get(){const e=Hl.arr(this.source)?this.source.map(Mi):$l(Mi(this.source));return this.calc(...e)}_start(){this.idle&&!Ra(this._active)&&(this.idle=!1,Ul(is(this),(e=>{e.done=!1})),Jl.skipAnimation?(yl.batchedUpdates((()=>this.advance())),La(this)):ri.start(this))}_attach(){let e=1;Ul($l(this.source),(t=>{Pi(t)&&Oi(t,this),Ys(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Ul($l(this.source),(e=>{Pi(e)&&Fi(e,this)})),this._active.clear(),La(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=$l(this.source).reduce(((e,t)=>Math.max(e,(Ys(t)?t.priority:0)+1)),0))}}function Ma(e){return!1!==e.idle}function Ra(e){return!e.size||Array.from(e).every(Ma)}function La(e){e.idle||(e.idle=!0,Ul(is(e),(e=>{e.done=!0})),Li(e,{type:"idle",parent:e}))}Jl.assign({createStringInterpolator:$i,to:(e,t)=>new Pa(e,t)}),ri.advance;var Aa=window.ReactDOM;function Da(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 Oa=["style","children","scrollTop","scrollLeft"],Fa=/^--/;function za(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Fa.test(e)||Ha.hasOwnProperty(e)&&Ha[e]?(""+t).trim():t+"px"}const Va={};let Ha={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 Ga=["Webkit","Ms","Moz","O"];Ha=Object.keys(Ha).reduce(((e,t)=>(Ga.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ha);const Ua=["x","y","z"],Wa=/^(matrix|translate|scale|rotate|skew)/,$a=/^(translate)/,ja=/^(rotate|skew)/,Ka=(e,t)=>Hl.num(e)&&0!==e?e+t:e,qa=(e,t)=>Hl.arr(e)?e.every((e=>qa(e,t))):Hl.num(e)?e===t:parseFloat(e)===t;class Ya extends ds{constructor(e){let{x:t,y:n,z:o}=e,r=Da(e,Ua);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Ka(e,"px"))).join(",")})`,qa(e,0)]))),Wl(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Wa.test(t)){if(delete r[t],Hl.und(e))return;const n=$a.test(t)?"px":ja.test(t)?"deg":"";l.push($l(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Ka(r,n)})`,qa(r,0)]:e=>[`${t}(${e.map((e=>Ka(e,n))).join(",")})`,qa(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new Qa(l,i)),super(r)}}class Qa extends Ai{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 Ul(this.inputs,((n,o)=>{const r=Mi(n[0]),[l,i]=this.transforms[o](Hl.arr(r)?r:n.map(Mi));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Ul(this.inputs,(e=>Ul(e,(e=>Pi(e)&&Oi(e,this)))))}observerRemoved(e){0==e&&Ul(this.inputs,(e=>Ul(e,(e=>Pi(e)&&Fi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Li(this,e)}}const Za=["scrollTop","scrollLeft"];Jl.assign({batchedUpdates:Aa.unstable_batchedUpdates,createStringInterpolator:$i,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 Xa=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new ds(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=ks(e)||"Anonymous";return(e=Hl.str(e)?l[e]||(l[e]=hs(e,r)):e[bs]||(e[bs]=hs(e,r))).displayName=`Animated(${t})`,e};return Wl(e,((t,n)=>{Hl.arr(e)&&(n=ks(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=Da(o,Oa),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:Va[t]||(Va[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=za(t,r[t]);Fa.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 Ya(e),getComponentProps:e=>Da(e,Za)}).animated,Ja=e=>e+1,ec=e=>({top:e.offsetTop,left:e.offsetLeft});var tc=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)(Ja,0),[u,p]=(0,s.useReducer)(Ja,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?ec(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,el.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",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=ec(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Hl.fun(e),[[o],r]=Ta(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};const nc=".block-editor-block-list__block",oc=".block-list-appender",rc=".block-editor-button-block-appender";function lc(e,t){return t.closest([nc,oc,rc].join(","))===e}function ic(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(nc);return t?t.id.slice("block-".length):void 0}function sc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Qn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Qn);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=el.focus.tabbable.find(t.current).filter((e=>(0,el.isTextField)(e))),s=-1===n,a=(s?u.last:u.first)(i)||t.current;if(lc(t.current,a)){if(!t.current.getAttribute("contenteditable")){const e=el.focus.tabbable.findNext(t.current);if(e&&lc(t.current,e)&&(0,el.isFormElement)(e))return void e.focus()}(0,el.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function ac(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function cc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Qn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",ac),t.addEventListener("mouseover",ac),()=>{t.removeEventListener("mouseout",ac),t.removeEventListener("mouseover",ac),t.classList.remove("is-hovered")}}),[e])}function uc(e){return(0,m.useSelect)((t=>{const{isBlockBeingDragged:n,isBlockHighlighted:o,isBlockSelected:l,isBlockMultiSelected:i,getBlockName:s,getSettings:a,hasSelectedInnerBlock:u,isTyping:d,__experimentalGetActiveBlockIdByBlockNames:p}=t(Qn),{__experimentalSpotlightEntityBlocks:m,outlineMode:f}=a(),g=n(e),h=l(e),v=s(e),b=u(e,!0),k=p(m);return c()({"is-selected":h,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(v)),"is-dragging":g,"has-child-selected":b,"has-active-entity":k,"is-active-entity":k===e,"remove-outline":h&&f&&d()})}),[e])}function dc(e){return(0,m.useSelect)((t=>{const n=t(Qn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function pc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Qn),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 mc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Qn);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 fc(e){const{isBlockSelected:t}=(0,m.useSelect)(Qn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((r=>{function l(l){r.parentElement.closest('[contenteditable="true"]')||(t(e)?l.target.isContentEditable||o(e):lc(r,l.target)&&n(e))}return r.addEventListener("focusin",l),()=>{r.removeEventListener("focusin",l)}}),[t,n])}var gc=window.wp.keycodes;function hc(e){const t=(0,m.useSelect)((t=>t(Qn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Qn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Qn);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!==gc.ENTER&&s!==gc.BACKSPACE&&s!==gc.DELETE||a!==i||(0,el.isTextField)(a)||(t.preventDefault(),s===gc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function vc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Qn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Qn);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 bc(){const e=(0,s.useContext)(Sf);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function kc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(_c),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Qn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,sc(n),Co(n),fc(n),hc(n),vc(n),cc(),bc(),tc({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=eo();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,uc(n),dc(n),pc(n),mc(n)),style:{...l.style,...e.style}}}kc.save=r.__unstableGetBlockProps;const _c=(0,s.createContext)();function yc(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",kc(o,{__unstableIsHtml:n}),t)}const Ec=(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(Qn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),Cc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Qn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Qn),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(Qn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Qn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Sc=(0,d.compose)(d.pure,Ec,Cc,(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:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Qn),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(il,{name:g,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)(g);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&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)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(yc,{isHtml:!0},(0,s.createElement)(kl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(yc,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(yc,{className:"has-warning"},(0,s.createElement)(ml,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,el.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(_c.Provider,{value:M},(0,s.createElement)(vl,{fallback:(0,s.createElement)(yc,{className:"has-warning"},(0,s.createElement)(gl,null))},N))})),wc=window.wp.htmlEntities,Bc=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Ic=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var xc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Ic.length));return(0,s.createElement)(p.Tip,null,Ic[e])},Tc=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),Nc=(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:Tc});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)})),Pc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(H()("`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)(Nc,{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)))};function Mc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(Qn),{getBlockName:h,getBlocks:v}=a.select(Qn),b=(0,m.useSelect)((e=>!t||e(Qn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),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(Qn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(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])}var Rc=(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(qn,Yn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o(n)}),[n]),Mc(e),(0,s.createElement)(Eo,null,t)}));function Lc(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)(Bf,null)))}function Ac(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Qn),{clearSelectedBlock:n}=(0,m.useDispatch)(Qn);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 Dc(e){return(0,s.createElement)("div",i({ref:Ac()},e))}function Oc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Qn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Fc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Oc,[]),i=So(r),s=So((0,u.first)(n)),a=So((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!s.current||!a.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(s.current),f.setEndAfter(a.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function zc(e,t,n,o){let r,l=el.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!el.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 Vc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===gc.UP,p=c===gc.DOWN,m=c===gc.LEFT,f=c===gc.RIGHT,g=d||m,h=m||f,v=d||p,b=h||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?el.isVerticalEdge:el.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(l())return;if(v?s||(s=(0,el.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===gc.UP||t===gc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(u,c,_))return;const S=(0,el.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=r(),B=e();if(k){const e=t(),r=n(e||B),l=o(e||B);(g&&r||!g&&l)&&function(e,t){const n=zc(e,t,i);return!n||!function(e,t){return e.closest(nc)===t.closest(nc)}(e,n)}(u,g)&&y(u,g)&&(i.contentEditable=!0,i.focus())}else if(v&&(0,el.isVerticalEdge)(u,g)&&!w){const e=zc(u,g,i,!0);e&&((0,el.placeCaretAtVerticalEdge)(e,g,s),a.preventDefault())}else if(h&&C.getSelection().isCollapsed&&(0,el.isHorizontalEdge)(u,S)&&!w){const e=zc(u,S,i);(0,el.placeCaretAtHorizontalEdge)(e,g),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}var Hc=window.wp.keyboardShortcuts;function Gc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Qn),{multiSelect:o}=(0,m.useDispatch)(Qn),r=(0,Hc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,el.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function Uc(e,t){e.contentEditable=t,t&&e.focus()}function Wc(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Qn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;Uc(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),Uc(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function $c(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Qn),{getBlockParents:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((n=>{const{ownerDocument:r}=n,{defaultView:l}=r;function i(){const r=l.getSelection();if(!r.rangeCount||r.isCollapsed)return void function(e,t){e.contentEditable=false}(n);const i=ic(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(r)),s=ic(function(e){const{focusNode:t,focusOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n-1]}(r));if(i===s)t(i);else{const t=[...o(i),i],n=[...o(s),s],r=function(e,t){let n=0;for(;e[n]===t[n];)n++;return n}(t,n);e(t[r],n[r])}}function s(){r.addEventListener("selectionchange",i),l.addEventListener("mouseup",i)}function a(){r.removeEventListener("selectionchange",i),l.removeEventListener("mouseup",i)}function c(){a(),s()}return s(),n.addEventListener("focusin",c),()=>{a(),n.removeEventListener("focusin",c)}}),[e,t,n,o])}function jc(){const{multiSelect:e,selectBlock:t}=(0,m.useDispatch)(Qn),{isSelectionEnabled:n,getBlockParents:o,getBlockSelectionStart:r,hasMultiSelection:l}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((e=>{function o(o){if(!n()||0!==o.button)return;const i=r(),s=ic(o.target);o.shiftKey?i!==s&&(e.contentEditable=!0,e.focus()):l()&&t(s)}return e.addEventListener("mousedown",o),()=>{e.removeEventListener("mousedown",o)}}),[e,t,n,o,r,l])}function Kc(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Qn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===gc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===gc.BACKSPACE||d.keyCode===gc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===gc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===gc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function qc(){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)(Qn),{setNavigationMode:a}=(0,m.useDispatch)(Qn),c=(0,m.useSelect)((e=>e(Qn).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";el.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===gc.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==gc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,el.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,el.isFormElement)(el.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!==gc.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=el.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(Qn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,Kc(),Wc(),$c(),jc(),Fc(),Gc(),Vc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var Yc=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=qc();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)}));const Qc="editor-styles-wrapper";function Zc(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var Xc=(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)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=Zc(null==a?void 0:a.styles),_=Zc(null==a?void 0:a.scripts),y=Ac(),[E,C,S]=qc(),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),h(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]);return(0,s.useEffect)((()=>{var e;f&&(e=f,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&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${Qc}`)||t.includes(".wp-block"))}))&&!e.getElementById(n.id)){e.head.appendChild(n.cloneNode(!0));const t=n.id.replace("-css","-inline-css"),o=document.getElementById(t);o&&e.head.appendChild(o.cloneNode(!0))}})))}),[f]),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,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(Qc,...v)},(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),Jc={grad:.9,turn:360,rad:360/(2*Math.PI)},eu=function(e){return"string"==typeof e?e.length>0:"number"==typeof e},tu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Math.pow(10,t)),Math.round(n*e)/n+0},nu=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},ru=function(e){return{r:nu(e.r,0,255),g:nu(e.g,0,255),b:nu(e.b,0,255),a:nu(e.a)}},lu=function(e){return{r:tu(e.r),g:tu(e.g),b:tu(e.b),a:tu(e.a,3)}},iu=/^#([0-9a-f]{3,8})$/i,su=function(e){var t=e.toString(16);return t.length<2?"0"+t:t},au=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}},cu=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}},uu=function(e){return{h:ou(e.h),s:nu(e.s,0,100),l:nu(e.l,0,100),a:nu(e.a)}},du=function(e){return{h:tu(e.h),s:tu(e.s),l:tu(e.l),a:tu(e.a,3)}},pu=function(e){return cu((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},mu=function(e){return{h:(t=au(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},fu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,gu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,hu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,vu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,bu={string:[[function(e){var t=iu.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?tu(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?tu(parseInt(e.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(e){var t=hu.exec(e)||vu.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:ru({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=fu.exec(e)||gu.exec(e);if(!t)return null;var n,o,r=uu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(Jc[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return pu(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 eu(t)&&eu(n)&&eu(o)?ru({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(!eu(t)||!eu(n)||!eu(o))return null;var i=uu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return pu(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!eu(t)||!eu(n)||!eu(o))return null;var i=function(e){return{h:ou(e.h),s:nu(e.s,0,100),v:nu(e.v,0,100),a:nu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return cu(i)},"hsv"]]},ku=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]},_u=function(e,t){var n=mu(e);return{h:n.h,s:nu(n.s+100*t,0,100),l:n.l,a:n.a}},yu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Eu=function(e,t){var n=mu(e);return{h:n.h,s:n.s,l:nu(n.l+100*t,0,100),a:n.a}},Cu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?ku(e.trim(),bu.string):"object"==typeof e&&null!==e?ku(e,bu.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 tu(yu(this.rgba),2)},e.prototype.isDark=function(){return yu(this.rgba)<.5},e.prototype.isLight=function(){return yu(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=lu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?su(tu(255*r)):"","#"+su(t)+su(n)+su(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return lu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=lu(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 du(mu(this.rgba))},e.prototype.toHslString=function(){return t=(e=du(mu(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=au(this.rgba),{h:tu(e.h),s:tu(e.s),v:tu(e.v),a:tu(e.a,3)};var e},e.prototype.invert=function(){return Su({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),Su(_u(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Su(_u(this.rgba,-e))},e.prototype.grayscale=function(){return Su(_u(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Su(Eu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Su(Eu(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?Su({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):tu(this.rgba.a,3);var t},e.prototype.hue=function(e){var t=mu(this.rgba);return"number"==typeof e?Su({h:e,s:t.s,l:t.l,a:t.a}):tu(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Su(e).toHex()},e}(),Su=function(e){return e instanceof Cu?e:new Cu(e)},wu=[],Bu=function(e){e.forEach((function(e){wu.indexOf(e)<0&&(e(Cu,bu),wu.push(e))}))};function Iu(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 xu=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Tu=function(e){return.2126*xu(e.r)+.7152*xu(e.g)+.0722*xu(e.b)};function Nu(e){e.prototype.luminance=function(){return e=Tu(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=Tu(l))>(a=Tu(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 Pu=n(3124),Mu=n.n(Pu);const Ru=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Lu(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(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(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 f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){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 h(){const e=p(/^([^{]+)/);if(e)return Au(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=Au(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Ru,""),value:n?Au(n[0]).replace(Ru,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(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=f();for(;r=k();)i.push(r),i=i.concat(f());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=Au(t[1]);if(!c())return a("@media missing '{'");const o=f().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:Au(t[1]),media:Au(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Au(t[1]);if(!c())return a("@supports missing '{'");const o=f().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=Au(t[1]),o=Au(t[2]);if(!c())return a("@document missing '{'");const r=f().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=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());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=f().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=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Du(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Au(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Du(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){Du(e,o)})):n&&"object"==typeof n&&Du(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Ou=n(8575),Fu=n.n(Ou),zu=Vu;function Vu(e){this.options=e||{}}Vu.prototype.emit=function(e){return e},Vu.prototype.visit=function(e){return this[e.type](e)},Vu.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};var Hu=Gu;function Gu(e){zu.call(this,e)}Fu()(Gu,zu),Gu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Gu.prototype.comment=function(e){return this.emit("",e.position)},Gu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Gu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Gu.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("}")},Gu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Gu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Gu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Gu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Gu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Gu.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("}")},Gu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Gu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Gu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Gu.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("}"):""},Gu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Uu=Wu;function Wu(e){e=e||{},zu.call(this,e),this.indentation=e.indent}Fu()(Wu,zu),Wu.prototype.compile=function(e){return this.stylesheet(e)},Wu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Wu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Wu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Wu.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}")},Wu.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}")},Wu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Wu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Wu.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}")},Wu.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)+"}")},Wu.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")},Wu.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}")},Wu.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}")},Wu.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}")},Wu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Wu.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()+"}"):""},Wu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Wu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var $u=function(e,t){try{const r=Lu(e);return n=Mu().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new Hu(o):new Uu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function ju(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 Ku(e,t){return new URL(e,t).toString()}var qu=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]};ju(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+Ku(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};const Yu=/^(body|html|:root).*$/;var Qu=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(Yu)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},Zu=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(Qu(t)),o&&r.push(qu(o)),r.length?$u(n,(0,d.compose)(r)):n}))};const Xu=".editor-styles-wrapper";function Ju(e){return(0,s.useCallback)((e=>{if(!e)return;const{ownerDocument:t}=e,{defaultView:n,body:o}=t,r=t.querySelector(Xu);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=Su(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function ed(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>Zu(t,Xu)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:Ju(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let td;Bu([Iu,Nu]);const nd=2e3;var od=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}=(0,m.useSelect)((e=>{const t=e(Qn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);td=td||(0,d.pure)(Bf);const g=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(${g})`,height:a*g,maxHeight:a>nd?nd*g:void 0,minHeight:o}},(0,s.createElement)(Xc,{head:(0,s.createElement)(ed,{styles:f}),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:nd,minHeight:g<1&&o?o/g:o}},i,(0,s.createElement)(td,{renderAppender:!1}))))},rd=(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(Qn).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)(Rc,{value:d,settings:c},r?(0,s.createElement)(Lc,{onClick:l}):(0,s.createElement)(od,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function ld(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Qn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(Rc,{value:p,settings:a},(0,s.createElement)(xf,{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?f:null}}var id=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(rd,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Pc,{title:i,icon:a,description:c}))},sd=(0,s.createContext)(),ad=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(sd);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)}))})),cd=(0,s.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function ud(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)(Nc,{icon:n}):(0,g.sprintf)(
11
  /* translators: %d: Number of blocks. */
12
- (0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Nc,{icon:cd})))))}var dd=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)(ud,{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})}))};function pd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var md=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(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)(dd,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,s.createElement)(ad,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,pd()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===gc.ENTER&&(e.preventDefault(),l(o,pd()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{p.current||a(o)},onMouseEnter:()=>{p.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,s.createElement)(Nc,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),fd=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Ht.speak)((0,g.__)("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))})),gd=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(sd);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),hd=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(fd,{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)(gd,{key:t},e.map(((e,l)=>(0,s.createElement)(md,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},vd=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))},bd=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Qn),{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])]},kd=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(sd.Provider,{value:n},t)};const _d=[];var yd=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=bd(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]),f=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),h=(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,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:_d);return(0,s.createElement)(kd,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(vd,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(hd,{items:p,onSelect:c,onHover:o,label:(0,g._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(vd,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(hd,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(vd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(hd,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,s.createElement)(vd,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(hd,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},Ed=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,g.__)("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,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},Cd=window.wp.notices,Sd=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Qn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Cd.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)(
13
  /* translators: %s: block pattern title. */
14
- (0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function wd(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)(wd)}`;return(0,s.createElement)(dd,{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)(rd,{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 Bd(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Id=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("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)(wd,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Bd,{key:e.name}))))};function xd(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 Td(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,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var Nd=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)(Td,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(xd,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Pd=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Br,{className:"block-editor-inserter__no-results-icon",icon:Tc}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},Md=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Qn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Qn),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:f,insertBlocks:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Qn),k=(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)?f(o.clientId,e,null,a||n?0:null,t):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
15
- (0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Ht.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const Rd=e=>e.name||"",Ld=e=>e.title,Ad=e=>e.description||"",Dd=e=>e.keywords||[],Od=e=>e.category,Fd=()=>null;function zd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Vd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(zd(e))},Hd=(e,t)=>(0,u.differenceWith)(e,Vd(t),((e,t)=>t.includes(e))),Gd=(e,t,n,o)=>0===Vd(o).length?e:Ud(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}}),Ud=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=Vd(t);if(0===o.length)return e;const r=e.map((e=>[e,Wd(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 Wd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Rd,getTitle:r=Ld,getDescription:l=Ad,getKeywords:i=Dd,getCategory:s=Od,getCollection:a=Fd}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=zd(t),v=zd(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===Hd(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function $d(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,g.sprintf)(
16
  /* translators: %d: number of patterns. %s: block pattern search query */
17
- (0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var jd=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ht.speak,500),[l,i]=Md({shouldFocusBlock:!0}),[a,,c]=Sd(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Ud(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,g.sprintf)(
18
  /* translators: %d: number of results. */
19
- (0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)($d,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(kd,null,!f&&(0,s.createElement)(Pd,null),f&&(0,s.createElement)(Id,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function Kd(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)(Nd,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(jd,{filterValue:o,selectedCategory:l,patternCategories:n}))}var qd=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(Kd,n))};function Yd(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Sd(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)(Id,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var Qd=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Sd(),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,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ed,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(Yd,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(qd,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},Zd=window.wp.url;function Xd(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=bd(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(Pd,null):(0,s.createElement)(vd,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(hd,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var Jd=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xd,{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,Zd.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:ep,Slot:tp}=(0,p.createSlotFill)("__unstableInserterMenuExtension");ep.Slot=tp;var np=ep;const op=[];var rp=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Ht.speak,500),[_,y]=Md({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=bd(_,y),[B,,I]=Sd(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=Ud(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=Gd((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,g.sprintf)(
20
  /* translators: %d: number of results. */
21
- (0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:op),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),L=!!N.length&&(0,s.createElement)(vd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(hd,{items:P,onSelect:w,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!x.length&&(0,s.createElement)(vd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Id,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:h})));return(0,s.createElement)(kd,null,!f&&!R&&(0,s.createElement)(Pd,null),b?A:L,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,s.createElement)(np.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(Pd,null))))};const lp={name:"blocks",
22
  /* translators: Blocks tab title in the block inserter. */
23
- title:(0,g.__)("Blocks")},ip={name:"patterns",
24
  /* translators: Patterns tab title in the block inserter. */
25
- title:(0,g.__)("Patterns")},sp={name:"reusable",
26
  /* translators: Reusable blocks tab title in the block inserter. */
27
- title:(0,g.__)("Reusable")};var ap=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[lp];return n&&e.push(ip),o&&e.push(sp),e}),[lp,n,ip,o,sp]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},cp=(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[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=Md({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(Qn);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=>{_(e)}),[_]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(yd,{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,g.__)("A tip for using the block editor")),(0,s.createElement)(xc,null)))),[y,B,x,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(Qd,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(Jd,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.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),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,s.createElement)(rp,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(ap,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(id,{item:v}))}));function up(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r}=e;const[l,i]=(0,s.useState)(""),[a,u]=Md({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[d]=bd(a,u),[f]=Sd(u,a),{setInserterIsOpened:h,insertionIndex:v,prioritizePatterns:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:r,getBlockCount:l}=e(Qn),i=t(),s=r(o),a=l();return{setInserterIsOpened:i.__experimentalSetIsInserterOpened,prioritizePatterns:i.__experimentalPreferPatternsOnRoot&&!n&&s>0&&(s<a||0===a),insertionIndex:-1===s?a:s}}),[o,n]),k=f.length&&(!!l||b),_=k&&f.length>6||d.length>6;(0,s.useEffect)((()=>{h&&h(!1)}),[h]);let y=0;return k&&(y=b?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":h})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:l,onChange:e=>{i(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(rp,{filterValue:l,onSelect:t,rootClientId:n,clientId:o,isAppender:r,maxBlockPatterns:y,maxBlockTypes:6,isDraggable:!1,prioritizePatterns:b})),h&&(0,s.createElement)(p.Button,{className:"block-editor-inserter__quick-inserter-expand",onClick:()=>{h({rootClientId:n,insertionIndex:v,filterValue:l})},"aria-label":(0,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const dp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={}}=e;t=a?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
28
- (0,g._x)("Add %s","directly add the only allowed block"),l):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:u,...d}=c;return(0,s.createElement)(p.Button,i({icon:Bc,label:t,tooltipPosition:"bottom",onClick:function(e){n&&n(e),u&&u(e)},className:"block-editor-inserter__toggle","aria-haspopup":!a&&"true","aria-expanded":!a&&r,disabled:o},d))};class pp 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=dp}=this.props;return c({onToggle:t,isOpen:n,disabled:o||!a,blockTitle:r,hasSingleBlockType:l,directInsertBlock:i,toggleProps:s})}renderContent(e){let{onClose:t}=e;const{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,__experimentalIsQuick:i}=this.props;return i?(0,s.createElement)(up,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r}):(0,s.createElement)(cp,{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,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var mp=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a}=e(Qn),{getBlockVariations:c}=e(r.store);o=o||l(n)||void 0;const d=s(o),p=a(o),m=1===(0,u.size)(d)&&0===(0,u.size)(c(d[0].name,"inserter"));let f=!1;return m&&(f=d[0]),{hasItems:i(o),hasSingleBlockType:m,blockTitle:f?f.title:"",allowedBlockType:f,directInsertBlock:p,rootClientId:o}})),(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(Qn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Qn);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(Qn);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,g.sprintf)(// translators: %s: the name of the block that has been added
29
- (0,g.__)("%s block added"),a.title);(0,Ht.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(pp),fp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Qn),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(Qn);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,wc.decodeEntities)(r)||(0,g.__)("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,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{gc.ENTER!==e.keyCode&&gc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(mp,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function gp(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(mp,{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,g.sprintf)(// translators: %s: the name of the block when there is only one
30
- (0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Br,{icon:Bc}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const hp=(0,s.forwardRef)(((e,t)=>(H()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),gp(e,t))));var vp=(0,s.forwardRef)(gp),bp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Qn);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)(fp,{rootClientId:n}):(0,s.createElement)(vp,{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)})),kp=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])};(0,s.createContext)();var _p=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d}=(0,m.useSelect)((e=>{var n;const{getBlockListSettings:o,getBlockRootClientId:r}=e(Qn),l=r(t);return{orientation:(null===(n=o(l))||void 0===n?void 0:n.orientation)||"vertical",rootClientId:l}}),[t]),f=wo(t),h=wo(n),v="vertical"===u,b=(0,s.useMemo)((()=>{if(!f&&!h)return{};const e=f?f.getBoundingClientRect():null,t=h?h.getBoundingClientRect():null;if(v)return{width:f?f.offsetWidth:h.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:h.offsetHeight}}),[f,h,v]),k=(0,s.useCallback)((()=>{if(!f&&!h)return{};const{ownerDocument:e}=f||h,t=f?f.getBoundingClientRect():null,n=h?h.getBoundingClientRect():null;return v?(0,g.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,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,ownerDocument:e}:(0,g.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,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,ownerDocument:e}}),[f,h]),_=kp(l);return f&&h?(0,s.createElement)(p.Popover,i({ref:_,noArrow:!0,animate:!1,getAnchorRect:k,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover",a.className)}),(0,s.createElement)("div",{style:b},o)):null};const yp=(0,s.createContext)();function Ep(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Qn),l=(0,s.useContext)(yp),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:g,isInserterShown:h}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Qn),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:h?.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)(_p,{previousClientId:u,nextClientId:f,__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&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":h}),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"}),h&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(mp,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Cp(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(Qn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(yp.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(Ep,n),t)}function Sp(){const e=(0,s.useContext)(yp),t=(0,m.useSelect)((e=>e(Qn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Qn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Qn);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",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));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.overlay-active"))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 wp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Bp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Ip(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Qn),{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 xp(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Qn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=Ip(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Tp(e){let{clientId:t,maximumLength:n}=e;return xp(t,n)}var Np=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(Qn),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),[f,g,h]=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,el.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)(Qn);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,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(ud,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Pp=function(e){let{clientId:t,rootClientId:n}=e;const o=Ip(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Qn),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:f,orientation:h}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(Qn),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,h);(0,s.useEffect)((()=>{k.current.focus(),(0,Ht.speak)(y)}),[y]);const E=wo(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Qn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Qn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!f}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(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)(Nc,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Np,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:cd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,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===gc.UP,r=n===gc.DOWN,l=n===gc.LEFT,i=n===gc.RIGHT,s=n===gc.TAB,a=n===gc.ESCAPE,c=n===gc.ENTER,u=n===gc.SPACE,d=e.shiftKey;if(n===gc.BACKSPACE||n===gc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),f=T(m||p),g=N(m||p),h=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(h)y=f;else if(v)y=g;else if(k){var D;y=null!==(D=w(p))&&void 0!==D?D:p}else if(_){var O;y=null!==(O=B([p])[0])&&void 0!==O?O:p}const F=C();if(a&&P()&&(R(),e.preventDefault()),a&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(c||u)&&F){const e=w(F),t=w(p),n=S(F);let o=S(p);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(v||h||k||_)if(y)e.preventDefault(),M(y);else if(s&&p){let t;if(v){t=E;do{t=el.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=el.focus.tabbable.findNext(t))}else t=el.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),R())}},label:y,className:"block-selection-button_select-button"},(0,s.createElement)(Tp,{clientId:t,maximumLength:35})))))};function Mp(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var Rp=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=!el.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||H()("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]=el.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,Hc.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=Mp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Mp(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)},Lp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Ap=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Dp=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Op=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Fp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Lp:Ap:Dp:"down"===e?"horizontal"===t?(0,g.isRTL)()?Ap:Lp:Op:null,zp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,Vp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(Vp),h=(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(Qn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(Qn),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${f}`;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:Fp(o,C),label:zp(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,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
31
  (0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
32
  (0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
33
  (0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
@@ -42,69 +42,69 @@ title:(0,g.__)("Reusable")};var ap=function(e){let{children:t,showPatterns:n=!1,
42
  (0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
  (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
44
  (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
45
- (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),Hp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Vp,i({direction:"up",ref:t},e)))),Gp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(Vp,i({direction:"down",ref:t},e))));var Up=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(Qn),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)),f=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===f.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const f=(0,g.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(Np,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:cd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:f,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)(Hp,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Gp,i({clientIds:t},e))))))};const{clearTimeout:Wp,setTimeout:$p}=window,jp=200;function Kp(e){let{ref:t,isFocused:n,debounceTimeout:o=jp,onChange:r=u.noop}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=a.current;e&&Wp&&Wp(e)};return(0,s.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=$p((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function qp(e){let{ref:t,debounceTimeout:n=jp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=Kp({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,s.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),a())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function Yp(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Qn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Qn),{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=Ip(n),c=(0,s.useRef)(),{gestures:u}=qp({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,g.sprintf)(
46
  /* translators: %s: Name of the block's parent. */
47
- (0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(Nc,{icon:a.icon})}))}var Qp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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 Zp(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,g.__)("Preview")),(0,s.createElement)(rd,{viewportWidth:500,blocks:t})))))}var Xp=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,g.__)("Transform to"),className:t},i&&(0,s.createElement)(Zp,{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)(Nc,{icon:n,showColors:!0}),l)})))},Jp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),em=window.wp.tokenList,tm=n.n(em);function nm(e,t,n){const o=new(tm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function om(e){return(0,u.find)(e,"isDefault")}function rm(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Qn),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)(Qn),d=function(e){return e&&0!==e.length?om(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(tm())(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),f=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=nm(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function lm(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=rm({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?Jp:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function im(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(lm,{clientId:o,onSwitch:n}))}const sm=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=sm(e,t,n);if(o)return o}}},am=(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 cm(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,g.__)("Preview")),(0,s.createElement)(um,{patterns:t,onSelect:n})))))}function um(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,g.__)("Patterns list")}),t.map((e=>(0,s.createElement)(dm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function dm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(dm,`${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)(rd,{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))}var pm=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=sm(r,t.name,o);if(n){e=!0,o.add(n.clientId),am(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)(cm,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:Lp},(0,g.__)("Patterns"))):null};const mm=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Qn),l=Ip(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Qn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Qn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;var b;g?v=null==l?void 0:l.icon:v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:Qp;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:a(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&a,_=!(null==h||!h.length)&&a;if(!c&&!k)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)(Nc,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Tp,{clientId:t,maximumLength:35})))}));const y=f,E=1===n.length?(0,g.sprintf)(
48
  /* translators: %s: block title. */
49
  (0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
50
  /* translators: %d: number of blocks. */
51
- (0,g._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)(Nc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Tp,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,s.createElement)(pm,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(Xp,{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)(im,{hoveredBlock:n[0],onSwitch:l}))})))))};var fm=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Qn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(mm,{clientIds:t,blocks:n})};const{Fill:gm,Slot:hm}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");gm.Slot=hm;var vm=gm,bm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),km=window.wp.blob;function _m(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;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function ym(){const{getBlockName:e}=(0,m.useSelect)(Qn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Cd.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,g.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
52
  (0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
53
  (0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
54
  (0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
55
- (0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function Em(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(Qn),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:g}=(0,m.useDispatch)(Qn),h=ym();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,el.documentHasUncollapsedSelection)(t):(0,el.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const k=s(),_=i()||l(),y=!_&&!k;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)g();else{let t;if(h(m.type,v),_)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",n),m.clipboardData.setData("text/html",n)}if("cut"===m.type)_&&!y?u(v):f();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,el.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!_m(r,o)&&(o=r.map((e=>`<img src="${(0,km.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)}}),[])}var Cm=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:Em()},t)};function Sm(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Qn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=a(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(Qn),T=ym();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(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(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&w(e[0]),T("copy",e)}})}var wm=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Qn),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=u.noop,clientId:o}=t;return{onToggleMode(){e(Qn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),Bm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Qn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Qn).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,g.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:Im,Slot:xm}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Im.Slot=xm;var Tm=Im;function Nm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Qn);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,g._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function Pm(){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(Qn),{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}}var Mm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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"})),Rm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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 Lm(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(Qn),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])}function Am(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=Lm(t),{isReusable:u}=(0,m.useSelect)((e=>{const{getBlockName:n}=e(Qn),o=n(t);return{isReusable:(0,r.isReusableBlock)((0,r.getBlockType)(o))}}),[t]),{updateBlockAttributes:f}=(0,m.useDispatch)(Qn),h=Ip(t),v=(0,d.useInstanceId)(Am,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const b=Object.values(o).every(Boolean),k=Object.values(o).some(Boolean)&&!b;return(0,s.createElement)(p.Modal,{title:(0,g.sprintf)(
56
  /* translators: %s: Name of the block. */
57
- (0,g.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),f([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":v,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:v},(0,g.__)("Lock all")),checked:b,indeterminate:k,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,g.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?Rm:Mm})),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,g.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?Rm:Mm})),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,g.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?Rm:Mm})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))})))),(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,g.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function Dm(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Lm(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,g.__)("Unlock"):(0,g.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?Mm:Rm,onClick:l},i),r&&(0,s.createElement)(Am,{clientId:t,onClose:l}))}const{Fill:Om,Slot:Fm}=(0,p.createSlotFill)("BlockSettingsMenuControls");function zm(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Om,t))}zm.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(Qn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),a=1===r.length,c=Pm(),{isGroupable:d,isUngroupable:f}=c,g=(d||f)&&l;return(0,s.createElement)(Fm,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!g&&!a?null:(0,s.createElement)(p.MenuGroup,null,a&&(0,s.createElement)(Dm,{clientId:r[0]}),e,g&&(0,s.createElement)(Nm,i({},c,{onClose:null==t?void 0:t.onClose})))))};var Vm=zm;const Hm={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function Gm(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,s.createElement)(p.MenuItem,{ref:o},(0,g.__)("Copy"))}var Um=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:f,hasReducedUI:h,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(Qn),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(Hc.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)(Qn),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),B=xp(d,25),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:u.noop,[n,k,_,y]),x=(0,g.sprintf)(
58
  /* translators: %s: block name */
59
- (0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=qp({ref:N,onChange(e){e&&h||S(f,e)}});return(0,s.createElement)(Sm,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:h,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:bm,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Hm,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Tm.Slot,{fillProps:{onClose:l}}),void 0!==f&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(Nc,{icon:b.icon}),onClick:()=>C(f)}),(0,g.sprintf)(
60
  /* translators: %s: Name of the block's parent. */
61
- (0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(Bm,{clientId:d}),(0,s.createElement)(Gm,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,h,w),shortcut:E.duplicate},(0,g.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,g.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,g.__)("Move to")),1===c&&(0,s.createElement)(wm,{clientId:d,onToggle:l})),(0,s.createElement)(Vm.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)))}))}))},Wm=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Um,i({clientIds:t,toggleProps:e},n)))))};function $m(e){let{clientId:t}=e;const n=Ip(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Lm(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:Rm,label:(0,g.sprintf)(
62
  /* translators: %s: block name */
63
- (0,g.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Am,{clientId:t,onClose:c})):null}var jm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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"})),Km=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),qm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));const Ym={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var Qm=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Pm(),{replaceBlocks:l}=(0,m.useDispatch)(Qn),{canRemove:i}=(0,m.useSelect)((e=>{const{canRemoveBlocks:n}=e(Qn);return{canRemove:n(t)}}),[t]),a=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=Ym[o],l(t,i))};return o&&i?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:jm,label:(0,g._x)("Group","verb"),onClick:a}),(0,s.createElement)(p.ToolbarButton,{icon:Km,label:(0,g._x)("Row","single horizontal line"),onClick:()=>a("row")}),(0,s.createElement)(p.ToolbarButton,{icon:qm,label:(0,g._x)("Stack","verb"),onClick:()=>a("stack")})):null},Zm=(0,s.createContext)(""),Xm=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Qn),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:h}=(0,m.useDispatch)(Qn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=qp({ref:v,onChange(e){e&&u||h(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&g,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!_&&(0,s.createElement)(Yp,{clientIds:n}),(0,s.createElement)("div",i({ref:v},k),(E||C)&&(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(fm,{clientIds:n}),!C&&(0,s.createElement)($m,{clientId:n[0]}),(0,s.createElement)(Up,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(Qm,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(io.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(Zm.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(vm.Slot,null))),(0,s.createElement)(Wm,{clientIds:n}))},Jm=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(Qn),{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:(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)(Rp,i({focusOnMount:t,className:d
64
- /* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(Xm,{hideDragHandle:n}))};function ef(e){let{clientId:t,bottomClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const u=wo(t),d=wo(null!=n?n:t),m=kp(l);if(!u||n&&!d)return null;const f={top:u,bottom:d},{ownerDocument:g}=u,h=g.defaultView.frameElement||(0,el.getScrollContainer)(u)||g.body;return(0,s.createElement)(p.Popover,i({ref:m,noArrow:!0,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:f,__unstableStickyBoundaryElement:h,__unstableSlotName:r||null,__unstableBoundaryParent:!0,__unstableObserveElement:u,shouldAnchorIncludePadding:!0,__unstableEditorCanvasWrapper:null==l?void 0:l.current},a,{className:c()("block-editor-block-popover",a.className)}),o)}function tf(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(Qn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function nf(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:f,lastClientId:g}=(0,m.useSelect)(tf,[]),h=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Qn);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),[k,_]=(0,s.useState)(!1),{stopTyping:y}=(0,m.useDispatch)(Qn),E=a,C=!a&&!f&&v&&!u&&!(!p&&!a&&o)&&!p,S=!(a||C||f||o);(0,Hc.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,y(!0)}),{isDisabled:!S}),(0,s.useEffect)((()=>{b.current=!1}));const w=(0,s.useRef)();return E||C?(0,s.createElement)(ef,{clientId:r||t,bottomClientId:g,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":h}),__unstablePopoverSlot:l,__unstableContentRef:i},C&&(0,s.createElement)("div",{onFocus:function(){_(!0)},onBlur:function(){_(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":k})},(0,s.createElement)(mp,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),C&&(0,s.createElement)(Jm,{focusOnMount:b.current,__experimentalInitialIndex:w.current,__experimentalOnIndexChange:e=>{w.current=e},key:t}),E&&(0,s.createElement)(Pp,{clientId:t,rootClientId:n})):null}function of(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Qn),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),f=(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:f}}function rf(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(of,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(nf,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function lf(e){let{children:t}=e;const n=(0,s.useContext)(yp),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(H()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Cp,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(rf,{__unstablePopoverSlot:"block-toolbar"}),t))}var sf=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=eo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),af=sf((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(vp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),cf=(0,d.compose)([sf,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Qn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(fp,{rootClientId:t})})),uf=window.wp.isShallowEqual,df=n.n(uf);const pf=new WeakMap;function mf(e,t){const n=(0,m.useSelect)((e=>e(Qn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Qn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Qn),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),f=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,el.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function ff(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 gf(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=ff(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function hf(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=gf(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function vf(){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(Qn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Qn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Qn),a=mf(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=hf(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 bf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Qn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Qn).getBlockRootClientId(e);return{blockListSettings:t(Qn).getBlockListSettings(e),parentLock:t(Qn).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=xr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),df()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Qn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Qn),a=(0,m.useSelect)((t=>t(Qn).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(Qn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){pf.has(t)||pf.set(t,new WeakMap);const n=pf.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)(nl,{value:k},(0,s.createElement)(xf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function kf(e){return Mc(e),(0,s.createElement)(bf,e)}const _f=(0,s.forwardRef)(((e,t)=>{const n=yf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function yf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=eo(),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(Qn),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,vf({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?kf:bf;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(xf,t)}}yf.save=r.__unstableGetInnerBlocksProps,_f.DefaultBlockAppender=cf,_f.ButtonBlockAppender=af,_f.Content=()=>yf.save().children;var Ef=_f;const Cf=(0,s.createContext)(),Sf=(0,s.createContext)();function wf(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(Qn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=yf({ref:(0,d.useMergeRefs)([Ac(),Sp(),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)(Cf.Provider,{value:o},(0,s.createElement)("div",p))}function Bf(e){return function(){const e=(0,m.useSelect)((e=>e(Qn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Qn).__experimentalGetParsedPattern(e[n].name),t=wp(o))};return t=wp(o),()=>Bp(t)}),[e])}(),(0,s.createElement)(lf,null,(0,s.createElement)(Jn,{value:Zn},(0,s.createElement)(wf,e)))}function If(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Tr}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(Qn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(Pr,{value:l},(0,s.createElement)(Sf.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Sc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(bp,{tagName:r,rootClientId:n,renderAppender:o}))}function xf(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(If,e))}function Tf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Nf(){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=Tf(o),i=0===r||r?`${r}${l}`:void 0;return i}function Pf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Nf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Mf(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Rf(e){let{onChange:t,values:n,...o}=e;const r=Nf(n),l=Mf(n)&&Pf(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}Bf.__unstableElementContext=Cf;const Lf={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function Af(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(Lf).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var Df=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),Of=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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 Ff(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("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?Df:Of,iconSize:16,"aria-label":o})))}const zf={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Vf={px:100,em:20,rem:20};function Hf(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Mf(n)||!Pf(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 Tf(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)(Nf(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Rf,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Vf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Af,{min:0,onChange:t,values:n||zf,units:l}),(0,s.createElement)(Ff,{onClick:()=>r(!o),isLinked:o})))}function Gf(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Hf,{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=Mo(t)),o({style:t})}})}Bu([Iu,Nu]);const Uf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Wf=(e,t)=>(0,u.find)(e,{color:t});function $f(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function jf(){return{disableCustomColors:!To("color.custom"),disableCustomGradients:!To("color.customGradient")}}function Kf(){const e=jf(),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,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._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,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const qf="__experimentalBorder",Yf=["top","right","bottom","left"],Qf=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}}}},Zf=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},Xf=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=Zf(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return Zf(t,"color",o)||{color:o}};function Jf(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function eg(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Kf(),a=tg(e.name),c=To("border.color")&&tg(e.name,"color"),u=To("border.radius")&&tg(e.name,"radius"),d=To("border.style")&&tg(e.name,"style"),m=To("border.width")&&tg(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const f=(0,r.getBlockSupport)(e.name,[qf,"__experimentalDefaultControls"]),h=(null==f?void 0:f.color)||(null==f?void 0:f.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=Xf({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Yf.forEach((e=>{var n;const o=Jf(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=Xf({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Ho,{__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,g.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Mo({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:h,resetAllFilter:Qf,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}},Yf.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=Xf({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=Xf({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Mo({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverClassNames:{linked:"block-editor__border-box-control__popover",top:"block-editor__border-box-control__popover-top",right:"block-editor__border-box-control__popover-right",bottom:"block-editor__border-box-control__popover-bottom",left:"block-editor__border-box-control__popover-left"},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,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:ng(o,"radius")})}(e),isShownByDefault:null==f?void 0:f.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)(Gf,e)))}function tg(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,qf);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 ng(e,t){return Mo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function og(e,t,n){if(!tg(t,"color")||Ao(t,qf,"color"))return e;const o=rg(n),r=c()(e.className,o);return e.className=r||void 0,e}function rg(e){var t;const{borderColor:n,style:o}=e,r=$f("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 lg=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:f}=t,{borderColor:g,style:h}=f,{colors:v}=Kf();if(!tg(m,"color")||Ao(m,qf,"color"))return(0,s.createElement)(e,t);const{color:b}=Xf({colors:v,namedColor:g}),{color:k}=Xf({colors:v,namedColor:Jf(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=Xf({colors:v,namedColor:Jf(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=Xf({colors:v,namedColor:Jf(null==h||null===(a=h.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=Xf({colors:v,namedColor:Jf(null==h||null===(u=h.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 ig(e){if(e)return`has-${e}-gradient-background`}function sg(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function ag(e,t){return(0,u.find)(e,["gradient",t])}function cg(e,t){const n=ag(e,t);return n&&n.slug}function ug(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=eo(),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(Qn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Qn),d=(0,s.useCallback)((o=>{const r=cg(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=ig(a);let f;return f=a?sg(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return tg(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",og),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!tg(e,"color")||Ao(e,qf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),og(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",lg),Bu([Iu,Nu]);var dg=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,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Su(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 h){if(!e.color)continue;const t=Su(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
65
  (0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
66
- (0,g.__)("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,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Ht.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};const pg=["colors","disableCustomColors","gradients","disableCustomGradients"];function mg(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{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},k&&(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&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function fg(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)(mg,i({},t,e))}var gg=function(e){return(0,u.every)(pg,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(mg,e):(0,s.createElement)(fg,e)};function hg(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...Kf(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(gg,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function vg(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function bg(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=So(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(vg(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(vg(t).color);let n=p.current,o=vg(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=vg(n).backgroundColor;i(o)})),(0,s.createElement)(Ho,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(hg,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(dg,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const kg="color",_g=e=>{const t=(0,r.getBlockSupport)(e,kg);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},yg=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,kg);return(0,u.isObject)(t)&&!!t.link},Eg=e=>{const t=(0,r.getBlockSupport)(e,kg);return(0,u.isObject)(t)&&!!t.gradients},Cg=e=>{const t=(0,r.getBlockSupport)(e,kg);return t&&!1!==t.background},Sg=e=>{const t=(0,r.getBlockSupport)(e,kg);return t&&!1!==t.text},wg=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},Bg=(e,t)=>Mo(Ro(t,e,void 0)),Ig=e=>({textColor:void 0,style:Bg(["color","text"],e.style)}),xg=e=>({style:Bg(["elements","link","color","text"],e.style)}),Tg=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 Ng(e,t,n){var o,r,l,i,s,a;if(!_g(t)||Ao(t,kg))return e;const u=Eg(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!Ao(t,kg,e),h=g("text")?$f("color",p):void 0,v=g("gradients")?ig(m):void 0,b=g("background")?$f("background-color",d):void 0,k=g("background")||g("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,h,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":g("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":g("link")&&(null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Pg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?Uf(e,n[1]).color:t};function Mg(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=To("color.palette.custom"),h=To("color.palette.theme"),v=To("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=To("color.gradients.custom"),_=To("color.gradients.theme"),y=To("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=To("color.custom"),S=To("color.customGradient"),w=To("color.background"),B=To("color.link"),I=To("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!_g(p))return null;const P=yg(p)&&B&&x,M=Sg(p)&&I&&x,R=Cg(p)&&w&&x,L=Eg(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=sg(E,F);else if(L){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=Wf(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:Mo(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[kg,"__experimentalDefaultControls"]);return(0,s.createElement)(bg,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:Uf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>wg("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:Bg(["color","text"],t.style)})})(e),resetAllFilter:Ig}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:Uf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=cg(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:Mo(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:Mo(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>wg("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Tg(t))})(e),resetAllFilter:Tg}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=Wf(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=Mo(Ro(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Pg(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,hasValue:()=>wg("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:Bg(["elements","link","color","text"],t.style)})})(e),resetAllFilter:xg}]:[]]})}const Rg=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=To("color.palette.custom")||[],u=To("color.palette.theme")||[],d=To("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!_g(o)||Ao(o,kg))return(0,s.createElement)(e,t);const m={};var f,g;a&&!Ao(o,kg,"text")&&(m.color=null===(f=Uf(p,a))||void 0===f?void 0:f.color),l&&!Ao(o,kg,"background")&&(m.backgroundColor=null===(g=Uf(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Lg={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 _g(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),Eg(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Ng),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!_g(e)||Ao(e,kg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Ng(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Rg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return Lo({linkColor:yg(r),textColor:Sg(r),backgroundColor:Cg(r),gradient:Eg(r)},Lg,e,t,n,o)}));const Ag=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],Dg=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Og=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function Fg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Og(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Ag.forEach((t=>{let{name:n,value:o}=t;Dg.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
67
  /* translators: 1: Font weight name. 2: Font style name. */
68
- (0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Ag.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return Dg.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:a,describedBy:d?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
69
  (0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
70
  (0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
71
- (0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}var zg=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||H()("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 a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__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(l)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,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))};const Vg="typography.lineHeight";function Hg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(zg,{__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:Mo(t)})}})}function Gg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!To("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Vg)||t}const Ug="typography.__experimentalFontStyle",Wg="typography.__experimentalFontWeight";function $g(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!jg(e),i=!Kg(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)(Fg,{onChange:e=>{r({style:Mo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function jg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Ug),n=To("typography.fontStyle");return!t||!n}function Kg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Wg),n=To("typography.fontWeight");return!t||!n}function qg(e){const t=jg(e),n=Kg(e);return t&&n}function Yg(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,g.__)("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,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Qg="typography.__experimentalFontFamily";function Zg(e,t,n){if(!(0,r.hasBlockSupport)(t,Qg))return e;if(Ao(t,Th,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(tm())(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 Xg(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)(Yg,{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 Jg(e){let{name:t}=e;const n=To("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Qg)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Qg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",Zg),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Qg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Zg(o,e,n)},e}));const eh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function th(e,t){return(0,u.find)(e,{size:t})||{size:t}}function nh(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var oh=function(e){const t=To("typography.fontSizes"),n=!To("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const rh="typography.fontSize";function lh(e,t,n){if(!(0,r.hasBlockSupport)(t,rh))return e;if(Ao(t,Th,"fontSize"))return e;const o=new(tm())(e.className);o.add(nh(n.fontSize));const l=o.value;return e.className=l||void 0,e}function ih(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=To("typography.fontSizes"),a=eh(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)(oh,{onChange:e=>{const t=th(i,e).slug;l({style:Mo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function sh(){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,rh)||!n}const ah=(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,rh)||Ao(i,Th,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=eh(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"),ch={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,rh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",lh),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,rh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),lh(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",ah),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return Lo({fontSize:(0,r.hasBlockSupport)(l,rh)},ch,e,t,n,o)}));var uh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),dh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));const ph=[{name:(0,g.__)("Underline"),value:"underline",icon:uh},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:dh}];function mh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},ph.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 fh="typography.__experimentalTextDecoration";function gh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(mh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function hh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,fh),n=To("typography.textDecoration");return t||!n}var vh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),bh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),kh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));const _h=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:vh},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:bh},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:kh}];function yh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},_h.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 Eh="typography.__experimentalTextTransform";function Ch(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(yh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Sh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Eh),n=To("typography.textTransform");return t||!n}function wh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Bh="typography.__experimentalLetterSpacing";function Ih(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(wh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Mo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function xh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Bh),n=To("typography.letterSpacing");return t||!n}const Th="typography",Nh=[Vg,rh,Ug,Wg,Qg,fh,Eh,Bh];function Ph(e){const{clientId:t}=e,n=Jg(e),o=sh(e),l=qg(e),i=Gg(e),a=hh(e),c=Sh(e),u=xh(e),d=!jg(e),m=!Kg(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[qg(e),sh(e),Gg(e),Jg(e),hh(e),Sh(e),xh(e)];return t.filter(Boolean).length===t.length}(e),h=Mh(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Th,"__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)(Ho,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("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)(Xg,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),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Mo({...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)(ih,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:Og(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)($g,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,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Hg,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,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(gh,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),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Ch,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,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Mo({...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)(Ih,e)))}const Mh=e=>Nh.some((t=>(0,r.hasBlockSupport)(e,t))),Rh=[...Nh,qf,kg,qo],Lh=e=>Rh.some((t=>(0,r.hasBlockSupport)(e,t))),Ah="var:";function Dh(e){return(0,u.startsWith)(e,Ah)?`var(--wp--${e.slice(Ah.length).split("|").join("--")})`:e}function Oh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=Dh(r))})):t.includes(l.join("."))||(n[o]=Dh((0,u.get)(e,l))))}}));const o=Jr(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const Fh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[kg],[`${Th}.__experimentalSkipSerialization`]:[Th],[`${qo}.__experimentalSkipSerialization`]:["spacing"]},zh={...Fh,[`${qo}`]:["spacing.blockGap"]},Vh={gradients:"gradient"};function Hh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:zh;if(!Lh(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{const o=(0,r.getBlockSupport)(t,n);!0===o&&(l=(0,u.omit)(l,e)),Array.isArray(o)&&o.forEach((t=>{const n=Vh[t]||t;l=(0,u.omit)(l,[[...e,n]])}))})),e.style={...Oh(l),...e.style},e}const Gh=(0,d.createHigherOrderComponent)((e=>t=>{const n=to();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Mg,t),(0,s.createElement)(Ph,t),(0,s.createElement)(eg,t),(0,s.createElement)(Zo,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),Uh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=Ao(t.name,kg,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=Oh(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(l,a),m=(0,s.useContext)(Bf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,a&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:a?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Lh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Hh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Lh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Hh(o,e,n,Fh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",Gh),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",Uh);var Wh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),$h=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==gc.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:l?(0,s.createElement)(p.DuotoneSwatch,{values:l}):(0,s.createElement)(Br,{icon:Wh})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const jh=[];function Kh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Su(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 qh(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 Yh(e){let{id:t,values:n}=e;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:n.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:n.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function Qh(e){let{selector:t,id:n,values:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Yh,{id:n,values:o}),(0,s.createElement)(qh,{id:n,selector:t}))}function Zh(e){let{presetSetting:t,defaultSetting:n}=e;const o=!To(n),r=To(`${t}.custom`)||jh,l=To(`${t}.theme`)||jh,i=To(`${t}.default`)||jh;return(0,s.useMemo)((()=>[...r,...l,...o?jh:i]),[o,r,l,i])}function Xh(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=Zh({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=Zh({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)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)($h,{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})}}))}Bu([Iu]);const Jh=(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)(Xh,t))}),"withDuotoneControls"),ev=(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),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(Bf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(Qh,{selector:m,id:p,values:Kh(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");function tv(e){let{preset:t}=e;return(0,s.createElement)(Yh,{id:`wp-duotone-${t.slug}`,values:Kh(t.colors)})}(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",Jh),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ev);const nv="__experimentalLayout";function ov(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(Qn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,nv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=xr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ho,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},v&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,s.createElement)(rv,{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 rv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Ir.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const lv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,nv)&&(0,s.createElement)(ov,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),iv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,nv),a=(0,d.useInstanceId)(e),u=To("layout")||{},p=(0,s.useContext)(Bf.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,nv)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Rr,{blockName:n,selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));function sv(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:rg(e)||void 0,style:Oh({border:n})}}function av(e){const{colors:t}=Kf(),n=sv(e),{borderColor:o}=e;if(o){const e=Xf({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function cv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=$f("background-color",s),m=$f("color",a),f=ig(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:Oh({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,nv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",iv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",lv);const uv={};function dv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=To("color.palette.custom")||[],l=To("color.palette.theme")||[],i=To("color.palette.default")||[],a=To("color.gradients")||uv,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=cv(e);if(t){const e=Uf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=sg(u,o)),n){const e=Uf(c,n);d.style.color=e.color}return d}function pv(e){const{style:t}=e;return{style:Oh({spacing:(null==t?void 0:t.spacing)||{}})}}function mv(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const fv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),gv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=To("color.palette.custom"),o=To("color.palette.theme"),r=To("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function hv(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Su(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Wf(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=Uf(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:$f(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function vv(e){return function(){const t=fv(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(hv(o,t),"withCustomColors")}}function bv(){const e=gv();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(hv(n,e),"withColors")}const kv=[];var _v=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=To("typography.fontSizes")||kv;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=eh(r,l,n[t]);return e[o]={...i,class:nh(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},yv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),Ev=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Cv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Sv=[{icon:yv,title:(0,g.__)("Align text left"),align:"left"},{icon:Ev,title:(0,g.__)("Align text center"),align:"center"},{icon:Cv,title:(0,g.__)("Align text right"),align:"right"}],wv={position:"bottom right",isAlternate:!0};var Bv=function(e){let{value:t,onChange:n,alignmentControls:o=Sv,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Cv:yv,label:r,toggleProps:{describedBy:l},popoverProps:wv,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};const Iv=e=>(0,s.createElement)(Bv,i({},e,{isToolbar:!1})),xv=e=>(0,s.createElement)(Bv,i({},e,{isToolbar:!0}));var Tv={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Qn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=bd(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Gd(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Nc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},Nv=window.wp.apiFetch,Pv=n.n(Nv),Mv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),Rv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),Lv={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Pv()({path:(0,Zd.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Br,{key:"icon",icon:"page"===e.subtype?Mv:Rv}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const Av=[];function Dv(e){let{completers:t=Av}=e;const{name:n}=eo();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Tv,Lv])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Ov=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:Dv(e)}))},Fv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),zv=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Fv,label:n,onClick:()=>o(!t),disabled:r})},Vv=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==gc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Hv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),Gv=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Qn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Qn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(Br,{icon:Hv,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Tp,{clientId:e,maximumLength:35})),(0,s.createElement)(Br,{icon:Hv,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Tp,{clientId:r,maximumLength:35})))};function Uv(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{canEdit:p,isParentSelected:f,hasChildSelected:g,isDraggingBlocks:h,isParentHighlighted:v}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l,canEditBlock:i}=e(Qn);return{canEdit:i(t),isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),b=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":v,"is-dragging-blocks":h});return(0,s.useEffect)((()=>{p?(f||g||l||a(!0),f&&!u&&l&&a(!1),g&&l&&a(!1)):a(!0)}),[f,g,l,u,p]),(0,s.createElement)(n,i({},o,{className:b,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l&&p?()=>a(!1):void 0}),null==o?void 0:o.children)}const Wv=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),$v=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(Wv,null)))},jv=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==gc.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)($v,null)))}))}};var Kv=e=>{let{children:t,...n}=e;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:jv(n),renderContent:()=>t})},qv=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Yv=Xa(p.__experimentalTreeGridRow);function Qv(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=tc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Yv,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function Zv(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(Br,{icon:Hv}))}var Xv=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const f=Ip(o),{isLocked:g}=Lm(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==gc.ENTER&&e.keyCode!==gc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(Zv,{onClick:l}),(0,s.createElement)(Nc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(Tp,{clientId:o,maximumLength:35})),(null==f?void 0:f.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor),g&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Br,{icon:Rm}))))})),Jv=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Qn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,s.createElement)(Np,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(Xv,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));const eb=(0,s.createContext)({__experimentalFeatures:!1,__experimentalPersistentListViewFeatures:!1}),tb=()=>(0,s.useContext)(eb);var nb=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:r,isBranchSelected:l,selectBlock:i,position:a,level:u,rowCount:f,siblingBlockCount:h,showBlockMovers:v,path:b,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}=t;const E=(0,s.useRef)(null),[C,S]=(0,s.useState)(!1),{clientId:w}=n,B=r&&_[0]===w,I=r&&_[_.length-1]===w,{toggleBlockHighlight:x}=(0,m.useDispatch)(Qn),T=Ip(w),{isLocked:N}=Lm(w),P=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,M=((e,t,n)=>(0,g.sprintf)(
72
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
73
- (0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(a,h,u);let R=(0,g.__)("Link");T&&(R=N?(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
74
- (0,g.__)("%s link (locked)"),T.title):(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
75
- (0,g.__)("%s link"),T.title));const L=T?(0,g.sprintf)(// translators: %s: The title of the block.
76
- (0,g.__)("Options for %s block"),T.title):(0,g.__)("Options"),{__experimentalFeatures:A,__experimentalPersistentListViewFeatures:D,__experimentalHideContainerBlockActions:O,isTreeGridMounted:F,expand:z,collapse:V}=tb(),H=v&&h>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":C||r}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":C||B});(0,s.useEffect)((()=>{D&&!F&&r&&E.current.focus()}),[]);const W=D?x:()=>{},$=(0,s.useCallback)((()=>{S(!0),W(w,!0)}),[w,S,W]),j=(0,s.useCallback)((()=>{S(!1),W(w,!1)}),[w,S,W]),K=(0,s.useCallback)((e=>{i(e,w),e.preventDefault()}),[w,i]),q=(0,s.useCallback)((e=>{i(void 0,e)}),[i]),Y=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===k?V(w):!1===k&&z(w)}),[w,z,V,k]),Q=A&&(!O||O&&u>1),Z=A&&!Q;let X;H?X=2:Z&&(X=3);const J=c()({"is-selected":r,"is-first-selected":B,"is-last-selected":I,"is-branch-selected":D&&l,"is-dragging":o,"has-single-cell":Z}),ee=_.includes(w)?_:[w];return(0,s.createElement)(Qv,{className:J,onMouseEnter:$,onMouseLeave:j,onFocus:$,onBlur:j,level:u,position:a,rowCount:f,path:b,id:`list-view-block-${w}`,"data-block":w,isExpanded:k,"aria-selected":!!r},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:X,ref:E,"aria-label":R,"aria-selected":!!r,"aria-expanded":k,"aria-describedby":P},(e=>{let{ref:t,tabIndex:o,onFocus:l}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(Jv,{block:n,onClick:K,onToggleExpanded:Y,isSelected:r,position:a,siblingBlockCount:h,level:u,ref:t,tabIndex:o,onFocus:l,isExpanded:k,selectedClientIds:_,preventAnnouncement:y}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:P},M))})),H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Hp,{orientation:"vertical",clientIds:[w],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Gp,{orientation:"vertical",clientIds:[w],ref:t,tabIndex:n,onFocus:o})})))),Q&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!r},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Um,{clientIds:ee,icon:bm,label:L,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:q})})))}));function ob(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(rb(t,n,o),0):1}const rb=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+ob(r,e,t,n):o+1};function lb(e){const{blocks:t,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,selectedClientIds:l,level:i=1,path:a="",isBranchSelected:c=!1,listPosition:d=0,fixedListWindow:p,expandNested:f}=e,{expandedState:g,draggedClientIds:h,__experimentalPersistentListViewFeatures:v}=tb(),b=(0,u.compact)(t),k=b.length;let _=d;return(0,s.createElement)(s.Fragment,null,b.map(((e,t)=>{var d;const{clientId:y,innerBlocks:E}=e;t>0&&(_+=ob(b[t-1],g,h,f));const C=v,{itemInView:S}=p,w=!C||S(_),B=t+1,I=a.length>0?`${a}_${B}`:`${B}`,x=r&&!!E&&!!E.length,T=x?null!==(d=g[y])&&void 0!==d?d:f:void 0,N=!(null==h||!h.includes(y)),P=N||w,M=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(y,l),R=c||M&&x;return(0,s.createElement)(m.AsyncModeProvider,{key:y,value:!M},P&&(0,s.createElement)(nb,{block:e,selectBlock:n,isSelected:M,isBranchSelected:R,isDragged:N,level:i,position:B,rowCount:k,siblingBlockCount:k,showBlockMovers:o,path:I,isExpanded:T,listPosition:_,selectedClientIds:l}),!P&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),x&&T&&!N&&(0,s.createElement)(lb,{blocks:E,selectBlock:n,showBlockMovers:o,showNestedBlocks:r,level:i+1,path:I,listPosition:_+1,fixedListWindow:p,isBranchSelected:R,selectedClientIds:l,expandNested:f}))})))}lb.defaultProps={selectBlock:()=>{}};var ib=(0,s.memo)(lb);function sb(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,s.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,s.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function ab(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const cb=["top","bottom"];const ub=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var db=(0,s.forwardRef)((function(e,t){let{blocks:n,__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,showNestedBlocks:c,showBlockMovers:f,id:h,expandNested:v=!1,...b}=e;const{clientIdsTree:k,draggedClientIds:_,selectedClientIds:y}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Qn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(n),{visibleBlockCount:E}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Qn),o=(null==_?void 0:_.length)>0?n(_).length+1:0;return{visibleBlockCount:t()-o}}),[_]),{updateBlockSelection:C}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(Qn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(Qn),{getBlockType:f}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===gc.UP||r.keyCode===gc.DOWN||r.keyCode===gc.HOME||r.keyCode===gc.END);if(!m&&!p()&&!d())return void n(s,null);const h=c(),v=[...l(s),s];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c();if((r.keyCode===gc.HOME||r.keyCode===gc.END)&&S.length>1)return;const w=(0,u.difference)(h,S);let B;if(1===w.length){var I;const e=null===(I=f(o(w[0])))||void 0===I?void 0:I.title;e&&(B=(0,g.sprintf)(
77
  /* translators: %s: block name */
78
  (0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
79
  /* translators: %s: number of deselected blocks */
80
- (0,g.__)("%s blocks deselected."),w.length));B&&(0,Ht.speak)(B)}),[e,o,f,l,i,a,c,d,p,t,n])}}(),[S,w]=(0,s.useReducer)(ub,{}),{ref:B,target:I}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Qn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=mf(a,c),p=o(),f=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=gf(t,s,cb),u=ab(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}(),x=(0,s.useRef)(),T=(0,d.useMergeRefs)([x,B,t]),N=(0,s.useRef)(!1),{setSelectedTreeId:P}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(Qn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:y[0],setExpandedState:w}),M=(0,s.useCallback)(((e,t)=>{C(e,t),P(t)}),[P,C]);(0,s.useEffect)((()=>{N.current=!0}),[]);const[R]=(0,d.__experimentalUseFixedWindowList)(x,36,E,{useWindowing:l,windowOverscan:40}),L=(0,s.useCallback)((e=>{e&&w({type:"expand",clientIds:[e]})}),[w]),A=(0,s.useCallback)((e=>{e&&w({type:"collapse",clientIds:[e]})}),[w]),D=(0,s.useCallback)((e=>{var t;L(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[L]),O=(0,s.useCallback)((e=>{var t;A(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[A]),F=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&C(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[C]),z=(0,s.useMemo)((()=>({__experimentalFeatures:o,__experimentalPersistentListViewFeatures:l,__experimentalHideContainerBlockActions:a,isTreeGridMounted:N.current,draggedClientIds:_,expandedState:S,expand:L,collapse:A})),[o,l,a,N.current,_,S,L,A]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(sb,{listViewRef:x,blockDropTarget:I}),(0,s.createElement)(p.__experimentalTreeGrid,{id:h,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:T,onCollapseRow:O,onExpandRow:D,onFocusRow:F},(0,s.createElement)(eb.Provider,{value:z},(0,s.createElement)(ib,i({blocks:k,selectBlock:M,showNestedBlocks:c,showBlockMovers:f,fixedListWindow:R,selectedClientIds:y,expandNested:v},b)))))}));function pb(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:qv,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
81
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var mb=(0,s.forwardRef)((function(e,t){let{isDisabled:n,__experimentalFeatures:o,...r}=e;const l=(0,m.useSelect)((e=>!!e(Qn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:o}=e;return(0,s.createElement)(pb,i({},r,{innerRef:t,isOpen:n,onToggle:o,isEnabled:l}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,g.__)("List view")),(0,s.createElement)(db,{showNestedBlocks:!0,__experimentalFeatures:o}))})}));function fb(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=nm(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(id,{item:i,isStylePreview:!0})}function gb(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function hb(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=rm({clientId:t,onSwitch:n}),[g,h]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[g]),!i||0===i.length)return null;const _=(0,u.debounce)(h,250),y=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>y(e),onFocus:()=>y(e),onMouseLeave:()=>y(null),onBlur:()=>y(null),onClick:()=>(e=>{l(e),o(null),h(null),_.cancel()})(e),"aria-current":a.name===e.name},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),g&&!k&&(0,s.createElement)(gb,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,s.createElement)(fb,{activeStyle:a,className:f,genericPreviewBlock:m,style:g})))}hb.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var vb=hb,bb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),kb=function(e){let{icon:t=bb,label:n=(0,g.__)("Choose variation"),instructions:o=(0,g.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,g.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,g.__)("Skip"))))},_b=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const yb="carousel",Eb="grid",Cb=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},t&&(0,s.createElement)(p.Button,{onClick:t},(0,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Sb=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:Ap,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:Lp,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var wb=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===yb,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:mo,label:(0,g.__)("Carousel view"),onClick:()=>n(yb),isPressed:u}),(0,s.createElement)(p.Button,{icon:_b,label:(0,g.__)("Grid view"),onClick:()=>n(Eb),isPressed:t===Eb}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Sb,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Cb,{onBlockPatternSelect:a,onStartBlank:c}))};const Bb=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,height:l}=e;const a=(0,p.__unstableUseCompositeState)(),c="block-editor-block-pattern-setup__container";if(t===yb){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel",style:{height:l}},(0,s.createElement)("div",{className:c},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(xb,{className:e.get(n)||"",key:t.name,pattern:t,minHeight:l}))))))}return(0,s.createElement)("div",{style:{height:l},className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(p.__unstableComposite,i({},a,{role:"listbox",className:c,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Ib,{key:e.name,pattern:e,onSelect:r,composite:a})))))};function Ib(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(Ib,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(rd,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function xb(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,d.useInstanceId)(xb,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(rd,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(p.VisuallyHidden,{id:a},i))}var Tb=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(yb),[u,p]=(0,s.useState)(0),[f,g]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(Qn),v=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Qn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o),[b,{height:k}]=(0,d.useResizeObserver)();if(null==v||!v.length||f)return l;const _=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)}),y=l?()=>{g(!0)}:void 0;return(0,s.createElement)(s.Fragment,null,b,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Bb,{viewMode:a,activeSlide:u,patterns:v,onBlockPatternSelect:_,height:k-120}),(0,s.createElement)(wb,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:v.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{_(v[u].blocks)},onStartBlank:y})))};function Nb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Transform to variation")),r.map((e=>(0,s.createElement)(p.Button,{key:e.name,icon:e.icon,isPressed:o===e.name,label:o===e.name?e.title:(0,g.sprintf)(
82
  /* translators: %s: Name of the block variation */
83
- (0,g.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function Pb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(p.DropdownMenu,{className:t,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:Op,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var Mb=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(Qn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(Qn),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return l.forEach((t=>{t.icon&&e.add(t.icon)})),e.size===l.length}),[l]);if(null==l||!l.length)return null;const c=a?Nb:Pb;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},Rb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{d:"M5 11.25h14v1.5H5z"})),Lb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5 11.25h3v1.5H5v-1.5zm5.5 0h3v1.5h-3v-1.5zm8.5 0h-3v1.5h3v-1.5z",clipRule:"evenodd"})),Ab=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none"},(0,s.createElement)(O.Path,{fillRule:"evenodd",d:"M5.25 11.25h1.5v1.5h-1.5v-1.5zm3 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5zm1.5 0h1.5v1.5h-1.5v-1.5zm4.5 0h-1.5v1.5h1.5v-1.5z",clipRule:"evenodd"}));const Db=[{label:(0,g.__)("Solid"),icon:Rb,value:"solid"},{label:(0,g.__)("Dashed"),icon:Lb,value:"dashed"},{label:(0,g.__)("Dotted"),icon:Ab,value:"dotted"}];function Ob(e){let{onChange:t,value:n}=e;return(0,s.createElement)("fieldset",{className:"components-border-style-control"},(0,s.createElement)("legend",null,(0,g.__)("Style")),(0,s.createElement)("div",{className:"components-border-style-control__buttons"},Db.map((e=>(0,s.createElement)(p.Button,{key:e.value,icon:e.icon,isSmall:!0,isPressed:e.value===n,onClick:()=>t(e.value===n?void 0:e.value),"aria-label":e.label})))))}var Fb=(0,d.createHigherOrderComponent)((e=>t=>{const n=To("color.palette"),o=!To("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),zb=Fb(p.ColorPalette);function Vb(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(gg,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var Hb=window.wp.date;const Gb=new Date(2022,0,25);function Ub(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,Hb.dateI18n)(n,Gb))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(Wb,{format:t,onChange:o}))}function Wb(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,Hb.dateI18n)(e,Gb),format:e}))),i={key:"custom",name:(0,g.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,g.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(p.CustomSelectControl,{label:(0,g.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,g.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}function $b(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,s.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,s.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,s.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,s.createElement)(gg,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}
84
  // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
85
- const jb=(0,g.__)("(%s: color %s)"),Kb=(0,g.__)("(%s: gradient %s)"),qb=["colors","disableCustomColors","gradients","disableCustomGradients"],Yb=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:a,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=Wf(c||t,l);r=(0,g.sprintf)(jb,a.toLowerCase(),e&&e.name||l)}else{const e=ag(u||n,l);r=(0,g.sprintf)(Kb,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},Qb=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,s.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,s.createElement)(Yb,{colors:n,gradients:o,settings:d}));return(0,s.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,s.createElement)($b,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},Zb=e=>{const t=jf();return t.colors=To("color.palette"),t.gradients=To("color.gradients"),(0,s.createElement)(Qb,i({},t,e))},Xb=e=>{const t=Kf();return(0,s.createElement)(Qb,i({},t,e))};// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
86
- var Jb=e=>(0,u.every)(qb,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(Qb,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Xb,e):(0,s.createElement)(Zb,e),ek=function(e,t){return(ek=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])})(e,t)},tk=function(){return(tk=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}).apply(this,arguments)};function nk(e,t,n,o){void 0===o&&(o=0);var r=mk(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function ok(e,t,n,o,r){void 0===r&&(r=0);var l=mk(t.width,t.height,r),i=l.width,s=l.height;return{x:rk(e.x,i,n.width,o),y:rk(e.y,s,n.height,o)}}function rk(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function lk(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ik(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function sk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?ak:ck,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:tk(tk({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function ak(e,t){return Math.min(e,Math.max(0,t))}function ck(e,t){return t}function uk(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function dk(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function pk(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function mk(e,t,n){var o=e/2,r=t/2,l=[pk(0,0,o,r,n),pk(e,0,o,r,n),pk(e,t,o,r,n),pk(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function fk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var gk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=uk(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:nk(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=tk({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?ok(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?ok(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=sk(n.props.restrictPosition?ok(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?ok(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}ek(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=lk(n,o),this.lastPinchRotation=ik(n,o),this.onDragStart(dk(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=dk(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=lk(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=ik(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,v=h.containerClassName,b=h.cropAreaClassName,k=h.mediaClassName;return zl().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:fk("reactEasyCrop_Container",v)},n?zl().createElement("img",tk({alt:"",className:fk("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:tk(tk({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&zl().createElement("video",tk({autoPlay:!0,loop:!0,muted:!0,className:fk("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:tk(tk({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&zl().createElement("div",{style:tk(tk({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:fk("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(zl().Component);const hk={position:"bottom right",isAlternate:!0};const vk=(0,s.createContext)({}),bk=()=>(0,s.useContext)(vk);function kk(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,g]=(0,s.useState)(),[h,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),g(e),v(1/h),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),g(e),v(1/h),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,g,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Cd.store),[p,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,Pv()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,g.sprintf)(
87
  /* translators: 1. Error message */
88
- (0,g.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:h})),[p,v,h])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(vk.Provider,{value:f},u)}function _k(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:g,setCrop:h,setZoom:v,rotation:b}=bk();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(gk,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var yk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function Ek(){const{isInProgress:e,zoom:t,setZoom:n}=bk();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:hk,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:yk,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var Ck=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Sk(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?Jp:void 0},t)})))}function wk(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=bk();return(0,s.createElement)(p.DropdownMenu,{icon:Ck,label:(0,g.__)("Aspect Ratio"),popoverProps:hk,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Sk,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(Sk,{label:(0,g.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(Sk,{label:(0,g.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))}))}var Bk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function Ik(){const{isInProgress:e,rotateClockwise:t}=bk();return(0,s.createElement)(p.ToolbarButton,{icon:Bk,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function xk(){const{isInProgress:e,apply:t,cancel:n}=bk();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function Tk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(_k,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(io,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Ek,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(wk,{toggleProps:e}))),(0,s.createElement)(Ik,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(xk,null))))}const Nk=[25,50,75,100];function Pk(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},Nk.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,g.__)("Reset")))))}var Mk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Rk=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)},Lk=n(5425),Ak=n.n(Lk);class Dk extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,Ak()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,Zd.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,g.sprintf)(
89
  /* translators: %s: number of results. */
90
- (0,g._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,g.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case gc.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case gc.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case gc.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case gc.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case gc.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case gc.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case gc.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,s=i;const a=n&&n.length;return l||a||(s=!1),!0===r&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,g.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,h={id:`url-input-control-${o}`,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},v={value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":(0,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(h,v,a):(0,s.createElement)(p.BaseControl,h,(0,s.createElement)("input",v),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,s.createElement)("div",i({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var Ok=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Qn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Dk),Fk=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:a}=e;return n?(t=a?(0,u.isFunction)(a)?a(n):a:(0,s.createInterpolateElement)((0,g.sprintf)(
91
  /* translators: %s: search term. */
92
- (0,g.__)("Create: <mark>%s</mark>"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(Br,{className:"block-editor-link-control__search-item-icon",icon:Bc}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},zk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})),Vk=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:a="",shouldShowType:u=!1}=e;return(0,s.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,s.createElement)(Br,{className:"block-editor-link-control__search-item-icon",icon:zk}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,s.createElement)(p.TextHighlight,{text:n.title,highlight:a})),(0,s.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,Zd.filterURLForDisplay)((0,Zd.safeDecodeURI)(n.url))||""),l&&(0,g.__)("Press ENTER to add this link"))),u&&n.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const Hk="__CREATE__",Gk=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function Uk(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:h,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=["url","mailto","tel","internal"],_=1===u.length&&k.includes(u[0].type.toLowerCase()),y=n&&!_&&!f,E=!(null!=v&&v.type),C=`block-editor-link-control-search-results-label-${t}`,S=f?(0,g.__)("Recently updated"):(0,g.sprintf)(
93
  /* translators: %s: search term. */
94
- (0,g.__)('Search results for "%s"'),o),w=(0,s.createElement)(f?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},S));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},w,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&Hk===e.type?(0,s.createElement)(Fk,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):Hk===e.type?null:(0,s.createElement)(Vk,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Wk(e){const t=(0,u.startsWith)(e,"#");return(0,Zd.isURL)(e)||e&&e.includes("www.")||t}const $k=()=>Promise.resolve([]),jk=e=>{let t="URL";const n=(0,Zd.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,Zd.prependHTTP)(e):e,type:t}])};const Kk=()=>Promise.resolve([]),qk=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=u.noop,onChange:f=u.noop,onSelect:h=u.noop,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(Uk,e)),fetchSuggestions:k=null,allowDirectEntry:_=!0,showInitialSuggestions:y=!1,suggestionsQuery:E={},withURLSuggestion:C=!0,createSuggestionButtonText:S,useLabel:w=!1}=e;const B=function(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?jk:$k;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return Wk(t)?i(t,{isInitialSuggestions:a}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:s}=t;let a=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(a=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!a&&u&&l&&!s?c[0].concat(c[1]):c[0],s||Wk(e)||!r?c:c.concat({title:e,url:e,type:Hk})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),I=v?k||B:Kk,x=(0,d.useInstanceId)(qk),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(Hk!==e.type)(_||t&&Object.keys(t).length>=1)&&h({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&h(t)}catch(e){}},M=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(Ok,{label:w?"URL":void 0,className:M,value:n,onChange:(e,t)=>{f(e),N(t)},placeholder:null!=i?i:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:x,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:I,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:y,onSubmit:(e,t)=>{var o;const r=e||T;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?P(r||{url:n}):t.preventDefault()},ref:t}),o)}));var Yk=qk,Qk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Zk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:Xk,Fill:Jk}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function e_(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function t_(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const a=r?null==n?void 0:n.url:null,{richData:u,isFetching:d}=function(e){const[t,n]=(0,s.useReducer)(e_,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(a),f=u&&Object.keys(u).length,h=n&&(0,Zd.filterURLForDisplay)((0,Zd.safeDecodeURI)(n.url),16)||"",v=(null==u?void 0:u.title)||(null==n?void 0:n.title)||h,b=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let k;return k=null!=u&&u.icon?(0,s.createElement)("img",{src:null==u?void 0:u.icon,alt:""}):b?(0,s.createElement)(Br,{icon:Qk,size:32}):(0,s.createElement)(Br,{icon:zk}),(0,s.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":f,"is-fetching":!!d,"is-preview":!0,"is-error":b})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==u?void 0:u.icon})},k),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},b?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,g.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,el.__unstableStripHTML)(v)),(null==n?void 0:n.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},h)))),(0,s.createElement)(p.Button,{icon:Zk,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:Of,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(Xk,{fillProps:n})),(f&&((null==u?void 0:u.image)||(null==u?void 0:u.description))||d)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==u?void 0:u.image)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=u&&u.image)})},(null==u?void 0:u.image)&&(0,s.createElement)("img",{src:null==u?void 0:u.image,alt:""})),((null==u?void 0:u.description)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=u&&u.description)})},(null==u?void 0:u.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}function n_(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Gk,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:h,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,s.useRef)(!0),x=(0,s.useRef)(),T=(0,s.useRef)(),[N,P]=(0,s.useState)((null==l?void 0:l.url)||""),[M,R]=(0,s.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,s.useState)(void 0!==v?v:!l||!l.url),O=(0,s.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length),{createPage:z,isCreatingPage:V,errorMessage:H}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b);function G(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(el.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A,V]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const U=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||a({url:L,title:M}),G()},W=d&&l&&!A&&!V,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&w;return(0,s.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},V&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,g.__)("Creating"),"…"),(A||!l)&&!V&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,s.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==gc.ENTER||F||(e.preventDefault(),U())}}),(0,s.createElement)(Yk,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:z,onChange:P,onSelect:e=>{a({...e,title:M||(null==e?void 0:e.title)}),G()},showInitialSuggestions:h,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:U,label:(0,g.__)("Submit"),icon:Mk,className:"block-editor-link-control__search-submit",disabled:F})))),H&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},H)),l&&!A&&!V&&(0,s.createElement)(t_,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:S,hasUnlinkControl:W,onRemove:d}),$&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(Rk,{value:l,settings:i,onChange:a})),B&&B())}n_.ViewerFill=Jk;var o_=n_,r_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),l_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),i_=(0,p.withFilters)("editor.MediaUpload")((()=>null)),s_=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return!!t().mediaUpload}),[])?n:t},a_=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Cd.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:a,onSelectURL:c,onFilesUpload:d=u.noop,onCloseModal:f=u.noop,name:h=(0,g.__)("Replace"),createNotice:v,removeNotice:b,children:k,multiple:_=!1,addToGallery:y,handleUpload:E=!0}=e;const[C,S]=(0,s.useState)(t),w=(0,m.useSelect)((e=>e(Qn).getSettings().mediaUpload),[]),B=(0,s.useRef)(),I=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),x=e=>{const t=(0,el.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:I,isDismissible:!0})}),1e3)},T=(e,t)=>{t(),S(null==e?void 0:e.url),a(e),(0,Ht.speak)((0,g.__)("The media file has been replaced")),b(I)},N=e=>{e.keyCode===gc.DOWN&&(e.preventDefault(),e.target.click())},P=_&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{ref:B,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:N},h)},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(i_,{gallery:P,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>T(e,t),allowedTypes:r,onClose:f,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:r_,onClick:t},(0,g.__)("Open Media Library"))}}),(0,s.createElement)(s_,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);d(n),w({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;T(n,t)},onError:x})})(e,t)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:l_,onClick:()=>{t()}},(0,g.__)("Upload"))}})),k),c&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,g.__)("Current media URL:")),(0,s.createElement)(o_,{value:{url:C},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;S(t),c(t),B.current.focus()}})))}})}));function c_(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,s.createElement)(p.ExternalLink,{className:r,href:t},n||(0,Zd.filterURLForDisplay)((0,Zd.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function u_(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...a}=e;const[c,u]=(0,s.useState)(!1),d=!!o&&c;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},a),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:Op,label:(0,g.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}u_.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,s.createElement)(Ok,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:Mk,label:(0,g.__)("Apply"),type:"submit"}))},u_.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...a}=e;return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},a),(0,s.createElement)(c_,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:Zk,label:(0,g.__)("Edit"),onClick:o}))};var d_=u_;const p_=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(d_,{onClose:r},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,g.__)("URL"),placeholder:(0,g.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Mk,label:(0,g.__)("Apply"),type:"submit"})))};var m_=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:d,accept:f,addToGallery:h,multiple:v=!1,handleUpload:b=!0,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:S,onDoubleClick:w,onFilesPreUpload:B=u.noop,onHTMLDrop:I=u.noop,onClose:x=u.noop,children:T,mediaLibraryButton:N,placeholder:P,style:M}=e;const R=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().mediaUpload}),[]),[L,A]=(0,s.useState)(""),[D,O]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;A(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const F=e=>{A(e.target.value)},z=()=>{O(!0)},V=()=>{O(!1)},H=e=>{e.preventDefault(),L&&S&&(S(L),V())},G=e=>{if(!b)return E(e);let o;if(B(e),v)if(h){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));E(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=E;else o=e=>{let[t]=e;return E(t)};R({allowedTypes:n,filesList:e,onFileChange:o,onError:y})},U=e=>{G(e.target.files)},W=null!=P?P:e=>{let{instructions:t,title:u}=l;if(R||S||(t=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&R&&(t=(0,g.__)("Upload a media file or pick one from your media library."),l?t=(0,g.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,g.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,g.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,g.__)("Media"),l?u=(0,g.__)("Audio"):i?u=(0,g.__)("Image"):s&&(u=(0,g.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,s.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:a,onDoubleClick:w,preview:i,style:M},e,T)},$=()=>k?null:(0,s.createElement)(p.DropZone,{onFilesDrop:G,onHTMLDrop:I}),j=()=>C&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:C},(0,g.__)("Cancel")),K=()=>S&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:D,variant:"tertiary"},(0,g.__)("Insert from URL")),D&&(0,s.createElement)(p_,{src:L,onChange:F,onSubmit:H,onClose:V}));return _?(0,s.createElement)(s_,null,$()):(0,s.createElement)(s_,{fallback:W(K())},(()=>{const e=null!=N?N:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,g.__)("Media Library"))},o=(0,s.createElement)(i_,{addToGallery:h,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:E,onClose:x,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(R&&d)return(0,s.createElement)(s.Fragment,null,$(),(0,s.createElement)(p.FormFileUpload,{onChange:U,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,g.__)("Upload")),o,K(),j());return W(n)}}));if(R){const e=(0,s.createElement)(s.Fragment,null,$(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:f,multiple:v},(0,g.__)("Upload")),o,K(),j());return W(e)}return W(o)})())})),f_=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(Jb,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const g_={position:"bottom right",isAlternate:!0};var h_=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:Op
95
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,g.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:g_})))}))),v_=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(h_,null)))):(0,s.createElement)(io,{group:"inline"},(0,s.createElement)(h_,null))};function b_(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==gc.DELETE&&o!==gc.BACKSPACE&&o!==gc.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function k_(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,km.createBlobURL)(e)}">`)).join("")}var y_=window.wp.shortcode;function E_(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function C_(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function S_(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?S_.EMPTY_ARRAY:t||n?t||(H()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}function w_(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:s=0,end:a=0}=t,c={...t,start:s,end:a},u=[],[d,p]=(0,z.split)(c),m=n.length>0;let f=-1;const g=(0,z.isEmpty)(d)&&!(0,z.isEmpty)(p);m&&(0,z.isEmpty)(d)||(u.push(r((0,z.toHTMLString)({value:d,multilineTag:i}),!g)),f+=1),m?(u.push(...n),f+=n.length):l&&u.push(l()),(m||l)&&(0,z.isEmpty)(p)||u.push(r((0,z.toHTMLString)({value:p,multilineTag:i}),g)),o(u,m?f:1,m?-1:0)}function B_(e,t){return t?(0,z.replace)(e,/\n+/g,z.__UNSTABLE_LINE_SEPARATOR):(0,z.replace)(e,new RegExp(z.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function I_(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:g}=t.current;if(!n)return;const{clipboardData:h}=e;let v="",b="";try{v=h.getData("text/plain"),b=h.getData("text/html")}catch(e){try{b=h.getData("Text")}catch(e){return}}if(b=function(e){return e.replace(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(b),b=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,z.insert)(i,v));const k=s.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,el.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,z.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=B_(t,!!m),E_(t,i.activeFormats),void l((0,z.insert)(i,t))}if(g)return void l((0,z.insert)(i,(0,z.create)({text:v})));if(null!=_&&_.length&&!_m(_,b)){const e=(0,r.pasteHandler)({HTML:k_(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,z.isEmpty)(i)?c(e):w_({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,z.isEmpty)(i)&&(E=v,(0,y_.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,z.isEmpty)(i)&&(0,Zd.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,z.create)({html:C});e=B_(e,!!m),E_(e,i.activeFormats),l((0,z.insert)(i,e))}else C.length>0&&(c&&(0,z.isEmpty)(i)?c(C,C.length-1,-1):w_({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function x_(e){let t=e.length;for(;t--;){const n=(0,u.findKey)(e[t].attributes,(e=>"string"==typeof e&&-1!==e.indexOf("†")));if(n)return e[t].attributes[n]=e[t].attributes[n].replace("†",""),e[t].clientId;const o=x_(e[t].innerBlocks);if(o)return o}}function T_(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(Qn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t,selectionChange:l}=o.current;if(!t)return;const{start:i,text:s}=e;if(" "!==s.slice(i-1,i))return;const a=s.slice(0,i).trim(),c=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=(0,r.findTransform)(c,(e=>{let{prefix:t}=e;return a===t}));if(!u)return;const d=(0,z.toHTMLString)({value:(0,z.insert)(e,"†",0,i)}),p=u.transform(d);l(x_([p])),t([p]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,z.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function N_(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(Qn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==gc.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,z.insert)(m,"\n")):f&&(0,z.__unstableIsEmptyLine)(m)?w_({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,z.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,z.insert)(m,"\n")):!f&&r?p():f&&w_({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function P_(e){return e(z.store).getFormatTypes()}S_.EMPTY_ARRAY=[];const M_=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function R_(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function L_(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function A_(){const{isMultiSelecting:e}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function D_(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,z.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,z.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,z.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const O_=(0,s.createContext)(),F_=(0,s.createContext)(),z_=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:f,isSelected:g,multiline:h,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:S,onRemove:w,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const V=(0,d.useInstanceId)(e);N=N||V,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const G=(0,s.useRef)(),{clientId:U}=eo(),{selectionStart:W,selectionEnd:$,isSelected:j}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(Qn),o=t(),r=n();let l;return void 0===g?l=o.clientId===U&&r.clientId===U&&o.attributeKey===N:g&&(l=o.clientId===U),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{selectionChange:K}=(0,m.useDispatch)(Qn),q=C_(h),Y=S_({allowedFormats:E,formattingControls:C,disableFormats:L}),Q=!Y||Y.length>0;let Z=a,X=f;Array.isArray(a)&&(Z=r.children.toHTML(a),X=e=>f(r.children.fromDOM((0,z.__unstableCreateElement)(document,e).childNodes)));const J=(0,s.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;("number"==typeof e||o)&&(n.start={clientId:U,attributeKey:N,offset:e}),("number"==typeof t||o)&&(n.end={clientId:U,attributeKey:N,offset:t}),K(n)}),[U,N]),{formatTypes:ee,prepareHandlers:te,valueHandlers:ne,changeHandlers:oe,dependencies:re}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(P_,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&M_.has(n))}))),[l,r,M_]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:U,identifier:N,withoutInteractiveFormatting:S,allowedFormats:Y});function le(e){return ee.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,z.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ie,onChange:se,ref:ae}=(0,z.__unstableUseRichText)({value:Z,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(oe).forEach((e=>{e(n,o)}))},selectionStart:W,selectionEnd:$,onSelectionChange:J,placeholder:y,__unstableIsSelected:j,__unstableMultilineTag:q,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...re,l],__unstableAfterParse:function(e){return ne.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:le,__unstableAddInvisibleFormats:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ce=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:Dv(e)})}({onReplace:_,completers:k,record:ie,onChange:se});!function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(Qn);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:Z,value:ie});const ue=(0,s.useRef)(new Set),de=(0,s.useRef)(new Set);function pe(){G.current.focus()}const me=l,fe=(0,s.createElement)(s.Fragment,null,j&&(0,s.createElement)(O_.Provider,{value:ue},(0,s.createElement)(F_.Provider,{value:de},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:ie,onChange:se,onFocus:pe}),(0,s.createElement)(D_,{value:ie,onChange:se,onFocus:pe,formatTypes:ee,forwardedRef:G})))),j&&Q&&(0,s.createElement)(v_,{inline:v,anchorRef:G.current}),(0,s.createElement)(me,i({role:"textbox","aria-multiline":!A,"aria-label":y},F,ce,{ref:(0,d.useMergeRefs)([n,ce.ref,F.ref,ae,T_({value:ie,onChange:se,__unstableAllowPrefixTransformations:O,formatTypes:ee,onReplace:_,selectionChange:K}),(0,d.useRefEffect)((e=>{function t(e){(gc.isKeyboardEvent.primary(e,"z")||gc.isKeyboardEvent.primary(e,"y")||gc.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),R_(ue),L_(de),b_(),I_({isSelected:j,disableFormats:L,onChange:se,value:ie,formatTypes:ee,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:q,preserveWhiteSpace:P,pastePlainText:M}),N_({removeEditorOnlyFormats:le,value:ie,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:q,onChange:se,disableLineBreaks:A,onSplitAtEnd:x}),A_(),G]),contentEditable:!0,suppressContentEditableWarning:!0,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===gc.DELETE||t===gc.BACKSPACE)){const{start:n,end:o,text:r}=ie,l=t===gc.BACKSPACE,i=ie.activeFormats&&!!ie.activeFormats.length;if(!(0,z.isCollapsed)(ie)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),w&&(0,z.isEmpty)(ie)&&l&&w(!l),e.preventDefault()}}})));if(!b)return fe;H()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const ge=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:ge},fe)}));z_.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=C_(o);!t&&i&&(t=`<${i}></${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},z_.isEmpty=e=>!e||0===e.length;var V_=z_;const H_=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(V_,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));H_.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};var G_=H_,U_=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(G_,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(bl.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function W_(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(W_),l=o||(0,g.sprintf)(
96
  /* translators: 1: property name. 2: viewport name. */
97
- (0,g._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var $_=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:u={id:"all",
98
  /* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
99
  label:(0,g.__)("All")},viewports:d=[{id:"small",label:(0,g.__)("Small screens")},{id:"medium",label:(0,g.__)("Medium screens")},{id:"large",label:(0,g.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,g.sprintf)(
100
  /* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
101
- (0,g.__)("Use the same %s on all screensizes."),n),f=(0,g.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=l((0,s.createElement)(W_,{property:n,viewport:u}),u);
102
- /* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&h,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(W_,{property:n,viewport:e}),e))))))))};function j_(e){let{character:t,type:n,onUse:o}=e;const r=(0,s.useContext)(O_),l=(0,s.useRef)();return l.current=o,(0,s.useEffect)((()=>{function e(e){gc.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function K_(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,a="RichText.ToolbarControls";return n&&(a+=`.${n}`),o&&r&&(t=gc.displayShortcut[o](r)),(0,s.createElement)(p.Fill,{name:a},(0,s.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function q_(e){let{inputType:t,onInput:n}=e;const o=(0,s.useContext)(F_),r=(0,s.useRef)();return r.current=n,(0,s.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const Y_=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var Q_=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(Qn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(Qn),r=e=>{o("edit"!==e)};return(0,s.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,s.createElement)(p.Button,i({},e,{ref:t,icon:n?Y_:Zk,"aria-expanded":r,"aria-haspopup":"true",onClick:l
103
- /* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,g.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Br,{icon:Zk}),(0,g.__)("Edit"))},{value:"select",label:(0,s.createElement)(s.Fragment,null,Y_,(0,g.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,g.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function Z_(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:To("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,s.createElement)(p.__experimentalUnitControl,i({units:o},n))}var X_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class J_ extends s.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,g.__)("Edit link"):(0,g.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(p.Button,{icon:Df,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(p.Button,{className:"block-editor-url-input__back",icon:X_,label:(0,g.__)("Close"),onClick:this.toggle}),(0,s.createElement)(Ok,{value:e||"",onChange:t}),(0,s.createElement)(p.Button,{icon:Mk,label:(0,g.__)("Submit"),type:"submit"}))))}}var ey=J_,ty=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const ny="none",oy="custom",ry="media",ly="attachment",iy=["noreferrer","noopener"],sy=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,s.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),ay=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:c,rel:d}=e;const[m,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!0)})),[v,b]=(0,s.useState)(!1),[k,_]=(0,s.useState)(null),y=(0,s.useRef)(null),E=(0,s.useCallback)((()=>{t!==ry&&t!==ly||_(""),b(!0)})),C=(0,s.useCallback)((()=>{b(!1)})),S=(0,s.useCallback)((()=>{_(null),C(),f(!1)})),w=(0,s.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(f(!1),_(null),C())})),B=(0,s.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=x().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||oy;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),I=(0,s.useCallback)((()=>{n({linkDestination:ny,href:""})})),x=()=>{const e=[{linkDestination:ry,title:(0,g.__)("Media File"),url:"image"===r?l:void 0,icon:sy}];return"image"===r&&i&&e.push({linkDestination:ly,title:(0,g.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},T=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=d?d:"").split(" ");iy.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===iy.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,s.createElement)(p.TextControl,{label:(0,g.__)("Link Rel"),value:null!=d?d:"",onChange:e=>{n({rel:e})}}),(0,s.createElement)(p.TextControl,{label:(0,g.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=((0,u.find)(x(),["linkDestination",t])||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{icon:Df,className:"components-toolbar__control",label:o?(0,g.__)("Edit link"):(0,g.__)("Insert link"),"aria-expanded":m,onClick:h}),m&&(0,s.createElement)(d_,{onFocusOutside:w(),onClose:S,renderSettings:()=>T,additionalControls:!N&&(0,s.createElement)(p.NavigableMenu,null,(0,u.map)(x(),(e=>(0,s.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=x();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:oy}).linkDestination:ny,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,s.createElement)(d_.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:_,onSubmit:B(),autocompleteRef:y}),o&&!v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(d_.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:P}),(0,s.createElement)(p.Button,{icon:ty,label:(0,g.__)("Remove link"),onClick:I}))))};function cy(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,
104
  /* translators: button label text should, if possible, be under 16 characters. */
105
- children:(0,g.__)("Preview")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:a,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&Jp},(0,g.__)("Desktop")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&Jp},(0,g.__)("Tablet")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&Jp},(0,g.__)("Mobile"))),t)))}function uy(e){const[t,n]=(0,s.useState)(window.innerWidth);(0,s.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var dy=(0,m.withSelect)((e=>({selectedBlockClientId:e(Qn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=So(t);return t?(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,g.__)("Skip to the selected block")):null})),py=window.wp.wordcount,my=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(Qn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,py.count)((0,r.serialize)(t),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(Nc,{icon:Qp,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,g.sprintf)(
106
  /* translators: %d: number of blocks */
107
  (0,g._n)("%d block","%d blocks",t.length),t.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,g.sprintf)(
108
  /* translators: %d: number of words */
109
- (0,g._n)("%d word","%d words",n),n))))}));function fy(e){let{blockName:t}=e;const{preferredStyle:n,onUpdatePreferredStyleVariations:o,styles:l}=(0,m.useSelect)((e=>{var n,o;const l=e(Qn).getSettings().__experimentalPreferredStyleVariations;return{preferredStyle:null==l||null===(n=l.value)||void 0===n?void 0:n[t],onUpdatePreferredStyleVariations:null!==(o=null==l?void 0:l.onChange)&&void 0!==o?o:null,styles:e(r.store).getBlockStyles(t)}}),[t]),i=(0,s.useMemo)((()=>[{label:(0,g.__)("Not set"),value:""},...l.map((e=>{let{label:t,name:n}=e;return{label:t,value:n}}))]),[l]),a=(0,s.useMemo)((()=>{var e;return null===(e=om(l))||void 0===e?void 0:e.name}),[l]),c=(0,s.useCallback)((e=>{o(t,e)}),[t,o]);return n&&n!==a?o&&(0,s.createElement)("div",{className:"default-style-picker__default-switcher"},(0,s.createElement)(p.SelectControl,{options:i,value:n||"",label:(0,g.__)("Default Style"),onChange:c})):null}const gy=e=>{let{clientId:t,blockName:n,hasBlockStyles:o}=e;const l=Ip(t);return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(Pc,l),(0,s.createElement)(Mb,{blockClientId:t}),o&&(0,s.createElement)("div",null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Styles")},(0,s.createElement)(vb,{scope:"core/block-inspector",clientId:t}),(0,r.hasBlockSupport)(n,"defaultStylePicker",!0)&&(0,s.createElement)(fy,{blockName:n}))),(0,s.createElement)(Ho.Slot,null),(0,s.createElement)(Ho.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Ho.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,s.createElement)(Ho.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,s.createElement)(Ho.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}),(0,s.createElement)("div",null,(0,s.createElement)(hy,null)),(0,s.createElement)(dy,{key:"back"}))},hy=()=>{const e=(0,p.__experimentalUseSlot)(Vo.slotName);return Boolean(e.fills&&e.fills.length)?(0,s.createElement)(p.PanelBody,{className:"block-editor-block-inspector__advanced",title:(0,g.__)("Advanced"),initialOpen:!1},(0,s.createElement)(Ho.Slot,{__experimentalGroup:"advanced"})):null};var vy=e=>{let{showNoBlockSelectedMessage:t=!0}=e;const{count:n,hasBlockStyles:o,selectedBlockName:l,selectedBlockClientId:i,blockType:a}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getSelectedBlockCount:n,getBlockName:o}=e(Qn),{getBlockStyles:l}=e(r.store),i=t(),s=i&&o(i),a=s&&(0,r.getBlockType)(s),c=s&&l(s);return{count:n(),selectedBlockClientId:i,selectedBlockName:s,blockType:a,hasBlockStyles:c&&c.length>0}}),[]);if(n>1)return(0,s.createElement)("div",{className:"block-editor-block-inspector"},(0,s.createElement)(my,null),(0,s.createElement)(Ho.Slot,null),(0,s.createElement)(Ho.Slot,{__experimentalGroup:"color",label:(0,g.__)("Color"),className:"color-block-support-panel__inner-wrapper"}),(0,s.createElement)(Ho.Slot,{__experimentalGroup:"typography",label:(0,g.__)("Typography")}),(0,s.createElement)(Ho.Slot,{__experimentalGroup:"dimensions",label:(0,g.__)("Dimensions")}),(0,s.createElement)(Ho.Slot,{__experimentalGroup:"border",label:(0,g.__)("Border")}));const c=l===(0,r.getUnregisteredTypeHandlerName)();return a&&i&&!c?(0,s.createElement)(gy,{clientId:i,blockName:a.name,hasBlockStyles:o}):t?(0,s.createElement)("span",{className:"block-editor-block-inspector__no-blocks"},(0,g.__)("No block selected.")):null};function by(e){let{children:t,__unstableContentRef:n,...o}=e;const r=(0,d.useViewportMatch)("medium"),l=(0,m.useSelect)((e=>e(Qn).getSettings().hasFixedToolbar),[]),a=(0,Hc.__unstableUseShortcutEventMatch)(),{getSelectedBlockClientIds:c,getBlockRootClientId:f}=(0,m.useSelect)(Qn),{duplicateBlocks:g,removeBlocks:h,insertAfterBlock:v,insertBeforeBlock:b,clearSelectedBlock:k,moveBlocksUp:_,moveBlocksDown:y}=(0,m.useDispatch)(Qn);return(0,s.createElement)("div",i({},o,{onKeyDown:function(e){if(a("core/block-editor/move-up",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));_(t,n)}}else if(a("core/block-editor/move-down",e)){const t=c();if(t.length){e.preventDefault();const n=f((0,u.first)(t));y(t,n)}}else if(a("core/block-editor/duplicate",e)){const t=c();t.length&&(e.preventDefault(),g(t))}else if(a("core/block-editor/remove",e)){const t=c();t.length&&(e.preventDefault(),h(t))}else if(a("core/block-editor/insert-after",e)){const t=c();t.length&&(e.preventDefault(),v((0,u.last)(t)))}else if(a("core/block-editor/insert-before",e)){const t=c();t.length&&(e.preventDefault(),b((0,u.first)(t)))}else a("core/block-editor/unselect",e)&&c().length>1&&(e.preventDefault(),k(),e.target.ownerDocument.defaultView.getSelection().removeAllRanges())}}),(0,s.createElement)(Cp,{__unstableContentRef:n},(l||!r)&&(0,s.createElement)(Jm,{isFixed:!0}),(0,s.createElement)(rf,{__unstableContentRef:n}),(0,s.createElement)(p.Popover.Slot,{name:"block-toolbar",ref:kp(n)}),t,(0,s.createElement)(p.Popover.Slot,{name:"__unstable-block-tools-after",ref:kp(n)})))}var ky=(0,s.forwardRef)((function(e,t){let{rootClientId:n,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i=!1,__experimentalInsertionIndex:a,__experimentalFilterValue:c,onSelect:d=u.noop,shouldFocusBlock:p=!1}=e;const f=(0,m.useSelect)((e=>{const{getBlockRootClientId:t}=e(Qn);return n||t(o)||void 0}),[o,n]);return(0,s.createElement)(cp,{onSelect:d,rootClientId:f,clientId:o,isAppender:r,showInserterHelpPanel:l,showMostUsedBlocks:i,__experimentalInsertionIndex:a,__experimentalFilterValue:c,shouldFocusBlock:p,ref:t})}));function _y(){return null}_y.Register=function(){const{registerShortcut:e}=(0,m.useDispatch)(Hc.store);return(0,s.useEffect)((()=>{e({name:"core/block-editor/duplicate",category:"block",description:(0,g.__)("Duplicate the selected block(s)."),keyCombination:{modifier:"primaryShift",character:"d"}}),e({name:"core/block-editor/remove",category:"block",description:(0,g.__)("Remove the selected block(s)."),keyCombination:{modifier:"access",character:"z"}}),e({name:"core/block-editor/insert-before",category:"block",description:(0,g.__)("Insert a new block before the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"t"}}),e({name:"core/block-editor/insert-after",category:"block",description:(0,g.__)("Insert a new block after the selected block(s)."),keyCombination:{modifier:"primaryAlt",character:"y"}}),e({name:"core/block-editor/delete-multi-selection",category:"block",description:(0,g.__)("Delete selection."),keyCombination:{character:"del"},aliases:[{character:"backspace"}]}),e({name:"core/block-editor/select-all",category:"selection",description:(0,g.__)("Select all text when typing. Press again to select all blocks."),keyCombination:{modifier:"primary",character:"a"}}),e({name:"core/block-editor/unselect",category:"selection",description:(0,g.__)("Clear selection."),keyCombination:{character:"escape"}}),e({name:"core/block-editor/focus-toolbar",category:"global",description:(0,g.__)("Navigate to the nearest toolbar."),keyCombination:{modifier:"alt",character:"F10"}}),e({name:"core/block-editor/move-up",category:"block",description:(0,g.__)("Move the selected block(s) up."),keyCombination:{modifier:"secondary",character:"t"}}),e({name:"core/block-editor/move-down",category:"block",description:(0,g.__)("Move the selected block(s) down."),keyCombination:{modifier:"secondary",character:"y"}})}),[e]),null};var yy=_y;function Ey(){return H()("wp.blockEditor.MultiSelectScrollIntoView",{hint:"This behaviour is now built-in.",since:"5.8"}),null}const Cy=new Set([gc.UP,gc.RIGHT,gc.DOWN,gc.LEFT,gc.ENTER,gc.BACKSPACE]);function Sy(){const e=(0,m.useSelect)((e=>e(Qn).isTyping()),[]),{stopTyping:t}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((n=>{if(!e)return;const{ownerDocument:o}=n;let r,l;function i(e){const{clientX:n,clientY:o}=e;r&&l&&(r!==n||l!==o)&&t(),r=n,l=o}return o.addEventListener("mousemove",i),()=>{o.removeEventListener("mousemove",i)}}),[e,t])}function wy(){const e=(0,m.useSelect)((e=>e(Qn).isTyping())),{startTyping:t,stopTyping:n}=(0,m.useDispatch)(Qn),o=Sy(),r=(0,d.useRefEffect)((o=>{const{ownerDocument:r}=o,{defaultView:l}=r;if(e){let e;function t(t){const{target:o}=t;e=l.setTimeout((()=>{(0,el.isTextField)(o)||n()}))}function i(e){const{keyCode:t}=e;t!==gc.ESCAPE&&t!==gc.TAB||n()}function s(){const e=l.getSelection();e.rangeCount>0&&e.getRangeAt(0).collapsed||n()}return o.addEventListener("focus",t),o.addEventListener("keydown",i),r.addEventListener("selectionchange",s),()=>{l.clearTimeout(e),o.removeEventListener("focus",t),o.removeEventListener("keydown",i),r.removeEventListener("selectionchange",s)}}function i(e){const{type:n,target:r}=e;(0,el.isTextField)(r)&&o.contains(r)&&("keydown"!==n||function(e){const{keyCode:t,shiftKey:n}=e;return!n&&Cy.has(t)}(e))&&t()}return o.addEventListener("keypress",i),o.addEventListener("keydown",i),()=>{o.removeEventListener("keypress",i),o.removeEventListener("keydown",i)}}),[e,t,n]);return(0,d.useMergeRefs)([o,r])}var By=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:wy()},t)};const Iy=-1!==window.navigator.userAgent.indexOf("Trident"),xy=new Set([gc.UP,gc.DOWN,gc.LEFT,gc.RIGHT]);function Ty(){const e=(0,m.useSelect)((e=>e(Qn).hasSelectedBlock()),[]);return(0,d.useRefEffect)((t=>{if(!e)return;const{ownerDocument:n}=t,{defaultView:o}=n;let r,l,i;function s(){r||(r=o.requestAnimationFrame((()=>{p(),r=null})))}function a(e){l&&o.cancelAnimationFrame(l),l=o.requestAnimationFrame((()=>{c(e),l=null}))}function c(e){let{keyCode:r}=e;if(!m())return;const l=(0,el.computeCaretRect)(o);if(!l)return;if(!i)return void(i=l);if(xy.has(r))return void(i=l);const s=l.top-i.top;if(0===s)return;const a=(0,el.getScrollContainer)(t);if(!a)return;const c=a===n.body,u=c?o.scrollY:a.scrollTop,d=c?0:a.getBoundingClientRect().top,p=c?i.top/o.innerHeight:(i.top-d)/(o.innerHeight-d);if(0===u&&p<.75&&function(){const e=t.querySelectorAll('[contenteditable="true"]');return e[e.length-1]===n.activeElement}())return void(i=l);const f=c?o.innerHeight:a.clientHeight;i.top+i.height>d+f||i.top<d?i=l:c?o.scrollBy(0,s):a.scrollTop+=s}function u(){n.addEventListener("selectionchange",d)}function d(){n.removeEventListener("selectionchange",d),p()}function p(){m()&&(i=(0,el.computeCaretRect)(o))}function m(){return t.contains(n.activeElement)&&n.activeElement.isContentEditable}return o.addEventListener("scroll",s,!0),o.addEventListener("resize
1
+ !function(){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:function(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:function(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:function(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 f(){for(var n=-1*u;n<=u;n+=2){var l=void 0,d=p[n-1],m=p[n+1],f=(m?m.newPos:0)-n;d&&(p[n-1]=void 0);var g=d&&d.newPos+1<a,h=m&&0<=f&&f<c;if(g||h){if(!g||h&&d.newPos<m.newPos?(l=r(m),i.pushComponent(l.components,void 0,!0)):((l=d).newPos++,i.pushComponent(l.components,!0,void 0)),f=i.extractCommon(l,t,e,n),l.newPos+1>=a&&f+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();f()||e()}),0)}();else for(;u<=d;){var g=f();if(g)return g}},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:function(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:function(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),f=o.offset(e),g=o.outerHeight(e),h=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:f.left-S.left-c,top:f.top-S.top-a},E={left:f.left+h-(S.left+w)+d,top:f.top+g-(S.top+B)+u},_=S):(v=o.offset(t),b=t.clientHeight,k=t.clientWidth,_={left:t.scrollLeft,top:t.scrollTop},y={left:f.left-(v.left+(parseFloat(o.css(t,"borderLeftWidth"))||0))-c,top:f.top-(v.top+(parseFloat(o.css(t,"borderTopWidth"))||0))-a},E={left:f.left+h-(v.left+k+(parseFloat(o.css(t,"borderRightWidth"))||0))+d,top:f.top+g-(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:function(e,t,n){"use strict";e.exports=n(1345)},5022:function(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 f(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 g(e){return null!=e&&e==e.window}var h={};function v(e,t,n){if(g(e))return"width"===t?h.viewportWidth(e):h.viewportHeight(e);if(9===e.nodeType)return"width"===t?h.docWidth(e):h.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-f(e,["border","padding"],o):i;if(s){var u=2===n?-f(e,["border"],o):f(e,["margin"],o);return a+(1===n?0:u)}return i+f(e,p.slice(n),o)}u(["Width","Height"],(function(e){h["doc"+e]=function(t){var n=t.document;return Math.max(n.documentElement["scroll"+e],n.body["scroll"+e],h["viewport"+e](n))},h["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);h["outer"+t]=function(t,n){return t&&k(t,e,n?0:1)};var n="width"===e?["Left","Right"]:["Top","Bottom"];h[e]=function(t,o){return void 0===o?t&&k(t,e,-1):t?(c(t),d(t)&&(o+=f(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:g,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(g(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(g(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},h)},8575:function(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:function(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="&nbsp;","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:function(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:function(e,t,n){e.exports=n(5372)()},9567:function(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:function(e,t,n){"use strict";var o=n(5438);t.Z=o.TextareaAutosize},3124:function(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={},f=!0,g={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){g.isRoot||(g.parent.node[g.key]=e),g.node=e,t&&(f=!1)},delete:function(e){delete g.parent.node[g.key],e&&(f=!1)},remove:function(e){s(g.parent.node)?g.parent.node.splice(g.key,1):delete g.parent.node[g.key],e&&(f=!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(){f=!1}};if(!u)return g;function h(){if("object"==typeof g.node&&null!==g.node){g.keys&&g.node_===g.node||(g.keys=l(g.node)),g.isLeaf=0==g.keys.length;for(var e=0;e<i.length;e++)if(i[e].node_===d){g.circular=i[e];break}}else g.isLeaf=!0,g.keys=null;g.notLeaf=!g.isLeaf,g.notRoot=!g.isRoot}h();var v=t.call(g,g.node);return void 0!==v&&g.update&&g.update(v),m.before&&m.before.call(g,g.node),f?("object"!=typeof g.node||null===g.node||g.circular||(i.push(g),h(),a(g.keys,(function(t,r){o.push(t),m.pre&&m.pre.call(g,g.node[t],t);var l=e(g.node[t]);n&&c.call(g.node,t)&&(g.node[t]=l.node),l.isLast=r==g.keys.length-1,l.isFirst=0==r,m.post&&m.post.call(g,l),o.pop()})),i.pop()),m.after&&m.after.call(g,g.node),g):g}(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:function(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=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(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=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var o={};!function(){"use strict";n.r(o),n.d(o,{AlignmentControl:function(){return Nv},AlignmentToolbar:function(){return Pv},Autocomplete:function(){return Vv},BlockAlignmentControl:function(){return Kr},BlockAlignmentToolbar:function(){return qr},BlockBreadcrumb:function(){return $v},BlockColorsStyleSelector:function(){return Qv},BlockContextProvider:function(){return al},BlockControls:function(){return io},BlockEdit:function(){return pl},BlockEditorKeyboardShortcuts:function(){return ky},BlockEditorProvider:function(){return zc},BlockFormatControls:function(){return lo},BlockIcon:function(){return Dc},BlockInspector:function(){return gy},BlockList:function(){return Tf},BlockMover:function(){return Yp},BlockNavigationDropdown:function(){return hb},BlockPreview:function(){return dd},BlockSelectionClearer:function(){return Gc},BlockSettingsMenu:function(){return Qm},BlockSettingsMenuControls:function(){return jm},BlockStyles:function(){return _b},BlockTitle:function(){return Ap},BlockToolbar:function(){return rf},BlockTools:function(){return hy},BlockVerticalAlignmentControl:function(){return pr},BlockVerticalAlignmentToolbar:function(){return mr},ButtonBlockAppender:function(){return Sp},ButtonBlockerAppender:function(){return Cp},ColorPalette:function(){return Ob},ColorPaletteControl:function(){return Fb},ContrastChecker:function(){return fg},CopyHandler:function(){return Tm},DefaultBlockAppender:function(){return yp},FontSizePicker:function(){return ih},InnerBlocks:function(){return wf},Inserter:function(){return _p},InspectorAdvancedControls:function(){return Lo},InspectorControls:function(){return Ao},JustifyContentControl:function(){return hr},JustifyToolbar:function(){return vr},LineHeightControl:function(){return Gg},MediaPlaceholder:function(){return d_},MediaReplaceFlow:function(){return i_},MediaUpload:function(){return r_},MediaUploadCheck:function(){return l_},MultiSelectScrollIntoView:function(){return _y},NavigableToolbar:function(){return zp},ObserveTyping:function(){return Sy},PanelColorSettings:function(){return p_},PlainText:function(){return H_},RichText:function(){return F_},RichTextShortcut:function(){return W_},RichTextToolbarButton:function(){return $_},SETTINGS_DEFAULTS:function(){return v},SkipToSelectedBlock:function(){return cy},ToolSelector:function(){return q_},Typewriter:function(){return xy},URLInput:function(){return Ak},URLInputButton:function(){return X_},URLPopover:function(){return c_},Warning:function(){return fl},WritingFlow:function(){return nu},__experimentalBlockAlignmentMatrixControl:function(){return Uv},__experimentalBlockContentOverlay:function(){return jv},__experimentalBlockFullHeightAligmentControl:function(){return Gv},__experimentalBlockPatternSetup:function(){return Mb},__experimentalBlockPatternsList:function(){return Ld},__experimentalBlockVariationPicker:function(){return Eb},__experimentalBlockVariationTransforms:function(){return Ab},__experimentalBorderRadiusControl:function(){return Wf},__experimentalColorGradientControl:function(){return bg},__experimentalColorGradientSettingsDropdown:function(){return Ub},__experimentalDateFormatPicker:function(){return Hb},__experimentalDuotoneControl:function(){return qh},__experimentalFontAppearanceControl:function(){return Hg},__experimentalFontFamilyControl:function(){return Xg},__experimentalGetBorderClassesAndStyles:function(){return uv},__experimentalGetColorClassesAndStyles:function(){return pv},__experimentalGetGradientClass:function(){return cg},__experimentalGetGradientObjectByGradientValue:function(){return dg},__experimentalGetMatchingVariation:function(){return My},__experimentalGetSpacingClassesAndStyles:function(){return gv},__experimentalImageEditingProvider:function(){return vk},__experimentalImageEditor:function(){return Ik},__experimentalImageSizeControl:function(){return Tk},__experimentalImageURLInputUI:function(){return iy},__experimentalLayoutStyle:function(){return Dr},__experimentalLetterSpacingControl:function(){return xh},__experimentalLibrary:function(){return vy},__experimentalLinkControl:function(){return t_},__experimentalLinkControlSearchInput:function(){return Kk},__experimentalLinkControlSearchItem:function(){return Fk},__experimentalLinkControlSearchResults:function(){return Hk},__experimentalListView:function(){return fb},__experimentalPanelColorGradientSettings:function(){return Zb},__experimentalPreviewOptions:function(){return sy},__experimentalResponsiveBlockControl:function(){return U_},__experimentalTextDecorationControl:function(){return hh},__experimentalTextTransformControl:function(){return Sh},__experimentalToolsPanelColorDropdown:function(){return kg},__experimentalUnitControl:function(){return Y_},__experimentalUseBlockPreview:function(){return pd},__experimentalUseBorderProps:function(){return dv},__experimentalUseColorProps:function(){return fv},__experimentalUseCustomSides:function(){return er},__experimentalUseGradient:function(){return mg},__experimentalUseNoRecursiveRenders:function(){return Py},__experimentalUseResizeCanvas:function(){return ay},__unstableBlockNameContext:function(){return of},__unstableBlockSettingsMenuFirstItem:function(){return Am},__unstableBlockToolbarLastItem:function(){return Cm},__unstableEditorStyles:function(){return sd},__unstableIframe:function(){return lu},__unstableInserterMenuExtension:function(){return cp},__unstablePresetDuotoneFilter:function(){return rv},__unstableRichTextInputEvent:function(){return j_},__unstableUseBlockSelectionClearer:function(){return Hc},__unstableUseClipboardHandler:function(){return xm},__unstableUseMouseMoveTypingReset:function(){return Ey},__unstableUseTypewriter:function(){return Iy},__unstableUseTypingObserver:function(){return Cy},createCustomColorsHOC:function(){return _v},getColorClassName:function(){return qf},getColorObjectByAttributeValues:function(){return jf},getColorObjectByColorValue:function(){return Kf},getFontSize:function(){return oh},getFontSizeClass:function(){return lh},getFontSizeObjectByValue:function(){return rh},getGradientSlugByValue:function(){return pg},getGradientValueBySlug:function(){return ug},getPxFromCssUnit:function(){return Gy},store:function(){return Qn},storeConfig:function(){return Yn},transformStyles:function(){return rd},useBlockDisplayInformation:function(){return Rp},useBlockEditContext:function(){return eo},useBlockProps:function(){return wc},useCachedTruthy:function(){return hv},useInnerBlocksProps:function(){return Sf},useSetting:function(){return Co},withColorContext:function(){return Db},withColors:function(){return yv},withFontSizes:function(){return Cv}});var e={};n.r(e),n.d(e,{__experimentalGetActiveBlockIdByBlockNames:function(){return zt},__experimentalGetAllowedBlocks:function(){return kt},__experimentalGetAllowedPatterns:function(){return Ct},__experimentalGetBlockListSettingsForBlocks:function(){return Tt},__experimentalGetDirectInsertBlock:function(){return _t},__experimentalGetGlobalBlocksByName:function(){return te},__experimentalGetLastBlockAttributeChanges:function(){return Mt},__experimentalGetParsedPattern:function(){return yt},__experimentalGetPatternTransformItems:function(){return wt},__experimentalGetPatternsByBlockTypes:function(){return St},__experimentalGetReusableBlockTitle:function(){return Nt},__unstableGetBlockWithoutInnerBlocks:function(){return q},__unstableGetClientIdWithClientIdsTree:function(){return Q},__unstableGetClientIdsTree:function(){return Z},__unstableGetSelectedBlocksWithPartialSelection:function(){return Le},__unstableIsFullySelected:function(){return Pe},__unstableIsLastBlockChangeIgnored:function(){return Pt},__unstableIsSelectionCollapsed:function(){return Me},__unstableIsSelectionMergeable:function(){return Re},areInnerBlocksControlled:function(){return Ft},canEditBlock:function(){return ct},canInsertBlockType:function(){return ot},canInsertBlocks:function(){return rt},canLockBlockType:function(){return ut},canMoveBlock:function(){return st},canMoveBlocks:function(){return at},canRemoveBlock:function(){return lt},canRemoveBlocks:function(){return it},didAutomaticChange:function(){return Dt},getAdjacentBlockClientId:function(){return ve},getBlock:function(){return K},getBlockAttributes:function(){return j},getBlockCount:function(){return oe},getBlockHierarchyRootClientId:function(){return ge},getBlockIndex:function(){return De},getBlockInsertionPoint:function(){return Qe},getBlockListSettings:function(){return Bt},getBlockMode:function(){return Ue},getBlockName:function(){return W},getBlockOrder:function(){return Ae},getBlockParents:function(){return me},getBlockParentsByBlockName:function(){return fe},getBlockRootClientId:function(){return pe},getBlockSelectionEnd:function(){return se},getBlockSelectionStart:function(){return ie},getBlockTransformItems:function(){return vt},getBlocks:function(){return Y},getBlocksByClientId:function(){return ne},getClientIdsOfDescendants:function(){return X},getClientIdsWithDescendants:function(){return J},getDraggedBlockClientIds:function(){return je},getFirstMultiSelectedBlockClientId:function(){return Se},getGlobalBlockCount:function(){return ee},getInserterItems:function(){return ht},getLastMultiSelectedBlockClientId:function(){return we},getLowestCommonAncestorWithSelectedBlock:function(){return he},getMultiSelectedBlockClientIds:function(){return Ee},getMultiSelectedBlocks:function(){return Ce},getMultiSelectedBlocksEndClientId:function(){return Ne},getMultiSelectedBlocksStartClientId:function(){return Te},getNextBlockClientId:function(){return ke},getPreviousBlockClientId:function(){return be},getSelectedBlock:function(){return de},getSelectedBlockClientId:function(){return ue},getSelectedBlockClientIds:function(){return ye},getSelectedBlockCount:function(){return ae},getSelectedBlocksInitialCaretPosition:function(){return _e},getSelectionEnd:function(){return le},getSelectionStart:function(){return re},getSettings:function(){return It},getTemplate:function(){return Je},getTemplateLock:function(){return et},hasBlockMovingClientId:function(){return At},hasInserterItems:function(){return bt},hasMultiSelection:function(){return Ve},hasSelectedBlock:function(){return ce},hasSelectedInnerBlock:function(){return Fe},isAncestorBeingDragged:function(){return qe},isAncestorMultiSelected:function(){return xe},isBlockBeingDragged:function(){return Ke},isBlockHighlighted:function(){return Ot},isBlockInsertionPointVisible:function(){return Ze},isBlockMultiSelected:function(){return Ie},isBlockSelected:function(){return Oe},isBlockValid:function(){return $},isBlockWithinSelection:function(){return ze},isCaretWithinFormattedText:function(){return Ye},isDraggingBlocks:function(){return $e},isFirstMultiSelectedBlock:function(){return Be},isLastBlockChangePersistent:function(){return xt},isMultiSelecting:function(){return He},isNavigationMode:function(){return Lt},isSelectionEnabled:function(){return Ge},isTyping:function(){return We},isValidTemplate:function(){return Xe},wasBlockJustInserted:function(){return Vt}});var t={};n.r(t),n.d(t,{__unstableDeleteSelection:function(){return vn},__unstableExpandSelection:function(){return kn},__unstableMarkAutomaticChange:function(){return zn},__unstableMarkLastChangeAsPersistent:function(){return On},__unstableMarkNextChangeAsNotPersistent:function(){return Fn},__unstableSaveReusableBlock:function(){return Dn},__unstableSplitSelection:function(){return bn},clearSelectedBlock:function(){return en},duplicateBlocks:function(){return Gn},enterFormattedText:function(){return Nn},exitFormattedText:function(){return Pn},flashBlock:function(){return jn},hideInsertionPoint:function(){return fn},insertAfterBlock:function(){return Wn},insertBeforeBlock:function(){return Un},insertBlock:function(){return dn},insertBlocks:function(){return pn},insertDefaultBlock:function(){return Rn},mergeBlocks:function(){return yn},moveBlockToPosition:function(){return un},moveBlocksDown:function(){return sn},moveBlocksToPosition:function(){return cn},moveBlocksUp:function(){return an},multiSelect:function(){return Jt},receiveBlocks:function(){return $t},removeBlock:function(){return Cn},removeBlocks:function(){return En},replaceBlock:function(){return rn},replaceBlocks:function(){return on},replaceInnerBlocks:function(){return Sn},resetBlocks:function(){return Gt},resetSelection:function(){return Wt},selectBlock:function(){return qt},selectNextBlock:function(){return Qt},selectPreviousBlock:function(){return Yt},selectionChange:function(){return Mn},setBlockMovingClientId:function(){return Hn},setHasControlledInnerBlocks:function(){return Kn},setNavigationMode:function(){return Vn},setTemplateValidity:function(){return gn},showInsertionPoint:function(){return mn},startDraggingBlocks:function(){return xn},startMultiSelect:function(){return Zt},startTyping:function(){return Bn},stopDraggingBlocks:function(){return Tn},stopMultiSelect:function(){return Xt},stopTyping:function(){return In},synchronizeTemplate:function(){return hn},toggleBlockHighlight:function(){return $n},toggleBlockMode:function(){return wn},toggleSelection:function(){return tn},updateBlock:function(){return Kt},updateBlockAttributes:function(){return jt},updateBlockListSettings:function(){return Ln},updateSettings:function(){return An},validateBlocksToTemplate:function(){return Ut}});var 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}));var s=window.wp.element,a=n(4403),c=n.n(a),u=window.lodash,d=window.wp.compose,p=window.wp.components,m=window.wp.data,f={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")},g=window.wp.i18n;const h={insertUsage:{}},v={alignWide:!1,supportsLayout:!0,colors:[{name:(0,g.__)("Black"),slug:"black",color:"#000000"},{name:(0,g.__)("Cyan bluish gray"),slug:"cyan-bluish-gray",color:"#abb8c3"},{name:(0,g.__)("White"),slug:"white",color:"#ffffff"},{name:(0,g.__)("Pale pink"),slug:"pale-pink",color:"#f78da7"},{name:(0,g.__)("Vivid red"),slug:"vivid-red",color:"#cf2e2e"},{name:(0,g.__)("Luminous vivid orange"),slug:"luminous-vivid-orange",color:"#ff6900"},{name:(0,g.__)("Luminous vivid amber"),slug:"luminous-vivid-amber",color:"#fcb900"},{name:(0,g.__)("Light green cyan"),slug:"light-green-cyan",color:"#7bdcb5"},{name:(0,g.__)("Vivid green cyan"),slug:"vivid-green-cyan",color:"#00d084"},{name:(0,g.__)("Pale cyan blue"),slug:"pale-cyan-blue",color:"#8ed1fc"},{name:(0,g.__)("Vivid cyan blue"),slug:"vivid-cyan-blue",color:"#0693e3"},{name:(0,g.__)("Vivid purple"),slug:"vivid-purple",color:"#9b51e0"}],fontSizes:[{name:(0,g._x)("Small","font size name"),size:13,slug:"small"},{name:(0,g._x)("Normal","font size name"),size:16,slug:"normal"},{name:(0,g._x)("Medium","font size name"),size:20,slug:"medium"},{name:(0,g._x)("Large","font size name"),size:36,slug:"large"},{name:(0,g._x)("Huge","font size name"),size:42,slug:"huge"}],imageDefaultSize:"large",imageSizes:[{slug:"thumbnail",name:(0,g.__)("Thumbnail")},{slug:"medium",name:(0,g.__)("Medium")},{slug:"large",name:(0,g.__)("Large")},{slug:"full",name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("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,g.__)("Blush light purple"),gradient:"linear-gradient(135deg,rgb(255,206,236) 0%,rgb(152,150,240) 100%)",slug:"blush-light-purple"},{name:(0,g.__)("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,g.__)("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,g.__)("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,g.__)("Electric grass"),gradient:"linear-gradient(135deg,rgb(202,248,128) 0%,rgb(113,206,126) 100%)",slug:"electric-grass"},{name:(0,g.__)("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)}function _(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,_(r,o))})),n}function y(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.reduce(((e,n)=>Object.assign(e,{[n.clientId]:t},y(n.innerBlocks,n.clientId))),{})}function E(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:u.identity;const n={},o=[...e];for(;o.length;){const{innerBlocks:e,...r}=o.shift();o.push(...e),n[r.clientId]=t(r)}return n}function C(e){return E(e,(e=>(0,u.omit)(e,"attributes")))}function S(e){return E(e,(e=>e.attributes))}function w(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)((0,u.keys)(e),(0,u.keys)(t))}(e.attributes,t.attributes)}function B(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 I(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 x=(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=B(o,n.blocks);o.tree=I(o,{...o.tree,...e},n.rootClientId?[n.rootClientId]:[""],!0);break}case"UPDATE_BLOCK":o.tree=I(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=I(o,{...o.tree,...e},n.clientIds,!1);break}case"REPLACE_BLOCKS_AUGMENTED_WITH_CHILDREN":{const e=B(o,n.blocks);o.tree=I(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=I(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=I(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),n.toRootClientId&&e.push(n.toRootClientId),n.fromRootClientId&&n.fromRootClientId||e.push(""),o.tree=I(o,o.tree,e,!0);break}case"MOVE_BLOCKS_UP":case"MOVE_BLOCKS_DOWN":{const e=[n.rootClientId?n.rootClientId:""];o.tree=I(o,o.tree,e,!0);break}case"SAVE_REUSABLE_BLOCK_SUCCESS":{const e=(0,u.keys)((0,u.omitBy)(o.attributes,((e,t)=>"core/block"!==o.byClientId[t].name||e.ref!==n.updatedId)));o.tree=I(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}),(e=>(t,n)=>{if("RESET_BLOCKS"===n.type){const e={...t,byClientId:C(n.blocks),attributes:S(n.blocks),order:_(n.blocks),parents:y(n.blocks),controlledInnerBlocks:{}},o=B(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:!w(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,...C(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),...C(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,...S(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),...S(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=_(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=_(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=_(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,...y(t.blocks)};case"INSERT_BLOCKS":return{...e,...y(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),...y(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}});function T(){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}var N,P,M=(0,m.combineReducers)({blocks:x,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:T(r.selectionStart,l),selectionEnd:T(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]:h,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"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}});function R(e){return[e]}function L(){var e={clear:function(){e.head=null}};return e}function A(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 D(e,t){var n,o;function r(){n=P?new WeakMap:L()}function l(){var n,r,l,i,s,a=arguments.length;for(i=new Array(a),l=0;l<a;l++)i[l]=arguments[l];for(s=t.apply(null,i),(n=o(s)).isUniqueByDependants||(n.lastDependants&&!A(s,n.lastDependants,0)&&n.clear(),n.lastDependants=s),r=n.head;r;){if(A(r.args,i,1))return r!==n.head&&(r.prev.next=r.next,r.next&&(r.next.prev=r.prev),r.next=n.head,r.prev=null,n.head.prev=r,n.head=r),r.val;r=r.next}return r={val:e.apply(null,i)},i[0]=null,r.args=i,n.head&&(n.head.prev=r,r.next=n.head),n.head=r,r.val}return t||(t=R),o=P?function(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(N)||((l=L()).isUniqueByDependants=a,s.set(N,l)),s.get(N)}:function(){return n},l.getDependants=t,l.clear=r,r(),l}N={},P="undefined"!=typeof WeakMap;var O=window.wp.primitives,F=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),z=window.wp.richText,V=window.wp.deprecated,H=n.n(V);function G(e){const{multiline:t,__unstableMultilineWrapperTags:n,__unstablePreserveWhiteSpace:o}=e;return{multilineTag:t,multilineWrapperTags:n,preserveWhiteSpace:o}}const U=[];function W(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 $(e,t){const n=e.blocks.byClientId[t];return!!n&&n.isValid}function j(e,t){return e.blocks.byClientId[t]?e.blocks.attributes[t]:null}function K(e,t){return e.blocks.byClientId[t]?e.blocks.tree[t]:null}const q=D(((e,t)=>{const n=e.blocks.byClientId[t];return n?{...n,attributes:j(e,t)}:null}),((e,t)=>[e.blocks.byClientId[t],e.blocks.attributes[t]]));function Y(e,t){var n;const o=t&&Ft(e,t)?"controlled||"+t:t||"";return(null===(n=e.blocks.tree[o])||void 0===n?void 0:n.innerBlocks)||U}const Q=D(((e,t)=>({clientId:t,innerBlocks:Z(e,t)})),(e=>[e.blocks.order])),Z=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return(0,u.map)(Ae(e,t),(t=>Q(e,t)))}),(e=>[e.blocks.order])),X=D(((e,t)=>{const n=[];for(const o of t)for(const t of Ae(e,o))n.push(t,...X(e,[t]));return n}),(e=>[e.blocks.order])),J=D((e=>{const t=[];for(const n of Ae(e))t.push(n,...X(e,[n]));return t}),(e=>[e.blocks.order])),ee=D(((e,t)=>{const n=J(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])),te=D(((e,t)=>{if(!t)return U;const n=J(e).filter((n=>e.blocks.byClientId[n].name===t));return n.length>0?n:U}),(e=>[e.blocks.order,e.blocks.byClientId])),ne=D(((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>K(e,t)))),((e,t)=>(0,u.map)((0,u.castArray)(t),(t=>e.blocks.tree[t]))));function oe(e,t){return Ae(e,t).length}function re(e){return e.selection.selectionStart}function le(e){return e.selection.selectionEnd}function ie(e){return e.selection.selectionStart.clientId}function se(e){return e.selection.selectionEnd.clientId}function ae(e){return Ee(e).length||(e.selection.selectionStart.clientId?1:0)}function ce(e){const{selectionStart:t,selectionEnd:n}=e.selection;return!!t.clientId&&t.clientId===n.clientId}function ue(e){const{selectionStart:t,selectionEnd:n}=e.selection,{clientId:o}=t;return o&&o===n.clientId?o:null}function de(e){const t=ue(e);return t?K(e,t):null}function pe(e,t){return void 0!==e.blocks.parents[t]?e.blocks.parents[t]:null}const me=D((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])),fe=D((function(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]&&arguments[3];const r=me(e,t,o);return(0,u.map)((0,u.filter)((0,u.map)(r,(t=>({id:t,name:W(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=ue(e),o=[...me(e,t),t],r=[...me(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 ve(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(void 0===t&&(t=ue(e)),void 0===t&&(t=n<0?Se(e):we(e)),!t)return null;const o=pe(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 be(e,t){return ve(e,t,-1)}function ke(e,t){return ve(e,t,1)}function _e(e){return e.initialPosition}const ye=D((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=pe(e,t.clientId);if(null===o)return U;const r=Ae(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 Ee(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?U:ye(e)}const Ce=D((e=>{const t=Ee(e);return t.length?t.map((t=>K(e,t))):U}),(e=>[...ye.getDependants(e),e.blocks.byClientId,e.blocks.order,e.blocks.attributes]));function Se(e){return(0,u.first)(Ee(e))||null}function we(e){return(0,u.last)(Ee(e))||null}function Be(e,t){return Se(e)===t}function Ie(e,t){return-1!==Ee(e).indexOf(t)}const xe=D(((e,t)=>{let n=t,o=!1;for(;n&&!o;)n=pe(e,n),o=Ie(e,n);return o}),(e=>[e.blocks.order,e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId]));function Te(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:t.clientId||null}function Ne(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId===n.clientId?null:n.clientId||null}function Pe(e){const t=re(e),n=le(e);return!t.attributeKey&&!n.attributeKey&&void 0===t.offset&&void 0===n.offset}function Me(e){const t=re(e),n=le(e);return!!t&&!!n&&t.clientId===n.clientId&&t.attributeKey===n.attributeKey&&t.offset===n.offset}function Re(e,t){const n=re(e),o=le(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=pe(e,n.clientId);if(l!==pe(e,o.clientId))return!1;const i=Ae(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=K(e,c);if(!(0,r.getBlockType)(d.name).merge)return!1;const p=K(e,u);if(p.name===d.name)return!0;const m=(0,r.switchToBlockType)(p,d.name);return m&&m.length}const Le=e=>{const t=re(e),n=le(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=pe(e,t.clientId);if(o!==pe(e,n.clientId))return U;const l=Ae(e,o),i=l.indexOf(t.clientId),s=l.indexOf(n.clientId),[a,c]=i>s?[n,t]:[t,n],u=K(e,a.clientId),d=(0,r.getBlockType)(u.name),p=K(e,c.clientId),m=(0,r.getBlockType)(p.name),f=u.attributes[a.attributeKey],g=p.attributes[c.attributeKey],h=d.attributes[a.attributeKey],v=m.attributes[c.attributeKey];let b=(0,z.create)({html:f,...G(h)}),k=(0,z.create)({html:g,...G(v)});return b=(0,z.remove)(b,0,a.offset),k=(0,z.remove)(k,c.offset,k.text.length),[{...u,attributes:{...u.attributes,[a.attributeKey]:(0,z.toHTMLString)({value:b,...G(h)})}},{...p,attributes:{...p.attributes,[c.attributeKey]:(0,z.toHTMLString)({value:k,...G(v)})}}]};function Ae(e,t){return e.blocks.order[t||""]||U}function De(e,t){return Ae(e,pe(e,t)).indexOf(t)}function Oe(e,t){const{selectionStart:n,selectionEnd:o}=e.selection;return n.clientId===o.clientId&&n.clientId===t}function Fe(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(0,u.some)(Ae(e,t),(t=>Oe(e,t)||Ie(e,t)||n&&Fe(e,t,n)))}function ze(e,t){if(!t)return!1;const n=Ee(e),o=n.indexOf(t);return o>-1&&o<n.length-1}function Ve(e){const{selectionStart:t,selectionEnd:n}=e.selection;return t.clientId!==n.clientId}function He(e){return e.isMultiSelecting}function Ge(e){return e.isSelectionEnabled}function Ue(e,t){return e.blocksMode[t]||"visual"}function We(e){return e.isTyping}function $e(e){return!!e.draggedBlocks.length}function je(e){return e.draggedBlocks}function Ke(e,t){return e.draggedBlocks.includes(t)}function qe(e,t){if(!$e(e))return!1;const n=me(e,t);return(0,u.some)(n,(t=>Ke(e,t)))}function Ye(){return H()('wp.data.select( "core/block-editor" ).isCaretWithinFormattedText',{since:"6.1",version:"6.3"}),!1}function Qe(e){let t,n;const{insertionPoint:o,selection:{selectionEnd:r}}=e;if(null!==o)return o;const{clientId:l}=r;return l?(t=pe(e,l)||void 0,n=De(e,r.clientId)+1):n=Ae(e).length,{rootClientId:t,index:n}}function Ze(e){return null!==e.insertionPoint}function Xe(e){return e.template.isValid}function Je(e){return e.settings.template}function et(e,t){if(!t)return e.settings.templateLock;const n=Bt(e,t);return n?n.templateLock:null}const tt=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,u.isBoolean)(e)?e:(0,u.isArray)(e)?!(!e.includes("core/post-content")||null!==t)||e.includes(t):n},nt=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}=It(e),s=tt(i,t,!0);if(!s)return!1;const a=!!et(e,o);if(a)return!1;const c=Bt(e,o);if(o&&void 0===c)return!1;const d=null==c?void 0:c.allowedBlocks,p=tt(d,t),m=n.parent,f=W(e,o),g=tt(m,f);let h=!0;const v=n.ancestor;if(v){const t=[o,...me(e,o)];h=(0,u.some)(t,(t=>tt(v,W(e,t))))}const b=h&&(null===p&&null===g||!0===p||!0===g);return b?(0,l.applyFilters)("blockEditor.__unstableCanInsertBlockType",b,n,o,{getBlock:K.bind(null,e),getBlockParentsByBlockName:fe.bind(null,e)}):b},ot=D(nt,((e,t,n)=>[e.blockListSettings[n],e.blocks.byClientId[n],e.settings.allowedBlockTypes,e.settings.templateLock]));function rt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>ot(e,W(e,t),n)))}function lt(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return!0;const{lock:r}=o,l=!!et(e,n);return void 0===r||void 0===(null==r?void 0:r.remove)?!l:!(null!=r&&r.remove)}function it(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>lt(e,t,n)))}function st(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;const o=j(e,t);if(null===o)return;const{lock:r}=o,l="all"===et(e,n);return void 0===r||void 0===(null==r?void 0:r.move)?!l:!(null!=r&&r.move)}function at(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return t.every((t=>st(e,t,n)))}function ct(e,t){const n=j(e,t);if(null===n)return!0;const{lock:o}=n;return!(null!=o&&o.edit)}function ut(e,t){var n;return!!(0,r.hasBlockSupport)(t,"lock",!0)&&!(null===(n=e.settings)||void 0===n||!n.canLockBlocks)}function dt(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 pt=(e,t,n)=>!!(0,r.hasBlockSupport)(t,"inserter",!0)&&nt(e,t.name,n),mt=(e,t)=>n=>{const o=`${t.id}/${n.name}`,{time:r,count:l=0}=dt(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:ft(r,l)}},ft=(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)(ne(e,J(e)),{name:t.name}));const{time:i,count:s=0}=dt(e,o)||{},a={id:o,name:t.name,title:t.title,icon:t.icon,isDisabled:l,frecency:ft(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=D((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=F;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}=dt(e,l)||{},c=ft(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=>pt(e,n,t))).map(n),a=nt(e,"core/block",t)?Rt(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=mt(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,Rt(e),(0,r.getBlockTypes)()])),vt=D((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=>pt(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,g.__)("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)()])),bt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=(0,u.some)((0,r.getBlockTypes)(),(n=>pt(e,n,t)));if(n)return!0;const o=nt(e,"core/block",t)&&Rt(e).length>0;return o}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,Rt(e),(0,r.getBlockTypes)()])),kt=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(t)return(0,u.filter)((0,r.getBlockTypes)(),(n=>pt(e,n,t)))}),((e,t)=>[e.blockListSettings[t],e.blocks.byClientId,e.settings.allowedBlockTypes,e.settings.templateLock,(0,r.getBlockTypes)()])),_t=D((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(K(e,o))?r:null:r:void 0}),((e,t)=>[e.blockListSettings[t],e.blocks.tree[t]])),yt=D(((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])),Et=D((e=>{const t=e.settings.__experimentalBlockPatterns,{allowedBlockTypes:n}=It(e);return t.filter((e=>{let{inserter:t=!0}=e;return!!t})).map((t=>{let{name:n}=t;return yt(e,n)})).filter((e=>{let{blocks:t}=e;return((e,t)=>{if((0,u.isBoolean)(t))return t;const n=[...e];for(;n.length>0;){var o;const e=n.shift();if(!tt(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])),Ct=D((function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;const n=Et(e),o=(0,u.filter)(n,(n=>{let{blocks:o}=n;return o.every((n=>{let{name:o}=n;return ot(e,o,t)}))}));return o}),((e,t)=>[e.settings.__experimentalBlockPatterns,e.settings.allowedBlockTypes,e.settings.templateLock,e.blockListSettings[t],e.blocks.byClientId[t]])),St=D((function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if(!t)return U;const o=Ct(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)=>[...Ct.getDependants(e,t)])),wt=D((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||Ft(e,n)})))return U;const o=Array.from(new Set(t.map((e=>{let{name:t}=e;return t}))));return St(e,o,n)}),((e,t)=>[...St.getDependants(e,t)]));function Bt(e,t){return e.blockListSettings[t]}function It(e){return e.settings}function xt(e){return e.blocks.isPersistentChange}const Tt=D((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])),Nt=D(((e,t)=>{var n;const o=(0,u.find)(Rt(e),(e=>e.id===t));return o?null===(n=o.title)||void 0===n?void 0:n.raw:null}),(e=>[Rt(e)]));function Pt(e){return e.blocks.isIgnoredChange}function Mt(e){return e.lastBlockAttributesChange}function Rt(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 Lt(e){return e.isNavigationMode}function At(e){return e.hasBlockMovingClientId}function Dt(e){return!!e.automaticChangeStatus}function Ot(e,t){return e.highlightedBlock===t}function Ft(e,t){return!!e.blocks.controlledInnerBlocks[t]}const zt=D(((e,t)=>{if(!t.length)return null;const n=ue(e);if(t.includes(W(e,n)))return n;const o=Ee(e),r=fe(e,n||o[0],t);return r?(0,u.last)(r):null}),((e,t)=>[e.selection.selectionStart.clientId,e.selection.selectionEnd.clientId,t]));function Vt(e,t,n){const{lastBlockInserted:o}=e;return o.clientId===t&&o.source===n}var Ht=window.wp.a11y;const Gt=e=>t=>{let{dispatch:n}=t;n({type:"RESET_BLOCKS",blocks:e}),n(Ut(e))},Ut=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 Wt(e,t,n){return{type:"RESET_SELECTION",selectionStart:e,selectionEnd:t,initialPosition:n}}function $t(e){return H()('wp.data.dispatch( "core/block-editor" ).receiveBlocks',{since:"5.9",alternative:"resetBlocks or insertBlocks"}),{type:"RECEIVE_BLOCKS",blocks:e}}function jt(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return{type:"UPDATE_BLOCK_ATTRIBUTES",clientIds:(0,u.castArray)(e),attributes:t,uniqueByBlock:n}}function Kt(e,t){return{type:"UPDATE_BLOCK",clientId:e,updates:t}}function qt(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return{type:"SELECT_BLOCK",initialPosition:t,clientId:e}}const Yt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getPreviousBlockClientId(e);r&&o.selectBlock(r,-1)},Qt=e=>t=>{let{select:n,dispatch:o}=t;const r=n.getNextBlockClientId(e);r&&o.selectBlock(r)};function Zt(){return{type:"START_MULTI_SELECT"}}function Xt(){return{type:"STOP_MULTI_SELECT"}}const Jt=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,Ht.speak)((0,g.sprintf)(
2
  /* translators: %s: number of selected blocks */
3
+ (0,g._n)("%s block selected.","%s blocks selected.",i),i),"assertive")}};function en(){return{type:"CLEAR_SELECTED_BLOCK"}}function tn(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return{type:"TOGGLE_SELECTION",isSelectionEnabled:e}}function nn(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 on=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=(0,u.castArray)(e),t=nn((0,u.castArray)(t),i.getSettings());const a=i.getBlockRootClientId((0,u.first)(e));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 rn(e,t){return on(e,t)}const ln=e=>(t,n)=>o=>{let{select:r,dispatch:l}=o;r.canMoveBlocks(t,n)&&l({type:e,clientIds:(0,u.castArray)(t),rootClientId:n})},sn=ln("MOVE_BLOCKS_DOWN"),an=ln("MOVE_BLOCKS_UP"),cn=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 un(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 cn([e],t,n,o)}function dn(e,t,n,o,r){return pn([e],t,n,o,0,r)}const pn=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;(0,u.isObject)(r)&&(l=r,r=0,H()("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=nn((0,u.castArray)(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 mn(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 fn(){return{type:"HIDE_INSERTION_POINT"}}function gn(e){return{type:"SET_TEMPLATE_VALIDITY",isValid:e}}const hn=()=>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)},vn=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 d,p;c.indexOf(i.clientId)>c.indexOf(s.clientId)?(d=s,p=i):(d=i,p=s);const m=e?p:d,f=o.getBlock(m.clientId),g=(0,r.getBlockType)(f.name);if(!g.merge)return;const h=d,v=p,b=o.getBlock(h.clientId),k=(0,r.getBlockType)(b.name),_=o.getBlock(v.clientId),y=(0,r.getBlockType)(_.name),E=b.attributes[h.attributeKey],C=_.attributes[v.attributeKey],S=k.attributes[h.attributeKey],w=y.attributes[v.attributeKey];let B=(0,z.create)({html:E,...G(S)}),I=(0,z.create)({html:C,...G(w)});B=(0,z.remove)(B,h.offset,B.text.length),I=(0,z.insert)(I,"†",0,v.offset);const x=(0,r.cloneBlock)(b,{[h.attributeKey]:(0,z.toHTMLString)({value:B,...G(S)})}),T=(0,r.cloneBlock)(_,{[v.attributeKey]:(0,z.toHTMLString)({value:I,...G(w)})}),N=e?x:T,P=b.name===_.name?[N]:(0,r.switchToBlockType)(N,g.name);if(!P||!P.length)return;let M;if(e){const e=P.pop();M=g.merge(e.attributes,T.attributes)}else{const e=P.shift();M=g.merge(x.attributes,e.attributes)}const R=(0,u.findKey)(M,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),L=M[R],A=(0,z.create)({html:L,...G(g.attributes[R])}),D=A.text.indexOf("†"),O=(0,z.remove)(A,D,D+1),F=(0,z.toHTMLString)({value:O,...G(g.attributes[R])});M[R]=F;const V=o.getSelectedBlockClientIds(),H=[...e?P:[],{...f,attributes:{...f.attributes,...M}},...e?[]:P];n.batch((()=>{l.selectionChange(f.clientId,R,D,D),l.replaceBlocks(V,H,0,o.getSelectedBlocksInitialCaretPosition())}))},bn=()=>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),f=t.getBlock(d.clientId),g=(0,r.getBlockType)(f.name),h=p.attributes[u.attributeKey],v=f.attributes[d.attributeKey],b=m.attributes[u.attributeKey],k=g.attributes[d.attributeKey];let _=(0,z.create)({html:h,...G(b)}),y=(0,z.create)({html:v,...G(k)});_=(0,z.remove)(_,u.offset,_.text.length),y=(0,z.remove)(y,0,d.offset),n.replaceBlocks(t.getSelectedBlockClientIds(),[{...p,attributes:{...p.attributes,[u.attributeKey]:(0,z.toHTMLString)({value:_,...G(b)})}},(0,r.createBlock)((0,r.getDefaultBlockName)()),{...f,attributes:{...f.attributes,[d.attributeKey]:(0,z.toHTMLString)({value:y,...G(k)})}}],1,t.getSelectedBlocksInitialCaretPosition())},kn=()=>e=>{let{select:t,dispatch:n}=e;const o=t.getSelectionStart(),r=t.getSelectionEnd();n.selectionChange({start:{clientId:o.clientId},end:{clientId:r.clientId}})},yn=(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),d=(0,r.getBlockType)(c.name);if(d&&!d.merge)return void l.selectBlock(c.clientId);const p=o.getBlock(a),m=(0,r.getBlockType)(p.name),{clientId:f,attributeKey:g,offset:h}=o.getSelectionStart(),v=(f===s?d:m).attributes[g],b=(f===s||f===a)&&void 0!==g&&void 0!==h&&!!v;v||("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 k=(0,r.cloneBlock)(c),_=(0,r.cloneBlock)(p);if(b){const e=f===s?k:_,t=e.attributes[g],n=(0,z.insert)((0,z.create)({html:t,...G(v)}),"†",h,h);e.attributes[g]=(0,z.toHTMLString)({value:n,...G(v)})}const y=c.name===p.name?[_]:(0,r.switchToBlockType)(_,c.name);if(!y||!y.length)return;const E=d.merge(k.attributes,y[0].attributes);if(b){const e=(0,u.findKey)(E,(e=>"string"==typeof e&&-1!==e.indexOf("†"))),t=E[e],n=(0,z.create)({html:t,...G(d.attributes[e])}),o=n.text.indexOf("†"),r=(0,z.remove)(n,o,o+1),i=(0,z.toHTMLString)({value:r,...G(d.attributes[e])});E[e]=i,l.selectionChange(c.clientId,e,o,o)}l.replaceBlocks([c.clientId,p.clientId],[{...c,attributes:{...c.attributes,...E}},...y.slice(1)],0)},En=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=(0,u.castArray)(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 Cn(e,t){return En([e],t)}function Sn(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 wn(e){return{type:"TOGGLE_BLOCK_MODE",clientId:e}}function Bn(){return{type:"START_TYPING"}}function In(){return{type:"STOP_TYPING"}}function xn(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return{type:"START_DRAGGING_BLOCKS",clientIds:e}}function Tn(){return{type:"STOP_DRAGGING_BLOCKS"}}function Nn(){return H()('wp.data.dispatch( "core/block-editor" ).enterFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Pn(){return H()('wp.data.dispatch( "core/block-editor" ).exitFormattedText',{since:"6.1",version:"6.3"}),{type:"DO_NOTHING"}}function Mn(e,t,n,o){return"string"==typeof e?{type:"SELECTION_CHANGE",clientId:e,attributeKey:t,startOffset:n,endOffset:o}:{type:"SELECTION_CHANGE",...e}}const Rn=(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 Ln(e,t){return{type:"UPDATE_BLOCK_LIST_SETTINGS",clientId:e,settings:t}}function An(e){return{type:"UPDATE_SETTINGS",settings:e}}function Dn(e,t){return{type:"SAVE_REUSABLE_BLOCK_SUCCESS",id:e,updatedId:t}}function On(){return{type:"MARK_LAST_CHANGE_AS_PERSISTENT"}}function Fn(){return{type:"MARK_NEXT_CHANGE_AS_NOT_PERSISTENT"}}const zn=()=>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"})}))},Vn=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,Ht.speak)((0,g.__)("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,Ht.speak)((0,g.__)("You are currently in edit mode. To return to the navigation mode, press Escape."))}},Hn=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,Ht.speak)((0,g.__)("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."))}},Gn=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((0,u.some)(i,(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=o.getBlockIndex((0,u.last)((0,u.castArray)(e))),c=i.map((e=>(0,r.__experimentalCloneSanitizedBlock)(e)));return l.insertBlocks(c,a+1,s,t),c.length>1&&t&&l.multiSelect((0,u.first)(c).clientId,(0,u.last)(c).clientId),c.map((e=>e.clientId))}},Un=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)},Wn=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 $n(e,t){return{type:"TOGGLE_BLOCK_HIGHLIGHT",clientId:e,isHighlighted:t}}const jn=e=>async t=>{let{dispatch:n}=t;n($n(e,!0)),await new Promise((e=>setTimeout(e,150))),n($n(e,!1))};function Kn(e,t){return{type:"SET_HAS_CONTROLLED_INNER_BLOCKS",hasControlledInnerBlocks:t,clientId:e}}const qn="core/block-editor",Yn={reducer:M,selectors:e,actions:t},Qn=(0,m.createReduxStore)(qn,{...Yn,persist:["preferences"]});(0,m.registerStore)(qn,{...Yn,persist:["preferences"]});const Zn={name:"",isSelected:!1},Xn=(0,s.createContext)(Zn),{Provider:Jn}=Xn;function eo(){return(0,s.useContext)(Xn)}function to(){const{isSelected:e,clientId:t,name:n}=eo();return(0,m.useSelect)((o=>{if(e)return!0;const{getBlockName:r,isFirstMultiSelectedBlock:l,getMultiSelectedBlockClientIds:i}=o(Qn);return!!l(t)&&i().every((e=>r(e)===n))}),[t,e,n])}function no(e){let{group:t="default",controls:n,children:o,__experimentalShareWithChildBlocks:l=!1}=e;const i=function(e,t){const n=to(),{clientId:o}=eo(),l=(0,m.useSelect)((e=>{const{getBlockName:n,hasSelectedInnerBlock:l}=e(Qn),{hasBlockSupport:i}=e(r.store);return t&&i(n(o),"__experimentalExposeControlsToChildren",!1)&&l(o)}),[t,o]);var i;return n?null===(i=f[e])||void 0===i?void 0:i.Fill:l?f.parent.Fill:null}(t,l);return i?(0,s.createElement)(p.__experimentalStyleProvider,{document: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 oo(e){let{group:t="default",...n}=e;const o=(0,s.useContext)(p.__experimentalToolbarContext),r=f[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 ro=no;ro.Slot=oo;const lo=e=>(0,s.createElement)(no,i({group:"inline"},e));lo.Slot=e=>(0,s.createElement)(oo,i({group:"inline"},e));var io=ro,so=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 9v6h11V9H9zM4 20h1.5V4H4v16z"})),ao=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 9h-7.2V4h-1.6v5H4v6h7.2v5h1.6v-5H20z"})),co=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 15h11V9H4v6zM18.5 4v16H20V4h-1.5z"})),uo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M9 15h6V9H9v6zm-5 5h1.5V4H4v16zM18.5 4v16H20V4h-1.5z"})),po=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),mo=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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 fo(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return e.split(",").map((e=>`.editor-styles-wrapper ${e} ${t}`)).join(",")}const go=(0,s.createContext)({refs:new Map,callbacks:new Map});function ho(e){let{children:t}=e;const n=(0,s.useMemo)((()=>({refs:new Map,callbacks:new Map})),[]);return(0,s.createElement)(go.Provider,{value:n},t)}function vo(e){const{refs:t,callbacks:n}=(0,s.useContext)(go),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 bo(e){const{refs:t}=(0,s.useContext)(go),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 ko(e){const{callbacks:t}=(0,s.useContext)(go),n=bo(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 _o=["color","border","typography","spacing"],yo={"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},Eo={"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 Co(e){const{name:t,clientId:n}=eo();return(0,m.useSelect)((o=>{if(_o.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=>Eo[e]||e)(e);[...o(Qn).getBlockParents(n),n].forEach((e=>{const n=o(Qn).getBlockName(e);if((0,r.hasBlockSupport)(n,"__experimentalSettings",!1)){var s;const n=o(Qn).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(Qn).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=yo[i]?yo[i](s):void 0;return void 0!==p?p:"typography.dropCap"===i||void 0}),[t,n,e])}window.wp.warning;var So={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 wo(e){var t;let{__experimentalGroup:n="default",children:o}=e;const r=to(),l=null===(t=So[n])||void 0===t?void 0:t.Fill;return l?r?(0,s.createElement)(p.__experimentalStyleProvider,{document: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 Bo=e=>{if(!(0,u.isObject)(e)||Array.isArray(e))return e;const t=(0,u.pickBy)((0,u.mapValues)(e,Bo),u.identity);return(0,u.isEmpty)(t)?void 0:t};function Io(e,t,n){return(0,u.setWith)(e?(0,u.clone)(e):{},t,n,u.clone)}function xo(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:Io(c.attributes,e,t)})}))})),c}function To(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 No(e){let{children:t,group:n,label:o}=e;const{updateBlockAttributes:r}=(0,m.useDispatch)(Qn),{getBlockAttributes:l,getMultiSelectedBlockClientIds:i,getSelectedBlockClientId:a,hasMultiSelection:c}=(0,m.useSelect)(Qn),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:Bo(r.style)},t[n]=r})),r(n,t,!0)}),[Bo,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 Po(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 Mo(e){var t;let{__experimentalGroup:n="default",label:o,...r}=e;const l=null===(t=So[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)(No,{group:n,label:o},(0,s.createElement)(Po,i({},r,{Slot:l}))):(0,s.createElement)(l,i({},r,{bubblesVirtually:!0})):null:("undefined"!=typeof process&&process.env,null)}const Ro=wo;Ro.Slot=Mo;const Lo=e=>(0,s.createElement)(wo,i({},e,{__experimentalGroup:"advanced"}));Lo.Slot=e=>(0,s.createElement)(Mo,i({},e,{__experimentalGroup:"advanced"})),Lo.slotName="InspectorAdvancedControls";var Ao=Ro,Do=window.wp.isShallowEqual,Oo=n.n(Do),Fo=window.wp.dom,zo=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 Vo(e){let{clientId:t,bottomClientId:n,children:o,__unstableRefreshSize:r,__unstableCoverTarget:l=!1,__unstablePopoverSlot:a,__unstableContentRef:u,...d}=e;const m=ko(t),f=ko(null!=n?n:t),g=zo(u),h=(0,s.useMemo)((()=>m&&f===m?{position:"absolute",width:m.offsetWidth,height:m.offsetHeight}:{}),[m,f,r]);if(!m||n&&!f)return null;const v={top:m,bottom:f},{ownerDocument:b}=m,k=b.defaultView.frameElement||(0,Fo.getScrollContainer)(m)||b.body;return(0,s.createElement)(p.Popover,i({ref:g,noArrow:!0,animate:!1,position:"top right left",focusOnMount:!1,anchorRef:v,__unstableStickyBoundaryElement:l?void 0:k,__unstableSlotName:a||null,__unstableBoundaryParent:!0,__unstableObserveElement:m,__unstableEditorCanvasWrapper:null==u?void 0:u.current,__unstableForcePosition:l},d,{className:c()("block-editor-block-popover",d.className)}),l&&(0,s.createElement)("div",{style:h},o),!l&&o)}function Ho(e){const t=(0,r.getBlockSupport)(e,Yo);return!!(!0===t||null!=t&&t.margin)}function Go(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Co("spacing.margin"),n=!tr(e,"margin");return!Ho(e)||t||n}function Uo(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["%","px","em","rem","vw"]}),i=er(n,"margin"),a=i&&i.some((e=>Zo.includes(e)));return Go(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:Bo(t)})},label:(0,g.__)("Margin"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function Wo(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)((()=>(Oo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(Vo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}function $o(e){const t=(0,r.getBlockSupport)(e,Yo);return!!(!0===t||null!=t&&t.padding)}function jo(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Co("spacing.padding"),n=!tr(e,"padding");return!$o(e)||t||n}function Ko(e){var t;const{name:n,attributes:{style:o},setAttributes:r}=e,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["%","px","em","rem","vw"]}),i=er(n,"padding"),a=i&&i.some((e=>Zo.includes(e)));return jo(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:Bo(t)})},label:(0,g.__)("Padding"),sides:i,units:l,allowReset:!1,splitOnAxis:a})),native:null})}function qo(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)((()=>(Oo()(l,u.current)||(c(!0),u.current=l,p(),d.current=setTimeout((()=>{c(!1)}),400)),()=>p())),[l]),a?(0,s.createElement)(Vo,{clientId:o,__unstableCoverTarget:!0,__unstableRefreshSize:l},(0,s.createElement)("div",{className:"block-editor__padding-visualizer",style:i})):null}const Yo="spacing",Qo=["top","right","bottom","left"],Zo=["vertical","horizontal"];function Xo(e){const t=rr(e),n=jo(e),o=Go(e),l=Jo(e),i=(a=e.name,"web"===s.Platform.OS&&(nr(a)||$o(a)||Ho(a)));var a;if(l||!i)return null;const c=(0,r.getBlockSupport)(e.name,[Yo,"__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)(Ao,{__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,g.__)("Padding"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...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)(Ko,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,g.__)("Margin"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...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)(Uo,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,g.__)("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)(lr,e))),!n&&(0,s.createElement)(qo,e),!o&&(0,s.createElement)(Wo,e))}const Jo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=rr(e),n=jo(e),o=Go(e);return t&&n&&o};function er(e,t){const n=(0,r.getBlockSupport)(e,Yo);if(n&&"boolean"!=typeof n[t])return n[t]}function tr(e,t){const n=er(e,t);return!(n&&n.some((e=>Qo.includes(e)))&&n.some((e=>Zo.includes(e)))&&(console.warn(`The ${t} support for the "${e}" block can not be configured to support both axial and arbitrary sides.`),1))}function nr(e){const t=(0,r.getBlockSupport)(e,Yo);return!!(!0===t||null!=t&&t.blockGap)}function or(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 rr(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Co("spacing.blockGap");return!nr(e)||t}function lr(e){var t;const{clientId:n,attributes:{style:o},name:r,setAttributes:l}=e,i=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["%","px","em","rem","vw"]}),a=er(r,"blockGap"),c=bo(n);if(rr(e))return null;const u=a&&a.some((e=>Zo.includes(e))),d=e=>{var t;let n=e;e&&u&&(n={...or(e)});const r={...o,spacing:{...null==o?void 0:o.spacing,blockGap:n}};l({style:Bo(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=or(null==o||null===(t=o.spacing)||void 0===t?void 0:t.blockGap),f=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,g.__)("Block spacing"),min:0,onChange:d,units:i,sides:a,values:f,allowReset:!1,splitOnAxis:u}):(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Block spacing"),__unstableInputWidth:"80px",min:0,onChange:d,units:i,value:f})),native:null})}const ir=(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"})),sr=(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"})),ar={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,g._x)("Align top","Block vertical alignment setting")},center:{icon:sr,title:(0,g._x)("Align middle","Block vertical alignment setting")},bottom:{icon:ir,title:(0,g._x)("Align bottom","Block vertical alignment setting")}},cr=["top","center","bottom"],ur={isAlternate:!0};var dr=function(e){let{value:t,onChange:n,controls:o=cr,isCollapsed:r=!0,isToolbar:l}=e;const a=ar[t],c=ar.top,u=l?p.ToolbarGroup:p.ToolbarDropdownMenu,d=l?{isCollapsed:r}:{};return(0,s.createElement)(u,i({popoverProps:ur,icon:a?a.icon:c.icon,label:(0,g._x)("Change vertical alignment","Block vertical alignment setting label"),controls:o.map((e=>{return{...ar[e],isActive:t===e,role:r?"menuitemradio":void 0,onClick:(o=e,()=>n(t===o?void 0:o))};var o}))},d))};const pr=e=>(0,s.createElement)(dr,i({},e,{isToolbar:!1})),mr=e=>(0,s.createElement)(dr,i({},e,{isToolbar:!0})),fr={left:so,center:ao,right:co,"space-between":uo};var 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?fr[r]:fr.left,d=[{name:"left",icon:so,title:(0,g.__)("Justify items left"),isActive:"left"===r,onClick:()=>c("left")},{name:"center",icon:ao,title:(0,g.__)("Justify items center"),isActive:"center"===r,onClick:()=>c("center")},{name:"right",icon:co,title:(0,g.__)("Justify items right"),isActive:"right"===r,onClick:()=>c("right")},{name:"space-between",icon:uo,title:(0,g.__)("Space between items"),isActive:"space-between"===r,onClick:()=>c("space-between")}],m=a?p.ToolbarGroup:p.ToolbarDropdownMenu,f=a?{isCollapsed:n}:{};return(0,s.createElement)(m,i({icon:u,popoverProps:l,label:(0,g.__)("Change items justification"),controls:d.filter((e=>t.includes(e.name)))},f))};const hr=e=>(0,s.createElement)(gr,i({},e,{isToolbar:!1})),vr=e=>(0,s.createElement)(gr,i({},e,{isToolbar:!0})),br={left:"flex-start",right:"flex-end",center:"center","space-between":"space-between"},kr={left:"flex-start",right:"flex-end",center:"center"},_r={top:"flex-start",center:"center",bottom:"flex-end"},yr=["wrap","nowrap"];var Er={name:"flex",label:(0,g.__)("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)(Sr,{layout:t,onChange:n})),(0,s.createElement)(p.FlexItem,null,r&&(0,s.createElement)(Br,{layout:t,onChange:n}))),(0,s.createElement)(wr,{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)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Sr,{layout:t,onChange:n,isToolbar:!0}),r&&"vertical"!==(null==t?void 0:t.orientation)&&(0,s.createElement)(Cr,{layout:t,onChange:n,isToolbar:!0}))},save:function(e){var t,n;let{selector:o,layout:r,style:l,blockName:i}=e;const{orientation:a="horizontal"}=r,c=null!==Co("spacing.blockGap"),u=null!=l&&null!==(t=l.spacing)&&void 0!==t&&t.blockGap&&!To(i,"spacing","blockGap")?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"0";const n=or(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}`}(null==l||null===(n=l.spacing)||void 0===n?void 0:n.blockGap,"0.5em"):"var( --wp--style--block-gap, 0.5em )",d=br[r.justifyContent]||br.left,p=yr.includes(r.flexWrap)?r.flexWrap:"wrap",m=`\n\t\tflex-direction: row;\n\t\talign-items: ${_r[r.verticalAlignment]||_r.center};\n\t\tjustify-content: ${d};\n\t\t`,f=`\n\t\tflex-direction: column;\n\t\talign-items: ${kr[r.justifyContent]||kr.left};\n\t\t`;return(0,s.createElement)("style",null,`\n\t\t\t\t${fo(o)} {\n\t\t\t\t\tdisplay: flex;\n\t\t\t\t\tflex-wrap: ${p};\n\t\t\t\t\tgap: ${c?u:"0.5em"};\n\t\t\t\t\t${"horizontal"===a?m:f}\n\t\t\t\t}\n\n\t\t\t\t${fo(o,"> *")} {\n\t\t\t\t\tmargin: 0;\n\t\t\t\t}\n\t\t\t`)},getOrientation(e){const{orientation:t="horizontal"}=e;return t},getAlignments:()=>[]};function Cr(e){let{layout:t,onChange:n,isToolbar:o=!1}=e;const{verticalAlignment:r=_r.center}=t,l=e=>{n({...t,verticalAlignment:e})};if(o)return(0,s.createElement)(pr,{onChange:l,value:r});const i=[{value:"flex-start",label:(0,g.__)("Align items top")},{value:"center",label:(0,g.__)("Align items center")},{value:"flex-end",label:(0,g.__)("Align items bottom")}];return(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-vertical-alignment-control"},(0,s.createElement)("legend",null,(0,g.__)("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 Sr(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)(hr,{allowedControls:a,value:r,onChange:i,popoverProps:{position:"bottom right",isAlternate:!0}});const c=[{value:"left",icon:so,label:(0,g.__)("Justify items left")},{value:"center",icon:ao,label:(0,g.__)("Justify items center")},{value:"right",icon:co,label:(0,g.__)("Justify items right")}];return"horizontal"===l&&c.push({value:"space-between",icon:uo,label:(0,g.__)("Space between items")}),(0,s.createElement)("fieldset",{className:"block-editor-hooks__flex-layout-justification-controls"},(0,s.createElement)("legend",null,(0,g.__)("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 wr(e){let{layout:t,onChange:n}=e;const{flexWrap:o="wrap"}=t;return(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Allow to wrap to multiple lines"),onChange:e=>{n({...t,flexWrap:e?"wrap":"nowrap"})},checked:"wrap"===o})}function Br(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,g.__)("Orientation")),(0,s.createElement)(p.Button,{label:"horizontal",icon:po,isPressed:"horizontal"===o,onClick:()=>n({...t,orientation:"horizontal"})}),(0,s.createElement)(p.Button,{label:"vertical",icon:mo,isPressed:"vertical"===o,onClick:()=>n({...t,orientation:"vertical"})}))}var Ir=function(e){let{icon:t,size:n=24,...o}=e;return(0,s.cloneElement)(t,{width:n,height:n,...o})},xr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 9v6h10V9H7zM5 19.8h14v-1.5H5v1.5zM5 4.3v1.5h14V4.3H5z"})),Tr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 9v6h14V9H5zm11-4.8H8v1.5h8V4.2zM8 19.8h8v-1.5H8v1.5z"}));const Nr=[{name:"default",label:(0,g.__)("Flow"),inspectorControls:function(e){let{layout:t,onChange:n}=e;const{wideSize:o,contentSize:r}=t,l=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("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,g.__)("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)(Ir,{icon:xr})),(0,s.createElement)("div",{className:"block-editor-hooks__layout-controls-unit"},(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("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)(Ir,{icon:Tr}))),(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,g.__)("Reset"))),(0,s.createElement)("p",{className:"block-editor-hooks__layout-controls-helptext"},(0,g.__)("Customize the width for all elements that are assigned to the center or wide columns.")))},toolBarControls:function(){return null},save:function(e){var t;let{selector:n,layout:o={},style:r,blockName:l}=e;const{contentSize:i,wideSize:a}=o,c=null!==Co("spacing.blockGap"),u=or(null==r||null===(t=r.spacing)||void 0===t?void 0:t.blockGap),d=null!=u&&u.top&&!To(l,"spacing","blockGap")?null==u?void 0:u.top:"var( --wp--style--block-gap )";let p=i||a?`\n\t\t\t\t\t${fo(n,"> :where(:not(.alignleft):not(.alignright))")} {\n\t\t\t\t\t\tmax-width: ${null!=i?i:a};\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${fo(n,"> .alignwide")} {\n\t\t\t\t\t\tmax-width: ${null!=a?a:i};\n\t\t\t\t\t}\n\t\t\t\t\t${fo(n,"> .alignfull")} {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`:"";return p+=`\n\t\t\t${fo(n,"> .alignleft")} {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-inline-start: 0;\n\t\t\t\tmargin-inline-end: 2em;\n\t\t\t}\n\t\t\t${fo(n,"> .alignright")} {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-inline-start: 2em;\n\t\t\t\tmargin-inline-end: 0;\n\t\t\t}\n\n\t\t\t${fo(n,"> .aligncenter")} {\n\t\t\t\tmargin-left: auto !important;\n\t\t\t\tmargin-right: auto !important;\n\t\t\t}\n\t\t`,c&&(p+=`\n\t\t\t\t${fo(n,"> *")} {\n\t\t\t\t\tmargin-block-start: 0;\n\t\t\t\t\tmargin-block-end: 0;\n\t\t\t\t}\n\t\t\t\t${fo(n,"> * + *")} {\n\t\t\t\t\tmargin-block-start: ${d};\n\t\t\t\t}\n\t\t\t`),(0,s.createElement)("style",null,p)},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,g.sprintf)((0,g.__)("Max %s wide"),t)),r.test(n)&&(
6
  // translators: %s: container size (i.e. 600px etc)
7
+ o.wide=(0,g.sprintf)((0,g.__)("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}},Er];function Pr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"default";return Nr.find((t=>t.name===e))}const Mr={type:"default"},Rr=(0,s.createContext)(Mr),Lr=Rr.Provider;function Ar(){return(0,s.useContext)(Rr)}function Dr(e){let{layout:t={},...n}=e;const o=Pr(t.type);return o?(0,s.createElement)(o.save,i({layout:t},n)):null}const Or=["none","left","center","right","wide","full"],Fr=["wide","full"];function zr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Or;e.includes("none")||(e=["none",...e]);const{wideControlsEnabled:t=!1,themeSupportsLayout:n}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn),n=t();return{wideControlsEnabled:n.alignWide,themeSupportsLayout:n.supportsLayout}}),[]),o=Ar(),r=Pr(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=Or}=o,s=e.filter((e=>(o.alignments||t||!Fr.includes(e))&&i.includes(e))).map((e=>({name:e})));return 1===s.length&&"none"===s[0].name?[]:s}var Vr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 15h14V9H5v6zm0 4.8h14v-1.5H5v1.5zM5 4.2v1.5h14V4.2H5z"})),Hr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 9v6h14V9H4zm8-4.8H4v1.5h8V4.2zM4 19.8h8v-1.5H4v1.5z"})),Gr=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M6 15h14V9H6v6zm6-10.8v1.5h8V4.2h-8zm0 15.6h8v-1.5h-8v1.5z"})),Ur=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M5 4v11h14V4H5zm3 15.8h8v-1.5H8v1.5z"}));const Wr={none:{icon:Vr,title:(0,g._x)("None","Alignment option")},left:{icon:Hr,title:(0,g.__)("Align left")},center:{icon:xr,title:(0,g.__)("Align center")},right:{icon:Gr,title:(0,g.__)("Align right")},wide:{icon:Tr,title:(0,g.__)("Wide width")},full:{icon:Ur,title:(0,g.__)("Full width")}},$r={isAlternate:!0};var jr=function(e){let{value:t,onChange:n,controls:o,isToolbar:r,isCollapsed:l=!0}=e;const a=zr(o);if(!a.length)return null;function u(e){n([t,"none"].includes(e)?void 0:e)}const d=Wr[t],m=Wr.none,f=r?p.ToolbarGroup:p.ToolbarDropdownMenu,h={popoverProps:$r,icon:d?d.icon:m.icon,label:(0,g.__)("Align"),toggleProps:{describedBy:(0,g.__)("Change alignment")}},v=r?{isCollapsed:l,controls:a.map((e=>{let{name:n}=e;return{...Wr[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}=Wr[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)(f,i({},h,v))};const Kr=e=>(0,s.createElement)(jr,i({},e,{isToolbar:!1})),qr=e=>(0,s.createElement)(jr,i({},e,{isToolbar:!0})),Yr=["left","center","right","wide","full"],Qr=["wide","full"];function Zr(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)?Yr.filter((t=>e.includes(t))):!0===e?[...Yr]:[],!o||!0===e&&!n?(0,u.without)(t,...Qr):t}const Xr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t,o=zr(Zr((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)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(Kr,{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"),Jr=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,{align:l}=o,a=zr(Zr((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:[...Yr,""]}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/align/with-data-align",Jr),(0,l.addFilter)("editor.BlockEdit","core/editor/align/with-toolbar-controls",Xr),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/align/addAssignedAlign",(function(e,t,n){const{align:o}=n;return Zr((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,tl={type:"string",source:"attribute",attribute:"id",selector:"*"},nl=(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,g.__)("HTML anchor"),help:(0,s.createElement)(s.Fragment,null,(0,g.__)("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,g.__)("https://wordpress.org/support/article/page-jumps/")},(0,g.__)("Learn more about anchors"))),value:t.attributes.anchor||"",placeholder:n?null:(0,g.__)("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)(Ao,{__experimentalGroup:"advanced"},o),!n&&"core/heading"===t.name&&(0,s.createElement)(Ao,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("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:tl}),e})),(0,l.addFilter)("editor.BlockEdit","core/editor/anchor/with-inspector-control",nl),(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 ol=(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)(Ao,{__experimentalGroup:"advanced"},(0,s.createElement)(p.TextControl,{autoComplete:"off",label:(0,g.__)("Additional CSS class(es)"),value:t.attributes.className||"",onChange:e=>{t.setAttributes({className:""!==e?e:void 0})},help:(0,g.__)("Separate multiple classes with spaces.")}))):(0,s.createElement)(e,t)),"withInspectorControl");function rl(e,t,n,o){const r=(0,u.get)(e,n);if(!r)return[];const l=[];if("string"==typeof r)l.push({selector:t.selector,key:o,value:r});else{const e=["top","right","bottom","left"].reduce(((e,n)=>{const l=(0,u.get)(r,[n]);return l&&e.push({selector:t.selector,key:`${o}${(0,u.upperFirst)(n)}`,value:l}),e}),[]);l.push(...e)}return l}(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",ol),(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 ll=[{name:"margin",generate:(e,t)=>rl(e,t,["spacing","margin"],"margin")},{name:"padding",generate:(e,t)=>rl(e,t,["spacing","padding"],"padding")}];function il(e,t){const n=[];return ll.forEach((o=>{n.push(...o.generate(e,t))})),n}const sl=(0,s.createContext)({});function al(e){let{value:t,children:n}=e;const o=(0,s.useContext)(sl),r=(0,s.useMemo)((()=>({...o,...t})),[o,t]);return(0,s.createElement)(sl.Provider,{value:r,children:n})}var cl=sl;const ul={};var dl=(0,p.withFilters)("editor.BlockEdit")((e=>{const{attributes:t={},name:n}=e,o=(0,r.getBlockType)(n),l=(0,s.useContext)(cl),a=(0,s.useMemo)((()=>o&&o.usesContext?(0,u.pick)(l,o.usesContext):ul),[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 pl(e){const{name:t,isSelected:n,clientId:o}=e,r={name:t,isSelected:n,clientId:o};return(0,s.createElement)(Jn,{value:(0,s.useMemo)((()=>r),Object.values(r))},(0,s.createElement)(dl,e))}var ml=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11 13h2v-2h-2v2zm-6 0h2v-2H5v2zm12-2v2h2v-2h-2z"})),fl=function(e){let{className:t,actions:n,children:o,secondaryActions:r}=e;return(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,g.__)("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)))))))))},gl=n(1973);function hl(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,Fo.safeHTML)(o)))),(0,s.createElement)("div",{className:"block-editor-block-compare__action"},(0,s.createElement)(p.Button,{variant:"secondary",tabIndex:"0",onClick:r},l)))}var vl=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,f=a,(0,gl.Kx)(m,f).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,f;return(0,s.createElement)("div",{className:"block-editor-block-compare__wrapper"},(0,s.createElement)(hl,{title:(0,g.__)("Current"),className:"block-editor-block-compare__current",action:n,actionText:(0,g.__)("Convert to HTML"),rawContent:t.originalContent,renderedContent:t.originalContent}),(0,s.createElement)(hl,{title:(0,g.__)("After Conversion"),className:"block-editor-block-compare__converted",action:o,actionText:i,rawContent:p,renderedContent:a}))};const bl=e=>(0,r.rawHandler)({HTML:e.originalContent});var kl=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;return{block:e(Qn).getBlock(n)}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;const{replaceBlock:o}=e(Qn);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,bl(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)),[]),f=(0,s.useMemo)((()=>[{
8
  // translators: Button to fix block content
9
+ title:(0,g._x)("Resolve","imperative verb"),onClick:d},a&&{title:(0,g.__)("Convert to HTML"),onClick:t},{title:(0,g.__)("Convert to Classic Block"),onClick:o}].filter(Boolean)),[d,t,o]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(fl,{actions:[(0,s.createElement)(p.Button,{key:"recover",onClick:l,variant:"primary"},(0,g.__)("Attempt Block Recovery"))],secondaryActions:f},(0,g.__)("This block contains unexpected or invalid content.")),c&&(0,s.createElement)(p.Modal,{title:// translators: Dialog title to fix block content
10
+ (0,g.__)("Resolve Block"),onRequestClose:m,className:"block-editor-block-compare"},(0,s.createElement)(vl,{block:i,onKeep:t,onConvert:n,convertor:bl,convertButtonText:(0,g.__)("Convert to Blocks")})))}));const _l=(0,s.createElement)(fl,{className:"block-editor-block-list__block-crash-warning"},(0,g.__)("This block has encountered an error and cannot be previewed."));var yl=()=>_l;class El 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}}var Cl=El,Sl=n(773),wl=function(e){let{clientId:t}=e;const[n,o]=(0,s.useState)(""),l=(0,m.useSelect)((e=>e(Qn).getBlock(t)),[t]),{updateBlock:i}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o((0,r.getBlockContent)(l))}),[l]),(0,s.createElement)(Sl.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 Bl=Hl();const Il=e=>Ol(e,Bl);let xl=Hl();Il.write=e=>Ol(e,xl);let Tl=Hl();Il.onStart=e=>Ol(e,Tl);let Nl=Hl();Il.onFrame=e=>Ol(e,Nl);let Pl=Hl();Il.onFinish=e=>Ol(e,Pl);let Ml=[];Il.setTimeout=(e,t)=>{let n=Il.now()+t,o=()=>{let e=Ml.findIndex((e=>e.cancel==o));~e&&Ml.splice(e,1),Ul.count-=~e?1:0},r={time:n,handler:e,cancel:o};return Ml.splice(Rl(n),0,r),Ul.count+=1,Fl(),r};let Rl=e=>~(~Ml.findIndex((t=>t.time>e))||~Ml.length);Il.cancel=e=>{Bl.delete(e),xl.delete(e)},Il.sync=e=>{Dl=!0,Il.batchedUpdates(e),Dl=!1},Il.throttle=e=>{let t;function n(){try{e(...t)}finally{t=null}}function o(...e){t=e,Il.onStart(n)}return o.handler=e,o.cancel=()=>{Tl.delete(n),t=null},o};let Ll="undefined"!=typeof window?window.requestAnimationFrame:()=>{};Il.use=e=>Ll=e,Il.now="undefined"!=typeof performance?()=>performance.now():Date.now,Il.batchedUpdates=e=>e(),Il.catch=console.error,Il.frameLoop="always",Il.advance=()=>{"demand"!==Il.frameLoop?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):Vl()};let Al=-1,Dl=!1;function Ol(e,t){Dl?(t.delete(e),e(0)):(t.add(e),Fl())}function Fl(){Al<0&&(Al=0,"demand"!==Il.frameLoop&&Ll(zl))}function zl(){~Al&&(Ll(zl),Il.batchedUpdates(Vl))}function Vl(){let e=Al;Al=Il.now();let t=Rl(Al);t&&(Gl(Ml.splice(0,t),(e=>e.handler())),Ul.count-=t),Tl.flush(),Bl.flush(e?Math.min(64,Al-e):16.667),Nl.flush(),xl.flush(),Pl.flush()}function Hl(){let e=new Set,t=e;return{add(n){Ul.count+=t!=e||e.has(n)?0:1,e.add(n)},delete:n=>(Ul.count-=t==e&&e.has(n)?1:0,e.delete(n)),flush(n){t.size&&(e=new Set,Ul.count-=t.size,Gl(t,(t=>t(n)&&e.add(t))),Ul.count+=e.size,t=e)}}}function Gl(e,t){e.forEach((e=>{try{t(e)}catch(e){Il.catch(e)}}))}const Ul={count:0,clear(){Al=-1,Ml=[],Tl=Hl(),Bl=Hl(),Nl=Hl(),xl=Hl(),Pl=Hl(),Ul.count=0}};var Wl=n(9196),$l=n.n(Wl);function jl(){}const Kl={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 ql(e,t){if(Kl.arr(e)){if(!Kl.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 Yl=(e,t)=>e.forEach(t);function Ql(e,t,n){for(const o in e)e.hasOwnProperty(o)&&t.call(n,e[o],o)}const Zl=e=>Kl.und(e)?[]:Kl.arr(e)?e:[e];function Xl(e,t){if(e.size){const n=Array.from(e);e.clear(),Yl(n,t)}}const Jl=(e,...t)=>Xl(e,(e=>e(...t)));let ei,ti,ni=null,oi=!1,ri=jl;var li=Object.freeze({__proto__:null,get createStringInterpolator(){return ei},get to(){return ti},get colors(){return ni},get skipAnimation(){return oi},get willAdvance(){return ri},assign:e=>{e.to&&(ti=e.to),e.now&&(Il.now=e.now),void 0!==e.colors&&(ni=e.colors),null!=e.skipAnimation&&(oi=e.skipAnimation),e.createStringInterpolator&&(ei=e.createStringInterpolator),e.requestAnimationFrame&&Il.use(e.requestAnimationFrame),e.batchedUpdates&&(Il.batchedUpdates=e.batchedUpdates),e.willAdvance&&(ri=e.willAdvance),e.frameLoop&&(Il.frameLoop=e.frameLoop)}});const ii=new Set;let si=[],ai=[],ci=0;const ui={get idle(){return!ii.size&&!si.length},start(e){ci>e.priority?(ii.add(e),Il.onStart(di)):(pi(e),Il(fi))},advance:fi,sort(e){if(ci)Il.onFrame((()=>ui.sort(e)));else{const t=si.indexOf(e);~t&&(si.splice(t,1),mi(e))}},clear(){si=[],ii.clear()}};function di(){ii.forEach(pi),ii.clear(),Il(fi)}function pi(e){si.includes(e)||mi(e)}function mi(e){si.splice(function(t,n){const o=t.findIndex((t=>t.priority>e.priority));return o<0?t.length:o}(si),0,e)}function fi(e){const t=ai;for(let n=0;n<si.length;n++){const o=si[n];ci=o.priority,o.idle||(ri(o),o.advance(e),o.idle||t.push(o))}return ci=0,ai=si,ai.length=0,si=t,si.length>0}const gi="[-+]?\\d*\\.?\\d+",hi=gi+"%";function vi(...e){return"\\(\\s*("+e.join(")\\s*,\\s*(")+")\\s*\\)"}const bi=new RegExp("rgb"+vi(gi,gi,gi)),ki=new RegExp("rgba"+vi(gi,gi,gi,gi)),_i=new RegExp("hsl"+vi(gi,hi,hi)),yi=new RegExp("hsla"+vi(gi,hi,hi,gi)),Ei=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Ci=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,Si=/^#([0-9a-fA-F]{6})$/,wi=/^#([0-9a-fA-F]{8})$/;function Bi(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 Ii(e,t,n){const o=n<.5?n*(1+t):n+t-n*t,r=2*n-o,l=Bi(r,o,e+1/3),i=Bi(r,o,e),s=Bi(r,o,e-1/3);return Math.round(255*l)<<24|Math.round(255*i)<<16|Math.round(255*s)<<8}function xi(e){const t=parseInt(e,10);return t<0?0:t>255?255:t}function Ti(e){return(parseFloat(e)%360+360)%360/360}function Ni(e){const t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function Pi(e){const t=parseFloat(e);return t<0?0:t>100?1:t/100}function Mi(e){let t=function(e){let t;return"number"==typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=Si.exec(e))?parseInt(t[1]+"ff",16)>>>0:ni&&void 0!==ni[e]?ni[e]:(t=bi.exec(e))?(xi(t[1])<<24|xi(t[2])<<16|xi(t[3])<<8|255)>>>0:(t=ki.exec(e))?(xi(t[1])<<24|xi(t[2])<<16|xi(t[3])<<8|Ni(t[4]))>>>0:(t=Ei.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=wi.exec(e))?parseInt(t[1],16)>>>0:(t=Ci.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=_i.exec(e))?(255|Ii(Ti(t[1]),Pi(t[2]),Pi(t[3])))>>>0:(t=yi.exec(e))?(Ii(Ti(t[1]),Pi(t[2]),Pi(t[3]))|Ni(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 Ri=(e,t,n)=>{if(Kl.fun(e))return e;if(Kl.arr(e))return Ri({range:e,output:t,extrapolate:n});if(Kl.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 Li(){return(Li=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 Ai=Symbol.for("FluidValue.get"),Di=Symbol.for("FluidValue.observers"),Oi=e=>Boolean(e&&e[Ai]),Fi=e=>e&&e[Ai]?e[Ai]():e,zi=e=>e[Di]||null;function Vi(e,t){let n=e[Di];n&&n.forEach((e=>{!function(e,t){e.eventObserved?e.eventObserved(t):e(t)}(e,t)}))}class Hi{constructor(e){if(this[Ai]=void 0,this[Di]=void 0,!e&&!(e=this.get))throw Error("Unknown getter");Gi(this,e)}}const Gi=(e,t)=>$i(e,Ai,t);function Ui(e,t){if(e[Ai]){let n=e[Di];n||$i(e,Di,n=new Set),n.has(t)||(n.add(t),e.observerAdded&&e.observerAdded(n.size,t))}return t}function Wi(e,t){let n=e[Di];if(n&&n.has(t)){const o=n.size-1;o?n.delete(t):e[Di]=null,e.observerRemoved&&e.observerRemoved(o,t)}}const $i=(e,t,n)=>Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0}),ji=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,Ki=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi;let qi;const Yi=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,Qi=(e,t,n,o,r)=>`rgba(${Math.round(t)}, ${Math.round(n)}, ${Math.round(o)}, ${r})`,Zi=e=>{qi||(qi=ni?new RegExp(`(${Object.keys(ni).join("|")})(?!\\w)`,"g"):/^\b$/);const t=e.output.map((e=>Fi(e).replace(Ki,Mi).replace(qi,Mi))),n=t.map((e=>e.match(ji).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=>Ri(Li({},e,{output:t}))));return e=>{let n=0;return t[0].replace(ji,(()=>String(o[n++](e)))).replace(Yi,Qi)}},Xi="react-spring: ",Ji=e=>{const t=e;let n=!1;if("function"!=typeof t)throw new TypeError(`${Xi}once requires a function parameter`);return(...e)=>{n||(t(...e),n=!0)}},es=Ji(console.warn),ts=Ji(console.warn);function ns(e){return Kl.str(e)&&("#"==e[0]||/\d/.test(e)||e in(ni||{}))}const os=e=>(0,Wl.useEffect)(e,rs),rs=[];function ls(){const e=(0,Wl.useState)()[1],t=(0,Wl.useState)(is)[0];return os(t.unmount),()=>{t.current&&e({})}}function is(){const e={current:!0,unmount:()=>()=>{e.current=!1}};return e}function ss(e){const t=(0,Wl.useRef)();return(0,Wl.useEffect)((()=>{t.current=e})),t.current}const as="undefined"!=typeof window&&window.document&&window.document.createElement?Wl.useLayoutEffect:Wl.useEffect,cs=Symbol.for("Animated:node"),us=e=>e&&e[cs],ds=(e,t)=>{return n=e,o=cs,r=t,Object.defineProperty(n,o,{value:r,writable:!0,configurable:!0});var n,o,r},ps=e=>e&&e[cs]&&e[cs].getPayload();class ms{constructor(){this.payload=void 0,ds(this,this)}getPayload(){return this.payload||[]}}class fs extends ms{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,Kl.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new fs(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return Kl.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,Kl.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}}class gs extends fs{constructor(e){super(0),this._string=null,this._toString=void 0,this._toString=Ri({output:[e,e]})}static create(e){return new gs(e)}getValue(){let e=this._string;return null==e?this._string=this._toString(this._value):e}setValue(e){if(Kl.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=Ri({output:[this.getValue(),e]})),this._value=0,super.reset()}}const hs={dependencies:null};class vs extends ms{constructor(e){super(),this.source=e,this.setValue(e)}getValue(e){const t={};return Ql(this.source,((n,o)=>{var r;(r=n)&&r[cs]===r?t[o]=n.getValue(e):Oi(n)?t[o]=Fi(n):e||(t[o]=n)})),t}setValue(e){this.source=e,this.payload=this._makePayload(e)}reset(){this.payload&&Yl(this.payload,(e=>e.reset()))}_makePayload(e){if(e){const t=new Set;return Ql(e,this._addToPayload,t),Array.from(t)}}_addToPayload(e){hs.dependencies&&Oi(e)&&hs.dependencies.add(e);const t=ps(e);t&&Yl(t,(e=>this.add(e)))}}class bs extends vs{constructor(e){super(e)}static create(e){return new bs(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(ks)),!0)}}function ks(e){return(ns(e)?gs:fs).create(e)}function _s(e){const t=us(e);return t?t.constructor:Kl.arr(e)?bs:ns(e)?gs:fs}function ys(){return(ys=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 Es=(e,t)=>{const n=!Kl.fun(e)||e.prototype&&e.prototype.isReactComponent;return(0,Wl.forwardRef)(((o,r)=>{const l=(0,Wl.useRef)(null),i=n&&(0,Wl.useCallback)((e=>{l.current=function(e,t){return e&&(Kl.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=ys({},e,{style:t.createAnimatedStyle(e.style)})),e=new vs(e),hs.dependencies=null,[e,n]}(o,t),c=ls(),u=()=>{const e=l.current;n&&!e||!1===(!!e&&t.applyAnimatedValues(e,s.getValue(!0)))&&c()},d=new Cs(u,a),p=(0,Wl.useRef)();as((()=>{const e=p.current;p.current=d,Yl(a,(e=>Ui(e,d))),e&&(Yl(e.deps,(t=>Wi(t,e))),Il.cancel(e.update))})),(0,Wl.useEffect)(u,[]),os((()=>()=>{const e=p.current;Yl(e.deps,(t=>Wi(t,e)))}));const m=t.getComponentProps(s.getValue());return Wl.createElement(e,ys({},m,{ref:i}))}))};class Cs{constructor(e,t){this.update=e,this.deps=t}eventObserved(e){"change"==e.type&&Il.write(this.update)}}const Ss=Symbol.for("AnimatedComponent"),ws=e=>Kl.str(e)?e:e&&Kl.str(e.displayName)?e.displayName:Kl.fun(e)&&e.name||null;function Bs(){return(Bs=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 Is(e,...t){return Kl.fun(e)?e(...t):e}const xs=(e,t)=>!0===e||!!(t&&e&&(Kl.fun(e)?e(t):Zl(e).includes(t))),Ts=(e,t)=>Kl.obj(e)?t&&e[t]:e,Ns=(e,t)=>!0===e.default?e[t]:e.default?e.default[t]:void 0,Ps=e=>e,Ms=(e,t=Ps)=>{let n=Rs;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);Kl.und(n)||(o[r]=n)}return o},Rs=["config","onProps","onStart","onChange","onPause","onResume","onRest"],Ls={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 As(e){const t=function(e){const t={};let n=0;if(Ql(e,((e,o)=>{Ls[o]||(t[o]=e,n++)})),n)return t}(e);if(t){const n={to:t};return Ql(e,((e,o)=>o in t||(n[o]=e))),n}return Bs({},e)}function Ds(e){return e=Fi(e),Kl.arr(e)?e.map(Ds):ns(e)?li.createStringInterpolator({range:[0,1],output:[e,e]})(1):e}function Os(e){for(const t in e)return!0;return!1}function Fs(e){return Kl.fun(e)||Kl.arr(e)&&Kl.obj(e[0])}function zs(e,t){var n;null==(n=e.ref)||n.delete(e),null==t||t.delete(e)}function Vs(e,t){var n;t&&e.ref!==t&&(null==(n=e.ref)||n.delete(e),t.add(e),e.ref=t)}const Hs=Bs({},{tension:170,friction:26},{mass:1,damping:1,easing:e=>e,clamp:!1});class Gs{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,Hs)}}function Us(e,t){if(Kl.und(t.decay)){const n=!Kl.und(t.tension)||!Kl.und(t.friction);!n&&Kl.und(t.frequency)&&Kl.und(t.damping)&&Kl.und(t.mass)||(e.duration=void 0,e.decay=void 0),n&&(e.frequency=void 0)}else e.duration=void 0}const Ws=[];class $s{constructor(){this.changed=!1,this.values=Ws,this.toValues=null,this.fromValues=Ws,this.to=void 0,this.from=void 0,this.config=new Gs,this.immediate=!1}}function js(e,{key:t,props:n,defaultProps:o,state:r,actions:l}){return new Promise(((i,s)=>{var a;let c,u,d=xs(null!=(a=n.cancel)?a:null==o?void 0:o.cancel,t);if(d)f();else{Kl.und(n.pause)||(r.paused=xs(n.pause,t));let e=null==o?void 0:o.pause;!0!==e&&(e=r.paused||xs(e,t)),c=Is(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-Il.now()}function m(){c>0?(u=Il.setTimeout(f,c),r.pauseQueue.add(p),r.timeouts.add(u)):f()}function f(){r.pauseQueue.delete(p),r.timeouts.delete(u),e<=(r.cancelId||0)&&(d=!0);try{l.start(Bs({},n,{callId:e,cancel:d}),i)}catch(e){s(e)}}}))}const Ks=(e,t)=>1==t.length?t[0]:t.some((e=>e.cancelled))?Qs(e.get()):t.every((e=>e.noop))?qs(e.get()):Ys(e.get(),t.every((e=>e.finished))),qs=e=>({value:e,noop:!0,finished:!0,cancelled:!1}),Ys=(e,t,n=!1)=>({value:e,finished:t,cancelled:n}),Qs=e=>({value:e,cancelled:!0,finished:!1});function Zs(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=Ms(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)&&Qs(o)||r!==n.asyncId&&Ys(o,!1);if(t)throw e.result=t,d(e),e},f=(e,t)=>{const l=new Js,i=new ea;return(async()=>{if(li.skipAnimation)throw Xs(n),i.result=Ys(o,!1),d(i),i;m(l);const s=Kl.obj(e)?Bs({},e):Bs({},t,{to:e});s.parentId=r,Ql(c,((e,t)=>{Kl.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 g;if(li.skipAnimation)return Xs(n),Ys(o,!1);try{let t;t=Kl.arr(e)?(async e=>{for(const t of e)await f(t)})(e):Promise.resolve(e(f,o.stop.bind(o))),await Promise.all([t.then(u),p]),g=Ys(o.get(),!0,!1)}catch(e){if(e instanceof Js)g=e.result;else{if(!(e instanceof ea))throw e;g=e.result}}finally{r==n.asyncId&&(n.asyncId=l,n.asyncTo=l?s:void 0,n.promise=l?a:void 0)}return Kl.fun(i)&&Il.batchedUpdates((()=>{i(g,o,o.item)})),g})():a}function Xs(e,t){Xl(e.timeouts,(e=>e.cancel())),e.pauseQueue.clear(),e.resumeQueue.clear(),e.asyncId=e.asyncTo=e.promise=void 0,t&&(e.cancelId=t)}class Js 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 ea extends Error{constructor(){super("SkipAnimationSignal"),this.result=void 0}}const ta=e=>e instanceof oa;let na=1;class oa extends Hi{constructor(...e){super(...e),this.id=na++,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=us(this);return e&&e.getValue()}to(...e){return li.to(this,e)}interpolate(...e){return es(`${Xi}The "interpolate" function is deprecated in v9 (use "to" instead)`),li.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){Vi(this,{type:"change",parent:this,value:e,idle:t})}_onPriorityChange(e){this.idle||ui.sort(this),Vi(this,{type:"priority",parent:this,priority:e})}}const ra=Symbol.for("SpringPhase"),la=e=>(1&e[ra])>0,ia=e=>(2&e[ra])>0,sa=e=>(4&e[ra])>0,aa=(e,t)=>t?e[ra]|=3:e[ra]&=-3,ca=(e,t)=>t?e[ra]|=4:e[ra]&=-5;class ua extends oa{constructor(e,t){if(super(),this.key=void 0,this.animation=new $s,this.queue=void 0,this.defaultProps={},this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!Kl.und(e)||!Kl.und(t)){const n=Kl.obj(e)?Bs({},e):Bs({},t,{from:e});Kl.und(n.default)&&(n.default=!0),this.start(n)}}get idle(){return!(ia(this)||this._state.asyncTo)||sa(this)}get goal(){return Fi(this.animation.to)}get velocity(){const e=us(this);return e instanceof fs?e.lastVelocity||0:e.getPayload().map((e=>e.lastVelocity||0))}get hasAnimated(){return la(this)}get isAnimating(){return ia(this)}get isPaused(){return sa(this)}advance(e){let t=!0,n=!1;const o=this.animation;let{config:r,toValues:l}=o;const i=ps(o.to);!i&&Oi(o.to)&&(l=Zl(Fi(o.to))),o.values.forEach(((s,a)=>{if(s.done)return;const c=s.constructor==gs?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=Kl.arr(r.velocity)?r.velocity[a]:r.velocity;let i;if(Kl.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=!Kl.und(a),m=n==c?s.v0>0:n<c;let f,g=!1;const h=1,v=Math.ceil(e/h);for(let e=0;e<v&&(f=Math.abs(i)>o,f||(u=Math.abs(c-d)<=t,!u));++e)p&&(g=d==c||d>c==m,g&&(i=-i*a,d=c)),i+=(1e-6*-r.tension*(d-c)+.001*-r.friction*i)/r.mass*h,d+=i*h}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=us(this),a=s.getValue();if(t){const e=Fi(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 Il.batchedUpdates((()=>{this._stop(),this._focus(e),this._set(e)})),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(ia(this)){const{to:e,config:t}=this.animation;Il.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 Kl.und(e)?(n=this.queue||[],this.queue=[]):n=[Kl.obj(e)?e:Bs({},t,{to:e})],Promise.all(n.map((e=>this._update(e)))).then((e=>Ks(this,e)))}stop(e){const{to:t}=this.animation;return this._focus(this.get()),Xs(this._state,e&&this._lastCallId),Il.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=Kl.obj(n)?n[t]:n,(null==n||Fs(n))&&(n=void 0),o=Kl.obj(o)?o[t]:o,null==o&&(o=void 0);const r={to:n,from:o};return la(this)||(e.reverse&&([n,o]=[o,n]),o=Fi(o),Kl.und(o)?us(this)||this._set(n):this._set(o)),r}_update(e,t){let n=Bs({},e);const{key:o,defaultProps:r}=this;n.default&&Object.assign(r,Ms(n,((e,t)=>/^on/.test(t)?Ts(e,o):e))),va(this,n,"onProps"),ba(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 js(++this._lastCallId,{key:o,props:n,defaultProps:r,state:i,actions:{pause:()=>{sa(this)||(ca(this,!0),Jl(i.pauseQueue),ba(this,"onPause",Ys(this,da(this,this.animation.to)),this))},resume:()=>{sa(this)&&(ca(this,!1),ia(this)&&this._resume(),Jl(i.resumeQueue),ba(this,"onResume",Ys(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=pa(n);if(e)return this._update(e,!0)}return e}))}_merge(e,t,n){if(t.cancel)return this.stop(!0),n(Qs(this));const o=!Kl.und(e.to),r=!Kl.und(e.from);if(o||r){if(!(t.callId>this._lastToId))return n(Qs(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&&!Kl.und(u)||(u=d),t.reverse&&([u,d]=[d,u]);const p=!ql(d,c);p&&(s.from=d),d=Fi(d);const m=!ql(u,a);m&&this._focus(u);const f=Fs(t.to),{config:g}=s,{decay:h,velocity:v}=g;(o||r)&&(g.velocity=0),t.config&&!f&&function(e,t,n){n&&(Us(n=Bs({},n),t),t=Bs({},n,t)),Us(e,t),Object.assign(e,t);for(const t in Hs)null==e[t]&&(e[t]=Hs[t]);let{mass:o,frequency:r,damping:l}=e;Kl.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)}(g,Is(t.config,l),t.config!==i.config?Is(i.config,l):void 0);let b=us(this);if(!b||Kl.und(u))return n(Ys(this,!0));const k=Kl.und(t.reset)?r&&!t.default:!Kl.und(d)&&xs(t.reset,l),_=k?d:this.get(),y=Ds(u),E=Kl.num(y)||Kl.arr(y)||ns(y),C=!f&&(!E||xs(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=Oi(u),B=!1;if(!w){const e=k||!la(this)&&p;(m||e)&&(B=ql(Ds(_),y),w=!B),(ql(s.immediate,C)||C)&&ql(g.decay,h)&&ql(g.velocity,v)||(w=!0)}if(B&&ia(this)&&(s.changed&&!k?w=!0:w||this._stop(a)),!f&&((w||Oi(a))&&(s.values=b.getPayload(),s.toValues=Oi(u)?null:S==gs?[1]:Zl(y)),s.immediate!=C&&(s.immediate=C,C||k||this._set(a)),w)){const{onRest:e}=s;Yl(ha,(e=>va(this,t,e)));const o=Ys(this,da(this,a));Jl(this._pendingCalls,o),this._pendingCalls.add(n),s.changed&&Il.batchedUpdates((()=>{s.changed=!k,null==e||e(o,this),k?Is(i.onRest,o):null==s.onStart||s.onStart(o,this)}))}k&&this._set(_),f?n(Zs(t.to,t,this._state,this)):w?this._start():ia(this)&&!m?this._pendingCalls.add(n):n(qs(_))}_focus(e){const t=this.animation;e!==t.to&&(zi(this)&&this._detach(),t.to=e,zi(this)&&this._attach())}_attach(){let e=0;const{to:t}=this.animation;Oi(t)&&(Ui(t,this),ta(t)&&(e=t.priority+1)),this.priority=e}_detach(){const{to:e}=this.animation;Oi(e)&&Wi(e,this)}_set(e,t=!0){const n=Fi(e);if(!Kl.und(n)){const e=us(this);if(!e||!ql(n,e.getValue())){const o=_s(n);e&&e.constructor==o?e.setValue(n):ds(this,o.create(n)),e&&Il.batchedUpdates((()=>{this._onChange(n,t)}))}}return us(this)}_onStart(){const e=this.animation;e.changed||(e.changed=!0,ba(this,"onStart",Ys(this,da(this,e.to)),this))}_onChange(e,t){t||(this._onStart(),Is(this.animation.onChange,e,this)),Is(this.defaultProps.onChange,e,this),super._onChange(e,t)}_start(){const e=this.animation;us(this).reset(Fi(e.to)),e.immediate||(e.fromValues=e.values.map((e=>e.lastPosition))),ia(this)||(aa(this,!0),sa(this)||this._resume())}_resume(){li.skipAnimation?this.finish():ui.start(this)}_stop(e,t){if(ia(this)){aa(this,!1);const n=this.animation;Yl(n.values,(e=>{e.done=!0})),n.toValues&&(n.onChange=n.onPause=n.onResume=void 0),Vi(this,{type:"idle",parent:this});const o=t?Qs(this.get()):Ys(this.get(),da(this,null!=e?e:n.to));Jl(this._pendingCalls,o),n.changed&&(n.changed=!1,ba(this,"onRest",o,this))}}}function da(e,t){const n=Ds(t);return ql(Ds(e.get()),n)}function pa(e,t=e.loop,n=e.to){let o=Is(t);if(o){const r=!0!==o&&As(o),l=(r||e).reverse,i=!r||r.reset;return ma(Bs({},e,{loop:t,default:!1,pause:void 0,to:!l||Fs(n)?n:void 0,from:i?e.from:void 0,reset:i},r))}}function ma(e){const{to:t,from:n}=e=As(e),o=new Set;return Kl.obj(t)&&ga(t,o),Kl.obj(n)&&ga(n,o),e.keys=o.size?Array.from(o):null,e}function fa(e){const t=ma(e);return Kl.und(t.default)&&(t.default=Ms(t)),t}function ga(e,t){Ql(e,((e,n)=>null!=e&&t.add(n)))}const ha=["onStart","onRest","onChange","onPause","onResume"];function va(e,t,n){e.animation[n]=t[n]!==Ns(t,n)?Ts(t[n],e.key):void 0}function ba(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 ka=["onStart","onChange","onRest"];let _a=1;class ya{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(Bs({default:!0},e))}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every((e=>e.idle))}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];Kl.und(n)||this.springs[t].set(n)}}update(e){return e&&this.queue.push(ma(e)),this}start(e){let{queue:t}=this;return e?t=Zl(e).map(ma):this.queue=[],this._flush?this._flush(this,t):(xa(this,t),Ea(this,t))}stop(e,t){if(e!==!!e&&(t=e),t){const n=this.springs;Yl(Zl(t),(t=>n[t].stop(!!e)))}else Xs(this._state,this._lastAsyncId),this.each((t=>t.stop(!!e)));return this}pause(e){if(Kl.und(e))this.start({pause:!0});else{const t=this.springs;Yl(Zl(e),(e=>t[e].pause()))}return this}resume(e){if(Kl.und(e))this.start({pause:!1});else{const t=this.springs;Yl(Zl(e),(e=>t[e].resume()))}return this}each(e){Ql(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,Xl(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&&Xl(t,(([e,t])=>{t.value=i,e(t,this,this._item)})),l&&(this._started=!1,Xl(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)}Il.onFrame(this._onFrame)}}function Ea(e,t){return Promise.all(t.map((t=>Ca(e,t)))).then((t=>Ks(e,t)))}async function Ca(e,t,n){const{keys:o,to:r,from:l,loop:i,onRest:s,onResolve:a}=t,c=Kl.obj(t.default)&&t.default;i&&(t.loop=!1),!1===r&&(t.to=null),!1===l&&(t.from=null);const u=Kl.arr(r)||Kl.fun(r)?r:void 0;u?(t.to=void 0,t.onRest=void 0,c&&(c.onRest=void 0)):Yl(ka,(n=>{const o=t[n];if(Kl.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,Jl(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===Ns(t,"cancel");(u||m&&d.asyncId)&&p.push(js(++e._lastAsyncId,{props:t,state:d,actions:{pause:jl,resume:jl,start(t,n){m?(Xs(d,e._lastAsyncId),n(Qs(e))):(t.onRest=s,n(Zs(u,t,d,e)))}}})),d.paused&&await new Promise((e=>{d.resumeQueue.add(e)}));const f=Ks(e,await Promise.all(p));if(i&&f.finished&&(!n||!f.noop)){const n=pa(t,i,r);if(n)return xa(e,[n]),Ca(e,n,!0)}return a&&Il.batchedUpdates((()=>a(f,e,e.item))),f}function Sa(e,t){const n=Bs({},e.springs);return t&&Yl(Zl(t),(e=>{Kl.und(e.keys)&&(e=ma(e)),Kl.obj(e.to)||(e=Bs({},e,{to:void 0})),Ia(n,e,(e=>Ba(e)))})),wa(e,n),n}function wa(e,t){Ql(t,((t,n)=>{e.springs[n]||(e.springs[n]=t,Ui(t,e))}))}function Ba(e,t){const n=new ua;return n.key=e,t&&Ui(n,t),n}function Ia(e,t,n){t.keys&&Yl(t.keys,(o=>{(e[o]||(e[o]=n(o)))._prepareNode(t)}))}function xa(e,t){Yl(t,(t=>{Ia(e.springs,t,(t=>Ba(t,e)))}))}const Ta=["children"],Na=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,Ta);const o=(0,Wl.useContext)(Pa),r=n.pause||!!o.pause,l=n.immediate||!!o.immediate;n=function(e,t){const[n]=(0,Wl.useState)((()=>({inputs:t,result:e()}))),o=(0,Wl.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,Wl.useEffect)((()=>{o.current=l,r==n&&(n.inputs=n.result=void 0)}),[l]),l.result}((()=>({pause:r,immediate:l})),[r,l]);const{Provider:i}=Pa;return Wl.createElement(i,{value:n},t)},Pa=(Ma=Na,Ra={},Object.assign(Ma,Wl.createContext(Ra)),Ma.Provider._context=Ma,Ma.Consumer._context=Ma,Ma);var Ma,Ra;Na.Provider=Pa.Provider,Na.Consumer=Pa.Consumer;const La=()=>{const e=[],t=function(t){ts(`${Xi}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 Yl(e,((e,r)=>{if(Kl.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 Yl(e,(e=>e.pause(...arguments))),this},t.resume=function(){return Yl(e,(e=>e.resume(...arguments))),this},t.set=function(t){Yl(e,(e=>e.set(t)))},t.start=function(t){const n=[];return Yl(e,((e,o)=>{if(Kl.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 Yl(e,(e=>e.stop(...arguments))),this},t.update=function(t){return Yl(e,((e,n)=>e.update(this._getProps(t,e,n)))),this};const n=function(e,t,n){return Kl.fun(e)?e(n,t):e};return t._getProps=n,t};function Aa(e,t,n){const o=Kl.fun(t)&&t;o&&!n&&(n=[]);const r=(0,Wl.useMemo)((()=>o||3==arguments.length?La():void 0),[]),l=(0,Wl.useRef)(0),i=ls(),s=(0,Wl.useMemo)((()=>({ctrls:[],queue:[],flush(e,t){const n=Sa(e,t);return l.current>0&&!s.queue.length&&!Object.keys(n).some((t=>!e.springs[t]))?Ea(e,t):new Promise((o=>{wa(e,n),s.queue.push((()=>{o(Ea(e,t))})),i()}))}})),[]),a=(0,Wl.useRef)([...s.ctrls]),c=[],u=ss(e)||0;function d(e,n){for(let r=e;r<n;r++){const e=a.current[r]||(a.current[r]=new ya(null,s.flush)),n=o?o(r,e):t[r];n&&(c[r]=fa(n))}}(0,Wl.useMemo)((()=>{Yl(a.current.slice(e,u),(e=>{zs(e,r),e.stop(!0)})),a.current.length=e,d(u,e)}),[e]),(0,Wl.useMemo)((()=>{d(0,Math.min(u,e))}),n);const p=a.current.map(((e,t)=>Sa(e,c[t]))),m=(0,Wl.useContext)(Na),f=ss(m),g=m!==f&&Os(m);as((()=>{l.current++,s.ctrls=a.current;const{queue:e}=s;e.length&&(s.queue=[],Yl(e,(e=>e()))),Yl(a.current,((e,t)=>{null==r||r.add(e),g&&e.start({default:m});const n=c[t];n&&(Vs(e,n.ref),e.ref?e.queue.push(n):e.start(n))}))})),os((()=>()=>{Yl(s.ctrls,(e=>e.stop(!0)))}));const h=p.map((e=>Bs({},e)));return r?[h,r]:h}let Da;!function(e){e.MOUNT="mount",e.ENTER="enter",e.UPDATE="update",e.LEAVE="leave"}(Da||(Da={}));class Oa extends oa{constructor(e,t){super(),this.key=void 0,this.idle=!0,this.calc=void 0,this._active=new Set,this.source=e,this.calc=Ri(...t);const n=this._get(),o=_s(n);ds(this,o.create(n))}advance(e){const t=this._get();ql(t,this.get())||(us(this).setValue(t),this._onChange(t,this.idle)),!this.idle&&za(this._active)&&Va(this)}_get(){const e=Kl.arr(this.source)?this.source.map(Fi):Zl(Fi(this.source));return this.calc(...e)}_start(){this.idle&&!za(this._active)&&(this.idle=!1,Yl(ps(this),(e=>{e.done=!1})),li.skipAnimation?(Il.batchedUpdates((()=>this.advance())),Va(this)):ui.start(this))}_attach(){let e=1;Yl(Zl(this.source),(t=>{Oi(t)&&Ui(t,this),ta(t)&&(t.idle||this._active.add(t),e=Math.max(e,t.priority+1))})),this.priority=e,this._start()}_detach(){Yl(Zl(this.source),(e=>{Oi(e)&&Wi(e,this)})),this._active.clear(),Va(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=Zl(this.source).reduce(((e,t)=>Math.max(e,(ta(t)?t.priority:0)+1)),0))}}function Fa(e){return!1!==e.idle}function za(e){return!e.size||Array.from(e).every(Fa)}function Va(e){e.idle||(e.idle=!0,Yl(ps(e),(e=>{e.done=!0})),Vi(e,{type:"idle",parent:e}))}li.assign({createStringInterpolator:Zi,to:(e,t)=>new Oa(e,t)}),ui.advance;var Ha=window.ReactDOM;function Ga(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 Ua=["style","children","scrollTop","scrollLeft"],Wa=/^--/;function $a(e,t){return null==t||"boolean"==typeof t||""===t?"":"number"!=typeof t||0===t||Wa.test(e)||Ka.hasOwnProperty(e)&&Ka[e]?(""+t).trim():t+"px"}const ja={};let Ka={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 qa=["Webkit","Ms","Moz","O"];Ka=Object.keys(Ka).reduce(((e,t)=>(qa.forEach((n=>e[((e,t)=>e+t.charAt(0).toUpperCase()+t.substring(1))(n,t)]=e[t])),e)),Ka);const Ya=["x","y","z"],Qa=/^(matrix|translate|scale|rotate|skew)/,Za=/^(translate)/,Xa=/^(rotate|skew)/,Ja=(e,t)=>Kl.num(e)&&0!==e?e+t:e,ec=(e,t)=>Kl.arr(e)?e.every((e=>ec(e,t))):Kl.num(e)?e===t:parseFloat(e)===t;class tc extends vs{constructor(e){let{x:t,y:n,z:o}=e,r=Ga(e,Ya);const l=[],i=[];(t||n||o)&&(l.push([t||0,n||0,o||0]),i.push((e=>[`translate3d(${e.map((e=>Ja(e,"px"))).join(",")})`,ec(e,0)]))),Ql(r,((e,t)=>{if("transform"===t)l.push([e||""]),i.push((e=>[e,""===e]));else if(Qa.test(t)){if(delete r[t],Kl.und(e))return;const n=Za.test(t)?"px":Xa.test(t)?"deg":"";l.push(Zl(e)),i.push("rotate3d"===t?([e,t,o,r])=>[`rotate3d(${e},${t},${o},${Ja(r,n)})`,ec(r,0)]:e=>[`${t}(${e.map((e=>Ja(e,n))).join(",")})`,ec(e,t.startsWith("scale")?1:0)])}})),l.length&&(r.transform=new nc(l,i)),super(r)}}class nc extends Hi{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 Yl(this.inputs,((n,o)=>{const r=Fi(n[0]),[l,i]=this.transforms[o](Kl.arr(r)?r:n.map(Fi));e+=" "+l,t=t&&i})),t?"none":e}observerAdded(e){1==e&&Yl(this.inputs,(e=>Yl(e,(e=>Oi(e)&&Ui(e,this)))))}observerRemoved(e){0==e&&Yl(this.inputs,(e=>Yl(e,(e=>Oi(e)&&Wi(e,this)))))}eventObserved(e){"change"==e.type&&(this._value=null),Vi(this,e)}}const oc=["scrollTop","scrollLeft"];li.assign({batchedUpdates:Ha.unstable_batchedUpdates,createStringInterpolator:Zi,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 rc=((e,{applyAnimatedValues:t=(()=>!1),createAnimatedStyle:n=(e=>new vs(e)),getComponentProps:o=(e=>e)}={})=>{const r={applyAnimatedValues:t,createAnimatedStyle:n,getComponentProps:o},l=e=>{const t=ws(e)||"Anonymous";return(e=Kl.str(e)?l[e]||(l[e]=Es(e,r)):e[Ss]||(e[Ss]=Es(e,r))).displayName=`Animated(${t})`,e};return Ql(e,((t,n)=>{Kl.arr(e)&&(n=ws(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=Ga(o,Ua),c=Object.values(a),u=Object.keys(a).map((t=>n||e.hasAttribute(t)?t:ja[t]||(ja[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=$a(t,r[t]);Wa.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 tc(e),getComponentProps:e=>Ga(e,oc)}).animated,lc=e=>e+1,ic=e=>({top:e.offsetTop,left:e.offsetLeft});var sc=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)(lc,0),[u,p]=(0,s.useReducer)(lc,0),[m,f]=(0,s.useState)({x:0,y:0}),g=(0,s.useMemo)((()=>l.current?ic(l.current):null),[r]),h=(0,s.useMemo)((()=>{if(!n||!l.current)return()=>{};const e=(0,Fo.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",h()}({x:o,y:r}),v.x=o,v.y=r)}return(0,s.useLayoutEffect)((()=>{a&&p()}),[a]),(0,s.useLayoutEffect)((()=>{if(!g)return;if(i)return void h();l.current.style.transform="";const e=ic(l.current);c(),f({x:Math.round(g.left-e.left),y:Math.round(g.top-e.top)})}),[r]),v.x=0,v.y=0,function(e,t){const n=Kl.fun(e),[[o],r]=Aa(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};const ac=".block-editor-block-list__block",cc=".block-list-appender",uc=".block-editor-button-block-appender";function dc(e,t){return t.closest([ac,cc,uc].join(","))===e}function pc(e){for(;e&&e.nodeType!==e.ELEMENT_NODE;)e=e.parentNode;if(!e)return;const t=e.closest(ac);return t?t.id.slice("block-".length):void 0}function mc(e){const t=(0,s.useRef)(),n=function(e){return(0,m.useSelect)((t=>{const{getSelectedBlocksInitialCaretPosition:n,isNavigationMode:o,isBlockSelected:r}=t(Qn);if(r(e)&&!o())return n()}),[e])}(e),{isBlockSelected:o,isMultiSelecting:r}=(0,m.useSelect)(Qn);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=Fo.focus.tabbable.find(t.current).filter((e=>(0,Fo.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=Fo.focus.tabbable.findNext(t.current);if(e&&dc(t.current,e)&&(0,Fo.isFormElement)(e))return void e.focus()}(0,Fo.placeCaretAtHorizontalEdge)(a,s)}else t.current.focus()}),[n,e]),t}function fc(e){if(e.defaultPrevented)return;const t="mouseover"===e.type?"add":"remove";e.preventDefault(),e.currentTarget.classList[t]("is-hovered")}function gc(){const e=(0,m.useSelect)((e=>{const{isNavigationMode:t,getSettings:n}=e(Qn);return t()||n().outlineMode}),[]);return(0,d.useRefEffect)((t=>{if(e)return t.addEventListener("mouseout",fc),t.addEventListener("mouseover",fc),()=>{t.removeEventListener("mouseout",fc),t.removeEventListener("mouseover",fc),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}=t(Qn),{outlineMode:p}=a(),m=n(e),f=l(e),g=s(e),h=u(e,!0);return c()({"is-selected":f,"is-highlighted":o(e),"is-multi-selected":i(e),"is-reusable":(0,r.isReusableBlock)((0,r.getBlockType)(g)),"is-dragging":m,"has-child-selected":h,"remove-outline":f&&p&&d()})}),[e])}function vc(e){return(0,m.useSelect)((t=>{const n=t(Qn).getBlockName(e),o=(0,r.getBlockType)(n);if((null==o?void 0:o.apiVersion)>1)return(0,r.getBlockDefaultClassName)(n)}),[e])}function bc(e){return(0,m.useSelect)((t=>{const{getBlockName:n,getBlockAttributes:o}=t(Qn),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 kc(e){return(0,m.useSelect)((t=>{const{hasBlockMovingClientId:n,canInsertBlockType:o,getBlockName:r,getBlockRootClientId:l,isBlockSelected:i}=t(Qn);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)(Qn),{selectBlock:n,selectionChange:o}=(0,m.useDispatch)(Qn);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])}var yc=window.wp.keycodes;function Ec(e){const t=(0,m.useSelect)((t=>t(Qn).isBlockSelected(e)),[e]),{getBlockRootClientId:n,getBlockIndex:o}=(0,m.useSelect)(Qn),{insertDefaultBlock:r,removeBlock:l}=(0,m.useDispatch)(Qn);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!==yc.ENTER&&s!==yc.BACKSPACE&&s!==yc.DELETE||a!==i||(0,Fo.isTextField)(a)||(t.preventDefault(),s===yc.ENTER?r({},n(e),o(e)+1):l(e))}function a(e){e.preventDefault()}}),[e,t,n,o,r,l])}function Cc(e){const{isNavigationMode:t,isBlockSelected:n}=(0,m.useSelect)(Qn),{setNavigationMode:o,selectBlock:r}=(0,m.useDispatch)(Qn);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 Sc(){const e=(0,s.useContext)(If);return(0,d.useRefEffect)((t=>{if(e)return e.observe(t),()=>{e.unobserve(t)}}),[e])}function wc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{__unstableIsHtml:t}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n,className:o,wrapperProps:l={},isAligned:i}=(0,s.useContext)(Bc),{index:a,mode:u,name:p,blockApiVersion:f,blockTitle:h,isPartOfSelection:v,adjustScrolling:b,enableAnimation:k}=(0,m.useSelect)((e=>{const{getBlockIndex:t,getBlockMode:o,getBlockName:l,isTyping:i,getGlobalBlockCount:s,isBlockSelected:a,isBlockMultiSelected:c,isAncestorMultiSelected:u,isFirstMultiSelectedBlock:d}=e(Qn),p=a(n),m=c(n)||u(n),f=l(n),g=(0,r.getBlockType)(f);return{index:t(n),mode:o(n),name:f,blockApiVersion:(null==g?void 0:g.apiVersion)||1,blockTitle:null==g?void 0:g.title,isPartOfSelection:p||m,adjustScrolling:p||d(n),enableAnimation:!i()&&s()<=200}}),[n]),_=(0,g.sprintf)((0,g.__)("Block: %s"),h),y="html"!==u||t?"":"-visual",E=(0,d.useMergeRefs)([e.ref,mc(n),vo(n),_c(n),Ec(n),Cc(n),gc(),Sc(),sc({isSelected:v,adjustScrolling:b,enableAnimation:k,triggerAnimationOnChange:a})]),C=eo();return f<2&&n===C.clientId&&"undefined"!=typeof process&&process.env,{...l,...e,ref:E,id:`block-${n}${y}`,tabIndex:0,role:"document","aria-label":_,"data-block":n,"data-type":p,"data-title":h,className:c()(c()("block-editor-block-list__block",{"wp-block":!i}),o,e.className,l.className,hc(n),vc(n),bc(n),kc(n)),style:{...l.style,...e.style}}}wc.save=r.__unstableGetBlockProps;const Bc=(0,s.createContext)();function Ic(e){let{children:t,isHtml:n,...o}=e;return(0,s.createElement)("div",wc(o,{__unstableIsHtml:n}),t)}const xc=(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(Qn),d=a(n),p=r(n),m=s(o),f=c(n,o),g=u(n,o),{name:h,attributes:v,isValid:b}=d||{};return{mode:l(n),isSelectionEnabled:i(),isLocked:!!m,canRemove:f,canMove:g,block:d,name:h,attributes:v,isValid:b,isSelected:p}})),Tc=(0,m.withDispatch)(((e,t,n)=>{let{select:o}=n;const{updateBlockAttributes:l,insertBlocks:i,mergeBlocks:s,replaceBlocks:a,toggleSelection:c,__unstableMarkLastChangeAsPersistent:u}=e(Qn);return{setAttributes(e){const{getMultiSelectedBlockClientIds:n}=o(Qn),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(Qn),s=l(n);i(e,s+1,r)},onMerge(e){const{clientId:n}=t,{getPreviousBlockClientId:r,getNextBlockClientId:l}=o(Qn);if(e){const e=l(n);e&&s(n,e)}else{const e=r(n);e&&s(e,n)}},onReplace(e,n,o){e.length&&!(0,r.isUnmodifiedDefaultBlock)(e[e.length-1])&&u(),a([t.clientId],e,n,o)},toggleSelection(e){c(e)}}}));var Nc=(0,d.compose)(d.pure,xc,Tc,(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:f,name:g,isValid:h,attributes:v,wrapperProps:b,setAttributes:k,onReplace:_,onInsertBlocksAfter:y,onMerge:E,toggleSelection:C}=e;const S=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().supportsLayout}),[]),{removeBlock:w}=(0,m.useDispatch)(Qn),B=(0,s.useCallback)((()=>w(a)),[a]);let I=(0,s.createElement)(pl,{name:g,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)(g);null!=x&&x.getEditWrapperProps&&(b=function(e,t){const n={...e,...t};return e&&t&&e.className&&t.className&&(n.className=c()(e.className,t.className)),e&&t&&e.style&&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)),h)N="html"===o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{style:{display:"none"}},I),(0,s.createElement)(Ic,{isHtml:!0},(0,s.createElement)(wl,{clientId:a}))):(null==x?void 0:x.apiVersion)>1?I:(0,s.createElement)(Ic,b,I);else{const e=n?(0,r.serializeRawBlock)(n):(0,r.getSaveContent)(x,v);N=(0,s.createElement)(Ic,{className:"has-warning"},(0,s.createElement)(kl,{clientId:a}),(0,s.createElement)(s.RawHTML,null,(0,Fo.safeHTML)(e)))}const P={clientId:a,className:null!==(t=b)&&void 0!==t&&t["data-align"]&&S?c()(f,`align${b["data-align"]}`):f,wrapperProps:(0,u.omit)(b,["data-align"]),isAligned:T},M=(0,s.useMemo)((()=>P),Object.values(P));return(0,s.createElement)(Bc.Provider,{value:M},(0,s.createElement)(Cl,{fallback:(0,s.createElement)(Ic,{className:"has-warning"},(0,s.createElement)(yl,null))},N))})),Pc=window.wp.htmlEntities,Mc=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 11.2h-5.2V6h-1.6v5.2H6v1.6h5.2V18h1.6v-5.2H18z"}));const Rc=[(0,s.createInterpolateElement)((0,g.__)("While writing, you can press <kbd>/</kbd> to quickly insert new blocks."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Indent a list by pressing <kbd>space</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,s.createInterpolateElement)((0,g.__)("Outdent a list by pressing <kbd>backspace</kbd> at the beginning of a line."),{kbd:(0,s.createElement)("kbd",null)}),(0,g.__)("Drag files into the editor to automatically insert media blocks."),(0,g.__)("Change a block's type by pressing the block icon on the toolbar.")];var Lc=function(){const[e]=(0,s.useState)(Math.floor(Math.random()*Rc.length));return(0,s.createElement)(p.Tip,null,Rc[e])},Ac=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),Dc=(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:Ac});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)})),Oc=function(e){let{title:t,icon:n,description:o,blockType:r}=e;return r&&(H()("`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)(Dc,{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)))};function Fc(e){let{clientId:t=null,value:n,selection:o,onChange:l=u.noop,onInput:i=u.noop}=e;const a=(0,m.useRegistry)(),{resetBlocks:c,resetSelection:d,replaceInnerBlocks:p,setHasControlledInnerBlocks:f,__unstableMarkNextChangeAsNotPersistent:g}=a.dispatch(Qn),{getBlockName:h,getBlocks:v}=a.select(Qn),b=(0,m.useSelect)((e=>!t||e(Qn).areInnerBlocksControlled(t)),[t]),k=(0,s.useRef)({incoming:null,outgoing:[]}),_=(0,s.useRef)(!1),y=()=>{n&&(g(),t?a.batch((()=>{f(t,!0);const e=n.map((e=>(0,r.cloneBlock)(e)));_.current&&(k.current.incoming=e),g(),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(Qn);let s=v(t),c=r(),u=!1;_.current=!0;const d=a.subscribe((()=>{if(null!==t&&null===h(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])}var zc=(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(qn,Yn),a(e)}),[o]),l?(0,s.createElement)(m.RegistryProvider,{value:l},(0,s.createElement)(e,i({registry:l},r))):null}))),"withRegistryProvider")((function(e){const{children:t,settings:n}=e,{updateSettings:o}=(0,m.useDispatch)(Qn);return(0,s.useEffect)((()=>{o(n)}),[n]),Fc(e),(0,s.createElement)(ho,null,t)}));function Vc(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)(Tf,null)))}function Hc(){const{hasSelectedBlock:e,hasMultiSelection:t}=(0,m.useSelect)(Qn),{clearSelectedBlock:n}=(0,m.useDispatch)(Qn);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 Gc(e){return(0,s.createElement)("div",i({ref:Hc()},e))}function Uc(e){const{isMultiSelecting:t,getMultiSelectedBlockClientIds:n,hasMultiSelection:o,getSelectedBlockClientId:r,getSelectedBlocksInitialCaretPosition:l,__unstableIsFullySelected:i}=e(Qn);return{isMultiSelecting:t(),multiSelectedBlockClientIds:n(),hasMultiSelection:o(),selectedBlockClientId:r(),initialPosition:l(),isFullSelection:i()}}function Wc(){const{initialPosition:e,isMultiSelecting:t,multiSelectedBlockClientIds:n,hasMultiSelection:o,selectedBlockClientId:r,isFullSelection:l}=(0,m.useSelect)(Uc,[]),i=bo(r),s=bo((0,u.first)(n)),a=bo((0,u.last)(n));return(0,d.useRefEffect)((c=>{const{ownerDocument:u}=c,{defaultView:d}=u;if(null==e)return;if(!o||t){if(!r||t)return;const e=d.getSelection();if(e.rangeCount&&!e.isCollapsed){const t=i.current,{startContainer:n,endContainer:o}=e.getRangeAt(0);!t||t.contains(n)&&t.contains(o)||e.removeAllRanges()}return}const{length:p}=n;if(p<2)return;if(!l)return;if(c.contentEditable=!0,c.focus(),!s.current||!a.current)return;const m=d.getSelection(),f=u.createRange();f.setStartBefore(s.current),f.setEndAfter(a.current),m.removeAllRanges(),m.addRange(f)}),[o,t,n,r,e,l])}function $c(e,t,n,o){let r,l=Fo.focus.focusable.find(n);return t&&(l=(0,u.reverse)(l)),l=l.slice(l.indexOf(e)+1),o&&(r=e.getBoundingClientRect()),(0,u.find)(l,(function(e){if(!Fo.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 jc(){const{getSelectedBlockClientId:e,getMultiSelectedBlocksEndClientId:t,getPreviousBlockClientId:n,getNextBlockClientId:o,getSettings:r,hasMultiSelection:l}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((i=>{let s;function a(){s=null}function c(a){const{keyCode:c,target:u}=a,d=c===yc.UP,p=c===yc.DOWN,m=c===yc.LEFT,f=c===yc.RIGHT,g=d||m,h=m||f,v=d||p,b=h||v,k=a.shiftKey,_=k||a.ctrlKey||a.altKey||a.metaKey,y=v?Fo.isVerticalEdge:Fo.isHorizontalEdge,{ownerDocument:E}=i,{defaultView:C}=E;if(l())return;if(v?s||(s=(0,Fo.computeCaretRect)(C)):s=null,a.defaultPrevented)return;if(!b)return;if(!function(e,t,n){if((t===yc.UP||t===yc.DOWN)&&!n)return!0;const{tagName:o}=e;return"INPUT"!==o&&"TEXTAREA"!==o}(u,c,_))return;const S=(0,Fo.isRTL)(u)?!g:g,{keepCaretInsideBlock:w}=r(),B=e();if(k){const e=t(),r=n(e||B),l=o(e||B);(g&&r||!g&&l)&&function(e,t){const n=$c(e,t,i);return!n||!function(e,t){return e.closest(ac)===t.closest(ac)}(e,n)}(u,g)&&y(u,g)&&(i.contentEditable=!0,i.focus())}else if(v&&(0,Fo.isVerticalEdge)(u,g)&&!w){const e=$c(u,g,i,!0);e&&((0,Fo.placeCaretAtVerticalEdge)(e,g,s),a.preventDefault())}else if(h&&C.getSelection().isCollapsed&&(0,Fo.isHorizontalEdge)(u,S)&&!w){const e=$c(u,S,i);(0,Fo.placeCaretAtHorizontalEdge)(e,g),a.preventDefault()}}return i.addEventListener("mousedown",a),i.addEventListener("keydown",c),()=>{i.removeEventListener("mousedown",a),i.removeEventListener("keydown",c)}}),[])}var Kc=window.wp.keyboardShortcuts;function qc(){const{getBlockOrder:e,getSelectedBlockClientIds:t,getBlockRootClientId:n}=(0,m.useSelect)(Qn),{multiSelect:o}=(0,m.useDispatch)(Qn),r=(0,Kc.__unstableUseShortcutEventMatch)();return(0,d.useRefEffect)((l=>{function i(l){if(!r("core/block-editor/select-all",l))return;const i=t();if(i.length<2&&!(0,Fo.isEntirelySelected)(l.target))return;const[s]=i,a=n(s);let c=e(a);i.length===c.length&&(c=e(n(a)));const d=(0,u.first)(c),p=(0,u.last)(c);d!==p&&(o(d,p),l.preventDefault())}return l.addEventListener("keydown",i),()=>{l.removeEventListener("keydown",i)}}),[])}function Yc(e,t){e.contentEditable=t,t&&e.focus()}function Qc(){const{startMultiSelect:e,stopMultiSelect:t}=(0,m.useDispatch)(Qn),{isSelectionEnabled:n,hasMultiSelection:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((r=>{const{ownerDocument:l}=r,{defaultView:i}=l;let s,a;function c(){t(),i.removeEventListener("mouseup",c),a=i.requestAnimationFrame((()=>{if(o())return;Yc(r,!1);const e=i.getSelection();if(e.rangeCount){const{commonAncestorContainer:t}=e.getRangeAt(0);s.contains(t)&&s.focus()}}))}function u(t){let{buttons:o,target:a}=t;1===o&&a.getAttribute("contenteditable")&&n()&&(s=l.activeElement,e(),i.addEventListener("mouseup",c),Yc(r,!0))}return r.addEventListener("mouseout",u),()=>{r.removeEventListener("mouseout",u),i.removeEventListener("mouseup",c),i.cancelAnimationFrame(a)}}),[e,t,n,o])}function Zc(e,t){e.contentEditable=t,t&&e.focus()}function Xc(){const{multiSelect:e,selectBlock:t,selectionChange:n}=(0,m.useDispatch)(Qn),{getBlockParents:o,getBlockSelectionStart:r}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((n=>{const{ownerDocument:l}=n,{defaultView:i}=l;function s(l){const s=i.getSelection();if(!s.rangeCount)return void Zc(n,!1);const a=l.shiftKey&&"mouseup"===l.type;if(s.isCollapsed&&!a)return void Zc(n,!1);let c=pc(function(e){const{anchorNode:t,anchorOffset:n}=e;return t.nodeType===t.TEXT_NODE?t:t.childNodes[n]}(s)),u=pc(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=pc(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 Zc(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 Jc(){const{selectBlock:e}=(0,m.useDispatch)(Qn),{isSelectionEnabled:t,getBlockSelectionStart:n,hasMultiSelection:o}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((r=>{function l(l){if(!t()||0!==l.button)return;const i=n(),s=pc(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 eu(){const{__unstableIsFullySelected:e,getSelectedBlockClientIds:t,__unstableIsSelectionMergeable:n,hasMultiSelection:o}=(0,m.useSelect)(Qn),{replaceBlocks:l,__unstableSplitSelection:i,removeBlocks:s,__unstableDeleteSelection:a,__unstableExpandSelection:c}=(0,m.useDispatch)(Qn);return(0,d.useRefEffect)((u=>{function d(d){d.defaultPrevented||o()&&(d.keyCode===yc.ENTER?(u.contentEditable=!1,d.preventDefault(),e()?l(t(),(0,r.createBlock)((0,r.getDefaultBlockName)())):i()):d.keyCode===yc.BACKSPACE||d.keyCode===yc.DELETE?(u.contentEditable=!1,d.preventDefault(),e()?s(t()):n()?a(d.keyCode===yc.DELETE):c()):1!==d.key.length||d.metaKey||d.ctrlKey||(u.contentEditable=!1,n()?a(d.keyCode===yc.DELETE):(d.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges())))}function p(e){o()&&(u.contentEditable=!1,n()?a():(e.preventDefault(),u.ownerDocument.defaultView.getSelection().removeAllRanges()))}return u.addEventListener("keydown",d),u.addEventListener("compositionstart",p),()=>{u.removeEventListener("keydown",d),u.removeEventListener("compositionstart",p)}}),[])}function tu(){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)(Qn),{setNavigationMode:a}=(0,m.useDispatch)(Qn),c=(0,m.useSelect)((e=>e(Qn).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";Fo.focus.tabbable[n](t.target).focus()}}const f=(0,s.createElement)("div",{ref:t,tabIndex:c,onFocus:p}),g=(0,s.createElement)("div",{ref:n,tabIndex:c,onFocus:p}),h=(0,d.useRefEffect)((s=>{function c(e){if(e.defaultPrevented)return;if(e.keyCode===yc.ESCAPE&&!r())return e.preventDefault(),void a(!0);if(e.keyCode!==yc.TAB)return;const o=e.shiftKey,i=o?"findPrevious":"findNext";if(!r()&&!l())return void(e.target===s&&a(!0));if(((0,Fo.isFormElement)(e.target)||e.target.getAttribute("data-block")===l())&&(0,Fo.isFormElement)(Fo.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!==yc.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=Fo.focus.tabbable[l](o.target);i!==t.current&&i!==n.current||(o.preventDefault(),i.focus({preventScroll:!0}))}const{ownerDocument:m}=s,{defaultView:f}=m;return f.addEventListener("keydown",p),s.addEventListener("keydown",c),s.addEventListener("focusout",d),()=>{f.removeEventListener("keydown",p),s.removeEventListener("keydown",c),s.removeEventListener("focusout",d)}}),[]);return[f,(0,d.useMergeRefs)([e,h]),g]}(),o=(0,m.useSelect)((e=>e(Qn).hasMultiSelection()),[]);return[e,(0,d.useMergeRefs)([t,eu(),Qc(),Xc(),Jc(),Wc(),qc(),jc(),(0,d.useRefEffect)((e=>{if(e.tabIndex=-1,e.contentEditable=o,o)return e.setAttribute("aria-label",(0,g.__)("Multiple selected blocks")),()=>{e.removeAttribute("aria-label")}}),[o])]),n]}var nu=(0,s.forwardRef)((function(e,t){let{children:n,...o}=e;const[r,l,a]=tu();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)}));const ou="editor-styles-wrapper";function ru(e){return(0,s.useMemo)((()=>{const t=document.implementation.createHTMLDocument("");return t.body.innerHTML=e,Array.from(t.body.children)}),[e])}var 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)((()=>({}))),[f,h]=(0,s.useState)(),[v,b]=(0,s.useState)([]),k=ru(null==a?void 0:a.styles),_=ru(null==a?void 0:a.scripts),y=Hc(),[E,C,S]=tu(),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),h(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&&Array.from(o).find((e=>{let{selectorText:t}=e;return t&&(t.includes(`.${ou}`)||t.includes(".wp-block"))}))&&!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,g.__)("Editor canvas")}),f&&(0,s.createPortal)((0,s.createElement)(s.Fragment,null,(0,s.createElement)("head",{ref:B},r),(0,s.createElement)("body",{ref:I,className:c()(ou,...v)},(0,s.createElement)("div",{style:{display:"none"},ref:x}),(0,s.createElement)(p.__experimentalStyleProvider,{document:f},o))),f.documentElement)),l>=0&&S)})),iu={grad:.9,turn:360,rad:360/(2*Math.PI)},su=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},cu=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=1),e>n?n:e>t?e:t},uu=function(e){return(e=isFinite(e)?e%360:0)>0?e:e+360},du=function(e){return{r:cu(e.r,0,255),g:cu(e.g,0,255),b:cu(e.b,0,255),a:cu(e.a)}},pu=function(e){return{r:au(e.r),g:au(e.g),b:au(e.b),a:au(e.a,3)}},mu=/^#([0-9a-f]{3,8})$/i,fu=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}},hu=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}},vu=function(e){return{h:uu(e.h),s:cu(e.s,0,100),l:cu(e.l,0,100),a:cu(e.a)}},bu=function(e){return{h:au(e.h),s:au(e.s),l:au(e.l),a:au(e.a,3)}},ku=function(e){return hu((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},_u=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},yu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Eu=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Cu=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Su=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,wu={string:[[function(e){var t=mu.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=Cu.exec(e)||Su.exec(e);return t?t[2]!==t[4]||t[4]!==t[6]?null:du({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=yu.exec(e)||Eu.exec(e);if(!t)return null;var n,o,r=vu({h:(n=t[1],o=t[2],void 0===o&&(o="deg"),Number(n)*(iu[o]||1)),s:Number(t[3]),l:Number(t[4]),a:void 0===t[5]?1:Number(t[5])/(t[6]?100:1)});return ku(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 su(t)&&su(n)&&su(o)?du({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(!su(t)||!su(n)||!su(o))return null;var i=vu({h:Number(t),s:Number(n),l:Number(o),a:Number(l)});return ku(i)},"hsl"],[function(e){var t=e.h,n=e.s,o=e.v,r=e.a,l=void 0===r?1:r;if(!su(t)||!su(n)||!su(o))return null;var i=function(e){return{h:uu(e.h),s:cu(e.s,0,100),v:cu(e.v,0,100),a:cu(e.a)}}({h:Number(t),s:Number(n),v:Number(o),a:Number(l)});return hu(i)},"hsv"]]},Bu=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]},Iu=function(e,t){var n=_u(e);return{h:n.h,s:cu(n.s+100*t,0,100),l:n.l,a:n.a}},xu=function(e){return(299*e.r+587*e.g+114*e.b)/1e3/255},Tu=function(e,t){var n=_u(e);return{h:n.h,s:n.s,l:cu(n.l+100*t,0,100),a:n.a}},Nu=function(){function e(e){this.parsed=function(e){return"string"==typeof e?Bu(e.trim(),wu.string):"object"==typeof e&&null!==e?Bu(e,wu.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(xu(this.rgba),2)},e.prototype.isDark=function(){return xu(this.rgba)<.5},e.prototype.isLight=function(){return xu(this.rgba)>=.5},e.prototype.toHex=function(){return t=(e=pu(this.rgba)).r,n=e.g,o=e.b,l=(r=e.a)<1?fu(au(255*r)):"","#"+fu(t)+fu(n)+fu(o)+l;var e,t,n,o,r,l},e.prototype.toRgb=function(){return pu(this.rgba)},e.prototype.toRgbString=function(){return t=(e=pu(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 bu(_u(this.rgba))},e.prototype.toHslString=function(){return t=(e=bu(_u(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 Pu({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),Pu(Iu(this.rgba,e))},e.prototype.desaturate=function(e){return void 0===e&&(e=.1),Pu(Iu(this.rgba,-e))},e.prototype.grayscale=function(){return Pu(Iu(this.rgba,-1))},e.prototype.lighten=function(e){return void 0===e&&(e=.1),Pu(Tu(this.rgba,e))},e.prototype.darken=function(e){return void 0===e&&(e=.1),Pu(Tu(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?Pu({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=_u(this.rgba);return"number"==typeof e?Pu({h:e,s:t.s,l:t.l,a:t.a}):au(t.h)},e.prototype.isEqual=function(e){return this.toHex()===Pu(e).toHex()},e}(),Pu=function(e){return e instanceof Nu?e:new Nu(e)},Mu=[],Ru=function(e){e.forEach((function(e){Mu.indexOf(e)<0&&(e(Nu,wu),Mu.push(e))}))};function Lu(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 Au=function(e){var t=e/255;return t<.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)},Du=function(e){return.2126*Au(e.r)+.7152*Au(e.g)+.0722*Au(e.b)};function Ou(e){e.prototype.luminance=function(){return e=Du(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=Du(l))>(a=Du(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 Fu=n(3124),zu=n.n(Fu);const Vu=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g;function Hu(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(),f(n);e.length&&"}"!==e.charAt(0)&&(t=S()||w());)!1!==t&&(n.push(t),f(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 f(e){let t;for(e=e||[];t=g();)!1!==t&&e.push(t);return e}function g(){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 h(){const e=p(/^([^{]+)/);if(e)return Gu(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=Gu(t[0]),!p(/^:\s*/))return a("property missing ':'");const n=p(/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^\)]*?\)|[^};])+)/),o=e({type:"declaration",property:t.replace(Vu,""),value:n?Gu(n[0]).replace(Vu,""):""});return p(/^[;\s]*/),o}function b(){const e=[];if(!c())return a("missing '{'");let t;for(f(e);t=v();)!1!==t&&(e.push(t),f(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=f();for(;r=k();)i.push(r),i=i.concat(f());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=Gu(t[1]);if(!c())return a("@media missing '{'");const o=f().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:Gu(t[1]),media:Gu(t[2])})}()||function(){const e=l(),t=p(/^@supports *([^{]+)/);if(!t)return;const n=Gu(t[1]);if(!c())return a("@supports missing '{'");const o=f().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=Gu(t[1]),o=Gu(t[2]);if(!c())return a("@document missing '{'");const r=f().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=h()||[];if(!c())return a("@page missing '{'");let n,o=f();for(;n=v();)o.push(n),o=o.concat(f());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=f().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=f();for(;t=v();)n.push(t),n=n.concat(f());return u()?e({type:"font-face",declarations:n}):a("@font-face missing '}'")}()}function w(){const e=l(),t=h();return t?(f(),e({type:"rule",selectors:t,declarations:b()})):a("selector missing")}return Uu(function(){const e=d();return{type:"stylesheet",stylesheet:{source:t.source,rules:e,parsingErrors:s}}}())}function Gu(e){return e?e.replace(/^\s+|\s+$/g,""):""}function Uu(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){Uu(e,o)})):n&&"object"==typeof n&&Uu(n,o)}return n&&Object.defineProperty(e,"parent",{configurable:!0,writable:!0,enumerable:!1,value:t||null}),e}var Wu=n(8575),$u=n.n(Wu),ju=Ku;function Ku(e){this.options=e||{}}Ku.prototype.emit=function(e){return e},Ku.prototype.visit=function(e){return this[e.type](e)},Ku.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};var qu=Yu;function Yu(e){ju.call(this,e)}$u()(Yu,ju),Yu.prototype.compile=function(e){return e.stylesheet.rules.map(this.visit,this).join("")},Yu.prototype.comment=function(e){return this.emit("",e.position)},Yu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Yu.prototype.media=function(e){return this.emit("@media "+e.media,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Yu.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("}")},Yu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Yu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Yu.prototype.supports=function(e){return this.emit("@supports "+e.supports,e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Yu.prototype.keyframes=function(e){return this.emit("@"+(e.vendor||"")+"keyframes "+e.name,e.position)+this.emit("{")+this.mapVisit(e.keyframes)+this.emit("}")},Yu.prototype.keyframe=function(e){const t=e.declarations;return this.emit(e.values.join(","),e.position)+this.emit("{")+this.mapVisit(t)+this.emit("}")},Yu.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("}")},Yu.prototype["font-face"]=function(e){return this.emit("@font-face",e.position)+this.emit("{")+this.mapVisit(e.declarations)+this.emit("}")},Yu.prototype.host=function(e){return this.emit("@host",e.position)+this.emit("{")+this.mapVisit(e.rules)+this.emit("}")},Yu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Yu.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("}"):""},Yu.prototype.declaration=function(e){return this.emit(e.property+":"+e.value,e.position)+this.emit(";")};var Qu=Zu;function Zu(e){e=e||{},ju.call(this,e),this.indentation=e.indent}$u()(Zu,ju),Zu.prototype.compile=function(e){return this.stylesheet(e)},Zu.prototype.stylesheet=function(e){return this.mapVisit(e.stylesheet.rules,"\n\n")},Zu.prototype.comment=function(e){return this.emit(this.indent()+"/*"+e.comment+"*/",e.position)},Zu.prototype.import=function(e){return this.emit("@import "+e.import+";",e.position)},Zu.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}")},Zu.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}")},Zu.prototype.charset=function(e){return this.emit("@charset "+e.charset+";",e.position)},Zu.prototype.namespace=function(e){return this.emit("@namespace "+e.namespace+";",e.position)},Zu.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}")},Zu.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)+"}")},Zu.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")},Zu.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}")},Zu.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}")},Zu.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}")},Zu.prototype["custom-media"]=function(e){return this.emit("@custom-media "+e.name+" "+e.media+";",e.position)},Zu.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()+"}"):""},Zu.prototype.declaration=function(e){return this.emit(this.indent())+this.emit(e.property+": "+e.value,e.position)+this.emit(";")},Zu.prototype.indent=function(e){return this.level=this.level||1,null!==e?(this.level+=e,""):Array(this.level).join(this.indentation||" ")};var Xu=function(e,t){try{const r=Hu(e);return n=zu().map(r,(function(e){if(!e)return e;const n=t(e);return this.update(n)})),((o=o||{}).compress?new qu(o):new Qu(o)).compile(n)}catch(e){return console.warn("Error while traversing the CSS: "+e),null}var n,o};function Ju(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 ed(e,t){return new URL(e,t).toString()}var td=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]};Ju(e)&&o.push(e)}return o}(t.value).map((r=e,e=>({...e,newUrl:"url("+e.before+e.quote+ed(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};const nd=/^(body|html|:root).*$/;var od=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(nd)?n.replace(/^(body|html|:root)/,e):e+" "+n))}:n},rd=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(od(t)),o&&r.push(td(o)),r.length?Xu(n,(0,d.compose)(r)):n}))};const ld=".editor-styles-wrapper";function id(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=Pu(l);i.luminance()>.5||0===i.alpha()?o.classList.remove("is-dark-theme"):o.classList.add("is-dark-theme")}),[e])}function sd(e){let{styles:t}=e;const n=(0,s.useMemo)((()=>rd(t,ld)),[t]);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("style",{ref:id(t)}),n.map(((e,t)=>(0,s.createElement)("style",{key:t},e))))}let ad;Ru([Lu,Ou]);const cd=2e3;var ud=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}=(0,m.useSelect)((e=>{const t=e(Qn).getSettings();return{styles:t.styles,assets:t.__unstableResolvedAssets}}),[]),f=(0,s.useMemo)((()=>c?[...c,{css:"body{height:auto;overflow:hidden;}",__unstableType:"presets"}]:c),[c]);ad=ad||(0,d.pure)(Tf);const g=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(${g})`,height:a*g,maxHeight:a>cd?cd*g:void 0,minHeight:o}},(0,s.createElement)(lu,{head:(0,s.createElement)(sd,{styles:f}),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:cd,minHeight:g<1&&o?o/g:o}},i,(0,s.createElement)(ad,{renderAppender:!1}))))},dd=(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(Qn).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)(zc,{value:d,settings:c},r?(0,s.createElement)(Vc,{onClick:l}):(0,s.createElement)(ud,{viewportWidth:o,__experimentalPadding:n,__experimentalMinHeight:i})):null}));function pd(e){let{blocks:t,props:n={},__experimentalLayout:o}=e;const r=(0,m.useSelect)((e=>e(Qn).getSettings()),[]),l=(0,d.__experimentalUseDisabled)(),i=(0,d.useMergeRefs)([n.ref,l]),a=(0,s.useMemo)((()=>({...r,__experimentalBlockPatterns:[]})),[r]),p=(0,s.useMemo)((()=>(0,u.castArray)(t)),[t]),f=(0,s.createElement)(zc,{value:p,settings:a},(0,s.createElement)(Pf,{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?f:null}}var md=function(e){var t,n;let{item:o}=e;const{name:l,title:i,icon:a,description:c,initialAttributes:u}=o,d=(0,r.getBlockType)(l),p=(0,r.isReusableBlock)(o);return(0,s.createElement)("div",{className:"block-editor-inserter__preview-container"},(0,s.createElement)("div",{className:"block-editor-inserter__preview"},p||null!=d&&d.example?(0,s.createElement)("div",{className:"block-editor-inserter__preview-content"},(0,s.createElement)(dd,{__experimentalPadding:16,viewportWidth:null!==(t=null===(n=d.example)||void 0===n?void 0:n.viewportWidth)&&void 0!==t?t:500,blocks:d.example?(0,r.getBlockFromExample)(o.name,{attributes:{...d.example.attributes,...u},innerBlocks:d.example.innerBlocks}):(0,r.createBlock)(l,u)})):(0,s.createElement)("div",{className:"block-editor-inserter__preview-content-missing"},(0,g.__)("No Preview Available."))),!p&&(0,s.createElement)(Oc,{title:i,icon:a,description:c}))},fd=(0,s.createContext)(),gd=(0,s.forwardRef)((function(e,t){let{isFirst:n,as:o,children:r,...l}=e;const a=(0,s.useContext)(fd);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)}))})),hd=(0,s.createElement)(O.SVG,{width:"24",height:"24",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M8 7h2V5H8v2zm0 6h2v-2H8v2zm0 6h2v-2H8v2zm6-14v2h2V5h-2zm0 8h2v-2h-2v2zm0 6h2v-2h-2v2z"}));function vd(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)(Dc,{icon:n}):(0,g.sprintf)(
11
  /* translators: %d: Number of blocks. */
12
+ (0,g._n)("%d block","%d blocks",t),t)),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Dc,{icon:hd})))))}var bd=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)(vd,{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})}))};function kd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:window;const{platform:t}=e.navigator;return-1!==t.indexOf("Mac")||["iPad","iPhone"].includes(t)}var _d=(0,s.memo)((function(e){let{className:t,isFirst:n,item:o,onSelect:l,onHover:a,isDraggable:u,...d}=e;const p=(0,s.useRef)(!1),m=o.icon?{backgroundColor:o.icon.background,color:o.icon.foreground}:{},f=(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)(bd,{isEnabled:u&&!o.disabled,blocks:f,icon:o.icon},(e=>{let{draggable:r,onDragStart:u,onDragEnd:f}=e;return(0,s.createElement)("div",{className:"block-editor-block-types-list__list-item",draggable:r,onDragStart:e=>{p.current=!0,u&&(a(null),u(e))},onDragEnd:e=>{p.current=!1,f&&f(e)}},(0,s.createElement)(gd,i({isFirst:n,className:c()("block-editor-block-types-list__item",t),disabled:o.isDisabled,onClick:e=>{e.preventDefault(),l(o,kd()?e.metaKey:e.ctrlKey),a(null)},onKeyDown:e=>{const{keyCode:t}=e;t===yc.ENTER&&(e.preventDefault(),l(o,kd()?e.metaKey:e.ctrlKey),a(null))},onFocus:()=>{p.current||a(o)},onMouseEnter:()=>{p.current||a(o)},onMouseLeave:()=>a(null),onBlur:()=>a(null)},d),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-icon",style:m},(0,s.createElement)(Dc,{icon:o.icon,showColors:!0})),(0,s.createElement)("span",{className:"block-editor-block-types-list__item-title"},o.title)))}))})),yd=(0,s.forwardRef)((function(e,t){const[n,o]=(0,s.useState)(!1);return(0,s.useEffect)((()=>{n&&(0,Ht.speak)((0,g.__)("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))})),Ed=(0,s.forwardRef)((function(e,t){const n=(0,s.useContext)(fd);return(0,s.createElement)(p.__unstableCompositeGroup,i({state:n,role:"presentation",ref:t},e))})),Cd=function(e){let{items:t=[],onSelect:n,onHover:o=(()=>{}),children:l,label:i,isDraggable:a=!0}=e;return(0,s.createElement)(yd,{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)(Ed,{key:t},e.map(((e,l)=>(0,s.createElement)(_d,{key:e.id,item:e,className:(0,r.getBlockMenuDefaultClassName)(e.id),onSelect:n,onHover:o,isDraggable:a,isFirst:0===t&&0===l})))))),l)},Sd=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))},wd=(e,t)=>{const{categories:n,collections:o,items:l}=(0,m.useSelect)((t=>{const{getInserterItems:n}=t(Qn),{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])]},Bd=function(e){let{children:t}=e;const n=(0,p.__unstableUseCompositeState)({shift:!0,wrap:"horizontal"});return(0,s.createElement)(fd.Provider,{value:n},t)};const Id=[];var xd=function(e){let{rootClientId:t,onInsert:n,onHover:o,showMostUsedBlocks:r}=e;const[l,i,a,c]=wd(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]),f=(0,s.useMemo)((()=>(0,u.flow)((e=>e.filter((e=>e.category&&"reusable"!==e.category))),(e=>(0,u.groupBy)(e,"category")))(l)),[l]),h=(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,k=(0,s.useMemo)((()=>Object.entries(a)),[a]),_=(0,d.useAsyncList)(b?k:Id);return(0,s.createElement)(Bd,null,(0,s.createElement)("div",null,r&&!!p.length&&(0,s.createElement)(Sd,{title:(0,g._x)("Most used","blocks")},(0,s.createElement)(Cd,{items:p,onSelect:c,onHover:o,label:(0,g._x)("Most used","blocks")})),(0,u.map)(v,(e=>{const t=f[e.slug];return t&&t.length?(0,s.createElement)(Sd,{key:e.slug,title:e.title,icon:e.icon},(0,s.createElement)(Cd,{items:t,onSelect:c,onHover:o,label:e.title})):null})),b&&m.length>0&&(0,s.createElement)(Sd,{className:"block-editor-inserter__uncategorized-blocks-panel",title:(0,g.__)("Uncategorized")},(0,s.createElement)(Cd,{items:m,onSelect:c,onHover:o,label:(0,g.__)("Uncategorized")})),(0,u.map)(_,(e=>{let[t,n]=e;const r=h[t];return r&&r.length?(0,s.createElement)(Sd,{key:t,title:n.title,icon:n.icon},(0,s.createElement)(Cd,{items:r,onSelect:c,onHover:o,label:n.title})):null}))))},Td=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,g.__)("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,g.__)("Explore all patterns"),onClick:()=>r()},(0,g._x)("Explore","Label for showing all block patterns"))))},Nd=window.wp.notices,Pd=(e,t)=>{const{patternCategories:n,patterns:o}=(0,m.useSelect)((e=>{const{__experimentalGetAllowedPatterns:n,getSettings:o}=e(Qn);return{patterns:n(t),patternCategories:o().__experimentalBlockPatternCategories}}),[t]),{createSuccessNotice:l}=(0,m.useDispatch)(Nd.store);return[o,n,(0,s.useCallback)(((t,n)=>{e((0,u.map)(n,(e=>(0,r.cloneBlock)(e))),t.name),l((0,g.sprintf)(
13
  /* translators: %s: block pattern title. */
14
+ (0,g.__)('Block pattern "%s" inserted.'),t.title),{type:"snackbar"})}),[])]};function Md(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)(Md)}`;return(0,s.createElement)(bd,{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)(dd,{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 Rd(){return(0,s.createElement)("div",{className:"block-editor-block-patterns-list__item is-placeholder"})}var Ld=function(e){let{isDraggable:t,blockPatterns:n,shownPatterns:o,onClickPattern:r,orientation:l,label:a=(0,g.__)("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)(Md,{key:e.name,pattern:e,onClick:r,isDraggable:t,composite:c}):(0,s.createElement)(Rd,{key:e.name}))))};function Ad(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 Dd(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,g.__)("Search for patterns"),placeholder:(0,g.__)("Search")}))}var Od=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)(Dd,{filterValue:r,setFilterValue:l}),!r&&(0,s.createElement)(Ad,{selectedCategory:t,patternCategories:n,onClickCategory:o}))},Fd=function(){return(0,s.createElement)("div",{className:"block-editor-inserter__no-results"},(0,s.createElement)(Ir,{className:"block-editor-inserter__no-results-icon",icon:Ac}),(0,s.createElement)("p",null,(0,g.__)("No results found.")))},zd=function(e){let{rootClientId:t="",insertionIndex:n,clientId:o,isAppender:l,onSelect:i,shouldFocusBlock:a=!0}=e;const{getSelectedBlock:c}=(0,m.useSelect)(Qn),{destinationRootClientId:d,destinationIndex:p}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:r,getBlockRootClientId:i,getBlockIndex:s,getBlockOrder:a}=e(Qn),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:f,insertBlocks:h,showInsertionPoint:v,hideInsertionPoint:b}=(0,m.useDispatch)(Qn),k=(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)?f(o.clientId,e,null,a||n?0:null,t):h(e,p,d,!0,a||n?0:null,t);const s=(0,g.sprintf)(// translators: %d: the name of the block that has been added
15
+ (0,g._n)("%d block added.","%d blocks added.",(0,u.castArray)(e).length),(0,u.castArray)(e).length);(0,Ht.speak)(s),i&&i()}),[l,c,f,h,d,p,i,a]),_=(0,s.useCallback)((e=>{e?v(d,p):b()}),[v,b,d,p]);return[d,k,_]};const Vd=e=>e.name||"",Hd=e=>e.title,Gd=e=>e.description||"",Ud=e=>e.keywords||[],Wd=e=>e.category,$d=()=>null;function jd(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e=(0,u.deburr)(e),e=e.replace(/^\//,""),e=e.toLowerCase(),e}const Kd=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return(0,u.words)(jd(e))},qd=(e,t)=>(0,u.differenceWith)(e,Kd(t),((e,t)=>t.includes(e))),Yd=(e,t,n,o)=>0===Kd(o).length?e:Qd(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}}),Qd=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=Kd(t);if(0===o.length)return e;const r=e.map((e=>[e,Zd(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 Zd(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const{getName:o=Vd,getTitle:r=Hd,getDescription:l=Gd,getKeywords:i=Ud,getCategory:s=Wd,getCollection:a=$d}=n,c=o(e),d=r(e),p=l(e),m=i(e),f=s(e),g=a(e),h=jd(t),v=jd(d);let b=0;if(h===v)b+=30;else if(v.startsWith(h))b+=20;else{const e=[c,d,p,...m,f,g].join(" "),t=(0,u.words)(h);0===qd(t,e).length&&(b+=10)}return 0!==b&&c.startsWith("core/")&&(b+=c!==e.id?1:2),b}function Xd(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,g.sprintf)(
16
  /* translators: %d: number of patterns. %s: block pattern search query */
17
+ (0,g._n)('%1$d pattern found for "%2$s"','%1$d patterns found for "%2$s"',n),n,t)):null}var Jd=function(e){let{filterValue:t,selectedCategory:n,patternCategories:o}=e;const r=(0,d.useDebounce)(Ht.speak,500),[l,i]=zd({shouldFocusBlock:!0}),[a,,c]=Pd(i,l),u=(0,s.useMemo)((()=>o.map((e=>e.name))),[o]),p=(0,s.useMemo)((()=>t?Qd(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,g.sprintf)(
18
  /* translators: %d: number of results. */
19
+ (0,g._n)("%d result found.","%d results found.",e),e);r(n)}),[t,r]);const m=(0,d.useAsyncList)(p,{step:2}),f=!(null==p||!p.length);return(0,s.createElement)("div",{className:"block-editor-block-patterns-explorer__list"},f&&(0,s.createElement)(Xd,{filterValue:t,filteredBlockPatternsLength:p.length}),(0,s.createElement)(Bd,null,!f&&(0,s.createElement)(Fd,null),f&&(0,s.createElement)(Ld,{shownPatterns:m,blockPatterns:p,onClickPattern:c,isDraggable:!1})))};function ep(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)(Od,{selectedCategory:l,patternCategories:n,onClickCategory:i,filterValue:o,setFilterValue:r}),(0,s.createElement)(Jd,{filterValue:o,selectedCategory:l,patternCategories:n}))}var tp=function(e){let{onModalClose:t,...n}=e;return(0,s.createElement)(p.Modal,{title:(0,g.__)("Patterns"),closeLabel:(0,g.__)("Close"),onRequestClose:t,isFullScreen:!0},(0,s.createElement)(ep,n))};function np(e){let{rootClientId:t,onInsert:n,selectedCategory:o,populatedCategories:r}=e;const[l,,i]=Pd(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)(Ld,{shownPatterns:p,blockPatterns:c,onClickPattern:i,label:o.label,orientation:"vertical",isDraggable:!0})):null}var op=function(e){let{rootClientId:t,onInsert:n,onClickCategory:o,selectedCategory:r}=e;const[l,i]=(0,s.useState)(!1),[a,c]=Pd(),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,g._x)("Uncategorized")}),e}),[a,c]),p=r||d[0];return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Td,{selectedCategory:p,patternCategories:d,onClickCategory:o,openPatternExplorer:()=>i(!0)}),!l&&(0,s.createElement)(np,{rootClientId:t,onInsert:n,selectedCategory:p,populatedCategories:d}),l&&(0,s.createElement)(tp,{initialCategory:p,patternCategories:d,onModalClose:()=>i(!1)}))},rp=window.wp.url;function lp(e){let{onHover:t,onInsert:n,rootClientId:o}=e;const[r,,,l]=wd(o,n),i=(0,s.useMemo)((()=>r.filter((e=>{let{category:t}=e;return"reusable"===t}))),[r]);return 0===i.length?(0,s.createElement)(Fd,null):(0,s.createElement)(Sd,{title:(0,g.__)("Reusable blocks")},(0,s.createElement)(Cd,{items:i,onSelect:l,onHover:t,label:(0,g.__)("Reusable blocks")}))}var ip=function(e){let{rootClientId:t,onInsert:n,onHover:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(lp,{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,rp.addQueryArgs)("edit.php",{post_type:"wp_block"})},(0,g.__)("Manage Reusable blocks"))))};const{Fill:sp,Slot:ap}=(0,p.createSlotFill)("__unstableInserterMenuExtension");sp.Slot=ap;var cp=sp;const up=[];var dp=function(e){let{filterValue:t,onSelect:n,onHover:o,rootClientId:r,clientId:l,isAppender:i,__experimentalInsertionIndex:a,maxBlockPatterns:c,maxBlockTypes:m,showBlockDirectory:f=!1,isDraggable:h=!0,shouldFocusBlock:v=!0,prioritizePatterns:b}=e;const k=(0,d.useDebounce)(Ht.speak,500),[_,y]=zd({onSelect:n,rootClientId:r,clientId:l,isAppender:i,insertionIndex:a,shouldFocusBlock:v}),[E,C,S,w]=wd(_,y),[B,,I]=Pd(y,_),x=(0,s.useMemo)((()=>{if(0===c)return[];const e=Qd(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=Yd((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,g.sprintf)(
20
  /* translators: %d: number of results. */
21
+ (0,g._n)("%d result found.","%d results found.",e),e);k(n)}),[t,k]);const P=(0,d.useAsyncList)(N,{step:9}),M=(0,d.useAsyncList)(P.length===N.length?x:up),R=!(0,u.isEmpty)(N)||!(0,u.isEmpty)(x),L=!!N.length&&(0,s.createElement)(Sd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Blocks"))},(0,s.createElement)(Cd,{items:P,onSelect:w,onHover:o,label:(0,g.__)("Blocks"),isDraggable:h})),A=!!x.length&&(0,s.createElement)(Sd,{title:(0,s.createElement)(p.VisuallyHidden,null,(0,g.__)("Block Patterns"))},(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-patterns"},(0,s.createElement)(Ld,{shownPatterns:M,blockPatterns:x,onClickPattern:I,isDraggable:h})));return(0,s.createElement)(Bd,null,!f&&!R&&(0,s.createElement)(Fd,null),b?A:L,!!N.length&&!!x.length&&(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-separator"}),b?L:A,f&&(0,s.createElement)(cp.Slot,{fillProps:{onSelect:w,onHover:o,filterValue:t,hasItems:R,rootClientId:_}},(e=>e.length?e:R?null:(0,s.createElement)(Fd,null))))};const pp={name:"blocks",
22
  /* translators: Blocks tab title in the block inserter. */
23
+ title:(0,g.__)("Blocks")},mp={name:"patterns",
24
  /* translators: Patterns tab title in the block inserter. */
25
+ title:(0,g.__)("Patterns")},fp={name:"reusable",
26
  /* translators: Reusable blocks tab title in the block inserter. */
27
+ title:(0,g.__)("Reusable")};var gp=function(e){let{children:t,showPatterns:n=!1,showReusableBlocks:o=!1,onSelect:r}=e;const l=(0,s.useMemo)((()=>{const e=[pp];return n&&e.push(mp),o&&e.push(fp),e}),[pp,n,mp,o,fp]);return(0,s.createElement)(p.TabPanel,{className:"block-editor-inserter__tabs",tabs:l,onSelect:r},t)},hp=(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[f,h]=(0,s.useState)(u),[v,b]=(0,s.useState)(null),[k,_]=(0,s.useState)(null),[y,E,C]=zd({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(Qn);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=>{_(e)}),[_]),N=(0,s.useMemo)((()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:"block-editor-inserter__block-list"},(0,s.createElement)(xd,{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,g.__)("A tip for using the block editor")),(0,s.createElement)(Lc,null)))),[y,B,x,f,c,a]),P=(0,s.useMemo)((()=>(0,s.createElement)(op,{rootClientId:y,onInsert:I,onClickCategory:T,selectedCategory:k})),[y,I,T,k]),M=(0,s.useMemo)((()=>(0,s.createElement)(ip,{rootClientId:y,onInsert:B,onHover:x})),[y,B,x]),R=(0,s.useCallback)((e=>"blocks"===e.name?N:"patterns"===e.name?P:M),[N,P,M]),L=(0,s.useRef)();return(0,s.useImperativeHandle)(t,(()=>({focusSearch:()=>{L.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),h(e)},value:f,label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search"),ref:L}),!!f&&(0,s.createElement)(dp,{filterValue:f,onSelect:i,onHover:x,rootClientId:n,clientId:o,isAppender:r,__experimentalInsertionIndex:l,showBlockDirectory:!0,shouldFocusBlock:d}),!f&&(S||w)&&(0,s.createElement)(gp,{showPatterns:S,showReusableBlocks:w},R),!f&&!S&&!w&&N)),a&&v&&(0,s.createElement)(md,{item:v}))}));function vp(e){let{onSelect:t,rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:l}=e;const[i,a]=(0,s.useState)(""),[u,d]=zd({onSelect:t,rootClientId:n,clientId:o,isAppender:r}),[f]=wd(u,d),[h]=Pd(d,u),{setInserterIsOpened:v,insertionIndex:b}=(0,m.useSelect)((e=>{const{getSettings:t,getBlockIndex:n,getBlockCount:r}=e(Qn),l=t(),i=n(o),s=r();return{setInserterIsOpened:l.__experimentalSetIsInserterOpened,insertionIndex:-1===i?s:i}}),[o]),k=h.length&&(!!i||l),_=k&&h.length>6||f.length>6;(0,s.useEffect)((()=>{v&&v(!1)}),[v]);let y=0;return k&&(y=l?4:2),(0,s.createElement)("div",{className:c()("block-editor-inserter__quick-inserter",{"has-search":_,"has-expand":v})},_&&(0,s.createElement)(p.SearchControl,{className:"block-editor-inserter__search",value:i,onChange:e=>{a(e)},label:(0,g.__)("Search for blocks and patterns"),placeholder:(0,g.__)("Search")}),(0,s.createElement)("div",{className:"block-editor-inserter__quick-inserter-results"},(0,s.createElement)(dp,{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,g.__)("Browse all. This will open the main inserter panel in the editor toolbar.")},(0,g.__)("Browse all")))}const bp=e=>{let t,{onToggle:n,disabled:o,isOpen:r,blockTitle:l,hasSingleBlockType:a,toggleProps:c={},prioritizePatterns:u}=e;t=a?(0,g.sprintf)(// translators: %s: the name of the block when there is only one
28
+ (0,g._x)("Add %s","directly add the only allowed block"),l):u?(0,g.__)("Add pattern"):(0,g._x)("Add block","Generic label for block inserter button");const{onClick:d,...m}=c;return(0,s.createElement)(p.Button,i({icon:Mc,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 kp 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=bp,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)(vp,{onSelect:()=>{t()},rootClientId:n,clientId:o,isAppender:r,prioritizePatterns:a}):(0,s.createElement)(hp,{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,g.__)("Add a block"),renderToggle:this.renderToggle,renderContent:this.renderContent,onClose:l})}}var _p=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n,rootClientId:o}=t;const{getBlockRootClientId:l,hasInserterItems:i,__experimentalGetAllowedBlocks:s,__experimentalGetDirectInsertBlock:a,getBlockIndex:c,getBlockCount:d,getSettings:p}=e(Qn),{getBlockVariations:m}=e(r.store);o=o||l(n)||void 0;const f=s(o),g=a(o),h=c(n),v=d(),b=p(),k=1===(0,u.size)(f)&&0===(0,u.size)(m(f[0].name,"inserter"));let _=!1;return k&&(_=f[0]),{hasItems:i(o),hasSingleBlockType:k,blockTitle:_?_.title:"",allowedBlockType:_,directInsertBlock:g,rootClientId:o,prioritizePatterns:b.__experimentalPreferPatternsOnRoot&&!o&&h>0&&(h<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(Qn);let p;if(c){const e=function(e){const{getBlock:t,getPreviousBlockClientId:r}=o(Qn);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(Qn);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,g.sprintf)(// translators: %s: the name of the block that has been added
29
+ (0,g.__)("%s block added"),a.title);(0,Ht.speak)(m)}}})),(0,d.ifCondition)((e=>{let{hasItems:t,isAppender:n,rootClientId:o,clientId:r}=e;return t||!n&&!o&&!r}))])(kp),yp=(0,d.compose)((0,m.withSelect)(((e,t)=>{const{getBlockCount:n,getSettings:o,getTemplateLock:r}=e(Qn),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(Qn);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,Pc.decodeEntities)(r)||(0,g.__)("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,g.__)("Add default block"),className:"block-editor-default-block-appender__content",onKeyDown:e=>{yc.ENTER!==e.keyCode&&yc.SPACE!==e.keyCode||n()},onClick:()=>n(),onFocus:()=>{o&&n()}},o?i:"\ufeff"),(0,s.createElement)(_p,{rootClientId:l,position:"bottom right",isAppender:!0,__experimentalIsQuick:!0}))}));function Ep(e,t){let{rootClientId:n,className:o,onFocus:r,tabIndex:l}=e;return(0,s.createElement)(_p,{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,g.sprintf)(// translators: %s: the name of the block when there is only one
30
+ (0,g._x)("Add %s","directly add the only allowed block"),d):(0,g._x)("Add block","Generic label for block inserter button");const f=!m;let h=(0,s.createElement)(p.Button,{ref:t,onFocus:r,tabIndex:l,className:c()(o,"block-editor-button-block-appender"),onClick:i,"aria-haspopup":f?"true":void 0,"aria-expanded":f?u:void 0,disabled:a,label:n},!m&&(0,s.createElement)(p.VisuallyHidden,{as:"span"},n),(0,s.createElement)(Ir,{icon:Mc}));return(f||m)&&(h=(0,s.createElement)(p.Tooltip,{text:n},h)),h},isAppender:!0})}const Cp=(0,s.forwardRef)(((e,t)=>(H()("wp.blockEditor.ButtonBlockerAppender",{alternative:"wp.blockEditor.ButtonBlockAppender",since:"5.9"}),Ep(e,t))));var Sp=(0,s.forwardRef)(Ep),wp=(0,m.withSelect)(((e,t)=>{let{rootClientId:n}=t;const{canInsertBlockType:o,getTemplateLock:l,getSelectedBlockClientId:i}=e(Qn);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)(yp,{rootClientId:n}):(0,s.createElement)(Sp,{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)();var Bp=function(e){let{previousClientId:t,nextClientId:n,children:o,__unstablePopoverSlot:r,__unstableContentRef:l,...a}=e;const{orientation:u,rootClientId:d}=(0,m.useSelect)((e=>{var n;const{getBlockListSettings:o,getBlockRootClientId:r}=e(Qn),l=r(t);return{orientation:(null===(n=o(l))||void 0===n?void 0:n.orientation)||"vertical",rootClientId:l}}),[t]),f=ko(t),h=ko(n),v="vertical"===u,b=(0,s.useMemo)((()=>{if(!f&&!h)return{};const e=f?f.getBoundingClientRect():null,t=h?h.getBoundingClientRect():null;if(v)return{width:f?f.offsetWidth:h.offsetWidth,height:t&&e?t.top-e.bottom:0};let n=0;return e&&t&&(n=(0,g.isRTL)()?e.left-t.right:t.left-e.right),{width:n,height:f?f.offsetHeight:h.offsetHeight}}),[f,h,v]),k=(0,s.useCallback)((()=>{if(!f&&!h)return{};const{ownerDocument:e}=f||h,t=f?f.getBoundingClientRect():null,n=h?h.getBoundingClientRect():null;return v?(0,g.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,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,ownerDocument:e}:(0,g.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,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,ownerDocument:e}}),[f,h]),_=zo(l);return f&&h?(0,s.createElement)(p.Popover,i({ref:_,noArrow:!0,animate:!1,getAnchorRect:k,focusOnMount:!1,__unstableSlotName:r||null,key:n+"--"+d},a,{className:c()("block-editor-block-popover",a.className)}),(0,s.createElement)("div",{style:b},o)):null};const Ip=(0,s.createContext)();function xp(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const{selectBlock:o,hideInsertionPoint:r}=(0,m.useDispatch)(Qn),l=(0,s.useContext)(Ip),i=(0,s.useRef)(),{orientation:a,previousClientId:u,nextClientId:f,rootClientId:g,isInserterShown:h}=(0,m.useSelect)((e=>{var t;const{getBlockOrder:n,getBlockListSettings:o,getBlockInsertionPoint:r,isBlockBeingDragged:l,getPreviousBlockClientId:i,getNextBlockClientId:s}=e(Qn),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:h?.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)(Bp,{previousClientId:u,nextClientId:f,__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&&f&&o(f,-1)},onFocus:function(e){e.target!==i.current&&(l.current=!0)},className:c()(y,{"is-with-inserter":h}),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"}),h&&(0,s.createElement)(p.__unstableMotion.div,{variants:_,className:c()("block-editor-block-list__insertion-point-inserter")},(0,s.createElement)(_p,{position:"bottom center",clientId:f,rootClientId:g,__experimentalIsQuick:!0,onToggle:e=>{l.current=e},onSelectOrClose:()=>{l.current=!1}}))))}function Tp(e){let{children:t,...n}=e;const o=(0,m.useSelect)((e=>e(Qn).isBlockInsertionPointVisible()),[]);return(0,s.createElement)(Ip.Provider,{value:(0,s.useRef)(!1)},o&&(0,s.createElement)(xp,n),t)}function Np(){const e=(0,s.useContext)(Ip),t=(0,m.useSelect)((e=>e(Qn).getSettings().hasReducedUI),[]),{getBlockListSettings:n,getBlockRootClientId:o,getBlockIndex:r,isBlockInsertionPointVisible:l,isMultiSelecting:i,getSelectedBlockClientIds:a,getTemplateLock:c}=(0,m.useSelect)(Qn),{showInsertionPoint:u,hideInsertionPoint:p}=(0,m.useDispatch)(Qn);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",f=t.target.getBoundingClientRect(),g=t.clientY-f.top,h=t.clientX-f.left;let v=Array.from(t.target.children).find((e=>e.classList.contains("wp-block")&&"vertical"===m&&e.offsetTop>g||e.classList.contains("wp-block")&&"horizontal"===m&&e.offsetLeft>h));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.overlay-active"))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 Pp="undefined"==typeof window?e=>{setTimeout((()=>e(Date.now())),0)}:window.requestIdleCallback||window.requestAnimationFrame,Mp="undefined"==typeof window?clearTimeout:window.cancelIdleCallback||window.cancelAnimationFrame;function Rp(e){return(0,m.useSelect)((t=>{if(!e)return null;const{getBlockName:n,getBlockAttributes:o}=t(Qn),{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 Lp(e,t){const{attributes:n,name:o,reusableBlockTitle:l}=(0,m.useSelect)((t=>{if(!e)return{};const{getBlockName:n,getBlockAttributes:o,__experimentalGetReusableBlockTitle:l}=t(Qn),i=n(e);if(!i)return{};const s=(0,r.isReusableBlock)((0,r.getBlockType)(i));return{attributes:o(e),name:i,reusableBlockTitle:s&&l(o(e).ref)}}),[e]),i=Rp(e);if(!o||!i)return null;const s=(0,r.getBlockType)(o),a=s?(0,r.__experimentalGetBlockLabel)(s,n):null,c=l||a,d=c&&c!==s.title?c:i.title;return t&&t>0?(0,u.truncate)(d,{length:t}):d}function Ap(e){let{clientId:t,maximumLength:n}=e;return Lp(t,n)}var Dp=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(Qn),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),[f,g,h]=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,Fo.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)(Qn);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,f(e),l&&l()},onDragOver:g,onDragEnd:()=>{b(),d.current=!1,h(),i&&i()},__experimentalDragComponent:(0,s.createElement)(vd,{count:n.length,icon:u})},(e=>{let{onDraggableStart:n,onDraggableEnd:o}=e;return t({draggable:!0,onDragStart:n,onDragEnd:o})}))},Op=function(e){let{clientId:t,rootClientId:n}=e;const o=Rp(t),l=(0,m.useSelect)((e=>{var o;const{getBlock:r,getBlockIndex:l,hasBlockMovingClientId:i,getBlockListSettings:s}=e(Qn),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:f,orientation:h}=l,{setNavigationMode:v,removeBlock:b}=(0,m.useDispatch)(Qn),k=(0,s.useRef)(),_=(0,r.getBlockType)(u),y=(0,r.__experimentalGetAccessibleBlockLabel)(_,d,a+1,h);(0,s.useEffect)((()=>{k.current.focus(),(0,Ht.speak)(y)}),[y]);const E=ko(t),{hasBlockMovingClientId:C,getBlockIndex:S,getBlockRootClientId:w,getClientIdsOfDescendants:B,getSelectedBlockClientId:I,getMultiSelectedBlocksEndClientId:x,getPreviousBlockClientId:T,getNextBlockClientId:N,isNavigationMode:P}=(0,m.useSelect)(Qn),{selectBlock:M,clearSelectedBlock:R,setBlockMovingClientId:L,moveBlockToPosition:A}=(0,m.useDispatch)(Qn),D=c()("block-editor-block-list__block-selection-button",{"is-block-moving-mode":!!f}),O=(0,g.__)("Drag");return(0,s.createElement)("div",{className:D},(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)(Dc,{icon:null==o?void 0:o.icon,showColors:!0})),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(Dp,{clientIds:[t]},(e=>(0,s.createElement)(p.Button,i({icon:hd,className:"block-selection-button_drag-handle","aria-hidden":"true",label:O,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===yc.UP,r=n===yc.DOWN,l=n===yc.LEFT,i=n===yc.RIGHT,s=n===yc.TAB,a=n===yc.ESCAPE,c=n===yc.ENTER,u=n===yc.SPACE,d=e.shiftKey;if(n===yc.BACKSPACE||n===yc.DELETE)return b(t),void e.preventDefault();const p=I(),m=x(),f=T(m||p),g=N(m||p),h=s&&d||o,v=s&&!d||r,k=l,_=i;let y;if(h)y=f;else if(v)y=g;else if(k){var D;y=null!==(D=w(p))&&void 0!==D?D:p}else if(_){var O;y=null!==(O=B([p])[0])&&void 0!==O?O:p}const F=C();if(a&&P()&&(R(),e.preventDefault()),a&&F&&!e.defaultPrevented&&(L(null),e.preventDefault()),(c||u)&&F){const e=w(F),t=w(p),n=S(F);let o=S(p);n<o&&e===t&&(o-=1),A(F,e,t,o),M(F),L(null)}if(v||h||k||_)if(y)e.preventDefault(),M(y);else if(s&&p){let t;if(v){t=E;do{t=Fo.focus.tabbable.findNext(t)}while(t&&E.contains(t));t||(t=E.ownerDocument.defaultView.frameElement,t=Fo.focus.tabbable.findNext(t))}else t=Fo.focus.tabbable.findPrevious(E);t&&(e.preventDefault(),t.focus(),R())}},label:y,className:"block-selection-button_select-button"},(0,s.createElement)(Ap,{clientId:t,maximumLength:35})))))};function Fp(e){return Array.from(e.querySelectorAll("[data-toolbar-item]"))}var zp=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=!Fo.focus.tabbable.find(e.current).some((e=>!("toolbarItem"in e.dataset)));t||H()("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]=Fo.focus.tabbable.find(e);t&&t.focus()}(e.current)}),[]);(0,Kc.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=Fp(e.current),n=i||0;var o;t[n]&&(o=e.current).contains(o.ownerDocument.activeElement)&&t[n].focus()}))),()=>{if(window.cancelAnimationFrame(t),!r||!e.current)return;const n=Fp(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)},Vp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})),Hp=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})),Gp=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M6.5 12.4L12 8l5.5 4.4-.9 1.2L12 10l-4.5 3.6-1-1.2z"})),Up=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M17.5 11.6L12 16l-5.5-4.4.9-1.2L12 14l4.5-3.6 1 1.2z"}));const Wp=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?Vp:Hp:Gp:"down"===e?"horizontal"===t?(0,g.isRTL)()?Hp:Vp:Up:null,$p=(e,t)=>"up"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move right"):(0,g.__)("Move left"):(0,g.__)("Move up"):"down"===e?"horizontal"===t?(0,g.isRTL)()?(0,g.__)("Move left"):(0,g.__)("Move right"):(0,g.__)("Move down"):null,jp=(0,s.forwardRef)(((e,t)=>{let{clientIds:n,direction:o,orientation:l,...a}=e;const f=(0,d.useInstanceId)(jp),h=(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(Qn),d=(0,u.castArray)(n),p=(0,u.first)(d),m=i(p),f=t(p),g=t((0,u.last)(d)),h=s(m),v=a(p),b=0===f,k=g===h.length-1,{orientation:_}=c(m)||{};return{blockType:v?(0,r.getBlockType)(v.name):null,isDisabled:"up"===o?b:k,rootClientId:m,firstIndex:f,isFirst:b,isLast:k,orientation:l||_}}),[n,o]),{moveBlocksDown:S,moveBlocksUp:w}=(0,m.useDispatch)(Qn),B="up"===o?w:S,I=`block-editor-block-mover-button__description-${f}`;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:Wp(o,C),label:$p(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,a=e=>"up"===e?"horizontal"===i?(0,g.isRTL)()?"right":"left":"up":"down"===e?"horizontal"===i?(0,g.isRTL)()?"left":"right":"down":null;if(e>1)return function(e,t,n,o,r){const l=t+1;return r<0&&n?(0,g.__)("Blocks cannot be moved up as they are already at the top"):r>0&&o?(0,g.__)("Blocks cannot be moved down as they are already at the bottom"):r<0&&!n?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
31
  (0,g._n)("Move %1$d block from position %2$d up by one place","Move %1$d blocks from position %2$d up by one place",e),e,l):r>0&&!o?(0,g.sprintf)(// translators: 1: Number of selected blocks, 2: Position of selected blocks
32
  (0,g._n)("Move %1$d block from position %2$d down by one place","Move %1$d blocks from position %2$d down by one place",e),e,l):void 0}(e,n,o,r,l);if(o&&r)return(0,g.sprintf)(// translators: %s: Type of block (i.e. Text, Image etc)
33
  (0,g.__)("Block %s is the only block, and cannot be moved"),t);if(l>0&&!r){const e=a("down");if("down"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc), 2: Position of selected block, 3: New position
42
  (0,g.__)("Move %1$s block from position %2$d right to position %3$d"),t,s,s-1)}if(l<0&&o){const e=a("up");if("up"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
43
  (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved up"),t);if("left"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
44
  (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved left"),t);if("right"===e)return(0,g.sprintf)(// translators: 1: Type of block (i.e. Text, Image etc)
45
+ (0,g.__)("Block %1$s is at the beginning of the content and can’t be moved right"),t)}}(h,v&&v.title,E,_,y,"up"===o?-1:1,C)))})),Kp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(jp,i({direction:"up",ref:t},e)))),qp=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(jp,i({direction:"down",ref:t},e))));var Yp=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(Qn),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)),f=i(d);return{canMove:l(t,d),rootClientId:d,isFirst:0===p,isLast:m===f.length-1,orientation:null===(n=r(d))||void 0===n?void 0:n.orientation}}),[t]);if(!o||l&&a&&!r)return null;const f=(0,g.__)("Drag");return(0,s.createElement)(p.ToolbarGroup,{className:c()("block-editor-block-mover",{"is-horizontal":"horizontal"===d})},!n&&(0,s.createElement)(Dp,{clientIds:t},(e=>(0,s.createElement)(p.Button,i({icon:hd,className:"block-editor-block-mover__drag-handle","aria-hidden":"true",label:f,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)(Kp,i({clientIds:t},e)))),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(qp,i({clientIds:t},e))))))};const{clearTimeout:Qp,setTimeout:Zp}=window,Xp=200;function Jp(e){let{ref:t,isFocused:n,debounceTimeout:o=Xp,onChange:r=u.noop}=e;const[l,i]=(0,s.useState)(!1),a=(0,s.useRef)(),c=e=>{null!=t&&t.current&&i(e),r(e)},d=()=>{const e=a.current;e&&Qp&&Qp(e)};return(0,s.useEffect)((()=>()=>{c(!1),d()}),[]),{showMovers:l,debouncedShowMovers:e=>{e&&e.stopPropagation(),d(),l||c(!0)},debouncedHideMovers:e=>{e&&e.stopPropagation(),d(),a.current=Zp((()=>{(()=>{const e=(null==t?void 0:t.current)&&t.current.matches(":hover");return!n&&!e})()&&c(!1)}),o)}}}function em(e){let{ref:t,debounceTimeout:n=Xp,onChange:o=u.noop}=e;const[r,l]=(0,s.useState)(!1),{showMovers:i,debouncedShowMovers:a,debouncedHideMovers:c}=Jp({ref:t,debounceTimeout:n,isFocused:r,onChange:o}),d=(0,s.useRef)(!1),p=()=>(null==t?void 0:t.current)&&t.current.contains(t.current.ownerDocument.activeElement);return(0,s.useEffect)((()=>{const e=t.current,n=()=>{p()&&(l(!0),a())},o=()=>{p()||(l(!1),c())};return e&&!d.current&&(e.addEventListener("focus",n,!0),e.addEventListener("blur",o,!0),d.current=!0),()=>{e&&(e.removeEventListener("focus",n),e.removeEventListener("blur",o))}}),[t,d,l,a,c]),{showMovers:i,gestures:{onMouseMove:a,onMouseLeave:c}}}function tm(){const{selectBlock:e,toggleBlockHighlight:t}=(0,m.useDispatch)(Qn),{firstParentClientId:n,shouldHide:o,hasReducedUI:l}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockParents:n,getSelectedBlockClientId:o,getSettings:l}=e(Qn),{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=Rp(n),c=(0,s.useRef)(),{gestures:u}=em({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,g.sprintf)(
46
  /* translators: %s: Name of the block's parent. */
47
+ (0,g.__)("Select %s"),a.title),showTooltip:!0,icon:(0,s.createElement)(Dc,{icon:a.icon})}))}var nm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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 om(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,g.__)("Preview")),(0,s.createElement)(dd,{viewportWidth:500,blocks:t})))))}var rm=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,g.__)("Transform to"),className:t},i&&(0,s.createElement)(om,{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)(Dc,{icon:n,showColors:!0}),l)})))},lm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.7 7.1l-6.3 8.5-3.3-2.5-.9 1.2 4.5 3.4L17.9 8z"})),im=window.wp.tokenList,sm=n.n(im);function am(e,t,n){const o=new(sm())(e);return t&&o.remove("is-style-"+t.name),o.add("is-style-"+n.name),o.value}function cm(e){return(0,u.find)(e,"isDefault")}function um(e){let{clientId:t,onSwitch:n}=e;const{styles:o,block:l,blockType:i,className:a}=(0,m.useSelect)((e=>{const{getBlock:n}=e(Qn),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)(Qn),d=function(e){return e&&0!==e.length?cm(e)?e:[{name:"default",label:(0,g._x)("Default","block style"),isDefault:!0},...e]:[]}(o),p=function(e,t){for(const n of new(sm())(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),f=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=am(a,p,e);c(t,{className:o}),n()},stylesToRender:d,activeStyle:p,genericPreviewBlock:f,className:a}}function dm(e){let{clientId:t,onSwitch:n=u.noop}=e;const{onSelect:o,stylesToRender:r,activeStyle:l}=um({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?lm:null,onClick:()=>o(e)},(0,s.createElement)(p.__experimentalText,{as:"span",limit:18,ellipsizeMode:"tail",truncate:!0},t))}))):null}function pm(e){let{hoveredBlock:t,onSwitch:n}=e;const{clientId:o}=t;return(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Styles"),className:"block-editor-block-switcher__styles__menugroup"},(0,s.createElement)(dm,{clientId:o,onSwitch:n}))}const mm=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=mm(e,t,n);if(o)return o}}},fm=(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 gm(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,g.__)("Preview")),(0,s.createElement)(hm,{patterns:t,onSelect:n})))))}function hm(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,g.__)("Patterns list")}),t.map((e=>(0,s.createElement)(vm,{key:e.name,pattern:e,onSelect:n,composite:o}))))}function vm(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-switcher__preview-patterns-container",l=(0,d.useInstanceId)(vm,`${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)(dd,{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))}var bm=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=mm(r,t.name,o);if(n){e=!0,o.add(n.clientId),fm(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)(gm,{patterns:a,onSelect:o}),(0,s.createElement)(p.MenuItem,{onClick:e=>{e.preventDefault(),i(!l)},icon:Vp},(0,g.__)("Patterns"))):null};const km=e=>{let{clientIds:t,blocks:n}=e;const{replaceBlocks:o}=(0,m.useDispatch)(Qn),l=Rp(n[0].clientId),{possibleBlockTransformations:i,canRemove:a,hasBlockStyles:c,icon:d,blockTitle:f,patterns:h}=(0,m.useSelect)((e=>{var o;const{getBlockRootClientId:i,getBlockTransformItems:s,__experimentalGetPatternTransformItems:a}=e(Qn),{getBlockStyles:c,getBlockType:d}=e(r.store),{canRemoveBlocks:p}=e(Qn),m=i((0,u.castArray)(t)[0]),[{name:f}]=n,g=1===n.length,h=g&&c(f);let v;var b;g?v=null==l?void 0:l.icon:v=1===(0,u.uniq)(n.map((e=>{let{name:t}=e;return t}))).length?null===(b=d(f))||void 0===b?void 0:b.icon:nm;return{possibleBlockTransformations:s(n,m),canRemove:p(t,m),hasBlockStyles:!(null==h||!h.length),icon:v,blockTitle:null===(o=d(f))||void 0===o?void 0:o.title,patterns:a(n,m)}}),[t,n,null==l?void 0:l.icon]),v=1===n.length&&(0,r.isReusableBlock)(n[0]),b=1===n.length&&(0,r.isTemplatePart)(n[0]),k=!!i.length&&a,_=!(null==h||!h.length)&&a;if(!c&&!k)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)(Dc,{icon:d,showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Ap,{clientId:t,maximumLength:35})))}));const y=f,E=1===n.length?(0,g.sprintf)(
48
  /* translators: %s: block title. */
49
  (0,g.__)("%s: Change block type or style"),f):(0,g.sprintf)(
50
  /* translators: %d: number of blocks. */
51
+ (0,g._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)(Dc,{icon:d,className:"block-editor-block-switcher__toggle",showColors:!0}),(v||b)&&(0,s.createElement)("span",{className:"block-editor-block-switcher__toggle-text"},(0,s.createElement)(Ap,{clientId:t,maximumLength:35}))),toggleProps:{describedBy:E,...e},menuProps:{orientation:"both"}},(e=>{let{onClose:l}=e;return C&&(0,s.createElement)("div",{className:"block-editor-block-switcher__container"},_&&(0,s.createElement)(bm,{blocks:n,patterns:h,onSelect:e=>{(e=>{o(t,e)})(e),l()}}),k&&(0,s.createElement)(rm,{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)(pm,{hoveredBlock:n[0],onSwitch:l}))})))))};var _m=e=>{let{clientIds:t}=e;const n=(0,m.useSelect)((e=>e(Qn).getBlocksByClientId(t)),[t]);return!n.length||n.some((e=>!e))?null:(0,s.createElement)(km,{clientIds:t,blocks:n})};const{Fill:ym,Slot:Em}=(0,p.createSlotFill)("__unstableBlockToolbarLastItem");ym.Slot=Em;var Cm=ym,Sm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})),wm=window.wp.blob;function Bm(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;return 1!==(null===(n=t.match(e))||void 0===n?void 0:n.length)}return!1}function Im(){const{getBlockName:e}=(0,m.useSelect)(Qn),{getBlockType:t}=(0,m.useSelect)(r.store),{createSuccessNotice:n}=(0,m.useDispatch)(Nd.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,g.sprintf)(// Translators: Name of the block being copied, e.g. "Paragraph".
52
  (0,g.__)('Copied "%s" to clipboard.'),s):(0,g.sprintf)(// Translators: Name of the block being cut, e.g. "Paragraph".
53
  (0,g.__)('Moved "%s" to clipboard.'),s)}else l="copy"===o?(0,g.sprintf)(// Translators: %d: Number of blocks being copied.
54
  (0,g._n)("Copied %d block to clipboard.","Copied %d blocks to clipboard.",r.length),r.length):(0,g.sprintf)(// Translators: %d: Number of blocks being cut.
55
+ (0,g._n)("Moved %d block to clipboard.","Moved %d blocks to clipboard.",r.length),r.length);n(l,{type:"snackbar"})}),[])}function xm(){const{getBlocksByClientId:e,getSelectedBlockClientIds:t,hasMultiSelection:n,getSettings:o,__unstableIsFullySelected:l,__unstableIsSelectionCollapsed:i,__unstableIsSelectionMergeable:s,__unstableGetSelectedBlocksWithPartialSelection:a}=(0,m.useSelect)(Qn),{flashBlock:c,removeBlocks:u,replaceBlocks:p,__unstableDeleteSelection:f,__unstableExpandSelection:g}=(0,m.useDispatch)(Qn),h=Im();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,Fo.documentHasUncollapsedSelection)(t):(0,Fo.documentHasSelection)(t))return}if(!d.contains(m.target.ownerDocument.activeElement))return;const b=m.defaultPrevented;m.preventDefault();const k=s(),_=i()||l(),y=!_&&!k;if("copy"===m.type||"cut"===m.type)if(1===v.length&&c(v[0]),y)g();else{let t;if(h(m.type,v),_)t=e(v);else{const[n,o]=a();t=[n,...e(v.slice(1,v.length-1)),o]}const n=(0,r.serialize)(t);m.clipboardData.setData("text/plain",n),m.clipboardData.setData("text/html",n)}if("cut"===m.type)_&&!y?u(v):f();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,Fo.getFilesFromDataTransfer)(t).filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)}));return r.length&&!Bm(r,o)&&(o=r.map((e=>`<img src="${(0,wm.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)}}),[])}var Tm=function(e){let{children:t}=e;return(0,s.createElement)("div",{ref:xm()},t)};function Nm(e){let{clientIds:t,children:n,__experimentalUpdateSelection:o}=e;const{canInsertBlockType:l,getBlockRootClientId:i,getBlocksByClientId:s,canMoveBlocks:a,canRemoveBlocks:c}=(0,m.useSelect)(Qn),{getDefaultBlockName:d,getGroupingBlockName:p}=(0,m.useSelect)(r.store),f=s(t),g=i(t[0]),h=(0,u.every)(f,(e=>!!e&&(0,r.hasBlockSupport)(e.name,"multiple",!0)&&l(e.name,g))),v=l(d(),g),b=a(t,g),k=c(t,g),{removeBlocks:_,replaceBlocks:y,duplicateBlocks:E,insertAfterBlock:C,insertBeforeBlock:S,flashBlock:w,setBlockMovingClientId:B,setNavigationMode:I,selectBlock:x}=(0,m.useDispatch)(Qn),T=Im();return n({canDuplicate:h,canInsertDefaultBlock:v,canMove:b,canRemove:k,rootClientId:g,blocks:f,onDuplicate:()=>E(t,o),onRemove:()=>_(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(!f.length)return;const e=p(),n=(0,r.switchToBlockType)(f,e);n&&y(t,n)},onUngroup(){if(!f.length)return;const e=f[0].innerBlocks;e.length&&y(t,e)},onCopy(){const e=f.map((e=>{let{clientId:t}=e;return t}));1===f.length&&w(e[0]),T("copy",e)}})}var Pm=(0,d.compose)([(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlock:o,getBlockMode:l,getSettings:i}=e(Qn),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=u.noop,clientId:o}=t;return{onToggleMode(){e(Qn).toggleBlockMode(o),n()}}}))])((function(e){let{blockType:t,mode:n,onToggleMode:o,small:l=!1,isCodeEditingEnabled:i=!0}=e;if(!(0,r.hasBlockSupport)(t,"html",!0)||!i)return null;const a="visual"===n?(0,g.__)("Edit as HTML"):(0,g.__)("Edit visually");return(0,s.createElement)(p.MenuItem,{onClick:o},!l&&a)})),Mm=(0,d.compose)((0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const o=e(Qn).getBlock(n);return{block:o,shouldRender:o&&"core/html"===o.name}})),(0,m.withDispatch)(((e,t)=>{let{block:n}=t;return{onClick:()=>e(Qn).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,g.__)("Convert to Blocks");return(0,s.createElement)(p.MenuItem,{onClick:n},!o&&r)}));const{Fill:Rm,Slot:Lm}=(0,p.createSlotFill)("__unstableBlockSettingsMenuFirstItem");Rm.Slot=Lm;var Am=Rm;function Dm(e){let{clientIds:t,isGroupable:n,isUngroupable:o,blocksSelection:l,groupingBlockName:i,onClose:a=(()=>{})}=e;const{replaceBlocks:c}=(0,m.useDispatch)(Qn);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,g._x)("Group","verb")),o&&(0,s.createElement)(p.MenuItem,{onClick:()=>{(()=>{const e=l[0].innerBlocks;e.length&&c(t,e)})(),a()}},(0,g._x)("Ungroup","Ungrouping blocks from within a Group block back into individual blocks within the Editor "))):null}function Om(){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(Qn),{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}}var Fm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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"})),zm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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 Vm(e){return(0,m.useSelect)((t=>{const{canEditBlock:n,canMoveBlock:o,canRemoveBlock:r,canLockBlockType:l,getBlockName:i,getBlockRootClientId:s}=t(Qn),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])}function Hm(e){let{clientId:t,onClose:n}=e;const[o,l]=(0,s.useState)({move:!1,remove:!1}),{canEdit:i,canMove:a,canRemove:c}=Vm(t),{isReusable:u}=(0,m.useSelect)((e=>{const{getBlockName:n}=e(Qn),o=n(t);return{isReusable:(0,r.isReusableBlock)((0,r.getBlockType)(o))}}),[t]),{updateBlockAttributes:f}=(0,m.useDispatch)(Qn),h=Rp(t),v=(0,d.useInstanceId)(Hm,"block-editor-block-lock-modal__options-title");(0,s.useEffect)((()=>{l({move:!a,remove:!c,...u?{edit:!i}:{}})}),[i,a,c,u]);const b=Object.values(o).every(Boolean),k=Object.values(o).some(Boolean)&&!b;return(0,s.createElement)(p.Modal,{title:(0,g.sprintf)(
56
  /* translators: %s: Name of the block. */
57
+ (0,g.__)("Lock %s"),h.title),overlayClassName:"block-editor-block-lock-modal",closeLabel:(0,g.__)("Close"),onRequestClose:n},(0,s.createElement)("form",{onSubmit:e=>{e.preventDefault(),f([t],{lock:o}),n()}},(0,s.createElement)("p",null,(0,g.__)("Choose specific attributes to restrict or lock all available options.")),(0,s.createElement)("div",{role:"group","aria-labelledby":v,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:v},(0,g.__)("Lock all")),checked:b,indeterminate:k,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,g.__)("Restrict editing"),(0,s.createElement)(p.Icon,{icon:o.edit?zm:Fm})),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,g.__)("Disable movement"),(0,s.createElement)(p.Icon,{icon:o.move?zm:Fm})),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,g.__)("Prevent removal"),(0,s.createElement)(p.Icon,{icon:o.remove?zm:Fm})),checked:o.remove,onChange:e=>l((t=>({...t,remove:e})))})))),(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,g.__)("Cancel"))),(0,s.createElement)(p.FlexItem,null,(0,s.createElement)(p.Button,{variant:"primary",type:"submit"},(0,g.__)("Apply"))))))}function Gm(e){let{clientId:t}=e;const{canLock:n,isLocked:o}=Vm(t),[r,l]=(0,s.useReducer)((e=>!e),!1);if(!n)return null;const i=o?(0,g.__)("Unlock"):(0,g.__)("Lock");return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{icon:o?Fm:zm,onClick:l},i),r&&(0,s.createElement)(Hm,{clientId:t,onClose:l}))}const{Fill:Um,Slot:Wm}=(0,p.createSlotFill)("BlockSettingsMenuControls");function $m(e){let{...t}=e;return(0,s.createElement)(p.__experimentalStyleProvider,{document:document},(0,s.createElement)(Um,t))}$m.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(Qn),l=null!==n?n:o();return{selectedBlocks:(0,u.map)((0,u.compact)(t(l)),(e=>e.name)),selectedClientIds:l,canRemove:r(l)}}),[n]),a=1===r.length,c=Om(),{isGroupable:d,isUngroupable:f}=c,g=(d||f)&&l;return(0,s.createElement)(Wm,{fillProps:{...t,selectedBlocks:o,selectedClientIds:r}},(e=>!(null!=e&&e.length)>0&&!g&&!a?null:(0,s.createElement)(p.MenuGroup,null,a&&(0,s.createElement)(Gm,{clientId:r[0]}),e,g&&(0,s.createElement)(Dm,i({},c,{onClose:null==t?void 0:t.onClose})))))};var jm=$m;const Km={className:"block-editor-block-settings-menu__popover",position:"bottom right",isAlternate:!0};function qm(e){let{blocks:t,onCopy:n}=e;const o=(0,d.useCopyToClipboard)((()=>(0,r.serialize)(t)),n);return(0,s.createElement)(p.MenuItem,{ref:o},(0,g.__)("Copy"))}var Ym=function(e){let{clientIds:t,__experimentalSelectBlock:n,children:o,...l}=e;const a=(0,u.castArray)(t),c=a.length,d=a[0],{firstParentClientId:f,hasReducedUI:h,onlyBlock:v,parentBlockType:b,previousBlockClientId:k,nextBlockClientId:_,selectedBlockClientIds:y}=(0,m.useSelect)((e=>{const{getBlockCount:t,getBlockName:n,getBlockParents:o,getPreviousBlockClientId:l,getNextBlockClientId:i,getSelectedBlockClientIds:s,getSettings:a}=e(Qn),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(Kc.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)(Qn),w=(0,s.useCallback)(n?async e=>{const t=await e;t&&t[0]&&n(t[0])}:u.noop,[n]),B=Lp(d,25),I=(0,s.useCallback)(n?()=>{const e=k||_;e&&y.includes(d)&&!y.includes(e)&&n(e)}:u.noop,[n,k,_,y]),x=(0,g.sprintf)(
58
  /* translators: %s: block name */
59
+ (0,g.__)("Remove %s"),B),T=1===c?x:(0,g.__)("Remove blocks"),N=(0,s.useRef)(),{gestures:P}=em({ref:N,onChange(e){e&&h||S(f,e)}});return(0,s.createElement)(Nm,{clientIds:t,__experimentalUpdateSelection:!n},(e=>{let{canDuplicate:n,canInsertDefaultBlock:r,canMove:a,canRemove:m,onDuplicate:h,onInsertAfter:k,onInsertBefore:_,onRemove:y,onCopy:S,onMoveTo:B,blocks:x}=e;return(0,s.createElement)(p.DropdownMenu,i({icon:Sm,label:(0,g.__)("Options"),className:"block-editor-block-settings-menu",popoverProps:Km,noIcons:!0},l),(e=>{let{onClose:l}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(Am.Slot,{fillProps:{onClose:l}}),void 0!==f&&(0,s.createElement)(p.MenuItem,i({},P,{ref:N,icon:(0,s.createElement)(Dc,{icon:b.icon}),onClick:()=>C(f)}),(0,g.sprintf)(
60
  /* translators: %s: Name of the block's parent. */
61
+ (0,g.__)("Select parent block (%s)"),b.title)),1===c&&(0,s.createElement)(Mm,{clientId:d}),(0,s.createElement)(qm,{blocks:x,onCopy:S}),n&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,h,w),shortcut:E.duplicate},(0,g.__)("Duplicate")),r&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,_),shortcut:E.insertBefore},(0,g.__)("Insert before")),(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,k),shortcut:E.insertAfter},(0,g.__)("Insert after"))),a&&!v&&(0,s.createElement)(p.MenuItem,{onClick:(0,u.flow)(l,B)},(0,g.__)("Move to")),1===c&&(0,s.createElement)(Pm,{clientId:d,onToggle:l})),(0,s.createElement)(jm.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)))}))}))},Qm=function(e){let{clientIds:t,...n}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Ym,i({clientIds:t,toggleProps:e},n)))))};function Zm(e){let{clientId:t}=e;const n=Rp(t),{canEdit:o,canMove:r,canRemove:l,canLock:i}=Vm(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:zm,label:(0,g.sprintf)(
62
  /* translators: %s: block name */
63
+ (0,g.__)("Unlock %s"),n.title),onClick:c})),a&&(0,s.createElement)(Hm,{clientId:t,onClose:c})):null}var Xm=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.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"})),Jm=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),ef=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));const tf={group:void 0,row:{type:"flex",flexWrap:"nowrap"},stack:{type:"flex",orientation:"vertical"}};var nf=function(){const{blocksSelection:e,clientIds:t,groupingBlockName:n,isGroupable:o}=Om(),{replaceBlocks:l}=(0,m.useDispatch)(Qn),{canRemove:i}=(0,m.useSelect)((e=>{const{canRemoveBlocks:n}=e(Qn);return{canRemove:n(t)}}),[t]),a=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=tf[o],l(t,i))};return o&&i?(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{icon:Xm,label:(0,g._x)("Group","verb"),onClick:a}),(0,s.createElement)(p.ToolbarButton,{icon:Jm,label:(0,g._x)("Row","single horizontal line"),onClick:()=>a("row")}),(0,s.createElement)(p.ToolbarButton,{icon:ef,label:(0,g._x)("Stack","verb"),onClick:()=>a("stack")})):null},of=(0,s.createContext)(""),rf=e=>{let{hideDragHandle:t}=e;const{blockClientIds:n,blockClientId:o,blockType:l,hasFixedToolbar:a,hasReducedUI:u,isValid:f,isVisual:g}=(0,m.useSelect)((e=>{const{getBlockName:t,getBlockMode:n,getSelectedBlockClientIds:o,isBlockValid:l,getBlockRootClientId:i,getSettings:s}=e(Qn),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:h}=(0,m.useDispatch)(Qn),v=(0,s.useRef)(),{showMovers:b,gestures:k}=em({ref:v,onChange(e){e&&u||h(o,e)}}),_=(0,d.useViewportMatch)("medium","<")||a;if(l&&!(0,r.hasBlockSupport)(l,"__experimentalToolbar",!0))return null;const y=_||b;if(0===n.length)return null;const E=f&&g,C=n.length>1,S=c()("block-editor-block-toolbar",y&&"is-showing-movers");return(0,s.createElement)("div",{className:S},!C&&!_&&(0,s.createElement)(tm,{clientIds:n}),(0,s.createElement)("div",i({ref:v},k),(E||C)&&(0,s.createElement)(p.ToolbarGroup,{className:"block-editor-block-toolbar__block-controls"},(0,s.createElement)(_m,{clientIds:n}),!C&&(0,s.createElement)(Zm,{clientId:n[0]}),(0,s.createElement)(Yp,{clientIds:n,hideDragHandle:t||u}))),E&&C&&(0,s.createElement)(nf,null),E&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(io.Slot,{group:"parent",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"block",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"inline",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(io.Slot,{group:"other",className:"block-editor-block-toolbar__slot"}),(0,s.createElement)(of.Provider,{value:null==l?void 0:l.name},(0,s.createElement)(Cm.Slot,null))),(0,s.createElement)(Qm,{clientIds:n}))},lf=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(Qn),{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:(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)(zp,i({focusOnMount:t,className:d
64
+ /* translators: accessibility text for the block toolbar */,"aria-label":(0,g.__)("Block tools")},o),(0,s.createElement)(rf,{hideDragHandle:n}))};function sf(e){const{isNavigationMode:t,isMultiSelecting:n,hasMultiSelection:o,isTyping:r,getSettings:l,getLastMultiSelectedBlockClientId:i}=e(Qn);return{isNavigationMode:t(),isMultiSelecting:n(),isTyping:r(),hasFixedToolbar:l().hasFixedToolbar,lastClientId:o()?i():null}}function af(e){let{clientId:t,rootClientId:n,isEmptyDefaultBlock:o,capturingClientId:r,__unstablePopoverSlot:l,__unstableContentRef:i}=e;const{isNavigationMode:a,isMultiSelecting:u,isTyping:p,hasFixedToolbar:f,lastClientId:g}=(0,m.useSelect)(sf,[]),h=(0,m.useSelect)((e=>{const{isBlockInsertionPointVisible:n,getBlockInsertionPoint:o,getBlockOrder:r}=e(Qn);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),[k,_]=(0,s.useState)(!1),{stopTyping:y}=(0,m.useDispatch)(Qn),E=a,C=!a&&!f&&v&&!u&&!(!p&&!a&&o)&&!p,S=!(a||C||f||o);(0,Kc.useShortcut)("core/block-editor/focus-toolbar",(()=>{b.current=!0,y(!0)}),{isDisabled:!S}),(0,s.useEffect)((()=>{b.current=!1}));const w=(0,s.useRef)();return E||C?(0,s.createElement)(Vo,{clientId:r||t,bottomClientId:g,className:c()("block-editor-block-list__block-popover",{"is-insertion-point-visible":h}),__unstablePopoverSlot:l,__unstableContentRef:i},C&&(0,s.createElement)("div",{onFocus:function(){_(!0)},onBlur:function(){_(!1)},tabIndex:-1,className:c()("block-editor-block-list__block-popover-inserter",{"is-visible":k})},(0,s.createElement)(_p,{clientId:t,rootClientId:n,__experimentalIsQuick:!0})),C&&(0,s.createElement)(lf,{focusOnMount:b.current,__experimentalInitialIndex:w.current,__experimentalOnIndexChange:e=>{w.current=e},key:t}),E&&(0,s.createElement)(Op,{clientId:t,rootClientId:n})):null}function cf(e){const{getSelectedBlockClientId:t,getFirstMultiSelectedBlockClientId:n,getBlockRootClientId:o,getBlock:l,getBlockParents:i,__experimentalGetBlockListSettingsForBlocks:s}=e(Qn),a=t()||n();if(!a)return;const{name:c,attributes:d={}}=l(a)||{},p=i(a),m=s(p),f=(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:f}}function uf(e){let{__unstablePopoverSlot:t,__unstableContentRef:n}=e;const o=(0,m.useSelect)(cf,[]);if(!o)return null;const{clientId:r,rootClientId:l,name:i,isEmptyDefaultBlock:a,capturingClientId:c}=o;return i?(0,s.createElement)(af,{clientId:r,rootClientId:l,isEmptyDefaultBlock:a,capturingClientId:c,__unstablePopoverSlot:t,__unstableContentRef:n}):null}function df(e){let{children:t}=e;const n=(0,s.useContext)(Ip),o=(0,s.useContext)(p.Disabled.Context);return n||o?t:(H()('wp.components.Popover.Slot name="block-toolbar"',{alternative:"wp.blockEditor.BlockTools",since:"5.8"}),(0,s.createElement)(Tp,{__unstablePopoverSlot:"block-toolbar"},(0,s.createElement)(uf,{__unstablePopoverSlot:"block-toolbar"}),t))}var pf=(0,d.createHigherOrderComponent)((e=>t=>{const{clientId:n}=eo();return(0,s.createElement)(e,i({},t,{clientId:n}))}),"withClientId"),mf=pf((e=>{let{clientId:t,showSeparator:n,isFloating:o,onAddBlock:r,isToggle:l}=e;return(0,s.createElement)(Sp,{className:c()({"block-list-appender__toggle":l}),rootClientId:t,showSeparator:n,isFloating:o,onAddBlock:r})})),ff=(0,d.compose)([pf,(0,m.withSelect)(((e,t)=>{let{clientId:n}=t;const{getBlockOrder:o}=e(Qn),r=o(n);return{lastBlockClientId:(0,u.last)(r)}}))])((e=>{let{clientId:t}=e;return(0,s.createElement)(yp,{rootClientId:t})}));const gf=new WeakMap;function hf(e,t){const n=(0,m.useSelect)((e=>e(Qn).getSettings().mediaUpload),[]),{canInsertBlockType:o,getBlockIndex:l,getClientIdsOfDescendants:i}=(0,m.useSelect)(Qn),{insertBlocks:s,moveBlocksToPosition:a,updateBlockAttributes:c,clearSelectedBlock:u}=(0,m.useDispatch)(Qn),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),f=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,Fo.getFilesFromDataTransfer)(e.dataTransfer),n=e.dataTransfer.getData("text/html");n?f(n):t.length?p(t):d(e)}}function vf(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 bf(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=vf(e,t,r);(void 0===n||l<n)&&(n=l,o=r)})),[n,o]}function kf(e,t,n){const o="horizontal"===n?["left","right"]:["top","bottom"],r=(0,g.isRTL)();let l,i;return e.forEach(((e,n)=>{const s=e.getBoundingClientRect(),[a,c]=bf(t,s,o);(void 0===i||a<i)&&(i=a,l=n+("bottom"===c||!r&&"right"===c||r&&"left"===c?1:0))})),l}function _f(){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(Qn);return"all"===n(e)}),[e]),{getBlockListSettings:r}=(0,m.useSelect)(Qn),{showInsertionPoint:l,hideInsertionPoint:i}=(0,m.useDispatch)(Qn),a=hf(e,t),c=(0,d.useThrottle)((0,s.useCallback)(((t,o)=>{var i;const s=kf(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 yf(e){const{clientId:t,allowedBlocks:n,__experimentalDefaultBlock:o,__experimentalDirectInsert:l,template:i,templateLock:a,wrapperRef:c,templateInsertUpdatesSelection:d,__experimentalCaptureToolbars:p,__experimentalAppenderTagName:f,renderAppender:g,orientation:h,placeholder:v,__experimentalLayout:b}=e;!function(e,t,n,o,r,l,i,a){const{updateBlockListSettings:c}=(0,m.useDispatch)(Qn),{blockListSettings:u,parentLock:d}=(0,m.useSelect)((t=>{const n=t(Qn).getBlockRootClientId(e);return{blockListSettings:t(Qn).getBlockListSettings(e),parentLock:t(Qn).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=Pr(null==a?void 0:a.type);t.orientation=e.getOrientation(a)}void 0!==n&&(t.__experimentalDefaultBlock=n),void 0!==o&&(t.__experimentalDirectInsert=o),Oo()(u,t)||c(e,t)}),[e,u,p,n,o,r,d,l,i,c,a])}(t,n,o,l,a,p,h,b),function(e,t,n,o){const{getSelectedBlocksInitialCaretPosition:l}=(0,m.useSelect)(Qn),{replaceInnerBlocks:i}=(0,m.useDispatch)(Qn),a=(0,m.useSelect)((t=>t(Qn).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(Qn).getBlock(t),o=(0,r.getBlockType)(n.name);if(o&&o.providesContext)return function(e,t){gf.has(t)||gf.set(t,new WeakMap);const n=gf.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)(al,{value:k},(0,s.createElement)(Pf,{rootClientId:t,renderAppender:g,__experimentalAppenderTagName:f,__experimentalLayout:b,wrapperRef:c,placeholder:v}))}function Ef(e){return Fc(e),(0,s.createElement)(yf,e)}const Cf=(0,s.forwardRef)(((e,t)=>{const n=Sf({ref:t},e);return(0,s.createElement)("div",{className:"block-editor-inner-blocks"},(0,s.createElement)("div",n))}));function Sf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{clientId:n}=eo(),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(Qn),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,_f({rootClientId:n})]),p={__experimentalCaptureToolbars:l,...t},f=p.value&&p.onChange?Ef:yf;return{...e,ref:u,className:c()(e.className,"block-editor-block-list__layout",{"has-overlay":a}),children:n?(0,s.createElement)(f,i({},p,{clientId:n})):(0,s.createElement)(Pf,t)}}Sf.save=r.__unstableGetInnerBlocksProps,Cf.DefaultBlockAppender=ff,Cf.ButtonBlockAppender=mf,Cf.Content=()=>Sf.save().children;var wf=Cf;const Bf=(0,s.createContext)(),If=(0,s.createContext)();function xf(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(Qn),{outlineMode:o,focusMode:r}=t();return{isOutlineMode:o,isFocusMode:r,isNavigationMode:n()}}),[]),p=Sf({ref:(0,d.useMergeRefs)([Hc(),Np(),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)(Bf.Provider,{value:o},(0,s.createElement)("div",p))}function Tf(e){return function(){const e=(0,m.useSelect)((e=>e(Qn).getSettings().__experimentalBlockPatterns),[]);(0,s.useEffect)((()=>{if(null==e||!e.length)return;let t,n=-1;const o=()=>{n++,n>=e.length||((0,m.select)(Qn).__experimentalGetParsedPattern(e[n].name),t=Pp(o))};return t=Pp(o),()=>Mp(t)}),[e])}(),(0,s.createElement)(df,null,(0,s.createElement)(Jn,{value:Zn},(0,s.createElement)(xf,e)))}function Nf(e){let{placeholder:t,rootClientId:n,renderAppender:o,__experimentalAppenderTagName:r,__experimentalLayout:l=Mr}=e;const[i,a]=(0,s.useState)(new Set),c=(0,s.useMemo)((()=>{const{IntersectionObserver:e}=window;if(e)return new e((e=>{a((t=>{const n=new Set(t);for(const t of e){const e=t.target.getAttribute("data-block");n[t.isIntersecting?"add":"delete"](e)}return n}))}))}),[a]),{order:u,selectedBlocks:d}=(0,m.useSelect)((e=>{const{getBlockOrder:t,getSelectedBlockClientIds:o}=e(Qn);return{order:t(n),selectedBlocks:o()}}),[n]);return(0,s.createElement)(Lr,{value:l},(0,s.createElement)(If.Provider,{value:c},u.map((e=>(0,s.createElement)(m.AsyncModeProvider,{key:e,value:!i.has(e)&&!d.includes(e)},(0,s.createElement)(Nc,{rootClientId:n,clientId:e}))))),u.length<1&&t,(0,s.createElement)(wp,{tagName:r,rootClientId:n,renderAppender:o}))}function Pf(e){return(0,s.createElement)(m.AsyncModeProvider,{value:!1},(0,s.createElement)(Nf,e))}function Mf(e){return[...e].sort(((t,n)=>e.filter((e=>e===n)).length-e.filter((e=>e===t)).length)).shift()}function Rf(){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=Mf(o),i=0===r||r?`${r}${l}`:void 0;return i}function Lf(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Rf(e),n="string"!=typeof e&&isNaN(parseFloat(t));return n}function Af(e){return!!e&&("string"==typeof e||!!Object.values(e).filter((e=>!!e||0===e)).length)}function Df(e){let{onChange:t,values:n,...o}=e;const r=Rf(n),l=Af(n)&&Lf(n),a=l?(0,g.__)("Mixed"):null;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{"aria-label":(0,g.__)("Border radius"),disableUnits:l,isOnly:!0,value:r,onChange:t,placeholder:a}))}Tf.__unstableElementContext=Bf;const Of={topLeft:(0,g.__)("Top left"),topRight:(0,g.__)("Top right"),bottomLeft:(0,g.__)("Bottom left"),bottomRight:(0,g.__)("Bottom right")};function Ff(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(Of).map((e=>{let[n,l]=e;return(0,s.createElement)(p.__experimentalUnitControl,i({},o,{key:n,"aria-label":l,value:r[n],onChange:(a=n,e=>{t&&t({...r,[a]:e||void 0})})}));var a})))}var zf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),Vf=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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 Hf(e){let{isLinked:t,...n}=e;const o=t?(0,g.__)("Unlink Radii"):(0,g.__)("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?zf:Vf,iconSize:16,"aria-label":o})))}const Gf={topLeft:null,topRight:null,bottomLeft:null,bottomRight:null},Uf={px:100,em:20,rem:20};function Wf(e){let{onChange:t,values:n}=e;const[o,r]=(0,s.useState)(!Af(n)||!Lf(n)),l=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("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 Mf(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)(Rf(n));return(0,s.createElement)("fieldset",{className:"components-border-radius-control"},(0,s.createElement)("legend",null,(0,g.__)("Radius")),(0,s.createElement)("div",{className:"components-border-radius-control__wrapper"},o?(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Df,{className:"components-border-radius-control__unit-control",values:n,min:0,onChange:t,units:l}),(0,s.createElement)(p.RangeControl,{className:"components-border-radius-control__range-control",value:null!=u?u:"",min:0,max:Uf[i],initialPosition:0,withInputField:!1,onChange:e=>{t(void 0!==e?`${e}${i}`:void 0)},step:c})):(0,s.createElement)(Ff,{min:0,onChange:t,values:n||Gf,units:l}),(0,s.createElement)(Hf,{onClick:()=>r(!o),isLinked:o})))}function $f(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Wf,{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=Bo(t)),o({style:t})}})}Ru([Lu,Ou]);const jf=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{color:n}},Kf=(e,t)=>(0,u.find)(e,{color:t});function qf(e,t){if(e&&t)return`has-${(0,u.kebabCase)(t)}-${e}`}function Yf(){return{disableCustomColors:!Co("color.custom"),disableCustomGradients:!Co("color.customGradient")}}function Qf(){const e=Yf(),t=Co("color.palette.custom"),n=Co("color.palette.theme"),o=Co("color.palette.default"),r=Co("color.defaultPalette");e.colors=(0,s.useMemo)((()=>{const e=[];return n&&n.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),colors:n}),r&&o&&o.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),colors:o}),t&&t.length&&e.push({name:(0,g._x)("Custom","Indicates this palette comes from the theme."),colors:t}),e}),[o,n,t]);const l=Co("color.gradients.custom"),i=Co("color.gradients.theme"),a=Co("color.gradients.default"),c=Co("color.defaultGradients");return e.gradients=(0,s.useMemo)((()=>{const e=[];return i&&i.length&&e.push({name:(0,g._x)("Theme","Indicates this palette comes from the theme."),gradients:i}),c&&a&&a.length&&e.push({name:(0,g._x)("Default","Indicates this palette comes from WordPress."),gradients:a}),l&&l.length&&e.push({name:(0,g._x)("Custom","Indicates this palette is created by the user."),gradients:l}),e}),[l,i,a]),e}const Zf="__experimentalBorder",Xf=["top","right","bottom","left"],Jf=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}}}},eg=(e,t,n)=>{let o;return e.some((e=>e.colors.some((e=>e[t]===n&&(o=e,!0))))),o},tg=e=>{let{colors:t,namedColor:n,customColor:o}=e;if(n){const e=eg(t,"slug",n);if(e)return e}if(!o)return{color:void 0};return eg(t,"color",o)||{color:o}};function ng(e){const t=/var:preset\|color\|(.+)/.exec(e);return t&&t[1]?t[1]:null}function og(e){const{attributes:t,clientId:n,setAttributes:o}=e,{style:l}=t,{colors:i}=Qf(),a=rg(e.name),c=Co("border.color")&&rg(e.name,"color"),u=Co("border.radius")&&rg(e.name,"radius"),d=Co("border.style")&&rg(e.name,"style"),m=Co("border.width")&&rg(e.name,"width");if([!c,!u,!d,!m].every(Boolean)||!a)return null;const f=(0,r.getBlockSupport)(e.name,[Zf,"__experimentalDefaultControls"]),h=(null==f?void 0:f.color)||(null==f?void 0:f.width),v=((e,t)=>{const{borderColor:n,style:o}=e,{border:r}=o||{};if(n){const{color:e}=tg({colors:t,namedColor:n});return e?{...r,color:e}:r}if(!r)return r;const l={...r};return Xf.forEach((e=>{var n;const o=ng(null===(n=l[e])||void 0===n?void 0:n.color);if(o){const{color:n}=tg({colors:t,namedColor:o});l[e]={...l[e],color:n}}})),l})(t,i);return(0,s.createElement)(Ao,{__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,g.__)("Border"),onDeselect:()=>(e=>{var t;let{attributes:n={},setAttributes:o}=e;const{style:r}=n;o({borderColor:void 0,style:{...r,border:Bo({radius:null==r||null===(t=r.border)||void 0===t?void 0:t.radius})}})})(e),isShownByDefault:h,resetAllFilter:Jf,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}},Xf.forEach((t=>{var n;if(null!==(n=e[t])&&void 0!==n&&n.color){var o;const n=tg({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=tg({colors:i,customColor:t});o.slug&&(n=o.slug,r.color=void 0)}const s=Bo({...l,border:{radius:null==l||null===(t=l.border)||void 0===t?void 0:t.radius,...r}});o({style:s,borderColor:n})},popoverClassNames:{linked:"block-editor__border-box-control__popover",top:"block-editor__border-box-control__popover-top",right:"block-editor__border-box-control__popover-right",bottom:"block-editor__border-box-control__popover-bottom",left:"block-editor__border-box-control__popover-left"},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,g.__)("Radius"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:lg(o,"radius")})}(e),isShownByDefault:null==f?void 0:f.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)($f,e)))}function rg(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,Zf);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 lg(e,t){return Bo({...e,border:{...null==e?void 0:e.border,[t]:void 0}})}function ig(e,t,n){if(!rg(t,"color")||To(t,Zf,"color"))return e;const o=sg(n),r=c()(e.className,o);return e.className=r||void 0,e}function sg(e){var t;const{borderColor:n,style:o}=e,r=qf("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 ag=(0,d.createHigherOrderComponent)((e=>t=>{var n,o,r,l,a,c,u,d,p;const{name:m,attributes:f}=t,{borderColor:g,style:h}=f,{colors:v}=Qf();if(!rg(m,"color")||To(m,Zf,"color"))return(0,s.createElement)(e,t);const{color:b}=tg({colors:v,namedColor:g}),{color:k}=tg({colors:v,namedColor:ng(null==h||null===(n=h.border)||void 0===n||null===(o=n.top)||void 0===o?void 0:o.color)}),{color:_}=tg({colors:v,namedColor:ng(null==h||null===(r=h.border)||void 0===r||null===(l=r.right)||void 0===l?void 0:l.color)}),{color:y}=tg({colors:v,namedColor:ng(null==h||null===(a=h.border)||void 0===a||null===(c=a.bottom)||void 0===c?void 0:c.color)}),{color:E}=tg({colors:v,namedColor:ng(null==h||null===(u=h.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 cg(e){if(e)return`has-${e}-gradient-background`}function ug(e,t){const n=(0,u.find)(e,["slug",t]);return n&&n.gradient}function dg(e,t){return(0,u.find)(e,["gradient",t])}function pg(e,t){const n=dg(e,t);return n&&n.slug}function mg(){let{gradientAttribute:e="gradient",customGradientAttribute:t="customGradient"}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{clientId:n}=eo(),o=Co("color.gradients.custom"),r=Co("color.gradients.theme"),l=Co("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(Qn),l=r(n)||{};return{customGradient:l[t],gradient:l[e]}}),[n,e,t]),{updateBlockAttributes:u}=(0,m.useDispatch)(Qn),d=(0,s.useCallback)((o=>{const r=pg(i,o);u(n,r?{[e]:r,[t]:void 0}:{[e]:void 0,[t]:o})}),[i,n,u]),p=cg(a);let f;return f=a?ug(i,a):c,{gradientClass:p,gradientValue:f,setGradient:d}}(0,l.addFilter)("blocks.registerBlockType","core/border/addAttributes",(function(e){return rg(e,"color")?e.attributes.borderColor?e:{...e,attributes:{...e.attributes,borderColor:{type:"string"}}}:e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/border/addSaveProps",ig),(0,l.addFilter)("blocks.registerBlockType","core/border/addEditProps",(function(e){if(!rg(e,"color")||To(e,Zf,"color"))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ig(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/border/with-border-color-palette-styles",ag),Ru([Lu,Ou]);var fg=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,f=c||r;if(!m&&!f)return null;const h=[{color:m,description:(0,g.__)("text color")},{color:f,description:(0,g.__)("link color")}],v=Pu(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 h){if(!e.color)continue;const t=Pu(e.color),n=t.isReadable(v,_),o=t.alpha()<1;if(!n){if(b||o)continue;y=k<t.brightness()?(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
65
  (0,g.__)("This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s."),e.description):(0,g.sprintf)(// translators: %s is a type of text color, e.g., "text color" or "link color".
66
+ (0,g.__)("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,g.__)("This color combination may be hard for people to read.");break}o&&u&&(y=(0,g.__)("Transparent text may be hard for people to read."),E=(0,g.__)("Transparent text may be hard for people to read."))}return y?((0,Ht.speak)(E),(0,s.createElement)("div",{className:"block-editor-contrast-checker"},(0,s.createElement)(p.Notice,{spokenMessage:null,status:"warning",isDismissible:!1},y))):null};const gg=["colors","disableCustomColors","gradients","disableCustomGradients"];function hg(e){let{colors:t,gradients:n,disableCustomColors:o,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,className:a,label:d,onColorChange:m,onGradientChange:f,colorValue:h,gradientValue:v,clearable:b,showTitle:k=!0,enableAlpha:_}=e;const y=m&&(!(0,u.isEmpty)(t)||!o),E=f&&(!(0,u.isEmpty)(n)||!r),[C,S]=(0,s.useState)(v?"gradient":!!y&&"color");return y||E?(0,s.createElement)(p.BaseControl,{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},k&&(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&&E&&(0,s.createElement)(p.__experimentalToggleGroupControl,{value:C,onChange:S,label:(0,g.__)("Select color type"),hideLabelFromVision:!0,isBlock:!0},(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"color",label:(0,g.__)("Solid")}),(0,s.createElement)(p.__experimentalToggleGroupControlOption,{value:"gradient",label:(0,g.__)("Gradient")})),("color"===C||!E)&&(0,s.createElement)(p.ColorPalette,{value:h,onChange:E?e=>{m(e),f()}:m,colors:t,disableCustomColors:o,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b,enableAlpha:_}),("gradient"===C||!y)&&(0,s.createElement)(p.GradientPicker,{value:v,onChange:y?e=>{f(e),m()}:f,gradients:n,disableCustomGradients:r,__experimentalHasMultipleOrigins:l,__experimentalIsRenderedInSidebar:i,clearable:b})))):null}function vg(e){const t={};return t.colors=Co("color.palette"),t.gradients=Co("color.gradients"),t.disableCustomColors=!Co("color.custom"),t.disableCustomGradients=!Co("color.customGradient"),(0,s.createElement)(hg,i({},t,e))}var bg=function(e){return(0,u.every)(gg,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(hg,e):(0,s.createElement)(vg,e)};function kg(e){var t;let{settings:n,enableAlpha:o,...r}=e;const l={...Qf(),clearable:!1,enableAlpha:o,label:n.label,onColorChange:n.onColorChange,onGradientChange:n.onGradientChange,colorValue:n.colorValue,gradientValue:n.gradientValue},a=null!==(t=n.gradientValue)&&void 0!==t?t:n.colorValue;return(0,s.createElement)(p.__experimentalToolsPanelItem,i({hasValue:n.hasValue,label:n.label,onDeselect:n.onDeselect,isShownByDefault:n.isShownByDefault,resetAllFilter:n.resetAllFilter},r,{className:"block-editor-tools-panel-color-gradient-settings__item"}),(0,s.createElement)(p.Dropdown,{className:"block-editor-tools-panel-color-dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:e=>{let{isOpen:t,onToggle:o}=e;return(0,s.createElement)(p.Button,{onClick:o,"aria-expanded":t,className:c()("block-editor-panel-color-gradient-settings__dropdown",{"is-open":t})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:a}),(0,s.createElement)(p.FlexItem,null,n.label)))},renderContent:()=>(0,s.createElement)(bg,i({showTitle:!1,__experimentalHasMultipleOrigins:!0,__experimentalIsRenderedInSidebar:!0,enableAlpha:!0},l))}))}function _g(e){return e.ownerDocument.defaultView.getComputedStyle(e)}function yg(e){let{enableAlpha:t=!1,settings:n,clientId:o,enableContrastChecking:r=!0}=e;const[l,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)(),p=bo(o);return(0,s.useEffect)((()=>{var e;if(!r)return;if(!p.current)return;c(_g(p.current).color);const t=null===(e=p.current)||void 0===e?void 0:e.querySelector("a");t&&t.innerText&&d(_g(t).color);let n=p.current,o=_g(n).backgroundColor;for(;"rgba(0, 0, 0, 0)"===o&&n.parentNode&&n.parentNode.nodeType===n.parentNode.ELEMENT_NODE;)n=n.parentNode,o=_g(n).backgroundColor;i(o)})),(0,s.createElement)(Ao,{__experimentalGroup:"color"},n.map(((e,n)=>(0,s.createElement)(kg,{key:n,settings:e,panelId:o,enableAlpha:t}))),r&&(0,s.createElement)(fg,{backgroundColor:l,textColor:a,enableAlphaChecker:t,linkColor:u}))}const Eg="color",Cg=e=>{const t=(0,r.getBlockSupport)(e,Eg);return t&&(!0===t.link||!0===t.gradient||!1!==t.background||!1!==t.text)},Sg=e=>{if("web"!==s.Platform.OS)return!1;const t=(0,r.getBlockSupport)(e,Eg);return(0,u.isObject)(t)&&!!t.link},wg=e=>{const t=(0,r.getBlockSupport)(e,Eg);return(0,u.isObject)(t)&&!!t.gradients},Bg=e=>{const t=(0,r.getBlockSupport)(e,Eg);return t&&!1!==t.background},Ig=e=>{const t=(0,r.getBlockSupport)(e,Eg);return t&&!1!==t.text},xg=e=>t=>{var n,o,r,l,i,s,a,c,u,d;return"background"===e?!!(t.attributes.backgroundColor||null!==(r=t.attributes.style)&&void 0!==r&&null!==(l=r.color)&&void 0!==l&&l.background||t.attributes.gradient||null!==(i=t.attributes.style)&&void 0!==i&&null!==(s=i.color)&&void 0!==s&&s.gradient):"link"===e?!(null===(a=t.attributes.style)||void 0===a||null===(c=a.elements)||void 0===c||null===(u=c.link)||void 0===u||null===(d=u.color)||void 0===d||!d.text):!!t.attributes[`${e}Color`]||!(null===(n=t.attributes.style)||void 0===n||null===(o=n.color)||void 0===o||!o[e])},Tg=(e,t)=>Bo(Io(t,e,void 0)),Ng=e=>({textColor:void 0,style:Tg(["color","text"],e.style)}),Pg=e=>({style:Tg(["elements","link","color","text"],e.style)}),Mg=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 Rg(e,t,n){var o,r,l,i,s,a;if(!Cg(t)||To(t,Eg))return e;const u=wg(t),{backgroundColor:d,textColor:p,gradient:m,style:f}=n,g=e=>!To(t,Eg,e),h=g("text")?qf("color",p):void 0,v=g("gradients")?cg(m):void 0,b=g("background")?qf("background-color",d):void 0,k=g("background")||g("gradients"),_=d||(null==f||null===(o=f.color)||void 0===o?void 0:o.background)||u&&(m||(null==f||null===(r=f.color)||void 0===r?void 0:r.gradient)),y=c()(e.className,h,v,{[b]:!(u&&null!=f&&null!==(l=f.color)&&void 0!==l&&l.gradient||!b),"has-text-color":g("text")&&(p||(null==f||null===(i=f.color)||void 0===i?void 0:i.text)),"has-background":k&&_,"has-link-color":g("link")&&(null==f||null===(s=f.elements)||void 0===s||null===(a=s.link)||void 0===a?void 0:a.color)});return e.className=y||void 0,e}const Lg=(e,t)=>{const n=/var:preset\|color\|(.+)/.exec(t);return n&&n[1]?jf(e,n[1]).color:t};function Ag(e){var t,n,o,l,i,a,c,u,d;const{name:p,attributes:m}=e,f=Co("color.palette.custom"),h=Co("color.palette.theme"),v=Co("color.palette.default"),b=(0,s.useMemo)((()=>[...f||[],...h||[],...v||[]]),[f,h,v]),k=Co("color.gradients.custom"),_=Co("color.gradients.theme"),y=Co("color.gradients.default"),E=(0,s.useMemo)((()=>[...k||[],..._||[],...y||[]]),[k,_,y]),C=Co("color.custom"),S=Co("color.customGradient"),w=Co("color.background"),B=Co("color.link"),I=Co("color.text"),x=C||!h||(null==h?void 0:h.length)>0,T=S||!_||(null==_?void 0:_.length)>0,N=(0,s.useRef)(m);if((0,s.useEffect)((()=>{N.current=m}),[m]),!Cg(p))return null;const P=Sg(p)&&B&&x,M=Ig(p)&&I&&x,R=Bg(p)&&w&&x,L=wg(p)&&T;if(!(P||M||R||L))return null;const{style:A,textColor:D,backgroundColor:O,gradient:F}=m;let z;if(L&&F)z=ug(E,F);else if(L){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=Kf(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:Bo(s),[i]:a};e.setAttributes(c),N.current={...N.current,...c}},G=!("web"!==s.Platform.OS||F||null!=A&&null!==(t=A.color)&&void 0!==t&&t.gradient),U=(0,r.getBlockSupport)(e.name,[Eg,"__experimentalDefaultControls"]);return(0,s.createElement)(yg,{enableContrastChecking:G,clientId:e.clientId,enableAlpha:!0,settings:[...M?[{label:(0,g.__)("Text"),onColorChange:H("text"),colorValue:jf(b,D,null==A||null===(n=A.color)||void 0===n?void 0:n.text).color,isShownByDefault:null==U?void 0:U.text,hasValue:()=>xg("text")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({textColor:void 0,style:Tg(["color","text"],t.style)})})(e),resetAllFilter:Ng}]:[],...R||L?[{label:(0,g.__)("Background"),onColorChange:R?H("background"):void 0,colorValue:jf(b,O,null==A||null===(o=A.color)||void 0===o?void 0:o.background).color,gradientValue:z,onGradientChange:L?t=>{const n=pg(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:Bo(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:Bo(e),gradient:void 0}}e.setAttributes(o),N.current={...N.current,...o}}:void 0,isShownByDefault:null==U?void 0:U.background,hasValue:()=>xg("background")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n(Mg(t))})(e),resetAllFilter:Mg}]:[],...P?[{label:(0,g.__)("Link"),onColorChange:t=>{const n=Kf(b,t),o=null!=n&&n.slug?`var:preset|color|${n.slug}`:t,r=Bo(Io(A,["elements","link","color","text"],o));e.setAttributes({style:r})},colorValue:Lg(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,hasValue:()=>xg("link")(e),onDeselect:()=>(e=>{let{attributes:t,setAttributes:n}=e;n({style:Tg(["elements","link","color","text"],t.style)})})(e),resetAllFilter:Pg}]:[]]})}const Dg=(0,d.createHigherOrderComponent)((e=>t=>{var n;const{name:o,attributes:r}=t,{backgroundColor:l,textColor:a}=r,c=Co("color.palette.custom")||[],u=Co("color.palette.theme")||[],d=Co("color.palette.default")||[],p=(0,s.useMemo)((()=>[...c||[],...u||[],...d||[]]),[c,u,d]);if(!Cg(o)||To(o,Eg))return(0,s.createElement)(e,t);const m={};var f,g;a&&!To(o,Eg,"text")&&(m.color=null===(f=jf(p,a))||void 0===f?void 0:f.color),l&&!To(o,Eg,"background")&&(m.backgroundColor=null===(g=jf(p,l))||void 0===g?void 0:g.color);let h=t.wrapperProps;return h={...t.wrapperProps,style:{...m,...null===(n=t.wrapperProps)||void 0===n?void 0:n.style}},(0,s.createElement)(e,i({},t,{wrapperProps:h}))})),Og={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 Cg(e)?(e.attributes.backgroundColor||Object.assign(e.attributes,{backgroundColor:{type:"string"}}),e.attributes.textColor||Object.assign(e.attributes,{textColor:{type:"string"}}),wg(e)&&!e.attributes.gradient&&Object.assign(e.attributes,{gradient:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/color/addSaveProps",Rg),(0,l.addFilter)("blocks.registerBlockType","core/color/addEditProps",(function(e){if(!Cg(e)||To(e,Eg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Rg(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/color/with-color-palette-styles",Dg),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/color/addTransforms",(function(e,t,n,o){const r=e.name;return xo({linkColor:Sg(r),textColor:Ig(r),backgroundColor:Bg(r),gradient:wg(r)},Og,e,t,n,o)}));const Fg=[{name:(0,g._x)("Regular","font style"),value:"normal"},{name:(0,g._x)("Italic","font style"),value:"italic"}],zg=[{name:(0,g._x)("Thin","font weight"),value:"100"},{name:(0,g._x)("Extra Light","font weight"),value:"200"},{name:(0,g._x)("Light","font weight"),value:"300"},{name:(0,g._x)("Regular","font weight"),value:"400"},{name:(0,g._x)("Medium","font weight"),value:"500"},{name:(0,g._x)("Semi Bold","font weight"),value:"600"},{name:(0,g._x)("Bold","font weight"),value:"700"},{name:(0,g._x)("Extra Bold","font weight"),value:"800"},{name:(0,g._x)("Black","font weight"),value:"900"}],Vg=(e,t)=>e?t?(0,g.__)("Appearance"):(0,g.__)("Font style"):(0,g.__)("Font weight");function Hg(e){const{onChange:t,hasFontStyles:n=!0,hasFontWeights:o=!0,value:{fontStyle:r,fontWeight:l}}=e,i=n||o,a=Vg(n,o),c={key:"default",name:(0,g.__)("Default"),style:{fontStyle:void 0,fontWeight:void 0}},u=(0,s.useMemo)((()=>n&&o?(()=>{const e=[c];return Fg.forEach((t=>{let{name:n,value:o}=t;zg.forEach((t=>{let{name:r,value:l}=t;const i="normal"===o?r:(0,g.sprintf)(
67
  /* translators: 1: Font weight name. 2: Font style name. */
68
+ (0,g.__)("%1$s %2$s"),r,n);e.push({key:`${o}-${l}`,name:i,style:{fontStyle:o,fontWeight:l}})}))})),e})():n?(()=>{const e=[c];return Fg.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:o,fontWeight:void 0}})})),e})():(()=>{const e=[c];return zg.forEach((t=>{let{name:n,value:o}=t;e.push({key:o,name:n,style:{fontStyle:void 0,fontWeight:o}})})),e})()),[e.options]),d=u.find((e=>e.style.fontStyle===r&&e.style.fontWeight===l))||u[0];return i&&(0,s.createElement)(p.CustomSelectControl,{className:"components-font-appearance-control",label:a,describedBy:d?n?o?(0,g.sprintf)(// translators: %s: Currently selected font appearance.
69
  (0,g.__)("Currently selected font appearance: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font style.
70
  (0,g.__)("Currently selected font style: %s"),d.name):(0,g.sprintf)(// translators: %s: Currently selected font weight.
71
+ (0,g.__)("Currently selected font weight: %s"),d.name):(0,g.__)("No selected font appearance"),options:u,value:d,onChange:e=>{let{selectedItem:n}=e;return t(n.style)}})}var Gg=e=>{let{value:t,onChange:n,__nextHasNoMarginBottom:o=!1,__unstableInputWidth:r="60px"}=e;const l=function(e){return void 0!==e&&""!==e}(t),i=l?t:"";o||H()("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 a=o?void 0:{marginBottom:24};return(0,s.createElement)("div",{className:"block-editor-line-height-control",style:a},(0,s.createElement)(p.__experimentalNumberControl,{__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(l)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,g.__)("Line height"),placeholder:1.5,step:.1,value:i,min:0}))};const Ug="typography.lineHeight";function Wg(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Gg,{__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:Bo(t)})}})}function $g(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!Co("typography.lineHeight");return!(0,r.hasBlockSupport)(e,Ug)||t}const jg="typography.__experimentalFontStyle",Kg="typography.__experimentalFontWeight";function qg(e){var t,n;const{attributes:{style:o},setAttributes:r}=e,l=!Yg(e),i=!Qg(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)(Hg,{onChange:e=>{r({style:Bo({...o,typography:{...null==o?void 0:o.typography,fontStyle:e.fontStyle,fontWeight:e.fontWeight}})})},hasFontStyles:l,hasFontWeights:i,value:{fontStyle:a,fontWeight:c}})}function Yg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,jg),n=Co("typography.fontStyle");return!t||!n}function Qg(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=(0,r.hasBlockSupport)(e,Kg),n=Co("typography.fontWeight");return!t||!n}function Zg(e){const t=Yg(e),n=Qg(e);return t&&n}function Xg(e){let{value:t="",onChange:n,fontFamilies:o,...r}=e;const l=Co("typography.fontFamilies");if(o||(o=l),(0,u.isEmpty)(o))return null;const a=[{value:"",label:(0,g.__)("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,g.__)("Font family"),options:a,value:t,onChange:n,labelPosition:"top"},r))}const Jg="typography.__experimentalFontFamily";function eh(e,t,n){if(!(0,r.hasBlockSupport)(t,Jg))return e;if(To(t,Mh,"fontFamily"))return e;if(null==n||!n.fontFamily)return e;const o=new(sm())(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 th(e){var t;let{setAttributes:n,attributes:{fontFamily:o}}=e;const r=Co("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)(Xg,{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 nh(e){let{name:t}=e;const n=Co("typography.fontFamilies");return!n||0===n.length||!(0,r.hasBlockSupport)(t,Jg)}(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,Jg)?(e.attributes.fontFamily||Object.assign(e.attributes,{fontFamily:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/fontFamily/addSaveProps",eh),(0,l.addFilter)("blocks.registerBlockType","core/fontFamily/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,Jg))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),eh(o,e,n)},e}));const oh=(e,t,n)=>{if(t){const n=(0,u.find)(e,{slug:t});if(n)return n}return{size:n}};function rh(e,t){return(0,u.find)(e,{size:t})||{size:t}}function lh(e){if(e)return`has-${(0,u.kebabCase)(e)}-font-size`}var ih=function(e){const t=Co("typography.fontSizes"),n=!Co("typography.customFontSize");return(0,s.createElement)(p.FontSizePicker,i({},e,{fontSizes:t,disableCustomFontSizes:n}))};const sh="typography.fontSize";function ah(e,t,n){if(!(0,r.hasBlockSupport)(t,sh))return e;if(To(t,Mh,"fontSize"))return e;const o=new(sm())(e.className);o.add(lh(n.fontSize));const l=o.value;return e.className=l||void 0,e}function ch(e){var t,n;const{attributes:{fontSize:o,style:r},setAttributes:l}=e,i=Co("typography.fontSizes"),a=oh(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)(ih,{onChange:e=>{const t=rh(i,e).slug;l({style:Bo({...r,typography:{...null==r?void 0:r.typography,fontSize:t?void 0:e}}),fontSize:t})},value:c,withReset:!1})}function uh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=Co("typography.fontSizes"),n=!(null==t||!t.length);return!(0,r.hasBlockSupport)(e,sh)||!n}const dh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=Co("typography.fontSizes"),{name:i,attributes:{fontSize:a,style:c},wrapperProps:u}=t;if(!(0,r.hasBlockSupport)(i,sh)||To(i,Mh,"fontSize")||!a||null!=c&&null!==(n=c.typography)&&void 0!==n&&n.fontSize)return(0,s.createElement)(e,t);const d=oh(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"),ph={fontSize:[["fontSize"],["style","typography","fontSize"]]};(0,l.addFilter)("blocks.registerBlockType","core/font/addAttribute",(function(e){return(0,r.hasBlockSupport)(e,sh)?(e.attributes.fontSize||Object.assign(e.attributes,{fontSize:{type:"string"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/font/addSaveProps",ah),(0,l.addFilter)("blocks.registerBlockType","core/font/addEditProps",(function(e){if(!(0,r.hasBlockSupport)(e,sh))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),ah(o,e,n)},e})),(0,l.addFilter)("editor.BlockListBlock","core/font-size/with-font-size-inline-styles",dh),(0,l.addFilter)("blocks.switchToBlockType.transformedBlock","core/font-size/addTransforms",(function(e,t,n,o){const l=e.name;return xo({fontSize:(0,r.hasBlockSupport)(l,sh)},ph,e,t,n,o)}));var mh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),fh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));const gh=[{name:(0,g.__)("Underline"),value:"underline",icon:mh},{name:(0,g.__)("Strikethrough"),value:"line-through",icon:fh}];function hh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-decoration-control"},(0,s.createElement)("legend",null,(0,g.__)("Decoration")),(0,s.createElement)("div",{className:"block-editor-text-decoration-control__buttons"},gh.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 vh="typography.__experimentalTextDecoration";function bh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(hh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textDecoration,onChange:function(e){o({style:Bo({...n,typography:{...null==n?void 0:n.typography,textDecoration:e}})})}})}function kh(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,vh),n=Co("typography.textDecoration");return t||!n}var _h=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),yh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"})),Eh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.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"}));const Ch=[{name:(0,g.__)("Uppercase"),value:"uppercase",icon:_h},{name:(0,g.__)("Lowercase"),value:"lowercase",icon:yh},{name:(0,g.__)("Capitalize"),value:"capitalize",icon:Eh}];function Sh(e){let{value:t,onChange:n}=e;return(0,s.createElement)("fieldset",{className:"block-editor-text-transform-control"},(0,s.createElement)("legend",null,(0,g.__)("Letter case")),(0,s.createElement)("div",{className:"block-editor-text-transform-control__buttons"},Ch.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 wh="typography.__experimentalTextTransform";function Bh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(Sh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.textTransform,onChange:function(e){o({style:Bo({...n,typography:{...null==n?void 0:n.typography,textTransform:e}})})}})}function Ih(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,wh),n=Co("typography.textTransform");return t||!n}function xh(e){let{value:t,onChange:n,__unstableInputWidth:o="60px"}=e;const r=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["px","em","rem"],defaultValues:{px:2,em:.2,rem:.2}});return(0,s.createElement)(p.__experimentalUnitControl,{label:(0,g.__)("Letter spacing"),value:t,__unstableInputWidth:o,units:r,onChange:n})}const Th="typography.__experimentalLetterSpacing";function Nh(e){var t;const{attributes:{style:n},setAttributes:o}=e;return(0,s.createElement)(xh,{value:null==n||null===(t=n.typography)||void 0===t?void 0:t.letterSpacing,onChange:function(e){o({style:Bo({...n,typography:{...null==n?void 0:n.typography,letterSpacing:e}})})},__unstableInputWidth:"100%"})}function Ph(){let{name:e}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!(0,r.hasBlockSupport)(e,Th),n=Co("typography.letterSpacing");return t||!n}const Mh="typography",Rh=[Ug,sh,jg,Kg,Jg,vh,wh,Th];function Lh(e){const{clientId:t}=e,n=nh(e),o=uh(e),l=Zg(e),i=$g(e),a=kh(e),c=Ih(e),u=Ph(e),d=!Yg(e),m=!Qg(e),f=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=[Zg(e),uh(e),$g(e),nh(e),kh(e),Ih(e),Ph(e)];return t.filter(Boolean).length===t.length}(e),h=Ah(e.name);if(f||!h)return null;const v=(0,r.getBlockSupport)(e.name,[Mh,"__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)(Ao,{__experimentalGroup:"typography"},!n&&(0,s.createElement)(p.__experimentalToolsPanelItem,{hasValue:()=>function(e){return!!e.attributes.fontFamily}(e),label:(0,g.__)("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)(th,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),label:(0,g.__)("Font size"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({fontSize:void 0,style:Bo({...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)(ch,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:Vg(d,m),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...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)(qg,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,g.__)("Line height"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...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)(Wg,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,g.__)("Decoration"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...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)(bh,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),label:(0,g.__)("Letter case"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...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)(Bh,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,g.__)("Letter spacing"),onDeselect:()=>function(e){let{attributes:t={},setAttributes:n}=e;const{style:o}=t;n({style:Bo({...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)(Nh,e)))}const Ah=e=>Rh.some((t=>(0,r.hasBlockSupport)(e,t))),Dh=[...Rh,Zf,Eg,Yo],Oh=e=>Dh.some((t=>(0,r.hasBlockSupport)(e,t))),Fh="var:";function zh(e){return(0,u.startsWith)(e,Fh)?`var(--wp--${e.slice(Fh.length).split("|").join("--")})`:e}function Vh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["spacing.blockGap"],n={};Object.keys(r.__EXPERIMENTAL_STYLE_PROPERTY).forEach((o=>{const l=r.__EXPERIMENTAL_STYLE_PROPERTY[o].value,i=r.__EXPERIMENTAL_STYLE_PROPERTY[o].properties;if((0,u.has)(e,l)&&"elements"!==(0,u.first)(l)){const s=(0,u.get)(e,l);r.__EXPERIMENTAL_STYLE_PROPERTY[o].useEngine||(i&&!(0,u.isString)(s)?Object.entries(i).forEach((e=>{const[t,o]=e,r=(0,u.get)(s,[o]);r&&(n[t]=zh(r))})):t.includes(l.join("."))||(n[o]=zh((0,u.get)(e,l))))}}));const o=il(e,{selector:"self"});return o.forEach((e=>{if("self"!==e.selector)throw"This style can't be added as inline style";n[e.key]=e.value})),n}const Hh={"__experimentalBorder.__experimentalSkipSerialization":["border"],"color.__experimentalSkipSerialization":[Eg],[`${Mh}.__experimentalSkipSerialization`]:[Mh],[`${Yo}.__experimentalSkipSerialization`]:["spacing"]},Gh={...Hh,[`${Yo}`]:["spacing.blockGap"]},Uh={gradients:"gradient"};function Wh(e,t,n){let o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Gh;if(!Oh(t))return e;let{style:l}=n;return(0,u.forEach)(o,((e,n)=>{const o=(0,r.getBlockSupport)(t,n);!0===o&&(l=(0,u.omit)(l,e)),Array.isArray(o)&&o.forEach((t=>{const n=Uh[t]||t;l=(0,u.omit)(l,[[...e,n]])}))})),e.style={...Vh(l),...e.style},e}const $h=(0,d.createHigherOrderComponent)((e=>t=>{const n=to();return(0,s.createElement)(s.Fragment,null,n&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ag,t),(0,s.createElement)(Lh,t),(0,s.createElement)(og,t),(0,s.createElement)(Xo,t)),(0,s.createElement)(e,t))}),"withToolbarControls"),jh=(0,d.createHigherOrderComponent)((e=>t=>{var n,o;const l=`wp-elements-${(0,d.useInstanceId)(e)}`,a=To(t.name,Eg,"link")?(0,u.omit)(null===(n=t.attributes.style)||void 0===n?void 0:n.elements,["link"]):null===(o=t.attributes.style)||void 0===o?void 0:o.elements,p=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return(0,u.map)(t,((t,n)=>{const o=Vh(t);return(0,u.isEmpty)(o)?"":[`.editor-styles-wrapper .${e} ${r.__EXPERIMENTAL_ELEMENTS[n]}{`,...(0,u.map)(o,((e,t)=>`\t${(0,u.kebabCase)(t)}: ${e};`)),"}"].join("\n")})).join("\n")}(l,a),m=(0,s.useContext)(Tf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,a&&m&&(0,s.createPortal)((0,s.createElement)("style",{dangerouslySetInnerHTML:{__html:p}}),m),(0,s.createElement)(e,i({},t,{className:a?c()(t.className,l):t.className})))}));(0,l.addFilter)("blocks.registerBlockType","core/style/addAttribute",(function(e){return Oh(e)?(e.attributes.style||Object.assign(e.attributes,{style:{type:"object"}}),e):e})),(0,l.addFilter)("blocks.getSaveContent.extraProps","core/style/addSaveProps",Wh),(0,l.addFilter)("blocks.registerBlockType","core/style/addEditProps",(function(e){if(!Oh(e))return e;const t=e.getEditWrapperProps;return e.getEditWrapperProps=n=>{let o={};return t&&(o=t(n)),Wh(o,e,n,Hh)},e})),(0,l.addFilter)("editor.BlockEdit","core/style/with-block-controls",$h),(0,l.addFilter)("editor.BlockListBlock","core/editor/with-elements-styles",jh),(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}));var Kh=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 4 4 19h16L12 4zm0 3.2 5.5 10.3H12V7.2z"})),qh=function(e){let{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}=e;return(0,s.createElement)(p.Dropdown,{popoverProps:{className:"block-editor-duotone-control__popover",headerTitle:(0,g.__)("Duotone"),isAlternate:!0},renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{showTooltip:!0,onClick:n,"aria-haspopup":"true","aria-expanded":t,onKeyDown:e=>{t||e.keyCode!==yc.DOWN||(e.preventDefault(),n())},label:(0,g.__)("Apply duotone filter"),icon:l?(0,s.createElement)(p.DuotoneSwatch,{values:l}):(0,s.createElement)(Ir,{icon:Kh})})},renderContent:()=>(0,s.createElement)(p.MenuGroup,{label:(0,g.__)("Duotone")},(0,s.createElement)("div",{className:"block-editor-duotone-control__description"},(0,g.__)("Create a two-tone color effect without losing your original image.")),(0,s.createElement)(p.DuotonePicker,{colorPalette:t,duotonePalette:n,disableCustomColors:o,disableCustomDuotone:r,value:l,onChange:i}))})};const Yh=[];function Qh(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];const t={r:[],g:[],b:[],a:[]};return e.forEach((e=>{const n=Pu(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 Zh(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 Xh(e){let{id:t,values:n}=e;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:n.r.join(" ")}),(0,s.createElement)("feFuncG",{type:"table",tableValues:n.g.join(" ")}),(0,s.createElement)("feFuncB",{type:"table",tableValues:n.b.join(" ")}),(0,s.createElement)("feFuncA",{type:"table",tableValues:n.a.join(" ")})),(0,s.createElement)("feComposite",{in2:"SourceGraphic",operator:"in"}))))}function Jh(e){let{selector:t,id:n,values:o}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Xh,{id:n,values:o}),(0,s.createElement)(Zh,{id:n,selector:t}))}function ev(e){let{presetSetting:t,defaultSetting:n}=e;const o=!Co(n),r=Co(`${t}.custom`)||Yh,l=Co(`${t}.theme`)||Yh,i=Co(`${t}.default`)||Yh;return(0,s.useMemo)((()=>[...r,...l,...o?Yh:i]),[o,r,l,i])}function tv(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=ev({presetSetting:"color.duotone",defaultSetting:"color.defaultDuotone"}),a=ev({presetSetting:"color.palette",defaultSetting:"color.defaultPalette"}),c=!Co("color.custom"),u=!Co("color.customDuotone")||0===(null==a?void 0:a.length)&&c;return 0===(null==i?void 0:i.length)&&u?null:(0,s.createElement)(io,{group:"block",__experimentalShareWithChildBlocks:!0},(0,s.createElement)(qh,{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})}}))}Ru([Lu]);const nv=(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)(tv,t))}),"withDuotoneControls"),ov=(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),f=c()(null==t?void 0:t.className,p),g=(0,s.useContext)(Tf.__unstableElementContext);return(0,s.createElement)(s.Fragment,null,g&&(0,s.createPortal)((0,s.createElement)(Jh,{selector:m,id:p,values:Qh(u)}),g),(0,s.createElement)(e,i({},t,{className:f})))}),"withDuotoneStyles");function rv(e){let{preset:t}=e;return(0,s.createElement)(Xh,{id:`wp-duotone-${t.slug}`,values:Qh(t.colors)})}(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",nv),(0,l.addFilter)("editor.BlockListBlock","core/editor/duotone/with-styles",ov);const lv="__experimentalLayout";function iv(e){let{setAttributes:t,attributes:n,name:o}=e;const{layout:l}=n,i=Co("layout"),a=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().supportsLayout}),[]),c=(0,r.getBlockSupport)(o,lv,{}),{allowSwitching:u,allowEditing:d=!0,allowInheriting:f=!0,default:h}=c;if(!d)return null;const v=!(!f||!i||null!=l&&l.type&&"default"!==(null==l?void 0:l.type)&&(null==l||!l.inherit)),b=l||h||{},{inherit:k=!1,type:_="default"}=b;if("default"===_&&!a)return null;const y=Pr(_),E=e=>t({layout:e});return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ao,null,(0,s.createElement)(p.PanelBody,{title:(0,g.__)("Layout")},v&&(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Inherit default layout"),checked:!!k,onChange:()=>t({layout:{inherit:!k}})}),!k&&u&&(0,s.createElement)(sv,{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 sv(e){let{type:t,onChange:n}=e;return(0,s.createElement)(p.ButtonGroup,null,Nr.map((e=>{let{name:o,label:r}=e;return(0,s.createElement)(p.Button,{key:o,isPressed:t===o,onClick:()=>n(o)},r)})))}const av=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n}=t;return[(0,r.hasBlockSupport)(n,lv)&&(0,s.createElement)(iv,i({key:"layout"},t)),(0,s.createElement)(e,i({key:"edit"},t))]}),"withInspectorControls"),cv=(0,d.createHigherOrderComponent)((e=>t=>{const{name:n,attributes:o}=t,l=(0,r.hasBlockSupport)(n,lv),a=(0,d.useInstanceId)(e),u=Co("layout")||{},p=(0,s.useContext)(Tf.__unstableElementContext),{layout:m}=o,{default:f}=(0,r.getBlockSupport)(n,lv)||{},g=null!=m&&m.inherit?u:m||f||{},h=c()(null==t?void 0:t.className,{[`wp-container-${a}`]:l});return(0,s.createElement)(s.Fragment,null,l&&p&&(0,s.createPortal)((0,s.createElement)(Dr,{blockName:n,selector:`.wp-container-${a}`,layout:g,style:null==o?void 0:o.style}),p),(0,s.createElement)(e,i({},t,{className:h})))}));function uv(e){var t;const n=(null===(t=e.style)||void 0===t?void 0:t.border)||{};return{className:sg(e)||void 0,style:Vh({border:n})}}function dv(e){const{colors:t}=Qf(),n=uv(e),{borderColor:o}=e;if(o){const e=tg({colors:t,namedColor:o});n.style.borderColor=e.color}return n}function pv(e){var t,n,o,r,l,i;const{backgroundColor:s,textColor:a,gradient:u,style:d}=e,p=qf("background-color",s),m=qf("color",a),f=cg(u),g=f||(null==d||null===(t=d.color)||void 0===t?void 0:t.gradient);return{className:c()(m,f,{[p]:!g&&!!p,"has-text-color":a||(null==d||null===(n=d.color)||void 0===n?void 0:n.text),"has-background":s||(null==d||null===(o=d.color)||void 0===o?void 0:o.background)||u||(null==d||null===(r=d.color)||void 0===r?void 0:r.gradient),"has-link-color":null==d||null===(l=d.elements)||void 0===l||null===(i=l.link)||void 0===i?void 0:i.color})||void 0,style:Vh({color:(null==d?void 0:d.color)||{}})}}(0,l.addFilter)("blocks.registerBlockType","core/layout/addAttribute",(function(e){return(0,u.has)(e.attributes,["layout","type"])||(0,r.hasBlockSupport)(e,lv)&&(e.attributes={...e.attributes,layout:{type:"object"}}),e})),(0,l.addFilter)("editor.BlockListBlock","core/editor/layout/with-layout-styles",cv),(0,l.addFilter)("editor.BlockEdit","core/editor/layout/with-inspector-controls",av);const mv={};function fv(e){const{backgroundColor:t,textColor:n,gradient:o}=e,r=Co("color.palette.custom")||[],l=Co("color.palette.theme")||[],i=Co("color.palette.default")||[],a=Co("color.gradients")||mv,c=(0,s.useMemo)((()=>[...r||[],...l||[],...i||[]]),[r,l,i]),u=(0,s.useMemo)((()=>[...(null==a?void 0:a.custom)||[],...(null==a?void 0:a.theme)||[],...(null==a?void 0:a.default)||[]]),[a]),d=pv(e);if(t){const e=jf(c,t);d.style.backgroundColor=e.color}if(o&&(d.style.background=ug(u,o)),n){const e=jf(c,n);d.style.color=e.color}return d}function gv(e){const{style:t}=e;return{style:Vh({spacing:(null==t?void 0:t.spacing)||{}})}}function hv(e){const[t,n]=(0,s.useState)(e);return(0,s.useEffect)((()=>{e&&n(e)}),[e]),t}const vv=e=>(0,d.createHigherOrderComponent)((t=>n=>(0,s.createElement)(t,i({},n,{colors:e}))),"withCustomColorPalette"),bv=()=>(0,d.createHigherOrderComponent)((e=>t=>{const n=Co("color.palette.custom"),o=Co("color.palette.theme"),r=Co("color.palette.default"),l=(0,s.useMemo)((()=>[...n||[],...o||[],...r||[]]),[n,o,r]);return(0,s.createElement)(e,i({},t,{colors:l}))}),"withEditorColorPalette");function kv(e,t){const n=(0,u.reduce)(e,((e,t)=>({...e,...(0,u.isString)(t)?{[t]:(0,u.kebabCase)(t)}:t})),{});return(0,d.compose)([t,e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.colorUtils={getMostReadableColor:this.getMostReadableColor.bind(this)},this.state={}}getMostReadableColor(e){const{colors:t}=this.props;return function(e,t){const n=Pu(t);return(0,u.maxBy)(e,(e=>{let{color:t}=e;return n.contrast(t)})).color}(t,e)}createSetters(){return(0,u.reduce)(n,((e,t,n)=>{const o=(0,u.upperFirst)(n),r=`custom${o}`;return e[`set${o}`]=this.createSetColor(n,r),e}),{})}createSetColor(e,t){return n=>{const o=Kf(this.props.colors,n);this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:o,colors:r}=e;return(0,u.reduce)(n,((e,n,l)=>{const i=jf(r,o[l],o[`custom${(0,u.upperFirst)(l)}`]),s=t[l];return(null==s?void 0:s.color)===i.color&&s?e[l]=s:e[l]={...i,class:qf(n,i.slug)},e}),{})}render(){return(0,s.createElement)(e,i({},this.props,{colors:void 0},this.state,this.setters,{colorUtils:this.colorUtils}))}}])}function _v(e){return function(){const t=vv(e);for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return(0,d.createHigherOrderComponent)(kv(o,t),"withCustomColors")}}function yv(){const e=bv();for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return(0,d.createHigherOrderComponent)(kv(n,e),"withColors")}const Ev=[];var Cv=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const o=(0,u.reduce)(t,((e,t)=>(e[t]=`custom${(0,u.upperFirst)(t)}`,e)),{});return(0,d.createHigherOrderComponent)((0,d.compose)([(0,d.createHigherOrderComponent)((e=>t=>{const n=Co("typography.fontSizes")||Ev;return(0,s.createElement)(e,i({},t,{fontSizes:n}))}),"withFontSizes"),e=>class extends s.Component{constructor(e){super(e),this.setters=this.createSetters(),this.state={}}createSetters(){return(0,u.reduce)(o,((e,t,n)=>(e[`set${(0,u.upperFirst)(n)}`]=this.createSetFontSize(n,t),e)),{})}createSetFontSize(e,t){return n=>{const o=(0,u.find)(this.props.fontSizes,{size:Number(n)});this.props.setAttributes({[e]:o&&o.slug?o.slug:void 0,[t]:o&&o.slug?void 0:n})}}static getDerivedStateFromProps(e,t){let{attributes:n,fontSizes:r}=e;const l=(e,o)=>!t[o]||(n[o]?n[o]!==t[o].slug:t[o].size!==n[e]);if(!(0,u.some)(o,l))return null;const i=(0,u.reduce)((0,u.pickBy)(o,l),((e,t,o)=>{const l=n[o],i=oh(r,l,n[t]);return e[o]={...i,class:lh(l)},e}),{});return{...t,...i}}render(){return(0,s.createElement)(e,i({},this.props,{fontSizes:void 0},this.state,this.setters))}}]),"withFontSizes")},Sv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4 19.8h8.9v-1.5H4v1.5zm8.9-15.6H4v1.5h8.9V4.2zm-8.9 7v1.5h16v-1.5H4z"})),wv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M16.4 4.2H7.6v1.5h8.9V4.2zM4 11.2v1.5h16v-1.5H4zm3.6 8.6h8.9v-1.5H7.6v1.5z"})),Bv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M11.1 19.8H20v-1.5h-8.9v1.5zm0-15.6v1.5H20V4.2h-8.9zM4 12.8h16v-1.5H4v1.5z"}));const Iv=[{icon:Sv,title:(0,g.__)("Align text left"),align:"left"},{icon:wv,title:(0,g.__)("Align text center"),align:"center"},{icon:Bv,title:(0,g.__)("Align text right"),align:"right"}],xv={position:"bottom right",isAlternate:!0};var Tv=function(e){let{value:t,onChange:n,alignmentControls:o=Iv,label:r=(0,g.__)("Align"),describedBy:l=(0,g.__)("Change text alignment"),isCollapsed:a=!0,isToolbar:c}=e;function d(e){return()=>n(t===e?void 0:e)}const m=(0,u.find)(o,(e=>e.align===t)),f=c?p.ToolbarGroup:p.ToolbarDropdownMenu,h=c?{isCollapsed:a}:{};return(0,s.createElement)(f,i({icon:m?m.icon:(0,g.isRTL)()?Bv:Sv,label:r,toggleProps:{describedBy:l},popoverProps:xv,controls:o.map((e=>{const{align:n}=e,o=t===n;return{...e,isActive:o,role:a?"menuitemradio":void 0,onClick:d(n)}}))},h))};const Nv=e=>(0,s.createElement)(Tv,i({},e,{isToolbar:!1})),Pv=e=>(0,s.createElement)(Tv,i({},e,{isToolbar:!0}));var Mv={name:"blocks",className:"block-editor-autocompleters__block",triggerPrefix:"/",useItems(e){const{rootClientId:t,selectedBlockName:n}=(0,m.useSelect)((e=>{const{getSelectedBlockClientId:t,getBlockName:n,getBlockInsertionPoint:o}=e(Qn),r=t();return{selectedBlockName:r?n(r):null,rootClientId:o().rootClientId}}),[]),[o,r,l]=wd(t,u.noop),i=(0,s.useMemo)((()=>(e.trim()?Yd(o,r,l,e):(0,u.orderBy)(o,["frecency"],["desc"])).filter((e=>e.name!==n)).slice(0,9)),[e,n,o,r,l]);return[(0,s.useMemo)((()=>i.map((e=>{const{title:t,icon:n,isDisabled:o}=e;return{key:`block-${e.id}`,value:e,label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Dc,{key:"icon",icon:n,showColors:!0}),t),isDisabled:o}}))),[i])]},allowContext:(e,t)=>!(/\S/.test(e)||/\S/.test(t)),getOptionCompletion(e){const{name:t,initialAttributes:n,innerBlocks:o}=e;return{action:"replace",value:(0,r.createBlock)(t,n,(0,r.createBlocksFromInnerBlocksTemplate)(o))}}},Rv=window.wp.apiFetch,Lv=n.n(Rv),Av=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M7 5.5h10a.5.5 0 01.5.5v12a.5.5 0 01-.5.5H7a.5.5 0 01-.5-.5V6a.5.5 0 01.5-.5zM17 4H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V6a2 2 0 00-2-2zm-1 3.75H8v1.5h8v-1.5zM8 11h8v1.5H8V11zm6 3.25H8v1.5h6v-1.5z"})),Dv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"m7.3 9.7 1.4 1.4c.2-.2.3-.3.4-.5 0 0 0-.1.1-.1.3-.5.4-1.1.3-1.6L12 7 9 4 7.2 6.5c-.6-.1-1.1 0-1.6.3 0 0-.1 0-.1.1-.3.1-.4.2-.6.4l1.4 1.4L4 11v1h1l2.3-2.3zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z"})),Ov={name:"links",className:"block-editor-autocompleters__link",triggerPrefix:"[[",options:async e=>{let t=await Lv()({path:(0,rp.addQueryArgs)("/wp/v2/search",{per_page:10,search:e,type:"post",order_by:"menu_order"})});return t=t.filter((e=>""!==e.title)),t},getOptionKeywords:e=>[...e.title.split(/\s+/)],getOptionLabel:e=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ir,{key:"icon",icon:"page"===e.subtype?Av:Dv}),e.title),getOptionCompletion:e=>(0,s.createElement)("a",{href:e.url},e.title)};const Fv=[];function zv(e){let{completers:t=Fv}=e;const{name:n}=eo();return(0,s.useMemo)((()=>{let e=t;return(n===(0,r.getDefaultBlockName)()||(0,r.getBlockSupport)(n,"__experimentalSlashInserter",!1))&&(e=e.concat([Mv,Ov])),(0,l.hasFilter)("editor.Autocomplete.completers")&&(e===t&&(e=e.map(u.clone)),e=(0,l.applyFilters)("editor.Autocomplete.completers",e,n)),e}),[t,n])}var Vv=function(e){return(0,s.createElement)(p.Autocomplete,i({},e,{completers:zv(e)}))},Hv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M4.2 9h1.5V5.8H9V4.2H4.2V9zm14 9.2H15v1.5h4.8V15h-1.5v3.2zM15 4.2v1.5h3.2V9h1.5V4.2H15zM5.8 15H4.2v4.8H9v-1.5H5.8V15z"})),Gv=function(e){let{isActive:t,label:n=(0,g.__)("Toggle full height"),onToggle:o,isDisabled:r}=e;return(0,s.createElement)(p.ToolbarButton,{isActive:t,icon:Hv,label:n,onClick:()=>o(!t),disabled:r})},Uv=function(e){const{label:t=(0,g.__)("Change matrix alignment"),onChange:n=u.noop,value:o="center",isDisabled:r}=e,l=(0,s.createElement)(p.__experimentalAlignmentMatrixControl.Icon,{value:o}),i="block-editor-block-alignment-matrix-control",a=`${i}__popover`;return(0,s.createElement)(p.Dropdown,{position:"bottom right",className:i,popoverProps:{className:a,isAlternate:!0},renderToggle:e=>{let{onToggle:n,isOpen:o}=e;return(0,s.createElement)(p.ToolbarButton,{onClick:n,"aria-haspopup":"true","aria-expanded":o,onKeyDown:e=>{o||e.keyCode!==yc.DOWN||(e.preventDefault(),n())},label:t,icon:l,showTooltip:!0,disabled:r})},renderContent:()=>(0,s.createElement)(p.__experimentalAlignmentMatrixControl,{hasFocusBorder:!1,onChange:n,value:o})})},Wv=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M10.8622 8.04053L14.2805 12.0286L10.8622 16.0167L9.72327 15.0405L12.3049 12.0286L9.72327 9.01672L10.8622 8.04053Z"})),$v=function(e){let{rootLabelText:t}=e;const{selectBlock:n,clearSelectedBlock:o}=(0,m.useDispatch)(Qn),{clientId:r,parents:l,hasSelection:i}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectedBlockClientId:n,getBlockParents:o}=e(Qn),r=n();return{parents:o(r),clientId:r,hasSelection:!!t().clientId}}),[]),a=t||(0,g.__)("Document");return(0,s.createElement)("ul",{className:"block-editor-block-breadcrumb",role:"list","aria-label":(0,g.__)("Block breadcrumb")},(0,s.createElement)("li",{className:i?void 0:"block-editor-block-breadcrumb__current","aria-current":i?void 0:"true"},i&&(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:o},a),!i&&a,!!r&&(0,s.createElement)(Ir,{icon:Wv,className:"block-editor-block-breadcrumb__separator"})),l.map((e=>(0,s.createElement)("li",{key:e},(0,s.createElement)(p.Button,{className:"block-editor-block-breadcrumb__button",variant:"tertiary",onClick:()=>n(e)},(0,s.createElement)(Ap,{clientId:e,maximumLength:35})),(0,s.createElement)(Ir,{icon:Wv,className:"block-editor-block-breadcrumb__separator"})))),!!r&&(0,s.createElement)("li",{className:"block-editor-block-breadcrumb__current","aria-current":"true"},(0,s.createElement)(Ap,{clientId:r,maximumLength:35})))};function jv(e){let{clientId:t,tagName:n="div",wrapperProps:o,className:r}=e;const[l,a]=(0,s.useState)(!0),[u,d]=(0,s.useState)(!1),{canEdit:p,isParentSelected:f,hasChildSelected:g,isDraggingBlocks:h,isParentHighlighted:v}=(0,m.useSelect)((e=>{const{isBlockSelected:n,hasSelectedInnerBlock:o,isDraggingBlocks:r,isBlockHighlighted:l,canEditBlock:i}=e(Qn);return{canEdit:i(t),isParentSelected:n(t),hasChildSelected:o(t,!0),isDraggingBlocks:r(),isParentHighlighted:l(t)}}),[t]),b=c()("block-editor-block-content-overlay",null==o?void 0:o.className,r,{"overlay-active":l,"parent-highlighted":v,"is-dragging-blocks":h});return(0,s.useEffect)((()=>{p?(f||g||l||a(!0),f&&!u&&l&&a(!1),g&&l&&a(!1)):a(!0)}),[f,g,l,u,p]),(0,s.createElement)(n,i({},o,{className:b,onMouseEnter:()=>d(!0),onMouseLeave:()=>d(!1),onMouseUp:l&&p?()=>a(!1):void 0}),null==o?void 0:o.children)}const Kv=()=>(0,s.createElement)(p.SVG,{xmlns:"https://www.w3.org/2000/svg",viewBox:"0 0 20 20"},(0,s.createElement)(p.Path,{d:"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z"})),qv=e=>{let{style:t,className:n}=e;return(0,s.createElement)("div",{className:"block-library-colors-selector__icon-container"},(0,s.createElement)("div",{className:`${n} block-library-colors-selector__state-selection`,style:t},(0,s.createElement)(Kv,null)))},Yv=e=>{let{TextColor:t,BackgroundColor:n}=e;return e=>{let{onToggle:o,isOpen:r}=e;return(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(p.ToolbarButton,{className:"components-toolbar__control block-library-colors-selector__toggle",label:(0,g.__)("Open Colors Selector"),onClick:o,onKeyDown:e=>{r||e.keyCode!==yc.DOWN||(e.preventDefault(),o())},icon:(0,s.createElement)(n,null,(0,s.createElement)(t,null,(0,s.createElement)(qv,null)))}))}};var Qv=e=>{let{children:t,...n}=e;return H()("wp.blockEditor.BlockColorsStyleSelector",{alternative:"block supports API",since:"6.1",version:"6.3"}),(0,s.createElement)(p.Dropdown,{position:"bottom right",className:"block-library-colors-selector",contentClassName:"block-library-colors-selector__popover",renderToggle:Yv(n),renderContent:()=>t})},Zv=(0,s.createElement)(O.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(O.Path,{d:"M13.8 5.2H3v1.5h10.8V5.2zm-3.6 12v1.5H21v-1.5H10.2zm7.2-6H6.6v1.5h10.8v-1.5z"}));const Xv=rc(p.__experimentalTreeGridRow);function Jv(e){let{isSelected:t,position:n,level:o,rowCount:r,children:l,className:a,path:u,...d}=e;const p=sc({isSelected:t,adjustScrolling:!1,enableAnimation:!0,triggerAnimationOnChange:u});return(0,s.createElement)(Xv,i({ref:p,className:c()("block-editor-list-view-leaf",a),level:o,positionInSet:n,setSize:r},d),l)}function eb(e){let{onClick:t}=e;return(0,s.createElement)("span",{className:"block-editor-list-view__expander",onClick:e=>t(e,{forceToggle:!0}),"aria-hidden":"true"},(0,s.createElement)(Ir,{icon:Wv}))}var tb=(0,s.forwardRef)((function(e,t){let{className:n,block:{clientId:o},onClick:r,onToggleExpanded:l,tabIndex:i,onFocus:a,onDragStart:u,onDragEnd:d,draggable:m}=e;const f=Rp(o),{isLocked:g}=Vm(o);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{className:c()("block-editor-list-view-block-select-button",n),onClick:r,onKeyDown:function(e){e.keyCode!==yc.ENTER&&e.keyCode!==yc.SPACE||r(e)},ref:t,tabIndex:i,onFocus:a,onDragStart:e=>{e.dataTransfer.clearData(),null==u||u(e)},onDragEnd:d,draggable:m,href:`#block-${o}`,"aria-hidden":!0},(0,s.createElement)(eb,{onClick:l}),(0,s.createElement)(Dc,{icon:null==f?void 0:f.icon,showColors:!0}),(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__title"},(0,s.createElement)(Ap,{clientId:o,maximumLength:35})),(null==f?void 0:f.anchor)&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__anchor"},f.anchor),g&&(0,s.createElement)("span",{className:"block-editor-list-view-block-select-button__lock"},(0,s.createElement)(Ir,{icon:zm}))))})),nb=(0,s.forwardRef)(((e,t)=>{let{onClick:n,onToggleExpanded:o,block:r,isSelected:l,position:a,siblingBlockCount:u,level:d,isExpanded:p,selectedClientIds:f,...g}=e;const{clientId:h}=r,{blockMovingClientId:v,selectedBlockInBlockEditor:b}=(0,m.useSelect)((e=>{const{hasBlockMovingClientId:t,getSelectedBlockClientId:n}=e(Qn);return{blockMovingClientId:t(),selectedBlockInBlockEditor:n()}}),[h]),k=v&&b===h,_=c()("block-editor-list-view-block-contents",{"is-dropping-before":k}),y=f.includes(h)?f:[h];return(0,s.createElement)(Dp,{clientIds:y},(e=>{let{draggable:c,onDragStart:m,onDragEnd:f}=e;return(0,s.createElement)(tb,i({ref:t,className:_,block:r,onClick:n,onToggleExpanded:o,isSelected:l,position:a,siblingBlockCount:u,level:d,draggable:c,onDragStart:m,onDragEnd:f,isExpanded:p},g))}))}));const ob=(0,s.createContext)({}),rb=()=>(0,s.useContext)(ob);var lb=(0,s.memo)((function e(t){let{block:n,isDragged:o,isSelected:l,isBranchSelected:i,selectBlock:a,position:u,level:f,rowCount:h,siblingBlockCount:v,showBlockMovers:b,path:k,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}=t;const C=(0,s.useRef)(null),[S,w]=(0,s.useState)(!1),{clientId:B}=n,I=l&&y[0]===B,x=l&&y[y.length-1]===B,{toggleBlockHighlight:T}=(0,m.useDispatch)(Qn),N=Rp(B),P=(0,m.useSelect)((e=>e(Qn).getBlockName(B)),[B]),M=(0,r.hasBlockSupport)(P,"__experimentalToolbar",!0),{isLocked:R}=Vm(B),L=`list-view-block-select-button__${(0,d.useInstanceId)(e)}`,A=((e,t,n)=>(0,g.sprintf)(
72
  /* translators: 1: The numerical position of the block. 2: The total number of blocks. 3. The level of nesting for the block. */
73
+ (0,g.__)("Block %1$d of %2$d, Level %3$d"),e,t,n))(u,v,f);let D=(0,g.__)("Link");N&&(D=R?(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the locked block.
74
+ (0,g.__)("%s link (locked)"),N.title):(0,g.sprintf)(// translators: %s: The title of the block. This string indicates a link to select the block.
75
+ (0,g.__)("%s link"),N.title));const O=N?(0,g.sprintf)(// translators: %s: The title of the block.
76
+ (0,g.__)("Options for %s block"),N.title):(0,g.__)("Options"),{isTreeGridMounted:F,expand:z,collapse:V}=rb(),H=b&&v>0,G=c()("block-editor-list-view-block__mover-cell",{"is-visible":S||l}),U=c()("block-editor-list-view-block__menu-cell",{"is-visible":S||I});(0,s.useEffect)((()=>{!F&&l&&C.current.focus()}),[]);const W=(0,s.useCallback)((()=>{w(!0),T(B,!0)}),[B,w,T]),$=(0,s.useCallback)((()=>{w(!1),T(B,!1)}),[B,w,T]),j=(0,s.useCallback)((e=>{a(e,B),e.preventDefault()}),[B,a]),K=(0,s.useCallback)((e=>{a(void 0,e)}),[a]),q=(0,s.useCallback)((e=>{e.preventDefault(),e.stopPropagation(),!0===_?V(B):!1===_&&z(B)}),[B,z,V,_]);let Y;H?Y=2:M||(Y=3);const Q=c()({"is-selected":l,"is-first-selected":I,"is-last-selected":x,"is-branch-selected":i,"is-dragging":o,"has-single-cell":!M}),Z=y.includes(B)?y:[B];return(0,s.createElement)(Jv,{className:Q,onMouseEnter:W,onMouseLeave:$,onFocus:W,onBlur:$,level:f,position:u,rowCount:h,path:k,id:`list-view-block-${B}`,"data-block":B,isExpanded:_,"aria-selected":!!l},(0,s.createElement)(p.__experimentalTreeGridCell,{className:"block-editor-list-view-block__contents-cell",colSpan:Y,ref:C,"aria-label":D,"aria-selected":!!l,"aria-expanded":_,"aria-describedby":L},(e=>{let{ref:t,tabIndex:o,onFocus:r}=e;return(0,s.createElement)("div",{className:"block-editor-list-view-block__contents-container"},(0,s.createElement)(nb,{block:n,onClick:j,onToggleExpanded:q,isSelected:l,position:u,siblingBlockCount:v,level:f,ref:t,tabIndex:o,onFocus:r,isExpanded:_,selectedClientIds:y,preventAnnouncement:E}),(0,s.createElement)("div",{className:"block-editor-list-view-block-select-button__description",id:L},A))})),H&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalTreeGridCell,{className:G,withoutGridItem:!0},(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Kp,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})),(0,s.createElement)(p.__experimentalTreeGridItem,null,(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(qp,{orientation:"vertical",clientIds:[B],ref:t,tabIndex:n,onFocus:o})})))),M&&(0,s.createElement)(p.__experimentalTreeGridCell,{className:U,"aria-selected":!!l},(e=>{let{ref:t,tabIndex:n,onFocus:o}=e;return(0,s.createElement)(Ym,{clientIds:Z,icon:Sm,label:O,toggleProps:{ref:t,className:"block-editor-list-view-block__menu",tabIndex:n,onFocus:o},disableOpenOnArrowDown:!0,__experimentalSelectBlock:K})})))}));function ib(e,t,n,o){var r;return(null==n?void 0:n.includes(e.clientId))?0:(null!==(r=t[e.clientId])&&void 0!==r?r:o)?1+e.innerBlocks.reduce(sb(t,n,o),0):1}const sb=(e,t,n)=>(o,r)=>{var l;return(null==t?void 0:t.includes(r.clientId))?o:(null!==(l=e[r.clientId])&&void 0!==l?l:n)&&r.innerBlocks.length>0?o+ib(r,e,t,n):o+1};function ab(e){const{blocks:t,selectBlock:n,showBlockMovers:o,selectedClientIds:r,level:l=1,path:i="",isBranchSelected:a=!1,listPosition:c=0,fixedListWindow:d,isExpanded:p}=e,{expandedState:f,draggedClientIds:g}=rb(),h=(0,u.compact)(t),v=h.length;let b=c;return(0,s.createElement)(s.Fragment,null,h.map(((e,t)=>{var c;const{clientId:k,innerBlocks:_}=e;t>0&&(b+=ib(h[t-1],f,g,p));const{itemInView:y}=d,E=y(b),C=t+1,S=i.length>0?`${i}_${C}`:`${C}`,w=!(null==_||!_.length),B=w?null!==(c=f[k])&&void 0!==c?c:p:void 0,I=!(null==g||!g.includes(k)),x=I||E,T=((e,t)=>(0,u.isArray)(t)&&t.length?-1!==t.indexOf(e):t===e)(k,r),N=a||T&&w;return(0,s.createElement)(m.AsyncModeProvider,{key:k,value:!T},x&&(0,s.createElement)(lb,{block:e,selectBlock:n,isSelected:T,isBranchSelected:N,isDragged:I,level:l,position:C,rowCount:v,siblingBlockCount:v,showBlockMovers:o,path:S,isExpanded:B,listPosition:b,selectedClientIds:r}),!x&&(0,s.createElement)("tr",null,(0,s.createElement)("td",{className:"block-editor-list-view-placeholder"})),w&&B&&!I&&(0,s.createElement)(ab,{blocks:_,selectBlock:n,showBlockMovers:o,level:l+1,path:S,listPosition:b+1,fixedListWindow:d,isBranchSelected:N,selectedClientIds:r,isExpanded:p}))})))}ab.defaultProps={selectBlock:()=>{}};var cb=(0,s.memo)(ab);function ub(e){let{listViewRef:t,blockDropTarget:n}=e;const{rootClientId:o,clientId:r,dropPosition:l}=n||{},[i,a]=(0,s.useMemo)((()=>t.current?[o?t.current.querySelector(`[data-block="${o}"]`):void 0,r?t.current.querySelector(`[data-block="${r}"]`):void 0]:[]),[o,r]),c=a||i,u=(0,s.useCallback)((()=>{if(!i)return 0;const e=c.getBoundingClientRect();return i.querySelector(".block-editor-block-icon").getBoundingClientRect().right-e.left}),[i,c]),d=(0,s.useMemo)((()=>{if(!c)return{};const e=u();return{width:c.offsetWidth-e}}),[u,c]),m=(0,s.useCallback)((()=>{if(!c)return{};const e=c.ownerDocument,t=c.getBoundingClientRect(),n=u(),o={left:t.left+n,right:t.right,width:0,height:t.height,ownerDocument:e};return"top"===l?{...o,top:t.top,bottom:t.top}:"bottom"===l||"inside"===l?{...o,top:t.bottom,bottom:t.bottom}:{}}),[c,l,u]);return c?(0,s.createElement)(p.Popover,{noArrow:!0,animate:!1,getAnchorRect:m,focusOnMount:!1,className:"block-editor-list-view-drop-indicator"},(0,s.createElement)("div",{style:d,className:"block-editor-list-view-drop-indicator__line"})):null}function db(e,t){return t.left<=e.x&&t.right>=e.x&&t.top<=e.y&&t.bottom>=e.y}const pb=["top","bottom"];const mb=(e,t)=>Array.isArray(t.clientIds)?{...e,...t.clientIds.reduce(((e,n)=>({...e,[n]:"expand"===t.type})),{})}:e;var fb=(0,s.forwardRef)((function(e,t){let{id:n,blocks:o,showBlockMovers:l=!1,isExpanded:i=!1}=e;const{clientIdsTree:a,draggedClientIds:c,selectedClientIds:f}=function(e){return(0,m.useSelect)((t=>{const{getDraggedBlockClientIds:n,getSelectedBlockClientIds:o,__unstableGetClientIdsTree:r}=t(Qn);return{selectedClientIds:o(),draggedClientIds:n(),clientIdsTree:e||r()}}),[e])}(o),{visibleBlockCount:h}=(0,m.useSelect)((e=>{const{getGlobalBlockCount:t,getClientIdsOfDescendants:n}=e(Qn),o=(null==c?void 0:c.length)>0?n(c).length+1:0;return{visibleBlockCount:t()-o}}),[c]),{updateBlockSelection:v}=function(){const{clearSelectedBlock:e,multiSelect:t,selectBlock:n}=(0,m.useDispatch)(Qn),{getBlockName:o,getBlockParents:l,getBlockSelectionStart:i,getBlockSelectionEnd:a,getSelectedBlockClientIds:c,hasMultiSelection:d,hasSelectedBlock:p}=(0,m.useSelect)(Qn),{getBlockType:f}=(0,m.useSelect)(r.store);return{updateBlockSelection:(0,s.useCallback)((async(r,s,a)=>{if(null==r||!r.shiftKey)return await e(),void n(s);r.preventDefault();const m="keydown"===r.type&&(r.keyCode===yc.UP||r.keyCode===yc.DOWN||r.keyCode===yc.HOME||r.keyCode===yc.END);if(!m&&!p()&&!d())return void n(s,null);const h=c(),v=[...l(s),s];m&&!h.some((e=>v.includes(e)))&&await e();let b=i(),k=s;m&&(p()||d()||(b=s),a&&(k=a));const _=l(b),y=l(k),{start:E,end:C}=function(e,t,n,o){const r=[...n,e],l=[...o,t],i=Math.min(r.length,l.length)-1;return{start:r[i],end:l[i]}}(b,k,_,y);await t(E,C,null);const S=c();if((r.keyCode===yc.HOME||r.keyCode===yc.END)&&S.length>1)return;const w=(0,u.difference)(h,S);let B;if(1===w.length){var I;const e=null===(I=f(o(w[0])))||void 0===I?void 0:I.title;e&&(B=(0,g.sprintf)(
77
  /* translators: %s: block name */
78
  (0,g.__)("%s deselected."),e))}else w.length>1&&(B=(0,g.sprintf)(
79
  /* translators: %s: number of deselected blocks */
80
+ (0,g.__)("%s blocks deselected."),w.length));B&&(0,Ht.speak)(B)}),[e,o,f,l,i,a,c,d,p,t,n])}}(),[b,k]=(0,s.useReducer)(mb,{}),{ref:_,target:y}=function(){const{getBlockRootClientId:e,getBlockIndex:t,getBlockCount:n,getDraggedBlockClientIds:o,canInsertBlocks:r}=(0,m.useSelect)(Qn),[l,i]=(0,s.useState)(),{rootClientId:a,blockIndex:c}=l||{},u=hf(a,c),p=o(),f=(0,d.useThrottle)((0,s.useCallback)(((o,l)=>{const s={x:o.clientX,y:o.clientY},a=!(null==p||!p.length),c=function(e,t){let n,o,r,l;for(const i of e){if(i.isDraggedBlock)continue;const s=i.element.getBoundingClientRect(),[a,c]=bf(t,s,pb),u=db(t,s);if(void 0===r||a<r||u){r=a;const t=e.indexOf(i),d=e[t-1];if("top"===c&&d&&d.rootClientId===i.rootClientId&&!d.isDraggedBlock?(o=d,n="bottom",l=d.element.getBoundingClientRect()):(o=i,n=c,l=s),u)break}}if(!o)return;const i="bottom"===n;if(i&&o.canInsertDraggedBlocksAsChild&&(o.innerBlockCount>0||function(e,t){const n=t.left+t.width/2;return e.x>n}(t,l)))return{rootClientId:o.clientId,blockIndex:0,dropPosition:"inside"};if(!o.canInsertDraggedBlocksAsSibling)return;const s=i?1:0;return{rootClientId:o.rootClientId,clientId:o.clientId,blockIndex:o.blockIndex+s,dropPosition:n}}(Array.from(l.querySelectorAll("[data-block]")).map((o=>{const l=o.dataset.block,i=e(l);return{clientId:l,rootClientId:i,blockIndex:t(l),element:o,isDraggedBlock:!!a&&p.includes(l),innerBlockCount:n(l),canInsertDraggedBlocksAsSibling:!a||r(p,i),canInsertDraggedBlocksAsChild:!a||r(p,l)}})),s);c&&i(c)}),[p]),200);return{ref:(0,d.__experimentalUseDropZone)({onDrop:u,onDragOver(e){f(e,e.currentTarget)},onDragEnd(){f.cancel(),i(null)}}),target:l}}(),E=(0,s.useRef)(),C=(0,d.useMergeRefs)([E,_,t]),S=(0,s.useRef)(!1),{setSelectedTreeId:w}=function(e){let{firstSelectedBlockClientId:t,setExpandedState:n}=e;const[o,r]=(0,s.useState)(null),{selectedBlockParentClientIds:l}=(0,m.useSelect)((e=>{const{getBlockParents:n}=e(Qn);return{selectedBlockParentClientIds:n(t,!1)}}),[t]),i=Array.isArray(l)&&l.length?l:null;return(0,s.useEffect)((()=>{o!==t&&i&&n({type:"expand",clientIds:l})}),[t]),{setSelectedTreeId:r}}({firstSelectedBlockClientId:f[0],setExpandedState:k}),B=(0,s.useCallback)(((e,t)=>{v(e,t),w(t)}),[w,v]);(0,s.useEffect)((()=>{S.current=!0}),[]);const[I]=(0,d.__experimentalUseFixedWindowList)(E,36,h,{useWindowing:!0,windowOverscan:40}),x=(0,s.useCallback)((e=>{e&&k({type:"expand",clientIds:[e]})}),[k]),T=(0,s.useCallback)((e=>{e&&k({type:"collapse",clientIds:[e]})}),[k]),N=(0,s.useCallback)((e=>{var t;x(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[x]),P=(0,s.useCallback)((e=>{var t;T(null==e||null===(t=e.dataset)||void 0===t?void 0:t.block)}),[T]),M=(0,s.useCallback)(((e,t,n)=>{var o,r;e.shiftKey&&v(e,null==t||null===(o=t.dataset)||void 0===o?void 0:o.block,null==n||null===(r=n.dataset)||void 0===r?void 0:r.block)}),[v]),R=(0,s.useMemo)((()=>({isTreeGridMounted:S.current,draggedClientIds:c,expandedState:b,expand:x,collapse:T})),[S.current,c,b,x,T]);return(0,s.createElement)(m.AsyncModeProvider,{value:!0},(0,s.createElement)(ub,{listViewRef:E,blockDropTarget:y}),(0,s.createElement)(p.__experimentalTreeGrid,{id:n,className:"block-editor-list-view-tree","aria-label":(0,g.__)("Block navigation structure"),ref:C,onCollapseRow:P,onExpandRow:N,onFocusRow:M},(0,s.createElement)(ob.Provider,{value:R},(0,s.createElement)(cb,{blocks:a,selectBlock:B,showBlockMovers:l,fixedListWindow:I,selectedClientIds:f,isExpanded:i}))))}));function gb(e){let{isEnabled:t,onToggle:n,isOpen:o,innerRef:r,...l}=e;return(0,s.createElement)(p.Button,i({},l,{ref:r,icon:Zv,"aria-expanded":o,"aria-haspopup":"true",onClick:t?n:void 0
81
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("List view"),className:"block-editor-block-navigation","aria-disabled":!t}))}var hb=(0,s.forwardRef)((function(e,t){let{isDisabled:n,...o}=e;H()("wp.blockEditor.BlockNavigationDropdown",{since:"6.1",alternative:"wp.components.Dropdown and wp.blockEditor.ListView"});const r=(0,m.useSelect)((e=>!!e(Qn).getBlockCount()),[])&&!n;return(0,s.createElement)(p.Dropdown,{contentClassName:"block-editor-block-navigation__popover",position:"bottom right",renderToggle:e=>{let{isOpen:n,onToggle:l}=e;return(0,s.createElement)(gb,i({},o,{innerRef:t,isOpen:n,onToggle:l,isEnabled:r}))},renderContent:()=>(0,s.createElement)("div",{className:"block-editor-block-navigation__container"},(0,s.createElement)("p",{className:"block-editor-block-navigation__label"},(0,g.__)("List view")),(0,s.createElement)(fb,null))})}));function vb(e){let{genericPreviewBlock:t,style:n,className:o,activeStyle:r}=e;const l=am(o,r,n),i=(0,s.useMemo)((()=>({...t,title:n.label||n.name,description:n.description,initialAttributes:{...t.attributes,className:l+" block-editor-block-styles__block-preview-container"}})),[t,l]);return(0,s.createElement)(md,{item:i,isStylePreview:!0})}function bb(e){let{children:t,scope:n,...o}=e;return(0,s.createElement)(p.Fill,{name:`BlockStylesPreviewPanel/${n}`},(0,s.createElement)("div",o,t))}function kb(e){let{clientId:t,onSwitch:n=u.noop,onHoverClassName:o=u.noop,scope:r}=e;const{onSelect:l,stylesToRender:i,activeStyle:a,genericPreviewBlock:m,className:f}=um({clientId:t,onSwitch:n}),[g,h]=(0,s.useState)(null),[v,b]=(0,s.useState)(0),k=(0,d.useViewportMatch)("medium","<");if((0,s.useLayoutEffect)((()=>{const e=document.querySelector(".interface-interface-skeleton__content"),t=(null==e?void 0:e.scrollTop)||0;b(t+16)}),[g]),!i||0===i.length)return null;const _=(0,u.debounce)(h,250),y=e=>{var t;g!==e?(_(e),o(null!==(t=null==e?void 0:e.name)&&void 0!==t?t:null)):_.cancel()};return(0,s.createElement)("div",{className:"block-editor-block-styles"},(0,s.createElement)("div",{className:"block-editor-block-styles__variants"},i.map((e=>{const t=e.label||e.name;return(0,s.createElement)(p.Button,{className:c()("block-editor-block-styles__item",{"is-active":a.name===e.name}),key:e.name,variant:"secondary",label:t,onMouseEnter:()=>y(e),onFocus:()=>y(e),onMouseLeave:()=>y(null),onBlur:()=>y(null),onClick:()=>(e=>{l(e),o(null),h(null),_.cancel()})(e),"aria-current":a.name===e.name},(0,s.createElement)(p.__experimentalText,{as:"span",limit:12,ellipsizeMode:"tail",className:"block-editor-block-styles__item-text",truncate:!0},t))}))),g&&!k&&(0,s.createElement)(bb,{scope:r,className:"block-editor-block-styles__preview-panel",style:{top:v},onMouseLeave:()=>y(null)},(0,s.createElement)(vb,{activeStyle:a,className:f,genericPreviewBlock:m,style:g})))}kb.Slot=function(e){let{scope:t}=e;return(0,s.createElement)(p.Slot,{name:`BlockStylesPreviewPanel/${t}`})};var _b=kb,yb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18 5.5H6a.5.5 0 00-.5.5v3h13V6a.5.5 0 00-.5-.5zm.5 5H10v8h8a.5.5 0 00.5-.5v-7.5zm-10 0h-3V18a.5.5 0 00.5.5h2.5v-8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z"})),Eb=function(e){let{icon:t=yb,label:n=(0,g.__)("Choose variation"),instructions:o=(0,g.__)("Select a variation to start with."),variations:r,onSelect:l,allowSkip:i}=e;const a=c()("block-editor-block-variation-picker",{"has-many-variations":r.length>4});return(0,s.createElement)(p.Placeholder,{icon:t,label:n,instructions:o,className:a},(0,s.createElement)("ul",{className:"block-editor-block-variation-picker__variations",role:"list","aria-label":(0,g.__)("Block variations")},r.map((e=>(0,s.createElement)("li",{key:e.name},(0,s.createElement)(p.Button,{variant:"secondary",icon:e.icon,iconSize:48,onClick:()=>l(e),className:"block-editor-block-variation-picker__variation",label:e.description||e.title}),(0,s.createElement)("span",{className:"block-editor-block-variation-picker__variation-label",role:"presentation"},e.title))))),i&&(0,s.createElement)("div",{className:"block-editor-block-variation-picker__skip"},(0,s.createElement)(p.Button,{variant:"link",onClick:()=>l()},(0,g.__)("Skip"))))},Cb=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7.8 16.5H5c-.3 0-.5-.2-.5-.5v-6.2h6.8v6.7zm0-8.3H4.5V5c0-.3.2-.5.5-.5h6.2v6.7zm8.3 7.8c0 .3-.2.5-.5.5h-6.2v-6.8h6.8V19zm0-7.8h-6.8V4.5H19c.3 0 .5.2.5.5v6.2z",fillRule:"evenodd",clipRule:"evenodd"}));const Sb="carousel",wb="grid",Bb=e=>{let{onStartBlank:t,onBlockPatternSelect:n}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__actions"},t&&(0,s.createElement)(p.Button,{onClick:t},(0,g.__)("Start blank")),(0,s.createElement)(p.Button,{variant:"primary",onClick:n},(0,g.__)("Choose")))},Ib=e=>{let{handlePrevious:t,handleNext:n,activeSlide:o,totalSlides:r}=e;return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__navigation"},(0,s.createElement)(p.Button,{icon:Hp,label:(0,g.__)("Previous pattern"),onClick:t,disabled:0===o}),(0,s.createElement)(p.Button,{icon:Vp,label:(0,g.__)("Next pattern"),onClick:n,disabled:o===r-1}))};var xb=e=>{let{viewMode:t,setViewMode:n,handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i,onBlockPatternSelect:a,onStartBlank:c}=e;const u=t===Sb,d=(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__display-controls"},(0,s.createElement)(p.Button,{icon:Ur,label:(0,g.__)("Carousel view"),onClick:()=>n(Sb),isPressed:u}),(0,s.createElement)(p.Button,{icon:Cb,label:(0,g.__)("Grid view"),onClick:()=>n(wb),isPressed:t===wb}));return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__toolbar"},u&&(0,s.createElement)(Ib,{handlePrevious:o,handleNext:r,activeSlide:l,totalSlides:i}),d,u&&(0,s.createElement)(Bb,{onBlockPatternSelect:a,onStartBlank:c}))};const Tb=e=>{let{viewMode:t,activeSlide:n,patterns:o,onBlockPatternSelect:r,height:l}=e;const a=(0,p.__unstableUseCompositeState)(),c="block-editor-block-pattern-setup__container";if(t===Sb){const e=new Map([[n,"active-slide"],[n-1,"previous-slide"],[n+1,"next-slide"]]);return(0,s.createElement)("div",{className:"block-editor-block-pattern-setup__carousel",style:{height:l}},(0,s.createElement)("div",{className:c},(0,s.createElement)("ul",{className:"carousel-container"},o.map(((t,n)=>(0,s.createElement)(Pb,{className:e.get(n)||"",key:t.name,pattern:t,minHeight:l}))))))}return(0,s.createElement)("div",{style:{height:l},className:"block-editor-block-pattern-setup__grid"},(0,s.createElement)(p.__unstableComposite,i({},a,{role:"listbox",className:c,"aria-label":(0,g.__)("Patterns list")}),o.map((e=>(0,s.createElement)(Nb,{key:e.name,pattern:e,onSelect:r,composite:a})))))};function Nb(e){let{pattern:t,onSelect:n,composite:o}=e;const r="block-editor-block-pattern-setup-list",{blocks:l,description:a,viewportWidth:c=700}=t,u=(0,d.useInstanceId)(Nb,`${r}__item-description`);return(0,s.createElement)("div",{className:`${r}__list-item`,"aria-label":t.title,"aria-describedby":t.description?u:void 0},(0,s.createElement)(p.__unstableCompositeItem,i({role:"option",as:"div"},o,{className:`${r}__item`,onClick:()=>n(l)}),(0,s.createElement)(dd,{blocks:l,viewportWidth:c})),!!a&&(0,s.createElement)(p.VisuallyHidden,{id:u},a))}function Pb(e){let{className:t,pattern:n,minHeight:o}=e;const{blocks:r,title:l,description:i}=n,a=(0,d.useInstanceId)(Pb,"block-editor-block-pattern-setup-list__item-description");return(0,s.createElement)("li",{className:`pattern-slide ${t}`,"aria-label":l,"aria-describedby":i?a:void 0},(0,s.createElement)(dd,{blocks:r,__experimentalMinHeight:o}),!!i&&(0,s.createElement)(p.VisuallyHidden,{id:a},i))}var Mb=e=>{let{clientId:t,blockName:n,filterPatternsFn:o,startBlankComponent:l,onBlockPatternSelect:i}=e;const[a,c]=(0,s.useState)(Sb),[u,p]=(0,s.useState)(0),[f,g]=(0,s.useState)(!1),{replaceBlock:h}=(0,m.useDispatch)(Qn),v=function(e,t,n){return(0,m.useSelect)((o=>{const{getBlockRootClientId:r,__experimentalGetPatternsByBlockTypes:l,__experimentalGetAllowedPatterns:i}=o(Qn),s=r(e);return n?i(s).filter(n):l(t,s)}),[e,t,n])}(t,n,o),[b,{height:k}]=(0,d.useResizeObserver)();if(null==v||!v.length||f)return l;const _=i||(e=>{const n=e.map((e=>(0,r.cloneBlock)(e)));h(t,n)}),y=l?()=>{g(!0)}:void 0;return(0,s.createElement)(s.Fragment,null,b,(0,s.createElement)("div",{className:`block-editor-block-pattern-setup view-mode-${a}`},(0,s.createElement)(Tb,{viewMode:a,activeSlide:u,patterns:v,onBlockPatternSelect:_,height:k-120}),(0,s.createElement)(xb,{viewMode:a,setViewMode:c,activeSlide:u,totalSlides:v.length,handleNext:()=>{p((e=>e+1))},handlePrevious:()=>{p((e=>e-1))},onBlockPatternSelect:()=>{_(v[u].blocks)},onStartBlank:y})))};function Rb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;return(0,s.createElement)("fieldset",{className:t},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Transform to variation")),r.map((e=>(0,s.createElement)(p.Button,{key:e.name,icon:e.icon,isPressed:o===e.name,label:o===e.name?e.title:(0,g.sprintf)(
82
  /* translators: %s: Name of the block variation */
83
+ (0,g.__)("Transform to %s"),e.title),onClick:()=>n(e.name),"aria-label":e.title,showTooltip:!0}))))}function Lb(e){let{className:t,onSelectVariation:n,selectedValue:o,variations:r}=e;const l=r.map((e=>{let{name:t,title:n,description:o}=e;return{value:t,label:n,info:o}}));return(0,s.createElement)(p.DropdownMenu,{className:t,label:(0,g.__)("Transform to variation"),text:(0,g.__)("Transform to variation"),popoverProps:{position:"bottom center",className:`${t}__popover`},icon:Up,toggleProps:{iconPosition:"right"}},(()=>(0,s.createElement)("div",{className:`${t}__container`},(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItemsChoice,{choices:l,value:o,onSelect:n})))))}var Ab=function(e){let{blockClientId:t}=e;const{updateBlockAttributes:n}=(0,m.useDispatch)(Qn),{activeBlockVariation:o,variations:l}=(0,m.useSelect)((e=>{const{getActiveBlockVariation:n,getBlockVariations:o}=e(r.store),{getBlockName:l,getBlockAttributes:i}=e(Qn),s=t&&l(t);return{activeBlockVariation:n(s,i(t)),variations:s&&o(s,"transform")}}),[t]),i=null==o?void 0:o.name,a=(0,s.useMemo)((()=>{const e=new Set;return l.forEach((t=>{t.icon&&e.add(t.icon)})),e.size===l.length}),[l]);if(null==l||!l.length)return null;const c=a?Rb:Lb;return(0,s.createElement)(c,{className:"block-editor-block-variation-transforms",onSelectVariation:e=>{n(t,{...l.find((t=>{let{name:n}=t;return n===e})).attributes})},selectedValue:i,variations:l})},Db=(0,d.createHigherOrderComponent)((e=>t=>{const n=Co("color.palette"),o=!Co("color.custom"),r=void 0===t.colors?n:t.colors,l=void 0===t.disableCustomColors?o:t.disableCustomColors,a=!(0,u.isEmpty)(r)||!l;return(0,s.createElement)(e,i({},t,{colors:r,disableCustomColors:l,hasColorsToChoose:a}))}),"withColorContext"),Ob=Db(p.ColorPalette);function Fb(e){let{onChange:t,value:n,...o}=e;return(0,s.createElement)(bg,i({},o,{onColorChange:t,colorValue:n,gradients:[],disableCustomGradients:!0}))}var zb=window.wp.date;const Vb=new Date(2022,0,25);function Hb(e){let{format:t,defaultFormat:n,onChange:o}=e;return(0,s.createElement)("fieldset",{className:"block-editor-date-format-picker"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Date format")),(0,s.createElement)(p.ToggleControl,{label:(0,s.createElement)(s.Fragment,null,(0,g.__)("Default format"),(0,s.createElement)("span",{className:"block-editor-date-format-picker__default-format-toggle-control__hint"},(0,zb.dateI18n)(n,Vb))),checked:!t,onChange:e=>o(e?null:n)}),t&&(0,s.createElement)(Gb,{format:t,onChange:o}))}function Gb(e){var t;let{format:n,onChange:o}=e;const r=(0,u.uniq)(["Y-m-d",(0,g._x)("n/j/Y","short date format"),(0,g._x)("n/j/Y g:i A","short date format with time"),(0,g._x)("M j, Y","medium date format"),(0,g._x)("M j, Y g:i A","medium date format with time"),(0,g._x)("F j, Y","long date format")]),l=r.map(((e,t)=>({key:`suggested-${t}`,name:(0,zb.dateI18n)(e,Vb),format:e}))),i={key:"custom",name:(0,g.__)("Custom"),className:"block-editor-date-format-picker__custom-format-select-control__custom-option",__experimentalHint:(0,g.__)("Enter your own date format")},[a,c]=(0,s.useState)((()=>!!n&&!r.includes(n)));return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.BaseControl,{className:"block-editor-date-format-picker__custom-format-select-control"},(0,s.createElement)(p.CustomSelectControl,{label:(0,g.__)("Choose a format"),options:[...l,i],value:a?i:null!==(t=l.find((e=>e.format===n)))&&void 0!==t?t:i,onChange:e=>{let{selectedItem:t}=e;t===i?c(!0):(c(!1),o(t.format))}})),a&&(0,s.createElement)(p.TextControl,{label:(0,g.__)("Custom format"),hideLabelFromVision:!0,help:(0,s.createInterpolateElement)((0,g.__)("Enter a date or time <Link>format string</Link>."),{Link:(0,s.createElement)(p.ExternalLink,{href:(0,g.__)("https://wordpress.org/support/article/formatting-date-and-time/")})}),value:n,onChange:e=>o(e)}))}function Ub(e){let t,{colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d,settings:m}=e;return u&&(t="bottom left"),(0,s.createElement)(p.__experimentalItemGroup,{isBordered:!0,isSeparated:!0,className:"block-editor-panel-color-gradient-settings__item-group"},m.map(((e,m)=>e&&(0,s.createElement)(p.Dropdown,{key:m,position:t,className:"block-editor-panel-color-gradient-settings__dropdown",contentClassName:"block-editor-panel-color-gradient-settings__dropdown-content",renderToggle:t=>{var n;let{isOpen:o,onToggle:r}=t;return(0,s.createElement)(p.__experimentalItem,{onClick:r,className:c()("block-editor-panel-color-gradient-settings__item",{"is-open":o})},(0,s.createElement)(p.__experimentalHStack,{justify:"flex-start"},(0,s.createElement)(p.ColorIndicator,{className:"block-editor-panel-color-gradient-settings__color-indicator",colorValue:null!==(n=e.gradientValue)&&void 0!==n?n:e.colorValue}),(0,s.createElement)(p.FlexItem,null,e.label)))},renderContent:()=>(0,s.createElement)(bg,i({showTitle:!1,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:a,__experimentalIsRenderedInSidebar:u,enableAlpha:d},e))}))))}
84
  // translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
85
+ const Wb=(0,g.__)("(%s: color %s)"),$b=(0,g.__)("(%s: gradient %s)"),jb=["colors","disableCustomColors","gradients","disableCustomGradients"],Kb=e=>{let{colors:t,gradients:n,settings:o}=e;return o.map(((e,o)=>{let r,{colorValue:l,gradientValue:i,label:a,colors:c,gradients:u}=e;if(!l&&!i)return null;if(l){const e=Kf(c||t,l);r=(0,g.sprintf)(Wb,a.toLowerCase(),e&&e.name||l)}else{const e=dg(u||n,l);r=(0,g.sprintf)($b,a.toLowerCase(),e&&e.name||i)}return(0,s.createElement)(p.ColorIndicator,{key:o,colorValue:l||i,"aria-label":r})}))},qb=e=>{let{className:t,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,children:a,settings:d,title:m,showTitle:f=!0,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v,...b}=e;if((0,u.isEmpty)(n)&&(0,u.isEmpty)(o)&&r&&l&&(0,u.every)(d,(e=>(0,u.isEmpty)(e.colors)&&(0,u.isEmpty)(e.gradients)&&(void 0===e.disableCustomColors||e.disableCustomColors)&&(void 0===e.disableCustomGradients||e.disableCustomGradients))))return null;const k=(0,s.createElement)("span",{className:"block-editor-panel-color-gradient-settings__panel-title"},m,(0,s.createElement)(Kb,{colors:n,gradients:o,settings:d}));return(0,s.createElement)(p.PanelBody,i({className:c()("block-editor-panel-color-gradient-settings",t),title:f?k:void 0},b),(0,s.createElement)(Ub,{settings:d,colors:n,gradients:o,disableCustomColors:r,disableCustomGradients:l,__experimentalHasMultipleOrigins:g,__experimentalIsRenderedInSidebar:h,enableAlpha:v}),!!a&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.__experimentalSpacer,{marginY:4})," ",a))},Yb=e=>{const t=Yf();return t.colors=Co("color.palette"),t.gradients=Co("color.gradients"),(0,s.createElement)(qb,i({},t,e))},Qb=e=>{const t=Qf();return(0,s.createElement)(qb,i({},t,e))};// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)
86
+ var Zb=e=>(0,u.every)(jb,(t=>e.hasOwnProperty(t)))?(0,s.createElement)(qb,e):e.__experimentalHasMultipleOrigins?(0,s.createElement)(Qb,e):(0,s.createElement)(Yb,e),Xb=function(e,t){return(Xb=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])})(e,t)},Jb=function(){return(Jb=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}).apply(this,arguments)};function ek(e,t,n,o){void 0===o&&(o=0);var r=dk(e,t,o),l=r.width,i=r.height;return e>=t*n&&l>t*n?{width:t*n,height:t}:l>t*n?{width:e,height:e/n}:l>i*n?{width:i*n,height:i}:{width:l,height:l/n}}function tk(e,t,n,o,r){void 0===r&&(r=0);var l=dk(t.width,t.height,r),i=l.width,s=l.height;return{x:nk(e.x,i,n.width,o),y:nk(e.y,s,n.height,o)}}function nk(e,t,n,o){var r=t*o/2-n/2;return Math.min(r,Math.max(e,-r))}function ok(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function rk(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function lk(e,t,n,o,r,l,i){void 0===l&&(l=0),void 0===i&&(i=!0);var s=i&&0===l?ik:sk,a={x:s(100,((t.width-n.width/r)/2-e.x/r)/t.width*100),y:s(100,((t.height-n.height/r)/2-e.y/r)/t.height*100),width:s(100,n.width/t.width*100/r),height:s(100,n.height/t.height*100/r)},c=Math.round(s(t.naturalWidth,a.width*t.naturalWidth/100)),u=Math.round(s(t.naturalHeight,a.height*t.naturalHeight/100)),d=t.naturalWidth>=t.naturalHeight*o?{width:Math.round(u*o),height:u}:{width:c,height:Math.round(c/o)};return{croppedAreaPercentages:a,croppedAreaPixels:Jb(Jb({},d),{x:Math.round(s(t.naturalWidth-d.width,a.x*t.naturalWidth/100)),y:Math.round(s(t.naturalHeight-d.height,a.y*t.naturalHeight/100))})}}function ik(e,t){return Math.min(e,Math.max(0,t))}function sk(e,t){return t}function ak(e,t,n){var o=t.width/t.naturalWidth,r=function(e,t,n){var o=t.width/t.naturalWidth;if(n)return n.height>n.width?n.height/o/e.height:n.width/o/e.width;var r=e.width/e.height;return t.naturalWidth>=t.naturalHeight*r?t.naturalHeight/e.height:t.naturalWidth/e.width}(e,t,n),l=o*r;return{crop:{x:((t.naturalWidth-e.width)/2-e.x)*l,y:((t.naturalHeight-e.height)/2-e.y)*l},zoom:r}}function ck(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function uk(e,t,n,o,r){var l=Math.cos,i=Math.sin,s=r*Math.PI/180;return[(e-n)*l(s)-(t-o)*i(s)+n,(e-n)*i(s)+(t-o)*l(s)+o]}function dk(e,t,n){var o=e/2,r=t/2,l=[uk(0,0,o,r,n),uk(e,0,o,r,n),uk(e,t,o,r,n),uk(0,t,o,r,n)],i=Math.min.apply(Math,l.map((function(e){return e[0]}))),s=Math.max.apply(Math,l.map((function(e){return e[0]}))),a=Math.min.apply(Math,l.map((function(e){return e[1]})));return{width:s-i,height:Math.max.apply(Math,l.map((function(e){return e[1]})))-a}}function pk(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter((function(e){return"string"==typeof e&&e.length>0})).join(" ").trim()}var mk=function(e){function t(){var n=null!==e&&e.apply(this,arguments)||this;return n.imageRef=null,n.videoRef=null,n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.state={cropSize:null,hasWheelJustStarted:!1},n.preventZoomSafari=function(e){return e.preventDefault()},n.cleanEvents=function(){document.removeEventListener("mousemove",n.onMouseMove),document.removeEventListener("mouseup",n.onDragStopped),document.removeEventListener("touchmove",n.onTouchMove),document.removeEventListener("touchend",n.onDragStopped)},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){n.computeSizes(),n.emitCropData(),n.setInitialCrop(),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(){var e=n.props,t=e.initialCroppedAreaPixels,o=e.cropSize;if(t){var r=ak(t,n.mediaSize,o),l=r.crop,i=r.zoom;n.props.onCropChange(l),n.props.onZoomChange&&n.props.onZoomChange(i)}},n.computeSizes=function(){var e,t,o,r,l=n.imageRef||n.videoRef;if(l){n.mediaSize={width:l.offsetWidth,height:l.offsetHeight,naturalWidth:(null===(e=n.imageRef)||void 0===e?void 0:e.naturalWidth)||(null===(t=n.videoRef)||void 0===t?void 0:t.videoWidth)||0,naturalHeight:(null===(o=n.imageRef)||void 0===o?void 0:o.naturalHeight)||(null===(r=n.videoRef)||void 0===r?void 0:r.videoHeight)||0};var i=n.props.cropSize?n.props.cropSize:ek(l.offsetWidth,l.offsetHeight,n.props.aspect,n.props.rotation);n.setState({cropSize:i},n.recomputeCropPosition)}n.containerRef&&(n.containerRect=n.containerRef.getBoundingClientRect())},n.onMouseDown=function(e){e.preventDefault(),document.addEventListener("mousemove",n.onMouseMove),document.addEventListener("mouseup",n.onDragStopped),n.onDragStart(t.getMousePoint(e))},n.onMouseMove=function(e){return n.onDrag(t.getMousePoint(e))},n.onTouchStart=function(e){e.preventDefault(),document.addEventListener("touchmove",n.onTouchMove,{passive:!1}),document.addEventListener("touchend",n.onDragStopped),2===e.touches.length?n.onPinchStart(e):1===e.touches.length&&n.onDragStart(t.getTouchPoint(e.touches[0]))},n.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?n.onPinchMove(e):1===e.touches.length&&n.onDrag(t.getTouchPoint(e.touches[0]))},n.onDragStart=function(e){var t,o,r=e.x,l=e.y;n.dragStartPosition={x:r,y:l},n.dragStartCrop=Jb({},n.props.crop),null===(o=(t=n.props).onInteractionStart)||void 0===o||o.call(t)},n.onDrag=function(e){var t=e.x,o=e.y;n.rafDragTimeout&&window.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=window.requestAnimationFrame((function(){if(n.state.cropSize&&void 0!==t&&void 0!==o){var e=t-n.dragStartPosition.x,r=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+e,y:n.dragStartCrop.y+r},i=n.props.restrictPosition?tk(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(i)}}))},n.onDragStopped=function(){var e,t;n.cleanEvents(),n.emitCropData(),null===(t=(e=n.props).onInteractionEnd)||void 0===t||t.call(e)},n.onWheel=function(e){e.preventDefault();var o=t.getMousePoint(e),r=n.props.zoom-e.deltaY*n.props.zoomSpeed/200;n.setNewZoom(r,o),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},(function(){var e,t;return null===(t=(e=n.props).onInteractionStart)||void 0===t?void 0:t.call(e)})),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=window.setTimeout((function(){return n.setState({hasWheelJustStarted:!1},(function(){var e,t;return null===(t=(e=n.props).onInteractionEnd)||void 0===t?void 0:t.call(e)}))}),250)},n.getPointOnContainer=function(e){var t=e.x,o=e.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(t-n.containerRect.left),y:n.containerRect.height/2-(o-n.containerRect.top)}},n.getPointOnMedia=function(e){var t=e.x,o=e.y,r=n.props,l=r.crop,i=r.zoom;return{x:(t+l.x)/i,y:(o+l.y)/i}},n.setNewZoom=function(e,t){if(n.state.cropSize&&n.props.onZoomChange){var o=n.getPointOnContainer(t),r=n.getPointOnMedia(o),l=Math.min(n.props.maxZoom,Math.max(e,n.props.minZoom)),i={x:r.x*l-o.x,y:r.y*l-o.y},s=n.props.restrictPosition?tk(i,n.mediaSize,n.state.cropSize,l,n.props.rotation):i;n.props.onCropChange(s),n.props.onZoomChange(l)}},n.emitCropData=function(){if(n.state.cropSize){var e=lk(n.props.restrictPosition?tk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition),t=e.croppedAreaPercentages,o=e.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(t,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var e=n.props.restrictPosition?tk(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(e),n.emitCropData()}},n}return function(e,t){function __(){this.constructor=e}Xb(e,t),e.prototype=null===t?Object.create(t):(__.prototype=t.prototype,new __)}(t,e),t.prototype.componentDidMount=function(){window.addEventListener("resize",this.computeSizes),this.containerRef&&(this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.preventZoomSafari),this.containerRef.addEventListener("gesturechange",this.preventZoomSafari)),this.props.disableAutomaticStylesInjection||(this.styleRef=document.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",document.head.appendChild(this.styleRef)),this.imageRef&&this.imageRef.complete&&this.onMediaLoad()},t.prototype.componentWillUnmount=function(){window.removeEventListener("resize",this.computeSizes),this.containerRef&&(this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.containerRef.removeEventListener("gesturechange",this.preventZoomSafari)),this.styleRef&&this.styleRef.remove(),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent()},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():e.cropSize!==this.props.cropSize&&this.computeSizes(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent())},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,n=e.aspect;return t?t.width/t.height:n},t.prototype.onPinchStart=function(e){var n=t.getTouchPoint(e.touches[0]),o=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=ok(n,o),this.lastPinchRotation=rk(n,o),this.onDragStart(ck(n,o))},t.prototype.onPinchMove=function(e){var n=this,o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]),l=ck(o,r);this.onDrag(l),this.rafPinchTimeout&&window.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=window.requestAnimationFrame((function(){var e=ok(o,r),t=n.props.zoom*(e/n.lastPinchDistance);n.setNewZoom(t,l),n.lastPinchDistance=e;var i=rk(o,r),s=n.props.rotation+(i-n.lastPinchRotation);n.props.onRotationChange&&n.props.onRotationChange(s),n.lastPinchRotation=i}))},t.prototype.render=function(){var e=this,t=this.props,n=t.image,o=t.video,r=t.mediaProps,l=t.crop,i=l.x,s=l.y,a=t.rotation,c=t.zoom,u=t.cropShape,d=t.showGrid,p=t.style,m=p.containerStyle,f=p.cropAreaStyle,g=p.mediaStyle,h=t.classes,v=h.containerClassName,b=h.cropAreaClassName,k=h.mediaClassName;return $l().createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(t){return e.containerRef=t},"data-testid":"container",style:m,className:pk("reactEasyCrop_Container",v)},n?$l().createElement("img",Jb({alt:"",className:pk("reactEasyCrop_Image",k)},r,{src:n,ref:function(t){return e.imageRef=t},style:Jb(Jb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),onLoad:this.onMediaLoad})):o&&$l().createElement("video",Jb({autoPlay:!0,loop:!0,muted:!0,className:pk("reactEasyCrop_Video",k)},r,{src:o,ref:function(t){return e.videoRef=t},onLoadedMetadata:this.onMediaLoad,style:Jb(Jb({},g),{transform:"translate("+i+"px, "+s+"px) rotate("+a+"deg) scale("+c+")"}),controls:!1})),this.state.cropSize&&$l().createElement("div",{style:Jb(Jb({},f),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:pk("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",d&&"reactEasyCrop_CropAreaGrid",b)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}($l().Component);const fk={position:"bottom right",isAlternate:!0};const gk=(0,s.createContext)({}),hk=()=>(0,s.useContext)(gk);function vk(e){let{id:t,url:n,naturalWidth:o,naturalHeight:r,isEditing:i,onFinishEditing:a,onSaveImage:c,children:u}=e;const d=function(e,t){const n=function(e){let{url:t,naturalWidth:n,naturalHeight:o}=e;const[r,i]=(0,s.useState)(),[a,c]=(0,s.useState)(),[u,d]=(0,s.useState)({x:0,y:0}),[p,m]=(0,s.useState)(),[f,g]=(0,s.useState)(),[h,v]=(0,s.useState)(),[b,k]=(0,s.useState)(),_=(0,s.useCallback)((()=>{d({x:0,y:0}),m(100),g(0),v(n/o),k(n/o)}),[n,o,d,m,g,v,k]),y=(0,s.useCallback)((()=>{const e=(f+90)%360;let r=n/o;if(f%180==90&&(r=o/n),0===e)return i(),g(e),v(1/h),void d({x:-u.y*r,y:u.x*r});const s=new window.Image;s.src=t,s.onload=function(t){const n=document.createElement("canvas");let o=0,l=0;e%180?(n.width=t.target.height,n.height=t.target.width):(n.width=t.target.width,n.height=t.target.height),90!==e&&180!==e||(o=n.width),270!==e&&180!==e||(l=n.height);const s=n.getContext("2d");s.translate(o,l),s.rotate(e*Math.PI/180),s.drawImage(t.target,0,0),n.toBlob((t=>{i(URL.createObjectURL(t)),g(e),v(1/h),d({x:-u.y*r,y:u.x*r})}))};const a=(0,l.applyFilters)("media.crossOrigin",void 0,t);"string"==typeof a&&(s.crossOrigin=a)}),[f,n,o,i,g,v,d]);return(0,s.useMemo)((()=>({editedUrl:r,setEditedUrl:i,crop:a,setCrop:c,position:u,setPosition:d,zoom:p,setZoom:m,rotation:f,setRotation:g,rotateClockwise:y,aspect:h,setAspect:v,defaultAspect:b,initializeTransformValues:_})),[r,i,a,c,u,d,p,m,f,g,y,h,v,b,_])}(e),{initializeTransformValues:o}=n;return(0,s.useEffect)((()=>{t&&o()}),[t,o]),n}({url:n,naturalWidth:o,naturalHeight:r},i),p=function(e){let{crop:t,rotation:n,height:o,width:r,aspect:l,url:i,id:a,onSaveImage:c,onFinishEditing:u}=e;const{createErrorNotice:d}=(0,m.useDispatch)(Nd.store),[p,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!1),u()}),[f,u]),v=(0,s.useCallback)((()=>{f(!0);let e={};(t.width<99.9||t.height<99.9)&&(e=t),n>0&&(e.rotation=n),e.src=i,Lv()({path:`/wp/v2/media/${a}/edit`,method:"POST",data:e}).then((e=>{c({id:e.id,url:e.source_url,height:o&&r?r/l:void 0})})).catch((e=>{d((0,g.sprintf)(
87
  /* translators: 1. Error message */
88
+ (0,g.__)("Could not edit image. %s"),e.message),{id:"image-editing-error",type:"snackbar"})})).finally((()=>{f(!1),u()}))}),[f,t,n,o,r,l,i,c,d,f,u]);return(0,s.useMemo)((()=>({isInProgress:p,apply:v,cancel:h})),[p,v,h])}({id:t,url:n,onSaveImage:c,onFinishEditing:a,...d}),f=(0,s.useMemo)((()=>({...d,...p})),[d,p]);return(0,s.createElement)(gk.Provider,{value:f},u)}function bk(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;const{isInProgress:a,editedUrl:u,position:d,zoom:m,aspect:f,setPosition:g,setCrop:h,setZoom:v,rotation:b}=hk();let k=o||r*l/i;return b%180==90&&(k=r*i/l),(0,s.createElement)("div",{className:c()("wp-block-image__crop-area",{"is-applying":a}),style:{width:n||r,height:k}},(0,s.createElement)(mk,{image:u||t,disabled:a,minZoom:1,maxZoom:3,crop:d,zoom:m/100,aspect:f,onCropChange:g,onCropComplete:e=>{h(e)},onZoomChange:e=>{v(100*e)}}),a&&(0,s.createElement)(p.Spinner,null))}var kk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13.5 6C10.5 6 8 8.5 8 11.5c0 1.1.3 2.1.9 3l-3.4 3 1 1.1 3.4-2.9c1 .9 2.2 1.4 3.6 1.4 3 0 5.5-2.5 5.5-5.5C19 8.5 16.5 6 13.5 6zm0 9.5c-2.2 0-4-1.8-4-4s1.8-4 4-4 4 1.8 4 4-1.8 4-4 4z"}));function _k(){const{isInProgress:e,zoom:t,setZoom:n}=hk();return(0,s.createElement)(p.Dropdown,{contentClassName:"wp-block-image__zoom",popoverProps:fk,renderToggle:t=>{let{isOpen:n,onToggle:o}=t;return(0,s.createElement)(p.ToolbarButton,{icon:kk,label:(0,g.__)("Zoom"),onClick:o,"aria-expanded":n,disabled:e})},renderContent:()=>(0,s.createElement)(p.RangeControl,{label:(0,g.__)("Zoom"),min:100,max:300,value:Math.round(t),onChange:n})})}var yk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 5.5h-13c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2v-9c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5h-13c-.3 0-.5-.2-.5-.5v-9c0-.3.2-.5.5-.5h13c.3 0 .5.2.5.5v9zM6.5 12H8v-2h2V8.5H6.5V12zm9.5 2h-2v1.5h3.5V12H16v2z"}));function Ek(e){let{aspectRatios:t,isDisabled:n,label:o,onClick:r,value:l}=e;return(0,s.createElement)(p.MenuGroup,{label:o},t.map((e=>{let{title:t,aspect:o}=e;return(0,s.createElement)(p.MenuItem,{key:o,disabled:n,onClick:()=>{r(o)},role:"menuitemradio",isSelected:o===l,icon:o===l?lm:void 0},t)})))}function Ck(e){let{toggleProps:t}=e;const{isInProgress:n,aspect:o,setAspect:r,defaultAspect:l}=hk();return(0,s.createElement)(p.DropdownMenu,{icon:yk,label:(0,g.__)("Aspect Ratio"),popoverProps:fk,toggleProps:t,className:"wp-block-image__aspect-ratio"},(e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ek,{isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("Original"),aspect:l},{title:(0,g.__)("Square"),aspect:1}]}),(0,s.createElement)(Ek,{label:(0,g.__)("Landscape"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("16:10"),aspect:1.6},{title:(0,g.__)("16:9"),aspect:16/9},{title:(0,g.__)("4:3"),aspect:4/3},{title:(0,g.__)("3:2"),aspect:1.5}]}),(0,s.createElement)(Ek,{label:(0,g.__)("Portrait"),isDisabled:n,onClick:e=>{r(e),t()},value:o,aspectRatios:[{title:(0,g.__)("10:16"),aspect:.625},{title:(0,g.__)("9:16"),aspect:9/16},{title:(0,g.__)("3:4"),aspect:3/4},{title:(0,g.__)("2:3"),aspect:2/3}]}))}))}var Sk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M15.1 4.8l-3-2.5V4c-4.4 0-8 3.6-8 8 0 3.7 2.5 6.9 6 7.7.3.1.6.1 1 .2l.2-1.5c-.4 0-.7-.1-1.1-.2l-.1.2v-.2c-2.6-.8-4.5-3.3-4.5-6.2 0-3.6 2.9-6.5 6.5-6.5v1.8l3-2.5zM20 11c-.2-1.4-.7-2.7-1.6-3.8l-1.2.8c.7.9 1.1 2 1.3 3.1L20 11zm-1.5 1.8c-.1.5-.2 1.1-.4 1.6s-.5 1-.8 1.5l1.2.9c.4-.5.8-1.1 1-1.8s.5-1.3.5-2l-1.5-.2zm-5.6 5.6l.2 1.5c1.4-.2 2.7-.7 3.8-1.6l-.9-1.1c-.9.7-2 1.1-3.1 1.2z"}));function wk(){const{isInProgress:e,rotateClockwise:t}=hk();return(0,s.createElement)(p.ToolbarButton,{icon:Sk,label:(0,g.__)("Rotate"),onClick:t,disabled:e})}function Bk(){const{isInProgress:e,apply:t,cancel:n}=hk();return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{onClick:t,disabled:e},(0,g.__)("Apply")),(0,s.createElement)(p.ToolbarButton,{onClick:n},(0,g.__)("Cancel")))}function Ik(e){let{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(bk,{url:t,width:n,height:o,clientWidth:r,naturalHeight:l,naturalWidth:i}),(0,s.createElement)(io,null,(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(_k,null),(0,s.createElement)(p.ToolbarItem,null,(e=>(0,s.createElement)(Ck,{toggleProps:e}))),(0,s.createElement)(wk,null)),(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(Bk,null))))}const xk=[25,50,75,100];function Tk(e){let{imageWidth:t,imageHeight:n,imageSizeOptions:o=[],isResizable:r=!0,slug:l,width:i,height:a,onChange:c,onChangeImage:d=u.noop}=e;const{currentHeight:m,currentWidth:f,updateDimension:h,updateDimensions:v}=function(e,t,n,o,r){var l,i;const[a,c]=(0,s.useState)(null!==(l=null!=t?t:o)&&void 0!==l?l:""),[u,d]=(0,s.useState)(null!==(i=null!=e?e:n)&&void 0!==i?i:"");return(0,s.useEffect)((()=>{void 0===t&&void 0!==o&&c(o),void 0===e&&void 0!==n&&d(n)}),[o,n]),(0,s.useEffect)((()=>{void 0!==t&&Number.parseInt(t)!==Number.parseInt(a)&&c(t),void 0!==e&&Number.parseInt(e)!==Number.parseInt(u)&&d(e)}),[t,e]),{currentHeight:u,currentWidth:a,updateDimension:(e,t)=>{"width"===e?c(t):d(t),r({[e]:""===t?void 0:parseInt(t,10)})},updateDimensions:(e,t)=>{d(null!=e?e:n),c(null!=t?t:o),r({height:e,width:t})}}}(a,i,n,t,c);return(0,s.createElement)(s.Fragment,null,!(0,u.isEmpty)(o)&&(0,s.createElement)(p.SelectControl,{label:(0,g.__)("Image size"),value:l,options:o,onChange:d}),r&&(0,s.createElement)("div",{className:"block-editor-image-size-control"},(0,s.createElement)("p",{className:"block-editor-image-size-control__row"},(0,g.__)("Image dimensions")),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__width",label:(0,g.__)("Width"),value:f,min:1,onChange:e=>h("width",e)}),(0,s.createElement)(p.TextControl,{type:"number",className:"block-editor-image-size-control__height",label:(0,g.__)("Height"),value:m,min:1,onChange:e=>h("height",e)})),(0,s.createElement)("div",{className:"block-editor-image-size-control__row"},(0,s.createElement)(p.ButtonGroup,{"aria-label":(0,g.__)("Image size presets")},xk.map((e=>{const o=Math.round(t*(e/100)),r=Math.round(n*(e/100)),l=f===o&&m===r;return(0,s.createElement)(p.Button,{key:e,isSmall:!0,variant:l?"primary":void 0,isPressed:l,onClick:()=>v(r,o)},e,"%")}))),(0,s.createElement)(p.Button,{isSmall:!0,onClick:()=>v()},(0,g.__)("Reset")))))}var Nk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"-2 -2 24 24"},(0,s.createElement)(O.Path,{d:"M6.734 16.106l2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.157 1.093-1.027-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734z"})),Pk=e=>{let{value:t,onChange:n=u.noop,settings:o}=e;if(!o||!o.length)return null;const r=e=>o=>{n({...t,[e.id]:o})},l=o.map((e=>(0,s.createElement)(p.ToggleControl,{className:"block-editor-link-control__setting",key:e.id,label:e.title,onChange:r(e),checked:!!t&&!!t[e.id]})));return(0,s.createElement)("fieldset",{className:"block-editor-link-control__settings"},(0,s.createElement)(p.VisuallyHidden,{as:"legend"},(0,g.__)("Currently selected link settings")),l)},Mk=n(5425),Rk=n.n(Mk);class Lk extends s.Component{constructor(e){super(e),this.onChange=this.onChange.bind(this),this.onFocus=this.onFocus.bind(this),this.onKeyDown=this.onKeyDown.bind(this),this.selectLink=this.selectLink.bind(this),this.handleOnClick=this.handleOnClick.bind(this),this.bindSuggestionNode=this.bindSuggestionNode.bind(this),this.autocompleteRef=e.autocompleteRef||(0,s.createRef)(),this.inputRef=(0,s.createRef)(),this.updateSuggestions=(0,u.debounce)(this.updateSuggestions.bind(this),200),this.suggestionNodes=[],this.isUpdatingSuggestions=!1,this.state={suggestions:[],showSuggestions:!1,selectedSuggestion:null,suggestionsListboxId:"",suggestionOptionIdPrefix:""}}componentDidUpdate(e){const{showSuggestions:t,selectedSuggestion:n}=this.state,{value:o,__experimentalShowInitialSuggestions:r=!1}=this.props;t&&null!==n&&this.suggestionNodes[n]&&!this.scrollingIntoView&&(this.scrollingIntoView=!0,Rk()(this.suggestionNodes[n],this.autocompleteRef.current,{onlyScrollIfNeeded:!0}),this.props.setTimeout((()=>{this.scrollingIntoView=!1}),100)),e.value===o||this.props.disableSuggestions||this.isUpdatingSuggestions||(null!=o&&o.length?this.updateSuggestions(o):r&&this.updateSuggestions())}componentDidMount(){this.shouldShowInitialSuggestions()&&this.updateSuggestions()}componentWillUnmount(){var e,t;null===(e=this.suggestionsRequest)||void 0===e||null===(t=e.cancel)||void 0===t||t.call(e),delete this.suggestionsRequest}bindSuggestionNode(e){return t=>{this.suggestionNodes[e]=t}}shouldShowInitialSuggestions(){const{suggestions:e}=this.state,{__experimentalShowInitialSuggestions:t=!1,value:n}=this.props;return!this.isUpdatingSuggestions&&t&&!(n&&n.length)&&!(e&&e.length)}updateSuggestions(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";const{__experimentalFetchLinkSuggestions:n,__experimentalHandleURLSuggestions:o}=this.props;if(!n)return;const r=!(null!==(e=t)&&void 0!==e&&e.length);if(t=t.trim(),!r&&(t.length<2||!o&&(0,rp.isURL)(t)))return void this.setState({showSuggestions:!1,selectedSuggestion:null,loading:!1});this.isUpdatingSuggestions=!0,this.setState({selectedSuggestion:null,loading:!0});const l=n(t,{isInitialSuggestions:r});l.then((e=>{this.suggestionsRequest===l&&(this.setState({suggestions:e,loading:!1,showSuggestions:!!e.length}),e.length?this.props.debouncedSpeak((0,g.sprintf)(
89
  /* translators: %s: number of results. */
90
+ (0,g._n)("%d result found, use up and down arrow keys to navigate.","%d results found, use up and down arrow keys to navigate.",e.length),e.length),"assertive"):this.props.debouncedSpeak((0,g.__)("No results."),"assertive"),this.isUpdatingSuggestions=!1)})).catch((()=>{this.suggestionsRequest===l&&(this.setState({loading:!1}),this.isUpdatingSuggestions=!1)})),this.suggestionsRequest=l}onChange(e){const t=e.target.value;this.props.onChange(t),this.props.disableSuggestions||this.updateSuggestions(t)}onFocus(){const{suggestions:e}=this.state,{disableSuggestions:t,value:n}=this.props;!n||t||this.isUpdatingSuggestions||e&&e.length||this.updateSuggestions(n)}onKeyDown(e){const{showSuggestions:t,selectedSuggestion:n,suggestions:o,loading:r}=this.state;if(!t||!o.length||r){switch(e.keyCode){case yc.UP:0!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(0,0));break;case yc.DOWN:this.props.value.length!==e.target.selectionStart&&(e.preventDefault(),e.target.setSelectionRange(this.props.value.length,this.props.value.length));break;case yc.ENTER:this.props.onSubmit&&this.props.onSubmit(null,e)}return}const l=this.state.suggestions[this.state.selectedSuggestion];switch(e.keyCode){case yc.UP:{e.preventDefault();const t=n?n-1:o.length-1;this.setState({selectedSuggestion:t});break}case yc.DOWN:{e.preventDefault();const t=null===n||n===o.length-1?0:n+1;this.setState({selectedSuggestion:t});break}case yc.TAB:null!==this.state.selectedSuggestion&&(this.selectLink(l),this.props.speak((0,g.__)("Link selected.")));break;case yc.ENTER:null!==this.state.selectedSuggestion?(this.selectLink(l),this.props.onSubmit&&this.props.onSubmit(l,e)):this.props.onSubmit&&this.props.onSubmit(null,e)}}selectLink(e){this.props.onChange(e.url,e),this.setState({selectedSuggestion:null,showSuggestions:!1})}handleOnClick(e){this.selectLink(e),this.inputRef.current.focus()}static getDerivedStateFromProps(e,t){let{value:n,instanceId:o,disableSuggestions:r,__experimentalShowInitialSuggestions:l=!1}=e,{showSuggestions:i}=t,s=i;const a=n&&n.length;return l||a||(s=!1),!0===r&&(s=!1),{showSuggestions:s,suggestionsListboxId:`block-editor-url-input-suggestions-${o}`,suggestionOptionIdPrefix:`block-editor-url-input-suggestion-${o}`}}render(){return(0,s.createElement)(s.Fragment,null,this.renderControl(),this.renderSuggestions())}renderControl(){const{label:e=null,className:t,isFullWidth:n,instanceId:o,placeholder:r=(0,g.__)("Paste URL or type to search"),__experimentalRenderControl:l,value:i=""}=this.props,{loading:a,showSuggestions:u,selectedSuggestion:d,suggestionsListboxId:m,suggestionOptionIdPrefix:f}=this.state,h=`url-input-control-${o}`,v={id:h,label:e,className:c()("block-editor-url-input",t,{"is-full-width":n})},b={id:h,value:i,required:!0,className:"block-editor-url-input__input",type:"text",onChange:this.onChange,onFocus:this.onFocus,placeholder:r,onKeyDown:this.onKeyDown,role:"combobox","aria-label":e?void 0:(0,g.__)("URL"),"aria-expanded":u,"aria-autocomplete":"list","aria-owns":m,"aria-activedescendant":null!==d?`${f}-${d}`:void 0,ref:this.inputRef};return l?l(v,b,a):(0,s.createElement)(p.BaseControl,v,(0,s.createElement)("input",b),a&&(0,s.createElement)(p.Spinner,null))}renderSuggestions(){const{className:e,__experimentalRenderSuggestions:t,value:n="",__experimentalShowInitialSuggestions:o=!1}=this.props,{showSuggestions:r,suggestions:l,selectedSuggestion:a,suggestionsListboxId:d,suggestionOptionIdPrefix:m,loading:f}=this.state,g={id:d,ref:this.autocompleteRef,role:"listbox"},h=(e,t)=>({role:"option",tabIndex:"-1",id:`${m}-${t}`,ref:this.bindSuggestionNode(t),"aria-selected":t===a});return(0,u.isFunction)(t)&&r&&l.length?t({suggestions:l,selectedSuggestion:a,suggestionsListProps:g,buildSuggestionItemProps:h,isLoading:f,handleSuggestionClick:this.handleOnClick,isInitialSuggestions:o&&!(n&&n.length)}):!(0,u.isFunction)(t)&&r&&l.length?(0,s.createElement)(p.Popover,{position:"bottom",noArrow:!0,focusOnMount:!1},(0,s.createElement)("div",i({},g,{className:c()("block-editor-url-input__suggestions",`${e}__suggestions`)}),l.map(((e,t)=>(0,s.createElement)(p.Button,i({},h(0,t),{key:e.id,className:c()("block-editor-url-input__suggestion",{"is-selected":t===a}),onClick:()=>this.handleOnClick(e)}),e.title))))):null}}var Ak=(0,d.compose)(d.withSafeTimeout,p.withSpokenMessages,d.withInstanceId,(0,m.withSelect)(((e,t)=>{if((0,u.isFunction)(t.__experimentalFetchLinkSuggestions))return;const{getSettings:n}=e(Qn);return{__experimentalFetchLinkSuggestions:n().__experimentalFetchLinkSuggestions}})))(Lk),Dk=e=>{let t,{searchTerm:n,onClick:o,itemProps:r,isSelected:l,buttonText:a}=e;return n?(t=a?(0,u.isFunction)(a)?a(n):a:(0,s.createInterpolateElement)((0,g.sprintf)(
91
  /* translators: %s: search term. */
92
+ (0,g.__)("Create: <mark>%s</mark>"),n),{mark:(0,s.createElement)("mark",null)}),(0,s.createElement)(p.Button,i({},r,{className:c()("block-editor-link-control__search-create block-editor-link-control__search-item",{"is-selected":l}),onClick:o}),(0,s.createElement)(Ir,{className:"block-editor-link-control__search-item-icon",icon:Mc}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},t)))):null},Ok=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.3c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8s-4-8.8-8.8-8.8zm6.5 5.5h-2.6C15.4 7.3 14.8 6 14 5c2 .6 3.6 2 4.5 3.8zm.7 3.2c0 .6-.1 1.2-.2 1.8h-2.9c.1-.6.1-1.2.1-1.8s-.1-1.2-.1-1.8H19c.2.6.2 1.2.2 1.8zM12 18.7c-1-.7-1.8-1.9-2.3-3.5h4.6c-.5 1.6-1.3 2.9-2.3 3.5zm-2.6-4.9c-.1-.6-.1-1.1-.1-1.8 0-.6.1-1.2.1-1.8h5.2c.1.6.1 1.1.1 1.8s-.1 1.2-.1 1.8H9.4zM4.8 12c0-.6.1-1.2.2-1.8h2.9c-.1.6-.1 1.2-.1 1.8 0 .6.1 1.2.1 1.8H5c-.2-.6-.2-1.2-.2-1.8zM12 5.3c1 .7 1.8 1.9 2.3 3.5H9.7c.5-1.6 1.3-2.9 2.3-3.5zM10 5c-.8 1-1.4 2.3-1.8 3.8H5.5C6.4 7 8 5.6 10 5zM5.5 15.3h2.6c.4 1.5 1 2.8 1.8 3.7-1.8-.6-3.5-2-4.4-3.7zM14 19c.8-1 1.4-2.2 1.8-3.7h2.6C17.6 17 16 18.4 14 19z"})),Fk=e=>{let{itemProps:t,suggestion:n,isSelected:o=!1,onClick:r,isURL:l=!1,searchTerm:a="",shouldShowType:u=!1}=e;return(0,s.createElement)(p.Button,i({},t,{onClick:r,className:c()("block-editor-link-control__search-item",{"is-selected":o,"is-url":l,"is-entity":!l})}),l&&(0,s.createElement)(Ir,{className:"block-editor-link-control__search-item-icon",icon:Ok}),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-title"},(0,s.createElement)(p.TextHighlight,{text:n.title,highlight:a})),(0,s.createElement)("span",{"aria-hidden":!l,className:"block-editor-link-control__search-item-info"},!l&&((0,rp.filterURLForDisplay)((0,rp.safeDecodeURI)(n.url))||""),l&&(0,g.__)("Press ENTER to add this link"))),u&&n.type&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-type"},function(e){return e.isFrontPage?"front page":"post_tag"===e.type?"tag":e.type}(n)))};const zk="__CREATE__",Vk=[{id:"opensInNewTab",title:(0,g.__)("Open in new tab")}];function Hk(e){let{instanceId:t,withCreateSuggestion:n,currentInputValue:o,handleSuggestionClick:r,suggestionsListProps:l,buildSuggestionItemProps:a,suggestions:u,selectedSuggestion:d,isLoading:m,isInitialSuggestions:f,createSuggestionButtonText:h,suggestionsQuery:v}=e;const b=c()("block-editor-link-control__search-results",{"is-loading":m}),k=["url","mailto","tel","internal"],_=1===u.length&&k.includes(u[0].type.toLowerCase()),y=n&&!_&&!f,E=!(null!=v&&v.type),C=`block-editor-link-control-search-results-label-${t}`,S=f?(0,g.__)("Recently updated"):(0,g.sprintf)(
93
  /* translators: %s: search term. */
94
+ (0,g.__)('Search results for "%s"'),o),w=(0,s.createElement)(f?s.Fragment:p.VisuallyHidden,{},(0,s.createElement)("span",{className:"block-editor-link-control__search-results-label",id:C},S));return(0,s.createElement)("div",{className:"block-editor-link-control__search-results-wrapper"},w,(0,s.createElement)("div",i({},l,{className:b,"aria-labelledby":C}),u.map(((e,t)=>y&&zk===e.type?(0,s.createElement)(Dk,{searchTerm:o,buttonText:h,onClick:()=>r(e),key:e.type,itemProps:a(e,t),isSelected:t===d}):zk===e.type?null:(0,s.createElement)(Fk,{key:`${e.id}-${e.type}`,itemProps:a(e,t),suggestion:e,index:t,onClick:()=>{r(e)},isSelected:t===d,isURL:k.includes(e.type.toLowerCase()),searchTerm:o,shouldShowType:E,isFrontPage:null==e?void 0:e.isFrontPage})))))}function Gk(e){const t=(0,u.startsWith)(e,"#");return(0,rp.isURL)(e)||e&&e.includes("www.")||t}const Uk=()=>Promise.resolve([]),Wk=e=>{let t="URL";const n=(0,rp.getProtocol)(e)||"";return n.includes("mailto")&&(t="mailto"),n.includes("tel")&&(t="tel"),(0,u.startsWith)(e,"#")&&(t="internal"),Promise.resolve([{id:e,title:e,url:"URL"===t?(0,rp.prependHTTP)(e):e,type:t}])};const $k=()=>Promise.resolve([]),jk=(0,s.forwardRef)(((e,t)=>{let{value:n,children:o,currentLink:r={},className:l=null,placeholder:i=null,withCreateSuggestion:a=!1,onCreateSuggestion:p=u.noop,onChange:f=u.noop,onSelect:h=u.noop,showSuggestions:v=!0,renderSuggestions:b=(e=>(0,s.createElement)(Hk,e)),fetchSuggestions:k=null,allowDirectEntry:_=!0,showInitialSuggestions:y=!1,suggestionsQuery:E={},withURLSuggestion:C=!0,createSuggestionButtonText:S,useLabel:w=!1}=e;const B=function(e,t,n,o){const{fetchSearchSuggestions:r,pageOnFront:l}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return{pageOnFront:t().pageOnFront,fetchSearchSuggestions:t().__experimentalFetchLinkSuggestions}}),[]),i=t?Wk:Uk;return(0,s.useCallback)(((t,s)=>{let{isInitialSuggestions:a}=s;return Gk(t)?i(t,{isInitialSuggestions:a}):(async(e,t,n,o,r,l,i)=>{const{isInitialSuggestions:s}=t;let a=!1,c=await Promise.all([n(e,t),o(e)]);c[0]=c[0].map((e=>Number(e.id)===i?(a=!0,e.isFrontPage=!0,e):e));const u=!e.includes(" ");return c=!a&&u&&l&&!s?c[0].concat(c[1]):c[0],s||Gk(e)||!r?c:c.concat({title:e,url:e,type:zk})})(t,{...e,isInitialSuggestions:a},r,i,n,o,l)}),[i,r,n])}(E,_,a,C),I=v?k||B:$k,x=(0,d.useInstanceId)(jk),[T,N]=(0,s.useState)(),P=async e=>{let t=e;if(zk!==e.type)(_||t&&Object.keys(t).length>=1)&&h({...(0,u.omit)(r,"id","url"),...t},t);else try{var n;t=await p(e.title),null!==(n=t)&&void 0!==n&&n.url&&h(t)}catch(e){}},M=c()(l,{"has-no-label":!w});return(0,s.createElement)("div",{className:"block-editor-link-control__search-input-container"},(0,s.createElement)(Ak,{label:w?"URL":void 0,className:M,value:n,onChange:(e,t)=>{f(e),N(t)},placeholder:null!=i?i:(0,g.__)("Search or type url"),__experimentalRenderSuggestions:v?e=>b({...e,instanceId:x,withCreateSuggestion:a,currentInputValue:n,createSuggestionButtonText:S,suggestionsQuery:E,handleSuggestionClick:t=>{e.handleSuggestionClick&&e.handleSuggestionClick(t),P(t)}}):null,__experimentalFetchLinkSuggestions:I,__experimentalHandleURLSuggestions:!0,__experimentalShowInitialSuggestions:y,onSubmit:(e,t)=>{var o;const r=e||T;r||null!=n&&null!==(o=n.trim())&&void 0!==o&&o.length?P(r||{url:n}):t.preventDefault()},ref:t}),o)}));var Kk=jk,qk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M12 3.2c-4.8 0-8.8 3.9-8.8 8.8 0 4.8 3.9 8.8 8.8 8.8 4.8 0 8.8-3.9 8.8-8.8 0-4.8-4-8.8-8.8-8.8zm0 16c-4 0-7.2-3.3-7.2-7.2C4.8 8 8 4.8 12 4.8s7.2 3.3 7.2 7.2c0 4-3.2 7.2-7.2 7.2zM11 17h2v-6h-2v6zm0-8h2V7h-2v2z"})),Yk=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20.1 5.1L16.9 2 6.2 12.7l-1.3 4.4 4.5-1.3L20.1 5.1zM4 20.8h8v-1.5H4v1.5z"}));const{Slot:Qk,Fill:Zk}=(0,p.createSlotFill)("BlockEditorLinkControlViewer");function Xk(e,t){switch(t.type){case"RESOLVED":return{...e,isFetching:!1,richData:t.richData};case"ERROR":return{...e,isFetching:!1,richData:null};case"LOADING":return{...e,isFetching:!0};default:throw new Error(`Unexpected action type ${t.type}`)}}function Jk(e){var t;let{value:n,onEditClick:o,hasRichPreviews:r=!1,hasUnlinkControl:l=!1,onRemove:i}=e;const a=r?null==n?void 0:n.url:null,{richData:u,isFetching:d}=function(e){const[t,n]=(0,s.useReducer)(Xk,{richData:null,isFetching:!1}),{fetchRichUrlData:o}=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return{fetchRichUrlData:t().__experimentalFetchRichUrlData}}),[]);return(0,s.useEffect)((()=>{if(null!=e&&e.length&&o&&"undefined"!=typeof AbortController){n({type:"LOADING"});const t=new window.AbortController,r=t.signal;return o(e,{signal:r}).then((e=>{n({type:"RESOLVED",richData:e})})).catch((()=>{r.aborted||n({type:"ERROR"})})),()=>{t.abort()}}}),[e]),t}(a),f=u&&Object.keys(u).length,h=n&&(0,rp.filterURLForDisplay)((0,rp.safeDecodeURI)(n.url),16)||"",v=(null==u?void 0:u.title)||(null==n?void 0:n.title)||h,b=!(null!=n&&null!==(t=n.url)&&void 0!==t&&t.length);let k;return k=null!=u&&u.icon?(0,s.createElement)("img",{src:null==u?void 0:u.icon,alt:""}):b?(0,s.createElement)(Ir,{icon:qk,size:32}):(0,s.createElement)(Ir,{icon:Ok}),(0,s.createElement)("div",{"aria-label":(0,g.__)("Currently selected"),"aria-selected":"true",className:c()("block-editor-link-control__search-item",{"is-current":!0,"is-rich":f,"is-fetching":!!d,"is-preview":!0,"is-error":b})},(0,s.createElement)("div",{className:"block-editor-link-control__search-item-top"},(0,s.createElement)("span",{className:"block-editor-link-control__search-item-header"},(0,s.createElement)("span",{className:c()("block-editor-link-control__search-item-icon",{"is-image":null==u?void 0:u.icon})},k),(0,s.createElement)("span",{className:"block-editor-link-control__search-item-details"},b?(0,s.createElement)("span",{className:"block-editor-link-control__search-item-error-notice"},(0,g.__)("Link is empty")):(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ExternalLink,{className:"block-editor-link-control__search-item-title",href:n.url},(0,Fo.__unstableStripHTML)(v)),(null==n?void 0:n.url)&&(0,s.createElement)("span",{className:"block-editor-link-control__search-item-info"},h)))),(0,s.createElement)(p.Button,{icon:Yk,label:(0,g.__)("Edit"),className:"block-editor-link-control__search-item-action",onClick:o,iconSize:24}),l&&(0,s.createElement)(p.Button,{icon:Vf,label:(0,g.__)("Unlink"),className:"block-editor-link-control__search-item-action block-editor-link-control__unlink",onClick:i,iconSize:24}),(0,s.createElement)(Qk,{fillProps:n})),(f&&((null==u?void 0:u.image)||(null==u?void 0:u.description))||d)&&(0,s.createElement)("div",{className:"block-editor-link-control__search-item-bottom"},((null==u?void 0:u.image)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.image),className:c()("block-editor-link-control__search-item-image",{"is-placeholder":!(null!=u&&u.image)})},(null==u?void 0:u.image)&&(0,s.createElement)("img",{src:null==u?void 0:u.image,alt:""})),((null==u?void 0:u.description)||d)&&(0,s.createElement)("div",{"aria-hidden":!(null!=u&&u.description),className:c()("block-editor-link-control__search-item-description",{"is-placeholder":!(null!=u&&u.description)})},(null==u?void 0:u.description)&&(0,s.createElement)(p.__experimentalText,{truncate:!0,numberOfLines:"2"},u.description))))}function e_(e){var t,n,o;let{searchInputPlaceholder:r,value:l,settings:i=Vk,onChange:a=u.noop,onRemove:d,noDirectEntry:m=!1,showSuggestions:f=!0,showInitialSuggestions:h,forceIsEditingLink:v,createSuggestion:b,withCreateSuggestion:k,inputValue:_="",suggestionsQuery:y={},noURLSuggestion:E=!1,createSuggestionButtonText:C,hasRichPreviews:S=!1,hasTextControl:w=!1,renderControlBottom:B=null}=e;void 0===k&&b&&(k=!0);const I=(0,s.useRef)(!0),x=(0,s.useRef)(),T=(0,s.useRef)(),[N,P]=(0,s.useState)((null==l?void 0:l.url)||""),[M,R]=(0,s.useState)((null==l?void 0:l.title)||""),L=_||N,[A,D]=(0,s.useState)(void 0!==v?v:!l||!l.url),O=(0,s.useRef)(!1),F=!(null!=L&&null!==(t=L.trim())&&void 0!==t&&t.length),{createPage:z,isCreatingPage:V,errorMessage:H}=function(e){const t=(0,s.useRef)(),[n,o]=(0,s.useState)(!1),[r,l]=(0,s.useState)(null);return(0,s.useEffect)((()=>()=>{t.current&&t.current.cancel()}),[]),{createPage:async function(n){o(!0),l(null);try{return t.current=(e=>{let t=!1;return{promise:new Promise(((n,o)=>{e.then((e=>t?o({isCanceled:!0}):n(e)),(e=>o(t?{isCanceled:!0}:e)))})),cancel(){t=!0}}})(Promise.resolve(e(n))),await t.current.promise}catch(e){if(e&&e.isCanceled)return;throw l(e.message||(0,g.__)("An unknown error occurred during creation. Please try again.")),e}finally{o(!1)}},isCreatingPage:n,errorMessage:r}}(b);function G(){var e;O.current=!(null===(e=x.current)||void 0===e||!e.contains(x.current.ownerDocument.activeElement)),D(!1)}(0,s.useEffect)((()=>{void 0!==v&&v!==A&&D(v)}),[v]),(0,s.useEffect)((()=>{if(I.current)return void(I.current=!1);const e=null!=T&&T.current?1:0;(Fo.focus.focusable.find(x.current)[e]||x.current).focus(),O.current=!1}),[A,V]),(0,s.useEffect)((()=>{null!=l&&l.title&&l.title!==M&&R(l.title),null!=l&&l.url&&P(l.url)}),[l]);const U=()=>{L===(null==l?void 0:l.url)&&M===(null==l?void 0:l.title)||a({url:L,title:M}),G()},W=d&&l&&!A&&!V,$=!(null==i||!i.length),j=(null==l||null===(n=l.url)||void 0===n||null===(o=n.trim())||void 0===o?void 0:o.length)>0&&w;return(0,s.createElement)("div",{tabIndex:-1,ref:x,className:"block-editor-link-control"},V&&(0,s.createElement)("div",{className:"block-editor-link-control__loading"},(0,s.createElement)(p.Spinner,null)," ",(0,g.__)("Creating"),"…"),(A||!l)&&!V&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)("div",{className:c()({"block-editor-link-control__search-input-wrapper":!0,"has-text-control":j})},j&&(0,s.createElement)(p.TextControl,{ref:T,className:"block-editor-link-control__field block-editor-link-control__text-content",label:"Text",value:M,onChange:R,onKeyDown:e=>{const{keyCode:t}=e;t!==yc.ENTER||F||(e.preventDefault(),U())}}),(0,s.createElement)(Kk,{currentLink:l,className:"block-editor-link-control__field block-editor-link-control__search-input",placeholder:r,value:L,withCreateSuggestion:k,onCreateSuggestion:z,onChange:P,onSelect:e=>{a({...e,title:M||(null==e?void 0:e.title)}),G()},showInitialSuggestions:h,allowDirectEntry:!m,showSuggestions:f,suggestionsQuery:y,withURLSuggestion:!E,createSuggestionButtonText:C,useLabel:j},(0,s.createElement)("div",{className:"block-editor-link-control__search-actions"},(0,s.createElement)(p.Button,{onClick:U,label:(0,g.__)("Submit"),icon:Nk,className:"block-editor-link-control__search-submit",disabled:F})))),H&&(0,s.createElement)(p.Notice,{className:"block-editor-link-control__search-error",status:"error",isDismissible:!1},H)),l&&!A&&!V&&(0,s.createElement)(Jk,{key:null==l?void 0:l.url,value:l,onEditClick:()=>D(!0),hasRichPreviews:S,hasUnlinkControl:W,onRemove:d}),$&&(0,s.createElement)("div",{className:"block-editor-link-control__tools"},(0,s.createElement)(Pk,{value:l,settings:i,onChange:a})),B&&B())}e_.ViewerFill=Zk;var t_=e_,n_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.7 3H5.3C4 3 3 4 3 5.3v13.4C3 20 4 21 5.3 21h13.4c1.3 0 2.3-1 2.3-2.3V5.3C21 4 20 3 18.7 3zm.8 15.7c0 .4-.4.8-.8.8H5.3c-.4 0-.8-.4-.8-.8V5.3c0-.4.4-.8.8-.8h13.4c.4 0 .8.4.8.8v13.4zM10 15l5-3-5-3v6z"})),o_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M18.5 15v3.5H13V6.7l4.5 4.1 1-1.1-6.2-5.8-5.8 5.8 1 1.1 4-4v11.7h-6V15H4v5h16v-5z"})),r_=(0,p.withFilters)("editor.MediaUpload")((()=>null)),l_=function(e){let{fallback:t=null,children:n}=e;return(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return!!t().mediaUpload}),[])?n:t},i_=(0,d.compose)([(0,m.withDispatch)((e=>{const{createNotice:t,removeNotice:n}=e(Nd.store);return{createNotice:t,removeNotice:n}})),(0,p.withFilters)("editor.MediaReplaceFlow")])((e=>{let{mediaURL:t,mediaId:n,mediaIds:o,allowedTypes:r,accept:l,onError:i,onSelect:a,onSelectURL:c,onFilesUpload:d=u.noop,onCloseModal:f=u.noop,name:h=(0,g.__)("Replace"),createNotice:v,removeNotice:b,children:k,multiple:_=!1,addToGallery:y,handleUpload:E=!0}=e;const[C,S]=(0,s.useState)(t),w=(0,m.useSelect)((e=>e(Qn).getSettings().mediaUpload),[]),B=(0,s.useRef)(),I=(0,u.uniqueId)("block-editor/media-replace-flow/error-notice/"),x=e=>{const t=(0,Fo.__unstableStripHTML)(e);i?i(t):setTimeout((()=>{v("error",t,{speak:!0,id:I,isDismissible:!0})}),1e3)},T=(e,t)=>{t(),S(null==e?void 0:e.url),a(e),(0,Ht.speak)((0,g.__)("The media file has been replaced")),b(I)},N=e=>{e.keyCode===yc.DOWN&&(e.preventDefault(),e.target.click())},P=_&&!(!r||0===r.length)&&r.every((e=>"image"===e||e.startsWith("image/")));return(0,s.createElement)(p.Dropdown,{popoverProps:{isAlternate:!0},contentClassName:"block-editor-media-replace-flow__options",renderToggle:e=>{let{isOpen:t,onToggle:n}=e;return(0,s.createElement)(p.ToolbarButton,{ref:B,"aria-expanded":t,"aria-haspopup":"true",onClick:n,onKeyDown:N},h)},renderContent:e=>{let{onClose:t}=e;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{className:"block-editor-media-replace-flow__media-upload-menu"},(0,s.createElement)(r_,{gallery:P,addToGallery:y,multiple:_,value:_?o:n,onSelect:e=>T(e,t),allowedTypes:r,onClose:f,render:e=>{let{open:t}=e;return(0,s.createElement)(p.MenuItem,{icon:n_,onClick:t},(0,g.__)("Open Media Library"))}}),(0,s.createElement)(l_,null,(0,s.createElement)(p.FormFileUpload,{onChange:e=>{((e,t)=>{const n=e.target.files;if(!E)return t(),a(n);d(n),w({allowedTypes:r,filesList:n,onFileChange:e=>{let[n]=e;T(n,t)},onError:x})})(e,t)},accept:l,multiple:_,render:e=>{let{openFileDialog:t}=e;return(0,s.createElement)(p.MenuItem,{icon:o_,onClick:()=>{t()}},(0,g.__)("Upload"))}})),k),c&&(0,s.createElement)("form",{className:"block-editor-media-flow__url-input"},(0,s.createElement)("span",{className:"block-editor-media-replace-flow__image-url-label"},(0,g.__)("Current media URL:")),(0,s.createElement)(t_,{value:{url:C},settings:[],showSuggestions:!1,onChange:e=>{let{url:t}=e;S(t),c(t),B.current.focus()}})))}})}));function s_(e){let{url:t,urlLabel:n,className:o}=e;const r=c()(o,"block-editor-url-popover__link-viewer-url");return t?(0,s.createElement)(p.ExternalLink,{className:r,href:t},n||(0,rp.filterURLForDisplay)((0,rp.safeDecodeURI)(t))):(0,s.createElement)("span",{className:r})}function a_(e){let{additionalControls:t,children:n,renderSettings:o,position:r="bottom center",focusOnMount:l="firstElement",...a}=e;const[c,u]=(0,s.useState)(!1),d=!!o&&c;return(0,s.createElement)(p.Popover,i({className:"block-editor-url-popover",focusOnMount:l,position:r},a),(0,s.createElement)("div",{className:"block-editor-url-popover__input-container"},(0,s.createElement)("div",{className:"block-editor-url-popover__row"},n,!!o&&(0,s.createElement)(p.Button,{className:"block-editor-url-popover__settings-toggle",icon:Up,label:(0,g.__)("Link settings"),onClick:()=>{u(!c)},"aria-expanded":c})),d&&(0,s.createElement)("div",{className:"block-editor-url-popover__row block-editor-url-popover__settings"},o())),t&&!d&&(0,s.createElement)("div",{className:"block-editor-url-popover__additional-controls"},t))}a_.LinkEditor=function(e){let{autocompleteRef:t,className:n,onChangeInputValue:o,value:r,...l}=e;return(0,s.createElement)("form",i({className:c()("block-editor-url-popover__link-editor",n)},l),(0,s.createElement)(Ak,{value:r,onChange:o,autocompleteRef:t}),(0,s.createElement)(p.Button,{icon:Nk,label:(0,g.__)("Apply"),type:"submit"}))},a_.LinkViewer=function(e){let{className:t,linkClassName:n,onEditLinkClick:o,url:r,urlLabel:l,...a}=e;return(0,s.createElement)("div",i({className:c()("block-editor-url-popover__link-viewer",t)},a),(0,s.createElement)(s_,{url:r,urlLabel:l,className:n}),o&&(0,s.createElement)(p.Button,{icon:Yk,label:(0,g.__)("Edit"),onClick:o}))};var c_=a_;const u_=e=>{let{src:t,onChange:n,onSubmit:o,onClose:r}=e;return(0,s.createElement)(c_,{onClose:r},(0,s.createElement)("form",{className:"block-editor-media-placeholder__url-input-form",onSubmit:o},(0,s.createElement)("input",{className:"block-editor-media-placeholder__url-input-field",type:"text","aria-label":(0,g.__)("URL"),placeholder:(0,g.__)("Paste or type URL"),onChange:n,value:t}),(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__url-input-submit-button",icon:Nk,label:(0,g.__)("Apply"),type:"submit"})))};var d_=(0,p.withFilters)("editor.MediaPlaceholder")((function(e){let{value:t={},allowedTypes:n,className:o,icon:r,labels:l={},mediaPreview:i,notices:a,isAppender:d,accept:f,addToGallery:h,multiple:v=!1,handleUpload:b=!0,disableDropZone:k,disableMediaButtons:_,onError:y,onSelect:E,onCancel:C,onSelectURL:S,onDoubleClick:w,onFilesPreUpload:B=u.noop,onHTMLDrop:I=u.noop,onClose:x=u.noop,children:T,mediaLibraryButton:N,placeholder:P,style:M}=e;const R=(0,m.useSelect)((e=>{const{getSettings:t}=e(Qn);return t().mediaUpload}),[]),[L,A]=(0,s.useState)(""),[D,O]=(0,s.useState)(!1);(0,s.useEffect)((()=>{var e;A(null!==(e=null==t?void 0:t.src)&&void 0!==e?e:"")}),[null==t?void 0:t.src]);const F=e=>{A(e.target.value)},z=()=>{O(!0)},V=()=>{O(!1)},H=e=>{e.preventDefault(),L&&S&&(S(L),V())},G=e=>{if(!b)return E(e);let o;if(B(e),v)if(h){let e=[];o=n=>{const o=(null!=t?t:[]).filter((t=>t.id?!e.some((e=>{let{id:n}=e;return Number(n)===Number(t.id)})):!e.some((e=>{let{urlSlug:n}=e;return t.url.includes(n)}))));E(o.concat(n)),e=n.map((e=>{const t=e.url.lastIndexOf("."),n=e.url.slice(0,t);return{id:e.id,urlSlug:n}}))}}else o=E;else o=e=>{let[t]=e;return E(t)};R({allowedTypes:n,filesList:e,onFileChange:o,onError:y})},U=e=>{G(e.target.files)},W=null!=P?P:e=>{let{instructions:t,title:u}=l;if(R||S||(t=(0,g.__)("To edit this block, you need permission to upload media.")),void 0===t||void 0===u){const e=null!=n?n:[],[o]=e,r=1===e.length,l=r&&"audio"===o,i=r&&"image"===o,s=r&&"video"===o;void 0===t&&R&&(t=(0,g.__)("Upload a media file or pick one from your media library."),l?t=(0,g.__)("Upload an audio file, pick one from your media library, or add one with a URL."):i?t=(0,g.__)("Upload an image file, pick one from your media library, or add one with a URL."):s&&(t=(0,g.__)("Upload a video file, pick one from your media library, or add one with a URL."))),void 0===u&&(u=(0,g.__)("Media"),l?u=(0,g.__)("Audio"):i?u=(0,g.__)("Image"):s&&(u=(0,g.__)("Video")))}const m=c()("block-editor-media-placeholder",o,{"is-appender":d});return(0,s.createElement)(p.Placeholder,{icon:r,label:u,instructions:t,className:m,notices:a,onDoubleClick:w,preview:i,style:M},e,T)},$=()=>k?null:(0,s.createElement)(p.DropZone,{onFilesDrop:G,onHTMLDrop:I}),j=()=>C&&(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__cancel-button",title:(0,g.__)("Cancel"),variant:"link",onClick:C},(0,g.__)("Cancel")),K=()=>S&&(0,s.createElement)("div",{className:"block-editor-media-placeholder__url-input-container"},(0,s.createElement)(p.Button,{className:"block-editor-media-placeholder__button",onClick:z,isPressed:D,variant:"tertiary"},(0,g.__)("Insert from URL")),D&&(0,s.createElement)(u_,{src:L,onChange:F,onSubmit:H,onClose:V}));return _?(0,s.createElement)(l_,null,$()):(0,s.createElement)(l_,{fallback:W(K())},(()=>{const e=null!=N?N:e=>{let{open:t}=e;return(0,s.createElement)(p.Button,{variant:"tertiary",onClick:()=>{t()}},(0,g.__)("Media Library"))},o=(0,s.createElement)(r_,{addToGallery:h,gallery:v&&!(!n||0===n.length)&&n.every((e=>"image"===e||e.startsWith("image/"))),multiple:v,onSelect:E,onClose:x,allowedTypes:n,value:Array.isArray(t)?t.map((e=>{let{id:t}=e;return t})):t.id,render:e});if(R&&d)return(0,s.createElement)(s.Fragment,null,$(),(0,s.createElement)(p.FormFileUpload,{onChange:U,accept:f,multiple:v,render:e=>{let{openFileDialog:t}=e;const n=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.Button,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onClick:t},(0,g.__)("Upload")),o,K(),j());return W(n)}}));if(R){const e=(0,s.createElement)(s.Fragment,null,$(),(0,s.createElement)(p.FormFileUpload,{variant:"primary",className:c()("block-editor-media-placeholder__button","block-editor-media-placeholder__upload-button"),onChange:U,accept:f,multiple:v},(0,g.__)("Upload")),o,K(),j());return W(e)}return W(o)})())})),p_=e=>{let{colorSettings:t,...n}=e;const o=t.map((e=>{if(!e)return e;const{value:t,onChange:n,...o}=e;return{...o,colorValue:t,onColorChange:n}}));return(0,s.createElement)(Zb,i({settings:o,gradients:[],disableCustomGradients:!0},n))};const m_={position:"bottom right",isAlternate:!0};var f_=()=>(0,s.createElement)(s.Fragment,null,["bold","italic","link"].map((e=>(0,s.createElement)(p.Slot,{name:`RichText.ToolbarControls.${e}`,key:e}))),(0,s.createElement)(p.Slot,{name:"RichText.ToolbarControls"},(e=>{if(!e.length)return null;const t=e.map((e=>{let[{props:t}]=e;return t})).some((e=>{let{isActive:t}=e;return t}));return(0,s.createElement)(p.ToolbarItem,null,(n=>(0,s.createElement)(p.DropdownMenu,{icon:Up
95
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("More"),toggleProps:{...n,className:c()(n.className,{"is-pressed":t}),describedBy:(0,g.__)("Displays more block tools")},controls:(0,u.orderBy)(e.map((e=>{let[{props:t}]=e;return t})),"title"),popoverProps:m_})))}))),g_=e=>{let{inline:t,anchorRef:n}=e;return t?(0,s.createElement)(p.Popover,{noArrow:!0,position:"top center",focusOnMount:!1,anchorRef:n,className:"block-editor-rich-text__inline-format-toolbar",__unstableSlotName:"block-toolbar"},(0,s.createElement)("div",{className:"block-editor-rich-text__inline-format-toolbar-group"},(0,s.createElement)(p.ToolbarGroup,null,(0,s.createElement)(f_,null)))):(0,s.createElement)(io,{group:"inline"},(0,s.createElement)(f_,null))};function h_(){const{didAutomaticChange:e,getSettings:t}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((n=>{function o(n){const{keyCode:o}=n;n.defaultPrevented||o!==yc.DELETE&&o!==yc.BACKSPACE&&o!==yc.ESCAPE||e()&&(n.preventDefault(),t().__experimentalUndo())}return n.addEventListener("keydown",o),()=>{n.removeEventListener("keydown",o)}}),[])}function v_(e){return e.filter((e=>{let{type:t}=e;return/^image\/(?:jpe?g|png|gif|webp)$/.test(t)})).map((e=>`<img src="${(0,wm.createBlobURL)(e)}">`)).join("")}var b_=window.wp.shortcode;function k_(e,t){if(null!=t&&t.length){let n=e.formats.length;for(;n--;)e.formats[n]=[...t,...e.formats[n]||[]]}}function y_(e){if(!0===e||"p"===e||"li"===e)return!0===e?"p":e}function E_(e){let{allowedFormats:t,formattingControls:n,disableFormats:o}=e;return o?E_.EMPTY_ARRAY:t||n?t||(H()("wp.blockEditor.RichText formattingControls prop",{since:"5.4",alternative:"allowedFormats",version:"6.2"}),n.map((e=>`core/${e}`))):void 0}function C_(e){let{value:t,pastedBlocks:n=[],onReplace:o,onSplit:r,onSplitMiddle:l,multilineTag:i}=e;if(!o||!r)return;const{start:s=0,end:a=0}=t,c={...t,start:s,end:a},u=[],[d,p]=(0,z.split)(c),m=n.length>0;let f=-1;const g=(0,z.isEmpty)(d)&&!(0,z.isEmpty)(p);m&&(0,z.isEmpty)(d)||(u.push(r((0,z.toHTMLString)({value:d,multilineTag:i}),!g)),f+=1),m?(u.push(...n),f+=n.length):l&&u.push(l()),(m||l)&&(0,z.isEmpty)(p)||u.push(r((0,z.toHTMLString)({value:p,multilineTag:i}),g)),o(u,m?f:1,m?-1:0)}function S_(e,t){return t?(0,z.replace)(e,/\n+/g,z.__UNSTABLE_LINE_SEPARATOR):(0,z.replace)(e,new RegExp(z.__UNSTABLE_LINE_SEPARATOR,"g"),"\n")}function w_(e){const t=(0,s.useRef)(e);return t.current=e,(0,d.useRefEffect)((e=>{function n(e){const{isSelected:n,disableFormats:o,onChange:l,value:i,formatTypes:s,tagName:a,onReplace:c,onSplit:u,onSplitMiddle:d,__unstableEmbedURLOnPaste:p,multilineTag:m,preserveWhiteSpace:f,pastePlainText:g}=t.current;if(!n)return;const{clipboardData:h}=e;let v="",b="";try{v=h.getData("text/plain"),b=h.getData("text/html")}catch(e){try{b=h.getData("Text")}catch(e){return}}if(b=function(e){return e.replace(/.*<!--StartFragment-->/s,"").replace(/<!--EndFragment-->.*/s,"")}(b),b=function(e){const t="<meta charset='utf-8'>";return e.startsWith(t)?e.slice(t.length):e}(b),e.preventDefault(),window.console.log("Received HTML:\n\n",b),window.console.log("Received plain text:\n\n",v),o)return void l((0,z.insert)(i,v));const k=s.reduce(((e,t)=>{let{__unstablePasteRule:n}=t;return n&&e===i&&(e=n(i,{html:b,plainText:v})),e}),i);if(k!==i)return void l(k);const _=[...(0,Fo.getFilesFromDataTransfer)(h)];if("true"===h.getData("rich-text")){const e=h.getData("rich-text-multi-line-tag")||void 0;let t=(0,z.create)({html:b,multilineTag:e,multilineWrapperTags:"li"===e?["ul","ol"]:void 0,preserveWhiteSpace:f});return t=S_(t,!!m),k_(t,i.activeFormats),void l((0,z.insert)(i,t))}if(g)return void l((0,z.insert)(i,(0,z.create)({text:v})));if(null!=_&&_.length&&!Bm(_,b)){const e=(0,r.pasteHandler)({HTML:v_(_),mode:"BLOCKS",tagName:a,preserveWhiteSpace:f});return window.console.log("Received items:\n\n",_),void(c&&(0,z.isEmpty)(i)?c(e):C_({value:i,pastedBlocks:e,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}let y=c&&u?"AUTO":"INLINE";var E;"AUTO"===y&&(0,z.isEmpty)(i)&&(E=v,(0,b_.regexp)(".*").test(E))&&(y="BLOCKS"),p&&(0,z.isEmpty)(i)&&(0,rp.isURL)(v.trim())&&(y="BLOCKS");const C=(0,r.pasteHandler)({HTML:b,plainText:v,mode:y,tagName:a,preserveWhiteSpace:f});if("string"==typeof C){let e=(0,z.create)({html:C});e=S_(e,!!m),k_(e,i.activeFormats),l((0,z.insert)(i,e))}else C.length>0&&(c&&(0,z.isEmpty)(i)?c(C,C.length-1,-1):C_({value:i,pastedBlocks:C,onReplace:c,onSplit:u,onSplitMiddle:d,multilineTag:m}))}return e.addEventListener("paste",n),()=>{e.removeEventListener("paste",n)}}),[])}function B_(e){let t=e.length;for(;t--;){const n=(0,u.findKey)(e[t].attributes,(e=>"string"==typeof e&&-1!==e.indexOf("†")));if(n)return e[t].attributes[n]=e[t].attributes[n].replace("†",""),e[t].clientId;const o=B_(e[t].innerBlocks);if(o)return o}}function I_(e){const{__unstableMarkLastChangeAsPersistent:t,__unstableMarkAutomaticChange:n}=(0,m.useDispatch)(Qn),o=(0,s.useRef)(e);return o.current=e,(0,d.useRefEffect)((e=>{function l(){const{value:e,onReplace:t,selectionChange:l}=o.current;if(!t)return;const{start:i,text:s}=e;if(" "!==s.slice(i-1,i))return;const a=s.slice(0,i).trim(),c=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"prefix"===t})),u=(0,r.findTransform)(c,(e=>{let{prefix:t}=e;return a===t}));if(!u)return;const d=(0,z.toHTMLString)({value:(0,z.insert)(e,"†",0,i)}),p=u.transform(d);l(B_([p])),t([p]),n()}function i(e){const{inputType:r,type:i}=e,{value:s,onChange:a,__unstableAllowPrefixTransformations:c,formatTypes:u}=o.current;if("insertText"!==r&&"compositionend"!==i)return;c&&l&&l();const d=u.reduce(((e,t)=>{let{__unstableInputRule:n}=t;return n&&(e=n(e)),e}),function(e){const t="tales of gutenberg",{start:n,text:o}=e;return n<t.length||o.slice(n-t.length,n).toLowerCase()!==t?e:(0,z.insert)(e," 🐡🐢🦀🐤🦋🐘🐧🐹🦁🦄🦍🐼🐿🎃🐴🐝🐆🦕🦔🌱🍇π🍌🐉💧🥨🌌🍂🍠🥦🥚🥝🎟🥥🥒🛵🥖🍒🍯🎾🎲🐺🐚🐮⌛️")}(s));d!==s&&(t(),a({...d,activeFormats:s.activeFormats}),n())}return e.addEventListener("input",i),e.addEventListener("compositionend",i),()=>{e.removeEventListener("input",i),e.removeEventListener("compositionend",i)}}),[])}function x_(e){const{__unstableMarkAutomaticChange:t}=(0,m.useDispatch)(Qn),n=(0,s.useRef)(e);return n.current=e,(0,d.useRefEffect)((e=>{function o(e){if(e.defaultPrevented)return;const{removeEditorOnlyFormats:o,value:l,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c,onChange:u,disableLineBreaks:d,onSplitAtEnd:p}=n.current;if(e.keyCode!==yc.ENTER)return;e.preventDefault();const m={...l};m.formats=o(l);const f=i&&s;if(i){const e=(0,r.getBlockTransforms)("from").filter((e=>{let{type:t}=e;return"enter"===t})),n=(0,r.findTransform)(e,(e=>e.regExp.test(m.text)));n&&(i([n.transform({content:m.text})]),t())}if(c)e.shiftKey?d||u((0,z.insert)(m,"\n")):f&&(0,z.__unstableIsEmptyLine)(m)?C_({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c}):u((0,z.__unstableInsertLineSeparator)(m));else{const{text:t,start:n,end:o}=m,r=p&&n===o&&o===t.length;e.shiftKey||!f&&!r?d||u((0,z.insert)(m,"\n")):!f&&r?p():f&&C_({value:m,onReplace:i,onSplit:s,onSplitMiddle:a,multilineTag:c})}}return e.addEventListener("keydown",o),()=>{e.removeEventListener("keydown",o)}}),[])}function T_(e){return e(z.store).getFormatTypes()}E_.EMPTY_ARRAY=[];const N_=new Set(["a","audio","button","details","embed","iframe","input","label","select","textarea","video"]);function P_(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("keydown",n),()=>{t.removeEventListener("keydown",n)}}),[])}function M_(e){return(0,d.useRefEffect)((t=>{function n(t){for(const n of e.current)n(t)}return t.addEventListener("input",n),()=>{t.removeEventListener("input",n)}}),[])}function R_(){const{isMultiSelecting:e}=(0,m.useSelect)(Qn);return(0,d.useRefEffect)((t=>{function n(){if(!e())return;const n=t.parentElement.closest('[contenteditable="true"]');n&&n.focus()}return t.addEventListener("focus",n),()=>{t.removeEventListener("focus",n)}}),[])}function L_(e){let{formatTypes:t,onChange:n,onFocus:o,value:r,forwardedRef:l}=e;return t.map((e=>{const{name:t,edit:i}=e;if(!i)return null;const a=(0,z.getActiveFormat)(r,t);let c=void 0!==a;const d=(0,z.getActiveObject)(r),p=void 0!==d&&d.type===t;if("core/link"===t&&!(0,z.isCollapsed)(r)){const e=r.formats,t=(0,u.find)(e[r.start],{type:"core/link"}),n=(0,u.find)(e[r.end-1],{type:"core/link"});t&&n&&t===n||(c=!1)}return(0,s.createElement)(i,{key:t,isActive:c,activeAttributes:c&&a.attributes||{},isObjectActive:p,activeObjectAttributes:p&&d.attributes||{},value:r,onChange:n,onFocus:o,contentRef:l})}))}const A_=(0,s.createContext)(),D_=(0,s.createContext)(),O_=(0,s.forwardRef)((function e(t,n){let{children:o,tagName:l="div",value:a="",onChange:f,isSelected:g,multiline:h,inlineToolbar:v,wrapperClassName:b,autocompleters:k,onReplace:_,placeholder:y,allowedFormats:E,formattingControls:C,withoutInteractiveFormatting:S,onRemove:w,onMerge:B,onSplit:I,__unstableOnSplitAtEnd:x,__unstableOnSplitMiddle:T,identifier:N,preserveWhiteSpace:P,__unstablePastePlainText:M,__unstableEmbedURLOnPaste:R,__unstableDisableFormats:L,disableLineBreaks:A,unstableOnFocus:D,__unstableAllowPrefixTransformations:O,...F}=t;const V=(0,d.useInstanceId)(e);N=N||V,F=function(e){return(0,u.omit)(e,["__unstableMobileNoFocusOnMount","deleteEnter","placeholderTextColor","textAlign","selectionColor","tagsToEliminate","rootTagsToEliminate","disableEditingMenu","fontSize","fontFamily","fontWeight","fontStyle","minWidth","maxWidth","setRef"])}(F);const G=(0,s.useRef)(),{clientId:U}=eo(),{selectionStart:W,selectionEnd:$,isSelected:j}=(0,m.useSelect)((e=>{const{getSelectionStart:t,getSelectionEnd:n}=e(Qn),o=t(),r=n();let l;return void 0===g?l=o.clientId===U&&r.clientId===U&&o.attributeKey===N:g&&(l=o.clientId===U),{selectionStart:l?o.offset:void 0,selectionEnd:l?r.offset:void 0,isSelected:l}})),{selectionChange:K}=(0,m.useDispatch)(Qn),q=y_(h),Y=E_({allowedFormats:E,formattingControls:C,disableFormats:L}),Q=!Y||Y.length>0;let Z=a,X=f;Array.isArray(a)&&(Z=r.children.toHTML(a),X=e=>f(r.children.fromDOM((0,z.__unstableCreateElement)(document,e).childNodes)));const J=(0,s.useCallback)(((e,t)=>{const n={},o=void 0===e&&void 0===t;("number"==typeof e||o)&&(n.start={clientId:U,attributeKey:N,offset:e}),("number"==typeof t||o)&&(n.end={clientId:U,attributeKey:N,offset:t}),K(n)}),[U,N]),{formatTypes:ee,prepareHandlers:te,valueHandlers:ne,changeHandlers:oe,dependencies:re}=function(e){let{clientId:t,identifier:n,withoutInteractiveFormatting:o,allowedFormats:r}=e;const l=(0,m.useSelect)(T_,[]),i=(0,s.useMemo)((()=>l.filter((e=>{let{name:t,tagName:n}=e;return!(r&&!r.includes(t)||o&&N_.has(n))}))),[l,r,N_]),a=(0,m.useSelect)((e=>i.reduce(((o,r)=>(r.__experimentalGetPropsForEditableTreePreparation&&(o[r.name]=r.__experimentalGetPropsForEditableTreePreparation(e,{richTextIdentifier:n,blockClientId:t})),o)),{})),[i,t,n]),c=(0,m.useDispatch)(),u=[],d=[],p=[],f=[];return i.forEach((e=>{if(e.__experimentalCreatePrepareEditableTree){const o=a[e.name],r=e.__experimentalCreatePrepareEditableTree(o,{richTextIdentifier:n,blockClientId:t});e.__experimentalCreateOnChangeEditableValue?d.push(r):u.push(r);for(const e in o)f.push(o[e])}if(e.__experimentalCreateOnChangeEditableValue){let o={};e.__experimentalGetPropsForEditableTreeChangeHandler&&(o=e.__experimentalGetPropsForEditableTreeChangeHandler(c,{richTextIdentifier:n,blockClientId:t})),p.push(e.__experimentalCreateOnChangeEditableValue({...a[e.name]||{},...o},{richTextIdentifier:n,blockClientId:t}))}})),{formatTypes:i,prepareHandlers:u,valueHandlers:d,changeHandlers:p,dependencies:f}}({clientId:U,identifier:N,withoutInteractiveFormatting:S,allowedFormats:Y});function le(e){return ee.forEach((t=>{t.__experimentalCreatePrepareEditableTree&&(e=(0,z.removeFormat)(e,t.name,0,e.text.length))})),e.formats}const{value:ie,onChange:se,ref:ae}=(0,z.__unstableUseRichText)({value:Z,onChange(e,t){let{__unstableFormats:n,__unstableText:o}=t;X(e),Object.values(oe).forEach((e=>{e(n,o)}))},selectionStart:W,selectionEnd:$,onSelectionChange:J,placeholder:y,__unstableIsSelected:j,__unstableMultilineTag:q,__unstableDisableFormats:L,preserveWhiteSpace:P,__unstableDependencies:[...re,l],__unstableAfterParse:function(e){return ne.reduce(((t,n)=>n(t,e.text)),e.formats)},__unstableBeforeSerialize:le,__unstableAddInvisibleFormats:function(e){return te.reduce(((t,n)=>n(t,e.text)),e.formats)}}),ce=function(e){return(0,p.__unstableUseAutocompleteProps)({...e,completers:zv(e)})}({onReplace:_,completers:k,record:ie,onChange:se});!function(e){let{html:t,value:n}=e;const o=(0,s.useRef)(),r=n.activeFormats&&!!n.activeFormats.length,{__unstableMarkLastChangeAsPersistent:l}=(0,m.useDispatch)(Qn);(0,s.useLayoutEffect)((()=>{if(o.current){if(o.current!==n.text){const e=window.setTimeout((()=>{l()}),1e3);return o.current=n.text,()=>{window.clearTimeout(e)}}l()}else o.current=n.text}),[t,r])}({html:Z,value:ie});const ue=(0,s.useRef)(new Set),de=(0,s.useRef)(new Set);function pe(){G.current.focus()}const me=l,fe=(0,s.createElement)(s.Fragment,null,j&&(0,s.createElement)(A_.Provider,{value:ue},(0,s.createElement)(D_.Provider,{value:de},(0,s.createElement)(p.Popover.__unstableSlotNameProvider,{value:"__unstable-block-tools-after"},o&&o({value:ie,onChange:se,onFocus:pe}),(0,s.createElement)(L_,{value:ie,onChange:se,onFocus:pe,formatTypes:ee,forwardedRef:G})))),j&&Q&&(0,s.createElement)(g_,{inline:v,anchorRef:G.current}),(0,s.createElement)(me,i({role:"textbox","aria-multiline":!A,"aria-label":y},F,ce,{ref:(0,d.useMergeRefs)([n,ce.ref,F.ref,ae,I_({value:ie,onChange:se,__unstableAllowPrefixTransformations:O,formatTypes:ee,onReplace:_,selectionChange:K}),(0,d.useRefEffect)((e=>{function t(e){(yc.isKeyboardEvent.primary(e,"z")||yc.isKeyboardEvent.primary(e,"y")||yc.isKeyboardEvent.primaryShift(e,"z"))&&e.preventDefault()}return e.addEventListener("keydown",t),()=>{e.addEventListener("keydown",t)}}),[]),P_(ue),M_(de),h_(),w_({isSelected:j,disableFormats:L,onChange:se,value:ie,formatTypes:ee,tagName:l,onReplace:_,onSplit:I,onSplitMiddle:T,__unstableEmbedURLOnPaste:R,multilineTag:q,preserveWhiteSpace:P,pastePlainText:M}),x_({removeEditorOnlyFormats:le,value:ie,onReplace:_,onSplit:I,onSplitMiddle:T,multilineTag:q,onChange:se,disableLineBreaks:A,onSplitAtEnd:x}),R_(),G]),contentEditable:!0,suppressContentEditableWarning:!0,className:c()("block-editor-rich-text__editable",F.className,"rich-text"),onFocus:D,onKeyDown:function(e){const{keyCode:t}=e;if(!e.defaultPrevented&&(t===yc.DELETE||t===yc.BACKSPACE)){const{start:n,end:o,text:r}=ie,l=t===yc.BACKSPACE,i=ie.activeFormats&&!!ie.activeFormats.length;if(!(0,z.isCollapsed)(ie)||i||l&&0!==n||!l&&o!==r.length)return;B&&B(!l),w&&(0,z.isEmpty)(ie)&&l&&w(!l),e.preventDefault()}}})));if(!b)return fe;H()("wp.blockEditor.RichText wrapperClassName prop",{since:"5.4",alternative:"className prop or create your own wrapper div",version:"6.2"});const ge=c()("block-editor-rich-text",b);return(0,s.createElement)("div",{className:ge},fe)}));O_.Content=e=>{let{value:t,tagName:n,multiline:o,...l}=e;Array.isArray(t)&&(t=r.children.toHTML(t));const i=y_(o);!t&&i&&(t=`<${i}></${i}>`);const a=(0,s.createElement)(s.RawHTML,null,t);return n?(0,s.createElement)(n,(0,u.omit)(l,["format"]),a):a},O_.isEmpty=e=>!e||0===e.length;var F_=O_;const z_=(0,s.forwardRef)(((e,t)=>(0,s.createElement)(F_,i({ref:t},e,{__unstableDisableFormats:!0,preserveWhiteSpace:!0}))));z_.Content=e=>{let{value:t="",tagName:n="div",...o}=e;return(0,s.createElement)(n,o,t)};var V_=z_,H_=(0,s.forwardRef)(((e,t)=>{let{__experimentalVersion:n,...o}=e;if(2===n)return(0,s.createElement)(V_,i({ref:t},o));const{className:r,onChange:l,...a}=o;return(0,s.createElement)(Sl.Z,i({ref:t,className:c()("block-editor-plain-text",r),onChange:e=>l(e.target.value)},a))}));function G_(e){let{property:t,viewport:n,desc:o}=e;const r=(0,d.useInstanceId)(G_),l=o||(0,g.sprintf)(
96
  /* translators: 1: property name. 2: viewport name. */
97
+ (0,g._x)("Controls the %1$s property for %2$s viewports.","Text labelling a interface as controlling a given layout property (eg: margin) for a given screen size."),t,n.label);return(0,s.createElement)(s.Fragment,null,(0,s.createElement)("span",{"aria-describedby":`rbc-desc-${r}`},n.label),(0,s.createElement)(p.VisuallyHidden,{as:"span",id:`rbc-desc-${r}`},l))}var U_=function(e){const{title:t,property:n,toggleLabel:o,onIsResponsiveChange:r,renderDefaultControl:l,renderResponsiveControls:i,isResponsive:a=!1,defaultLabel:u={id:"all",
98
  /* translators: 'Label. Used to signify a layout property (eg: margin, padding) will apply uniformly to all screensizes.' */
99
  label:(0,g.__)("All")},viewports:d=[{id:"small",label:(0,g.__)("Small screens")},{id:"medium",label:(0,g.__)("Medium screens")},{id:"large",label:(0,g.__)("Large screens")}]}=e;if(!t||!n||!l)return null;const m=o||(0,g.sprintf)(
100
  /* translators: 'Toggle control label. Should the property be the same across all screen sizes or unique per screen size.'. %s property value for the control (eg: margin, padding...etc) */
101
+ (0,g.__)("Use the same %s on all screensizes."),n),f=(0,g.__)("Toggle between using the same value for all screen sizes or using a unique value per screen size."),h=l((0,s.createElement)(G_,{property:n,viewport:u}),u);
102
+ /* translators: 'Help text for the responsive mode toggle control.' */return(0,s.createElement)("fieldset",{className:"block-editor-responsive-block-control"},(0,s.createElement)("legend",{className:"block-editor-responsive-block-control__title"},t),(0,s.createElement)("div",{className:"block-editor-responsive-block-control__inner"},(0,s.createElement)(p.ToggleControl,{className:"block-editor-responsive-block-control__toggle",label:m,checked:!a,onChange:r,help:f}),(0,s.createElement)("div",{className:c()("block-editor-responsive-block-control__group",{"is-responsive":a})},!a&&h,a&&(i?i(d):d.map((e=>(0,s.createElement)(s.Fragment,{key:e.id},l((0,s.createElement)(G_,{property:n,viewport:e}),e))))))))};function W_(e){let{character:t,type:n,onUse:o}=e;const r=(0,s.useContext)(A_),l=(0,s.useRef)();return l.current=o,(0,s.useEffect)((()=>{function e(e){yc.isKeyboardEvent[n](e,t)&&(l.current(),e.preventDefault())}return r.current.add(e),()=>{r.current.delete(e)}}),[t,n]),null}function $_(e){let t,{name:n,shortcutType:o,shortcutCharacter:r,...l}=e,a="RichText.ToolbarControls";return n&&(a+=`.${n}`),o&&r&&(t=yc.displayShortcut[o](r)),(0,s.createElement)(p.Fill,{name:a},(0,s.createElement)(p.ToolbarButton,i({},l,{shortcut:t})))}function j_(e){let{inputType:t,onInput:n}=e;const o=(0,s.useContext)(D_),r=(0,s.useRef)();return r.current=n,(0,s.useEffect)((()=>{function e(e){e.inputType===t&&(r.current(),e.preventDefault())}return o.current.add(e),()=>{o.current.delete(e)}}),[t]),null}const K_=(0,s.createElement)(p.SVG,{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24"},(0,s.createElement)(p.Path,{d:"M9.4 20.5L5.2 3.8l14.6 9-2 .3c-.2 0-.4.1-.7.1-.9.2-1.6.3-2.2.5-.8.3-1.4.5-1.8.8-.4.3-.8.8-1.3 1.5-.4.5-.8 1.2-1.2 2l-.3.6-.9 1.9zM7.6 7.1l2.4 9.3c.2-.4.5-.8.7-1.1.6-.8 1.1-1.4 1.6-1.8.5-.4 1.3-.8 2.2-1.1l1.2-.3-8.1-5z"}));var q_=(0,s.forwardRef)((function(e,t){const n=(0,m.useSelect)((e=>e(Qn).isNavigationMode()),[]),{setNavigationMode:o}=(0,m.useDispatch)(Qn),r=e=>{o("edit"!==e)};return(0,s.createElement)(p.Dropdown,{renderToggle:o=>{let{isOpen:r,onToggle:l}=o;return(0,s.createElement)(p.Button,i({},e,{ref:t,icon:n?K_:Yk,"aria-expanded":r,"aria-haspopup":"true",onClick:l
103
+ /* translators: button label text should, if possible, be under 16 characters. */,label:(0,g.__)("Tools")}))},position:"bottom right",renderContent:()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.NavigableMenu,{role:"menu","aria-label":(0,g.__)("Tools")},(0,s.createElement)(p.MenuItemsChoice,{value:n?"select":"edit",onSelect:r,choices:[{value:"edit",label:(0,s.createElement)(s.Fragment,null,(0,s.createElement)(Ir,{icon:Yk}),(0,g.__)("Edit"))},{value:"select",label:(0,s.createElement)(s.Fragment,null,K_,(0,g.__)("Select"))}]})),(0,s.createElement)("div",{className:"block-editor-tool-selector__help"},(0,g.__)("Tools provide different interactions for selecting, navigating, and editing blocks. Toggle between select and edit by pressing Escape and Enter.")))})}));function Y_(e){let{units:t,...n}=e;const o=(0,p.__experimentalUseCustomUnits)({availableUnits:Co("spacing.units")||["%","px","em","rem","vw"],units:t});return(0,s.createElement)(p.__experimentalUnitControl,i({units:o},n))}var Q_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M20 10.8H6.7l4.1-4.5-1.1-1.1-5.8 6.3 5.8 5.8 1.1-1.1-4-3.9H20z"}));class Z_ extends s.Component{constructor(){super(...arguments),this.toggle=this.toggle.bind(this),this.submitLink=this.submitLink.bind(this),this.state={expanded:!1}}toggle(){this.setState({expanded:!this.state.expanded})}submitLink(e){e.preventDefault(),this.toggle()}render(){const{url:e,onChange:t}=this.props,{expanded:n}=this.state,o=e?(0,g.__)("Edit link"):(0,g.__)("Insert link");return(0,s.createElement)("div",{className:"block-editor-url-input__button"},(0,s.createElement)(p.Button,{icon:zf,label:o,onClick:this.toggle,className:"components-toolbar__control",isPressed:!!e}),n&&(0,s.createElement)("form",{className:"block-editor-url-input__button-modal",onSubmit:this.submitLink},(0,s.createElement)("div",{className:"block-editor-url-input__button-modal-line"},(0,s.createElement)(p.Button,{className:"block-editor-url-input__back",icon:Q_,label:(0,g.__)("Close"),onClick:this.toggle}),(0,s.createElement)(Ak,{value:e||"",onChange:t}),(0,s.createElement)(p.Button,{icon:Nk,label:(0,g.__)("Submit"),type:"submit"}))))}}var X_=Z_,J_=(0,s.createElement)(O.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24"},(0,s.createElement)(O.Path,{d:"M13 11.8l6.1-6.3-1-1-6.1 6.2-6.1-6.2-1 1 6.1 6.3-6.5 6.7 1 1 6.5-6.6 6.5 6.6 1-1z"}));const ey="none",ty="custom",ny="media",oy="attachment",ry=["noreferrer","noopener"],ly=(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0,0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"m19 5v14h-14v-14h14m0-2h-14c-1.1 0-2 0.9-2 2v14c0 1.1 0.9 2 2 2h14c1.1 0 2-0.9 2-2v-14c0-1.1-0.9-2-2-2z"}),(0,s.createElement)(p.Path,{d:"m14.14 11.86l-3 3.87-2.14-2.59-3 3.86h12l-3.86-5.14z"})),iy=e=>{let{linkDestination:t,onChangeUrl:n,url:o,mediaType:r="image",mediaUrl:l,mediaLink:i,linkTarget:a,linkClass:c,rel:d}=e;const[m,f]=(0,s.useState)(!1),h=(0,s.useCallback)((()=>{f(!0)})),[v,b]=(0,s.useState)(!1),[k,_]=(0,s.useState)(null),y=(0,s.useRef)(null),E=(0,s.useCallback)((()=>{t!==ny&&t!==oy||_(""),b(!0)})),C=(0,s.useCallback)((()=>{b(!1)})),S=(0,s.useCallback)((()=>{_(null),C(),f(!1)})),w=(0,s.useCallback)((()=>e=>{const t=y.current;t&&t.contains(e.target)||(f(!1),_(null),C())})),B=(0,s.useCallback)((()=>e=>{if(k){var t;const e=(null===(t=x().find((e=>e.url===k)))||void 0===t?void 0:t.linkDestination)||ty;n({href:k,linkDestination:e})}C(),_(null),e.preventDefault()})),I=(0,s.useCallback)((()=>{n({linkDestination:ey,href:""})})),x=()=>{const e=[{linkDestination:ny,title:(0,g.__)("Media File"),url:"image"===r?l:void 0,icon:ly}];return"image"===r&&i&&e.push({linkDestination:oy,title:(0,g.__)("Attachment Page"),url:"image"===r?i:void 0,icon:(0,s.createElement)(p.SVG,{viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg"},(0,s.createElement)(p.Path,{d:"M0 0h24v24H0V0z",fill:"none"}),(0,s.createElement)(p.Path,{d:"M14 2H6c-1.1 0-1.99.9-1.99 2L4 20c0 1.1.89 2 1.99 2H18c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6z"}))}),e},T=(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToggleControl,{label:(0,g.__)("Open in new tab"),onChange:e=>{const t=(e=>{const t=e?"_blank":void 0;let n;if(t){const e=(null!=d?d:"").split(" ");ry.forEach((t=>{e.includes(t)||e.push(t)})),n=e.join(" ")}else{const e=(null!=d?d:"").split(" ").filter((e=>!1===ry.includes(e)));n=e.length?e.join(" "):void 0}return{linkTarget:t,rel:n}})(e);n(t)},checked:"_blank"===a}),(0,s.createElement)(p.TextControl,{label:(0,g.__)("Link Rel"),value:null!=d?d:"",onChange:e=>{n({rel:e})}}),(0,s.createElement)(p.TextControl,{label:(0,g.__)("Link CSS Class"),value:c||"",onChange:e=>{n({linkClass:e})}})),N=null!==k?k:o,P=((0,u.find)(x(),["linkDestination",t])||{}).title;return(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.ToolbarButton,{icon:zf,className:"components-toolbar__control",label:o?(0,g.__)("Edit link"):(0,g.__)("Insert link"),"aria-expanded":m,onClick:h}),m&&(0,s.createElement)(c_,{onFocusOutside:w(),onClose:S,renderSettings:()=>T,additionalControls:!N&&(0,s.createElement)(p.NavigableMenu,null,(0,u.map)(x(),(e=>(0,s.createElement)(p.MenuItem,{key:e.linkDestination,icon:e.icon,onClick:()=>{_(null),(e=>{const t=x();let o;o=e?((0,u.find)(t,(t=>t.url===e))||{linkDestination:ty}).linkDestination:ey,n({linkDestination:o,href:e})})(e.url),C()}},e.title))))},(!o||v)&&(0,s.createElement)(c_.LinkEditor,{className:"block-editor-format-toolbar__link-container-content",value:N,onChangeInputValue:_,onSubmit:B(),autocompleteRef:y}),o&&!v&&(0,s.createElement)(s.Fragment,null,(0,s.createElement)(c_.LinkViewer,{className:"block-editor-format-toolbar__link-container-content",url:o,onEditLinkClick:E,urlLabel:P}),(0,s.createElement)(p.Button,{icon:J_,label:(0,g.__)("Remove link"),onClick:I}))))};function sy(e){let{children:t,className:n,isEnabled:o=!0,deviceType:r,setDeviceType:l}=e;if((0,d.useViewportMatch)("small","<"))return null;const i={className:c()(n,"block-editor-post-preview__dropdown-content"),position:"bottom left"},a={variant:"tertiary",className:"block-editor-post-preview__button-toggle",disabled:!o,
104
  /* translators: button label text should, if possible, be under 16 characters. */
105
+ children:(0,g.__)("Preview")};return(0,s.createElement)(p.DropdownMenu,{className:"block-editor-post-preview__dropdown",popoverProps:i,toggleProps:a,icon:null},(()=>(0,s.createElement)(s.Fragment,null,(0,s.createElement)(p.MenuGroup,null,(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Desktop"),icon:"Desktop"===r&&lm},(0,g.__)("Desktop")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Tablet"),icon:"Tablet"===r&&lm},(0,g.__)("Tablet")),(0,s.createElement)(p.MenuItem,{className:"block-editor-post-preview__button-resize",onClick:()=>l("Mobile"),icon:"Mobile"===r&&lm},(0,g.__)("Mobile"))),t)))}function ay(e){const[t,n]=(0,s.useState)(window.innerWidth);(0,s.useEffect)((()=>{if("Desktop"===e)return;const t=()=>n(window.innerWidth);return window.addEventListener("resize",t),()=>{window.removeEventListener("resize",t)}}),[e]);const o=e=>{let n;switch(e){case"Tablet":n=780;break;case"Mobile":n=360;break;default:return null}return n<t?n:t};return(e=>{const t="Mobile"===e?"768px":"1024px";switch(e){case"Tablet":case"Mobile":return{width:o(e),margin:(window.innerHeight<800?36:72)+"px auto",height:t,borderRadius:"2px 2px 2px 2px",border:"1px solid #ddd",overflowY:"auto"};default:return null}})(e)}var cy=(0,m.withSelect)((e=>({selectedBlockClientId:e(Qn).getBlockSelectionStart()})))((e=>{let{selectedBlockClientId:t}=e;const n=bo(t);return t?(0,s.createElement)(p.Button,{variant:"secondary",className:"block-editor-skip-to-selected-block",onClick:()=>{n.current.focus()}},(0,g.__)("Skip to the selected block")):null})),uy=window.wp.wordcount,dy=(0,m.withSelect)((e=>{const{getMultiSelectedBlocks:t}=e(Qn);return{blocks:t()}}))((function(e){let{blocks:t}=e;const n=(0,uy.count)((0,r.serialize)(t),"words");return(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card"},(0,s.createElement)(Dc,{icon:nm,showColors:!0}),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-content"},(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-title"},(0,g.sprintf)(
106
  /* translators: %d: number of blocks */
107
  (0,g._n)("%d block","%d blocks",t.length),t.length)),(0,s.createElement)("div",{className:"block-editor-multi-selection-inspector__card-description"},(0,g.sprintf)(
108
  /* translators: %d: number of words */