| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 (function() { 2 "use strict"; 3 var wp; 4 (wp ||= {}).blockLibrary = (() => { 5 var __create = Object.create; 6 var __defProp = Object.defineProperty; 7 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 8 var __getOwnPropNames = Object.getOwnPropertyNames; 9 var __getProtoOf = Object.getPrototypeOf; 10 var __hasOwnProp = Object.prototype.hasOwnProperty; 11 var __require = /* @__PURE__ */ ((x3) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x3, { 12 get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2] 13 }) : x3)(function(x3) { 14 if (typeof require !== "undefined") return require.apply(this, arguments); 15 throw Error('Dynamic require of "' + x3 + '" is not supported'); 16 }); 17 var __commonJS = (cb, mod) => function __require2() { 18 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 19 }; 20 var __export = (target, all) => { 21 for (var name118 in all) 22 __defProp(target, name118, { get: all[name118], enumerable: true }); 23 }; 24 var __copyProps = (to, from, except, desc) => { 25 if (from && typeof from === "object" || typeof from === "function") { 26 for (let key of __getOwnPropNames(from)) 27 if (!__hasOwnProp.call(to, key) && key !== except) 28 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 29 } 30 return to; 31 }; 32 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 33 // If the importer is in node compatibility mode or this is not an ESM 34 // file that has been converted to a CommonJS file using a Babel- 35 // compatible transform (i.e. "__esModule" has not been set), then set 36 // "default" to the CommonJS "module.exports" for node compatibility. 37 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 38 mod 39 )); 40 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); 41 42 // package-external:@wordpress/blocks 43 var require_blocks = __commonJS({ 44 "package-external:@wordpress/blocks"(exports, module) { 45 module.exports = window.wp.blocks; 46 } 47 }); 48 49 // package-external:@wordpress/compose 50 var require_compose = __commonJS({ 51 "package-external:@wordpress/compose"(exports, module) { 52 module.exports = window.wp.compose; 53 } 54 }); 55 56 // package-external:@wordpress/data 57 var require_data = __commonJS({ 58 "package-external:@wordpress/data"(exports, module) { 59 module.exports = window.wp.data; 60 } 61 }); 62 63 // package-external:@wordpress/block-editor 64 var require_block_editor = __commonJS({ 65 "package-external:@wordpress/block-editor"(exports, module) { 66 module.exports = window.wp.blockEditor; 67 } 68 }); 69 70 // package-external:@wordpress/server-side-render 71 var require_server_side_render = __commonJS({ 72 "package-external:@wordpress/server-side-render"(exports, module) { 73 module.exports = window.wp.serverSideRender; 74 } 75 }); 76 77 // package-external:@wordpress/i18n 78 var require_i18n = __commonJS({ 79 "package-external:@wordpress/i18n"(exports, module) { 80 module.exports = window.wp.i18n; 81 } 82 }); 83 84 // node_modules/domelementtype/lib/index.js 85 var require_lib = __commonJS({ 86 "node_modules/domelementtype/lib/index.js"(exports) { 87 "use strict"; 88 Object.defineProperty(exports, "__esModule", { value: true }); 89 exports.Doctype = exports.CDATA = exports.Tag = exports.Style = exports.Script = exports.Comment = exports.Directive = exports.Text = exports.Root = exports.isTag = exports.ElementType = void 0; 90 var ElementType; 91 (function(ElementType2) { 92 ElementType2["Root"] = "root"; 93 ElementType2["Text"] = "text"; 94 ElementType2["Directive"] = "directive"; 95 ElementType2["Comment"] = "comment"; 96 ElementType2["Script"] = "script"; 97 ElementType2["Style"] = "style"; 98 ElementType2["Tag"] = "tag"; 99 ElementType2["CDATA"] = "cdata"; 100 ElementType2["Doctype"] = "doctype"; 101 })(ElementType = exports.ElementType || (exports.ElementType = {})); 102 function isTag(elem) { 103 return elem.type === ElementType.Tag || elem.type === ElementType.Script || elem.type === ElementType.Style; 104 } 105 exports.isTag = isTag; 106 exports.Root = ElementType.Root; 107 exports.Text = ElementType.Text; 108 exports.Directive = ElementType.Directive; 109 exports.Comment = ElementType.Comment; 110 exports.Script = ElementType.Script; 111 exports.Style = ElementType.Style; 112 exports.Tag = ElementType.Tag; 113 exports.CDATA = ElementType.CDATA; 114 exports.Doctype = ElementType.Doctype; 115 } 116 }); 117 118 // node_modules/domhandler/lib/node.js 119 var require_node = __commonJS({ 120 "node_modules/domhandler/lib/node.js"(exports) { 121 "use strict"; 122 var __extends = exports && exports.__extends || /* @__PURE__ */ (function() { 123 var extendStatics = function(d2, b2) { 124 extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d3, b3) { 125 d3.__proto__ = b3; 126 } || function(d3, b3) { 127 for (var p2 in b3) if (Object.prototype.hasOwnProperty.call(b3, p2)) d3[p2] = b3[p2]; 128 }; 129 return extendStatics(d2, b2); 130 }; 131 return function(d2, b2) { 132 if (typeof b2 !== "function" && b2 !== null) 133 throw new TypeError("Class extends value " + String(b2) + " is not a constructor or null"); 134 extendStatics(d2, b2); 135 function __265() { 136 this.constructor = d2; 137 } 138 d2.prototype = b2 === null ? Object.create(b2) : (__265.prototype = b2.prototype, new __265()); 139 }; 140 })(); 141 var __assign2 = exports && exports.__assign || function() { 142 __assign2 = Object.assign || function(t2) { 143 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 144 s2 = arguments[i2]; 145 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) 146 t2[p2] = s2[p2]; 147 } 148 return t2; 149 }; 150 return __assign2.apply(this, arguments); 151 }; 152 Object.defineProperty(exports, "__esModule", { value: true }); 153 exports.cloneNode = exports.hasChildren = exports.isDocument = exports.isDirective = exports.isComment = exports.isText = exports.isCDATA = exports.isTag = exports.Element = exports.Document = exports.CDATA = exports.NodeWithChildren = exports.ProcessingInstruction = exports.Comment = exports.Text = exports.DataNode = exports.Node = void 0; 154 var domelementtype_1 = require_lib(); 155 var Node2 = ( 156 /** @class */ 157 (function() { 158 function Node3() { 159 this.parent = null; 160 this.prev = null; 161 this.next = null; 162 this.startIndex = null; 163 this.endIndex = null; 164 } 165 Object.defineProperty(Node3.prototype, "parentNode", { 166 // Read-write aliases for properties 167 /** 168 * Same as {@link parent}. 169 * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. 170 */ 171 get: function() { 172 return this.parent; 173 }, 174 set: function(parent) { 175 this.parent = parent; 176 }, 177 enumerable: false, 178 configurable: true 179 }); 180 Object.defineProperty(Node3.prototype, "previousSibling", { 181 /** 182 * Same as {@link prev}. 183 * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. 184 */ 185 get: function() { 186 return this.prev; 187 }, 188 set: function(prev) { 189 this.prev = prev; 190 }, 191 enumerable: false, 192 configurable: true 193 }); 194 Object.defineProperty(Node3.prototype, "nextSibling", { 195 /** 196 * Same as {@link next}. 197 * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. 198 */ 199 get: function() { 200 return this.next; 201 }, 202 set: function(next2) { 203 this.next = next2; 204 }, 205 enumerable: false, 206 configurable: true 207 }); 208 Node3.prototype.cloneNode = function(recursive) { 209 if (recursive === void 0) { 210 recursive = false; 211 } 212 return cloneNode(this, recursive); 213 }; 214 return Node3; 215 })() 216 ); 217 exports.Node = Node2; 218 var DataNode = ( 219 /** @class */ 220 (function(_super) { 221 __extends(DataNode2, _super); 222 function DataNode2(data) { 223 var _this = _super.call(this) || this; 224 _this.data = data; 225 return _this; 226 } 227 Object.defineProperty(DataNode2.prototype, "nodeValue", { 228 /** 229 * Same as {@link data}. 230 * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. 231 */ 232 get: function() { 233 return this.data; 234 }, 235 set: function(data) { 236 this.data = data; 237 }, 238 enumerable: false, 239 configurable: true 240 }); 241 return DataNode2; 242 })(Node2) 243 ); 244 exports.DataNode = DataNode; 245 var Text3 = ( 246 /** @class */ 247 (function(_super) { 248 __extends(Text4, _super); 249 function Text4() { 250 var _this = _super !== null && _super.apply(this, arguments) || this; 251 _this.type = domelementtype_1.ElementType.Text; 252 return _this; 253 } 254 Object.defineProperty(Text4.prototype, "nodeType", { 255 get: function() { 256 return 3; 257 }, 258 enumerable: false, 259 configurable: true 260 }); 261 return Text4; 262 })(DataNode) 263 ); 264 exports.Text = Text3; 265 var Comment2 = ( 266 /** @class */ 267 (function(_super) { 268 __extends(Comment3, _super); 269 function Comment3() { 270 var _this = _super !== null && _super.apply(this, arguments) || this; 271 _this.type = domelementtype_1.ElementType.Comment; 272 return _this; 273 } 274 Object.defineProperty(Comment3.prototype, "nodeType", { 275 get: function() { 276 return 8; 277 }, 278 enumerable: false, 279 configurable: true 280 }); 281 return Comment3; 282 })(DataNode) 283 ); 284 exports.Comment = Comment2; 285 var ProcessingInstruction2 = ( 286 /** @class */ 287 (function(_super) { 288 __extends(ProcessingInstruction3, _super); 289 function ProcessingInstruction3(name118, data) { 290 var _this = _super.call(this, data) || this; 291 _this.name = name118; 292 _this.type = domelementtype_1.ElementType.Directive; 293 return _this; 294 } 295 Object.defineProperty(ProcessingInstruction3.prototype, "nodeType", { 296 get: function() { 297 return 1; 298 }, 299 enumerable: false, 300 configurable: true 301 }); 302 return ProcessingInstruction3; 303 })(DataNode) 304 ); 305 exports.ProcessingInstruction = ProcessingInstruction2; 306 var NodeWithChildren = ( 307 /** @class */ 308 (function(_super) { 309 __extends(NodeWithChildren2, _super); 310 function NodeWithChildren2(children) { 311 var _this = _super.call(this) || this; 312 _this.children = children; 313 return _this; 314 } 315 Object.defineProperty(NodeWithChildren2.prototype, "firstChild", { 316 // Aliases 317 /** First child of the node. */ 318 get: function() { 319 var _a; 320 return (_a = this.children[0]) !== null && _a !== void 0 ? _a : null; 321 }, 322 enumerable: false, 323 configurable: true 324 }); 325 Object.defineProperty(NodeWithChildren2.prototype, "lastChild", { 326 /** Last child of the node. */ 327 get: function() { 328 return this.children.length > 0 ? this.children[this.children.length - 1] : null; 329 }, 330 enumerable: false, 331 configurable: true 332 }); 333 Object.defineProperty(NodeWithChildren2.prototype, "childNodes", { 334 /** 335 * Same as {@link children}. 336 * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. 337 */ 338 get: function() { 339 return this.children; 340 }, 341 set: function(children) { 342 this.children = children; 343 }, 344 enumerable: false, 345 configurable: true 346 }); 347 return NodeWithChildren2; 348 })(Node2) 349 ); 350 exports.NodeWithChildren = NodeWithChildren; 351 var CDATA = ( 352 /** @class */ 353 (function(_super) { 354 __extends(CDATA2, _super); 355 function CDATA2() { 356 var _this = _super !== null && _super.apply(this, arguments) || this; 357 _this.type = domelementtype_1.ElementType.CDATA; 358 return _this; 359 } 360 Object.defineProperty(CDATA2.prototype, "nodeType", { 361 get: function() { 362 return 4; 363 }, 364 enumerable: false, 365 configurable: true 366 }); 367 return CDATA2; 368 })(NodeWithChildren) 369 ); 370 exports.CDATA = CDATA; 371 var Document = ( 372 /** @class */ 373 (function(_super) { 374 __extends(Document2, _super); 375 function Document2() { 376 var _this = _super !== null && _super.apply(this, arguments) || this; 377 _this.type = domelementtype_1.ElementType.Root; 378 return _this; 379 } 380 Object.defineProperty(Document2.prototype, "nodeType", { 381 get: function() { 382 return 9; 383 }, 384 enumerable: false, 385 configurable: true 386 }); 387 return Document2; 388 })(NodeWithChildren) 389 ); 390 exports.Document = Document; 391 var Element3 = ( 392 /** @class */ 393 (function(_super) { 394 __extends(Element4, _super); 395 function Element4(name118, attribs, children, type) { 396 if (children === void 0) { 397 children = []; 398 } 399 if (type === void 0) { 400 type = name118 === "script" ? domelementtype_1.ElementType.Script : name118 === "style" ? domelementtype_1.ElementType.Style : domelementtype_1.ElementType.Tag; 401 } 402 var _this = _super.call(this, children) || this; 403 _this.name = name118; 404 _this.attribs = attribs; 405 _this.type = type; 406 return _this; 407 } 408 Object.defineProperty(Element4.prototype, "nodeType", { 409 get: function() { 410 return 1; 411 }, 412 enumerable: false, 413 configurable: true 414 }); 415 Object.defineProperty(Element4.prototype, "tagName", { 416 // DOM Level 1 aliases 417 /** 418 * Same as {@link name}. 419 * [DOM spec](https://dom.spec.whatwg.org)-compatible alias. 420 */ 421 get: function() { 422 return this.name; 423 }, 424 set: function(name118) { 425 this.name = name118; 426 }, 427 enumerable: false, 428 configurable: true 429 }); 430 Object.defineProperty(Element4.prototype, "attributes", { 431 get: function() { 432 var _this = this; 433 return Object.keys(this.attribs).map(function(name118) { 434 var _a, _b; 435 return { 436 name: name118, 437 value: _this.attribs[name118], 438 namespace: (_a = _this["x-attribsNamespace"]) === null || _a === void 0 ? void 0 : _a[name118], 439 prefix: (_b = _this["x-attribsPrefix"]) === null || _b === void 0 ? void 0 : _b[name118] 440 }; 441 }); 442 }, 443 enumerable: false, 444 configurable: true 445 }); 446 return Element4; 447 })(NodeWithChildren) 448 ); 449 exports.Element = Element3; 450 function isTag(node) { 451 return (0, domelementtype_1.isTag)(node); 452 } 453 exports.isTag = isTag; 454 function isCDATA(node) { 455 return node.type === domelementtype_1.ElementType.CDATA; 456 } 457 exports.isCDATA = isCDATA; 458 function isText(node) { 459 return node.type === domelementtype_1.ElementType.Text; 460 } 461 exports.isText = isText; 462 function isComment(node) { 463 return node.type === domelementtype_1.ElementType.Comment; 464 } 465 exports.isComment = isComment; 466 function isDirective(node) { 467 return node.type === domelementtype_1.ElementType.Directive; 468 } 469 exports.isDirective = isDirective; 470 function isDocument(node) { 471 return node.type === domelementtype_1.ElementType.Root; 472 } 473 exports.isDocument = isDocument; 474 function hasChildren(node) { 475 return Object.prototype.hasOwnProperty.call(node, "children"); 476 } 477 exports.hasChildren = hasChildren; 478 function cloneNode(node, recursive) { 479 if (recursive === void 0) { 480 recursive = false; 481 } 482 var result; 483 if (isText(node)) { 484 result = new Text3(node.data); 485 } else if (isComment(node)) { 486 result = new Comment2(node.data); 487 } else if (isTag(node)) { 488 var children = recursive ? cloneChildren(node.children) : []; 489 var clone_1 = new Element3(node.name, __assign2({}, node.attribs), children); 490 children.forEach(function(child) { 491 return child.parent = clone_1; 492 }); 493 if (node.namespace != null) { 494 clone_1.namespace = node.namespace; 495 } 496 if (node["x-attribsNamespace"]) { 497 clone_1["x-attribsNamespace"] = __assign2({}, node["x-attribsNamespace"]); 498 } 499 if (node["x-attribsPrefix"]) { 500 clone_1["x-attribsPrefix"] = __assign2({}, node["x-attribsPrefix"]); 501 } 502 result = clone_1; 503 } else if (isCDATA(node)) { 504 var children = recursive ? cloneChildren(node.children) : []; 505 var clone_2 = new CDATA(children); 506 children.forEach(function(child) { 507 return child.parent = clone_2; 508 }); 509 result = clone_2; 510 } else if (isDocument(node)) { 511 var children = recursive ? cloneChildren(node.children) : []; 512 var clone_3 = new Document(children); 513 children.forEach(function(child) { 514 return child.parent = clone_3; 515 }); 516 if (node["x-mode"]) { 517 clone_3["x-mode"] = node["x-mode"]; 518 } 519 result = clone_3; 520 } else if (isDirective(node)) { 521 var instruction = new ProcessingInstruction2(node.name, node.data); 522 if (node["x-name"] != null) { 523 instruction["x-name"] = node["x-name"]; 524 instruction["x-publicId"] = node["x-publicId"]; 525 instruction["x-systemId"] = node["x-systemId"]; 526 } 527 result = instruction; 528 } else { 529 throw new Error("Not implemented yet: ".concat(node.type)); 530 } 531 result.startIndex = node.startIndex; 532 result.endIndex = node.endIndex; 533 if (node.sourceCodeLocation != null) { 534 result.sourceCodeLocation = node.sourceCodeLocation; 535 } 536 return result; 537 } 538 exports.cloneNode = cloneNode; 539 function cloneChildren(childs) { 540 var children = childs.map(function(child) { 541 return cloneNode(child, true); 542 }); 543 for (var i2 = 1; i2 < children.length; i2++) { 544 children[i2].prev = children[i2 - 1]; 545 children[i2 - 1].next = children[i2]; 546 } 547 return children; 548 } 549 } 550 }); 551 552 // node_modules/domhandler/lib/index.js 553 var require_lib2 = __commonJS({ 554 "node_modules/domhandler/lib/index.js"(exports) { 555 "use strict"; 556 var __createBinding = exports && exports.__createBinding || (Object.create ? (function(o2, m3, k2, k22) { 557 if (k22 === void 0) k22 = k2; 558 var desc = Object.getOwnPropertyDescriptor(m3, k2); 559 if (!desc || ("get" in desc ? !m3.__esModule : desc.writable || desc.configurable)) { 560 desc = { enumerable: true, get: function() { 561 return m3[k2]; 562 } }; 563 } 564 Object.defineProperty(o2, k22, desc); 565 }) : (function(o2, m3, k2, k22) { 566 if (k22 === void 0) k22 = k2; 567 o2[k22] = m3[k2]; 568 })); 569 var __exportStar = exports && exports.__exportStar || function(m3, exports2) { 570 for (var p2 in m3) if (p2 !== "default" && !Object.prototype.hasOwnProperty.call(exports2, p2)) __createBinding(exports2, m3, p2); 571 }; 572 Object.defineProperty(exports, "__esModule", { value: true }); 573 exports.DomHandler = void 0; 574 var domelementtype_1 = require_lib(); 575 var node_js_1 = require_node(); 576 __exportStar(require_node(), exports); 577 var defaultOpts = { 578 withStartIndices: false, 579 withEndIndices: false, 580 xmlMode: false 581 }; 582 var DomHandler = ( 583 /** @class */ 584 (function() { 585 function DomHandler2(callback, options2, elementCB) { 586 this.dom = []; 587 this.root = new node_js_1.Document(this.dom); 588 this.done = false; 589 this.tagStack = [this.root]; 590 this.lastNode = null; 591 this.parser = null; 592 if (typeof options2 === "function") { 593 elementCB = options2; 594 options2 = defaultOpts; 595 } 596 if (typeof callback === "object") { 597 options2 = callback; 598 callback = void 0; 599 } 600 this.callback = callback !== null && callback !== void 0 ? callback : null; 601 this.options = options2 !== null && options2 !== void 0 ? options2 : defaultOpts; 602 this.elementCB = elementCB !== null && elementCB !== void 0 ? elementCB : null; 603 } 604 DomHandler2.prototype.onparserinit = function(parser) { 605 this.parser = parser; 606 }; 607 DomHandler2.prototype.onreset = function() { 608 this.dom = []; 609 this.root = new node_js_1.Document(this.dom); 610 this.done = false; 611 this.tagStack = [this.root]; 612 this.lastNode = null; 613 this.parser = null; 614 }; 615 DomHandler2.prototype.onend = function() { 616 if (this.done) 617 return; 618 this.done = true; 619 this.parser = null; 620 this.handleCallback(null); 621 }; 622 DomHandler2.prototype.onerror = function(error2) { 623 this.handleCallback(error2); 624 }; 625 DomHandler2.prototype.onclosetag = function() { 626 this.lastNode = null; 627 var elem = this.tagStack.pop(); 628 if (this.options.withEndIndices) { 629 elem.endIndex = this.parser.endIndex; 630 } 631 if (this.elementCB) 632 this.elementCB(elem); 633 }; 634 DomHandler2.prototype.onopentag = function(name118, attribs) { 635 var type = this.options.xmlMode ? domelementtype_1.ElementType.Tag : void 0; 636 var element = new node_js_1.Element(name118, attribs, void 0, type); 637 this.addNode(element); 638 this.tagStack.push(element); 639 }; 640 DomHandler2.prototype.ontext = function(data) { 641 var lastNode = this.lastNode; 642 if (lastNode && lastNode.type === domelementtype_1.ElementType.Text) { 643 lastNode.data += data; 644 if (this.options.withEndIndices) { 645 lastNode.endIndex = this.parser.endIndex; 646 } 647 } else { 648 var node = new node_js_1.Text(data); 649 this.addNode(node); 650 this.lastNode = node; 651 } 652 }; 653 DomHandler2.prototype.oncomment = function(data) { 654 if (this.lastNode && this.lastNode.type === domelementtype_1.ElementType.Comment) { 655 this.lastNode.data += data; 656 return; 657 } 658 var node = new node_js_1.Comment(data); 659 this.addNode(node); 660 this.lastNode = node; 661 }; 662 DomHandler2.prototype.oncommentend = function() { 663 this.lastNode = null; 664 }; 665 DomHandler2.prototype.oncdatastart = function() { 666 var text = new node_js_1.Text(""); 667 var node = new node_js_1.CDATA([text]); 668 this.addNode(node); 669 text.parent = node; 670 this.lastNode = text; 671 }; 672 DomHandler2.prototype.oncdataend = function() { 673 this.lastNode = null; 674 }; 675 DomHandler2.prototype.onprocessinginstruction = function(name118, data) { 676 var node = new node_js_1.ProcessingInstruction(name118, data); 677 this.addNode(node); 678 }; 679 DomHandler2.prototype.handleCallback = function(error2) { 680 if (typeof this.callback === "function") { 681 this.callback(error2, this.dom); 682 } else if (error2) { 683 throw error2; 684 } 685 }; 686 DomHandler2.prototype.addNode = function(node) { 687 var parent = this.tagStack[this.tagStack.length - 1]; 688 var previousSibling = parent.children[parent.children.length - 1]; 689 if (this.options.withStartIndices) { 690 node.startIndex = this.parser.startIndex; 691 } 692 if (this.options.withEndIndices) { 693 node.endIndex = this.parser.endIndex; 694 } 695 parent.children.push(node); 696 if (previousSibling) { 697 node.prev = previousSibling; 698 previousSibling.next = node; 699 } 700 node.parent = parent; 701 this.lastNode = null; 702 }; 703 return DomHandler2; 704 })() 705 ); 706 exports.DomHandler = DomHandler; 707 exports.default = DomHandler; 708 } 709 }); 710 711 // node_modules/html-dom-parser/lib/client/constants.js 712 var require_constants = __commonJS({ 713 "node_modules/html-dom-parser/lib/client/constants.js"(exports) { 714 "use strict"; 715 Object.defineProperty(exports, "__esModule", { value: true }); 716 exports.CARRIAGE_RETURN_PLACEHOLDER_REGEX = exports.CARRIAGE_RETURN_PLACEHOLDER = exports.CARRIAGE_RETURN_REGEX = exports.CARRIAGE_RETURN = exports.CASE_SENSITIVE_TAG_NAMES_MAP = exports.CASE_SENSITIVE_TAG_NAMES = void 0; 717 exports.CASE_SENSITIVE_TAG_NAMES = [ 718 "animateMotion", 719 "animateTransform", 720 "clipPath", 721 "feBlend", 722 "feColorMatrix", 723 "feComponentTransfer", 724 "feComposite", 725 "feConvolveMatrix", 726 "feDiffuseLighting", 727 "feDisplacementMap", 728 "feDropShadow", 729 "feFlood", 730 "feFuncA", 731 "feFuncB", 732 "feFuncG", 733 "feFuncR", 734 "feGaussianBlur", 735 "feImage", 736 "feMerge", 737 "feMergeNode", 738 "feMorphology", 739 "feOffset", 740 "fePointLight", 741 "feSpecularLighting", 742 "feSpotLight", 743 "feTile", 744 "feTurbulence", 745 "foreignObject", 746 "linearGradient", 747 "radialGradient", 748 "textPath" 749 ]; 750 exports.CASE_SENSITIVE_TAG_NAMES_MAP = exports.CASE_SENSITIVE_TAG_NAMES.reduce(function(accumulator, tagName) { 751 accumulator[tagName.toLowerCase()] = tagName; 752 return accumulator; 753 }, {}); 754 exports.CARRIAGE_RETURN = "\r"; 755 exports.CARRIAGE_RETURN_REGEX = new RegExp(exports.CARRIAGE_RETURN, "g"); 756 exports.CARRIAGE_RETURN_PLACEHOLDER = "__HTML_DOM_PARSER_CARRIAGE_RETURN_PLACEHOLDER_".concat(Date.now(), "__"); 757 exports.CARRIAGE_RETURN_PLACEHOLDER_REGEX = new RegExp(exports.CARRIAGE_RETURN_PLACEHOLDER, "g"); 758 } 759 }); 760 761 // node_modules/html-dom-parser/lib/client/utilities.js 762 var require_utilities = __commonJS({ 763 "node_modules/html-dom-parser/lib/client/utilities.js"(exports) { 764 "use strict"; 765 Object.defineProperty(exports, "__esModule", { value: true }); 766 exports.formatAttributes = formatAttributes; 767 exports.escapeSpecialCharacters = escapeSpecialCharacters; 768 exports.revertEscapedCharacters = revertEscapedCharacters; 769 exports.formatDOM = formatDOM; 770 var domhandler_1 = require_lib2(); 771 var constants_1 = require_constants(); 772 function getCaseSensitiveTagName(tagName) { 773 return constants_1.CASE_SENSITIVE_TAG_NAMES_MAP[tagName]; 774 } 775 function formatAttributes(attributes2) { 776 var map = {}; 777 var index = 0; 778 var attributesLength = attributes2.length; 779 for (; index < attributesLength; index++) { 780 var attribute = attributes2[index]; 781 map[attribute.name] = attribute.value; 782 } 783 return map; 784 } 785 function formatTagName(tagName) { 786 tagName = tagName.toLowerCase(); 787 var caseSensitiveTagName = getCaseSensitiveTagName(tagName); 788 if (caseSensitiveTagName) { 789 return caseSensitiveTagName; 790 } 791 return tagName; 792 } 793 function escapeSpecialCharacters(html) { 794 return html.replace(constants_1.CARRIAGE_RETURN_REGEX, constants_1.CARRIAGE_RETURN_PLACEHOLDER); 795 } 796 function revertEscapedCharacters(text) { 797 return text.replace(constants_1.CARRIAGE_RETURN_PLACEHOLDER_REGEX, constants_1.CARRIAGE_RETURN); 798 } 799 function formatDOM(nodes, parent, directive) { 800 if (parent === void 0) { 801 parent = null; 802 } 803 var domNodes = []; 804 var current; 805 var index = 0; 806 var nodesLength = nodes.length; 807 for (; index < nodesLength; index++) { 808 var node = nodes[index]; 809 switch (node.nodeType) { 810 case 1: { 811 var tagName = formatTagName(node.nodeName); 812 current = new domhandler_1.Element(tagName, formatAttributes(node.attributes)); 813 current.children = formatDOM( 814 // template children are on content 815 tagName === "template" ? node.content.childNodes : node.childNodes, 816 current 817 ); 818 break; 819 } 820 case 3: 821 current = new domhandler_1.Text(revertEscapedCharacters(node.nodeValue)); 822 break; 823 case 8: 824 current = new domhandler_1.Comment(node.nodeValue); 825 break; 826 default: 827 continue; 828 } 829 var prev = domNodes[index - 1] || null; 830 if (prev) { 831 prev.next = current; 832 } 833 current.parent = parent; 834 current.prev = prev; 835 current.next = null; 836 domNodes.push(current); 837 } 838 if (directive) { 839 current = new domhandler_1.ProcessingInstruction(directive.substring(0, directive.indexOf(" ")).toLowerCase(), directive); 840 current.next = domNodes[0] || null; 841 current.parent = parent; 842 domNodes.unshift(current); 843 if (domNodes[1]) { 844 domNodes[1].prev = domNodes[0]; 845 } 846 } 847 return domNodes; 848 } 849 } 850 }); 851 852 // node_modules/html-dom-parser/lib/client/domparser.js 853 var require_domparser = __commonJS({ 854 "node_modules/html-dom-parser/lib/client/domparser.js"(exports) { 855 "use strict"; 856 Object.defineProperty(exports, "__esModule", { value: true }); 857 exports.default = domparser; 858 var utilities_1 = require_utilities(); 859 var HTML = "html"; 860 var HEAD = "head"; 861 var BODY = "body"; 862 var FIRST_TAG_REGEX = /<([a-zA-Z]+[0-9]?)/; 863 var HEAD_TAG_REGEX = /<head[^]*>/i; 864 var BODY_TAG_REGEX = /<body[^]*>/i; 865 var parseFromDocument = function(html, tagName) { 866 throw new Error("This browser does not support `document.implementation.createHTMLDocument`"); 867 }; 868 var parseFromString = function(html, tagName) { 869 throw new Error("This browser does not support `DOMParser.prototype.parseFromString`"); 870 }; 871 var DOMParser = typeof window === "object" && window.DOMParser; 872 if (typeof DOMParser === "function") { 873 domParser_1 = new DOMParser(); 874 mimeType_1 = "text/html"; 875 parseFromString = function(html, tagName) { 876 if (tagName) { 877 html = "<".concat(tagName, ">").concat(html, "</").concat(tagName, ">"); 878 } 879 return domParser_1.parseFromString(html, mimeType_1); 880 }; 881 parseFromDocument = parseFromString; 882 } 883 var domParser_1; 884 var mimeType_1; 885 if (typeof document === "object" && document.implementation) { 886 htmlDocument_1 = document.implementation.createHTMLDocument(); 887 parseFromDocument = function(html, tagName) { 888 if (tagName) { 889 var element = htmlDocument_1.documentElement.querySelector(tagName); 890 if (element) { 891 element.innerHTML = html; 892 } 893 return htmlDocument_1; 894 } 895 htmlDocument_1.documentElement.innerHTML = html; 896 return htmlDocument_1; 897 }; 898 } 899 var htmlDocument_1; 900 var template = typeof document === "object" && document.createElement("template"); 901 var parseFromTemplate; 902 if (template && template.content) { 903 parseFromTemplate = function(html) { 904 template.innerHTML = html; 905 return template.content.childNodes; 906 }; 907 } 908 function domparser(html) { 909 var _a, _b; 910 html = (0, utilities_1.escapeSpecialCharacters)(html); 911 var match = html.match(FIRST_TAG_REGEX); 912 var firstTagName = match && match[1] ? match[1].toLowerCase() : ""; 913 switch (firstTagName) { 914 case HTML: { 915 var doc = parseFromString(html); 916 if (!HEAD_TAG_REGEX.test(html)) { 917 var element = doc.querySelector(HEAD); 918 (_a = element === null || element === void 0 ? void 0 : element.parentNode) === null || _a === void 0 ? void 0 : _a.removeChild(element); 919 } 920 if (!BODY_TAG_REGEX.test(html)) { 921 var element = doc.querySelector(BODY); 922 (_b = element === null || element === void 0 ? void 0 : element.parentNode) === null || _b === void 0 ? void 0 : _b.removeChild(element); 923 } 924 return doc.querySelectorAll(HTML); 925 } 926 case HEAD: 927 case BODY: { 928 var elements = parseFromDocument(html).querySelectorAll(firstTagName); 929 if (BODY_TAG_REGEX.test(html) && HEAD_TAG_REGEX.test(html)) { 930 return elements[0].parentNode.childNodes; 931 } 932 return elements; 933 } 934 // low-level tag or text 935 default: { 936 if (parseFromTemplate) { 937 return parseFromTemplate(html); 938 } 939 var element = parseFromDocument(html, BODY).querySelector(BODY); 940 return element.childNodes; 941 } 942 } 943 } 944 } 945 }); 946 947 // node_modules/html-dom-parser/lib/client/html-to-dom.js 948 var require_html_to_dom = __commonJS({ 949 "node_modules/html-dom-parser/lib/client/html-to-dom.js"(exports) { 950 "use strict"; 951 var __importDefault = exports && exports.__importDefault || function(mod) { 952 return mod && mod.__esModule ? mod : { "default": mod }; 953 }; 954 Object.defineProperty(exports, "__esModule", { value: true }); 955 exports.default = HTMLDOMParser; 956 var domparser_1 = __importDefault(require_domparser()); 957 var utilities_1 = require_utilities(); 958 var DIRECTIVE_REGEX = /<(![a-zA-Z\s]+)>/; 959 function HTMLDOMParser(html) { 960 if (typeof html !== "string") { 961 throw new TypeError("First argument must be a string"); 962 } 963 if (!html) { 964 return []; 965 } 966 var match = html.match(DIRECTIVE_REGEX); 967 var directive = match ? match[1] : void 0; 968 return (0, utilities_1.formatDOM)((0, domparser_1.default)(html), null, directive); 969 } 970 } 971 }); 972 973 // node_modules/react-property/lib/possibleStandardNamesOptimized.js 974 var require_possibleStandardNamesOptimized = __commonJS({ 975 "node_modules/react-property/lib/possibleStandardNamesOptimized.js"(exports) { 976 var SAME = 0; 977 exports.SAME = SAME; 978 var CAMELCASE = 1; 979 exports.CAMELCASE = CAMELCASE; 980 exports.possibleStandardNames = { 981 accept: 0, 982 acceptCharset: 1, 983 "accept-charset": "acceptCharset", 984 accessKey: 1, 985 action: 0, 986 allowFullScreen: 1, 987 alt: 0, 988 as: 0, 989 async: 0, 990 autoCapitalize: 1, 991 autoComplete: 1, 992 autoCorrect: 1, 993 autoFocus: 1, 994 autoPlay: 1, 995 autoSave: 1, 996 capture: 0, 997 cellPadding: 1, 998 cellSpacing: 1, 999 challenge: 0, 1000 charSet: 1, 1001 checked: 0, 1002 children: 0, 1003 cite: 0, 1004 class: "className", 1005 classID: 1, 1006 className: 1, 1007 cols: 0, 1008 colSpan: 1, 1009 content: 0, 1010 contentEditable: 1, 1011 contextMenu: 1, 1012 controls: 0, 1013 controlsList: 1, 1014 coords: 0, 1015 crossOrigin: 1, 1016 dangerouslySetInnerHTML: 1, 1017 data: 0, 1018 dateTime: 1, 1019 default: 0, 1020 defaultChecked: 1, 1021 defaultValue: 1, 1022 defer: 0, 1023 dir: 0, 1024 disabled: 0, 1025 disablePictureInPicture: 1, 1026 disableRemotePlayback: 1, 1027 download: 0, 1028 draggable: 0, 1029 encType: 1, 1030 enterKeyHint: 1, 1031 for: "htmlFor", 1032 form: 0, 1033 formMethod: 1, 1034 formAction: 1, 1035 formEncType: 1, 1036 formNoValidate: 1, 1037 formTarget: 1, 1038 frameBorder: 1, 1039 headers: 0, 1040 height: 0, 1041 hidden: 0, 1042 high: 0, 1043 href: 0, 1044 hrefLang: 1, 1045 htmlFor: 1, 1046 httpEquiv: 1, 1047 "http-equiv": "httpEquiv", 1048 icon: 0, 1049 id: 0, 1050 innerHTML: 1, 1051 inputMode: 1, 1052 integrity: 0, 1053 is: 0, 1054 itemID: 1, 1055 itemProp: 1, 1056 itemRef: 1, 1057 itemScope: 1, 1058 itemType: 1, 1059 keyParams: 1, 1060 keyType: 1, 1061 kind: 0, 1062 label: 0, 1063 lang: 0, 1064 list: 0, 1065 loop: 0, 1066 low: 0, 1067 manifest: 0, 1068 marginWidth: 1, 1069 marginHeight: 1, 1070 max: 0, 1071 maxLength: 1, 1072 media: 0, 1073 mediaGroup: 1, 1074 method: 0, 1075 min: 0, 1076 minLength: 1, 1077 multiple: 0, 1078 muted: 0, 1079 name: 0, 1080 noModule: 1, 1081 nonce: 0, 1082 noValidate: 1, 1083 open: 0, 1084 optimum: 0, 1085 pattern: 0, 1086 placeholder: 0, 1087 playsInline: 1, 1088 poster: 0, 1089 preload: 0, 1090 profile: 0, 1091 radioGroup: 1, 1092 readOnly: 1, 1093 referrerPolicy: 1, 1094 rel: 0, 1095 required: 0, 1096 reversed: 0, 1097 role: 0, 1098 rows: 0, 1099 rowSpan: 1, 1100 sandbox: 0, 1101 scope: 0, 1102 scoped: 0, 1103 scrolling: 0, 1104 seamless: 0, 1105 selected: 0, 1106 shape: 0, 1107 size: 0, 1108 sizes: 0, 1109 span: 0, 1110 spellCheck: 1, 1111 src: 0, 1112 srcDoc: 1, 1113 srcLang: 1, 1114 srcSet: 1, 1115 start: 0, 1116 step: 0, 1117 style: 0, 1118 summary: 0, 1119 tabIndex: 1, 1120 target: 0, 1121 title: 0, 1122 type: 0, 1123 useMap: 1, 1124 value: 0, 1125 width: 0, 1126 wmode: 0, 1127 wrap: 0, 1128 about: 0, 1129 accentHeight: 1, 1130 "accent-height": "accentHeight", 1131 accumulate: 0, 1132 additive: 0, 1133 alignmentBaseline: 1, 1134 "alignment-baseline": "alignmentBaseline", 1135 allowReorder: 1, 1136 alphabetic: 0, 1137 amplitude: 0, 1138 arabicForm: 1, 1139 "arabic-form": "arabicForm", 1140 ascent: 0, 1141 attributeName: 1, 1142 attributeType: 1, 1143 autoReverse: 1, 1144 azimuth: 0, 1145 baseFrequency: 1, 1146 baselineShift: 1, 1147 "baseline-shift": "baselineShift", 1148 baseProfile: 1, 1149 bbox: 0, 1150 begin: 0, 1151 bias: 0, 1152 by: 0, 1153 calcMode: 1, 1154 capHeight: 1, 1155 "cap-height": "capHeight", 1156 clip: 0, 1157 clipPath: 1, 1158 "clip-path": "clipPath", 1159 clipPathUnits: 1, 1160 clipRule: 1, 1161 "clip-rule": "clipRule", 1162 color: 0, 1163 colorInterpolation: 1, 1164 "color-interpolation": "colorInterpolation", 1165 colorInterpolationFilters: 1, 1166 "color-interpolation-filters": "colorInterpolationFilters", 1167 colorProfile: 1, 1168 "color-profile": "colorProfile", 1169 colorRendering: 1, 1170 "color-rendering": "colorRendering", 1171 contentScriptType: 1, 1172 contentStyleType: 1, 1173 cursor: 0, 1174 cx: 0, 1175 cy: 0, 1176 d: 0, 1177 datatype: 0, 1178 decelerate: 0, 1179 descent: 0, 1180 diffuseConstant: 1, 1181 direction: 0, 1182 display: 0, 1183 divisor: 0, 1184 dominantBaseline: 1, 1185 "dominant-baseline": "dominantBaseline", 1186 dur: 0, 1187 dx: 0, 1188 dy: 0, 1189 edgeMode: 1, 1190 elevation: 0, 1191 enableBackground: 1, 1192 "enable-background": "enableBackground", 1193 end: 0, 1194 exponent: 0, 1195 externalResourcesRequired: 1, 1196 fill: 0, 1197 fillOpacity: 1, 1198 "fill-opacity": "fillOpacity", 1199 fillRule: 1, 1200 "fill-rule": "fillRule", 1201 filter: 0, 1202 filterRes: 1, 1203 filterUnits: 1, 1204 floodOpacity: 1, 1205 "flood-opacity": "floodOpacity", 1206 floodColor: 1, 1207 "flood-color": "floodColor", 1208 focusable: 0, 1209 fontFamily: 1, 1210 "font-family": "fontFamily", 1211 fontSize: 1, 1212 "font-size": "fontSize", 1213 fontSizeAdjust: 1, 1214 "font-size-adjust": "fontSizeAdjust", 1215 fontStretch: 1, 1216 "font-stretch": "fontStretch", 1217 fontStyle: 1, 1218 "font-style": "fontStyle", 1219 fontVariant: 1, 1220 "font-variant": "fontVariant", 1221 fontWeight: 1, 1222 "font-weight": "fontWeight", 1223 format: 0, 1224 from: 0, 1225 fx: 0, 1226 fy: 0, 1227 g1: 0, 1228 g2: 0, 1229 glyphName: 1, 1230 "glyph-name": "glyphName", 1231 glyphOrientationHorizontal: 1, 1232 "glyph-orientation-horizontal": "glyphOrientationHorizontal", 1233 glyphOrientationVertical: 1, 1234 "glyph-orientation-vertical": "glyphOrientationVertical", 1235 glyphRef: 1, 1236 gradientTransform: 1, 1237 gradientUnits: 1, 1238 hanging: 0, 1239 horizAdvX: 1, 1240 "horiz-adv-x": "horizAdvX", 1241 horizOriginX: 1, 1242 "horiz-origin-x": "horizOriginX", 1243 ideographic: 0, 1244 imageRendering: 1, 1245 "image-rendering": "imageRendering", 1246 in2: 0, 1247 in: 0, 1248 inlist: 0, 1249 intercept: 0, 1250 k1: 0, 1251 k2: 0, 1252 k3: 0, 1253 k4: 0, 1254 k: 0, 1255 kernelMatrix: 1, 1256 kernelUnitLength: 1, 1257 kerning: 0, 1258 keyPoints: 1, 1259 keySplines: 1, 1260 keyTimes: 1, 1261 lengthAdjust: 1, 1262 letterSpacing: 1, 1263 "letter-spacing": "letterSpacing", 1264 lightingColor: 1, 1265 "lighting-color": "lightingColor", 1266 limitingConeAngle: 1, 1267 local: 0, 1268 markerEnd: 1, 1269 "marker-end": "markerEnd", 1270 markerHeight: 1, 1271 markerMid: 1, 1272 "marker-mid": "markerMid", 1273 markerStart: 1, 1274 "marker-start": "markerStart", 1275 markerUnits: 1, 1276 markerWidth: 1, 1277 mask: 0, 1278 maskContentUnits: 1, 1279 maskUnits: 1, 1280 mathematical: 0, 1281 mode: 0, 1282 numOctaves: 1, 1283 offset: 0, 1284 opacity: 0, 1285 operator: 0, 1286 order: 0, 1287 orient: 0, 1288 orientation: 0, 1289 origin: 0, 1290 overflow: 0, 1291 overlinePosition: 1, 1292 "overline-position": "overlinePosition", 1293 overlineThickness: 1, 1294 "overline-thickness": "overlineThickness", 1295 paintOrder: 1, 1296 "paint-order": "paintOrder", 1297 panose1: 0, 1298 "panose-1": "panose1", 1299 pathLength: 1, 1300 patternContentUnits: 1, 1301 patternTransform: 1, 1302 patternUnits: 1, 1303 pointerEvents: 1, 1304 "pointer-events": "pointerEvents", 1305 points: 0, 1306 pointsAtX: 1, 1307 pointsAtY: 1, 1308 pointsAtZ: 1, 1309 prefix: 0, 1310 preserveAlpha: 1, 1311 preserveAspectRatio: 1, 1312 primitiveUnits: 1, 1313 property: 0, 1314 r: 0, 1315 radius: 0, 1316 refX: 1, 1317 refY: 1, 1318 renderingIntent: 1, 1319 "rendering-intent": "renderingIntent", 1320 repeatCount: 1, 1321 repeatDur: 1, 1322 requiredExtensions: 1, 1323 requiredFeatures: 1, 1324 resource: 0, 1325 restart: 0, 1326 result: 0, 1327 results: 0, 1328 rotate: 0, 1329 rx: 0, 1330 ry: 0, 1331 scale: 0, 1332 security: 0, 1333 seed: 0, 1334 shapeRendering: 1, 1335 "shape-rendering": "shapeRendering", 1336 slope: 0, 1337 spacing: 0, 1338 specularConstant: 1, 1339 specularExponent: 1, 1340 speed: 0, 1341 spreadMethod: 1, 1342 startOffset: 1, 1343 stdDeviation: 1, 1344 stemh: 0, 1345 stemv: 0, 1346 stitchTiles: 1, 1347 stopColor: 1, 1348 "stop-color": "stopColor", 1349 stopOpacity: 1, 1350 "stop-opacity": "stopOpacity", 1351 strikethroughPosition: 1, 1352 "strikethrough-position": "strikethroughPosition", 1353 strikethroughThickness: 1, 1354 "strikethrough-thickness": "strikethroughThickness", 1355 string: 0, 1356 stroke: 0, 1357 strokeDasharray: 1, 1358 "stroke-dasharray": "strokeDasharray", 1359 strokeDashoffset: 1, 1360 "stroke-dashoffset": "strokeDashoffset", 1361 strokeLinecap: 1, 1362 "stroke-linecap": "strokeLinecap", 1363 strokeLinejoin: 1, 1364 "stroke-linejoin": "strokeLinejoin", 1365 strokeMiterlimit: 1, 1366 "stroke-miterlimit": "strokeMiterlimit", 1367 strokeWidth: 1, 1368 "stroke-width": "strokeWidth", 1369 strokeOpacity: 1, 1370 "stroke-opacity": "strokeOpacity", 1371 suppressContentEditableWarning: 1, 1372 suppressHydrationWarning: 1, 1373 surfaceScale: 1, 1374 systemLanguage: 1, 1375 tableValues: 1, 1376 targetX: 1, 1377 targetY: 1, 1378 textAnchor: 1, 1379 "text-anchor": "textAnchor", 1380 textDecoration: 1, 1381 "text-decoration": "textDecoration", 1382 textLength: 1, 1383 textRendering: 1, 1384 "text-rendering": "textRendering", 1385 to: 0, 1386 transform: 0, 1387 typeof: 0, 1388 u1: 0, 1389 u2: 0, 1390 underlinePosition: 1, 1391 "underline-position": "underlinePosition", 1392 underlineThickness: 1, 1393 "underline-thickness": "underlineThickness", 1394 unicode: 0, 1395 unicodeBidi: 1, 1396 "unicode-bidi": "unicodeBidi", 1397 unicodeRange: 1, 1398 "unicode-range": "unicodeRange", 1399 unitsPerEm: 1, 1400 "units-per-em": "unitsPerEm", 1401 unselectable: 0, 1402 vAlphabetic: 1, 1403 "v-alphabetic": "vAlphabetic", 1404 values: 0, 1405 vectorEffect: 1, 1406 "vector-effect": "vectorEffect", 1407 version: 0, 1408 vertAdvY: 1, 1409 "vert-adv-y": "vertAdvY", 1410 vertOriginX: 1, 1411 "vert-origin-x": "vertOriginX", 1412 vertOriginY: 1, 1413 "vert-origin-y": "vertOriginY", 1414 vHanging: 1, 1415 "v-hanging": "vHanging", 1416 vIdeographic: 1, 1417 "v-ideographic": "vIdeographic", 1418 viewBox: 1, 1419 viewTarget: 1, 1420 visibility: 0, 1421 vMathematical: 1, 1422 "v-mathematical": "vMathematical", 1423 vocab: 0, 1424 widths: 0, 1425 wordSpacing: 1, 1426 "word-spacing": "wordSpacing", 1427 writingMode: 1, 1428 "writing-mode": "writingMode", 1429 x1: 0, 1430 x2: 0, 1431 x: 0, 1432 xChannelSelector: 1, 1433 xHeight: 1, 1434 "x-height": "xHeight", 1435 xlinkActuate: 1, 1436 "xlink:actuate": "xlinkActuate", 1437 xlinkArcrole: 1, 1438 "xlink:arcrole": "xlinkArcrole", 1439 xlinkHref: 1, 1440 "xlink:href": "xlinkHref", 1441 xlinkRole: 1, 1442 "xlink:role": "xlinkRole", 1443 xlinkShow: 1, 1444 "xlink:show": "xlinkShow", 1445 xlinkTitle: 1, 1446 "xlink:title": "xlinkTitle", 1447 xlinkType: 1, 1448 "xlink:type": "xlinkType", 1449 xmlBase: 1, 1450 "xml:base": "xmlBase", 1451 xmlLang: 1, 1452 "xml:lang": "xmlLang", 1453 xmlns: 0, 1454 "xml:space": "xmlSpace", 1455 xmlnsXlink: 1, 1456 "xmlns:xlink": "xmlnsXlink", 1457 xmlSpace: 1, 1458 y1: 0, 1459 y2: 0, 1460 y: 0, 1461 yChannelSelector: 1, 1462 z: 0, 1463 zoomAndPan: 1 1464 }; 1465 } 1466 }); 1467 1468 // node_modules/react-property/lib/index.js 1469 var require_lib3 = __commonJS({ 1470 "node_modules/react-property/lib/index.js"(exports) { 1471 "use strict"; 1472 var RESERVED = 0; 1473 var STRING = 1; 1474 var BOOLEANISH_STRING = 2; 1475 var BOOLEAN = 3; 1476 var OVERLOADED_BOOLEAN = 4; 1477 var NUMERIC = 5; 1478 var POSITIVE_NUMERIC = 6; 1479 function getPropertyInfo(name118) { 1480 return properties.hasOwnProperty(name118) ? properties[name118] : null; 1481 } 1482 function PropertyInfoRecord(name118, type, mustUseProperty, attributeName, attributeNamespace, sanitizeURL, removeEmptyString) { 1483 this.acceptsBooleans = type === BOOLEANISH_STRING || type === BOOLEAN || type === OVERLOADED_BOOLEAN; 1484 this.attributeName = attributeName; 1485 this.attributeNamespace = attributeNamespace; 1486 this.mustUseProperty = mustUseProperty; 1487 this.propertyName = name118; 1488 this.type = type; 1489 this.sanitizeURL = sanitizeURL; 1490 this.removeEmptyString = removeEmptyString; 1491 } 1492 var properties = {}; 1493 var reservedProps = [ 1494 "children", 1495 "dangerouslySetInnerHTML", 1496 // TODO: This prevents the assignment of defaultValue to regular 1497 // elements (not just inputs). Now that ReactDOMInput assigns to the 1498 // defaultValue property -- do we need this? 1499 "defaultValue", 1500 "defaultChecked", 1501 "innerHTML", 1502 "suppressContentEditableWarning", 1503 "suppressHydrationWarning", 1504 "style" 1505 ]; 1506 reservedProps.forEach((name118) => { 1507 properties[name118] = new PropertyInfoRecord( 1508 name118, 1509 RESERVED, 1510 false, 1511 // mustUseProperty 1512 name118, 1513 // attributeName 1514 null, 1515 // attributeNamespace 1516 false, 1517 // sanitizeURL 1518 false 1519 // removeEmptyString 1520 ); 1521 }); 1522 [ 1523 ["acceptCharset", "accept-charset"], 1524 ["className", "class"], 1525 ["htmlFor", "for"], 1526 ["httpEquiv", "http-equiv"] 1527 ].forEach(([name118, attributeName]) => { 1528 properties[name118] = new PropertyInfoRecord( 1529 name118, 1530 STRING, 1531 false, 1532 // mustUseProperty 1533 attributeName, 1534 // attributeName 1535 null, 1536 // attributeNamespace 1537 false, 1538 // sanitizeURL 1539 false 1540 // removeEmptyString 1541 ); 1542 }); 1543 ["contentEditable", "draggable", "spellCheck", "value"].forEach((name118) => { 1544 properties[name118] = new PropertyInfoRecord( 1545 name118, 1546 BOOLEANISH_STRING, 1547 false, 1548 // mustUseProperty 1549 name118.toLowerCase(), 1550 // attributeName 1551 null, 1552 // attributeNamespace 1553 false, 1554 // sanitizeURL 1555 false 1556 // removeEmptyString 1557 ); 1558 }); 1559 [ 1560 "autoReverse", 1561 "externalResourcesRequired", 1562 "focusable", 1563 "preserveAlpha" 1564 ].forEach((name118) => { 1565 properties[name118] = new PropertyInfoRecord( 1566 name118, 1567 BOOLEANISH_STRING, 1568 false, 1569 // mustUseProperty 1570 name118, 1571 // attributeName 1572 null, 1573 // attributeNamespace 1574 false, 1575 // sanitizeURL 1576 false 1577 // removeEmptyString 1578 ); 1579 }); 1580 [ 1581 "allowFullScreen", 1582 "async", 1583 // Note: there is a special case that prevents it from being written to the DOM 1584 // on the client side because the browsers are inconsistent. Instead we call focus(). 1585 "autoFocus", 1586 "autoPlay", 1587 "controls", 1588 "default", 1589 "defer", 1590 "disabled", 1591 "disablePictureInPicture", 1592 "disableRemotePlayback", 1593 "formNoValidate", 1594 "hidden", 1595 "loop", 1596 "noModule", 1597 "noValidate", 1598 "open", 1599 "playsInline", 1600 "readOnly", 1601 "required", 1602 "reversed", 1603 "scoped", 1604 "seamless", 1605 // Microdata 1606 "itemScope" 1607 ].forEach((name118) => { 1608 properties[name118] = new PropertyInfoRecord( 1609 name118, 1610 BOOLEAN, 1611 false, 1612 // mustUseProperty 1613 name118.toLowerCase(), 1614 // attributeName 1615 null, 1616 // attributeNamespace 1617 false, 1618 // sanitizeURL 1619 false 1620 // removeEmptyString 1621 ); 1622 }); 1623 [ 1624 "checked", 1625 // Note: `option.selected` is not updated if `select.multiple` is 1626 // disabled with `removeAttribute`. We have special logic for handling this. 1627 "multiple", 1628 "muted", 1629 "selected" 1630 // NOTE: if you add a camelCased prop to this list, 1631 // you'll need to set attributeName to name.toLowerCase() 1632 // instead in the assignment below. 1633 ].forEach((name118) => { 1634 properties[name118] = new PropertyInfoRecord( 1635 name118, 1636 BOOLEAN, 1637 true, 1638 // mustUseProperty 1639 name118, 1640 // attributeName 1641 null, 1642 // attributeNamespace 1643 false, 1644 // sanitizeURL 1645 false 1646 // removeEmptyString 1647 ); 1648 }); 1649 [ 1650 "capture", 1651 "download" 1652 // NOTE: if you add a camelCased prop to this list, 1653 // you'll need to set attributeName to name.toLowerCase() 1654 // instead in the assignment below. 1655 ].forEach((name118) => { 1656 properties[name118] = new PropertyInfoRecord( 1657 name118, 1658 OVERLOADED_BOOLEAN, 1659 false, 1660 // mustUseProperty 1661 name118, 1662 // attributeName 1663 null, 1664 // attributeNamespace 1665 false, 1666 // sanitizeURL 1667 false 1668 // removeEmptyString 1669 ); 1670 }); 1671 [ 1672 "cols", 1673 "rows", 1674 "size", 1675 "span" 1676 // NOTE: if you add a camelCased prop to this list, 1677 // you'll need to set attributeName to name.toLowerCase() 1678 // instead in the assignment below. 1679 ].forEach((name118) => { 1680 properties[name118] = new PropertyInfoRecord( 1681 name118, 1682 POSITIVE_NUMERIC, 1683 false, 1684 // mustUseProperty 1685 name118, 1686 // attributeName 1687 null, 1688 // attributeNamespace 1689 false, 1690 // sanitizeURL 1691 false 1692 // removeEmptyString 1693 ); 1694 }); 1695 ["rowSpan", "start"].forEach((name118) => { 1696 properties[name118] = new PropertyInfoRecord( 1697 name118, 1698 NUMERIC, 1699 false, 1700 // mustUseProperty 1701 name118.toLowerCase(), 1702 // attributeName 1703 null, 1704 // attributeNamespace 1705 false, 1706 // sanitizeURL 1707 false 1708 // removeEmptyString 1709 ); 1710 }); 1711 var CAMELIZE = /[\-\:]([a-z])/g; 1712 var capitalize2 = (token) => token[1].toUpperCase(); 1713 [ 1714 "accent-height", 1715 "alignment-baseline", 1716 "arabic-form", 1717 "baseline-shift", 1718 "cap-height", 1719 "clip-path", 1720 "clip-rule", 1721 "color-interpolation", 1722 "color-interpolation-filters", 1723 "color-profile", 1724 "color-rendering", 1725 "dominant-baseline", 1726 "enable-background", 1727 "fill-opacity", 1728 "fill-rule", 1729 "flood-color", 1730 "flood-opacity", 1731 "font-family", 1732 "font-size", 1733 "font-size-adjust", 1734 "font-stretch", 1735 "font-style", 1736 "font-variant", 1737 "font-weight", 1738 "glyph-name", 1739 "glyph-orientation-horizontal", 1740 "glyph-orientation-vertical", 1741 "horiz-adv-x", 1742 "horiz-origin-x", 1743 "image-rendering", 1744 "letter-spacing", 1745 "lighting-color", 1746 "marker-end", 1747 "marker-mid", 1748 "marker-start", 1749 "overline-position", 1750 "overline-thickness", 1751 "paint-order", 1752 "panose-1", 1753 "pointer-events", 1754 "rendering-intent", 1755 "shape-rendering", 1756 "stop-color", 1757 "stop-opacity", 1758 "strikethrough-position", 1759 "strikethrough-thickness", 1760 "stroke-dasharray", 1761 "stroke-dashoffset", 1762 "stroke-linecap", 1763 "stroke-linejoin", 1764 "stroke-miterlimit", 1765 "stroke-opacity", 1766 "stroke-width", 1767 "text-anchor", 1768 "text-decoration", 1769 "text-rendering", 1770 "underline-position", 1771 "underline-thickness", 1772 "unicode-bidi", 1773 "unicode-range", 1774 "units-per-em", 1775 "v-alphabetic", 1776 "v-hanging", 1777 "v-ideographic", 1778 "v-mathematical", 1779 "vector-effect", 1780 "vert-adv-y", 1781 "vert-origin-x", 1782 "vert-origin-y", 1783 "word-spacing", 1784 "writing-mode", 1785 "xmlns:xlink", 1786 "x-height" 1787 // NOTE: if you add a camelCased prop to this list, 1788 // you'll need to set attributeName to name.toLowerCase() 1789 // instead in the assignment below. 1790 ].forEach((attributeName) => { 1791 const name118 = attributeName.replace(CAMELIZE, capitalize2); 1792 properties[name118] = new PropertyInfoRecord( 1793 name118, 1794 STRING, 1795 false, 1796 // mustUseProperty 1797 attributeName, 1798 null, 1799 // attributeNamespace 1800 false, 1801 // sanitizeURL 1802 false 1803 // removeEmptyString 1804 ); 1805 }); 1806 [ 1807 "xlink:actuate", 1808 "xlink:arcrole", 1809 "xlink:role", 1810 "xlink:show", 1811 "xlink:title", 1812 "xlink:type" 1813 // NOTE: if you add a camelCased prop to this list, 1814 // you'll need to set attributeName to name.toLowerCase() 1815 // instead in the assignment below. 1816 ].forEach((attributeName) => { 1817 const name118 = attributeName.replace(CAMELIZE, capitalize2); 1818 properties[name118] = new PropertyInfoRecord( 1819 name118, 1820 STRING, 1821 false, 1822 // mustUseProperty 1823 attributeName, 1824 "http://www.w3.org/1999/xlink", 1825 false, 1826 // sanitizeURL 1827 false 1828 // removeEmptyString 1829 ); 1830 }); 1831 [ 1832 "xml:base", 1833 "xml:lang", 1834 "xml:space" 1835 // NOTE: if you add a camelCased prop to this list, 1836 // you'll need to set attributeName to name.toLowerCase() 1837 // instead in the assignment below. 1838 ].forEach((attributeName) => { 1839 const name118 = attributeName.replace(CAMELIZE, capitalize2); 1840 properties[name118] = new PropertyInfoRecord( 1841 name118, 1842 STRING, 1843 false, 1844 // mustUseProperty 1845 attributeName, 1846 "http://www.w3.org/XML/1998/namespace", 1847 false, 1848 // sanitizeURL 1849 false 1850 // removeEmptyString 1851 ); 1852 }); 1853 ["tabIndex", "crossOrigin"].forEach((attributeName) => { 1854 properties[attributeName] = new PropertyInfoRecord( 1855 attributeName, 1856 STRING, 1857 false, 1858 // mustUseProperty 1859 attributeName.toLowerCase(), 1860 // attributeName 1861 null, 1862 // attributeNamespace 1863 false, 1864 // sanitizeURL 1865 false 1866 // removeEmptyString 1867 ); 1868 }); 1869 var xlinkHref = "xlinkHref"; 1870 properties[xlinkHref] = new PropertyInfoRecord( 1871 "xlinkHref", 1872 STRING, 1873 false, 1874 // mustUseProperty 1875 "xlink:href", 1876 "http://www.w3.org/1999/xlink", 1877 true, 1878 // sanitizeURL 1879 false 1880 // removeEmptyString 1881 ); 1882 ["src", "href", "action", "formAction"].forEach((attributeName) => { 1883 properties[attributeName] = new PropertyInfoRecord( 1884 attributeName, 1885 STRING, 1886 false, 1887 // mustUseProperty 1888 attributeName.toLowerCase(), 1889 // attributeName 1890 null, 1891 // attributeNamespace 1892 true, 1893 // sanitizeURL 1894 true 1895 // removeEmptyString 1896 ); 1897 }); 1898 var { 1899 CAMELCASE, 1900 SAME, 1901 possibleStandardNames: possibleStandardNamesOptimized 1902 } = require_possibleStandardNamesOptimized(); 1903 var ATTRIBUTE_NAME_START_CHAR = ":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD"; 1904 var ATTRIBUTE_NAME_CHAR = ATTRIBUTE_NAME_START_CHAR + "\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040"; 1905 var isCustomAttribute = RegExp.prototype.test.bind( 1906 // eslint-disable-next-line no-misleading-character-class 1907 new RegExp("^(data|aria)-[" + ATTRIBUTE_NAME_CHAR + "]*$") 1908 ); 1909 var possibleStandardNames = Object.keys( 1910 possibleStandardNamesOptimized 1911 ).reduce((accumulator, standardName) => { 1912 const propName = possibleStandardNamesOptimized[standardName]; 1913 if (propName === SAME) { 1914 accumulator[standardName] = standardName; 1915 } else if (propName === CAMELCASE) { 1916 accumulator[standardName.toLowerCase()] = standardName; 1917 } else { 1918 accumulator[standardName] = propName; 1919 } 1920 return accumulator; 1921 }, {}); 1922 exports.BOOLEAN = BOOLEAN; 1923 exports.BOOLEANISH_STRING = BOOLEANISH_STRING; 1924 exports.NUMERIC = NUMERIC; 1925 exports.OVERLOADED_BOOLEAN = OVERLOADED_BOOLEAN; 1926 exports.POSITIVE_NUMERIC = POSITIVE_NUMERIC; 1927 exports.RESERVED = RESERVED; 1928 exports.STRING = STRING; 1929 exports.getPropertyInfo = getPropertyInfo; 1930 exports.isCustomAttribute = isCustomAttribute; 1931 exports.possibleStandardNames = possibleStandardNames; 1932 } 1933 }); 1934 1935 // vendor-external:react 1936 var require_react = __commonJS({ 1937 "vendor-external:react"(exports, module) { 1938 module.exports = window.React; 1939 } 1940 }); 1941 1942 // node_modules/inline-style-parser/cjs/index.js 1943 var require_cjs = __commonJS({ 1944 "node_modules/inline-style-parser/cjs/index.js"(exports, module) { 1945 "use strict"; 1946 var COMMENT_REGEX = /\/\*[^*]*\*+([^/*][^*]*\*+)*\//g; 1947 var NEWLINE_REGEX = /\n/g; 1948 var WHITESPACE_REGEX = /^\s*/; 1949 var PROPERTY_REGEX = /^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/; 1950 var COLON_REGEX = /^:\s*/; 1951 var VALUE_REGEX = /^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/; 1952 var SEMICOLON_REGEX = /^[;\s]*/; 1953 var TRIM_REGEX = /^\s+|\s+$/g; 1954 var NEWLINE = "\n"; 1955 var FORWARD_SLASH = "/"; 1956 var ASTERISK = "*"; 1957 var EMPTY_STRING = ""; 1958 var TYPE_COMMENT = "comment"; 1959 var TYPE_DECLARATION = "declaration"; 1960 function index(style2, options2) { 1961 if (typeof style2 !== "string") { 1962 throw new TypeError("First argument must be a string"); 1963 } 1964 if (!style2) return []; 1965 options2 = options2 || {}; 1966 var lineno = 1; 1967 var column = 1; 1968 function updatePosition(str) { 1969 var lines = str.match(NEWLINE_REGEX); 1970 if (lines) lineno += lines.length; 1971 var i2 = str.lastIndexOf(NEWLINE); 1972 column = ~i2 ? str.length - i2 : column + str.length; 1973 } 1974 function position() { 1975 var start = { line: lineno, column }; 1976 return function(node) { 1977 node.position = new Position(start); 1978 whitespace(); 1979 return node; 1980 }; 1981 } 1982 function Position(start) { 1983 this.start = start; 1984 this.end = { line: lineno, column }; 1985 this.source = options2.source; 1986 } 1987 Position.prototype.content = style2; 1988 function error2(msg) { 1989 var err = new Error( 1990 options2.source + ":" + lineno + ":" + column + ": " + msg 1991 ); 1992 err.reason = msg; 1993 err.filename = options2.source; 1994 err.line = lineno; 1995 err.column = column; 1996 err.source = style2; 1997 if (options2.silent) ; 1998 else { 1999 throw err; 2000 } 2001 } 2002 function match(re) { 2003 var m3 = re.exec(style2); 2004 if (!m3) return; 2005 var str = m3[0]; 2006 updatePosition(str); 2007 style2 = style2.slice(str.length); 2008 return m3; 2009 } 2010 function whitespace() { 2011 match(WHITESPACE_REGEX); 2012 } 2013 function comments(rules) { 2014 var c2; 2015 rules = rules || []; 2016 while (c2 = comment()) { 2017 if (c2 !== false) { 2018 rules.push(c2); 2019 } 2020 } 2021 return rules; 2022 } 2023 function comment() { 2024 var pos = position(); 2025 if (FORWARD_SLASH != style2.charAt(0) || ASTERISK != style2.charAt(1)) return; 2026 var i2 = 2; 2027 while (EMPTY_STRING != style2.charAt(i2) && (ASTERISK != style2.charAt(i2) || FORWARD_SLASH != style2.charAt(i2 + 1))) { 2028 ++i2; 2029 } 2030 i2 += 2; 2031 if (EMPTY_STRING === style2.charAt(i2 - 1)) { 2032 return error2("End of comment missing"); 2033 } 2034 var str = style2.slice(2, i2 - 2); 2035 column += 2; 2036 updatePosition(str); 2037 style2 = style2.slice(i2); 2038 column += 2; 2039 return pos({ 2040 type: TYPE_COMMENT, 2041 comment: str 2042 }); 2043 } 2044 function declaration() { 2045 var pos = position(); 2046 var prop = match(PROPERTY_REGEX); 2047 if (!prop) return; 2048 comment(); 2049 if (!match(COLON_REGEX)) return error2("property missing ':'"); 2050 var val = match(VALUE_REGEX); 2051 var ret = pos({ 2052 type: TYPE_DECLARATION, 2053 property: trim(prop[0].replace(COMMENT_REGEX, EMPTY_STRING)), 2054 value: val ? trim(val[0].replace(COMMENT_REGEX, EMPTY_STRING)) : EMPTY_STRING 2055 }); 2056 match(SEMICOLON_REGEX); 2057 return ret; 2058 } 2059 function declarations() { 2060 var decls = []; 2061 comments(decls); 2062 var decl; 2063 while (decl = declaration()) { 2064 if (decl !== false) { 2065 decls.push(decl); 2066 comments(decls); 2067 } 2068 } 2069 return decls; 2070 } 2071 whitespace(); 2072 return declarations(); 2073 } 2074 function trim(str) { 2075 return str ? str.replace(TRIM_REGEX, EMPTY_STRING) : EMPTY_STRING; 2076 } 2077 module.exports = index; 2078 } 2079 }); 2080 2081 // node_modules/style-to-object/cjs/index.js 2082 var require_cjs2 = __commonJS({ 2083 "node_modules/style-to-object/cjs/index.js"(exports) { 2084 "use strict"; 2085 var __importDefault = exports && exports.__importDefault || function(mod) { 2086 return mod && mod.__esModule ? mod : { "default": mod }; 2087 }; 2088 Object.defineProperty(exports, "__esModule", { value: true }); 2089 exports.default = StyleToObject; 2090 var inline_style_parser_1 = __importDefault(require_cjs()); 2091 function StyleToObject(style2, iterator) { 2092 let styleObject = null; 2093 if (!style2 || typeof style2 !== "string") { 2094 return styleObject; 2095 } 2096 const declarations = (0, inline_style_parser_1.default)(style2); 2097 const hasIterator = typeof iterator === "function"; 2098 declarations.forEach((declaration) => { 2099 if (declaration.type !== "declaration") { 2100 return; 2101 } 2102 const { property, value } = declaration; 2103 if (hasIterator) { 2104 iterator(property, value, declaration); 2105 } else if (value) { 2106 styleObject = styleObject || {}; 2107 styleObject[property] = value; 2108 } 2109 }); 2110 return styleObject; 2111 } 2112 } 2113 }); 2114 2115 // node_modules/style-to-js/cjs/utilities.js 2116 var require_utilities2 = __commonJS({ 2117 "node_modules/style-to-js/cjs/utilities.js"(exports) { 2118 "use strict"; 2119 Object.defineProperty(exports, "__esModule", { value: true }); 2120 exports.camelCase = void 0; 2121 var CUSTOM_PROPERTY_REGEX = /^--[a-zA-Z0-9_-]+$/; 2122 var HYPHEN_REGEX = /-([a-z])/g; 2123 var NO_HYPHEN_REGEX = /^[^-]+$/; 2124 var VENDOR_PREFIX_REGEX = /^-(webkit|moz|ms|o|khtml)-/; 2125 var MS_VENDOR_PREFIX_REGEX = /^-(ms)-/; 2126 var skipCamelCase = function(property) { 2127 return !property || NO_HYPHEN_REGEX.test(property) || CUSTOM_PROPERTY_REGEX.test(property); 2128 }; 2129 var capitalize2 = function(match, character) { 2130 return character.toUpperCase(); 2131 }; 2132 var trimHyphen = function(match, prefix) { 2133 return "".concat(prefix, "-"); 2134 }; 2135 var camelCase = function(property, options2) { 2136 if (options2 === void 0) { 2137 options2 = {}; 2138 } 2139 if (skipCamelCase(property)) { 2140 return property; 2141 } 2142 property = property.toLowerCase(); 2143 if (options2.reactCompat) { 2144 property = property.replace(MS_VENDOR_PREFIX_REGEX, trimHyphen); 2145 } else { 2146 property = property.replace(VENDOR_PREFIX_REGEX, trimHyphen); 2147 } 2148 return property.replace(HYPHEN_REGEX, capitalize2); 2149 }; 2150 exports.camelCase = camelCase; 2151 } 2152 }); 2153 2154 // node_modules/style-to-js/cjs/index.js 2155 var require_cjs3 = __commonJS({ 2156 "node_modules/style-to-js/cjs/index.js"(exports, module) { 2157 "use strict"; 2158 var __importDefault = exports && exports.__importDefault || function(mod) { 2159 return mod && mod.__esModule ? mod : { "default": mod }; 2160 }; 2161 var style_to_object_1 = __importDefault(require_cjs2()); 2162 var utilities_1 = require_utilities2(); 2163 function StyleToJS(style2, options2) { 2164 var output = {}; 2165 if (!style2 || typeof style2 !== "string") { 2166 return output; 2167 } 2168 (0, style_to_object_1.default)(style2, function(property, value) { 2169 if (property && value) { 2170 output[(0, utilities_1.camelCase)(property, options2)] = value; 2171 } 2172 }); 2173 return output; 2174 } 2175 StyleToJS.default = StyleToJS; 2176 module.exports = StyleToJS; 2177 } 2178 }); 2179 2180 // node_modules/html-react-parser/lib/utilities.js 2181 var require_utilities3 = __commonJS({ 2182 "node_modules/html-react-parser/lib/utilities.js"(exports) { 2183 "use strict"; 2184 var __importDefault = exports && exports.__importDefault || function(mod) { 2185 return mod && mod.__esModule ? mod : { "default": mod }; 2186 }; 2187 Object.defineProperty(exports, "__esModule", { value: true }); 2188 exports.returnFirstArg = exports.canTextBeChildOfNode = exports.ELEMENTS_WITH_NO_TEXT_CHILDREN = exports.PRESERVE_CUSTOM_ATTRIBUTES = void 0; 2189 exports.isCustomComponent = isCustomComponent; 2190 exports.setStyleProp = setStyleProp; 2191 var react_1 = require_react(); 2192 var style_to_js_1 = __importDefault(require_cjs3()); 2193 var RESERVED_SVG_MATHML_ELEMENTS = /* @__PURE__ */ new Set([ 2194 "annotation-xml", 2195 "color-profile", 2196 "font-face", 2197 "font-face-src", 2198 "font-face-uri", 2199 "font-face-format", 2200 "font-face-name", 2201 "missing-glyph" 2202 ]); 2203 function isCustomComponent(tagName, props) { 2204 if (!tagName.includes("-")) { 2205 return Boolean(props && typeof props.is === "string"); 2206 } 2207 if (RESERVED_SVG_MATHML_ELEMENTS.has(tagName)) { 2208 return false; 2209 } 2210 return true; 2211 } 2212 var styleOptions = { 2213 reactCompat: true 2214 }; 2215 function setStyleProp(style2, props) { 2216 if (typeof style2 !== "string") { 2217 return; 2218 } 2219 if (!style2.trim()) { 2220 props.style = {}; 2221 return; 2222 } 2223 try { 2224 props.style = (0, style_to_js_1.default)(style2, styleOptions); 2225 } catch (error2) { 2226 props.style = {}; 2227 } 2228 } 2229 exports.PRESERVE_CUSTOM_ATTRIBUTES = Number(react_1.version.split(".")[0]) >= 16; 2230 exports.ELEMENTS_WITH_NO_TEXT_CHILDREN = /* @__PURE__ */ new Set([ 2231 "tr", 2232 "tbody", 2233 "thead", 2234 "tfoot", 2235 "colgroup", 2236 "table", 2237 "head", 2238 "html", 2239 "frameset" 2240 ]); 2241 var canTextBeChildOfNode = function(node) { 2242 return !exports.ELEMENTS_WITH_NO_TEXT_CHILDREN.has(node.name); 2243 }; 2244 exports.canTextBeChildOfNode = canTextBeChildOfNode; 2245 var returnFirstArg = function(arg) { 2246 return arg; 2247 }; 2248 exports.returnFirstArg = returnFirstArg; 2249 } 2250 }); 2251 2252 // node_modules/html-react-parser/lib/attributes-to-props.js 2253 var require_attributes_to_props = __commonJS({ 2254 "node_modules/html-react-parser/lib/attributes-to-props.js"(exports) { 2255 "use strict"; 2256 Object.defineProperty(exports, "__esModule", { value: true }); 2257 exports.default = attributesToProps2; 2258 var react_property_1 = require_lib3(); 2259 var utilities_1 = require_utilities3(); 2260 var UNCONTROLLED_COMPONENT_ATTRIBUTES = ["checked", "value"]; 2261 var UNCONTROLLED_COMPONENT_NAMES = ["input", "select", "textarea"]; 2262 var valueOnlyInputs = { 2263 reset: true, 2264 submit: true 2265 }; 2266 function attributesToProps2(attributes2, nodeName) { 2267 if (attributes2 === void 0) { 2268 attributes2 = {}; 2269 } 2270 var props = {}; 2271 var isInputValueOnly = Boolean(attributes2.type && valueOnlyInputs[attributes2.type]); 2272 for (var attributeName in attributes2) { 2273 var attributeValue = attributes2[attributeName]; 2274 if ((0, react_property_1.isCustomAttribute)(attributeName)) { 2275 props[attributeName] = attributeValue; 2276 continue; 2277 } 2278 var attributeNameLowerCased = attributeName.toLowerCase(); 2279 var propName = getPropName(attributeNameLowerCased); 2280 if (propName) { 2281 var propertyInfo = (0, react_property_1.getPropertyInfo)(propName); 2282 if (UNCONTROLLED_COMPONENT_ATTRIBUTES.includes(propName) && UNCONTROLLED_COMPONENT_NAMES.includes(nodeName) && !isInputValueOnly) { 2283 propName = getPropName("default" + attributeNameLowerCased); 2284 } 2285 props[propName] = attributeValue; 2286 switch (propertyInfo && propertyInfo.type) { 2287 case react_property_1.BOOLEAN: 2288 props[propName] = true; 2289 break; 2290 case react_property_1.OVERLOADED_BOOLEAN: 2291 if (attributeValue === "") { 2292 props[propName] = true; 2293 } 2294 break; 2295 } 2296 continue; 2297 } 2298 if (utilities_1.PRESERVE_CUSTOM_ATTRIBUTES) { 2299 props[attributeName] = attributeValue; 2300 } 2301 } 2302 (0, utilities_1.setStyleProp)(attributes2.style, props); 2303 return props; 2304 } 2305 function getPropName(attributeName) { 2306 return react_property_1.possibleStandardNames[attributeName]; 2307 } 2308 } 2309 }); 2310 2311 // node_modules/html-react-parser/lib/dom-to-react.js 2312 var require_dom_to_react = __commonJS({ 2313 "node_modules/html-react-parser/lib/dom-to-react.js"(exports) { 2314 "use strict"; 2315 var __importDefault = exports && exports.__importDefault || function(mod) { 2316 return mod && mod.__esModule ? mod : { "default": mod }; 2317 }; 2318 Object.defineProperty(exports, "__esModule", { value: true }); 2319 exports.default = domToReact2; 2320 var react_1 = require_react(); 2321 var attributes_to_props_1 = __importDefault(require_attributes_to_props()); 2322 var utilities_1 = require_utilities3(); 2323 var React50 = { 2324 cloneElement: react_1.cloneElement, 2325 createElement: react_1.createElement, 2326 isValidElement: react_1.isValidElement 2327 }; 2328 function domToReact2(nodes, options2) { 2329 if (options2 === void 0) { 2330 options2 = {}; 2331 } 2332 var reactElements = []; 2333 var hasReplace = typeof options2.replace === "function"; 2334 var transform = options2.transform || utilities_1.returnFirstArg; 2335 var _a = options2.library || React50, cloneElement5 = _a.cloneElement, createElement3 = _a.createElement, isValidElement3 = _a.isValidElement; 2336 var nodesLength = nodes.length; 2337 for (var index = 0; index < nodesLength; index++) { 2338 var node = nodes[index]; 2339 if (hasReplace) { 2340 var replaceElement = options2.replace(node, index); 2341 if (isValidElement3(replaceElement)) { 2342 if (nodesLength > 1) { 2343 replaceElement = cloneElement5(replaceElement, { 2344 key: replaceElement.key || index 2345 }); 2346 } 2347 reactElements.push(transform(replaceElement, node, index)); 2348 continue; 2349 } 2350 } 2351 if (node.type === "text") { 2352 var isWhitespace = !node.data.trim().length; 2353 if (isWhitespace && node.parent && !(0, utilities_1.canTextBeChildOfNode)(node.parent)) { 2354 continue; 2355 } 2356 if (options2.trim && isWhitespace) { 2357 continue; 2358 } 2359 reactElements.push(transform(node.data, node, index)); 2360 continue; 2361 } 2362 var element = node; 2363 var props = {}; 2364 if (skipAttributesToProps(element)) { 2365 (0, utilities_1.setStyleProp)(element.attribs.style, element.attribs); 2366 props = element.attribs; 2367 } else if (element.attribs) { 2368 props = (0, attributes_to_props_1.default)(element.attribs, element.name); 2369 } 2370 var children = void 0; 2371 switch (node.type) { 2372 case "script": 2373 case "style": 2374 if (node.children[0]) { 2375 props.dangerouslySetInnerHTML = { 2376 __html: node.children[0].data 2377 }; 2378 } 2379 break; 2380 case "tag": 2381 if (node.name === "textarea" && node.children[0]) { 2382 props.defaultValue = node.children[0].data; 2383 } else if (node.children && node.children.length) { 2384 children = domToReact2(node.children, options2); 2385 } 2386 break; 2387 // skip all other cases (e.g., comment) 2388 default: 2389 continue; 2390 } 2391 if (nodesLength > 1) { 2392 props.key = index; 2393 } 2394 reactElements.push(transform(createElement3(node.name, props, children), node, index)); 2395 } 2396 return reactElements.length === 1 ? reactElements[0] : reactElements; 2397 } 2398 function skipAttributesToProps(node) { 2399 return utilities_1.PRESERVE_CUSTOM_ATTRIBUTES && node.type === "tag" && (0, utilities_1.isCustomComponent)(node.name, node.attribs); 2400 } 2401 } 2402 }); 2403 2404 // node_modules/html-react-parser/lib/index.js 2405 var require_lib4 = __commonJS({ 2406 "node_modules/html-react-parser/lib/index.js"(exports) { 2407 "use strict"; 2408 var __importDefault = exports && exports.__importDefault || function(mod) { 2409 return mod && mod.__esModule ? mod : { "default": mod }; 2410 }; 2411 Object.defineProperty(exports, "__esModule", { value: true }); 2412 exports.htmlToDOM = exports.domToReact = exports.attributesToProps = exports.Text = exports.ProcessingInstruction = exports.Element = exports.Comment = void 0; 2413 exports.default = HTMLReactParser2; 2414 var html_dom_parser_1 = __importDefault(require_html_to_dom()); 2415 exports.htmlToDOM = html_dom_parser_1.default; 2416 var attributes_to_props_1 = __importDefault(require_attributes_to_props()); 2417 exports.attributesToProps = attributes_to_props_1.default; 2418 var dom_to_react_1 = __importDefault(require_dom_to_react()); 2419 exports.domToReact = dom_to_react_1.default; 2420 var domhandler_1 = require_lib2(); 2421 Object.defineProperty(exports, "Comment", { enumerable: true, get: function() { 2422 return domhandler_1.Comment; 2423 } }); 2424 Object.defineProperty(exports, "Element", { enumerable: true, get: function() { 2425 return domhandler_1.Element; 2426 } }); 2427 Object.defineProperty(exports, "ProcessingInstruction", { enumerable: true, get: function() { 2428 return domhandler_1.ProcessingInstruction; 2429 } }); 2430 Object.defineProperty(exports, "Text", { enumerable: true, get: function() { 2431 return domhandler_1.Text; 2432 } }); 2433 var domParserOptions = { lowerCaseAttributeNames: false }; 2434 function HTMLReactParser2(html, options2) { 2435 if (typeof html !== "string") { 2436 throw new TypeError("First argument must be a string"); 2437 } 2438 if (!html) { 2439 return []; 2440 } 2441 return (0, dom_to_react_1.default)((0, html_dom_parser_1.default)(html, (options2 === null || options2 === void 0 ? void 0 : options2.htmlparser2) || domParserOptions), options2); 2442 } 2443 } 2444 }); 2445 2446 // package-external:@wordpress/dom 2447 var require_dom = __commonJS({ 2448 "package-external:@wordpress/dom"(exports, module) { 2449 module.exports = window.wp.dom; 2450 } 2451 }); 2452 2453 // vendor-external:react/jsx-runtime 2454 var require_jsx_runtime = __commonJS({ 2455 "vendor-external:react/jsx-runtime"(exports, module) { 2456 module.exports = window.ReactJSXRuntime; 2457 } 2458 }); 2459 2460 // package-external:@wordpress/element 2461 var require_element = __commonJS({ 2462 "package-external:@wordpress/element"(exports, module) { 2463 module.exports = window.wp.element; 2464 } 2465 }); 2466 2467 // package-external:@wordpress/primitives 2468 var require_primitives = __commonJS({ 2469 "package-external:@wordpress/primitives"(exports, module) { 2470 module.exports = window.wp.primitives; 2471 } 2472 }); 2473 2474 // package-external:@wordpress/components 2475 var require_components = __commonJS({ 2476 "package-external:@wordpress/components"(exports, module) { 2477 module.exports = window.wp.components; 2478 } 2479 }); 2480 2481 // package-external:@wordpress/blob 2482 var require_blob = __commonJS({ 2483 "package-external:@wordpress/blob"(exports, module) { 2484 module.exports = window.wp.blob; 2485 } 2486 }); 2487 2488 // package-external:@wordpress/core-data 2489 var require_core_data = __commonJS({ 2490 "package-external:@wordpress/core-data"(exports, module) { 2491 module.exports = window.wp.coreData; 2492 } 2493 }); 2494 2495 // package-external:@wordpress/url 2496 var require_url = __commonJS({ 2497 "package-external:@wordpress/url"(exports, module) { 2498 module.exports = window.wp.url; 2499 } 2500 }); 2501 2502 // package-external:@wordpress/html-entities 2503 var require_html_entities = __commonJS({ 2504 "package-external:@wordpress/html-entities"(exports, module) { 2505 module.exports = window.wp.htmlEntities; 2506 } 2507 }); 2508 2509 // vendor-external:react-dom 2510 var require_react_dom = __commonJS({ 2511 "vendor-external:react-dom"(exports, module) { 2512 module.exports = window.ReactDOM; 2513 } 2514 }); 2515 2516 // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js 2517 var require_use_sync_external_store_shim_development = __commonJS({ 2518 "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { 2519 "use strict"; 2520 (function() { 2521 function is(x3, y2) { 2522 return x3 === y2 && (0 !== x3 || 1 / x3 === 1 / y2) || x3 !== x3 && y2 !== y2; 2523 } 2524 function useSyncExternalStore$2(subscribe2, getSnapshot2) { 2525 didWarnOld18Alpha || void 0 === React50.startTransition || (didWarnOld18Alpha = true, console.error( 2526 "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release." 2527 )); 2528 var value = getSnapshot2(); 2529 if (!didWarnUncachedGetSnapshot) { 2530 var cachedValue = getSnapshot2(); 2531 objectIs(value, cachedValue) || (console.error( 2532 "The result of getSnapshot should be cached to avoid an infinite loop" 2533 ), didWarnUncachedGetSnapshot = true); 2534 } 2535 cachedValue = useState91({ 2536 inst: { value, getSnapshot: getSnapshot2 } 2537 }); 2538 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; 2539 useLayoutEffect5( 2540 function() { 2541 inst.value = value; 2542 inst.getSnapshot = getSnapshot2; 2543 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 2544 }, 2545 [subscribe2, value, getSnapshot2] 2546 ); 2547 useEffect70( 2548 function() { 2549 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 2550 return subscribe2(function() { 2551 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 2552 }); 2553 }, 2554 [subscribe2] 2555 ); 2556 useDebugValue(value); 2557 return value; 2558 } 2559 function checkIfSnapshotChanged(inst) { 2560 var latestGetSnapshot = inst.getSnapshot; 2561 inst = inst.value; 2562 try { 2563 var nextValue = latestGetSnapshot(); 2564 return !objectIs(inst, nextValue); 2565 } catch (error2) { 2566 return true; 2567 } 2568 } 2569 function useSyncExternalStore$1(subscribe2, getSnapshot2) { 2570 return getSnapshot2(); 2571 } 2572 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 2573 var React50 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState91 = React50.useState, useEffect70 = React50.useEffect, useLayoutEffect5 = React50.useLayoutEffect, useDebugValue = React50.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; 2574 exports.useSyncExternalStore = void 0 !== React50.useSyncExternalStore ? React50.useSyncExternalStore : shim; 2575 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 2576 })(); 2577 } 2578 }); 2579 2580 // node_modules/use-sync-external-store/shim/index.js 2581 var require_shim = __commonJS({ 2582 "node_modules/use-sync-external-store/shim/index.js"(exports, module) { 2583 "use strict"; 2584 if (false) { 2585 module.exports = null; 2586 } else { 2587 module.exports = require_use_sync_external_store_shim_development(); 2588 } 2589 } 2590 }); 2591 2592 // package-external:@wordpress/private-apis 2593 var require_private_apis = __commonJS({ 2594 "package-external:@wordpress/private-apis"(exports, module) { 2595 module.exports = window.wp.privateApis; 2596 } 2597 }); 2598 2599 // package-external:@wordpress/a11y 2600 var require_a11y = __commonJS({ 2601 "package-external:@wordpress/a11y"(exports, module) { 2602 module.exports = window.wp.a11y; 2603 } 2604 }); 2605 2606 // package-external:@wordpress/notices 2607 var require_notices = __commonJS({ 2608 "package-external:@wordpress/notices"(exports, module) { 2609 module.exports = window.wp.notices; 2610 } 2611 }); 2612 2613 // package-external:@wordpress/keycodes 2614 var require_keycodes = __commonJS({ 2615 "package-external:@wordpress/keycodes"(exports, module) { 2616 module.exports = window.wp.keycodes; 2617 } 2618 }); 2619 2620 // package-external:@wordpress/deprecated 2621 var require_deprecated = __commonJS({ 2622 "package-external:@wordpress/deprecated"(exports, module) { 2623 module.exports = window.wp.deprecated; 2624 } 2625 }); 2626 2627 // package-external:@wordpress/rich-text 2628 var require_rich_text = __commonJS({ 2629 "package-external:@wordpress/rich-text"(exports, module) { 2630 module.exports = window.wp.richText; 2631 } 2632 }); 2633 2634 // package-external:@wordpress/date 2635 var require_date = __commonJS({ 2636 "package-external:@wordpress/date"(exports, module) { 2637 module.exports = window.wp.date; 2638 } 2639 }); 2640 2641 // package-external:@wordpress/api-fetch 2642 var require_api_fetch = __commonJS({ 2643 "package-external:@wordpress/api-fetch"(exports, module) { 2644 module.exports = window.wp.apiFetch; 2645 } 2646 }); 2647 2648 // package-external:@wordpress/hooks 2649 var require_hooks = __commonJS({ 2650 "package-external:@wordpress/hooks"(exports, module) { 2651 module.exports = window.wp.hooks; 2652 } 2653 }); 2654 2655 // package-external:@wordpress/style-engine 2656 var require_style_engine = __commonJS({ 2657 "package-external:@wordpress/style-engine"(exports, module) { 2658 module.exports = window.wp.styleEngine; 2659 } 2660 }); 2661 2662 // node_modules/fast-deep-equal/es6/index.js 2663 var require_es6 = __commonJS({ 2664 "node_modules/fast-deep-equal/es6/index.js"(exports, module) { 2665 "use strict"; 2666 module.exports = function equal(a2, b2) { 2667 if (a2 === b2) return true; 2668 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { 2669 if (a2.constructor !== b2.constructor) return false; 2670 var length, i2, keys; 2671 if (Array.isArray(a2)) { 2672 length = a2.length; 2673 if (length != b2.length) return false; 2674 for (i2 = length; i2-- !== 0; ) 2675 if (!equal(a2[i2], b2[i2])) return false; 2676 return true; 2677 } 2678 if (a2 instanceof Map && b2 instanceof Map) { 2679 if (a2.size !== b2.size) return false; 2680 for (i2 of a2.entries()) 2681 if (!b2.has(i2[0])) return false; 2682 for (i2 of a2.entries()) 2683 if (!equal(i2[1], b2.get(i2[0]))) return false; 2684 return true; 2685 } 2686 if (a2 instanceof Set && b2 instanceof Set) { 2687 if (a2.size !== b2.size) return false; 2688 for (i2 of a2.entries()) 2689 if (!b2.has(i2[0])) return false; 2690 return true; 2691 } 2692 if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { 2693 length = a2.length; 2694 if (length != b2.length) return false; 2695 for (i2 = length; i2-- !== 0; ) 2696 if (a2[i2] !== b2[i2]) return false; 2697 return true; 2698 } 2699 if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; 2700 if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); 2701 if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); 2702 keys = Object.keys(a2); 2703 length = keys.length; 2704 if (length !== Object.keys(b2).length) return false; 2705 for (i2 = length; i2-- !== 0; ) 2706 if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; 2707 for (i2 = length; i2-- !== 0; ) { 2708 var key = keys[i2]; 2709 if (!equal(a2[key], b2[key])) return false; 2710 } 2711 return true; 2712 } 2713 return a2 !== a2 && b2 !== b2; 2714 }; 2715 } 2716 }); 2717 2718 // node_modules/remove-accents/index.js 2719 var require_remove_accents = __commonJS({ 2720 "node_modules/remove-accents/index.js"(exports, module) { 2721 var characterMap = { 2722 "\xC0": "A", 2723 "\xC1": "A", 2724 "\xC2": "A", 2725 "\xC3": "A", 2726 "\xC4": "A", 2727 "\xC5": "A", 2728 "\u1EA4": "A", 2729 "\u1EAE": "A", 2730 "\u1EB2": "A", 2731 "\u1EB4": "A", 2732 "\u1EB6": "A", 2733 "\xC6": "AE", 2734 "\u1EA6": "A", 2735 "\u1EB0": "A", 2736 "\u0202": "A", 2737 "\u1EA2": "A", 2738 "\u1EA0": "A", 2739 "\u1EA8": "A", 2740 "\u1EAA": "A", 2741 "\u1EAC": "A", 2742 "\xC7": "C", 2743 "\u1E08": "C", 2744 "\xC8": "E", 2745 "\xC9": "E", 2746 "\xCA": "E", 2747 "\xCB": "E", 2748 "\u1EBE": "E", 2749 "\u1E16": "E", 2750 "\u1EC0": "E", 2751 "\u1E14": "E", 2752 "\u1E1C": "E", 2753 "\u0206": "E", 2754 "\u1EBA": "E", 2755 "\u1EBC": "E", 2756 "\u1EB8": "E", 2757 "\u1EC2": "E", 2758 "\u1EC4": "E", 2759 "\u1EC6": "E", 2760 "\xCC": "I", 2761 "\xCD": "I", 2762 "\xCE": "I", 2763 "\xCF": "I", 2764 "\u1E2E": "I", 2765 "\u020A": "I", 2766 "\u1EC8": "I", 2767 "\u1ECA": "I", 2768 "\xD0": "D", 2769 "\xD1": "N", 2770 "\xD2": "O", 2771 "\xD3": "O", 2772 "\xD4": "O", 2773 "\xD5": "O", 2774 "\xD6": "O", 2775 "\xD8": "O", 2776 "\u1ED0": "O", 2777 "\u1E4C": "O", 2778 "\u1E52": "O", 2779 "\u020E": "O", 2780 "\u1ECE": "O", 2781 "\u1ECC": "O", 2782 "\u1ED4": "O", 2783 "\u1ED6": "O", 2784 "\u1ED8": "O", 2785 "\u1EDC": "O", 2786 "\u1EDE": "O", 2787 "\u1EE0": "O", 2788 "\u1EDA": "O", 2789 "\u1EE2": "O", 2790 "\xD9": "U", 2791 "\xDA": "U", 2792 "\xDB": "U", 2793 "\xDC": "U", 2794 "\u1EE6": "U", 2795 "\u1EE4": "U", 2796 "\u1EEC": "U", 2797 "\u1EEE": "U", 2798 "\u1EF0": "U", 2799 "\xDD": "Y", 2800 "\xE0": "a", 2801 "\xE1": "a", 2802 "\xE2": "a", 2803 "\xE3": "a", 2804 "\xE4": "a", 2805 "\xE5": "a", 2806 "\u1EA5": "a", 2807 "\u1EAF": "a", 2808 "\u1EB3": "a", 2809 "\u1EB5": "a", 2810 "\u1EB7": "a", 2811 "\xE6": "ae", 2812 "\u1EA7": "a", 2813 "\u1EB1": "a", 2814 "\u0203": "a", 2815 "\u1EA3": "a", 2816 "\u1EA1": "a", 2817 "\u1EA9": "a", 2818 "\u1EAB": "a", 2819 "\u1EAD": "a", 2820 "\xE7": "c", 2821 "\u1E09": "c", 2822 "\xE8": "e", 2823 "\xE9": "e", 2824 "\xEA": "e", 2825 "\xEB": "e", 2826 "\u1EBF": "e", 2827 "\u1E17": "e", 2828 "\u1EC1": "e", 2829 "\u1E15": "e", 2830 "\u1E1D": "e", 2831 "\u0207": "e", 2832 "\u1EBB": "e", 2833 "\u1EBD": "e", 2834 "\u1EB9": "e", 2835 "\u1EC3": "e", 2836 "\u1EC5": "e", 2837 "\u1EC7": "e", 2838 "\xEC": "i", 2839 "\xED": "i", 2840 "\xEE": "i", 2841 "\xEF": "i", 2842 "\u1E2F": "i", 2843 "\u020B": "i", 2844 "\u1EC9": "i", 2845 "\u1ECB": "i", 2846 "\xF0": "d", 2847 "\xF1": "n", 2848 "\xF2": "o", 2849 "\xF3": "o", 2850 "\xF4": "o", 2851 "\xF5": "o", 2852 "\xF6": "o", 2853 "\xF8": "o", 2854 "\u1ED1": "o", 2855 "\u1E4D": "o", 2856 "\u1E53": "o", 2857 "\u020F": "o", 2858 "\u1ECF": "o", 2859 "\u1ECD": "o", 2860 "\u1ED5": "o", 2861 "\u1ED7": "o", 2862 "\u1ED9": "o", 2863 "\u1EDD": "o", 2864 "\u1EDF": "o", 2865 "\u1EE1": "o", 2866 "\u1EDB": "o", 2867 "\u1EE3": "o", 2868 "\xF9": "u", 2869 "\xFA": "u", 2870 "\xFB": "u", 2871 "\xFC": "u", 2872 "\u1EE7": "u", 2873 "\u1EE5": "u", 2874 "\u1EED": "u", 2875 "\u1EEF": "u", 2876 "\u1EF1": "u", 2877 "\xFD": "y", 2878 "\xFF": "y", 2879 "\u0100": "A", 2880 "\u0101": "a", 2881 "\u0102": "A", 2882 "\u0103": "a", 2883 "\u0104": "A", 2884 "\u0105": "a", 2885 "\u0106": "C", 2886 "\u0107": "c", 2887 "\u0108": "C", 2888 "\u0109": "c", 2889 "\u010A": "C", 2890 "\u010B": "c", 2891 "\u010C": "C", 2892 "\u010D": "c", 2893 "C\u0306": "C", 2894 "c\u0306": "c", 2895 "\u010E": "D", 2896 "\u010F": "d", 2897 "\u0110": "D", 2898 "\u0111": "d", 2899 "\u0112": "E", 2900 "\u0113": "e", 2901 "\u0114": "E", 2902 "\u0115": "e", 2903 "\u0116": "E", 2904 "\u0117": "e", 2905 "\u0118": "E", 2906 "\u0119": "e", 2907 "\u011A": "E", 2908 "\u011B": "e", 2909 "\u011C": "G", 2910 "\u01F4": "G", 2911 "\u011D": "g", 2912 "\u01F5": "g", 2913 "\u011E": "G", 2914 "\u011F": "g", 2915 "\u0120": "G", 2916 "\u0121": "g", 2917 "\u0122": "G", 2918 "\u0123": "g", 2919 "\u0124": "H", 2920 "\u0125": "h", 2921 "\u0126": "H", 2922 "\u0127": "h", 2923 "\u1E2A": "H", 2924 "\u1E2B": "h", 2925 "\u0128": "I", 2926 "\u0129": "i", 2927 "\u012A": "I", 2928 "\u012B": "i", 2929 "\u012C": "I", 2930 "\u012D": "i", 2931 "\u012E": "I", 2932 "\u012F": "i", 2933 "\u0130": "I", 2934 "\u0131": "i", 2935 "\u0132": "IJ", 2936 "\u0133": "ij", 2937 "\u0134": "J", 2938 "\u0135": "j", 2939 "\u0136": "K", 2940 "\u0137": "k", 2941 "\u1E30": "K", 2942 "\u1E31": "k", 2943 "K\u0306": "K", 2944 "k\u0306": "k", 2945 "\u0139": "L", 2946 "\u013A": "l", 2947 "\u013B": "L", 2948 "\u013C": "l", 2949 "\u013D": "L", 2950 "\u013E": "l", 2951 "\u013F": "L", 2952 "\u0140": "l", 2953 "\u0141": "l", 2954 "\u0142": "l", 2955 "\u1E3E": "M", 2956 "\u1E3F": "m", 2957 "M\u0306": "M", 2958 "m\u0306": "m", 2959 "\u0143": "N", 2960 "\u0144": "n", 2961 "\u0145": "N", 2962 "\u0146": "n", 2963 "\u0147": "N", 2964 "\u0148": "n", 2965 "\u0149": "n", 2966 "N\u0306": "N", 2967 "n\u0306": "n", 2968 "\u014C": "O", 2969 "\u014D": "o", 2970 "\u014E": "O", 2971 "\u014F": "o", 2972 "\u0150": "O", 2973 "\u0151": "o", 2974 "\u0152": "OE", 2975 "\u0153": "oe", 2976 "P\u0306": "P", 2977 "p\u0306": "p", 2978 "\u0154": "R", 2979 "\u0155": "r", 2980 "\u0156": "R", 2981 "\u0157": "r", 2982 "\u0158": "R", 2983 "\u0159": "r", 2984 "R\u0306": "R", 2985 "r\u0306": "r", 2986 "\u0212": "R", 2987 "\u0213": "r", 2988 "\u015A": "S", 2989 "\u015B": "s", 2990 "\u015C": "S", 2991 "\u015D": "s", 2992 "\u015E": "S", 2993 "\u0218": "S", 2994 "\u0219": "s", 2995 "\u015F": "s", 2996 "\u0160": "S", 2997 "\u0161": "s", 2998 "\u0162": "T", 2999 "\u0163": "t", 3000 "\u021B": "t", 3001 "\u021A": "T", 3002 "\u0164": "T", 3003 "\u0165": "t", 3004 "\u0166": "T", 3005 "\u0167": "t", 3006 "T\u0306": "T", 3007 "t\u0306": "t", 3008 "\u0168": "U", 3009 "\u0169": "u", 3010 "\u016A": "U", 3011 "\u016B": "u", 3012 "\u016C": "U", 3013 "\u016D": "u", 3014 "\u016E": "U", 3015 "\u016F": "u", 3016 "\u0170": "U", 3017 "\u0171": "u", 3018 "\u0172": "U", 3019 "\u0173": "u", 3020 "\u0216": "U", 3021 "\u0217": "u", 3022 "V\u0306": "V", 3023 "v\u0306": "v", 3024 "\u0174": "W", 3025 "\u0175": "w", 3026 "\u1E82": "W", 3027 "\u1E83": "w", 3028 "X\u0306": "X", 3029 "x\u0306": "x", 3030 "\u0176": "Y", 3031 "\u0177": "y", 3032 "\u0178": "Y", 3033 "Y\u0306": "Y", 3034 "y\u0306": "y", 3035 "\u0179": "Z", 3036 "\u017A": "z", 3037 "\u017B": "Z", 3038 "\u017C": "z", 3039 "\u017D": "Z", 3040 "\u017E": "z", 3041 "\u017F": "s", 3042 "\u0192": "f", 3043 "\u01A0": "O", 3044 "\u01A1": "o", 3045 "\u01AF": "U", 3046 "\u01B0": "u", 3047 "\u01CD": "A", 3048 "\u01CE": "a", 3049 "\u01CF": "I", 3050 "\u01D0": "i", 3051 "\u01D1": "O", 3052 "\u01D2": "o", 3053 "\u01D3": "U", 3054 "\u01D4": "u", 3055 "\u01D5": "U", 3056 "\u01D6": "u", 3057 "\u01D7": "U", 3058 "\u01D8": "u", 3059 "\u01D9": "U", 3060 "\u01DA": "u", 3061 "\u01DB": "U", 3062 "\u01DC": "u", 3063 "\u1EE8": "U", 3064 "\u1EE9": "u", 3065 "\u1E78": "U", 3066 "\u1E79": "u", 3067 "\u01FA": "A", 3068 "\u01FB": "a", 3069 "\u01FC": "AE", 3070 "\u01FD": "ae", 3071 "\u01FE": "O", 3072 "\u01FF": "o", 3073 "\xDE": "TH", 3074 "\xFE": "th", 3075 "\u1E54": "P", 3076 "\u1E55": "p", 3077 "\u1E64": "S", 3078 "\u1E65": "s", 3079 "X\u0301": "X", 3080 "x\u0301": "x", 3081 "\u0403": "\u0413", 3082 "\u0453": "\u0433", 3083 "\u040C": "\u041A", 3084 "\u045C": "\u043A", 3085 "A\u030B": "A", 3086 "a\u030B": "a", 3087 "E\u030B": "E", 3088 "e\u030B": "e", 3089 "I\u030B": "I", 3090 "i\u030B": "i", 3091 "\u01F8": "N", 3092 "\u01F9": "n", 3093 "\u1ED2": "O", 3094 "\u1ED3": "o", 3095 "\u1E50": "O", 3096 "\u1E51": "o", 3097 "\u1EEA": "U", 3098 "\u1EEB": "u", 3099 "\u1E80": "W", 3100 "\u1E81": "w", 3101 "\u1EF2": "Y", 3102 "\u1EF3": "y", 3103 "\u0200": "A", 3104 "\u0201": "a", 3105 "\u0204": "E", 3106 "\u0205": "e", 3107 "\u0208": "I", 3108 "\u0209": "i", 3109 "\u020C": "O", 3110 "\u020D": "o", 3111 "\u0210": "R", 3112 "\u0211": "r", 3113 "\u0214": "U", 3114 "\u0215": "u", 3115 "B\u030C": "B", 3116 "b\u030C": "b", 3117 "\u010C\u0323": "C", 3118 "\u010D\u0323": "c", 3119 "\xCA\u030C": "E", 3120 "\xEA\u030C": "e", 3121 "F\u030C": "F", 3122 "f\u030C": "f", 3123 "\u01E6": "G", 3124 "\u01E7": "g", 3125 "\u021E": "H", 3126 "\u021F": "h", 3127 "J\u030C": "J", 3128 "\u01F0": "j", 3129 "\u01E8": "K", 3130 "\u01E9": "k", 3131 "M\u030C": "M", 3132 "m\u030C": "m", 3133 "P\u030C": "P", 3134 "p\u030C": "p", 3135 "Q\u030C": "Q", 3136 "q\u030C": "q", 3137 "\u0158\u0329": "R", 3138 "\u0159\u0329": "r", 3139 "\u1E66": "S", 3140 "\u1E67": "s", 3141 "V\u030C": "V", 3142 "v\u030C": "v", 3143 "W\u030C": "W", 3144 "w\u030C": "w", 3145 "X\u030C": "X", 3146 "x\u030C": "x", 3147 "Y\u030C": "Y", 3148 "y\u030C": "y", 3149 "A\u0327": "A", 3150 "a\u0327": "a", 3151 "B\u0327": "B", 3152 "b\u0327": "b", 3153 "\u1E10": "D", 3154 "\u1E11": "d", 3155 "\u0228": "E", 3156 "\u0229": "e", 3157 "\u0190\u0327": "E", 3158 "\u025B\u0327": "e", 3159 "\u1E28": "H", 3160 "\u1E29": "h", 3161 "I\u0327": "I", 3162 "i\u0327": "i", 3163 "\u0197\u0327": "I", 3164 "\u0268\u0327": "i", 3165 "M\u0327": "M", 3166 "m\u0327": "m", 3167 "O\u0327": "O", 3168 "o\u0327": "o", 3169 "Q\u0327": "Q", 3170 "q\u0327": "q", 3171 "U\u0327": "U", 3172 "u\u0327": "u", 3173 "X\u0327": "X", 3174 "x\u0327": "x", 3175 "Z\u0327": "Z", 3176 "z\u0327": "z", 3177 "\u0439": "\u0438", 3178 "\u0419": "\u0418", 3179 "\u0451": "\u0435", 3180 "\u0401": "\u0415" 3181 }; 3182 var chars = Object.keys(characterMap).join("|"); 3183 var allAccents = new RegExp(chars, "g"); 3184 var firstAccent = new RegExp(chars, ""); 3185 function matcher(match) { 3186 return characterMap[match]; 3187 } 3188 var removeAccents3 = function(string) { 3189 return string.replace(allAccents, matcher); 3190 }; 3191 var hasAccents = function(string) { 3192 return !!string.match(firstAccent); 3193 }; 3194 module.exports = removeAccents3; 3195 module.exports.has = hasAccents; 3196 module.exports.remove = removeAccents3; 3197 } 3198 }); 3199 3200 // package-external:@wordpress/upload-media 3201 var require_upload_media = __commonJS({ 3202 "package-external:@wordpress/upload-media"(exports, module) { 3203 module.exports = window.wp.uploadMedia; 3204 } 3205 }); 3206 3207 // package-external:@wordpress/escape-html 3208 var require_escape_html = __commonJS({ 3209 "package-external:@wordpress/escape-html"(exports, module) { 3210 module.exports = window.wp.escapeHtml; 3211 } 3212 }); 3213 3214 // package-external:@wordpress/wordcount 3215 var require_wordcount = __commonJS({ 3216 "package-external:@wordpress/wordcount"(exports, module) { 3217 module.exports = window.wp.wordcount; 3218 } 3219 }); 3220 3221 // package-external:@wordpress/patterns 3222 var require_patterns = __commonJS({ 3223 "package-external:@wordpress/patterns"(exports, module) { 3224 module.exports = window.wp.patterns; 3225 } 3226 }); 3227 3228 // package-external:@wordpress/autop 3229 var require_autop = __commonJS({ 3230 "package-external:@wordpress/autop"(exports, module) { 3231 module.exports = window.wp.autop; 3232 } 3233 }); 3234 3235 // package-external:@wordpress/shortcode 3236 var require_shortcode = __commonJS({ 3237 "package-external:@wordpress/shortcode"(exports, module) { 3238 module.exports = window.wp.shortcode; 3239 } 3240 }); 3241 3242 // packages/block-library/build-module/index.mjs 3243 var index_exports = {}; 3244 __export(index_exports, { 3245 __experimentalGetCoreBlocks: () => __experimentalGetCoreBlocks, 3246 __experimentalRegisterExperimentalCoreBlocks: () => __experimentalRegisterExperimentalCoreBlocks, 3247 privateApis: () => privateApis4, 3248 registerCoreBlocks: () => registerCoreBlocks 3249 }); 3250 var import_blocks130 = __toESM(require_blocks(), 1); 3251 var import_compose66 = __toESM(require_compose(), 1); 3252 var import_data172 = __toESM(require_data(), 1); 3253 var import_block_editor291 = __toESM(require_block_editor(), 1); 3254 var import_server_side_render7 = __toESM(require_server_side_render(), 1); 3255 var import_i18n275 = __toESM(require_i18n(), 1); 3256 3257 // node_modules/clsx/dist/clsx.mjs 3258 function r(e3) { 3259 var t2, f2, n2 = ""; 3260 if ("string" == typeof e3 || "number" == typeof e3) n2 += e3; 3261 else if ("object" == typeof e3) if (Array.isArray(e3)) { 3262 var o2 = e3.length; 3263 for (t2 = 0; t2 < o2; t2++) e3[t2] && (f2 = r(e3[t2])) && (n2 && (n2 += " "), n2 += f2); 3264 } else for (f2 in e3) e3[f2] && (n2 && (n2 += " "), n2 += f2); 3265 return n2; 3266 } 3267 function clsx() { 3268 for (var e3, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++) (e3 = arguments[f2]) && (t2 = r(e3)) && (n2 && (n2 += " "), n2 += t2); 3269 return n2; 3270 } 3271 var clsx_default = clsx; 3272 3273 // node_modules/html-react-parser/esm/index.mjs 3274 var import_lib = __toESM(require_lib4(), 1); 3275 var import_lib2 = __toESM(require_lib4(), 1); 3276 var esm_default = import_lib.default.default || import_lib.default; 3277 3278 // packages/block-library/build-module/utils/html-renderer.mjs 3279 var import_dom = __toESM(require_dom(), 1); 3280 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 3281 var HtmlRenderer = ({ wrapperProps = {}, html = "" }) => { 3282 const options2 = { 3283 replace: ({ name: name118, type, attribs, parent, children }) => { 3284 if (type === "tag" && name118) { 3285 const parsedProps = (0, import_lib2.attributesToProps)(attribs || {}); 3286 const TagName2 = name118; 3287 if (!parent) { 3288 const mergedProps = { 3289 ...parsedProps, 3290 ...wrapperProps, 3291 className: clsx_default( 3292 parsedProps.className, 3293 wrapperProps.className 3294 ), 3295 style: { 3296 ...parsedProps.style || {}, 3297 ...wrapperProps.style || {} 3298 } 3299 }; 3300 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(TagName2, { ...mergedProps, children: (0, import_lib2.domToReact)(children, options2) }); 3301 } 3302 } 3303 } 3304 }; 3305 const sanitizedContent = (0, import_dom.safeHTML)(html); 3306 const parsedContent = esm_default(sanitizedContent, options2); 3307 return parsedContent; 3308 }; 3309 var html_renderer_default = HtmlRenderer; 3310 3311 // packages/block-library/build-module/accordion/index.mjs 3312 var accordion_exports = {}; 3313 __export(accordion_exports, { 3314 init: () => init, 3315 metadata: () => block_default, 3316 name: () => name, 3317 settings: () => settings 3318 }); 3319 var import_i18n2 = __toESM(require_i18n(), 1); 3320 3321 // packages/icons/build-module/icon/index.mjs 3322 var import_element = __toESM(require_element(), 1); 3323 var icon_default = (0, import_element.forwardRef)( 3324 ({ icon: icon2, size = 24, style: style2, ...props }, ref) => { 3325 const intrinsicStyle = icon2.props.style; 3326 const mergedStyle = intrinsicStyle || style2 ? { ...intrinsicStyle, ...style2 } : void 0; 3327 return (0, import_element.cloneElement)(icon2, { 3328 width: size, 3329 height: size, 3330 ...props, 3331 // Merge styles so the icon's intrinsic style (e.g. `fill: none` on 3332 // stroke-based icons) is preserved unless the consumer overrides 3333 // the same property explicitly. 3334 ...mergedStyle ? { style: mergedStyle } : {}, 3335 ref 3336 }); 3337 } 3338 ); 3339 3340 // packages/icons/build-module/library/accordion-heading.mjs 3341 var import_primitives = __toESM(require_primitives(), 1); 3342 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 3343 var accordion_heading_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsxs)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3344 /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M19.5 12.75L9.5 12.75L9.5 11.25L19.5 11.25L19.5 12.75Z" }), 3345 /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives.Path, { d: "M4.5 9.5L8.5 12L4.5 14.5L4.5 9.5Z" }) 3346 ] }); 3347 3348 // packages/icons/build-module/library/accordion-item.mjs 3349 var import_primitives2 = __toESM(require_primitives(), 1); 3350 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); 3351 var accordion_item_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3352 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M19.5 9.5L9.5 9.5L9.5 8L19.5 8L19.5 9.5Z" }), 3353 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M19.5 13L9.5 13L9.5 11.5L19.5 11.5L19.5 13Z" }), 3354 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M19.5 16.3999L9.5 16.3999L9.5 14.8999L19.5 14.8999L19.5 16.3999Z" }), 3355 /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives2.Path, { d: "M4.5 6.25L8.5 8.75L4.5 11.25L4.5 6.25Z" }) 3356 ] }); 3357 3358 // packages/icons/build-module/library/accordion.mjs 3359 var import_primitives3 = __toESM(require_primitives(), 1); 3360 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); 3361 var accordion_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3362 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M19.5 9.25L9.5 9.25L9.5 7.75L19.5 7.75L19.5 9.25Z" }), 3363 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M4.5 6L8.5 8.5L4.5 11L4.5 6Z" }), 3364 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M19.5 16.25L9.5 16.25L9.5 14.75L19.5 14.75L19.5 16.25Z" }), 3365 /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives3.Path, { d: "M4.5 13L8.5 15.5L4.5 18L4.5 13Z" }) 3366 ] }); 3367 3368 // packages/icons/build-module/library/add-submenu.mjs 3369 var import_primitives4 = __toESM(require_primitives(), 1); 3370 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); 3371 var add_submenu_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives4.Path, { d: "M2 12c0 3.6 2.4 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.5 0-4.5-1.5-4.5-4s2-4.5 4.5-4.5h3.5V6H8c-3.6 0-6 2.4-6 6zm19.5-1h-8v1.5h8V11zm0 5h-8v1.5h8V16zm0-10h-8v1.5h8V6z" }) }); 3372 3373 // packages/icons/build-module/library/align-center.mjs 3374 var import_primitives5 = __toESM(require_primitives(), 1); 3375 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); 3376 var align_center_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives5.Path, { d: "M7.5 5H16.5M4 12H20M7.5 19H16.5", vectorEffect: "non-scaling-stroke" }) }); 3377 3378 // packages/icons/build-module/library/align-left.mjs 3379 var import_primitives6 = __toESM(require_primitives(), 1); 3380 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); 3381 var align_left_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives6.Path, { d: "M4 5H13M4 12H20M4 19H13", vectorEffect: "non-scaling-stroke" }) }); 3382 3383 // packages/icons/build-module/library/align-none.mjs 3384 var import_primitives7 = __toESM(require_primitives(), 1); 3385 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); 3386 var align_none_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3387 /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives7.Path, { d: "M5 5H19M5 19H19", vectorEffect: "non-scaling-stroke" }), 3388 /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives7.Rect, { x: "5", y: "9", width: "14", height: "6", fill: "currentColor", stroke: "none" }) 3389 ] }); 3390 3391 // packages/icons/build-module/library/align-right.mjs 3392 var import_primitives8 = __toESM(require_primitives(), 1); 3393 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); 3394 var align_right_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives8.Path, { d: "M11 5H20M4 12H20M11 19H20", vectorEffect: "non-scaling-stroke" }) }); 3395 3396 // packages/icons/build-module/library/archive.mjs 3397 var import_primitives9 = __toESM(require_primitives(), 1); 3398 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); 3399 var archive_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives9.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M11.934 7.406a1 1 0 0 0 .914.594H19a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5h5.764a.5.5 0 0 1 .447.276l.723 1.63Zm1.064-1.216a.5.5 0 0 0 .462.31H19a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h5.764a2 2 0 0 1 1.789 1.106l.445 1.084ZM8.5 10.5h7V12h-7v-1.5Zm7 3.5h-7v1.5h7V14Z" }) }); 3400 3401 // packages/icons/build-module/library/audio.mjs 3402 var import_primitives10 = __toESM(require_primitives(), 1); 3403 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); 3404 var audio_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives10.Path, { d: "M17.7 4.3c-1.2 0-2.8 0-3.8 1-.6.6-.9 1.5-.9 2.6V14c-.6-.6-1.5-1-2.5-1C8.6 13 7 14.6 7 16.5S8.6 20 10.5 20c1.5 0 2.8-1 3.3-2.3.5-.8.7-1.8.7-2.5V7.9c0-.7.2-1.2.5-1.6.6-.6 1.8-.6 2.8-.6h.3V4.3h-.4z" }) }); 3405 3406 // packages/icons/build-module/library/block-default.mjs 3407 var import_primitives11 = __toESM(require_primitives(), 1); 3408 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); 3409 var block_default_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives11.Path, { d: "M19 8h-1V6h-5v2h-2V6H6v2H5c-1.1 0-2 .9-2 2v8c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2v-8c0-1.1-.9-2-2-2zm.5 10c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-8c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v8z" }) }); 3410 3411 // packages/icons/build-module/library/block-table.mjs 3412 var import_primitives12 = __toESM(require_primitives(), 1); 3413 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); 3414 var block_table_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives12.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zM5 4.5h14c.3 0 .5.2.5.5v3.5h-15V5c0-.3.2-.5.5-.5zm8 5.5h6.5v3.5H13V10zm-1.5 3.5h-7V10h7v3.5zm-7 5.5v-4h7v4.5H5c-.3 0-.5-.2-.5-.5zm14.5.5h-6V15h6.5v4c0 .3-.2.5-.5.5z" }) }); 3415 3416 // packages/icons/build-module/library/breadcrumbs.mjs 3417 var import_primitives13 = __toESM(require_primitives(), 1); 3418 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); 3419 var breadcrumbs_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives13.Path, { d: "M4 13.5h3v-3H4v3Zm6-3.5 2 2-2 2 1 1 3-3-3-3-1 1Zm7 .5v3h3v-3h-3Z" }) }); 3420 3421 // packages/icons/build-module/library/button.mjs 3422 var import_primitives14 = __toESM(require_primitives(), 1); 3423 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); 3424 var button_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives14.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) }); 3425 3426 // packages/icons/build-module/library/buttons.mjs 3427 var import_primitives15 = __toESM(require_primitives(), 1); 3428 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); 3429 var buttons_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives15.Path, { d: "M14.5 17.5H9.5V16H14.5V17.5Z M14.5 8H9.5V6.5H14.5V8Z M7 3.5H17C18.1046 3.5 19 4.39543 19 5.5V9C19 10.1046 18.1046 11 17 11H7C5.89543 11 5 10.1046 5 9V5.5C5 4.39543 5.89543 3.5 7 3.5ZM17 5H7C6.72386 5 6.5 5.22386 6.5 5.5V9C6.5 9.27614 6.72386 9.5 7 9.5H17C17.2761 9.5 17.5 9.27614 17.5 9V5.5C17.5 5.22386 17.2761 5 17 5Z M7 13H17C18.1046 13 19 13.8954 19 15V18.5C19 19.6046 18.1046 20.5 17 20.5H7C5.89543 20.5 5 19.6046 5 18.5V15C5 13.8954 5.89543 13 7 13ZM17 14.5H7C6.72386 14.5 6.5 14.7239 6.5 15V18.5C6.5 18.7761 6.72386 19 7 19H17C17.2761 19 17.5 18.7761 17.5 18.5V15C17.5 14.7239 17.2761 14.5 17 14.5Z" }) }); 3430 3431 // packages/icons/build-module/library/calendar.mjs 3432 var import_primitives16 = __toESM(require_primitives(), 1); 3433 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); 3434 var calendar_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives16.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V7h15v12zM9 10H7v2h2v-2zm0 4H7v2h2v-2zm4-4h-2v2h2v-2zm4 0h-2v2h2v-2zm-4 4h-2v2h2v-2zm4 0h-2v2h2v-2z" }) }); 3435 3436 // packages/icons/build-module/library/caption.mjs 3437 var import_primitives17 = __toESM(require_primitives(), 1); 3438 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); 3439 var caption_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives17.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6 5.5h12a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5ZM4 6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6Zm4 10h2v-1.5H8V16Zm5 0h-2v-1.5h2V16Zm1 0h2v-1.5h-2V16Z" }) }); 3440 3441 // packages/icons/build-module/library/category.mjs 3442 var import_primitives18 = __toESM(require_primitives(), 1); 3443 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); 3444 var category_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3445 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives18.Path, { d: "M4.75 6C4.75 5.30964 5.30964 4.75 6 4.75H9C9.69036 4.75 10.25 5.30964 10.25 6V9C10.25 9.69036 9.69036 10.25 9 10.25H6C5.30964 10.25 4.75 9.69036 4.75 9V6Z", vectorEffect: "non-scaling-stroke" }), 3446 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives18.Path, { d: "M4.75 15C4.75 14.3096 5.30964 13.75 6 13.75H9C9.69036 13.75 10.25 14.3096 10.25 15V18C10.25 18.6904 9.69036 19.25 9 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V15Z", vectorEffect: "non-scaling-stroke" }), 3447 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives18.Path, { d: "M13.75 6C13.75 5.30964 14.3096 4.75 15 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V9C19.25 9.69036 18.6904 10.25 18 10.25H15C14.3096 10.25 13.75 9.69036 13.75 9V6Z", vectorEffect: "non-scaling-stroke" }), 3448 /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives18.Path, { d: "M13.75 15C13.75 14.3096 14.3096 13.75 15 13.75H18C18.6904 13.75 19.25 14.3096 19.25 15V18C19.25 18.6904 18.6904 19.25 18 19.25H15C14.3096 19.25 13.75 18.6904 13.75 18V15Z", vectorEffect: "non-scaling-stroke" }) 3449 ] }); 3450 3451 // packages/icons/build-module/library/chevron-down.mjs 3452 var import_primitives19 = __toESM(require_primitives(), 1); 3453 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); 3454 var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives19.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives19.Path, { d: "M7 11L12 15L17 11", vectorEffect: "non-scaling-stroke" }) }); 3455 3456 // packages/icons/build-module/library/chevron-left-small.mjs 3457 var import_primitives20 = __toESM(require_primitives(), 1); 3458 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); 3459 var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives20.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_primitives20.Path, { d: "M13.5 8.5L10.5 12L13.5 15.5", vectorEffect: "non-scaling-stroke" }) }); 3460 3461 // packages/icons/build-module/library/chevron-left.mjs 3462 var import_primitives21 = __toESM(require_primitives(), 1); 3463 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); 3464 var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives21.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_primitives21.Path, { d: "M14 6.5L9 12L14 17.5", vectorEffect: "non-scaling-stroke" }) }); 3465 3466 // packages/icons/build-module/library/chevron-right-small.mjs 3467 var import_primitives22 = __toESM(require_primitives(), 1); 3468 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); 3469 var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives22.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_primitives22.Path, { d: "M10.5 8.5L13.5 12L10.5 15.5", vectorEffect: "non-scaling-stroke" }) }); 3470 3471 // packages/icons/build-module/library/chevron-right.mjs 3472 var import_primitives23 = __toESM(require_primitives(), 1); 3473 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); 3474 var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives23.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_primitives23.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) }); 3475 3476 // packages/icons/build-module/library/chevron-up.mjs 3477 var import_primitives24 = __toESM(require_primitives(), 1); 3478 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); 3479 var chevron_up_default = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives24.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_primitives24.Path, { d: "M7 13L12 9L17 13", vectorEffect: "non-scaling-stroke" }) }); 3480 3481 // packages/icons/build-module/library/classic.mjs 3482 var import_primitives25 = __toESM(require_primitives(), 1); 3483 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); 3484 var classic_default = /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives25.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(import_primitives25.Path, { d: "M20 6H4c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H4c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h16c.3 0 .5.2.5.5v9zM10 10H8v2h2v-2zm-5 2h2v-2H5v2zm8-2h-2v2h2v-2zm-5 6h8v-2H8v2zm6-4h2v-2h-2v2zm3 0h2v-2h-2v2zm0 4h2v-2h-2v2zM5 16h2v-2H5v2z" }) }); 3485 3486 // packages/icons/build-module/library/close.mjs 3487 var import_primitives26 = __toESM(require_primitives(), 1); 3488 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); 3489 var close_default = /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives26.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_primitives26.Path, { d: "M5 19L19 5M19 19L5 5", vectorEffect: "non-scaling-stroke" }) }); 3490 3491 // packages/icons/build-module/library/code.mjs 3492 var import_primitives27 = __toESM(require_primitives(), 1); 3493 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); 3494 var code_default = /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives27.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(import_primitives27.Path, { d: "M7.99997 7L3.70708 11.2929C3.31655 11.6834 3.31655 12.3166 3.70708 12.7071L7.99997 17M16 17L20.2929 12.7071C20.6834 12.3166 20.6834 11.6834 20.2929 11.2929L16 7", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); 3495 3496 // packages/icons/build-module/library/column.mjs 3497 var import_primitives28 = __toESM(require_primitives(), 1); 3498 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); 3499 var column_default = /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives28.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_primitives28.Path, { d: "M19 6H6c-1.1 0-2 .9-2 2v9c0 1.1.9 2 2 2h13c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zM6 17.5c-.3 0-.5-.2-.5-.5V8c0-.3.2-.5.5-.5h3v10H6zm13.5-.5c0 .3-.2.5-.5.5h-3v-10h3c.3 0 .5.2.5.5v9z" }) }); 3500 3501 // packages/icons/build-module/library/columns.mjs 3502 var import_primitives29 = __toESM(require_primitives(), 1); 3503 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); 3504 var columns_default = /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives29.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(import_primitives29.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M15 7.5h-5v10h5v-10Zm1.5 0v10H19a.5.5 0 0 0 .5-.5V8a.5.5 0 0 0-.5-.5h-2.5ZM6 7.5h2.5v10H6a.5.5 0 0 1-.5-.5V8a.5.5 0 0 1 .5-.5ZM6 6h13a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2Z" }) }); 3505 3506 // packages/icons/build-module/library/comment-author-avatar.mjs 3507 var import_primitives30 = __toESM(require_primitives(), 1); 3508 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); 3509 var comment_author_avatar_default = /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_primitives30.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3510 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives30.Path, { d: "M13.25 10C13.25 10.6904 12.6904 11.25 12 11.25C11.3096 11.25 10.75 10.6904 10.75 10C10.75 9.30964 11.3096 8.75 12 8.75C12.6904 8.75 13.25 9.30964 13.25 10Z", fill: "currentColor", stroke: "none" }), 3511 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives30.Path, { d: "M8 18.0476V16C8 14.8954 8.89543 14 10 14H14C15.1046 14 16 14.8954 16 16V18.0476M13.25 10C13.25 10.6904 12.6904 11.25 12 11.25C11.3096 11.25 10.75 10.6904 10.75 10C10.75 9.30964 11.3096 8.75 12 8.75C12.6904 8.75 13.25 9.30964 13.25 10Z", vectorEffect: "non-scaling-stroke" }), 3512 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_primitives30.Path, { d: "M12 4.75C7.99594 4.75 4.75 7.99593 4.75 12C4.75 16.0041 7.99593 19.25 12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) 3513 ] }); 3514 3515 // packages/icons/build-module/library/comment-author-name.mjs 3516 var import_primitives31 = __toESM(require_primitives(), 1); 3517 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); 3518 var comment_author_name_default = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(import_primitives31.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3519 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives31.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z" }), 3520 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives31.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M15 15V15C15 13.8954 14.1046 13 13 13L11 13C9.89543 13 9 13.8954 9 15V15" }), 3521 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_primitives31.Circle, { cx: "12", cy: "9", r: "2", fillRule: "evenodd", clipRule: "evenodd" }) 3522 ] }); 3523 3524 // packages/icons/build-module/library/comment-content.mjs 3525 var import_primitives32 = __toESM(require_primitives(), 1); 3526 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); 3527 var comment_content_default = /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives32.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(import_primitives32.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M6.68822 16.625L5.5 17.8145L5.5 5.5L18.5 5.5L18.5 16.625L6.68822 16.625ZM7.31 18.125L19 18.125C19.5523 18.125 20 17.6773 20 17.125L20 5C20 4.44772 19.5523 4 19 4H5C4.44772 4 4 4.44772 4 5V19.5247C4 19.8173 4.16123 20.086 4.41935 20.2237C4.72711 20.3878 5.10601 20.3313 5.35252 20.0845L7.31 18.125ZM16 9.99997H8V8.49997H16V9.99997ZM8 14H13V12.5H8V14Z" }) }); 3528 3529 // packages/icons/build-module/library/comment-edit-link.mjs 3530 var import_primitives33 = __toESM(require_primitives(), 1); 3531 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); 3532 var comment_edit_link_default = /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives33.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_primitives33.Path, { d: "m6.249 11.065.44-.44h3.186l-1.5 1.5H7.31l-1.957 1.96A.792.792 0 0 1 4 13.524V5a1 1 0 0 1 1-1h8a1 1 0 0 1 1 1v1.5L12.5 8V5.5h-7v6.315l.749-.75ZM20 19.75H7v-1.5h13v1.5Zm0-12.653-8.967 9.064L8 17l.867-2.935L17.833 5 20 7.097Z" }) }); 3533 3534 // packages/icons/build-module/library/comment-reply-link.mjs 3535 var import_primitives34 = __toESM(require_primitives(), 1); 3536 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); 3537 var comment_reply_link_default = /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives34.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(import_primitives34.Path, { d: "M6.68822 10.625L6.24878 11.0649L5.5 11.8145L5.5 5.5L12.5 5.5V8L14 6.5V5C14 4.44772 13.5523 4 13 4H5C4.44772 4 4 4.44771 4 5V13.5247C4 13.8173 4.16123 14.086 4.41935 14.2237C4.72711 14.3878 5.10601 14.3313 5.35252 14.0845L7.31 12.125H8.375L9.875 10.625H7.31H6.68822ZM14.5605 10.4983L11.6701 13.75H16.9975C17.9963 13.75 18.7796 14.1104 19.3553 14.7048C19.9095 15.2771 20.2299 16.0224 20.4224 16.7443C20.7645 18.0276 20.7543 19.4618 20.7487 20.2544C20.7481 20.345 20.7475 20.4272 20.7475 20.4999L19.2475 20.5001C19.2475 20.4191 19.248 20.3319 19.2484 20.2394V20.2394C19.2526 19.4274 19.259 18.2035 18.973 17.1307C18.8156 16.5401 18.586 16.0666 18.2778 15.7483C17.9909 15.4521 17.5991 15.25 16.9975 15.25H11.8106L14.5303 17.9697L13.4696 19.0303L8.96956 14.5303L13.4394 9.50171L14.5605 10.4983Z" }) }); 3538 3539 // packages/icons/build-module/library/comment.mjs 3540 var import_primitives35 = __toESM(require_primitives(), 1); 3541 var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); 3542 var comment_default = /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives35.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_primitives35.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12.9c0 .6.5 1.1 1.1 1.1.3 0 .5-.1.8-.3L8.5 17H18c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 11c0 .3-.2.5-.5.5H7.9l-2.4 2.4V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v9z" }) }); 3543 3544 // packages/icons/build-module/library/contents.mjs 3545 var import_primitives36 = __toESM(require_primitives(), 1); 3546 var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); 3547 var contents_default = /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_primitives36.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M8.10417 6.00024H6.5C5.39543 6.00024 4.5 6.89567 4.5 8.00024V10.3336H6V8.00024C6 7.7241 6.22386 7.50024 6.5 7.50024H8.10417V6.00024ZM4.5 13.6669V16.0002C4.5 17.1048 5.39543 18.0002 6.5 18.0002H8.10417V16.5002H6.5C6.22386 16.5002 6 16.2764 6 16.0002V13.6669H4.5ZM10.3958 6.00024V7.50024H13.6042V6.00024H10.3958ZM15.8958 6.00024V7.50024H17.5C17.7761 7.50024 18 7.7241 18 8.00024V10.3336H19.5V8.00024C19.5 6.89567 18.6046 6.00024 17.5 6.00024H15.8958ZM19.5 13.6669H18V16.0002C18 16.2764 17.7761 16.5002 17.5 16.5002H15.8958V18.0002H17.5C18.6046 18.0002 19.5 17.1048 19.5 16.0002V13.6669ZM13.6042 18.0002V16.5002H10.3958V18.0002H13.6042Z" }) }); 3548 3549 // packages/icons/build-module/library/cover.mjs 3550 var import_primitives37 = __toESM(require_primitives(), 1); 3551 var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); 3552 var cover_default = /* @__PURE__ */ (0, import_jsx_runtime38.jsxs)(import_primitives37.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3553 /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives37.Path, { d: "M20.25 18.75V5.25C20.25 4.42157 19.5784 3.75 18.75 3.75H5.25C4.42157 3.75 3.75 4.42157 3.75 5.25V18.75C3.75 19.5784 4.42157 20.25 5.25 20.25H18.75C19.5784 20.25 20.25 19.5784 20.25 18.75Z", vectorEffect: "non-scaling-stroke" }), 3554 /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_primitives37.Path, { d: "M11.5 13.4V3.75H16.5V13.4L14 10.3L11.5 13.4Z", fill: "currentColor", stroke: "none" }) 3555 ] }); 3556 3557 // packages/icons/build-module/library/crop.mjs 3558 var import_primitives38 = __toESM(require_primitives(), 1); 3559 var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); 3560 var crop_default = /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives38.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_primitives38.Path, { d: "M18 20v-2h2v-1.5H7.75a.25.25 0 0 1-.25-.25V4H6v2H4v1.5h2v8.75c0 .966.784 1.75 1.75 1.75h8.75v2H18ZM9.273 7.5h6.977a.25.25 0 0 1 .25.25v6.977H18V7.75A1.75 1.75 0 0 0 16.25 6H9.273v1.5Z" }) }); 3561 3562 // packages/icons/build-module/library/custom-link.mjs 3563 var import_primitives39 = __toESM(require_primitives(), 1); 3564 var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); 3565 var custom_link_default = /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives39.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_primitives39.Path, { d: "M12.5 14.5h-1V16h1c2.2 0 4-1.8 4-4s-1.8-4-4-4h-1v1.5h1c1.4 0 2.5 1.1 2.5 2.5s-1.1 2.5-2.5 2.5zm-4 1.5v-1.5h-1C6.1 14.5 5 13.4 5 12s1.1-2.5 2.5-2.5h1V8h-1c-2.2 0-4 1.8-4 4s1.8 4 4 4h1zm-1-3.2h5v-1.5h-5v1.5zM18 4H9c-1.1 0-2 .9-2 2v.5h1.5V6c0-.3.2-.5.5-.5h9c.3 0 .5.2.5.5v12c0 .3-.2.5-.5.5H9c-.3 0-.5-.2-.5-.5v-.5H7v.5c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2z" }) }); 3566 3567 // packages/icons/build-module/library/custom-post-type.mjs 3568 var import_primitives40 = __toESM(require_primitives(), 1); 3569 var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); 3570 var custom_post_type_default = /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives40.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_primitives40.Path, { d: "M4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4zm.8-4l.7.7 2-2V12h1V9.2l2 2 .7-.7-2-2H12v-1H9.2l2-2-.7-.7-2 2V4h-1v2.8l-2-2-.7.7 2 2H4v1h2.8l-2 2z" }) }); 3571 3572 // packages/icons/build-module/library/details.mjs 3573 var import_primitives41 = __toESM(require_primitives(), 1); 3574 var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); 3575 var details_default = /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_primitives41.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3576 /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives41.Path, { d: "M4 16h10v1.5H4V16Zm0-4.5h16V13H4v-1.5ZM10 7h10v1.5H10V7Z", fillRule: "evenodd", clipRule: "evenodd" }), 3577 /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_primitives41.Path, { d: "m4 5.25 4 2.5-4 2.5v-5Z" }) 3578 ] }); 3579 3580 // packages/icons/build-module/library/error.mjs 3581 var import_primitives42 = __toESM(require_primitives(), 1); 3582 var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); 3583 var error_default = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives42.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(import_primitives42.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" }) }); 3584 3585 // packages/icons/build-module/library/external.mjs 3586 var import_primitives43 = __toESM(require_primitives(), 1); 3587 var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); 3588 var external_default = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives43.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(import_primitives43.Path, { d: "M19.5 4.5h-7V6h4.44l-5.97 5.97 1.06 1.06L18 7.06v4.44h1.5v-7Zm-13 1a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2v-3H17v3a.5.5 0 0 1-.5.5h-10a.5.5 0 0 1-.5-.5v-10a.5.5 0 0 1 .5-.5h3V5.5h-3Z" }) }); 3589 3590 // packages/icons/build-module/library/file.mjs 3591 var import_primitives44 = __toESM(require_primitives(), 1); 3592 var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); 3593 var file_default = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives44.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(import_primitives44.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.848 8a1 1 0 0 1-.914-.594l-.723-1.63a.5.5 0 0 0-.447-.276H5a.5.5 0 0 0-.5.5v11.5a.5.5 0 0 0 .5.5h14a.5.5 0 0 0 .5-.5v-9A.5.5 0 0 0 19 8h-6.152Zm.612-1.5a.5.5 0 0 1-.462-.31l-.445-1.084A2 2 0 0 0 10.763 4H5a2 2 0 0 0-2 2v11.5a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-9a2 2 0 0 0-2-2h-5.54Z" }) }); 3594 3595 // packages/icons/build-module/library/flip-horizontal.mjs 3596 var import_primitives45 = __toESM(require_primitives(), 1); 3597 var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); 3598 var flip_horizontal_default = /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives45.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(import_primitives45.Path, { d: "M4 6v12c0 1.1.9 2 2 2h3v-1.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h3V4H6c-1.1 0-2 .9-2 2zm7.2 16h1.5V2h-1.5v20zM15 5.5h1.5V4H15v1.5zm3.5.5H20c0-1.1-.9-2-2-2v1.5c.3 0 .5.2.5.5zm0 10.5H20v-2h-1.5v2zm0-3.5H20v-2h-1.5v2zm-.5 5.5V20c1.1 0 2-.9 2-2h-1.5c0 .3-.2.5-.5.5zM15 20h1.5v-1.5H15V20zm3.5-10.5H20v-2h-1.5v2z" }) }); 3599 3600 // packages/icons/build-module/library/flip-vertical.mjs 3601 var import_primitives46 = __toESM(require_primitives(), 1); 3602 var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); 3603 var flip_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives46.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_primitives46.Path, { d: "M2 11.2v1.5h20v-1.5H2zM5.5 6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v3H20V6c0-1.1-.9-2-2-2H6c-1.1 0-2 .9-2 2v3h1.5V6zm2 14h2v-1.5h-2V20zm3.5 0h2v-1.5h-2V20zm7-1.5V20c1.1 0 2-.9 2-2h-1.5c0 .3-.2.5-.5.5zm.5-2H20V15h-1.5v1.5zM5.5 18H4c0 1.1.9 2 2 2v-1.5c-.3 0-.5-.2-.5-.5zm0-3H4v1.5h1.5V15zm9 5h2v-1.5h-2V20z" }) }); 3604 3605 // packages/icons/build-module/library/footer.mjs 3606 var import_primitives47 = __toESM(require_primitives(), 1); 3607 var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); 3608 var footer_default = /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives47.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(import_primitives47.Path, { fillRule: "evenodd", d: "M18 5.5h-8v8h8.5V6a.5.5 0 00-.5-.5zm-9.5 8h-3V6a.5.5 0 01.5-.5h2.5v8zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); 3609 3610 // packages/icons/build-module/library/format-indent-rtl.mjs 3611 var import_primitives48 = __toESM(require_primitives(), 1); 3612 var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); 3613 var format_indent_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives48.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_primitives48.Path, { d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM20.0303 9.03033L17.0607 12L20.0303 14.9697L18.9697 16.0303L15.4697 12.5303L14.9393 12L15.4697 11.4697L18.9697 7.96967L20.0303 9.03033Z" }) }); 3614 3615 // packages/icons/build-module/library/format-indent.mjs 3616 var import_primitives49 = __toESM(require_primitives(), 1); 3617 var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); 3618 var format_indent_default = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives49.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_primitives49.Path, { d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-8-3.5l3 3-3 3 1 1 4-4-4-4-1 1z" }) }); 3619 3620 // packages/icons/build-module/library/format-list-bullets-rtl.mjs 3621 var import_primitives50 = __toESM(require_primitives(), 1); 3622 var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); 3623 var format_list_bullets_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives50.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_primitives50.Path, { d: "M4 8.8h8.9V7.2H4v1.6zm0 7h8.9v-1.5H4v1.5zM18 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-3c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2z" }) }); 3624 3625 // packages/icons/build-module/library/format-list-bullets.mjs 3626 var import_primitives51 = __toESM(require_primitives(), 1); 3627 var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); 3628 var format_list_bullets_default = /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives51.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_primitives51.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM6 13c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0-7c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) }); 3629 3630 // packages/icons/build-module/library/format-list-numbered-rtl.mjs 3631 var import_primitives52 = __toESM(require_primitives(), 1); 3632 var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); 3633 var format_list_numbered_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives52.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_primitives52.Path, { d: "M3.8 15.8h8.9v-1.5H3.8v1.5zm0-7h8.9V7.2H3.8v1.6zm14.7-2.1V10h1V5.3l-2.2.7.3 1 .9-.3zm1.2 6.1c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5H20v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3 0-.8-.3-1.1z" }) }); 3634 3635 // packages/icons/build-module/library/format-list-numbered.mjs 3636 var import_primitives53 = __toESM(require_primitives(), 1); 3637 var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); 3638 var format_list_numbered_default = /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives53.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(import_primitives53.Path, { d: "M11.1 15.8H20v-1.5h-8.9v1.5zm0-8.6v1.5H20V7.2h-8.9zM5 6.7V10h1V5.3L3.8 6l.4 1 .8-.3zm-.4 5.7c-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-1c.3-.6.8-1.4.9-2.1.1-.3 0-.8-.2-1.1-.5-.6-1.3-.5-1.7-.4z" }) }); 3639 3640 // packages/icons/build-module/library/format-ltr.mjs 3641 var import_primitives54 = __toESM(require_primitives(), 1); 3642 var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); 3643 var format_ltr_default = /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives54.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_primitives54.Path, { d: "M3 9c0 2.8 2.2 5 5 5v-.2V20h1.5V5.5H12V20h1.5V5.5h3V4H8C5.2 4 3 6.2 3 9Zm15.9-1-1.1 1 2.6 3-2.6 3 1.1 1 3.4-4-3.4-4Z" }) }); 3644 3645 // packages/icons/build-module/library/format-outdent-rtl.mjs 3646 var import_primitives55 = __toESM(require_primitives(), 1); 3647 var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); 3648 var format_outdent_rtl_default = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives55.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_primitives55.Path, { d: "M20 5.5H4V4H20V5.5ZM12 12.5H4V11H12V12.5ZM20 20V18.5H4V20H20ZM15.4697 14.9697L18.4393 12L15.4697 9.03033L16.5303 7.96967L20.0303 11.4697L20.5607 12L20.0303 12.5303L16.5303 16.0303L15.4697 14.9697Z" }) }); 3649 3650 // packages/icons/build-module/library/format-outdent.mjs 3651 var import_primitives56 = __toESM(require_primitives(), 1); 3652 var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1); 3653 var format_outdent_default = /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives56.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(import_primitives56.Path, { d: "M4 7.2v1.5h16V7.2H4zm8 8.6h8v-1.5h-8v1.5zm-4-4.6l-4 4 4 4 1-1-3-3 3-3-1-1z" }) }); 3654 3655 // packages/icons/build-module/library/fullscreen.mjs 3656 var import_primitives57 = __toESM(require_primitives(), 1); 3657 var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1); 3658 var fullscreen_default = /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives57.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(import_primitives57.Path, { d: "M6 4a2 2 0 0 0-2 2v3h1.5V6a.5.5 0 0 1 .5-.5h3V4H6Zm3 14.5H6a.5.5 0 0 1-.5-.5v-3H4v3a2 2 0 0 0 2 2h3v-1.5Zm6 1.5v-1.5h3a.5.5 0 0 0 .5-.5v-3H20v3a2 2 0 0 1-2 2h-3Zm3-16a2 2 0 0 1 2 2v3h-1.5V6a.5.5 0 0 0-.5-.5h-3V4h3Z" }) }); 3659 3660 // packages/icons/build-module/library/gallery.mjs 3661 var import_primitives58 = __toESM(require_primitives(), 1); 3662 var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1); 3663 var gallery_default = /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives58.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(import_primitives58.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M16.375 4.5H4.625a.125.125 0 0 0-.125.125v8.254l2.859-1.54a.75.75 0 0 1 .68-.016l2.384 1.142 2.89-2.074a.75.75 0 0 1 .874 0l2.313 1.66V4.625a.125.125 0 0 0-.125-.125Zm.125 9.398-2.75-1.975-2.813 2.02a.75.75 0 0 1-.76.067l-2.444-1.17L4.5 14.583v1.792c0 .069.056.125.125.125h11.75a.125.125 0 0 0 .125-.125v-2.477ZM4.625 3C3.728 3 3 3.728 3 4.625v11.75C3 17.273 3.728 18 4.625 18h11.75c.898 0 1.625-.727 1.625-1.625V4.625C18 3.728 17.273 3 16.375 3H4.625ZM20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" }) }); 3664 3665 // packages/icons/build-module/library/grid.mjs 3666 var import_primitives59 = __toESM(require_primitives(), 1); 3667 var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1); 3668 var grid_default = /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives59.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(import_primitives59.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m3 5c0-1.10457.89543-2 2-2h13.5c1.1046 0 2 .89543 2 2v13.5c0 1.1046-.8954 2-2 2h-13.5c-1.10457 0-2-.8954-2-2zm2-.5h6v6.5h-6.5v-6c0-.27614.22386-.5.5-.5zm-.5 8v6c0 .2761.22386.5.5.5h6v-6.5zm8 0v6.5h6c.2761 0 .5-.2239.5-.5v-6zm0-8v6.5h6.5v-6c0-.27614-.2239-.5-.5-.5z" }) }); 3669 3670 // packages/icons/build-module/library/group.mjs 3671 var import_primitives60 = __toESM(require_primitives(), 1); 3672 var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1); 3673 var group_default = /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives60.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(import_primitives60.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" }) }); 3674 3675 // packages/icons/build-module/library/header.mjs 3676 var import_primitives61 = __toESM(require_primitives(), 1); 3677 var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1); 3678 var header_default = /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives61.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(import_primitives61.Path, { d: "M18.5 10.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" }) }); 3679 3680 // packages/icons/build-module/library/heading-level-1.mjs 3681 var import_primitives62 = __toESM(require_primitives(), 1); 3682 var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1); 3683 var heading_level_1_default = /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives62.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(import_primitives62.Path, { d: "M17.6 7c-.6.9-1.5 1.7-2.6 2v1h2v7h2V7h-1.4zM11 11H7V7H5v10h2v-4h4v4h2V7h-2v4z" }) }); 3684 3685 // packages/icons/build-module/library/heading-level-2.mjs 3686 var import_primitives63 = __toESM(require_primitives(), 1); 3687 var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1); 3688 var heading_level_2_default = /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives63.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(import_primitives63.Path, { d: "M9 11.1H5v-4H3v10h2v-4h4v4h2v-10H9v4zm8 4c.5-.4.6-.6 1.1-1.1.4-.4.8-.8 1.2-1.3.3-.4.6-.8.9-1.3.2-.4.3-.8.3-1.3 0-.4-.1-.9-.3-1.3-.2-.4-.4-.7-.8-1-.3-.3-.7-.5-1.2-.6-.5-.2-1-.2-1.5-.2-.4 0-.7 0-1.1.1-.3.1-.7.2-1 .3-.3.1-.6.3-.9.5-.3.2-.6.4-.8.7l1.2 1.2c.3-.3.6-.5 1-.7.4-.2.7-.3 1.2-.3s.9.1 1.3.4c.3.3.5.7.5 1.1 0 .4-.1.8-.4 1.1-.3.5-.6.9-1 1.2-.4.4-1 .9-1.6 1.4-.6.5-1.4 1.1-2.2 1.6v1.5h8v-2H17z" }) }); 3689 3690 // packages/icons/build-module/library/heading-level-3.mjs 3691 var import_primitives64 = __toESM(require_primitives(), 1); 3692 var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1); 3693 var heading_level_3_default = /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives64.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_primitives64.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.3 1.7c-.4-.4-1-.7-1.6-.8v-.1c.6-.2 1.1-.5 1.5-.9.3-.4.5-.8.5-1.3 0-.4-.1-.8-.3-1.1-.2-.3-.5-.6-.8-.8-.4-.2-.8-.4-1.2-.5-.6-.1-1.1-.2-1.6-.2-.6 0-1.3.1-1.8.3s-1.1.5-1.6.9l1.2 1.4c.4-.2.7-.4 1.1-.6.3-.2.7-.3 1.1-.3.4 0 .8.1 1.1.3.3.2.4.5.4.8 0 .4-.2.7-.6.9-.7.3-1.5.5-2.2.4v1.6c.5 0 1 0 1.5.1.3.1.7.2 1 .3.2.1.4.2.5.4s.1.4.1.6c0 .3-.2.7-.5.8-.4.2-.9.3-1.4.3s-1-.1-1.4-.3c-.4-.2-.8-.4-1.2-.7L13 15.6c.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.6 0 1.1-.1 1.6-.2.4-.1.9-.2 1.3-.5.4-.2.7-.5.9-.9.2-.4.3-.8.3-1.2 0-.6-.3-1.1-.7-1.5z" }) }); 3694 3695 // packages/icons/build-module/library/heading-level-4.mjs 3696 var import_primitives65 = __toESM(require_primitives(), 1); 3697 var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1); 3698 var heading_level_4_default = /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives65.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_primitives65.Path, { d: "M20 13V7h-3l-4 6v2h5v2h2v-2h1v-2h-1zm-2 0h-2.8L18 9v4zm-9-2H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); 3699 3700 // packages/icons/build-module/library/heading-level-5.mjs 3701 var import_primitives66 = __toESM(require_primitives(), 1); 3702 var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1); 3703 var heading_level_5_default = /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives66.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_primitives66.Path, { d: "M9 11H5V7H3v10h2v-4h4v4h2V7H9v4zm11.7 1.2c-.2-.3-.5-.7-.8-.9-.3-.3-.7-.5-1.1-.6-.5-.1-.9-.2-1.4-.2-.2 0-.5.1-.7.1-.2.1-.5.1-.7.2l.1-1.9h4.3V7H14l-.3 5 1 .6.5-.2.4-.1c.1-.1.3-.1.4-.1h.5c.5 0 1 .1 1.4.4.4.2.6.7.6 1.1 0 .4-.2.8-.6 1.1-.4.3-.9.4-1.4.4-.4 0-.9-.1-1.3-.3-.4-.2-.7-.4-1.1-.7 0 0-1.1 1.4-1 1.5.5.4 1 .8 1.6 1 .7.3 1.5.4 2.3.4.5 0 1-.1 1.5-.3s.9-.4 1.3-.7c.4-.3.7-.7.9-1.1s.3-.9.3-1.4-.1-1-.3-1.4z" }) }); 3704 3705 // packages/icons/build-module/library/heading-level-6.mjs 3706 var import_primitives67 = __toESM(require_primitives(), 1); 3707 var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1); 3708 var heading_level_6_default = /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives67.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_primitives67.Path, { d: "M20.7 12.4c-.2-.3-.4-.6-.7-.9s-.6-.5-1-.6c-.4-.2-.8-.2-1.2-.2-.5 0-.9.1-1.3.3s-.8.5-1.2.8c0-.5 0-.9.2-1.4l.6-.9c.2-.2.5-.4.8-.5.6-.2 1.3-.2 1.9 0 .3.1.6.3.8.5 0 0 1.3-1.3 1.3-1.4-.4-.3-.9-.6-1.4-.8-.6-.2-1.3-.3-2-.3-.6 0-1.1.1-1.7.4-.5.2-1 .5-1.4.9-.4.4-.8 1-1 1.6-.3.7-.4 1.5-.4 2.3s.1 1.5.3 2.1c.2.6.6 1.1 1 1.5.4.4.9.7 1.4.9 1 .3 2 .3 3 0 .4-.1.8-.3 1.2-.6.3-.3.6-.6.8-1 .2-.5.3-.9.3-1.4s-.1-.9-.3-1.3zm-2 2.1c-.1.2-.3.4-.4.5-.1.1-.3.2-.5.2-.2.1-.4.1-.6.1-.2.1-.5 0-.7-.1-.2 0-.3-.2-.5-.3-.1-.2-.3-.4-.4-.6-.2-.3-.3-.7-.3-1 .3-.3.6-.5 1-.7.3-.1.7-.2 1-.2.4 0 .8.1 1.1.3.3.3.4.7.4 1.1 0 .2 0 .5-.1.7zM9 11H5V7H3v10h2v-4h4v4h2V7H9v4z" }) }); 3709 3710 // packages/icons/build-module/library/heading.mjs 3711 var import_primitives68 = __toESM(require_primitives(), 1); 3712 var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1); 3713 var heading_default = /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives68.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(import_primitives68.Path, { d: "M6 5V18.5911L12 13.8473L18 18.5911V5H6Z" }) }); 3714 3715 // packages/icons/build-module/library/home.mjs 3716 var import_primitives69 = __toESM(require_primitives(), 1); 3717 var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1); 3718 var home_default = /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives69.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_primitives69.Path, { d: "M12 4L4 7.9V20h16V7.9L12 4zm6.5 14.5H14V13h-4v5.5H5.5V8.8L12 5.7l6.5 3.1v9.7z" }) }); 3719 3720 // packages/icons/build-module/library/html.mjs 3721 var import_primitives70 = __toESM(require_primitives(), 1); 3722 var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1); 3723 var html_default = /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives70.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_primitives70.Path, { d: "M4.8 11.4H2.1V9H1v6h1.1v-2.6h2.7V15h1.1V9H4.8v2.4zm1.9-1.3h1.7V15h1.1v-4.9h1.7V9H6.7v1.1zM16.2 9l-1.5 2.7L13.3 9h-.9l-.8 6h1.1l.5-4 1.5 2.8 1.5-2.8.5 4h1.1L17 9h-.8zm3.8 5V9h-1.1v6h3.6v-1H20z" }) }); 3724 3725 // packages/icons/build-module/library/image.mjs 3726 var import_primitives71 = __toESM(require_primitives(), 1); 3727 var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1); 3728 var image_default = /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives71.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_primitives71.Path, { d: "M3.75 16.2031L8.6 12.7L12 15L16 11L20.25 15.2517M5 20.25H19C19.6904 20.25 20.25 19.6904 20.25 19V5C20.25 4.30964 19.6904 3.75 19 3.75H5C4.30964 3.75 3.75 4.30964 3.75 5V19C3.75 19.6904 4.30964 20.25 5 20.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); 3729 3730 // packages/icons/build-module/library/keyboard-return.mjs 3731 var import_primitives72 = __toESM(require_primitives(), 1); 3732 var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1); 3733 var keyboard_return_default = /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_primitives72.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime73.jsx)(import_primitives72.Path, { d: "m6.734 16.106 2.176-2.38-1.093-1.028-3.846 4.158 3.846 4.158 1.093-1.028-2.176-2.38h2.811c1.125 0 2.25.03 3.374 0 1.428-.001 3.362-.25 4.963-1.277 1.66-1.065 2.868-2.906 2.868-5.859 0-2.479-1.327-4.896-3.65-5.93-1.82-.813-3.044-.8-4.806-.788l-.567.002v1.5c.184 0 .368 0 .553-.002 1.82-.007 2.704-.014 4.21.657 1.854.827 2.76 2.657 2.76 4.561 0 2.472-.973 3.824-2.178 4.596-1.258.807-2.864 1.04-4.163 1.04h-.02c-1.115.03-2.229 0-3.344 0H6.734Z" }) }); 3734 3735 // packages/icons/build-module/library/layout.mjs 3736 var import_primitives73 = __toESM(require_primitives(), 1); 3737 var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1); 3738 var layout_default = /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives73.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime74.jsx)(import_primitives73.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" }) }); 3739 3740 // packages/icons/build-module/library/link-off.mjs 3741 var import_primitives74 = __toESM(require_primitives(), 1); 3742 var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1); 3743 var link_off_default = /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives74.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_primitives74.Path, { d: "M9.5 12H12.5M10 7.75H8.25C5.90279 7.75 4 9.65279 4 12C4 14.3472 5.90279 16.25 8.25 16.25H10.2333M14 16.25H15.75C18.0972 16.25 20 14.3472 20 12C20 9.65279 18.0972 7.75 15.75 7.75H14.7667M8.5 19.5L16.5 4.5", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); 3744 3745 // packages/icons/build-module/library/link.mjs 3746 var import_primitives75 = __toESM(require_primitives(), 1); 3747 var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1); 3748 var link_default = /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives75.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime76.jsx)(import_primitives75.Path, { d: "M9.5 12L14.5 12M10 7.75H8.25C5.90279 7.75 4 9.65279 4 12C4 14.3472 5.90279 16.25 8.25 16.25H10M14 16.25H15.75C18.0972 16.25 20 14.3472 20 12C20 9.65279 18.0972 7.75 15.75 7.75L14 7.75", vectorEffect: "non-scaling-stroke" }) }); 3749 3750 // packages/icons/build-module/library/list-item.mjs 3751 var import_primitives76 = __toESM(require_primitives(), 1); 3752 var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1); 3753 var list_item_default = /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives76.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_primitives76.Path, { d: "M12 11v1.5h8V11h-8zm-6-1c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z" }) }); 3754 3755 // packages/icons/build-module/library/list.mjs 3756 var import_primitives77 = __toESM(require_primitives(), 1); 3757 var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1); 3758 var list_default = /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives77.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime78.jsx)(import_primitives77.Path, { d: "M4 4v1.5h16V4H4zm8 8.5h8V11h-8v1.5zM4 20h16v-1.5H4V20zm4-8c0-1.1-.9-2-2-2s-2 .9-2 2 .9 2 2 2 2-.9 2-2z" }) }); 3759 3760 // packages/icons/build-module/library/login.mjs 3761 var import_primitives78 = __toESM(require_primitives(), 1); 3762 var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1); 3763 var login_default = /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives78.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(import_primitives78.Path, { d: "M11 14.5l1.1 1.1 3-3 .5-.5-.6-.6-3-3-1 1 1.7 1.7H5v1.5h7.7L11 14.5zM16.8 5h-7c-1.1 0-2 .9-2 2v1.5h1.5V7c0-.3.2-.5.5-.5h7c.3 0 .5.2.5.5v10c0 .3-.2.5-.5.5h-7c-.3 0-.5-.2-.5-.5v-1.5H7.8V17c0 1.1.9 2 2 2h7c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2z" }) }); 3764 3765 // packages/icons/build-module/library/loop.mjs 3766 var import_primitives79 = __toESM(require_primitives(), 1); 3767 var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1); 3768 var loop_default = /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives79.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_primitives79.Path, { d: "M18.1823 11.6392C18.1823 13.0804 17.0139 14.2487 15.5727 14.2487C14.3579 14.2487 13.335 13.4179 13.0453 12.2922L13.0377 12.2625L13.0278 12.2335L12.3985 10.377L12.3942 10.3785C11.8571 8.64997 10.246 7.39405 8.33961 7.39405C5.99509 7.39405 4.09448 9.29465 4.09448 11.6392C4.09448 13.9837 5.99509 15.8843 8.33961 15.8843C8.88499 15.8843 9.40822 15.781 9.88943 15.5923L9.29212 14.0697C8.99812 14.185 8.67729 14.2487 8.33961 14.2487C6.89838 14.2487 5.73003 13.0804 5.73003 11.6392C5.73003 10.1979 6.89838 9.02959 8.33961 9.02959C9.55444 9.02959 10.5773 9.86046 10.867 10.9862L10.8772 10.9836L11.4695 12.7311C11.9515 14.546 13.6048 15.8843 15.5727 15.8843C17.9172 15.8843 19.8178 13.9837 19.8178 11.6392C19.8178 9.29465 17.9172 7.39404 15.5727 7.39404C15.0287 7.39404 14.5066 7.4968 14.0264 7.6847L14.6223 9.20781C14.9158 9.093 15.2358 9.02959 15.5727 9.02959C17.0139 9.02959 18.1823 10.1979 18.1823 11.6392Z" }) }); 3769 3770 // packages/icons/build-module/library/map-marker.mjs 3771 var import_primitives80 = __toESM(require_primitives(), 1); 3772 var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1); 3773 var map_marker_default = /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_primitives80.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_primitives80.Path, { d: "M12 9c-.8 0-1.5.7-1.5 1.5S11.2 12 12 12s1.5-.7 1.5-1.5S12.8 9 12 9zm0-5c-3.6 0-6.5 2.8-6.5 6.2 0 .8.3 1.8.9 3.1.5 1.1 1.2 2.3 2 3.6.7 1 3 3.8 3.2 3.9l.4.5.4-.5c.2-.2 2.6-2.9 3.2-3.9.8-1.2 1.5-2.5 2-3.6.6-1.3.9-2.3.9-3.1C18.5 6.8 15.6 4 12 4zm4.3 8.7c-.5 1-1.1 2.2-1.9 3.4-.5.7-1.7 2.2-2.4 3-.7-.8-1.9-2.3-2.4-3-.8-1.2-1.4-2.3-1.9-3.3-.6-1.4-.7-2.2-.7-2.5 0-2.6 2.2-4.7 5-4.7s5 2.1 5 4.7c0 .2-.1 1-.7 2.4z" }) }); 3774 3775 // packages/icons/build-module/library/math.mjs 3776 var import_primitives81 = __toESM(require_primitives(), 1); 3777 var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1); 3778 var math_default = /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives81.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_primitives81.Path, { d: "M11.2 6.8c-.7 0-1.4.5-1.6 1.1l-2.8 7.5-1.2-1.8c-.1-.2-.4-.3-.6-.3H3v1.5h1.6l1.2 1.8c.6.9 1.9.7 2.2-.3l2.9-7.9s.1-.2.2-.2h7.8V6.7h-7.8Zm5.3 3.4-1.9 1.9-1.9-1.9-1.1 1.1 1.9 1.9-1.9 1.9 1.1 1.1 1.9-1.9 1.9 1.9 1.1-1.1-1.9-1.9 1.9-1.9-1.1-1.1Z" }) }); 3779 3780 // packages/icons/build-module/library/media-and-text.mjs 3781 var import_primitives82 = __toESM(require_primitives(), 1); 3782 var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1); 3783 var media_and_text_default = /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives82.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_primitives82.Path, { d: "M3 6v11.5h8V6H3Zm11 3h7V7.5h-7V9Zm7 3.5h-7V11h7v1.5ZM14 16h7v-1.5h-7V16Z" }) }); 3784 3785 // packages/icons/build-module/library/media.mjs 3786 var import_primitives83 = __toESM(require_primitives(), 1); 3787 var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1); 3788 var media_default = /* @__PURE__ */ (0, import_jsx_runtime84.jsxs)(import_primitives83.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3789 /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives83.Path, { d: "m7 6.5 4 2.5-4 2.5z" }), 3790 /* @__PURE__ */ (0, import_jsx_runtime84.jsx)(import_primitives83.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m5 3c-1.10457 0-2 .89543-2 2v14c0 1.1046.89543 2 2 2h14c1.1046 0 2-.8954 2-2v-14c0-1.10457-.8954-2-2-2zm14 1.5h-14c-.27614 0-.5.22386-.5.5v10.7072l3.62953-2.6465c.25108-.1831.58905-.1924.84981-.0234l2.92666 1.8969 3.5712-3.4719c.2911-.2831.7545-.2831 1.0456 0l2.9772 2.8945v-9.3568c0-.27614-.2239-.5-.5-.5zm-14.5 14.5v-1.4364l4.09643-2.987 2.99567 1.9417c.2936.1903.6798.1523.9307-.0917l3.4772-3.3806 3.4772 3.3806.0228-.0234v2.5968c0 .2761-.2239.5-.5.5h-14c-.27614 0-.5-.2239-.5-.5z" }) 3791 ] }); 3792 3793 // packages/icons/build-module/library/menu.mjs 3794 var import_primitives84 = __toESM(require_primitives(), 1); 3795 var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1); 3796 var menu_default = /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives84.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_primitives84.Path, { d: "M5 12H19M5 18.25H19M5 5.75H19", vectorEffect: "non-scaling-stroke" }) }); 3797 3798 // packages/icons/build-module/library/more-vertical.mjs 3799 var import_primitives85 = __toESM(require_primitives(), 1); 3800 var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1); 3801 var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives85.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(import_primitives85.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); 3802 3803 // packages/icons/build-module/library/more.mjs 3804 var import_primitives86 = __toESM(require_primitives(), 1); 3805 var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1); 3806 var more_default = /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives86.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_primitives86.Path, { d: "M4 9v1.5h16V9H4zm12 5.5h4V13h-4v1.5zm-6 0h4V13h-4v1.5zm-6 0h4V13H4v1.5z" }) }); 3807 3808 // packages/icons/build-module/library/navigation-overlay.mjs 3809 var import_primitives87 = __toESM(require_primitives(), 1); 3810 var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1); 3811 var navigation_overlay_default = /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives87.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_primitives87.Path, { d: "M18.5 10a1.5 1.5 0 0 1 1.5 1.5v7a1.5 1.5 0 0 1-1.5 1.5h-7a1.5 1.5 0 0 1-1.5-1.5v-7a1.5 1.5 0 0 1 1.5-1.5zM16 4a2 2 0 0 1 2 2v2h-1.5V6a.5.5 0 0 0-.5-.5H6a.5.5 0 0 0-.5.5v3H8v1.5H5.5V16a.5.5 0 0 0 .5.5h2V18H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z" }) }); 3812 3813 // packages/icons/build-module/library/navigation.mjs 3814 var import_primitives88 = __toESM(require_primitives(), 1); 3815 var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1); 3816 var navigation_default = /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)(import_primitives88.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3817 /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives88.Path, { d: "M9 16L13.5 12.8421L15 8L10.5 11.1579L9 16Z", fill: "currentColor", stroke: "none" }), 3818 /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_primitives88.Path, { d: "M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) 3819 ] }); 3820 3821 // packages/icons/build-module/library/next.mjs 3822 var import_primitives89 = __toESM(require_primitives(), 1); 3823 var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1); 3824 var next_default = /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives89.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_primitives89.Path, { d: "M7 17.5L12 12L7 6.5M13 17.5L18 12L13 6.5", vectorEffect: "non-scaling-stroke" }) }); 3825 3826 // packages/icons/build-module/library/overlay-text.mjs 3827 var import_primitives90 = __toESM(require_primitives(), 1); 3828 var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1); 3829 var overlay_text_default = /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives90.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime91.jsx)(import_primitives90.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12-9.8c.4 0 .8-.3.9-.7l1.1-3h3.6l.5 1.7h1.9L13 9h-2.2l-3.4 9.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12H20V6c0-1.1-.9-2-2-2zm-6 7l1.4 3.9h-2.7L12 11z" }) }); 3830 3831 // packages/icons/build-module/library/page-break.mjs 3832 var import_primitives91 = __toESM(require_primitives(), 1); 3833 var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1); 3834 var page_break_default = /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives91.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime92.jsx)(import_primitives91.Path, { d: "M17.5 9V6a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v3H8V6a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v3h1.5Zm0 6.5V18a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2v-2.5H8V18a.5.5 0 0 0 .5.5h7a.5.5 0 0 0 .5-.5v-2.5h1.5ZM4 13h16v-1.5H4V13Z" }) }); 3835 3836 // packages/icons/build-module/library/page.mjs 3837 var import_primitives92 = __toESM(require_primitives(), 1); 3838 var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1); 3839 var page_default = /* @__PURE__ */ (0, import_jsx_runtime93.jsxs)(import_primitives92.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3840 /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives92.Path, { d: "M15.5 7.5h-7V9h7V7.5Zm-7 3.5h7v1.5h-7V11Zm7 3.5h-7V16h7v-1.5Z" }), 3841 /* @__PURE__ */ (0, import_jsx_runtime93.jsx)(import_primitives92.Path, { d: "M17 4H7a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2ZM7 5.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V6a.5.5 0 0 1 .5-.5Z" }) 3842 ] }); 3843 3844 // packages/icons/build-module/library/pages.mjs 3845 var import_primitives93 = __toESM(require_primitives(), 1); 3846 var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1); 3847 var pages_default = /* @__PURE__ */ (0, import_jsx_runtime94.jsxs)(import_primitives93.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3848 /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives93.Path, { d: "M14.5 5.5h-7V7h7V5.5ZM7.5 9h7v1.5h-7V9Zm7 3.5h-7V14h7v-1.5Z" }), 3849 /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives93.Path, { d: "M16 2H6a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2ZM6 3.5h10a.5.5 0 0 1 .5.5v12a.5.5 0 0 1-.5.5H6a.5.5 0 0 1-.5-.5V4a.5.5 0 0 1 .5-.5Z" }), 3850 /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(import_primitives93.Path, { d: "M20 8v11c0 .69-.31 1-.999 1H6v1.5h13.001c1.52 0 2.499-.982 2.499-2.5V8H20Z" }) 3851 ] }); 3852 3853 // packages/icons/build-module/library/paragraph.mjs 3854 var import_primitives94 = __toESM(require_primitives(), 1); 3855 var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1); 3856 var paragraph_default = /* @__PURE__ */ (0, import_jsx_runtime95.jsxs)(import_primitives94.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3857 /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives94.Path, { d: "M10.75 20V4.75L14.75 4.75M14.75 20V4.75M14.75 4.75H18.5", vectorEffect: "non-scaling-stroke" }), 3858 /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(import_primitives94.Path, { d: "M5.75 9C5.75 11.3472 7.65279 13.25 10 13.25H10.75V4.75H10C7.65279 4.75 5.75 6.65279 5.75 9Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }) 3859 ] }); 3860 3861 // packages/icons/build-module/library/pencil.mjs 3862 var import_primitives95 = __toESM(require_primitives(), 1); 3863 var import_jsx_runtime96 = __toESM(require_jsx_runtime(), 1); 3864 var pencil_default = /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives95.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime96.jsx)(import_primitives95.Path, { d: "m19 7-3-3-8.5 8.5-1 4 4-1L19 7Zm-7 11.5H5V20h7v-1.5Z" }) }); 3865 3866 // packages/icons/build-module/library/pin.mjs 3867 var import_primitives96 = __toESM(require_primitives(), 1); 3868 var import_jsx_runtime97 = __toESM(require_jsx_runtime(), 1); 3869 var pin_default = /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives96.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime97.jsx)(import_primitives96.Path, { d: "m21.5 9.1-6.6-6.6-4.2 5.6c-1.2-.1-2.4.1-3.6.7-.1 0-.1.1-.2.1-.5.3-.9.6-1.2.9l3.7 3.7-5.7 5.7v1.1h1.1l5.7-5.7 3.7 3.7c.4-.4.7-.8.9-1.2.1-.1.1-.2.2-.3.6-1.1.8-2.4.6-3.6l5.6-4.1zm-7.3 3.5.1.9c.1.9 0 1.8-.4 2.6l-6-6c.8-.4 1.7-.5 2.6-.4l.9.1L15 4.9 19.1 9l-4.9 3.6z" }) }); 3870 3871 // packages/icons/build-module/library/playlist-track.mjs 3872 var import_primitives97 = __toESM(require_primitives(), 1); 3873 var import_jsx_runtime98 = __toESM(require_jsx_runtime(), 1); 3874 var playlist_track_default = /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives97.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime98.jsx)(import_primitives97.Path, { d: "M16.1 5.7h-.3c-1 0-2.2 0-2.8.6-.3.4-.5.9-.5 1.6v7.3c0 .7-.2 1.7-.7 2.5C11.3 19 10 20 8.5 20 6.6 20 5 18.4 5 16.5S6.6 13 8.5 13c1 0 1.9.4 2.5 1V7.9c0-1.1.3-2 .9-2.6 1-1 2.6-1 3.8-1h.4zM19.5 12l-4 3V9z" }) }); 3875 3876 // packages/icons/build-module/library/playlist.mjs 3877 var import_primitives98 = __toESM(require_primitives(), 1); 3878 var import_jsx_runtime99 = __toESM(require_jsx_runtime(), 1); 3879 var playlist_default = /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives98.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime99.jsx)(import_primitives98.Path, { d: "M16.1 5.7h-.3c-1 0-2.2 0-2.8.6-.3.4-.5.9-.5 1.6v7.3c0 .7-.2 1.7-.7 2.5C11.3 19 10 20 8.5 20 6.6 20 5 18.4 5 16.5S6.6 13 8.5 13c1 0 1.9.4 2.5 1V7.9c0-1.1.3-2 .9-2.6 1-1 2.6-1 3.8-1h.4zM20 15.75h-5v-1.5h5zM20 10.75h-5v-1.5h5z" }) }); 3880 3881 // packages/icons/build-module/library/plugins.mjs 3882 var import_primitives99 = __toESM(require_primitives(), 1); 3883 var import_jsx_runtime100 = __toESM(require_jsx_runtime(), 1); 3884 var plugins_default = /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives99.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime100.jsx)(import_primitives99.Path, { d: "M10.5 4v4h3V4H15v4h1.5a1 1 0 011 1v4l-3 4v2a1 1 0 01-1 1h-3a1 1 0 01-1-1v-2l-3-4V9a1 1 0 011-1H9V4h1.5zm.5 12.5v2h2v-2l3-4v-3H8v3l3 4z" }) }); 3885 3886 // packages/icons/build-module/library/plus.mjs 3887 var import_primitives100 = __toESM(require_primitives(), 1); 3888 var import_jsx_runtime101 = __toESM(require_jsx_runtime(), 1); 3889 var plus_default = /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives100.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime101.jsx)(import_primitives100.Path, { d: "M12 18V6M18 12H6", vectorEffect: "non-scaling-stroke" }) }); 3890 3891 // packages/icons/build-module/library/position-center.mjs 3892 var import_primitives101 = __toESM(require_primitives(), 1); 3893 var import_jsx_runtime102 = __toESM(require_jsx_runtime(), 1); 3894 var position_center_default = /* @__PURE__ */ (0, import_jsx_runtime102.jsxs)(import_primitives101.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3895 /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives101.Path, { d: "M5 4.75H19M5 19.25H19", vectorEffect: "non-scaling-stroke" }), 3896 /* @__PURE__ */ (0, import_jsx_runtime102.jsx)(import_primitives101.Rect, { x: "7", y: "9", width: "10", height: "6", fill: "currentColor", stroke: "none" }) 3897 ] }); 3898 3899 // packages/icons/build-module/library/position-left.mjs 3900 var import_primitives102 = __toESM(require_primitives(), 1); 3901 var import_jsx_runtime103 = __toESM(require_jsx_runtime(), 1); 3902 var position_left_default = /* @__PURE__ */ (0, import_jsx_runtime103.jsxs)(import_primitives102.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3903 /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives102.Path, { d: "M5 4.75H13M5 19.25H13", vectorEffect: "non-scaling-stroke" }), 3904 /* @__PURE__ */ (0, import_jsx_runtime103.jsx)(import_primitives102.Rect, { x: "5", y: "9", width: "14", height: "6", fill: "currentColor", stroke: "none" }) 3905 ] }); 3906 3907 // packages/icons/build-module/library/position-right.mjs 3908 var import_primitives103 = __toESM(require_primitives(), 1); 3909 var import_jsx_runtime104 = __toESM(require_jsx_runtime(), 1); 3910 var position_right_default = /* @__PURE__ */ (0, import_jsx_runtime104.jsxs)(import_primitives103.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3911 /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_primitives103.Path, { d: "M11 4.75H19M11 19.25H19", vectorEffect: "non-scaling-stroke" }), 3912 /* @__PURE__ */ (0, import_jsx_runtime104.jsx)(import_primitives103.Rect, { x: "5", y: "9", width: "14", height: "6", fill: "currentColor", stroke: "none" }) 3913 ] }); 3914 3915 // packages/icons/build-module/library/post-author.mjs 3916 var import_primitives104 = __toESM(require_primitives(), 1); 3917 var import_jsx_runtime105 = __toESM(require_jsx_runtime(), 1); 3918 var post_author_default = /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives104.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime105.jsx)(import_primitives104.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M10 4.5a1 1 0 11-2 0 1 1 0 012 0zm1.5 0a2.5 2.5 0 11-5 0 2.5 2.5 0 015 0zm2.25 7.5v-1A2.75 2.75 0 0011 8.25H7A2.75 2.75 0 004.25 11v1h1.5v-1c0-.69.56-1.25 1.25-1.25h4c.69 0 1.25.56 1.25 1.25v1h1.5zM4 20h9v-1.5H4V20zm16-4H4v-1.5h16V16z" }) }); 3919 3920 // packages/icons/build-module/library/post-categories.mjs 3921 var import_primitives105 = __toESM(require_primitives(), 1); 3922 var import_jsx_runtime106 = __toESM(require_jsx_runtime(), 1); 3923 var post_categories_default = /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives105.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime106.jsx)(import_primitives105.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M20 4H4v1.5h16V4zm-2 9h-3c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5h-3c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3zM4 9.5h9V8H4v1.5zM9 13H6c-1.1 0-2 .9-2 2v3c0 1.1.9 2 2 2h3c1.1 0 2-.9 2-2v-3c0-1.1-.9-2-2-2zm.5 5c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5v-3c0-.3.2-.5.5-.5h3c.3 0 .5.2.5.5v3z" }) }); 3924 3925 // packages/icons/build-module/library/post-comments-count.mjs 3926 var import_primitives106 = __toESM(require_primitives(), 1); 3927 var import_jsx_runtime107 = __toESM(require_jsx_runtime(), 1); 3928 var post_comments_count_default = /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives106.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime107.jsx)(import_primitives106.Path, { d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-2.2 6.6H7l1.6-2.2c.3-.4.5-.7.6-.9.1-.2.2-.4.2-.5 0-.2-.1-.3-.1-.4-.1-.1-.2-.1-.4-.1s-.4 0-.6.1c-.3.1-.5.3-.7.4l-.2.2-.2-1.2.1-.1c.3-.2.5-.3.8-.4.3-.1.6-.1.9-.1.3 0 .6.1.9.2.2.1.4.3.6.5.1.2.2.5.2.7 0 .3-.1.6-.2.9-.1.3-.4.7-.7 1.1l-.5.6h1.6v1.2z" }) }); 3929 3930 // packages/icons/build-module/library/post-comments-form.mjs 3931 var import_primitives107 = __toESM(require_primitives(), 1); 3932 var import_jsx_runtime108 = __toESM(require_jsx_runtime(), 1); 3933 var post_comments_form_default = /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives107.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime108.jsx)(import_primitives107.Path, { d: "M13 8H4v1.5h9V8zM4 4v1.5h16V4H4zm9 8H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1V13c0-.6-.4-1-1-1zm-.5 6.6H6.7l-1.2 1.2v-6.3h7v5.1z" }) }); 3934 3935 // packages/icons/build-module/library/post-comments.mjs 3936 var import_primitives108 = __toESM(require_primitives(), 1); 3937 var import_jsx_runtime109 = __toESM(require_jsx_runtime(), 1); 3938 var post_comments_default = /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives108.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime109.jsx)(import_primitives108.Path, { d: "M14 10.1V4c0-.6-.4-1-1-1H5c-.6 0-1 .4-1 1v8.3c0 .3.2.7.6.8.1.1.2.1.3.1.2 0 .5-.1.6-.3l1.8-1.8H13c.6 0 1-.4 1-1zm-1.5-.5H6.7l-1.2 1.2V4.5h7v5.1zM19 12h-8c-.6 0-1 .4-1 1v6.1c0 .6.4 1 1 1h5.7l1.8 1.8c.1.2.4.3.6.3.1 0 .2 0 .3-.1.4-.1.6-.5.6-.8V13c0-.6-.4-1-1-1zm-.5 7.8l-1.2-1.2h-5.8v-5.1h7v6.3z" }) }); 3939 3940 // packages/icons/build-module/library/post-content.mjs 3941 var import_primitives109 = __toESM(require_primitives(), 1); 3942 var import_jsx_runtime110 = __toESM(require_jsx_runtime(), 1); 3943 var post_content_default = /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives109.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime110.jsx)(import_primitives109.Path, { d: "M4 6h12V4.5H4V6Zm16 4.5H4V9h16v1.5ZM4 15h16v-1.5H4V15Zm0 4.5h16V18H4v1.5Z" }) }); 3944 3945 // packages/icons/build-module/library/post-date.mjs 3946 var import_primitives110 = __toESM(require_primitives(), 1); 3947 var import_jsx_runtime111 = __toESM(require_jsx_runtime(), 1); 3948 var post_date_default = /* @__PURE__ */ (0, import_jsx_runtime111.jsxs)(import_primitives110.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 3949 /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives110.Path, { d: "M11.696 13.972c.356-.546.599-.958.728-1.235a1.79 1.79 0 00.203-.783c0-.264-.077-.47-.23-.618-.148-.153-.354-.23-.618-.23-.295 0-.569.07-.82.212a3.413 3.413 0 00-.738.571l-.147-1.188c.289-.234.59-.41.903-.526.313-.117.66-.175 1.041-.175.375 0 .695.08.959.24.264.153.46.362.59.626.135.265.203.556.203.876 0 .362-.08.734-.24 1.115-.154.381-.427.87-.82 1.466l-.756 1.152H14v1.106h-4l1.696-2.609z" }), 3950 /* @__PURE__ */ (0, import_jsx_runtime111.jsx)(import_primitives110.Path, { d: "M19.5 7h-15v12a.5.5 0 00.5.5h14a.5.5 0 00.5-.5V7zM3 7V5a2 2 0 012-2h14a2 2 0 012 2v14a2 2 0 01-2 2H5a2 2 0 01-2-2V7z" }) 3951 ] }); 3952 3953 // packages/icons/build-module/library/post-excerpt.mjs 3954 var import_primitives111 = __toESM(require_primitives(), 1); 3955 var import_jsx_runtime112 = __toESM(require_jsx_runtime(), 1); 3956 var post_excerpt_default = /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives111.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime112.jsx)(import_primitives111.Path, { d: "M8.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H4v-3h4.001ZM4 20h9v-1.5H4V20Zm16-4H4v-1.5h16V16ZM13.001 3.984V9.47c0 1.518-.98 2.5-2.499 2.5h-.5v-1.5h.5c.69 0 1-.31 1-1V6.984H9v-3h4.001Z" }) }); 3957 3958 // packages/icons/build-module/library/post-featured-image.mjs 3959 var import_primitives112 = __toESM(require_primitives(), 1); 3960 var import_jsx_runtime113 = __toESM(require_jsx_runtime(), 1); 3961 var post_featured_image_default = /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives112.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime113.jsx)(import_primitives112.Path, { d: "M19 3H5c-.6 0-1 .4-1 1v7c0 .5.4 1 1 1h14c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1zM5.5 10.5v-.4l1.8-1.3 1.3.8c.3.2.7.2.9-.1L11 8.1l2.4 2.4H5.5zm13 0h-2.9l-4-4c-.3-.3-.8-.3-1.1 0L8.9 8l-1.2-.8c-.3-.2-.6-.2-.9 0l-1.3 1V4.5h13v6zM4 20h9v-1.5H4V20zm0-4h16v-1.5H4V16z" }) }); 3962 3963 // packages/icons/build-module/library/post-list.mjs 3964 var import_primitives113 = __toESM(require_primitives(), 1); 3965 var import_jsx_runtime114 = __toESM(require_jsx_runtime(), 1); 3966 var post_list_default = /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives113.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime114.jsx)(import_primitives113.Path, { d: "M18 5.5H6a.5.5 0 0 0-.5.5v12a.5.5 0 0 0 .5.5h12a.5.5 0 0 0 .5-.5V6a.5.5 0 0 0-.5-.5ZM6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2Zm1 5h1.5v1.5H7V9Zm1.5 4.5H7V15h1.5v-1.5ZM10 9h7v1.5h-7V9Zm7 4.5h-7V15h7v-1.5Z" }) }); 3967 3968 // packages/icons/build-module/library/post-terms.mjs 3969 var import_primitives114 = __toESM(require_primitives(), 1); 3970 var import_jsx_runtime115 = __toESM(require_jsx_runtime(), 1); 3971 var post_terms_default = /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives114.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime115.jsx)(import_primitives114.Path, { d: "M8.1 12.3c.1.1.3.3.5.3.2.1.4.1.6.1.2 0 .4 0 .6-.1.2-.1.4-.2.5-.3l3-3c.3-.3.5-.7.5-1.1 0-.4-.2-.8-.5-1.1L9.7 3.5c-.1-.2-.3-.3-.5-.3H5c-.4 0-.8.4-.8.8v4.2c0 .2.1.4.2.5l3.7 3.6zM5.8 4.8h3.1l3.4 3.4v.1l-3 3 .5.5-.7-.5-3.3-3.4V4.8zM4 20h9v-1.5H4V20zm0-5.5V16h16v-1.5H4z" }) }); 3972 3973 // packages/icons/build-module/library/preformatted.mjs 3974 var import_primitives115 = __toESM(require_primitives(), 1); 3975 var import_jsx_runtime116 = __toESM(require_jsx_runtime(), 1); 3976 var preformatted_default = /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives115.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime116.jsx)(import_primitives115.Path, { d: "M18 4H6c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm.5 14c0 .3-.2.5-.5.5H6c-.3 0-.5-.2-.5-.5V6c0-.3.2-.5.5-.5h12c.3 0 .5.2.5.5v12zM7 16.5h6V15H7v1.5zm4-4h6V11h-6v1.5zM9 11H7v1.5h2V11zm6 5.5h2V15h-2v1.5z" }) }); 3977 3978 // packages/icons/build-module/library/previous.mjs 3979 var import_primitives116 = __toESM(require_primitives(), 1); 3980 var import_jsx_runtime117 = __toESM(require_jsx_runtime(), 1); 3981 var previous_default = /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives116.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime117.jsx)(import_primitives116.Path, { d: "M17 6.5L12 12L17 17.5M11 6.5L6 12L11 17.5", vectorEffect: "non-scaling-stroke" }) }); 3982 3983 // packages/icons/build-module/library/published.mjs 3984 var import_primitives117 = __toESM(require_primitives(), 1); 3985 var import_jsx_runtime118 = __toESM(require_jsx_runtime(), 1); 3986 var published_default = /* @__PURE__ */ (0, import_jsx_runtime118.jsxs)(import_primitives117.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3987 /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_primitives117.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), 3988 /* @__PURE__ */ (0, import_jsx_runtime118.jsx)(import_primitives117.Path, { d: "M9 12L11 14L15 10", vectorEffect: "non-scaling-stroke" }) 3989 ] }); 3990 3991 // packages/icons/build-module/library/pull-left.mjs 3992 var import_primitives118 = __toESM(require_primitives(), 1); 3993 var import_jsx_runtime119 = __toESM(require_jsx_runtime(), 1); 3994 var pull_left_default = /* @__PURE__ */ (0, import_jsx_runtime119.jsxs)(import_primitives118.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 3995 /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_primitives118.Path, { d: "M10 18L4 18L4 6L10 6L10 18Z", fill: "currentColor", stroke: "none" }), 3996 /* @__PURE__ */ (0, import_jsx_runtime119.jsx)(import_primitives118.Path, { d: "M13 9.25H20M20 14.75H13", vectorEffect: "non-scaling-stroke" }) 3997 ] }); 3998 3999 // packages/icons/build-module/library/pull-right.mjs 4000 var import_primitives119 = __toESM(require_primitives(), 1); 4001 var import_jsx_runtime120 = __toESM(require_jsx_runtime(), 1); 4002 var pull_right_default = /* @__PURE__ */ (0, import_jsx_runtime120.jsxs)(import_primitives119.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 4003 /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_primitives119.Path, { d: "M20 18L14 18L14 6L20 6L20 18Z", fill: "currentColor", stroke: "none" }), 4004 /* @__PURE__ */ (0, import_jsx_runtime120.jsx)(import_primitives119.Path, { d: "M4 9.25H11M11 14.75H4", vectorEffect: "non-scaling-stroke" }) 4005 ] }); 4006 4007 // packages/icons/build-module/library/pullquote.mjs 4008 var import_primitives120 = __toESM(require_primitives(), 1); 4009 var import_jsx_runtime121 = __toESM(require_jsx_runtime(), 1); 4010 var pullquote_default = /* @__PURE__ */ (0, import_jsx_runtime121.jsxs)(import_primitives120.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 4011 /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_primitives120.Path, { d: "M4 4.75H20M4 19.25H20", vectorEffect: "non-scaling-stroke" }), 4012 /* @__PURE__ */ (0, import_jsx_runtime121.jsx)(import_primitives120.Path, { d: "M4.75 9.75C4.75 9.19772 5.19772 8.75 5.75 8.75H18.25C18.8023 8.75 19.25 9.19772 19.25 9.75V14.25C19.25 14.8023 18.8023 15.25 18.25 15.25H5.75C5.19771 15.25 4.75 14.8023 4.75 14.25V9.75Z", vectorEffect: "non-scaling-stroke" }) 4013 ] }); 4014 4015 // packages/icons/build-module/library/query-pagination-next.mjs 4016 var import_primitives121 = __toESM(require_primitives(), 1); 4017 var import_jsx_runtime122 = __toESM(require_jsx_runtime(), 1); 4018 var query_pagination_next_default = /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_primitives121.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime122.jsx)(import_primitives121.Path, { d: "M5 13.5h3v-3H5v3zm5 0h3v-3h-3v3zM17 9l-1 1 2 2-2 2 1 1 3-3-3-3z" }) }); 4019 4020 // packages/icons/build-module/library/query-pagination-numbers.mjs 4021 var import_primitives122 = __toESM(require_primitives(), 1); 4022 var import_jsx_runtime123 = __toESM(require_jsx_runtime(), 1); 4023 var query_pagination_numbers_default = /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_primitives122.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime123.jsx)(import_primitives122.Path, { d: "M4 13.5h6v-3H4v3zm8.2-2.5.8-.3V14h1V9.3l-2.2.7.4 1zm7.1-1.2c-.5-.6-1.2-.5-1.7-.4-.3.1-.5.2-.7.3l.1 1.1c.2-.2.5-.4.8-.5.3-.1.6 0 .7.1.2.3 0 .8-.2 1.1-.5.8-.9 1.6-1.4 2.5h2.7v-1h-.9c.3-.6.8-1.4.9-2.1 0-.3-.1-.8-.3-1.1z" }) }); 4024 4025 // packages/icons/build-module/library/query-pagination-previous.mjs 4026 var import_primitives123 = __toESM(require_primitives(), 1); 4027 var import_jsx_runtime124 = __toESM(require_jsx_runtime(), 1); 4028 var query_pagination_previous_default = /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_primitives123.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime124.jsx)(import_primitives123.Path, { d: "M16 10.5v3h3v-3h-3zm-5 3h3v-3h-3v3zM7 9l-3 3 3 3 1-1-2-2 2-2-1-1z" }) }); 4029 4030 // packages/icons/build-module/library/query-pagination.mjs 4031 var import_primitives124 = __toESM(require_primitives(), 1); 4032 var import_jsx_runtime125 = __toESM(require_jsx_runtime(), 1); 4033 var query_pagination_default = /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_primitives124.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime125.jsx)(import_primitives124.Path, { d: "M4 13.5h6v-3H4v3zm8 0h3v-3h-3v3zm5-3v3h3v-3h-3z" }) }); 4034 4035 // packages/icons/build-module/library/quote.mjs 4036 var import_primitives125 = __toESM(require_primitives(), 1); 4037 var import_jsx_runtime126 = __toESM(require_jsx_runtime(), 1); 4038 var quote_default = /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_primitives125.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime126.jsx)(import_primitives125.Path, { d: "M13 6v6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H13zm-9 6h5.2v4c0 .8-.2 1.4-.5 1.7-.6.6-1.6.6-2.5.5h-.3v1.5h.5c1 0 2.3-.1 3.3-1 .6-.6 1-1.6 1-2.8V6H4v6z" }) }); 4039 4040 // packages/icons/build-module/library/remove-submenu.mjs 4041 var import_primitives126 = __toESM(require_primitives(), 1); 4042 var import_jsx_runtime127 = __toESM(require_jsx_runtime(), 1); 4043 var remove_submenu_default = /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_primitives126.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime127.jsx)(import_primitives126.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "m13.955 20.748 8-17.5-.91-.416L19.597 6H13.5v1.5h5.411l-1.6 3.5H13.5v1.5h3.126l-1.6 3.5H13.5l.028 1.5h.812l-1.295 2.832.91.416ZM17.675 16l-.686 1.5h4.539L21.5 16h-3.825Zm2.286-5-.686 1.5H21.5V11h-1.54ZM2 12c0 3.58 2.42 5.5 6 5.5h.5V19l3-2.5-3-2.5v2H8c-2.48 0-4.5-1.52-4.5-4S5.52 7.5 8 7.5h3.5V6H8c-3.58 0-6 2.42-6 6Z" }) }); 4044 4045 // packages/icons/build-module/library/reset.mjs 4046 var import_primitives127 = __toESM(require_primitives(), 1); 4047 var import_jsx_runtime128 = __toESM(require_jsx_runtime(), 1); 4048 var reset_default = /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_primitives127.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime128.jsx)(import_primitives127.Path, { d: "M7 12H17", vectorEffect: "non-scaling-stroke" }) }); 4049 4050 // packages/icons/build-module/library/resize-corner-ne.mjs 4051 var import_primitives128 = __toESM(require_primitives(), 1); 4052 var import_jsx_runtime129 = __toESM(require_jsx_runtime(), 1); 4053 var resize_corner_ne_default = /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_primitives128.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime129.jsx)(import_primitives128.Path, { d: "M11.5 18.75H5.25V12.5M5.25 18.75L18.75 5.25M18.75 11.5V5.25H12.5", vectorEffect: "non-scaling-stroke" }) }); 4054 4055 // packages/icons/build-module/library/rotate-right.mjs 4056 var import_primitives129 = __toESM(require_primitives(), 1); 4057 var import_jsx_runtime130 = __toESM(require_jsx_runtime(), 1); 4058 var rotate_right_default = /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_primitives129.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime130.jsx)(import_primitives129.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" }) }); 4059 4060 // packages/icons/build-module/library/row.mjs 4061 var import_primitives130 = __toESM(require_primitives(), 1); 4062 var import_jsx_runtime131 = __toESM(require_jsx_runtime(), 1); 4063 var row_default = /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_primitives130.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime131.jsx)(import_primitives130.Path, { d: "M4 6.5h5a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H4V16h5a.5.5 0 0 0 .5-.5v-7A.5.5 0 0 0 9 8H4V6.5Zm16 0h-5a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h5V16h-5a.5.5 0 0 1-.5-.5v-7A.5.5 0 0 1 15 8h5V6.5Z" }) }); 4064 4065 // packages/icons/build-module/library/rss.mjs 4066 var import_primitives131 = __toESM(require_primitives(), 1); 4067 var import_jsx_runtime132 = __toESM(require_jsx_runtime(), 1); 4068 var rss_default = /* @__PURE__ */ (0, import_jsx_runtime132.jsxs)(import_primitives131.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 4069 /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_primitives131.Path, { d: "M6.25 17.75L6.25 19.25L4.75 19.25L4.75 17.75L6.25 17.75Z", fill: "currentColor", vectorEffect: "non-scaling-stroke" }), 4070 /* @__PURE__ */ (0, import_jsx_runtime132.jsx)(import_primitives131.Path, { d: "M4.75 11H5C9.41828 11 13 14.5817 13 19V19.25M19 19.25V19C19 11.268 12.732 5 5 5H4.75", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }) 4071 ] }); 4072 4073 // packages/icons/build-module/library/search.mjs 4074 var import_primitives132 = __toESM(require_primitives(), 1); 4075 var import_jsx_runtime133 = __toESM(require_jsx_runtime(), 1); 4076 var search_default = /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_primitives132.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime133.jsx)(import_primitives132.Path, { d: "M5 19L9.28769 14.7123M18.25 11C18.25 13.8995 15.8995 16.25 13 16.25C10.1005 16.25 7.75 13.8995 7.75 11C7.75 8.10051 10.1005 5.75 13 5.75C15.8995 5.75 18.25 8.10051 18.25 11Z", vectorEffect: "non-scaling-stroke" }) }); 4077 4078 // packages/icons/build-module/library/separator.mjs 4079 var import_primitives133 = __toESM(require_primitives(), 1); 4080 var import_jsx_runtime134 = __toESM(require_jsx_runtime(), 1); 4081 var separator_default = /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_primitives133.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime134.jsx)(import_primitives133.Path, { d: "M3.75 7V11.75M3.75 16.5V11.75M3.75 11.75H20.25M20.25 11.75V16.5M20.25 11.75V7", vectorEffect: "non-scaling-stroke" }) }); 4082 4083 // packages/icons/build-module/library/share.mjs 4084 var import_primitives134 = __toESM(require_primitives(), 1); 4085 var import_jsx_runtime135 = __toESM(require_jsx_runtime(), 1); 4086 var share_default = /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_primitives134.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime135.jsx)(import_primitives134.Path, { d: "M9 11.8l6.1-4.5c.1.4.4.7.9.7h2c.6 0 1-.4 1-1V5c0-.6-.4-1-1-1h-2c-.6 0-1 .4-1 1v.4l-6.4 4.8c-.2-.1-.4-.2-.6-.2H6c-.6 0-1 .4-1 1v2c0 .6.4 1 1 1h2c.2 0 .4-.1.6-.2l6.4 4.8v.4c0 .6.4 1 1 1h2c.6 0 1-.4 1-1v-2c0-.6-.4-1-1-1h-2c-.5 0-.8.3-.9.7L9 12.2v-.4z" }) }); 4087 4088 // packages/icons/build-module/library/shortcode.mjs 4089 var import_primitives135 = __toESM(require_primitives(), 1); 4090 var import_jsx_runtime136 = __toESM(require_jsx_runtime(), 1); 4091 var shortcode_default = /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_primitives135.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime136.jsx)(import_primitives135.Path, { d: "M16 4.2v1.5h2.5v12.5H16v1.5h4V4.2h-4zM4.2 19.8h4v-1.5H5.8V5.8h2.5V4.2h-4l-.1 15.6zm5.1-3.1l1.4.6 4-10-1.4-.6-4 10z" }) }); 4092 4093 // packages/icons/build-module/library/sidebar.mjs 4094 var import_primitives136 = __toESM(require_primitives(), 1); 4095 var import_jsx_runtime137 = __toESM(require_jsx_runtime(), 1); 4096 var sidebar_default = /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_primitives136.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime137.jsx)(import_primitives136.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.5zM6 4h12a2 2 0 012 2v12a2 2 0 01-2 2H6a2 2 0 01-2-2V6a2 2 0 012-2z" }) }); 4097 4098 // packages/icons/build-module/library/site-logo.mjs 4099 var import_primitives137 = __toESM(require_primitives(), 1); 4100 var import_jsx_runtime138 = __toESM(require_jsx_runtime(), 1); 4101 var site_logo_default = /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_primitives137.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime138.jsx)(import_primitives137.Path, { d: "M5.07325 14.1472L8.71429 12L12.5 13.3333L15.75 11C15.75 11 17.934 11.9169 19.2032 12.8281M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) }); 4102 4103 // packages/icons/build-module/library/square.mjs 4104 var import_primitives138 = __toESM(require_primitives(), 1); 4105 var import_jsx_runtime139 = __toESM(require_jsx_runtime(), 1); 4106 var square_default = /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_primitives138.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime139.jsx)(import_primitives138.Path, { d: "M5.75 12V18.25H12M12 5.75H18.25V12", vectorEffect: "non-scaling-stroke" }) }); 4107 4108 // packages/icons/build-module/library/stack.mjs 4109 var import_primitives139 = __toESM(require_primitives(), 1); 4110 var import_jsx_runtime140 = __toESM(require_jsx_runtime(), 1); 4111 var stack_default = /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_primitives139.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime140.jsx)(import_primitives139.Path, { d: "M17.5 4v5a2 2 0 0 1-2 2h-7a2 2 0 0 1-2-2V4H8v5a.5.5 0 0 0 .5.5h7A.5.5 0 0 0 16 9V4h1.5Zm0 16v-5a2 2 0 0 0-2-2h-7a2 2 0 0 0-2 2v5H8v-5a.5.5 0 0 1 .5-.5h7a.5.5 0 0 1 .5.5v5h1.5Z" }) }); 4112 4113 // packages/icons/build-module/library/symbol-filled.mjs 4114 var import_primitives140 = __toESM(require_primitives(), 1); 4115 var import_jsx_runtime141 = __toESM(require_jsx_runtime(), 1); 4116 var symbol_filled_default = /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_primitives140.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime141.jsx)(import_primitives140.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-17.6 1L10 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" }) }); 4117 4118 // packages/icons/build-module/library/symbol.mjs 4119 var import_primitives141 = __toESM(require_primitives(), 1); 4120 var import_jsx_runtime142 = __toESM(require_jsx_runtime(), 1); 4121 var symbol_default = /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_primitives141.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime142.jsx)(import_primitives141.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" }) }); 4122 4123 // packages/icons/build-module/library/tab-list.mjs 4124 var import_primitives142 = __toESM(require_primitives(), 1); 4125 var import_jsx_runtime143 = __toESM(require_jsx_runtime(), 1); 4126 var tab_list_default = /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_primitives142.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime143.jsx)(import_primitives142.Path, { d: "M18.2 9.5h-3.5c-1 0-1.8.8-1.8 1.8v2.5h1.5v-2.5c0-.1.1-.2.2-.2h3.5c.1 0 .2.1.2.2v2.5h1.5v-2.5c0-1-.8-1.8-1.8-1.8Zm-9 0H5.7c-1 0-1.8.8-1.8 1.8v2.5h7v-2.5c0-1-.8-1.8-1.8-1.8Z" }) }); 4127 4128 // packages/icons/build-module/library/tab-panel.mjs 4129 var import_primitives143 = __toESM(require_primitives(), 1); 4130 var import_jsx_runtime144 = __toESM(require_jsx_runtime(), 1); 4131 var tab_panel_default = /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_primitives143.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime144.jsx)(import_primitives143.Path, { d: "M4 16.5h13V15H4v1.5ZM4 12v1.5h16V12H4Zm1.5-4.2c0-.1.1-.2.2-.2h3.5c.1 0 .2.1.2.2v2.5h1.5V7.8c0-1-.8-1.8-1.8-1.8H5.6c-1 0-1.8.8-1.8 1.8v2.5h1.5V7.8Z" }) }); 4132 4133 // packages/icons/build-module/library/table-column-after.mjs 4134 var import_primitives144 = __toESM(require_primitives(), 1); 4135 var import_jsx_runtime145 = __toESM(require_jsx_runtime(), 1); 4136 var table_column_after_default = /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_primitives144.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime145.jsx)(import_primitives144.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14.2c.1.9.9 1.7 1.8 1.8H19.2c1-.1 1.8-1 1.8-2V5c0-1.1-.9-2-2-2ZM8.5 19.5H5c-.3 0-.5-.2-.5-.5v-3.5h4v4Zm0-5.5h-4v-4h4v4Zm0-5.5h-4V5c0-.3.2-.5.5-.5h3.5v4Zm11 10.5c0 .3-.2.5-.5.5h-9v-15h9c.3 0 .5.2.5.5v14Zm-4-10.8H14v3h-3v1.5h3v3h1.5v-3h3v-1.5h-3v-3Z" }) }); 4137 4138 // packages/icons/build-module/library/table-column-before.mjs 4139 var import_primitives145 = __toESM(require_primitives(), 1); 4140 var import_jsx_runtime146 = __toESM(require_jsx_runtime(), 1); 4141 var table_column_before_default = /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_primitives145.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime146.jsx)(import_primitives145.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1 .8 1.9 1.8 2H19.2c.9-.1 1.7-.9 1.8-1.8V5c0-1.1-.9-2-2-2Zm-5 16.5H5c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h9v15Zm5.5-.5c0 .3-.2.5-.5.5h-3.5v-4h4V19Zm0-5h-4v-4h4v4Zm0-5.5h-4v-4H19c.3 0 .5.2.5.5v3.5Zm-11 7.3H10v-3h3v-1.5h-3v-3H8.5v3h-3v1.5h3v3Z" }) }); 4142 4143 // packages/icons/build-module/library/table-column-delete.mjs 4144 var import_primitives146 = __toESM(require_primitives(), 1); 4145 var import_jsx_runtime147 = __toESM(require_jsx_runtime(), 1); 4146 var table_column_delete_default = /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_primitives146.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime147.jsx)(import_primitives146.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14.2c.1.9.9 1.7 1.8 1.8H19.2c1-.1 1.8-1 1.8-2V5c0-1.1-.9-2-2-2ZM8.5 19.5H5c-.3 0-.5-.2-.5-.5V5c0-.3.2-.5.5-.5h3.5v15Zm11-.5c0 .3-.2.5-.5.5h-9v-15h9c.3 0 .5.2.5.5v14ZM16.9 8.8l-2.1 2.1-2.1-2.1-1.1 1.1 2.1 2.1-2.1 2.1 1.1 1.1 2.1-2.1 2.1 2.1 1.1-1.1-2.1-2.1L18 9.9l-1.1-1.1Z" }) }); 4147 4148 // packages/icons/build-module/library/table-of-contents.mjs 4149 var import_primitives147 = __toESM(require_primitives(), 1); 4150 var import_jsx_runtime148 = __toESM(require_jsx_runtime(), 1); 4151 var table_of_contents_default = /* @__PURE__ */ (0, import_jsx_runtime148.jsxs)(import_primitives147.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 4152 /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_primitives147.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M20 9.484h-8.889v-1.5H20v1.5Zm0 7h-4.889v-1.5H20v1.5Zm-14 .032a1 1 0 1 0 0-2 1 1 0 0 0 0 2Zm0 1a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z" }), 4153 /* @__PURE__ */ (0, import_jsx_runtime148.jsx)(import_primitives147.Path, { d: "M13 15.516a2 2 0 1 1-4 0 2 2 0 0 1 4 0ZM8 8.484a2 2 0 1 1-4 0 2 2 0 0 1 4 0Z" }) 4154 ] }); 4155 4156 // packages/icons/build-module/library/table-row-after.mjs 4157 var import_primitives148 = __toESM(require_primitives(), 1); 4158 var import_jsx_runtime149 = __toESM(require_jsx_runtime(), 1); 4159 var table_row_after_default = /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_primitives148.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime149.jsx)(import_primitives148.Path, { d: "M19 3H4.8c-.9.1-1.7.9-1.8 1.8V19.2c.1 1 1 1.8 2 1.8h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm-9 1.5h4v4h-4v-4ZM4.5 5c0-.3.2-.5.5-.5h3.5v4h-4V5Zm15 14c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-9h15v9Zm0-10.5h-4v-4H19c.3 0 .5.2.5.5v3.5Zm-8.3 10h1.5v-3h3V14h-3v-3h-1.5v3h-3v1.5h3v3Z" }) }); 4160 4161 // packages/icons/build-module/library/table-row-before.mjs 4162 var import_primitives149 = __toESM(require_primitives(), 1); 4163 var import_jsx_runtime150 = __toESM(require_jsx_runtime(), 1); 4164 var table_row_before_default = /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_primitives149.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime150.jsx)(import_primitives149.Path, { d: "M21 5c0-1.1-.9-2-2-2H5c-1 0-1.9.8-2 1.8V19.2c.1.9.9 1.7 1.8 1.8H19c1.1 0 2-.9 2-2V5ZM4.5 14V5c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v9h-15Zm4 5.5H5c-.3 0-.5-.2-.5-.5v-3.5h4v4Zm5.5 0h-4v-4h4v4Zm5.5-.5c0 .3-.2.5-.5.5h-3.5v-4h4V19ZM11.2 10h-3V8.5h3v-3h1.5v3h3V10h-3v3h-1.5v-3Z" }) }); 4165 4166 // packages/icons/build-module/library/table-row-delete.mjs 4167 var import_primitives150 = __toESM(require_primitives(), 1); 4168 var import_jsx_runtime151 = __toESM(require_jsx_runtime(), 1); 4169 var table_row_delete_default = /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_primitives150.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime151.jsx)(import_primitives150.Path, { d: "M19 3H4.8c-.9.1-1.7.9-1.8 1.8V19.2c.1 1 1 1.8 2 1.8h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5v-9h15v9Zm0-10.5h-15V5c0-.3.2-.5.5-.5h14c.3 0 .5.2.5.5v3.5Zm-9.6 9.4 2.1-2.1 2.1 2.1 1.1-1.1-2.1-2.1 2.1-2.1-1.1-1.1-2.1 2.1-2.1-2.1-1.1 1.1 2.1 2.1-2.1 2.1 1.1 1.1Z" }) }); 4170 4171 // packages/icons/build-module/library/table.mjs 4172 var import_primitives151 = __toESM(require_primitives(), 1); 4173 var import_jsx_runtime152 = __toESM(require_jsx_runtime(), 1); 4174 var table_default = /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(import_primitives151.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime152.jsx)(import_primitives151.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2Zm.5 2v6.2h-6.8V4.4h6.2c.3 0 .5.2.5.5ZM5 4.5h6.2v6.8H4.4V5.1c0-.3.2-.5.5-.5ZM4.5 19v-6.2h6.8v6.8H5.1c-.3 0-.5-.2-.5-.5Zm14.5.5h-6.2v-6.8h6.8v6.2c0 .3-.2.5-.5.5Z" }) }); 4175 4176 // packages/icons/build-module/library/tabs.mjs 4177 var import_primitives152 = __toESM(require_primitives(), 1); 4178 var import_jsx_runtime153 = __toESM(require_jsx_runtime(), 1); 4179 var tabs_default = /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_primitives152.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime153.jsx)(import_primitives152.Path, { d: "M4 16.5h13V15H4v1.5Zm0-3h16V12H4v1.5ZM18.2 6h-3.5c-1 0-1.8.8-1.8 1.8v2.5h1.5V7.8c0-.1.1-.2.2-.2h3.5c.1 0 .2.1.2.2v2.5h1.5V7.8c0-1-.8-1.8-1.8-1.8ZM11 7.8c0-1-.8-1.8-1.8-1.8H5.7c-1 0-1.8.8-1.8 1.8v2.5h7V7.8Z" }) }); 4180 4181 // packages/icons/build-module/library/tag.mjs 4182 var import_primitives153 = __toESM(require_primitives(), 1); 4183 var import_jsx_runtime154 = __toESM(require_jsx_runtime(), 1); 4184 var tag_default = /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(import_primitives153.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime154.jsx)(import_primitives153.Path, { d: "M4.75 4a.75.75 0 0 0-.75.75v7.826c0 .2.08.39.22.53l6.72 6.716a2.313 2.313 0 0 0 3.276-.001l5.61-5.611-.531-.53.532.528a2.315 2.315 0 0 0 0-3.264L13.104 4.22a.75.75 0 0 0-.53-.22H4.75ZM19 12.576a.815.815 0 0 1-.236.574l-5.61 5.611a.814.814 0 0 1-1.153 0L5.5 12.264V5.5h6.763l6.5 6.502a.816.816 0 0 1 .237.574ZM8.75 9.75a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z" }) }); 4185 4186 // packages/icons/build-module/library/term-count.mjs 4187 var import_primitives154 = __toESM(require_primitives(), 1); 4188 var import_jsx_runtime155 = __toESM(require_jsx_runtime(), 1); 4189 var term_count_default = /* @__PURE__ */ (0, import_jsx_runtime155.jsxs)(import_primitives154.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 4190 /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(import_primitives154.Path, { d: "M 12.841306,16.677917 12.001264,12.71529 Q 11.835801,11.930402 11.695793,11.417042 11.560029,10.89944 11.398809,10.568514 11.237588,10.237588 11,10 10.635133,9.6351329 10.219354,9.6351329 9.8078183,9.6308902 9.4387086,10 8.9932313,10.445477 8.8574668,11.022476 8.7259449,11.595233 8.7259449,12.155262 L 7.4955791,11.196425 Q 7.5719467,10.509117 7.8307477,9.9109045 8.0937915,9.3084495 8.6410921,8.7611489 9.1799075,8.2223335 9.7569066,8.086569 q 0.5812414,-0.1400071 1.1242994,0.046669 0.543058,0.1866762 0.975808,0.6194255 0.335168,0.3351686 0.581242,0.767918 0.24183,0.4285067 0.436992,1.0564174 0.195161,0.619426 0.381837,1.527351 l 0.364867,1.756453 1.883733,-1.883732 1.018234,1.018233 z" }), 4191 /* @__PURE__ */ (0, import_jsx_runtime155.jsx)(import_primitives154.Path, { d: "M12.574 4a.75.75 0 0 1 .53.22l6.723 6.724a2.315 2.315 0 0 1 0 3.264l-.532-.528.531.53-5.61 5.611a2.31 2.31 0 0 1-3.276.001l-6.72-6.716a.75.75 0 0 1-.22-.53V4.75A.75.75 0 0 1 4.75 4h7.824ZM5.5 5.5v6.764l6.501 6.497a.817.817 0 0 0 .889.178.816.816 0 0 0 .264-.178l5.61-5.61a.816.816 0 0 0-.001-1.149l-6.5-6.502H5.5Z" }) 4192 ] }); 4193 4194 // packages/icons/build-module/library/term-description.mjs 4195 var import_primitives155 = __toESM(require_primitives(), 1); 4196 var import_jsx_runtime156 = __toESM(require_jsx_runtime(), 1); 4197 var term_description_default = /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(import_primitives155.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime156.jsx)(import_primitives155.Path, { d: "M6.08 10.103h2.914L9.657 12h1.417L8.23 4H6.846L4 12h1.417l.663-1.897Zm1.463-4.137.994 2.857h-2l1.006-2.857ZM11 16H4v-1.5h7V16Zm1 0h8v-1.5h-8V16Zm-4 4H4v-1.5h4V20Zm7-1.5V20H9v-1.5h6Z" }) }); 4198 4199 // packages/icons/build-module/library/term-name.mjs 4200 var import_primitives156 = __toESM(require_primitives(), 1); 4201 var import_jsx_runtime157 = __toESM(require_jsx_runtime(), 1); 4202 var term_name_default = /* @__PURE__ */ (0, import_jsx_runtime157.jsxs)(import_primitives156.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: [ 4203 /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_primitives156.Path, { d: "m14.95 13.889-1.061 1.061-5.552-5.553 1.06-1.06 5.552 5.552Z" }), 4204 /* @__PURE__ */ (0, import_jsx_runtime157.jsx)(import_primitives156.Path, { d: "M12.574 4a.75.75 0 0 1 .53.22l6.723 6.724a2.315 2.315 0 0 1 0 3.264l-.532-.528.531.53-5.61 5.611a2.31 2.31 0 0 1-3.276.001l-6.72-6.716a.75.75 0 0 1-.22-.53V4.75A.75.75 0 0 1 4.75 4h7.824ZM5.5 5.5v6.764l6.501 6.497a.817.817 0 0 0 .889.178.816.816 0 0 0 .264-.178l5.61-5.61a.816.816 0 0 0-.001-1.149l-6.5-6.502H5.5Z" }) 4205 ] }); 4206 4207 // packages/icons/build-module/library/time.mjs 4208 var import_primitives157 = __toESM(require_primitives(), 1); 4209 var import_jsx_runtime158 = __toESM(require_jsx_runtime(), 1); 4210 var time_default = /* @__PURE__ */ (0, import_jsx_runtime158.jsxs)(import_primitives157.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 4211 /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(import_primitives157.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }), 4212 /* @__PURE__ */ (0, import_jsx_runtime158.jsx)(import_primitives157.Path, { d: "M15 15L11.75 12.25V8", vectorEffect: "non-scaling-stroke" }) 4213 ] }); 4214 4215 // packages/icons/build-module/library/title.mjs 4216 var import_primitives158 = __toESM(require_primitives(), 1); 4217 var import_jsx_runtime159 = __toESM(require_jsx_runtime(), 1); 4218 var title_default = /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(import_primitives158.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime159.jsx)(import_primitives158.Path, { d: "m4 5.5h2v6.5h1.5v-6.5h2v-1.5h-5.5zm16 10.5h-16v-1.5h16zm-7 4h-9v-1.5h9z" }) }); 4219 4220 // packages/icons/build-module/library/upload.mjs 4221 var import_primitives159 = __toESM(require_primitives(), 1); 4222 var import_jsx_runtime160 = __toESM(require_jsx_runtime(), 1); 4223 var upload_default = /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(import_primitives159.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime160.jsx)(import_primitives159.Path, { d: "M4.75 15V19.25H12M12 19.25V4.5M12 19.25H19.25V15M17.5 10L12 4.5L6.5 10", vectorEffect: "non-scaling-stroke" }) }); 4224 4225 // packages/icons/build-module/library/verse.mjs 4226 var import_primitives160 = __toESM(require_primitives(), 1); 4227 var import_jsx_runtime161 = __toESM(require_jsx_runtime(), 1); 4228 var verse_default = /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(import_primitives160.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime161.jsx)(import_primitives160.Path, { d: "M17.8 2l-.9.3c-.1 0-3.6 1-5.2 2.1C10 5.5 9.3 6.5 8.9 7.1c-.6.9-1.7 4.7-1.7 6.3l-.9 2.3c-.2.4 0 .8.4 1 .1 0 .2.1.3.1.3 0 .6-.2.7-.5l.6-1.5c.3 0 .7-.1 1.2-.2.7-.1 1.4-.3 2.2-.5.8-.2 1.6-.5 2.4-.8.7-.3 1.4-.7 1.9-1.2s.8-1.2 1-1.9c.2-.7.3-1.6.4-2.4.1-.8.1-1.7.2-2.5 0-.8.1-1.5.2-2.1V2zm-1.9 5.6c-.1.8-.2 1.5-.3 2.1-.2.6-.4 1-.6 1.3-.3.3-.8.6-1.4.9-.7.3-1.4.5-2.2.8-.6.2-1.3.3-1.8.4L15 7.5c.3-.3.6-.7 1-1.1 0 .4 0 .8-.1 1.2zM6 20h8v-1.5H6V20z" }) }); 4229 4230 // packages/icons/build-module/library/video.mjs 4231 var import_primitives161 = __toESM(require_primitives(), 1); 4232 var import_jsx_runtime162 = __toESM(require_jsx_runtime(), 1); 4233 var video_default = /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(import_primitives161.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime162.jsx)(import_primitives161.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" }) }); 4234 4235 // packages/icons/build-module/library/word-count.mjs 4236 var import_primitives162 = __toESM(require_primitives(), 1); 4237 var import_jsx_runtime163 = __toESM(require_jsx_runtime(), 1); 4238 var word_count_default = /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_primitives162.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime163.jsx)(import_primitives162.Path, { d: "M19 5c1.1 0 2 .9 2 2v10c0 1.1-.9 2-2 2H5c-1.1 0-2-.9-2-2V7c0-1.1.9-2 2-2zM5 6.5c-.3 0-.5.2-.5.5v10c0 .3.2.5.5.5h14c.3 0 .5-.2.5-.5V7c0-.3-.2-.5-.5-.5zM14.734 9q.714 0 1.15.253.437.247.639.84.2.591.2 1.61v1.15q0 .402.036.667.04.258.172.39.138.127.437.127h.104l-.162.828h-.08q-.5 0-.776-.097a.9.9 0 0 1-.414-.283 2 2 0 0 1-.259-.448q-.316.367-.748.598-.43.23-.977.23-.524 0-.914-.213a1.56 1.56 0 0 1-.61-.58 1.65 1.65 0 0 1-.213-.84q0-.477.207-.817.213-.345.564-.568.357-.23.794-.363.437-.139.902-.196.471-.062.902-.068 0-.805-.315-1.053-.316-.247-.915-.247-.316 0-.678.098-.356.097-.805.408l-.15-.84a2.8 2.8 0 0 1 .846-.419A3.4 3.4 0 0 1 14.734 9m-5.877 1.669H9.86l.59-1.531h.689l-.585 1.53h.898l-.249.727h-.922l-.337.866h1.019l-.354.773h-.962l-.681 1.804h-.701l.69-1.804h-.999l-.693 1.804h-.69l.685-1.804H6.3l.34-.773h.915l.333-.866h-.994l.244-.726H8.16l.594-1.531h.693zm6.832 1.264q-.823.029-1.335.16-.506.133-.74.397-.236.265-.236.685 0 .454.241.66.248.202.632.202.414 0 .8-.207.39-.207.637-.552zm-7.441.328h1l.34-.866h-1z" }) }); 4239 4240 // packages/block-library/build-module/accordion/edit.mjs 4241 var import_block_editor2 = __toESM(require_block_editor(), 1); 4242 var import_i18n = __toESM(require_i18n(), 1); 4243 var import_components = __toESM(require_components(), 1); 4244 var import_data2 = __toESM(require_data(), 1); 4245 var import_blocks = __toESM(require_blocks(), 1); 4246 4247 // packages/block-library/build-module/utils/hooks.mjs 4248 var import_data = __toESM(require_data(), 1); 4249 var import_element2 = __toESM(require_element(), 1); 4250 var import_blob = __toESM(require_blob(), 1); 4251 var import_block_editor = __toESM(require_block_editor(), 1); 4252 var import_core_data = __toESM(require_core_data(), 1); 4253 var import_compose = __toESM(require_compose(), 1); 4254 function useCanEditEntity(kind, name118, recordId) { 4255 return (0, import_data.useSelect)( 4256 (select10) => select10(import_core_data.store).canUser("update", { 4257 kind, 4258 name: name118, 4259 id: recordId 4260 }), 4261 [kind, name118, recordId] 4262 ); 4263 } 4264 function useUploadMediaFromBlobURL(args = {}) { 4265 const latestArgsRef = (0, import_element2.useRef)(args); 4266 const hasUploadStartedRef = (0, import_element2.useRef)(false); 4267 const { getSettings: getSettings2 } = (0, import_data.useSelect)(import_block_editor.store); 4268 (0, import_element2.useLayoutEffect)(() => { 4269 latestArgsRef.current = args; 4270 }); 4271 (0, import_element2.useEffect)(() => { 4272 if (hasUploadStartedRef.current) { 4273 return; 4274 } 4275 if (!latestArgsRef.current.url || !(0, import_blob.isBlobURL)(latestArgsRef.current.url)) { 4276 return; 4277 } 4278 const file = (0, import_blob.getBlobByURL)(latestArgsRef.current.url); 4279 if (!file) { 4280 return; 4281 } 4282 const { url, allowedTypes, onChange, onError } = latestArgsRef.current; 4283 const { mediaUpload } = getSettings2(); 4284 if (!mediaUpload) { 4285 return; 4286 } 4287 hasUploadStartedRef.current = true; 4288 mediaUpload({ 4289 filesList: [file], 4290 allowedTypes, 4291 onFileChange: ([media]) => { 4292 if ((0, import_blob.isBlobURL)(media?.url)) { 4293 return; 4294 } 4295 (0, import_blob.revokeBlobURL)(url); 4296 onChange(media); 4297 hasUploadStartedRef.current = false; 4298 }, 4299 onError: (message) => { 4300 (0, import_blob.revokeBlobURL)(url); 4301 onError(message); 4302 hasUploadStartedRef.current = false; 4303 } 4304 }); 4305 }, [getSettings2]); 4306 } 4307 function useDefaultAvatar() { 4308 const avatarURL = (0, import_data.useSelect)((select10) => { 4309 const { getSettings: getSettings2 } = select10(import_block_editor.store); 4310 const { __experimentalDiscussionSettings } = getSettings2(); 4311 return __experimentalDiscussionSettings?.avatarURL ?? ""; 4312 }, []); 4313 return avatarURL; 4314 } 4315 function useToolsPanelDropdownMenuProps() { 4316 const isMobile = (0, import_compose.useViewportMatch)("medium", "<"); 4317 return !isMobile ? { 4318 popoverProps: { 4319 placement: "left-start", 4320 // For non-mobile, inner sidebar width (248px) - button width (24px) - border (1px) + padding (16px) + spacing (20px) 4321 offset: 259 4322 } 4323 } : {}; 4324 } 4325 4326 // packages/block-library/build-module/accordion/edit.mjs 4327 var import_jsx_runtime164 = __toESM(require_jsx_runtime(), 1); 4328 var ACCORDION_BLOCK_NAME = "core/accordion-item"; 4329 var ACCORDION_HEADING_BLOCK_NAME = "core/accordion-heading"; 4330 var ACCORDION_BLOCK = { 4331 name: ACCORDION_BLOCK_NAME 4332 }; 4333 function Edit({ 4334 attributes: { 4335 autoclose, 4336 iconPosition, 4337 showIcon, 4338 headingLevel, 4339 levelOptions 4340 }, 4341 clientId, 4342 setAttributes, 4343 isSelected: isSingleSelected 4344 }) { 4345 const registry = (0, import_data2.useRegistry)(); 4346 const { getBlockOrder } = (0, import_data2.useSelect)(import_block_editor2.store); 4347 const blockProps = (0, import_block_editor2.useBlockProps)({ 4348 role: "group" 4349 }); 4350 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 4351 const { updateBlockAttributes, insertBlock } = (0, import_data2.useDispatch)(import_block_editor2.store); 4352 const blockEditingMode = (0, import_block_editor2.useBlockEditingMode)(); 4353 const isContentOnlyMode = blockEditingMode === "contentOnly"; 4354 const innerBlocksProps = (0, import_block_editor2.useInnerBlocksProps)(blockProps, { 4355 defaultBlock: ACCORDION_BLOCK, 4356 directInsert: true 4357 }); 4358 const addAccordionItemBlock = () => { 4359 const newAccordionItem = (0, import_blocks.createBlock)(ACCORDION_BLOCK_NAME, {}, [ 4360 (0, import_blocks.createBlock)(ACCORDION_HEADING_BLOCK_NAME, { 4361 level: headingLevel 4362 }), 4363 (0, import_blocks.createBlock)("core/accordion-panel", {}) 4364 ]); 4365 insertBlock(newAccordionItem, void 0, clientId); 4366 }; 4367 const updateHeadingLevel = (newHeadingLevel) => { 4368 const innerBlockClientIds = getBlockOrder(clientId); 4369 const accordionHeaderClientIds = []; 4370 innerBlockClientIds.forEach((contentClientId) => { 4371 const headerClientIds = getBlockOrder(contentClientId); 4372 accordionHeaderClientIds.push(...headerClientIds); 4373 }); 4374 registry.batch(() => { 4375 setAttributes({ headingLevel: newHeadingLevel }); 4376 updateBlockAttributes(accordionHeaderClientIds, { 4377 level: newHeadingLevel 4378 }); 4379 }); 4380 }; 4381 return /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(import_jsx_runtime164.Fragment, { children: [ 4382 isSingleSelected && !isContentOnlyMode && /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)(import_jsx_runtime164.Fragment, { children: [ 4383 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_block_editor2.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_components.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4384 import_block_editor2.HeadingLevelDropdown, 4385 { 4386 value: headingLevel, 4387 options: levelOptions, 4388 onChange: updateHeadingLevel 4389 } 4390 ) }) }), 4391 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_block_editor2.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_components.ToolbarButton, { onClick: addAccordionItemBlock, children: (0, import_i18n.__)("Add item") }) }) 4392 ] }), 4393 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(import_block_editor2.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)( 4394 import_components.__experimentalToolsPanel, 4395 { 4396 label: (0, import_i18n.__)("Settings"), 4397 resetAll: () => { 4398 setAttributes({ 4399 autoclose: false, 4400 showIcon: true, 4401 iconPosition: "right" 4402 }); 4403 }, 4404 dropdownMenuProps, 4405 children: [ 4406 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4407 import_components.__experimentalToolsPanelItem, 4408 { 4409 label: (0, import_i18n.__)("Auto-close"), 4410 isShownByDefault: true, 4411 hasValue: () => !!autoclose, 4412 onDeselect: () => setAttributes({ autoclose: false }), 4413 children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4414 import_components.ToggleControl, 4415 { 4416 label: (0, import_i18n.__)("Auto-close"), 4417 onChange: (value) => { 4418 setAttributes({ 4419 autoclose: value 4420 }); 4421 }, 4422 checked: autoclose, 4423 help: (0, import_i18n.__)( 4424 "Automatically close accordions when a new one is opened." 4425 ) 4426 } 4427 ) 4428 } 4429 ), 4430 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4431 import_components.__experimentalToolsPanelItem, 4432 { 4433 label: (0, import_i18n.__)("Show icon"), 4434 isShownByDefault: true, 4435 hasValue: () => !showIcon, 4436 onDeselect: () => setAttributes({ showIcon: true }), 4437 children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4438 import_components.ToggleControl, 4439 { 4440 label: (0, import_i18n.__)("Show icon"), 4441 onChange: (value) => { 4442 setAttributes({ 4443 showIcon: value, 4444 iconPosition: value ? iconPosition : "right" 4445 }); 4446 }, 4447 checked: showIcon, 4448 help: (0, import_i18n.__)( 4449 "Display a plus icon next to the accordion header." 4450 ) 4451 } 4452 ) 4453 } 4454 ), 4455 showIcon && /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4456 import_components.__experimentalToolsPanelItem, 4457 { 4458 label: (0, import_i18n.__)("Icon Position"), 4459 isShownByDefault: true, 4460 hasValue: () => iconPosition !== "right", 4461 onDeselect: () => setAttributes({ iconPosition: "right" }), 4462 children: /* @__PURE__ */ (0, import_jsx_runtime164.jsxs)( 4463 import_components.__experimentalToggleGroupControl, 4464 { 4465 isBlock: true, 4466 label: (0, import_i18n.__)("Icon Position"), 4467 value: iconPosition, 4468 onChange: (value) => { 4469 setAttributes({ iconPosition: value }); 4470 }, 4471 children: [ 4472 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4473 import_components.__experimentalToggleGroupControlOption, 4474 { 4475 label: (0, import_i18n.__)("Left"), 4476 value: "left" 4477 } 4478 ), 4479 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)( 4480 import_components.__experimentalToggleGroupControlOption, 4481 { 4482 label: (0, import_i18n.__)("Right"), 4483 value: "right" 4484 } 4485 ) 4486 ] 4487 } 4488 ) 4489 } 4490 ) 4491 ] 4492 } 4493 ) }, "setting"), 4494 /* @__PURE__ */ (0, import_jsx_runtime164.jsx)("div", { ...innerBlocksProps }) 4495 ] }); 4496 } 4497 4498 // packages/block-library/build-module/accordion/save.mjs 4499 var import_block_editor3 = __toESM(require_block_editor(), 1); 4500 var import_jsx_runtime165 = __toESM(require_jsx_runtime(), 1); 4501 function save() { 4502 const blockProps = import_block_editor3.useBlockProps.save({ 4503 role: "group" 4504 }); 4505 return /* @__PURE__ */ (0, import_jsx_runtime165.jsx)("div", { ...import_block_editor3.useInnerBlocksProps.save(blockProps) }); 4506 } 4507 4508 // packages/block-library/build-module/accordion/block.json 4509 var block_default = { 4510 $schema: "https://schemas.wp.org/trunk/block.json", 4511 apiVersion: 3, 4512 name: "core/accordion", 4513 title: "Accordion", 4514 category: "design", 4515 description: "Displays a foldable layout that groups content in collapsible sections.", 4516 example: {}, 4517 supports: { 4518 anchor: true, 4519 html: false, 4520 align: ["wide", "full"], 4521 background: { 4522 backgroundImage: true, 4523 backgroundSize: true, 4524 gradient: true, 4525 __experimentalDefaultControls: { 4526 backgroundImage: true 4527 } 4528 }, 4529 color: { 4530 background: true, 4531 gradients: true 4532 }, 4533 __experimentalBorder: { 4534 color: true, 4535 radius: true, 4536 style: true, 4537 width: true, 4538 __experimentalDefaultControls: { 4539 color: true, 4540 radius: true, 4541 style: true, 4542 width: true 4543 } 4544 }, 4545 spacing: { 4546 padding: true, 4547 margin: ["top", "bottom"], 4548 blockGap: true 4549 }, 4550 shadow: true, 4551 layout: true, 4552 ariaLabel: true, 4553 interactivity: true, 4554 typography: { 4555 fontSize: true, 4556 lineHeight: true, 4557 __experimentalFontFamily: true, 4558 __experimentalFontWeight: true, 4559 __experimentalFontStyle: true, 4560 __experimentalTextTransform: true, 4561 __experimentalTextDecoration: true, 4562 __experimentalLetterSpacing: true, 4563 __experimentalDefaultControls: { 4564 fontSize: true 4565 } 4566 }, 4567 contentRole: true, 4568 listView: true 4569 }, 4570 attributes: { 4571 iconPosition: { 4572 type: "string", 4573 default: "right" 4574 }, 4575 showIcon: { 4576 type: "boolean", 4577 default: true 4578 }, 4579 autoclose: { 4580 type: "boolean", 4581 default: false 4582 }, 4583 headingLevel: { 4584 type: "number", 4585 default: 3 4586 }, 4587 levelOptions: { 4588 type: "array" 4589 } 4590 }, 4591 providesContext: { 4592 "core/accordion-icon-position": "iconPosition", 4593 "core/accordion-show-icon": "showIcon", 4594 "core/accordion-heading-level": "headingLevel" 4595 }, 4596 allowedBlocks: ["core/accordion-item"], 4597 textdomain: "default", 4598 viewScriptModule: "@wordpress/block-library/accordion/view" 4599 }; 4600 4601 // packages/block-library/build-module/utils/init-block.mjs 4602 var import_blocks2 = __toESM(require_blocks(), 1); 4603 function initBlock(block) { 4604 if (!block) { 4605 return; 4606 } 4607 const { metadata, settings: settings117, name: name118 } = block; 4608 return (0, import_blocks2.registerBlockType)({ name: name118, ...metadata }, settings117); 4609 } 4610 4611 // packages/block-library/build-module/accordion/index.mjs 4612 var { name } = block_default; 4613 var TEMPLATE = [["core/accordion-item"]]; 4614 var settings = { 4615 icon: accordion_default, 4616 example: { 4617 innerBlocks: [ 4618 { 4619 name: "core/accordion-item", 4620 innerBlocks: [ 4621 { 4622 name: "core/accordion-heading", 4623 attributes: { 4624 title: (0, import_i18n2.__)( 4625 "Lorem ipsum dolor sit amet, consectetur." 4626 ) 4627 } 4628 } 4629 ] 4630 }, 4631 { 4632 name: "core/accordion-item", 4633 innerBlocks: [ 4634 { 4635 name: "core/accordion-heading", 4636 attributes: { 4637 title: (0, import_i18n2.__)( 4638 "Suspendisse commodo lacus, interdum et." 4639 ) 4640 } 4641 } 4642 ] 4643 } 4644 ] 4645 }, 4646 template: TEMPLATE, 4647 templateInsertUpdatesSelection: true, 4648 edit: Edit, 4649 save 4650 }; 4651 var init = () => initBlock({ name, metadata: block_default, settings }); 4652 4653 // packages/block-library/build-module/accordion-item/index.mjs 4654 var accordion_item_exports = {}; 4655 __export(accordion_item_exports, { 4656 init: () => init2, 4657 metadata: () => block_default2, 4658 name: () => name2, 4659 settings: () => settings2 4660 }); 4661 4662 // packages/block-library/build-module/accordion-item/edit.mjs 4663 var import_i18n3 = __toESM(require_i18n(), 1); 4664 var import_block_editor4 = __toESM(require_block_editor(), 1); 4665 var import_data3 = __toESM(require_data(), 1); 4666 var import_components2 = __toESM(require_components(), 1); 4667 var import_jsx_runtime166 = __toESM(require_jsx_runtime(), 1); 4668 function Edit2({ 4669 attributes: attributes2, 4670 clientId, 4671 setAttributes, 4672 isSelected: isSingleSelected 4673 }) { 4674 const { openByDefault } = attributes2; 4675 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 4676 const { isSelected } = (0, import_data3.useSelect)( 4677 (select10) => { 4678 if (isSingleSelected || openByDefault) { 4679 return { isSelected: true }; 4680 } 4681 return { 4682 isSelected: select10(import_block_editor4.store).hasSelectedInnerBlock( 4683 clientId, 4684 true 4685 ) 4686 }; 4687 }, 4688 [clientId, isSingleSelected, openByDefault] 4689 ); 4690 const blockProps = (0, import_block_editor4.useBlockProps)({ 4691 className: clsx_default({ 4692 "is-open": openByDefault || isSelected 4693 }) 4694 }); 4695 const innerBlocksProps = (0, import_block_editor4.useInnerBlocksProps)(blockProps, { 4696 templateLock: "all", 4697 directInsert: true 4698 }); 4699 return /* @__PURE__ */ (0, import_jsx_runtime166.jsxs)(import_jsx_runtime166.Fragment, { children: [ 4700 /* @__PURE__ */ (0, import_jsx_runtime166.jsx)(import_block_editor4.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 4701 import_components2.__experimentalToolsPanel, 4702 { 4703 label: (0, import_i18n3.__)("Settings"), 4704 resetAll: () => { 4705 setAttributes({ openByDefault: false }); 4706 }, 4707 dropdownMenuProps, 4708 children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 4709 import_components2.__experimentalToolsPanelItem, 4710 { 4711 label: (0, import_i18n3.__)("Open by default"), 4712 isShownByDefault: true, 4713 hasValue: () => !!openByDefault, 4714 onDeselect: () => { 4715 setAttributes({ openByDefault: false }); 4716 }, 4717 children: /* @__PURE__ */ (0, import_jsx_runtime166.jsx)( 4718 import_components2.ToggleControl, 4719 { 4720 label: (0, import_i18n3.__)("Open by default"), 4721 onChange: (value) => { 4722 setAttributes({ 4723 openByDefault: value 4724 }); 4725 }, 4726 checked: openByDefault, 4727 help: (0, import_i18n3.__)( 4728 "Accordion content will be displayed by default." 4729 ) 4730 } 4731 ) 4732 } 4733 ) 4734 } 4735 ) }, "setting"), 4736 /* @__PURE__ */ (0, import_jsx_runtime166.jsx)("div", { ...innerBlocksProps }) 4737 ] }); 4738 } 4739 4740 // packages/block-library/build-module/accordion-item/save.mjs 4741 var import_block_editor5 = __toESM(require_block_editor(), 1); 4742 var import_jsx_runtime167 = __toESM(require_jsx_runtime(), 1); 4743 function save2({ attributes: attributes2 }) { 4744 const { openByDefault } = attributes2; 4745 const blockProps = import_block_editor5.useBlockProps.save({ 4746 className: clsx_default({ 4747 "is-open": openByDefault 4748 }) 4749 }); 4750 const innerBlocksProps = import_block_editor5.useInnerBlocksProps.save(blockProps); 4751 return /* @__PURE__ */ (0, import_jsx_runtime167.jsx)("div", { ...innerBlocksProps }); 4752 } 4753 4754 // packages/block-library/build-module/accordion-item/block.json 4755 var block_default2 = { 4756 $schema: "https://schemas.wp.org/trunk/block.json", 4757 apiVersion: 3, 4758 name: "core/accordion-item", 4759 title: "Accordion Item", 4760 category: "design", 4761 description: "Wraps the heading and panel in one unit.", 4762 parent: ["core/accordion"], 4763 allowedBlocks: ["core/accordion-heading", "core/accordion-panel"], 4764 supports: { 4765 html: false, 4766 color: { 4767 background: true, 4768 gradients: true 4769 }, 4770 interactivity: true, 4771 spacing: { 4772 margin: ["top", "bottom"], 4773 padding: true, 4774 blockGap: true 4775 }, 4776 __experimentalBorder: { 4777 color: true, 4778 radius: true, 4779 style: true, 4780 width: true, 4781 __experimentalDefaultControls: { 4782 color: true, 4783 radius: true, 4784 style: true, 4785 width: true 4786 } 4787 }, 4788 shadow: true, 4789 layout: { 4790 allowEditing: false 4791 }, 4792 typography: { 4793 fontSize: true, 4794 lineHeight: true, 4795 __experimentalFontFamily: true, 4796 __experimentalFontWeight: true, 4797 __experimentalFontStyle: true, 4798 __experimentalTextTransform: true, 4799 __experimentalTextDecoration: true, 4800 __experimentalLetterSpacing: true, 4801 __experimentalDefaultControls: { 4802 fontSize: true 4803 } 4804 }, 4805 contentRole: true 4806 }, 4807 attributes: { 4808 openByDefault: { 4809 type: "boolean", 4810 default: false 4811 } 4812 }, 4813 providesContext: { 4814 "core/accordion-open-by-default": "openByDefault" 4815 }, 4816 textdomain: "default", 4817 style: "wp-block-accordion-item" 4818 }; 4819 4820 // packages/block-library/build-module/accordion-item/index.mjs 4821 var { name: name2 } = block_default2; 4822 var TEMPLATE2 = [["core/accordion-heading"], ["core/accordion-panel"]]; 4823 var settings2 = { 4824 icon: accordion_item_default, 4825 template: TEMPLATE2, 4826 templateInsertUpdatesSelection: true, 4827 edit: Edit2, 4828 save: save2 4829 }; 4830 var init2 = () => initBlock({ name: name2, metadata: block_default2, settings: settings2 }); 4831 4832 // packages/block-library/build-module/accordion-heading/index.mjs 4833 var accordion_heading_exports = {}; 4834 __export(accordion_heading_exports, { 4835 init: () => init3, 4836 metadata: () => block_default3, 4837 name: () => name3, 4838 settings: () => settings3 4839 }); 4840 4841 // packages/block-library/build-module/accordion-heading/edit.mjs 4842 var import_i18n4 = __toESM(require_i18n(), 1); 4843 var import_element3 = __toESM(require_element(), 1); 4844 var import_block_editor6 = __toESM(require_block_editor(), 1); 4845 var import_data4 = __toESM(require_data(), 1); 4846 var import_jsx_runtime168 = __toESM(require_jsx_runtime(), 1); 4847 function Edit3({ attributes: attributes2, setAttributes, context }) { 4848 const { title } = attributes2; 4849 const { 4850 "core/accordion-icon-position": iconPosition, 4851 "core/accordion-show-icon": showIcon, 4852 "core/accordion-heading-level": headingLevel 4853 } = context; 4854 const TagName2 = "h" + headingLevel; 4855 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data4.useDispatch)(import_block_editor6.store); 4856 (0, import_element3.useEffect)(() => { 4857 if (iconPosition !== void 0 && showIcon !== void 0) { 4858 __unstableMarkNextChangeAsNotPersistent(); 4859 setAttributes({ 4860 iconPosition, 4861 showIcon 4862 }); 4863 } 4864 }, [ 4865 iconPosition, 4866 showIcon, 4867 setAttributes, 4868 __unstableMarkNextChangeAsNotPersistent 4869 ]); 4870 const [fluidTypographySettings, layout] = (0, import_block_editor6.useSettings)( 4871 "typography.fluid", 4872 "layout" 4873 ); 4874 const typographyProps = (0, import_block_editor6.getTypographyClassesAndStyles)(attributes2, { 4875 typography: { 4876 fluid: fluidTypographySettings 4877 }, 4878 layout: { 4879 wideSize: layout?.wideSize 4880 } 4881 }); 4882 const blockProps = (0, import_block_editor6.useBlockProps)({ 4883 className: clsx_default({ 4884 "has-icon": showIcon, 4885 "has-icon-left": showIcon && iconPosition === "left", 4886 "has-icon-right": showIcon && iconPosition === "right" 4887 }) 4888 }); 4889 const spacingProps = (0, import_block_editor6.__experimentalGetSpacingClassesAndStyles)(attributes2); 4890 return /* @__PURE__ */ (0, import_jsx_runtime168.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime168.jsxs)( 4891 "button", 4892 { 4893 className: "wp-block-accordion-heading__toggle", 4894 style: spacingProps.style, 4895 tabIndex: "-1", 4896 children: [ 4897 showIcon && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)( 4898 "span", 4899 { 4900 className: "wp-block-accordion-heading__toggle-icon", 4901 "aria-hidden": "true", 4902 children: "+" 4903 } 4904 ), 4905 /* @__PURE__ */ (0, import_jsx_runtime168.jsx)( 4906 import_block_editor6.RichText, 4907 { 4908 withoutInteractiveFormatting: true, 4909 disableLineBreaks: true, 4910 tagName: "span", 4911 value: title, 4912 onChange: (newTitle) => setAttributes({ title: newTitle }), 4913 placeholder: (0, import_i18n4.__)("Accordion title"), 4914 className: "wp-block-accordion-heading__toggle-title", 4915 style: { 4916 letterSpacing: typographyProps.style.letterSpacing, 4917 textDecoration: typographyProps.style.textDecoration 4918 } 4919 } 4920 ), 4921 showIcon && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime168.jsx)( 4922 "span", 4923 { 4924 className: "wp-block-accordion-heading__toggle-icon", 4925 "aria-hidden": "true", 4926 children: "+" 4927 } 4928 ) 4929 ] 4930 } 4931 ) }); 4932 } 4933 4934 // packages/block-library/build-module/accordion-heading/save.mjs 4935 var import_block_editor7 = __toESM(require_block_editor(), 1); 4936 var import_jsx_runtime169 = __toESM(require_jsx_runtime(), 1); 4937 function save3({ attributes: attributes2 }) { 4938 const { level, title, iconPosition, showIcon } = attributes2; 4939 const TagName2 = "h" + (level || 3); 4940 const typographyProps = (0, import_block_editor7.getTypographyClassesAndStyles)(attributes2); 4941 const blockProps = import_block_editor7.useBlockProps.save({ 4942 className: clsx_default({ 4943 "has-icon": showIcon, 4944 "has-icon-left": showIcon && iconPosition === "left", 4945 "has-icon-right": showIcon && iconPosition === "right" 4946 }) 4947 }); 4948 const spacingProps = (0, import_block_editor7.__experimentalGetSpacingClassesAndStyles)(attributes2); 4949 return /* @__PURE__ */ (0, import_jsx_runtime169.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime169.jsxs)( 4950 "button", 4951 { 4952 type: "button", 4953 className: "wp-block-accordion-heading__toggle", 4954 style: spacingProps.style, 4955 children: [ 4956 showIcon && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( 4957 "span", 4958 { 4959 className: "wp-block-accordion-heading__toggle-icon", 4960 "aria-hidden": "true", 4961 children: "+" 4962 } 4963 ), 4964 /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( 4965 import_block_editor7.RichText.Content, 4966 { 4967 className: "wp-block-accordion-heading__toggle-title", 4968 tagName: "span", 4969 value: title, 4970 style: { 4971 letterSpacing: typographyProps.style.letterSpacing, 4972 textDecoration: typographyProps.style.textDecoration 4973 } 4974 } 4975 ), 4976 showIcon && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime169.jsx)( 4977 "span", 4978 { 4979 className: "wp-block-accordion-heading__toggle-icon", 4980 "aria-hidden": "true", 4981 children: "+" 4982 } 4983 ) 4984 ] 4985 } 4986 ) }); 4987 } 4988 4989 // packages/block-library/build-module/accordion-heading/block.json 4990 var block_default3 = { 4991 $schema: "https://schemas.wp.org/trunk/block.json", 4992 apiVersion: 3, 4993 name: "core/accordion-heading", 4994 title: "Accordion Heading", 4995 category: "design", 4996 description: "Displays a heading that toggles the accordion panel.", 4997 parent: ["core/accordion-item"], 4998 usesContext: [ 4999 "core/accordion-icon-position", 5000 "core/accordion-show-icon", 5001 "core/accordion-heading-level" 5002 ], 5003 supports: { 5004 anchor: true, 5005 color: { 5006 background: true, 5007 gradients: true 5008 }, 5009 align: false, 5010 interactivity: true, 5011 spacing: { 5012 padding: true, 5013 __experimentalDefaultControls: { 5014 padding: true 5015 }, 5016 __experimentalSkipSerialization: true, 5017 __experimentalSelector: ".wp-block-accordion-heading__toggle" 5018 }, 5019 __experimentalBorder: { 5020 color: true, 5021 radius: true, 5022 style: true, 5023 width: true, 5024 __experimentalDefaultControls: { 5025 color: true, 5026 radius: true, 5027 style: true, 5028 width: true 5029 } 5030 }, 5031 typography: { 5032 __experimentalSkipSerialization: [ 5033 "textDecoration", 5034 "letterSpacing" 5035 ], 5036 fontSize: true, 5037 __experimentalFontFamily: true, 5038 __experimentalFontWeight: true, 5039 __experimentalFontStyle: true, 5040 __experimentalTextTransform: true, 5041 __experimentalTextDecoration: true, 5042 __experimentalLetterSpacing: true, 5043 __experimentalDefaultControls: { 5044 fontSize: true, 5045 fontFamily: true 5046 } 5047 }, 5048 shadow: true, 5049 visibility: false, 5050 lock: false 5051 }, 5052 selectors: { 5053 spacing: ".wp-block-accordion-heading .wp-block-accordion-heading__toggle", 5054 typography: { 5055 letterSpacing: ".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title", 5056 textDecoration: ".wp-block-accordion-heading .wp-block-accordion-heading__toggle-title" 5057 } 5058 }, 5059 attributes: { 5060 openByDefault: { 5061 type: "boolean", 5062 default: false 5063 }, 5064 title: { 5065 type: "rich-text", 5066 source: "rich-text", 5067 selector: ".wp-block-accordion-heading__toggle-title", 5068 role: "content" 5069 }, 5070 level: { 5071 type: "number" 5072 }, 5073 iconPosition: { 5074 type: "string", 5075 enum: ["left", "right"], 5076 default: "right" 5077 }, 5078 showIcon: { 5079 type: "boolean", 5080 default: true 5081 } 5082 }, 5083 textdomain: "default" 5084 }; 5085 5086 // packages/block-library/build-module/accordion-heading/deprecated.mjs 5087 var import_block_editor8 = __toESM(require_block_editor(), 1); 5088 var import_jsx_runtime170 = __toESM(require_jsx_runtime(), 1); 5089 var v1 = { 5090 attributes: { 5091 openByDefault: { 5092 type: "boolean", 5093 default: false 5094 }, 5095 title: { 5096 type: "rich-text", 5097 source: "rich-text", 5098 selector: ".wp-block-accordion-heading__toggle-title", 5099 role: "content" 5100 }, 5101 level: { 5102 type: "number" 5103 }, 5104 iconPosition: { 5105 type: "string", 5106 enum: ["left", "right"], 5107 default: "right" 5108 }, 5109 showIcon: { 5110 type: "boolean", 5111 default: true 5112 } 5113 }, 5114 supports: { 5115 anchor: true, 5116 color: { 5117 background: true, 5118 gradients: true 5119 }, 5120 align: false, 5121 interactivity: true, 5122 spacing: { 5123 padding: true, 5124 __experimentalDefaultControls: { 5125 padding: true 5126 }, 5127 __experimentalSkipSerialization: true, 5128 __experimentalSelector: ".wp-block-accordion-heading__toggle" 5129 }, 5130 __experimentalBorder: { 5131 color: true, 5132 radius: true, 5133 style: true, 5134 width: true, 5135 __experimentalDefaultControls: { 5136 color: true, 5137 radius: true, 5138 style: true, 5139 width: true 5140 } 5141 }, 5142 typography: { 5143 fontSize: true, 5144 __experimentalFontFamily: true, 5145 __experimentalFontWeight: true, 5146 __experimentalFontStyle: true, 5147 __experimentalTextTransform: true, 5148 __experimentalTextDecoration: true, 5149 __experimentalLetterSpacing: true, 5150 __experimentalDefaultControls: { 5151 fontSize: true, 5152 fontFamily: true 5153 } 5154 }, 5155 shadow: true, 5156 visibility: false 5157 }, 5158 save({ attributes: attributes2 }) { 5159 const { level, title, iconPosition, showIcon } = attributes2; 5160 const TagName2 = "h" + (level || 3); 5161 const blockProps = import_block_editor8.useBlockProps.save(); 5162 const spacingProps = (0, import_block_editor8.__experimentalGetSpacingClassesAndStyles)(attributes2); 5163 return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)( 5164 "button", 5165 { 5166 className: "wp-block-accordion-heading__toggle", 5167 style: spacingProps.style, 5168 children: [ 5169 showIcon && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5170 "span", 5171 { 5172 className: "wp-block-accordion-heading__toggle-icon", 5173 "aria-hidden": "true", 5174 children: "+" 5175 } 5176 ), 5177 /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5178 import_block_editor8.RichText.Content, 5179 { 5180 className: "wp-block-accordion-heading__toggle-title", 5181 tagName: "span", 5182 value: title 5183 } 5184 ), 5185 showIcon && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5186 "span", 5187 { 5188 className: "wp-block-accordion-heading__toggle-icon", 5189 "aria-hidden": "true", 5190 children: "+" 5191 } 5192 ) 5193 ] 5194 } 5195 ) }); 5196 } 5197 }; 5198 var v2 = { 5199 attributes: { 5200 openByDefault: { 5201 type: "boolean", 5202 default: false 5203 }, 5204 title: { 5205 type: "rich-text", 5206 source: "rich-text", 5207 selector: ".wp-block-accordion-heading__toggle-title", 5208 role: "content" 5209 }, 5210 level: { 5211 type: "number" 5212 }, 5213 iconPosition: { 5214 type: "string", 5215 enum: ["left", "right"], 5216 default: "right" 5217 }, 5218 showIcon: { 5219 type: "boolean", 5220 default: true 5221 } 5222 }, 5223 supports: { 5224 anchor: true, 5225 color: { 5226 background: true, 5227 gradients: true 5228 }, 5229 align: false, 5230 interactivity: true, 5231 spacing: { 5232 padding: true, 5233 __experimentalDefaultControls: { 5234 padding: true 5235 }, 5236 __experimentalSkipSerialization: true, 5237 __experimentalSelector: ".wp-block-accordion-heading__toggle" 5238 }, 5239 __experimentalBorder: { 5240 color: true, 5241 radius: true, 5242 style: true, 5243 width: true, 5244 __experimentalDefaultControls: { 5245 color: true, 5246 radius: true, 5247 style: true, 5248 width: true 5249 } 5250 }, 5251 typography: { 5252 __experimentalSkipSerialization: [ 5253 "textDecoration", 5254 "letterSpacing" 5255 ], 5256 fontSize: true, 5257 __experimentalFontFamily: true, 5258 __experimentalFontWeight: true, 5259 __experimentalFontStyle: true, 5260 __experimentalTextTransform: true, 5261 __experimentalTextDecoration: true, 5262 __experimentalLetterSpacing: true, 5263 __experimentalDefaultControls: { 5264 fontSize: true, 5265 fontFamily: true 5266 } 5267 }, 5268 shadow: true, 5269 visibility: false, 5270 lock: false 5271 }, 5272 save({ attributes: attributes2 }) { 5273 const { level, title, iconPosition, showIcon } = attributes2; 5274 const TagName2 = "h" + (level || 3); 5275 const typographyProps = (0, import_block_editor8.getTypographyClassesAndStyles)(attributes2); 5276 const blockProps = import_block_editor8.useBlockProps.save(); 5277 const spacingProps = (0, import_block_editor8.__experimentalGetSpacingClassesAndStyles)(attributes2); 5278 return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)( 5279 "button", 5280 { 5281 className: "wp-block-accordion-heading__toggle", 5282 style: spacingProps.style, 5283 children: [ 5284 showIcon && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5285 "span", 5286 { 5287 className: "wp-block-accordion-heading__toggle-icon", 5288 "aria-hidden": "true", 5289 children: "+" 5290 } 5291 ), 5292 /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5293 import_block_editor8.RichText.Content, 5294 { 5295 className: "wp-block-accordion-heading__toggle-title", 5296 tagName: "span", 5297 value: title, 5298 style: { 5299 letterSpacing: typographyProps.style.letterSpacing, 5300 textDecoration: typographyProps.style.textDecoration 5301 } 5302 } 5303 ), 5304 showIcon && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5305 "span", 5306 { 5307 className: "wp-block-accordion-heading__toggle-icon", 5308 "aria-hidden": "true", 5309 children: "+" 5310 } 5311 ) 5312 ] 5313 } 5314 ) }); 5315 } 5316 }; 5317 var v3 = { 5318 attributes: { 5319 openByDefault: { 5320 type: "boolean", 5321 default: false 5322 }, 5323 title: { 5324 type: "rich-text", 5325 source: "rich-text", 5326 selector: ".wp-block-accordion-heading__toggle-title", 5327 role: "content" 5328 }, 5329 level: { 5330 type: "number" 5331 }, 5332 iconPosition: { 5333 type: "string", 5334 enum: ["left", "right"], 5335 default: "right" 5336 }, 5337 showIcon: { 5338 type: "boolean", 5339 default: true 5340 } 5341 }, 5342 supports: { 5343 anchor: true, 5344 color: { 5345 background: true, 5346 gradients: true 5347 }, 5348 align: false, 5349 interactivity: true, 5350 spacing: { 5351 padding: true, 5352 __experimentalDefaultControls: { 5353 padding: true 5354 }, 5355 __experimentalSkipSerialization: true, 5356 __experimentalSelector: ".wp-block-accordion-heading__toggle" 5357 }, 5358 __experimentalBorder: { 5359 color: true, 5360 radius: true, 5361 style: true, 5362 width: true, 5363 __experimentalDefaultControls: { 5364 color: true, 5365 radius: true, 5366 style: true, 5367 width: true 5368 } 5369 }, 5370 typography: { 5371 __experimentalSkipSerialization: [ 5372 "textDecoration", 5373 "letterSpacing" 5374 ], 5375 fontSize: true, 5376 __experimentalFontFamily: true, 5377 __experimentalFontWeight: true, 5378 __experimentalFontStyle: true, 5379 __experimentalTextTransform: true, 5380 __experimentalTextDecoration: true, 5381 __experimentalLetterSpacing: true, 5382 __experimentalDefaultControls: { 5383 fontSize: true, 5384 fontFamily: true 5385 } 5386 }, 5387 shadow: true, 5388 visibility: false, 5389 lock: false 5390 }, 5391 save({ attributes: attributes2 }) { 5392 const { level, title, iconPosition, showIcon } = attributes2; 5393 const TagName2 = "h" + (level || 3); 5394 const typographyProps = (0, import_block_editor8.getTypographyClassesAndStyles)(attributes2); 5395 const blockProps = import_block_editor8.useBlockProps.save(); 5396 const spacingProps = (0, import_block_editor8.__experimentalGetSpacingClassesAndStyles)(attributes2); 5397 return /* @__PURE__ */ (0, import_jsx_runtime170.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime170.jsxs)( 5398 "button", 5399 { 5400 type: "button", 5401 className: "wp-block-accordion-heading__toggle", 5402 style: spacingProps.style, 5403 children: [ 5404 showIcon && iconPosition === "left" && /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5405 "span", 5406 { 5407 className: "wp-block-accordion-heading__toggle-icon", 5408 "aria-hidden": "true", 5409 children: "+" 5410 } 5411 ), 5412 /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5413 import_block_editor8.RichText.Content, 5414 { 5415 className: "wp-block-accordion-heading__toggle-title", 5416 tagName: "span", 5417 value: title, 5418 style: { 5419 letterSpacing: typographyProps.style.letterSpacing, 5420 textDecoration: typographyProps.style.textDecoration 5421 } 5422 } 5423 ), 5424 showIcon && iconPosition === "right" && /* @__PURE__ */ (0, import_jsx_runtime170.jsx)( 5425 "span", 5426 { 5427 className: "wp-block-accordion-heading__toggle-icon", 5428 "aria-hidden": "true", 5429 children: "+" 5430 } 5431 ) 5432 ] 5433 } 5434 ) }); 5435 } 5436 }; 5437 var deprecated_default = [v3, v2, v1]; 5438 5439 // packages/block-library/build-module/accordion-heading/index.mjs 5440 var { name: name3 } = block_default3; 5441 var settings3 = { 5442 icon: accordion_heading_default, 5443 edit: Edit3, 5444 save: save3, 5445 deprecated: deprecated_default 5446 }; 5447 var init3 = () => initBlock({ name: name3, metadata: block_default3, settings: settings3 }); 5448 5449 // packages/block-library/build-module/accordion-panel/index.mjs 5450 var accordion_panel_exports = {}; 5451 __export(accordion_panel_exports, { 5452 init: () => init4, 5453 metadata: () => block_default4, 5454 name: () => name4, 5455 settings: () => settings4 5456 }); 5457 5458 // packages/block-library/build-module/accordion-panel/edit.mjs 5459 var import_block_editor9 = __toESM(require_block_editor(), 1); 5460 var import_data5 = __toESM(require_data(), 1); 5461 var import_jsx_runtime171 = __toESM(require_jsx_runtime(), 1); 5462 function Edit4({ attributes: attributes2, context, clientId, isSelected }) { 5463 const { allowedBlocks, templateLock } = attributes2; 5464 const openByDefault = context["core/accordion-open-by-default"]; 5465 const { hasSelection } = (0, import_data5.useSelect)( 5466 (select10) => { 5467 if (isSelected || openByDefault) { 5468 return { hasSelection: true }; 5469 } 5470 const { 5471 getBlockRootClientId, 5472 isBlockSelected, 5473 hasSelectedInnerBlock 5474 } = select10(import_block_editor9.store); 5475 const rootClientId = getBlockRootClientId(clientId); 5476 return { 5477 hasSelection: isBlockSelected(rootClientId) || hasSelectedInnerBlock(rootClientId, true) 5478 }; 5479 }, 5480 [clientId, isSelected, openByDefault] 5481 ); 5482 const blockProps = (0, import_block_editor9.useBlockProps)({ 5483 hidden: !hasSelection, 5484 role: "region" 5485 }); 5486 const innerBlocksProps = (0, import_block_editor9.useInnerBlocksProps)(blockProps, { 5487 allowedBlocks, 5488 templateLock 5489 }); 5490 return /* @__PURE__ */ (0, import_jsx_runtime171.jsx)("div", { ...innerBlocksProps }); 5491 } 5492 5493 // packages/block-library/build-module/accordion-panel/save.mjs 5494 var import_block_editor10 = __toESM(require_block_editor(), 1); 5495 var import_jsx_runtime172 = __toESM(require_jsx_runtime(), 1); 5496 function save4() { 5497 const blockProps = import_block_editor10.useBlockProps.save({ 5498 role: "region" 5499 }); 5500 const innerBlocksProps = import_block_editor10.useInnerBlocksProps.save(blockProps); 5501 return /* @__PURE__ */ (0, import_jsx_runtime172.jsx)("div", { ...innerBlocksProps }); 5502 } 5503 5504 // packages/block-library/build-module/accordion-panel/block.json 5505 var block_default4 = { 5506 $schema: "https://schemas.wp.org/trunk/block.json", 5507 apiVersion: 3, 5508 name: "core/accordion-panel", 5509 title: "Accordion Panel", 5510 category: "design", 5511 description: "Contains the hidden or revealed content beneath the heading.", 5512 parent: ["core/accordion-item"], 5513 usesContext: ["core/accordion-open-by-default"], 5514 supports: { 5515 __experimentalOnEnter: true, 5516 html: false, 5517 color: { 5518 background: true, 5519 gradients: true 5520 }, 5521 interactivity: true, 5522 spacing: { 5523 padding: true, 5524 blockGap: true, 5525 __experimentalDefaultControls: { 5526 padding: true, 5527 blockGap: true 5528 } 5529 }, 5530 __experimentalBorder: { 5531 color: true, 5532 radius: true, 5533 style: true, 5534 width: true, 5535 __experimentalDefaultControls: { 5536 color: true, 5537 radius: true, 5538 style: true, 5539 width: true 5540 } 5541 }, 5542 typography: { 5543 fontSize: true, 5544 lineHeight: true, 5545 __experimentalFontFamily: true, 5546 __experimentalFontWeight: true, 5547 __experimentalFontStyle: true, 5548 __experimentalTextTransform: true, 5549 __experimentalTextDecoration: true, 5550 __experimentalLetterSpacing: true, 5551 __experimentalDefaultControls: { 5552 fontSize: true 5553 } 5554 }, 5555 shadow: true, 5556 layout: { 5557 allowEditing: false 5558 }, 5559 visibility: false, 5560 contentRole: true, 5561 allowedBlocks: true, 5562 lock: false 5563 }, 5564 attributes: { 5565 templateLock: { 5566 type: ["string", "boolean"], 5567 enum: ["all", "insert", "contentOnly", false], 5568 default: false 5569 } 5570 }, 5571 textdomain: "default", 5572 style: "wp-block-accordion-panel" 5573 }; 5574 5575 // packages/block-library/build-module/accordion-panel/index.mjs 5576 var { name: name4 } = block_default4; 5577 var TEMPLATE3 = [["core/paragraph", {}]]; 5578 var settings4 = { 5579 icon: contents_default, 5580 template: TEMPLATE3, 5581 edit: Edit4, 5582 save: save4 5583 }; 5584 var init4 = () => initBlock({ name: name4, metadata: block_default4, settings: settings4 }); 5585 5586 // packages/block-library/build-module/archives/index.mjs 5587 var archives_exports = {}; 5588 __export(archives_exports, { 5589 init: () => init5, 5590 metadata: () => block_default5, 5591 name: () => name5, 5592 settings: () => settings5 5593 }); 5594 5595 // packages/block-library/build-module/archives/block.json 5596 var block_default5 = { 5597 $schema: "https://schemas.wp.org/trunk/block.json", 5598 apiVersion: 3, 5599 name: "core/archives", 5600 title: "Archives", 5601 category: "widgets", 5602 description: "Display a date archive of your posts.", 5603 textdomain: "default", 5604 attributes: { 5605 displayAsDropdown: { 5606 type: "boolean", 5607 default: false 5608 }, 5609 showLabel: { 5610 type: "boolean", 5611 default: true 5612 }, 5613 showPostCounts: { 5614 type: "boolean", 5615 default: false 5616 }, 5617 type: { 5618 type: "string", 5619 default: "monthly" 5620 } 5621 }, 5622 supports: { 5623 anchor: true, 5624 align: true, 5625 __experimentalBorder: { 5626 radius: true, 5627 color: true, 5628 width: true, 5629 style: true 5630 }, 5631 html: false, 5632 spacing: { 5633 margin: true, 5634 padding: true, 5635 __experimentalDefaultControls: { 5636 margin: false, 5637 padding: false 5638 } 5639 }, 5640 typography: { 5641 fontSize: true, 5642 lineHeight: true, 5643 __experimentalFontFamily: true, 5644 __experimentalFontWeight: true, 5645 __experimentalFontStyle: true, 5646 __experimentalTextTransform: true, 5647 __experimentalTextDecoration: true, 5648 __experimentalLetterSpacing: true, 5649 __experimentalDefaultControls: { 5650 fontSize: true 5651 } 5652 }, 5653 color: { 5654 gradients: true, 5655 link: true, 5656 __experimentalDefaultControls: { 5657 background: true, 5658 text: true, 5659 link: true 5660 } 5661 }, 5662 interactivity: { 5663 clientNavigation: true 5664 } 5665 } 5666 }; 5667 5668 // packages/block-library/build-module/archives/edit.mjs 5669 var import_components3 = __toESM(require_components(), 1); 5670 var import_i18n5 = __toESM(require_i18n(), 1); 5671 var import_block_editor11 = __toESM(require_block_editor(), 1); 5672 var import_server_side_render = __toESM(require_server_side_render(), 1); 5673 var import_compose2 = __toESM(require_compose(), 1); 5674 var import_jsx_runtime173 = __toESM(require_jsx_runtime(), 1); 5675 function ArchivesEdit({ attributes: attributes2, setAttributes, name: name118 }) { 5676 const { showLabel, showPostCounts, displayAsDropdown, type } = attributes2; 5677 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 5678 const { content, status, error: error2 } = (0, import_server_side_render.useServerSideRender)({ 5679 attributes: attributes2, 5680 skipBlockSupportAttributes: true, 5681 block: name118 5682 }); 5683 const disabledRef = (0, import_compose2.useDisabled)(); 5684 const blockProps = (0, import_block_editor11.useBlockProps)({ ref: disabledRef }); 5685 return /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)(import_jsx_runtime173.Fragment, { children: [ 5686 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_block_editor11.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime173.jsxs)( 5687 import_components3.__experimentalToolsPanel, 5688 { 5689 label: (0, import_i18n5.__)("Settings"), 5690 resetAll: () => { 5691 setAttributes({ 5692 displayAsDropdown: false, 5693 showLabel: true, 5694 showPostCounts: false, 5695 type: "monthly" 5696 }); 5697 }, 5698 dropdownMenuProps, 5699 children: [ 5700 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 5701 import_components3.__experimentalToolsPanelItem, 5702 { 5703 label: (0, import_i18n5.__)("Display as dropdown"), 5704 isShownByDefault: true, 5705 hasValue: () => displayAsDropdown, 5706 onDeselect: () => setAttributes({ displayAsDropdown: false }), 5707 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 5708 import_components3.ToggleControl, 5709 { 5710 label: (0, import_i18n5.__)("Display as dropdown"), 5711 checked: displayAsDropdown, 5712 onChange: () => setAttributes({ 5713 displayAsDropdown: !displayAsDropdown 5714 }) 5715 } 5716 ) 5717 } 5718 ), 5719 displayAsDropdown && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 5720 import_components3.__experimentalToolsPanelItem, 5721 { 5722 label: (0, import_i18n5.__)("Show label"), 5723 isShownByDefault: true, 5724 hasValue: () => !showLabel, 5725 onDeselect: () => setAttributes({ showLabel: true }), 5726 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 5727 import_components3.ToggleControl, 5728 { 5729 label: (0, import_i18n5.__)("Show label"), 5730 checked: showLabel, 5731 onChange: () => setAttributes({ 5732 showLabel: !showLabel 5733 }) 5734 } 5735 ) 5736 } 5737 ), 5738 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 5739 import_components3.__experimentalToolsPanelItem, 5740 { 5741 label: (0, import_i18n5.__)("Show post counts"), 5742 isShownByDefault: true, 5743 hasValue: () => showPostCounts, 5744 onDeselect: () => setAttributes({ showPostCounts: false }), 5745 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 5746 import_components3.ToggleControl, 5747 { 5748 label: (0, import_i18n5.__)("Show post counts"), 5749 checked: showPostCounts, 5750 onChange: () => setAttributes({ 5751 showPostCounts: !showPostCounts 5752 }) 5753 } 5754 ) 5755 } 5756 ), 5757 /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 5758 import_components3.__experimentalToolsPanelItem, 5759 { 5760 label: (0, import_i18n5.__)("Group by"), 5761 isShownByDefault: true, 5762 hasValue: () => type !== "monthly", 5763 onDeselect: () => setAttributes({ type: "monthly" }), 5764 children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)( 5765 import_components3.SelectControl, 5766 { 5767 label: (0, import_i18n5.__)("Group by"), 5768 options: [ 5769 { label: (0, import_i18n5.__)("Year"), value: "yearly" }, 5770 { label: (0, import_i18n5.__)("Month"), value: "monthly" }, 5771 { label: (0, import_i18n5.__)("Week"), value: "weekly" }, 5772 { label: (0, import_i18n5.__)("Day"), value: "daily" } 5773 ], 5774 value: type, 5775 onChange: (value) => setAttributes({ type: value }) 5776 } 5777 ) 5778 } 5779 ) 5780 ] 5781 } 5782 ) }), 5783 status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(import_components3.Spinner, {}) }), 5784 status === "error" && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime173.jsx)("p", { children: (0, import_i18n5.sprintf)( 5785 /* translators: %s: error message returned when rendering the block. */ 5786 (0, import_i18n5.__)("Error: %s"), 5787 error2 5788 ) }) }), 5789 status === "success" && /* @__PURE__ */ (0, import_jsx_runtime173.jsx)(html_renderer_default, { wrapperProps: blockProps, html: content }) 5790 ] }); 5791 } 5792 5793 // packages/block-library/build-module/archives/index.mjs 5794 var { name: name5 } = block_default5; 5795 var settings5 = { 5796 icon: archive_default, 5797 example: {}, 5798 edit: ArchivesEdit 5799 }; 5800 var init5 = () => initBlock({ name: name5, metadata: block_default5, settings: settings5 }); 5801 5802 // packages/block-library/build-module/avatar/index.mjs 5803 var avatar_exports = {}; 5804 __export(avatar_exports, { 5805 init: () => init6, 5806 metadata: () => block_default6, 5807 name: () => name6, 5808 settings: () => settings6 5809 }); 5810 5811 // packages/block-library/build-module/avatar/block.json 5812 var block_default6 = { 5813 $schema: "https://schemas.wp.org/trunk/block.json", 5814 apiVersion: 3, 5815 name: "core/avatar", 5816 title: "Avatar", 5817 category: "theme", 5818 description: "Add a user\u2019s avatar.", 5819 textdomain: "default", 5820 attributes: { 5821 userId: { 5822 type: "number" 5823 }, 5824 size: { 5825 type: "number", 5826 default: 96 5827 }, 5828 isLink: { 5829 type: "boolean", 5830 default: false 5831 }, 5832 linkTarget: { 5833 type: "string", 5834 default: "_self" 5835 } 5836 }, 5837 usesContext: ["postType", "postId", "commentId"], 5838 supports: { 5839 anchor: true, 5840 html: false, 5841 align: true, 5842 alignWide: false, 5843 spacing: { 5844 margin: true, 5845 padding: true, 5846 __experimentalDefaultControls: { 5847 margin: false, 5848 padding: false 5849 } 5850 }, 5851 __experimentalBorder: { 5852 __experimentalSkipSerialization: true, 5853 radius: true, 5854 width: true, 5855 color: true, 5856 style: true, 5857 __experimentalDefaultControls: { 5858 radius: true 5859 } 5860 }, 5861 color: { 5862 text: false, 5863 background: false 5864 }, 5865 filter: { 5866 duotone: true 5867 }, 5868 interactivity: { 5869 clientNavigation: true 5870 } 5871 }, 5872 selectors: { 5873 border: ".wp-block-avatar img", 5874 filter: { 5875 duotone: ".wp-block-avatar img" 5876 } 5877 }, 5878 editorStyle: "wp-block-avatar-editor", 5879 style: "wp-block-avatar" 5880 }; 5881 5882 // packages/block-library/build-module/avatar/edit.mjs 5883 var import_block_editor12 = __toESM(require_block_editor(), 1); 5884 var import_components5 = __toESM(require_components(), 1); 5885 var import_i18n8 = __toESM(require_i18n(), 1); 5886 var import_url = __toESM(require_url(), 1); 5887 5888 // packages/block-library/build-module/avatar/hooks.mjs 5889 var import_core_data2 = __toESM(require_core_data(), 1); 5890 var import_i18n6 = __toESM(require_i18n(), 1); 5891 var import_data6 = __toESM(require_data(), 1); 5892 function getAvatarSizes(sizes) { 5893 const minSize = sizes ? sizes[0] : 24; 5894 const maxSize = sizes ? sizes[sizes.length - 1] : 96; 5895 const maxSizeBuffer = Math.floor(maxSize * 2.5); 5896 return { 5897 minSize, 5898 maxSize: maxSizeBuffer 5899 }; 5900 } 5901 function useCommentAvatar({ commentId }) { 5902 const [avatars] = (0, import_core_data2.useEntityProp)( 5903 "root", 5904 "comment", 5905 "author_avatar_urls", 5906 commentId 5907 ); 5908 const [authorName] = (0, import_core_data2.useEntityProp)( 5909 "root", 5910 "comment", 5911 "author_name", 5912 commentId 5913 ); 5914 const avatarUrls = avatars ? Object.values(avatars) : null; 5915 const sizes = avatars ? Object.keys(avatars) : null; 5916 const { minSize, maxSize } = getAvatarSizes(sizes); 5917 const defaultAvatar = useDefaultAvatar(); 5918 return { 5919 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, 5920 minSize, 5921 maxSize, 5922 alt: authorName ? ( 5923 // translators: %s: Author name. 5924 (0, import_i18n6.sprintf)((0, import_i18n6.__)("%s Avatar"), authorName) 5925 ) : (0, import_i18n6.__)("Default Avatar") 5926 }; 5927 } 5928 function useUserAvatar({ userId, postId, postType }) { 5929 const { authorDetails } = (0, import_data6.useSelect)( 5930 (select10) => { 5931 const { getEditedEntityRecord, getUser } = select10(import_core_data2.store); 5932 if (userId) { 5933 return { 5934 authorDetails: getUser(userId) 5935 }; 5936 } 5937 const _authorId = getEditedEntityRecord( 5938 "postType", 5939 postType, 5940 postId 5941 )?.author; 5942 return { 5943 authorDetails: _authorId ? getUser(_authorId) : null 5944 }; 5945 }, 5946 [postType, postId, userId] 5947 ); 5948 const avatarUrls = authorDetails?.avatar_urls ? Object.values(authorDetails.avatar_urls) : null; 5949 const sizes = authorDetails?.avatar_urls ? Object.keys(authorDetails.avatar_urls) : null; 5950 const { minSize, maxSize } = getAvatarSizes(sizes); 5951 const defaultAvatar = useDefaultAvatar(); 5952 return { 5953 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : defaultAvatar, 5954 minSize, 5955 maxSize, 5956 alt: authorDetails ? ( 5957 // translators: %s: Author name. 5958 (0, import_i18n6.sprintf)((0, import_i18n6.__)("%s Avatar"), authorDetails?.name) 5959 ) : (0, import_i18n6.__)("Default Avatar") 5960 }; 5961 } 5962 5963 // packages/block-library/build-module/avatar/user-control.mjs 5964 var import_i18n7 = __toESM(require_i18n(), 1); 5965 var import_components4 = __toESM(require_components(), 1); 5966 var import_data7 = __toESM(require_data(), 1); 5967 var import_core_data3 = __toESM(require_core_data(), 1); 5968 var import_element4 = __toESM(require_element(), 1); 5969 var import_compose3 = __toESM(require_compose(), 1); 5970 var import_html_entities = __toESM(require_html_entities(), 1); 5971 var import_jsx_runtime174 = __toESM(require_jsx_runtime(), 1); 5972 var AUTHORS_QUERY = { 5973 who: "authors", 5974 per_page: 100, 5975 _fields: "id,name", 5976 context: "view" 5977 }; 5978 function UserControl({ value, onChange }) { 5979 const [filterValue, setFilterValue] = (0, import_element4.useState)(""); 5980 const { authors, isLoading } = (0, import_data7.useSelect)( 5981 (select10) => { 5982 const { getUsers, isResolving } = select10(import_core_data3.store); 5983 const query = { ...AUTHORS_QUERY }; 5984 if (filterValue) { 5985 query.search = filterValue; 5986 query.search_columns = ["name"]; 5987 } 5988 return { 5989 authors: getUsers(query), 5990 isLoading: isResolving("getUsers", [query]) 5991 }; 5992 }, 5993 [filterValue] 5994 ); 5995 const options2 = (0, import_element4.useMemo)(() => { 5996 return (authors ?? []).map((author) => { 5997 return { 5998 value: author.id, 5999 label: (0, import_html_entities.decodeEntities)(author.name) 6000 }; 6001 }); 6002 }, [authors]); 6003 return /* @__PURE__ */ (0, import_jsx_runtime174.jsx)( 6004 import_components4.ComboboxControl, 6005 { 6006 label: (0, import_i18n7.__)("User"), 6007 help: (0, import_i18n7.__)( 6008 "Select the avatar user to display, if it is blank it will use the post/page author." 6009 ), 6010 value, 6011 onChange, 6012 options: options2, 6013 onFilterValueChange: (0, import_compose3.debounce)(setFilterValue, 300), 6014 isLoading 6015 } 6016 ); 6017 } 6018 6019 // packages/block-library/build-module/avatar/edit.mjs 6020 var import_jsx_runtime175 = __toESM(require_jsx_runtime(), 1); 6021 var AvatarInspectorControls = ({ 6022 setAttributes, 6023 avatar, 6024 attributes: attributes2, 6025 selectUser 6026 }) => { 6027 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 6028 return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(import_block_editor12.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)( 6029 import_components5.__experimentalToolsPanel, 6030 { 6031 label: (0, import_i18n8.__)("Settings"), 6032 resetAll: () => { 6033 setAttributes({ 6034 size: 96, 6035 isLink: false, 6036 linkTarget: "_self", 6037 userId: void 0 6038 }); 6039 }, 6040 dropdownMenuProps, 6041 children: [ 6042 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6043 import_components5.__experimentalToolsPanelItem, 6044 { 6045 label: (0, import_i18n8.__)("Image size"), 6046 isShownByDefault: true, 6047 hasValue: () => attributes2?.size !== 96, 6048 onDeselect: () => setAttributes({ size: 96 }), 6049 children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6050 import_components5.RangeControl, 6051 { 6052 label: (0, import_i18n8.__)("Image size"), 6053 onChange: (newSize) => setAttributes({ 6054 size: newSize 6055 }), 6056 min: avatar.minSize, 6057 max: avatar.maxSize, 6058 initialPosition: attributes2?.size, 6059 value: attributes2?.size 6060 } 6061 ) 6062 } 6063 ), 6064 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6065 import_components5.__experimentalToolsPanelItem, 6066 { 6067 label: (0, import_i18n8.__)("Link to user profile"), 6068 isShownByDefault: true, 6069 hasValue: () => attributes2?.isLink, 6070 onDeselect: () => setAttributes({ isLink: false }), 6071 children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6072 import_components5.ToggleControl, 6073 { 6074 label: (0, import_i18n8.__)("Link to user profile"), 6075 onChange: () => setAttributes({ isLink: !attributes2.isLink }), 6076 checked: attributes2.isLink 6077 } 6078 ) 6079 } 6080 ), 6081 attributes2.isLink && /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6082 import_components5.__experimentalToolsPanelItem, 6083 { 6084 label: (0, import_i18n8.__)("Open in new tab"), 6085 isShownByDefault: true, 6086 hasValue: () => attributes2?.linkTarget !== "_self", 6087 onDeselect: () => setAttributes({ linkTarget: "_self" }), 6088 children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6089 import_components5.ToggleControl, 6090 { 6091 label: (0, import_i18n8.__)("Open in new tab"), 6092 onChange: (value) => setAttributes({ 6093 linkTarget: value ? "_blank" : "_self" 6094 }), 6095 checked: attributes2.linkTarget === "_blank" 6096 } 6097 ) 6098 } 6099 ), 6100 selectUser && /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6101 import_components5.__experimentalToolsPanelItem, 6102 { 6103 label: (0, import_i18n8.__)("User"), 6104 isShownByDefault: true, 6105 hasValue: () => !!attributes2?.userId, 6106 onDeselect: () => setAttributes({ userId: void 0 }), 6107 children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6108 UserControl, 6109 { 6110 value: attributes2?.userId, 6111 onChange: (value) => { 6112 setAttributes({ 6113 userId: value 6114 }); 6115 } 6116 } 6117 ) 6118 } 6119 ) 6120 ] 6121 } 6122 ) }); 6123 }; 6124 var AvatarLinkWrapper = ({ children, isLink }) => isLink ? /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6125 "a", 6126 { 6127 href: "#avatar-pseudo-link", 6128 className: "wp-block-avatar__link", 6129 onClick: (event) => event.preventDefault(), 6130 children 6131 } 6132 ) : children; 6133 var ResizableAvatar = ({ 6134 setAttributes, 6135 attributes: attributes2, 6136 avatar, 6137 blockProps, 6138 isSelected 6139 }) => { 6140 const borderProps = (0, import_block_editor12.__experimentalUseBorderProps)(attributes2); 6141 const doubledSizedSrc = (0, import_url.addQueryArgs)( 6142 (0, import_url.removeQueryArgs)(avatar?.src, ["s"]), 6143 { 6144 s: attributes2?.size * 2 6145 } 6146 ); 6147 return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(AvatarLinkWrapper, { isLink: attributes2.isLink, children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6148 import_components5.ResizableBox, 6149 { 6150 size: { 6151 width: attributes2.size, 6152 height: attributes2.size 6153 }, 6154 showHandle: isSelected, 6155 onResizeStop: (event, direction, elt, delta) => { 6156 setAttributes({ 6157 size: parseInt( 6158 attributes2.size + (delta.height || delta.width), 6159 10 6160 ) 6161 }); 6162 }, 6163 lockAspectRatio: true, 6164 enable: { 6165 top: false, 6166 right: !(0, import_i18n8.isRTL)(), 6167 bottom: true, 6168 left: (0, import_i18n8.isRTL)() 6169 }, 6170 minWidth: avatar.minSize, 6171 maxWidth: avatar.maxSize, 6172 children: /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6173 "img", 6174 { 6175 src: doubledSizedSrc, 6176 alt: avatar.alt, 6177 className: clsx_default( 6178 "avatar", 6179 "avatar-" + attributes2.size, 6180 "photo", 6181 "wp-block-avatar__image", 6182 borderProps.className 6183 ), 6184 style: borderProps.style 6185 } 6186 ) 6187 } 6188 ) }) }); 6189 }; 6190 var CommentEdit = ({ attributes: attributes2, context, setAttributes, isSelected }) => { 6191 const { commentId } = context; 6192 const blockProps = (0, import_block_editor12.useBlockProps)(); 6193 const avatar = useCommentAvatar({ commentId }); 6194 return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(import_jsx_runtime175.Fragment, { children: [ 6195 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6196 AvatarInspectorControls, 6197 { 6198 avatar, 6199 setAttributes, 6200 attributes: attributes2, 6201 selectUser: false 6202 } 6203 ), 6204 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6205 ResizableAvatar, 6206 { 6207 attributes: attributes2, 6208 avatar, 6209 blockProps, 6210 isSelected, 6211 setAttributes 6212 } 6213 ) 6214 ] }); 6215 }; 6216 var UserEdit = ({ attributes: attributes2, context, setAttributes, isSelected }) => { 6217 const { postId, postType } = context; 6218 const avatar = useUserAvatar({ 6219 userId: attributes2?.userId, 6220 postId, 6221 postType 6222 }); 6223 const blockProps = (0, import_block_editor12.useBlockProps)(); 6224 return /* @__PURE__ */ (0, import_jsx_runtime175.jsxs)(import_jsx_runtime175.Fragment, { children: [ 6225 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6226 AvatarInspectorControls, 6227 { 6228 selectUser: true, 6229 attributes: attributes2, 6230 avatar, 6231 setAttributes 6232 } 6233 ), 6234 /* @__PURE__ */ (0, import_jsx_runtime175.jsx)( 6235 ResizableAvatar, 6236 { 6237 attributes: attributes2, 6238 avatar, 6239 blockProps, 6240 isSelected, 6241 setAttributes 6242 } 6243 ) 6244 ] }); 6245 }; 6246 function Edit5(props) { 6247 if (props?.context?.commentId || props?.context?.commentId === null) { 6248 return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(CommentEdit, { ...props }); 6249 } 6250 return /* @__PURE__ */ (0, import_jsx_runtime175.jsx)(UserEdit, { ...props }); 6251 } 6252 6253 // packages/block-library/build-module/avatar/index.mjs 6254 var { name: name6 } = block_default6; 6255 var settings6 = { 6256 icon: comment_author_avatar_default, 6257 edit: Edit5, 6258 example: {} 6259 }; 6260 var init6 = () => initBlock({ name: name6, metadata: block_default6, settings: settings6 }); 6261 6262 // packages/block-library/build-module/audio/index.mjs 6263 var audio_exports = {}; 6264 __export(audio_exports, { 6265 init: () => init7, 6266 metadata: () => block_default8, 6267 name: () => name7, 6268 settings: () => settings7 6269 }); 6270 var import_i18n15 = __toESM(require_i18n(), 1); 6271 var import_blocks6 = __toESM(require_blocks(), 1); 6272 6273 // packages/block-library/build-module/audio/deprecated.mjs 6274 var import_block_editor13 = __toESM(require_block_editor(), 1); 6275 var import_jsx_runtime176 = __toESM(require_jsx_runtime(), 1); 6276 var deprecated_default2 = [ 6277 { 6278 attributes: { 6279 src: { 6280 type: "string", 6281 source: "attribute", 6282 selector: "audio", 6283 attribute: "src" 6284 }, 6285 caption: { 6286 type: "string", 6287 source: "html", 6288 selector: "figcaption" 6289 }, 6290 id: { 6291 type: "number" 6292 }, 6293 autoplay: { 6294 type: "boolean", 6295 source: "attribute", 6296 selector: "audio", 6297 attribute: "autoplay" 6298 }, 6299 loop: { 6300 type: "boolean", 6301 source: "attribute", 6302 selector: "audio", 6303 attribute: "loop" 6304 }, 6305 preload: { 6306 type: "string", 6307 source: "attribute", 6308 selector: "audio", 6309 attribute: "preload" 6310 } 6311 }, 6312 supports: { 6313 align: true 6314 }, 6315 save({ attributes: attributes2 }) { 6316 const { autoplay, caption, loop, preload, src } = attributes2; 6317 return /* @__PURE__ */ (0, import_jsx_runtime176.jsxs)("figure", { children: [ 6318 /* @__PURE__ */ (0, import_jsx_runtime176.jsx)( 6319 "audio", 6320 { 6321 controls: "controls", 6322 src, 6323 autoPlay: autoplay, 6324 loop, 6325 preload 6326 } 6327 ), 6328 !import_block_editor13.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime176.jsx)( 6329 import_block_editor13.RichText.Content, 6330 { 6331 tagName: "figcaption", 6332 value: caption 6333 } 6334 ) 6335 ] }); 6336 } 6337 } 6338 ]; 6339 6340 // packages/block-library/build-module/audio/edit.mjs 6341 var import_blob2 = __toESM(require_blob(), 1); 6342 var import_components7 = __toESM(require_components(), 1); 6343 6344 // node_modules/@base-ui/utils/useControlled.mjs 6345 var React = __toESM(require_react(), 1); 6346 6347 // node_modules/@base-ui/utils/error.mjs 6348 var set; 6349 if (true) { 6350 set = /* @__PURE__ */ new Set(); 6351 } 6352 function error(...messages) { 6353 if (true) { 6354 const messageKey = messages.join(" "); 6355 if (!set.has(messageKey)) { 6356 set.add(messageKey); 6357 console.error(`Base UI: $messageKey}`); 6358 } 6359 } 6360 } 6361 6362 // node_modules/@base-ui/utils/useControlled.mjs 6363 function useControlled({ 6364 controlled, 6365 default: defaultProp, 6366 name: name118, 6367 state = "value" 6368 }) { 6369 const { 6370 current: isControlled 6371 } = React.useRef(controlled !== void 0); 6372 const [valueState, setValue] = React.useState(defaultProp); 6373 const value = isControlled ? controlled : valueState; 6374 if (true) { 6375 React.useEffect(() => { 6376 if (isControlled !== (controlled !== void 0)) { 6377 error([`A component is changing the $isControlled ? "" : "un"}controlled $state} state of $name118} to be $isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled $name118} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n")); 6378 } 6379 }, [state, name118, controlled]); 6380 const { 6381 current: defaultValue 6382 } = React.useRef(defaultProp); 6383 React.useEffect(() => { 6384 if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) { 6385 error([`A component is changing the default $state} state of an uncontrolled $name118} after being initialized. To suppress this warning opt to use a controlled $name118}.`].join("\n")); 6386 } 6387 }, [defaultProp]); 6388 } 6389 const setValueIfUncontrolled = React.useCallback((newValue) => { 6390 if (!isControlled) { 6391 setValue(newValue); 6392 } 6393 }, []); 6394 return [value, setValueIfUncontrolled]; 6395 } 6396 function serializeToDevModeString(input) { 6397 let nextId = 0; 6398 const seen = /* @__PURE__ */ new WeakMap(); 6399 try { 6400 const result = JSON.stringify(input, function replacer(key, value) { 6401 if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) { 6402 return void 0; 6403 } 6404 if (typeof value === "bigint") { 6405 return `__bigint__:$value}`; 6406 } 6407 if (value !== null && typeof value === "object") { 6408 const id = seen.get(value); 6409 if (id !== void 0) { 6410 return `__object__:$id}`; 6411 } 6412 seen.set(value, nextId); 6413 nextId += 1; 6414 } 6415 return value; 6416 }); 6417 return result ?? `__top__:$typeof input}`; 6418 } catch { 6419 return "__unserializable__"; 6420 } 6421 } 6422 6423 // node_modules/@base-ui/utils/safeReact.mjs 6424 var React2 = __toESM(require_react(), 1); 6425 var SafeReact = { 6426 ...React2 6427 }; 6428 6429 // node_modules/@base-ui/utils/useRefWithInit.mjs 6430 var React3 = __toESM(require_react(), 1); 6431 var UNINITIALIZED = {}; 6432 function useRefWithInit(init117, initArg) { 6433 const ref = React3.useRef(UNINITIALIZED); 6434 if (ref.current === UNINITIALIZED) { 6435 ref.current = init117(initArg); 6436 } 6437 return ref; 6438 } 6439 6440 // node_modules/@base-ui/utils/useStableCallback.mjs 6441 var useInsertionEffect = SafeReact.useInsertionEffect; 6442 var useSafeInsertionEffect = ( 6443 // React 17 doesn't have useInsertionEffect. 6444 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. 6445 useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() 6446 ); 6447 function useStableCallback(callback) { 6448 const stable = useRefWithInit(createStableCallback).current; 6449 stable.next = callback; 6450 useSafeInsertionEffect(stable.effect); 6451 return stable.trampoline; 6452 } 6453 function createStableCallback() { 6454 const stable = { 6455 next: void 0, 6456 callback: assertNotCalled, 6457 trampoline: (...args) => stable.callback?.(...args), 6458 effect: () => { 6459 stable.callback = stable.next; 6460 } 6461 }; 6462 return stable; 6463 } 6464 function assertNotCalled() { 6465 if (true) { 6466 throw ( 6467 /* minify-error-disabled */ 6468 new Error("Base UI: Cannot call an event handler while rendering.") 6469 ); 6470 } 6471 } 6472 6473 // node_modules/@base-ui/utils/warn.mjs 6474 var set2; 6475 if (true) { 6476 set2 = /* @__PURE__ */ new Set(); 6477 } 6478 function warn(...messages) { 6479 if (true) { 6480 const messageKey = messages.join(" "); 6481 if (!set2.has(messageKey)) { 6482 set2.add(messageKey); 6483 console.warn(`Base UI: $messageKey}`); 6484 } 6485 } 6486 } 6487 6488 // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs 6489 var React6 = __toESM(require_react(), 1); 6490 6491 // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs 6492 var React4 = __toESM(require_react(), 1); 6493 var noop = () => { 6494 }; 6495 var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop; 6496 6497 // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs 6498 var React5 = __toESM(require_react(), 1); 6499 var CompositeListContext = /* @__PURE__ */ React5.createContext({ 6500 register: () => { 6501 }, 6502 unregister: () => { 6503 }, 6504 subscribeMapChange: () => () => { 6505 }, 6506 nextIndexRef: { 6507 current: 0 6508 } 6509 }); 6510 if (true) CompositeListContext.displayName = "CompositeListContext"; 6511 function useCompositeListContext() { 6512 return React5.useContext(CompositeListContext); 6513 } 6514 6515 // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs 6516 var import_jsx_runtime177 = __toESM(require_jsx_runtime(), 1); 6517 function CompositeList(props) { 6518 const { 6519 children, 6520 elementsRef, 6521 labelsRef, 6522 onMapChange: onMapChangeProp 6523 } = props; 6524 const onMapChange = useStableCallback(onMapChangeProp); 6525 const [, setMapTick] = React6.useState(false); 6526 const listeners = useRefWithInit(createListeners).current; 6527 const map = useRefWithInit(createMap).current; 6528 const nextIndexRef = React6.useRef(0); 6529 const isDirtyRef = React6.useRef(true); 6530 const itemsRef = React6.useRef([]); 6531 const mutationObserverRef = React6.useRef(null); 6532 const scheduleMapUpdate = useStableCallback(() => { 6533 if (isDirtyRef.current) { 6534 return; 6535 } 6536 isDirtyRef.current = true; 6537 setMapTick((tick) => !tick); 6538 }); 6539 const register = useStableCallback((node, registration) => { 6540 map.set(node, registration); 6541 scheduleMapUpdate(); 6542 }); 6543 const unregister = useStableCallback((node) => { 6544 map.delete(node); 6545 scheduleMapUpdate(); 6546 }); 6547 const syncRefs = useStableCallback((items) => { 6548 const nextMap = /* @__PURE__ */ new Map(); 6549 elementsRef.current.length = 0; 6550 if (labelsRef) { 6551 labelsRef.current.length = 0; 6552 } 6553 items.forEach((item) => { 6554 nextMap.set(item.element, { 6555 ...item.registration.metadata ?? {}, 6556 index: item.index 6557 }); 6558 elementsRef.current[item.index] = item.element; 6559 if (labelsRef) { 6560 labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent; 6561 } 6562 }); 6563 nextIndexRef.current = elementsRef.current.length; 6564 return nextMap; 6565 }); 6566 function observe(sortedNodes) { 6567 mutationObserverRef.current?.disconnect(); 6568 mutationObserverRef.current = null; 6569 if (typeof MutationObserver !== "function" || sortedNodes.length < 2) { 6570 return; 6571 } 6572 const mutationObserver = new MutationObserver((entries) => { 6573 if (!hasMovedNode(entries)) { 6574 return; 6575 } 6576 let previousConnectedNode = null; 6577 for (const node of sortedNodes) { 6578 if (!node.isConnected) { 6579 continue; 6580 } 6581 if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) { 6582 mutationObserver.disconnect(); 6583 scheduleMapUpdate(); 6584 return; 6585 } 6586 previousConnectedNode = node; 6587 } 6588 }); 6589 mutationObserverRef.current = mutationObserver; 6590 const roots = /* @__PURE__ */ new Set(); 6591 for (let i2 = 1; i2 < sortedNodes.length; i2 += 1) { 6592 const root = getCommonAncestor(sortedNodes[i2 - 1], sortedNodes[i2]); 6593 if (root) { 6594 roots.add(root); 6595 } 6596 } 6597 roots.forEach((root) => mutationObserver.observe(root, { 6598 childList: true 6599 })); 6600 } 6601 const flush = useStableCallback(() => { 6602 const [items, automaticNodes] = getCompositeListSnapshot(map); 6603 const nextMap = syncRefs(items); 6604 observe(automaticNodes); 6605 itemsRef.current = items; 6606 isDirtyRef.current = false; 6607 listeners.forEach((listener) => listener(nextMap)); 6608 onMapChange(nextMap); 6609 }); 6610 useIsoLayoutEffect(() => { 6611 if (!isDirtyRef.current) { 6612 syncRefs(itemsRef.current); 6613 } 6614 return () => { 6615 elementsRef.current = []; 6616 if (labelsRef) { 6617 labelsRef.current = []; 6618 } 6619 }; 6620 }, [elementsRef, labelsRef, syncRefs]); 6621 useIsoLayoutEffect(() => { 6622 if (isDirtyRef.current) { 6623 flush(); 6624 } 6625 }); 6626 useIsoLayoutEffect(() => { 6627 return () => { 6628 mutationObserverRef.current?.disconnect(); 6629 isDirtyRef.current = true; 6630 }; 6631 }, []); 6632 const subscribeMapChange = useStableCallback((fn) => { 6633 listeners.add(fn); 6634 return () => { 6635 listeners.delete(fn); 6636 }; 6637 }); 6638 const contextValue = React6.useMemo(() => ({ 6639 register, 6640 unregister, 6641 subscribeMapChange, 6642 nextIndexRef 6643 }), [register, unregister, subscribeMapChange, nextIndexRef]); 6644 return /* @__PURE__ */ (0, import_jsx_runtime177.jsx)(CompositeListContext.Provider, { 6645 value: contextValue, 6646 children 6647 }); 6648 } 6649 function createMap() { 6650 return /* @__PURE__ */ new Map(); 6651 } 6652 function createListeners() { 6653 return /* @__PURE__ */ new Set(); 6654 } 6655 function getCompositeListSnapshot(map) { 6656 const reservedIndices = /* @__PURE__ */ new Set(); 6657 const items = []; 6658 const automaticItems = []; 6659 map.forEach((registration, node) => { 6660 if (!node.isConnected) { 6661 return; 6662 } 6663 const index = registration.index; 6664 const item = { 6665 index: index ?? -1, 6666 element: node, 6667 registration 6668 }; 6669 if (index === null) { 6670 automaticItems.push(item); 6671 } else if (index >= 0) { 6672 reservedIndices.add(index); 6673 items.push(item); 6674 } 6675 }); 6676 let nextAutomaticIndex = 0; 6677 automaticItems.sort((a2, b2) => sortByDocumentPosition(a2.element, b2.element)); 6678 automaticItems.forEach((item) => { 6679 while (reservedIndices.has(nextAutomaticIndex)) { 6680 nextAutomaticIndex += 1; 6681 } 6682 item.index = nextAutomaticIndex; 6683 items.push(item); 6684 nextAutomaticIndex += 1; 6685 }); 6686 if (reservedIndices.size > 0) { 6687 items.sort((a2, b2) => a2.index - b2.index); 6688 } 6689 return [items, automaticItems.map((item) => item.element)]; 6690 } 6691 function getCommonAncestor(firstNode, lastNode) { 6692 let ancestor = firstNode.parentElement; 6693 while (ancestor && !ancestor.contains(lastNode)) { 6694 ancestor = ancestor.parentElement; 6695 } 6696 return ancestor; 6697 } 6698 function hasMovedNode(entries) { 6699 for (const entry of entries) { 6700 for (let i2 = 0; i2 < entry.removedNodes.length; i2 += 1) { 6701 if (entry.removedNodes[i2].isConnected) { 6702 return true; 6703 } 6704 } 6705 } 6706 return false; 6707 } 6708 function sortByDocumentPosition(a2, b2) { 6709 return a2.compareDocumentPosition(b2) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1; 6710 } 6711 6712 // node_modules/@base-ui/react/internals/useRenderElement.mjs 6713 var React9 = __toESM(require_react(), 1); 6714 6715 // node_modules/@base-ui/utils/useMergedRefs.mjs 6716 function useMergedRefs(a2, b2, c2, d2) { 6717 const forkRef = useRefWithInit(createForkRef).current; 6718 if (didChange(forkRef, a2, b2, c2, d2)) { 6719 update(forkRef, [a2, b2, c2, d2]); 6720 } 6721 return forkRef.callback; 6722 } 6723 function useMergedRefsN(refs) { 6724 const forkRef = useRefWithInit(createForkRef).current; 6725 if (didChangeN(forkRef, refs)) { 6726 update(forkRef, refs); 6727 } 6728 return forkRef.callback; 6729 } 6730 function createForkRef() { 6731 return { 6732 callback: null, 6733 cleanup: null, 6734 refs: [] 6735 }; 6736 } 6737 function didChange(forkRef, a2, b2, c2, d2) { 6738 return forkRef.refs[0] !== a2 || forkRef.refs[1] !== b2 || forkRef.refs[2] !== c2 || forkRef.refs[3] !== d2; 6739 } 6740 function didChangeN(forkRef, newRefs) { 6741 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]); 6742 } 6743 function update(forkRef, refs) { 6744 forkRef.refs = refs; 6745 if (refs.every((ref) => ref == null)) { 6746 forkRef.callback = null; 6747 return; 6748 } 6749 forkRef.callback = (instance) => { 6750 if (forkRef.cleanup) { 6751 forkRef.cleanup(); 6752 forkRef.cleanup = null; 6753 } 6754 if (instance != null) { 6755 const cleanupCallbacks = Array(refs.length).fill(null); 6756 for (let i2 = 0; i2 < refs.length; i2 += 1) { 6757 const ref = refs[i2]; 6758 if (ref == null) { 6759 continue; 6760 } 6761 switch (typeof ref) { 6762 case "function": { 6763 const refCleanup = ref(instance); 6764 if (typeof refCleanup === "function") { 6765 cleanupCallbacks[i2] = refCleanup; 6766 } 6767 break; 6768 } 6769 case "object": { 6770 ref.current = instance; 6771 break; 6772 } 6773 default: 6774 } 6775 } 6776 forkRef.cleanup = () => { 6777 for (let i2 = 0; i2 < refs.length; i2 += 1) { 6778 const ref = refs[i2]; 6779 if (ref == null) { 6780 continue; 6781 } 6782 switch (typeof ref) { 6783 case "function": { 6784 const cleanupCallback = cleanupCallbacks[i2]; 6785 if (typeof cleanupCallback === "function") { 6786 cleanupCallback(); 6787 } else { 6788 void ref(null); 6789 } 6790 break; 6791 } 6792 case "object": { 6793 ref.current = null; 6794 break; 6795 } 6796 default: 6797 } 6798 } 6799 }; 6800 } 6801 }; 6802 } 6803 6804 // node_modules/@base-ui/utils/getReactElementRef.mjs 6805 var React8 = __toESM(require_react(), 1); 6806 6807 // node_modules/@base-ui/utils/reactVersion.mjs 6808 var React7 = __toESM(require_react(), 1); 6809 var majorVersion = parseInt(React7.version, 10); 6810 function isReactVersionAtLeast(reactVersionToCheck) { 6811 return majorVersion >= reactVersionToCheck; 6812 } 6813 6814 // node_modules/@base-ui/utils/getReactElementRef.mjs 6815 function getReactElementRef(element) { 6816 if (!/* @__PURE__ */ React8.isValidElement(element)) { 6817 return null; 6818 } 6819 const reactElement = element; 6820 const propsWithRef = reactElement.props; 6821 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; 6822 } 6823 6824 // node_modules/@base-ui/utils/mergeObjects.mjs 6825 function mergeObjects(a2, b2) { 6826 if (a2 && !b2) { 6827 return a2; 6828 } 6829 if (!a2 && b2) { 6830 return b2; 6831 } 6832 if (a2 || b2) { 6833 return { 6834 ...a2, 6835 ...b2 6836 }; 6837 } 6838 return void 0; 6839 } 6840 6841 // node_modules/@base-ui/utils/empty.mjs 6842 function NOOP() { 6843 } 6844 var EMPTY_ARRAY = Object.freeze([]); 6845 var EMPTY_OBJECT = Object.freeze({}); 6846 6847 // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs 6848 function getStateAttributesProps(state, customMapping) { 6849 const props = {}; 6850 for (const key in state) { 6851 const value = state[key]; 6852 if (customMapping?.hasOwnProperty(key)) { 6853 const customProps = customMapping[key](value); 6854 if (customProps != null) { 6855 Object.assign(props, customProps); 6856 } 6857 continue; 6858 } 6859 if (value === true) { 6860 props[`data-$key.toLowerCase()}`] = ""; 6861 } else if (value) { 6862 props[`data-$key.toLowerCase()}`] = value.toString(); 6863 } 6864 } 6865 return props; 6866 } 6867 6868 // node_modules/@base-ui/react/utils/resolveClassName.mjs 6869 function resolveClassName(className, state) { 6870 return typeof className === "function" ? className(state) : className; 6871 } 6872 6873 // node_modules/@base-ui/react/utils/resolveStyle.mjs 6874 function resolveStyle(style2, state) { 6875 return typeof style2 === "function" ? style2(state) : style2; 6876 } 6877 6878 // node_modules/@base-ui/react/merge-props/mergeProps.mjs 6879 var EMPTY_PROPS = {}; 6880 function mergeProps(a2, b2, c2, d2, e3) { 6881 if (!c2 && !d2 && !e3 && !a2) { 6882 return createInitialMergedProps(b2); 6883 } 6884 let merged = createInitialMergedProps(a2); 6885 if (b2) { 6886 merged = mergeInto(merged, b2); 6887 } 6888 if (c2) { 6889 merged = mergeInto(merged, c2); 6890 } 6891 if (d2) { 6892 merged = mergeInto(merged, d2); 6893 } 6894 if (e3) { 6895 merged = mergeInto(merged, e3); 6896 } 6897 return merged; 6898 } 6899 function mergePropsN(props) { 6900 if (props.length === 0) { 6901 return EMPTY_PROPS; 6902 } 6903 if (props.length === 1) { 6904 return createInitialMergedProps(props[0]); 6905 } 6906 let merged = createInitialMergedProps(props[0]); 6907 for (let i2 = 1; i2 < props.length; i2 += 1) { 6908 merged = mergeInto(merged, props[i2]); 6909 } 6910 return merged; 6911 } 6912 function createInitialMergedProps(inputProps) { 6913 if (isPropsGetter(inputProps)) { 6914 return { 6915 ...resolvePropsGetter(inputProps, EMPTY_PROPS) 6916 }; 6917 } 6918 return copyInitialProps(inputProps); 6919 } 6920 function mergeInto(merged, inputProps) { 6921 if (isPropsGetter(inputProps)) { 6922 return resolvePropsGetter(inputProps, merged); 6923 } 6924 return mutablyMergeInto(merged, inputProps); 6925 } 6926 function copyInitialProps(inputProps) { 6927 const copiedProps = { 6928 ...inputProps 6929 }; 6930 for (const propName in copiedProps) { 6931 const propValue = copiedProps[propName]; 6932 if (isEventHandler(propName, propValue)) { 6933 copiedProps[propName] = wrapEventHandler(propValue); 6934 } 6935 } 6936 return copiedProps; 6937 } 6938 function mutablyMergeInto(mergedProps, externalProps) { 6939 if (!externalProps) { 6940 return mergedProps; 6941 } 6942 for (const propName in externalProps) { 6943 const externalPropValue = externalProps[propName]; 6944 switch (propName) { 6945 case "style": { 6946 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); 6947 break; 6948 } 6949 case "className": { 6950 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); 6951 break; 6952 } 6953 default: { 6954 if (isEventHandler(propName, externalPropValue)) { 6955 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); 6956 } else { 6957 mergedProps[propName] = externalPropValue; 6958 } 6959 } 6960 } 6961 } 6962 return mergedProps; 6963 } 6964 function isEventHandler(key, value) { 6965 const code0 = key.charCodeAt(0); 6966 const code1 = key.charCodeAt(1); 6967 const code2 = key.charCodeAt(2); 6968 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); 6969 } 6970 function isPropsGetter(inputProps) { 6971 return typeof inputProps === "function"; 6972 } 6973 function resolvePropsGetter(inputProps, previousProps) { 6974 if (isPropsGetter(inputProps)) { 6975 return inputProps(previousProps); 6976 } 6977 return inputProps ?? EMPTY_PROPS; 6978 } 6979 function mergeEventHandlers(ourHandler, theirHandler) { 6980 if (!theirHandler) { 6981 return ourHandler; 6982 } 6983 if (!ourHandler) { 6984 return wrapEventHandler(theirHandler); 6985 } 6986 return (...args) => { 6987 const event = args[0]; 6988 if (isSyntheticEvent(event)) { 6989 const baseUIEvent = event; 6990 makeEventPreventable(baseUIEvent); 6991 const result2 = theirHandler(...args); 6992 if (!baseUIEvent.baseUIHandlerPrevented) { 6993 ourHandler?.(...args); 6994 } 6995 return result2; 6996 } 6997 const result = theirHandler(...args); 6998 ourHandler?.(...args); 6999 return result; 7000 }; 7001 } 7002 function wrapEventHandler(handler) { 7003 if (!handler) { 7004 return handler; 7005 } 7006 return (...args) => { 7007 const event = args[0]; 7008 if (isSyntheticEvent(event)) { 7009 makeEventPreventable(event); 7010 } 7011 return handler(...args); 7012 }; 7013 } 7014 function makeEventPreventable(event) { 7015 event.preventBaseUIHandler = () => { 7016 event.baseUIHandlerPrevented = true; 7017 }; 7018 return event; 7019 } 7020 function mergeClassNames(ourClassName, theirClassName) { 7021 if (theirClassName) { 7022 if (ourClassName) { 7023 return theirClassName + " " + ourClassName; 7024 } 7025 return theirClassName; 7026 } 7027 return ourClassName; 7028 } 7029 function isSyntheticEvent(event) { 7030 return event != null && typeof event === "object" && "nativeEvent" in event; 7031 } 7032 7033 // node_modules/@base-ui/react/internals/useRenderElement.mjs 7034 var import_react = __toESM(require_react(), 1); 7035 function useRenderElement(element, componentProps, params = {}) { 7036 const renderProp = componentProps.render; 7037 const outProps = useRenderElementProps(componentProps, params); 7038 if (params.enabled === false) { 7039 return null; 7040 } 7041 const state = params.state ?? EMPTY_OBJECT; 7042 return evaluateRenderProp(element, renderProp, outProps, state); 7043 } 7044 function useRenderElementProps(componentProps, params = {}) { 7045 const { 7046 className: classNameProp, 7047 style: styleProp, 7048 render: renderProp 7049 } = componentProps; 7050 const { 7051 state = EMPTY_OBJECT, 7052 ref, 7053 props, 7054 stateAttributesMapping: stateAttributesMapping4, 7055 enabled = true 7056 } = params; 7057 const className = enabled ? resolveClassName(classNameProp, state) : void 0; 7058 const style2 = enabled ? resolveStyle(styleProp, state) : void 0; 7059 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping4) : EMPTY_OBJECT; 7060 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; 7061 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; 7062 if (typeof document !== "undefined") { 7063 if (!enabled) { 7064 void useMergedRefs(null, null); 7065 } else if (Array.isArray(ref)) { 7066 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); 7067 } else { 7068 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); 7069 } 7070 } 7071 if (!enabled) { 7072 return EMPTY_OBJECT; 7073 } 7074 if (className !== void 0) { 7075 outProps.className = mergeClassNames(outProps.className, className); 7076 } 7077 if (style2 !== void 0) { 7078 outProps.style = mergeObjects(outProps.style, style2); 7079 } 7080 return outProps; 7081 } 7082 function resolveRenderFunctionProps(props) { 7083 if (Array.isArray(props)) { 7084 return mergePropsN(props); 7085 } 7086 return mergeProps(void 0, props); 7087 } 7088 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 7089 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; 7090 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; 7091 function evaluateRenderProp(element, render, props, state) { 7092 if (render) { 7093 if (typeof render === "function") { 7094 if (true) { 7095 warnIfRenderPropLooksLikeComponent(render); 7096 } 7097 return render(props, state); 7098 } 7099 const mergedProps = mergeProps(props, render.props); 7100 mergedProps.ref = props.ref; 7101 let newElement = render; 7102 if (newElement?.$$typeof === REACT_LAZY_TYPE) { 7103 const children = React9.Children.toArray(render); 7104 newElement = children[0]; 7105 } 7106 if (true) { 7107 if (!/* @__PURE__ */ React9.isValidElement(newElement)) { 7108 throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n")); 7109 } 7110 } 7111 return /* @__PURE__ */ React9.cloneElement(newElement, mergedProps); 7112 } 7113 if (element) { 7114 if (typeof element === "string") { 7115 return renderTag(element, props); 7116 } 7117 } 7118 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); 7119 } 7120 function warnIfRenderPropLooksLikeComponent(renderFn) { 7121 const functionName = renderFn.name; 7122 if (functionName.length === 0) { 7123 return; 7124 } 7125 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { 7126 return; 7127 } 7128 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { 7129 return; 7130 } 7131 warn(`The \`render\` prop received a function named \`$functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop"); 7132 } 7133 function renderTag(Tag, props) { 7134 if (Tag === "button") { 7135 return /* @__PURE__ */ (0, import_react.createElement)("button", { 7136 type: "button", 7137 ...props, 7138 key: props.key 7139 }); 7140 } 7141 if (Tag === "img") { 7142 return /* @__PURE__ */ (0, import_react.createElement)("img", { 7143 alt: "", 7144 ...props, 7145 key: props.key 7146 }); 7147 } 7148 return /* @__PURE__ */ React9.createElement(Tag, props); 7149 } 7150 7151 // node_modules/@base-ui/utils/useId.mjs 7152 var React10 = __toESM(require_react(), 1); 7153 var globalId = 0; 7154 function useGlobalId(idOverride, prefix = "mui") { 7155 const [defaultId, setDefaultId] = React10.useState(idOverride); 7156 const id = idOverride || defaultId; 7157 React10.useEffect(() => { 7158 if (defaultId == null) { 7159 globalId += 1; 7160 setDefaultId(`$prefix}-$globalId}`); 7161 } 7162 }, [defaultId, prefix]); 7163 return id; 7164 } 7165 var maybeReactUseId = SafeReact.useId; 7166 function useId(idOverride, prefix) { 7167 if (maybeReactUseId !== void 0) { 7168 const reactId = maybeReactUseId(); 7169 return idOverride ?? (prefix ? `$prefix}-$reactId}` : reactId); 7170 } 7171 return useGlobalId(idOverride, prefix); 7172 } 7173 7174 // node_modules/@base-ui/react/internals/useBaseUiId.mjs 7175 function useBaseUiId(idOverride) { 7176 return useId(idOverride, "base-ui"); 7177 } 7178 7179 // node_modules/@base-ui/react/internals/reason-parts.mjs 7180 var reason_parts_exports = {}; 7181 __export(reason_parts_exports, { 7182 cancelOpen: () => cancelOpen, 7183 chipRemovePress: () => chipRemovePress, 7184 clearPress: () => clearPress, 7185 closePress: () => closePress, 7186 closeWatcher: () => closeWatcher, 7187 decrementPress: () => decrementPress, 7188 disabled: () => disabled, 7189 drag: () => drag, 7190 escapeKey: () => escapeKey, 7191 focusOut: () => focusOut, 7192 imperativeAction: () => imperativeAction, 7193 incrementPress: () => incrementPress, 7194 initial: () => initial, 7195 inputBlur: () => inputBlur, 7196 inputChange: () => inputChange, 7197 inputClear: () => inputClear, 7198 inputPaste: () => inputPaste, 7199 inputPress: () => inputPress, 7200 itemPress: () => itemPress, 7201 keyboard: () => keyboard, 7202 linkPress: () => linkPress, 7203 listNavigation: () => listNavigation, 7204 missing: () => missing, 7205 none: () => none, 7206 outsidePress: () => outsidePress, 7207 pointer: () => pointer, 7208 scrub: () => scrub, 7209 siblingOpen: () => siblingOpen, 7210 swipe: () => swipe, 7211 trackPress: () => trackPress, 7212 triggerFocus: () => triggerFocus, 7213 triggerHover: () => triggerHover, 7214 triggerPress: () => triggerPress, 7215 wheel: () => wheel, 7216 windowResize: () => windowResize 7217 }); 7218 var none = "none"; 7219 var triggerPress = "trigger-press"; 7220 var triggerHover = "trigger-hover"; 7221 var triggerFocus = "trigger-focus"; 7222 var outsidePress = "outside-press"; 7223 var itemPress = "item-press"; 7224 var closePress = "close-press"; 7225 var linkPress = "link-press"; 7226 var clearPress = "clear-press"; 7227 var chipRemovePress = "chip-remove-press"; 7228 var trackPress = "track-press"; 7229 var incrementPress = "increment-press"; 7230 var decrementPress = "decrement-press"; 7231 var inputChange = "input-change"; 7232 var inputClear = "input-clear"; 7233 var inputBlur = "input-blur"; 7234 var inputPaste = "input-paste"; 7235 var inputPress = "input-press"; 7236 var focusOut = "focus-out"; 7237 var escapeKey = "escape-key"; 7238 var closeWatcher = "close-watcher"; 7239 var listNavigation = "list-navigation"; 7240 var keyboard = "keyboard"; 7241 var pointer = "pointer"; 7242 var drag = "drag"; 7243 var wheel = "wheel"; 7244 var scrub = "scrub"; 7245 var cancelOpen = "cancel-open"; 7246 var siblingOpen = "sibling-open"; 7247 var disabled = "disabled"; 7248 var missing = "missing"; 7249 var initial = "initial"; 7250 var imperativeAction = "imperative-action"; 7251 var swipe = "swipe"; 7252 var windowResize = "window-resize"; 7253 7254 // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs 7255 function createChangeEventDetails(reason, event, trigger, customProperties) { 7256 let canceled = false; 7257 let allowPropagation = false; 7258 const custom = customProperties ?? EMPTY_OBJECT; 7259 const details = { 7260 reason, 7261 event: event ?? new Event("base-ui"), 7262 cancel() { 7263 canceled = true; 7264 }, 7265 allowPropagation() { 7266 allowPropagation = true; 7267 }, 7268 get isCanceled() { 7269 return canceled; 7270 }, 7271 get isPropagationAllowed() { 7272 return allowPropagation; 7273 }, 7274 trigger, 7275 ...custom 7276 }; 7277 return details; 7278 } 7279 7280 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs 7281 var React12 = __toESM(require_react(), 1); 7282 7283 // node_modules/@base-ui/utils/useOnMount.mjs 7284 var React11 = __toESM(require_react(), 1); 7285 function useOnMount(fn) { 7286 React11.useEffect(fn, EMPTY_ARRAY); 7287 } 7288 7289 // node_modules/@base-ui/utils/useAnimationFrame.mjs 7290 var EMPTY = null; 7291 var LAST_RAF = globalThis.requestAnimationFrame; 7292 var Scheduler = class { 7293 /* This implementation uses an array as a backing data-structure for frame callbacks. 7294 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it 7295 * never calls the native `cancelAnimationFrame` if there are no frames left. This can 7296 * be much more efficient if there is a call pattern that alterns as 7297 * "request-cancel-request-cancel-…". 7298 * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation 7299 * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ 7300 callbacks = []; 7301 callbacksCount = 0; 7302 nextId = 1; 7303 startId = 1; 7304 isScheduled = false; 7305 tick = (timestamp) => { 7306 this.isScheduled = false; 7307 const currentCallbacks = this.callbacks; 7308 const currentCallbacksCount = this.callbacksCount; 7309 this.callbacks = []; 7310 this.callbacksCount = 0; 7311 this.startId = this.nextId; 7312 if (currentCallbacksCount > 0) { 7313 for (let i2 = 0; i2 < currentCallbacks.length; i2 += 1) { 7314 currentCallbacks[i2]?.(timestamp); 7315 } 7316 } 7317 }; 7318 request(fn) { 7319 const id = this.nextId; 7320 this.nextId += 1; 7321 this.callbacks.push(fn); 7322 this.callbacksCount += 1; 7323 const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); 7324 if (!this.isScheduled || didRAFChange) { 7325 requestAnimationFrame(this.tick); 7326 this.isScheduled = true; 7327 } 7328 return id; 7329 } 7330 cancel(id) { 7331 const index = id - this.startId; 7332 if (index < 0 || index >= this.callbacks.length) { 7333 return; 7334 } 7335 this.callbacks[index] = null; 7336 this.callbacksCount -= 1; 7337 } 7338 }; 7339 var scheduler = new Scheduler(); 7340 var AnimationFrame = class _AnimationFrame { 7341 static create() { 7342 return new _AnimationFrame(); 7343 } 7344 static request(fn) { 7345 return scheduler.request(fn); 7346 } 7347 static cancel(id) { 7348 return scheduler.cancel(id); 7349 } 7350 currentId = EMPTY; 7351 /** 7352 * Executes `fn` after `delay`, clearing any previously scheduled call. 7353 */ 7354 request(fn) { 7355 this.cancel(); 7356 this.currentId = scheduler.request(() => { 7357 this.currentId = EMPTY; 7358 fn(); 7359 }); 7360 } 7361 cancel = () => { 7362 if (this.currentId !== EMPTY) { 7363 scheduler.cancel(this.currentId); 7364 this.currentId = EMPTY; 7365 } 7366 }; 7367 disposeEffect = () => { 7368 return this.cancel; 7369 }; 7370 }; 7371 function useAnimationFrame() { 7372 const timeout = useRefWithInit(AnimationFrame.create).current; 7373 useOnMount(timeout.disposeEffect); 7374 return timeout; 7375 } 7376 7377 // node_modules/@base-ui/react/internals/useTransitionStatus.mjs 7378 function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { 7379 const [transitionStatus, setTransitionStatus] = React12.useState(open && enableIdleState ? "idle" : void 0); 7380 const [mounted, setMounted] = React12.useState(open); 7381 if (open && !mounted) { 7382 setMounted(true); 7383 setTransitionStatus("starting"); 7384 } 7385 if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { 7386 setTransitionStatus("ending"); 7387 } 7388 if (!open && !mounted && transitionStatus === "ending") { 7389 setTransitionStatus(void 0); 7390 } 7391 useIsoLayoutEffect(() => { 7392 if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { 7393 const frame = AnimationFrame.request(() => { 7394 setTransitionStatus("ending"); 7395 }); 7396 return () => { 7397 AnimationFrame.cancel(frame); 7398 }; 7399 } 7400 return void 0; 7401 }, [open, mounted, transitionStatus, deferEndingState]); 7402 useIsoLayoutEffect(() => { 7403 if (!open || enableIdleState) { 7404 return void 0; 7405 } 7406 const frame = AnimationFrame.request(() => { 7407 setTransitionStatus(void 0); 7408 }); 7409 return () => { 7410 AnimationFrame.cancel(frame); 7411 }; 7412 }, [enableIdleState, open]); 7413 useIsoLayoutEffect(() => { 7414 if (!open || !enableIdleState) { 7415 return void 0; 7416 } 7417 if (open && mounted && transitionStatus !== "idle") { 7418 setTransitionStatus("starting"); 7419 } 7420 const frame = AnimationFrame.request(() => { 7421 setTransitionStatus("idle"); 7422 }); 7423 return () => { 7424 AnimationFrame.cancel(frame); 7425 }; 7426 }, [enableIdleState, open, mounted, transitionStatus]); 7427 return { 7428 mounted, 7429 setMounted, 7430 transitionStatus 7431 }; 7432 } 7433 7434 // node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs 7435 var React13 = __toESM(require_react(), 1); 7436 function useCompositeListItem(params = {}) { 7437 const { 7438 guess, 7439 label, 7440 metadata, 7441 textRef, 7442 index: externalIndex 7443 } = params; 7444 const { 7445 register, 7446 unregister, 7447 subscribeMapChange, 7448 nextIndexRef 7449 } = useCompositeListContext(); 7450 const indexRef = React13.useRef(-1); 7451 const [internalIndex, setInternalIndex] = React13.useState(externalIndex == null && guess ? () => { 7452 if (indexRef.current === -1) { 7453 const newIndex = nextIndexRef.current; 7454 nextIndexRef.current += 1; 7455 indexRef.current = newIndex; 7456 } 7457 return indexRef.current; 7458 } : -1); 7459 const index = externalIndex ?? internalIndex; 7460 const componentRef = React13.useRef(null); 7461 const ref = React13.useCallback((node) => { 7462 const previousNode = componentRef.current; 7463 if (previousNode) { 7464 unregister(previousNode); 7465 } 7466 componentRef.current = node; 7467 if (node) { 7468 register(node, { 7469 metadata: metadata ?? null, 7470 index: externalIndex ?? null, 7471 label, 7472 textRef 7473 }); 7474 } 7475 }, [externalIndex, register, unregister, metadata, label, textRef]); 7476 useIsoLayoutEffect(() => { 7477 if (externalIndex != null) { 7478 return void 0; 7479 } 7480 return subscribeMapChange((map) => { 7481 const i2 = componentRef.current ? map.get(componentRef.current)?.index : null; 7482 if (i2 != null) { 7483 setInternalIndex(i2); 7484 } 7485 }); 7486 }, [externalIndex, subscribeMapChange]); 7487 return { 7488 ref, 7489 index 7490 }; 7491 } 7492 7493 // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs 7494 var STARTING_HOOK = { 7495 "data-starting-style": "" 7496 }; 7497 var ENDING_HOOK = { 7498 "data-ending-style": "" 7499 }; 7500 var transitionStatusMapping = { 7501 transitionStatus(value) { 7502 if (value === "starting") { 7503 return STARTING_HOOK; 7504 } 7505 if (value === "ending") { 7506 return ENDING_HOOK; 7507 } 7508 return null; 7509 } 7510 }; 7511 7512 // node_modules/@base-ui/react/internals/use-button/useButton.mjs 7513 var React16 = __toESM(require_react(), 1); 7514 7515 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 7516 function hasWindow() { 7517 return typeof window !== "undefined"; 7518 } 7519 function getWindow(node) { 7520 var _node$ownerDocument; 7521 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 7522 } 7523 function isElement(value) { 7524 if (!hasWindow()) { 7525 return false; 7526 } 7527 return value instanceof Element || value instanceof getWindow(value).Element; 7528 } 7529 function isHTMLElement(value) { 7530 if (!hasWindow()) { 7531 return false; 7532 } 7533 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 7534 } 7535 function isShadowRoot(value) { 7536 if (!hasWindow() || typeof ShadowRoot === "undefined") { 7537 return false; 7538 } 7539 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 7540 } 7541 function getComputedStyle2(element) { 7542 return getWindow(element).getComputedStyle(element); 7543 } 7544 7545 // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs 7546 var React14 = __toESM(require_react(), 1); 7547 var CompositeRootContext = /* @__PURE__ */ React14.createContext(void 0); 7548 if (true) CompositeRootContext.displayName = "CompositeRootContext"; 7549 function useCompositeRootContext(optional = false) { 7550 const context = React14.useContext(CompositeRootContext); 7551 if (context === void 0 && !optional) { 7552 throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16)); 7553 } 7554 return context; 7555 } 7556 7557 // node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs 7558 var React15 = __toESM(require_react(), 1); 7559 function useFocusableWhenDisabled(parameters) { 7560 const { 7561 focusableWhenDisabled, 7562 disabled: disabled2, 7563 composite = false, 7564 tabIndex: tabIndexProp = 0, 7565 isNativeButton 7566 } = parameters; 7567 const isFocusableComposite = composite && focusableWhenDisabled !== false; 7568 const isNonFocusableComposite = composite && focusableWhenDisabled === false; 7569 const props = React15.useMemo(() => { 7570 const additionalProps = { 7571 // allow Tabbing away from focusableWhenDisabled elements 7572 onKeyDown(event) { 7573 if (disabled2 && focusableWhenDisabled && event.key !== "Tab") { 7574 event.preventDefault(); 7575 } 7576 } 7577 }; 7578 if (!composite) { 7579 additionalProps.tabIndex = tabIndexProp; 7580 if (!isNativeButton && disabled2) { 7581 additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1; 7582 } 7583 } 7584 if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) { 7585 additionalProps["aria-disabled"] = disabled2; 7586 } 7587 if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) { 7588 additionalProps.disabled = disabled2; 7589 } 7590 return additionalProps; 7591 }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]); 7592 return { 7593 props 7594 }; 7595 } 7596 7597 // node_modules/@base-ui/utils/owner.mjs 7598 function ownerDocument(node) { 7599 return node?.ownerDocument || document; 7600 } 7601 7602 // node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs 7603 function dispatchClickWithModifiers(target, sourceEvent, { 7604 detail = 0 7605 } = {}) { 7606 target.dispatchEvent(new (getWindow(target)).PointerEvent("click", { 7607 bubbles: true, 7608 cancelable: true, 7609 composed: true, 7610 detail, 7611 shiftKey: sourceEvent.shiftKey, 7612 ctrlKey: sourceEvent.ctrlKey, 7613 altKey: sourceEvent.altKey, 7614 metaKey: sourceEvent.metaKey 7615 })); 7616 } 7617 7618 // node_modules/@base-ui/react/internals/use-button/useButton.mjs 7619 function useButton(parameters = {}) { 7620 const { 7621 disabled: disabled2 = false, 7622 focusableWhenDisabled, 7623 tabIndex = 0, 7624 native: isNativeButton = true, 7625 composite: compositeProp 7626 } = parameters; 7627 const elementRef = React16.useRef(null); 7628 const compositeRootContext = useCompositeRootContext(true); 7629 const isCompositeItem = compositeProp ?? compositeRootContext !== void 0; 7630 const { 7631 props: focusableWhenDisabledProps 7632 } = useFocusableWhenDisabled({ 7633 focusableWhenDisabled, 7634 disabled: disabled2, 7635 composite: isCompositeItem, 7636 tabIndex, 7637 isNativeButton 7638 }); 7639 if (true) { 7640 React16.useEffect(() => { 7641 if (!elementRef.current) { 7642 return; 7643 } 7644 const isButtonTag = isButtonElement(elementRef.current); 7645 if (isNativeButton) { 7646 if (!isButtonTag) { 7647 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 7648 const message = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`."; 7649 error(`$message}$ownerStackMessage}`); 7650 } 7651 } else if (isButtonTag) { 7652 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 7653 const message = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`."; 7654 error(`$message}$ownerStackMessage}`); 7655 } 7656 }, [isNativeButton]); 7657 } 7658 const updateDisabled = React16.useCallback(() => { 7659 const element = elementRef.current; 7660 if (!isButtonElement(element)) { 7661 return; 7662 } 7663 if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) { 7664 element.disabled = false; 7665 } 7666 }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]); 7667 useIsoLayoutEffect(updateDisabled, [updateDisabled]); 7668 const getButtonProps = React16.useCallback((externalProps = {}) => { 7669 const { 7670 onClick: externalOnClick, 7671 onMouseDown: externalOnMouseDown, 7672 onKeyUp: externalOnKeyUp, 7673 onKeyDown: externalOnKeyDown, 7674 onPointerDown: externalOnPointerDown, 7675 ...otherExternalProps 7676 } = externalProps; 7677 return mergeProps({ 7678 onClick(event) { 7679 if (disabled2) { 7680 event.preventDefault(); 7681 return; 7682 } 7683 externalOnClick?.(event); 7684 }, 7685 onMouseDown(event) { 7686 if (!disabled2) { 7687 externalOnMouseDown?.(event); 7688 } 7689 }, 7690 onKeyDown(event) { 7691 if (disabled2) { 7692 return; 7693 } 7694 makeEventPreventable(event); 7695 externalOnKeyDown?.(event); 7696 if (event.baseUIHandlerPrevented) { 7697 return; 7698 } 7699 const isCurrentTarget = event.target === event.currentTarget; 7700 const currentTarget = event.currentTarget; 7701 const isButton = isButtonElement(currentTarget); 7702 const isLink = !isNativeButton && isValidLinkElement(currentTarget); 7703 const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink); 7704 const isEnterKey = event.key === "Enter"; 7705 const isSpaceKey = event.key === " "; 7706 const role = currentTarget.getAttribute("role"); 7707 const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell"; 7708 if (isCurrentTarget && isCompositeItem && isSpaceKey) { 7709 if (event.defaultPrevented && isTextNavigationRole) { 7710 return; 7711 } 7712 event.preventDefault(); 7713 if (!isNativeButton || isButton) { 7714 event.preventBaseUIHandler(); 7715 dispatchClickWithModifiers(currentTarget, event); 7716 } 7717 return; 7718 } 7719 if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) { 7720 if (isCurrentTarget && isLink && isSpaceKey) { 7721 event.preventDefault(); 7722 } 7723 return; 7724 } 7725 if (event.defaultPrevented) { 7726 return; 7727 } 7728 event.preventDefault(); 7729 if (isEnterKey) { 7730 event.preventBaseUIHandler(); 7731 dispatchClickWithModifiers(currentTarget, event); 7732 } 7733 }, 7734 onKeyUp(event) { 7735 if (disabled2) { 7736 return; 7737 } 7738 makeEventPreventable(event); 7739 externalOnKeyUp?.(event); 7740 if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") { 7741 event.preventDefault(); 7742 return; 7743 } 7744 if (event.baseUIHandlerPrevented) { 7745 return; 7746 } 7747 if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") { 7748 event.preventBaseUIHandler(); 7749 dispatchClickWithModifiers(event.currentTarget, event); 7750 } 7751 }, 7752 onPointerDown(event) { 7753 if (disabled2) { 7754 event.preventDefault(); 7755 return; 7756 } 7757 externalOnPointerDown?.(event); 7758 } 7759 }, isNativeButton ? { 7760 type: "button" 7761 } : { 7762 role: "button" 7763 }, focusableWhenDisabledProps, otherExternalProps); 7764 }, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]); 7765 const buttonRef = useStableCallback((element) => { 7766 elementRef.current = element; 7767 updateDisabled(); 7768 }); 7769 return { 7770 getButtonProps, 7771 buttonRef 7772 }; 7773 } 7774 function isButtonElement(elem) { 7775 return isHTMLElement(elem) && elem.tagName === "BUTTON"; 7776 } 7777 function isValidLinkElement(elem) { 7778 return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href); 7779 } 7780 7781 // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 7782 var React17 = __toESM(require_react(), 1); 7783 7784 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 7785 var ReactDOM = __toESM(require_react_dom(), 1); 7786 7787 // node_modules/@base-ui/react/utils/resolveRef.mjs 7788 function resolveRef(maybeRef) { 7789 if (maybeRef == null) { 7790 return maybeRef; 7791 } 7792 return "current" in maybeRef ? maybeRef.current : maybeRef; 7793 } 7794 7795 // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 7796 function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false) { 7797 const frame = useAnimationFrame(); 7798 return useStableCallback((fnToExecute, signal = null) => { 7799 frame.cancel(); 7800 const element = resolveRef(elementOrRef); 7801 if (element == null) { 7802 return; 7803 } 7804 const resolvedElement = element; 7805 const done = () => { 7806 ReactDOM.flushSync(fnToExecute); 7807 }; 7808 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { 7809 fnToExecute(); 7810 return; 7811 } 7812 function exec() { 7813 Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { 7814 if (!signal?.aborted) { 7815 done(); 7816 } 7817 }, () => { 7818 if (signal?.aborted) { 7819 return; 7820 } 7821 const currentAnimations = resolvedElement.getAnimations(); 7822 if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { 7823 exec(); 7824 return; 7825 } 7826 done(); 7827 }); 7828 } 7829 if (waitForStartingStyleRemoved) { 7830 const startingStyleAttribute = "data-starting-style"; 7831 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 7832 frame.request(exec); 7833 return; 7834 } 7835 const attributeObserver = new MutationObserver(() => { 7836 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 7837 attributeObserver.disconnect(); 7838 exec(); 7839 } 7840 }); 7841 attributeObserver.observe(resolvedElement, { 7842 attributes: true, 7843 attributeFilter: [startingStyleAttribute] 7844 }); 7845 signal?.addEventListener("abort", () => attributeObserver.disconnect(), { 7846 once: true 7847 }); 7848 return; 7849 } 7850 frame.request(exec); 7851 }); 7852 } 7853 7854 // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 7855 function useOpenChangeComplete(parameters) { 7856 const { 7857 enabled = true, 7858 open, 7859 ref, 7860 onComplete: onCompleteParam 7861 } = parameters; 7862 const onComplete = useStableCallback(onCompleteParam); 7863 const runOnceAnimationsFinish = useAnimationsFinished(ref, open); 7864 React17.useEffect(() => { 7865 if (!enabled) { 7866 return void 0; 7867 } 7868 const abortController = new AbortController(); 7869 runOnceAnimationsFinish(onComplete, abortController.signal); 7870 return () => { 7871 abortController.abort(); 7872 }; 7873 }, [enabled, open, onComplete, runOnceAnimationsFinish]); 7874 } 7875 7876 // node_modules/@base-ui/utils/useTimeout.mjs 7877 var EMPTY2 = 0; 7878 var Timeout = class _Timeout { 7879 static create() { 7880 return new _Timeout(); 7881 } 7882 currentId = EMPTY2; 7883 /** 7884 * Executes `fn` after `delay`, clearing any previously scheduled call. 7885 */ 7886 start(delay, fn) { 7887 this.clear(); 7888 this.currentId = setTimeout(() => { 7889 this.currentId = EMPTY2; 7890 fn(); 7891 }, delay); 7892 } 7893 isStarted() { 7894 return this.currentId !== EMPTY2; 7895 } 7896 clear = () => { 7897 if (this.currentId !== EMPTY2) { 7898 clearTimeout(this.currentId); 7899 this.currentId = EMPTY2; 7900 } 7901 }; 7902 disposeEffect = () => { 7903 return this.clear; 7904 }; 7905 }; 7906 function useTimeout() { 7907 const timeout = useRefWithInit(Timeout.create).current; 7908 useOnMount(timeout.disposeEffect); 7909 return timeout; 7910 } 7911 7912 // node_modules/@base-ui/react/internals/shadowDom.mjs 7913 function activeElement(doc) { 7914 let element = doc.activeElement; 7915 while (element?.shadowRoot?.activeElement != null) { 7916 element = element.shadowRoot.activeElement; 7917 } 7918 return element; 7919 } 7920 function contains(parent, child) { 7921 if (!parent || !child) { 7922 return false; 7923 } 7924 const rootNode = child.getRootNode?.(); 7925 if (parent.contains(child)) { 7926 return true; 7927 } 7928 if (rootNode && isShadowRoot(rootNode)) { 7929 let next2 = child; 7930 while (next2) { 7931 if (parent === next2) { 7932 return true; 7933 } 7934 next2 = next2.parentNode || next2.host; 7935 } 7936 } 7937 return false; 7938 } 7939 function getTarget(event) { 7940 if ("composedPath" in event) { 7941 return event.composedPath()[0]; 7942 } 7943 return event.target; 7944 } 7945 7946 // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 7947 var round = Math.round; 7948 7949 // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs 7950 function isIndexOutOfListBounds(list, index) { 7951 return index < 0 || index >= list.length; 7952 } 7953 function getMinListIndex(listRef, disabledIndices) { 7954 return findNonDisabledListIndex(listRef.current, { 7955 disabledIndices 7956 }); 7957 } 7958 function getMaxListIndex(listRef, disabledIndices) { 7959 return findNonDisabledListIndex(listRef.current, { 7960 decrement: true, 7961 startingIndex: listRef.current.length, 7962 disabledIndices 7963 }); 7964 } 7965 function findNonDisabledListIndex(list, { 7966 startingIndex = -1, 7967 decrement = false, 7968 disabledIndices, 7969 amount = 1 7970 } = {}) { 7971 let index = startingIndex; 7972 do { 7973 index += decrement ? -amount : amount; 7974 } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices)); 7975 return index; 7976 } 7977 function isListIndexDisabled(list, index, disabledIndices) { 7978 const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index) : disabledIndices?.includes(index) ?? false; 7979 if (isExplicitlyDisabled) { 7980 return true; 7981 } 7982 const element = list[index]; 7983 if (!element) { 7984 return false; 7985 } 7986 if (!isElementVisible(element)) { 7987 return true; 7988 } 7989 if (element.matches(":disabled")) { 7990 return true; 7991 } 7992 return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true"); 7993 } 7994 function isHiddenByStyles(styles) { 7995 return styles.visibility === "hidden" || styles.visibility === "collapse"; 7996 } 7997 function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { 7998 if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { 7999 return false; 8000 } 8001 if (typeof element.checkVisibility === "function") { 8002 return element.checkVisibility(); 8003 } 8004 return styles.display !== "none" && styles.display !== "contents"; 8005 } 8006 8007 // node_modules/@base-ui/utils/useForcedRerendering.mjs 8008 var React18 = __toESM(require_react(), 1); 8009 function useForcedRerendering() { 8010 const [, setState] = React18.useState({}); 8011 return React18.useCallback(() => { 8012 setState({}); 8013 }, []); 8014 } 8015 8016 // node_modules/@base-ui/react/internals/composite/composite.mjs 8017 var ARROW_UP = "ArrowUp"; 8018 var ARROW_DOWN = "ArrowDown"; 8019 var ARROW_LEFT = "ArrowLeft"; 8020 var ARROW_RIGHT = "ArrowRight"; 8021 var HOME = "Home"; 8022 var END = "End"; 8023 var COMPOSITE_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]); 8024 var SHIFT = "Shift"; 8025 var MODIFIER_KEYS = [SHIFT, "Control", "Alt", "Meta"]; 8026 function isInputElement(element) { 8027 return isHTMLElement(element) && element.tagName === "INPUT"; 8028 } 8029 function isNativeInput(element) { 8030 if (isInputElement(element) && element.selectionStart != null) { 8031 return true; 8032 } 8033 if (isHTMLElement(element) && element.tagName === "TEXTAREA") { 8034 return true; 8035 } 8036 return false; 8037 } 8038 function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) { 8039 if (!scrollContainer || !element || !element.scrollTo) { 8040 return; 8041 } 8042 let targetX = scrollContainer.scrollLeft; 8043 let targetY = scrollContainer.scrollTop; 8044 const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth; 8045 const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight; 8046 if (isOverflowingX && orientation !== "vertical") { 8047 const elementOffsetLeft = getOffset(scrollContainer, element, "left"); 8048 const containerStyles = getStyles(scrollContainer); 8049 const elementStyles = getStyles(element); 8050 if (direction === "ltr") { 8051 if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) { 8052 targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight; 8053 } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) { 8054 targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft; 8055 } 8056 } 8057 if (direction === "rtl") { 8058 if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) { 8059 targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft; 8060 } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) { 8061 targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight; 8062 } 8063 } 8064 } 8065 if (isOverflowingY && orientation !== "horizontal") { 8066 const elementOffsetTop = getOffset(scrollContainer, element, "top"); 8067 const containerStyles = getStyles(scrollContainer); 8068 const elementStyles = getStyles(element); 8069 if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) { 8070 targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop; 8071 } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) { 8072 targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom; 8073 } 8074 } 8075 scrollContainer.scrollTo({ 8076 left: targetX, 8077 top: targetY, 8078 behavior: "auto" 8079 }); 8080 } 8081 function getOffset(ancestor, element, side) { 8082 const propName = side === "left" ? "offsetLeft" : "offsetTop"; 8083 let result = 0; 8084 while (element.offsetParent) { 8085 result += element[propName]; 8086 if (element.offsetParent === ancestor) { 8087 break; 8088 } 8089 element = element.offsetParent; 8090 } 8091 return result; 8092 } 8093 function getStyles(element) { 8094 const styles = getComputedStyle(element); 8095 return { 8096 scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0, 8097 scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0, 8098 scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0, 8099 scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0, 8100 scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0, 8101 scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0, 8102 scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0, 8103 scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0 8104 }; 8105 } 8106 8107 // node_modules/@base-ui/utils/inertValue.mjs 8108 function inertValue(value) { 8109 if (isReactVersionAtLeast(19)) { 8110 return value; 8111 } 8112 return value ? "true" : void 0; 8113 } 8114 8115 // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs 8116 var React19 = __toESM(require_react(), 1); 8117 8118 // node_modules/@base-ui/react/internals/field-constants/constants.mjs 8119 var DEFAULT_VALIDITY_STATE = { 8120 badInput: false, 8121 customError: false, 8122 patternMismatch: false, 8123 rangeOverflow: false, 8124 rangeUnderflow: false, 8125 stepMismatch: false, 8126 tooLong: false, 8127 tooShort: false, 8128 typeMismatch: false, 8129 valid: null, 8130 valueMissing: false 8131 }; 8132 var DEFAULT_FIELD_STATE_ATTRIBUTES = { 8133 valid: null, 8134 touched: false, 8135 dirty: false, 8136 filled: false, 8137 focused: false 8138 }; 8139 var DEFAULT_FIELD_ROOT_STATE = { 8140 disabled: false, 8141 ...DEFAULT_FIELD_STATE_ATTRIBUTES 8142 }; 8143 var fieldValidityMapping = { 8144 valid(value) { 8145 if (value === null) { 8146 return null; 8147 } 8148 if (value) { 8149 return { 8150 "data-valid": "" 8151 }; 8152 } 8153 return { 8154 "data-invalid": "" 8155 }; 8156 } 8157 }; 8158 8159 // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs 8160 var DEFAULT_FIELD_ROOT_CONTEXT = { 8161 invalid: void 0, 8162 name: void 0, 8163 validityData: { 8164 state: DEFAULT_VALIDITY_STATE, 8165 errors: [], 8166 error: "", 8167 value: "", 8168 initialValue: null 8169 }, 8170 setValidityData: NOOP, 8171 disabled: void 0, 8172 setTouched: NOOP, 8173 setDirty: NOOP, 8174 setFilled: NOOP, 8175 setFocused: NOOP, 8176 validationMode: "onSubmit", 8177 shouldValidateOnChange: () => false, 8178 state: DEFAULT_FIELD_ROOT_STATE, 8179 registerFieldControl: NOOP, 8180 validation: { 8181 getValidationProps: (_disabled, props = EMPTY_OBJECT) => props, 8182 inputRef: { 8183 current: null 8184 }, 8185 registeredInputs: /* @__PURE__ */ new Map(), 8186 registerInput: NOOP, 8187 getInputControl: () => null, 8188 commit: async () => { 8189 }, 8190 change: NOOP 8191 } 8192 }; 8193 var FieldRootContext = /* @__PURE__ */ React19.createContext(DEFAULT_FIELD_ROOT_CONTEXT); 8194 if (true) FieldRootContext.displayName = "FieldRootContext"; 8195 function useFieldRootContext(optional = true) { 8196 const context = React19.useContext(FieldRootContext); 8197 if (context.setValidityData === NOOP && !optional) { 8198 throw new Error(true ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28)); 8199 } 8200 return context; 8201 } 8202 8203 // node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs 8204 function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name118) { 8205 const { 8206 registerFieldControl 8207 } = useFieldRootContext(); 8208 const sourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol()); 8209 useIsoLayoutEffect(() => { 8210 const source = sourceRef.current; 8211 if (!enabled) { 8212 registerFieldControl(source, void 0); 8213 return; 8214 } 8215 const registration = { 8216 controlRef, 8217 getValue: getFormValueOverride, 8218 id, 8219 name: name118, 8220 value 8221 }; 8222 registerFieldControl(source, registration); 8223 }, [controlRef, enabled, getFormValueOverride, id, name118, registerFieldControl, sourceRef, value]); 8224 useIsoLayoutEffect(() => { 8225 const source = sourceRef.current; 8226 return () => { 8227 registerFieldControl(source, void 0); 8228 }; 8229 }, [registerFieldControl, sourceRef]); 8230 } 8231 8232 // node_modules/@base-ui/react/internals/form-context/FormContext.mjs 8233 var React20 = __toESM(require_react(), 1); 8234 var FormContext = /* @__PURE__ */ React20.createContext({ 8235 elementRef: { 8236 current: null 8237 }, 8238 formRef: { 8239 current: { 8240 fields: /* @__PURE__ */ new Map() 8241 } 8242 }, 8243 errors: {}, 8244 clearErrors: NOOP, 8245 validationMode: "onSubmit", 8246 submitAttemptedRef: { 8247 current: false 8248 } 8249 }); 8250 if (true) FormContext.displayName = "FormContext"; 8251 function useFormContext() { 8252 return React20.useContext(FormContext); 8253 } 8254 8255 // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs 8256 var React22 = __toESM(require_react(), 1); 8257 8258 // node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs 8259 var React21 = __toESM(require_react(), 1); 8260 var LabelableContext = /* @__PURE__ */ React21.createContext({ 8261 controlId: void 0, 8262 registerControlId: NOOP, 8263 labelId: void 0, 8264 setLabelId: NOOP, 8265 messageIds: [], 8266 setMessageIds: NOOP, 8267 getDescriptionProps: (externalProps) => externalProps 8268 }); 8269 if (true) LabelableContext.displayName = "LabelableContext"; 8270 function useLabelableContext() { 8271 return React21.useContext(LabelableContext); 8272 } 8273 8274 // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs 8275 function useLabelableId(params = {}) { 8276 const { 8277 id, 8278 implicit = false, 8279 controlRef 8280 } = params; 8281 const { 8282 controlId, 8283 registerControlId 8284 } = useLabelableContext(); 8285 const defaultId = useBaseUiId(id); 8286 const controlIdForEffect = implicit ? controlId : void 0; 8287 const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol()); 8288 const hasRegisteredRef = React22.useRef(false); 8289 const hadExplicitIdRef = React22.useRef(id != null); 8290 const unregisterControlId = useStableCallback(() => { 8291 if (!hasRegisteredRef.current || registerControlId === NOOP) { 8292 return; 8293 } 8294 hasRegisteredRef.current = false; 8295 registerControlId(controlSourceRef.current, void 0); 8296 }); 8297 useIsoLayoutEffect(() => { 8298 if (registerControlId === NOOP) { 8299 return void 0; 8300 } 8301 let nextId; 8302 if (implicit) { 8303 const elem = controlRef?.current; 8304 if (isElement(elem) && elem.closest("label") != null) { 8305 nextId = id ?? null; 8306 } else { 8307 nextId = controlIdForEffect ?? defaultId; 8308 } 8309 } else if (id != null) { 8310 hadExplicitIdRef.current = true; 8311 nextId = id; 8312 } else if (hadExplicitIdRef.current) { 8313 nextId = defaultId; 8314 } else { 8315 unregisterControlId(); 8316 return void 0; 8317 } 8318 if (nextId === void 0) { 8319 unregisterControlId(); 8320 return void 0; 8321 } 8322 hasRegisteredRef.current = true; 8323 registerControlId(controlSourceRef.current, nextId); 8324 return void 0; 8325 }, [id, controlRef, controlIdForEffect, registerControlId, implicit, defaultId, controlSourceRef, unregisterControlId]); 8326 React22.useEffect(() => { 8327 return unregisterControlId; 8328 }, [unregisterControlId]); 8329 return controlId ?? defaultId; 8330 } 8331 8332 // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs 8333 var React23 = __toESM(require_react(), 1); 8334 var DirectionContext = /* @__PURE__ */ React23.createContext(void 0); 8335 if (true) DirectionContext.displayName = "DirectionContext"; 8336 function useDirection() { 8337 const context = React23.useContext(DirectionContext); 8338 return context?.direction ?? "ltr"; 8339 } 8340 8341 // node_modules/@base-ui/react/field/item/FieldItemContext.mjs 8342 var React24 = __toESM(require_react(), 1); 8343 var FieldItemContext = /* @__PURE__ */ React24.createContext({ 8344 disabled: false 8345 }); 8346 if (true) FieldItemContext.displayName = "FieldItemContext"; 8347 function useFieldItemContext() { 8348 const context = React24.useContext(FieldItemContext); 8349 return context; 8350 } 8351 8352 // node_modules/@base-ui/react/field/root/useFieldValidation.mjs 8353 var React25 = __toESM(require_react(), 1); 8354 8355 // node_modules/@base-ui/react/field/utils/getCombinedFieldValidityData.mjs 8356 function getCombinedFieldValidityData(validityData, invalid) { 8357 return { 8358 ...validityData, 8359 state: { 8360 ...validityData.state, 8361 valid: !invalid && validityData.state.valid 8362 } 8363 }; 8364 } 8365 8366 // node_modules/@base-ui/react/field/root/useFieldValidation.mjs 8367 var validityKeys = Object.keys(DEFAULT_VALIDITY_STATE); 8368 function isEligibleInput(input, formElement) { 8369 if (input.matches(":disabled")) { 8370 return false; 8371 } 8372 if (!formElement || input.form === formElement) { 8373 return true; 8374 } 8375 return input.form === null && !input.hasAttribute("form"); 8376 } 8377 function findRepresentativeInput(inputs, formElement) { 8378 let fallback2 = null; 8379 for (const input of inputs.keys()) { 8380 if (!isEligibleInput(input, formElement)) { 8381 continue; 8382 } 8383 if (!input.validity.valid) { 8384 return input; 8385 } 8386 fallback2 ??= input; 8387 } 8388 return fallback2; 8389 } 8390 function clearCustomValidity(element, inputs) { 8391 for (const input of inputs.keys()) { 8392 input.setCustomValidity(""); 8393 } 8394 element?.setCustomValidity(""); 8395 } 8396 function useFieldValidation(params) { 8397 const { 8398 elementRef, 8399 formRef 8400 } = useFormContext(); 8401 const { 8402 setValidityData, 8403 validate, 8404 validityData, 8405 validationDebounceTime, 8406 invalid, 8407 markedDirtyRef, 8408 state, 8409 shouldValidateOnChange, 8410 registeredFieldIdRef 8411 } = params; 8412 const { 8413 controlId, 8414 getDescriptionProps 8415 } = useLabelableContext(); 8416 const timeout = useTimeout(); 8417 const inputRef = React25.useRef(null); 8418 const registeredInputs = useRefWithInit(() => /* @__PURE__ */ new Map()).current; 8419 const validationCommitIdRef = React25.useRef(0); 8420 const registerInput = React25.useCallback((element, registration) => { 8421 registeredInputs.set(element, registration); 8422 return () => { 8423 registeredInputs.delete(element); 8424 }; 8425 }, [registeredInputs]); 8426 const getInputControl = useStableCallback(() => { 8427 const element = findRepresentativeInput(registeredInputs, elementRef.current); 8428 return element && registeredInputs.get(element)?.controlRef.current || null; 8429 }); 8430 const commit = useStableCallback(async (value, revalidate = false) => { 8431 validationCommitIdRef.current += 1; 8432 const validationCommitId = validationCommitIdRef.current; 8433 function updateRegisteredFieldValidity(nextValidityData2, externalInvalid = invalid) { 8434 const fieldId = registeredFieldIdRef.current ?? controlId; 8435 if (fieldId == null) { 8436 return; 8437 } 8438 const currentFieldData = formRef.current.fields.get(fieldId); 8439 if (!currentFieldData) { 8440 return; 8441 } 8442 const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData2, externalInvalid); 8443 formRef.current.fields.set(fieldId, { 8444 ...currentFieldData, 8445 validityData: validityDataWithFormErrors 8446 }); 8447 } 8448 function publishAllValid(input, externalInvalid) { 8449 const nextValidityData2 = { 8450 value, 8451 state: { 8452 ...DEFAULT_VALIDITY_STATE, 8453 valid: true 8454 }, 8455 error: "", 8456 errors: [], 8457 initialValue: validityData.initialValue 8458 }; 8459 clearCustomValidity(input, registeredInputs); 8460 updateRegisteredFieldValidity(nextValidityData2, externalInvalid); 8461 setValidityData(nextValidityData2); 8462 } 8463 const element = registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current; 8464 if (revalidate) { 8465 if (state.valid !== false || !element) { 8466 return; 8467 } 8468 const currentNativeValidity = element.validity; 8469 if (!currentNativeValidity.valueMissing) { 8470 publishAllValid(element, false); 8471 return; 8472 } 8473 for (const key of validityKeys) { 8474 if (key !== "valid" && key !== "valueMissing" && key !== "customError" && currentNativeValidity[key]) { 8475 return; 8476 } 8477 } 8478 } 8479 function getState(el) { 8480 const computedState = validityKeys.reduce((acc, key) => { 8481 acc[key] = el.validity[key]; 8482 return acc; 8483 }, {}); 8484 let hasOnlyValueMissingError = false; 8485 for (const key of validityKeys) { 8486 if (key === "valid") { 8487 continue; 8488 } 8489 if (key === "valueMissing" && computedState[key]) { 8490 hasOnlyValueMissingError = true; 8491 } else if (computedState[key]) { 8492 return computedState; 8493 } 8494 } 8495 if (hasOnlyValueMissingError && !markedDirtyRef.current) { 8496 computedState.valid = true; 8497 computedState.valueMissing = false; 8498 } 8499 return computedState; 8500 } 8501 timeout.clear(); 8502 let result = null; 8503 let validationErrors = []; 8504 const nextState = element ? getState(element) : { 8505 ...DEFAULT_VALIDITY_STATE, 8506 valid: true 8507 }; 8508 let defaultValidationMessage; 8509 const isValidatingOnChange = shouldValidateOnChange(); 8510 if (element && element.validationMessage && !isValidatingOnChange) { 8511 defaultValidationMessage = element.validationMessage; 8512 validationErrors = [element.validationMessage]; 8513 } else { 8514 const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => { 8515 if (field.name) { 8516 acc[field.name] = field.getValue(); 8517 } 8518 return acc; 8519 }, {}); 8520 const resultOrPromise = validate(value, formValues); 8521 if (typeof resultOrPromise === "object" && resultOrPromise !== null && "then" in resultOrPromise) { 8522 result = await resultOrPromise; 8523 if (validationCommitId !== validationCommitIdRef.current) { 8524 return; 8525 } 8526 } else { 8527 result = resultOrPromise; 8528 } 8529 if (result !== null) { 8530 nextState.valid = false; 8531 nextState.customError = true; 8532 if (Array.isArray(result)) { 8533 validationErrors = result; 8534 element?.setCustomValidity(result.join("\n")); 8535 } else if (result) { 8536 validationErrors = [result]; 8537 element?.setCustomValidity(result); 8538 } 8539 } else if (isValidatingOnChange) { 8540 clearCustomValidity(element, registeredInputs); 8541 nextState.customError = false; 8542 if (element && element.validationMessage) { 8543 defaultValidationMessage = element.validationMessage; 8544 validationErrors = [element.validationMessage]; 8545 } else if ((!element || element.validity.valid) && !nextState.valid) { 8546 nextState.valid = true; 8547 } 8548 } 8549 } 8550 const nextValidityData = { 8551 value, 8552 state: nextState, 8553 error: defaultValidationMessage ?? (Array.isArray(result) ? result[0] : result ?? ""), 8554 errors: validationErrors, 8555 initialValue: validityData.initialValue 8556 }; 8557 updateRegisteredFieldValidity(nextValidityData); 8558 setValidityData(nextValidityData); 8559 }); 8560 const change = useStableCallback((value) => { 8561 timeout.clear(); 8562 const validateOnChange = shouldValidateOnChange(); 8563 if (validateOnChange && value !== "" && validationDebounceTime) { 8564 validationCommitIdRef.current += 1; 8565 timeout.start(validationDebounceTime, () => { 8566 commit(value); 8567 }); 8568 } else { 8569 commit(value, !validateOnChange); 8570 } 8571 }); 8572 const getValidationProps = React25.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? { 8573 "aria-invalid": true 8574 } : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]); 8575 return React25.useMemo(() => ({ 8576 getValidationProps, 8577 inputRef, 8578 registeredInputs, 8579 registerInput, 8580 getInputControl, 8581 commit, 8582 change 8583 }), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]); 8584 } 8585 8586 // node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs 8587 function useRegisteredLabelId(idProp, setLabelId) { 8588 const id = useBaseUiId(idProp); 8589 useIsoLayoutEffect(() => { 8590 setLabelId(id); 8591 return () => { 8592 setLabelId((currentId) => currentId === id ? void 0 : currentId); 8593 }; 8594 }, [id, setLabelId]); 8595 return id; 8596 } 8597 8598 // node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs 8599 function useLabel(params = {}) { 8600 const { 8601 id: idProp, 8602 fallbackControlId, 8603 native = false, 8604 setLabelId: setLabelIdProp, 8605 focusControl: focusControlProp 8606 } = params; 8607 const { 8608 controlId: contextControlId, 8609 setLabelId: setContextLabelId 8610 } = useLabelableContext(); 8611 const syncLabelId = useStableCallback((nextLabelId) => { 8612 setContextLabelId(nextLabelId); 8613 setLabelIdProp?.(nextLabelId); 8614 }); 8615 const id = useRegisteredLabelId(idProp, syncLabelId); 8616 const resolvedControlId = contextControlId ?? fallbackControlId; 8617 function focusControl(event) { 8618 if (focusControlProp) { 8619 focusControlProp(event, resolvedControlId); 8620 return; 8621 } 8622 if (!resolvedControlId) { 8623 return; 8624 } 8625 const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId); 8626 if (isHTMLElement(controlElement)) { 8627 focusElementWithVisible(controlElement); 8628 } 8629 } 8630 function handleInteraction(event) { 8631 const target = getTarget(event.nativeEvent); 8632 if (target?.closest("button,input,select,textarea")) { 8633 return; 8634 } 8635 if (!event.defaultPrevented && event.detail > 1) { 8636 event.preventDefault(); 8637 } 8638 if (native) { 8639 return; 8640 } 8641 focusControl(event); 8642 } 8643 return native ? { 8644 id, 8645 htmlFor: resolvedControlId ?? void 0, 8646 onMouseDown: handleInteraction 8647 } : { 8648 id, 8649 onClick: handleInteraction, 8650 onPointerDown(event) { 8651 event.preventDefault(); 8652 } 8653 }; 8654 } 8655 function focusElementWithVisible(element) { 8656 element.focus({ 8657 // Available from Chrome 144+ (January 2026). 8658 // Safari and Firefox already support it. 8659 focusVisible: true 8660 }); 8661 } 8662 8663 // node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs 8664 var React26 = __toESM(require_react(), 1); 8665 function useCompositeItem(params = {}) { 8666 const { 8667 highlightItemOnHover, 8668 highlightedIndex, 8669 onHighlightedIndexChange 8670 } = useCompositeRootContext(); 8671 const { 8672 ref, 8673 index 8674 } = useCompositeListItem(params); 8675 const isHighlighted = highlightedIndex === index; 8676 const itemRef = React26.useRef(null); 8677 const mergedRef = useMergedRefs(ref, itemRef); 8678 const compositeProps = { 8679 tabIndex: isHighlighted ? 0 : -1, 8680 onFocus() { 8681 onHighlightedIndexChange(index); 8682 }, 8683 onMouseMove() { 8684 const item = itemRef.current; 8685 if (!highlightItemOnHover || !item) { 8686 return; 8687 } 8688 const disabled2 = item.hasAttribute("disabled") || item.ariaDisabled === "true"; 8689 if (!isHighlighted && !disabled2) { 8690 item.focus(); 8691 } 8692 } 8693 }; 8694 return { 8695 compositeProps, 8696 compositeRef: mergedRef, 8697 index 8698 }; 8699 } 8700 8701 // node_modules/@base-ui/react/utils/getCssDimensions.mjs 8702 function getCssDimensions(element) { 8703 const css = getComputedStyle2(element); 8704 let width = parseFloat(css.width) || 0; 8705 let height = parseFloat(css.height) || 0; 8706 const hasOffset = isHTMLElement(element); 8707 const offsetWidth = hasOffset ? element.offsetWidth : width; 8708 const offsetHeight = hasOffset ? element.offsetHeight : height; 8709 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 8710 if (shouldFallback) { 8711 width = offsetWidth; 8712 height = offsetHeight; 8713 } 8714 return { 8715 width, 8716 height 8717 }; 8718 } 8719 8720 // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs 8721 var React27 = __toESM(require_react(), 1); 8722 var import_jsx_runtime178 = __toESM(require_jsx_runtime(), 1); 8723 var DirectionProvider = function DirectionProvider2(props) { 8724 const { 8725 direction = "ltr" 8726 } = props; 8727 const contextValue = React27.useMemo(() => ({ 8728 direction 8729 }), [direction]); 8730 return /* @__PURE__ */ (0, import_jsx_runtime178.jsx)(DirectionContext.Provider, { 8731 value: contextValue, 8732 children: props.children 8733 }); 8734 }; 8735 if (true) DirectionProvider.displayName = "DirectionProvider"; 8736 8737 // node_modules/@base-ui/utils/isElementDisabled.mjs 8738 function isElementDisabled(element) { 8739 return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true"; 8740 } 8741 8742 // node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs 8743 var React28 = __toESM(require_react(), 1); 8744 var CSPContext = /* @__PURE__ */ React28.createContext(void 0); 8745 if (true) CSPContext.displayName = "CSPContext"; 8746 var DEFAULT_CSP_CONTEXT_VALUE = { 8747 disableStyleElements: false 8748 }; 8749 function useCSPContext() { 8750 return React28.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE; 8751 } 8752 8753 // node_modules/@base-ui/react/field/index.parts.mjs 8754 var index_parts_exports = {}; 8755 __export(index_parts_exports, { 8756 Control: () => FieldControl, 8757 Description: () => FieldDescription, 8758 Error: () => FieldError, 8759 Item: () => FieldItem, 8760 Label: () => FieldLabel, 8761 Root: () => FieldRoot, 8762 Validity: () => FieldValidity 8763 }); 8764 8765 // node_modules/@base-ui/react/field/root/FieldRoot.mjs 8766 var React32 = __toESM(require_react(), 1); 8767 8768 // node_modules/@base-ui/react/fieldset/root/FieldsetRootContext.mjs 8769 var React29 = __toESM(require_react(), 1); 8770 var FieldsetRootContext = /* @__PURE__ */ React29.createContext(void 0); 8771 if (true) FieldsetRootContext.displayName = "FieldsetRootContext"; 8772 function useFieldsetRootContext(optional = false) { 8773 const context = React29.useContext(FieldsetRootContext); 8774 if (!context && !optional) { 8775 throw new Error(true ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : formatErrorMessage_default(86)); 8776 } 8777 return context; 8778 } 8779 8780 // node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs 8781 var React30 = __toESM(require_react(), 1); 8782 var import_jsx_runtime179 = __toESM(require_jsx_runtime(), 1); 8783 var LabelableProvider = function LabelableProvider2(props) { 8784 const defaultId = useBaseUiId(); 8785 const initialControlId = props.controlId === void 0 ? defaultId : props.controlId; 8786 const [controlId, setControlIdState] = React30.useState(initialControlId); 8787 const [labelId, setLabelId] = React30.useState(props.labelId); 8788 const [messageIds, setMessageIds] = React30.useState([]); 8789 const registrationsRef = useRefWithInit(() => /* @__PURE__ */ new Map()); 8790 const { 8791 messageIds: parentMessageIds 8792 } = useLabelableContext(); 8793 const registerControlId = useStableCallback((source, nextId) => { 8794 const registrations = registrationsRef.current; 8795 if (nextId === void 0) { 8796 registrations.delete(source); 8797 return; 8798 } 8799 registrations.set(source, nextId); 8800 setControlIdState((prev) => { 8801 if (registrations.size === 0) { 8802 return void 0; 8803 } 8804 let nextControlId; 8805 for (const id of registrations.values()) { 8806 if (prev !== void 0 && id === prev) { 8807 return prev; 8808 } 8809 if (nextControlId === void 0) { 8810 nextControlId = id; 8811 } 8812 } 8813 return nextControlId; 8814 }); 8815 }); 8816 const getDescriptionProps = React30.useCallback((externalProps) => { 8817 const ids = externalProps["aria-describedby"] ? externalProps["aria-describedby"].split(" ") : []; 8818 ids.push(...parentMessageIds, ...messageIds); 8819 return { 8820 ...externalProps, 8821 "aria-describedby": Array.from(new Set(ids)).join(" ") || void 0 8822 }; 8823 }, [parentMessageIds, messageIds]); 8824 const contextValue = React30.useMemo(() => ({ 8825 controlId, 8826 registerControlId, 8827 labelId, 8828 setLabelId, 8829 messageIds, 8830 setMessageIds, 8831 getDescriptionProps 8832 }), [controlId, registerControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]); 8833 return /* @__PURE__ */ (0, import_jsx_runtime179.jsx)(LabelableContext.Provider, { 8834 value: contextValue, 8835 children: props.children 8836 }); 8837 }; 8838 if (true) LabelableProvider.displayName = "LabelableProvider"; 8839 8840 // node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs 8841 var React31 = __toESM(require_react(), 1); 8842 function useFieldControlRegistration(params) { 8843 const { 8844 commit, 8845 invalid, 8846 markedDirtyRef, 8847 name: name118, 8848 setRegisteredFieldName, 8849 registeredFieldIdRef, 8850 setValidityData, 8851 validityData 8852 } = params; 8853 const { 8854 formRef 8855 } = useFormContext(); 8856 const activeFieldControlSourceRef = React31.useRef(null); 8857 const registrationRef = React31.useRef(null); 8858 const initialValueCapturedRef = React31.useRef(false); 8859 const getValueForForm = useStableCallback(() => { 8860 const registration = registrationRef.current; 8861 if (!registration) { 8862 return void 0; 8863 } 8864 if (registration.getValue) { 8865 return registration.getValue(); 8866 } 8867 return registration.value; 8868 }); 8869 function getRegistrationValue(registration) { 8870 return registration.value === void 0 ? getValueForForm() : registration.value; 8871 } 8872 const validate = useStableCallback(() => { 8873 const registration = registrationRef.current; 8874 markedDirtyRef.current = true; 8875 if (!registration) { 8876 commit(validityData.value); 8877 return; 8878 } 8879 commit(getRegistrationValue(registration)); 8880 }); 8881 function refreshRegistration() { 8882 const registration = registrationRef.current; 8883 if (!registration || !registration.id) { 8884 return; 8885 } 8886 formRef.current.fields.set(registration.id, { 8887 getValue: getValueForForm, 8888 name: name118 ?? registration.name, 8889 controlRef: registration.controlRef, 8890 validityData: getCombinedFieldValidityData(validityData, invalid), 8891 validate 8892 }); 8893 } 8894 function deleteRegistration(id = registrationRef.current?.id) { 8895 if (id) { 8896 formRef.current.fields.delete(id); 8897 } 8898 } 8899 function captureInitialValue(registration) { 8900 if (initialValueCapturedRef.current) { 8901 return; 8902 } 8903 initialValueCapturedRef.current = true; 8904 const initialValue = getRegistrationValue(registration); 8905 setValidityData((prev) => prev.initialValue === initialValue ? prev : { 8906 ...prev, 8907 initialValue 8908 }); 8909 } 8910 useIsoLayoutEffect(() => { 8911 const registration = registrationRef.current; 8912 if (!registration || !registration.id) { 8913 return; 8914 } 8915 setRegisteredFieldName(name118 ? void 0 : registration.name); 8916 formRef.current.fields.set(registration.id, { 8917 getValue: getValueForForm, 8918 name: name118 ?? registration.name, 8919 controlRef: registration.controlRef, 8920 validityData: getCombinedFieldValidityData(validityData, invalid), 8921 validate 8922 }); 8923 }, [formRef, getValueForForm, invalid, name118, setRegisteredFieldName, validate, validityData]); 8924 useIsoLayoutEffect(() => { 8925 const fields = formRef.current.fields; 8926 return () => { 8927 const id = registrationRef.current?.id; 8928 if (id) { 8929 fields.delete(id); 8930 } 8931 }; 8932 }, [formRef]); 8933 const register = useStableCallback((source, registration) => { 8934 if (!registration) { 8935 if (activeFieldControlSourceRef.current === source) { 8936 activeFieldControlSourceRef.current = null; 8937 deleteRegistration(); 8938 registrationRef.current = null; 8939 setRegisteredFieldName(void 0); 8940 registeredFieldIdRef.current = void 0; 8941 } 8942 return; 8943 } 8944 const previousId = registrationRef.current?.id; 8945 activeFieldControlSourceRef.current = source; 8946 registrationRef.current = registration; 8947 if (!name118) { 8948 setRegisteredFieldName(registration.name); 8949 } 8950 registeredFieldIdRef.current = registration.id; 8951 if (previousId && previousId !== registration.id) { 8952 deleteRegistration(previousId); 8953 } 8954 captureInitialValue(registration); 8955 refreshRegistration(); 8956 }); 8957 return [validate, register]; 8958 } 8959 8960 // node_modules/@base-ui/react/field/root/FieldRoot.mjs 8961 var import_jsx_runtime180 = __toESM(require_jsx_runtime(), 1); 8962 var FieldRootInner = /* @__PURE__ */ React32.forwardRef(function FieldRootInner2(componentProps, forwardedRef) { 8963 const { 8964 errors, 8965 validationMode: formValidationMode, 8966 submitAttemptedRef 8967 } = useFormContext(); 8968 const { 8969 render, 8970 className, 8971 validate: validateProp, 8972 validationDebounceTime = 0, 8973 validationMode = formValidationMode, 8974 name: name118, 8975 disabled: disabledProp = false, 8976 invalid: invalidProp, 8977 dirty: dirtyProp, 8978 touched: touchedProp, 8979 actionsRef, 8980 style: style2, 8981 ...elementProps 8982 } = componentProps; 8983 const disabledFieldset = useFieldsetRootContext(true)?.disabled; 8984 const validate = useStableCallback(validateProp || (() => null)); 8985 const disabled2 = disabledFieldset || disabledProp; 8986 const [touchedState, setTouchedUnwrapped] = React32.useState(false); 8987 const [dirtyState, setDirtyUnwrapped] = React32.useState(false); 8988 const [filled, setFilled] = React32.useState(false); 8989 const [focused, setFocused] = React32.useState(false); 8990 const dirty = dirtyProp ?? dirtyState; 8991 const touched = touchedProp ?? touchedState; 8992 const markedDirtyRef = React32.useRef(dirty); 8993 const registeredFieldIdRef = React32.useRef(void 0); 8994 const [registeredFieldName, setRegisteredFieldName] = React32.useState(); 8995 const effectiveName = name118 ?? registeredFieldName; 8996 useIsoLayoutEffect(() => { 8997 if (dirtyProp !== void 0) { 8998 markedDirtyRef.current = dirtyProp; 8999 } 9000 }, [dirtyProp]); 9001 const setDirty = useStableCallback((value) => { 9002 if (dirtyProp !== void 0) { 9003 return; 9004 } 9005 if (value) { 9006 markedDirtyRef.current = true; 9007 } 9008 setDirtyUnwrapped(value); 9009 }); 9010 const setTouched = useStableCallback((value) => { 9011 if (touchedProp !== void 0) { 9012 return; 9013 } 9014 setTouchedUnwrapped(value); 9015 }); 9016 const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitAttemptedRef.current); 9017 const formError = effectiveName && Object.hasOwn(errors, effectiveName) ? errors[effectiveName] : null; 9018 const hasFormError = !!(Array.isArray(formError) ? formError.length : formError); 9019 const invalid = invalidProp === true || hasFormError; 9020 const [validityData, setValidityData] = React32.useState({ 9021 state: DEFAULT_VALIDITY_STATE, 9022 error: "", 9023 errors: [], 9024 value: null, 9025 initialValue: null 9026 }); 9027 const valid = !invalid && (disabled2 ? null : validityData.state.valid); 9028 const state = React32.useMemo(() => ({ 9029 disabled: disabled2, 9030 touched, 9031 dirty, 9032 valid, 9033 filled, 9034 focused 9035 }), [disabled2, touched, dirty, valid, filled, focused]); 9036 const validation = useFieldValidation({ 9037 setValidityData, 9038 validate, 9039 validityData, 9040 validationDebounceTime, 9041 invalid, 9042 markedDirtyRef, 9043 state, 9044 shouldValidateOnChange, 9045 registeredFieldIdRef 9046 }); 9047 const [validateFieldControl, registerFieldControl] = useFieldControlRegistration({ 9048 commit: validation.commit, 9049 invalid, 9050 markedDirtyRef, 9051 name: name118, 9052 setRegisteredFieldName, 9053 registeredFieldIdRef, 9054 setValidityData, 9055 validityData 9056 }); 9057 React32.useImperativeHandle(actionsRef, () => ({ 9058 validate: validateFieldControl 9059 }), [validateFieldControl]); 9060 const contextValue = React32.useMemo(() => ({ 9061 invalid, 9062 name: effectiveName, 9063 validityData, 9064 setValidityData, 9065 disabled: disabled2, 9066 setTouched, 9067 setDirty, 9068 setFilled, 9069 setFocused, 9070 validationMode, 9071 shouldValidateOnChange, 9072 state, 9073 registerFieldControl, 9074 validation 9075 }), [invalid, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]); 9076 const element = useRenderElement("div", componentProps, { 9077 ref: forwardedRef, 9078 state, 9079 props: elementProps, 9080 stateAttributesMapping: fieldValidityMapping 9081 }); 9082 return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(FieldRootContext.Provider, { 9083 value: contextValue, 9084 children: element 9085 }); 9086 }); 9087 if (true) FieldRootInner.displayName = "FieldRootInner"; 9088 var FieldRoot = /* @__PURE__ */ React32.forwardRef(function FieldRoot2(componentProps, forwardedRef) { 9089 return /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(LabelableProvider, { 9090 children: /* @__PURE__ */ (0, import_jsx_runtime180.jsx)(FieldRootInner, { 9091 ...componentProps, 9092 ref: forwardedRef 9093 }) 9094 }); 9095 }); 9096 if (true) FieldRoot.displayName = "FieldRoot"; 9097 9098 // node_modules/@base-ui/react/field/label/FieldLabel.mjs 9099 var React33 = __toESM(require_react(), 1); 9100 var FieldLabel = /* @__PURE__ */ React33.forwardRef(function FieldLabel2(componentProps, forwardedRef) { 9101 const { 9102 render, 9103 className, 9104 style: style2, 9105 id: idProp, 9106 nativeLabel = true, 9107 ...elementProps 9108 } = componentProps; 9109 const fieldRootContext = useFieldRootContext(false); 9110 const fieldItemContext = useFieldItemContext(); 9111 const { 9112 labelId 9113 } = useLabelableContext(); 9114 const state = { 9115 ...fieldRootContext.state, 9116 disabled: fieldRootContext.disabled || fieldItemContext.disabled 9117 }; 9118 const labelRef = React33.useRef(null); 9119 const labelProps = useLabel({ 9120 id: labelId ?? idProp, 9121 native: nativeLabel 9122 }); 9123 if (true) { 9124 React33.useEffect(() => { 9125 if (!labelRef.current) { 9126 return; 9127 } 9128 const isLabelTag = labelRef.current.tagName === "LABEL"; 9129 if (nativeLabel) { 9130 if (!isLabelTag) { 9131 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 9132 const message = "<Field.Label> expected a <label> element because the `nativeLabel` prop is true. Rendering a non-<label> disables native label association, so `htmlFor` will not work. Use a real <label> in the `render` prop, or set `nativeLabel` to `false`."; 9133 error(`$message}$ownerStackMessage}`); 9134 } 9135 } else if (isLabelTag) { 9136 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 9137 const message = "<Field.Label> expected a non-<label> element because the `nativeLabel` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the `render` prop, or set `nativeLabel` to `true`."; 9138 error(`$message}$ownerStackMessage}`); 9139 } 9140 }, [nativeLabel]); 9141 } 9142 const element = useRenderElement("label", componentProps, { 9143 ref: [forwardedRef, labelRef], 9144 state, 9145 props: [labelProps, elementProps], 9146 stateAttributesMapping: fieldValidityMapping 9147 }); 9148 return element; 9149 }); 9150 if (true) FieldLabel.displayName = "FieldLabel"; 9151 9152 // node_modules/@base-ui/react/field/error/FieldError.mjs 9153 var React34 = __toESM(require_react(), 1); 9154 var import_jsx_runtime181 = __toESM(require_jsx_runtime(), 1); 9155 var stateAttributesMapping = { 9156 ...fieldValidityMapping, 9157 ...transitionStatusMapping 9158 }; 9159 var FieldError = /* @__PURE__ */ React34.forwardRef(function FieldError2(componentProps, forwardedRef) { 9160 const { 9161 render, 9162 id: idProp, 9163 className, 9164 match, 9165 style: style2, 9166 ...elementProps 9167 } = componentProps; 9168 const id = useBaseUiId(idProp); 9169 const { 9170 validityData, 9171 state: fieldState, 9172 name: name118 9173 } = useFieldRootContext(false); 9174 const { 9175 setMessageIds 9176 } = useLabelableContext(); 9177 const { 9178 errors 9179 } = useFormContext(); 9180 const formError = name118 && Object.hasOwn(errors, name118) ? errors[name118] : null; 9181 const hasFormError = !!(Array.isArray(formError) ? formError.length : formError); 9182 const hasSpecificMatch = typeof match === "string"; 9183 let rendered = false; 9184 if (match === true) { 9185 rendered = true; 9186 } else if (fieldState.disabled) { 9187 rendered = false; 9188 } else if (hasSpecificMatch) { 9189 rendered = Boolean(validityData.state[match]); 9190 } else { 9191 rendered = hasFormError || validityData.state.valid === false; 9192 } 9193 const { 9194 mounted, 9195 transitionStatus, 9196 setMounted 9197 } = useTransitionStatus(rendered); 9198 useIsoLayoutEffect(() => { 9199 if (!rendered || !id) { 9200 return void 0; 9201 } 9202 setMessageIds((v20) => v20.concat(id)); 9203 return () => { 9204 setMessageIds((v20) => v20.filter((item) => item !== id)); 9205 }; 9206 }, [rendered, id, setMessageIds]); 9207 const errorRef = React34.useRef(null); 9208 const [lastRenderedMessage, setLastRenderedMessage] = React34.useState(null); 9209 const [lastRenderedMessageKey, setLastRenderedMessageKey] = React34.useState(null); 9210 let error2 = validityData.error; 9211 if (!hasSpecificMatch && hasFormError) { 9212 error2 = formError; 9213 } else if (validityData.errors.length > 1) { 9214 error2 = validityData.errors; 9215 } 9216 let errorMessage = error2; 9217 if (Array.isArray(error2)) { 9218 errorMessage = error2.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("ul", { 9219 children: error2.map((message) => /* @__PURE__ */ (0, import_jsx_runtime181.jsx)("li", { 9220 children: message 9221 }, message)) 9222 }) : error2[0]; 9223 } 9224 const errorKey = Array.isArray(error2) ? JSON.stringify(error2) : error2; 9225 if (rendered && errorKey !== lastRenderedMessageKey) { 9226 setLastRenderedMessageKey(errorKey); 9227 setLastRenderedMessage(errorMessage); 9228 } 9229 useOpenChangeComplete({ 9230 open: rendered, 9231 ref: errorRef, 9232 onComplete() { 9233 if (!rendered) { 9234 setMounted(false); 9235 } 9236 } 9237 }); 9238 const state = { 9239 ...fieldState, 9240 transitionStatus 9241 }; 9242 const element = useRenderElement("div", componentProps, { 9243 ref: [forwardedRef, errorRef], 9244 state, 9245 props: [{ 9246 id, 9247 children: rendered ? errorMessage : lastRenderedMessage 9248 }, elementProps], 9249 stateAttributesMapping, 9250 enabled: mounted 9251 }); 9252 if (!mounted) { 9253 return null; 9254 } 9255 return element; 9256 }); 9257 if (true) FieldError.displayName = "FieldError"; 9258 9259 // node_modules/@base-ui/react/field/description/FieldDescription.mjs 9260 var React35 = __toESM(require_react(), 1); 9261 var FieldDescription = /* @__PURE__ */ React35.forwardRef(function FieldDescription2(componentProps, forwardedRef) { 9262 const { 9263 render, 9264 id: idProp, 9265 className, 9266 style: style2, 9267 ...elementProps 9268 } = componentProps; 9269 const id = useBaseUiId(idProp); 9270 const fieldRootContext = useFieldRootContext(false); 9271 const fieldItemContext = useFieldItemContext(); 9272 const { 9273 setMessageIds 9274 } = useLabelableContext(); 9275 const state = { 9276 ...fieldRootContext.state, 9277 disabled: fieldRootContext.disabled || fieldItemContext.disabled 9278 }; 9279 useIsoLayoutEffect(() => { 9280 if (!id) { 9281 return void 0; 9282 } 9283 setMessageIds((v20) => v20.concat(id)); 9284 return () => { 9285 setMessageIds((v20) => v20.filter((item) => item !== id)); 9286 }; 9287 }, [id, setMessageIds]); 9288 const element = useRenderElement("p", componentProps, { 9289 ref: forwardedRef, 9290 state, 9291 props: [{ 9292 id 9293 }, elementProps], 9294 stateAttributesMapping: fieldValidityMapping 9295 }); 9296 return element; 9297 }); 9298 if (true) FieldDescription.displayName = "FieldDescription"; 9299 9300 // node_modules/@base-ui/react/field/control/FieldControl.mjs 9301 var React36 = __toESM(require_react(), 1); 9302 var FieldControl = /* @__PURE__ */ React36.forwardRef(function FieldControl2(componentProps, forwardedRef) { 9303 const { 9304 render, 9305 className, 9306 id: idProp, 9307 name: nameProp, 9308 value: valueProp, 9309 disabled: disabledProp = false, 9310 onValueChange, 9311 defaultValue, 9312 autoFocus = false, 9313 style: style2, 9314 ...elementProps 9315 } = componentProps; 9316 const { 9317 state: fieldState, 9318 name: fieldName, 9319 disabled: fieldDisabled, 9320 setTouched, 9321 setDirty, 9322 validityData, 9323 setFocused, 9324 setFilled, 9325 validationMode, 9326 validation 9327 } = useFieldRootContext(); 9328 const { 9329 clearErrors 9330 } = useFormContext(); 9331 const disabled2 = fieldDisabled || disabledProp; 9332 const name118 = fieldName ?? nameProp; 9333 const state = { 9334 ...fieldState, 9335 disabled: disabled2 9336 }; 9337 const { 9338 labelId 9339 } = useLabelableContext(); 9340 const id = useLabelableId({ 9341 id: idProp 9342 }); 9343 useIsoLayoutEffect(() => { 9344 const hasExternalValue = valueProp != null; 9345 if (validation.inputRef.current?.value || hasExternalValue && valueProp !== "") { 9346 setFilled(true); 9347 } else if (hasExternalValue && valueProp === "") { 9348 setFilled(false); 9349 } 9350 }, [validation.inputRef, setFilled, valueProp]); 9351 const inputRef = React36.useRef(null); 9352 useIsoLayoutEffect(() => { 9353 if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) { 9354 setFocused(true); 9355 } 9356 }, [autoFocus, setFocused]); 9357 const [valueUnwrapped] = useControlled({ 9358 controlled: valueProp, 9359 default: defaultValue, 9360 name: "FieldControl", 9361 state: "value" 9362 }); 9363 const isControlled = valueProp !== void 0; 9364 const value = isControlled ? valueUnwrapped : void 0; 9365 const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value); 9366 useRegisterFieldControl(validation.inputRef, id, value, getValueFromInput, !disabled2, nameProp); 9367 const element = useRenderElement("input", componentProps, { 9368 ref: [forwardedRef, inputRef], 9369 state, 9370 props: [{ 9371 id, 9372 disabled: disabled2, 9373 name: name118, 9374 ref: validation.inputRef, 9375 "aria-labelledby": labelId, 9376 autoFocus, 9377 ...isControlled ? { 9378 value 9379 } : { 9380 defaultValue 9381 }, 9382 onChange(event) { 9383 const inputValue = event.currentTarget.value; 9384 onValueChange?.(inputValue, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent)); 9385 setDirty(inputValue !== (validityData.initialValue ?? "")); 9386 setFilled(inputValue !== ""); 9387 if (!event.nativeEvent.defaultPrevented) { 9388 clearErrors(name118); 9389 validation.change(inputValue); 9390 } 9391 }, 9392 onFocus() { 9393 setFocused(true); 9394 }, 9395 onBlur(event) { 9396 setTouched(true); 9397 setFocused(false); 9398 if (validationMode === "onBlur") { 9399 validation.commit(event.currentTarget.value); 9400 } 9401 }, 9402 onKeyDown(event) { 9403 if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") { 9404 setTouched(true); 9405 validation.commit(event.currentTarget.value); 9406 } 9407 } 9408 }, elementProps, (props) => validation.getValidationProps(disabled2, props)], 9409 stateAttributesMapping: fieldValidityMapping 9410 }); 9411 return element; 9412 }); 9413 if (true) FieldControl.displayName = "FieldControl"; 9414 9415 // node_modules/@base-ui/react/field/validity/FieldValidity.mjs 9416 var React37 = __toESM(require_react(), 1); 9417 var import_jsx_runtime182 = __toESM(require_jsx_runtime(), 1); 9418 var FieldValidity = function FieldValidity2(props) { 9419 const { 9420 children 9421 } = props; 9422 const { 9423 validityData, 9424 invalid 9425 } = useFieldRootContext(false); 9426 const combinedFieldValidityData = React37.useMemo(() => getCombinedFieldValidityData(validityData, invalid), [validityData, invalid]); 9427 const isInvalid = combinedFieldValidityData.state.valid === false; 9428 const { 9429 transitionStatus 9430 } = useTransitionStatus(isInvalid); 9431 const fieldValidityState = React37.useMemo(() => { 9432 return { 9433 ...combinedFieldValidityData, 9434 validity: combinedFieldValidityData.state, 9435 transitionStatus 9436 }; 9437 }, [combinedFieldValidityData, transitionStatus]); 9438 return /* @__PURE__ */ (0, import_jsx_runtime182.jsx)(React37.Fragment, { 9439 children: children(fieldValidityState) 9440 }); 9441 }; 9442 if (true) FieldValidity.displayName = "FieldValidity"; 9443 9444 // node_modules/@base-ui/react/field/item/FieldItem.mjs 9445 var React38 = __toESM(require_react(), 1); 9446 var import_jsx_runtime183 = __toESM(require_jsx_runtime(), 1); 9447 var FieldItem = /* @__PURE__ */ React38.forwardRef(function FieldItem2(componentProps, forwardedRef) { 9448 const { 9449 render, 9450 className, 9451 style: style2, 9452 disabled: disabledProp = false, 9453 ...elementProps 9454 } = componentProps; 9455 const { 9456 state: fieldState, 9457 disabled: rootDisabled 9458 } = useFieldRootContext(false); 9459 const disabled2 = rootDisabled || disabledProp; 9460 const state = { 9461 ...fieldState, 9462 disabled: disabled2 9463 }; 9464 const fieldItemContext = React38.useMemo(() => ({ 9465 disabled: disabled2 9466 }), [disabled2]); 9467 const element = useRenderElement("div", componentProps, { 9468 ref: forwardedRef, 9469 state, 9470 props: elementProps, 9471 stateAttributesMapping: fieldValidityMapping 9472 }); 9473 return /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(LabelableProvider, { 9474 children: /* @__PURE__ */ (0, import_jsx_runtime183.jsx)(FieldItemContext.Provider, { 9475 value: fieldItemContext, 9476 children: element 9477 }) 9478 }); 9479 }); 9480 if (true) FieldItem.displayName = "FieldItem"; 9481 9482 // node_modules/@base-ui/react/input/Input.mjs 9483 var React39 = __toESM(require_react(), 1); 9484 var import_jsx_runtime184 = __toESM(require_jsx_runtime(), 1); 9485 var Input = /* @__PURE__ */ React39.forwardRef(function Input2(props, forwardedRef) { 9486 return /* @__PURE__ */ (0, import_jsx_runtime184.jsx)(index_parts_exports.Control, { 9487 ref: forwardedRef, 9488 ...props 9489 }); 9490 }); 9491 if (true) Input.displayName = "Input"; 9492 9493 // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs 9494 var React41 = __toESM(require_react(), 1); 9495 9496 // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs 9497 var React40 = __toESM(require_react(), 1); 9498 9499 // node_modules/@base-ui/react/internals/composite/constants.mjs 9500 var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active"; 9501 9502 // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs 9503 var EMPTY_ARRAY2 = []; 9504 function useCompositeRoot(params) { 9505 const { 9506 loopFocus = true, 9507 orientation = "both", 9508 grid, 9509 onLoop, 9510 direction, 9511 highlightedIndex: externalHighlightedIndex, 9512 onHighlightedIndexChange: externalSetHighlightedIndex, 9513 rootRef: externalRef, 9514 enableHomeAndEndKeys = false, 9515 stopEventPropagation, 9516 disabledIndices, 9517 modifierKeys = EMPTY_ARRAY2 9518 } = params; 9519 const [internalHighlightedIndex, internalSetHighlightedIndex] = React40.useState(0); 9520 const isGrid = grid != null; 9521 const rootRef = React40.useRef(null); 9522 const mergedRef = useMergedRefs(rootRef, externalRef); 9523 const elementsRef = React40.useRef([]); 9524 const hasSetDefaultIndexRef = React40.useRef(false); 9525 const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex; 9526 const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => { 9527 (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index); 9528 if (shouldScrollIntoView) { 9529 const newActiveItem = elementsRef.current[index]; 9530 scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation); 9531 } 9532 }); 9533 const onMapChange = useStableCallback((map) => { 9534 if (map.size === 0 || hasSetDefaultIndexRef.current) { 9535 return; 9536 } 9537 hasSetDefaultIndexRef.current = true; 9538 const sortedElements = Array.from(map.keys()); 9539 const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null; 9540 const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1; 9541 if (activeIndex !== -1) { 9542 onHighlightedIndexChange(activeIndex); 9543 } else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) { 9544 const firstEnabledIndex = findNonDisabledListIndex(sortedElements, { 9545 disabledIndices 9546 }); 9547 if (!isIndexOutOfListBounds(sortedElements, firstEnabledIndex)) { 9548 onHighlightedIndexChange(firstEnabledIndex); 9549 } 9550 } 9551 scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation); 9552 }); 9553 useIsoLayoutEffect(() => { 9554 if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current) { 9555 return; 9556 } 9557 const elements = elementsRef.current; 9558 if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) { 9559 const firstEnabledIndex = findNonDisabledListIndex(elements, { 9560 disabledIndices 9561 }); 9562 if (!isIndexOutOfListBounds(elements, firstEnabledIndex)) { 9563 onHighlightedIndexChange(firstEnabledIndex); 9564 } 9565 } 9566 }, [disabledIndices, externalHighlightedIndex, highlightedIndex, elementsRef, onHighlightedIndexChange]); 9567 const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => { 9568 if (!onLoop) { 9569 return nextIndex; 9570 } 9571 return onLoop(event, prevIndex, nextIndex, elementsRef); 9572 }); 9573 const onKeyDown = useStableCallback((event) => { 9574 const isHomeOrEnd = event.key === HOME || event.key === END; 9575 if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd) { 9576 return; 9577 } 9578 if (isModifierKeySet(event, modifierKeys)) { 9579 return; 9580 } 9581 const element = rootRef.current; 9582 if (!element) { 9583 return; 9584 } 9585 const isRtl = direction === "rtl"; 9586 const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT; 9587 const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT; 9588 const forwardKey = orientation === "vertical" ? ARROW_DOWN : horizontalForwardKey; 9589 const backwardKey = orientation === "vertical" ? ARROW_UP : horizontalBackwardKey; 9590 const target = getTarget(event.nativeEvent); 9591 if (target != null && isNativeInput(target) && !isElementDisabled(target)) { 9592 const selectionStart = target.selectionStart; 9593 const selectionEnd = target.selectionEnd; 9594 const textContent = target.value; 9595 if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) { 9596 return; 9597 } 9598 if (event.key !== backwardKey && selectionStart < textContent.length) { 9599 return; 9600 } 9601 if (event.key !== forwardKey && selectionStart > 0) { 9602 return; 9603 } 9604 } 9605 let nextIndex = highlightedIndex; 9606 const minIndex = getMinListIndex(elementsRef, disabledIndices); 9607 const maxIndex = getMaxListIndex(elementsRef, disabledIndices); 9608 if (grid != null) { 9609 nextIndex = grid({ 9610 disabledIndices, 9611 elementsRef, 9612 event, 9613 highlightedIndex, 9614 loopFocus, 9615 maxIndex, 9616 minIndex, 9617 onLoop: wrappedOnLoop, 9618 orientation, 9619 rtl: isRtl 9620 }); 9621 } 9622 const isForwardKey = orientation !== "vertical" && event.key === horizontalForwardKey || orientation !== "horizontal" && event.key === ARROW_DOWN; 9623 const isBackwardKey = orientation !== "vertical" && event.key === horizontalBackwardKey || orientation !== "horizontal" && event.key === ARROW_UP; 9624 if (enableHomeAndEndKeys) { 9625 if (event.key === HOME) { 9626 nextIndex = minIndex; 9627 } else if (event.key === END) { 9628 nextIndex = maxIndex; 9629 } 9630 } 9631 if (nextIndex === highlightedIndex && (isForwardKey || isBackwardKey)) { 9632 if (loopFocus && nextIndex === maxIndex && isForwardKey) { 9633 nextIndex = minIndex; 9634 if (onLoop) { 9635 nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef); 9636 } 9637 } else if (loopFocus && nextIndex === minIndex && isBackwardKey) { 9638 nextIndex = maxIndex; 9639 if (onLoop) { 9640 nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef); 9641 } 9642 } else { 9643 nextIndex = findNonDisabledListIndex(elementsRef.current, { 9644 startingIndex: nextIndex, 9645 decrement: isBackwardKey, 9646 disabledIndices 9647 }); 9648 } 9649 } 9650 if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) { 9651 if (stopEventPropagation) { 9652 event.stopPropagation(); 9653 } 9654 if (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) { 9655 event.preventDefault(); 9656 } 9657 onHighlightedIndexChange(nextIndex, true); 9658 queueMicrotask(() => { 9659 elementsRef.current[nextIndex]?.focus(); 9660 }); 9661 } 9662 }); 9663 const props = { 9664 ref: mergedRef, 9665 onFocus(event) { 9666 const element = rootRef.current; 9667 const target = getTarget(event.nativeEvent); 9668 if (!element || target == null || !isNativeInput(target)) { 9669 return; 9670 } 9671 target.setSelectionRange(0, target.value.length); 9672 }, 9673 onKeyDown 9674 }; 9675 return { 9676 props, 9677 highlightedIndex, 9678 onHighlightedIndexChange, 9679 elementsRef, 9680 onMapChange, 9681 relayKeyboardEvent: onKeyDown 9682 }; 9683 } 9684 function isModifierKeySet(event, ignoredModifierKeys) { 9685 for (const key of MODIFIER_KEYS) { 9686 if (ignoredModifierKeys.includes(key)) { 9687 continue; 9688 } 9689 if (event.getModifierState(key)) { 9690 return true; 9691 } 9692 } 9693 return false; 9694 } 9695 9696 // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs 9697 var import_jsx_runtime185 = __toESM(require_jsx_runtime(), 1); 9698 function CompositeRoot(componentProps) { 9699 const { 9700 render, 9701 className, 9702 style: style2, 9703 refs = EMPTY_ARRAY, 9704 props = EMPTY_ARRAY, 9705 state = EMPTY_OBJECT, 9706 stateAttributesMapping: stateAttributesMapping4, 9707 highlightedIndex: highlightedIndexProp, 9708 onHighlightedIndexChange: onHighlightedIndexChangeProp, 9709 orientation, 9710 grid, 9711 loopFocus, 9712 onLoop, 9713 enableHomeAndEndKeys, 9714 onMapChange: onMapChangeProp, 9715 stopEventPropagation = true, 9716 rootRef, 9717 disabledIndices, 9718 modifierKeys, 9719 highlightItemOnHover = false, 9720 tag = "div", 9721 ...elementProps 9722 } = componentProps; 9723 const direction = useDirection(); 9724 const { 9725 props: defaultProps, 9726 highlightedIndex, 9727 onHighlightedIndexChange, 9728 elementsRef, 9729 onMapChange: onMapChangeUnwrapped, 9730 relayKeyboardEvent 9731 } = useCompositeRoot({ 9732 grid, 9733 loopFocus, 9734 onLoop, 9735 orientation, 9736 highlightedIndex: highlightedIndexProp, 9737 onHighlightedIndexChange: onHighlightedIndexChangeProp, 9738 rootRef, 9739 stopEventPropagation, 9740 enableHomeAndEndKeys, 9741 direction, 9742 disabledIndices, 9743 modifierKeys 9744 }); 9745 const element = useRenderElement(tag, componentProps, { 9746 state, 9747 ref: refs, 9748 props: [defaultProps, ...props, elementProps], 9749 stateAttributesMapping: stateAttributesMapping4 9750 }); 9751 const contextValue = React41.useMemo(() => ({ 9752 highlightedIndex, 9753 onHighlightedIndexChange, 9754 highlightItemOnHover, 9755 relayKeyboardEvent 9756 }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]); 9757 return /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(CompositeRootContext.Provider, { 9758 value: contextValue, 9759 children: /* @__PURE__ */ (0, import_jsx_runtime185.jsx)(CompositeList, { 9760 elementsRef, 9761 onMapChange: (newMap) => { 9762 onMapChangeProp?.(newMap); 9763 onMapChangeUnwrapped(newMap); 9764 }, 9765 children: element 9766 }) 9767 }); 9768 } 9769 9770 // node_modules/@base-ui/react/internals/prehydrationScript.stub.mjs 9771 var script = ""; 9772 9773 // node_modules/@base-ui/react/utils/useIsHydrating.mjs 9774 var import_shim = __toESM(require_shim(), 1); 9775 function subscribe() { 9776 return NOOP; 9777 } 9778 function getSnapshot() { 9779 return false; 9780 } 9781 function getServerSnapshot() { 9782 return true; 9783 } 9784 function useIsHydrating() { 9785 return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot); 9786 } 9787 9788 // node_modules/@base-ui/react/internals/PrehydrationScript.mjs 9789 var React42 = __toESM(require_react(), 1); 9790 var import_jsx_runtime186 = __toESM(require_jsx_runtime(), 1); 9791 function PrehydrationScript(props) { 9792 const { 9793 script: script2 9794 } = props; 9795 const { 9796 nonce 9797 } = useCSPContext(); 9798 const isHydrating = useIsHydrating(); 9799 if (!isHydrating) { 9800 return null; 9801 } 9802 return /* @__PURE__ */ (0, import_jsx_runtime186.jsx)("script", { 9803 nonce, 9804 dangerouslySetInnerHTML: { 9805 __html: script2 9806 }, 9807 suppressHydrationWarning: true 9808 }); 9809 } 9810 9811 // node_modules/@base-ui/react/tabs/index.parts.mjs 9812 var index_parts_exports2 = {}; 9813 __export(index_parts_exports2, { 9814 Indicator: () => TabsIndicator, 9815 List: () => TabsList, 9816 Panel: () => TabsPanel, 9817 Root: () => TabsRoot, 9818 Tab: () => TabsTab 9819 }); 9820 9821 // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs 9822 var React44 = __toESM(require_react(), 1); 9823 9824 // node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs 9825 var React43 = __toESM(require_react(), 1); 9826 var TabsRootContext = /* @__PURE__ */ React43.createContext(void 0); 9827 if (true) TabsRootContext.displayName = "TabsRootContext"; 9828 function useTabsRootContext() { 9829 const context = React43.useContext(TabsRootContext); 9830 if (context === void 0) { 9831 throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64)); 9832 } 9833 return context; 9834 } 9835 9836 // node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs 9837 var tabsStateAttributesMapping = { 9838 tabActivationDirection: (dir) => ({ 9839 "data-activation-direction": dir 9840 }) 9841 }; 9842 9843 // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs 9844 var import_jsx_runtime187 = __toESM(require_jsx_runtime(), 1); 9845 var TabsRoot = /* @__PURE__ */ React44.forwardRef(function TabsRoot2(componentProps, forwardedRef) { 9846 const { 9847 className, 9848 defaultValue: defaultValueProp = 0, 9849 onValueChange: onValueChangeProp, 9850 orientation = "horizontal", 9851 render, 9852 value: valueProp, 9853 style: style2, 9854 ...elementProps 9855 } = componentProps; 9856 const hasExplicitDefaultValueProp = componentProps.defaultValue !== void 0; 9857 const tabPanelRefs = React44.useRef([]); 9858 const [mountedTabPanels, setMountedTabPanels] = React44.useState(() => /* @__PURE__ */ new Map()); 9859 const [value, setValue] = useControlled({ 9860 controlled: valueProp, 9861 default: defaultValueProp, 9862 name: "Tabs", 9863 state: "value" 9864 }); 9865 const isControlled = valueProp !== void 0; 9866 const [tabMap, setTabMap] = React44.useState(() => /* @__PURE__ */ new Map()); 9867 const lastKnownTabElementRef = React44.useRef(void 0); 9868 const getTabElementBySelectedValue = React44.useCallback((selectedValue) => findTabElement(tabMap, selectedValue), [tabMap]); 9869 const [activationDirectionState, setActivationDirectionState] = React44.useState(() => ({ 9870 previousValue: value, 9871 tabActivationDirection: "none" 9872 })); 9873 const { 9874 previousValue, 9875 tabActivationDirection: committedTabActivationDirection 9876 } = activationDirectionState; 9877 let tabActivationDirection = committedTabActivationDirection; 9878 let directionComputationIncomplete = false; 9879 if (previousValue !== value) { 9880 tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap); 9881 directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null; 9882 } 9883 const nextPreviousValue = directionComputationIncomplete ? previousValue : value; 9884 const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection; 9885 useIsoLayoutEffect(() => { 9886 if (!shouldSyncActivationDirectionState) { 9887 return; 9888 } 9889 setActivationDirectionState({ 9890 previousValue: nextPreviousValue, 9891 tabActivationDirection 9892 }); 9893 }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]); 9894 const onValueChange = useStableCallback((newValue, eventDetails) => { 9895 const activationDirection = computeActivationDirection(value, newValue, orientation, tabMap); 9896 eventDetails.activationDirection = activationDirection; 9897 onValueChangeProp?.(newValue, eventDetails); 9898 if (eventDetails.isCanceled) { 9899 return; 9900 } 9901 setValue(newValue); 9902 }); 9903 const notifyAutomaticValueChange = useStableCallback((nextValue, reason) => { 9904 onValueChangeProp?.(nextValue, createChangeEventDetails(reason, void 0, void 0, { 9905 activationDirection: "none" 9906 })); 9907 }); 9908 const registerMountedTabPanel = useStableCallback((panelValue, panelId) => { 9909 setMountedTabPanels((prev) => { 9910 const next2 = new Map(prev); 9911 next2.set(panelValue, panelId); 9912 return next2; 9913 }); 9914 return () => { 9915 setMountedTabPanels((prev) => { 9916 if (prev.get(panelValue) !== panelId) { 9917 return prev; 9918 } 9919 const next2 = new Map(prev); 9920 next2.delete(panelValue); 9921 return next2; 9922 }); 9923 }; 9924 }); 9925 const getTabPanelIdByValue = React44.useCallback((tabValue) => { 9926 return mountedTabPanels.get(tabValue); 9927 }, [mountedTabPanels]); 9928 const getTabIdByPanelValue = React44.useCallback((tabPanelValue) => { 9929 for (const tabMetadata of tabMap.values()) { 9930 if (tabPanelValue === tabMetadata.value) { 9931 return tabMetadata.id; 9932 } 9933 } 9934 return void 0; 9935 }, [tabMap]); 9936 const tabsContextValue = React44.useMemo(() => ({ 9937 getTabElementBySelectedValue, 9938 getTabIdByPanelValue, 9939 getTabPanelIdByValue, 9940 onValueChange, 9941 orientation, 9942 registerMountedTabPanel, 9943 setTabMap, 9944 tabActivationDirection, 9945 value 9946 }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, tabActivationDirection, value]); 9947 const selectedTabMetadata = React44.useMemo(() => { 9948 for (const tabMetadata of tabMap.values()) { 9949 if (tabMetadata.value === value) { 9950 return tabMetadata; 9951 } 9952 } 9953 return void 0; 9954 }, [tabMap, value]); 9955 const firstEnabledTabValue = React44.useMemo(() => { 9956 for (const tabMetadata of tabMap.values()) { 9957 if (!tabMetadata.disabled) { 9958 return tabMetadata.value; 9959 } 9960 } 9961 return void 0; 9962 }, [tabMap]); 9963 const shouldNotifyInitialValueChangeRef = React44.useRef(!hasExplicitDefaultValueProp); 9964 const initialDefaultValueRef = React44.useRef(defaultValueProp); 9965 const shouldHonorDisabledDefaultValueRef = React44.useRef(hasExplicitDefaultValueProp); 9966 const didRegisterTabsRef = React44.useRef(false); 9967 useIsoLayoutEffect(() => { 9968 if (isControlled) { 9969 return; 9970 } 9971 function commitAutomaticValueChange(fallbackValue, fallbackReason) { 9972 setValue(fallbackValue); 9973 setActivationDirectionState({ 9974 previousValue: fallbackValue, 9975 tabActivationDirection: "none" 9976 }); 9977 notifyAutomaticValueChange(fallbackValue, fallbackReason); 9978 shouldNotifyInitialValueChangeRef.current = false; 9979 } 9980 if (tabMap.size === 0) { 9981 if (didRegisterTabsRef.current && value !== null && !lastKnownTabElementRef.current?.isConnected) { 9982 commitAutomaticValueChange(null, reason_parts_exports.missing); 9983 } 9984 return; 9985 } 9986 didRegisterTabsRef.current = true; 9987 lastKnownTabElementRef.current = tabMap.keys().next().value; 9988 const selectionIsDisabled = selectedTabMetadata?.disabled; 9989 const selectionIsMissing = selectedTabMetadata == null && value !== null; 9990 if (!selectionIsDisabled && value === initialDefaultValueRef.current) { 9991 shouldHonorDisabledDefaultValueRef.current = false; 9992 } 9993 if (shouldHonorDisabledDefaultValueRef.current && selectionIsDisabled && value === initialDefaultValueRef.current) { 9994 return; 9995 } 9996 const shouldNotifyInitialValueChange = shouldNotifyInitialValueChangeRef.current; 9997 if (selectionIsDisabled || selectionIsMissing) { 9998 const fallbackValue = firstEnabledTabValue ?? null; 9999 if (value === fallbackValue) { 10000 shouldNotifyInitialValueChangeRef.current = false; 10001 return; 10002 } 10003 let fallbackReason = reason_parts_exports.missing; 10004 if (shouldNotifyInitialValueChange) { 10005 fallbackReason = reason_parts_exports.initial; 10006 } else if (selectionIsDisabled) { 10007 fallbackReason = reason_parts_exports.disabled; 10008 } 10009 commitAutomaticValueChange(fallbackValue, fallbackReason); 10010 return; 10011 } 10012 if (shouldNotifyInitialValueChange && selectedTabMetadata != null) { 10013 notifyAutomaticValueChange(value, reason_parts_exports.initial); 10014 shouldNotifyInitialValueChangeRef.current = false; 10015 } 10016 }, [firstEnabledTabValue, isControlled, notifyAutomaticValueChange, selectedTabMetadata, setValue, tabMap, value]); 10017 const state = { 10018 orientation, 10019 tabActivationDirection 10020 }; 10021 const element = useRenderElement("div", componentProps, { 10022 state, 10023 ref: forwardedRef, 10024 props: elementProps, 10025 stateAttributesMapping: tabsStateAttributesMapping 10026 }); 10027 return /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(TabsRootContext.Provider, { 10028 value: tabsContextValue, 10029 children: /* @__PURE__ */ (0, import_jsx_runtime187.jsx)(CompositeList, { 10030 elementsRef: tabPanelRefs, 10031 children: element 10032 }) 10033 }); 10034 }); 10035 if (true) TabsRoot.displayName = "TabsRoot"; 10036 function findTabElement(tabMap, value) { 10037 for (const [tabElement, tabMetadata] of tabMap.entries()) { 10038 if (value === tabMetadata.value) { 10039 return tabElement; 10040 } 10041 } 10042 return null; 10043 } 10044 function computeActivationDirection(oldValue, newValue, orientation, tabMap) { 10045 if (oldValue == null || newValue == null) { 10046 return "none"; 10047 } 10048 const [positionProp, backward, forward] = orientation === "horizontal" ? ["left", "left", "right"] : ["top", "up", "down"]; 10049 const oldTab = findTabElement(tabMap, oldValue); 10050 const newTab = findTabElement(tabMap, newValue); 10051 if (oldTab == null || newTab == null) { 10052 if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) { 10053 return newValue > oldValue ? forward : backward; 10054 } 10055 return "none"; 10056 } 10057 const oldPosition = oldTab.getBoundingClientRect()[positionProp]; 10058 const newPosition = newTab.getBoundingClientRect()[positionProp]; 10059 if (newPosition < oldPosition) { 10060 return backward; 10061 } 10062 if (newPosition > oldPosition) { 10063 return forward; 10064 } 10065 return "none"; 10066 } 10067 10068 // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs 10069 var React46 = __toESM(require_react(), 1); 10070 10071 // node_modules/@base-ui/react/tabs/list/TabsListContext.mjs 10072 var React45 = __toESM(require_react(), 1); 10073 var TabsListContext = /* @__PURE__ */ React45.createContext(void 0); 10074 if (true) TabsListContext.displayName = "TabsListContext"; 10075 function useTabsListContext() { 10076 const context = React45.useContext(TabsListContext); 10077 if (context === void 0) { 10078 throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65)); 10079 } 10080 return context; 10081 } 10082 10083 // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs 10084 var TabsTab = /* @__PURE__ */ React46.forwardRef(function TabsTab2(componentProps, forwardedRef) { 10085 const { 10086 className, 10087 disabled: disabled2 = false, 10088 render, 10089 value, 10090 id: idProp, 10091 nativeButton = true, 10092 style: style2, 10093 ...elementProps 10094 } = componentProps; 10095 const { 10096 value: activeTabValue, 10097 getTabPanelIdByValue, 10098 onValueChange, 10099 orientation, 10100 tabActivationDirection 10101 } = useTabsRootContext(); 10102 const { 10103 activateOnFocus, 10104 registerTabResizeObserverElement, 10105 tabsListElement 10106 } = useTabsListContext(); 10107 const { 10108 highlightedIndex, 10109 onHighlightedIndexChange 10110 } = useCompositeRootContext(); 10111 const id = useBaseUiId(idProp); 10112 const tabMetadata = React46.useMemo(() => ({ 10113 disabled: disabled2, 10114 id, 10115 value 10116 }), [disabled2, id, value]); 10117 const { 10118 compositeProps, 10119 compositeRef, 10120 index 10121 // hook is used instead of the CompositeItem component 10122 // because the index is needed for Tab internals 10123 } = useCompositeItem({ 10124 metadata: tabMetadata 10125 }); 10126 const active = value === activeTabValue; 10127 const isNavigatingRef = React46.useRef(false); 10128 const unobserveTabElementRef = React46.useRef(null); 10129 const observeTabElement = useStableCallback((element2) => { 10130 unobserveTabElementRef.current?.(); 10131 unobserveTabElementRef.current = element2 ? registerTabResizeObserverElement(element2) : null; 10132 }); 10133 useIsoLayoutEffect(() => { 10134 if (isNavigatingRef.current) { 10135 isNavigatingRef.current = false; 10136 return; 10137 } 10138 if (!(active && index > -1 && highlightedIndex !== index)) { 10139 return; 10140 } 10141 const listElement = tabsListElement; 10142 if (listElement != null) { 10143 const activeEl = activeElement(ownerDocument(listElement)); 10144 if (activeEl && contains(listElement, activeEl)) { 10145 return; 10146 } 10147 } 10148 if (!disabled2) { 10149 onHighlightedIndexChange(index); 10150 } 10151 }, [active, index, highlightedIndex, onHighlightedIndexChange, disabled2, tabsListElement]); 10152 const { 10153 getButtonProps, 10154 buttonRef 10155 } = useButton({ 10156 disabled: disabled2, 10157 native: nativeButton, 10158 focusableWhenDisabled: true 10159 }); 10160 const tabPanelId = getTabPanelIdByValue(value); 10161 const isPressingRef = React46.useRef(false); 10162 const isMainButtonRef = React46.useRef(false); 10163 function activate(event) { 10164 onValueChange(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, { 10165 activationDirection: "none" 10166 })); 10167 } 10168 function onClick(event) { 10169 if (active || disabled2) { 10170 return; 10171 } 10172 activate(event); 10173 } 10174 function onFocus(event) { 10175 if (active || disabled2) { 10176 return; 10177 } 10178 if (activateOnFocus && (!isPressingRef.current || // keyboard or touch focus 10179 isMainButtonRef.current)) { 10180 activate(event); 10181 } 10182 } 10183 function onPointerDown(event) { 10184 if (active || disabled2) { 10185 return; 10186 } 10187 isPressingRef.current = true; 10188 isMainButtonRef.current = event.button === 0; 10189 const doc = ownerDocument(event.currentTarget); 10190 function handlePointerEnd() { 10191 isPressingRef.current = false; 10192 isMainButtonRef.current = false; 10193 doc.removeEventListener("pointerup", handlePointerEnd); 10194 doc.removeEventListener("pointercancel", handlePointerEnd); 10195 } 10196 doc.addEventListener("pointerup", handlePointerEnd); 10197 doc.addEventListener("pointercancel", handlePointerEnd); 10198 } 10199 const state = { 10200 disabled: disabled2, 10201 active, 10202 orientation, 10203 tabActivationDirection 10204 }; 10205 const element = useRenderElement("button", componentProps, { 10206 state, 10207 ref: [forwardedRef, buttonRef, compositeRef, observeTabElement], 10208 props: [compositeProps, { 10209 role: "tab", 10210 "aria-controls": tabPanelId, 10211 "aria-selected": active, 10212 id, 10213 onClick, 10214 onFocus, 10215 onPointerDown, 10216 [ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0, 10217 onKeyDownCapture() { 10218 isNavigatingRef.current = true; 10219 } 10220 }, elementProps, getButtonProps], 10221 stateAttributesMapping: tabsStateAttributesMapping 10222 }); 10223 return element; 10224 }); 10225 if (true) TabsTab.displayName = "TabsTab"; 10226 10227 // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs 10228 var React47 = __toESM(require_react(), 1); 10229 var import_jsx_runtime188 = __toESM(require_jsx_runtime(), 1); 10230 var _PrehydrationScript; 10231 var stateAttributesMapping2 = { 10232 ...tabsStateAttributesMapping, 10233 activeTabPosition: () => null, 10234 activeTabSize: () => null 10235 }; 10236 var TabsIndicator = /* @__PURE__ */ React47.forwardRef(function TabsIndicator2(componentProps, forwardedRef) { 10237 const { 10238 className, 10239 render, 10240 renderBeforeHydration = false, 10241 style: styleProp, 10242 ...elementProps 10243 } = componentProps; 10244 const { 10245 getTabElementBySelectedValue, 10246 orientation, 10247 tabActivationDirection, 10248 value 10249 } = useTabsRootContext(); 10250 const { 10251 tabsListElement, 10252 registerIndicatorUpdateListener 10253 } = useTabsListContext(); 10254 const rerender = useForcedRerendering(); 10255 React47.useEffect(() => { 10256 return registerIndicatorUpdateListener(rerender); 10257 }, [registerIndicatorUpdateListener, rerender]); 10258 let left = 0; 10259 let right = 0; 10260 let top = 0; 10261 let bottom = 0; 10262 let width = 0; 10263 let height = 0; 10264 let isTabSelected = false; 10265 if (value != null && tabsListElement != null) { 10266 const activeTab = getTabElementBySelectedValue(value); 10267 if (activeTab != null) { 10268 isTabSelected = true; 10269 const { 10270 width: computedWidth, 10271 height: computedHeight 10272 } = getCssDimensions(activeTab); 10273 const { 10274 width: tabListWidth, 10275 height: tabListHeight 10276 } = getCssDimensions(tabsListElement); 10277 const tabRect = activeTab.getBoundingClientRect(); 10278 const tabsListRect = tabsListElement.getBoundingClientRect(); 10279 const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1; 10280 const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1; 10281 const hasNonZeroScale = scaleX > Number.EPSILON && scaleY > Number.EPSILON; 10282 if (hasNonZeroScale) { 10283 const tabLeftDelta = tabRect.left - tabsListRect.left; 10284 const tabTopDelta = tabRect.top - tabsListRect.top; 10285 left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft; 10286 top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop; 10287 } else { 10288 left = activeTab.offsetLeft; 10289 top = activeTab.offsetTop; 10290 } 10291 width = computedWidth; 10292 height = computedHeight; 10293 right = tabsListElement.scrollWidth - left - width; 10294 bottom = tabsListElement.scrollHeight - top - height; 10295 } 10296 } 10297 const activeTabPosition = isTabSelected ? { 10298 left, 10299 right, 10300 top, 10301 bottom 10302 } : null; 10303 const activeTabSize = isTabSelected ? { 10304 width, 10305 height 10306 } : null; 10307 const style2 = isTabSelected ? { 10308 "--active-tab-left": `$left}px`, 10309 "--active-tab-right": `$right}px`, 10310 "--active-tab-top": `$top}px`, 10311 "--active-tab-bottom": `$bottom}px`, 10312 "--active-tab-width": `$width}px`, 10313 "--active-tab-height": `$height}px` 10314 } : void 0; 10315 const displayIndicator = isTabSelected && width > 0 && height > 0; 10316 const state = { 10317 orientation, 10318 activeTabPosition, 10319 activeTabSize, 10320 tabActivationDirection 10321 }; 10322 const element = useRenderElement("span", componentProps, { 10323 state, 10324 ref: forwardedRef, 10325 props: [{ 10326 role: "presentation", 10327 style: style2, 10328 hidden: !displayIndicator 10329 // do not display the indicator before the layout is settled 10330 }, elementProps, { 10331 suppressHydrationWarning: true 10332 }], 10333 stateAttributesMapping: stateAttributesMapping2 10334 }); 10335 if (value == null) { 10336 return null; 10337 } 10338 return /* @__PURE__ */ (0, import_jsx_runtime188.jsxs)(React47.Fragment, { 10339 children: [element, renderBeforeHydration && (_PrehydrationScript || (_PrehydrationScript = /* @__PURE__ */ (0, import_jsx_runtime188.jsx)(PrehydrationScript, { 10340 script 10341 })))] 10342 }); 10343 }); 10344 if (true) TabsIndicator.displayName = "TabsIndicator"; 10345 10346 // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs 10347 var React48 = __toESM(require_react(), 1); 10348 var stateAttributesMapping3 = { 10349 ...tabsStateAttributesMapping, 10350 ...transitionStatusMapping 10351 }; 10352 var TabsPanel = /* @__PURE__ */ React48.forwardRef(function TabsPanel2(componentProps, forwardedRef) { 10353 const { 10354 className, 10355 value, 10356 render, 10357 keepMounted = false, 10358 style: style2, 10359 ...elementProps 10360 } = componentProps; 10361 const { 10362 value: selectedValue, 10363 getTabIdByPanelValue, 10364 orientation, 10365 tabActivationDirection, 10366 registerMountedTabPanel 10367 } = useTabsRootContext(); 10368 const id = useBaseUiId(); 10369 const { 10370 ref: listItemRef, 10371 index 10372 } = useCompositeListItem(); 10373 const open = value === selectedValue; 10374 const { 10375 mounted, 10376 transitionStatus, 10377 setMounted 10378 } = useTransitionStatus(open); 10379 const hidden = !mounted; 10380 const correspondingTabId = getTabIdByPanelValue(value); 10381 const state = { 10382 hidden, 10383 orientation, 10384 tabActivationDirection, 10385 transitionStatus 10386 }; 10387 const panelRef = React48.useRef(null); 10388 const element = useRenderElement("div", componentProps, { 10389 state, 10390 ref: [forwardedRef, listItemRef, panelRef], 10391 props: [{ 10392 "aria-labelledby": correspondingTabId, 10393 hidden, 10394 id, 10395 role: "tabpanel", 10396 tabIndex: open ? 0 : -1, 10397 inert: inertValue(!open), 10398 // Computed key: a plain literal key fails the DOM-props excess property check. 10399 ["data-index"]: index 10400 }, elementProps], 10401 stateAttributesMapping: stateAttributesMapping3 10402 }); 10403 useOpenChangeComplete({ 10404 open, 10405 ref: panelRef, 10406 onComplete() { 10407 if (!open) { 10408 setMounted(false); 10409 } 10410 } 10411 }); 10412 useIsoLayoutEffect(() => { 10413 if (id == null || hidden && !keepMounted) { 10414 return void 0; 10415 } 10416 return registerMountedTabPanel(value, id); 10417 }, [hidden, keepMounted, value, id, registerMountedTabPanel]); 10418 const shouldRender = keepMounted || mounted; 10419 if (!shouldRender) { 10420 return null; 10421 } 10422 return element; 10423 }); 10424 if (true) TabsPanel.displayName = "TabsPanel"; 10425 10426 // node_modules/@base-ui/react/tabs/list/TabsList.mjs 10427 var React49 = __toESM(require_react(), 1); 10428 var import_jsx_runtime189 = __toESM(require_jsx_runtime(), 1); 10429 var TabsList = /* @__PURE__ */ React49.forwardRef(function TabsList2(componentProps, forwardedRef) { 10430 const { 10431 activateOnFocus = false, 10432 className, 10433 loopFocus = true, 10434 render, 10435 style: style2, 10436 ...elementProps 10437 } = componentProps; 10438 const { 10439 orientation, 10440 setTabMap, 10441 tabActivationDirection 10442 } = useTabsRootContext(); 10443 const [highlightedTabIndex, setHighlightedTabIndex] = React49.useState(0); 10444 const [tabsListElement, setTabsListElement] = React49.useState(null); 10445 const indicatorUpdateListenersRef = React49.useRef(/* @__PURE__ */ new Set()); 10446 const tabResizeObserverElementsRef = React49.useRef(/* @__PURE__ */ new Set()); 10447 const resizeObserverRef = React49.useRef(null); 10448 useIsoLayoutEffect(() => { 10449 if (typeof ResizeObserver === "undefined") { 10450 return void 0; 10451 } 10452 const resizeObserver = new ResizeObserver(() => { 10453 indicatorUpdateListenersRef.current.forEach((listener) => { 10454 listener(); 10455 }); 10456 }); 10457 resizeObserverRef.current = resizeObserver; 10458 if (tabsListElement) { 10459 resizeObserver.observe(tabsListElement); 10460 } 10461 tabResizeObserverElementsRef.current.forEach((element) => { 10462 resizeObserver.observe(element); 10463 }); 10464 return () => { 10465 resizeObserver.disconnect(); 10466 resizeObserverRef.current = null; 10467 }; 10468 }, [tabsListElement]); 10469 const registerIndicatorUpdateListener = useStableCallback((listener) => { 10470 indicatorUpdateListenersRef.current.add(listener); 10471 return () => { 10472 indicatorUpdateListenersRef.current.delete(listener); 10473 }; 10474 }); 10475 const registerTabResizeObserverElement = useStableCallback((element) => { 10476 tabResizeObserverElementsRef.current.add(element); 10477 resizeObserverRef.current?.observe(element); 10478 return () => { 10479 tabResizeObserverElementsRef.current.delete(element); 10480 resizeObserverRef.current?.unobserve(element); 10481 }; 10482 }); 10483 const state = { 10484 orientation, 10485 tabActivationDirection 10486 }; 10487 const defaultProps = { 10488 "aria-orientation": orientation === "vertical" ? "vertical" : void 0, 10489 role: "tablist" 10490 }; 10491 const tabsListContextValue = React49.useMemo(() => ({ 10492 activateOnFocus, 10493 registerIndicatorUpdateListener, 10494 registerTabResizeObserverElement, 10495 tabsListElement 10496 }), [activateOnFocus, registerIndicatorUpdateListener, registerTabResizeObserverElement, tabsListElement]); 10497 return /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(TabsListContext.Provider, { 10498 value: tabsListContextValue, 10499 children: /* @__PURE__ */ (0, import_jsx_runtime189.jsx)(CompositeRoot, { 10500 render, 10501 className, 10502 style: style2, 10503 state, 10504 refs: [forwardedRef, setTabsListElement], 10505 props: [defaultProps, elementProps], 10506 stateAttributesMapping: tabsStateAttributesMapping, 10507 highlightedIndex: highlightedTabIndex, 10508 enableHomeAndEndKeys: true, 10509 loopFocus, 10510 orientation, 10511 onHighlightedIndexChange: setHighlightedTabIndex, 10512 onMapChange: setTabMap, 10513 disabledIndices: EMPTY_ARRAY 10514 }) 10515 }); 10516 }); 10517 if (true) TabsList.displayName = "TabsList"; 10518 10519 // node_modules/@base-ui/react/use-render/useRender.mjs 10520 function useRender(params) { 10521 return useRenderElement(params.defaultTagName ?? "div", params, params); 10522 } 10523 10524 // packages/ui/build-module/text/text.mjs 10525 var import_element5 = __toESM(require_element(), 1); 10526 var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; 10527 function getRuntime() { 10528 const globalScope = globalThis; 10529 if (globalScope.__wpStyleRuntime) { 10530 return globalScope.__wpStyleRuntime; 10531 } 10532 globalScope.__wpStyleRuntime = { 10533 documents: /* @__PURE__ */ new Map(), 10534 styles: /* @__PURE__ */ new Map(), 10535 injectedStyles: /* @__PURE__ */ new WeakMap() 10536 }; 10537 if (typeof document !== "undefined") { 10538 registerDocument(document); 10539 } 10540 return globalScope.__wpStyleRuntime; 10541 } 10542 function documentContainsStyleHash(targetDocument, hash) { 10543 if (!targetDocument.head) { 10544 return false; 10545 } 10546 for (const style2 of targetDocument.head.querySelectorAll( 10547 `style[$STYLE_HASH_ATTRIBUTE}]` 10548 )) { 10549 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { 10550 return true; 10551 } 10552 } 10553 return false; 10554 } 10555 function injectStyle(targetDocument, hash, css) { 10556 if (!targetDocument.head) { 10557 return; 10558 } 10559 const runtime = getRuntime(); 10560 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10561 if (!injectedStyles) { 10562 injectedStyles = /* @__PURE__ */ new Set(); 10563 runtime.injectedStyles.set(targetDocument, injectedStyles); 10564 } 10565 if (injectedStyles.has(hash)) { 10566 return; 10567 } 10568 if (documentContainsStyleHash(targetDocument, hash)) { 10569 injectedStyles.add(hash); 10570 return; 10571 } 10572 const style2 = targetDocument.createElement("style"); 10573 style2.setAttribute(STYLE_HASH_ATTRIBUTE, hash); 10574 style2.appendChild(targetDocument.createTextNode(css)); 10575 targetDocument.head.appendChild(style2); 10576 injectedStyles.add(hash); 10577 } 10578 function registerDocument(targetDocument) { 10579 const runtime = getRuntime(); 10580 runtime.documents.set( 10581 targetDocument, 10582 (runtime.documents.get(targetDocument) ?? 0) + 1 10583 ); 10584 for (const [hash, css] of runtime.styles) { 10585 injectStyle(targetDocument, hash, css); 10586 } 10587 return () => { 10588 const count = runtime.documents.get(targetDocument); 10589 if (count === void 0) { 10590 return; 10591 } 10592 if (count <= 1) { 10593 runtime.documents.delete(targetDocument); 10594 return; 10595 } 10596 runtime.documents.set(targetDocument, count - 1); 10597 }; 10598 } 10599 function registerStyle(hash, css) { 10600 const runtime = getRuntime(); 10601 runtime.styles.set(hash, css); 10602 for (const targetDocument of runtime.documents.keys()) { 10603 injectStyle(targetDocument, hash, css); 10604 } 10605 } 10606 if (typeof process === "undefined" || true) { 10607 registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 10608 } 10609 var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" }; 10610 if (typeof process === "undefined" || true) { 10611 registerStyle("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 10612 } 10613 var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 10614 var Text2 = (0, import_element5.forwardRef)(function Text22({ variant = "body-md", render, className, ...props }, ref) { 10615 const element = useRender({ 10616 render, 10617 defaultTagName: "span", 10618 ref, 10619 props: mergeProps(props, { 10620 className: clsx_default( 10621 style_default.text, 10622 global_css_defense_default.heading, 10623 global_css_defense_default.p, 10624 style_default[variant], 10625 className 10626 ) 10627 }) 10628 }); 10629 return element; 10630 }); 10631 10632 // packages/ui/build-module/utils/direction-provider.mjs 10633 var import_i18n9 = __toESM(require_i18n(), 1); 10634 var import_jsx_runtime190 = __toESM(require_jsx_runtime(), 1); 10635 function DirectionProvider3({ children }) { 10636 return /* @__PURE__ */ (0, import_jsx_runtime190.jsx)(DirectionProvider, { direction: (0, import_i18n9.isRTL)() ? "rtl" : "ltr", children }); 10637 } 10638 10639 // packages/ui/build-module/link/link.mjs 10640 var import_element6 = __toESM(require_element(), 1); 10641 var import_i18n10 = __toESM(require_i18n(), 1); 10642 var import_jsx_runtime191 = __toESM(require_jsx_runtime(), 1); 10643 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; 10644 function getRuntime2() { 10645 const globalScope = globalThis; 10646 if (globalScope.__wpStyleRuntime) { 10647 return globalScope.__wpStyleRuntime; 10648 } 10649 globalScope.__wpStyleRuntime = { 10650 documents: /* @__PURE__ */ new Map(), 10651 styles: /* @__PURE__ */ new Map(), 10652 injectedStyles: /* @__PURE__ */ new WeakMap() 10653 }; 10654 if (typeof document !== "undefined") { 10655 registerDocument2(document); 10656 } 10657 return globalScope.__wpStyleRuntime; 10658 } 10659 function documentContainsStyleHash2(targetDocument, hash) { 10660 if (!targetDocument.head) { 10661 return false; 10662 } 10663 for (const style2 of targetDocument.head.querySelectorAll( 10664 `style[$STYLE_HASH_ATTRIBUTE2}]` 10665 )) { 10666 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { 10667 return true; 10668 } 10669 } 10670 return false; 10671 } 10672 function injectStyle2(targetDocument, hash, css) { 10673 if (!targetDocument.head) { 10674 return; 10675 } 10676 const runtime = getRuntime2(); 10677 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10678 if (!injectedStyles) { 10679 injectedStyles = /* @__PURE__ */ new Set(); 10680 runtime.injectedStyles.set(targetDocument, injectedStyles); 10681 } 10682 if (injectedStyles.has(hash)) { 10683 return; 10684 } 10685 if (documentContainsStyleHash2(targetDocument, hash)) { 10686 injectedStyles.add(hash); 10687 return; 10688 } 10689 const style2 = targetDocument.createElement("style"); 10690 style2.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); 10691 style2.appendChild(targetDocument.createTextNode(css)); 10692 targetDocument.head.appendChild(style2); 10693 injectedStyles.add(hash); 10694 } 10695 function registerDocument2(targetDocument) { 10696 const runtime = getRuntime2(); 10697 runtime.documents.set( 10698 targetDocument, 10699 (runtime.documents.get(targetDocument) ?? 0) + 1 10700 ); 10701 for (const [hash, css] of runtime.styles) { 10702 injectStyle2(targetDocument, hash, css); 10703 } 10704 return () => { 10705 const count = runtime.documents.get(targetDocument); 10706 if (count === void 0) { 10707 return; 10708 } 10709 if (count <= 1) { 10710 runtime.documents.delete(targetDocument); 10711 return; 10712 } 10713 runtime.documents.set(targetDocument, count - 1); 10714 }; 10715 } 10716 function registerStyle2(hash, css) { 10717 const runtime = getRuntime2(); 10718 runtime.styles.set(hash, css); 10719 for (const targetDocument of runtime.documents.keys()) { 10720 injectStyle2(targetDocument, hash, css); 10721 } 10722 } 10723 if (typeof process === "undefined" || true) { 10724 registerStyle2("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 10725 } 10726 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 10727 if (typeof process === "undefined" || true) { 10728 registerStyle2("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); 10729 } 10730 var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" }; 10731 if (typeof process === "undefined" || true) { 10732 registerStyle2("e8e6a9be37", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}'); 10733 } 10734 var style_default2 = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" }; 10735 if (typeof process === "undefined" || true) { 10736 registerStyle2("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 10737 } 10738 var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 10739 var Link = (0, import_element6.forwardRef)(function Link2({ 10740 children, 10741 variant = "default", 10742 tone = "brand", 10743 openInNewTab = false, 10744 target, 10745 render, 10746 className, 10747 ...props 10748 }, ref) { 10749 const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? ""); 10750 const element = useRender({ 10751 render, 10752 defaultTagName: "a", 10753 ref, 10754 props: mergeProps(props, { 10755 className: clsx_default( 10756 global_css_defense_default2.a, 10757 resets_default["box-sizing"], 10758 focus_module_default["outset-ring--focus-except-active"], 10759 variant !== "unstyled" && style_default2.link, 10760 variant !== "unstyled" && style_default2[`is-$tone}`], 10761 variant === "unstyled" && style_default2["is-unstyled"], 10762 className 10763 ), 10764 target: target ?? (openInNewTab ? "_blank" : void 0), 10765 children: /* @__PURE__ */ (0, import_jsx_runtime191.jsxs)(import_jsx_runtime191.Fragment, { children: [ 10766 children, 10767 shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime191.jsx)( 10768 "span", 10769 { 10770 className: style_default2["link-icon"], 10771 role: "img", 10772 "aria-label": ( 10773 /* translators: accessibility text appended to link text */ 10774 (0, import_i18n10.__)("(opens in a new tab)") 10775 ) 10776 } 10777 ) 10778 ] }) 10779 }) 10780 }); 10781 return element; 10782 }); 10783 10784 // packages/ui/build-module/icon/icon.mjs 10785 var import_element7 = __toESM(require_element(), 1); 10786 var import_primitives163 = __toESM(require_primitives(), 1); 10787 var import_jsx_runtime192 = __toESM(require_jsx_runtime(), 1); 10788 var Icon = (0, import_element7.forwardRef)(function Icon2({ icon: icon2, size = 24, style: style2, ...restProps }, ref) { 10789 const mergedStyle = icon2.props.style || style2 ? { ...icon2.props.style, ...style2 } : void 0; 10790 return /* @__PURE__ */ (0, import_jsx_runtime192.jsx)( 10791 import_primitives163.SVG, 10792 { 10793 ref, 10794 ...icon2.props, 10795 ...restProps, 10796 ...mergedStyle ? { style: mergedStyle } : {}, 10797 width: size, 10798 height: size 10799 } 10800 ); 10801 }); 10802 10803 // packages/ui/build-module/visually-hidden/visually-hidden.mjs 10804 var import_element8 = __toESM(require_element(), 1); 10805 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; 10806 function getRuntime3() { 10807 const globalScope = globalThis; 10808 if (globalScope.__wpStyleRuntime) { 10809 return globalScope.__wpStyleRuntime; 10810 } 10811 globalScope.__wpStyleRuntime = { 10812 documents: /* @__PURE__ */ new Map(), 10813 styles: /* @__PURE__ */ new Map(), 10814 injectedStyles: /* @__PURE__ */ new WeakMap() 10815 }; 10816 if (typeof document !== "undefined") { 10817 registerDocument3(document); 10818 } 10819 return globalScope.__wpStyleRuntime; 10820 } 10821 function documentContainsStyleHash3(targetDocument, hash) { 10822 if (!targetDocument.head) { 10823 return false; 10824 } 10825 for (const style2 of targetDocument.head.querySelectorAll( 10826 `style[$STYLE_HASH_ATTRIBUTE3}]` 10827 )) { 10828 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) { 10829 return true; 10830 } 10831 } 10832 return false; 10833 } 10834 function injectStyle3(targetDocument, hash, css) { 10835 if (!targetDocument.head) { 10836 return; 10837 } 10838 const runtime = getRuntime3(); 10839 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10840 if (!injectedStyles) { 10841 injectedStyles = /* @__PURE__ */ new Set(); 10842 runtime.injectedStyles.set(targetDocument, injectedStyles); 10843 } 10844 if (injectedStyles.has(hash)) { 10845 return; 10846 } 10847 if (documentContainsStyleHash3(targetDocument, hash)) { 10848 injectedStyles.add(hash); 10849 return; 10850 } 10851 const style2 = targetDocument.createElement("style"); 10852 style2.setAttribute(STYLE_HASH_ATTRIBUTE3, hash); 10853 style2.appendChild(targetDocument.createTextNode(css)); 10854 targetDocument.head.appendChild(style2); 10855 injectedStyles.add(hash); 10856 } 10857 function registerDocument3(targetDocument) { 10858 const runtime = getRuntime3(); 10859 runtime.documents.set( 10860 targetDocument, 10861 (runtime.documents.get(targetDocument) ?? 0) + 1 10862 ); 10863 for (const [hash, css] of runtime.styles) { 10864 injectStyle3(targetDocument, hash, css); 10865 } 10866 return () => { 10867 const count = runtime.documents.get(targetDocument); 10868 if (count === void 0) { 10869 return; 10870 } 10871 if (count <= 1) { 10872 runtime.documents.delete(targetDocument); 10873 return; 10874 } 10875 runtime.documents.set(targetDocument, count - 1); 10876 }; 10877 } 10878 function registerStyle3(hash, css) { 10879 const runtime = getRuntime3(); 10880 runtime.styles.set(hash, css); 10881 for (const targetDocument of runtime.documents.keys()) { 10882 injectStyle3(targetDocument, hash, css); 10883 } 10884 } 10885 if (typeof process === "undefined" || true) { 10886 registerStyle3("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}"); 10887 } 10888 var style_default3 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; 10889 var VisuallyHidden = (0, import_element8.forwardRef)( 10890 function VisuallyHidden2({ render, ...restProps }, ref) { 10891 const element = useRender({ 10892 render, 10893 ref, 10894 props: mergeProps( 10895 { className: style_default3["visually-hidden"] }, 10896 restProps, 10897 { 10898 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. 10899 "data-visually-hidden": "" 10900 } 10901 ) 10902 }); 10903 return element; 10904 } 10905 ); 10906 10907 // packages/ui/build-module/stack/stack.mjs 10908 var import_element9 = __toESM(require_element(), 1); 10909 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; 10910 function getRuntime4() { 10911 const globalScope = globalThis; 10912 if (globalScope.__wpStyleRuntime) { 10913 return globalScope.__wpStyleRuntime; 10914 } 10915 globalScope.__wpStyleRuntime = { 10916 documents: /* @__PURE__ */ new Map(), 10917 styles: /* @__PURE__ */ new Map(), 10918 injectedStyles: /* @__PURE__ */ new WeakMap() 10919 }; 10920 if (typeof document !== "undefined") { 10921 registerDocument4(document); 10922 } 10923 return globalScope.__wpStyleRuntime; 10924 } 10925 function documentContainsStyleHash4(targetDocument, hash) { 10926 if (!targetDocument.head) { 10927 return false; 10928 } 10929 for (const style2 of targetDocument.head.querySelectorAll( 10930 `style[$STYLE_HASH_ATTRIBUTE4}]` 10931 )) { 10932 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) { 10933 return true; 10934 } 10935 } 10936 return false; 10937 } 10938 function injectStyle4(targetDocument, hash, css) { 10939 if (!targetDocument.head) { 10940 return; 10941 } 10942 const runtime = getRuntime4(); 10943 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10944 if (!injectedStyles) { 10945 injectedStyles = /* @__PURE__ */ new Set(); 10946 runtime.injectedStyles.set(targetDocument, injectedStyles); 10947 } 10948 if (injectedStyles.has(hash)) { 10949 return; 10950 } 10951 if (documentContainsStyleHash4(targetDocument, hash)) { 10952 injectedStyles.add(hash); 10953 return; 10954 } 10955 const style2 = targetDocument.createElement("style"); 10956 style2.setAttribute(STYLE_HASH_ATTRIBUTE4, hash); 10957 style2.appendChild(targetDocument.createTextNode(css)); 10958 targetDocument.head.appendChild(style2); 10959 injectedStyles.add(hash); 10960 } 10961 function registerDocument4(targetDocument) { 10962 const runtime = getRuntime4(); 10963 runtime.documents.set( 10964 targetDocument, 10965 (runtime.documents.get(targetDocument) ?? 0) + 1 10966 ); 10967 for (const [hash, css] of runtime.styles) { 10968 injectStyle4(targetDocument, hash, css); 10969 } 10970 return () => { 10971 const count = runtime.documents.get(targetDocument); 10972 if (count === void 0) { 10973 return; 10974 } 10975 if (count <= 1) { 10976 runtime.documents.delete(targetDocument); 10977 return; 10978 } 10979 runtime.documents.set(targetDocument, count - 1); 10980 }; 10981 } 10982 function registerStyle4(hash, css) { 10983 const runtime = getRuntime4(); 10984 runtime.styles.set(hash, css); 10985 for (const targetDocument of runtime.documents.keys()) { 10986 injectStyle4(targetDocument, hash, css); 10987 } 10988 } 10989 if (typeof process === "undefined" || true) { 10990 registerStyle4("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); 10991 } 10992 var style_default4 = { "stack": "_19ce0419607e1896__stack" }; 10993 var gapTokens = { 10994 xs: "var(--wpds-dimension-gap-xs, 4px)", 10995 sm: "var(--wpds-dimension-gap-sm, 8px)", 10996 md: "var(--wpds-dimension-gap-md, 12px)", 10997 lg: "var(--wpds-dimension-gap-lg, 16px)", 10998 xl: "var(--wpds-dimension-gap-xl, 24px)", 10999 "2xl": "var(--wpds-dimension-gap-2xl, 32px)", 11000 "3xl": "var(--wpds-dimension-gap-3xl, 40px)" 11001 }; 11002 var Stack = (0, import_element9.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { 11003 const style2 = { 11004 gap: gap && gapTokens[gap], 11005 alignItems: align, 11006 justifyContent: justify, 11007 flexDirection: direction, 11008 flexWrap: wrap 11009 }; 11010 const element = useRender({ 11011 render, 11012 ref, 11013 props: mergeProps(props, { style: style2, className: style_default4.stack }) 11014 }); 11015 return element; 11016 }); 11017 11018 // packages/ui/build-module/utils/use-schedule-validation.mjs 11019 var import_compose4 = __toESM(require_compose(), 1); 11020 var import_element10 = __toESM(require_element(), 1); 11021 function useScheduleValidation(validate) { 11022 const validateEvent = (0, import_compose4.useEvent)(validate); 11023 const timerRef = (0, import_element10.useRef)(null); 11024 const unmountedRef = (0, import_element10.useRef)(false); 11025 const scheduleValidation = (0, import_element10.useCallback)(() => { 11026 if (unmountedRef.current) { 11027 return; 11028 } 11029 if (timerRef.current) { 11030 clearTimeout(timerRef.current); 11031 } 11032 timerRef.current = setTimeout(() => { 11033 validateEvent(); 11034 timerRef.current = null; 11035 }, 0); 11036 }, [validateEvent]); 11037 (0, import_element10.useEffect)(() => { 11038 unmountedRef.current = false; 11039 return () => { 11040 unmountedRef.current = true; 11041 if (timerRef.current) { 11042 clearTimeout(timerRef.current); 11043 } 11044 }; 11045 }, []); 11046 return scheduleValidation; 11047 } 11048 11049 // packages/ui/build-module/form/primitives/input/input.mjs 11050 var import_element13 = __toESM(require_element(), 1); 11051 11052 // packages/ui/build-module/form/primitives/input-layout/input-layout.mjs 11053 var import_element11 = __toESM(require_element(), 1); 11054 var import_jsx_runtime193 = __toESM(require_jsx_runtime(), 1); 11055 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; 11056 function getRuntime5() { 11057 const globalScope = globalThis; 11058 if (globalScope.__wpStyleRuntime) { 11059 return globalScope.__wpStyleRuntime; 11060 } 11061 globalScope.__wpStyleRuntime = { 11062 documents: /* @__PURE__ */ new Map(), 11063 styles: /* @__PURE__ */ new Map(), 11064 injectedStyles: /* @__PURE__ */ new WeakMap() 11065 }; 11066 if (typeof document !== "undefined") { 11067 registerDocument5(document); 11068 } 11069 return globalScope.__wpStyleRuntime; 11070 } 11071 function documentContainsStyleHash5(targetDocument, hash) { 11072 if (!targetDocument.head) { 11073 return false; 11074 } 11075 for (const style2 of targetDocument.head.querySelectorAll( 11076 `style[$STYLE_HASH_ATTRIBUTE5}]` 11077 )) { 11078 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) { 11079 return true; 11080 } 11081 } 11082 return false; 11083 } 11084 function injectStyle5(targetDocument, hash, css) { 11085 if (!targetDocument.head) { 11086 return; 11087 } 11088 const runtime = getRuntime5(); 11089 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11090 if (!injectedStyles) { 11091 injectedStyles = /* @__PURE__ */ new Set(); 11092 runtime.injectedStyles.set(targetDocument, injectedStyles); 11093 } 11094 if (injectedStyles.has(hash)) { 11095 return; 11096 } 11097 if (documentContainsStyleHash5(targetDocument, hash)) { 11098 injectedStyles.add(hash); 11099 return; 11100 } 11101 const style2 = targetDocument.createElement("style"); 11102 style2.setAttribute(STYLE_HASH_ATTRIBUTE5, hash); 11103 style2.appendChild(targetDocument.createTextNode(css)); 11104 targetDocument.head.appendChild(style2); 11105 injectedStyles.add(hash); 11106 } 11107 function registerDocument5(targetDocument) { 11108 const runtime = getRuntime5(); 11109 runtime.documents.set( 11110 targetDocument, 11111 (runtime.documents.get(targetDocument) ?? 0) + 1 11112 ); 11113 for (const [hash, css] of runtime.styles) { 11114 injectStyle5(targetDocument, hash, css); 11115 } 11116 return () => { 11117 const count = runtime.documents.get(targetDocument); 11118 if (count === void 0) { 11119 return; 11120 } 11121 if (count <= 1) { 11122 runtime.documents.delete(targetDocument); 11123 return; 11124 } 11125 runtime.documents.set(targetDocument, count - 1); 11126 }; 11127 } 11128 function registerStyle5(hash, css) { 11129 const runtime = getRuntime5(); 11130 runtime.styles.set(hash, css); 11131 for (const targetDocument of runtime.documents.keys()) { 11132 injectStyle5(targetDocument, hash, css); 11133 } 11134 } 11135 if (typeof process === "undefined" || true) { 11136 registerStyle5("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 11137 } 11138 var global_css_defense_default3 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 11139 if (typeof process === "undefined" || true) { 11140 registerStyle5("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 11141 } 11142 var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 11143 if (typeof process === "undefined" || true) { 11144 registerStyle5("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}'); 11145 } 11146 var style_default5 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" }; 11147 var InputLayout = (0, import_element11.forwardRef)( 11148 function InputLayout2({ 11149 className, 11150 children, 11151 visuallyDisabled, 11152 size = "default", 11153 isBorderless, 11154 prefix, 11155 suffix, 11156 ...restProps 11157 }, ref) { 11158 return /* @__PURE__ */ (0, import_jsx_runtime193.jsxs)( 11159 "div", 11160 { 11161 ref, 11162 className: clsx_default( 11163 global_css_defense_default3.div, 11164 resets_default2["box-sizing"], 11165 style_default5["input-layout"], 11166 style_default5[`is-size-$size}`], 11167 visuallyDisabled && style_default5["is-disabled"], 11168 isBorderless && style_default5["is-borderless"], 11169 className 11170 ), 11171 ...restProps, 11172 children: [ 11173 import_element11.Children.count(prefix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( 11174 "div", 11175 { 11176 className: style_default5["slot-wrapper"], 11177 "data-slot-type": "prefix", 11178 children: prefix 11179 } 11180 ), 11181 children, 11182 import_element11.Children.count(suffix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime193.jsx)( 11183 "div", 11184 { 11185 className: style_default5["slot-wrapper"], 11186 "data-slot-type": "suffix", 11187 children: suffix 11188 } 11189 ) 11190 ] 11191 } 11192 ); 11193 } 11194 ); 11195 11196 // packages/ui/build-module/form/primitives/input-layout/slot.mjs 11197 var import_element12 = __toESM(require_element(), 1); 11198 var import_jsx_runtime194 = __toESM(require_jsx_runtime(), 1); 11199 var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash"; 11200 function getRuntime6() { 11201 const globalScope = globalThis; 11202 if (globalScope.__wpStyleRuntime) { 11203 return globalScope.__wpStyleRuntime; 11204 } 11205 globalScope.__wpStyleRuntime = { 11206 documents: /* @__PURE__ */ new Map(), 11207 styles: /* @__PURE__ */ new Map(), 11208 injectedStyles: /* @__PURE__ */ new WeakMap() 11209 }; 11210 if (typeof document !== "undefined") { 11211 registerDocument6(document); 11212 } 11213 return globalScope.__wpStyleRuntime; 11214 } 11215 function documentContainsStyleHash6(targetDocument, hash) { 11216 if (!targetDocument.head) { 11217 return false; 11218 } 11219 for (const style2 of targetDocument.head.querySelectorAll( 11220 `style[$STYLE_HASH_ATTRIBUTE6}]` 11221 )) { 11222 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) { 11223 return true; 11224 } 11225 } 11226 return false; 11227 } 11228 function injectStyle6(targetDocument, hash, css) { 11229 if (!targetDocument.head) { 11230 return; 11231 } 11232 const runtime = getRuntime6(); 11233 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11234 if (!injectedStyles) { 11235 injectedStyles = /* @__PURE__ */ new Set(); 11236 runtime.injectedStyles.set(targetDocument, injectedStyles); 11237 } 11238 if (injectedStyles.has(hash)) { 11239 return; 11240 } 11241 if (documentContainsStyleHash6(targetDocument, hash)) { 11242 injectedStyles.add(hash); 11243 return; 11244 } 11245 const style2 = targetDocument.createElement("style"); 11246 style2.setAttribute(STYLE_HASH_ATTRIBUTE6, hash); 11247 style2.appendChild(targetDocument.createTextNode(css)); 11248 targetDocument.head.appendChild(style2); 11249 injectedStyles.add(hash); 11250 } 11251 function registerDocument6(targetDocument) { 11252 const runtime = getRuntime6(); 11253 runtime.documents.set( 11254 targetDocument, 11255 (runtime.documents.get(targetDocument) ?? 0) + 1 11256 ); 11257 for (const [hash, css] of runtime.styles) { 11258 injectStyle6(targetDocument, hash, css); 11259 } 11260 return () => { 11261 const count = runtime.documents.get(targetDocument); 11262 if (count === void 0) { 11263 return; 11264 } 11265 if (count <= 1) { 11266 runtime.documents.delete(targetDocument); 11267 return; 11268 } 11269 runtime.documents.set(targetDocument, count - 1); 11270 }; 11271 } 11272 function registerStyle6(hash, css) { 11273 const runtime = getRuntime6(); 11274 runtime.styles.set(hash, css); 11275 for (const targetDocument of runtime.documents.keys()) { 11276 injectStyle6(targetDocument, hash, css); 11277 } 11278 } 11279 if (typeof process === "undefined" || true) { 11280 registerStyle6("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}'); 11281 } 11282 var style_default6 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" }; 11283 var InputLayoutSlot = (0, import_element12.forwardRef)(function InputLayoutSlot2({ padding = "default", className, ...restProps }, ref) { 11284 return /* @__PURE__ */ (0, import_jsx_runtime194.jsx)( 11285 "div", 11286 { 11287 ref, 11288 className: clsx_default( 11289 style_default6["input-layout-slot"], 11290 style_default6[`is-padding-$padding}`], 11291 className 11292 ), 11293 ...restProps 11294 } 11295 ); 11296 }); 11297 InputLayoutSlot.displayName = "InputLayout.Slot"; 11298 11299 // packages/ui/build-module/form/primitives/input-layout/index.mjs 11300 var InputLayout3 = Object.assign(InputLayout, { 11301 Slot: InputLayoutSlot 11302 }); 11303 11304 // packages/ui/build-module/form/primitives/input/input.mjs 11305 var import_jsx_runtime195 = __toESM(require_jsx_runtime(), 1); 11306 var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash"; 11307 function getRuntime7() { 11308 const globalScope = globalThis; 11309 if (globalScope.__wpStyleRuntime) { 11310 return globalScope.__wpStyleRuntime; 11311 } 11312 globalScope.__wpStyleRuntime = { 11313 documents: /* @__PURE__ */ new Map(), 11314 styles: /* @__PURE__ */ new Map(), 11315 injectedStyles: /* @__PURE__ */ new WeakMap() 11316 }; 11317 if (typeof document !== "undefined") { 11318 registerDocument7(document); 11319 } 11320 return globalScope.__wpStyleRuntime; 11321 } 11322 function documentContainsStyleHash7(targetDocument, hash) { 11323 if (!targetDocument.head) { 11324 return false; 11325 } 11326 for (const style2 of targetDocument.head.querySelectorAll( 11327 `style[$STYLE_HASH_ATTRIBUTE7}]` 11328 )) { 11329 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) { 11330 return true; 11331 } 11332 } 11333 return false; 11334 } 11335 function injectStyle7(targetDocument, hash, css) { 11336 if (!targetDocument.head) { 11337 return; 11338 } 11339 const runtime = getRuntime7(); 11340 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11341 if (!injectedStyles) { 11342 injectedStyles = /* @__PURE__ */ new Set(); 11343 runtime.injectedStyles.set(targetDocument, injectedStyles); 11344 } 11345 if (injectedStyles.has(hash)) { 11346 return; 11347 } 11348 if (documentContainsStyleHash7(targetDocument, hash)) { 11349 injectedStyles.add(hash); 11350 return; 11351 } 11352 const style2 = targetDocument.createElement("style"); 11353 style2.setAttribute(STYLE_HASH_ATTRIBUTE7, hash); 11354 style2.appendChild(targetDocument.createTextNode(css)); 11355 targetDocument.head.appendChild(style2); 11356 injectedStyles.add(hash); 11357 } 11358 function registerDocument7(targetDocument) { 11359 const runtime = getRuntime7(); 11360 runtime.documents.set( 11361 targetDocument, 11362 (runtime.documents.get(targetDocument) ?? 0) + 1 11363 ); 11364 for (const [hash, css] of runtime.styles) { 11365 injectStyle7(targetDocument, hash, css); 11366 } 11367 return () => { 11368 const count = runtime.documents.get(targetDocument); 11369 if (count === void 0) { 11370 return; 11371 } 11372 if (count <= 1) { 11373 runtime.documents.delete(targetDocument); 11374 return; 11375 } 11376 runtime.documents.set(targetDocument, count - 1); 11377 }; 11378 } 11379 function registerStyle7(hash, css) { 11380 const runtime = getRuntime7(); 11381 runtime.styles.set(hash, css); 11382 for (const targetDocument of runtime.documents.keys()) { 11383 injectStyle7(targetDocument, hash, css); 11384 } 11385 } 11386 if (typeof process === "undefined" || true) { 11387 registerStyle7("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 11388 } 11389 var global_css_defense_default4 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 11390 if (typeof process === "undefined" || true) { 11391 registerStyle7("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); 11392 } 11393 var focus_module_default2 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" }; 11394 if (typeof process === "undefined" || true) { 11395 registerStyle7("1a25f6a232", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._2ae7be2fc1bb17a3__input{--_gcd-input-padding:var(--wp-ui-input-padding-block,0px) var(--wp-ui-input-layout-padding-inline,0px);background:transparent;border:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:inherit;font-size:inherit;line-height:inherit;outline:none;padding-block:var(--wp-ui-input-padding-block,0);padding-inline:var(--wp-ui-input-layout-padding-inline,0);width:100%;&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-weak,#707070)}&:disabled,&[aria-disabled=true]{--_gcd-input-placeholder-color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}@media (forced-colors:active){color:GrayText}}&[type=email],&[type=url]{direction:ltr}&[type=number]{appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{appearance:none;margin:0}}}}}"); 11396 } 11397 var style_default7 = { "input": "_2ae7be2fc1bb17a3__input" }; 11398 var Input3 = (0, import_element13.forwardRef)(function Input22({ className, size = "default", prefix, suffix, style: style2, ...restProps }, ref) { 11399 return /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( 11400 InputLayout3, 11401 { 11402 className: clsx_default( 11403 focus_module_default2["outset-ring--focus-within"], 11404 className 11405 ), 11406 style: style2, 11407 size, 11408 visuallyDisabled: restProps.disabled, 11409 prefix, 11410 suffix, 11411 children: /* @__PURE__ */ (0, import_jsx_runtime195.jsx)( 11412 Input, 11413 { 11414 ref, 11415 className: clsx_default(global_css_defense_default4.input, style_default7.input), 11416 ...restProps 11417 } 11418 ) 11419 } 11420 ); 11421 }); 11422 11423 // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs 11424 var import_i18n11 = __toESM(require_i18n(), 1); 11425 var import_element15 = __toESM(require_element(), 1); 11426 11427 // packages/ui/build-module/spinner/spinner.mjs 11428 var import_element14 = __toESM(require_element(), 1); 11429 var import_jsx_runtime196 = __toESM(require_jsx_runtime(), 1); 11430 var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash"; 11431 function getRuntime8() { 11432 const globalScope = globalThis; 11433 if (globalScope.__wpStyleRuntime) { 11434 return globalScope.__wpStyleRuntime; 11435 } 11436 globalScope.__wpStyleRuntime = { 11437 documents: /* @__PURE__ */ new Map(), 11438 styles: /* @__PURE__ */ new Map(), 11439 injectedStyles: /* @__PURE__ */ new WeakMap() 11440 }; 11441 if (typeof document !== "undefined") { 11442 registerDocument8(document); 11443 } 11444 return globalScope.__wpStyleRuntime; 11445 } 11446 function documentContainsStyleHash8(targetDocument, hash) { 11447 if (!targetDocument.head) { 11448 return false; 11449 } 11450 for (const style2 of targetDocument.head.querySelectorAll( 11451 `style[$STYLE_HASH_ATTRIBUTE8}]` 11452 )) { 11453 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) { 11454 return true; 11455 } 11456 } 11457 return false; 11458 } 11459 function injectStyle8(targetDocument, hash, css) { 11460 if (!targetDocument.head) { 11461 return; 11462 } 11463 const runtime = getRuntime8(); 11464 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11465 if (!injectedStyles) { 11466 injectedStyles = /* @__PURE__ */ new Set(); 11467 runtime.injectedStyles.set(targetDocument, injectedStyles); 11468 } 11469 if (injectedStyles.has(hash)) { 11470 return; 11471 } 11472 if (documentContainsStyleHash8(targetDocument, hash)) { 11473 injectedStyles.add(hash); 11474 return; 11475 } 11476 const style2 = targetDocument.createElement("style"); 11477 style2.setAttribute(STYLE_HASH_ATTRIBUTE8, hash); 11478 style2.appendChild(targetDocument.createTextNode(css)); 11479 targetDocument.head.appendChild(style2); 11480 injectedStyles.add(hash); 11481 } 11482 function registerDocument8(targetDocument) { 11483 const runtime = getRuntime8(); 11484 runtime.documents.set( 11485 targetDocument, 11486 (runtime.documents.get(targetDocument) ?? 0) + 1 11487 ); 11488 for (const [hash, css] of runtime.styles) { 11489 injectStyle8(targetDocument, hash, css); 11490 } 11491 return () => { 11492 const count = runtime.documents.get(targetDocument); 11493 if (count === void 0) { 11494 return; 11495 } 11496 if (count <= 1) { 11497 runtime.documents.delete(targetDocument); 11498 return; 11499 } 11500 runtime.documents.set(targetDocument, count - 1); 11501 }; 11502 } 11503 function registerStyle8(hash, css) { 11504 const runtime = getRuntime8(); 11505 runtime.styles.set(hash, css); 11506 for (const targetDocument of runtime.documents.keys()) { 11507 injectStyle8(targetDocument, hash, css); 11508 } 11509 } 11510 if (typeof process === "undefined" || true) { 11511 registerStyle8("bbbecfe373", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.ab4d64c07c0ba587__spinner{background-color:transparent;display:inline-block;height:var(--wpds-dimension-size-2xs,16px);opacity:1;overflow:visible;position:relative;width:var(--wpds-dimension-size-2xs,16px)}.a7654e10245bb7d2__indicator,.dc51f80c84b35fe2__track{fill:transparent;stroke-width:1.5px}.dc51f80c84b35fe2__track{stroke:var(--wpds-color-background-track-neutral,#dbdbdb)}.a7654e10245bb7d2__indicator{stroke:var(--wpds-color-background-thumb-brand,var(--wp-admin-theme-color,#3858e9));stroke-linecap:round;animation:_02322d973909703c__spinner-spin 1.4s linear infinite both;transform-origin:50% 50%}@keyframes _02322d973909703c__spinner-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}}}"); 11512 } 11513 var style_default8 = { "spinner": "ab4d64c07c0ba587__spinner", "track": "dc51f80c84b35fe2__track", "indicator": "a7654e10245bb7d2__indicator", "spinner-spin": "_02322d973909703c__spinner-spin" }; 11514 var Spinner2 = (0, import_element14.forwardRef)( 11515 function Spinner22({ className, ...props }, ref) { 11516 return /* @__PURE__ */ (0, import_jsx_runtime196.jsxs)( 11517 "svg", 11518 { 11519 className: clsx_default(style_default8.spinner, className), 11520 viewBox: "0 0 100 100", 11521 xmlns: "http://www.w3.org/2000/svg", 11522 role: "presentation", 11523 focusable: "false", 11524 ...props, 11525 ref, 11526 children: [ 11527 /* @__PURE__ */ (0, import_jsx_runtime196.jsx)( 11528 "circle", 11529 { 11530 className: style_default8.track, 11531 cx: "50", 11532 cy: "50", 11533 r: "50", 11534 vectorEffect: "non-scaling-stroke" 11535 } 11536 ), 11537 /* @__PURE__ */ (0, import_jsx_runtime196.jsx)( 11538 "path", 11539 { 11540 className: style_default8.indicator, 11541 d: "m 50 0 a 50 50 0 0 1 50 50", 11542 vectorEffect: "non-scaling-stroke" 11543 } 11544 ) 11545 ] 11546 } 11547 ); 11548 } 11549 ); 11550 11551 // packages/ui/build-module/form/primitives/validity-indicator/validity-indicator.mjs 11552 var import_jsx_runtime197 = __toESM(require_jsx_runtime(), 1); 11553 var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash"; 11554 function getRuntime9() { 11555 const globalScope = globalThis; 11556 if (globalScope.__wpStyleRuntime) { 11557 return globalScope.__wpStyleRuntime; 11558 } 11559 globalScope.__wpStyleRuntime = { 11560 documents: /* @__PURE__ */ new Map(), 11561 styles: /* @__PURE__ */ new Map(), 11562 injectedStyles: /* @__PURE__ */ new WeakMap() 11563 }; 11564 if (typeof document !== "undefined") { 11565 registerDocument9(document); 11566 } 11567 return globalScope.__wpStyleRuntime; 11568 } 11569 function documentContainsStyleHash9(targetDocument, hash) { 11570 if (!targetDocument.head) { 11571 return false; 11572 } 11573 for (const style2 of targetDocument.head.querySelectorAll( 11574 `style[$STYLE_HASH_ATTRIBUTE9}]` 11575 )) { 11576 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) { 11577 return true; 11578 } 11579 } 11580 return false; 11581 } 11582 function injectStyle9(targetDocument, hash, css) { 11583 if (!targetDocument.head) { 11584 return; 11585 } 11586 const runtime = getRuntime9(); 11587 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11588 if (!injectedStyles) { 11589 injectedStyles = /* @__PURE__ */ new Set(); 11590 runtime.injectedStyles.set(targetDocument, injectedStyles); 11591 } 11592 if (injectedStyles.has(hash)) { 11593 return; 11594 } 11595 if (documentContainsStyleHash9(targetDocument, hash)) { 11596 injectedStyles.add(hash); 11597 return; 11598 } 11599 const style2 = targetDocument.createElement("style"); 11600 style2.setAttribute(STYLE_HASH_ATTRIBUTE9, hash); 11601 style2.appendChild(targetDocument.createTextNode(css)); 11602 targetDocument.head.appendChild(style2); 11603 injectedStyles.add(hash); 11604 } 11605 function registerDocument9(targetDocument) { 11606 const runtime = getRuntime9(); 11607 runtime.documents.set( 11608 targetDocument, 11609 (runtime.documents.get(targetDocument) ?? 0) + 1 11610 ); 11611 for (const [hash, css] of runtime.styles) { 11612 injectStyle9(targetDocument, hash, css); 11613 } 11614 return () => { 11615 const count = runtime.documents.get(targetDocument); 11616 if (count === void 0) { 11617 return; 11618 } 11619 if (count <= 1) { 11620 runtime.documents.delete(targetDocument); 11621 return; 11622 } 11623 runtime.documents.set(targetDocument, count - 1); 11624 }; 11625 } 11626 function registerStyle9(hash, css) { 11627 const runtime = getRuntime9(); 11628 runtime.styles.set(hash, css); 11629 for (const targetDocument of runtime.documents.keys()) { 11630 injectStyle9(targetDocument, hash, css); 11631 } 11632 } 11633 if (typeof process === "undefined" || true) { 11634 registerStyle9("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 11635 } 11636 var global_css_defense_default5 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 11637 if (typeof process === "undefined" || true) { 11638 registerStyle9("bd510b0d40", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7a7ac88e306348e7__indicator{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);align-items:flex-start;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);gap:var(--wpds-dimension-gap-xs,4px);line-height:var(--wpds-typography-line-height-xs,16px);@media not (prefers-reduced-motion){animation:_48722cc5dd090ce4__indicator-jump var(--wpds-motion-duration-md,.2s) cubic-bezier(.68,-.55,.27,1.55)}}._57a3bbbfbe38a5c6__is-invalid{color:var(--wpds-color-foreground-content-error-weak,#cc1818)}._9e944dc198aac10b__is-valid{color:var(--wpds-color-foreground-content-success-weak,#007f2f)}.e482806667437c6a__indicator-icon{flex-shrink:0}._6e46434cc23019d2__indicator-spinner{height:var(--wpds-dimension-size-3xs,12px);margin:2px;width:var(--wpds-dimension-size-3xs,12px)}@keyframes _48722cc5dd090ce4__indicator-jump{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}}}'); 11639 } 11640 var style_default9 = { "indicator": "_7a7ac88e306348e7__indicator", "indicator-jump": "_48722cc5dd090ce4__indicator-jump", "is-invalid": "_57a3bbbfbe38a5c6__is-invalid", "is-valid": "_9e944dc198aac10b__is-valid", "indicator-icon": "e482806667437c6a__indicator-icon", "indicator-spinner": "_6e46434cc23019d2__indicator-spinner" }; 11641 var ICON = { 11642 valid: published_default, 11643 invalid: error_default 11644 }; 11645 function ValidityIndicator({ 11646 id, 11647 type, 11648 message 11649 }) { 11650 return /* @__PURE__ */ (0, import_jsx_runtime197.jsxs)( 11651 "p", 11652 { 11653 id, 11654 className: clsx_default( 11655 global_css_defense_default5.p, 11656 style_default9.indicator, 11657 style_default9[`is-$type}`] 11658 ), 11659 children: [ 11660 type === "validating" ? /* @__PURE__ */ (0, import_jsx_runtime197.jsx)(Spinner2, { className: style_default9["indicator-spinner"] }) : /* @__PURE__ */ (0, import_jsx_runtime197.jsx)( 11661 Icon, 11662 { 11663 className: style_default9["indicator-icon"], 11664 icon: ICON[type], 11665 size: 16, 11666 fill: "currentColor" 11667 } 11668 ), 11669 message 11670 ] 11671 } 11672 ); 11673 } 11674 11675 // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs 11676 var import_jsx_runtime198 = __toESM(require_jsx_runtime(), 1); 11677 var DEFAULT_RENDER = (props) => /* @__PURE__ */ (0, import_jsx_runtime198.jsx)(Stack, { ...props, direction: "column", gap: "sm" }); 11678 function appendRequiredIndicator(label, required, markWhenOptional) { 11679 let suffix; 11680 if (required && !markWhenOptional) { 11681 suffix = `(${(0, import_i18n11.__)("Required")})`; 11682 } else if (!required && markWhenOptional) { 11683 suffix = `(${(0, import_i18n11.__)("Optional")})`; 11684 } 11685 if (!suffix) { 11686 return label; 11687 } 11688 if (typeof label === "string") { 11689 return `$label} $suffix}`; 11690 } 11691 return /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(import_jsx_runtime198.Fragment, { children: [ 11692 label, 11693 " ", 11694 suffix 11695 ] }); 11696 } 11697 var VALIDITY_VISIBLE_ATTRIBUTE = "data-validity-visible"; 11698 var ControlWithError = (0, import_element15.forwardRef)(function ControlWithError2({ 11699 required, 11700 markWhenOptional, 11701 customValidity, 11702 getValidityTarget, 11703 children, 11704 render = DEFAULT_RENDER, 11705 ...restProps 11706 }, forwardedRef) { 11707 const [errorMessage, setErrorMessage] = (0, import_element15.useState)(); 11708 const [statusMessage, setStatusMessage] = (0, import_element15.useState)(); 11709 const [showMessage, setShowMessage] = (0, import_element15.useState)(false); 11710 const [isTouched, setIsTouched] = (0, import_element15.useState)(false); 11711 const wrapperRef = (0, import_element15.useRef)(null); 11712 (0, import_element15.useEffect)(() => { 11713 const validityTarget = getValidityTarget(); 11714 const handler = () => { 11715 if (customValidity?.type !== "validating") { 11716 setErrorMessage(validityTarget?.validationMessage); 11717 } 11718 setShowMessage(true); 11719 validityTarget?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, ""); 11720 }; 11721 validityTarget?.addEventListener("invalid", handler); 11722 return () => validityTarget?.removeEventListener("invalid", handler); 11723 }, [customValidity?.type, getValidityTarget]); 11724 (0, import_element15.useEffect)(() => { 11725 const validityTarget = getValidityTarget(); 11726 const suppressNativePopover = (event) => { 11727 event.preventDefault(); 11728 if (!event.isTrusted) { 11729 return; 11730 } 11731 const target = event.target; 11732 const firstErrorInForm = Array.from( 11733 target.form?.elements ?? [] 11734 ).find((el) => !el.validity.valid); 11735 if (!target.form || firstErrorInForm === target) { 11736 target.focus(); 11737 } 11738 }; 11739 const radioSiblings = validityTarget?.type === "radio" && validityTarget?.name ? Array.from( 11740 wrapperRef.current?.querySelectorAll( 11741 `input[type="radio"][name="$validityTarget?.name}"]` 11742 ) ?? [] 11743 ).filter((sibling) => sibling !== validityTarget) : []; 11744 validityTarget?.addEventListener("invalid", suppressNativePopover); 11745 radioSiblings.forEach( 11746 (sibling) => sibling.addEventListener("invalid", suppressNativePopover) 11747 ); 11748 return () => { 11749 validityTarget?.removeEventListener( 11750 "invalid", 11751 suppressNativePopover 11752 ); 11753 radioSiblings.forEach( 11754 (sibling) => sibling.removeEventListener("invalid", suppressNativePopover) 11755 ); 11756 }; 11757 }, [getValidityTarget]); 11758 (0, import_element15.useEffect)(() => { 11759 const validityTarget = getValidityTarget(); 11760 if (!customValidity?.type) { 11761 validityTarget?.setCustomValidity(""); 11762 setErrorMessage(validityTarget?.validationMessage); 11763 setStatusMessage(void 0); 11764 return; 11765 } 11766 switch (customValidity.type) { 11767 case "validating": { 11768 validityTarget?.setCustomValidity(""); 11769 setErrorMessage(void 0); 11770 setStatusMessage({ 11771 type: "validating", 11772 message: customValidity.message 11773 }); 11774 break; 11775 } 11776 case "valid": { 11777 validityTarget?.setCustomValidity(""); 11778 setErrorMessage(validityTarget?.validationMessage); 11779 setStatusMessage({ 11780 type: "valid", 11781 message: customValidity.message 11782 }); 11783 break; 11784 } 11785 case "invalid": { 11786 validityTarget?.setCustomValidity( 11787 customValidity.message ?? "" 11788 ); 11789 setErrorMessage(validityTarget?.validationMessage); 11790 setStatusMessage(void 0); 11791 break; 11792 } 11793 } 11794 }, [customValidity, getValidityTarget]); 11795 (0, import_element15.useEffect)(() => { 11796 if (!isTouched || showMessage) { 11797 return; 11798 } 11799 if (customValidity?.type === "validating") { 11800 const timer = setTimeout(() => { 11801 setShowMessage(true); 11802 }, 1e3); 11803 return () => clearTimeout(timer); 11804 } 11805 setShowMessage(true); 11806 }, [isTouched, customValidity?.type, showMessage]); 11807 const onBlur = (event) => { 11808 if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) { 11809 return; 11810 } 11811 if (!isTouched) { 11812 setIsTouched(true); 11813 getValidityTarget()?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, ""); 11814 } 11815 const validityTarget = getValidityTarget(); 11816 const isValidating = customValidity?.type === "validating"; 11817 window.queueMicrotask(() => { 11818 if (!isValidating) { 11819 setErrorMessage(validityTarget?.validationMessage); 11820 } 11821 }); 11822 }; 11823 const messageId = (0, import_element15.useId)(); 11824 const message = (() => { 11825 if (errorMessage) { 11826 return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( 11827 ValidityIndicator, 11828 { 11829 id: messageId, 11830 type: "invalid", 11831 message: errorMessage 11832 } 11833 ); 11834 } 11835 if (statusMessage?.type) { 11836 return /* @__PURE__ */ (0, import_jsx_runtime198.jsx)( 11837 ValidityIndicator, 11838 { 11839 id: messageId, 11840 type: statusMessage.type, 11841 message: statusMessage.message 11842 } 11843 ); 11844 } 11845 return null; 11846 })(); 11847 const visibleMessage = showMessage ? message : null; 11848 (0, import_element15.useEffect)(() => { 11849 const target = getValidityTarget(); 11850 if (!target) { 11851 return; 11852 } 11853 function setDescribedBy(el, shouldAdd) { 11854 const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter((id) => id && id !== messageId); 11855 if (shouldAdd) { 11856 ids.push(messageId); 11857 } 11858 if (ids.length) { 11859 el.setAttribute("aria-describedby", ids.join(" ")); 11860 } else { 11861 el.removeAttribute("aria-describedby"); 11862 } 11863 } 11864 setDescribedBy(target, !!visibleMessage); 11865 return () => setDescribedBy(target, false); 11866 }, [visibleMessage, messageId, getValidityTarget]); 11867 return useRender({ 11868 render, 11869 ref: [forwardedRef, wrapperRef], 11870 props: mergeProps(restProps, { 11871 onBlur, 11872 children: /* @__PURE__ */ (0, import_jsx_runtime198.jsxs)(import_jsx_runtime198.Fragment, { children: [ 11873 (0, import_element15.cloneElement)(children, { 11874 label: appendRequiredIndicator( 11875 children.props.label, 11876 required, 11877 markWhenOptional 11878 ), 11879 required 11880 }), 11881 visibleMessage 11882 ] }) 11883 }) 11884 }); 11885 }); 11886 11887 // packages/ui/build-module/form/primitives/field/index.mjs 11888 var field_exports = {}; 11889 __export(field_exports, { 11890 Control: () => Control, 11891 Description: () => Description, 11892 Details: () => Details, 11893 Item: () => Item, 11894 Label: () => Label, 11895 Root: () => Root, 11896 VisualLabel: () => VisualLabel 11897 }); 11898 11899 // packages/ui/build-module/form/primitives/field/root.mjs 11900 var import_element16 = __toESM(require_element(), 1); 11901 var import_jsx_runtime199 = __toESM(require_jsx_runtime(), 1); 11902 var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash"; 11903 function getRuntime10() { 11904 const globalScope = globalThis; 11905 if (globalScope.__wpStyleRuntime) { 11906 return globalScope.__wpStyleRuntime; 11907 } 11908 globalScope.__wpStyleRuntime = { 11909 documents: /* @__PURE__ */ new Map(), 11910 styles: /* @__PURE__ */ new Map(), 11911 injectedStyles: /* @__PURE__ */ new WeakMap() 11912 }; 11913 if (typeof document !== "undefined") { 11914 registerDocument10(document); 11915 } 11916 return globalScope.__wpStyleRuntime; 11917 } 11918 function documentContainsStyleHash10(targetDocument, hash) { 11919 if (!targetDocument.head) { 11920 return false; 11921 } 11922 for (const style2 of targetDocument.head.querySelectorAll( 11923 `style[$STYLE_HASH_ATTRIBUTE10}]` 11924 )) { 11925 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) { 11926 return true; 11927 } 11928 } 11929 return false; 11930 } 11931 function injectStyle10(targetDocument, hash, css) { 11932 if (!targetDocument.head) { 11933 return; 11934 } 11935 const runtime = getRuntime10(); 11936 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11937 if (!injectedStyles) { 11938 injectedStyles = /* @__PURE__ */ new Set(); 11939 runtime.injectedStyles.set(targetDocument, injectedStyles); 11940 } 11941 if (injectedStyles.has(hash)) { 11942 return; 11943 } 11944 if (documentContainsStyleHash10(targetDocument, hash)) { 11945 injectedStyles.add(hash); 11946 return; 11947 } 11948 const style2 = targetDocument.createElement("style"); 11949 style2.setAttribute(STYLE_HASH_ATTRIBUTE10, hash); 11950 style2.appendChild(targetDocument.createTextNode(css)); 11951 targetDocument.head.appendChild(style2); 11952 injectedStyles.add(hash); 11953 } 11954 function registerDocument10(targetDocument) { 11955 const runtime = getRuntime10(); 11956 runtime.documents.set( 11957 targetDocument, 11958 (runtime.documents.get(targetDocument) ?? 0) + 1 11959 ); 11960 for (const [hash, css] of runtime.styles) { 11961 injectStyle10(targetDocument, hash, css); 11962 } 11963 return () => { 11964 const count = runtime.documents.get(targetDocument); 11965 if (count === void 0) { 11966 return; 11967 } 11968 if (count <= 1) { 11969 runtime.documents.delete(targetDocument); 11970 return; 11971 } 11972 runtime.documents.set(targetDocument, count - 1); 11973 }; 11974 } 11975 function registerStyle10(hash, css) { 11976 const runtime = getRuntime10(); 11977 runtime.styles.set(hash, css); 11978 for (const targetDocument of runtime.documents.keys()) { 11979 injectStyle10(targetDocument, hash, css); 11980 } 11981 } 11982 if (typeof process === "undefined" || true) { 11983 registerStyle10("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 11984 } 11985 var resets_default3 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 11986 var DEFAULT_RENDER2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime199.jsx)(Stack, { ...props, direction: "column", gap: "sm" }); 11987 var Root = (0, import_element16.forwardRef)(function Root2({ className, render = DEFAULT_RENDER2, ...restProps }, ref) { 11988 return /* @__PURE__ */ (0, import_jsx_runtime199.jsx)( 11989 index_parts_exports.Root, 11990 { 11991 ref, 11992 className: clsx_default(resets_default3["box-sizing"], className), 11993 render, 11994 ...restProps 11995 } 11996 ); 11997 }); 11998 11999 // packages/ui/build-module/form/primitives/field/item.mjs 12000 var import_element17 = __toESM(require_element(), 1); 12001 var import_jsx_runtime200 = __toESM(require_jsx_runtime(), 1); 12002 var Item = (0, import_element17.forwardRef)(function Item2(props, ref) { 12003 return /* @__PURE__ */ (0, import_jsx_runtime200.jsx)(index_parts_exports.Item, { ref, ...props }); 12004 }); 12005 12006 // packages/ui/build-module/form/primitives/field/label.mjs 12007 var import_element18 = __toESM(require_element(), 1); 12008 var import_jsx_runtime201 = __toESM(require_jsx_runtime(), 1); 12009 var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash"; 12010 function getRuntime11() { 12011 const globalScope = globalThis; 12012 if (globalScope.__wpStyleRuntime) { 12013 return globalScope.__wpStyleRuntime; 12014 } 12015 globalScope.__wpStyleRuntime = { 12016 documents: /* @__PURE__ */ new Map(), 12017 styles: /* @__PURE__ */ new Map(), 12018 injectedStyles: /* @__PURE__ */ new WeakMap() 12019 }; 12020 if (typeof document !== "undefined") { 12021 registerDocument11(document); 12022 } 12023 return globalScope.__wpStyleRuntime; 12024 } 12025 function documentContainsStyleHash11(targetDocument, hash) { 12026 if (!targetDocument.head) { 12027 return false; 12028 } 12029 for (const style2 of targetDocument.head.querySelectorAll( 12030 `style[$STYLE_HASH_ATTRIBUTE11}]` 12031 )) { 12032 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) { 12033 return true; 12034 } 12035 } 12036 return false; 12037 } 12038 function injectStyle11(targetDocument, hash, css) { 12039 if (!targetDocument.head) { 12040 return; 12041 } 12042 const runtime = getRuntime11(); 12043 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12044 if (!injectedStyles) { 12045 injectedStyles = /* @__PURE__ */ new Set(); 12046 runtime.injectedStyles.set(targetDocument, injectedStyles); 12047 } 12048 if (injectedStyles.has(hash)) { 12049 return; 12050 } 12051 if (documentContainsStyleHash11(targetDocument, hash)) { 12052 injectedStyles.add(hash); 12053 return; 12054 } 12055 const style2 = targetDocument.createElement("style"); 12056 style2.setAttribute(STYLE_HASH_ATTRIBUTE11, hash); 12057 style2.appendChild(targetDocument.createTextNode(css)); 12058 targetDocument.head.appendChild(style2); 12059 injectedStyles.add(hash); 12060 } 12061 function registerDocument11(targetDocument) { 12062 const runtime = getRuntime11(); 12063 runtime.documents.set( 12064 targetDocument, 12065 (runtime.documents.get(targetDocument) ?? 0) + 1 12066 ); 12067 for (const [hash, css] of runtime.styles) { 12068 injectStyle11(targetDocument, hash, css); 12069 } 12070 return () => { 12071 const count = runtime.documents.get(targetDocument); 12072 if (count === void 0) { 12073 return; 12074 } 12075 if (count <= 1) { 12076 runtime.documents.delete(targetDocument); 12077 return; 12078 } 12079 runtime.documents.set(targetDocument, count - 1); 12080 }; 12081 } 12082 function registerStyle11(hash, css) { 12083 const runtime = getRuntime11(); 12084 runtime.styles.set(hash, css); 12085 for (const targetDocument of runtime.documents.keys()) { 12086 injectStyle11(targetDocument, hash, css); 12087 } 12088 } 12089 if (typeof process === "undefined" || true) { 12090 registerStyle11("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 12091 } 12092 var field_default = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" }; 12093 var Label = (0, import_element18.forwardRef)( 12094 function Label2({ className, hideFromVision, variant, ...restProps }, ref) { 12095 const label = /* @__PURE__ */ (0, import_jsx_runtime201.jsx)( 12096 index_parts_exports.Label, 12097 { 12098 ref, 12099 className: clsx_default( 12100 field_default.label, 12101 variant && field_default[`is-$variant}`], 12102 className 12103 ), 12104 ...restProps 12105 } 12106 ); 12107 if (hideFromVision) { 12108 return /* @__PURE__ */ (0, import_jsx_runtime201.jsx)(VisuallyHidden, { render: label }); 12109 } 12110 return label; 12111 } 12112 ); 12113 12114 // packages/ui/build-module/form/primitives/field/description.mjs 12115 var import_element19 = __toESM(require_element(), 1); 12116 var import_jsx_runtime202 = __toESM(require_jsx_runtime(), 1); 12117 var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash"; 12118 function getRuntime12() { 12119 const globalScope = globalThis; 12120 if (globalScope.__wpStyleRuntime) { 12121 return globalScope.__wpStyleRuntime; 12122 } 12123 globalScope.__wpStyleRuntime = { 12124 documents: /* @__PURE__ */ new Map(), 12125 styles: /* @__PURE__ */ new Map(), 12126 injectedStyles: /* @__PURE__ */ new WeakMap() 12127 }; 12128 if (typeof document !== "undefined") { 12129 registerDocument12(document); 12130 } 12131 return globalScope.__wpStyleRuntime; 12132 } 12133 function documentContainsStyleHash12(targetDocument, hash) { 12134 if (!targetDocument.head) { 12135 return false; 12136 } 12137 for (const style2 of targetDocument.head.querySelectorAll( 12138 `style[$STYLE_HASH_ATTRIBUTE12}]` 12139 )) { 12140 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) { 12141 return true; 12142 } 12143 } 12144 return false; 12145 } 12146 function injectStyle12(targetDocument, hash, css) { 12147 if (!targetDocument.head) { 12148 return; 12149 } 12150 const runtime = getRuntime12(); 12151 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12152 if (!injectedStyles) { 12153 injectedStyles = /* @__PURE__ */ new Set(); 12154 runtime.injectedStyles.set(targetDocument, injectedStyles); 12155 } 12156 if (injectedStyles.has(hash)) { 12157 return; 12158 } 12159 if (documentContainsStyleHash12(targetDocument, hash)) { 12160 injectedStyles.add(hash); 12161 return; 12162 } 12163 const style2 = targetDocument.createElement("style"); 12164 style2.setAttribute(STYLE_HASH_ATTRIBUTE12, hash); 12165 style2.appendChild(targetDocument.createTextNode(css)); 12166 targetDocument.head.appendChild(style2); 12167 injectedStyles.add(hash); 12168 } 12169 function registerDocument12(targetDocument) { 12170 const runtime = getRuntime12(); 12171 runtime.documents.set( 12172 targetDocument, 12173 (runtime.documents.get(targetDocument) ?? 0) + 1 12174 ); 12175 for (const [hash, css] of runtime.styles) { 12176 injectStyle12(targetDocument, hash, css); 12177 } 12178 return () => { 12179 const count = runtime.documents.get(targetDocument); 12180 if (count === void 0) { 12181 return; 12182 } 12183 if (count <= 1) { 12184 runtime.documents.delete(targetDocument); 12185 return; 12186 } 12187 runtime.documents.set(targetDocument, count - 1); 12188 }; 12189 } 12190 function registerStyle12(hash, css) { 12191 const runtime = getRuntime12(); 12192 runtime.styles.set(hash, css); 12193 for (const targetDocument of runtime.documents.keys()) { 12194 injectStyle12(targetDocument, hash, css); 12195 } 12196 } 12197 if (typeof process === "undefined" || true) { 12198 registerStyle12("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 12199 } 12200 var global_css_defense_default6 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 12201 if (typeof process === "undefined" || true) { 12202 registerStyle12("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 12203 } 12204 var field_default2 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" }; 12205 var Description = (0, import_element19.forwardRef)(function Description2({ className, ...restProps }, ref) { 12206 return /* @__PURE__ */ (0, import_jsx_runtime202.jsx)( 12207 index_parts_exports.Description, 12208 { 12209 ref, 12210 className: clsx_default( 12211 global_css_defense_default6.p, 12212 field_default2.description, 12213 className 12214 ), 12215 ...restProps 12216 } 12217 ); 12218 }); 12219 12220 // packages/ui/build-module/form/primitives/field/details.mjs 12221 var import_element20 = __toESM(require_element(), 1); 12222 var import_i18n12 = __toESM(require_i18n(), 1); 12223 var import_jsx_runtime203 = __toESM(require_jsx_runtime(), 1); 12224 var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash"; 12225 function getRuntime13() { 12226 const globalScope = globalThis; 12227 if (globalScope.__wpStyleRuntime) { 12228 return globalScope.__wpStyleRuntime; 12229 } 12230 globalScope.__wpStyleRuntime = { 12231 documents: /* @__PURE__ */ new Map(), 12232 styles: /* @__PURE__ */ new Map(), 12233 injectedStyles: /* @__PURE__ */ new WeakMap() 12234 }; 12235 if (typeof document !== "undefined") { 12236 registerDocument13(document); 12237 } 12238 return globalScope.__wpStyleRuntime; 12239 } 12240 function documentContainsStyleHash13(targetDocument, hash) { 12241 if (!targetDocument.head) { 12242 return false; 12243 } 12244 for (const style2 of targetDocument.head.querySelectorAll( 12245 `style[$STYLE_HASH_ATTRIBUTE13}]` 12246 )) { 12247 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) { 12248 return true; 12249 } 12250 } 12251 return false; 12252 } 12253 function injectStyle13(targetDocument, hash, css) { 12254 if (!targetDocument.head) { 12255 return; 12256 } 12257 const runtime = getRuntime13(); 12258 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12259 if (!injectedStyles) { 12260 injectedStyles = /* @__PURE__ */ new Set(); 12261 runtime.injectedStyles.set(targetDocument, injectedStyles); 12262 } 12263 if (injectedStyles.has(hash)) { 12264 return; 12265 } 12266 if (documentContainsStyleHash13(targetDocument, hash)) { 12267 injectedStyles.add(hash); 12268 return; 12269 } 12270 const style2 = targetDocument.createElement("style"); 12271 style2.setAttribute(STYLE_HASH_ATTRIBUTE13, hash); 12272 style2.appendChild(targetDocument.createTextNode(css)); 12273 targetDocument.head.appendChild(style2); 12274 injectedStyles.add(hash); 12275 } 12276 function registerDocument13(targetDocument) { 12277 const runtime = getRuntime13(); 12278 runtime.documents.set( 12279 targetDocument, 12280 (runtime.documents.get(targetDocument) ?? 0) + 1 12281 ); 12282 for (const [hash, css] of runtime.styles) { 12283 injectStyle13(targetDocument, hash, css); 12284 } 12285 return () => { 12286 const count = runtime.documents.get(targetDocument); 12287 if (count === void 0) { 12288 return; 12289 } 12290 if (count <= 1) { 12291 runtime.documents.delete(targetDocument); 12292 return; 12293 } 12294 runtime.documents.set(targetDocument, count - 1); 12295 }; 12296 } 12297 function registerStyle13(hash, css) { 12298 const runtime = getRuntime13(); 12299 runtime.styles.set(hash, css); 12300 for (const targetDocument of runtime.documents.keys()) { 12301 injectStyle13(targetDocument, hash, css); 12302 } 12303 } 12304 if (typeof process === "undefined" || true) { 12305 registerStyle13("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 12306 } 12307 var field_default3 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" }; 12308 var Details = (0, import_element20.forwardRef)( 12309 function Details2({ className, ...restProps }, ref) { 12310 return /* @__PURE__ */ (0, import_jsx_runtime203.jsxs)(import_jsx_runtime203.Fragment, { children: [ 12311 /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime203.jsx)(index_parts_exports.Description, {}), children: (0, import_i18n12.__)("More details follow the field.") }), 12312 /* @__PURE__ */ (0, import_jsx_runtime203.jsx)( 12313 "div", 12314 { 12315 ref, 12316 className: clsx_default(field_default3.description, className), 12317 ...restProps 12318 } 12319 ) 12320 ] }); 12321 } 12322 ); 12323 12324 // packages/ui/build-module/form/primitives/field/control.mjs 12325 var import_element21 = __toESM(require_element(), 1); 12326 var import_jsx_runtime204 = __toESM(require_jsx_runtime(), 1); 12327 var Control = (0, import_element21.forwardRef)( 12328 function Control2(props, ref) { 12329 return /* @__PURE__ */ (0, import_jsx_runtime204.jsx)(index_parts_exports.Control, { ref, ...props }); 12330 } 12331 ); 12332 12333 // packages/ui/build-module/form/primitives/field/visual-label.mjs 12334 var import_element22 = __toESM(require_element(), 1); 12335 var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash"; 12336 function getRuntime14() { 12337 const globalScope = globalThis; 12338 if (globalScope.__wpStyleRuntime) { 12339 return globalScope.__wpStyleRuntime; 12340 } 12341 globalScope.__wpStyleRuntime = { 12342 documents: /* @__PURE__ */ new Map(), 12343 styles: /* @__PURE__ */ new Map(), 12344 injectedStyles: /* @__PURE__ */ new WeakMap() 12345 }; 12346 if (typeof document !== "undefined") { 12347 registerDocument14(document); 12348 } 12349 return globalScope.__wpStyleRuntime; 12350 } 12351 function documentContainsStyleHash14(targetDocument, hash) { 12352 if (!targetDocument.head) { 12353 return false; 12354 } 12355 for (const style2 of targetDocument.head.querySelectorAll( 12356 `style[$STYLE_HASH_ATTRIBUTE14}]` 12357 )) { 12358 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) { 12359 return true; 12360 } 12361 } 12362 return false; 12363 } 12364 function injectStyle14(targetDocument, hash, css) { 12365 if (!targetDocument.head) { 12366 return; 12367 } 12368 const runtime = getRuntime14(); 12369 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12370 if (!injectedStyles) { 12371 injectedStyles = /* @__PURE__ */ new Set(); 12372 runtime.injectedStyles.set(targetDocument, injectedStyles); 12373 } 12374 if (injectedStyles.has(hash)) { 12375 return; 12376 } 12377 if (documentContainsStyleHash14(targetDocument, hash)) { 12378 injectedStyles.add(hash); 12379 return; 12380 } 12381 const style2 = targetDocument.createElement("style"); 12382 style2.setAttribute(STYLE_HASH_ATTRIBUTE14, hash); 12383 style2.appendChild(targetDocument.createTextNode(css)); 12384 targetDocument.head.appendChild(style2); 12385 injectedStyles.add(hash); 12386 } 12387 function registerDocument14(targetDocument) { 12388 const runtime = getRuntime14(); 12389 runtime.documents.set( 12390 targetDocument, 12391 (runtime.documents.get(targetDocument) ?? 0) + 1 12392 ); 12393 for (const [hash, css] of runtime.styles) { 12394 injectStyle14(targetDocument, hash, css); 12395 } 12396 return () => { 12397 const count = runtime.documents.get(targetDocument); 12398 if (count === void 0) { 12399 return; 12400 } 12401 if (count <= 1) { 12402 runtime.documents.delete(targetDocument); 12403 return; 12404 } 12405 runtime.documents.set(targetDocument, count - 1); 12406 }; 12407 } 12408 function registerStyle14(hash, css) { 12409 const runtime = getRuntime14(); 12410 runtime.styles.set(hash, css); 12411 for (const targetDocument of runtime.documents.keys()) { 12412 injectStyle14(targetDocument, hash, css); 12413 } 12414 } 12415 if (typeof process === "undefined" || true) { 12416 registerStyle14("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 12417 } 12418 var field_default4 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" }; 12419 var VisualLabel = (0, import_element22.forwardRef)( 12420 function VisualLabel2({ className, render, variant, ...restProps }, ref) { 12421 return useRender({ 12422 defaultTagName: "span", 12423 render, 12424 ref, 12425 props: mergeProps(restProps, { 12426 className: clsx_default( 12427 field_default4.label, 12428 variant && field_default4[`is-$variant}`], 12429 className 12430 ) 12431 }) 12432 }); 12433 } 12434 ); 12435 VisualLabel.displayName = "Field.VisualLabel"; 12436 12437 // packages/ui/build-module/form/primitives/textarea/textarea.mjs 12438 var import_element23 = __toESM(require_element(), 1); 12439 var import_jsx_runtime205 = __toESM(require_jsx_runtime(), 1); 12440 var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash"; 12441 function getRuntime15() { 12442 const globalScope = globalThis; 12443 if (globalScope.__wpStyleRuntime) { 12444 return globalScope.__wpStyleRuntime; 12445 } 12446 globalScope.__wpStyleRuntime = { 12447 documents: /* @__PURE__ */ new Map(), 12448 styles: /* @__PURE__ */ new Map(), 12449 injectedStyles: /* @__PURE__ */ new WeakMap() 12450 }; 12451 if (typeof document !== "undefined") { 12452 registerDocument15(document); 12453 } 12454 return globalScope.__wpStyleRuntime; 12455 } 12456 function documentContainsStyleHash15(targetDocument, hash) { 12457 if (!targetDocument.head) { 12458 return false; 12459 } 12460 for (const style2 of targetDocument.head.querySelectorAll( 12461 `style[$STYLE_HASH_ATTRIBUTE15}]` 12462 )) { 12463 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) { 12464 return true; 12465 } 12466 } 12467 return false; 12468 } 12469 function injectStyle15(targetDocument, hash, css) { 12470 if (!targetDocument.head) { 12471 return; 12472 } 12473 const runtime = getRuntime15(); 12474 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12475 if (!injectedStyles) { 12476 injectedStyles = /* @__PURE__ */ new Set(); 12477 runtime.injectedStyles.set(targetDocument, injectedStyles); 12478 } 12479 if (injectedStyles.has(hash)) { 12480 return; 12481 } 12482 if (documentContainsStyleHash15(targetDocument, hash)) { 12483 injectedStyles.add(hash); 12484 return; 12485 } 12486 const style2 = targetDocument.createElement("style"); 12487 style2.setAttribute(STYLE_HASH_ATTRIBUTE15, hash); 12488 style2.appendChild(targetDocument.createTextNode(css)); 12489 targetDocument.head.appendChild(style2); 12490 injectedStyles.add(hash); 12491 } 12492 function registerDocument15(targetDocument) { 12493 const runtime = getRuntime15(); 12494 runtime.documents.set( 12495 targetDocument, 12496 (runtime.documents.get(targetDocument) ?? 0) + 1 12497 ); 12498 for (const [hash, css] of runtime.styles) { 12499 injectStyle15(targetDocument, hash, css); 12500 } 12501 return () => { 12502 const count = runtime.documents.get(targetDocument); 12503 if (count === void 0) { 12504 return; 12505 } 12506 if (count <= 1) { 12507 runtime.documents.delete(targetDocument); 12508 return; 12509 } 12510 runtime.documents.set(targetDocument, count - 1); 12511 }; 12512 } 12513 function registerStyle15(hash, css) { 12514 const runtime = getRuntime15(); 12515 runtime.styles.set(hash, css); 12516 for (const targetDocument of runtime.documents.keys()) { 12517 injectStyle15(targetDocument, hash, css); 12518 } 12519 } 12520 if (typeof process === "undefined" || true) { 12521 registerStyle15("1540cbc709", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._1e441c22c9dc5d28__wrapper{--wp-ui-textarea-min-height:var(--wpds-dimension-size-lg,40px)}._414844876c32ecee__textarea{min-height:calc(var(--wp-ui-textarea-min-height) - 2px);resize:block}}@layer compositions{._1e441c22c9dc5d28__wrapper{--wp-ui-input-padding-block:9.9px;height:auto;line-height:1.4}}}"); 12522 } 12523 var style_default10 = { "wrapper": "_1e441c22c9dc5d28__wrapper", "textarea": "_414844876c32ecee__textarea" }; 12524 if (typeof process === "undefined" || true) { 12525 registerStyle15("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 12526 } 12527 var global_css_defense_default7 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 12528 var wrappedRender = (render, restProps) => { 12529 return function textareaRender(props) { 12530 return typeof render === "function" ? render(mergeProps(props, restProps)) : (0, import_element23.cloneElement)(render, mergeProps(props, restProps)); 12531 }; 12532 }; 12533 var Textarea = (0, import_element23.forwardRef)( 12534 function Textarea2({ 12535 className, 12536 defaultValue, 12537 disabled: disabled2, 12538 onValueChange, 12539 render, 12540 rows = 4, 12541 style: style2, 12542 value, 12543 ...restProps 12544 }, ref) { 12545 return /* @__PURE__ */ (0, import_jsx_runtime205.jsx)( 12546 Input3, 12547 { 12548 className: clsx_default(style_default10.wrapper, className), 12549 style: style2, 12550 render: wrappedRender( 12551 render || ((props) => /* @__PURE__ */ (0, import_jsx_runtime205.jsx)("textarea", { ...props })), 12552 { 12553 className: clsx_default( 12554 global_css_defense_default7.textarea, 12555 style_default10.textarea 12556 ), 12557 ref, 12558 rows, 12559 ...restProps 12560 } 12561 ), 12562 value, 12563 defaultValue, 12564 onValueChange, 12565 disabled: disabled2 12566 } 12567 ); 12568 } 12569 ); 12570 12571 // packages/ui/build-module/form/textarea-control/textarea-control.mjs 12572 var import_element24 = __toESM(require_element(), 1); 12573 var import_jsx_runtime206 = __toESM(require_jsx_runtime(), 1); 12574 var TextareaControl = (0, import_element24.forwardRef)(function TextareaControl2({ 12575 className, 12576 label, 12577 description, 12578 details, 12579 hideLabelFromVision, 12580 ...restProps 12581 }, ref) { 12582 return /* @__PURE__ */ (0, import_jsx_runtime206.jsxs)(field_exports.Root, { className, children: [ 12583 /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(field_exports.Label, { hideFromVision: hideLabelFromVision, children: label }), 12584 /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(Textarea, { ref, ...restProps }), 12585 description && /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(field_exports.Description, { children: description }), 12586 details && /* @__PURE__ */ (0, import_jsx_runtime206.jsx)(field_exports.Details, { children: details }) 12587 ] }); 12588 }); 12589 12590 // packages/ui/build-module/form/with-validation/validated-textarea-control/validated-textarea-control.mjs 12591 var import_element25 = __toESM(require_element(), 1); 12592 var import_compose5 = __toESM(require_compose(), 1); 12593 var import_jsx_runtime207 = __toESM(require_jsx_runtime(), 1); 12594 var ValidatedTextareaControl = (0, import_element25.forwardRef)(function ValidatedTextareaControl2({ required, markWhenOptional, customValidity, ...restProps }, forwardedRef) { 12595 const validityTargetRef = (0, import_element25.useRef)(null); 12596 const mergedRefs = (0, import_compose5.useMergeRefs)([forwardedRef, validityTargetRef]); 12597 return /* @__PURE__ */ (0, import_jsx_runtime207.jsx)( 12598 ControlWithError, 12599 { 12600 required, 12601 markWhenOptional, 12602 customValidity, 12603 getValidityTarget: () => validityTargetRef.current, 12604 children: /* @__PURE__ */ (0, import_jsx_runtime207.jsx)(TextareaControl, { ref: mergedRefs, ...restProps }) 12605 } 12606 ); 12607 }); 12608 12609 // packages/ui/build-module/tabs/index.mjs 12610 var tabs_exports = {}; 12611 __export(tabs_exports, { 12612 List: () => List, 12613 Panel: () => Panel, 12614 Root: () => Root3, 12615 Tab: () => Tab 12616 }); 12617 12618 // packages/ui/build-module/tabs/list.mjs 12619 var import_element26 = __toESM(require_element(), 1); 12620 var import_compose6 = __toESM(require_compose(), 1); 12621 var import_jsx_runtime208 = __toESM(require_jsx_runtime(), 1); 12622 var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash"; 12623 function getRuntime16() { 12624 const globalScope = globalThis; 12625 if (globalScope.__wpStyleRuntime) { 12626 return globalScope.__wpStyleRuntime; 12627 } 12628 globalScope.__wpStyleRuntime = { 12629 documents: /* @__PURE__ */ new Map(), 12630 styles: /* @__PURE__ */ new Map(), 12631 injectedStyles: /* @__PURE__ */ new WeakMap() 12632 }; 12633 if (typeof document !== "undefined") { 12634 registerDocument16(document); 12635 } 12636 return globalScope.__wpStyleRuntime; 12637 } 12638 function documentContainsStyleHash16(targetDocument, hash) { 12639 if (!targetDocument.head) { 12640 return false; 12641 } 12642 for (const style2 of targetDocument.head.querySelectorAll( 12643 `style[$STYLE_HASH_ATTRIBUTE16}]` 12644 )) { 12645 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) { 12646 return true; 12647 } 12648 } 12649 return false; 12650 } 12651 function injectStyle16(targetDocument, hash, css) { 12652 if (!targetDocument.head) { 12653 return; 12654 } 12655 const runtime = getRuntime16(); 12656 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12657 if (!injectedStyles) { 12658 injectedStyles = /* @__PURE__ */ new Set(); 12659 runtime.injectedStyles.set(targetDocument, injectedStyles); 12660 } 12661 if (injectedStyles.has(hash)) { 12662 return; 12663 } 12664 if (documentContainsStyleHash16(targetDocument, hash)) { 12665 injectedStyles.add(hash); 12666 return; 12667 } 12668 const style2 = targetDocument.createElement("style"); 12669 style2.setAttribute(STYLE_HASH_ATTRIBUTE16, hash); 12670 style2.appendChild(targetDocument.createTextNode(css)); 12671 targetDocument.head.appendChild(style2); 12672 injectedStyles.add(hash); 12673 } 12674 function registerDocument16(targetDocument) { 12675 const runtime = getRuntime16(); 12676 runtime.documents.set( 12677 targetDocument, 12678 (runtime.documents.get(targetDocument) ?? 0) + 1 12679 ); 12680 for (const [hash, css] of runtime.styles) { 12681 injectStyle16(targetDocument, hash, css); 12682 } 12683 return () => { 12684 const count = runtime.documents.get(targetDocument); 12685 if (count === void 0) { 12686 return; 12687 } 12688 if (count <= 1) { 12689 runtime.documents.delete(targetDocument); 12690 return; 12691 } 12692 runtime.documents.set(targetDocument, count - 1); 12693 }; 12694 } 12695 function registerStyle16(hash, css) { 12696 const runtime = getRuntime16(); 12697 runtime.styles.set(hash, css); 12698 for (const targetDocument of runtime.documents.keys()) { 12699 injectStyle16(targetDocument, hash, css); 12700 } 12701 } 12702 if (typeof process === "undefined" || true) { 12703 registerStyle16("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}'); 12704 } 12705 var style_default11 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" }; 12706 var SCROLL_EPSILON = 1; 12707 var List = (0, import_element26.forwardRef)( 12708 function TabList({ 12709 children, 12710 variant = "default", 12711 className, 12712 activateOnFocus, 12713 ...otherProps 12714 }, forwardedRef) { 12715 const [listEl, setListEl] = (0, import_element26.useState)(null); 12716 const [overflow, setOverflow] = (0, import_element26.useState)({ 12717 first: false, 12718 last: false, 12719 isScrolling: false 12720 }); 12721 (0, import_element26.useEffect)(() => { 12722 if (!listEl) { 12723 return; 12724 } 12725 const measureOverflow = () => { 12726 const { scrollWidth, clientWidth, scrollLeft } = listEl; 12727 const maxScroll = Math.max(scrollWidth - clientWidth, 0); 12728 const direction = listEl.dir || (typeof window !== "undefined" ? window.getComputedStyle(listEl).direction : "ltr"); 12729 const scrollFromStart = direction === "rtl" && scrollLeft < 0 ? ( 12730 // In RTL layouts, scrollLeft is typically 0 at the visual "start" 12731 // (right edge) and becomes negative toward the "end" (left edge). 12732 // Normalize value for correct first/last detection logic. 12733 -scrollLeft 12734 ) : scrollLeft; 12735 const next2 = { 12736 first: scrollFromStart > SCROLL_EPSILON, 12737 last: scrollFromStart < maxScroll - SCROLL_EPSILON, 12738 isScrolling: scrollWidth > clientWidth 12739 }; 12740 setOverflow( 12741 (prev) => prev.first === next2.first && prev.last === next2.last && prev.isScrolling === next2.isScrolling ? prev : next2 12742 ); 12743 }; 12744 const resizeObserver = new ResizeObserver(measureOverflow); 12745 const observeTabs = () => { 12746 resizeObserver.disconnect(); 12747 resizeObserver.observe(listEl); 12748 listEl.querySelectorAll('[role="tab"]').forEach((tab) => resizeObserver.observe(tab)); 12749 }; 12750 const mutationObserver = new MutationObserver(observeTabs); 12751 mutationObserver.observe(listEl, { 12752 childList: true, 12753 subtree: true 12754 }); 12755 let scrollTick = false; 12756 const throttleMeasureOverflowOnScroll = () => { 12757 if (!scrollTick) { 12758 requestAnimationFrame(() => { 12759 measureOverflow(); 12760 scrollTick = false; 12761 }); 12762 scrollTick = true; 12763 } 12764 }; 12765 listEl.addEventListener( 12766 "scroll", 12767 throttleMeasureOverflowOnScroll, 12768 { passive: true } 12769 ); 12770 observeTabs(); 12771 measureOverflow(); 12772 return () => { 12773 listEl.removeEventListener( 12774 "scroll", 12775 throttleMeasureOverflowOnScroll 12776 ); 12777 resizeObserver.disconnect(); 12778 mutationObserver.disconnect(); 12779 }; 12780 }, [listEl]); 12781 const mergedListRef = (0, import_compose6.useMergeRefs)([ 12782 forwardedRef, 12783 (el) => setListEl(el) 12784 ]); 12785 return /* @__PURE__ */ (0, import_jsx_runtime208.jsxs)( 12786 index_parts_exports2.List, 12787 { 12788 ref: mergedListRef, 12789 activateOnFocus, 12790 "data-select-on-move": activateOnFocus ? "true" : "false", 12791 className: clsx_default( 12792 style_default11.tablist, 12793 overflow.first && style_default11["is-overflowing-first"], 12794 overflow.last && style_default11["is-overflowing-last"], 12795 style_default11[`is-$variant}-variant`], 12796 className 12797 ), 12798 ...otherProps, 12799 tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0), 12800 children: [ 12801 children, 12802 /* @__PURE__ */ (0, import_jsx_runtime208.jsx)(index_parts_exports2.Indicator, { className: style_default11.indicator }) 12803 ] 12804 } 12805 ); 12806 } 12807 ); 12808 12809 // packages/ui/build-module/tabs/panel.mjs 12810 var import_element28 = __toESM(require_element(), 1); 12811 12812 // packages/ui/build-module/tabs/context.mjs 12813 var import_element27 = __toESM(require_element(), 1); 12814 var import_jsx_runtime209 = __toESM(require_jsx_runtime(), 1); 12815 var VALIDATION_ENABLED = true; 12816 var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element27.createContext)(null) : null; 12817 function useRegisterTabDev() { 12818 const context = (0, import_element27.useContext)(TabsValidationContext); 12819 (0, import_element27.useEffect)(() => { 12820 if (context) { 12821 return context.registerTab(); 12822 } 12823 return void 0; 12824 }, [context]); 12825 } 12826 function useRegisterTabProd() { 12827 } 12828 var useRegisterTab = VALIDATION_ENABLED ? useRegisterTabDev : useRegisterTabProd; 12829 function useRegisterPanelDev() { 12830 const context = (0, import_element27.useContext)(TabsValidationContext); 12831 (0, import_element27.useEffect)(() => { 12832 if (context) { 12833 return context.registerPanel(); 12834 } 12835 return void 0; 12836 }, [context]); 12837 } 12838 function useRegisterPanelProd() { 12839 } 12840 var useRegisterPanel = VALIDATION_ENABLED ? useRegisterPanelDev : useRegisterPanelProd; 12841 function TabsValidationProviderDev({ 12842 children 12843 }) { 12844 const tabCountRef = (0, import_element27.useRef)(0); 12845 const panelCountRef = (0, import_element27.useRef)(0); 12846 const scheduleValidation = useScheduleValidation(() => { 12847 const tabCount = tabCountRef.current; 12848 const panelCount = panelCountRef.current; 12849 if (tabCount !== panelCount) { 12850 throw new Error( 12851 `Tabs: Tab/Panel count mismatch ($tabCount} Tabs, $panelCount} Panels). Each Tab must be associated with exactly one Panel. Mismatched or missing associations can break screen reader navigation and violate WAI-ARIA Tabs pattern requirements.` 12852 ); 12853 } 12854 }); 12855 const registerTab = (0, import_element27.useCallback)(() => { 12856 tabCountRef.current += 1; 12857 scheduleValidation(); 12858 return () => { 12859 tabCountRef.current -= 1; 12860 scheduleValidation(); 12861 }; 12862 }, [scheduleValidation]); 12863 const registerPanel = (0, import_element27.useCallback)(() => { 12864 panelCountRef.current += 1; 12865 scheduleValidation(); 12866 return () => { 12867 panelCountRef.current -= 1; 12868 scheduleValidation(); 12869 }; 12870 }, [scheduleValidation]); 12871 const contextValue = (0, import_element27.useMemo)( 12872 () => ({ 12873 registerTab, 12874 registerPanel 12875 }), 12876 [registerTab, registerPanel] 12877 ); 12878 return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(TabsValidationContext.Provider, { value: contextValue, children }); 12879 } 12880 function TabsValidationProviderProd({ 12881 children 12882 }) { 12883 return /* @__PURE__ */ (0, import_jsx_runtime209.jsx)(import_jsx_runtime209.Fragment, { children }); 12884 } 12885 var TabsValidationProvider = VALIDATION_ENABLED ? TabsValidationProviderDev : TabsValidationProviderProd; 12886 12887 // packages/ui/build-module/tabs/panel.mjs 12888 var import_jsx_runtime210 = __toESM(require_jsx_runtime(), 1); 12889 var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash"; 12890 function getRuntime17() { 12891 const globalScope = globalThis; 12892 if (globalScope.__wpStyleRuntime) { 12893 return globalScope.__wpStyleRuntime; 12894 } 12895 globalScope.__wpStyleRuntime = { 12896 documents: /* @__PURE__ */ new Map(), 12897 styles: /* @__PURE__ */ new Map(), 12898 injectedStyles: /* @__PURE__ */ new WeakMap() 12899 }; 12900 if (typeof document !== "undefined") { 12901 registerDocument17(document); 12902 } 12903 return globalScope.__wpStyleRuntime; 12904 } 12905 function documentContainsStyleHash17(targetDocument, hash) { 12906 if (!targetDocument.head) { 12907 return false; 12908 } 12909 for (const style2 of targetDocument.head.querySelectorAll( 12910 `style[$STYLE_HASH_ATTRIBUTE17}]` 12911 )) { 12912 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) { 12913 return true; 12914 } 12915 } 12916 return false; 12917 } 12918 function injectStyle17(targetDocument, hash, css) { 12919 if (!targetDocument.head) { 12920 return; 12921 } 12922 const runtime = getRuntime17(); 12923 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12924 if (!injectedStyles) { 12925 injectedStyles = /* @__PURE__ */ new Set(); 12926 runtime.injectedStyles.set(targetDocument, injectedStyles); 12927 } 12928 if (injectedStyles.has(hash)) { 12929 return; 12930 } 12931 if (documentContainsStyleHash17(targetDocument, hash)) { 12932 injectedStyles.add(hash); 12933 return; 12934 } 12935 const style2 = targetDocument.createElement("style"); 12936 style2.setAttribute(STYLE_HASH_ATTRIBUTE17, hash); 12937 style2.appendChild(targetDocument.createTextNode(css)); 12938 targetDocument.head.appendChild(style2); 12939 injectedStyles.add(hash); 12940 } 12941 function registerDocument17(targetDocument) { 12942 const runtime = getRuntime17(); 12943 runtime.documents.set( 12944 targetDocument, 12945 (runtime.documents.get(targetDocument) ?? 0) + 1 12946 ); 12947 for (const [hash, css] of runtime.styles) { 12948 injectStyle17(targetDocument, hash, css); 12949 } 12950 return () => { 12951 const count = runtime.documents.get(targetDocument); 12952 if (count === void 0) { 12953 return; 12954 } 12955 if (count <= 1) { 12956 runtime.documents.delete(targetDocument); 12957 return; 12958 } 12959 runtime.documents.set(targetDocument, count - 1); 12960 }; 12961 } 12962 function registerStyle17(hash, css) { 12963 const runtime = getRuntime17(); 12964 runtime.styles.set(hash, css); 12965 for (const targetDocument of runtime.documents.keys()) { 12966 injectStyle17(targetDocument, hash, css); 12967 } 12968 } 12969 if (typeof process === "undefined" || true) { 12970 registerStyle17("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}"); 12971 } 12972 var global_css_defense_default8 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" }; 12973 if (typeof process === "undefined" || true) { 12974 registerStyle17("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); 12975 } 12976 var focus_module_default3 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" }; 12977 var Panel = (0, import_element28.forwardRef)( 12978 function TabPanel({ className, ...otherProps }, forwardedRef) { 12979 useRegisterPanel(); 12980 return /* @__PURE__ */ (0, import_jsx_runtime210.jsx)( 12981 index_parts_exports2.Panel, 12982 { 12983 ref: forwardedRef, 12984 className: clsx_default( 12985 global_css_defense_default8.div, 12986 focus_module_default3["outset-ring--focus-visible"], 12987 className 12988 ), 12989 ...otherProps 12990 } 12991 ); 12992 } 12993 ); 12994 12995 // packages/ui/build-module/tabs/root.mjs 12996 var import_element29 = __toESM(require_element(), 1); 12997 var import_jsx_runtime211 = __toESM(require_jsx_runtime(), 1); 12998 var Root3 = (0, import_element29.forwardRef)( 12999 function TabsRoot3({ ...otherProps }, forwardedRef) { 13000 return /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(TabsValidationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime211.jsx)(index_parts_exports2.Root, { ref: forwardedRef, ...otherProps }) }) }); 13001 } 13002 ); 13003 13004 // packages/ui/build-module/tabs/tab.mjs 13005 var import_element30 = __toESM(require_element(), 1); 13006 var import_jsx_runtime212 = __toESM(require_jsx_runtime(), 1); 13007 var STYLE_HASH_ATTRIBUTE18 = "data-wp-hash"; 13008 function getRuntime18() { 13009 const globalScope = globalThis; 13010 if (globalScope.__wpStyleRuntime) { 13011 return globalScope.__wpStyleRuntime; 13012 } 13013 globalScope.__wpStyleRuntime = { 13014 documents: /* @__PURE__ */ new Map(), 13015 styles: /* @__PURE__ */ new Map(), 13016 injectedStyles: /* @__PURE__ */ new WeakMap() 13017 }; 13018 if (typeof document !== "undefined") { 13019 registerDocument18(document); 13020 } 13021 return globalScope.__wpStyleRuntime; 13022 } 13023 function documentContainsStyleHash18(targetDocument, hash) { 13024 if (!targetDocument.head) { 13025 return false; 13026 } 13027 for (const style2 of targetDocument.head.querySelectorAll( 13028 `style[$STYLE_HASH_ATTRIBUTE18}]` 13029 )) { 13030 if (style2.getAttribute(STYLE_HASH_ATTRIBUTE18) === hash) { 13031 return true; 13032 } 13033 } 13034 return false; 13035 } 13036 function injectStyle18(targetDocument, hash, css) { 13037 if (!targetDocument.head) { 13038 return; 13039 } 13040 const runtime = getRuntime18(); 13041 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13042 if (!injectedStyles) { 13043 injectedStyles = /* @__PURE__ */ new Set(); 13044 runtime.injectedStyles.set(targetDocument, injectedStyles); 13045 } 13046 if (injectedStyles.has(hash)) { 13047 return; 13048 } 13049 if (documentContainsStyleHash18(targetDocument, hash)) { 13050 injectedStyles.add(hash); 13051 return; 13052 } 13053 const style2 = targetDocument.createElement("style"); 13054 style2.setAttribute(STYLE_HASH_ATTRIBUTE18, hash); 13055 style2.appendChild(targetDocument.createTextNode(css)); 13056 targetDocument.head.appendChild(style2); 13057 injectedStyles.add(hash); 13058 } 13059 function registerDocument18(targetDocument) { 13060 const runtime = getRuntime18(); 13061 runtime.documents.set( 13062 targetDocument, 13063 (runtime.documents.get(targetDocument) ?? 0) + 1 13064 ); 13065 for (const [hash, css] of runtime.styles) { 13066 injectStyle18(targetDocument, hash, css); 13067 } 13068 return () => { 13069 const count = runtime.documents.get(targetDocument); 13070 if (count === void 0) { 13071 return; 13072 } 13073 if (count <= 1) { 13074 runtime.documents.delete(targetDocument); 13075 return; 13076 } 13077 runtime.documents.set(targetDocument, count - 1); 13078 }; 13079 } 13080 function registerStyle18(hash, css) { 13081 const runtime = getRuntime18(); 13082 runtime.styles.set(hash, css); 13083 for (const targetDocument of runtime.documents.keys()) { 13084 injectStyle18(targetDocument, hash, css); 13085 } 13086 } 13087 if (typeof process === "undefined" || true) { 13088 registerStyle18("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}'); 13089 } 13090 var style_default12 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" }; 13091 var Tab = (0, import_element30.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) { 13092 useRegisterTab(); 13093 return /* @__PURE__ */ (0, import_jsx_runtime212.jsxs)( 13094 index_parts_exports2.Tab, 13095 { 13096 ref: forwardedRef, 13097 className: clsx_default(style_default12.tab, className), 13098 ...otherProps, 13099 children: [ 13100 /* @__PURE__ */ (0, import_jsx_runtime212.jsx)("span", { className: style_default12["tab-children"], children }), 13101 /* @__PURE__ */ (0, import_jsx_runtime212.jsx)(Icon, { icon: chevron_right_default, className: style_default12["tab-chevron"] }) 13102 ] 13103 } 13104 ); 13105 }); 13106 13107 // packages/block-library/build-module/audio/edit.mjs 13108 var import_block_editor15 = __toESM(require_block_editor(), 1); 13109 var import_i18n14 = __toESM(require_i18n(), 1); 13110 var import_data8 = __toESM(require_data(), 1); 13111 var import_notices = __toESM(require_notices(), 1); 13112 var import_element33 = __toESM(require_element(), 1); 13113 13114 // node_modules/memize/dist/index.js 13115 function memize(fn, options2) { 13116 var size = 0; 13117 var head; 13118 var tail; 13119 options2 = options2 || {}; 13120 function memoized() { 13121 var node = head, len = arguments.length, args, i2; 13122 searchCache: while (node) { 13123 if (node.args.length !== arguments.length) { 13124 node = node.next; 13125 continue; 13126 } 13127 for (i2 = 0; i2 < len; i2++) { 13128 if (node.args[i2] !== arguments[i2]) { 13129 node = node.next; 13130 continue searchCache; 13131 } 13132 } 13133 if (node !== head) { 13134 if (node === tail) { 13135 tail = node.prev; 13136 } 13137 node.prev.next = node.next; 13138 if (node.next) { 13139 node.next.prev = node.prev; 13140 } 13141 node.next = head; 13142 node.prev = null; 13143 head.prev = node; 13144 head = node; 13145 } 13146 return node.val; 13147 } 13148 args = new Array(len); 13149 for (i2 = 0; i2 < len; i2++) { 13150 args[i2] = arguments[i2]; 13151 } 13152 node = { 13153 args, 13154 // Generate the result from original function 13155 val: fn.apply(null, args) 13156 }; 13157 if (head) { 13158 head.prev = node; 13159 node.next = head; 13160 } else { 13161 tail = node; 13162 } 13163 if (size === /** @type {MemizeOptions} */ 13164 options2.maxSize) { 13165 tail = /** @type {MemizeCacheNode} */ 13166 tail.prev; 13167 tail.next = null; 13168 } else { 13169 size++; 13170 } 13171 head = node; 13172 return node.val; 13173 } 13174 memoized.clear = function() { 13175 head = null; 13176 tail = null; 13177 size = 0; 13178 }; 13179 return memoized; 13180 } 13181 13182 // packages/block-library/build-module/embed/util.mjs 13183 var import_element31 = __toESM(require_element(), 1); 13184 var import_blocks3 = __toESM(require_blocks(), 1); 13185 var import_url2 = __toESM(require_url(), 1); 13186 13187 // node_modules/tslib/tslib.es6.mjs 13188 var __assign = function() { 13189 __assign = Object.assign || function __assign2(t2) { 13190 for (var s2, i2 = 1, n2 = arguments.length; i2 < n2; i2++) { 13191 s2 = arguments[i2]; 13192 for (var p2 in s2) if (Object.prototype.hasOwnProperty.call(s2, p2)) t2[p2] = s2[p2]; 13193 } 13194 return t2; 13195 }; 13196 return __assign.apply(this, arguments); 13197 }; 13198 13199 // node_modules/lower-case/dist.es2015/index.js 13200 function lowerCase(str) { 13201 return str.toLowerCase(); 13202 } 13203 13204 // node_modules/no-case/dist.es2015/index.js 13205 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 13206 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 13207 function noCase(input, options2) { 13208 if (options2 === void 0) { 13209 options2 = {}; 13210 } 13211 var _a = options2.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options2.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options2.transform, transform = _c === void 0 ? lowerCase : _c, _d = options2.delimiter, delimiter = _d === void 0 ? " " : _d; 13212 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 13213 var start = 0; 13214 var end = result.length; 13215 while (result.charAt(start) === "\0") 13216 start++; 13217 while (result.charAt(end - 1) === "\0") 13218 end--; 13219 return result.slice(start, end).split("\0").map(transform).join(delimiter); 13220 } 13221 function replace(input, re, value) { 13222 if (re instanceof RegExp) 13223 return input.replace(re, value); 13224 return re.reduce(function(input2, re2) { 13225 return input2.replace(re2, value); 13226 }, input); 13227 } 13228 13229 // node_modules/upper-case-first/dist.es2015/index.js 13230 function upperCaseFirst(input) { 13231 return input.charAt(0).toUpperCase() + input.substr(1); 13232 } 13233 13234 // node_modules/capital-case/dist.es2015/index.js 13235 function capitalCaseTransform(input) { 13236 return upperCaseFirst(input.toLowerCase()); 13237 } 13238 function capitalCase(input, options2) { 13239 if (options2 === void 0) { 13240 options2 = {}; 13241 } 13242 return noCase(input, __assign({ delimiter: " ", transform: capitalCaseTransform }, options2)); 13243 } 13244 13245 // node_modules/dot-case/dist.es2015/index.js 13246 function dotCase(input, options2) { 13247 if (options2 === void 0) { 13248 options2 = {}; 13249 } 13250 return noCase(input, __assign({ delimiter: "." }, options2)); 13251 } 13252 13253 // node_modules/param-case/dist.es2015/index.js 13254 function paramCase(input, options2) { 13255 if (options2 === void 0) { 13256 options2 = {}; 13257 } 13258 return dotCase(input, __assign({ delimiter: "-" }, options2)); 13259 } 13260 13261 // packages/kebab-case/build-module/index.mjs 13262 function kebabCase(str) { 13263 let input = str?.toString?.() ?? ""; 13264 input = input.replace(/['\u2019]/, ""); 13265 return paramCase(input, { 13266 splitRegexp: [ 13267 /(?!(?:1ST|2ND|3RD|[4-9]TH)(?![a-z]))([a-z0-9])([A-Z])/g, 13268 // fooBar => foo-bar, 3Bar => 3-bar 13269 /(?!(?:1st|2nd|3rd|[4-9]th)(?![a-z]))([0-9])([a-z])/g, 13270 // 3bar => 3-bar 13271 /([A-Za-z])([0-9])/g, 13272 // Foo3 => foo-3, foo3 => foo-3 13273 /([A-Z])([A-Z][a-z])/g 13274 // FOOBar => foo-bar 13275 ] 13276 }); 13277 } 13278 13279 // packages/block-library/build-module/embed/block.json 13280 var block_default7 = { 13281 $schema: "https://schemas.wp.org/trunk/block.json", 13282 apiVersion: 3, 13283 name: "core/embed", 13284 title: "Embed", 13285 category: "embed", 13286 description: "Add a block that displays content pulled from other sites, like Twitter or YouTube.", 13287 textdomain: "default", 13288 attributes: { 13289 url: { 13290 type: "string", 13291 role: "content" 13292 }, 13293 caption: { 13294 type: "rich-text", 13295 source: "rich-text", 13296 selector: "figcaption", 13297 role: "content" 13298 }, 13299 type: { 13300 type: "string", 13301 role: "content" 13302 }, 13303 providerNameSlug: { 13304 type: "string", 13305 role: "content" 13306 }, 13307 allowResponsive: { 13308 type: "boolean", 13309 default: true 13310 }, 13311 responsive: { 13312 type: "boolean", 13313 default: false, 13314 role: "content" 13315 }, 13316 previewable: { 13317 type: "boolean", 13318 default: true, 13319 role: "content" 13320 } 13321 }, 13322 supports: { 13323 anchor: true, 13324 align: true, 13325 spacing: { 13326 margin: true 13327 }, 13328 interactivity: { 13329 clientNavigation: true 13330 } 13331 }, 13332 editorStyle: "wp-block-embed-editor", 13333 style: "wp-block-embed" 13334 }; 13335 13336 // packages/block-library/build-module/embed/constants.mjs 13337 var ASPECT_RATIOS = [ 13338 // Common video resolutions. 13339 { ratio: "2.33", className: "wp-embed-aspect-21-9" }, 13340 { ratio: "2.00", className: "wp-embed-aspect-18-9" }, 13341 { ratio: "1.78", className: "wp-embed-aspect-16-9" }, 13342 { ratio: "1.33", className: "wp-embed-aspect-4-3" }, 13343 // Vertical video and instagram square video support. 13344 { ratio: "1.00", className: "wp-embed-aspect-1-1" }, 13345 { ratio: "0.56", className: "wp-embed-aspect-9-16" }, 13346 { ratio: "0.50", className: "wp-embed-aspect-1-2" } 13347 ]; 13348 var WP_EMBED_TYPE = "wp-embed"; 13349 13350 // packages/block-library/build-module/embed/util.mjs 13351 var import_jsx_runtime213 = __toESM(require_jsx_runtime(), 1); 13352 var { name: DEFAULT_EMBED_BLOCK } = block_default7; 13353 var getEmbedInfoByProvider = (provider) => (0, import_blocks3.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find( 13354 ({ name: name118 }) => name118 === provider 13355 ); 13356 var matchesPatterns = (url, patterns = []) => patterns.some((pattern) => url.match(pattern)); 13357 var findMoreSuitableBlock = (url) => (0, import_blocks3.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find( 13358 ({ patterns }) => matchesPatterns(url, patterns) 13359 ); 13360 function rewriteXToTwitter(url) { 13361 if (!url || (0, import_url2.getAuthority)(url) !== "x.com") { 13362 return url; 13363 } 13364 const rewritten = new URL(url); 13365 rewritten.host = "twitter.com"; 13366 return rewritten.toString(); 13367 } 13368 var isFromWordPress = (html) => html && html.includes('class="wp-embedded-content"'); 13369 var getPhotoHtml = (photo) => { 13370 const imageUrl = photo.url || photo.thumbnail_url; 13371 const photoPreview = /* @__PURE__ */ (0, import_jsx_runtime213.jsx)("p", { children: /* @__PURE__ */ (0, import_jsx_runtime213.jsx)("img", { src: imageUrl, alt: photo.title, width: "100%" }) }); 13372 return (0, import_element31.renderToString)(photoPreview); 13373 }; 13374 var createUpgradedEmbedBlock = (props, attributesFromPreview = {}) => { 13375 const { preview, attributes: attributes2 = {} } = props; 13376 const { url, providerNameSlug, type, ...restAttributes } = attributes2; 13377 if (!url || !(0, import_blocks3.getBlockType)(DEFAULT_EMBED_BLOCK)) { 13378 return; 13379 } 13380 const matchedBlock = findMoreSuitableBlock(url); 13381 const isCurrentBlockWP = providerNameSlug === "wordpress" || type === WP_EMBED_TYPE; 13382 const shouldCreateNewBlock = !isCurrentBlockWP && matchedBlock && (matchedBlock.attributes.providerNameSlug !== providerNameSlug || !providerNameSlug); 13383 if (shouldCreateNewBlock) { 13384 return (0, import_blocks3.createBlock)(DEFAULT_EMBED_BLOCK, { 13385 url, 13386 ...restAttributes, 13387 ...matchedBlock.attributes 13388 }); 13389 } 13390 const wpVariation = (0, import_blocks3.getBlockVariations)(DEFAULT_EMBED_BLOCK)?.find( 13391 ({ name: name118 }) => name118 === "wordpress" 13392 ); 13393 if (!wpVariation || !preview || !isFromWordPress(preview.html) || isCurrentBlockWP) { 13394 return; 13395 } 13396 return (0, import_blocks3.createBlock)(DEFAULT_EMBED_BLOCK, { 13397 url, 13398 ...wpVariation.attributes, 13399 // By now we have the preview, but when the new block first renders, it 13400 // won't have had all the attributes set, and so won't get the correct 13401 // type and it won't render correctly. So, we pass through the current attributes 13402 // here so that the initial render works when we switch to the WordPress 13403 // block. This only affects the WordPress block because it can't be 13404 // rendered in the usual Sandbox (it has a sandbox of its own) and it 13405 // relies on the preview to set the correct render type. 13406 ...attributesFromPreview 13407 }); 13408 }; 13409 var hasAspectRatioClass = (existingClassNames) => { 13410 if (!existingClassNames) { 13411 return false; 13412 } 13413 return ASPECT_RATIOS.some( 13414 ({ className }) => existingClassNames.includes(className) 13415 ); 13416 }; 13417 var removeAspectRatioClasses = (existingClassNames) => { 13418 if (!existingClassNames) { 13419 return existingClassNames; 13420 } 13421 const aspectRatioClassNames = ASPECT_RATIOS.reduce( 13422 (accumulator, { className }) => { 13423 accumulator.push(className); 13424 return accumulator; 13425 }, 13426 ["wp-has-aspect-ratio"] 13427 ); 13428 let outputClassNames = existingClassNames; 13429 for (const className of aspectRatioClassNames) { 13430 outputClassNames = outputClassNames.replace(className, ""); 13431 } 13432 return outputClassNames.trim(); 13433 }; 13434 function hasInlineResponsivePadding(html) { 13435 const paddingPattern = /padding-(top|bottom)\s*:\s*[\d.]+%/i; 13436 return paddingPattern.test(html); 13437 } 13438 function getClassNames(html, existingClassNames, allowResponsive = true) { 13439 if (!allowResponsive) { 13440 return removeAspectRatioClasses(existingClassNames); 13441 } 13442 if (hasInlineResponsivePadding(html)) { 13443 return removeAspectRatioClasses(existingClassNames); 13444 } 13445 const previewDocument = document.implementation.createHTMLDocument(""); 13446 previewDocument.body.innerHTML = html; 13447 const iframe = previewDocument.body.querySelector("iframe"); 13448 if (iframe && iframe.height && iframe.width) { 13449 const aspectRatio = (iframe.width / iframe.height).toFixed(2); 13450 for (let ratioIndex = 0; ratioIndex < ASPECT_RATIOS.length; ratioIndex++) { 13451 const potentialRatio = ASPECT_RATIOS[ratioIndex]; 13452 if (aspectRatio >= potentialRatio.ratio) { 13453 const ratioDiff = aspectRatio - potentialRatio.ratio; 13454 if (ratioDiff > 0.1) { 13455 return removeAspectRatioClasses(existingClassNames); 13456 } 13457 return clsx_default( 13458 removeAspectRatioClasses(existingClassNames), 13459 potentialRatio.className, 13460 "wp-has-aspect-ratio" 13461 ); 13462 } 13463 } 13464 } 13465 return existingClassNames; 13466 } 13467 function fallback(url, onReplace) { 13468 const link = /* @__PURE__ */ (0, import_jsx_runtime213.jsx)("a", { href: url, children: url }); 13469 onReplace( 13470 (0, import_blocks3.createBlock)("core/paragraph", { content: (0, import_element31.renderToString)(link) }) 13471 ); 13472 } 13473 var getAttributesFromPreview = memize( 13474 (preview, title, currentClassNames, isResponsive, allowResponsive = true) => { 13475 if (!preview) { 13476 return {}; 13477 } 13478 const attributes2 = {}; 13479 let { type = "rich" } = preview; 13480 const { html, provider_name: providerName } = preview; 13481 const providerNameSlug = kebabCase( 13482 (providerName || title).toLowerCase() 13483 ); 13484 if (isFromWordPress(html)) { 13485 type = WP_EMBED_TYPE; 13486 } 13487 if (html || "photo" === type) { 13488 attributes2.type = type; 13489 attributes2.providerNameSlug = providerNameSlug; 13490 } 13491 if (hasAspectRatioClass(currentClassNames)) { 13492 return attributes2; 13493 } 13494 attributes2.className = getClassNames( 13495 html, 13496 currentClassNames, 13497 isResponsive && allowResponsive 13498 ); 13499 return attributes2; 13500 } 13501 ); 13502 var getMergedAttributesWithPreview = (currentAttributes, preview, title, isResponsive) => { 13503 const { allowResponsive, className } = currentAttributes; 13504 return { 13505 ...currentAttributes, 13506 ...getAttributesFromPreview( 13507 preview, 13508 title, 13509 className, 13510 isResponsive, 13511 allowResponsive 13512 ) 13513 }; 13514 }; 13515 13516 // packages/block-library/build-module/utils/caption.mjs 13517 var import_element32 = __toESM(require_element(), 1); 13518 var import_compose7 = __toESM(require_compose(), 1); 13519 var import_i18n13 = __toESM(require_i18n(), 1); 13520 var import_block_editor14 = __toESM(require_block_editor(), 1); 13521 var import_components6 = __toESM(require_components(), 1); 13522 var import_blocks4 = __toESM(require_blocks(), 1); 13523 var import_jsx_runtime214 = __toESM(require_jsx_runtime(), 1); 13524 function Caption({ 13525 attributeKey = "caption", 13526 attributes: attributes2, 13527 setAttributes, 13528 isSelected, 13529 insertBlocksAfter, 13530 placeholder: placeholder2 = (0, import_i18n13.__)("Add caption"), 13531 label = (0, import_i18n13.__)("Caption text"), 13532 showToolbarButton = true, 13533 excludeElementClassName, 13534 className, 13535 readOnly, 13536 tagName = "figcaption", 13537 addLabel = (0, import_i18n13.__)("Add caption"), 13538 removeLabel = (0, import_i18n13.__)("Remove caption"), 13539 icon: icon2 = caption_default, 13540 ...props 13541 }) { 13542 const caption = attributes2[attributeKey]; 13543 const prevCaption = (0, import_compose7.usePrevious)(caption); 13544 const isCaptionEmpty = import_block_editor14.RichText.isEmpty(caption); 13545 const isPrevCaptionEmpty = import_block_editor14.RichText.isEmpty(prevCaption); 13546 const [showCaption, setShowCaption] = (0, import_element32.useState)(!isCaptionEmpty); 13547 (0, import_element32.useEffect)(() => { 13548 if (!isCaptionEmpty && isPrevCaptionEmpty) { 13549 setShowCaption(true); 13550 } 13551 }, [isCaptionEmpty, isPrevCaptionEmpty]); 13552 (0, import_element32.useEffect)(() => { 13553 if (!isSelected && isCaptionEmpty) { 13554 setShowCaption(false); 13555 } 13556 }, [isSelected, isCaptionEmpty]); 13557 const ref = (0, import_element32.useCallback)( 13558 (node) => { 13559 if (node && isCaptionEmpty) { 13560 node.focus(); 13561 } 13562 }, 13563 [isCaptionEmpty] 13564 ); 13565 return /* @__PURE__ */ (0, import_jsx_runtime214.jsxs)(import_jsx_runtime214.Fragment, { children: [ 13566 showToolbarButton && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)(import_block_editor14.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( 13567 import_components6.ToolbarButton, 13568 { 13569 onClick: () => { 13570 setShowCaption(!showCaption); 13571 if (showCaption && caption) { 13572 setAttributes({ 13573 [attributeKey]: void 0 13574 }); 13575 } 13576 }, 13577 icon: icon2, 13578 isPressed: showCaption, 13579 label: showCaption ? removeLabel : addLabel 13580 } 13581 ) }), 13582 showCaption && (!import_block_editor14.RichText.isEmpty(caption) || isSelected) && /* @__PURE__ */ (0, import_jsx_runtime214.jsx)( 13583 import_block_editor14.RichText, 13584 { 13585 identifier: attributeKey, 13586 tagName, 13587 className: clsx_default( 13588 className, 13589 excludeElementClassName ? "" : (0, import_block_editor14.__experimentalGetElementClassName)("caption") 13590 ), 13591 ref, 13592 "aria-label": label, 13593 placeholder: placeholder2, 13594 value: caption, 13595 onChange: (value) => setAttributes({ [attributeKey]: value }), 13596 inlineToolbar: true, 13597 __unstableOnSplitAtEnd: insertBlocksAfter ? () => insertBlocksAfter( 13598 (0, import_blocks4.createBlock)((0, import_blocks4.getDefaultBlockName)()) 13599 ) : void 0, 13600 readOnly, 13601 ...props 13602 } 13603 ) 13604 ] }); 13605 } 13606 13607 // packages/block-library/build-module/audio/edit.mjs 13608 var import_jsx_runtime215 = __toESM(require_jsx_runtime(), 1); 13609 var ALLOWED_MEDIA_TYPES = ["audio"]; 13610 function AudioEdit({ 13611 attributes: attributes2, 13612 className, 13613 setAttributes, 13614 onReplace, 13615 isSelected: isSingleSelected, 13616 insertBlocksAfter 13617 }) { 13618 const { id, autoplay, loop, preload, src } = attributes2; 13619 const [temporaryURL, setTemporaryURL] = (0, import_element33.useState)(attributes2.blob); 13620 const blockEditingMode = (0, import_block_editor15.useBlockEditingMode)(); 13621 const hasNonContentControls = blockEditingMode === "default"; 13622 useUploadMediaFromBlobURL({ 13623 url: temporaryURL, 13624 allowedTypes: ALLOWED_MEDIA_TYPES, 13625 onChange: onSelectAudio, 13626 onError: onUploadError 13627 }); 13628 function toggleAttribute(attribute) { 13629 return (newValue) => { 13630 setAttributes({ [attribute]: newValue }); 13631 }; 13632 } 13633 function onSelectURL(newSrc) { 13634 if (newSrc !== src) { 13635 const embedBlock = createUpgradedEmbedBlock({ 13636 attributes: { url: newSrc } 13637 }); 13638 if (void 0 !== embedBlock && onReplace) { 13639 onReplace(embedBlock); 13640 return; 13641 } 13642 setAttributes({ src: newSrc, id: void 0, blob: void 0 }); 13643 setTemporaryURL(); 13644 } 13645 } 13646 const { createErrorNotice } = (0, import_data8.useDispatch)(import_notices.store); 13647 function onUploadError(message) { 13648 createErrorNotice(message, { type: "snackbar" }); 13649 } 13650 function onSelectAudio(media) { 13651 if (!media || !media.url) { 13652 setAttributes({ 13653 src: void 0, 13654 id: void 0, 13655 caption: void 0, 13656 blob: void 0 13657 }); 13658 setTemporaryURL(); 13659 return; 13660 } 13661 if ((0, import_blob2.isBlobURL)(media.url)) { 13662 setTemporaryURL(media.url); 13663 return; 13664 } 13665 setAttributes({ 13666 blob: void 0, 13667 src: media.url, 13668 id: media.id, 13669 caption: media.caption 13670 }); 13671 setTemporaryURL(); 13672 } 13673 const classes = clsx_default(className, { 13674 "is-transient": !!temporaryURL 13675 }); 13676 const blockProps = (0, import_block_editor15.useBlockProps)({ 13677 className: classes 13678 }); 13679 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 13680 if (!src && !temporaryURL) { 13681 return /* @__PURE__ */ (0, import_jsx_runtime215.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13682 import_block_editor15.MediaPlaceholder, 13683 { 13684 icon: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(import_block_editor15.BlockIcon, { icon: audio_default }), 13685 onSelect: onSelectAudio, 13686 onSelectURL, 13687 accept: "audio/*", 13688 allowedTypes: ALLOWED_MEDIA_TYPES, 13689 value: attributes2, 13690 onError: onUploadError 13691 } 13692 ) }); 13693 } 13694 return /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)(import_jsx_runtime215.Fragment, { children: [ 13695 isSingleSelected && /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(import_block_editor15.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13696 import_block_editor15.MediaReplaceFlow, 13697 { 13698 mediaId: id, 13699 mediaURL: src, 13700 allowedTypes: ALLOWED_MEDIA_TYPES, 13701 accept: "audio/*", 13702 onSelect: onSelectAudio, 13703 onSelectURL, 13704 onError: onUploadError, 13705 onReset: () => onSelectAudio(void 0), 13706 variant: "toolbar" 13707 } 13708 ) }), 13709 /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(import_block_editor15.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)( 13710 import_components7.__experimentalToolsPanel, 13711 { 13712 label: (0, import_i18n14.__)("Settings"), 13713 resetAll: () => { 13714 setAttributes({ 13715 autoplay: false, 13716 loop: false, 13717 preload: void 0 13718 }); 13719 }, 13720 dropdownMenuProps, 13721 children: [ 13722 /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(Text2, { className: "wp-block-audio__autoplay-help-text", children: (0, import_i18n14.__)( 13723 "Most browsers block audio until a visitor interacts with the page, so autoplay often won\u2019t work, especially on mobile. Unexpected sound can also be disruptive for screen reader users." 13724 ) }), 13725 /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13726 import_components7.__experimentalToolsPanelItem, 13727 { 13728 label: (0, import_i18n14.__)("Autoplay"), 13729 isShownByDefault: true, 13730 hasValue: () => !!autoplay, 13731 onDeselect: () => setAttributes({ 13732 autoplay: false 13733 }), 13734 children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13735 import_components7.ToggleControl, 13736 { 13737 label: (0, import_i18n14.__)("Autoplay"), 13738 onChange: toggleAttribute("autoplay"), 13739 checked: !!autoplay 13740 } 13741 ) 13742 } 13743 ), 13744 /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13745 import_components7.__experimentalToolsPanelItem, 13746 { 13747 label: (0, import_i18n14.__)("Loop"), 13748 isShownByDefault: true, 13749 hasValue: () => !!loop, 13750 onDeselect: () => setAttributes({ 13751 loop: false 13752 }), 13753 children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13754 import_components7.ToggleControl, 13755 { 13756 label: (0, import_i18n14.__)("Loop"), 13757 onChange: toggleAttribute("loop"), 13758 checked: !!loop 13759 } 13760 ) 13761 } 13762 ), 13763 /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13764 import_components7.__experimentalToolsPanelItem, 13765 { 13766 label: (0, import_i18n14.__)("Preload"), 13767 isShownByDefault: true, 13768 hasValue: () => !!preload, 13769 onDeselect: () => setAttributes({ 13770 preload: void 0 13771 }), 13772 children: /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13773 import_components7.SelectControl, 13774 { 13775 label: (0, import_i18n14._x)( 13776 "Preload", 13777 "noun; Audio block parameter" 13778 ), 13779 value: preload || "", 13780 onChange: (value) => setAttributes({ 13781 preload: value || void 0 13782 }), 13783 options: [ 13784 { value: "", label: (0, import_i18n14.__)("Browser default") }, 13785 { value: "auto", label: (0, import_i18n14.__)("Auto") }, 13786 { value: "metadata", label: (0, import_i18n14.__)("Metadata") }, 13787 { 13788 value: "none", 13789 label: (0, import_i18n14._x)("None", "Preload value") 13790 } 13791 ] 13792 } 13793 ) 13794 } 13795 ) 13796 ] 13797 } 13798 ) }), 13799 /* @__PURE__ */ (0, import_jsx_runtime215.jsxs)("figure", { ...blockProps, children: [ 13800 /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13801 "audio", 13802 { 13803 controls: "controls", 13804 inert: !isSingleSelected ? "true" : void 0, 13805 src: src ?? temporaryURL 13806 } 13807 ), 13808 !!temporaryURL && /* @__PURE__ */ (0, import_jsx_runtime215.jsx)(import_components7.Spinner, {}), 13809 /* @__PURE__ */ (0, import_jsx_runtime215.jsx)( 13810 Caption, 13811 { 13812 attributes: attributes2, 13813 setAttributes, 13814 isSelected: isSingleSelected, 13815 insertBlocksAfter, 13816 label: (0, import_i18n14.__)("Audio caption text"), 13817 showToolbarButton: isSingleSelected && hasNonContentControls 13818 } 13819 ) 13820 ] }) 13821 ] }); 13822 } 13823 var edit_default = AudioEdit; 13824 13825 // packages/block-library/build-module/audio/block.json 13826 var block_default8 = { 13827 $schema: "https://schemas.wp.org/trunk/block.json", 13828 apiVersion: 3, 13829 name: "core/audio", 13830 title: "Audio", 13831 category: "media", 13832 description: "Embed a simple audio player.", 13833 keywords: ["music", "sound", "podcast", "recording"], 13834 textdomain: "default", 13835 attributes: { 13836 blob: { 13837 type: "string", 13838 role: "local" 13839 }, 13840 src: { 13841 type: "string", 13842 source: "attribute", 13843 selector: "audio", 13844 attribute: "src", 13845 role: "content" 13846 }, 13847 caption: { 13848 type: "rich-text", 13849 source: "rich-text", 13850 selector: "figcaption", 13851 role: "content" 13852 }, 13853 id: { 13854 type: "number", 13855 role: "content" 13856 }, 13857 autoplay: { 13858 type: "boolean", 13859 source: "attribute", 13860 selector: "audio", 13861 attribute: "autoplay" 13862 }, 13863 loop: { 13864 type: "boolean", 13865 source: "attribute", 13866 selector: "audio", 13867 attribute: "loop" 13868 }, 13869 preload: { 13870 type: "string", 13871 source: "attribute", 13872 selector: "audio", 13873 attribute: "preload" 13874 } 13875 }, 13876 supports: { 13877 anchor: true, 13878 align: true, 13879 spacing: { 13880 margin: true, 13881 padding: true, 13882 __experimentalDefaultControls: { 13883 margin: false, 13884 padding: false 13885 } 13886 }, 13887 interactivity: { 13888 clientNavigation: true 13889 } 13890 }, 13891 editorStyle: "wp-block-audio-editor", 13892 style: "wp-block-audio" 13893 }; 13894 13895 // packages/block-library/build-module/audio/save.mjs 13896 var import_block_editor16 = __toESM(require_block_editor(), 1); 13897 var import_jsx_runtime216 = __toESM(require_jsx_runtime(), 1); 13898 function save5({ attributes: attributes2 }) { 13899 const { autoplay, caption, loop, preload, src } = attributes2; 13900 return src && /* @__PURE__ */ (0, import_jsx_runtime216.jsxs)("figure", { ...import_block_editor16.useBlockProps.save(), children: [ 13901 /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 13902 "audio", 13903 { 13904 controls: "controls", 13905 src, 13906 autoPlay: autoplay, 13907 loop, 13908 preload 13909 } 13910 ), 13911 !import_block_editor16.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime216.jsx)( 13912 import_block_editor16.RichText.Content, 13913 { 13914 tagName: "figcaption", 13915 value: caption, 13916 className: (0, import_block_editor16.__experimentalGetElementClassName)( 13917 "caption" 13918 ) 13919 } 13920 ) 13921 ] }); 13922 } 13923 13924 // packages/block-library/build-module/audio/transforms.mjs 13925 var import_blob3 = __toESM(require_blob(), 1); 13926 var import_blocks5 = __toESM(require_blocks(), 1); 13927 var transforms = { 13928 from: [ 13929 { 13930 type: "files", 13931 isMatch(files) { 13932 return files.length === 1 && files[0].type.indexOf("audio/") === 0; 13933 }, 13934 transform(files) { 13935 const file = files[0]; 13936 const block = (0, import_blocks5.createBlock)("core/audio", { 13937 blob: (0, import_blob3.createBlobURL)(file) 13938 }); 13939 return block; 13940 } 13941 }, 13942 { 13943 type: "shortcode", 13944 tag: "audio", 13945 attributes: { 13946 src: { 13947 type: "string", 13948 shortcode: ({ 13949 named: { src, mp3, m4a, ogg, wav, wma } 13950 }) => { 13951 return src || mp3 || m4a || ogg || wav || wma; 13952 } 13953 }, 13954 loop: { 13955 type: "string", 13956 shortcode: ({ named: { loop } }) => { 13957 return loop; 13958 } 13959 }, 13960 autoplay: { 13961 type: "string", 13962 shortcode: ({ named: { autoplay } }) => { 13963 return autoplay; 13964 } 13965 }, 13966 preload: { 13967 type: "string", 13968 shortcode: ({ named: { preload } }) => { 13969 return preload; 13970 } 13971 } 13972 } 13973 } 13974 ] 13975 }; 13976 var transforms_default = transforms; 13977 13978 // packages/block-library/build-module/lock-unlock.mjs 13979 var import_private_apis = __toESM(require_private_apis(), 1); 13980 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 13981 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 13982 "@wordpress/block-library" 13983 ); 13984 13985 // packages/block-library/build-module/audio/index.mjs 13986 var { fieldsKey, formKey } = unlock(import_blocks6.privateApis); 13987 var { name: name7 } = block_default8; 13988 var settings7 = { 13989 icon: audio_default, 13990 example: { 13991 attributes: { 13992 src: "https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg" 13993 }, 13994 viewportWidth: 350 13995 }, 13996 transforms: transforms_default, 13997 deprecated: deprecated_default2, 13998 edit: edit_default, 13999 save: save5 14000 }; 14001 if (window.__experimentalContentOnlyInspectorFields) { 14002 settings7[fieldsKey] = [ 14003 { 14004 id: "audio", 14005 label: (0, import_i18n15.__)("Audio"), 14006 type: "media", 14007 Edit: { 14008 control: "media", 14009 // TODO: replace with custom component 14010 allowedTypes: ["audio"], 14011 multiple: false 14012 }, 14013 getValue: ({ item }) => ({ 14014 id: item.id, 14015 url: item.src 14016 }), 14017 setValue: ({ value }) => ({ 14018 id: value.id, 14019 src: value.url 14020 }) 14021 }, 14022 { 14023 id: "caption", 14024 label: (0, import_i18n15.__)("Caption"), 14025 type: "text", 14026 Edit: "rich-text" 14027 // TODO: replace with custom component 14028 } 14029 ]; 14030 settings7[formKey] = { 14031 fields: ["audio", "caption"] 14032 }; 14033 } 14034 var init7 = () => initBlock({ name: name7, metadata: block_default8, settings: settings7 }); 14035 14036 // packages/block-library/build-module/breadcrumbs/index.mjs 14037 var breadcrumbs_exports = {}; 14038 __export(breadcrumbs_exports, { 14039 init: () => init8, 14040 metadata: () => block_default9, 14041 name: () => name8, 14042 settings: () => settings8 14043 }); 14044 14045 // packages/block-library/build-module/breadcrumbs/block.json 14046 var block_default9 = { 14047 $schema: "https://schemas.wp.org/trunk/block.json", 14048 apiVersion: 3, 14049 name: "core/breadcrumbs", 14050 title: "Breadcrumbs", 14051 category: "theme", 14052 description: "Display a breadcrumb trail showing the path to the current page.", 14053 textdomain: "default", 14054 attributes: { 14055 prefersTaxonomy: { 14056 type: "boolean", 14057 default: false 14058 }, 14059 separator: { 14060 type: "string", 14061 default: "/" 14062 }, 14063 showHomeItem: { 14064 type: "boolean", 14065 default: true 14066 }, 14067 showCurrentItem: { 14068 type: "boolean", 14069 default: true 14070 }, 14071 showOnHomePage: { 14072 type: "boolean", 14073 default: false 14074 } 14075 }, 14076 usesContext: ["postId", "postType", "templateSlug"], 14077 supports: { 14078 anchor: true, 14079 html: false, 14080 align: ["wide", "full"], 14081 spacing: { 14082 margin: true, 14083 padding: true 14084 }, 14085 color: { 14086 gradients: true, 14087 link: true, 14088 __experimentalDefaultControls: { 14089 background: true, 14090 text: true 14091 } 14092 }, 14093 __experimentalBorder: { 14094 radius: true, 14095 color: true, 14096 width: true, 14097 style: true, 14098 __experimentalDefaultControls: { 14099 radius: false, 14100 color: true, 14101 width: true, 14102 style: true 14103 } 14104 }, 14105 typography: { 14106 fontSize: true, 14107 lineHeight: true, 14108 __experimentalFontFamily: true, 14109 __experimentalFontWeight: true, 14110 __experimentalFontStyle: true, 14111 __experimentalTextTransform: true, 14112 __experimentalTextDecoration: true, 14113 __experimentalLetterSpacing: true, 14114 __experimentalDefaultControls: { 14115 fontSize: true 14116 } 14117 }, 14118 interactivity: { 14119 clientNavigation: true 14120 } 14121 }, 14122 style: "wp-block-breadcrumbs" 14123 }; 14124 14125 // packages/block-library/build-module/breadcrumbs/edit.mjs 14126 var import_i18n16 = __toESM(require_i18n(), 1); 14127 var import_block_editor17 = __toESM(require_block_editor(), 1); 14128 var import_components8 = __toESM(require_components(), 1); 14129 var import_data9 = __toESM(require_data(), 1); 14130 var import_core_data4 = __toESM(require_core_data(), 1); 14131 var import_element34 = __toESM(require_element(), 1); 14132 var import_server_side_render2 = __toESM(require_server_side_render(), 1); 14133 var import_compose8 = __toESM(require_compose(), 1); 14134 var import_jsx_runtime217 = __toESM(require_jsx_runtime(), 1); 14135 var separatorDefaultValue = "/"; 14136 function BreadcrumbEdit({ 14137 attributes: attributes2, 14138 setAttributes, 14139 name: name118, 14140 context: { postId, postType, templateSlug } 14141 }) { 14142 const { 14143 separator, 14144 showHomeItem, 14145 showCurrentItem, 14146 prefersTaxonomy, 14147 showOnHomePage 14148 } = attributes2; 14149 const { 14150 post, 14151 isPostTypeHierarchical, 14152 postTypeHasTaxonomies, 14153 hasTermsAssigned, 14154 isLoading 14155 } = (0, import_data9.useSelect)( 14156 (select10) => { 14157 if (!postType) { 14158 return {}; 14159 } 14160 const _post = select10(import_core_data4.store).getEntityRecord( 14161 "postType", 14162 postType, 14163 postId 14164 ); 14165 const postTypeObject = select10(import_core_data4.store).getPostType(postType); 14166 const _postTypeHasTaxonomies = postTypeObject && postTypeObject.taxonomies.length; 14167 let taxonomies; 14168 if (_postTypeHasTaxonomies) { 14169 taxonomies = select10(import_core_data4.store).getTaxonomies({ 14170 type: postType, 14171 per_page: -1 14172 }); 14173 } 14174 return { 14175 post: _post, 14176 isPostTypeHierarchical: postTypeObject?.hierarchical, 14177 postTypeHasTaxonomies: _postTypeHasTaxonomies, 14178 hasTermsAssigned: _post && (taxonomies || []).filter( 14179 ({ visibility }) => visibility?.publicly_queryable 14180 ).some((taxonomy) => { 14181 return !!_post[taxonomy.rest_base]?.length; 14182 }), 14183 isLoading: postId && !_post || !postTypeObject || _postTypeHasTaxonomies && !taxonomies 14184 }; 14185 }, 14186 [postType, postId] 14187 ); 14188 const [invalidationKey, setInvalidationKey] = (0, import_element34.useState)(0); 14189 (0, import_element34.useEffect)(() => { 14190 setInvalidationKey((c2) => c2 + 1); 14191 }, [post]); 14192 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 14193 const { content, status, error: error2 } = (0, import_server_side_render2.useServerSideRender)({ 14194 attributes: attributes2, 14195 skipBlockSupportAttributes: true, 14196 block: name118, 14197 urlQueryArgs: { post_id: postId, invalidationKey } 14198 }); 14199 const prevContentRef = (0, import_element34.useRef)(""); 14200 (0, import_element34.useEffect)(() => { 14201 if (status === "success") { 14202 prevContentRef.current = content; 14203 } 14204 }, [content, status]); 14205 const [showLoader, setShowLoader] = (0, import_element34.useState)(false); 14206 (0, import_element34.useEffect)(() => { 14207 if (status !== "loading") { 14208 return; 14209 } 14210 const timeout = setTimeout(() => { 14211 setShowLoader(true); 14212 }, 400); 14213 return () => { 14214 clearTimeout(timeout); 14215 setShowLoader(false); 14216 }; 14217 }, [status]); 14218 const disabledRef = (0, import_compose8.useDisabled)(); 14219 const blockProps = (0, import_block_editor17.useBlockProps)({ ref: disabledRef }); 14220 if (isLoading) { 14221 return /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_components8.Spinner, {}) }); 14222 } 14223 let _showTerms; 14224 if (!isPostTypeHierarchical && !post?.parent) { 14225 _showTerms = true; 14226 } else if (!postTypeHasTaxonomies) { 14227 _showTerms = false; 14228 } else { 14229 _showTerms = prefersTaxonomy; 14230 } 14231 let placeholder2 = null; 14232 const showPlaceholder = !postId || !postType || // When `templateSlug` is set only show placeholder if the post type is not. 14233 // This is needed because when we are showing the template in post editor we 14234 // want to show the real breadcrumbs if we have the post type. 14235 templateSlug && !postType || !_showTerms && !isPostTypeHierarchical || _showTerms && !hasTermsAssigned; 14236 if (showPlaceholder) { 14237 const placeholderItems = []; 14238 if (showHomeItem) { 14239 placeholderItems.push((0, import_i18n16.__)("Home")); 14240 } 14241 if (templateSlug && !postId) { 14242 placeholderItems.push((0, import_i18n16.__)("Page")); 14243 } else if (_showTerms) { 14244 placeholderItems.push((0, import_i18n16.__)("Category")); 14245 } else { 14246 placeholderItems.push((0, import_i18n16.__)("Ancestor"), (0, import_i18n16.__)("Parent")); 14247 } 14248 placeholder2 = /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14249 "nav", 14250 { 14251 ...blockProps, 14252 style: { 14253 "--separator": `"$separator.replace(/\\/g, "\\\\").replace(/"/g, '\\"')}"`, 14254 ...blockProps.style 14255 }, 14256 children: /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)("ol", { children: [ 14257 placeholderItems.map((text, index) => /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("a", { href: `#breadcrumbs-pseudo-link-$index}`, children: text }) }, index)), 14258 showCurrentItem && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("span", { "aria-current": "page", children: (0, import_i18n16.__)("Current") }) }) 14259 ] }) 14260 } 14261 ); 14262 } 14263 return /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(import_jsx_runtime217.Fragment, { children: [ 14264 /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_block_editor17.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)( 14265 import_components8.__experimentalToolsPanel, 14266 { 14267 label: (0, import_i18n16.__)("Settings"), 14268 resetAll: () => { 14269 setAttributes({ 14270 separator: separatorDefaultValue, 14271 showHomeItem: true, 14272 showCurrentItem: true 14273 }); 14274 }, 14275 dropdownMenuProps, 14276 children: [ 14277 /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14278 import_components8.__experimentalToolsPanelItem, 14279 { 14280 label: (0, import_i18n16.__)("Show home breadcrumb"), 14281 isShownByDefault: true, 14282 hasValue: () => !showHomeItem, 14283 onDeselect: () => setAttributes({ 14284 showHomeItem: true 14285 }), 14286 children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14287 import_components8.ToggleControl, 14288 { 14289 label: (0, import_i18n16.__)("Show home breadcrumb"), 14290 onChange: (value) => setAttributes({ showHomeItem: value }), 14291 checked: showHomeItem 14292 } 14293 ) 14294 } 14295 ), 14296 /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14297 import_components8.__experimentalToolsPanelItem, 14298 { 14299 label: (0, import_i18n16.__)("Show current breadcrumb"), 14300 isShownByDefault: true, 14301 hasValue: () => !showCurrentItem, 14302 onDeselect: () => setAttributes({ 14303 showCurrentItem: true 14304 }), 14305 children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14306 import_components8.ToggleControl, 14307 { 14308 label: (0, import_i18n16.__)("Show current breadcrumb"), 14309 onChange: (value) => setAttributes({ showCurrentItem: value }), 14310 checked: showCurrentItem 14311 } 14312 ) 14313 } 14314 ), 14315 /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14316 import_components8.__experimentalToolsPanelItem, 14317 { 14318 label: (0, import_i18n16.__)("Separator"), 14319 isShownByDefault: true, 14320 hasValue: () => separator !== separatorDefaultValue, 14321 onDeselect: () => setAttributes({ 14322 separator: separatorDefaultValue 14323 }), 14324 children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14325 import_components8.TextControl, 14326 { 14327 autoComplete: "off", 14328 label: (0, import_i18n16.__)("Separator"), 14329 value: separator, 14330 onChange: (value) => setAttributes({ separator: value }), 14331 onBlur: () => { 14332 if (!separator) { 14333 setAttributes({ 14334 separator: separatorDefaultValue 14335 }); 14336 } 14337 } 14338 } 14339 ) 14340 } 14341 ) 14342 ] 14343 } 14344 ) }), 14345 /* @__PURE__ */ (0, import_jsx_runtime217.jsxs)(import_block_editor17.InspectorControls, { group: "advanced", children: [ 14346 /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14347 import_components8.CheckboxControl, 14348 { 14349 label: (0, import_i18n16.__)("Show on homepage"), 14350 checked: showOnHomePage, 14351 onChange: (value) => setAttributes({ showOnHomePage: value }), 14352 help: (0, import_i18n16.__)( 14353 "If this Breadcrumbs block appears in a template or template part that\u2019s shown on the homepage, enable this option to display the breadcrumb trail. Otherwise, this setting has no effect." 14354 ) 14355 } 14356 ), 14357 /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14358 import_components8.CheckboxControl, 14359 { 14360 label: (0, import_i18n16.__)("Prefer taxonomy terms"), 14361 checked: prefersTaxonomy, 14362 onChange: (value) => setAttributes({ prefersTaxonomy: value }), 14363 help: (0, import_i18n16.__)( 14364 "The exact type of breadcrumbs shown will vary automatically depending on the page in which this block is displayed. In the specific case of a hierarchical post type with taxonomies, the breadcrumbs can either reflect its post hierarchy (default) or the hierarchy of its assigned taxonomy terms." 14365 ) 14366 } 14367 ) 14368 ] }), 14369 status === "loading" && !showPlaceholder && (prevContentRef.current ? /* @__PURE__ */ (0, import_jsx_runtime217.jsx)( 14370 html_renderer_default, 14371 { 14372 wrapperProps: { 14373 ...blockProps, 14374 style: { 14375 ...blockProps.style, 14376 opacity: showLoader ? 0.3 : 1 14377 } 14378 }, 14379 html: prevContentRef.current 14380 } 14381 ) : /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(import_components8.Spinner, {}) })), 14382 status === "error" && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime217.jsx)("p", { children: (0, import_i18n16.sprintf)( 14383 /* translators: %s: error message returned when rendering the block. */ 14384 (0, import_i18n16.__)("Error: %s"), 14385 error2 14386 ) }) }), 14387 showPlaceholder && placeholder2, 14388 !showPlaceholder && status === "success" && /* @__PURE__ */ (0, import_jsx_runtime217.jsx)(html_renderer_default, { wrapperProps: blockProps, html: content }) 14389 ] }); 14390 } 14391 14392 // packages/block-library/build-module/breadcrumbs/index.mjs 14393 var { name: name8 } = block_default9; 14394 var settings8 = { 14395 icon: breadcrumbs_default, 14396 example: {}, 14397 edit: BreadcrumbEdit 14398 }; 14399 var init8 = () => initBlock({ name: name8, metadata: block_default9, settings: settings8 }); 14400 14401 // packages/block-library/build-module/button/index.mjs 14402 var button_exports = {}; 14403 __export(button_exports, { 14404 init: () => init9, 14405 metadata: () => block_default10, 14406 name: () => name9, 14407 settings: () => settings9 14408 }); 14409 var import_i18n18 = __toESM(require_i18n(), 1); 14410 var import_blocks8 = __toESM(require_blocks(), 1); 14411 14412 // packages/block-library/build-module/button/deprecated.mjs 14413 var import_block_editor19 = __toESM(require_block_editor(), 1); 14414 var import_compose9 = __toESM(require_compose(), 1); 14415 14416 // packages/block-library/build-module/utils/migrate-font-family.mjs 14417 var import_block_editor18 = __toESM(require_block_editor(), 1); 14418 var { cleanEmptyObject } = unlock(import_block_editor18.privateApis); 14419 function migrate_font_family_default(attributes2) { 14420 if (!attributes2?.style?.typography?.fontFamily) { 14421 return attributes2; 14422 } 14423 const { fontFamily, ...typography } = attributes2.style.typography; 14424 return { 14425 ...attributes2, 14426 style: cleanEmptyObject({ 14427 ...attributes2.style, 14428 typography 14429 }), 14430 fontFamily: fontFamily.split("|").pop() 14431 }; 14432 } 14433 14434 // packages/block-library/build-module/utils/migrate-text-align.mjs 14435 function migrate_text_align_default(attributes2) { 14436 const { textAlign, ...restAttributes } = attributes2; 14437 if (!textAlign) { 14438 return attributes2; 14439 } 14440 return { 14441 ...restAttributes, 14442 style: { 14443 ...attributes2.style, 14444 typography: { 14445 ...attributes2.style?.typography, 14446 textAlign 14447 } 14448 } 14449 }; 14450 } 14451 14452 // packages/block-library/build-module/button/deprecated.mjs 14453 var import_jsx_runtime218 = __toESM(require_jsx_runtime(), 1); 14454 var migrateWidth = (attributes2) => { 14455 const { width, ...otherAttributes } = attributes2; 14456 if (!width) { 14457 return otherAttributes; 14458 } 14459 return { 14460 ...otherAttributes, 14461 style: { 14462 ...otherAttributes.style, 14463 dimensions: { 14464 ...otherAttributes.style?.dimensions, 14465 width: `$width}%` 14466 } 14467 } 14468 }; 14469 }; 14470 var migrateBorderRadius = (attributes2) => { 14471 const { borderRadius, ...newAttributes } = attributes2; 14472 const oldBorderRadius = [ 14473 borderRadius, 14474 newAttributes.style?.border?.radius 14475 ].find((possibleBorderRadius) => { 14476 return typeof possibleBorderRadius === "number" && possibleBorderRadius !== 0; 14477 }); 14478 if (!oldBorderRadius) { 14479 return newAttributes; 14480 } 14481 return { 14482 ...newAttributes, 14483 style: { 14484 ...newAttributes.style, 14485 border: { 14486 ...newAttributes.style?.border, 14487 radius: `$oldBorderRadius}px` 14488 } 14489 } 14490 }; 14491 }; 14492 function migrateAlign(attributes2) { 14493 if (!attributes2.align) { 14494 return attributes2; 14495 } 14496 const { align, ...otherAttributes } = attributes2; 14497 return { 14498 ...otherAttributes, 14499 className: clsx_default( 14500 otherAttributes.className, 14501 `align$attributes2.align}` 14502 ) 14503 }; 14504 } 14505 var migrateCustomColorsAndGradients = (attributes2) => { 14506 if (!attributes2.customTextColor && !attributes2.customBackgroundColor && !attributes2.customGradient) { 14507 return attributes2; 14508 } 14509 const style2 = { color: {} }; 14510 if (attributes2.customTextColor) { 14511 style2.color.text = attributes2.customTextColor; 14512 } 14513 if (attributes2.customBackgroundColor) { 14514 style2.color.background = attributes2.customBackgroundColor; 14515 } 14516 if (attributes2.customGradient) { 14517 style2.color.gradient = attributes2.customGradient; 14518 } 14519 const { 14520 customTextColor, 14521 customBackgroundColor, 14522 customGradient, 14523 ...restAttributes 14524 } = attributes2; 14525 return { 14526 ...restAttributes, 14527 style: style2 14528 }; 14529 }; 14530 var oldColorsMigration = (attributes2) => { 14531 const { color, textColor, ...restAttributes } = { 14532 ...attributes2, 14533 customTextColor: attributes2.textColor && "#" === attributes2.textColor[0] ? attributes2.textColor : void 0, 14534 customBackgroundColor: attributes2.color && "#" === attributes2.color[0] ? attributes2.color : void 0 14535 }; 14536 return migrateCustomColorsAndGradients(restAttributes); 14537 }; 14538 var blockAttributes = { 14539 url: { 14540 type: "string", 14541 source: "attribute", 14542 selector: "a", 14543 attribute: "href" 14544 }, 14545 title: { 14546 type: "string", 14547 source: "attribute", 14548 selector: "a", 14549 attribute: "title" 14550 }, 14551 text: { 14552 type: "string", 14553 source: "html", 14554 selector: "a" 14555 } 14556 }; 14557 var v14 = { 14558 attributes: { 14559 tagName: { 14560 type: "string", 14561 enum: ["a", "button"], 14562 default: "a" 14563 }, 14564 type: { 14565 type: "string", 14566 default: "button" 14567 }, 14568 url: { 14569 type: "string", 14570 source: "attribute", 14571 selector: "a", 14572 attribute: "href", 14573 role: "content" 14574 }, 14575 title: { 14576 type: "string", 14577 source: "attribute", 14578 selector: "a,button", 14579 attribute: "title", 14580 role: "content" 14581 }, 14582 text: { 14583 type: "rich-text", 14584 source: "rich-text", 14585 selector: "a,button", 14586 role: "content" 14587 }, 14588 linkTarget: { 14589 type: "string", 14590 source: "attribute", 14591 selector: "a", 14592 attribute: "target", 14593 role: "content" 14594 }, 14595 rel: { 14596 type: "string", 14597 source: "attribute", 14598 selector: "a", 14599 attribute: "rel", 14600 role: "content" 14601 }, 14602 placeholder: { 14603 type: "string" 14604 }, 14605 backgroundColor: { 14606 type: "string" 14607 }, 14608 textColor: { 14609 type: "string" 14610 }, 14611 gradient: { 14612 type: "string" 14613 }, 14614 width: { 14615 type: "number" 14616 } 14617 }, 14618 supports: { 14619 anchor: true, 14620 splitting: true, 14621 align: false, 14622 alignWide: false, 14623 color: { 14624 __experimentalSkipSerialization: true, 14625 gradients: true, 14626 __experimentalDefaultControls: { 14627 background: true, 14628 text: true 14629 } 14630 }, 14631 typography: { 14632 __experimentalSkipSerialization: [ 14633 "fontSize", 14634 "lineHeight", 14635 "textAlign", 14636 "fontFamily", 14637 "fontWeight", 14638 "fontStyle", 14639 "textTransform", 14640 "textDecoration", 14641 "letterSpacing" 14642 ], 14643 fontSize: true, 14644 lineHeight: true, 14645 textAlign: true, 14646 __experimentalFontFamily: true, 14647 __experimentalFontWeight: true, 14648 __experimentalFontStyle: true, 14649 __experimentalTextTransform: true, 14650 __experimentalTextDecoration: true, 14651 __experimentalLetterSpacing: true, 14652 __experimentalWritingMode: true, 14653 __experimentalDefaultControls: { 14654 fontSize: true 14655 } 14656 }, 14657 reusable: false, 14658 shadow: { 14659 __experimentalSkipSerialization: true 14660 }, 14661 spacing: { 14662 __experimentalSkipSerialization: true, 14663 padding: ["horizontal", "vertical"], 14664 __experimentalDefaultControls: { 14665 padding: true 14666 } 14667 }, 14668 __experimentalBorder: { 14669 color: true, 14670 radius: true, 14671 style: true, 14672 width: true, 14673 __experimentalSkipSerialization: true, 14674 __experimentalDefaultControls: { 14675 color: true, 14676 radius: true, 14677 style: true, 14678 width: true 14679 } 14680 }, 14681 interactivity: { 14682 clientNavigation: true 14683 } 14684 }, 14685 selectors: { 14686 root: ".wp-block-button .wp-block-button__link", 14687 typography: { 14688 writingMode: ".wp-block-button" 14689 } 14690 }, 14691 save({ attributes: attributes2, className }) { 14692 const { 14693 tagName, 14694 type, 14695 fontSize, 14696 linkTarget, 14697 rel, 14698 style: style2, 14699 text, 14700 title, 14701 url, 14702 width 14703 } = attributes2; 14704 const TagName2 = tagName || "a"; 14705 const isButtonTag = "button" === TagName2; 14706 const buttonType = type || "button"; 14707 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes2); 14708 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes2); 14709 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes2); 14710 const shadowProps = (0, import_block_editor19.__experimentalGetShadowClassesAndStyles)(attributes2); 14711 const typographyProps = (0, import_block_editor19.getTypographyClassesAndStyles)(attributes2); 14712 const buttonClasses = clsx_default( 14713 "wp-block-button__link", 14714 colorProps.className, 14715 borderProps.className, 14716 typographyProps.className, 14717 { 14718 // For backwards compatibility add style that isn't 14719 // provided via block support. 14720 "no-border-radius": style2?.border?.radius === 0, 14721 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 14722 }, 14723 (0, import_block_editor19.__experimentalGetElementClassName)("button") 14724 ); 14725 const buttonStyle = { 14726 ...borderProps.style, 14727 ...colorProps.style, 14728 ...spacingProps.style, 14729 ...shadowProps.style, 14730 ...typographyProps.style, 14731 writingMode: void 0 14732 }; 14733 const wrapperClasses = clsx_default(className, { 14734 [`has-custom-width wp-block-button__width-$width}`]: width 14735 }); 14736 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 14737 import_block_editor19.RichText.Content, 14738 { 14739 tagName: TagName2, 14740 type: isButtonTag ? buttonType : null, 14741 className: buttonClasses, 14742 href: isButtonTag ? null : url, 14743 title, 14744 style: buttonStyle, 14745 value: text, 14746 target: isButtonTag ? null : linkTarget, 14747 rel: isButtonTag ? null : rel 14748 } 14749 ) }); 14750 }, 14751 isEligible(attributes2) { 14752 return typeof attributes2.width === "number"; 14753 }, 14754 migrate: migrateWidth 14755 }; 14756 var v13 = { 14757 attributes: { 14758 tagName: { 14759 type: "string", 14760 enum: ["a", "button"], 14761 default: "a" 14762 }, 14763 type: { 14764 type: "string", 14765 default: "button" 14766 }, 14767 textAlign: { 14768 type: "string" 14769 }, 14770 url: { 14771 type: "string", 14772 source: "attribute", 14773 selector: "a", 14774 attribute: "href", 14775 role: "content" 14776 }, 14777 title: { 14778 type: "string", 14779 source: "attribute", 14780 selector: "a,button", 14781 attribute: "title", 14782 role: "content" 14783 }, 14784 text: { 14785 type: "rich-text", 14786 source: "rich-text", 14787 selector: "a,button", 14788 role: "content" 14789 }, 14790 linkTarget: { 14791 type: "string", 14792 source: "attribute", 14793 selector: "a", 14794 attribute: "target", 14795 role: "content" 14796 }, 14797 rel: { 14798 type: "string", 14799 source: "attribute", 14800 selector: "a", 14801 attribute: "rel", 14802 role: "content" 14803 }, 14804 placeholder: { 14805 type: "string" 14806 }, 14807 backgroundColor: { 14808 type: "string" 14809 }, 14810 textColor: { 14811 type: "string" 14812 }, 14813 gradient: { 14814 type: "string" 14815 }, 14816 width: { 14817 type: "number" 14818 } 14819 }, 14820 supports: { 14821 anchor: true, 14822 align: true, 14823 alignWide: false, 14824 color: { 14825 __experimentalSkipSerialization: true, 14826 gradients: true, 14827 __experimentalDefaultControls: { 14828 background: true, 14829 text: true 14830 } 14831 }, 14832 typography: { 14833 __experimentalSkipSerialization: [ 14834 "fontSize", 14835 "lineHeight", 14836 "fontFamily", 14837 "fontWeight", 14838 "fontStyle", 14839 "textTransform", 14840 "textDecoration", 14841 "letterSpacing" 14842 ], 14843 fontSize: true, 14844 lineHeight: true, 14845 __experimentalFontFamily: true, 14846 __experimentalFontWeight: true, 14847 __experimentalFontStyle: true, 14848 __experimentalTextTransform: true, 14849 __experimentalTextDecoration: true, 14850 __experimentalLetterSpacing: true, 14851 __experimentalWritingMode: true, 14852 __experimentalDefaultControls: { 14853 fontSize: true 14854 } 14855 }, 14856 reusable: false, 14857 shadow: { 14858 __experimentalSkipSerialization: true 14859 }, 14860 spacing: { 14861 __experimentalSkipSerialization: true, 14862 padding: ["horizontal", "vertical"], 14863 __experimentalDefaultControls: { 14864 padding: true 14865 } 14866 }, 14867 __experimentalBorder: { 14868 color: true, 14869 radius: true, 14870 style: true, 14871 width: true, 14872 __experimentalSkipSerialization: true, 14873 __experimentalDefaultControls: { 14874 color: true, 14875 radius: true, 14876 style: true, 14877 width: true 14878 } 14879 }, 14880 interactivity: { 14881 clientNavigation: true 14882 } 14883 }, 14884 selectors: { 14885 root: ".wp-block-button .wp-block-button__link", 14886 typography: { 14887 writingMode: ".wp-block-button" 14888 } 14889 }, 14890 save({ attributes: attributes2, className }) { 14891 const { 14892 tagName, 14893 type, 14894 textAlign, 14895 fontSize, 14896 linkTarget, 14897 rel, 14898 style: style2, 14899 text, 14900 title, 14901 url, 14902 width 14903 } = attributes2; 14904 const TagName2 = tagName || "a"; 14905 const isButtonTag = "button" === TagName2; 14906 const buttonType = type || "button"; 14907 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes2); 14908 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes2); 14909 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes2); 14910 const shadowProps = (0, import_block_editor19.__experimentalGetShadowClassesAndStyles)(attributes2); 14911 const typographyProps = (0, import_block_editor19.getTypographyClassesAndStyles)(attributes2); 14912 const buttonClasses = clsx_default( 14913 "wp-block-button__link", 14914 colorProps.className, 14915 borderProps.className, 14916 typographyProps.className, 14917 { 14918 [`has-text-align-$textAlign}`]: textAlign, 14919 // For backwards compatibility add style that isn't provided via 14920 // block support. 14921 "no-border-radius": style2?.border?.radius === 0, 14922 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 14923 }, 14924 (0, import_block_editor19.__experimentalGetElementClassName)("button") 14925 ); 14926 const buttonStyle = { 14927 ...borderProps.style, 14928 ...colorProps.style, 14929 ...spacingProps.style, 14930 ...shadowProps.style, 14931 ...typographyProps.style, 14932 writingMode: void 0 14933 }; 14934 const wrapperClasses = clsx_default(className, { 14935 [`has-custom-width wp-block-button__width-$width}`]: width 14936 }); 14937 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 14938 import_block_editor19.RichText.Content, 14939 { 14940 tagName: TagName2, 14941 type: isButtonTag ? buttonType : null, 14942 className: buttonClasses, 14943 href: isButtonTag ? null : url, 14944 title, 14945 style: buttonStyle, 14946 value: text, 14947 target: isButtonTag ? null : linkTarget, 14948 rel: isButtonTag ? null : rel 14949 } 14950 ) }); 14951 }, 14952 isEligible(attributes2) { 14953 return !!attributes2.textAlign || typeof attributes2.width === "number"; 14954 }, 14955 migrate: (0, import_compose9.compose)(migrateWidth, migrate_text_align_default) 14956 }; 14957 var v12 = { 14958 attributes: { 14959 tagName: { 14960 type: "string", 14961 enum: ["a", "button"], 14962 default: "a" 14963 }, 14964 type: { 14965 type: "string", 14966 default: "button" 14967 }, 14968 textAlign: { 14969 type: "string" 14970 }, 14971 url: { 14972 type: "string", 14973 source: "attribute", 14974 selector: "a", 14975 attribute: "href" 14976 }, 14977 title: { 14978 type: "string", 14979 source: "attribute", 14980 selector: "a,button", 14981 attribute: "title", 14982 role: "content" 14983 }, 14984 text: { 14985 type: "rich-text", 14986 source: "rich-text", 14987 selector: "a,button", 14988 role: "content" 14989 }, 14990 linkTarget: { 14991 type: "string", 14992 source: "attribute", 14993 selector: "a", 14994 attribute: "target", 14995 role: "content" 14996 }, 14997 rel: { 14998 type: "string", 14999 source: "attribute", 15000 selector: "a", 15001 attribute: "rel", 15002 role: "content" 15003 }, 15004 placeholder: { 15005 type: "string" 15006 }, 15007 backgroundColor: { 15008 type: "string" 15009 }, 15010 textColor: { 15011 type: "string" 15012 }, 15013 gradient: { 15014 type: "string" 15015 }, 15016 width: { 15017 type: "number" 15018 } 15019 }, 15020 supports: { 15021 anchor: true, 15022 align: true, 15023 alignWide: false, 15024 color: { 15025 __experimentalSkipSerialization: true, 15026 gradients: true, 15027 __experimentalDefaultControls: { 15028 background: true, 15029 text: true 15030 } 15031 }, 15032 typography: { 15033 fontSize: true, 15034 lineHeight: true, 15035 __experimentalFontFamily: true, 15036 __experimentalFontWeight: true, 15037 __experimentalFontStyle: true, 15038 __experimentalTextTransform: true, 15039 __experimentalTextDecoration: true, 15040 __experimentalLetterSpacing: true, 15041 __experimentalWritingMode: true, 15042 __experimentalDefaultControls: { 15043 fontSize: true 15044 } 15045 }, 15046 reusable: false, 15047 shadow: { 15048 __experimentalSkipSerialization: true 15049 }, 15050 spacing: { 15051 __experimentalSkipSerialization: true, 15052 padding: ["horizontal", "vertical"], 15053 __experimentalDefaultControls: { 15054 padding: true 15055 } 15056 }, 15057 __experimentalBorder: { 15058 color: true, 15059 radius: true, 15060 style: true, 15061 width: true, 15062 __experimentalSkipSerialization: true, 15063 __experimentalDefaultControls: { 15064 color: true, 15065 radius: true, 15066 style: true, 15067 width: true 15068 } 15069 }, 15070 __experimentalSelector: ".wp-block-button__link", 15071 interactivity: { 15072 clientNavigation: true 15073 } 15074 }, 15075 save({ attributes: attributes2, className }) { 15076 const { 15077 tagName, 15078 type, 15079 textAlign, 15080 fontSize, 15081 linkTarget, 15082 rel, 15083 style: style2, 15084 text, 15085 title, 15086 url, 15087 width 15088 } = attributes2; 15089 const TagName2 = tagName || "a"; 15090 const isButtonTag = "button" === TagName2; 15091 const buttonType = type || "button"; 15092 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes2); 15093 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes2); 15094 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes2); 15095 const shadowProps = (0, import_block_editor19.__experimentalGetShadowClassesAndStyles)(attributes2); 15096 const buttonClasses = clsx_default( 15097 "wp-block-button__link", 15098 colorProps.className, 15099 borderProps.className, 15100 { 15101 [`has-text-align-$textAlign}`]: textAlign, 15102 // For backwards compatibility add style that isn't provided via 15103 // block support. 15104 "no-border-radius": style2?.border?.radius === 0 15105 }, 15106 (0, import_block_editor19.__experimentalGetElementClassName)("button") 15107 ); 15108 const buttonStyle = { 15109 ...borderProps.style, 15110 ...colorProps.style, 15111 ...spacingProps.style, 15112 ...shadowProps.style 15113 }; 15114 const wrapperClasses = clsx_default(className, { 15115 [`has-custom-width wp-block-button__width-$width}`]: width, 15116 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 15117 }); 15118 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15119 import_block_editor19.RichText.Content, 15120 { 15121 tagName: TagName2, 15122 type: isButtonTag ? buttonType : null, 15123 className: buttonClasses, 15124 href: isButtonTag ? null : url, 15125 title, 15126 style: buttonStyle, 15127 value: text, 15128 target: isButtonTag ? null : linkTarget, 15129 rel: isButtonTag ? null : rel 15130 } 15131 ) }); 15132 }, 15133 isEligible(attributes2) { 15134 return typeof attributes2.width === "number"; 15135 }, 15136 migrate: migrateWidth 15137 }; 15138 var v11 = { 15139 attributes: { 15140 url: { 15141 type: "string", 15142 source: "attribute", 15143 selector: "a", 15144 attribute: "href" 15145 }, 15146 title: { 15147 type: "string", 15148 source: "attribute", 15149 selector: "a", 15150 attribute: "title" 15151 }, 15152 text: { 15153 type: "string", 15154 source: "html", 15155 selector: "a" 15156 }, 15157 linkTarget: { 15158 type: "string", 15159 source: "attribute", 15160 selector: "a", 15161 attribute: "target" 15162 }, 15163 rel: { 15164 type: "string", 15165 source: "attribute", 15166 selector: "a", 15167 attribute: "rel" 15168 }, 15169 placeholder: { 15170 type: "string" 15171 }, 15172 backgroundColor: { 15173 type: "string" 15174 }, 15175 textColor: { 15176 type: "string" 15177 }, 15178 gradient: { 15179 type: "string" 15180 }, 15181 width: { 15182 type: "number" 15183 } 15184 }, 15185 supports: { 15186 anchor: true, 15187 align: true, 15188 alignWide: false, 15189 color: { 15190 __experimentalSkipSerialization: true, 15191 gradients: true, 15192 __experimentalDefaultControls: { 15193 background: true, 15194 text: true 15195 } 15196 }, 15197 typography: { 15198 fontSize: true, 15199 __experimentalFontFamily: true, 15200 __experimentalDefaultControls: { 15201 fontSize: true 15202 } 15203 }, 15204 reusable: false, 15205 spacing: { 15206 __experimentalSkipSerialization: true, 15207 padding: ["horizontal", "vertical"], 15208 __experimentalDefaultControls: { 15209 padding: true 15210 } 15211 }, 15212 __experimentalBorder: { 15213 radius: true, 15214 __experimentalSkipSerialization: true, 15215 __experimentalDefaultControls: { 15216 radius: true 15217 } 15218 }, 15219 __experimentalSelector: ".wp-block-button__link" 15220 }, 15221 save({ attributes: attributes2, className }) { 15222 const { fontSize, linkTarget, rel, style: style2, text, title, url, width } = attributes2; 15223 if (!text) { 15224 return null; 15225 } 15226 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes2); 15227 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes2); 15228 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes2); 15229 const buttonClasses = clsx_default( 15230 "wp-block-button__link", 15231 colorProps.className, 15232 borderProps.className, 15233 { 15234 // For backwards compatibility add style that isn't provided via 15235 // block support. 15236 "no-border-radius": style2?.border?.radius === 0 15237 } 15238 ); 15239 const buttonStyle = { 15240 ...borderProps.style, 15241 ...colorProps.style, 15242 ...spacingProps.style 15243 }; 15244 const wrapperClasses = clsx_default(className, { 15245 [`has-custom-width wp-block-button__width-$width}`]: width, 15246 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 15247 }); 15248 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15249 import_block_editor19.RichText.Content, 15250 { 15251 tagName: "a", 15252 className: buttonClasses, 15253 href: url, 15254 title, 15255 style: buttonStyle, 15256 value: text, 15257 target: linkTarget, 15258 rel 15259 } 15260 ) }); 15261 } 15262 }; 15263 var v10 = { 15264 attributes: { 15265 url: { 15266 type: "string", 15267 source: "attribute", 15268 selector: "a", 15269 attribute: "href" 15270 }, 15271 title: { 15272 type: "string", 15273 source: "attribute", 15274 selector: "a", 15275 attribute: "title" 15276 }, 15277 text: { 15278 type: "string", 15279 source: "html", 15280 selector: "a" 15281 }, 15282 linkTarget: { 15283 type: "string", 15284 source: "attribute", 15285 selector: "a", 15286 attribute: "target" 15287 }, 15288 rel: { 15289 type: "string", 15290 source: "attribute", 15291 selector: "a", 15292 attribute: "rel" 15293 }, 15294 placeholder: { 15295 type: "string" 15296 }, 15297 backgroundColor: { 15298 type: "string" 15299 }, 15300 textColor: { 15301 type: "string" 15302 }, 15303 gradient: { 15304 type: "string" 15305 }, 15306 width: { 15307 type: "number" 15308 } 15309 }, 15310 supports: { 15311 anchor: true, 15312 align: true, 15313 alignWide: false, 15314 color: { 15315 __experimentalSkipSerialization: true, 15316 gradients: true 15317 }, 15318 typography: { 15319 fontSize: true, 15320 __experimentalFontFamily: true 15321 }, 15322 reusable: false, 15323 spacing: { 15324 __experimentalSkipSerialization: true, 15325 padding: ["horizontal", "vertical"], 15326 __experimentalDefaultControls: { 15327 padding: true 15328 } 15329 }, 15330 __experimentalBorder: { 15331 radius: true, 15332 __experimentalSkipSerialization: true 15333 }, 15334 __experimentalSelector: ".wp-block-button__link" 15335 }, 15336 save({ attributes: attributes2, className }) { 15337 const { fontSize, linkTarget, rel, style: style2, text, title, url, width } = attributes2; 15338 if (!text) { 15339 return null; 15340 } 15341 const borderProps = (0, import_block_editor19.__experimentalGetBorderClassesAndStyles)(attributes2); 15342 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes2); 15343 const spacingProps = (0, import_block_editor19.__experimentalGetSpacingClassesAndStyles)(attributes2); 15344 const buttonClasses = clsx_default( 15345 "wp-block-button__link", 15346 colorProps.className, 15347 borderProps.className, 15348 { 15349 // For backwards compatibility add style that isn't provided via 15350 // block support. 15351 "no-border-radius": style2?.border?.radius === 0 15352 } 15353 ); 15354 const buttonStyle = { 15355 ...borderProps.style, 15356 ...colorProps.style, 15357 ...spacingProps.style 15358 }; 15359 const wrapperClasses = clsx_default(className, { 15360 [`has-custom-width wp-block-button__width-$width}`]: width, 15361 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 15362 }); 15363 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15364 import_block_editor19.RichText.Content, 15365 { 15366 tagName: "a", 15367 className: buttonClasses, 15368 href: url, 15369 title, 15370 style: buttonStyle, 15371 value: text, 15372 target: linkTarget, 15373 rel 15374 } 15375 ) }); 15376 }, 15377 migrate: (0, import_compose9.compose)(migrateWidth, migrate_font_family_default), 15378 isEligible({ style: style2, width }) { 15379 return style2?.typography?.fontFamily || typeof width === "number"; 15380 } 15381 }; 15382 var deprecated = [ 15383 v14, 15384 v13, 15385 v12, 15386 v11, 15387 v10, 15388 { 15389 supports: { 15390 anchor: true, 15391 align: true, 15392 alignWide: false, 15393 color: { 15394 __experimentalSkipSerialization: true, 15395 gradients: true 15396 }, 15397 typography: { 15398 fontSize: true, 15399 __experimentalFontFamily: true 15400 }, 15401 reusable: false, 15402 __experimentalSelector: ".wp-block-button__link" 15403 }, 15404 attributes: { 15405 ...blockAttributes, 15406 linkTarget: { 15407 type: "string", 15408 source: "attribute", 15409 selector: "a", 15410 attribute: "target" 15411 }, 15412 rel: { 15413 type: "string", 15414 source: "attribute", 15415 selector: "a", 15416 attribute: "rel" 15417 }, 15418 placeholder: { 15419 type: "string" 15420 }, 15421 backgroundColor: { 15422 type: "string" 15423 }, 15424 textColor: { 15425 type: "string" 15426 }, 15427 gradient: { 15428 type: "string" 15429 }, 15430 width: { 15431 type: "number" 15432 } 15433 }, 15434 isEligible({ style: style2 }) { 15435 return typeof style2?.border?.radius === "number"; 15436 }, 15437 save({ attributes: attributes2, className }) { 15438 const { 15439 fontSize, 15440 linkTarget, 15441 rel, 15442 style: style2, 15443 text, 15444 title, 15445 url, 15446 width 15447 } = attributes2; 15448 if (!text) { 15449 return null; 15450 } 15451 const borderRadius = style2?.border?.radius; 15452 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes2); 15453 const buttonClasses = clsx_default( 15454 "wp-block-button__link", 15455 colorProps.className, 15456 { 15457 "no-border-radius": style2?.border?.radius === 0 15458 } 15459 ); 15460 const buttonStyle = { 15461 borderRadius: borderRadius ? borderRadius : void 0, 15462 ...colorProps.style 15463 }; 15464 const wrapperClasses = clsx_default(className, { 15465 [`has-custom-width wp-block-button__width-$width}`]: width, 15466 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 15467 }); 15468 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15469 import_block_editor19.RichText.Content, 15470 { 15471 tagName: "a", 15472 className: buttonClasses, 15473 href: url, 15474 title, 15475 style: buttonStyle, 15476 value: text, 15477 target: linkTarget, 15478 rel 15479 } 15480 ) }); 15481 }, 15482 migrate: (0, import_compose9.compose)( 15483 migrateWidth, 15484 migrate_font_family_default, 15485 migrateBorderRadius 15486 ) 15487 }, 15488 { 15489 supports: { 15490 anchor: true, 15491 align: true, 15492 alignWide: false, 15493 color: { 15494 __experimentalSkipSerialization: true 15495 }, 15496 reusable: false, 15497 __experimentalSelector: ".wp-block-button__link" 15498 }, 15499 attributes: { 15500 ...blockAttributes, 15501 linkTarget: { 15502 type: "string", 15503 source: "attribute", 15504 selector: "a", 15505 attribute: "target" 15506 }, 15507 rel: { 15508 type: "string", 15509 source: "attribute", 15510 selector: "a", 15511 attribute: "rel" 15512 }, 15513 placeholder: { 15514 type: "string" 15515 }, 15516 borderRadius: { 15517 type: "number" 15518 }, 15519 backgroundColor: { 15520 type: "string" 15521 }, 15522 textColor: { 15523 type: "string" 15524 }, 15525 gradient: { 15526 type: "string" 15527 }, 15528 style: { 15529 type: "object" 15530 }, 15531 width: { 15532 type: "number" 15533 } 15534 }, 15535 save({ attributes: attributes2, className }) { 15536 const { borderRadius, linkTarget, rel, text, title, url, width } = attributes2; 15537 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes2); 15538 const buttonClasses = clsx_default( 15539 "wp-block-button__link", 15540 colorProps.className, 15541 { 15542 "no-border-radius": borderRadius === 0 15543 } 15544 ); 15545 const buttonStyle = { 15546 borderRadius: borderRadius ? borderRadius + "px" : void 0, 15547 ...colorProps.style 15548 }; 15549 const wrapperClasses = clsx_default(className, { 15550 [`has-custom-width wp-block-button__width-$width}`]: width 15551 }); 15552 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15553 import_block_editor19.RichText.Content, 15554 { 15555 tagName: "a", 15556 className: buttonClasses, 15557 href: url, 15558 title, 15559 style: buttonStyle, 15560 value: text, 15561 target: linkTarget, 15562 rel 15563 } 15564 ) }); 15565 }, 15566 migrate: (0, import_compose9.compose)( 15567 migrateWidth, 15568 migrate_font_family_default, 15569 migrateBorderRadius 15570 ) 15571 }, 15572 { 15573 supports: { 15574 anchor: true, 15575 align: true, 15576 alignWide: false, 15577 color: { 15578 __experimentalSkipSerialization: true 15579 }, 15580 reusable: false, 15581 __experimentalSelector: ".wp-block-button__link" 15582 }, 15583 attributes: { 15584 ...blockAttributes, 15585 linkTarget: { 15586 type: "string", 15587 source: "attribute", 15588 selector: "a", 15589 attribute: "target" 15590 }, 15591 rel: { 15592 type: "string", 15593 source: "attribute", 15594 selector: "a", 15595 attribute: "rel" 15596 }, 15597 placeholder: { 15598 type: "string" 15599 }, 15600 borderRadius: { 15601 type: "number" 15602 }, 15603 backgroundColor: { 15604 type: "string" 15605 }, 15606 textColor: { 15607 type: "string" 15608 }, 15609 gradient: { 15610 type: "string" 15611 }, 15612 style: { 15613 type: "object" 15614 }, 15615 width: { 15616 type: "number" 15617 } 15618 }, 15619 save({ attributes: attributes2, className }) { 15620 const { borderRadius, linkTarget, rel, text, title, url, width } = attributes2; 15621 const colorProps = (0, import_block_editor19.__experimentalGetColorClassesAndStyles)(attributes2); 15622 const buttonClasses = clsx_default( 15623 "wp-block-button__link", 15624 colorProps.className, 15625 { 15626 "no-border-radius": borderRadius === 0 15627 } 15628 ); 15629 const buttonStyle = { 15630 borderRadius: borderRadius ? borderRadius + "px" : void 0, 15631 ...colorProps.style 15632 }; 15633 const wrapperClasses = clsx_default(className, { 15634 [`has-custom-width wp-block-button__width-$width}`]: width 15635 }); 15636 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { ...import_block_editor19.useBlockProps.save({ className: wrapperClasses }), children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15637 import_block_editor19.RichText.Content, 15638 { 15639 tagName: "a", 15640 className: buttonClasses, 15641 href: url, 15642 title, 15643 style: buttonStyle, 15644 value: text, 15645 target: linkTarget, 15646 rel 15647 } 15648 ) }); 15649 }, 15650 migrate: (0, import_compose9.compose)( 15651 migrateWidth, 15652 migrate_font_family_default, 15653 migrateBorderRadius 15654 ) 15655 }, 15656 { 15657 supports: { 15658 align: true, 15659 alignWide: false, 15660 color: { gradients: true } 15661 }, 15662 attributes: { 15663 ...blockAttributes, 15664 linkTarget: { 15665 type: "string", 15666 source: "attribute", 15667 selector: "a", 15668 attribute: "target" 15669 }, 15670 rel: { 15671 type: "string", 15672 source: "attribute", 15673 selector: "a", 15674 attribute: "rel" 15675 }, 15676 placeholder: { 15677 type: "string" 15678 }, 15679 borderRadius: { 15680 type: "number" 15681 }, 15682 backgroundColor: { 15683 type: "string" 15684 }, 15685 textColor: { 15686 type: "string" 15687 }, 15688 gradient: { 15689 type: "string" 15690 }, 15691 style: { 15692 type: "object" 15693 } 15694 }, 15695 save({ attributes: attributes2 }) { 15696 const { borderRadius, linkTarget, rel, text, title, url } = attributes2; 15697 const buttonClasses = clsx_default("wp-block-button__link", { 15698 "no-border-radius": borderRadius === 0 15699 }); 15700 const buttonStyle = { 15701 borderRadius: borderRadius ? borderRadius + "px" : void 0 15702 }; 15703 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15704 import_block_editor19.RichText.Content, 15705 { 15706 tagName: "a", 15707 className: buttonClasses, 15708 href: url, 15709 title, 15710 style: buttonStyle, 15711 value: text, 15712 target: linkTarget, 15713 rel 15714 } 15715 ); 15716 }, 15717 migrate: (0, import_compose9.compose)(migrateWidth, migrateBorderRadius) 15718 }, 15719 { 15720 supports: { 15721 align: true, 15722 alignWide: false 15723 }, 15724 attributes: { 15725 ...blockAttributes, 15726 linkTarget: { 15727 type: "string", 15728 source: "attribute", 15729 selector: "a", 15730 attribute: "target" 15731 }, 15732 rel: { 15733 type: "string", 15734 source: "attribute", 15735 selector: "a", 15736 attribute: "rel" 15737 }, 15738 placeholder: { 15739 type: "string" 15740 }, 15741 borderRadius: { 15742 type: "number" 15743 }, 15744 backgroundColor: { 15745 type: "string" 15746 }, 15747 textColor: { 15748 type: "string" 15749 }, 15750 customBackgroundColor: { 15751 type: "string" 15752 }, 15753 customTextColor: { 15754 type: "string" 15755 }, 15756 customGradient: { 15757 type: "string" 15758 }, 15759 gradient: { 15760 type: "string" 15761 } 15762 }, 15763 isEligible: (attributes2) => !!attributes2.customTextColor || !!attributes2.customBackgroundColor || !!attributes2.customGradient || !!attributes2.align, 15764 migrate: (0, import_compose9.compose)( 15765 migrateWidth, 15766 migrateBorderRadius, 15767 migrateCustomColorsAndGradients, 15768 migrateAlign 15769 ), 15770 save({ attributes: attributes2 }) { 15771 const { 15772 backgroundColor, 15773 borderRadius, 15774 customBackgroundColor, 15775 customTextColor, 15776 customGradient, 15777 linkTarget, 15778 gradient, 15779 rel, 15780 text, 15781 textColor, 15782 title, 15783 url 15784 } = attributes2; 15785 const textClass = (0, import_block_editor19.getColorClassName)("color", textColor); 15786 const backgroundClass = !customGradient && (0, import_block_editor19.getColorClassName)("background-color", backgroundColor); 15787 const gradientClass = (0, import_block_editor19.__experimentalGetGradientClass)(gradient); 15788 const buttonClasses = clsx_default("wp-block-button__link", { 15789 "has-text-color": textColor || customTextColor, 15790 [textClass]: textClass, 15791 "has-background": backgroundColor || customBackgroundColor || customGradient || gradient, 15792 [backgroundClass]: backgroundClass, 15793 "no-border-radius": borderRadius === 0, 15794 [gradientClass]: gradientClass 15795 }); 15796 const buttonStyle = { 15797 background: customGradient ? customGradient : void 0, 15798 backgroundColor: backgroundClass || customGradient || gradient ? void 0 : customBackgroundColor, 15799 color: textClass ? void 0 : customTextColor, 15800 borderRadius: borderRadius ? borderRadius + "px" : void 0 15801 }; 15802 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15803 import_block_editor19.RichText.Content, 15804 { 15805 tagName: "a", 15806 className: buttonClasses, 15807 href: url, 15808 title, 15809 style: buttonStyle, 15810 value: text, 15811 target: linkTarget, 15812 rel 15813 } 15814 ) }); 15815 } 15816 }, 15817 { 15818 attributes: { 15819 ...blockAttributes, 15820 align: { 15821 type: "string", 15822 default: "none" 15823 }, 15824 backgroundColor: { 15825 type: "string" 15826 }, 15827 textColor: { 15828 type: "string" 15829 }, 15830 customBackgroundColor: { 15831 type: "string" 15832 }, 15833 customTextColor: { 15834 type: "string" 15835 }, 15836 linkTarget: { 15837 type: "string", 15838 source: "attribute", 15839 selector: "a", 15840 attribute: "target" 15841 }, 15842 rel: { 15843 type: "string", 15844 source: "attribute", 15845 selector: "a", 15846 attribute: "rel" 15847 }, 15848 placeholder: { 15849 type: "string" 15850 } 15851 }, 15852 isEligible(attribute) { 15853 return attribute.className && attribute.className.includes("is-style-squared"); 15854 }, 15855 migrate(attributes2) { 15856 let newClassName = attributes2.className; 15857 if (newClassName) { 15858 newClassName = newClassName.replace(/is-style-squared[\s]?/, "").trim(); 15859 } 15860 return migrateBorderRadius( 15861 migrateCustomColorsAndGradients({ 15862 ...attributes2, 15863 className: newClassName ? newClassName : void 0, 15864 borderRadius: 0 15865 }) 15866 ); 15867 }, 15868 save({ attributes: attributes2 }) { 15869 const { 15870 backgroundColor, 15871 customBackgroundColor, 15872 customTextColor, 15873 linkTarget, 15874 rel, 15875 text, 15876 textColor, 15877 title, 15878 url 15879 } = attributes2; 15880 const textClass = (0, import_block_editor19.getColorClassName)("color", textColor); 15881 const backgroundClass = (0, import_block_editor19.getColorClassName)( 15882 "background-color", 15883 backgroundColor 15884 ); 15885 const buttonClasses = clsx_default("wp-block-button__link", { 15886 "has-text-color": textColor || customTextColor, 15887 [textClass]: textClass, 15888 "has-background": backgroundColor || customBackgroundColor, 15889 [backgroundClass]: backgroundClass 15890 }); 15891 const buttonStyle = { 15892 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 15893 color: textClass ? void 0 : customTextColor 15894 }; 15895 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15896 import_block_editor19.RichText.Content, 15897 { 15898 tagName: "a", 15899 className: buttonClasses, 15900 href: url, 15901 title, 15902 style: buttonStyle, 15903 value: text, 15904 target: linkTarget, 15905 rel 15906 } 15907 ) }); 15908 } 15909 }, 15910 { 15911 attributes: { 15912 ...blockAttributes, 15913 align: { 15914 type: "string", 15915 default: "none" 15916 }, 15917 backgroundColor: { 15918 type: "string" 15919 }, 15920 textColor: { 15921 type: "string" 15922 }, 15923 customBackgroundColor: { 15924 type: "string" 15925 }, 15926 customTextColor: { 15927 type: "string" 15928 } 15929 }, 15930 migrate: (0, import_compose9.compose)(migrateWidth, oldColorsMigration), 15931 save({ attributes: attributes2 }) { 15932 const { 15933 url, 15934 text, 15935 title, 15936 backgroundColor, 15937 textColor, 15938 customBackgroundColor, 15939 customTextColor 15940 } = attributes2; 15941 const textClass = (0, import_block_editor19.getColorClassName)("color", textColor); 15942 const backgroundClass = (0, import_block_editor19.getColorClassName)( 15943 "background-color", 15944 backgroundColor 15945 ); 15946 const buttonClasses = clsx_default("wp-block-button__link", { 15947 "has-text-color": textColor || customTextColor, 15948 [textClass]: textClass, 15949 "has-background": backgroundColor || customBackgroundColor, 15950 [backgroundClass]: backgroundClass 15951 }); 15952 const buttonStyle = { 15953 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 15954 color: textClass ? void 0 : customTextColor 15955 }; 15956 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15957 import_block_editor19.RichText.Content, 15958 { 15959 tagName: "a", 15960 className: buttonClasses, 15961 href: url, 15962 title, 15963 style: buttonStyle, 15964 value: text 15965 } 15966 ) }); 15967 } 15968 }, 15969 { 15970 attributes: { 15971 ...blockAttributes, 15972 color: { 15973 type: "string" 15974 }, 15975 textColor: { 15976 type: "string" 15977 }, 15978 align: { 15979 type: "string", 15980 default: "none" 15981 } 15982 }, 15983 save({ attributes: attributes2 }) { 15984 const { url, text, title, align, color, textColor } = attributes2; 15985 const buttonStyle = { 15986 backgroundColor: color, 15987 color: textColor 15988 }; 15989 const linkClass = "wp-block-button__link"; 15990 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)("div", { className: `align$align}`, children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 15991 import_block_editor19.RichText.Content, 15992 { 15993 tagName: "a", 15994 className: linkClass, 15995 href: url, 15996 title, 15997 style: buttonStyle, 15998 value: text 15999 } 16000 ) }); 16001 }, 16002 migrate: (0, import_compose9.compose)(migrateWidth, oldColorsMigration) 16003 }, 16004 { 16005 attributes: { 16006 ...blockAttributes, 16007 color: { 16008 type: "string" 16009 }, 16010 textColor: { 16011 type: "string" 16012 }, 16013 align: { 16014 type: "string", 16015 default: "none" 16016 } 16017 }, 16018 save({ attributes: attributes2 }) { 16019 const { url, text, title, align, color, textColor } = attributes2; 16020 return /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 16021 "div", 16022 { 16023 className: `align$align}`, 16024 style: { backgroundColor: color }, 16025 children: /* @__PURE__ */ (0, import_jsx_runtime218.jsx)( 16026 import_block_editor19.RichText.Content, 16027 { 16028 tagName: "a", 16029 href: url, 16030 title, 16031 style: { color: textColor }, 16032 value: text 16033 } 16034 ) 16035 } 16036 ); 16037 }, 16038 migrate: (0, import_compose9.compose)(migrateWidth, oldColorsMigration) 16039 } 16040 ]; 16041 var deprecated_default3 = deprecated; 16042 16043 // packages/block-library/build-module/button/edit.mjs 16044 var import_i18n17 = __toESM(require_i18n(), 1); 16045 var import_element36 = __toESM(require_element(), 1); 16046 var import_components9 = __toESM(require_components(), 1); 16047 var import_block_editor21 = __toESM(require_block_editor(), 1); 16048 var import_keycodes = __toESM(require_keycodes(), 1); 16049 var import_blocks7 = __toESM(require_blocks(), 1); 16050 var import_compose11 = __toESM(require_compose(), 1); 16051 var import_data11 = __toESM(require_data(), 1); 16052 16053 // packages/block-library/build-module/button/constants.mjs 16054 var NEW_TAB_REL = "noopener"; 16055 var NEW_TAB_TARGET = "_blank"; 16056 var NOFOLLOW_REL = "nofollow"; 16057 16058 // packages/block-library/build-module/button/get-updated-link-attributes.mjs 16059 var import_url3 = __toESM(require_url(), 1); 16060 function getUpdatedLinkAttributes({ 16061 rel = "", 16062 url = "", 16063 opensInNewTab, 16064 nofollow 16065 }) { 16066 let newLinkTarget; 16067 let updatedRel = rel; 16068 if (opensInNewTab) { 16069 newLinkTarget = NEW_TAB_TARGET; 16070 updatedRel = updatedRel?.includes(NEW_TAB_REL) ? updatedRel : updatedRel + ` $NEW_TAB_REL}`; 16071 } else { 16072 const relRegex = new RegExp(`\\b$NEW_TAB_REL}\\s*`, "g"); 16073 updatedRel = updatedRel?.replace(relRegex, "").trim(); 16074 } 16075 if (nofollow) { 16076 updatedRel = updatedRel?.includes(NOFOLLOW_REL) ? updatedRel : (updatedRel + ` $NOFOLLOW_REL}`).trim(); 16077 } else { 16078 const relRegex = new RegExp(`\\b$NOFOLLOW_REL}\\s*`, "g"); 16079 updatedRel = updatedRel?.replace(relRegex, "").trim(); 16080 } 16081 return { 16082 url: (0, import_url3.prependHTTPS)(url), 16083 linkTarget: newLinkTarget, 16084 rel: updatedRel || void 0 16085 }; 16086 } 16087 16088 // packages/block-library/build-module/utils/remove-anchor-tag.mjs 16089 function removeAnchorTag(value) { 16090 return value.toString().replace(/<\/?a[^>]*>/g, ""); 16091 } 16092 16093 // packages/block-library/build-module/utils/deprecated-text-align-attributes.mjs 16094 var import_compose10 = __toESM(require_compose(), 1); 16095 var import_element35 = __toESM(require_element(), 1); 16096 var import_deprecated3 = __toESM(require_deprecated(), 1); 16097 var import_data10 = __toESM(require_data(), 1); 16098 var import_block_editor20 = __toESM(require_block_editor(), 1); 16099 function useDeprecatedTextAlign(props) { 16100 const { name: name118, attributes: attributes2, setAttributes } = props; 16101 const { textAlign } = attributes2; 16102 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data10.useDispatch)(import_block_editor20.store); 16103 const updateStyleWithAlign = (0, import_compose10.useEvent)(() => { 16104 (0, import_deprecated3.default)(`textAlign attribute in $name118}`, { 16105 alternative: "style.typography.textAlign", 16106 since: "7.0" 16107 }); 16108 __unstableMarkNextChangeAsNotPersistent(); 16109 setAttributes((currentAttr) => ({ 16110 style: { 16111 ...currentAttr.style, 16112 typography: { 16113 ...currentAttr.style?.typography, 16114 textAlign 16115 } 16116 } 16117 })); 16118 }); 16119 const lastUpdatedAlignRef = (0, import_element35.useRef)(); 16120 (0, import_element35.useEffect)(() => { 16121 if (textAlign === lastUpdatedAlignRef.current) { 16122 return; 16123 } 16124 lastUpdatedAlignRef.current = textAlign; 16125 updateStyleWithAlign(); 16126 }, [textAlign, updateStyleWithAlign]); 16127 } 16128 16129 // packages/block-library/build-module/button/utils.mjs 16130 function isPercentageWidth(width) { 16131 return typeof width === "string" && width.endsWith("%"); 16132 } 16133 function getWidthClasses(width) { 16134 if (!width) { 16135 return {}; 16136 } 16137 if (isPercentageWidth(width)) { 16138 const legacyWidthClasses = { 16139 "25%": "wp-block-button__width-25", 16140 "50%": "wp-block-button__width-50", 16141 "75%": "wp-block-button__width-75", 16142 "100%": "wp-block-button__width-100" 16143 }; 16144 return { 16145 "has-custom-width": true, 16146 "wp-block-button__width": true, 16147 // Maintain legacy class for backwards compatibility. 16148 ...legacyWidthClasses[width] && { 16149 [legacyWidthClasses[width]]: true 16150 } 16151 }; 16152 } 16153 return { 16154 "has-custom-width": true 16155 }; 16156 } 16157 16158 // packages/block-library/build-module/button/edit.mjs 16159 var import_jsx_runtime219 = __toESM(require_jsx_runtime(), 1); 16160 var { HTMLElementControl } = unlock(import_block_editor21.privateApis); 16161 var { subscribeDelegatedListener } = unlock(import_compose11.privateApis); 16162 var LINK_SETTINGS = [ 16163 ...import_block_editor21.LinkControl.DEFAULT_LINK_SETTINGS, 16164 { 16165 id: "nofollow", 16166 title: (0, import_i18n17.__)("Mark as nofollow") 16167 } 16168 ]; 16169 function useEnter(clientId) { 16170 const { replaceBlocks, selectionChange } = (0, import_data11.useDispatch)(import_block_editor21.store); 16171 const { 16172 getBlock, 16173 getBlockAttributes: getBlockAttributes4, 16174 getBlockRootClientId, 16175 getBlockIndex 16176 } = (0, import_data11.useSelect)(import_block_editor21.store); 16177 return (0, import_compose11.useRefEffect)((element) => { 16178 function onKeyDown(event) { 16179 if (event.defaultPrevented || event.keyCode !== import_keycodes.ENTER) { 16180 return; 16181 } 16182 const { text } = getBlockAttributes4(clientId) ?? {}; 16183 if (text?.length) { 16184 return; 16185 } 16186 event.preventDefault(); 16187 const topParentListBlock = getBlock( 16188 getBlockRootClientId(clientId) 16189 ); 16190 const blockIndex = getBlockIndex(clientId); 16191 const head = (0, import_blocks7.cloneBlock)({ 16192 ...topParentListBlock, 16193 innerBlocks: topParentListBlock.innerBlocks.slice( 16194 0, 16195 blockIndex 16196 ) 16197 }); 16198 const middle = (0, import_blocks7.createBlock)((0, import_blocks7.getDefaultBlockName)()); 16199 const after = topParentListBlock.innerBlocks.slice( 16200 blockIndex + 1 16201 ); 16202 const tail = after.length ? [ 16203 (0, import_blocks7.cloneBlock)({ 16204 ...topParentListBlock, 16205 innerBlocks: after 16206 }) 16207 ] : []; 16208 replaceBlocks( 16209 topParentListBlock.clientId, 16210 [head, middle, ...tail], 16211 1 16212 ); 16213 selectionChange(middle.clientId); 16214 } 16215 return subscribeDelegatedListener( 16216 element, 16217 "keydown", 16218 onKeyDown, 16219 true 16220 ); 16221 }, []); 16222 } 16223 function ButtonEdit(props) { 16224 const { 16225 attributes: attributes2, 16226 setAttributes, 16227 className, 16228 isSelected, 16229 onReplace, 16230 mergeBlocks, 16231 clientId, 16232 context 16233 } = props; 16234 const { 16235 tagName, 16236 linkTarget, 16237 placeholder: placeholder2, 16238 rel, 16239 style: style2, 16240 text, 16241 url, 16242 metadata 16243 } = attributes2; 16244 const width = style2?.dimensions?.width; 16245 useDeprecatedTextAlign(props); 16246 const TagName2 = tagName || "a"; 16247 function onKeyDown(event) { 16248 if (import_keycodes.isKeyboardEvent.primary(event, "k")) { 16249 startEditing(event); 16250 } else if (import_keycodes.isKeyboardEvent.primaryShift(event, "k")) { 16251 unlink(); 16252 richTextRef.current?.focus(); 16253 } 16254 } 16255 const [popoverAnchor, setPopoverAnchor] = (0, import_element36.useState)(null); 16256 const borderProps = (0, import_block_editor21.__experimentalUseBorderProps)(attributes2); 16257 const colorProps = (0, import_block_editor21.__experimentalUseColorProps)(attributes2); 16258 const spacingProps = (0, import_block_editor21.__experimentalGetSpacingClassesAndStyles)(attributes2); 16259 const shadowProps = (0, import_block_editor21.__experimentalGetShadowClassesAndStyles)(attributes2); 16260 const dimensionsProps = (0, import_block_editor21.__experimentalGetDimensionsClassesAndStyles)(attributes2); 16261 const ref = (0, import_element36.useRef)(); 16262 const richTextRef = (0, import_element36.useRef)(); 16263 const blockProps = (0, import_block_editor21.useBlockProps)({ 16264 ref: (0, import_compose11.useMergeRefs)([setPopoverAnchor, ref]), 16265 onKeyDown 16266 }); 16267 const blockEditingMode = (0, import_block_editor21.useBlockEditingMode)(); 16268 const [isEditingURL, setIsEditingURL] = (0, import_element36.useState)(false); 16269 const isURLSet = !!url; 16270 const opensInNewTab = linkTarget === NEW_TAB_TARGET; 16271 const nofollow = !!rel?.includes(NOFOLLOW_REL); 16272 const isLinkTag = "a" === TagName2; 16273 const { 16274 createPageEntity, 16275 userCanCreatePages, 16276 lockUrlControls = false 16277 } = (0, import_data11.useSelect)( 16278 (select10) => { 16279 if (!isSelected) { 16280 return {}; 16281 } 16282 const _settings = select10(import_block_editor21.store).getSettings(); 16283 const blockBindingsSource = (0, import_blocks7.getBlockBindingsSource)( 16284 metadata?.bindings?.url?.source 16285 ); 16286 return { 16287 createPageEntity: _settings.__experimentalCreatePageEntity, 16288 userCanCreatePages: _settings.__experimentalUserCanCreatePages, 16289 lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ 16290 select: select10, 16291 context, 16292 args: metadata?.bindings?.url?.args 16293 }) 16294 }; 16295 }, 16296 [context, isSelected, metadata?.bindings?.url] 16297 ); 16298 async function handleCreate(pageTitle) { 16299 const page = await createPageEntity({ 16300 title: pageTitle, 16301 status: "draft" 16302 }); 16303 return { 16304 id: page.id, 16305 type: page.type, 16306 title: page.title.rendered, 16307 url: page.link, 16308 kind: "post-type" 16309 }; 16310 } 16311 function createButtonText(searchTerm) { 16312 return (0, import_element36.createInterpolateElement)( 16313 (0, import_i18n17.sprintf)( 16314 /* translators: %s: search term. */ 16315 (0, import_i18n17.__)("Create page: <mark>%s</mark>"), 16316 searchTerm 16317 ), 16318 { mark: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)("mark", {}) } 16319 ); 16320 } 16321 function startEditing(event) { 16322 event.preventDefault(); 16323 setIsEditingURL(true); 16324 } 16325 function unlink() { 16326 setAttributes({ 16327 url: void 0, 16328 linkTarget: void 0, 16329 rel: void 0 16330 }); 16331 setIsEditingURL(false); 16332 } 16333 (0, import_element36.useEffect)(() => { 16334 if (!isSelected) { 16335 setIsEditingURL(false); 16336 } 16337 }, [isSelected]); 16338 const linkValue = (0, import_element36.useMemo)( 16339 () => ({ url, opensInNewTab, nofollow }), 16340 [url, opensInNewTab, nofollow] 16341 ); 16342 const useEnterRef = useEnter(clientId); 16343 const mergedRef = (0, import_compose11.useMergeRefs)([useEnterRef, richTextRef]); 16344 const [fluidTypographySettings, layout, dimensionSizes] = (0, import_block_editor21.useSettings)( 16345 "typography.fluid", 16346 "layout", 16347 "dimensions.dimensionSizes" 16348 ); 16349 const dimensionPresets = (0, import_element36.useMemo)(() => { 16350 if (!dimensionSizes) { 16351 return []; 16352 } 16353 return [ 16354 ...dimensionSizes?.custom ?? [], 16355 ...dimensionSizes?.theme ?? [], 16356 ...dimensionSizes?.default ?? [] 16357 ]; 16358 }, [dimensionSizes]); 16359 const typographyProps = (0, import_block_editor21.getTypographyClassesAndStyles)(attributes2, { 16360 typography: { 16361 fluid: fluidTypographySettings 16362 }, 16363 layout: { 16364 wideSize: layout?.wideSize 16365 } 16366 }); 16367 const resolvedWidth = (0, import_element36.useMemo)(() => { 16368 if (!width) { 16369 return void 0; 16370 } 16371 const presetPrefix = "var:preset|dimension|"; 16372 if (width.startsWith(presetPrefix)) { 16373 const slug = width.slice(presetPrefix.length); 16374 const preset = dimensionPresets?.find((p2) => p2.slug === slug); 16375 return preset?.size ?? width; 16376 } 16377 return width; 16378 }, [width, dimensionPresets]); 16379 const hasNonContentControls = blockEditingMode === "default"; 16380 const hasBlockControls = hasNonContentControls || isLinkTag && !lockUrlControls; 16381 const classes = clsx_default( 16382 blockProps.className, 16383 getWidthClasses(resolvedWidth) 16384 ); 16385 const widthStyle = (0, import_element36.useMemo)(() => { 16386 if (!width) { 16387 return {}; 16388 } 16389 if (isPercentageWidth(resolvedWidth)) { 16390 return { 16391 "--wp--block-button--width": parseFloat(resolvedWidth) 16392 }; 16393 } 16394 return dimensionsProps.style; 16395 }, [width, resolvedWidth, dimensionsProps.style]); 16396 return /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(import_jsx_runtime219.Fragment, { children: [ 16397 /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( 16398 "div", 16399 { 16400 ...blockProps, 16401 className: classes, 16402 style: { ...blockProps.style, ...widthStyle }, 16403 children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( 16404 import_block_editor21.RichText, 16405 { 16406 ref: mergedRef, 16407 "aria-label": (0, import_i18n17.__)("Button text"), 16408 placeholder: placeholder2 || (0, import_i18n17.__)("Add text\u2026"), 16409 value: text, 16410 onChange: (value) => setAttributes({ 16411 text: removeAnchorTag(value) 16412 }), 16413 withoutInteractiveFormatting: true, 16414 className: clsx_default( 16415 className, 16416 "wp-block-button__link", 16417 colorProps.className, 16418 borderProps.className, 16419 typographyProps.className, 16420 { 16421 // For backwards compatibility add style that isn't 16422 // provided via block support. 16423 "no-border-radius": style2?.border?.radius === 0, 16424 [`has-custom-font-size`]: blockProps.style.fontSize 16425 }, 16426 (0, import_block_editor21.__experimentalGetElementClassName)("button") 16427 ), 16428 style: { 16429 ...borderProps.style, 16430 ...colorProps.style, 16431 ...spacingProps.style, 16432 ...shadowProps.style, 16433 ...typographyProps.style, 16434 writingMode: void 0 16435 }, 16436 onReplace, 16437 onMerge: mergeBlocks, 16438 identifier: "text" 16439 } 16440 ) 16441 } 16442 ), 16443 hasBlockControls && /* @__PURE__ */ (0, import_jsx_runtime219.jsx)(import_block_editor21.BlockControls, { group: "block", children: isLinkTag && !lockUrlControls && /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( 16444 import_components9.ToolbarButton, 16445 { 16446 name: "link", 16447 icon: !isURLSet ? link_default : link_off_default, 16448 title: !isURLSet ? (0, import_i18n17.__)("Link") : (0, import_i18n17.__)("Unlink"), 16449 shortcut: !isURLSet ? import_keycodes.displayShortcut.primary("k") : import_keycodes.displayShortcut.primaryShift("k"), 16450 onClick: !isURLSet ? startEditing : unlink, 16451 isActive: isURLSet 16452 } 16453 ) }), 16454 isLinkTag && isSelected && (isEditingURL || isURLSet) && !lockUrlControls && /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( 16455 import_components9.Popover, 16456 { 16457 placement: "bottom", 16458 onClose: () => { 16459 setIsEditingURL(false); 16460 richTextRef.current?.focus(); 16461 }, 16462 anchor: popoverAnchor, 16463 focusOnMount: isEditingURL ? "firstElement" : false, 16464 __unstableSlotName: "__unstable-block-tools-after", 16465 shift: true, 16466 children: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( 16467 import_block_editor21.LinkControl, 16468 { 16469 value: linkValue, 16470 onChange: ({ 16471 url: newURL, 16472 opensInNewTab: newOpensInNewTab, 16473 nofollow: newNofollow 16474 }) => setAttributes( 16475 getUpdatedLinkAttributes({ 16476 rel, 16477 url: newURL, 16478 opensInNewTab: newOpensInNewTab, 16479 nofollow: newNofollow 16480 }) 16481 ), 16482 onRemove: () => { 16483 unlink(); 16484 richTextRef.current?.focus(); 16485 }, 16486 forceIsEditingLink: isEditingURL, 16487 settings: LINK_SETTINGS, 16488 createSuggestion: createPageEntity && handleCreate, 16489 withCreateSuggestion: userCanCreatePages, 16490 createSuggestionButtonText: createButtonText 16491 } 16492 ) 16493 } 16494 ), 16495 /* @__PURE__ */ (0, import_jsx_runtime219.jsxs)(import_block_editor21.InspectorControls, { group: "advanced", children: [ 16496 /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( 16497 HTMLElementControl, 16498 { 16499 tagName, 16500 onChange: (value) => setAttributes({ tagName: value }), 16501 options: [ 16502 { label: (0, import_i18n17.__)("Default (<a>)"), value: "a" }, 16503 { label: "<button>", value: "button" } 16504 ] 16505 } 16506 ), 16507 isLinkTag && /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( 16508 import_components9.TextControl, 16509 { 16510 label: (0, import_i18n17.__)("Link relation"), 16511 help: (0, import_element36.createInterpolateElement)( 16512 (0, import_i18n17.__)( 16513 "The <a>Link Relation</a> attribute defines the relationship between a linked resource and the current document." 16514 ), 16515 { 16516 a: /* @__PURE__ */ (0, import_jsx_runtime219.jsx)( 16517 Link, 16518 { 16519 openInNewTab: true, 16520 href: "https://developer.mozilla.org/docs/Web/HTML/Attributes/rel" 16521 } 16522 ) 16523 } 16524 ), 16525 value: rel || "", 16526 onChange: (newRel) => setAttributes({ rel: newRel }) 16527 } 16528 ) 16529 ] }) 16530 ] }); 16531 } 16532 var edit_default2 = ButtonEdit; 16533 16534 // packages/block-library/build-module/button/block.json 16535 var block_default10 = { 16536 $schema: "https://schemas.wp.org/trunk/block.json", 16537 apiVersion: 3, 16538 name: "core/button", 16539 title: "Button", 16540 category: "design", 16541 parent: ["core/buttons"], 16542 description: "Prompt visitors to take action with a button-style link.", 16543 keywords: ["link"], 16544 textdomain: "default", 16545 attributes: { 16546 tagName: { 16547 type: "string", 16548 enum: ["a", "button"], 16549 default: "a" 16550 }, 16551 type: { 16552 type: "string", 16553 default: "button" 16554 }, 16555 url: { 16556 type: "string", 16557 source: "attribute", 16558 selector: "a", 16559 attribute: "href", 16560 role: "content" 16561 }, 16562 title: { 16563 type: "string", 16564 source: "attribute", 16565 selector: "a,button", 16566 attribute: "title", 16567 role: "content" 16568 }, 16569 text: { 16570 type: "rich-text", 16571 source: "rich-text", 16572 selector: "a,button", 16573 role: "content" 16574 }, 16575 linkTarget: { 16576 type: "string", 16577 source: "attribute", 16578 selector: "a", 16579 attribute: "target", 16580 role: "content" 16581 }, 16582 rel: { 16583 type: "string", 16584 source: "attribute", 16585 selector: "a", 16586 attribute: "rel", 16587 role: "content" 16588 }, 16589 placeholder: { 16590 type: "string" 16591 }, 16592 backgroundColor: { 16593 type: "string" 16594 }, 16595 textColor: { 16596 type: "string" 16597 }, 16598 gradient: { 16599 type: "string" 16600 } 16601 }, 16602 supports: { 16603 anchor: true, 16604 splitting: true, 16605 align: false, 16606 alignWide: false, 16607 color: { 16608 __experimentalSkipSerialization: true, 16609 gradients: true, 16610 __experimentalDefaultControls: { 16611 background: true, 16612 text: true 16613 } 16614 }, 16615 dimensions: { 16616 width: true, 16617 __experimentalSkipSerialization: ["width"], 16618 __experimentalDefaultControls: { 16619 width: true 16620 } 16621 }, 16622 typography: { 16623 __experimentalSkipSerialization: [ 16624 "fontSize", 16625 "lineHeight", 16626 "textAlign", 16627 "fontFamily", 16628 "fontWeight", 16629 "fontStyle", 16630 "textTransform", 16631 "textDecoration", 16632 "letterSpacing" 16633 ], 16634 fontSize: true, 16635 lineHeight: true, 16636 textAlign: true, 16637 __experimentalFontFamily: true, 16638 __experimentalFontWeight: true, 16639 __experimentalFontStyle: true, 16640 __experimentalTextTransform: true, 16641 __experimentalTextDecoration: true, 16642 __experimentalLetterSpacing: true, 16643 __experimentalWritingMode: true, 16644 __experimentalDefaultControls: { 16645 fontSize: true 16646 } 16647 }, 16648 reusable: false, 16649 shadow: { 16650 __experimentalSkipSerialization: true 16651 }, 16652 spacing: { 16653 __experimentalSkipSerialization: true, 16654 padding: ["horizontal", "vertical"], 16655 __experimentalDefaultControls: { 16656 padding: true 16657 } 16658 }, 16659 __experimentalBorder: { 16660 color: true, 16661 radius: true, 16662 style: true, 16663 width: true, 16664 __experimentalSkipSerialization: true, 16665 __experimentalDefaultControls: { 16666 color: true, 16667 radius: true, 16668 style: true, 16669 width: true 16670 } 16671 }, 16672 interactivity: { 16673 clientNavigation: true 16674 } 16675 }, 16676 styles: [ 16677 { name: "fill", label: "Fill", isDefault: true }, 16678 { name: "outline", label: "Outline" } 16679 ], 16680 editorStyle: "wp-block-button-editor", 16681 style: "wp-block-button", 16682 selectors: { 16683 root: ".wp-block-button .wp-block-button__link", 16684 typography: { 16685 writingMode: ".wp-block-button" 16686 }, 16687 dimensions: { 16688 root: ".wp-block-button", 16689 width: ".wp-block-button" 16690 } 16691 } 16692 }; 16693 16694 // packages/block-library/build-module/button/save.mjs 16695 var import_block_editor22 = __toESM(require_block_editor(), 1); 16696 var import_jsx_runtime220 = __toESM(require_jsx_runtime(), 1); 16697 function save6({ attributes: attributes2 }) { 16698 const { 16699 tagName, 16700 type, 16701 fontSize, 16702 linkTarget, 16703 rel, 16704 style: style2, 16705 text, 16706 title, 16707 url 16708 } = attributes2; 16709 const TagName2 = tagName || "a"; 16710 const isButtonTag = "button" === TagName2; 16711 const buttonType = type || "button"; 16712 const borderProps = (0, import_block_editor22.__experimentalGetBorderClassesAndStyles)(attributes2); 16713 const colorProps = (0, import_block_editor22.__experimentalGetColorClassesAndStyles)(attributes2); 16714 const spacingProps = (0, import_block_editor22.__experimentalGetSpacingClassesAndStyles)(attributes2); 16715 const shadowProps = (0, import_block_editor22.__experimentalGetShadowClassesAndStyles)(attributes2); 16716 const typographyProps = (0, import_block_editor22.getTypographyClassesAndStyles)(attributes2); 16717 const buttonClasses = clsx_default( 16718 "wp-block-button__link", 16719 colorProps.className, 16720 borderProps.className, 16721 typographyProps.className, 16722 { 16723 // For backwards compatibility add style that isn't provided via 16724 // block support. 16725 "no-border-radius": style2?.border?.radius === 0, 16726 [`has-custom-font-size`]: fontSize || style2?.typography?.fontSize 16727 }, 16728 (0, import_block_editor22.__experimentalGetElementClassName)("button") 16729 ); 16730 const buttonStyle = { 16731 ...borderProps.style, 16732 ...colorProps.style, 16733 ...spacingProps.style, 16734 ...shadowProps.style, 16735 ...typographyProps.style, 16736 writingMode: void 0 16737 }; 16738 return /* @__PURE__ */ (0, import_jsx_runtime220.jsx)("div", { ...import_block_editor22.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime220.jsx)( 16739 import_block_editor22.RichText.Content, 16740 { 16741 tagName: TagName2, 16742 type: isButtonTag ? buttonType : null, 16743 className: buttonClasses, 16744 href: isButtonTag ? null : url, 16745 title, 16746 style: buttonStyle, 16747 value: text, 16748 target: isButtonTag ? null : linkTarget, 16749 rel: isButtonTag ? null : rel 16750 } 16751 ) }); 16752 } 16753 16754 // packages/block-library/build-module/button/index.mjs 16755 var { fieldsKey: fieldsKey2, formKey: formKey2 } = unlock(import_blocks8.privateApis); 16756 var { name: name9 } = block_default10; 16757 var settings9 = { 16758 icon: button_default, 16759 example: { 16760 attributes: { 16761 className: "is-style-fill", 16762 text: (0, import_i18n18.__)("Call to action") 16763 } 16764 }, 16765 edit: edit_default2, 16766 save: save6, 16767 deprecated: deprecated_default3, 16768 merge: (a2, { text = "" }) => ({ 16769 ...a2, 16770 text: (a2.text || "") + text 16771 }), 16772 __experimentalLabel(attributes2, { context }) { 16773 const { text } = attributes2; 16774 const customName = attributes2?.metadata?.name; 16775 const hasContent = text?.trim().length > 0; 16776 if (context === "list-view" && (customName || hasContent)) { 16777 return customName || text; 16778 } 16779 if (context === "breadcrumb" && customName) { 16780 return customName; 16781 } 16782 } 16783 }; 16784 if (window.__experimentalContentOnlyInspectorFields) { 16785 settings9[fieldsKey2] = [ 16786 { 16787 id: "text", 16788 label: (0, import_i18n18.__)("Content"), 16789 type: "text", 16790 Edit: "rich-text" 16791 // TODO: replace with custom component 16792 }, 16793 { 16794 id: "link", 16795 label: (0, import_i18n18.__)("Link"), 16796 type: "url", 16797 Edit: "link", 16798 // TODO: replace with custom component 16799 getValue: ({ item }) => ({ 16800 url: item.url, 16801 rel: item.rel, 16802 linkTarget: item.linkTarget 16803 }), 16804 setValue: ({ value }) => ({ 16805 url: value.url, 16806 rel: value.rel, 16807 linkTarget: value.linkTarget 16808 }) 16809 } 16810 ]; 16811 settings9[formKey2] = { 16812 fields: ["text", "link"] 16813 }; 16814 } 16815 var init9 = () => initBlock({ name: name9, metadata: block_default10, settings: settings9 }); 16816 16817 // packages/block-library/build-module/buttons/index.mjs 16818 var buttons_exports = {}; 16819 __export(buttons_exports, { 16820 init: () => init10, 16821 metadata: () => block_default11, 16822 name: () => name10, 16823 settings: () => settings10 16824 }); 16825 var import_i18n19 = __toESM(require_i18n(), 1); 16826 16827 // packages/block-library/build-module/buttons/deprecated.mjs 16828 var import_block_editor23 = __toESM(require_block_editor(), 1); 16829 var import_jsx_runtime221 = __toESM(require_jsx_runtime(), 1); 16830 var migrateWithLayout = (attributes2) => { 16831 if (!!attributes2.layout) { 16832 return attributes2; 16833 } 16834 const { contentJustification, orientation, ...updatedAttributes } = attributes2; 16835 if (contentJustification || orientation) { 16836 Object.assign(updatedAttributes, { 16837 layout: { 16838 type: "flex", 16839 ...contentJustification && { 16840 justifyContent: contentJustification 16841 }, 16842 ...orientation && { orientation } 16843 } 16844 }); 16845 } 16846 return updatedAttributes; 16847 }; 16848 var deprecated3 = [ 16849 { 16850 attributes: { 16851 contentJustification: { 16852 type: "string" 16853 }, 16854 orientation: { 16855 type: "string", 16856 default: "horizontal" 16857 } 16858 }, 16859 supports: { 16860 anchor: true, 16861 align: ["wide", "full"], 16862 __experimentalExposeControlsToChildren: true, 16863 spacing: { 16864 blockGap: true, 16865 margin: ["top", "bottom"], 16866 __experimentalDefaultControls: { 16867 blockGap: true 16868 } 16869 } 16870 }, 16871 isEligible: ({ contentJustification, orientation }) => !!contentJustification || !!orientation, 16872 migrate: migrateWithLayout, 16873 save({ attributes: { contentJustification, orientation } }) { 16874 return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)( 16875 "div", 16876 { 16877 ...import_block_editor23.useBlockProps.save({ 16878 className: clsx_default({ 16879 [`is-content-justification-$contentJustification}`]: contentJustification, 16880 "is-vertical": orientation === "vertical" 16881 }) 16882 }), 16883 children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_block_editor23.InnerBlocks.Content, {}) 16884 } 16885 ); 16886 } 16887 }, 16888 { 16889 supports: { 16890 align: ["center", "left", "right"], 16891 anchor: true 16892 }, 16893 save() { 16894 return /* @__PURE__ */ (0, import_jsx_runtime221.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime221.jsx)(import_block_editor23.InnerBlocks.Content, {}) }); 16895 }, 16896 isEligible({ align }) { 16897 return align && ["center", "left", "right"].includes(align); 16898 }, 16899 migrate(attributes2) { 16900 return migrateWithLayout({ 16901 ...attributes2, 16902 align: void 0, 16903 // Floating Buttons blocks shouldn't have been supported in the 16904 // first place. Most users using them probably expected them to 16905 // act like content justification controls, so these blocks are 16906 // migrated to use content justification. 16907 // As for center-aligned Buttons blocks, the content justification 16908 // equivalent will create an identical end result in most cases. 16909 contentJustification: attributes2.align 16910 }); 16911 } 16912 } 16913 ]; 16914 var deprecated_default4 = deprecated3; 16915 16916 // packages/block-library/build-module/buttons/transforms.mjs 16917 var import_blocks10 = __toESM(require_blocks(), 1); 16918 var import_rich_text = __toESM(require_rich_text(), 1); 16919 16920 // packages/block-library/build-module/utils/get-transformed-attributes.mjs 16921 var import_blocks9 = __toESM(require_blocks(), 1); 16922 function getTransformedAttributes(attributes2, newBlockName, bindingsCallback = null) { 16923 if (!attributes2) { 16924 return void 0; 16925 } 16926 const newBlockType = (0, import_blocks9.getBlockType)(newBlockName); 16927 if (!newBlockType) { 16928 return void 0; 16929 } 16930 const transformedAttributes = {}; 16931 if ((0, import_blocks9.hasBlockSupport)(newBlockType, "anchor") && attributes2.anchor) { 16932 transformedAttributes.anchor = attributes2.anchor; 16933 } 16934 if ((0, import_blocks9.hasBlockSupport)(newBlockType, "ariaLabel") && attributes2.ariaLabel) { 16935 transformedAttributes.ariaLabel = attributes2.ariaLabel; 16936 } 16937 if (attributes2.metadata) { 16938 const transformedMetadata = []; 16939 if (bindingsCallback) { 16940 transformedMetadata.push("id", "bindings"); 16941 } 16942 if (transformedMetadata.length > 0) { 16943 const newMetadata = Object.entries(attributes2.metadata).reduce( 16944 (obj, [prop, value]) => { 16945 if (!transformedMetadata.includes(prop)) { 16946 return obj; 16947 } 16948 obj[prop] = prop === "bindings" ? bindingsCallback(value) : value; 16949 return obj; 16950 }, 16951 {} 16952 ); 16953 if (Object.keys(newMetadata).length > 0) { 16954 transformedAttributes.metadata = newMetadata; 16955 } 16956 } 16957 } 16958 if (Object.keys(transformedAttributes).length === 0) { 16959 return void 0; 16960 } 16961 return transformedAttributes; 16962 } 16963 16964 // packages/block-library/build-module/buttons/transforms.mjs 16965 var transforms2 = { 16966 from: [ 16967 { 16968 type: "block", 16969 isMultiBlock: true, 16970 blocks: ["core/button"], 16971 transform: (buttons) => ( 16972 // Creates the buttons block. 16973 (0, import_blocks10.createBlock)( 16974 "core/buttons", 16975 {}, 16976 // Loop the selected buttons. 16977 buttons.map( 16978 (attributes2) => ( 16979 // Create singular button in the buttons block. 16980 (0, import_blocks10.createBlock)("core/button", attributes2) 16981 ) 16982 ) 16983 ) 16984 ) 16985 }, 16986 { 16987 type: "block", 16988 isMultiBlock: true, 16989 blocks: ["core/paragraph"], 16990 transform: (buttons) => ( 16991 // Creates the buttons block. 16992 (0, import_blocks10.createBlock)( 16993 "core/buttons", 16994 {}, 16995 // Loop the selected buttons. 16996 buttons.map((attributes2) => { 16997 const { content } = attributes2; 16998 const element = (0, import_rich_text.__unstableCreateElement)(document, content); 16999 const text = element.innerText || ""; 17000 const link = element.querySelector("a"); 17001 const url = link?.getAttribute("href"); 17002 return (0, import_blocks10.createBlock)("core/button", { 17003 ...attributes2, 17004 ...getTransformedAttributes( 17005 attributes2, 17006 "core/button", 17007 ({ content: contentBinding }) => ({ 17008 text: contentBinding 17009 }) 17010 ), 17011 text, 17012 url 17013 }); 17014 }) 17015 ) 17016 ), 17017 isMatch: (paragraphs) => { 17018 return paragraphs.every((attributes2) => { 17019 const element = (0, import_rich_text.__unstableCreateElement)( 17020 document, 17021 attributes2.content 17022 ); 17023 const text = element.innerText || ""; 17024 const links = element.querySelectorAll("a"); 17025 return text.length <= 30 && links.length <= 1; 17026 }); 17027 } 17028 } 17029 ] 17030 }; 17031 var transforms_default2 = transforms2; 17032 17033 // packages/block-library/build-module/buttons/edit.mjs 17034 var import_block_editor24 = __toESM(require_block_editor(), 1); 17035 var import_jsx_runtime222 = __toESM(require_jsx_runtime(), 1); 17036 var DEFAULT_BLOCK = { 17037 name: "core/button" 17038 }; 17039 function ButtonsEdit({ attributes: attributes2, className }) { 17040 const { fontSize, layout, style: style2 } = attributes2; 17041 const blockProps = (0, import_block_editor24.useBlockProps)({ 17042 className: clsx_default(className, { 17043 "has-custom-font-size": fontSize || style2?.typography?.fontSize 17044 }) 17045 }); 17046 const innerBlocksProps = (0, import_block_editor24.useInnerBlocksProps)(blockProps, { 17047 defaultBlock: DEFAULT_BLOCK, 17048 orientation: layout?.orientation ?? "horizontal" 17049 }); 17050 return /* @__PURE__ */ (0, import_jsx_runtime222.jsx)("div", { ...innerBlocksProps }); 17051 } 17052 var edit_default3 = ButtonsEdit; 17053 17054 // packages/block-library/build-module/buttons/block.json 17055 var block_default11 = { 17056 $schema: "https://schemas.wp.org/trunk/block.json", 17057 apiVersion: 3, 17058 name: "core/buttons", 17059 title: "Buttons", 17060 category: "design", 17061 allowedBlocks: ["core/button"], 17062 description: "Prompt visitors to take action with a group of button-style links.", 17063 keywords: ["link"], 17064 textdomain: "default", 17065 supports: { 17066 anchor: true, 17067 align: ["wide", "full"], 17068 html: false, 17069 __experimentalExposeControlsToChildren: true, 17070 color: { 17071 gradients: true, 17072 text: false, 17073 __experimentalDefaultControls: { 17074 background: true 17075 } 17076 }, 17077 spacing: { 17078 blockGap: ["horizontal", "vertical"], 17079 padding: true, 17080 margin: ["top", "bottom"], 17081 __experimentalDefaultControls: { 17082 blockGap: true 17083 } 17084 }, 17085 typography: { 17086 fontSize: true, 17087 lineHeight: true, 17088 __experimentalFontFamily: true, 17089 __experimentalFontWeight: true, 17090 __experimentalFontStyle: true, 17091 __experimentalTextTransform: true, 17092 __experimentalTextDecoration: true, 17093 __experimentalLetterSpacing: true, 17094 __experimentalDefaultControls: { 17095 fontSize: true 17096 } 17097 }, 17098 __experimentalBorder: { 17099 color: true, 17100 radius: true, 17101 style: true, 17102 width: true, 17103 __experimentalDefaultControls: { 17104 color: true, 17105 radius: true, 17106 style: true, 17107 width: true 17108 } 17109 }, 17110 layout: { 17111 allowSwitching: false, 17112 allowInheriting: false, 17113 default: { 17114 type: "flex" 17115 } 17116 }, 17117 interactivity: { 17118 clientNavigation: true 17119 }, 17120 listView: true, 17121 contentRole: true 17122 }, 17123 editorStyle: "wp-block-buttons-editor", 17124 style: "wp-block-buttons" 17125 }; 17126 17127 // packages/block-library/build-module/buttons/save.mjs 17128 var import_block_editor25 = __toESM(require_block_editor(), 1); 17129 var import_jsx_runtime223 = __toESM(require_jsx_runtime(), 1); 17130 function save7({ attributes: attributes2, className }) { 17131 const { fontSize, style: style2 } = attributes2; 17132 const blockProps = import_block_editor25.useBlockProps.save({ 17133 className: clsx_default(className, { 17134 "has-custom-font-size": fontSize || style2?.typography?.fontSize 17135 }) 17136 }); 17137 const innerBlocksProps = import_block_editor25.useInnerBlocksProps.save(blockProps); 17138 return /* @__PURE__ */ (0, import_jsx_runtime223.jsx)("div", { ...innerBlocksProps }); 17139 } 17140 17141 // packages/block-library/build-module/buttons/index.mjs 17142 var { name: name10 } = block_default11; 17143 var TEMPLATE4 = [["core/button"]]; 17144 var settings10 = { 17145 icon: buttons_default, 17146 example: { 17147 attributes: { 17148 layout: { 17149 type: "flex", 17150 justifyContent: "center" 17151 } 17152 }, 17153 innerBlocks: [ 17154 { 17155 name: "core/button", 17156 attributes: { text: (0, import_i18n19.__)("Find out more") } 17157 }, 17158 { 17159 name: "core/button", 17160 attributes: { text: (0, import_i18n19.__)("Contact us") } 17161 } 17162 ] 17163 }, 17164 deprecated: deprecated_default4, 17165 transforms: transforms_default2, 17166 template: TEMPLATE4, 17167 templateInsertUpdatesSelection: true, 17168 edit: edit_default3, 17169 save: save7 17170 }; 17171 var init10 = () => initBlock({ name: name10, metadata: block_default11, settings: settings10 }); 17172 17173 // packages/block-library/build-module/calendar/index.mjs 17174 var calendar_exports = {}; 17175 __export(calendar_exports, { 17176 init: () => init11, 17177 metadata: () => block_default12, 17178 name: () => name11, 17179 settings: () => settings11 17180 }); 17181 17182 // packages/block-library/build-module/calendar/block.json 17183 var block_default12 = { 17184 $schema: "https://schemas.wp.org/trunk/block.json", 17185 apiVersion: 3, 17186 name: "core/calendar", 17187 title: "Calendar", 17188 category: "widgets", 17189 description: "A calendar of your site\u2019s posts.", 17190 keywords: ["posts", "archive"], 17191 textdomain: "default", 17192 attributes: { 17193 month: { 17194 type: "integer" 17195 }, 17196 year: { 17197 type: "integer" 17198 } 17199 }, 17200 supports: { 17201 anchor: true, 17202 align: true, 17203 html: false, 17204 color: { 17205 link: true, 17206 __experimentalSkipSerialization: ["text", "background"], 17207 __experimentalDefaultControls: { 17208 background: true, 17209 text: true 17210 }, 17211 __experimentalSelector: "table, th" 17212 }, 17213 typography: { 17214 fontSize: true, 17215 lineHeight: true, 17216 __experimentalFontFamily: true, 17217 __experimentalFontWeight: true, 17218 __experimentalFontStyle: true, 17219 __experimentalTextTransform: true, 17220 __experimentalLetterSpacing: true, 17221 __experimentalDefaultControls: { 17222 fontSize: true 17223 } 17224 }, 17225 interactivity: { 17226 clientNavigation: true 17227 } 17228 }, 17229 style: "wp-block-calendar" 17230 }; 17231 17232 // packages/block-library/build-module/calendar/edit.mjs 17233 var import_components10 = __toESM(require_components(), 1); 17234 var import_data12 = __toESM(require_data(), 1); 17235 var import_server_side_render3 = __toESM(require_server_side_render(), 1); 17236 var import_block_editor26 = __toESM(require_block_editor(), 1); 17237 var import_core_data5 = __toESM(require_core_data(), 1); 17238 var import_i18n20 = __toESM(require_i18n(), 1); 17239 var import_compose12 = __toESM(require_compose(), 1); 17240 var import_jsx_runtime224 = __toESM(require_jsx_runtime(), 1); 17241 var getYearMonth = memize((date) => { 17242 if (!date) { 17243 return {}; 17244 } 17245 const dateObj = new Date(date); 17246 return { 17247 year: dateObj.getFullYear(), 17248 month: dateObj.getMonth() + 1 17249 }; 17250 }); 17251 function CalendarEdit({ attributes: attributes2, name: name118 }) { 17252 const { date, hasPosts, hasPostsResolved } = (0, import_data12.useSelect)((select10) => { 17253 const { getEntityRecords, hasFinishedResolution } = select10(import_core_data5.store); 17254 const singlePublishedPostQuery = { 17255 status: "publish", 17256 per_page: 1 17257 }; 17258 const posts = getEntityRecords( 17259 "postType", 17260 "post", 17261 singlePublishedPostQuery 17262 ); 17263 const postsResolved = hasFinishedResolution("getEntityRecords", [ 17264 "postType", 17265 "post", 17266 singlePublishedPostQuery 17267 ]); 17268 let _date; 17269 const editorSelectors = select10("core/editor"); 17270 if (editorSelectors) { 17271 const postType = editorSelectors.getEditedPostAttribute("type"); 17272 if (postType === "post") { 17273 _date = editorSelectors.getEditedPostAttribute("date"); 17274 } 17275 } 17276 return { 17277 date: _date, 17278 hasPostsResolved: postsResolved, 17279 hasPosts: postsResolved && posts?.length === 1 17280 }; 17281 }, []); 17282 const { content, status, error: error2 } = (0, import_server_side_render3.useServerSideRender)({ 17283 attributes: { 17284 ...attributes2, 17285 ...getYearMonth(date) 17286 }, 17287 block: name118 17288 }); 17289 const disabledRef = (0, import_compose12.useDisabled)(); 17290 const blockProps = (0, import_block_editor26.useBlockProps)({ ref: disabledRef }); 17291 if (!hasPosts) { 17292 return /* @__PURE__ */ (0, import_jsx_runtime224.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_components10.Placeholder, { icon: calendar_default, label: (0, import_i18n20.__)("Calendar"), children: !hasPostsResolved ? /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_components10.Spinner, {}) : (0, import_i18n20.__)("No published posts found.") }) }); 17293 } 17294 return /* @__PURE__ */ (0, import_jsx_runtime224.jsxs)(import_jsx_runtime224.Fragment, { children: [ 17295 status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime224.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(import_components10.Spinner, {}) }), 17296 status === "error" && /* @__PURE__ */ (0, import_jsx_runtime224.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime224.jsx)("p", { children: (0, import_i18n20.sprintf)( 17297 /* translators: %s: error message returned when rendering the block. */ 17298 (0, import_i18n20.__)("Error: %s"), 17299 error2 17300 ) }) }), 17301 status === "success" && /* @__PURE__ */ (0, import_jsx_runtime224.jsx)(html_renderer_default, { wrapperProps: blockProps, html: content }) 17302 ] }); 17303 } 17304 17305 // packages/block-library/build-module/calendar/transforms.mjs 17306 var import_blocks11 = __toESM(require_blocks(), 1); 17307 var transforms3 = { 17308 from: [ 17309 { 17310 type: "block", 17311 blocks: ["core/archives"], 17312 transform: () => (0, import_blocks11.createBlock)("core/calendar") 17313 } 17314 ], 17315 to: [ 17316 { 17317 type: "block", 17318 blocks: ["core/archives"], 17319 transform: () => (0, import_blocks11.createBlock)("core/archives") 17320 } 17321 ] 17322 }; 17323 var transforms_default3 = transforms3; 17324 17325 // packages/block-library/build-module/calendar/index.mjs 17326 var { name: name11 } = block_default12; 17327 var settings11 = { 17328 icon: calendar_default, 17329 example: {}, 17330 edit: CalendarEdit, 17331 transforms: transforms_default3 17332 }; 17333 var init11 = () => initBlock({ name: name11, metadata: block_default12, settings: settings11 }); 17334 17335 // packages/block-library/build-module/categories/index.mjs 17336 var categories_exports = {}; 17337 __export(categories_exports, { 17338 init: () => init12, 17339 metadata: () => block_default13, 17340 name: () => name12, 17341 settings: () => settings12 17342 }); 17343 17344 // packages/block-library/build-module/categories/block.json 17345 var block_default13 = { 17346 $schema: "https://schemas.wp.org/trunk/block.json", 17347 apiVersion: 3, 17348 name: "core/categories", 17349 title: "Terms List", 17350 category: "widgets", 17351 description: "Display a list of all terms of a given taxonomy.", 17352 keywords: ["categories"], 17353 textdomain: "default", 17354 attributes: { 17355 taxonomy: { 17356 type: "string", 17357 default: "category" 17358 }, 17359 displayAsDropdown: { 17360 type: "boolean", 17361 default: false 17362 }, 17363 showHierarchy: { 17364 type: "boolean", 17365 default: false 17366 }, 17367 showPostCounts: { 17368 type: "boolean", 17369 default: false 17370 }, 17371 showOnlyTopLevel: { 17372 type: "boolean", 17373 default: false 17374 }, 17375 showEmpty: { 17376 type: "boolean", 17377 default: false 17378 }, 17379 label: { 17380 type: "string", 17381 role: "content" 17382 }, 17383 showLabel: { 17384 type: "boolean", 17385 default: true 17386 } 17387 }, 17388 usesContext: ["enhancedPagination"], 17389 supports: { 17390 anchor: true, 17391 align: true, 17392 html: false, 17393 spacing: { 17394 margin: true, 17395 padding: true, 17396 __experimentalDefaultControls: { 17397 margin: false, 17398 padding: false 17399 } 17400 }, 17401 typography: { 17402 fontSize: true, 17403 lineHeight: true, 17404 __experimentalFontFamily: true, 17405 __experimentalFontWeight: true, 17406 __experimentalFontStyle: true, 17407 __experimentalTextTransform: true, 17408 __experimentalTextDecoration: true, 17409 __experimentalLetterSpacing: true, 17410 __experimentalDefaultControls: { 17411 fontSize: true 17412 } 17413 }, 17414 color: { 17415 gradients: true, 17416 link: true, 17417 __experimentalDefaultControls: { 17418 background: true, 17419 text: true, 17420 link: true 17421 } 17422 }, 17423 interactivity: { 17424 clientNavigation: true 17425 }, 17426 __experimentalBorder: { 17427 radius: true, 17428 color: true, 17429 width: true, 17430 style: true, 17431 __experimentalDefaultControls: { 17432 radius: true, 17433 color: true, 17434 width: true, 17435 style: true 17436 } 17437 } 17438 }, 17439 editorStyle: "wp-block-categories-editor", 17440 style: "wp-block-categories" 17441 }; 17442 17443 // packages/block-library/build-module/categories/edit.mjs 17444 var import_components11 = __toESM(require_components(), 1); 17445 var import_compose13 = __toESM(require_compose(), 1); 17446 var import_block_editor27 = __toESM(require_block_editor(), 1); 17447 var import_html_entities2 = __toESM(require_html_entities(), 1); 17448 var import_i18n21 = __toESM(require_i18n(), 1); 17449 var import_core_data6 = __toESM(require_core_data(), 1); 17450 var import_data13 = __toESM(require_data(), 1); 17451 var import_notices2 = __toESM(require_notices(), 1); 17452 var import_jsx_runtime225 = __toESM(require_jsx_runtime(), 1); 17453 function CategoriesEdit({ 17454 attributes: { 17455 displayAsDropdown, 17456 showHierarchy, 17457 showPostCounts, 17458 showOnlyTopLevel, 17459 showEmpty, 17460 label, 17461 showLabel, 17462 taxonomy: taxonomySlug 17463 }, 17464 setAttributes, 17465 className, 17466 clientId 17467 }) { 17468 const selectId = (0, import_compose13.useInstanceId)(CategoriesEdit, "blocks-category-select"); 17469 const { records: allTaxonomies, isResolvingTaxonomies } = (0, import_core_data6.useEntityRecords)( 17470 "root", 17471 "taxonomy", 17472 { per_page: -1 } 17473 ); 17474 const taxonomies = allTaxonomies?.filter((t2) => t2.visibility.public); 17475 const taxonomy = taxonomies?.find((t2) => t2.slug === taxonomySlug); 17476 const isHierarchicalTaxonomy = !isResolvingTaxonomies && taxonomy?.hierarchical; 17477 const query = { per_page: -1, hide_empty: !showEmpty, context: "view" }; 17478 if (isHierarchicalTaxonomy && showOnlyTopLevel) { 17479 query.parent = 0; 17480 } 17481 const { records: categories, isResolving } = (0, import_core_data6.useEntityRecords)( 17482 "taxonomy", 17483 taxonomySlug, 17484 query 17485 ); 17486 const { createWarningNotice } = (0, import_data13.useDispatch)(import_notices2.store); 17487 const showRedirectionPreventedNotice = (event) => { 17488 event.preventDefault(); 17489 createWarningNotice((0, import_i18n21.__)("Links are disabled in the editor."), { 17490 id: `block-library/core/categories/redirection-prevented/$clientId}`, 17491 type: "snackbar" 17492 }); 17493 }; 17494 const getCategoriesList = (parentId) => { 17495 if (!categories?.length) { 17496 return []; 17497 } 17498 if (parentId === null) { 17499 return categories; 17500 } 17501 return categories.filter(({ parent }) => parent === parentId); 17502 }; 17503 const toggleAttribute = (attributeName) => (newValue) => setAttributes({ [attributeName]: newValue }); 17504 const renderCategoryName = (name118) => !name118 ? (0, import_i18n21.__)("(Untitled)") : (0, import_html_entities2.decodeEntities)(name118).trim(); 17505 const renderCategoryList = () => { 17506 const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; 17507 const categoriesList = getCategoriesList(parentId); 17508 return categoriesList.map( 17509 (category) => renderCategoryListItem(category) 17510 ); 17511 }; 17512 const renderCategoryListItem = (category) => { 17513 const childCategories = getCategoriesList(category.id); 17514 const { id, link, count, name: name118 } = category; 17515 return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)("li", { className: `cat-item cat-item-$id}`, children: [ 17516 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("a", { href: link, onClick: showRedirectionPreventedNotice, children: renderCategoryName(name118) }), 17517 showPostCounts && ` ($count})`, 17518 isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("ul", { className: "children", children: childCategories.map( 17519 (childCategory) => renderCategoryListItem(childCategory) 17520 ) }) 17521 ] }, id); 17522 }; 17523 const renderCategoryDropdown = () => { 17524 const parentId = isHierarchicalTaxonomy && showHierarchy ? 0 : null; 17525 const categoriesList = getCategoriesList(parentId); 17526 return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(import_jsx_runtime225.Fragment, { children: [ 17527 showLabel ? /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17528 import_block_editor27.RichText, 17529 { 17530 className: "wp-block-categories__label", 17531 "aria-label": (0, import_i18n21.__)("Label text"), 17532 placeholder: taxonomy?.name, 17533 withoutInteractiveFormatting: true, 17534 value: label, 17535 onChange: (html) => setAttributes({ label: html }) 17536 } 17537 ) : ( 17538 // eslint-disable-next-line jsx-a11y/label-has-associated-control 17539 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("label", { htmlFor: selectId }), children: label ? label : taxonomy?.name }) 17540 ), 17541 /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)("select", { id: selectId, children: [ 17542 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("option", { children: (0, import_i18n21.sprintf)( 17543 /* translators: %s: taxonomy's singular name */ 17544 (0, import_i18n21.__)("Select %s"), 17545 taxonomy?.labels?.singular_name 17546 ) }), 17547 categoriesList.map( 17548 (category) => renderCategoryDropdownItem(category, 0) 17549 ) 17550 ] }) 17551 ] }); 17552 }; 17553 const renderCategoryDropdownItem = (category, level) => { 17554 const { id, count, name: name118 } = category; 17555 const childCategories = getCategoriesList(id); 17556 return [ 17557 /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)("option", { className: `level-$level}`, children: [ 17558 Array.from({ length: level * 3 }).map(() => "\xA0"), 17559 renderCategoryName(name118), 17560 showPostCounts && ` ($count})` 17561 ] }, id), 17562 isHierarchicalTaxonomy && showHierarchy && !!childCategories.length && childCategories.map( 17563 (childCategory) => renderCategoryDropdownItem(childCategory, level + 1) 17564 ) 17565 ]; 17566 }; 17567 const TagName2 = !!categories?.length && !displayAsDropdown && !isResolving ? "ul" : "div"; 17568 const classes = clsx_default( 17569 className, 17570 `wp-block-categories-taxonomy-$taxonomySlug}`, 17571 { 17572 "wp-block-categories-list": !!categories?.length && !displayAsDropdown && !isResolving, 17573 "wp-block-categories-dropdown": !!categories?.length && displayAsDropdown && !isResolving 17574 } 17575 ); 17576 const blockProps = (0, import_block_editor27.useBlockProps)({ 17577 className: classes 17578 }); 17579 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 17580 return /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)(TagName2, { ...blockProps, children: [ 17581 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(import_block_editor27.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime225.jsxs)( 17582 import_components11.__experimentalToolsPanel, 17583 { 17584 label: (0, import_i18n21.__)("Settings"), 17585 resetAll: () => { 17586 setAttributes({ 17587 taxonomy: "category", 17588 displayAsDropdown: false, 17589 showHierarchy: false, 17590 showPostCounts: false, 17591 showOnlyTopLevel: false, 17592 showEmpty: false, 17593 showLabel: true 17594 }); 17595 }, 17596 dropdownMenuProps, 17597 children: [ 17598 Array.isArray(taxonomies) && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17599 import_components11.__experimentalToolsPanelItem, 17600 { 17601 hasValue: () => { 17602 return taxonomySlug !== "category"; 17603 }, 17604 label: (0, import_i18n21.__)("Taxonomy"), 17605 onDeselect: () => { 17606 setAttributes({ taxonomy: "category" }); 17607 }, 17608 isShownByDefault: true, 17609 children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17610 import_components11.SelectControl, 17611 { 17612 label: (0, import_i18n21.__)("Taxonomy"), 17613 options: taxonomies.map((t2) => ({ 17614 label: t2.name, 17615 value: t2.slug 17616 })), 17617 value: taxonomySlug, 17618 onChange: (selectedTaxonomy) => setAttributes({ 17619 taxonomy: selectedTaxonomy 17620 }) 17621 } 17622 ) 17623 } 17624 ), 17625 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17626 import_components11.__experimentalToolsPanelItem, 17627 { 17628 hasValue: () => !!displayAsDropdown, 17629 label: (0, import_i18n21.__)("Display as dropdown"), 17630 onDeselect: () => setAttributes({ displayAsDropdown: false }), 17631 isShownByDefault: true, 17632 children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17633 import_components11.ToggleControl, 17634 { 17635 label: (0, import_i18n21.__)("Display as dropdown"), 17636 checked: displayAsDropdown, 17637 onChange: toggleAttribute("displayAsDropdown") 17638 } 17639 ) 17640 } 17641 ), 17642 displayAsDropdown && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17643 import_components11.__experimentalToolsPanelItem, 17644 { 17645 hasValue: () => !showLabel, 17646 label: (0, import_i18n21.__)("Show label"), 17647 onDeselect: () => setAttributes({ showLabel: true }), 17648 isShownByDefault: true, 17649 children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17650 import_components11.ToggleControl, 17651 { 17652 className: "wp-block-categories__indentation", 17653 label: (0, import_i18n21.__)("Show label"), 17654 checked: showLabel, 17655 onChange: toggleAttribute("showLabel") 17656 } 17657 ) 17658 } 17659 ), 17660 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17661 import_components11.__experimentalToolsPanelItem, 17662 { 17663 hasValue: () => !!showPostCounts, 17664 label: (0, import_i18n21.__)("Show post counts"), 17665 onDeselect: () => setAttributes({ showPostCounts: false }), 17666 isShownByDefault: true, 17667 children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17668 import_components11.ToggleControl, 17669 { 17670 label: (0, import_i18n21.__)("Show post counts"), 17671 checked: showPostCounts, 17672 onChange: toggleAttribute("showPostCounts") 17673 } 17674 ) 17675 } 17676 ), 17677 isHierarchicalTaxonomy && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17678 import_components11.__experimentalToolsPanelItem, 17679 { 17680 hasValue: () => !!showOnlyTopLevel, 17681 label: (0, import_i18n21.__)("Show only top level terms"), 17682 onDeselect: () => setAttributes({ showOnlyTopLevel: false }), 17683 isShownByDefault: true, 17684 children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17685 import_components11.ToggleControl, 17686 { 17687 label: (0, import_i18n21.__)("Show only top level terms"), 17688 checked: showOnlyTopLevel, 17689 onChange: toggleAttribute( 17690 "showOnlyTopLevel" 17691 ) 17692 } 17693 ) 17694 } 17695 ), 17696 /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17697 import_components11.__experimentalToolsPanelItem, 17698 { 17699 hasValue: () => !!showEmpty, 17700 label: (0, import_i18n21.__)("Show empty terms"), 17701 onDeselect: () => setAttributes({ showEmpty: false }), 17702 isShownByDefault: true, 17703 children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17704 import_components11.ToggleControl, 17705 { 17706 label: (0, import_i18n21.__)("Show empty terms"), 17707 checked: showEmpty, 17708 onChange: toggleAttribute("showEmpty") 17709 } 17710 ) 17711 } 17712 ), 17713 isHierarchicalTaxonomy && !showOnlyTopLevel && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17714 import_components11.__experimentalToolsPanelItem, 17715 { 17716 hasValue: () => !!showHierarchy, 17717 label: (0, import_i18n21.__)("Show hierarchy"), 17718 onDeselect: () => setAttributes({ showHierarchy: false }), 17719 isShownByDefault: true, 17720 children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)( 17721 import_components11.ToggleControl, 17722 { 17723 label: (0, import_i18n21.__)("Show hierarchy"), 17724 checked: showHierarchy, 17725 onChange: toggleAttribute("showHierarchy") 17726 } 17727 ) 17728 } 17729 ) 17730 ] 17731 } 17732 ) }), 17733 isResolving && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(import_components11.Placeholder, { icon: pin_default, label: (0, import_i18n21.__)("Terms"), children: /* @__PURE__ */ (0, import_jsx_runtime225.jsx)(import_components11.Spinner, {}) }), 17734 !isResolving && categories?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime225.jsx)("p", { children: taxonomy.labels.no_terms }), 17735 !isResolving && categories?.length > 0 && (displayAsDropdown ? renderCategoryDropdown() : renderCategoryList()) 17736 ] }); 17737 } 17738 17739 // packages/block-library/build-module/categories/variations.mjs 17740 var import_i18n22 = __toESM(require_i18n(), 1); 17741 var variations = [ 17742 { 17743 name: "terms", 17744 title: (0, import_i18n22.__)("Terms List"), 17745 icon: category_default, 17746 attributes: { 17747 // We need to set an attribute here that will be set when inserting the block. 17748 // We cannot leave this empty, as that would be interpreted as the default value, 17749 // which is `category` -- for which we're defining a distinct variation below, 17750 // for backwards compatibility reasons. 17751 // The logical fallback is thus the only other built-in and public taxonomy: Tags. 17752 taxonomy: "post_tag" 17753 }, 17754 isActive: (blockAttributes8) => ( 17755 // This variation is used for any taxonomy other than `category`. 17756 blockAttributes8.taxonomy !== "category" 17757 ) 17758 }, 17759 { 17760 name: "categories", 17761 title: (0, import_i18n22.__)("Categories List"), 17762 description: (0, import_i18n22.__)("Display a list of all categories."), 17763 icon: category_default, 17764 attributes: { 17765 taxonomy: "category" 17766 }, 17767 isActive: ["taxonomy"], 17768 // The following is needed to prevent "Terms List" from showing up twice in the inserter 17769 // (once for the block, once for the variation). Fortunately, it does not collide with 17770 // `categories` being the default value of the `taxonomy` attribute. 17771 isDefault: true 17772 } 17773 ]; 17774 var variations_default = variations; 17775 17776 // packages/block-library/build-module/categories/index.mjs 17777 var { name: name12 } = block_default13; 17778 var settings12 = { 17779 icon: category_default, 17780 example: {}, 17781 edit: CategoriesEdit, 17782 variations: variations_default 17783 }; 17784 var init12 = () => initBlock({ name: name12, metadata: block_default13, settings: settings12 }); 17785 17786 // packages/block-library/build-module/freeform/index.mjs 17787 var freeform_exports = {}; 17788 __export(freeform_exports, { 17789 init: () => init13, 17790 metadata: () => block_default14, 17791 name: () => name13, 17792 settings: () => settings13 17793 }); 17794 17795 // packages/block-library/build-module/freeform/edit.mjs 17796 var import_block_editor30 = __toESM(require_block_editor(), 1); 17797 var import_data16 = __toESM(require_data(), 1); 17798 var import_components14 = __toESM(require_components(), 1); 17799 var import_element38 = __toESM(require_element(), 1); 17800 var import_i18n25 = __toESM(require_i18n(), 1); 17801 17802 // packages/block-library/build-module/freeform/convert-to-blocks-button.mjs 17803 var import_i18n23 = __toESM(require_i18n(), 1); 17804 var import_components12 = __toESM(require_components(), 1); 17805 var import_data14 = __toESM(require_data(), 1); 17806 var import_blocks12 = __toESM(require_blocks(), 1); 17807 var import_block_editor28 = __toESM(require_block_editor(), 1); 17808 var import_jsx_runtime226 = __toESM(require_jsx_runtime(), 1); 17809 var ConvertToBlocksButton = ({ clientId }) => { 17810 const { replaceBlocks } = (0, import_data14.useDispatch)(import_block_editor28.store); 17811 const block = (0, import_data14.useSelect)( 17812 (select10) => { 17813 return select10(import_block_editor28.store).getBlock(clientId); 17814 }, 17815 [clientId] 17816 ); 17817 return /* @__PURE__ */ (0, import_jsx_runtime226.jsx)( 17818 import_components12.ToolbarButton, 17819 { 17820 onClick: () => replaceBlocks( 17821 block.clientId, 17822 (0, import_blocks12.rawHandler)({ HTML: (0, import_blocks12.serialize)(block) }) 17823 ), 17824 children: (0, import_i18n23.__)("Convert to blocks") 17825 } 17826 ); 17827 }; 17828 var convert_to_blocks_button_default = ConvertToBlocksButton; 17829 17830 // packages/block-library/build-module/freeform/modal.mjs 17831 var import_block_editor29 = __toESM(require_block_editor(), 1); 17832 var import_components13 = __toESM(require_components(), 1); 17833 var import_element37 = __toESM(require_element(), 1); 17834 var import_i18n24 = __toESM(require_i18n(), 1); 17835 var import_data15 = __toESM(require_data(), 1); 17836 var import_compose14 = __toESM(require_compose(), 1); 17837 var import_jsx_runtime227 = __toESM(require_jsx_runtime(), 1); 17838 function ModalAuxiliaryActions({ onClick, isModalFullScreen }) { 17839 const isMobileViewport = (0, import_compose14.useViewportMatch)("small", "<"); 17840 if (isMobileViewport) { 17841 return null; 17842 } 17843 return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( 17844 import_components13.Button, 17845 { 17846 size: "compact", 17847 onClick, 17848 icon: fullscreen_default, 17849 isPressed: isModalFullScreen, 17850 label: isModalFullScreen ? (0, import_i18n24.__)("Exit fullscreen") : (0, import_i18n24.__)("Enter fullscreen") 17851 } 17852 ); 17853 } 17854 function ClassicEdit(props) { 17855 const styles = (0, import_data15.useSelect)( 17856 (select10) => select10(import_block_editor29.store).getSettings().styles 17857 ); 17858 (0, import_element37.useEffect)(() => { 17859 const { baseURL, suffix, settings: settings117 } = window.wpEditorL10n.tinymce; 17860 window.tinymce.EditorManager.overrideDefaults({ 17861 base_url: baseURL, 17862 suffix 17863 }); 17864 window.wp.oldEditor.initialize(props.id, { 17865 tinymce: { 17866 ...settings117, 17867 setup(editor) { 17868 editor.on("init", () => { 17869 const doc = editor.getDoc(); 17870 styles.forEach(({ css }) => { 17871 const styleEl = doc.createElement("style"); 17872 styleEl.innerHTML = css; 17873 doc.head.appendChild(styleEl); 17874 }); 17875 }); 17876 } 17877 } 17878 }); 17879 return () => { 17880 window.wp.oldEditor.remove(props.id); 17881 }; 17882 }, []); 17883 return /* @__PURE__ */ (0, import_jsx_runtime227.jsx)("textarea", { ...props }); 17884 } 17885 function ModalEdit({ clientId, content, onClose, onChange }) { 17886 const [isModalFullScreen, setIsModalFullScreen] = (0, import_element37.useState)(false); 17887 const id = `editor-$clientId}`; 17888 return /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)( 17889 import_components13.Modal, 17890 { 17891 title: (0, import_i18n24.__)("Classic Editor"), 17892 onRequestClose: onClose, 17893 shouldCloseOnClickOutside: false, 17894 overlayClassName: "block-editor-freeform-modal", 17895 isFullScreen: isModalFullScreen, 17896 className: "block-editor-freeform-modal__content", 17897 headerActions: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( 17898 ModalAuxiliaryActions, 17899 { 17900 onClick: () => setIsModalFullScreen(!isModalFullScreen), 17901 isModalFullScreen 17902 } 17903 ), 17904 children: [ 17905 /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(ClassicEdit, { id, defaultValue: content }), 17906 /* @__PURE__ */ (0, import_jsx_runtime227.jsxs)( 17907 import_components13.Flex, 17908 { 17909 className: "block-editor-freeform-modal__actions", 17910 justify: "flex-end", 17911 expanded: false, 17912 children: [ 17913 /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(import_components13.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( 17914 import_components13.Button, 17915 { 17916 __next40pxDefaultSize: true, 17917 variant: "tertiary", 17918 onClick: onClose, 17919 children: (0, import_i18n24.__)("Cancel") 17920 } 17921 ) }), 17922 /* @__PURE__ */ (0, import_jsx_runtime227.jsx)(import_components13.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime227.jsx)( 17923 import_components13.Button, 17924 { 17925 __next40pxDefaultSize: true, 17926 variant: "primary", 17927 onClick: () => { 17928 onChange(window.wp.oldEditor.getContent(id)); 17929 onClose(); 17930 }, 17931 children: (0, import_i18n24.__)("Save") 17932 } 17933 ) }) 17934 ] 17935 } 17936 ) 17937 ] 17938 } 17939 ); 17940 } 17941 17942 // packages/block-library/build-module/freeform/edit.mjs 17943 var import_jsx_runtime228 = __toESM(require_jsx_runtime(), 1); 17944 function FreeformEdit({ 17945 attributes: attributes2, 17946 setAttributes, 17947 clientId 17948 }) { 17949 const { content } = attributes2; 17950 const [isOpen, setOpen] = (0, import_element38.useState)(false); 17951 const editButtonRef = (0, import_element38.useRef)(null); 17952 const canRemove = (0, import_data16.useSelect)( 17953 (select10) => select10(import_block_editor30.store).canRemoveBlock(clientId), 17954 [clientId] 17955 ); 17956 return /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)(import_jsx_runtime228.Fragment, { children: [ 17957 canRemove && /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(import_block_editor30.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(import_components14.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(convert_to_blocks_button_default, { clientId }) }) }), 17958 /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(import_block_editor30.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(import_components14.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)( 17959 import_components14.ToolbarButton, 17960 { 17961 ref: editButtonRef, 17962 onClick: () => setOpen(true), 17963 children: (0, import_i18n25.__)("Edit") 17964 } 17965 ) }) }), 17966 /* @__PURE__ */ (0, import_jsx_runtime228.jsxs)("div", { ...(0, import_block_editor30.useBlockProps)(), children: [ 17967 content ? /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(import_element38.RawHTML, { children: content }) : /* @__PURE__ */ (0, import_jsx_runtime228.jsx)( 17968 import_components14.Placeholder, 17969 { 17970 icon: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)(import_block_editor30.BlockIcon, { icon: classic_default }), 17971 label: (0, import_i18n25.__)("Classic"), 17972 instructions: (0, import_i18n25.__)( 17973 "Use the classic editor to add content." 17974 ), 17975 children: /* @__PURE__ */ (0, import_jsx_runtime228.jsx)( 17976 import_components14.Button, 17977 { 17978 __next40pxDefaultSize: true, 17979 variant: "primary", 17980 onClick: () => setOpen(true), 17981 children: (0, import_i18n25.__)("Edit contents") 17982 } 17983 ) 17984 } 17985 ), 17986 isOpen && /* @__PURE__ */ (0, import_jsx_runtime228.jsx)( 17987 ModalEdit, 17988 { 17989 clientId, 17990 content, 17991 onClose: () => { 17992 setOpen(false); 17993 if (editButtonRef.current) { 17994 editButtonRef.current.focus(); 17995 } 17996 }, 17997 onChange: (newContent) => setAttributes({ content: newContent }) 17998 } 17999 ) 18000 ] }) 18001 ] }); 18002 } 18003 18004 // packages/block-library/build-module/freeform/block.json 18005 var block_default14 = { 18006 $schema: "https://schemas.wp.org/trunk/block.json", 18007 apiVersion: 3, 18008 name: "core/freeform", 18009 title: "Classic", 18010 category: "text", 18011 description: "Use the classic WordPress editor.", 18012 textdomain: "default", 18013 attributes: { 18014 content: { 18015 type: "string", 18016 source: "raw" 18017 } 18018 }, 18019 supports: { 18020 className: false, 18021 customClassName: false, 18022 lock: false, 18023 reusable: false, 18024 renaming: false, 18025 visibility: false, 18026 customCSS: false 18027 }, 18028 editorStyle: "wp-block-freeform-editor" 18029 }; 18030 18031 // packages/block-library/build-module/freeform/save.mjs 18032 var import_element39 = __toESM(require_element(), 1); 18033 var import_jsx_runtime229 = __toESM(require_jsx_runtime(), 1); 18034 function save8({ attributes: attributes2 }) { 18035 const { content } = attributes2; 18036 return /* @__PURE__ */ (0, import_jsx_runtime229.jsx)(import_element39.RawHTML, { children: content }); 18037 } 18038 18039 // packages/block-library/build-module/freeform/index.mjs 18040 var { name: name13 } = block_default14; 18041 var settings13 = { 18042 icon: classic_default, 18043 edit: FreeformEdit, 18044 save: save8 18045 }; 18046 var init13 = () => initBlock({ name: name13, metadata: block_default14, settings: settings13 }); 18047 18048 // packages/block-library/build-module/code/index.mjs 18049 var code_exports = {}; 18050 __export(code_exports, { 18051 init: () => init14, 18052 metadata: () => block_default15, 18053 name: () => name14, 18054 settings: () => settings14 18055 }); 18056 var import_i18n27 = __toESM(require_i18n(), 1); 18057 var import_blocks15 = __toESM(require_blocks(), 1); 18058 18059 // packages/block-library/build-module/code/edit.mjs 18060 var import_i18n26 = __toESM(require_i18n(), 1); 18061 var import_block_editor31 = __toESM(require_block_editor(), 1); 18062 var import_blocks13 = __toESM(require_blocks(), 1); 18063 var import_jsx_runtime230 = __toESM(require_jsx_runtime(), 1); 18064 function CodeEdit({ 18065 attributes: attributes2, 18066 setAttributes, 18067 onRemove, 18068 insertBlocksAfter, 18069 mergeBlocks 18070 }) { 18071 const blockProps = (0, import_block_editor31.useBlockProps)(); 18072 return /* @__PURE__ */ (0, import_jsx_runtime230.jsx)("pre", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime230.jsx)( 18073 import_block_editor31.RichText, 18074 { 18075 tagName: "code", 18076 identifier: "content", 18077 value: attributes2.content, 18078 onChange: (content) => setAttributes({ content }), 18079 onRemove, 18080 onMerge: mergeBlocks, 18081 placeholder: (0, import_i18n26.__)("Write code\u2026"), 18082 "aria-label": (0, import_i18n26.__)("Code"), 18083 preserveWhiteSpace: true, 18084 __unstablePastePlainText: true, 18085 __unstableOnSplitAtDoubleLineEnd: insertBlocksAfter ? () => insertBlocksAfter( 18086 (0, import_blocks13.createBlock)((0, import_blocks13.getDefaultBlockName)()) 18087 ) : void 0, 18088 style: { whiteSpace: "break-spaces" } 18089 } 18090 ) }); 18091 } 18092 18093 // packages/block-library/build-module/code/block.json 18094 var block_default15 = { 18095 $schema: "https://schemas.wp.org/trunk/block.json", 18096 apiVersion: 3, 18097 name: "core/code", 18098 title: "Code", 18099 category: "text", 18100 description: "Display code snippets that respect your spacing and tabs.", 18101 textdomain: "default", 18102 attributes: { 18103 content: { 18104 type: "rich-text", 18105 source: "rich-text", 18106 selector: "code", 18107 __unstablePreserveWhiteSpace: true, 18108 role: "content" 18109 } 18110 }, 18111 supports: { 18112 align: ["wide"], 18113 anchor: true, 18114 typography: { 18115 fontSize: true, 18116 lineHeight: true, 18117 __experimentalFontFamily: true, 18118 __experimentalFontWeight: true, 18119 __experimentalFontStyle: true, 18120 __experimentalTextTransform: true, 18121 __experimentalTextDecoration: true, 18122 __experimentalLetterSpacing: true, 18123 __experimentalDefaultControls: { 18124 fontSize: true 18125 } 18126 }, 18127 spacing: { 18128 margin: ["top", "bottom"], 18129 padding: true, 18130 __experimentalDefaultControls: { 18131 margin: false, 18132 padding: false 18133 } 18134 }, 18135 __experimentalBorder: { 18136 radius: true, 18137 color: true, 18138 width: true, 18139 style: true, 18140 __experimentalDefaultControls: { 18141 width: true, 18142 color: true 18143 } 18144 }, 18145 color: { 18146 text: true, 18147 background: true, 18148 gradients: true, 18149 __experimentalDefaultControls: { 18150 background: true, 18151 text: true 18152 } 18153 }, 18154 interactivity: { 18155 clientNavigation: true 18156 } 18157 }, 18158 style: "wp-block-code" 18159 }; 18160 18161 // packages/block-library/build-module/code/save.mjs 18162 var import_block_editor32 = __toESM(require_block_editor(), 1); 18163 18164 // packages/block-library/build-module/code/utils.mjs 18165 var import_compose15 = __toESM(require_compose(), 1); 18166 function escape(content) { 18167 return (0, import_compose15.pipe)( 18168 escapeOpeningSquareBrackets, 18169 escapeProtocolInIsolatedUrls 18170 )(content || ""); 18171 } 18172 function escapeOpeningSquareBrackets(content) { 18173 return content.replace(/\[/g, "["); 18174 } 18175 function escapeProtocolInIsolatedUrls(content) { 18176 return content.replace( 18177 /^(\s*https?:)\/\/([^\s<>"]+\s*)$/m, 18178 "$1//$2" 18179 ); 18180 } 18181 18182 // packages/block-library/build-module/code/save.mjs 18183 var import_jsx_runtime231 = __toESM(require_jsx_runtime(), 1); 18184 function save9({ attributes: attributes2 }) { 18185 return /* @__PURE__ */ (0, import_jsx_runtime231.jsx)("pre", { ...import_block_editor32.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime231.jsx)( 18186 import_block_editor32.RichText.Content, 18187 { 18188 tagName: "code", 18189 value: escape( 18190 typeof attributes2.content === "string" ? attributes2.content : attributes2.content.toHTMLString({ 18191 preserveWhiteSpace: true 18192 }) 18193 ) 18194 } 18195 ) }); 18196 } 18197 18198 // packages/block-library/build-module/code/transforms.mjs 18199 var import_blocks14 = __toESM(require_blocks(), 1); 18200 var import_rich_text2 = __toESM(require_rich_text(), 1); 18201 var transforms4 = { 18202 from: [ 18203 { 18204 type: "input", 18205 regExp: /^```$/, 18206 transform: () => (0, import_blocks14.createBlock)("core/code") 18207 }, 18208 { 18209 type: "block", 18210 blocks: ["core/paragraph"], 18211 transform: (attributes2) => { 18212 const { content } = attributes2; 18213 return (0, import_blocks14.createBlock)("core/code", { 18214 ...attributes2, 18215 ...getTransformedAttributes(attributes2, "core/code"), 18216 content 18217 }); 18218 } 18219 }, 18220 { 18221 type: "block", 18222 blocks: ["core/html"], 18223 __experimentalConvert(block) { 18224 const { attributes: attributes2 } = block; 18225 return (0, import_blocks14.createBlock)("core/code", { 18226 ...attributes2, 18227 ...getTransformedAttributes(attributes2, "core/code"), 18228 // The HTML is plain text (with plain line breaks), so 18229 // convert it to rich text. 18230 content: (0, import_rich_text2.toHTMLString)({ 18231 value: (0, import_rich_text2.create)({ text: (0, import_blocks14.getBlockContent)(block) }) 18232 }) 18233 }); 18234 } 18235 }, 18236 { 18237 type: "raw", 18238 isMatch: (node) => node.nodeName === "PRE" && node.children.length === 1 && node.firstChild.nodeName === "CODE", 18239 schema: { 18240 pre: { 18241 children: { 18242 code: { 18243 children: { 18244 "#text": {} 18245 } 18246 } 18247 } 18248 } 18249 } 18250 } 18251 ], 18252 to: [ 18253 { 18254 type: "block", 18255 blocks: ["core/paragraph"], 18256 transform: (attributes2) => { 18257 const { content } = attributes2; 18258 return (0, import_blocks14.createBlock)("core/paragraph", { 18259 ...getTransformedAttributes(attributes2, "core/paragraph"), 18260 content 18261 }); 18262 } 18263 } 18264 ] 18265 }; 18266 var transforms_default4 = transforms4; 18267 18268 // packages/block-library/build-module/code/index.mjs 18269 var { fieldsKey: fieldsKey3, formKey: formKey3 } = unlock(import_blocks15.privateApis); 18270 var { name: name14 } = block_default15; 18271 var settings14 = { 18272 icon: code_default, 18273 example: { 18274 attributes: { 18275 /* eslint-disable @wordpress/i18n-no-collapsible-whitespace */ 18276 // translators: Preserve \n markers for line breaks 18277 content: (0, import_i18n27.__)( 18278 "// A \u201Cblock\u201D is the abstract term used\n// to describe units of markup that\n// when composed together, form the\n// content or layout of a page.\nregisterBlockType( name, settings );" 18279 ) 18280 /* eslint-enable @wordpress/i18n-no-collapsible-whitespace */ 18281 } 18282 }, 18283 merge(attributes2, attributesToMerge) { 18284 return { 18285 content: attributes2.content + "\n\n" + attributesToMerge.content 18286 }; 18287 }, 18288 transforms: transforms_default4, 18289 edit: CodeEdit, 18290 save: save9 18291 }; 18292 if (window.__experimentalContentOnlyInspectorFields) { 18293 settings14[fieldsKey3] = [ 18294 { 18295 id: "content", 18296 label: (0, import_i18n27.__)("Code"), 18297 type: "text", 18298 Edit: "rich-text" 18299 // TODO: replace with custom component 18300 } 18301 ]; 18302 settings14[formKey3] = { 18303 fields: ["content"] 18304 }; 18305 } 18306 var init14 = () => initBlock({ name: name14, metadata: block_default15, settings: settings14 }); 18307 18308 // packages/block-library/build-module/column/index.mjs 18309 var column_exports = {}; 18310 __export(column_exports, { 18311 init: () => init15, 18312 metadata: () => block_default16, 18313 name: () => name15, 18314 settings: () => settings15 18315 }); 18316 18317 // packages/block-library/build-module/column/deprecated.mjs 18318 var import_block_editor33 = __toESM(require_block_editor(), 1); 18319 var import_jsx_runtime232 = __toESM(require_jsx_runtime(), 1); 18320 var deprecated4 = [ 18321 { 18322 attributes: { 18323 verticalAlignment: { 18324 type: "string" 18325 }, 18326 width: { 18327 type: "number", 18328 min: 0, 18329 max: 100 18330 } 18331 }, 18332 isEligible({ width }) { 18333 return isFinite(width); 18334 }, 18335 migrate(attributes2) { 18336 return { 18337 ...attributes2, 18338 width: `$attributes2.width}%` 18339 }; 18340 }, 18341 save({ attributes: attributes2 }) { 18342 const { verticalAlignment, width } = attributes2; 18343 const wrapperClasses = clsx_default({ 18344 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 18345 }); 18346 const style2 = { flexBasis: width + "%" }; 18347 return /* @__PURE__ */ (0, import_jsx_runtime232.jsx)("div", { className: wrapperClasses, style: style2, children: /* @__PURE__ */ (0, import_jsx_runtime232.jsx)(import_block_editor33.InnerBlocks.Content, {}) }); 18348 } 18349 } 18350 ]; 18351 var deprecated_default5 = deprecated4; 18352 18353 // packages/block-library/build-module/column/edit.mjs 18354 var import_block_editor34 = __toESM(require_block_editor(), 1); 18355 var import_components15 = __toESM(require_components(), 1); 18356 var import_data17 = __toESM(require_data(), 1); 18357 var import_i18n28 = __toESM(require_i18n(), 1); 18358 var import_jsx_runtime233 = __toESM(require_jsx_runtime(), 1); 18359 function ColumnInspectorControls({ width, setAttributes }) { 18360 const [availableUnits] = (0, import_block_editor34.useSettings)("spacing.units"); 18361 const units = (0, import_components15.__experimentalUseCustomUnits)({ 18362 availableUnits: availableUnits || ["%", "px", "em", "rem", "vw"] 18363 }); 18364 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 18365 return /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 18366 import_components15.__experimentalToolsPanel, 18367 { 18368 label: (0, import_i18n28.__)("Settings"), 18369 resetAll: () => { 18370 setAttributes({ width: void 0 }); 18371 }, 18372 dropdownMenuProps, 18373 children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 18374 import_components15.__experimentalToolsPanelItem, 18375 { 18376 hasValue: () => width !== void 0, 18377 label: (0, import_i18n28.__)("Width"), 18378 onDeselect: () => setAttributes({ width: void 0 }), 18379 isShownByDefault: true, 18380 children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 18381 import_components15.__experimentalUnitControl, 18382 { 18383 label: (0, import_i18n28.__)("Width"), 18384 __unstableInputWidth: "calc(50% - 8px)", 18385 value: width || "", 18386 onChange: (nextWidth) => { 18387 nextWidth = 0 > parseFloat(nextWidth) ? "0" : nextWidth; 18388 setAttributes({ width: nextWidth }); 18389 }, 18390 units 18391 } 18392 ) 18393 } 18394 ) 18395 } 18396 ); 18397 } 18398 function ColumnEdit({ 18399 attributes: { verticalAlignment, width, templateLock, allowedBlocks }, 18400 setAttributes, 18401 clientId 18402 }) { 18403 const classes = clsx_default("block-core-columns", { 18404 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 18405 }); 18406 const { columnsIds, hasChildBlocks, rootClientId } = (0, import_data17.useSelect)( 18407 (select10) => { 18408 const { getBlockOrder, getBlockRootClientId } = select10(import_block_editor34.store); 18409 const rootId = getBlockRootClientId(clientId); 18410 return { 18411 hasChildBlocks: getBlockOrder(clientId).length > 0, 18412 rootClientId: rootId, 18413 columnsIds: getBlockOrder(rootId) 18414 }; 18415 }, 18416 [clientId] 18417 ); 18418 const { updateBlockAttributes } = (0, import_data17.useDispatch)(import_block_editor34.store); 18419 const updateAlignment = (value) => { 18420 setAttributes({ verticalAlignment: value }); 18421 updateBlockAttributes(rootClientId, { 18422 verticalAlignment: null 18423 }); 18424 }; 18425 const widthWithUnit = Number.isFinite(width) ? width + "%" : width; 18426 const blockProps = (0, import_block_editor34.useBlockProps)({ 18427 className: classes, 18428 style: widthWithUnit ? { flexBasis: widthWithUnit } : void 0 18429 }); 18430 const columnsCount = columnsIds.length; 18431 const currentColumnPosition = columnsIds.indexOf(clientId) + 1; 18432 const label = (0, import_i18n28.sprintf)( 18433 /* translators: 1: Block label (i.e. "Block: Column"), 2: Position of the selected block, 3: Total number of sibling blocks of the same type */ 18434 (0, import_i18n28.__)("%1$s (%2$d of %3$d)"), 18435 blockProps["aria-label"], 18436 currentColumnPosition, 18437 columnsCount 18438 ); 18439 const innerBlocksProps = (0, import_block_editor34.useInnerBlocksProps)( 18440 { ...blockProps, "aria-label": label }, 18441 { 18442 templateLock, 18443 allowedBlocks, 18444 renderAppender: hasChildBlocks ? false : import_block_editor34.InnerBlocks.ButtonBlockAppender 18445 } 18446 ); 18447 return /* @__PURE__ */ (0, import_jsx_runtime233.jsxs)(import_jsx_runtime233.Fragment, { children: [ 18448 /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(import_block_editor34.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 18449 import_block_editor34.BlockVerticalAlignmentToolbar, 18450 { 18451 onChange: updateAlignment, 18452 value: verticalAlignment, 18453 controls: ["top", "center", "bottom", "stretch"] 18454 } 18455 ) }), 18456 /* @__PURE__ */ (0, import_jsx_runtime233.jsx)(import_block_editor34.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime233.jsx)( 18457 ColumnInspectorControls, 18458 { 18459 width, 18460 setAttributes 18461 } 18462 ) }), 18463 /* @__PURE__ */ (0, import_jsx_runtime233.jsx)("div", { ...innerBlocksProps }) 18464 ] }); 18465 } 18466 var edit_default4 = ColumnEdit; 18467 18468 // packages/block-library/build-module/column/block.json 18469 var block_default16 = { 18470 $schema: "https://schemas.wp.org/trunk/block.json", 18471 apiVersion: 3, 18472 name: "core/column", 18473 title: "Column", 18474 category: "design", 18475 parent: ["core/columns"], 18476 description: "A single column within a columns block.", 18477 textdomain: "default", 18478 attributes: { 18479 verticalAlignment: { 18480 type: "string" 18481 }, 18482 width: { 18483 type: "string" 18484 }, 18485 templateLock: { 18486 type: ["string", "boolean"], 18487 enum: ["all", "insert", "contentOnly", false] 18488 } 18489 }, 18490 supports: { 18491 __experimentalOnEnter: true, 18492 anchor: true, 18493 reusable: false, 18494 html: false, 18495 color: { 18496 gradients: true, 18497 heading: true, 18498 button: true, 18499 link: true, 18500 __experimentalDefaultControls: { 18501 background: true, 18502 text: true 18503 } 18504 }, 18505 shadow: true, 18506 spacing: { 18507 blockGap: true, 18508 padding: true, 18509 __experimentalDefaultControls: { 18510 padding: true, 18511 blockGap: true 18512 } 18513 }, 18514 __experimentalBorder: { 18515 color: true, 18516 radius: true, 18517 style: true, 18518 width: true, 18519 __experimentalDefaultControls: { 18520 color: true, 18521 radius: true, 18522 style: true, 18523 width: true 18524 } 18525 }, 18526 typography: { 18527 fontSize: true, 18528 lineHeight: true, 18529 __experimentalFontFamily: true, 18530 __experimentalFontWeight: true, 18531 __experimentalFontStyle: true, 18532 __experimentalTextTransform: true, 18533 __experimentalTextDecoration: true, 18534 __experimentalLetterSpacing: true, 18535 __experimentalDefaultControls: { 18536 fontSize: true 18537 } 18538 }, 18539 layout: true, 18540 interactivity: { 18541 clientNavigation: true 18542 }, 18543 allowedBlocks: true 18544 } 18545 }; 18546 18547 // packages/block-library/build-module/column/save.mjs 18548 var import_block_editor35 = __toESM(require_block_editor(), 1); 18549 var import_jsx_runtime234 = __toESM(require_jsx_runtime(), 1); 18550 function save10({ attributes: attributes2 }) { 18551 const { verticalAlignment, width } = attributes2; 18552 const wrapperClasses = clsx_default({ 18553 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment 18554 }); 18555 let style2; 18556 if (width && /\d/.test(width)) { 18557 let flexBasis = Number.isFinite(width) ? width + "%" : width; 18558 if (!Number.isFinite(width) && width?.endsWith("%")) { 18559 const multiplier = 1e12; 18560 flexBasis = Math.round(Number.parseFloat(width) * multiplier) / multiplier + "%"; 18561 } 18562 style2 = { flexBasis }; 18563 } 18564 const blockProps = import_block_editor35.useBlockProps.save({ 18565 className: wrapperClasses, 18566 style: style2 18567 }); 18568 const innerBlocksProps = import_block_editor35.useInnerBlocksProps.save(blockProps); 18569 return /* @__PURE__ */ (0, import_jsx_runtime234.jsx)("div", { ...innerBlocksProps }); 18570 } 18571 18572 // packages/block-library/build-module/column/index.mjs 18573 var { name: name15 } = block_default16; 18574 var settings15 = { 18575 icon: column_default, 18576 edit: edit_default4, 18577 save: save10, 18578 deprecated: deprecated_default5 18579 }; 18580 var init15 = () => initBlock({ name: name15, metadata: block_default16, settings: settings15 }); 18581 18582 // packages/block-library/build-module/columns/index.mjs 18583 var columns_exports = {}; 18584 __export(columns_exports, { 18585 init: () => init16, 18586 metadata: () => block_default17, 18587 name: () => name16, 18588 settings: () => settings16 18589 }); 18590 var import_i18n31 = __toESM(require_i18n(), 1); 18591 18592 // packages/block-library/build-module/columns/deprecated.mjs 18593 var import_blocks16 = __toESM(require_blocks(), 1); 18594 var import_block_editor36 = __toESM(require_block_editor(), 1); 18595 var import_jsx_runtime235 = __toESM(require_jsx_runtime(), 1); 18596 function getDeprecatedLayoutColumn(originalContent) { 18597 let { doc } = getDeprecatedLayoutColumn; 18598 if (!doc) { 18599 doc = document.implementation.createHTMLDocument(""); 18600 getDeprecatedLayoutColumn.doc = doc; 18601 } 18602 let columnMatch; 18603 doc.body.innerHTML = originalContent; 18604 for (const classListItem of doc.body.firstChild.classList) { 18605 if (columnMatch = classListItem.match(/^layout-column-(\d+)$/)) { 18606 return Number(columnMatch[1]) - 1; 18607 } 18608 } 18609 } 18610 var migrateCustomColors = (attributes2) => { 18611 if (!attributes2.customTextColor && !attributes2.customBackgroundColor) { 18612 return attributes2; 18613 } 18614 const style2 = { color: {} }; 18615 if (attributes2.customTextColor) { 18616 style2.color.text = attributes2.customTextColor; 18617 } 18618 if (attributes2.customBackgroundColor) { 18619 style2.color.background = attributes2.customBackgroundColor; 18620 } 18621 const { customTextColor, customBackgroundColor, ...restAttributes } = attributes2; 18622 return { 18623 ...restAttributes, 18624 style: style2, 18625 isStackedOnMobile: true 18626 }; 18627 }; 18628 var deprecated_default6 = [ 18629 { 18630 attributes: { 18631 verticalAlignment: { 18632 type: "string" 18633 }, 18634 backgroundColor: { 18635 type: "string" 18636 }, 18637 customBackgroundColor: { 18638 type: "string" 18639 }, 18640 customTextColor: { 18641 type: "string" 18642 }, 18643 textColor: { 18644 type: "string" 18645 } 18646 }, 18647 migrate: migrateCustomColors, 18648 save({ attributes: attributes2 }) { 18649 const { 18650 verticalAlignment, 18651 backgroundColor, 18652 customBackgroundColor, 18653 textColor, 18654 customTextColor 18655 } = attributes2; 18656 const backgroundClass = (0, import_block_editor36.getColorClassName)( 18657 "background-color", 18658 backgroundColor 18659 ); 18660 const textClass = (0, import_block_editor36.getColorClassName)("color", textColor); 18661 const className = clsx_default({ 18662 "has-background": backgroundColor || customBackgroundColor, 18663 "has-text-color": textColor || customTextColor, 18664 [backgroundClass]: backgroundClass, 18665 [textClass]: textClass, 18666 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment 18667 }); 18668 const style2 = { 18669 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 18670 color: textClass ? void 0 : customTextColor 18671 }; 18672 return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)( 18673 "div", 18674 { 18675 className: className ? className : void 0, 18676 style: style2, 18677 children: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(import_block_editor36.InnerBlocks.Content, {}) 18678 } 18679 ); 18680 } 18681 }, 18682 { 18683 attributes: { 18684 columns: { 18685 type: "number", 18686 default: 2 18687 } 18688 }, 18689 isEligible(attributes2, innerBlocks) { 18690 const isFastPassEligible = innerBlocks.some( 18691 (innerBlock) => /layout-column-\d+/.test(innerBlock.originalContent) 18692 ); 18693 if (!isFastPassEligible) { 18694 return false; 18695 } 18696 return innerBlocks.some( 18697 (innerBlock) => getDeprecatedLayoutColumn(innerBlock.originalContent) !== void 0 18698 ); 18699 }, 18700 migrate(attributes2, innerBlocks) { 18701 const columns = innerBlocks.reduce((accumulator, innerBlock) => { 18702 const { originalContent } = innerBlock; 18703 let columnIndex = getDeprecatedLayoutColumn(originalContent); 18704 if (columnIndex === void 0) { 18705 columnIndex = 0; 18706 } 18707 if (!accumulator[columnIndex]) { 18708 accumulator[columnIndex] = []; 18709 } 18710 accumulator[columnIndex].push(innerBlock); 18711 return accumulator; 18712 }, []); 18713 const migratedInnerBlocks = columns.map( 18714 (columnBlocks) => (0, import_blocks16.createBlock)("core/column", {}, columnBlocks) 18715 ); 18716 const { columns: ignoredColumns, ...restAttributes } = attributes2; 18717 return [ 18718 { 18719 ...restAttributes, 18720 isStackedOnMobile: true 18721 }, 18722 migratedInnerBlocks 18723 ]; 18724 }, 18725 save({ attributes: attributes2 }) { 18726 const { columns } = attributes2; 18727 return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { className: `has-$columns}-columns`, children: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(import_block_editor36.InnerBlocks.Content, {}) }); 18728 } 18729 }, 18730 { 18731 attributes: { 18732 columns: { 18733 type: "number", 18734 default: 2 18735 } 18736 }, 18737 migrate(attributes2, innerBlocks) { 18738 const { columns, ...restAttributes } = attributes2; 18739 attributes2 = { 18740 ...restAttributes, 18741 isStackedOnMobile: true 18742 }; 18743 return [attributes2, innerBlocks]; 18744 }, 18745 save({ attributes: attributes2 }) { 18746 const { verticalAlignment, columns } = attributes2; 18747 const wrapperClasses = clsx_default(`has-$columns}-columns`, { 18748 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment 18749 }); 18750 return /* @__PURE__ */ (0, import_jsx_runtime235.jsx)("div", { className: wrapperClasses, children: /* @__PURE__ */ (0, import_jsx_runtime235.jsx)(import_block_editor36.InnerBlocks.Content, {}) }); 18751 } 18752 } 18753 ]; 18754 18755 // packages/block-library/build-module/columns/edit.mjs 18756 var import_i18n29 = __toESM(require_i18n(), 1); 18757 var import_components16 = __toESM(require_components(), 1); 18758 var import_block_editor37 = __toESM(require_block_editor(), 1); 18759 var import_data18 = __toESM(require_data(), 1); 18760 var import_blocks17 = __toESM(require_blocks(), 1); 18761 18762 // packages/block-library/build-module/columns/utils.mjs 18763 var toWidthPrecision = (value) => { 18764 const unitlessValue = parseFloat(value); 18765 return Number.isFinite(unitlessValue) ? parseFloat(unitlessValue.toFixed(2)) : void 0; 18766 }; 18767 function getEffectiveColumnWidth(block, totalBlockCount) { 18768 const { width = 100 / totalBlockCount } = block.attributes; 18769 return toWidthPrecision(width); 18770 } 18771 function getTotalColumnsWidth(blocks, totalBlockCount = blocks.length) { 18772 return blocks.reduce( 18773 (sum, block) => sum + getEffectiveColumnWidth(block, totalBlockCount), 18774 0 18775 ); 18776 } 18777 function getColumnWidths(blocks, totalBlockCount = blocks.length) { 18778 return blocks.reduce((accumulator, block) => { 18779 const width = getEffectiveColumnWidth(block, totalBlockCount); 18780 return Object.assign(accumulator, { [block.clientId]: width }); 18781 }, {}); 18782 } 18783 function getRedistributedColumnWidths(blocks, availableWidth, totalBlockCount = blocks.length) { 18784 const totalWidth = getTotalColumnsWidth(blocks, totalBlockCount); 18785 return Object.fromEntries( 18786 Object.entries(getColumnWidths(blocks, totalBlockCount)).map( 18787 ([clientId, width]) => { 18788 const newWidth = availableWidth * width / totalWidth; 18789 return [clientId, toWidthPrecision(newWidth)]; 18790 } 18791 ) 18792 ); 18793 } 18794 function hasExplicitPercentColumnWidths(blocks) { 18795 return blocks.every((block) => { 18796 const blockWidth = block.attributes.width; 18797 return Number.isFinite( 18798 blockWidth?.endsWith?.("%") ? parseFloat(blockWidth) : blockWidth 18799 ); 18800 }); 18801 } 18802 function getMappedColumnWidths(blocks, widths) { 18803 return blocks.map((block) => ({ 18804 ...block, 18805 attributes: { 18806 ...block.attributes, 18807 width: `$widths[block.clientId]}%` 18808 } 18809 })); 18810 } 18811 18812 // packages/block-library/build-module/columns/edit.mjs 18813 var import_jsx_runtime236 = __toESM(require_jsx_runtime(), 1); 18814 var DEFAULT_BLOCK2 = { 18815 name: "core/column" 18816 }; 18817 function ColumnInspectorControls2({ 18818 clientId, 18819 setAttributes, 18820 isStackedOnMobile 18821 }) { 18822 const { count, canInsertColumnBlock, minCount } = (0, import_data18.useSelect)( 18823 (select10) => { 18824 const { canInsertBlockType, canRemoveBlock, getBlockOrder } = select10(import_block_editor37.store); 18825 const blockOrder = getBlockOrder(clientId); 18826 const preventRemovalBlockIndexes = blockOrder.reduce( 18827 (acc, blockId, index) => { 18828 if (!canRemoveBlock(blockId)) { 18829 acc.push(index); 18830 } 18831 return acc; 18832 }, 18833 [] 18834 ); 18835 return { 18836 count: blockOrder.length, 18837 canInsertColumnBlock: canInsertBlockType( 18838 "core/column", 18839 clientId 18840 ), 18841 minCount: Math.max(...preventRemovalBlockIndexes) + 1 18842 }; 18843 }, 18844 [clientId] 18845 ); 18846 const { getBlocks } = (0, import_data18.useSelect)(import_block_editor37.store); 18847 const { replaceInnerBlocks } = (0, import_data18.useDispatch)(import_block_editor37.store); 18848 function updateColumns(previousColumns, newColumns) { 18849 let innerBlocks = getBlocks(clientId); 18850 const hasExplicitWidths = hasExplicitPercentColumnWidths(innerBlocks); 18851 const isAddingColumn = newColumns > previousColumns; 18852 if (isAddingColumn && hasExplicitWidths) { 18853 const newColumnWidth = toWidthPrecision(100 / newColumns); 18854 const newlyAddedColumns = newColumns - previousColumns; 18855 const widths = getRedistributedColumnWidths( 18856 innerBlocks, 18857 100 - newColumnWidth * newlyAddedColumns 18858 ); 18859 innerBlocks = [ 18860 ...getMappedColumnWidths(innerBlocks, widths), 18861 ...Array.from({ 18862 length: newlyAddedColumns 18863 }).map(() => { 18864 return (0, import_blocks17.createBlock)("core/column", { 18865 width: `$newColumnWidth}%` 18866 }); 18867 }) 18868 ]; 18869 } else if (isAddingColumn) { 18870 innerBlocks = [ 18871 ...innerBlocks, 18872 ...Array.from({ 18873 length: newColumns - previousColumns 18874 }).map(() => { 18875 return (0, import_blocks17.createBlock)("core/column"); 18876 }) 18877 ]; 18878 } else if (newColumns < previousColumns) { 18879 innerBlocks = innerBlocks.slice( 18880 0, 18881 -(previousColumns - newColumns) 18882 ); 18883 if (hasExplicitWidths) { 18884 const widths = getRedistributedColumnWidths(innerBlocks, 100); 18885 innerBlocks = getMappedColumnWidths(innerBlocks, widths); 18886 } 18887 } 18888 replaceInnerBlocks(clientId, innerBlocks); 18889 } 18890 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 18891 return /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)( 18892 import_components16.__experimentalToolsPanel, 18893 { 18894 label: (0, import_i18n29.__)("Settings"), 18895 resetAll: () => { 18896 setAttributes({ 18897 isStackedOnMobile: true 18898 }); 18899 }, 18900 dropdownMenuProps, 18901 children: [ 18902 canInsertColumnBlock && /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_components16.__experimentalVStack, { spacing: 4, style: { gridColumn: "1 / -1" }, children: [ 18903 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( 18904 import_components16.RangeControl, 18905 { 18906 label: (0, import_i18n29.__)("Columns"), 18907 value: count, 18908 onChange: (value) => updateColumns(count, Math.max(minCount, value)), 18909 min: Math.max(1, minCount), 18910 max: Math.max(6, count) 18911 } 18912 ), 18913 count > 6 && /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(import_components16.Notice, { status: "warning", isDismissible: false, children: (0, import_i18n29.__)( 18914 "This column count exceeds the recommended amount and may cause visual breakage." 18915 ) }) 18916 ] }), 18917 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( 18918 import_components16.__experimentalToolsPanelItem, 18919 { 18920 label: (0, import_i18n29.__)("Stack on mobile"), 18921 isShownByDefault: true, 18922 hasValue: () => isStackedOnMobile !== true, 18923 onDeselect: () => setAttributes({ 18924 isStackedOnMobile: true 18925 }), 18926 children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( 18927 import_components16.ToggleControl, 18928 { 18929 label: (0, import_i18n29.__)("Stack on mobile"), 18930 checked: isStackedOnMobile, 18931 onChange: () => setAttributes({ 18932 isStackedOnMobile: !isStackedOnMobile 18933 }) 18934 } 18935 ) 18936 } 18937 ) 18938 ] 18939 } 18940 ); 18941 } 18942 function ColumnsEditContainer({ attributes: attributes2, setAttributes, clientId }) { 18943 const { isStackedOnMobile, verticalAlignment, templateLock } = attributes2; 18944 const registry = (0, import_data18.useRegistry)(); 18945 const { getBlockOrder } = (0, import_data18.useSelect)(import_block_editor37.store); 18946 const { updateBlockAttributes } = (0, import_data18.useDispatch)(import_block_editor37.store); 18947 const classes = clsx_default({ 18948 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 18949 [`is-not-stacked-on-mobile`]: !isStackedOnMobile 18950 }); 18951 const blockProps = (0, import_block_editor37.useBlockProps)({ 18952 className: classes 18953 }); 18954 const innerBlocksProps = (0, import_block_editor37.useInnerBlocksProps)(blockProps, { 18955 defaultBlock: DEFAULT_BLOCK2, 18956 directInsert: true, 18957 orientation: "horizontal", 18958 renderAppender: false, 18959 templateLock 18960 }); 18961 function updateAlignment(newVerticalAlignment) { 18962 const innerBlockClientIds = getBlockOrder(clientId); 18963 registry.batch(() => { 18964 setAttributes({ verticalAlignment: newVerticalAlignment }); 18965 updateBlockAttributes(innerBlockClientIds, { 18966 verticalAlignment: newVerticalAlignment 18967 }); 18968 }); 18969 } 18970 return /* @__PURE__ */ (0, import_jsx_runtime236.jsxs)(import_jsx_runtime236.Fragment, { children: [ 18971 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(import_block_editor37.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( 18972 import_block_editor37.BlockVerticalAlignmentToolbar, 18973 { 18974 onChange: updateAlignment, 18975 value: verticalAlignment 18976 } 18977 ) }), 18978 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(import_block_editor37.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( 18979 ColumnInspectorControls2, 18980 { 18981 clientId, 18982 setAttributes, 18983 isStackedOnMobile 18984 } 18985 ) }), 18986 /* @__PURE__ */ (0, import_jsx_runtime236.jsx)("div", { ...innerBlocksProps }) 18987 ] }); 18988 } 18989 function Placeholder4({ clientId, name: name118, setAttributes }) { 18990 const { blockType, variations: variations20 } = (0, import_data18.useSelect)( 18991 (select10) => { 18992 const { getBlockVariations: getBlockVariations4, getBlockType: getBlockType6 } = select10(import_blocks17.store); 18993 return { 18994 blockType: getBlockType6(name118), 18995 variations: getBlockVariations4(name118, "block") 18996 }; 18997 }, 18998 [name118] 18999 ); 19000 const { replaceInnerBlocks } = (0, import_data18.useDispatch)(import_block_editor37.store); 19001 const blockProps = (0, import_block_editor37.useBlockProps)(); 19002 return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime236.jsx)( 19003 import_block_editor37.__experimentalBlockVariationPicker, 19004 { 19005 icon: blockType?.icon?.src, 19006 label: blockType?.title, 19007 variations: variations20, 19008 instructions: (0, import_i18n29.__)("Divide into columns. Select a layout:"), 19009 onSelect: (nextVariation) => { 19010 if (nextVariation.attributes) { 19011 setAttributes(nextVariation.attributes); 19012 } 19013 if (nextVariation.innerBlocks) { 19014 replaceInnerBlocks( 19015 clientId, 19016 (0, import_blocks17.createBlocksFromInnerBlocksTemplate)( 19017 nextVariation.innerBlocks 19018 ), 19019 true 19020 ); 19021 } 19022 } 19023 } 19024 ) }); 19025 } 19026 var ColumnsEdit = (props) => { 19027 const { clientId } = props; 19028 const hasInnerBlocks = (0, import_data18.useSelect)( 19029 (select10) => select10(import_block_editor37.store).getBlocks(clientId).length > 0, 19030 [clientId] 19031 ); 19032 const Component = hasInnerBlocks ? ColumnsEditContainer : Placeholder4; 19033 return /* @__PURE__ */ (0, import_jsx_runtime236.jsx)(Component, { ...props }); 19034 }; 19035 var edit_default5 = ColumnsEdit; 19036 19037 // packages/block-library/build-module/columns/block.json 19038 var block_default17 = { 19039 $schema: "https://schemas.wp.org/trunk/block.json", 19040 apiVersion: 3, 19041 name: "core/columns", 19042 title: "Columns", 19043 category: "design", 19044 allowedBlocks: ["core/column"], 19045 description: "Display content in multiple columns, with blocks added to each column.", 19046 textdomain: "default", 19047 attributes: { 19048 verticalAlignment: { 19049 type: "string" 19050 }, 19051 isStackedOnMobile: { 19052 type: "boolean", 19053 default: true 19054 }, 19055 templateLock: { 19056 type: ["string", "boolean"], 19057 enum: ["all", "insert", "contentOnly", false] 19058 } 19059 }, 19060 supports: { 19061 anchor: true, 19062 align: ["wide", "full"], 19063 html: false, 19064 color: { 19065 gradients: true, 19066 link: true, 19067 heading: true, 19068 button: true, 19069 __experimentalDefaultControls: { 19070 background: true, 19071 text: true 19072 } 19073 }, 19074 spacing: { 19075 blockGap: { 19076 __experimentalDefault: "2em", 19077 sides: ["horizontal", "vertical"] 19078 }, 19079 margin: ["top", "bottom"], 19080 padding: true, 19081 __experimentalDefaultControls: { 19082 padding: true, 19083 blockGap: true 19084 } 19085 }, 19086 layout: { 19087 allowSwitching: false, 19088 allowInheriting: false, 19089 allowEditing: false, 19090 default: { 19091 type: "flex", 19092 flexWrap: "nowrap" 19093 } 19094 }, 19095 __experimentalBorder: { 19096 color: true, 19097 radius: true, 19098 style: true, 19099 width: true, 19100 __experimentalDefaultControls: { 19101 color: true, 19102 radius: true, 19103 style: true, 19104 width: true 19105 } 19106 }, 19107 typography: { 19108 fontSize: true, 19109 lineHeight: true, 19110 __experimentalFontFamily: true, 19111 __experimentalFontWeight: true, 19112 __experimentalFontStyle: true, 19113 __experimentalTextTransform: true, 19114 __experimentalTextDecoration: true, 19115 __experimentalLetterSpacing: true, 19116 __experimentalDefaultControls: { 19117 fontSize: true 19118 } 19119 }, 19120 interactivity: { 19121 clientNavigation: true 19122 }, 19123 shadow: true 19124 }, 19125 editorStyle: "wp-block-columns-editor", 19126 style: "wp-block-columns" 19127 }; 19128 19129 // packages/block-library/build-module/columns/save.mjs 19130 var import_block_editor38 = __toESM(require_block_editor(), 1); 19131 var import_jsx_runtime237 = __toESM(require_jsx_runtime(), 1); 19132 function save11({ attributes: attributes2 }) { 19133 const { isStackedOnMobile, verticalAlignment } = attributes2; 19134 const className = clsx_default({ 19135 [`are-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 19136 [`is-not-stacked-on-mobile`]: !isStackedOnMobile 19137 }); 19138 const blockProps = import_block_editor38.useBlockProps.save({ className }); 19139 const innerBlocksProps = import_block_editor38.useInnerBlocksProps.save(blockProps); 19140 return /* @__PURE__ */ (0, import_jsx_runtime237.jsx)("div", { ...innerBlocksProps }); 19141 } 19142 19143 // packages/block-library/build-module/columns/variations.mjs 19144 var import_components17 = __toESM(require_components(), 1); 19145 var import_i18n30 = __toESM(require_i18n(), 1); 19146 var import_jsx_runtime238 = __toESM(require_jsx_runtime(), 1); 19147 var variations2 = [ 19148 { 19149 name: "one-column-full", 19150 title: (0, import_i18n30.__)("100"), 19151 description: (0, import_i18n30.__)("One column"), 19152 icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)( 19153 import_components17.SVG, 19154 { 19155 xmlns: "http://www.w3.org/2000/svg", 19156 width: "48", 19157 height: "48", 19158 viewBox: "0 0 48 48", 19159 children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_components17.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" }) 19160 } 19161 ), 19162 innerBlocks: [["core/column"]], 19163 scope: ["block"] 19164 }, 19165 { 19166 name: "two-columns-equal", 19167 title: (0, import_i18n30.__)("50 / 50"), 19168 description: (0, import_i18n30.__)("Two columns; equal split"), 19169 icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)( 19170 import_components17.SVG, 19171 { 19172 xmlns: "http://www.w3.org/2000/svg", 19173 width: "48", 19174 height: "48", 19175 viewBox: "0 0 48 48", 19176 children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_components17.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" }) 19177 } 19178 ), 19179 isDefault: true, 19180 innerBlocks: [["core/column"], ["core/column"]], 19181 scope: ["block"] 19182 }, 19183 { 19184 name: "two-columns-one-third-two-thirds", 19185 title: (0, import_i18n30.__)("33 / 66"), 19186 description: (0, import_i18n30.__)("Two columns; one-third, two-thirds split"), 19187 icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)( 19188 import_components17.SVG, 19189 { 19190 xmlns: "http://www.w3.org/2000/svg", 19191 width: "48", 19192 height: "48", 19193 viewBox: "0 0 48 48", 19194 children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_components17.Path, { d: "M0 10a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm17 0a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H19a2 2 0 0 1-2-2V10Z" }) 19195 } 19196 ), 19197 innerBlocks: [ 19198 ["core/column", { width: "33.33%" }], 19199 ["core/column", { width: "66.66%" }] 19200 ], 19201 scope: ["block"] 19202 }, 19203 { 19204 name: "two-columns-two-thirds-one-third", 19205 title: (0, import_i18n30.__)("66 / 33"), 19206 description: (0, import_i18n30.__)("Two columns; two-thirds, one-third split"), 19207 icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)( 19208 import_components17.SVG, 19209 { 19210 xmlns: "http://www.w3.org/2000/svg", 19211 width: "48", 19212 height: "48", 19213 viewBox: "0 0 48 48", 19214 children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_components17.Path, { d: "M0 10a2 2 0 0 1 2-2h27a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm33 0a2 2 0 0 1 2-2h11a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35a2 2 0 0 1-2-2V10Z" }) 19215 } 19216 ), 19217 innerBlocks: [ 19218 ["core/column", { width: "66.66%" }], 19219 ["core/column", { width: "33.33%" }] 19220 ], 19221 scope: ["block"] 19222 }, 19223 { 19224 name: "three-columns-equal", 19225 title: (0, import_i18n30.__)("33 / 33 / 33"), 19226 description: (0, import_i18n30.__)("Three columns; equal split"), 19227 icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)( 19228 import_components17.SVG, 19229 { 19230 xmlns: "http://www.w3.org/2000/svg", 19231 width: "48", 19232 height: "48", 19233 viewBox: "0 0 48 48", 19234 children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_components17.Path, { d: "M0 10a2 2 0 0 1 2-2h10.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm16.5 0c0-1.105.864-2 1.969-2H29.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H18.47c-1.105 0-1.969-.895-1.969-2V10Zm17 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H35.469c-1.105 0-1.969-.895-1.969-2V10Z" }) 19235 } 19236 ), 19237 innerBlocks: [ 19238 ["core/column"], 19239 ["core/column"], 19240 ["core/column"] 19241 ], 19242 scope: ["block"] 19243 }, 19244 { 19245 name: "three-columns-wider-center", 19246 title: (0, import_i18n30.__)("25 / 50 / 25"), 19247 description: (0, import_i18n30.__)("Three columns; wide center column"), 19248 icon: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)( 19249 import_components17.SVG, 19250 { 19251 xmlns: "http://www.w3.org/2000/svg", 19252 width: "48", 19253 height: "48", 19254 viewBox: "0 0 48 48", 19255 children: /* @__PURE__ */ (0, import_jsx_runtime238.jsx)(import_components17.Path, { d: "M0 10a2 2 0 0 1 2-2h7.531c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H2a2 2 0 0 1-2-2V10Zm13.5 0c0-1.105.864-2 1.969-2H32.53c1.105 0 1.969.895 1.969 2v28c0 1.105-.864 2-1.969 2H15.47c-1.105 0-1.969-.895-1.969-2V10Zm23 0c0-1.105.864-2 1.969-2H46a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2h-7.531c-1.105 0-1.969-.895-1.969-2V10Z" }) 19256 } 19257 ), 19258 innerBlocks: [ 19259 ["core/column", { width: "25%" }], 19260 ["core/column", { width: "50%" }], 19261 ["core/column", { width: "25%" }] 19262 ], 19263 scope: ["block"] 19264 } 19265 ]; 19266 var variations_default2 = variations2; 19267 19268 // packages/block-library/build-module/columns/transforms.mjs 19269 var import_blocks18 = __toESM(require_blocks(), 1); 19270 var MAXIMUM_SELECTED_BLOCKS = 6; 19271 var COLUMN_VERTICAL_ALIGNMENTS = ["top", "center", "bottom"]; 19272 var ROW_VERTICAL_ALIGNMENTS = [...COLUMN_VERTICAL_ALIGNMENTS, "stretch"]; 19273 var FLEX_SIZE_LAYOUT_VALUES = ["fixed", "fixedNoShrink"]; 19274 var DEFAULT_COLUMN_LAYOUT = { type: "default" }; 19275 var getObjectValue = (value) => value && typeof value === "object" && !Array.isArray(value) ? value : {}; 19276 var getGroupAttributes = (attributes2) => { 19277 const groupAttributeDefinitions = (0, import_blocks18.getBlockType)("core/group")?.attributes; 19278 if (!groupAttributeDefinitions) { 19279 return {}; 19280 } 19281 const normalizedAttributes = getObjectValue(attributes2); 19282 return Object.fromEntries( 19283 Object.entries(normalizedAttributes).filter( 19284 ([name118]) => Object.hasOwn(groupAttributeDefinitions, name118) 19285 ) 19286 ); 19287 }; 19288 var getColumnWidth = (width) => { 19289 if (Number.isFinite(width)) { 19290 return `$width}%`; 19291 } 19292 if (typeof width === "string" && /\d/.test(width)) { 19293 return width; 19294 } 19295 return void 0; 19296 }; 19297 var getColumnBlocksFromGrid = (innerBlocks, columnCount) => { 19298 const columnWidth = +(100 / columnCount).toFixed(2); 19299 const innerBlocksTemplate = Array.from( 19300 { length: columnCount }, 19301 (_2, columnIndex) => [ 19302 "core/column", 19303 { width: `$columnWidth}%` }, 19304 innerBlocks.filter( 19305 (_innerBlock, blockIndex) => blockIndex % columnCount === columnIndex 19306 ) 19307 ] 19308 ); 19309 return (0, import_blocks18.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate); 19310 }; 19311 var getColumnBlocksFromRow = (innerBlocks) => innerBlocks.map((innerBlock) => { 19312 const style2 = getObjectValue(innerBlock?.attributes?.style); 19313 const { selfStretch, flexSize, ...remainingLayout } = getObjectValue( 19314 style2.layout 19315 ); 19316 const columnWidth = FLEX_SIZE_LAYOUT_VALUES.includes(selfStretch) ? getColumnWidth(flexSize) : void 0; 19317 const updatedStyle = { ...style2 }; 19318 if (Object.keys(remainingLayout).length) { 19319 updatedStyle.layout = remainingLayout; 19320 } else { 19321 delete updatedStyle.layout; 19322 } 19323 const columnInnerBlock = (0, import_blocks18.cloneSanitizedBlock)(innerBlock, { 19324 style: Object.keys(updatedStyle).length ? updatedStyle : void 0 19325 }); 19326 return (0, import_blocks18.createBlock)( 19327 "core/column", 19328 columnWidth ? { width: columnWidth } : {}, 19329 [columnInnerBlock] 19330 ); 19331 }); 19332 var getGridInnerBlocks = (innerBlocks) => innerBlocks.flatMap((column) => { 19333 const columnInnerBlocks = column.innerBlocks || []; 19334 const { 19335 layout: layoutAttribute, 19336 style: styleAttribute, 19337 ...groupAttributes 19338 } = getGroupAttributes(column?.attributes); 19339 const columnStyle = getObjectValue(styleAttribute); 19340 const columnLayout = getObjectValue(layoutAttribute); 19341 const hasGroupAttributes = Object.keys(groupAttributes).length > 0; 19342 const hasColumnStyle = Object.keys(columnStyle).length > 0; 19343 const hasColumnLayout = Object.keys(columnLayout).length > 0; 19344 if (columnInnerBlocks.length > 1 || hasGroupAttributes || hasColumnStyle || hasColumnLayout) { 19345 return [ 19346 (0, import_blocks18.createBlock)( 19347 "core/group", 19348 { 19349 ...groupAttributes, 19350 layout: hasColumnLayout ? columnLayout : DEFAULT_COLUMN_LAYOUT, 19351 ...hasColumnStyle && { 19352 style: columnStyle 19353 } 19354 }, 19355 columnInnerBlocks 19356 ) 19357 ]; 19358 } 19359 return columnInnerBlocks; 19360 }); 19361 var getRowInnerBlocks = (innerBlocks) => { 19362 const columnWidths = innerBlocks.map((column) => { 19363 return getColumnWidth(column?.attributes?.width); 19364 }); 19365 const allColumnWidthsUnavailable = columnWidths.every( 19366 (columnWidth) => !columnWidth 19367 ); 19368 const equalColumnWidth = innerBlocks.length ? `${+(100 / innerBlocks.length).toFixed(2)}%` : void 0; 19369 return innerBlocks.map((column, index) => { 19370 const columnInnerBlocks = Array.isArray(column?.innerBlocks) ? column.innerBlocks : []; 19371 const columnWidth = columnWidths[index] || (allColumnWidthsUnavailable ? equalColumnWidth : void 0); 19372 const childLayout = columnWidth ? { selfStretch: "fixed", flexSize: columnWidth } : { selfStretch: "fill" }; 19373 const { 19374 layout: layoutAttribute, 19375 style: styleAttribute, 19376 ...groupAttributes 19377 } = getGroupAttributes(column?.attributes); 19378 const columnStyle = getObjectValue(styleAttribute); 19379 const columnLayout = getObjectValue(layoutAttribute); 19380 const hasGroupAttributes = Object.keys(groupAttributes).length > 0; 19381 const hasColumnStyle = Object.keys(columnStyle).length > 0; 19382 const hasColumnLayout = Object.keys(columnLayout).length > 0; 19383 if (columnInnerBlocks.length === 1 && !hasGroupAttributes && !hasColumnStyle && !hasColumnLayout) { 19384 const innerBlock = columnInnerBlocks[0]; 19385 const style2 = getObjectValue(innerBlock.attributes?.style); 19386 const layout = getObjectValue(style2.layout); 19387 const updatedLayout = { ...layout, ...childLayout }; 19388 if (!columnWidth) { 19389 delete updatedLayout.flexSize; 19390 } 19391 return (0, import_blocks18.cloneSanitizedBlock)(innerBlock, { 19392 style: { 19393 ...style2, 19394 layout: updatedLayout 19395 } 19396 }); 19397 } 19398 return (0, import_blocks18.createBlock)( 19399 "core/group", 19400 { 19401 ...groupAttributes, 19402 layout: hasColumnLayout ? columnLayout : DEFAULT_COLUMN_LAYOUT, 19403 style: { 19404 ...columnStyle, 19405 layout: { 19406 ...getObjectValue(columnStyle.layout), 19407 ...childLayout 19408 } 19409 } 19410 }, 19411 columnInnerBlocks 19412 ); 19413 }); 19414 }; 19415 var transforms5 = { 19416 from: [ 19417 { 19418 type: "block", 19419 blocks: ["core/group"], 19420 priority: 1, 19421 transform: (attributes2, innerBlocks) => { 19422 const { layout, ...rest } = attributes2; 19423 const { columnCount } = layout; 19424 return (0, import_blocks18.createBlock)( 19425 "core/columns", 19426 rest, 19427 getColumnBlocksFromGrid(innerBlocks, columnCount) 19428 ); 19429 }, 19430 isMatch: ({ layout }) => layout?.type === "grid" && Number.isInteger(layout?.columnCount) && layout.columnCount > 0 19431 }, 19432 { 19433 type: "block", 19434 blocks: ["core/group"], 19435 priority: 1, 19436 transform: (attributes2, innerBlocks) => { 19437 const { layout, ...rest } = attributes2; 19438 const verticalAlignment = COLUMN_VERTICAL_ALIGNMENTS.includes( 19439 layout?.verticalAlignment 19440 ) ? layout.verticalAlignment : void 0; 19441 return (0, import_blocks18.createBlock)( 19442 "core/columns", 19443 { ...rest, verticalAlignment }, 19444 getColumnBlocksFromRow(innerBlocks) 19445 ); 19446 }, 19447 isMatch: ({ layout }) => layout?.type === "flex" && layout?.orientation !== "vertical" 19448 }, 19449 { 19450 type: "block", 19451 isMultiBlock: true, 19452 blocks: ["*"], 19453 __experimentalConvert: (blocks) => { 19454 const columnWidth = +(100 / blocks.length).toFixed(2); 19455 const innerBlocksTemplate = blocks.map( 19456 ({ name: name118, attributes: attributes2, innerBlocks, innerContent }) => [ 19457 "core/column", 19458 { width: `$columnWidth}%` }, 19459 [ 19460 [ 19461 name118, 19462 { ...attributes2 }, 19463 innerBlocks, 19464 innerContent 19465 ] 19466 ] 19467 ] 19468 ); 19469 return (0, import_blocks18.createBlock)( 19470 "core/columns", 19471 {}, 19472 (0, import_blocks18.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate) 19473 ); 19474 }, 19475 isMatch: ({ length: selectedBlocksLength }, blocks) => { 19476 if (blocks.length === 1 && blocks[0].name === "core/columns") { 19477 return false; 19478 } 19479 return selectedBlocksLength && selectedBlocksLength <= MAXIMUM_SELECTED_BLOCKS; 19480 } 19481 }, 19482 { 19483 type: "block", 19484 blocks: ["core/media-text"], 19485 priority: 1, 19486 transform: (attributes2, innerBlocks) => { 19487 const { 19488 align, 19489 backgroundColor, 19490 textColor, 19491 style: style2, 19492 mediaAlt: alt, 19493 mediaId: id, 19494 mediaPosition: mediaPosition3, 19495 mediaSizeSlug: sizeSlug, 19496 mediaType, 19497 mediaUrl: url, 19498 mediaWidth, 19499 verticalAlignment 19500 } = attributes2; 19501 let media; 19502 if (mediaType === "image" || !mediaType) { 19503 const imageAttrs = { id, alt, url, sizeSlug }; 19504 const linkAttrs = { 19505 href: attributes2.href, 19506 linkClass: attributes2.linkClass, 19507 linkDestination: attributes2.linkDestination, 19508 linkTarget: attributes2.linkTarget, 19509 rel: attributes2.rel 19510 }; 19511 media = ["core/image", { ...imageAttrs, ...linkAttrs }]; 19512 } else { 19513 media = ["core/video", { id, src: url }]; 19514 } 19515 const innerBlocksTemplate = [ 19516 ["core/column", { width: `$mediaWidth}%` }, [media]], 19517 [ 19518 "core/column", 19519 { width: `$100 - mediaWidth}%` }, 19520 innerBlocks 19521 ] 19522 ]; 19523 if (mediaPosition3 === "right") { 19524 innerBlocksTemplate.reverse(); 19525 } 19526 return (0, import_blocks18.createBlock)( 19527 "core/columns", 19528 { 19529 align, 19530 backgroundColor, 19531 textColor, 19532 style: style2, 19533 verticalAlignment 19534 }, 19535 (0, import_blocks18.createBlocksFromInnerBlocksTemplate)(innerBlocksTemplate) 19536 ); 19537 } 19538 } 19539 ], 19540 to: [ 19541 { 19542 type: "block", 19543 blocks: ["core/group"], 19544 variationName: "group-row", 19545 transform: (attributes2, innerBlocks) => { 19546 const { verticalAlignment } = attributes2; 19547 const rowVerticalAlignment = ROW_VERTICAL_ALIGNMENTS.includes( 19548 verticalAlignment 19549 ) ? verticalAlignment : "stretch"; 19550 return (0, import_blocks18.createBlock)( 19551 "core/group", 19552 { 19553 ...attributes2, 19554 isStackedOnMobile: void 0, 19555 verticalAlignment: void 0, 19556 layout: { 19557 type: "flex", 19558 flexWrap: "nowrap", 19559 verticalAlignment: rowVerticalAlignment 19560 } 19561 }, 19562 getRowInnerBlocks(innerBlocks) 19563 ); 19564 } 19565 }, 19566 { 19567 type: "block", 19568 blocks: ["core/group"], 19569 variationName: "group-grid", 19570 transform: (attributes2, innerBlocks) => { 19571 const columnCount = innerBlocks.length; 19572 return (0, import_blocks18.createBlock)( 19573 "core/group", 19574 { 19575 ...attributes2, 19576 isStackedOnMobile: void 0, 19577 verticalAlignment: void 0, 19578 layout: { 19579 type: "grid", 19580 ...columnCount && { columnCount } 19581 } 19582 }, 19583 getGridInnerBlocks(innerBlocks) 19584 ); 19585 } 19586 } 19587 ], 19588 ungroup: (attributes2, innerBlocks) => innerBlocks.flatMap((innerBlock) => innerBlock.innerBlocks) 19589 }; 19590 var transforms_default5 = transforms5; 19591 19592 // packages/block-library/build-module/columns/index.mjs 19593 var { name: name16 } = block_default17; 19594 var settings16 = { 19595 icon: columns_default, 19596 variations: variations_default2, 19597 example: { 19598 viewportWidth: 782, 19599 // Columns collapse "@media (max-width: 781px)". 19600 innerBlocks: [ 19601 { 19602 name: "core/column", 19603 innerBlocks: [ 19604 { 19605 name: "core/paragraph", 19606 attributes: { 19607 /* translators: example text. */ 19608 content: (0, import_i18n31.__)( 19609 "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent et eros eu felis." 19610 ) 19611 } 19612 }, 19613 { 19614 name: "core/image", 19615 attributes: { 19616 url: "https://s.w.org/images/core/5.3/Windbuchencom.jpg" 19617 } 19618 }, 19619 { 19620 name: "core/paragraph", 19621 attributes: { 19622 /* translators: example text. */ 19623 content: (0, import_i18n31.__)( 19624 "Suspendisse commodo neque lacus, a dictum orci interdum et." 19625 ) 19626 } 19627 } 19628 ] 19629 }, 19630 { 19631 name: "core/column", 19632 innerBlocks: [ 19633 { 19634 name: "core/paragraph", 19635 attributes: { 19636 /* translators: example text. */ 19637 content: (0, import_i18n31.__)( 19638 "Etiam et egestas lorem. Vivamus sagittis sit amet dolor quis lobortis. Integer sed fermentum arcu, id vulputate lacus. Etiam fermentum sem eu quam hendrerit." 19639 ) 19640 } 19641 }, 19642 { 19643 name: "core/paragraph", 19644 attributes: { 19645 /* translators: example text. */ 19646 content: (0, import_i18n31.__)( 19647 "Nam risus massa, ullamcorper consectetur eros fermentum, porta aliquet ligula. Sed vel mauris nec enim." 19648 ) 19649 } 19650 } 19651 ] 19652 } 19653 ] 19654 }, 19655 deprecated: deprecated_default6, 19656 edit: edit_default5, 19657 save: save11, 19658 transforms: transforms_default5 19659 }; 19660 var init16 = () => initBlock({ name: name16, metadata: block_default17, settings: settings16 }); 19661 19662 // packages/block-library/build-module/comments/index.mjs 19663 var comments_exports = {}; 19664 __export(comments_exports, { 19665 init: () => init17, 19666 metadata: () => block_default18, 19667 name: () => name17, 19668 settings: () => settings17 19669 }); 19670 19671 // packages/block-library/build-module/comments/block.json 19672 var block_default18 = { 19673 $schema: "https://schemas.wp.org/trunk/block.json", 19674 apiVersion: 3, 19675 name: "core/comments", 19676 title: "Comments", 19677 category: "theme", 19678 description: "An advanced block that allows displaying post comments using different visual configurations.", 19679 textdomain: "default", 19680 attributes: { 19681 tagName: { 19682 type: "string", 19683 default: "div" 19684 }, 19685 legacy: { 19686 type: "boolean", 19687 default: false 19688 } 19689 }, 19690 supports: { 19691 anchor: true, 19692 align: ["wide", "full"], 19693 html: false, 19694 color: { 19695 gradients: true, 19696 heading: true, 19697 link: true, 19698 __experimentalDefaultControls: { 19699 background: true, 19700 text: true, 19701 link: true 19702 } 19703 }, 19704 spacing: { 19705 margin: true, 19706 padding: true 19707 }, 19708 typography: { 19709 fontSize: true, 19710 lineHeight: true, 19711 __experimentalFontFamily: true, 19712 __experimentalFontWeight: true, 19713 __experimentalFontStyle: true, 19714 __experimentalTextTransform: true, 19715 __experimentalTextDecoration: true, 19716 __experimentalLetterSpacing: true, 19717 __experimentalDefaultControls: { 19718 fontSize: true 19719 } 19720 }, 19721 __experimentalBorder: { 19722 radius: true, 19723 color: true, 19724 width: true, 19725 style: true, 19726 __experimentalDefaultControls: { 19727 radius: true, 19728 color: true, 19729 width: true, 19730 style: true 19731 } 19732 } 19733 }, 19734 editorStyle: "wp-block-comments-editor", 19735 usesContext: ["postId", "postType"] 19736 }; 19737 19738 // packages/block-library/build-module/comments/deprecated.mjs 19739 var import_block_editor39 = __toESM(require_block_editor(), 1); 19740 var import_jsx_runtime239 = __toESM(require_jsx_runtime(), 1); 19741 var v15 = { 19742 attributes: { 19743 tagName: { 19744 type: "string", 19745 default: "div" 19746 } 19747 }, 19748 apiVersion: 3, 19749 supports: { 19750 align: ["wide", "full"], 19751 html: false, 19752 color: { 19753 gradients: true, 19754 link: true, 19755 __experimentalDefaultControls: { 19756 background: true, 19757 text: true, 19758 link: true 19759 } 19760 } 19761 }, 19762 save({ attributes: { tagName: Tag } }) { 19763 const blockProps = import_block_editor39.useBlockProps.save(); 19764 const { className } = blockProps; 19765 const classes = className?.split(" ") || []; 19766 const newClasses = classes?.filter( 19767 (cls) => cls !== "wp-block-comments" 19768 ); 19769 const newBlockProps = { 19770 ...blockProps, 19771 className: newClasses.join(" ") 19772 }; 19773 return /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(Tag, { ...newBlockProps, children: /* @__PURE__ */ (0, import_jsx_runtime239.jsx)(import_block_editor39.InnerBlocks.Content, {}) }); 19774 } 19775 }; 19776 var deprecated_default7 = [v15]; 19777 19778 // packages/block-library/build-module/comments/edit/index.mjs 19779 var import_block_editor44 = __toESM(require_block_editor(), 1); 19780 19781 // packages/block-library/build-module/comments/edit/comments-inspector-controls.mjs 19782 var import_i18n32 = __toESM(require_i18n(), 1); 19783 var import_block_editor40 = __toESM(require_block_editor(), 1); 19784 var import_jsx_runtime240 = __toESM(require_jsx_runtime(), 1); 19785 var { HTMLElementControl: HTMLElementControl2 } = unlock(import_block_editor40.privateApis); 19786 function CommentsInspectorControls({ 19787 attributes: { tagName }, 19788 setAttributes 19789 }) { 19790 return /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(import_block_editor40.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)(import_block_editor40.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime240.jsx)( 19791 HTMLElementControl2, 19792 { 19793 tagName, 19794 onChange: (value) => setAttributes({ tagName: value }), 19795 options: [ 19796 { label: (0, import_i18n32.__)("Default (<div>)"), value: "div" }, 19797 { label: "<section>", value: "section" }, 19798 { label: "<aside>", value: "aside" } 19799 ] 19800 } 19801 ) }) }); 19802 } 19803 19804 // packages/block-library/build-module/comments/edit/comments-legacy.mjs 19805 var import_block_editor43 = __toESM(require_block_editor(), 1); 19806 var import_i18n35 = __toESM(require_i18n(), 1); 19807 var import_components19 = __toESM(require_components(), 1); 19808 19809 // packages/block-library/build-module/comments/edit/placeholder.mjs 19810 var import_block_editor42 = __toESM(require_block_editor(), 1); 19811 var import_i18n34 = __toESM(require_i18n(), 1); 19812 var import_data20 = __toESM(require_data(), 1); 19813 var import_core_data8 = __toESM(require_core_data(), 1); 19814 var import_element40 = __toESM(require_element(), 1); 19815 19816 // packages/block-library/build-module/post-comments-form/form.mjs 19817 var import_i18n33 = __toESM(require_i18n(), 1); 19818 var import_block_editor41 = __toESM(require_block_editor(), 1); 19819 var import_components18 = __toESM(require_components(), 1); 19820 var import_compose16 = __toESM(require_compose(), 1); 19821 var import_core_data7 = __toESM(require_core_data(), 1); 19822 var import_data19 = __toESM(require_data(), 1); 19823 var import_jsx_runtime241 = __toESM(require_jsx_runtime(), 1); 19824 var CommentsFormPlaceholder = () => { 19825 const instanceId = (0, import_compose16.useInstanceId)(CommentsFormPlaceholder); 19826 return /* @__PURE__ */ (0, import_jsx_runtime241.jsxs)("div", { className: "comment-respond", children: [ 19827 /* @__PURE__ */ (0, import_jsx_runtime241.jsx)("h3", { className: "comment-reply-title", children: (0, import_i18n33.__)("Leave a Reply") }), 19828 /* @__PURE__ */ (0, import_jsx_runtime241.jsxs)( 19829 "form", 19830 { 19831 noValidate: true, 19832 className: "comment-form", 19833 onSubmit: (event) => event.preventDefault(), 19834 children: [ 19835 /* @__PURE__ */ (0, import_jsx_runtime241.jsxs)("p", { children: [ 19836 /* @__PURE__ */ (0, import_jsx_runtime241.jsx)("label", { htmlFor: `comment-$instanceId}`, children: (0, import_i18n33.__)("Comment") }), 19837 /* @__PURE__ */ (0, import_jsx_runtime241.jsx)( 19838 "textarea", 19839 { 19840 id: `comment-$instanceId}`, 19841 name: "comment", 19842 cols: "45", 19843 rows: "8", 19844 readOnly: true 19845 } 19846 ) 19847 ] }), 19848 /* @__PURE__ */ (0, import_jsx_runtime241.jsx)("p", { className: "form-submit wp-block-button", children: /* @__PURE__ */ (0, import_jsx_runtime241.jsx)( 19849 "input", 19850 { 19851 name: "submit", 19852 type: "submit", 19853 className: clsx_default( 19854 "wp-block-button__link", 19855 (0, import_block_editor41.__experimentalGetElementClassName)("button") 19856 ), 19857 label: (0, import_i18n33.__)("Post Comment"), 19858 value: (0, import_i18n33.__)("Post Comment"), 19859 "aria-disabled": "true" 19860 } 19861 ) }) 19862 ] 19863 } 19864 ) 19865 ] }); 19866 }; 19867 var CommentsForm = ({ postId, postType }) => { 19868 const [commentStatus, setCommentStatus] = (0, import_core_data7.useEntityProp)( 19869 "postType", 19870 postType, 19871 "comment_status", 19872 postId 19873 ); 19874 const isSiteEditor = postType === void 0 || postId === void 0; 19875 const defaultCommentStatus = (0, import_data19.useSelect)( 19876 (select10) => select10(import_block_editor41.store).getSettings().__experimentalDiscussionSettings?.defaultCommentStatus, 19877 [] 19878 ); 19879 const postTypeSupportsComments = (0, import_data19.useSelect)( 19880 (select10) => postType ? !!select10(import_core_data7.store).getPostType(postType)?.supports.comments : false 19881 ); 19882 if (!isSiteEditor && "open" !== commentStatus) { 19883 if ("closed" === commentStatus) { 19884 const actions = [ 19885 /* @__PURE__ */ (0, import_jsx_runtime241.jsx)( 19886 import_components18.Button, 19887 { 19888 __next40pxDefaultSize: true, 19889 onClick: () => setCommentStatus("open"), 19890 variant: "primary", 19891 children: (0, import_i18n33._x)( 19892 "Enable comments", 19893 "action that affects the current post" 19894 ) 19895 }, 19896 "enableComments" 19897 ) 19898 ]; 19899 return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(import_block_editor41.Warning, { actions, children: (0, import_i18n33.__)( 19900 "Post Comments Form block: Comments are not enabled for this item." 19901 ) }); 19902 } else if (!postTypeSupportsComments) { 19903 return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(import_block_editor41.Warning, { children: (0, import_i18n33.sprintf)( 19904 /* translators: %s: Post type (i.e. "post", "page") */ 19905 (0, import_i18n33.__)( 19906 "Post Comments Form block: Comments are not enabled for this post type (%s)." 19907 ), 19908 postType 19909 ) }); 19910 } else if ("open" !== defaultCommentStatus) { 19911 return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(import_block_editor41.Warning, { children: (0, import_i18n33.__)( 19912 "Post Comments Form block: Comments are not enabled." 19913 ) }); 19914 } 19915 } 19916 return /* @__PURE__ */ (0, import_jsx_runtime241.jsx)(CommentsFormPlaceholder, {}); 19917 }; 19918 var form_default = CommentsForm; 19919 19920 // packages/block-library/build-module/comments/edit/placeholder.mjs 19921 var import_jsx_runtime242 = __toESM(require_jsx_runtime(), 1); 19922 function PostCommentsPlaceholder({ postType, postId }) { 19923 let [postTitle] = (0, import_core_data8.useEntityProp)("postType", postType, "title", postId); 19924 postTitle = postTitle || (0, import_i18n34.__)("Post Title"); 19925 const avatarURL = (0, import_data20.useSelect)( 19926 (select10) => select10(import_block_editor42.store).getSettings().__experimentalDiscussionSettings?.avatarURL, 19927 [] 19928 ); 19929 return /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("div", { className: "wp-block-comments__legacy-placeholder", inert: "true", children: [ 19930 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("h3", { 19931 /* translators: %s: Post title. */ 19932 children: (0, import_i18n34.sprintf)((0, import_i18n34.__)("One response to %s"), postTitle) 19933 }), 19934 /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("div", { className: "navigation", children: [ 19935 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("div", { className: "alignleft", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("a", { href: "#top", children: [ 19936 "\xAB ", 19937 (0, import_i18n34.__)("Older Comments") 19938 ] }) }), 19939 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("div", { className: "alignright", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("a", { href: "#top", children: [ 19940 (0, import_i18n34.__)("Newer Comments"), 19941 " \xBB" 19942 ] }) }) 19943 ] }), 19944 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("ol", { className: "commentlist", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("li", { className: "comment even thread-even depth-1", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("article", { className: "comment-body", children: [ 19945 /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("footer", { className: "comment-meta", children: [ 19946 /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("div", { className: "comment-author vcard", children: [ 19947 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)( 19948 "img", 19949 { 19950 alt: (0, import_i18n34.__)("Commenter Avatar"), 19951 src: avatarURL, 19952 className: "avatar avatar-32 photo", 19953 height: "32", 19954 width: "32", 19955 loading: "lazy" 19956 } 19957 ), 19958 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("b", { className: "fn", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("a", { href: "#top", className: "url", children: (0, import_i18n34.__)("A WordPress Commenter") }) }), 19959 " ", 19960 /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("span", { className: "says", children: [ 19961 (0, import_i18n34.__)("says"), 19962 ":" 19963 ] }) 19964 ] }), 19965 /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("div", { className: "comment-metadata", children: [ 19966 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("a", { href: "#top", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("time", { dateTime: "2000-01-01T00:00:00+00:00", children: (0, import_i18n34.__)("January 1, 2000 at 00:00 am") }) }), 19967 " ", 19968 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("span", { className: "edit-link", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)( 19969 "a", 19970 { 19971 className: "comment-edit-link", 19972 href: "#top", 19973 children: (0, import_i18n34.__)("Edit") 19974 } 19975 ) }) 19976 ] }) 19977 ] }), 19978 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("div", { className: "comment-content", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("p", { children: [ 19979 (0, import_i18n34.__)("Hi, this is a comment."), 19980 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("br", {}), 19981 (0, import_i18n34.__)( 19982 "To get started with moderating, editing, and deleting comments, please visit the Comments screen in the dashboard." 19983 ), 19984 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("br", {}), 19985 (0, import_element40.createInterpolateElement)( 19986 (0, import_i18n34.__)( 19987 "Commenter avatars come from <a>Gravatar</a>." 19988 ), 19989 { 19990 a: ( 19991 // eslint-disable-next-line jsx-a11y/anchor-has-content 19992 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("a", { href: "https://gravatar.com/" }) 19993 ) 19994 } 19995 ) 19996 ] }) }), 19997 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("div", { className: "reply", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsx)( 19998 "a", 19999 { 20000 className: "comment-reply-link", 20001 href: "#top", 20002 "aria-label": (0, import_i18n34.__)( 20003 "Reply to A WordPress Commenter" 20004 ), 20005 /* translators: Comment reply button text. */ 20006 children: (0, import_i18n34._x)("Reply", "verb") 20007 } 20008 ) }) 20009 ] }) }) }), 20010 /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("div", { className: "navigation", children: [ 20011 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("div", { className: "alignleft", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("a", { href: "#top", children: [ 20012 "\xAB ", 20013 (0, import_i18n34.__)("Older Comments") 20014 ] }) }), 20015 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)("div", { className: "alignright", children: /* @__PURE__ */ (0, import_jsx_runtime242.jsxs)("a", { href: "#top", children: [ 20016 (0, import_i18n34.__)("Newer Comments"), 20017 " \xBB" 20018 ] }) }) 20019 ] }), 20020 /* @__PURE__ */ (0, import_jsx_runtime242.jsx)(form_default, { postId, postType }) 20021 ] }); 20022 } 20023 20024 // packages/block-library/build-module/comments/edit/comments-legacy.mjs 20025 var import_jsx_runtime243 = __toESM(require_jsx_runtime(), 1); 20026 function CommentsLegacy({ 20027 attributes: attributes2, 20028 setAttributes, 20029 context: { postType, postId } 20030 }) { 20031 const { textAlign } = attributes2; 20032 const actions = [ 20033 /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 20034 import_components19.Button, 20035 { 20036 __next40pxDefaultSize: true, 20037 onClick: () => void setAttributes({ legacy: false }), 20038 variant: "primary", 20039 children: (0, import_i18n35.__)("Switch to editable mode") 20040 }, 20041 "convert" 20042 ) 20043 ]; 20044 const blockProps = (0, import_block_editor43.useBlockProps)({ 20045 className: clsx_default({ 20046 [`has-text-align-$textAlign}`]: textAlign 20047 }) 20048 }); 20049 return /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)(import_jsx_runtime243.Fragment, { children: [ 20050 /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_block_editor43.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime243.jsx)( 20051 import_block_editor43.AlignmentControl, 20052 { 20053 value: textAlign, 20054 onChange: (nextAlign) => { 20055 setAttributes({ textAlign: nextAlign }); 20056 } 20057 } 20058 ) }), 20059 /* @__PURE__ */ (0, import_jsx_runtime243.jsxs)("div", { ...blockProps, children: [ 20060 /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(import_block_editor43.Warning, { actions, children: (0, import_i18n35.__)( 20061 "Comments block: You\u2019re currently using the legacy version of the block. The following is just a placeholder - the final styling will likely look different. For a better representation and more customization options, switch the block to its editable mode." 20062 ) }), 20063 /* @__PURE__ */ (0, import_jsx_runtime243.jsx)(PostCommentsPlaceholder, { postId, postType }) 20064 ] }) 20065 ] }); 20066 } 20067 20068 // packages/block-library/build-module/comments/edit/index.mjs 20069 var import_jsx_runtime244 = __toESM(require_jsx_runtime(), 1); 20070 function CommentsEdit(props) { 20071 const { attributes: attributes2, setAttributes, clientId } = props; 20072 const { tagName: TagName2, legacy } = attributes2; 20073 const blockProps = (0, import_block_editor44.useBlockProps)(); 20074 const innerBlocksProps = (0, import_block_editor44.useInnerBlocksProps)(blockProps); 20075 if (legacy) { 20076 return /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(CommentsLegacy, { ...props }); 20077 } 20078 return /* @__PURE__ */ (0, import_jsx_runtime244.jsxs)(import_jsx_runtime244.Fragment, { children: [ 20079 /* @__PURE__ */ (0, import_jsx_runtime244.jsx)( 20080 CommentsInspectorControls, 20081 { 20082 attributes: attributes2, 20083 setAttributes, 20084 clientId 20085 } 20086 ), 20087 /* @__PURE__ */ (0, import_jsx_runtime244.jsx)(TagName2, { ...innerBlocksProps }) 20088 ] }); 20089 } 20090 20091 // packages/block-library/build-module/comments/save.mjs 20092 var import_block_editor45 = __toESM(require_block_editor(), 1); 20093 var import_jsx_runtime245 = __toESM(require_jsx_runtime(), 1); 20094 function save12({ attributes: { tagName: Tag, legacy } }) { 20095 const blockProps = import_block_editor45.useBlockProps.save(); 20096 const innerBlocksProps = import_block_editor45.useInnerBlocksProps.save(blockProps); 20097 return legacy ? null : /* @__PURE__ */ (0, import_jsx_runtime245.jsx)(Tag, { ...innerBlocksProps }); 20098 } 20099 20100 // packages/block-library/build-module/comments/edit/template.mjs 20101 var TEMPLATE5 = [ 20102 ["core/comments-title"], 20103 [ 20104 "core/comment-template", 20105 {}, 20106 [ 20107 [ 20108 "core/columns", 20109 {}, 20110 [ 20111 [ 20112 "core/column", 20113 { width: "40px" }, 20114 [ 20115 [ 20116 "core/avatar", 20117 { 20118 size: 40, 20119 style: { 20120 border: { radius: "20px" } 20121 } 20122 } 20123 ] 20124 ] 20125 ], 20126 [ 20127 "core/column", 20128 {}, 20129 [ 20130 [ 20131 "core/comment-author-name", 20132 { 20133 fontSize: "small" 20134 } 20135 ], 20136 [ 20137 "core/group", 20138 { 20139 layout: { type: "flex" }, 20140 style: { 20141 spacing: { 20142 margin: { 20143 top: "0px", 20144 bottom: "0px" 20145 } 20146 } 20147 } 20148 }, 20149 [ 20150 [ 20151 "core/comment-date", 20152 { 20153 fontSize: "small" 20154 } 20155 ], 20156 [ 20157 "core/comment-edit-link", 20158 { 20159 fontSize: "small" 20160 } 20161 ] 20162 ] 20163 ], 20164 ["core/comment-content"], 20165 [ 20166 "core/comment-reply-link", 20167 { 20168 fontSize: "small" 20169 } 20170 ] 20171 ] 20172 ] 20173 ] 20174 ] 20175 ] 20176 ], 20177 ["core/comments-pagination"], 20178 ["core/post-comments-form"] 20179 ]; 20180 var template_default = TEMPLATE5; 20181 20182 // packages/block-library/build-module/comments/index.mjs 20183 var { name: name17 } = block_default18; 20184 var settings17 = { 20185 icon: post_comments_default, 20186 example: {}, 20187 template: template_default, 20188 edit: CommentsEdit, 20189 save: save12, 20190 deprecated: deprecated_default7 20191 }; 20192 var init17 = () => initBlock({ name: name17, metadata: block_default18, settings: settings17 }); 20193 20194 // packages/block-library/build-module/comment-author-avatar/index.mjs 20195 var comment_author_avatar_exports = {}; 20196 __export(comment_author_avatar_exports, { 20197 init: () => init18, 20198 metadata: () => block_default19, 20199 name: () => name18, 20200 settings: () => settings18 20201 }); 20202 20203 // packages/block-library/build-module/comment-author-avatar/block.json 20204 var block_default19 = { 20205 $schema: "https://schemas.wp.org/trunk/block.json", 20206 apiVersion: 3, 20207 __experimental: "fse", 20208 name: "core/comment-author-avatar", 20209 title: "Comment Author Avatar (deprecated)", 20210 category: "theme", 20211 ancestor: ["core/comment-template"], 20212 description: "This block is deprecated. Please use the Avatar block instead.", 20213 textdomain: "default", 20214 attributes: { 20215 width: { 20216 type: "number", 20217 default: 96 20218 }, 20219 height: { 20220 type: "number", 20221 default: 96 20222 } 20223 }, 20224 usesContext: ["commentId"], 20225 supports: { 20226 html: false, 20227 inserter: false, 20228 __experimentalBorder: { 20229 radius: true, 20230 width: true, 20231 color: true, 20232 style: true 20233 }, 20234 color: { 20235 background: true, 20236 text: false, 20237 __experimentalDefaultControls: { 20238 background: true 20239 } 20240 }, 20241 spacing: { 20242 __experimentalSkipSerialization: true, 20243 margin: true, 20244 padding: true 20245 }, 20246 interactivity: { 20247 clientNavigation: true 20248 } 20249 } 20250 }; 20251 20252 // packages/block-library/build-module/comment-author-avatar/edit.mjs 20253 var import_block_editor46 = __toESM(require_block_editor(), 1); 20254 var import_components20 = __toESM(require_components(), 1); 20255 var import_core_data9 = __toESM(require_core_data(), 1); 20256 var import_data21 = __toESM(require_data(), 1); 20257 var import_i18n36 = __toESM(require_i18n(), 1); 20258 var import_jsx_runtime246 = __toESM(require_jsx_runtime(), 1); 20259 function Edit6({ 20260 attributes: attributes2, 20261 context: { commentId }, 20262 setAttributes, 20263 isSelected 20264 }) { 20265 const { height, width } = attributes2; 20266 const [avatars] = (0, import_core_data9.useEntityProp)( 20267 "root", 20268 "comment", 20269 "author_avatar_urls", 20270 commentId 20271 ); 20272 const [authorName] = (0, import_core_data9.useEntityProp)( 20273 "root", 20274 "comment", 20275 "author_name", 20276 commentId 20277 ); 20278 const avatarUrls = avatars ? Object.values(avatars) : null; 20279 const sizes = avatars ? Object.keys(avatars) : null; 20280 const minSize = sizes ? sizes[0] : 24; 20281 const maxSize = sizes ? sizes[sizes.length - 1] : 96; 20282 const blockProps = (0, import_block_editor46.useBlockProps)(); 20283 const spacingProps = (0, import_block_editor46.__experimentalGetSpacingClassesAndStyles)(attributes2); 20284 const maxSizeBuffer = Math.floor(maxSize * 2.5); 20285 const avatarURL = (0, import_data21.useSelect)((select10) => { 20286 const { __experimentalDiscussionSettings } = select10(import_block_editor46.store).getSettings(); 20287 return __experimentalDiscussionSettings?.avatarURL; 20288 }, []); 20289 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(import_block_editor46.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)(import_components20.PanelBody, { title: (0, import_i18n36.__)("Settings"), children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 20290 import_components20.RangeControl, 20291 { 20292 label: (0, import_i18n36.__)("Image size"), 20293 onChange: (newWidth) => setAttributes({ 20294 width: newWidth, 20295 height: newWidth 20296 }), 20297 min: minSize, 20298 max: maxSizeBuffer, 20299 initialPosition: width, 20300 value: width 20301 } 20302 ) }) }); 20303 const resizableAvatar = /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 20304 import_components20.ResizableBox, 20305 { 20306 size: { 20307 width, 20308 height 20309 }, 20310 showHandle: isSelected, 20311 onResizeStop: (event, direction, elt, delta) => { 20312 setAttributes({ 20313 height: parseInt(height + delta.height, 10), 20314 width: parseInt(width + delta.width, 10) 20315 }); 20316 }, 20317 lockAspectRatio: true, 20318 enable: { 20319 top: false, 20320 right: !(0, import_i18n36.isRTL)(), 20321 bottom: true, 20322 left: (0, import_i18n36.isRTL)() 20323 }, 20324 minWidth: minSize, 20325 maxWidth: maxSizeBuffer, 20326 children: /* @__PURE__ */ (0, import_jsx_runtime246.jsx)( 20327 "img", 20328 { 20329 src: avatarUrls ? avatarUrls[avatarUrls.length - 1] : avatarURL, 20330 alt: `$authorName} ${(0, import_i18n36.__)("Avatar")}`, 20331 ...blockProps 20332 } 20333 ) 20334 } 20335 ); 20336 return /* @__PURE__ */ (0, import_jsx_runtime246.jsxs)(import_jsx_runtime246.Fragment, { children: [ 20337 inspectorControls, 20338 /* @__PURE__ */ (0, import_jsx_runtime246.jsx)("div", { ...spacingProps, children: resizableAvatar }) 20339 ] }); 20340 } 20341 20342 // packages/block-library/build-module/comment-author-avatar/index.mjs 20343 var { name: name18 } = block_default19; 20344 var settings18 = { 20345 icon: comment_author_avatar_default, 20346 edit: Edit6 20347 }; 20348 var init18 = () => initBlock({ name: name18, metadata: block_default19, settings: settings18 }); 20349 20350 // packages/block-library/build-module/comment-author-name/index.mjs 20351 var comment_author_name_exports = {}; 20352 __export(comment_author_name_exports, { 20353 init: () => init19, 20354 metadata: () => block_default20, 20355 name: () => name19, 20356 settings: () => settings19 20357 }); 20358 20359 // packages/block-library/build-module/comment-author-name/block.json 20360 var block_default20 = { 20361 $schema: "https://schemas.wp.org/trunk/block.json", 20362 apiVersion: 3, 20363 name: "core/comment-author-name", 20364 title: "Comment Author Name", 20365 category: "theme", 20366 ancestor: ["core/comment-template"], 20367 description: "Displays the name of the author of the comment.", 20368 textdomain: "default", 20369 attributes: { 20370 isLink: { 20371 type: "boolean", 20372 default: true 20373 }, 20374 linkTarget: { 20375 type: "string", 20376 default: "_self" 20377 } 20378 }, 20379 usesContext: ["commentId"], 20380 supports: { 20381 anchor: true, 20382 html: false, 20383 spacing: { 20384 margin: true, 20385 padding: true 20386 }, 20387 color: { 20388 gradients: true, 20389 link: true, 20390 __experimentalDefaultControls: { 20391 background: true, 20392 text: true, 20393 link: true 20394 } 20395 }, 20396 typography: { 20397 fontSize: true, 20398 lineHeight: true, 20399 textAlign: true, 20400 __experimentalFontFamily: true, 20401 __experimentalFontWeight: true, 20402 __experimentalFontStyle: true, 20403 __experimentalTextTransform: true, 20404 __experimentalTextDecoration: true, 20405 __experimentalLetterSpacing: true, 20406 __experimentalDefaultControls: { 20407 fontSize: true 20408 } 20409 }, 20410 interactivity: { 20411 clientNavigation: true 20412 }, 20413 __experimentalBorder: { 20414 radius: true, 20415 color: true, 20416 width: true, 20417 style: true, 20418 __experimentalDefaultControls: { 20419 radius: true, 20420 color: true, 20421 width: true, 20422 style: true 20423 } 20424 } 20425 }, 20426 style: "wp-block-comment-author-name" 20427 }; 20428 20429 // packages/block-library/build-module/comment-author-name/edit.mjs 20430 var import_i18n37 = __toESM(require_i18n(), 1); 20431 var import_data22 = __toESM(require_data(), 1); 20432 var import_block_editor47 = __toESM(require_block_editor(), 1); 20433 var import_core_data10 = __toESM(require_core_data(), 1); 20434 var import_components21 = __toESM(require_components(), 1); 20435 var import_jsx_runtime247 = __toESM(require_jsx_runtime(), 1); 20436 function Edit7(props) { 20437 const { 20438 attributes: { isLink, linkTarget }, 20439 context: { commentId }, 20440 setAttributes 20441 } = props; 20442 useDeprecatedTextAlign(props); 20443 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 20444 const blockProps = (0, import_block_editor47.useBlockProps)(); 20445 let displayName = (0, import_data22.useSelect)( 20446 (select10) => { 20447 const { getEntityRecord } = select10(import_core_data10.store); 20448 const comment = getEntityRecord("root", "comment", commentId); 20449 const authorName = comment?.author_name; 20450 if (comment && !authorName) { 20451 const user = getEntityRecord("root", "user", comment.author); 20452 return user?.name ?? (0, import_i18n37.__)("Anonymous"); 20453 } 20454 return authorName ?? ""; 20455 }, 20456 [commentId] 20457 ); 20458 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime247.jsx)(import_block_editor47.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)( 20459 import_components21.__experimentalToolsPanel, 20460 { 20461 label: (0, import_i18n37.__)("Settings"), 20462 resetAll: () => { 20463 setAttributes({ 20464 isLink: true, 20465 linkTarget: "_self" 20466 }); 20467 }, 20468 dropdownMenuProps, 20469 children: [ 20470 /* @__PURE__ */ (0, import_jsx_runtime247.jsx)( 20471 import_components21.__experimentalToolsPanelItem, 20472 { 20473 label: (0, import_i18n37.__)("Link to authors URL"), 20474 isShownByDefault: true, 20475 hasValue: () => !isLink, 20476 onDeselect: () => setAttributes({ 20477 isLink: true 20478 }), 20479 children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)( 20480 import_components21.ToggleControl, 20481 { 20482 label: (0, import_i18n37.__)("Link to authors URL"), 20483 onChange: () => setAttributes({ isLink: !isLink }), 20484 checked: isLink 20485 } 20486 ) 20487 } 20488 ), 20489 isLink && /* @__PURE__ */ (0, import_jsx_runtime247.jsx)( 20490 import_components21.__experimentalToolsPanelItem, 20491 { 20492 label: (0, import_i18n37.__)("Open in new tab"), 20493 isShownByDefault: true, 20494 hasValue: () => linkTarget !== "_self", 20495 onDeselect: () => setAttributes({ 20496 linkTarget: "_self" 20497 }), 20498 children: /* @__PURE__ */ (0, import_jsx_runtime247.jsx)( 20499 import_components21.ToggleControl, 20500 { 20501 label: (0, import_i18n37.__)("Open in new tab"), 20502 onChange: (value) => setAttributes({ 20503 linkTarget: value ? "_blank" : "_self" 20504 }), 20505 checked: linkTarget === "_blank" 20506 } 20507 ) 20508 } 20509 ) 20510 ] 20511 } 20512 ) }); 20513 if (!commentId || !displayName) { 20514 displayName = (0, import_i18n37._x)("Comment Author", "block title"); 20515 } 20516 const displayAuthor = isLink ? /* @__PURE__ */ (0, import_jsx_runtime247.jsx)( 20517 "a", 20518 { 20519 href: "#comment-author-pseudo-link", 20520 onClick: (event) => event.preventDefault(), 20521 children: displayName 20522 } 20523 ) : displayName; 20524 return /* @__PURE__ */ (0, import_jsx_runtime247.jsxs)(import_jsx_runtime247.Fragment, { children: [ 20525 inspectorControls, 20526 /* @__PURE__ */ (0, import_jsx_runtime247.jsx)("div", { ...blockProps, children: displayAuthor }) 20527 ] }); 20528 } 20529 20530 // packages/block-library/build-module/comment-author-name/deprecated.mjs 20531 var v22 = { 20532 attributes: { 20533 isLink: { 20534 type: "boolean", 20535 default: true 20536 }, 20537 linkTarget: { 20538 type: "string", 20539 default: "_self" 20540 }, 20541 textAlign: { 20542 type: "string" 20543 } 20544 }, 20545 usesContext: ["commentId"], 20546 supports: { 20547 html: false, 20548 spacing: { 20549 margin: true, 20550 padding: true 20551 }, 20552 color: { 20553 gradients: true, 20554 link: true 20555 }, 20556 typography: { 20557 fontSize: true, 20558 lineHeight: true, 20559 __experimentalFontFamily: true, 20560 __experimentalFontWeight: true, 20561 __experimentalFontStyle: true, 20562 __experimentalTextTransform: true, 20563 __experimentalTextDecoration: true, 20564 __experimentalLetterSpacing: true 20565 }, 20566 interactivity: { 20567 clientNavigation: true 20568 }, 20569 __experimentalBorder: { 20570 radius: true, 20571 color: true, 20572 width: true, 20573 style: true 20574 } 20575 }, 20576 save() { 20577 return null; 20578 }, 20579 migrate: migrate_text_align_default, 20580 isEligible(attributes2) { 20581 return !!attributes2.textAlign || !!attributes2.className?.match( 20582 /\bhas-text-align-(left|center|right)\b/ 20583 ); 20584 } 20585 }; 20586 var v16 = { 20587 attributes: { 20588 isLink: { 20589 type: "boolean", 20590 default: false 20591 }, 20592 linkTarget: { 20593 type: "string", 20594 default: "_self" 20595 } 20596 }, 20597 supports: { 20598 html: false, 20599 color: { 20600 gradients: true, 20601 link: true 20602 }, 20603 typography: { 20604 fontSize: true, 20605 lineHeight: true, 20606 __experimentalFontFamily: true, 20607 __experimentalFontWeight: true, 20608 __experimentalFontStyle: true, 20609 __experimentalTextTransform: true, 20610 __experimentalLetterSpacing: true 20611 } 20612 }, 20613 save() { 20614 return null; 20615 }, 20616 migrate: migrate_font_family_default, 20617 isEligible({ style: style2 }) { 20618 return style2?.typography?.fontFamily; 20619 } 20620 }; 20621 var deprecated_default8 = [v22, v16]; 20622 20623 // packages/block-library/build-module/comment-author-name/index.mjs 20624 var { name: name19 } = block_default20; 20625 var settings19 = { 20626 icon: comment_author_name_default, 20627 edit: Edit7, 20628 deprecated: deprecated_default8, 20629 example: {} 20630 }; 20631 var init19 = () => initBlock({ name: name19, metadata: block_default20, settings: settings19 }); 20632 20633 // packages/block-library/build-module/comment-content/index.mjs 20634 var comment_content_exports = {}; 20635 __export(comment_content_exports, { 20636 init: () => init20, 20637 metadata: () => block_default21, 20638 name: () => name20, 20639 settings: () => settings20 20640 }); 20641 20642 // packages/block-library/build-module/comment-content/block.json 20643 var block_default21 = { 20644 $schema: "https://schemas.wp.org/trunk/block.json", 20645 apiVersion: 3, 20646 name: "core/comment-content", 20647 title: "Comment Content", 20648 category: "theme", 20649 ancestor: ["core/comment-template"], 20650 description: "Displays the contents of a comment.", 20651 textdomain: "default", 20652 usesContext: ["commentId"], 20653 supports: { 20654 anchor: true, 20655 color: { 20656 gradients: true, 20657 link: true, 20658 __experimentalDefaultControls: { 20659 background: true, 20660 text: true 20661 } 20662 }, 20663 typography: { 20664 fontSize: true, 20665 lineHeight: true, 20666 textAlign: true, 20667 __experimentalFontFamily: true, 20668 __experimentalFontWeight: true, 20669 __experimentalFontStyle: true, 20670 __experimentalTextTransform: true, 20671 __experimentalTextDecoration: true, 20672 __experimentalLetterSpacing: true, 20673 __experimentalDefaultControls: { 20674 fontSize: true 20675 } 20676 }, 20677 __experimentalBorder: { 20678 radius: true, 20679 color: true, 20680 width: true, 20681 style: true, 20682 __experimentalDefaultControls: { 20683 radius: true, 20684 color: true, 20685 width: true, 20686 style: true 20687 } 20688 }, 20689 spacing: { 20690 padding: ["horizontal", "vertical"], 20691 __experimentalDefaultControls: { 20692 padding: true 20693 } 20694 }, 20695 html: false 20696 }, 20697 style: "wp-block-comment-content" 20698 }; 20699 20700 // packages/block-library/build-module/comment-content/edit.mjs 20701 var import_i18n38 = __toESM(require_i18n(), 1); 20702 var import_element41 = __toESM(require_element(), 1); 20703 var import_components22 = __toESM(require_components(), 1); 20704 var import_core_data11 = __toESM(require_core_data(), 1); 20705 var import_block_editor48 = __toESM(require_block_editor(), 1); 20706 var import_jsx_runtime248 = __toESM(require_jsx_runtime(), 1); 20707 function Edit8(props) { 20708 const { 20709 context: { commentId } 20710 } = props; 20711 useDeprecatedTextAlign(props); 20712 const blockProps = (0, import_block_editor48.useBlockProps)(); 20713 const [content] = (0, import_core_data11.useEntityProp)( 20714 "root", 20715 "comment", 20716 "content", 20717 commentId 20718 ); 20719 if (!commentId || !content) { 20720 return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_jsx_runtime248.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("p", { children: (0, import_i18n38._x)("Comment Content", "block title") }) }) }); 20721 } 20722 return /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_jsx_runtime248.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_components22.Disabled, { children: /* @__PURE__ */ (0, import_jsx_runtime248.jsx)(import_element41.RawHTML, { children: content.rendered }, "html") }) }) }); 20723 } 20724 20725 // packages/block-library/build-module/comment-content/deprecated.mjs 20726 var v17 = { 20727 attributes: { 20728 textAlign: { 20729 type: "string" 20730 } 20731 }, 20732 usesContext: ["commentId"], 20733 supports: { 20734 anchor: true, 20735 color: { 20736 gradients: true, 20737 link: true 20738 }, 20739 typography: { 20740 fontSize: true, 20741 lineHeight: true, 20742 __experimentalFontFamily: true, 20743 __experimentalFontWeight: true, 20744 __experimentalFontStyle: true, 20745 __experimentalTextTransform: true, 20746 __experimentalTextDecoration: true, 20747 __experimentalLetterSpacing: true 20748 }, 20749 __experimentalBorder: { 20750 radius: true, 20751 color: true, 20752 width: true, 20753 style: true 20754 }, 20755 spacing: { 20756 padding: ["horizontal", "vertical"] 20757 }, 20758 html: false 20759 }, 20760 save() { 20761 return null; 20762 }, 20763 migrate: migrate_text_align_default, 20764 isEligible(attributes2) { 20765 return !!attributes2.textAlign || !!attributes2.className?.match( 20766 /\bhas-text-align-(left|center|right)\b/ 20767 ); 20768 } 20769 }; 20770 var deprecated_default9 = [v17]; 20771 20772 // packages/block-library/build-module/comment-content/index.mjs 20773 var { name: name20 } = block_default21; 20774 var settings20 = { 20775 icon: comment_content_default, 20776 edit: Edit8, 20777 deprecated: deprecated_default9, 20778 example: {} 20779 }; 20780 var init20 = () => initBlock({ name: name20, metadata: block_default21, settings: settings20 }); 20781 20782 // packages/block-library/build-module/comment-date/index.mjs 20783 var comment_date_exports = {}; 20784 __export(comment_date_exports, { 20785 init: () => init21, 20786 metadata: () => block_default22, 20787 name: () => name21, 20788 settings: () => settings21 20789 }); 20790 20791 // packages/block-library/build-module/comment-date/block.json 20792 var block_default22 = { 20793 $schema: "https://schemas.wp.org/trunk/block.json", 20794 apiVersion: 3, 20795 name: "core/comment-date", 20796 title: "Comment Date", 20797 category: "theme", 20798 ancestor: ["core/comment-template"], 20799 description: "Displays the date on which the comment was posted.", 20800 textdomain: "default", 20801 attributes: { 20802 format: { 20803 type: "string" 20804 }, 20805 isLink: { 20806 type: "boolean", 20807 default: true 20808 } 20809 }, 20810 usesContext: ["commentId"], 20811 supports: { 20812 anchor: true, 20813 html: false, 20814 color: { 20815 gradients: true, 20816 link: true, 20817 __experimentalDefaultControls: { 20818 background: true, 20819 text: true, 20820 link: true 20821 } 20822 }, 20823 spacing: { 20824 margin: true, 20825 padding: true 20826 }, 20827 typography: { 20828 fontSize: true, 20829 lineHeight: true, 20830 textAlign: true, 20831 __experimentalFontFamily: true, 20832 __experimentalFontWeight: true, 20833 __experimentalFontStyle: true, 20834 __experimentalTextTransform: true, 20835 __experimentalTextDecoration: true, 20836 __experimentalLetterSpacing: true, 20837 __experimentalDefaultControls: { 20838 fontSize: true 20839 } 20840 }, 20841 interactivity: { 20842 clientNavigation: true 20843 }, 20844 __experimentalBorder: { 20845 radius: true, 20846 color: true, 20847 width: true, 20848 style: true, 20849 __experimentalDefaultControls: { 20850 radius: true, 20851 color: true, 20852 width: true, 20853 style: true 20854 } 20855 } 20856 }, 20857 style: "wp-block-comment-date" 20858 }; 20859 20860 // packages/block-library/build-module/comment-date/edit.mjs 20861 var import_core_data12 = __toESM(require_core_data(), 1); 20862 var import_date = __toESM(require_date(), 1); 20863 var import_block_editor49 = __toESM(require_block_editor(), 1); 20864 var import_components23 = __toESM(require_components(), 1); 20865 var import_i18n39 = __toESM(require_i18n(), 1); 20866 var import_jsx_runtime249 = __toESM(require_jsx_runtime(), 1); 20867 function Edit9({ 20868 attributes: { format: format3, isLink }, 20869 context: { commentId }, 20870 setAttributes 20871 }) { 20872 const blockProps = (0, import_block_editor49.useBlockProps)(); 20873 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 20874 let [date] = (0, import_core_data12.useEntityProp)("root", "comment", "date", commentId); 20875 const [siteFormat = (0, import_date.getSettings)().formats.date] = (0, import_core_data12.useEntityProp)( 20876 "root", 20877 "site", 20878 "date_format" 20879 ); 20880 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime249.jsx)(import_block_editor49.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)( 20881 import_components23.__experimentalToolsPanel, 20882 { 20883 label: (0, import_i18n39.__)("Settings"), 20884 resetAll: () => { 20885 setAttributes({ 20886 format: void 0, 20887 isLink: true 20888 }); 20889 }, 20890 dropdownMenuProps, 20891 children: [ 20892 /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 20893 import_components23.__experimentalToolsPanelItem, 20894 { 20895 label: (0, import_i18n39.__)("Date format"), 20896 hasValue: () => format3 !== void 0, 20897 onDeselect: () => setAttributes({ format: void 0 }), 20898 isShownByDefault: true, 20899 children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 20900 import_block_editor49.__experimentalDateFormatPicker, 20901 { 20902 format: format3, 20903 defaultFormat: siteFormat, 20904 onChange: (nextFormat) => setAttributes({ format: nextFormat }) 20905 } 20906 ) 20907 } 20908 ), 20909 /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 20910 import_components23.__experimentalToolsPanelItem, 20911 { 20912 label: (0, import_i18n39.__)("Link to comment"), 20913 hasValue: () => !isLink, 20914 onDeselect: () => setAttributes({ isLink: true }), 20915 isShownByDefault: true, 20916 children: /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 20917 import_components23.ToggleControl, 20918 { 20919 label: (0, import_i18n39.__)("Link to comment"), 20920 onChange: () => setAttributes({ isLink: !isLink }), 20921 checked: isLink 20922 } 20923 ) 20924 } 20925 ) 20926 ] 20927 } 20928 ) }); 20929 if (!commentId || !date) { 20930 date = (0, import_i18n39._x)("Comment Date", "block title"); 20931 } 20932 let commentDate = date instanceof Date ? /* @__PURE__ */ (0, import_jsx_runtime249.jsx)("time", { dateTime: (0, import_date.dateI18n)("c", date), children: format3 === "human-diff" ? (0, import_date.humanTimeDiff)(date) : (0, import_date.dateI18n)(format3 || siteFormat, date) }) : /* @__PURE__ */ (0, import_jsx_runtime249.jsx)("time", { children: date }); 20933 if (isLink) { 20934 commentDate = /* @__PURE__ */ (0, import_jsx_runtime249.jsx)( 20935 "a", 20936 { 20937 href: "#comment-date-pseudo-link", 20938 onClick: (event) => event.preventDefault(), 20939 children: commentDate 20940 } 20941 ); 20942 } 20943 return /* @__PURE__ */ (0, import_jsx_runtime249.jsxs)(import_jsx_runtime249.Fragment, { children: [ 20944 inspectorControls, 20945 /* @__PURE__ */ (0, import_jsx_runtime249.jsx)("div", { ...blockProps, children: commentDate }) 20946 ] }); 20947 } 20948 20949 // packages/block-library/build-module/comment-date/deprecated.mjs 20950 var v18 = { 20951 attributes: { 20952 format: { 20953 type: "string" 20954 }, 20955 isLink: { 20956 type: "boolean", 20957 default: false 20958 } 20959 }, 20960 supports: { 20961 html: false, 20962 color: { 20963 gradients: true, 20964 link: true 20965 }, 20966 typography: { 20967 fontSize: true, 20968 lineHeight: true, 20969 __experimentalFontFamily: true, 20970 __experimentalFontWeight: true, 20971 __experimentalFontStyle: true, 20972 __experimentalTextTransform: true, 20973 __experimentalLetterSpacing: true 20974 } 20975 }, 20976 save() { 20977 return null; 20978 }, 20979 migrate: migrate_font_family_default, 20980 isEligible({ style: style2 }) { 20981 return style2?.typography?.fontFamily; 20982 } 20983 }; 20984 var deprecated_default10 = [v18]; 20985 20986 // packages/block-library/build-module/comment-date/index.mjs 20987 var { name: name21 } = block_default22; 20988 var settings21 = { 20989 icon: post_date_default, 20990 edit: Edit9, 20991 deprecated: deprecated_default10, 20992 example: {} 20993 }; 20994 var init21 = () => initBlock({ name: name21, metadata: block_default22, settings: settings21 }); 20995 20996 // packages/block-library/build-module/comment-edit-link/index.mjs 20997 var comment_edit_link_exports = {}; 20998 __export(comment_edit_link_exports, { 20999 init: () => init22, 21000 metadata: () => block_default23, 21001 name: () => name22, 21002 settings: () => settings22 21003 }); 21004 21005 // packages/block-library/build-module/comment-edit-link/block.json 21006 var block_default23 = { 21007 $schema: "https://schemas.wp.org/trunk/block.json", 21008 apiVersion: 3, 21009 name: "core/comment-edit-link", 21010 title: "Comment Edit Link", 21011 category: "theme", 21012 ancestor: ["core/comment-template"], 21013 description: "Displays a link to edit the comment in the WordPress Dashboard. This link is only visible to users with the edit comment capability.", 21014 textdomain: "default", 21015 usesContext: ["commentId"], 21016 attributes: { 21017 linkTarget: { 21018 type: "string", 21019 default: "_self" 21020 } 21021 }, 21022 supports: { 21023 anchor: true, 21024 html: false, 21025 color: { 21026 link: true, 21027 gradients: true, 21028 text: false, 21029 __experimentalDefaultControls: { 21030 background: true, 21031 link: true 21032 } 21033 }, 21034 spacing: { 21035 margin: true, 21036 padding: true, 21037 __experimentalDefaultControls: { 21038 margin: false, 21039 padding: false 21040 } 21041 }, 21042 typography: { 21043 fontSize: true, 21044 lineHeight: true, 21045 textAlign: true, 21046 __experimentalFontFamily: true, 21047 __experimentalFontWeight: true, 21048 __experimentalFontStyle: true, 21049 __experimentalTextTransform: true, 21050 __experimentalTextDecoration: true, 21051 __experimentalLetterSpacing: true, 21052 __experimentalDefaultControls: { 21053 fontSize: true 21054 } 21055 }, 21056 interactivity: { 21057 clientNavigation: true 21058 }, 21059 __experimentalBorder: { 21060 radius: true, 21061 color: true, 21062 width: true, 21063 style: true 21064 } 21065 }, 21066 style: "wp-block-comment-edit-link" 21067 }; 21068 21069 // packages/block-library/build-module/comment-edit-link/edit.mjs 21070 var import_block_editor50 = __toESM(require_block_editor(), 1); 21071 var import_components24 = __toESM(require_components(), 1); 21072 var import_i18n40 = __toESM(require_i18n(), 1); 21073 var import_jsx_runtime250 = __toESM(require_jsx_runtime(), 1); 21074 function Edit10(props) { 21075 const { attributes: attributes2, setAttributes } = props; 21076 const { linkTarget } = attributes2; 21077 useDeprecatedTextAlign(props); 21078 const blockProps = (0, import_block_editor50.useBlockProps)(); 21079 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 21080 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime250.jsx)(import_block_editor50.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime250.jsx)( 21081 import_components24.__experimentalToolsPanel, 21082 { 21083 label: (0, import_i18n40.__)("Settings"), 21084 resetAll: () => { 21085 setAttributes({ 21086 linkTarget: "_self" 21087 }); 21088 }, 21089 dropdownMenuProps, 21090 children: /* @__PURE__ */ (0, import_jsx_runtime250.jsx)( 21091 import_components24.__experimentalToolsPanelItem, 21092 { 21093 label: (0, import_i18n40.__)("Open in new tab"), 21094 isShownByDefault: true, 21095 hasValue: () => linkTarget === "_blank", 21096 onDeselect: () => setAttributes({ linkTarget: "_self" }), 21097 children: /* @__PURE__ */ (0, import_jsx_runtime250.jsx)( 21098 import_components24.ToggleControl, 21099 { 21100 label: (0, import_i18n40.__)("Open in new tab"), 21101 onChange: (value) => setAttributes({ 21102 linkTarget: value ? "_blank" : "_self" 21103 }), 21104 checked: linkTarget === "_blank" 21105 } 21106 ) 21107 } 21108 ) 21109 } 21110 ) }); 21111 return /* @__PURE__ */ (0, import_jsx_runtime250.jsxs)(import_jsx_runtime250.Fragment, { children: [ 21112 inspectorControls, 21113 /* @__PURE__ */ (0, import_jsx_runtime250.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime250.jsx)( 21114 "a", 21115 { 21116 href: "#edit-comment-pseudo-link", 21117 onClick: (event) => event.preventDefault(), 21118 children: (0, import_i18n40.__)("Edit") 21119 } 21120 ) }) 21121 ] }); 21122 } 21123 21124 // packages/block-library/build-module/comment-edit-link/deprecated.mjs 21125 var v19 = { 21126 attributes: { 21127 linkTarget: { 21128 type: "string", 21129 default: "_self" 21130 }, 21131 textAlign: { 21132 type: "string" 21133 } 21134 }, 21135 usesContext: ["commentId"], 21136 supports: { 21137 anchor: true, 21138 html: false, 21139 color: { 21140 link: true, 21141 gradients: true, 21142 text: false 21143 }, 21144 spacing: { 21145 margin: true, 21146 padding: true 21147 }, 21148 typography: { 21149 fontSize: true, 21150 lineHeight: true, 21151 __experimentalFontFamily: true, 21152 __experimentalFontWeight: true, 21153 __experimentalFontStyle: true, 21154 __experimentalTextTransform: true, 21155 __experimentalTextDecoration: true, 21156 __experimentalLetterSpacing: true 21157 }, 21158 interactivity: { 21159 clientNavigation: true 21160 }, 21161 __experimentalBorder: { 21162 radius: true, 21163 color: true, 21164 width: true, 21165 style: true 21166 } 21167 }, 21168 save() { 21169 return null; 21170 }, 21171 migrate: migrate_text_align_default, 21172 isEligible(attributes2) { 21173 return !!attributes2.textAlign || !!attributes2.className?.match( 21174 /\bhas-text-align-(left|center|right)\b/ 21175 ); 21176 } 21177 }; 21178 var deprecated_default11 = [v19]; 21179 21180 // packages/block-library/build-module/comment-edit-link/index.mjs 21181 var { name: name22 } = block_default23; 21182 var settings22 = { 21183 icon: comment_edit_link_default, 21184 edit: Edit10, 21185 deprecated: deprecated_default11, 21186 example: {} 21187 }; 21188 var init22 = () => initBlock({ name: name22, metadata: block_default23, settings: settings22 }); 21189 21190 // packages/block-library/build-module/comment-reply-link/index.mjs 21191 var comment_reply_link_exports = {}; 21192 __export(comment_reply_link_exports, { 21193 init: () => init23, 21194 metadata: () => block_default24, 21195 name: () => name23, 21196 settings: () => settings23 21197 }); 21198 21199 // packages/block-library/build-module/comment-reply-link/block.json 21200 var block_default24 = { 21201 $schema: "https://schemas.wp.org/trunk/block.json", 21202 apiVersion: 3, 21203 name: "core/comment-reply-link", 21204 title: "Comment Reply Link", 21205 category: "theme", 21206 ancestor: ["core/comment-template"], 21207 description: "Displays a link to reply to a comment.", 21208 textdomain: "default", 21209 usesContext: ["commentId"], 21210 supports: { 21211 anchor: true, 21212 color: { 21213 gradients: true, 21214 link: true, 21215 text: false, 21216 __experimentalDefaultControls: { 21217 background: true, 21218 link: true 21219 } 21220 }, 21221 spacing: { 21222 margin: true, 21223 padding: true, 21224 __experimentalDefaultControls: { 21225 margin: false, 21226 padding: false 21227 } 21228 }, 21229 typography: { 21230 fontSize: true, 21231 lineHeight: true, 21232 textAlign: true, 21233 __experimentalFontFamily: true, 21234 __experimentalFontWeight: true, 21235 __experimentalFontStyle: true, 21236 __experimentalTextTransform: true, 21237 __experimentalTextDecoration: true, 21238 __experimentalLetterSpacing: true, 21239 __experimentalDefaultControls: { 21240 fontSize: true 21241 } 21242 }, 21243 __experimentalBorder: { 21244 radius: true, 21245 color: true, 21246 width: true, 21247 style: true 21248 }, 21249 html: false 21250 }, 21251 style: "wp-block-comment-reply-link" 21252 }; 21253 21254 // packages/block-library/build-module/comment-reply-link/edit.mjs 21255 var import_i18n41 = __toESM(require_i18n(), 1); 21256 var import_block_editor51 = __toESM(require_block_editor(), 1); 21257 var import_jsx_runtime251 = __toESM(require_jsx_runtime(), 1); 21258 function Edit11(props) { 21259 useDeprecatedTextAlign(props); 21260 const blockProps = (0, import_block_editor51.useBlockProps)(); 21261 return /* @__PURE__ */ (0, import_jsx_runtime251.jsx)(import_jsx_runtime251.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime251.jsx)( 21262 "a", 21263 { 21264 href: "#comment-reply-pseudo-link", 21265 onClick: (event) => event.preventDefault(), 21266 /* translators: Comment reply button text. */ 21267 children: (0, import_i18n41._x)("Reply", "verb") 21268 } 21269 ) }) }); 21270 } 21271 var edit_default6 = Edit11; 21272 21273 // packages/block-library/build-module/comment-reply-link/deprecated.mjs 21274 var v110 = { 21275 attributes: { 21276 textAlign: { 21277 type: "string" 21278 } 21279 }, 21280 usesContext: ["commentId"], 21281 supports: { 21282 anchor: true, 21283 color: { 21284 gradients: true, 21285 link: true, 21286 text: false 21287 }, 21288 spacing: { 21289 margin: true, 21290 padding: true 21291 }, 21292 typography: { 21293 fontSize: true, 21294 lineHeight: true, 21295 __experimentalFontFamily: true, 21296 __experimentalFontWeight: true, 21297 __experimentalFontStyle: true, 21298 __experimentalTextTransform: true, 21299 __experimentalTextDecoration: true, 21300 __experimentalLetterSpacing: true 21301 }, 21302 __experimentalBorder: { 21303 radius: true, 21304 color: true, 21305 width: true, 21306 style: true 21307 }, 21308 html: false 21309 }, 21310 save() { 21311 return null; 21312 }, 21313 migrate: migrate_text_align_default, 21314 isEligible(attributes2) { 21315 return !!attributes2.textAlign || !!attributes2.className?.match( 21316 /\bhas-text-align-(left|center|right)\b/ 21317 ); 21318 } 21319 }; 21320 var deprecated_default12 = [v110]; 21321 21322 // packages/block-library/build-module/comment-reply-link/index.mjs 21323 var { name: name23 } = block_default24; 21324 var settings23 = { 21325 edit: edit_default6, 21326 icon: comment_reply_link_default, 21327 deprecated: deprecated_default12, 21328 example: {} 21329 }; 21330 var init23 = () => initBlock({ name: name23, metadata: block_default24, settings: settings23 }); 21331 21332 // packages/block-library/build-module/comment-template/index.mjs 21333 var comment_template_exports = {}; 21334 __export(comment_template_exports, { 21335 init: () => init24, 21336 metadata: () => block_default25, 21337 name: () => name24, 21338 settings: () => settings24 21339 }); 21340 21341 // packages/block-library/build-module/comment-template/block.json 21342 var block_default25 = { 21343 $schema: "https://schemas.wp.org/trunk/block.json", 21344 apiVersion: 3, 21345 name: "core/comment-template", 21346 title: "Comment Template", 21347 category: "design", 21348 parent: ["core/comments"], 21349 description: "Contains the block elements used to display a comment, like the title, date, author, avatar and more.", 21350 textdomain: "default", 21351 usesContext: ["postId"], 21352 supports: { 21353 anchor: true, 21354 align: true, 21355 html: false, 21356 reusable: false, 21357 spacing: { 21358 margin: true, 21359 padding: true 21360 }, 21361 typography: { 21362 fontSize: true, 21363 lineHeight: true, 21364 __experimentalFontFamily: true, 21365 __experimentalFontWeight: true, 21366 __experimentalFontStyle: true, 21367 __experimentalTextTransform: true, 21368 __experimentalTextDecoration: true, 21369 __experimentalLetterSpacing: true, 21370 __experimentalDefaultControls: { 21371 fontSize: true 21372 } 21373 }, 21374 interactivity: { 21375 clientNavigation: true 21376 }, 21377 __experimentalBorder: { 21378 radius: true, 21379 color: true, 21380 width: true, 21381 style: true, 21382 __experimentalDefaultControls: { 21383 radius: true, 21384 color: true, 21385 width: true, 21386 style: true 21387 } 21388 } 21389 }, 21390 style: "wp-block-comment-template" 21391 }; 21392 21393 // packages/block-library/build-module/comment-template/edit.mjs 21394 var import_element43 = __toESM(require_element(), 1); 21395 var import_data24 = __toESM(require_data(), 1); 21396 var import_i18n42 = __toESM(require_i18n(), 1); 21397 var import_block_editor53 = __toESM(require_block_editor(), 1); 21398 var import_components25 = __toESM(require_components(), 1); 21399 var import_core_data13 = __toESM(require_core_data(), 1); 21400 21401 // packages/block-library/build-module/comment-template/hooks.mjs 21402 var import_element42 = __toESM(require_element(), 1); 21403 var import_data23 = __toESM(require_data(), 1); 21404 var import_block_editor52 = __toESM(require_block_editor(), 1); 21405 var import_url4 = __toESM(require_url(), 1); 21406 var import_api_fetch = __toESM(require_api_fetch(), 1); 21407 var MAX_COMMENTS_PER_PAGE = 100; 21408 var useCommentQueryArgs = ({ postId }) => { 21409 const queryArgs = { 21410 status: "approve", 21411 order: "asc", 21412 context: "embed", 21413 parent: 0, 21414 _embed: "children" 21415 }; 21416 const { 21417 pageComments, 21418 commentsPerPage, 21419 defaultCommentsPage: defaultPage 21420 } = (0, import_data23.useSelect)((select10) => { 21421 const { getSettings: getSettings2 } = select10(import_block_editor52.store); 21422 const { __experimentalDiscussionSettings } = getSettings2(); 21423 return __experimentalDiscussionSettings ?? {}; 21424 }, []); 21425 const perPage = pageComments ? Math.min(commentsPerPage, MAX_COMMENTS_PER_PAGE) : MAX_COMMENTS_PER_PAGE; 21426 const page = useDefaultPageIndex({ 21427 defaultPage, 21428 postId, 21429 perPage, 21430 queryArgs 21431 }); 21432 return (0, import_element42.useMemo)(() => { 21433 return page ? { 21434 ...queryArgs, 21435 post: postId, 21436 per_page: perPage, 21437 page 21438 } : null; 21439 }, [postId, perPage, page]); 21440 }; 21441 var useDefaultPageIndex = ({ defaultPage, postId, perPage, queryArgs }) => { 21442 const [defaultPages, setDefaultPages] = (0, import_element42.useState)({}); 21443 const key = `$postId}_$perPage}`; 21444 const page = defaultPages[key] || 0; 21445 (0, import_element42.useEffect)(() => { 21446 if (page || defaultPage !== "newest") { 21447 return; 21448 } 21449 (0, import_api_fetch.default)({ 21450 path: (0, import_url4.addQueryArgs)("/wp/v2/comments", { 21451 ...queryArgs, 21452 post: postId, 21453 per_page: perPage, 21454 _fields: "id" 21455 }), 21456 method: "HEAD", 21457 parse: false 21458 }).then((res) => { 21459 const pages = parseInt(res.headers.get("X-WP-TotalPages")); 21460 setDefaultPages({ 21461 ...defaultPages, 21462 [key]: pages <= 1 ? 1 : pages 21463 // If there are 0 pages, it means that there are no comments, but there is no 0th page. 21464 }); 21465 }).catch(() => { 21466 setDefaultPages({ 21467 ...defaultPages, 21468 [key]: 1 21469 }); 21470 }); 21471 }, [defaultPage, postId, perPage, setDefaultPages]); 21472 return defaultPage === "newest" ? page : 1; 21473 }; 21474 var useCommentTree = (topLevelComments) => { 21475 const commentTree = (0, import_element42.useMemo)( 21476 () => topLevelComments?.map(({ id, _embedded }) => { 21477 const [children] = _embedded?.children || [[]]; 21478 return { 21479 commentId: id, 21480 children: children.map((child) => ({ 21481 commentId: child.id 21482 })) 21483 }; 21484 }), 21485 [topLevelComments] 21486 ); 21487 return commentTree; 21488 }; 21489 21490 // packages/block-library/build-module/comment-template/edit.mjs 21491 var import_jsx_runtime252 = __toESM(require_jsx_runtime(), 1); 21492 var getCommentsPlaceholder = ({ 21493 perPage, 21494 pageComments, 21495 threadComments, 21496 threadCommentsDepth 21497 }) => { 21498 const commentsDepth = !threadComments ? 1 : Math.min(threadCommentsDepth, 3); 21499 const buildChildrenComment = (commentsLevel) => { 21500 if (commentsLevel < commentsDepth) { 21501 const nextLevel = commentsLevel + 1; 21502 return [ 21503 { 21504 commentId: -(commentsLevel + 3), 21505 children: buildChildrenComment(nextLevel) 21506 } 21507 ]; 21508 } 21509 return []; 21510 }; 21511 const placeholderComments = [ 21512 { commentId: -1, children: buildChildrenComment(1) } 21513 ]; 21514 if ((!pageComments || perPage >= 2) && commentsDepth < 3) { 21515 placeholderComments.push({ 21516 commentId: -2, 21517 children: [] 21518 }); 21519 } 21520 if ((!pageComments || perPage >= 3) && commentsDepth < 2) { 21521 placeholderComments.push({ 21522 commentId: -3, 21523 children: [] 21524 }); 21525 } 21526 return placeholderComments; 21527 }; 21528 function CommentTemplateInnerBlocks({ 21529 comment, 21530 activeCommentId, 21531 setActiveCommentId, 21532 firstCommentId, 21533 blocks 21534 }) { 21535 const { children, ...innerBlocksProps } = (0, import_block_editor53.useInnerBlocksProps)({}); 21536 return /* @__PURE__ */ (0, import_jsx_runtime252.jsxs)("li", { ...innerBlocksProps, children: [ 21537 comment.commentId === (activeCommentId || firstCommentId) ? children : null, 21538 /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 21539 MemoizedCommentTemplatePreview, 21540 { 21541 blocks, 21542 commentId: comment.commentId, 21543 setActiveCommentId, 21544 isHidden: comment.commentId === (activeCommentId || firstCommentId) 21545 } 21546 ), 21547 comment?.children?.length > 0 ? /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 21548 CommentsList, 21549 { 21550 comments: comment.children, 21551 activeCommentId, 21552 setActiveCommentId, 21553 blocks, 21554 firstCommentId 21555 } 21556 ) : null 21557 ] }); 21558 } 21559 var CommentTemplatePreview = ({ 21560 blocks, 21561 commentId, 21562 setActiveCommentId, 21563 isHidden 21564 }) => { 21565 const blockPreviewProps = (0, import_block_editor53.__experimentalUseBlockPreview)({ 21566 blocks 21567 }); 21568 const handleOnClick = () => { 21569 setActiveCommentId(commentId); 21570 }; 21571 const style2 = { 21572 display: isHidden ? "none" : void 0 21573 }; 21574 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 21575 "div", 21576 { 21577 ...blockPreviewProps, 21578 tabIndex: 0, 21579 role: "button", 21580 style: style2, 21581 onClick: handleOnClick, 21582 onKeyPress: handleOnClick 21583 } 21584 ); 21585 }; 21586 var MemoizedCommentTemplatePreview = (0, import_element43.memo)(CommentTemplatePreview); 21587 var CommentsList = ({ 21588 comments, 21589 blockProps, 21590 activeCommentId, 21591 setActiveCommentId, 21592 blocks, 21593 firstCommentId 21594 }) => /* @__PURE__ */ (0, import_jsx_runtime252.jsx)("ol", { ...blockProps, children: comments && comments.map(({ commentId, ...comment }, index) => /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 21595 import_block_editor53.BlockContextProvider, 21596 { 21597 value: { 21598 // If the commentId is negative it means that this comment is a 21599 // "placeholder" and that the block is most likely being used in the 21600 // site editor. In this case, we have to set the commentId to `null` 21601 // because otherwise the (non-existent) comment with a negative ID 21602 // would be requested from the REST API. 21603 commentId: commentId < 0 ? null : commentId 21604 }, 21605 children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 21606 CommentTemplateInnerBlocks, 21607 { 21608 comment: { commentId, ...comment }, 21609 activeCommentId, 21610 setActiveCommentId, 21611 blocks, 21612 firstCommentId 21613 } 21614 ) 21615 }, 21616 comment.commentId || index 21617 )) }); 21618 function CommentTemplateEdit({ 21619 clientId, 21620 context: { postId } 21621 }) { 21622 const blockProps = (0, import_block_editor53.useBlockProps)(); 21623 const [activeCommentId, setActiveCommentId] = (0, import_element43.useState)(); 21624 const { 21625 commentOrder, 21626 threadCommentsDepth, 21627 threadComments, 21628 commentsPerPage, 21629 pageComments 21630 } = (0, import_data24.useSelect)((select10) => { 21631 const { getSettings: getSettings2 } = select10(import_block_editor53.store); 21632 return getSettings2().__experimentalDiscussionSettings ?? {}; 21633 }, []); 21634 const commentQuery = useCommentQueryArgs({ 21635 postId 21636 }); 21637 const { topLevelComments, blocks } = (0, import_data24.useSelect)( 21638 (select10) => { 21639 const { getEntityRecords } = select10(import_core_data13.store); 21640 const { getBlocks } = select10(import_block_editor53.store); 21641 return { 21642 // Request only top-level comments. Replies are embedded. 21643 topLevelComments: commentQuery ? getEntityRecords("root", "comment", commentQuery) : null, 21644 blocks: getBlocks(clientId) 21645 }; 21646 }, 21647 [clientId, commentQuery] 21648 ); 21649 let commentTree = useCommentTree( 21650 // Reverse the order of top comments if needed. 21651 commentOrder === "desc" && topLevelComments ? [...topLevelComments].reverse() : topLevelComments 21652 ); 21653 if (!topLevelComments) { 21654 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)("p", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime252.jsx)(import_components25.Spinner, {}) }); 21655 } 21656 if (!postId) { 21657 commentTree = getCommentsPlaceholder({ 21658 perPage: commentsPerPage, 21659 pageComments, 21660 threadComments, 21661 threadCommentsDepth 21662 }); 21663 } 21664 if (!commentTree.length) { 21665 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)("p", { ...blockProps, children: (0, import_i18n42.__)("No results found.") }); 21666 } 21667 return /* @__PURE__ */ (0, import_jsx_runtime252.jsx)( 21668 CommentsList, 21669 { 21670 comments: commentTree, 21671 blockProps, 21672 blocks, 21673 activeCommentId, 21674 setActiveCommentId, 21675 firstCommentId: commentTree[0]?.commentId 21676 } 21677 ); 21678 } 21679 21680 // packages/block-library/build-module/comment-template/save.mjs 21681 var import_block_editor54 = __toESM(require_block_editor(), 1); 21682 var import_jsx_runtime253 = __toESM(require_jsx_runtime(), 1); 21683 function CommentTemplateSave() { 21684 return /* @__PURE__ */ (0, import_jsx_runtime253.jsx)(import_block_editor54.InnerBlocks.Content, {}); 21685 } 21686 21687 // packages/block-library/build-module/comment-template/index.mjs 21688 var { name: name24 } = block_default25; 21689 var TEMPLATE6 = [ 21690 ["core/avatar"], 21691 ["core/comment-author-name"], 21692 ["core/comment-date"], 21693 ["core/comment-content"], 21694 ["core/comment-reply-link"], 21695 ["core/comment-edit-link"] 21696 ]; 21697 var settings24 = { 21698 icon: layout_default, 21699 template: TEMPLATE6, 21700 edit: CommentTemplateEdit, 21701 save: CommentTemplateSave 21702 }; 21703 var init24 = () => initBlock({ name: name24, metadata: block_default25, settings: settings24 }); 21704 21705 // packages/block-library/build-module/comments-pagination-previous/index.mjs 21706 var comments_pagination_previous_exports = {}; 21707 __export(comments_pagination_previous_exports, { 21708 init: () => init25, 21709 metadata: () => block_default26, 21710 name: () => name25, 21711 settings: () => settings25 21712 }); 21713 var import_i18n44 = __toESM(require_i18n(), 1); 21714 21715 // packages/block-library/build-module/comments-pagination-previous/block.json 21716 var block_default26 = { 21717 $schema: "https://schemas.wp.org/trunk/block.json", 21718 apiVersion: 3, 21719 name: "core/comments-pagination-previous", 21720 title: "Comments Previous Page", 21721 category: "theme", 21722 parent: ["core/comments-pagination"], 21723 description: "Displays the previous comment's page link.", 21724 textdomain: "default", 21725 attributes: { 21726 label: { 21727 type: "string" 21728 } 21729 }, 21730 usesContext: ["postId", "comments/paginationArrow"], 21731 supports: { 21732 anchor: true, 21733 reusable: false, 21734 html: false, 21735 color: { 21736 gradients: true, 21737 text: false, 21738 __experimentalDefaultControls: { 21739 background: true 21740 } 21741 }, 21742 typography: { 21743 fontSize: true, 21744 lineHeight: true, 21745 __experimentalFontFamily: true, 21746 __experimentalFontWeight: true, 21747 __experimentalFontStyle: true, 21748 __experimentalTextTransform: true, 21749 __experimentalTextDecoration: true, 21750 __experimentalLetterSpacing: true, 21751 __experimentalDefaultControls: { 21752 fontSize: true 21753 } 21754 }, 21755 interactivity: { 21756 clientNavigation: true 21757 } 21758 } 21759 }; 21760 21761 // packages/block-library/build-module/comments-pagination-previous/edit.mjs 21762 var import_i18n43 = __toESM(require_i18n(), 1); 21763 var import_block_editor55 = __toESM(require_block_editor(), 1); 21764 var import_jsx_runtime254 = __toESM(require_jsx_runtime(), 1); 21765 var arrowMap = { 21766 none: "", 21767 arrow: "\u2190", 21768 chevron: "\xAB" 21769 }; 21770 function CommentsPaginationPreviousEdit({ 21771 attributes: { label }, 21772 setAttributes, 21773 context: { "comments/paginationArrow": paginationArrow } 21774 }) { 21775 const displayArrow = arrowMap[paginationArrow]; 21776 return /* @__PURE__ */ (0, import_jsx_runtime254.jsxs)( 21777 "a", 21778 { 21779 href: "#comments-pagination-previous-pseudo-link", 21780 onClick: (event) => event.preventDefault(), 21781 ...(0, import_block_editor55.useBlockProps)(), 21782 children: [ 21783 displayArrow && /* @__PURE__ */ (0, import_jsx_runtime254.jsx)( 21784 "span", 21785 { 21786 className: `wp-block-comments-pagination-previous-arrow is-arrow-$paginationArrow}`, 21787 children: displayArrow 21788 } 21789 ), 21790 /* @__PURE__ */ (0, import_jsx_runtime254.jsx)( 21791 import_block_editor55.PlainText, 21792 { 21793 __experimentalVersion: 2, 21794 tagName: "span", 21795 "aria-label": (0, import_i18n43.__)("Older comments page link"), 21796 placeholder: (0, import_i18n43.__)("Older Comments"), 21797 value: label, 21798 onChange: (newLabel) => setAttributes({ label: newLabel }) 21799 } 21800 ) 21801 ] 21802 } 21803 ); 21804 } 21805 21806 // packages/block-library/build-module/comments-pagination-previous/index.mjs 21807 var { name: name25 } = block_default26; 21808 var settings25 = { 21809 icon: query_pagination_previous_default, 21810 edit: CommentsPaginationPreviousEdit, 21811 example: { 21812 attributes: { 21813 label: (0, import_i18n44.__)("Older Comments") 21814 } 21815 } 21816 }; 21817 var init25 = () => initBlock({ name: name25, metadata: block_default26, settings: settings25 }); 21818 21819 // packages/block-library/build-module/comments-pagination/index.mjs 21820 var comments_pagination_exports = {}; 21821 __export(comments_pagination_exports, { 21822 init: () => init26, 21823 metadata: () => block_default27, 21824 name: () => name26, 21825 settings: () => settings26 21826 }); 21827 21828 // packages/block-library/build-module/comments-pagination/block.json 21829 var block_default27 = { 21830 $schema: "https://schemas.wp.org/trunk/block.json", 21831 apiVersion: 3, 21832 name: "core/comments-pagination", 21833 title: "Comments Pagination", 21834 category: "theme", 21835 parent: ["core/comments"], 21836 allowedBlocks: [ 21837 "core/comments-pagination-previous", 21838 "core/comments-pagination-numbers", 21839 "core/comments-pagination-next" 21840 ], 21841 description: "Displays a paginated navigation to next/previous set of comments, when applicable.", 21842 textdomain: "default", 21843 attributes: { 21844 paginationArrow: { 21845 type: "string", 21846 default: "none" 21847 } 21848 }, 21849 example: { 21850 attributes: { 21851 paginationArrow: "none" 21852 } 21853 }, 21854 providesContext: { 21855 "comments/paginationArrow": "paginationArrow" 21856 }, 21857 supports: { 21858 anchor: true, 21859 align: true, 21860 reusable: false, 21861 html: false, 21862 color: { 21863 gradients: true, 21864 link: true, 21865 __experimentalDefaultControls: { 21866 background: true, 21867 text: true, 21868 link: true 21869 } 21870 }, 21871 layout: { 21872 allowSwitching: false, 21873 allowInheriting: false, 21874 default: { 21875 type: "flex" 21876 } 21877 }, 21878 typography: { 21879 fontSize: true, 21880 lineHeight: true, 21881 __experimentalFontFamily: true, 21882 __experimentalFontWeight: true, 21883 __experimentalFontStyle: true, 21884 __experimentalTextTransform: true, 21885 __experimentalTextDecoration: true, 21886 __experimentalLetterSpacing: true, 21887 __experimentalDefaultControls: { 21888 fontSize: true 21889 } 21890 }, 21891 interactivity: { 21892 clientNavigation: true 21893 } 21894 }, 21895 editorStyle: "wp-block-comments-pagination-editor", 21896 style: "wp-block-comments-pagination" 21897 }; 21898 21899 // packages/block-library/build-module/comments-pagination/edit.mjs 21900 var import_i18n46 = __toESM(require_i18n(), 1); 21901 var import_block_editor56 = __toESM(require_block_editor(), 1); 21902 var import_data25 = __toESM(require_data(), 1); 21903 var import_components27 = __toESM(require_components(), 1); 21904 21905 // packages/block-library/build-module/comments-pagination/comments-pagination-arrow-controls.mjs 21906 var import_i18n45 = __toESM(require_i18n(), 1); 21907 var import_components26 = __toESM(require_components(), 1); 21908 var import_jsx_runtime255 = __toESM(require_jsx_runtime(), 1); 21909 function CommentsPaginationArrowControls({ value, onChange }) { 21910 return /* @__PURE__ */ (0, import_jsx_runtime255.jsxs)( 21911 import_components26.__experimentalToggleGroupControl, 21912 { 21913 label: (0, import_i18n45.__)("Arrow"), 21914 value, 21915 onChange, 21916 help: (0, import_i18n45.__)( 21917 "A decorative arrow appended to the next and previous comments link." 21918 ), 21919 isBlock: true, 21920 children: [ 21921 /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( 21922 import_components26.__experimentalToggleGroupControlOption, 21923 { 21924 value: "none", 21925 label: (0, import_i18n45._x)( 21926 "None", 21927 "Arrow option for Comments Pagination Next/Previous blocks" 21928 ) 21929 } 21930 ), 21931 /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( 21932 import_components26.__experimentalToggleGroupControlOption, 21933 { 21934 value: "arrow", 21935 label: (0, import_i18n45._x)( 21936 "Arrow", 21937 "Arrow option for Comments Pagination Next/Previous blocks" 21938 ) 21939 } 21940 ), 21941 /* @__PURE__ */ (0, import_jsx_runtime255.jsx)( 21942 import_components26.__experimentalToggleGroupControlOption, 21943 { 21944 value: "chevron", 21945 label: (0, import_i18n45._x)( 21946 "Chevron", 21947 "Arrow option for Comments Pagination Next/Previous blocks" 21948 ) 21949 } 21950 ) 21951 ] 21952 } 21953 ); 21954 } 21955 21956 // packages/block-library/build-module/comments-pagination/edit.mjs 21957 var import_jsx_runtime256 = __toESM(require_jsx_runtime(), 1); 21958 function QueryPaginationEdit({ 21959 attributes: { paginationArrow }, 21960 setAttributes, 21961 clientId 21962 }) { 21963 const hasNextPreviousBlocks = (0, import_data25.useSelect)((select10) => { 21964 const { getBlocks } = select10(import_block_editor56.store); 21965 const innerBlocks = getBlocks(clientId); 21966 return innerBlocks?.find((innerBlock) => { 21967 return [ 21968 "core/comments-pagination-previous", 21969 "core/comments-pagination-next" 21970 ].includes(innerBlock.name); 21971 }); 21972 }, []); 21973 const blockProps = (0, import_block_editor56.useBlockProps)(); 21974 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 21975 const innerBlocksProps = (0, import_block_editor56.useInnerBlocksProps)(blockProps); 21976 const pageComments = (0, import_data25.useSelect)((select10) => { 21977 const { getSettings: getSettings2 } = select10(import_block_editor56.store); 21978 const { __experimentalDiscussionSettings } = getSettings2(); 21979 return __experimentalDiscussionSettings?.pageComments; 21980 }, []); 21981 if (!pageComments) { 21982 return /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(import_block_editor56.Warning, { children: (0, import_i18n46.__)( 21983 "Comments Pagination block: paging comments is disabled in the Discussion Settings" 21984 ) }); 21985 } 21986 return /* @__PURE__ */ (0, import_jsx_runtime256.jsxs)(import_jsx_runtime256.Fragment, { children: [ 21987 hasNextPreviousBlocks && /* @__PURE__ */ (0, import_jsx_runtime256.jsx)(import_block_editor56.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)( 21988 import_components27.__experimentalToolsPanel, 21989 { 21990 label: (0, import_i18n46.__)("Settings"), 21991 dropdownMenuProps, 21992 resetAll: () => setAttributes({ paginationArrow: "none" }), 21993 children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)( 21994 import_components27.__experimentalToolsPanelItem, 21995 { 21996 label: (0, import_i18n46.__)("Arrow"), 21997 hasValue: () => paginationArrow !== "none", 21998 onDeselect: () => setAttributes({ paginationArrow: "none" }), 21999 isShownByDefault: true, 22000 children: /* @__PURE__ */ (0, import_jsx_runtime256.jsx)( 22001 CommentsPaginationArrowControls, 22002 { 22003 value: paginationArrow, 22004 onChange: (value) => { 22005 setAttributes({ paginationArrow: value }); 22006 } 22007 } 22008 ) 22009 } 22010 ) 22011 } 22012 ) }), 22013 /* @__PURE__ */ (0, import_jsx_runtime256.jsx)("div", { ...innerBlocksProps }) 22014 ] }); 22015 } 22016 22017 // packages/block-library/build-module/comments-pagination/save.mjs 22018 var import_block_editor57 = __toESM(require_block_editor(), 1); 22019 var import_jsx_runtime257 = __toESM(require_jsx_runtime(), 1); 22020 function save13() { 22021 return /* @__PURE__ */ (0, import_jsx_runtime257.jsx)(import_block_editor57.InnerBlocks.Content, {}); 22022 } 22023 22024 // packages/block-library/build-module/comments-pagination/index.mjs 22025 var { name: name26 } = block_default27; 22026 var TEMPLATE7 = [ 22027 ["core/comments-pagination-previous"], 22028 ["core/comments-pagination-numbers"], 22029 ["core/comments-pagination-next"] 22030 ]; 22031 var settings26 = { 22032 icon: query_pagination_default, 22033 template: TEMPLATE7, 22034 edit: QueryPaginationEdit, 22035 save: save13 22036 }; 22037 var init26 = () => initBlock({ name: name26, metadata: block_default27, settings: settings26 }); 22038 22039 // packages/block-library/build-module/comments-pagination-next/index.mjs 22040 var comments_pagination_next_exports = {}; 22041 __export(comments_pagination_next_exports, { 22042 init: () => init27, 22043 metadata: () => block_default28, 22044 name: () => name27, 22045 settings: () => settings27 22046 }); 22047 var import_i18n48 = __toESM(require_i18n(), 1); 22048 22049 // packages/block-library/build-module/comments-pagination-next/block.json 22050 var block_default28 = { 22051 $schema: "https://schemas.wp.org/trunk/block.json", 22052 apiVersion: 3, 22053 name: "core/comments-pagination-next", 22054 title: "Comments Next Page", 22055 category: "theme", 22056 parent: ["core/comments-pagination"], 22057 description: "Displays the next comment's page link.", 22058 textdomain: "default", 22059 attributes: { 22060 label: { 22061 type: "string" 22062 } 22063 }, 22064 usesContext: ["postId", "comments/paginationArrow"], 22065 supports: { 22066 anchor: true, 22067 reusable: false, 22068 html: false, 22069 color: { 22070 gradients: true, 22071 text: false, 22072 __experimentalDefaultControls: { 22073 background: true 22074 } 22075 }, 22076 typography: { 22077 fontSize: true, 22078 lineHeight: true, 22079 __experimentalFontFamily: true, 22080 __experimentalFontWeight: true, 22081 __experimentalFontStyle: true, 22082 __experimentalTextTransform: true, 22083 __experimentalTextDecoration: true, 22084 __experimentalLetterSpacing: true, 22085 __experimentalDefaultControls: { 22086 fontSize: true 22087 } 22088 }, 22089 interactivity: { 22090 clientNavigation: true 22091 } 22092 } 22093 }; 22094 22095 // packages/block-library/build-module/comments-pagination-next/edit.mjs 22096 var import_i18n47 = __toESM(require_i18n(), 1); 22097 var import_block_editor58 = __toESM(require_block_editor(), 1); 22098 var import_jsx_runtime258 = __toESM(require_jsx_runtime(), 1); 22099 var arrowMap2 = { 22100 none: "", 22101 arrow: "\u2192", 22102 chevron: "\xBB" 22103 }; 22104 function CommentsPaginationNextEdit({ 22105 attributes: { label }, 22106 setAttributes, 22107 context: { "comments/paginationArrow": paginationArrow } 22108 }) { 22109 const displayArrow = arrowMap2[paginationArrow]; 22110 return /* @__PURE__ */ (0, import_jsx_runtime258.jsxs)( 22111 "a", 22112 { 22113 href: "#comments-pagination-next-pseudo-link", 22114 onClick: (event) => event.preventDefault(), 22115 ...(0, import_block_editor58.useBlockProps)(), 22116 children: [ 22117 /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 22118 import_block_editor58.PlainText, 22119 { 22120 __experimentalVersion: 2, 22121 tagName: "span", 22122 "aria-label": (0, import_i18n47.__)("Newer comments page link"), 22123 placeholder: (0, import_i18n47.__)("Newer Comments"), 22124 value: label, 22125 onChange: (newLabel) => setAttributes({ label: newLabel }) 22126 } 22127 ), 22128 displayArrow && /* @__PURE__ */ (0, import_jsx_runtime258.jsx)( 22129 "span", 22130 { 22131 className: `wp-block-comments-pagination-next-arrow is-arrow-$paginationArrow}`, 22132 children: displayArrow 22133 } 22134 ) 22135 ] 22136 } 22137 ); 22138 } 22139 22140 // packages/block-library/build-module/comments-pagination-next/index.mjs 22141 var { name: name27 } = block_default28; 22142 var settings27 = { 22143 icon: query_pagination_next_default, 22144 edit: CommentsPaginationNextEdit, 22145 example: { 22146 attributes: { 22147 label: (0, import_i18n48.__)("Newer Comments") 22148 } 22149 } 22150 }; 22151 var init27 = () => initBlock({ name: name27, metadata: block_default28, settings: settings27 }); 22152 22153 // packages/block-library/build-module/comments-pagination-numbers/index.mjs 22154 var comments_pagination_numbers_exports = {}; 22155 __export(comments_pagination_numbers_exports, { 22156 init: () => init28, 22157 metadata: () => block_default29, 22158 name: () => name28, 22159 settings: () => settings28 22160 }); 22161 22162 // packages/block-library/build-module/comments-pagination-numbers/block.json 22163 var block_default29 = { 22164 $schema: "https://schemas.wp.org/trunk/block.json", 22165 apiVersion: 3, 22166 name: "core/comments-pagination-numbers", 22167 title: "Comments Page Numbers", 22168 category: "theme", 22169 parent: ["core/comments-pagination"], 22170 description: "Displays a list of page numbers for comments pagination.", 22171 textdomain: "default", 22172 usesContext: ["postId"], 22173 supports: { 22174 anchor: true, 22175 reusable: false, 22176 html: false, 22177 color: { 22178 gradients: true, 22179 text: false, 22180 __experimentalDefaultControls: { 22181 background: true 22182 } 22183 }, 22184 typography: { 22185 fontSize: true, 22186 lineHeight: true, 22187 __experimentalFontFamily: true, 22188 __experimentalFontWeight: true, 22189 __experimentalFontStyle: true, 22190 __experimentalTextTransform: true, 22191 __experimentalTextDecoration: true, 22192 __experimentalLetterSpacing: true, 22193 __experimentalDefaultControls: { 22194 fontSize: true 22195 } 22196 }, 22197 interactivity: { 22198 clientNavigation: true 22199 }, 22200 spacing: { 22201 margin: true, 22202 padding: true, 22203 __experimentalDefaultControls: { 22204 padding: true 22205 } 22206 } 22207 } 22208 }; 22209 22210 // packages/block-library/build-module/comments-pagination-numbers/edit.mjs 22211 var import_block_editor59 = __toESM(require_block_editor(), 1); 22212 var import_jsx_runtime259 = __toESM(require_jsx_runtime(), 1); 22213 var PaginationItem = ({ content, tag: Tag = "a", extraClass = "" }) => Tag === "a" ? /* @__PURE__ */ (0, import_jsx_runtime259.jsx)( 22214 Tag, 22215 { 22216 className: `page-numbers $extraClass}`, 22217 href: "#comments-pagination-numbers-pseudo-link", 22218 onClick: (event) => event.preventDefault(), 22219 children: content 22220 } 22221 ) : /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(Tag, { className: `page-numbers $extraClass}`, children: content }); 22222 function CommentsPaginationNumbersEdit() { 22223 return /* @__PURE__ */ (0, import_jsx_runtime259.jsxs)("div", { ...(0, import_block_editor59.useBlockProps)(), children: [ 22224 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(PaginationItem, { content: "1" }), 22225 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(PaginationItem, { content: "2" }), 22226 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(PaginationItem, { content: "3", tag: "span", extraClass: "current" }), 22227 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(PaginationItem, { content: "4" }), 22228 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(PaginationItem, { content: "5" }), 22229 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(PaginationItem, { content: "...", tag: "span", extraClass: "dots" }), 22230 /* @__PURE__ */ (0, import_jsx_runtime259.jsx)(PaginationItem, { content: "8" }) 22231 ] }); 22232 } 22233 22234 // packages/block-library/build-module/comments-pagination-numbers/index.mjs 22235 var { name: name28 } = block_default29; 22236 var settings28 = { 22237 icon: query_pagination_numbers_default, 22238 edit: CommentsPaginationNumbersEdit, 22239 example: {} 22240 }; 22241 var init28 = () => initBlock({ name: name28, metadata: block_default29, settings: settings28 }); 22242 22243 // packages/block-library/build-module/comments-title/index.mjs 22244 var comments_title_exports = {}; 22245 __export(comments_title_exports, { 22246 init: () => init29, 22247 metadata: () => block_default30, 22248 name: () => name29, 22249 settings: () => settings29 22250 }); 22251 22252 // packages/block-library/build-module/comments-title/block.json 22253 var block_default30 = { 22254 $schema: "https://schemas.wp.org/trunk/block.json", 22255 apiVersion: 3, 22256 name: "core/comments-title", 22257 title: "Comments Title", 22258 category: "theme", 22259 ancestor: ["core/comments"], 22260 description: "Displays a title with the number of comments.", 22261 textdomain: "default", 22262 usesContext: ["postId", "postType"], 22263 attributes: { 22264 showPostTitle: { 22265 type: "boolean", 22266 default: true 22267 }, 22268 showCommentsCount: { 22269 type: "boolean", 22270 default: true 22271 }, 22272 level: { 22273 type: "number", 22274 default: 2 22275 }, 22276 levelOptions: { 22277 type: "array" 22278 } 22279 }, 22280 supports: { 22281 anchor: true, 22282 align: true, 22283 html: false, 22284 __experimentalBorder: { 22285 radius: true, 22286 color: true, 22287 width: true, 22288 style: true 22289 }, 22290 color: { 22291 gradients: true, 22292 __experimentalDefaultControls: { 22293 background: true, 22294 text: true 22295 } 22296 }, 22297 spacing: { 22298 margin: true, 22299 padding: true 22300 }, 22301 typography: { 22302 fontSize: true, 22303 lineHeight: true, 22304 textAlign: true, 22305 __experimentalFontFamily: true, 22306 __experimentalFontWeight: true, 22307 __experimentalFontStyle: true, 22308 __experimentalTextTransform: true, 22309 __experimentalTextDecoration: true, 22310 __experimentalLetterSpacing: true, 22311 __experimentalDefaultControls: { 22312 fontSize: true, 22313 __experimentalFontFamily: true, 22314 __experimentalFontStyle: true, 22315 __experimentalFontWeight: true 22316 } 22317 }, 22318 interactivity: { 22319 clientNavigation: true 22320 } 22321 } 22322 }; 22323 22324 // packages/block-library/build-module/comments-title/edit.mjs 22325 var import_block_editor60 = __toESM(require_block_editor(), 1); 22326 var import_i18n49 = __toESM(require_i18n(), 1); 22327 var import_core_data14 = __toESM(require_core_data(), 1); 22328 var import_components28 = __toESM(require_components(), 1); 22329 var import_element44 = __toESM(require_element(), 1); 22330 var import_data26 = __toESM(require_data(), 1); 22331 var import_api_fetch2 = __toESM(require_api_fetch(), 1); 22332 var import_url5 = __toESM(require_url(), 1); 22333 var import_jsx_runtime260 = __toESM(require_jsx_runtime(), 1); 22334 function Edit12(props) { 22335 useDeprecatedTextAlign(props); 22336 const { attributes: attributes2, setAttributes, context } = props; 22337 const { 22338 showPostTitle, 22339 showCommentsCount, 22340 level = 2, 22341 levelOptions 22342 } = attributes2; 22343 const { postId, postType } = context; 22344 const TagName2 = "h" + level; 22345 const [commentsCount, setCommentsCount] = (0, import_element44.useState)(); 22346 const [rawTitle] = (0, import_core_data14.useEntityProp)("postType", postType, "title", postId); 22347 const isSiteEditor = typeof postId === "undefined"; 22348 const blockProps = (0, import_block_editor60.useBlockProps)(); 22349 const { 22350 threadCommentsDepth, 22351 threadComments, 22352 commentsPerPage, 22353 pageComments 22354 } = (0, import_data26.useSelect)((select10) => { 22355 const { getSettings: getSettings2 } = select10(import_block_editor60.store); 22356 return getSettings2().__experimentalDiscussionSettings ?? {}; 22357 }, []); 22358 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 22359 (0, import_element44.useEffect)(() => { 22360 if (isSiteEditor) { 22361 const nestedCommentsNumber = threadComments ? Math.min(threadCommentsDepth, 3) - 1 : 0; 22362 const topLevelCommentsNumber = pageComments ? commentsPerPage : 3; 22363 const commentsNumber = parseInt(nestedCommentsNumber) + parseInt(topLevelCommentsNumber); 22364 setCommentsCount(Math.min(commentsNumber, 3)); 22365 return; 22366 } 22367 const currentPostId = postId; 22368 (0, import_api_fetch2.default)({ 22369 path: (0, import_url5.addQueryArgs)("/wp/v2/comments", { 22370 post: postId, 22371 _fields: "id" 22372 }), 22373 method: "HEAD", 22374 parse: false 22375 }).then((res) => { 22376 if (currentPostId === postId) { 22377 setCommentsCount( 22378 parseInt(res.headers.get("X-WP-Total")) 22379 ); 22380 } 22381 }).catch(() => { 22382 setCommentsCount(0); 22383 }); 22384 }, [postId]); 22385 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(import_block_editor60.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime260.jsx)( 22386 import_block_editor60.HeadingLevelDropdown, 22387 { 22388 value: level, 22389 options: levelOptions, 22390 onChange: (newLevel) => setAttributes({ level: newLevel }) 22391 } 22392 ) }); 22393 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(import_block_editor60.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)( 22394 import_components28.__experimentalToolsPanel, 22395 { 22396 label: (0, import_i18n49.__)("Settings"), 22397 resetAll: () => { 22398 setAttributes({ 22399 showPostTitle: true, 22400 showCommentsCount: true 22401 }); 22402 }, 22403 dropdownMenuProps, 22404 children: [ 22405 /* @__PURE__ */ (0, import_jsx_runtime260.jsx)( 22406 import_components28.__experimentalToolsPanelItem, 22407 { 22408 label: (0, import_i18n49.__)("Show post title"), 22409 isShownByDefault: true, 22410 hasValue: () => !showPostTitle, 22411 onDeselect: () => setAttributes({ showPostTitle: true }), 22412 children: /* @__PURE__ */ (0, import_jsx_runtime260.jsx)( 22413 import_components28.ToggleControl, 22414 { 22415 label: (0, import_i18n49.__)("Show post title"), 22416 checked: showPostTitle, 22417 onChange: (value) => setAttributes({ showPostTitle: value }) 22418 } 22419 ) 22420 } 22421 ), 22422 /* @__PURE__ */ (0, import_jsx_runtime260.jsx)( 22423 import_components28.__experimentalToolsPanelItem, 22424 { 22425 label: (0, import_i18n49.__)("Show comments count"), 22426 isShownByDefault: true, 22427 hasValue: () => !showCommentsCount, 22428 onDeselect: () => setAttributes({ showCommentsCount: true }), 22429 children: /* @__PURE__ */ (0, import_jsx_runtime260.jsx)( 22430 import_components28.ToggleControl, 22431 { 22432 label: (0, import_i18n49.__)("Show comments count"), 22433 checked: showCommentsCount, 22434 onChange: (value) => setAttributes({ showCommentsCount: value }) 22435 } 22436 ) 22437 } 22438 ) 22439 ] 22440 } 22441 ) }); 22442 const postTitle = isSiteEditor ? (0, import_i18n49.__)("Post Title") : rawTitle; 22443 let placeholder2; 22444 if (showCommentsCount && commentsCount !== void 0) { 22445 if (showPostTitle) { 22446 if (commentsCount === 1) { 22447 placeholder2 = (0, import_i18n49.sprintf)( 22448 /* translators: %s: Post title. */ 22449 (0, import_i18n49.__)('One response to "%s"'), 22450 postTitle 22451 ); 22452 } else { 22453 placeholder2 = (0, import_i18n49.sprintf)( 22454 /* translators: 1: Number of comments, 2: Post title. */ 22455 (0, import_i18n49._n)( 22456 '%1$s response to "%2$s"', 22457 '%1$s responses to "%2$s"', 22458 commentsCount 22459 ), 22460 commentsCount, 22461 postTitle 22462 ); 22463 } 22464 } else if (commentsCount === 1) { 22465 placeholder2 = (0, import_i18n49.__)("One response"); 22466 } else { 22467 placeholder2 = (0, import_i18n49.sprintf)( 22468 /* translators: %s: Number of comments. */ 22469 (0, import_i18n49._n)("%s response", "%s responses", commentsCount), 22470 commentsCount 22471 ); 22472 } 22473 } else if (showPostTitle) { 22474 if (commentsCount === 1) { 22475 placeholder2 = (0, import_i18n49.sprintf)((0, import_i18n49.__)('Response to "%s"'), postTitle); 22476 } else { 22477 placeholder2 = (0, import_i18n49.sprintf)((0, import_i18n49.__)('Responses to "%s"'), postTitle); 22478 } 22479 } else if (commentsCount === 1) { 22480 placeholder2 = (0, import_i18n49.__)("Response"); 22481 } else { 22482 placeholder2 = (0, import_i18n49.__)("Responses"); 22483 } 22484 return /* @__PURE__ */ (0, import_jsx_runtime260.jsxs)(import_jsx_runtime260.Fragment, { children: [ 22485 blockControls, 22486 inspectorControls, 22487 /* @__PURE__ */ (0, import_jsx_runtime260.jsx)(TagName2, { ...blockProps, children: placeholder2 }) 22488 ] }); 22489 } 22490 22491 // packages/block-library/build-module/comments-title/deprecated.mjs 22492 var v23 = { 22493 attributes: { 22494 textAlign: { 22495 type: "string" 22496 }, 22497 showPostTitle: { 22498 type: "boolean", 22499 default: true 22500 }, 22501 showCommentsCount: { 22502 type: "boolean", 22503 default: true 22504 }, 22505 level: { 22506 type: "number", 22507 default: 2 22508 }, 22509 levelOptions: { 22510 type: "array" 22511 } 22512 }, 22513 supports: { 22514 anchor: true, 22515 align: true, 22516 html: false, 22517 __experimentalBorder: { 22518 radius: true, 22519 color: true, 22520 width: true, 22521 style: true 22522 }, 22523 color: { 22524 gradients: true, 22525 __experimentalDefaultControls: { 22526 background: true, 22527 text: true 22528 } 22529 }, 22530 spacing: { 22531 margin: true, 22532 padding: true 22533 }, 22534 typography: { 22535 fontSize: true, 22536 lineHeight: true, 22537 __experimentalFontFamily: true, 22538 __experimentalFontWeight: true, 22539 __experimentalFontStyle: true, 22540 __experimentalTextTransform: true, 22541 __experimentalTextDecoration: true, 22542 __experimentalLetterSpacing: true, 22543 __experimentalDefaultControls: { 22544 fontSize: true, 22545 __experimentalFontFamily: true, 22546 __experimentalFontStyle: true, 22547 __experimentalFontWeight: true 22548 } 22549 }, 22550 interactivity: { 22551 clientNavigation: true 22552 } 22553 }, 22554 migrate: (oldAttributes) => { 22555 const { singleCommentLabel, multipleCommentsLabel, ...newAttributes } = oldAttributes; 22556 return migrate_text_align_default(newAttributes); 22557 }, 22558 isEligible(attributes2) { 22559 return !!attributes2.textAlign || !!attributes2.className?.match( 22560 /\bhas-text-align-(left|center|right)\b/ 22561 ); 22562 }, 22563 save: () => null 22564 }; 22565 var v111 = { 22566 attributes: { 22567 textAlign: { 22568 type: "string" 22569 }, 22570 showPostTitle: { 22571 type: "boolean", 22572 default: true 22573 }, 22574 showCommentsCount: { 22575 type: "boolean", 22576 default: true 22577 }, 22578 level: { 22579 type: "number", 22580 default: 2 22581 }, 22582 levelOptions: { 22583 type: "array" 22584 }, 22585 singleCommentLabel: { 22586 type: "string" 22587 }, 22588 multipleCommentsLabel: { 22589 type: "string" 22590 } 22591 }, 22592 supports: { 22593 anchor: true, 22594 align: true, 22595 html: false, 22596 __experimentalBorder: { 22597 radius: true, 22598 color: true, 22599 width: true, 22600 style: true 22601 }, 22602 color: { 22603 gradients: true, 22604 __experimentalDefaultControls: { 22605 background: true, 22606 text: true 22607 } 22608 }, 22609 spacing: { 22610 margin: true, 22611 padding: true 22612 }, 22613 typography: { 22614 fontSize: true, 22615 lineHeight: true, 22616 __experimentalFontFamily: true, 22617 __experimentalFontWeight: true, 22618 __experimentalFontStyle: true, 22619 __experimentalTextTransform: true, 22620 __experimentalTextDecoration: true, 22621 __experimentalLetterSpacing: true, 22622 __experimentalDefaultControls: { 22623 fontSize: true, 22624 __experimentalFontFamily: true, 22625 __experimentalFontStyle: true, 22626 __experimentalFontWeight: true 22627 } 22628 }, 22629 interactivity: { 22630 clientNavigation: true 22631 } 22632 }, 22633 migrate: (oldAttributes) => { 22634 const { singleCommentLabel, multipleCommentsLabel, ...newAttributes } = oldAttributes; 22635 return migrate_text_align_default(newAttributes); 22636 }, 22637 isEligible: ({ multipleCommentsLabel, singleCommentLabel }) => multipleCommentsLabel || singleCommentLabel, 22638 save: () => null 22639 }; 22640 var deprecated_default13 = [v23, v111]; 22641 22642 // packages/block-library/build-module/comments-title/index.mjs 22643 var { name: name29 } = block_default30; 22644 var settings29 = { 22645 icon: title_default, 22646 edit: Edit12, 22647 deprecated: deprecated_default13, 22648 example: {} 22649 }; 22650 var init29 = () => initBlock({ name: name29, metadata: block_default30, settings: settings29 }); 22651 22652 // packages/block-library/build-module/cover/index.mjs 22653 var cover_exports = {}; 22654 __export(cover_exports, { 22655 init: () => init30, 22656 metadata: () => block_default31, 22657 name: () => name30, 22658 settings: () => settings30 22659 }); 22660 var import_i18n58 = __toESM(require_i18n(), 1); 22661 var import_blocks23 = __toESM(require_blocks(), 1); 22662 22663 // packages/block-library/build-module/cover/deprecated.mjs 22664 var import_blocks19 = __toESM(require_blocks(), 1); 22665 var import_block_editor61 = __toESM(require_block_editor(), 1); 22666 var import_i18n50 = __toESM(require_i18n(), 1); 22667 var import_compose17 = __toESM(require_compose(), 1); 22668 22669 // packages/block-library/build-module/cover/shared.mjs 22670 var import_blob4 = __toESM(require_blob(), 1); 22671 var POSITION_CLASSNAMES = { 22672 "top left": "is-position-top-left", 22673 "top center": "is-position-top-center", 22674 "top right": "is-position-top-right", 22675 "center left": "is-position-center-left", 22676 "center center": "is-position-center-center", 22677 center: "is-position-center-center", 22678 "center right": "is-position-center-right", 22679 "bottom left": "is-position-bottom-left", 22680 "bottom center": "is-position-bottom-center", 22681 "bottom right": "is-position-bottom-right" 22682 }; 22683 var IMAGE_BACKGROUND_TYPE = "image"; 22684 var VIDEO_BACKGROUND_TYPE = "video"; 22685 var EMBED_VIDEO_BACKGROUND_TYPE = "embed-video"; 22686 var COVER_MIN_HEIGHT = 50; 22687 var DEFAULT_FOCAL_POINT = { x: 0.5, y: 0.5 }; 22688 var ALLOWED_MEDIA_TYPES2 = ["image", "video"]; 22689 function mediaPosition({ x: x3, y: y2 } = DEFAULT_FOCAL_POINT) { 22690 return `$Math.round(x3 * 100)}% $Math.round(y2 * 100)}%`; 22691 } 22692 function dimRatioToClass(ratio) { 22693 return ratio === 50 || ratio === void 0 ? null : "has-background-dim-" + 10 * Math.round(ratio / 10); 22694 } 22695 function attributesFromMedia(media) { 22696 if (!media || !media.url && !media.src) { 22697 return { 22698 url: void 0, 22699 id: void 0 22700 }; 22701 } 22702 if ((0, import_blob4.isBlobURL)(media.url)) { 22703 media.type = (0, import_blob4.getBlobTypeByURL)(media.url); 22704 } 22705 let mediaType; 22706 if (media.media_type) { 22707 if (media.media_type === IMAGE_BACKGROUND_TYPE) { 22708 mediaType = IMAGE_BACKGROUND_TYPE; 22709 } else { 22710 mediaType = VIDEO_BACKGROUND_TYPE; 22711 } 22712 } else if (media.type && (media.type === IMAGE_BACKGROUND_TYPE || media.type === VIDEO_BACKGROUND_TYPE)) { 22713 mediaType = media.type; 22714 } else { 22715 return; 22716 } 22717 return { 22718 url: media.url || media.src, 22719 id: media.id, 22720 alt: media?.alt, 22721 backgroundType: mediaType, 22722 ...mediaType === VIDEO_BACKGROUND_TYPE ? { hasParallax: void 0 } : {} 22723 }; 22724 } 22725 function isContentPositionCenter(contentPosition) { 22726 return !contentPosition || contentPosition === "center center" || contentPosition === "center"; 22727 } 22728 function getPositionClassName(contentPosition) { 22729 if (isContentPositionCenter(contentPosition)) { 22730 return ""; 22731 } 22732 return POSITION_CLASSNAMES[contentPosition]; 22733 } 22734 22735 // packages/block-library/build-module/cover/deprecated.mjs 22736 var import_jsx_runtime261 = __toESM(require_jsx_runtime(), 1); 22737 function backgroundImageStyles(url) { 22738 return url ? { backgroundImage: `url($url})` } : {}; 22739 } 22740 function dimRatioToClassV1(ratio) { 22741 return ratio === 0 || ratio === 50 || !ratio ? null : "has-background-dim-" + 10 * Math.round(ratio / 10); 22742 } 22743 function migrateDimRatio(attributes2) { 22744 return { 22745 ...attributes2, 22746 dimRatio: !attributes2.url ? 100 : attributes2.dimRatio 22747 }; 22748 } 22749 function migrateTag(attributes2) { 22750 if (!attributes2.tagName) { 22751 attributes2 = { 22752 ...attributes2, 22753 tagName: "div" 22754 }; 22755 } 22756 return { 22757 ...attributes2 22758 }; 22759 } 22760 var blockAttributes2 = { 22761 url: { 22762 type: "string" 22763 }, 22764 id: { 22765 type: "number" 22766 }, 22767 hasParallax: { 22768 type: "boolean", 22769 default: false 22770 }, 22771 dimRatio: { 22772 type: "number", 22773 default: 50 22774 }, 22775 overlayColor: { 22776 type: "string" 22777 }, 22778 customOverlayColor: { 22779 type: "string" 22780 }, 22781 backgroundType: { 22782 type: "string", 22783 default: "image" 22784 }, 22785 focalPoint: { 22786 type: "object" 22787 } 22788 }; 22789 var v8ToV11BlockAttributes = { 22790 url: { 22791 type: "string" 22792 }, 22793 id: { 22794 type: "number" 22795 }, 22796 alt: { 22797 type: "string", 22798 source: "attribute", 22799 selector: "img", 22800 attribute: "alt", 22801 default: "" 22802 }, 22803 hasParallax: { 22804 type: "boolean", 22805 default: false 22806 }, 22807 isRepeated: { 22808 type: "boolean", 22809 default: false 22810 }, 22811 dimRatio: { 22812 type: "number", 22813 default: 100 22814 }, 22815 overlayColor: { 22816 type: "string" 22817 }, 22818 customOverlayColor: { 22819 type: "string" 22820 }, 22821 backgroundType: { 22822 type: "string", 22823 default: "image" 22824 }, 22825 focalPoint: { 22826 type: "object" 22827 }, 22828 minHeight: { 22829 type: "number" 22830 }, 22831 minHeightUnit: { 22832 type: "string" 22833 }, 22834 gradient: { 22835 type: "string" 22836 }, 22837 customGradient: { 22838 type: "string" 22839 }, 22840 contentPosition: { 22841 type: "string" 22842 }, 22843 isDark: { 22844 type: "boolean", 22845 default: true 22846 }, 22847 allowedBlocks: { 22848 type: "array" 22849 }, 22850 templateLock: { 22851 type: ["string", "boolean"], 22852 enum: ["all", "insert", false] 22853 } 22854 }; 22855 var v12toV13BlockAttributes = { 22856 ...v8ToV11BlockAttributes, 22857 useFeaturedImage: { 22858 type: "boolean", 22859 default: false 22860 }, 22861 tagName: { 22862 type: "string", 22863 default: "div" 22864 } 22865 }; 22866 var v14BlockAttributes = { 22867 ...v12toV13BlockAttributes, 22868 isUserOverlayColor: { 22869 type: "boolean" 22870 }, 22871 sizeSlug: { 22872 type: "string" 22873 }, 22874 alt: { 22875 type: "string", 22876 default: "" 22877 } 22878 }; 22879 var v7toV11BlockSupports = { 22880 anchor: true, 22881 align: true, 22882 html: false, 22883 spacing: { 22884 padding: true, 22885 __experimentalDefaultControls: { 22886 padding: true 22887 } 22888 }, 22889 color: { 22890 __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background", 22891 text: false, 22892 background: false 22893 } 22894 }; 22895 var v12BlockSupports = { 22896 ...v7toV11BlockSupports, 22897 spacing: { 22898 padding: true, 22899 margin: ["top", "bottom"], 22900 blockGap: true, 22901 __experimentalDefaultControls: { 22902 padding: true, 22903 blockGap: true 22904 } 22905 }, 22906 __experimentalBorder: { 22907 color: true, 22908 radius: true, 22909 style: true, 22910 width: true, 22911 __experimentalDefaultControls: { 22912 color: true, 22913 radius: true, 22914 style: true, 22915 width: true 22916 } 22917 }, 22918 color: { 22919 __experimentalDuotone: "> .wp-block-cover__image-background, > .wp-block-cover__video-background", 22920 heading: true, 22921 text: true, 22922 background: false, 22923 __experimentalSkipSerialization: ["gradients"], 22924 enableContrastChecker: false 22925 }, 22926 typography: { 22927 fontSize: true, 22928 lineHeight: true, 22929 __experimentalFontFamily: true, 22930 __experimentalFontWeight: true, 22931 __experimentalFontStyle: true, 22932 __experimentalTextTransform: true, 22933 __experimentalTextDecoration: true, 22934 __experimentalLetterSpacing: true, 22935 __experimentalDefaultControls: { 22936 fontSize: true 22937 } 22938 }, 22939 layout: { 22940 allowJustification: false 22941 } 22942 }; 22943 var v14BlockSupports = { 22944 ...v12BlockSupports, 22945 shadow: true, 22946 dimensions: { 22947 aspectRatio: true 22948 }, 22949 interactivity: { 22950 clientNavigation: true 22951 } 22952 }; 22953 var v142 = { 22954 attributes: v14BlockAttributes, 22955 supports: v14BlockSupports, 22956 save({ attributes: attributes2 }) { 22957 const { 22958 backgroundType, 22959 gradient, 22960 contentPosition, 22961 customGradient, 22962 customOverlayColor, 22963 dimRatio, 22964 focalPoint, 22965 useFeaturedImage, 22966 hasParallax, 22967 isDark: isDark2, 22968 isRepeated, 22969 overlayColor, 22970 url, 22971 alt, 22972 id, 22973 minHeight: minHeightProp, 22974 minHeightUnit, 22975 tagName: Tag, 22976 sizeSlug 22977 } = attributes2; 22978 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 22979 "background-color", 22980 overlayColor 22981 ); 22982 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 22983 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 22984 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 22985 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 22986 const isImgElement = !(hasParallax || isRepeated); 22987 const style2 = { 22988 minHeight: minHeight || void 0 22989 }; 22990 const bgStyle = { 22991 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 22992 background: customGradient ? customGradient : void 0 22993 }; 22994 const objectPosition = ( 22995 // prettier-ignore 22996 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 22997 ); 22998 const backgroundImage = url ? `url($url})` : void 0; 22999 const backgroundPosition = mediaPosition(focalPoint); 23000 const classes = clsx_default( 23001 { 23002 "is-light": !isDark2, 23003 "has-parallax": hasParallax, 23004 "is-repeated": isRepeated, 23005 "has-custom-content-position": !isContentPositionCenter(contentPosition) 23006 }, 23007 getPositionClassName(contentPosition) 23008 ); 23009 const imgClasses = clsx_default( 23010 "wp-block-cover__image-background", 23011 id ? `wp-image-$id}` : null, 23012 { 23013 [`size-$sizeSlug}`]: sizeSlug, 23014 "has-parallax": hasParallax, 23015 "is-repeated": isRepeated 23016 } 23017 ); 23018 const gradientValue = gradient || customGradient; 23019 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(Tag, { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 23020 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23021 "span", 23022 { 23023 "aria-hidden": "true", 23024 className: clsx_default( 23025 "wp-block-cover__background", 23026 overlayColorClass, 23027 dimRatioToClass(dimRatio), 23028 { 23029 "has-background-dim": dimRatio !== void 0, 23030 // For backwards compatibility. Former versions of the Cover Block applied 23031 // `.wp-block-cover__gradient-background` in the presence of 23032 // media, a gradient and a dim. 23033 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 23034 "has-background-gradient": gradientValue, 23035 [gradientClass]: gradientClass 23036 } 23037 ), 23038 style: bgStyle 23039 } 23040 ), 23041 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23042 "img", 23043 { 23044 className: imgClasses, 23045 alt, 23046 src: url, 23047 style: { objectPosition }, 23048 "data-object-fit": "cover", 23049 "data-object-position": objectPosition 23050 } 23051 ) : /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23052 "div", 23053 { 23054 role: alt ? "img" : void 0, 23055 "aria-label": alt ? alt : void 0, 23056 className: imgClasses, 23057 style: { backgroundPosition, backgroundImage } 23058 } 23059 )), 23060 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23061 "video", 23062 { 23063 className: clsx_default( 23064 "wp-block-cover__video-background", 23065 "intrinsic-ignore" 23066 ), 23067 autoPlay: true, 23068 muted: true, 23069 loop: true, 23070 playsInline: true, 23071 src: url, 23072 style: { objectPosition }, 23073 "data-object-fit": "cover", 23074 "data-object-position": objectPosition 23075 } 23076 ), 23077 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23078 "div", 23079 { 23080 ...import_block_editor61.useInnerBlocksProps.save({ 23081 className: "wp-block-cover__inner-container" 23082 }) 23083 } 23084 ) 23085 ] }); 23086 } 23087 }; 23088 var v132 = { 23089 attributes: v12toV13BlockAttributes, 23090 supports: v12BlockSupports, 23091 save({ attributes: attributes2 }) { 23092 const { 23093 backgroundType, 23094 gradient, 23095 contentPosition, 23096 customGradient, 23097 customOverlayColor, 23098 dimRatio, 23099 focalPoint, 23100 useFeaturedImage, 23101 hasParallax, 23102 isDark: isDark2, 23103 isRepeated, 23104 overlayColor, 23105 url, 23106 alt, 23107 id, 23108 minHeight: minHeightProp, 23109 minHeightUnit, 23110 tagName: Tag 23111 } = attributes2; 23112 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 23113 "background-color", 23114 overlayColor 23115 ); 23116 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 23117 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 23118 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 23119 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 23120 const isImgElement = !(hasParallax || isRepeated); 23121 const style2 = { 23122 minHeight: minHeight || void 0 23123 }; 23124 const bgStyle = { 23125 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 23126 background: customGradient ? customGradient : void 0 23127 }; 23128 const objectPosition = ( 23129 // prettier-ignore 23130 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 23131 ); 23132 const backgroundImage = url ? `url($url})` : void 0; 23133 const backgroundPosition = mediaPosition(focalPoint); 23134 const classes = clsx_default( 23135 { 23136 "is-light": !isDark2, 23137 "has-parallax": hasParallax, 23138 "is-repeated": isRepeated, 23139 "has-custom-content-position": !isContentPositionCenter(contentPosition) 23140 }, 23141 getPositionClassName(contentPosition) 23142 ); 23143 const imgClasses = clsx_default( 23144 "wp-block-cover__image-background", 23145 id ? `wp-image-$id}` : null, 23146 { 23147 "has-parallax": hasParallax, 23148 "is-repeated": isRepeated 23149 } 23150 ); 23151 const gradientValue = gradient || customGradient; 23152 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(Tag, { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 23153 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23154 "span", 23155 { 23156 "aria-hidden": "true", 23157 className: clsx_default( 23158 "wp-block-cover__background", 23159 overlayColorClass, 23160 dimRatioToClass(dimRatio), 23161 { 23162 "has-background-dim": dimRatio !== void 0, 23163 // For backwards compatibility. Former versions of the Cover Block applied 23164 // `.wp-block-cover__gradient-background` in the presence of 23165 // media, a gradient and a dim. 23166 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 23167 "has-background-gradient": gradientValue, 23168 [gradientClass]: gradientClass 23169 } 23170 ), 23171 style: bgStyle 23172 } 23173 ), 23174 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23175 "img", 23176 { 23177 className: imgClasses, 23178 alt, 23179 src: url, 23180 style: { objectPosition }, 23181 "data-object-fit": "cover", 23182 "data-object-position": objectPosition 23183 } 23184 ) : /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23185 "div", 23186 { 23187 role: "img", 23188 className: imgClasses, 23189 style: { backgroundPosition, backgroundImage } 23190 } 23191 )), 23192 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23193 "video", 23194 { 23195 className: clsx_default( 23196 "wp-block-cover__video-background", 23197 "intrinsic-ignore" 23198 ), 23199 autoPlay: true, 23200 muted: true, 23201 loop: true, 23202 playsInline: true, 23203 src: url, 23204 style: { objectPosition }, 23205 "data-object-fit": "cover", 23206 "data-object-position": objectPosition 23207 } 23208 ), 23209 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23210 "div", 23211 { 23212 ...import_block_editor61.useInnerBlocksProps.save({ 23213 className: "wp-block-cover__inner-container" 23214 }) 23215 } 23216 ) 23217 ] }); 23218 } 23219 }; 23220 var v122 = { 23221 attributes: v12toV13BlockAttributes, 23222 supports: v12BlockSupports, 23223 isEligible(attributes2) { 23224 return (attributes2.customOverlayColor !== void 0 || attributes2.overlayColor !== void 0) && attributes2.isUserOverlayColor === void 0; 23225 }, 23226 migrate(attributes2) { 23227 return { 23228 ...attributes2, 23229 isUserOverlayColor: true 23230 }; 23231 }, 23232 save({ attributes: attributes2 }) { 23233 const { 23234 backgroundType, 23235 gradient, 23236 contentPosition, 23237 customGradient, 23238 customOverlayColor, 23239 dimRatio, 23240 focalPoint, 23241 useFeaturedImage, 23242 hasParallax, 23243 isDark: isDark2, 23244 isRepeated, 23245 overlayColor, 23246 url, 23247 alt, 23248 id, 23249 minHeight: minHeightProp, 23250 minHeightUnit, 23251 tagName: Tag 23252 } = attributes2; 23253 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 23254 "background-color", 23255 overlayColor 23256 ); 23257 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 23258 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 23259 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 23260 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 23261 const isImgElement = !(hasParallax || isRepeated); 23262 const style2 = { 23263 minHeight: minHeight || void 0 23264 }; 23265 const bgStyle = { 23266 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 23267 background: customGradient ? customGradient : void 0 23268 }; 23269 const objectPosition = ( 23270 // prettier-ignore 23271 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 23272 ); 23273 const backgroundImage = url ? `url($url})` : void 0; 23274 const backgroundPosition = mediaPosition(focalPoint); 23275 const classes = clsx_default( 23276 { 23277 "is-light": !isDark2, 23278 "has-parallax": hasParallax, 23279 "is-repeated": isRepeated, 23280 "has-custom-content-position": !isContentPositionCenter(contentPosition) 23281 }, 23282 getPositionClassName(contentPosition) 23283 ); 23284 const imgClasses = clsx_default( 23285 "wp-block-cover__image-background", 23286 id ? `wp-image-$id}` : null, 23287 { 23288 "has-parallax": hasParallax, 23289 "is-repeated": isRepeated 23290 } 23291 ); 23292 const gradientValue = gradient || customGradient; 23293 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)(Tag, { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 23294 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23295 "span", 23296 { 23297 "aria-hidden": "true", 23298 className: clsx_default( 23299 "wp-block-cover__background", 23300 overlayColorClass, 23301 dimRatioToClass(dimRatio), 23302 { 23303 "has-background-dim": dimRatio !== void 0, 23304 // For backwards compatibility. Former versions of the Cover Block applied 23305 // `.wp-block-cover__gradient-background` in the presence of 23306 // media, a gradient and a dim. 23307 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 23308 "has-background-gradient": gradientValue, 23309 [gradientClass]: gradientClass 23310 } 23311 ), 23312 style: bgStyle 23313 } 23314 ), 23315 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23316 "img", 23317 { 23318 className: imgClasses, 23319 alt, 23320 src: url, 23321 style: { objectPosition }, 23322 "data-object-fit": "cover", 23323 "data-object-position": objectPosition 23324 } 23325 ) : /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23326 "div", 23327 { 23328 role: "img", 23329 className: imgClasses, 23330 style: { backgroundPosition, backgroundImage } 23331 } 23332 )), 23333 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23334 "video", 23335 { 23336 className: clsx_default( 23337 "wp-block-cover__video-background", 23338 "intrinsic-ignore" 23339 ), 23340 autoPlay: true, 23341 muted: true, 23342 loop: true, 23343 playsInline: true, 23344 src: url, 23345 style: { objectPosition }, 23346 "data-object-fit": "cover", 23347 "data-object-position": objectPosition 23348 } 23349 ), 23350 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23351 "div", 23352 { 23353 ...import_block_editor61.useInnerBlocksProps.save({ 23354 className: "wp-block-cover__inner-container" 23355 }) 23356 } 23357 ) 23358 ] }); 23359 } 23360 }; 23361 var v112 = { 23362 attributes: v8ToV11BlockAttributes, 23363 supports: v7toV11BlockSupports, 23364 save({ attributes: attributes2 }) { 23365 const { 23366 backgroundType, 23367 gradient, 23368 contentPosition, 23369 customGradient, 23370 customOverlayColor, 23371 dimRatio, 23372 focalPoint, 23373 useFeaturedImage, 23374 hasParallax, 23375 isDark: isDark2, 23376 isRepeated, 23377 overlayColor, 23378 url, 23379 alt, 23380 id, 23381 minHeight: minHeightProp, 23382 minHeightUnit 23383 } = attributes2; 23384 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 23385 "background-color", 23386 overlayColor 23387 ); 23388 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 23389 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 23390 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 23391 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 23392 const isImgElement = !(hasParallax || isRepeated); 23393 const style2 = { 23394 minHeight: minHeight || void 0 23395 }; 23396 const bgStyle = { 23397 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 23398 background: customGradient ? customGradient : void 0 23399 }; 23400 const objectPosition = ( 23401 // prettier-ignore 23402 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 23403 ); 23404 const backgroundImage = url ? `url($url})` : void 0; 23405 const backgroundPosition = mediaPosition(focalPoint); 23406 const classes = clsx_default( 23407 { 23408 "is-light": !isDark2, 23409 "has-parallax": hasParallax, 23410 "is-repeated": isRepeated, 23411 "has-custom-content-position": !isContentPositionCenter(contentPosition) 23412 }, 23413 getPositionClassName(contentPosition) 23414 ); 23415 const imgClasses = clsx_default( 23416 "wp-block-cover__image-background", 23417 id ? `wp-image-$id}` : null, 23418 { 23419 "has-parallax": hasParallax, 23420 "is-repeated": isRepeated 23421 } 23422 ); 23423 const gradientValue = gradient || customGradient; 23424 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 23425 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23426 "span", 23427 { 23428 "aria-hidden": "true", 23429 className: clsx_default( 23430 "wp-block-cover__background", 23431 overlayColorClass, 23432 dimRatioToClass(dimRatio), 23433 { 23434 "has-background-dim": dimRatio !== void 0, 23435 // For backwards compatibility. Former versions of the Cover Block applied 23436 // `.wp-block-cover__gradient-background` in the presence of 23437 // media, a gradient and a dim. 23438 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 23439 "has-background-gradient": gradientValue, 23440 [gradientClass]: gradientClass 23441 } 23442 ), 23443 style: bgStyle 23444 } 23445 ), 23446 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23447 "img", 23448 { 23449 className: imgClasses, 23450 alt, 23451 src: url, 23452 style: { objectPosition }, 23453 "data-object-fit": "cover", 23454 "data-object-position": objectPosition 23455 } 23456 ) : /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23457 "div", 23458 { 23459 role: "img", 23460 className: imgClasses, 23461 style: { backgroundPosition, backgroundImage } 23462 } 23463 )), 23464 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23465 "video", 23466 { 23467 className: clsx_default( 23468 "wp-block-cover__video-background", 23469 "intrinsic-ignore" 23470 ), 23471 autoPlay: true, 23472 muted: true, 23473 loop: true, 23474 playsInline: true, 23475 src: url, 23476 style: { objectPosition }, 23477 "data-object-fit": "cover", 23478 "data-object-position": objectPosition 23479 } 23480 ), 23481 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23482 "div", 23483 { 23484 ...import_block_editor61.useInnerBlocksProps.save({ 23485 className: "wp-block-cover__inner-container" 23486 }) 23487 } 23488 ) 23489 ] }); 23490 }, 23491 migrate: migrateTag 23492 }; 23493 var v102 = { 23494 attributes: v8ToV11BlockAttributes, 23495 supports: v7toV11BlockSupports, 23496 save({ attributes: attributes2 }) { 23497 const { 23498 backgroundType, 23499 gradient, 23500 contentPosition, 23501 customGradient, 23502 customOverlayColor, 23503 dimRatio, 23504 focalPoint, 23505 useFeaturedImage, 23506 hasParallax, 23507 isDark: isDark2, 23508 isRepeated, 23509 overlayColor, 23510 url, 23511 alt, 23512 id, 23513 minHeight: minHeightProp, 23514 minHeightUnit 23515 } = attributes2; 23516 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 23517 "background-color", 23518 overlayColor 23519 ); 23520 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 23521 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 23522 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 23523 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 23524 const isImgElement = !(hasParallax || isRepeated); 23525 const style2 = { 23526 ...isImageBackground && !isImgElement && !useFeaturedImage ? backgroundImageStyles(url) : {}, 23527 minHeight: minHeight || void 0 23528 }; 23529 const bgStyle = { 23530 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 23531 background: customGradient ? customGradient : void 0 23532 }; 23533 const objectPosition = ( 23534 // prettier-ignore 23535 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : void 0 23536 ); 23537 const classes = clsx_default( 23538 { 23539 "is-light": !isDark2, 23540 "has-parallax": hasParallax, 23541 "is-repeated": isRepeated, 23542 "has-custom-content-position": !isContentPositionCenter(contentPosition) 23543 }, 23544 getPositionClassName(contentPosition) 23545 ); 23546 const gradientValue = gradient || customGradient; 23547 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 23548 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23549 "span", 23550 { 23551 "aria-hidden": "true", 23552 className: clsx_default( 23553 "wp-block-cover__background", 23554 overlayColorClass, 23555 dimRatioToClass(dimRatio), 23556 { 23557 "has-background-dim": dimRatio !== void 0, 23558 // For backwards compatibility. Former versions of the Cover Block applied 23559 // `.wp-block-cover__gradient-background` in the presence of 23560 // media, a gradient and a dim. 23561 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 23562 "has-background-gradient": gradientValue, 23563 [gradientClass]: gradientClass 23564 } 23565 ), 23566 style: bgStyle 23567 } 23568 ), 23569 !useFeaturedImage && isImageBackground && isImgElement && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23570 "img", 23571 { 23572 className: clsx_default( 23573 "wp-block-cover__image-background", 23574 id ? `wp-image-$id}` : null 23575 ), 23576 alt, 23577 src: url, 23578 style: { objectPosition }, 23579 "data-object-fit": "cover", 23580 "data-object-position": objectPosition 23581 } 23582 ), 23583 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23584 "video", 23585 { 23586 className: clsx_default( 23587 "wp-block-cover__video-background", 23588 "intrinsic-ignore" 23589 ), 23590 autoPlay: true, 23591 muted: true, 23592 loop: true, 23593 playsInline: true, 23594 src: url, 23595 style: { objectPosition }, 23596 "data-object-fit": "cover", 23597 "data-object-position": objectPosition 23598 } 23599 ), 23600 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23601 "div", 23602 { 23603 ...import_block_editor61.useInnerBlocksProps.save({ 23604 className: "wp-block-cover__inner-container" 23605 }) 23606 } 23607 ) 23608 ] }); 23609 }, 23610 migrate: migrateTag 23611 }; 23612 var v9 = { 23613 attributes: v8ToV11BlockAttributes, 23614 supports: v7toV11BlockSupports, 23615 save({ attributes: attributes2 }) { 23616 const { 23617 backgroundType, 23618 gradient, 23619 contentPosition, 23620 customGradient, 23621 customOverlayColor, 23622 dimRatio, 23623 focalPoint, 23624 hasParallax, 23625 isDark: isDark2, 23626 isRepeated, 23627 overlayColor, 23628 url, 23629 alt, 23630 id, 23631 minHeight: minHeightProp, 23632 minHeightUnit 23633 } = attributes2; 23634 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 23635 "background-color", 23636 overlayColor 23637 ); 23638 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 23639 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 23640 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 23641 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 23642 const isImgElement = !(hasParallax || isRepeated); 23643 const style2 = { 23644 ...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}, 23645 minHeight: minHeight || void 0 23646 }; 23647 const bgStyle = { 23648 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 23649 background: customGradient ? customGradient : void 0 23650 }; 23651 const objectPosition = ( 23652 // prettier-ignore 23653 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : void 0 23654 ); 23655 const classes = clsx_default( 23656 { 23657 "is-light": !isDark2, 23658 "has-parallax": hasParallax, 23659 "is-repeated": isRepeated, 23660 "has-custom-content-position": !isContentPositionCenter(contentPosition) 23661 }, 23662 getPositionClassName(contentPosition) 23663 ); 23664 const gradientValue = gradient || customGradient; 23665 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 23666 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23667 "span", 23668 { 23669 "aria-hidden": "true", 23670 className: clsx_default( 23671 "wp-block-cover__background", 23672 overlayColorClass, 23673 dimRatioToClass(dimRatio), 23674 { 23675 "has-background-dim": dimRatio !== void 0, 23676 // For backwards compatibility. Former versions of the Cover Block applied 23677 // `.wp-block-cover__gradient-background` in the presence of 23678 // media, a gradient and a dim. 23679 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 23680 "has-background-gradient": gradientValue, 23681 [gradientClass]: gradientClass 23682 } 23683 ), 23684 style: bgStyle 23685 } 23686 ), 23687 isImageBackground && isImgElement && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23688 "img", 23689 { 23690 className: clsx_default( 23691 "wp-block-cover__image-background", 23692 id ? `wp-image-$id}` : null 23693 ), 23694 alt, 23695 src: url, 23696 style: { objectPosition }, 23697 "data-object-fit": "cover", 23698 "data-object-position": objectPosition 23699 } 23700 ), 23701 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23702 "video", 23703 { 23704 className: clsx_default( 23705 "wp-block-cover__video-background", 23706 "intrinsic-ignore" 23707 ), 23708 autoPlay: true, 23709 muted: true, 23710 loop: true, 23711 playsInline: true, 23712 src: url, 23713 style: { objectPosition }, 23714 "data-object-fit": "cover", 23715 "data-object-position": objectPosition 23716 } 23717 ), 23718 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23719 "div", 23720 { 23721 ...import_block_editor61.useInnerBlocksProps.save({ 23722 className: "wp-block-cover__inner-container" 23723 }) 23724 } 23725 ) 23726 ] }); 23727 }, 23728 migrate: migrateTag 23729 }; 23730 var v8 = { 23731 attributes: v8ToV11BlockAttributes, 23732 supports: v7toV11BlockSupports, 23733 save({ attributes: attributes2 }) { 23734 const { 23735 backgroundType, 23736 gradient, 23737 contentPosition, 23738 customGradient, 23739 customOverlayColor, 23740 dimRatio, 23741 focalPoint, 23742 hasParallax, 23743 isDark: isDark2, 23744 isRepeated, 23745 overlayColor, 23746 url, 23747 alt, 23748 id, 23749 minHeight: minHeightProp, 23750 minHeightUnit 23751 } = attributes2; 23752 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 23753 "background-color", 23754 overlayColor 23755 ); 23756 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 23757 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 23758 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 23759 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 23760 const isImgElement = !(hasParallax || isRepeated); 23761 const style2 = { 23762 ...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}, 23763 minHeight: minHeight || void 0 23764 }; 23765 const bgStyle = { 23766 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 23767 background: customGradient ? customGradient : void 0 23768 }; 23769 const objectPosition = ( 23770 // prettier-ignore 23771 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : void 0 23772 ); 23773 const classes = clsx_default( 23774 { 23775 "is-light": !isDark2, 23776 "has-parallax": hasParallax, 23777 "is-repeated": isRepeated, 23778 "has-custom-content-position": !isContentPositionCenter(contentPosition) 23779 }, 23780 getPositionClassName(contentPosition) 23781 ); 23782 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 23783 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23784 "span", 23785 { 23786 "aria-hidden": "true", 23787 className: clsx_default( 23788 overlayColorClass, 23789 dimRatioToClass(dimRatio), 23790 "wp-block-cover__gradient-background", 23791 gradientClass, 23792 { 23793 "has-background-dim": dimRatio !== void 0, 23794 "has-background-gradient": gradient || customGradient, 23795 [gradientClass]: !url && gradientClass 23796 } 23797 ), 23798 style: bgStyle 23799 } 23800 ), 23801 isImageBackground && isImgElement && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23802 "img", 23803 { 23804 className: clsx_default( 23805 "wp-block-cover__image-background", 23806 id ? `wp-image-$id}` : null 23807 ), 23808 alt, 23809 src: url, 23810 style: { objectPosition }, 23811 "data-object-fit": "cover", 23812 "data-object-position": objectPosition 23813 } 23814 ), 23815 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23816 "video", 23817 { 23818 className: clsx_default( 23819 "wp-block-cover__video-background", 23820 "intrinsic-ignore" 23821 ), 23822 autoPlay: true, 23823 muted: true, 23824 loop: true, 23825 playsInline: true, 23826 src: url, 23827 style: { objectPosition }, 23828 "data-object-fit": "cover", 23829 "data-object-position": objectPosition 23830 } 23831 ), 23832 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23833 "div", 23834 { 23835 ...import_block_editor61.useInnerBlocksProps.save({ 23836 className: "wp-block-cover__inner-container" 23837 }) 23838 } 23839 ) 23840 ] }); 23841 }, 23842 migrate: migrateTag 23843 }; 23844 var v7 = { 23845 attributes: { 23846 ...blockAttributes2, 23847 isRepeated: { 23848 type: "boolean", 23849 default: false 23850 }, 23851 minHeight: { 23852 type: "number" 23853 }, 23854 minHeightUnit: { 23855 type: "string" 23856 }, 23857 gradient: { 23858 type: "string" 23859 }, 23860 customGradient: { 23861 type: "string" 23862 }, 23863 contentPosition: { 23864 type: "string" 23865 }, 23866 alt: { 23867 type: "string", 23868 source: "attribute", 23869 selector: "img", 23870 attribute: "alt", 23871 default: "" 23872 } 23873 }, 23874 supports: v7toV11BlockSupports, 23875 save({ attributes: attributes2 }) { 23876 const { 23877 backgroundType, 23878 gradient, 23879 contentPosition, 23880 customGradient, 23881 customOverlayColor, 23882 dimRatio, 23883 focalPoint, 23884 hasParallax, 23885 isRepeated, 23886 overlayColor, 23887 url, 23888 alt, 23889 id, 23890 minHeight: minHeightProp, 23891 minHeightUnit 23892 } = attributes2; 23893 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 23894 "background-color", 23895 overlayColor 23896 ); 23897 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 23898 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 23899 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 23900 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 23901 const isImgElement = !(hasParallax || isRepeated); 23902 const style2 = { 23903 ...isImageBackground && !isImgElement ? backgroundImageStyles(url) : {}, 23904 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 23905 background: customGradient && !url ? customGradient : void 0, 23906 minHeight: minHeight || void 0 23907 }; 23908 const objectPosition = ( 23909 // prettier-ignore 23910 focalPoint && isImgElement ? `$Math.round(focalPoint.x * 100)}% $Math.round(focalPoint.y * 100)}%` : void 0 23911 ); 23912 const classes = clsx_default( 23913 dimRatioToClassV1(dimRatio), 23914 overlayColorClass, 23915 { 23916 "has-background-dim": dimRatio !== 0, 23917 "has-parallax": hasParallax, 23918 "is-repeated": isRepeated, 23919 "has-background-gradient": gradient || customGradient, 23920 [gradientClass]: !url && gradientClass, 23921 "has-custom-content-position": !isContentPositionCenter(contentPosition) 23922 }, 23923 getPositionClassName(contentPosition) 23924 ); 23925 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 23926 url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23927 "span", 23928 { 23929 "aria-hidden": "true", 23930 className: clsx_default( 23931 "wp-block-cover__gradient-background", 23932 gradientClass 23933 ), 23934 style: customGradient ? { background: customGradient } : void 0 23935 } 23936 ), 23937 isImageBackground && isImgElement && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23938 "img", 23939 { 23940 className: clsx_default( 23941 "wp-block-cover__image-background", 23942 id ? `wp-image-$id}` : null 23943 ), 23944 alt, 23945 src: url, 23946 style: { objectPosition }, 23947 "data-object-fit": "cover", 23948 "data-object-position": objectPosition 23949 } 23950 ), 23951 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 23952 "video", 23953 { 23954 className: clsx_default( 23955 "wp-block-cover__video-background", 23956 "intrinsic-ignore" 23957 ), 23958 autoPlay: true, 23959 muted: true, 23960 loop: true, 23961 playsInline: true, 23962 src: url, 23963 style: { objectPosition }, 23964 "data-object-fit": "cover", 23965 "data-object-position": objectPosition 23966 } 23967 ), 23968 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor61.InnerBlocks.Content, {}) }) 23969 ] }); 23970 }, 23971 migrate: (0, import_compose17.compose)(migrateDimRatio, migrateTag) 23972 }; 23973 var v6 = { 23974 attributes: { 23975 ...blockAttributes2, 23976 isRepeated: { 23977 type: "boolean", 23978 default: false 23979 }, 23980 minHeight: { 23981 type: "number" 23982 }, 23983 minHeightUnit: { 23984 type: "string" 23985 }, 23986 gradient: { 23987 type: "string" 23988 }, 23989 customGradient: { 23990 type: "string" 23991 }, 23992 contentPosition: { 23993 type: "string" 23994 } 23995 }, 23996 supports: { 23997 align: true 23998 }, 23999 save({ attributes: attributes2 }) { 24000 const { 24001 backgroundType, 24002 gradient, 24003 contentPosition, 24004 customGradient, 24005 customOverlayColor, 24006 dimRatio, 24007 focalPoint, 24008 hasParallax, 24009 isRepeated, 24010 overlayColor, 24011 url, 24012 minHeight: minHeightProp, 24013 minHeightUnit 24014 } = attributes2; 24015 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 24016 "background-color", 24017 overlayColor 24018 ); 24019 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 24020 const minHeight = minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 24021 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 24022 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 24023 const style2 = isImageBackground ? backgroundImageStyles(url) : {}; 24024 const videoStyle = {}; 24025 if (!overlayColorClass) { 24026 style2.backgroundColor = customOverlayColor; 24027 } 24028 if (customGradient && !url) { 24029 style2.background = customGradient; 24030 } 24031 style2.minHeight = minHeight || void 0; 24032 let positionValue; 24033 if (focalPoint) { 24034 positionValue = `$Math.round( 24035 focalPoint.x * 100 24036 )}% $Math.round(focalPoint.y * 100)}%`; 24037 if (isImageBackground && !hasParallax) { 24038 style2.backgroundPosition = positionValue; 24039 } 24040 if (isVideoBackground) { 24041 videoStyle.objectPosition = positionValue; 24042 } 24043 } 24044 const classes = clsx_default( 24045 dimRatioToClassV1(dimRatio), 24046 overlayColorClass, 24047 { 24048 "has-background-dim": dimRatio !== 0, 24049 "has-parallax": hasParallax, 24050 "is-repeated": isRepeated, 24051 "has-background-gradient": gradient || customGradient, 24052 [gradientClass]: !url && gradientClass, 24053 "has-custom-content-position": !isContentPositionCenter(contentPosition) 24054 }, 24055 getPositionClassName(contentPosition) 24056 ); 24057 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { ...import_block_editor61.useBlockProps.save({ className: classes, style: style2 }), children: [ 24058 url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24059 "span", 24060 { 24061 "aria-hidden": "true", 24062 className: clsx_default( 24063 "wp-block-cover__gradient-background", 24064 gradientClass 24065 ), 24066 style: customGradient ? { background: customGradient } : void 0 24067 } 24068 ), 24069 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24070 "video", 24071 { 24072 className: "wp-block-cover__video-background", 24073 autoPlay: true, 24074 muted: true, 24075 loop: true, 24076 playsInline: true, 24077 src: url, 24078 style: videoStyle 24079 } 24080 ), 24081 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor61.InnerBlocks.Content, {}) }) 24082 ] }); 24083 }, 24084 migrate: (0, import_compose17.compose)(migrateDimRatio, migrateTag) 24085 }; 24086 var v5 = { 24087 attributes: { 24088 ...blockAttributes2, 24089 minHeight: { 24090 type: "number" 24091 }, 24092 gradient: { 24093 type: "string" 24094 }, 24095 customGradient: { 24096 type: "string" 24097 } 24098 }, 24099 supports: { 24100 align: true 24101 }, 24102 save({ attributes: attributes2 }) { 24103 const { 24104 backgroundType, 24105 gradient, 24106 customGradient, 24107 customOverlayColor, 24108 dimRatio, 24109 focalPoint, 24110 hasParallax, 24111 overlayColor, 24112 url, 24113 minHeight 24114 } = attributes2; 24115 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 24116 "background-color", 24117 overlayColor 24118 ); 24119 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 24120 const style2 = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 24121 if (!overlayColorClass) { 24122 style2.backgroundColor = customOverlayColor; 24123 } 24124 if (focalPoint && !hasParallax) { 24125 style2.backgroundPosition = `$Math.round( 24126 focalPoint.x * 100 24127 )}% $Math.round(focalPoint.y * 100)}%`; 24128 } 24129 if (customGradient && !url) { 24130 style2.background = customGradient; 24131 } 24132 style2.minHeight = minHeight || void 0; 24133 const classes = clsx_default( 24134 dimRatioToClassV1(dimRatio), 24135 overlayColorClass, 24136 { 24137 "has-background-dim": dimRatio !== 0, 24138 "has-parallax": hasParallax, 24139 "has-background-gradient": customGradient, 24140 [gradientClass]: !url && gradientClass 24141 } 24142 ); 24143 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { className: classes, style: style2, children: [ 24144 url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24145 "span", 24146 { 24147 "aria-hidden": "true", 24148 className: clsx_default( 24149 "wp-block-cover__gradient-background", 24150 gradientClass 24151 ), 24152 style: customGradient ? { background: customGradient } : void 0 24153 } 24154 ), 24155 VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24156 "video", 24157 { 24158 className: "wp-block-cover__video-background", 24159 autoPlay: true, 24160 muted: true, 24161 loop: true, 24162 src: url 24163 } 24164 ), 24165 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor61.InnerBlocks.Content, {}) }) 24166 ] }); 24167 }, 24168 migrate: (0, import_compose17.compose)(migrateDimRatio, migrateTag) 24169 }; 24170 var v4 = { 24171 attributes: { 24172 ...blockAttributes2, 24173 minHeight: { 24174 type: "number" 24175 }, 24176 gradient: { 24177 type: "string" 24178 }, 24179 customGradient: { 24180 type: "string" 24181 } 24182 }, 24183 supports: { 24184 align: true 24185 }, 24186 save({ attributes: attributes2 }) { 24187 const { 24188 backgroundType, 24189 gradient, 24190 customGradient, 24191 customOverlayColor, 24192 dimRatio, 24193 focalPoint, 24194 hasParallax, 24195 overlayColor, 24196 url, 24197 minHeight 24198 } = attributes2; 24199 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 24200 "background-color", 24201 overlayColor 24202 ); 24203 const gradientClass = (0, import_block_editor61.__experimentalGetGradientClass)(gradient); 24204 const style2 = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 24205 if (!overlayColorClass) { 24206 style2.backgroundColor = customOverlayColor; 24207 } 24208 if (focalPoint && !hasParallax) { 24209 style2.backgroundPosition = `$focalPoint.x * 100}% $focalPoint.y * 100}%`; 24210 } 24211 if (customGradient && !url) { 24212 style2.background = customGradient; 24213 } 24214 style2.minHeight = minHeight || void 0; 24215 const classes = clsx_default( 24216 dimRatioToClassV1(dimRatio), 24217 overlayColorClass, 24218 { 24219 "has-background-dim": dimRatio !== 0, 24220 "has-parallax": hasParallax, 24221 "has-background-gradient": customGradient, 24222 [gradientClass]: !url && gradientClass 24223 } 24224 ); 24225 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { className: classes, style: style2, children: [ 24226 url && (gradient || customGradient) && dimRatio !== 0 && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24227 "span", 24228 { 24229 "aria-hidden": "true", 24230 className: clsx_default( 24231 "wp-block-cover__gradient-background", 24232 gradientClass 24233 ), 24234 style: customGradient ? { background: customGradient } : void 0 24235 } 24236 ), 24237 VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24238 "video", 24239 { 24240 className: "wp-block-cover__video-background", 24241 autoPlay: true, 24242 muted: true, 24243 loop: true, 24244 src: url 24245 } 24246 ), 24247 /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("div", { className: "wp-block-cover__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor61.InnerBlocks.Content, {}) }) 24248 ] }); 24249 }, 24250 migrate: (0, import_compose17.compose)(migrateDimRatio, migrateTag) 24251 }; 24252 var v32 = { 24253 attributes: { 24254 ...blockAttributes2, 24255 title: { 24256 type: "string", 24257 source: "html", 24258 selector: "p" 24259 }, 24260 contentAlign: { 24261 type: "string", 24262 default: "center" 24263 } 24264 }, 24265 supports: { 24266 align: true 24267 }, 24268 save({ attributes: attributes2 }) { 24269 const { 24270 backgroundType, 24271 contentAlign, 24272 customOverlayColor, 24273 dimRatio, 24274 focalPoint, 24275 hasParallax, 24276 overlayColor, 24277 title, 24278 url 24279 } = attributes2; 24280 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 24281 "background-color", 24282 overlayColor 24283 ); 24284 const style2 = backgroundType === IMAGE_BACKGROUND_TYPE ? backgroundImageStyles(url) : {}; 24285 if (!overlayColorClass) { 24286 style2.backgroundColor = customOverlayColor; 24287 } 24288 if (focalPoint && !hasParallax) { 24289 style2.backgroundPosition = `$focalPoint.x * 100}% $focalPoint.y * 100}%`; 24290 } 24291 const classes = clsx_default( 24292 dimRatioToClassV1(dimRatio), 24293 overlayColorClass, 24294 { 24295 "has-background-dim": dimRatio !== 0, 24296 "has-parallax": hasParallax, 24297 [`has-$contentAlign}-content`]: contentAlign !== "center" 24298 } 24299 ); 24300 return /* @__PURE__ */ (0, import_jsx_runtime261.jsxs)("div", { className: classes, style: style2, children: [ 24301 VIDEO_BACKGROUND_TYPE === backgroundType && url && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24302 "video", 24303 { 24304 className: "wp-block-cover__video-background", 24305 autoPlay: true, 24306 muted: true, 24307 loop: true, 24308 src: url 24309 } 24310 ), 24311 !import_block_editor61.RichText.isEmpty(title) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24312 import_block_editor61.RichText.Content, 24313 { 24314 tagName: "p", 24315 className: "wp-block-cover-text", 24316 value: title 24317 } 24318 ) 24319 ] }); 24320 }, 24321 migrate(attributes2) { 24322 const newAttribs = { 24323 ...attributes2, 24324 dimRatio: !attributes2.url ? 100 : attributes2.dimRatio, 24325 tagName: !attributes2.tagName ? "div" : attributes2.tagName 24326 }; 24327 const { title, contentAlign, ...restAttributes } = newAttribs; 24328 return [ 24329 restAttributes, 24330 [ 24331 (0, import_blocks19.createBlock)("core/paragraph", { 24332 content: attributes2.title, 24333 style: { 24334 typography: { 24335 textAlign: attributes2.contentAlign 24336 } 24337 }, 24338 fontSize: "large", 24339 placeholder: (0, import_i18n50.__)("Write title\u2026") 24340 }) 24341 ] 24342 ]; 24343 } 24344 }; 24345 var v24 = { 24346 attributes: { 24347 ...blockAttributes2, 24348 title: { 24349 type: "string", 24350 source: "html", 24351 selector: "p" 24352 }, 24353 contentAlign: { 24354 type: "string", 24355 default: "center" 24356 }, 24357 align: { 24358 type: "string" 24359 } 24360 }, 24361 supports: { 24362 className: false 24363 }, 24364 save({ attributes: attributes2 }) { 24365 const { 24366 url, 24367 title, 24368 hasParallax, 24369 dimRatio, 24370 align, 24371 contentAlign, 24372 overlayColor, 24373 customOverlayColor 24374 } = attributes2; 24375 const overlayColorClass = (0, import_block_editor61.getColorClassName)( 24376 "background-color", 24377 overlayColor 24378 ); 24379 const style2 = backgroundImageStyles(url); 24380 if (!overlayColorClass) { 24381 style2.backgroundColor = customOverlayColor; 24382 } 24383 const classes = clsx_default( 24384 "wp-block-cover-image", 24385 dimRatioToClassV1(dimRatio), 24386 overlayColorClass, 24387 { 24388 "has-background-dim": dimRatio !== 0, 24389 "has-parallax": hasParallax, 24390 [`has-$contentAlign}-content`]: contentAlign !== "center" 24391 }, 24392 align ? `align$align}` : null 24393 ); 24394 return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("div", { className: classes, style: style2, children: !import_block_editor61.RichText.isEmpty(title) && /* @__PURE__ */ (0, import_jsx_runtime261.jsx)( 24395 import_block_editor61.RichText.Content, 24396 { 24397 tagName: "p", 24398 className: "wp-block-cover-image-text", 24399 value: title 24400 } 24401 ) }); 24402 }, 24403 migrate(attributes2) { 24404 const newAttribs = { 24405 ...attributes2, 24406 dimRatio: !attributes2.url ? 100 : attributes2.dimRatio, 24407 tagName: !attributes2.tagName ? "div" : attributes2.tagName 24408 }; 24409 const { title, contentAlign, align, ...restAttributes } = newAttribs; 24410 return [ 24411 restAttributes, 24412 [ 24413 (0, import_blocks19.createBlock)("core/paragraph", { 24414 content: attributes2.title, 24415 style: { 24416 typography: { 24417 textAlign: attributes2.contentAlign 24418 } 24419 }, 24420 fontSize: "large", 24421 placeholder: (0, import_i18n50.__)("Write title\u2026") 24422 }) 24423 ] 24424 ]; 24425 } 24426 }; 24427 var v113 = { 24428 attributes: { 24429 ...blockAttributes2, 24430 title: { 24431 type: "string", 24432 source: "html", 24433 selector: "h2" 24434 }, 24435 align: { 24436 type: "string" 24437 }, 24438 contentAlign: { 24439 type: "string", 24440 default: "center" 24441 } 24442 }, 24443 supports: { 24444 className: false 24445 }, 24446 save({ attributes: attributes2 }) { 24447 const { url, title, hasParallax, dimRatio, align } = attributes2; 24448 const style2 = backgroundImageStyles(url); 24449 const classes = clsx_default( 24450 "wp-block-cover-image", 24451 dimRatioToClassV1(dimRatio), 24452 { 24453 "has-background-dim": dimRatio !== 0, 24454 "has-parallax": hasParallax 24455 }, 24456 align ? `align$align}` : null 24457 ); 24458 return /* @__PURE__ */ (0, import_jsx_runtime261.jsx)("section", { className: classes, style: style2, children: /* @__PURE__ */ (0, import_jsx_runtime261.jsx)(import_block_editor61.RichText.Content, { tagName: "h2", value: title }) }); 24459 }, 24460 migrate(attributes2) { 24461 const newAttribs = { 24462 ...attributes2, 24463 dimRatio: !attributes2.url ? 100 : attributes2.dimRatio, 24464 tagName: !attributes2.tagName ? "div" : attributes2.tagName 24465 }; 24466 const { title, contentAlign, align, ...restAttributes } = newAttribs; 24467 return [ 24468 restAttributes, 24469 [ 24470 (0, import_blocks19.createBlock)("core/paragraph", { 24471 content: attributes2.title, 24472 style: { 24473 typography: { 24474 textAlign: attributes2.contentAlign 24475 } 24476 }, 24477 fontSize: "large", 24478 placeholder: (0, import_i18n50.__)("Write title\u2026") 24479 }) 24480 ] 24481 ]; 24482 } 24483 }; 24484 var deprecated_default14 = [v142, v132, v122, v112, v102, v9, v8, v7, v6, v5, v4, v32, v24, v113]; 24485 24486 // packages/block-library/build-module/cover/edit/index.mjs 24487 var import_core_data16 = __toESM(require_core_data(), 1); 24488 var import_element50 = __toESM(require_element(), 1); 24489 var import_components33 = __toESM(require_components(), 1); 24490 var import_compose20 = __toESM(require_compose(), 1); 24491 var import_block_editor68 = __toESM(require_block_editor(), 1); 24492 var import_i18n56 = __toESM(require_i18n(), 1); 24493 var import_data29 = __toESM(require_data(), 1); 24494 var import_blocks21 = __toESM(require_blocks(), 1); 24495 var import_blob7 = __toESM(require_blob(), 1); 24496 var import_notices4 = __toESM(require_notices(), 1); 24497 24498 // packages/block-library/build-module/cover/edit/inspector-controls.mjs 24499 var import_element46 = __toESM(require_element(), 1); 24500 var import_components30 = __toESM(require_components(), 1); 24501 var import_compose19 = __toESM(require_compose(), 1); 24502 var import_block_editor64 = __toESM(require_block_editor(), 1); 24503 var import_i18n52 = __toESM(require_i18n(), 1); 24504 var import_data28 = __toESM(require_data(), 1); 24505 var import_core_data15 = __toESM(require_core_data(), 1); 24506 24507 // packages/block-library/build-module/utils/style-state.mjs 24508 var import_block_editor62 = __toESM(require_block_editor(), 1); 24509 var { cleanEmptyObject: cleanEmptyObject2, getStyleForState, setStyleForState } = unlock( 24510 import_block_editor62.privateApis 24511 ); 24512 function getStateStyle(style2, selectedState) { 24513 return getStyleForState(style2, selectedState) || {}; 24514 } 24515 function getMappedDimensions(dimensions, dimensionKeyMap = {}) { 24516 return Object.fromEntries( 24517 Object.entries(dimensions).map(([key, value]) => [ 24518 dimensionKeyMap[key] || key, 24519 value 24520 ]) 24521 ); 24522 } 24523 function getControlledDimensions(dimensions, dimensionKeys) { 24524 if (!dimensionKeys) { 24525 return dimensions; 24526 } 24527 return Object.fromEntries( 24528 dimensionKeys.map((key) => [key, dimensions[key]]) 24529 ); 24530 } 24531 function getStyleStateKey(selectedState) { 24532 return [ 24533 selectedState?.viewport || "default", 24534 selectedState?.pseudo || "default" 24535 ].join(":"); 24536 } 24537 function getStateDimensions(style2, selectedState) { 24538 return getStateStyle(style2, selectedState)?.dimensions || {}; 24539 } 24540 function getActiveDimensionValue(options2 = {}) { 24541 const { 24542 attributes: attributes2 = {}, 24543 style: style2 = attributes2?.style, 24544 selectedState, 24545 hasSelectedStyleState, 24546 attributeKey, 24547 styleKey = attributeKey, 24548 rootValue 24549 } = options2; 24550 if (hasSelectedStyleState) { 24551 return getStateDimensions(style2, selectedState)?.[styleKey]; 24552 } 24553 if (Object.hasOwn(options2, "rootValue")) { 24554 return rootValue; 24555 } 24556 return attributes2?.[attributeKey]; 24557 } 24558 function setStateDimensions(style2, selectedState, nextDimensions) { 24559 const stateStyle = getStateStyle(style2, selectedState); 24560 return setStyleForState( 24561 style2, 24562 selectedState, 24563 cleanEmptyObject2({ 24564 ...stateStyle, 24565 dimensions: cleanEmptyObject2({ 24566 ...stateStyle?.dimensions, 24567 ...nextDimensions 24568 }) 24569 }) 24570 ); 24571 } 24572 function getDimensionUpdateAttributes({ 24573 style: style2, 24574 selectedState, 24575 hasSelectedStyleState, 24576 nextDimensions, 24577 dimensionKeyMap, 24578 dimensionKeys 24579 }) { 24580 const controlledDimensions = getControlledDimensions( 24581 nextDimensions, 24582 dimensionKeys 24583 ); 24584 if (!hasSelectedStyleState) { 24585 return controlledDimensions; 24586 } 24587 return { 24588 style: setStateDimensions( 24589 style2, 24590 selectedState, 24591 getMappedDimensions(controlledDimensions, dimensionKeyMap) 24592 ) 24593 }; 24594 } 24595 function resetDimensions(style2, keys) { 24596 const dimensionsReset = Object.fromEntries( 24597 keys.map((key) => [key, void 0]) 24598 ); 24599 return cleanEmptyObject2({ 24600 ...style2, 24601 dimensions: cleanEmptyObject2({ 24602 ...style2?.dimensions, 24603 ...dimensionsReset 24604 }) 24605 }); 24606 } 24607 function resetStateDimensions(style2, selectedState, keys) { 24608 return setStyleForState( 24609 style2, 24610 selectedState, 24611 resetDimensions(getStateStyle(style2, selectedState), keys) 24612 ); 24613 } 24614 function getDimensionResetAttributes({ 24615 attributes: attributes2 = {}, 24616 style: style2 = attributes2?.style, 24617 selectedState, 24618 hasSelectedStyleState, 24619 keys, 24620 defaultAttributes = {} 24621 }) { 24622 return { 24623 ...hasSelectedStyleState ? {} : { ...attributes2, ...defaultAttributes }, 24624 style: hasSelectedStyleState ? resetStateDimensions(style2, selectedState, keys) : resetDimensions(style2, keys) 24625 }; 24626 } 24627 24628 // packages/block-library/build-module/cover/constants.mjs 24629 var DEFAULT_MEDIA_SIZE_SLUG = "full"; 24630 24631 // packages/block-library/build-module/utils/poster-image.mjs 24632 var import_block_editor63 = __toESM(require_block_editor(), 1); 24633 var import_notices3 = __toESM(require_notices(), 1); 24634 var import_components29 = __toESM(require_components(), 1); 24635 var import_blob5 = __toESM(require_blob(), 1); 24636 var import_i18n51 = __toESM(require_i18n(), 1); 24637 var import_element45 = __toESM(require_element(), 1); 24638 var import_compose18 = __toESM(require_compose(), 1); 24639 var import_data27 = __toESM(require_data(), 1); 24640 var import_jsx_runtime262 = __toESM(require_jsx_runtime(), 1); 24641 var POSTER_IMAGE_ALLOWED_MEDIA_TYPES = ["image"]; 24642 function PosterImage({ poster, onChange }) { 24643 const posterButtonRef = (0, import_element45.useRef)(); 24644 const [isLoading, setIsLoading] = (0, import_element45.useState)(false); 24645 const descriptionId = (0, import_compose18.useInstanceId)( 24646 PosterImage, 24647 "block-library-poster-image-description" 24648 ); 24649 const { getSettings: getSettings2 } = (0, import_data27.useSelect)(import_block_editor63.store); 24650 const { createErrorNotice } = (0, import_data27.useDispatch)(import_notices3.store); 24651 const onDropFiles = (filesList) => { 24652 getSettings2().mediaUpload({ 24653 allowedTypes: POSTER_IMAGE_ALLOWED_MEDIA_TYPES, 24654 filesList, 24655 onFileChange: ([image]) => { 24656 if ((0, import_blob5.isBlobURL)(image?.url)) { 24657 setIsLoading(true); 24658 return; 24659 } 24660 if (image) { 24661 onChange(image); 24662 } 24663 setIsLoading(false); 24664 }, 24665 onError: (message) => { 24666 createErrorNotice(message, { 24667 id: "poster-image-upload-notice", 24668 type: "snackbar" 24669 }); 24670 setIsLoading(false); 24671 }, 24672 multiple: false 24673 }); 24674 }; 24675 const getPosterButtonContent = () => { 24676 if (!poster && isLoading) { 24677 return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components29.Spinner, {}); 24678 } 24679 return !poster ? (0, import_i18n51.__)("Set poster image") : (0, import_i18n51.__)("Replace"); 24680 }; 24681 return /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_block_editor63.MediaUploadCheck, { children: /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)( 24682 import_components29.__experimentalToolsPanelItem, 24683 { 24684 label: (0, import_i18n51.__)("Poster image"), 24685 isShownByDefault: true, 24686 hasValue: () => !!poster, 24687 onDeselect: () => onChange(void 0), 24688 children: [ 24689 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components29.BaseControl.VisualLabel, { children: (0, import_i18n51.__)("Poster image") }), 24690 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 24691 import_block_editor63.MediaUpload, 24692 { 24693 title: (0, import_i18n51.__)("Select poster image"), 24694 onSelect: onChange, 24695 allowedTypes: POSTER_IMAGE_ALLOWED_MEDIA_TYPES, 24696 render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)("div", { className: "block-library-poster-image__container", children: [ 24697 poster && /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)( 24698 import_components29.Button, 24699 { 24700 __next40pxDefaultSize: true, 24701 onClick: open, 24702 "aria-haspopup": "dialog", 24703 "aria-label": (0, import_i18n51.__)( 24704 "Edit or replace the poster image." 24705 ), 24706 className: "block-library-poster-image__preview", 24707 disabled: isLoading, 24708 accessibleWhenDisabled: true, 24709 children: [ 24710 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 24711 "img", 24712 { 24713 src: poster, 24714 alt: (0, import_i18n51.__)("Poster image preview"), 24715 className: "block-library-poster-image__preview-image" 24716 } 24717 ), 24718 isLoading && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components29.Spinner, {}) 24719 ] 24720 } 24721 ), 24722 /* @__PURE__ */ (0, import_jsx_runtime262.jsxs)( 24723 import_components29.__experimentalHStack, 24724 { 24725 className: clsx_default( 24726 "block-library-poster-image__actions", 24727 { 24728 "block-library-poster-image__actions-select": !poster 24729 } 24730 ), 24731 children: [ 24732 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 24733 import_components29.Button, 24734 { 24735 __next40pxDefaultSize: true, 24736 onClick: open, 24737 ref: posterButtonRef, 24738 className: "block-library-poster-image__action", 24739 "aria-describedby": descriptionId, 24740 "aria-haspopup": "dialog", 24741 variant: !poster ? "secondary" : void 0, 24742 disabled: isLoading, 24743 accessibleWhenDisabled: true, 24744 children: getPosterButtonContent() 24745 } 24746 ), 24747 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)("p", { id: descriptionId, hidden: true, children: poster ? (0, import_i18n51.sprintf)( 24748 /* translators: %s: poster image URL. */ 24749 (0, import_i18n51.__)( 24750 "The current poster image url is %s." 24751 ), 24752 poster 24753 ) : (0, import_i18n51.__)( 24754 "There is no poster image currently selected." 24755 ) }), 24756 !!poster && /* @__PURE__ */ (0, import_jsx_runtime262.jsx)( 24757 import_components29.Button, 24758 { 24759 __next40pxDefaultSize: true, 24760 onClick: () => { 24761 onChange(void 0); 24762 posterButtonRef.current.focus(); 24763 }, 24764 className: "block-library-poster-image__action", 24765 disabled: isLoading, 24766 accessibleWhenDisabled: true, 24767 children: (0, import_i18n51.__)("Remove") 24768 } 24769 ) 24770 ] 24771 } 24772 ), 24773 /* @__PURE__ */ (0, import_jsx_runtime262.jsx)(import_components29.DropZone, { onFilesDrop: onDropFiles }) 24774 ] }) 24775 } 24776 ) 24777 ] 24778 } 24779 ) }); 24780 } 24781 var poster_image_default = PosterImage; 24782 24783 // packages/block-library/build-module/cover/edit/inspector-controls.mjs 24784 var import_jsx_runtime263 = __toESM(require_jsx_runtime(), 1); 24785 var { 24786 cleanEmptyObject: cleanEmptyObject3, 24787 isDefaultBlockStyleState, 24788 ResolutionTool, 24789 HTMLElementControl: HTMLElementControl3 24790 } = unlock(import_block_editor64.privateApis); 24791 function CoverHeightInput({ 24792 onChange, 24793 onUnitChange, 24794 unit = "px", 24795 value = "" 24796 }) { 24797 const instanceId = (0, import_compose19.useInstanceId)(import_components30.__experimentalUnitControl); 24798 const inputId = `block-cover-height-input-$instanceId}`; 24799 const isPx = unit === "px"; 24800 const [availableUnits] = (0, import_block_editor64.useSettings)("spacing.units"); 24801 const units = (0, import_components30.__experimentalUseCustomUnits)({ 24802 availableUnits: availableUnits || ["px", "em", "rem", "vw", "vh"], 24803 defaultValues: { px: 430, "%": 20, em: 20, rem: 20, vw: 20, vh: 50 } 24804 }); 24805 const handleOnChange = (unprocessedValue) => { 24806 const inputValue = unprocessedValue !== "" ? parseFloat(unprocessedValue) : void 0; 24807 if (isNaN(inputValue) && inputValue !== void 0) { 24808 return; 24809 } 24810 onChange(inputValue); 24811 }; 24812 const computedValue = (0, import_element46.useMemo)(() => { 24813 const [parsedQuantity] = (0, import_components30.__experimentalParseQuantityAndUnitFromRawValue)(value); 24814 return [parsedQuantity, unit].join(""); 24815 }, [unit, value]); 24816 const min = isPx ? COVER_MIN_HEIGHT : 0; 24817 return /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 24818 import_components30.__experimentalUnitControl, 24819 { 24820 label: (0, import_i18n52.__)("Minimum height"), 24821 id: inputId, 24822 isResetValueOnUnitChange: true, 24823 min, 24824 onChange: handleOnChange, 24825 onUnitChange, 24826 units, 24827 value: computedValue 24828 } 24829 ); 24830 } 24831 function CoverInspectorControls({ 24832 attributes: attributes2, 24833 setAttributes, 24834 clientId, 24835 setOverlayColor, 24836 coverRef, 24837 currentSettings, 24838 updateDimRatio, 24839 featuredImage 24840 }) { 24841 const { 24842 useFeaturedImage, 24843 id, 24844 dimRatio, 24845 focalPoint, 24846 hasParallax, 24847 isRepeated, 24848 minHeight, 24849 minHeightUnit, 24850 alt, 24851 tagName, 24852 poster 24853 } = attributes2; 24854 const { 24855 isVideoBackground, 24856 isImageBackground, 24857 mediaElement, 24858 url, 24859 overlayColor 24860 } = currentSettings; 24861 const sizeSlug = attributes2.sizeSlug || DEFAULT_MEDIA_SIZE_SLUG; 24862 const { gradientValue, setGradient } = (0, import_block_editor64.__experimentalUseGradient)(); 24863 const { imageSizes, selectedStyleState } = (0, import_data28.useSelect)( 24864 (select10) => { 24865 const { getSettings: getSettings2, getSelectedBlockStyleState } = unlock( 24866 select10(import_block_editor64.store) 24867 ); 24868 return { 24869 imageSizes: getSettings2()?.imageSizes, 24870 selectedStyleState: getSelectedBlockStyleState(clientId) 24871 }; 24872 }, 24873 [clientId] 24874 ); 24875 const hasSelectedStyleState = !isDefaultBlockStyleState(selectedStyleState); 24876 const selectedStyleStateKey = getStyleStateKey(selectedStyleState); 24877 const stateMinHeight = getActiveDimensionValue({ 24878 attributes: attributes2, 24879 selectedState: selectedStyleState, 24880 hasSelectedStyleState, 24881 attributeKey: "minHeight", 24882 styleKey: "minHeight", 24883 rootValue: void 0 24884 }); 24885 const [stateMinHeightValue, stateMinHeightUnit] = (0, import_components30.__experimentalParseQuantityAndUnitFromRawValue)(stateMinHeight || ""); 24886 const activeMinHeight = hasSelectedStyleState ? stateMinHeightValue : minHeight; 24887 const activeMinHeightUnit = hasSelectedStyleState ? stateMinHeightUnit || minHeightUnit : minHeightUnit; 24888 const activeAspectRatio = getActiveDimensionValue({ 24889 attributes: attributes2, 24890 selectedState: selectedStyleState, 24891 hasSelectedStyleState, 24892 attributeKey: "aspectRatio", 24893 rootValue: attributes2?.style?.dimensions?.aspectRatio 24894 }); 24895 const image = (0, import_data28.useSelect)( 24896 (select10) => id && isImageBackground ? select10(import_core_data15.store).getEntityRecord( 24897 "postType", 24898 "attachment", 24899 id, 24900 { context: "view" } 24901 ) : null, 24902 [id, isImageBackground] 24903 ); 24904 const currentBackgroundImage = useFeaturedImage ? featuredImage : image; 24905 function updateImage(newSizeSlug) { 24906 const newUrl = currentBackgroundImage?.media_details?.sizes?.[newSizeSlug]?.source_url; 24907 if (!newUrl) { 24908 return null; 24909 } 24910 setAttributes({ 24911 url: newUrl, 24912 sizeSlug: newSizeSlug 24913 }); 24914 } 24915 const imageSizeOptions = imageSizes?.filter( 24916 ({ slug }) => currentBackgroundImage?.media_details?.sizes?.[slug]?.source_url 24917 )?.map(({ name: name118, slug }) => ({ value: slug, label: name118 })); 24918 const toggleParallax = () => { 24919 setAttributes({ 24920 hasParallax: !hasParallax, 24921 ...!hasParallax ? { focalPoint: void 0 } : {} 24922 }); 24923 }; 24924 const toggleIsRepeated = () => { 24925 setAttributes({ 24926 isRepeated: !isRepeated 24927 }); 24928 }; 24929 const showFocalPointPicker = isVideoBackground || isImageBackground; 24930 const imperativeFocalPointPreview = (value) => { 24931 const [styleOfRef, property] = mediaElement.current ? [mediaElement.current.style, "objectPosition"] : [coverRef.current.style, "backgroundPosition"]; 24932 styleOfRef[property] = mediaPosition(value); 24933 }; 24934 const colorGradientSettings = (0, import_block_editor64.__experimentalUseMultipleOriginColorsAndGradients)(); 24935 const showOverlayControls = colorGradientSettings.hasColorsOrGradients && !hasSelectedStyleState; 24936 const setMinHeightAttributes = (nextMinHeight, nextUnit) => { 24937 if (hasSelectedStyleState) { 24938 setAttributes( 24939 getDimensionUpdateAttributes({ 24940 style: attributes2.style, 24941 selectedState: selectedStyleState, 24942 hasSelectedStyleState, 24943 nextDimensions: { 24944 minHeight: nextMinHeight === void 0 ? void 0 : `$nextMinHeight}$nextUnit || activeMinHeightUnit || "px"}`, 24945 aspectRatio: void 0 24946 } 24947 }) 24948 ); 24949 return; 24950 } 24951 setAttributes({ 24952 minHeight: nextMinHeight, 24953 style: cleanEmptyObject3({ 24954 ...attributes2?.style, 24955 dimensions: { 24956 ...attributes2?.style?.dimensions, 24957 aspectRatio: void 0 24958 // Reset aspect ratio when minHeight is set. 24959 } 24960 }) 24961 }); 24962 }; 24963 const getResetMinHeightAttributes = (attrs = attributes2) => { 24964 return getDimensionResetAttributes({ 24965 style: attrs.style, 24966 selectedState: selectedStyleState, 24967 hasSelectedStyleState, 24968 keys: ["minHeight"], 24969 defaultAttributes: { 24970 minHeight: void 0, 24971 minHeightUnit: void 0 24972 } 24973 }); 24974 }; 24975 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 24976 return /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)(import_jsx_runtime263.Fragment, { children: [ 24977 (!!url || useFeaturedImage) && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_block_editor64.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)( 24978 import_components30.__experimentalToolsPanel, 24979 { 24980 label: (0, import_i18n52.__)("Settings"), 24981 resetAll: () => { 24982 setAttributes({ 24983 hasParallax: false, 24984 focalPoint: void 0, 24985 isRepeated: false, 24986 alt: "", 24987 poster: void 0 24988 }); 24989 updateImage(DEFAULT_MEDIA_SIZE_SLUG); 24990 }, 24991 dropdownMenuProps, 24992 children: [ 24993 isImageBackground && /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)(import_jsx_runtime263.Fragment, { children: [ 24994 /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 24995 import_components30.__experimentalToolsPanelItem, 24996 { 24997 label: (0, import_i18n52.__)("Fixed background"), 24998 isShownByDefault: true, 24999 hasValue: () => !!hasParallax, 25000 onDeselect: () => setAttributes({ 25001 hasParallax: false, 25002 focalPoint: void 0 25003 }), 25004 children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25005 import_components30.ToggleControl, 25006 { 25007 label: (0, import_i18n52.__)("Fixed background"), 25008 checked: !!hasParallax, 25009 onChange: toggleParallax 25010 } 25011 ) 25012 } 25013 ), 25014 /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25015 import_components30.__experimentalToolsPanelItem, 25016 { 25017 label: (0, import_i18n52.__)("Repeated background"), 25018 isShownByDefault: true, 25019 hasValue: () => isRepeated, 25020 onDeselect: () => setAttributes({ 25021 isRepeated: false 25022 }), 25023 children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25024 import_components30.ToggleControl, 25025 { 25026 label: (0, import_i18n52.__)("Repeated background"), 25027 checked: isRepeated, 25028 onChange: toggleIsRepeated 25029 } 25030 ) 25031 } 25032 ) 25033 ] }), 25034 showFocalPointPicker && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25035 import_components30.__experimentalToolsPanelItem, 25036 { 25037 label: (0, import_i18n52.__)("Focal point"), 25038 isShownByDefault: true, 25039 hasValue: () => !!focalPoint, 25040 onDeselect: () => setAttributes({ 25041 focalPoint: void 0 25042 }), 25043 children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25044 import_components30.FocalPointPicker, 25045 { 25046 label: (0, import_i18n52.__)("Focal point"), 25047 url, 25048 value: focalPoint, 25049 onDragStart: imperativeFocalPointPreview, 25050 onDrag: imperativeFocalPointPreview, 25051 onChange: (newFocalPoint) => setAttributes({ 25052 focalPoint: newFocalPoint 25053 }) 25054 } 25055 ) 25056 } 25057 ), 25058 isVideoBackground && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25059 poster_image_default, 25060 { 25061 poster, 25062 onChange: (posterImage) => setAttributes({ 25063 poster: posterImage?.url 25064 }) 25065 } 25066 ), 25067 !useFeaturedImage && url && !isVideoBackground && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25068 import_components30.__experimentalToolsPanelItem, 25069 { 25070 label: (0, import_i18n52.__)("Alternative text"), 25071 isShownByDefault: true, 25072 hasValue: () => !!alt, 25073 onDeselect: () => setAttributes({ alt: "" }), 25074 children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25075 import_components30.TextareaControl, 25076 { 25077 label: (0, import_i18n52.__)("Alternative text"), 25078 value: alt, 25079 onChange: (newAlt) => setAttributes({ alt: newAlt }), 25080 help: /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)(import_jsx_runtime263.Fragment, { children: [ 25081 /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25082 Link, 25083 { 25084 openInNewTab: true, 25085 href: ( 25086 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 25087 (0, import_i18n52.__)( 25088 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 25089 ) 25090 ), 25091 children: (0, import_i18n52.__)( 25092 "Describe the purpose of the image." 25093 ) 25094 } 25095 ), 25096 /* @__PURE__ */ (0, import_jsx_runtime263.jsx)("br", {}), 25097 (0, import_i18n52.__)( 25098 "Leave empty if decorative." 25099 ) 25100 ] }) 25101 } 25102 ) 25103 } 25104 ), 25105 !!imageSizeOptions?.length && /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25106 ResolutionTool, 25107 { 25108 value: sizeSlug, 25109 onChange: updateImage, 25110 options: imageSizeOptions, 25111 defaultValue: DEFAULT_MEDIA_SIZE_SLUG 25112 } 25113 ) 25114 ] 25115 } 25116 ) }), 25117 showOverlayControls && /* @__PURE__ */ (0, import_jsx_runtime263.jsxs)(import_block_editor64.InspectorControls, { group: "color", children: [ 25118 /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25119 import_block_editor64.__experimentalColorGradientSettingsDropdown, 25120 { 25121 __experimentalIsRenderedInSidebar: true, 25122 settings: [ 25123 { 25124 colorValue: overlayColor.color, 25125 gradientValue, 25126 label: (0, import_i18n52.__)("Overlay"), 25127 onColorChange: setOverlayColor, 25128 onGradientChange: setGradient, 25129 isShownByDefault: true, 25130 resetAllFilter: () => ({ 25131 overlayColor: void 0, 25132 customOverlayColor: void 0, 25133 gradient: void 0, 25134 customGradient: void 0 25135 }), 25136 clearable: true 25137 } 25138 ], 25139 panelId: clientId, 25140 ...colorGradientSettings 25141 } 25142 ), 25143 /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25144 import_components30.__experimentalToolsPanelItem, 25145 { 25146 hasValue: () => { 25147 return dimRatio === void 0 ? false : dimRatio !== (url ? 50 : 100); 25148 }, 25149 label: (0, import_i18n52.__)("Overlay opacity"), 25150 onDeselect: () => updateDimRatio(url ? 50 : 100), 25151 resetAllFilter: () => ({ 25152 dimRatio: url ? 50 : 100 25153 }), 25154 isShownByDefault: true, 25155 panelId: clientId, 25156 children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25157 import_components30.RangeControl, 25158 { 25159 label: (0, import_i18n52.__)("Overlay opacity"), 25160 value: dimRatio, 25161 onChange: (newDimRatio) => updateDimRatio(newDimRatio), 25162 min: 0, 25163 max: 100, 25164 step: 10, 25165 required: true 25166 } 25167 ) 25168 } 25169 ) 25170 ] }), 25171 /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_block_editor64.InspectorControls, { group: "dimensions", children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25172 import_components30.__experimentalToolsPanelItem, 25173 { 25174 className: "single-column", 25175 hasValue: () => !!activeMinHeight, 25176 label: (0, import_i18n52.__)("Minimum height"), 25177 onDeselect: () => setAttributes(getResetMinHeightAttributes()), 25178 resetAllFilter: getResetMinHeightAttributes, 25179 isShownByDefault: true, 25180 panelId: clientId, 25181 children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25182 CoverHeightInput, 25183 { 25184 value: activeAspectRatio ? "" : activeMinHeight, 25185 unit: activeMinHeightUnit, 25186 onChange: (newMinHeight) => setMinHeightAttributes(newMinHeight), 25187 onUnitChange: (nextUnit) => { 25188 if (hasSelectedStyleState) { 25189 if (activeMinHeight !== void 0) { 25190 setMinHeightAttributes( 25191 activeMinHeight, 25192 nextUnit 25193 ); 25194 } 25195 return; 25196 } 25197 setAttributes({ 25198 minHeightUnit: nextUnit 25199 }); 25200 } 25201 } 25202 ) 25203 }, 25204 selectedStyleStateKey 25205 ) }), 25206 /* @__PURE__ */ (0, import_jsx_runtime263.jsx)(import_block_editor64.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime263.jsx)( 25207 HTMLElementControl3, 25208 { 25209 tagName, 25210 onChange: (value) => setAttributes({ tagName: value }), 25211 clientId, 25212 options: [ 25213 { label: (0, import_i18n52.__)("Default (<div>)"), value: "div" }, 25214 { label: "<header>", value: "header" }, 25215 { label: "<main>", value: "main" }, 25216 { label: "<section>", value: "section" }, 25217 { label: "<article>", value: "article" }, 25218 { label: "<aside>", value: "aside" }, 25219 { label: "<footer>", value: "footer" } 25220 ] 25221 } 25222 ) }) 25223 ] }); 25224 } 25225 25226 // packages/block-library/build-module/cover/edit/block-controls.mjs 25227 var import_element48 = __toESM(require_element(), 1); 25228 var import_block_editor65 = __toESM(require_block_editor(), 1); 25229 var import_i18n54 = __toESM(require_i18n(), 1); 25230 var import_components32 = __toESM(require_components(), 1); 25231 25232 // packages/block-library/build-module/cover/edit/embed-video-url-input.mjs 25233 var import_element47 = __toESM(require_element(), 1); 25234 var import_components31 = __toESM(require_components(), 1); 25235 var import_i18n53 = __toESM(require_i18n(), 1); 25236 25237 // packages/block-library/build-module/cover/embed-video-utils.mjs 25238 var import_blocks20 = __toESM(require_blocks(), 1); 25239 var DEFAULT_EMBED_BLOCK2 = "core/embed"; 25240 var DEFAULT_VIDEO_PROVIDERS = [ 25241 "youtube", 25242 "vimeo", 25243 "videopress", 25244 "animoto", 25245 "tiktok", 25246 "wordpress-tv" 25247 ]; 25248 function getAllowedVideoProviders(allowedVideoProviders) { 25249 if (!Array.isArray(allowedVideoProviders)) { 25250 return []; 25251 } 25252 return DEFAULT_VIDEO_PROVIDERS.filter( 25253 (provider) => allowedVideoProviders.includes(provider) 25254 ); 25255 } 25256 function isValidVideoEmbedUrl(url, allowedProviders) { 25257 if (!url) { 25258 return false; 25259 } 25260 const embedBlock = findVideoEmbedProvider(url, allowedProviders); 25261 return embedBlock !== null; 25262 } 25263 function findVideoEmbedProvider(url, allowedProviders = DEFAULT_VIDEO_PROVIDERS) { 25264 const embedVariations = (0, import_blocks20.getBlockVariations)(DEFAULT_EMBED_BLOCK2); 25265 if (!embedVariations) { 25266 return null; 25267 } 25268 const matchingVariation = embedVariations.find( 25269 ({ patterns }) => matchesPatterns(url, patterns) 25270 ); 25271 if (!matchingVariation || !allowedProviders.includes(matchingVariation.name)) { 25272 return null; 25273 } 25274 return matchingVariation; 25275 } 25276 function getBackgroundEmbedHtml(html) { 25277 const srcMatch = html?.match(/src=["']([^"']+)["']/); 25278 if (!srcMatch) { 25279 return null; 25280 } 25281 const iframeSrc = srcMatch[1]; 25282 const backgroundSrc = getBackgroundVideoSrc(iframeSrc); 25283 return html.replace(iframeSrc, backgroundSrc); 25284 } 25285 function detectProviderFromSrc(src) { 25286 if (!src) { 25287 return null; 25288 } 25289 const lowerSrc = src.toLowerCase(); 25290 if (lowerSrc.includes("youtube.com") || lowerSrc.includes("youtu.be")) { 25291 return "youtube"; 25292 } 25293 if (lowerSrc.includes("vimeo.com")) { 25294 return "vimeo"; 25295 } 25296 if (lowerSrc.includes("videopress.com")) { 25297 return "videopress"; 25298 } 25299 if (lowerSrc.includes("animoto.com")) { 25300 return "animoto"; 25301 } 25302 if (lowerSrc.includes("tiktok.com")) { 25303 return "tiktok"; 25304 } 25305 if (lowerSrc.includes("wordpress.tv")) { 25306 return "wordpress-tv"; 25307 } 25308 return null; 25309 } 25310 function getBackgroundVideoSrc(src) { 25311 if (!src) { 25312 return src; 25313 } 25314 try { 25315 const url = new URL(src); 25316 const provider = detectProviderFromSrc(src); 25317 switch (provider) { 25318 case "youtube": 25319 url.searchParams.set("autoplay", "1"); 25320 url.searchParams.set("mute", "1"); 25321 url.searchParams.set("loop", "1"); 25322 url.searchParams.set("controls", "0"); 25323 url.searchParams.set("showinfo", "0"); 25324 url.searchParams.set("modestbranding", "1"); 25325 url.searchParams.set("playsinline", "1"); 25326 url.searchParams.set("rel", "0"); 25327 const videoId = url.pathname.split("/").pop(); 25328 if (videoId) { 25329 url.searchParams.set("playlist", videoId); 25330 } 25331 break; 25332 case "vimeo": 25333 url.searchParams.set("autoplay", "1"); 25334 url.searchParams.set("muted", "1"); 25335 url.searchParams.set("loop", "1"); 25336 url.searchParams.set("background", "1"); 25337 url.searchParams.set("controls", "0"); 25338 break; 25339 case "videopress": 25340 case "wordpress-tv": 25341 url.searchParams.set("autoplay", "1"); 25342 url.searchParams.set("loop", "1"); 25343 url.searchParams.set("muted", "1"); 25344 break; 25345 default: 25346 url.searchParams.set("autoplay", "1"); 25347 url.searchParams.set("muted", "1"); 25348 url.searchParams.set("loop", "1"); 25349 break; 25350 } 25351 return url.toString(); 25352 } catch { 25353 return src; 25354 } 25355 } 25356 25357 // packages/block-library/build-module/cover/edit/embed-video-url-input.mjs 25358 var import_jsx_runtime264 = __toESM(require_jsx_runtime(), 1); 25359 function EmbedVideoUrlInput({ 25360 onSubmit, 25361 onClose, 25362 initialUrl = "", 25363 allowedVideoProviders 25364 }) { 25365 const [url, setUrl] = (0, import_element47.useState)(initialUrl); 25366 const [error2, setError] = (0, import_element47.useState)(""); 25367 const handleConfirm = () => { 25368 if (!url) { 25369 setError((0, import_i18n53.__)("Please enter a URL.")); 25370 return; 25371 } 25372 if (!isValidVideoEmbedUrl(url, allowedVideoProviders)) { 25373 setError( 25374 (0, import_i18n53.__)( 25375 "This URL is not supported. Please enter a valid video link from a supported provider." 25376 ) 25377 ); 25378 return; 25379 } 25380 onSubmit(url); 25381 onClose(); 25382 }; 25383 return /* @__PURE__ */ (0, import_jsx_runtime264.jsx)( 25384 import_components31.__experimentalConfirmDialog, 25385 { 25386 isOpen: true, 25387 onConfirm: handleConfirm, 25388 onCancel: onClose, 25389 confirmButtonText: (0, import_i18n53.__)("Add video"), 25390 size: "medium", 25391 children: /* @__PURE__ */ (0, import_jsx_runtime264.jsxs)(Stack, { direction: "column", gap: "lg", children: [ 25392 error2 && /* @__PURE__ */ (0, import_jsx_runtime264.jsx)(import_components31.Notice, { status: "error", isDismissible: false, children: error2 }), 25393 /* @__PURE__ */ (0, import_jsx_runtime264.jsx)( 25394 import_components31.TextControl, 25395 { 25396 type: "url", 25397 label: (0, import_i18n53.__)("Video URL"), 25398 value: url, 25399 onChange: (value) => { 25400 setUrl(value); 25401 setError(""); 25402 }, 25403 placeholder: (0, import_i18n53.__)( 25404 "Enter YouTube, Vimeo, or other video URL" 25405 ), 25406 help: (0, import_i18n53.__)( 25407 "Add a background video to the cover block that will autoplay in a loop." 25408 ) 25409 } 25410 ) 25411 ] }) 25412 } 25413 ); 25414 } 25415 25416 // packages/block-library/build-module/cover/edit/block-controls.mjs 25417 var import_jsx_runtime265 = __toESM(require_jsx_runtime(), 1); 25418 var { cleanEmptyObject: cleanEmptyObject4 } = unlock(import_block_editor65.privateApis); 25419 function CoverBlockControls({ 25420 attributes: attributes2, 25421 setAttributes, 25422 onSelectMedia, 25423 currentSettings, 25424 toggleUseFeaturedImage, 25425 onClearMedia, 25426 onSelectEmbedUrl, 25427 onEditMedia, 25428 editMediaButtonRef, 25429 showEditMediaButton, 25430 isEditMediaDisabled, 25431 blockEditingMode 25432 }) { 25433 const { 25434 contentPosition, 25435 id, 25436 useFeaturedImage, 25437 minHeight, 25438 minHeightUnit, 25439 backgroundType, 25440 allowedVideoProviders 25441 } = attributes2; 25442 const { hasInnerBlocks, url } = currentSettings; 25443 const filteredVideoProviders = getAllowedVideoProviders( 25444 allowedVideoProviders 25445 ); 25446 const hasAllowedVideoProviders = filteredVideoProviders.length > 0; 25447 const [prevMinHeightValue, setPrevMinHeightValue] = (0, import_element48.useState)(minHeight); 25448 const [prevMinHeightUnit, setPrevMinHeightUnit] = (0, import_element48.useState)(minHeightUnit); 25449 const [isEmbedUrlInputOpen, setIsEmbedUrlInputOpen] = (0, import_element48.useState)(false); 25450 const isMinFullHeight = minHeightUnit === "vh" && minHeight === 100 && !attributes2?.style?.dimensions?.aspectRatio; 25451 const isContentOnlyMode = blockEditingMode === "contentOnly"; 25452 const toggleMinFullHeight = () => { 25453 if (isMinFullHeight) { 25454 if (prevMinHeightUnit === "vh" && prevMinHeightValue === 100) { 25455 return setAttributes({ 25456 minHeight: void 0, 25457 minHeightUnit: void 0 25458 }); 25459 } 25460 return setAttributes({ 25461 minHeight: prevMinHeightValue, 25462 minHeightUnit: prevMinHeightUnit 25463 }); 25464 } 25465 setPrevMinHeightValue(minHeight); 25466 setPrevMinHeightUnit(minHeightUnit); 25467 return setAttributes({ 25468 minHeight: 100, 25469 minHeightUnit: "vh", 25470 style: cleanEmptyObject4({ 25471 ...attributes2?.style, 25472 dimensions: { 25473 ...attributes2?.style?.dimensions, 25474 aspectRatio: void 0 25475 // Reset aspect ratio when minHeight is set. 25476 } 25477 }) 25478 }); 25479 }; 25480 return /* @__PURE__ */ (0, import_jsx_runtime265.jsxs)(import_jsx_runtime265.Fragment, { children: [ 25481 !isContentOnlyMode && /* @__PURE__ */ (0, import_jsx_runtime265.jsxs)(import_block_editor65.BlockControls, { group: "block", children: [ 25482 /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 25483 import_block_editor65.__experimentalBlockAlignmentMatrixControl, 25484 { 25485 label: (0, import_i18n54.__)("Change content position"), 25486 value: contentPosition, 25487 onChange: (nextPosition) => setAttributes({ 25488 contentPosition: nextPosition 25489 }), 25490 isDisabled: !hasInnerBlocks 25491 } 25492 ), 25493 /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 25494 import_block_editor65.__experimentalBlockFullHeightAligmentControl, 25495 { 25496 isActive: isMinFullHeight, 25497 onToggle: toggleMinFullHeight, 25498 isDisabled: !hasInnerBlocks 25499 } 25500 ), 25501 showEditMediaButton && /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 25502 import_components32.ToolbarButton, 25503 { 25504 ref: editMediaButtonRef, 25505 icon: crop_default, 25506 label: (0, import_i18n54.__)("Edit image"), 25507 onClick: onEditMedia, 25508 "aria-haspopup": "dialog", 25509 disabled: isEditMediaDisabled 25510 } 25511 ) 25512 ] }), 25513 /* @__PURE__ */ (0, import_jsx_runtime265.jsx)(import_block_editor65.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 25514 import_block_editor65.MediaReplaceFlow, 25515 { 25516 mediaId: id, 25517 mediaURL: url, 25518 allowedTypes: ALLOWED_MEDIA_TYPES2, 25519 onSelect: onSelectMedia, 25520 onToggleFeaturedImage: toggleUseFeaturedImage, 25521 useFeaturedImage, 25522 name: !url ? (0, import_i18n54.__)("Add media") : (0, import_i18n54.__)("Replace"), 25523 onReset: onClearMedia, 25524 variant: "toolbar", 25525 children: ({ onClose }) => hasAllowedVideoProviders ? /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 25526 import_components32.MenuItem, 25527 { 25528 icon: link_default, 25529 onClick: () => { 25530 setIsEmbedUrlInputOpen(true); 25531 onClose(); 25532 }, 25533 children: (0, import_i18n54.__)("Embed video from URL") 25534 } 25535 ) : null 25536 } 25537 ) }), 25538 isEmbedUrlInputOpen && /* @__PURE__ */ (0, import_jsx_runtime265.jsx)( 25539 EmbedVideoUrlInput, 25540 { 25541 onSubmit: (embedUrl) => { 25542 onSelectEmbedUrl(embedUrl); 25543 }, 25544 onClose: () => setIsEmbedUrlInputOpen(false), 25545 initialUrl: backgroundType === EMBED_VIDEO_BACKGROUND_TYPE ? url : "", 25546 allowedVideoProviders: filteredVideoProviders 25547 } 25548 ) 25549 ] }); 25550 } 25551 25552 // packages/block-library/build-module/cover/edit/cover-placeholder.mjs 25553 var import_block_editor66 = __toESM(require_block_editor(), 1); 25554 var import_i18n55 = __toESM(require_i18n(), 1); 25555 var import_blob6 = __toESM(require_blob(), 1); 25556 var import_jsx_runtime266 = __toESM(require_jsx_runtime(), 1); 25557 function CoverPlaceholder({ 25558 disableMediaButtons = false, 25559 children, 25560 onSelectMedia, 25561 onError, 25562 style: style2, 25563 toggleUseFeaturedImage 25564 }) { 25565 const onFilesPreUpload = (files) => { 25566 if (files.length === 1) { 25567 onSelectMedia({ url: (0, import_blob6.createBlobURL)(files[0]) }); 25568 } 25569 }; 25570 return /* @__PURE__ */ (0, import_jsx_runtime266.jsx)( 25571 import_block_editor66.MediaPlaceholder, 25572 { 25573 icon: /* @__PURE__ */ (0, import_jsx_runtime266.jsx)(import_block_editor66.BlockIcon, { icon: cover_default }), 25574 labels: { 25575 title: (0, import_i18n55.__)("Cover") 25576 }, 25577 onSelect: onSelectMedia, 25578 allowedTypes: ALLOWED_MEDIA_TYPES2, 25579 disableMediaButtons, 25580 onToggleFeaturedImage: toggleUseFeaturedImage, 25581 onFilesPreUpload, 25582 onError, 25583 style: style2, 25584 children 25585 } 25586 ); 25587 } 25588 25589 // packages/block-library/build-module/cover/edit/resizable-cover-popover.mjs 25590 var import_element49 = __toESM(require_element(), 1); 25591 var import_block_editor67 = __toESM(require_block_editor(), 1); 25592 var import_jsx_runtime267 = __toESM(require_jsx_runtime(), 1); 25593 var RESIZABLE_BOX_ENABLE_OPTION = { 25594 top: false, 25595 right: false, 25596 bottom: true, 25597 left: false, 25598 topRight: false, 25599 bottomRight: false, 25600 bottomLeft: false, 25601 topLeft: false 25602 }; 25603 var { ResizableBoxPopover } = unlock(import_block_editor67.privateApis); 25604 function ResizableCoverPopover({ 25605 className, 25606 height, 25607 minHeight, 25608 onResize, 25609 onResizeStart, 25610 onResizeStop, 25611 showHandle, 25612 size, 25613 width, 25614 ...props 25615 }) { 25616 const [isResizing, setIsResizing] = (0, import_element49.useState)(false); 25617 const resizableBoxProps = { 25618 className: clsx_default(className, { "is-resizing": isResizing }), 25619 enable: RESIZABLE_BOX_ENABLE_OPTION, 25620 onResizeStart: (_event, _direction, elt) => { 25621 onResizeStart(elt.clientHeight); 25622 onResize(elt.clientHeight); 25623 }, 25624 onResize: (_event, _direction, elt) => { 25625 onResize(elt.clientHeight); 25626 if (!isResizing) { 25627 setIsResizing(true); 25628 } 25629 }, 25630 onResizeStop: (_event, _direction, elt) => { 25631 onResizeStop(elt.clientHeight); 25632 setIsResizing(false); 25633 }, 25634 showHandle, 25635 size, 25636 __experimentalShowTooltip: true, 25637 __experimentalTooltipProps: { 25638 axis: "y", 25639 position: "bottom", 25640 isVisible: isResizing 25641 } 25642 }; 25643 return /* @__PURE__ */ (0, import_jsx_runtime267.jsx)( 25644 ResizableBoxPopover, 25645 { 25646 className: "block-library-cover__resizable-box-popover", 25647 resizableBoxProps, 25648 ...props 25649 } 25650 ); 25651 } 25652 25653 // node_modules/colord/index.mjs 25654 var r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; 25655 var t = function(r3) { 25656 return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3; 25657 }; 25658 var n = function(r3, t2, n2) { 25659 return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = Math.pow(10, t2)), Math.round(n2 * r3) / n2 + 0; 25660 }; 25661 var e = function(r3, t2, n2) { 25662 return void 0 === t2 && (t2 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t2 ? r3 : t2; 25663 }; 25664 var u = function(r3) { 25665 return (r3 = isFinite(r3) ? r3 % 360 : 0) > 0 ? r3 : r3 + 360; 25666 }; 25667 var a = function(r3) { 25668 return { r: e(r3.r, 0, 255), g: e(r3.g, 0, 255), b: e(r3.b, 0, 255), a: e(r3.a) }; 25669 }; 25670 var o = function(r3) { 25671 return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) }; 25672 }; 25673 var i = /^#([0-9a-f]{3,8})$/i; 25674 var s = function(r3) { 25675 var t2 = r3.toString(16); 25676 return t2.length < 2 ? "0" + t2 : t2; 25677 }; 25678 var h = function(r3) { 25679 var t2 = r3.r, n2 = r3.g, e3 = r3.b, u2 = r3.a, a2 = Math.max(t2, n2, e3), o2 = a2 - Math.min(t2, n2, e3), i2 = o2 ? a2 === t2 ? (n2 - e3) / o2 : a2 === n2 ? 2 + (e3 - t2) / o2 : 4 + (t2 - n2) / o2 : 0; 25680 return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o2 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; 25681 }; 25682 var b = function(r3) { 25683 var t2 = r3.h, n2 = r3.s, e3 = r3.v, u2 = r3.a; 25684 t2 = t2 / 360 * 6, n2 /= 100, e3 /= 100; 25685 var a2 = Math.floor(t2), o2 = e3 * (1 - n2), i2 = e3 * (1 - (t2 - a2) * n2), s2 = e3 * (1 - (1 - t2 + a2) * n2), h2 = a2 % 6; 25686 return { r: 255 * [e3, i2, o2, o2, s2, e3][h2], g: 255 * [s2, e3, e3, i2, o2, o2][h2], b: 255 * [o2, o2, s2, e3, e3, i2][h2], a: u2 }; 25687 }; 25688 var g = function(r3) { 25689 return { h: u(r3.h), s: e(r3.s, 0, 100), l: e(r3.l, 0, 100), a: e(r3.a) }; 25690 }; 25691 var d = function(r3) { 25692 return { h: n(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) }; 25693 }; 25694 var f = function(r3) { 25695 return b((n2 = (t2 = r3).s, { h: t2.h, s: (n2 *= ((e3 = t2.l) < 50 ? e3 : 100 - e3) / 100) > 0 ? 2 * n2 / (e3 + n2) * 100 : 0, v: e3 + n2, a: t2.a })); 25696 var t2, n2, e3; 25697 }; 25698 var c = function(r3) { 25699 return { h: (t2 = h(r3)).h, s: (u2 = (200 - (n2 = t2.s)) * (e3 = t2.v) / 100) > 0 && u2 < 200 ? n2 * e3 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t2.a }; 25700 var t2, n2, e3, u2; 25701 }; 25702 var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 25703 var p = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 25704 var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 25705 var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 25706 var y = { string: [[function(r3) { 25707 var t2 = i.exec(r3); 25708 return t2 ? (r3 = t2[1]).length <= 4 ? { r: parseInt(r3[0] + r3[0], 16), g: parseInt(r3[1] + r3[1], 16), b: parseInt(r3[2] + r3[2], 16), a: 4 === r3.length ? n(parseInt(r3[3] + r3[3], 16) / 255, 2) : 1 } : 6 === r3.length || 8 === r3.length ? { r: parseInt(r3.substr(0, 2), 16), g: parseInt(r3.substr(2, 2), 16), b: parseInt(r3.substr(4, 2), 16), a: 8 === r3.length ? n(parseInt(r3.substr(6, 2), 16) / 255, 2) : 1 } : null : null; 25709 }, "hex"], [function(r3) { 25710 var t2 = v.exec(r3) || m.exec(r3); 25711 return t2 ? t2[2] !== t2[4] || t2[4] !== t2[6] ? null : a({ r: Number(t2[1]) / (t2[2] ? 100 / 255 : 1), g: Number(t2[3]) / (t2[4] ? 100 / 255 : 1), b: Number(t2[5]) / (t2[6] ? 100 / 255 : 1), a: void 0 === t2[7] ? 1 : Number(t2[7]) / (t2[8] ? 100 : 1) }) : null; 25712 }, "rgb"], [function(t2) { 25713 var n2 = l.exec(t2) || p.exec(t2); 25714 if (!n2) return null; 25715 var e3, u2, a2 = g({ h: (e3 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e3) * (r2[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); 25716 return f(a2); 25717 }, "hsl"]], object: [[function(r3) { 25718 var n2 = r3.r, e3 = r3.g, u2 = r3.b, o2 = r3.a, i2 = void 0 === o2 ? 1 : o2; 25719 return t(n2) && t(e3) && t(u2) ? a({ r: Number(n2), g: Number(e3), b: Number(u2), a: Number(i2) }) : null; 25720 }, "rgb"], [function(r3) { 25721 var n2 = r3.h, e3 = r3.s, u2 = r3.l, a2 = r3.a, o2 = void 0 === a2 ? 1 : a2; 25722 if (!t(n2) || !t(e3) || !t(u2)) return null; 25723 var i2 = g({ h: Number(n2), s: Number(e3), l: Number(u2), a: Number(o2) }); 25724 return f(i2); 25725 }, "hsl"], [function(r3) { 25726 var n2 = r3.h, a2 = r3.s, o2 = r3.v, i2 = r3.a, s2 = void 0 === i2 ? 1 : i2; 25727 if (!t(n2) || !t(a2) || !t(o2)) return null; 25728 var h2 = (function(r4) { 25729 return { h: u(r4.h), s: e(r4.s, 0, 100), v: e(r4.v, 0, 100), a: e(r4.a) }; 25730 })({ h: Number(n2), s: Number(a2), v: Number(o2), a: Number(s2) }); 25731 return b(h2); 25732 }, "hsv"]] }; 25733 var N = function(r3, t2) { 25734 for (var n2 = 0; n2 < t2.length; n2++) { 25735 var e3 = t2[n2][0](r3); 25736 if (e3) return [e3, t2[n2][1]]; 25737 } 25738 return [null, void 0]; 25739 }; 25740 var x = function(r3) { 25741 return "string" == typeof r3 ? N(r3.trim(), y.string) : "object" == typeof r3 && null !== r3 ? N(r3, y.object) : [null, void 0]; 25742 }; 25743 var M = function(r3, t2) { 25744 var n2 = c(r3); 25745 return { h: n2.h, s: e(n2.s + 100 * t2, 0, 100), l: n2.l, a: n2.a }; 25746 }; 25747 var H = function(r3) { 25748 return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255; 25749 }; 25750 var $ = function(r3, t2) { 25751 var n2 = c(r3); 25752 return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t2, 0, 100), a: n2.a }; 25753 }; 25754 var j = (function() { 25755 function r3(r4) { 25756 this.parsed = x(r4)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; 25757 } 25758 return r3.prototype.isValid = function() { 25759 return null !== this.parsed; 25760 }, r3.prototype.brightness = function() { 25761 return n(H(this.rgba), 2); 25762 }, r3.prototype.isDark = function() { 25763 return H(this.rgba) < 0.5; 25764 }, r3.prototype.isLight = function() { 25765 return H(this.rgba) >= 0.5; 25766 }, r3.prototype.toHex = function() { 25767 return r4 = o(this.rgba), t2 = r4.r, e3 = r4.g, u2 = r4.b, i2 = (a2 = r4.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t2) + s(e3) + s(u2) + i2; 25768 var r4, t2, e3, u2, a2, i2; 25769 }, r3.prototype.toRgb = function() { 25770 return o(this.rgba); 25771 }, r3.prototype.toRgbString = function() { 25772 return r4 = o(this.rgba), t2 = r4.r, n2 = r4.g, e3 = r4.b, (u2 = r4.a) < 1 ? "rgba(" + t2 + ", " + n2 + ", " + e3 + ", " + u2 + ")" : "rgb(" + t2 + ", " + n2 + ", " + e3 + ")"; 25773 var r4, t2, n2, e3, u2; 25774 }, r3.prototype.toHsl = function() { 25775 return d(c(this.rgba)); 25776 }, r3.prototype.toHslString = function() { 25777 return r4 = d(c(this.rgba)), t2 = r4.h, n2 = r4.s, e3 = r4.l, (u2 = r4.a) < 1 ? "hsla(" + t2 + ", " + n2 + "%, " + e3 + "%, " + u2 + ")" : "hsl(" + t2 + ", " + n2 + "%, " + e3 + "%)"; 25778 var r4, t2, n2, e3, u2; 25779 }, r3.prototype.toHsv = function() { 25780 return r4 = h(this.rgba), { h: n(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) }; 25781 var r4; 25782 }, r3.prototype.invert = function() { 25783 return w({ r: 255 - (r4 = this.rgba).r, g: 255 - r4.g, b: 255 - r4.b, a: r4.a }); 25784 var r4; 25785 }, r3.prototype.saturate = function(r4) { 25786 return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, r4)); 25787 }, r3.prototype.desaturate = function(r4) { 25788 return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, -r4)); 25789 }, r3.prototype.grayscale = function() { 25790 return w(M(this.rgba, -1)); 25791 }, r3.prototype.lighten = function(r4) { 25792 return void 0 === r4 && (r4 = 0.1), w($(this.rgba, r4)); 25793 }, r3.prototype.darken = function(r4) { 25794 return void 0 === r4 && (r4 = 0.1), w($(this.rgba, -r4)); 25795 }, r3.prototype.rotate = function(r4) { 25796 return void 0 === r4 && (r4 = 15), this.hue(this.hue() + r4); 25797 }, r3.prototype.alpha = function(r4) { 25798 return "number" == typeof r4 ? w({ r: (t2 = this.rgba).r, g: t2.g, b: t2.b, a: r4 }) : n(this.rgba.a, 3); 25799 var t2; 25800 }, r3.prototype.hue = function(r4) { 25801 var t2 = c(this.rgba); 25802 return "number" == typeof r4 ? w({ h: r4, s: t2.s, l: t2.l, a: t2.a }) : n(t2.h); 25803 }, r3.prototype.isEqual = function(r4) { 25804 return this.toHex() === w(r4).toHex(); 25805 }, r3; 25806 })(); 25807 var w = function(r3) { 25808 return r3 instanceof j ? r3 : new j(r3); 25809 }; 25810 var S = []; 25811 var k = function(r3) { 25812 r3.forEach(function(r4) { 25813 S.indexOf(r4) < 0 && (r4(j, y), S.push(r4)); 25814 }); 25815 }; 25816 25817 // node_modules/colord/plugins/names.mjs 25818 function names_default(e3, f2) { 25819 var a2 = { white: "#ffffff", bisque: "#ffe4c4", blue: "#0000ff", cadetblue: "#5f9ea0", chartreuse: "#7fff00", chocolate: "#d2691e", coral: "#ff7f50", antiquewhite: "#faebd7", aqua: "#00ffff", azure: "#f0ffff", whitesmoke: "#f5f5f5", papayawhip: "#ffefd5", plum: "#dda0dd", blanchedalmond: "#ffebcd", black: "#000000", gold: "#ffd700", goldenrod: "#daa520", gainsboro: "#dcdcdc", cornsilk: "#fff8dc", cornflowerblue: "#6495ed", burlywood: "#deb887", aquamarine: "#7fffd4", beige: "#f5f5dc", crimson: "#dc143c", cyan: "#00ffff", darkblue: "#00008b", darkcyan: "#008b8b", darkgoldenrod: "#b8860b", darkkhaki: "#bdb76b", darkgray: "#a9a9a9", darkgreen: "#006400", darkgrey: "#a9a9a9", peachpuff: "#ffdab9", darkmagenta: "#8b008b", darkred: "#8b0000", darkorchid: "#9932cc", darkorange: "#ff8c00", darkslateblue: "#483d8b", gray: "#808080", darkslategray: "#2f4f4f", darkslategrey: "#2f4f4f", deeppink: "#ff1493", deepskyblue: "#00bfff", wheat: "#f5deb3", firebrick: "#b22222", floralwhite: "#fffaf0", ghostwhite: "#f8f8ff", darkviolet: "#9400d3", magenta: "#ff00ff", green: "#008000", dodgerblue: "#1e90ff", grey: "#808080", honeydew: "#f0fff0", hotpink: "#ff69b4", blueviolet: "#8a2be2", forestgreen: "#228b22", lawngreen: "#7cfc00", indianred: "#cd5c5c", indigo: "#4b0082", fuchsia: "#ff00ff", brown: "#a52a2a", maroon: "#800000", mediumblue: "#0000cd", lightcoral: "#f08080", darkturquoise: "#00ced1", lightcyan: "#e0ffff", ivory: "#fffff0", lightyellow: "#ffffe0", lightsalmon: "#ffa07a", lightseagreen: "#20b2aa", linen: "#faf0e6", mediumaquamarine: "#66cdaa", lemonchiffon: "#fffacd", lime: "#00ff00", khaki: "#f0e68c", mediumseagreen: "#3cb371", limegreen: "#32cd32", mediumspringgreen: "#00fa9a", lightskyblue: "#87cefa", lightblue: "#add8e6", midnightblue: "#191970", lightpink: "#ffb6c1", mistyrose: "#ffe4e1", moccasin: "#ffe4b5", mintcream: "#f5fffa", lightslategray: "#778899", lightslategrey: "#778899", navajowhite: "#ffdead", navy: "#000080", mediumvioletred: "#c71585", powderblue: "#b0e0e6", palegoldenrod: "#eee8aa", oldlace: "#fdf5e6", paleturquoise: "#afeeee", mediumturquoise: "#48d1cc", mediumorchid: "#ba55d3", rebeccapurple: "#663399", lightsteelblue: "#b0c4de", mediumslateblue: "#7b68ee", thistle: "#d8bfd8", tan: "#d2b48c", orchid: "#da70d6", mediumpurple: "#9370db", purple: "#800080", pink: "#ffc0cb", skyblue: "#87ceeb", springgreen: "#00ff7f", palegreen: "#98fb98", red: "#ff0000", yellow: "#ffff00", slateblue: "#6a5acd", lavenderblush: "#fff0f5", peru: "#cd853f", palevioletred: "#db7093", violet: "#ee82ee", teal: "#008080", slategray: "#708090", slategrey: "#708090", aliceblue: "#f0f8ff", darkseagreen: "#8fbc8f", darkolivegreen: "#556b2f", greenyellow: "#adff2f", seagreen: "#2e8b57", seashell: "#fff5ee", tomato: "#ff6347", silver: "#c0c0c0", sienna: "#a0522d", lavender: "#e6e6fa", lightgreen: "#90ee90", orange: "#ffa500", orangered: "#ff4500", steelblue: "#4682b4", royalblue: "#4169e1", turquoise: "#40e0d0", yellowgreen: "#9acd32", salmon: "#fa8072", saddlebrown: "#8b4513", sandybrown: "#f4a460", rosybrown: "#bc8f8f", darksalmon: "#e9967a", lightgoldenrodyellow: "#fafad2", snow: "#fffafa", lightgrey: "#d3d3d3", lightgray: "#d3d3d3", dimgray: "#696969", dimgrey: "#696969", olivedrab: "#6b8e23", olive: "#808000" }, r3 = {}; 25820 for (var d2 in a2) r3[a2[d2]] = d2; 25821 var l2 = {}; 25822 e3.prototype.toName = function(f3) { 25823 if (!(this.rgba.a || this.rgba.r || this.rgba.g || this.rgba.b)) return "transparent"; 25824 var d3, i2, n2 = r3[this.toHex()]; 25825 if (n2) return n2; 25826 if (null == f3 ? void 0 : f3.closest) { 25827 var o2 = this.toRgb(), t2 = 1 / 0, b2 = "black"; 25828 if (!l2.length) for (var c2 in a2) l2[c2] = new e3(a2[c2]).toRgb(); 25829 for (var g2 in a2) { 25830 var u2 = (d3 = o2, i2 = l2[g2], Math.pow(d3.r - i2.r, 2) + Math.pow(d3.g - i2.g, 2) + Math.pow(d3.b - i2.b, 2)); 25831 u2 < t2 && (t2 = u2, b2 = g2); 25832 } 25833 return b2; 25834 } 25835 }; 25836 f2.string.push([function(f3) { 25837 var r4 = f3.toLowerCase(), d3 = "transparent" === r4 ? "#0000" : a2[r4]; 25838 return d3 ? new e3(d3).toRgb() : null; 25839 }, "name"]); 25840 } 25841 25842 // node_modules/fast-average-color/dist/index.esm.js 25843 function toHex(num) { 25844 var str = num.toString(16); 25845 return str.length === 1 ? "0" + str : str; 25846 } 25847 function arrayToHex(arr) { 25848 return "#" + arr.map(toHex).join(""); 25849 } 25850 function isDark(color) { 25851 var result = (color[0] * 299 + color[1] * 587 + color[2] * 114) / 1e3; 25852 return result < 128; 25853 } 25854 function prepareIgnoredColor(color) { 25855 if (!color) { 25856 return []; 25857 } 25858 return isRGBArray(color) ? color : [color]; 25859 } 25860 function isRGBArray(value) { 25861 return Array.isArray(value[0]); 25862 } 25863 function isIgnoredColor(data, index, ignoredColor) { 25864 for (var i2 = 0; i2 < ignoredColor.length; i2++) { 25865 if (isIgnoredColorAsNumbers(data, index, ignoredColor[i2])) { 25866 return true; 25867 } 25868 } 25869 return false; 25870 } 25871 function isIgnoredColorAsNumbers(data, index, ignoredColor) { 25872 switch (ignoredColor.length) { 25873 case 3: 25874 if (isIgnoredRGBColor(data, index, ignoredColor)) { 25875 return true; 25876 } 25877 break; 25878 case 4: 25879 if (isIgnoredRGBAColor(data, index, ignoredColor)) { 25880 return true; 25881 } 25882 break; 25883 case 5: 25884 if (isIgnoredRGBAColorWithThreshold(data, index, ignoredColor)) { 25885 return true; 25886 } 25887 break; 25888 default: 25889 return false; 25890 } 25891 } 25892 function isIgnoredRGBColor(data, index, ignoredColor) { 25893 if (data[index + 3] !== 255) { 25894 return true; 25895 } 25896 if (data[index] === ignoredColor[0] && data[index + 1] === ignoredColor[1] && data[index + 2] === ignoredColor[2]) { 25897 return true; 25898 } 25899 return false; 25900 } 25901 function isIgnoredRGBAColor(data, index, ignoredColor) { 25902 if (data[index + 3] && ignoredColor[3]) { 25903 return data[index] === ignoredColor[0] && data[index + 1] === ignoredColor[1] && data[index + 2] === ignoredColor[2] && data[index + 3] === ignoredColor[3]; 25904 } 25905 return data[index + 3] === ignoredColor[3]; 25906 } 25907 function inRange(colorComponent, ignoredColorComponent, value) { 25908 return colorComponent >= ignoredColorComponent - value && colorComponent <= ignoredColorComponent + value; 25909 } 25910 function isIgnoredRGBAColorWithThreshold(data, index, ignoredColor) { 25911 var redIgnored = ignoredColor[0]; 25912 var greenIgnored = ignoredColor[1]; 25913 var blueIgnored = ignoredColor[2]; 25914 var alphaIgnored = ignoredColor[3]; 25915 var threshold = ignoredColor[4]; 25916 var alphaData = data[index + 3]; 25917 var alphaInRange = inRange(alphaData, alphaIgnored, threshold); 25918 if (!alphaIgnored) { 25919 return alphaInRange; 25920 } 25921 if (!alphaData && alphaInRange) { 25922 return true; 25923 } 25924 if (inRange(data[index], redIgnored, threshold) && inRange(data[index + 1], greenIgnored, threshold) && inRange(data[index + 2], blueIgnored, threshold) && alphaInRange) { 25925 return true; 25926 } 25927 return false; 25928 } 25929 function dominantAlgorithm(arr, len, options2) { 25930 var colorHash = {}; 25931 var divider = 24; 25932 var ignoredColor = options2.ignoredColor; 25933 var step = options2.step; 25934 var max = [0, 0, 0, 0, 0]; 25935 for (var i2 = 0; i2 < len; i2 += step) { 25936 var red = arr[i2]; 25937 var green = arr[i2 + 1]; 25938 var blue = arr[i2 + 2]; 25939 var alpha = arr[i2 + 3]; 25940 if (ignoredColor && isIgnoredColor(arr, i2, ignoredColor)) { 25941 continue; 25942 } 25943 var key = Math.round(red / divider) + "," + Math.round(green / divider) + "," + Math.round(blue / divider); 25944 if (colorHash[key]) { 25945 colorHash[key] = [ 25946 colorHash[key][0] + red * alpha, 25947 colorHash[key][1] + green * alpha, 25948 colorHash[key][2] + blue * alpha, 25949 colorHash[key][3] + alpha, 25950 colorHash[key][4] + 1 25951 ]; 25952 } else { 25953 colorHash[key] = [red * alpha, green * alpha, blue * alpha, alpha, 1]; 25954 } 25955 if (max[4] < colorHash[key][4]) { 25956 max = colorHash[key]; 25957 } 25958 } 25959 var redTotal = max[0]; 25960 var greenTotal = max[1]; 25961 var blueTotal = max[2]; 25962 var alphaTotal = max[3]; 25963 var count = max[4]; 25964 return alphaTotal ? [ 25965 Math.round(redTotal / alphaTotal), 25966 Math.round(greenTotal / alphaTotal), 25967 Math.round(blueTotal / alphaTotal), 25968 Math.round(alphaTotal / count) 25969 ] : options2.defaultColor; 25970 } 25971 function simpleAlgorithm(arr, len, options2) { 25972 var redTotal = 0; 25973 var greenTotal = 0; 25974 var blueTotal = 0; 25975 var alphaTotal = 0; 25976 var count = 0; 25977 var ignoredColor = options2.ignoredColor; 25978 var step = options2.step; 25979 for (var i2 = 0; i2 < len; i2 += step) { 25980 var alpha = arr[i2 + 3]; 25981 var red = arr[i2] * alpha; 25982 var green = arr[i2 + 1] * alpha; 25983 var blue = arr[i2 + 2] * alpha; 25984 if (ignoredColor && isIgnoredColor(arr, i2, ignoredColor)) { 25985 continue; 25986 } 25987 redTotal += red; 25988 greenTotal += green; 25989 blueTotal += blue; 25990 alphaTotal += alpha; 25991 count++; 25992 } 25993 return alphaTotal ? [ 25994 Math.round(redTotal / alphaTotal), 25995 Math.round(greenTotal / alphaTotal), 25996 Math.round(blueTotal / alphaTotal), 25997 Math.round(alphaTotal / count) 25998 ] : options2.defaultColor; 25999 } 26000 function sqrtAlgorithm(arr, len, options2) { 26001 var redTotal = 0; 26002 var greenTotal = 0; 26003 var blueTotal = 0; 26004 var alphaTotal = 0; 26005 var count = 0; 26006 var ignoredColor = options2.ignoredColor; 26007 var step = options2.step; 26008 for (var i2 = 0; i2 < len; i2 += step) { 26009 var red = arr[i2]; 26010 var green = arr[i2 + 1]; 26011 var blue = arr[i2 + 2]; 26012 var alpha = arr[i2 + 3]; 26013 if (ignoredColor && isIgnoredColor(arr, i2, ignoredColor)) { 26014 continue; 26015 } 26016 redTotal += red * red * alpha; 26017 greenTotal += green * green * alpha; 26018 blueTotal += blue * blue * alpha; 26019 alphaTotal += alpha; 26020 count++; 26021 } 26022 return alphaTotal ? [ 26023 Math.round(Math.sqrt(redTotal / alphaTotal)), 26024 Math.round(Math.sqrt(greenTotal / alphaTotal)), 26025 Math.round(Math.sqrt(blueTotal / alphaTotal)), 26026 Math.round(alphaTotal / count) 26027 ] : options2.defaultColor; 26028 } 26029 function getDefaultColor(options2) { 26030 return getOption(options2, "defaultColor", [0, 0, 0, 0]); 26031 } 26032 function getOption(options2, name118, defaultValue) { 26033 return options2[name118] === void 0 ? defaultValue : options2[name118]; 26034 } 26035 var MIN_SIZE = 10; 26036 var MAX_SIZE = 100; 26037 function isSvg(filename) { 26038 return filename.search(/\.svg(\?|$)/i) !== -1; 26039 } 26040 function getOriginalSize(resource) { 26041 if (isInstanceOfHTMLImageElement(resource)) { 26042 var width = resource.naturalWidth; 26043 var height = resource.naturalHeight; 26044 if (!resource.naturalWidth && isSvg(resource.src)) { 26045 width = height = MAX_SIZE; 26046 } 26047 return { 26048 width, 26049 height 26050 }; 26051 } 26052 if (isInstanceOfHTMLVideoElement(resource)) { 26053 return { 26054 width: resource.videoWidth, 26055 height: resource.videoHeight 26056 }; 26057 } 26058 return { 26059 width: resource.width, 26060 height: resource.height 26061 }; 26062 } 26063 function getSrc(resource) { 26064 if (isInstanceOfHTMLCanvasElement(resource)) { 26065 return "canvas"; 26066 } 26067 if (isInstanceOfOffscreenCanvas(resource)) { 26068 return "offscreencanvas"; 26069 } 26070 if (isInstanceOfImageBitmap(resource)) { 26071 return "imagebitmap"; 26072 } 26073 return resource.src; 26074 } 26075 function isInstanceOfHTMLImageElement(resource) { 26076 return typeof HTMLImageElement !== "undefined" && resource instanceof HTMLImageElement; 26077 } 26078 function isInstanceOfOffscreenCanvas(resource) { 26079 return typeof OffscreenCanvas !== "undefined" && resource instanceof OffscreenCanvas; 26080 } 26081 function isInstanceOfHTMLVideoElement(resource) { 26082 return typeof HTMLVideoElement !== "undefined" && resource instanceof HTMLVideoElement; 26083 } 26084 function isInstanceOfHTMLCanvasElement(resource) { 26085 return typeof HTMLCanvasElement !== "undefined" && resource instanceof HTMLCanvasElement; 26086 } 26087 function isInstanceOfImageBitmap(resource) { 26088 return typeof ImageBitmap !== "undefined" && resource instanceof ImageBitmap; 26089 } 26090 function prepareSizeAndPosition(originalSize, options2) { 26091 var srcLeft = getOption(options2, "left", 0); 26092 var srcTop = getOption(options2, "top", 0); 26093 var srcWidth = getOption(options2, "width", originalSize.width); 26094 var srcHeight = getOption(options2, "height", originalSize.height); 26095 var destWidth = srcWidth; 26096 var destHeight = srcHeight; 26097 if (options2.mode === "precision") { 26098 return { 26099 srcLeft, 26100 srcTop, 26101 srcWidth, 26102 srcHeight, 26103 destWidth, 26104 destHeight 26105 }; 26106 } 26107 var factor; 26108 if (srcWidth > srcHeight) { 26109 factor = srcWidth / srcHeight; 26110 destWidth = MAX_SIZE; 26111 destHeight = Math.round(destWidth / factor); 26112 } else { 26113 factor = srcHeight / srcWidth; 26114 destHeight = MAX_SIZE; 26115 destWidth = Math.round(destHeight / factor); 26116 } 26117 if (destWidth > srcWidth || destHeight > srcHeight || destWidth < MIN_SIZE || destHeight < MIN_SIZE) { 26118 destWidth = srcWidth; 26119 destHeight = srcHeight; 26120 } 26121 return { 26122 srcLeft, 26123 srcTop, 26124 srcWidth, 26125 srcHeight, 26126 destWidth, 26127 destHeight 26128 }; 26129 } 26130 var isWebWorkers = typeof window === "undefined"; 26131 function makeCanvas() { 26132 return isWebWorkers ? new OffscreenCanvas(1, 1) : document.createElement("canvas"); 26133 } 26134 var ERROR_PREFIX = "FastAverageColor: "; 26135 function outputError(message, silent, error2) { 26136 if (!silent) { 26137 console.error(ERROR_PREFIX + message); 26138 if (error2) { 26139 console.error(error2); 26140 } 26141 } 26142 } 26143 function getError(text) { 26144 return Error(ERROR_PREFIX + text); 26145 } 26146 var FastAverageColor = ( 26147 /** @class */ 26148 (function() { 26149 function FastAverageColor2() { 26150 this.canvas = null; 26151 this.ctx = null; 26152 } 26153 FastAverageColor2.prototype.getColorAsync = function(resource, options2) { 26154 if (!resource) { 26155 return Promise.reject(getError("call .getColorAsync() without resource.")); 26156 } 26157 if (typeof resource === "string") { 26158 if (typeof Image === "undefined") { 26159 return Promise.reject(getError("resource as string is not supported in this environment")); 26160 } 26161 var img = new Image(); 26162 img.crossOrigin = options2 && options2.crossOrigin || ""; 26163 img.src = resource; 26164 return this.bindImageEvents(img, options2); 26165 } else if (isInstanceOfHTMLImageElement(resource) && !resource.complete) { 26166 return this.bindImageEvents(resource, options2); 26167 } else { 26168 var result = this.getColor(resource, options2); 26169 return result.error ? Promise.reject(result.error) : Promise.resolve(result); 26170 } 26171 }; 26172 FastAverageColor2.prototype.getColor = function(resource, options2) { 26173 options2 = options2 || {}; 26174 var defaultColor = getDefaultColor(options2); 26175 if (!resource) { 26176 outputError("call .getColor(null) without resource", options2.silent); 26177 return this.prepareResult(defaultColor); 26178 } 26179 var originalSize = getOriginalSize(resource); 26180 var size = prepareSizeAndPosition(originalSize, options2); 26181 if (!size.srcWidth || !size.srcHeight || !size.destWidth || !size.destHeight) { 26182 outputError('incorrect sizes for resource "'.concat(getSrc(resource), '"'), options2.silent); 26183 return this.prepareResult(defaultColor); 26184 } 26185 if (!this.canvas) { 26186 this.canvas = makeCanvas(); 26187 } 26188 if (!this.ctx) { 26189 this.ctx = this.canvas.getContext && this.canvas.getContext("2d"); 26190 if (!this.ctx) { 26191 outputError("Canvas Context 2D is not supported in this browser", options2.silent); 26192 return this.prepareResult(defaultColor); 26193 } 26194 } 26195 this.canvas.width = size.destWidth; 26196 this.canvas.height = size.destHeight; 26197 var value = defaultColor; 26198 try { 26199 this.ctx.clearRect(0, 0, size.destWidth, size.destHeight); 26200 this.ctx.drawImage(resource, size.srcLeft, size.srcTop, size.srcWidth, size.srcHeight, 0, 0, size.destWidth, size.destHeight); 26201 var bitmapData = this.ctx.getImageData(0, 0, size.destWidth, size.destHeight).data; 26202 value = this.getColorFromArray4(bitmapData, options2); 26203 } catch (e3) { 26204 outputError("security error (CORS) for resource ".concat(getSrc(resource), ".\nDetails: https://developer.mozilla.org/en/docs/Web/HTML/CORS_enabled_image"), options2.silent, e3); 26205 } 26206 return this.prepareResult(value); 26207 }; 26208 FastAverageColor2.prototype.getColorFromArray4 = function(arr, options2) { 26209 options2 = options2 || {}; 26210 var bytesPerPixel = 4; 26211 var arrLength = arr.length; 26212 var defaultColor = getDefaultColor(options2); 26213 if (arrLength < bytesPerPixel) { 26214 return defaultColor; 26215 } 26216 var len = arrLength - arrLength % bytesPerPixel; 26217 var step = (options2.step || 1) * bytesPerPixel; 26218 var algorithm; 26219 switch (options2.algorithm || "sqrt") { 26220 case "simple": 26221 algorithm = simpleAlgorithm; 26222 break; 26223 case "sqrt": 26224 algorithm = sqrtAlgorithm; 26225 break; 26226 case "dominant": 26227 algorithm = dominantAlgorithm; 26228 break; 26229 default: 26230 throw getError("".concat(options2.algorithm, " is unknown algorithm")); 26231 } 26232 return algorithm(arr, len, { 26233 defaultColor, 26234 ignoredColor: prepareIgnoredColor(options2.ignoredColor), 26235 step 26236 }); 26237 }; 26238 FastAverageColor2.prototype.prepareResult = function(value) { 26239 var rgb = value.slice(0, 3); 26240 var rgba = [value[0], value[1], value[2], value[3] / 255]; 26241 var isDarkColor = isDark(value); 26242 return { 26243 value: [value[0], value[1], value[2], value[3]], 26244 rgb: "rgb(" + rgb.join(",") + ")", 26245 rgba: "rgba(" + rgba.join(",") + ")", 26246 hex: arrayToHex(rgb), 26247 hexa: arrayToHex(value), 26248 isDark: isDarkColor, 26249 isLight: !isDarkColor 26250 }; 26251 }; 26252 FastAverageColor2.prototype.destroy = function() { 26253 if (this.canvas) { 26254 this.canvas.width = 1; 26255 this.canvas.height = 1; 26256 this.canvas = null; 26257 } 26258 this.ctx = null; 26259 }; 26260 FastAverageColor2.prototype.bindImageEvents = function(resource, options2) { 26261 var _this = this; 26262 return new Promise(function(resolve, reject) { 26263 var onload = function() { 26264 unbindEvents(); 26265 var result = _this.getColor(resource, options2); 26266 if (result.error) { 26267 reject(result.error); 26268 } else { 26269 resolve(result); 26270 } 26271 }; 26272 var onerror = function() { 26273 unbindEvents(); 26274 reject(getError('Error loading image "'.concat(resource.src, '".'))); 26275 }; 26276 var onabort = function() { 26277 unbindEvents(); 26278 reject(getError('Image "'.concat(resource.src, '" loading aborted'))); 26279 }; 26280 var unbindEvents = function() { 26281 resource.removeEventListener("load", onload); 26282 resource.removeEventListener("error", onerror); 26283 resource.removeEventListener("abort", onabort); 26284 }; 26285 resource.addEventListener("load", onload); 26286 resource.addEventListener("error", onerror); 26287 resource.addEventListener("abort", onabort); 26288 }); 26289 }; 26290 return FastAverageColor2; 26291 })() 26292 ); 26293 26294 // packages/block-library/build-module/cover/edit/color-utils.mjs 26295 var import_hooks19 = __toESM(require_hooks(), 1); 26296 k([names_default]); 26297 var DEFAULT_BACKGROUND_COLOR = "#FFF"; 26298 var DEFAULT_OVERLAY_COLOR = "#000"; 26299 function compositeSourceOver(source, dest) { 26300 return { 26301 r: source.r * source.a + dest.r * dest.a * (1 - source.a), 26302 g: source.g * source.a + dest.g * dest.a * (1 - source.a), 26303 b: source.b * source.a + dest.b * dest.a * (1 - source.a), 26304 a: source.a + dest.a * (1 - source.a) 26305 }; 26306 } 26307 function retrieveFastAverageColor() { 26308 if (!retrieveFastAverageColor.fastAverageColor) { 26309 retrieveFastAverageColor.fastAverageColor = new FastAverageColor(); 26310 } 26311 return retrieveFastAverageColor.fastAverageColor; 26312 } 26313 var getMediaColor = memize(async (url) => { 26314 if (!url) { 26315 return DEFAULT_BACKGROUND_COLOR; 26316 } 26317 const { r: r3, g: g2, b: b2, a: a2 } = w(DEFAULT_BACKGROUND_COLOR).toRgb(); 26318 try { 26319 const imgCrossOrigin = (0, import_hooks19.applyFilters)( 26320 "media.crossOrigin", 26321 void 0, 26322 url 26323 ); 26324 const color = await retrieveFastAverageColor().getColorAsync(url, { 26325 // The default color is white, which is the color 26326 // that is returned if there's an error. 26327 // colord returns alpga 0-1, FAC needs 0-255 26328 defaultColor: [r3, g2, b2, a2 * 255], 26329 // Errors that come up don't reject the promise, 26330 // so error logging has to be silenced 26331 // with this option. 26332 silent: false, 26333 crossOrigin: imgCrossOrigin 26334 }); 26335 return color.hex; 26336 } catch { 26337 return DEFAULT_BACKGROUND_COLOR; 26338 } 26339 }); 26340 function compositeIsDark(dimRatio, overlayColor, backgroundColor) { 26341 if (overlayColor === backgroundColor || dimRatio === 100) { 26342 return w(overlayColor).isDark(); 26343 } 26344 const overlay = w(overlayColor).alpha(dimRatio / 100).toRgb(); 26345 const background = w(backgroundColor).toRgb(); 26346 const composite = compositeSourceOver(overlay, background); 26347 return w(composite).isDark(); 26348 } 26349 26350 // packages/block-library/build-module/cover/edit/index.mjs 26351 var import_jsx_runtime268 = __toESM(require_jsx_runtime(), 1); 26352 var { openMediaEditorModalKey } = unlock(import_block_editor68.privateApis); 26353 function getInnerBlocksTemplate(attributes2) { 26354 return [ 26355 [ 26356 "core/paragraph", 26357 { 26358 style: { 26359 typography: { 26360 textAlign: "center" 26361 } 26362 }, 26363 placeholder: (0, import_i18n56.__)("Write title\u2026"), 26364 ...attributes2 26365 } 26366 ] 26367 ]; 26368 } 26369 var isTemporaryMedia = (id, url) => !id && (0, import_blob7.isBlobURL)(url); 26370 function CoverEdit({ 26371 attributes: attributes2, 26372 clientId, 26373 isSelected, 26374 overlayColor, 26375 setAttributes, 26376 setOverlayColor, 26377 toggleSelection, 26378 context: { postId, postType } 26379 }) { 26380 const { 26381 contentPosition, 26382 id, 26383 url: originalUrl, 26384 backgroundType: originalBackgroundType, 26385 useFeaturedImage, 26386 dimRatio, 26387 focalPoint, 26388 hasParallax, 26389 isDark: isDark2, 26390 isRepeated, 26391 minHeight, 26392 minHeightUnit, 26393 alt, 26394 allowedBlocks, 26395 templateLock, 26396 tagName: TagName2 = "div", 26397 isUserOverlayColor, 26398 sizeSlug, 26399 poster 26400 } = attributes2; 26401 const [featuredImage] = (0, import_core_data16.useEntityProp)( 26402 "postType", 26403 postType, 26404 "featured_media", 26405 postId 26406 ); 26407 const { getSettings: getSettings2 } = (0, import_data29.useSelect)(import_block_editor68.store); 26408 const openMediaEditorModal = (0, import_data29.useSelect)( 26409 (select10) => select10(import_block_editor68.store).getSettings()[openMediaEditorModalKey], 26410 [] 26411 ); 26412 const { __unstableMarkNextChangeAsNotPersistent, replaceInnerBlocks } = (0, import_data29.useDispatch)(import_block_editor68.store); 26413 const registry = (0, import_data29.useRegistry)(); 26414 const propsRef = (0, import_element50.useRef)({ attributes: attributes2, overlayColor }); 26415 (0, import_element50.useLayoutEffect)(() => { 26416 propsRef.current = { attributes: attributes2, overlayColor }; 26417 }); 26418 const { media } = (0, import_data29.useSelect)( 26419 (select10) => { 26420 return { 26421 media: featuredImage && useFeaturedImage ? select10(import_core_data16.store).getEntityRecord( 26422 "postType", 26423 "attachment", 26424 featuredImage, 26425 { 26426 context: "view" 26427 } 26428 ) : void 0 26429 }; 26430 }, 26431 [featuredImage, useFeaturedImage] 26432 ); 26433 const mediaUrl = media?.media_details?.sizes?.[sizeSlug]?.source_url ?? media?.source_url; 26434 (0, import_element50.useEffect)(() => { 26435 (async () => { 26436 if (!useFeaturedImage) { 26437 return; 26438 } 26439 const averageBackgroundColor = await getMediaColor(mediaUrl); 26440 const { attributes: currentAttrs, overlayColor: currentOverlay } = propsRef.current; 26441 let newOverlayColor = currentOverlay.color; 26442 if (!currentAttrs.isUserOverlayColor) { 26443 newOverlayColor = averageBackgroundColor; 26444 __unstableMarkNextChangeAsNotPersistent(); 26445 setOverlayColor(newOverlayColor); 26446 } 26447 const newIsDark = compositeIsDark( 26448 currentAttrs.dimRatio, 26449 newOverlayColor, 26450 averageBackgroundColor 26451 ); 26452 __unstableMarkNextChangeAsNotPersistent(); 26453 setAttributes({ 26454 isDark: newIsDark, 26455 isUserOverlayColor: currentAttrs.isUserOverlayColor || false 26456 }); 26457 })(); 26458 }, [ 26459 mediaUrl, 26460 __unstableMarkNextChangeAsNotPersistent, 26461 setAttributes, 26462 setOverlayColor, 26463 useFeaturedImage 26464 ]); 26465 const url = useFeaturedImage ? mediaUrl : ( 26466 // Ensure the url is not malformed due to sanitization through `wp_kses`. 26467 originalUrl?.replaceAll("&", "&") 26468 ); 26469 const backgroundType = useFeaturedImage ? IMAGE_BACKGROUND_TYPE : originalBackgroundType; 26470 const { createErrorNotice } = (0, import_data29.useDispatch)(import_notices4.store); 26471 const { gradientClass, gradientValue } = (0, import_block_editor68.__experimentalUseGradient)(); 26472 const scaffoldInnerBlocks = () => { 26473 const { 26474 getBlocks, 26475 isBlockSelected, 26476 getSelectedBlocksInitialCaretPosition 26477 } = registry.select(import_block_editor68.store); 26478 if (getBlocks(clientId).length > 0) { 26479 return; 26480 } 26481 const [fontSizes] = unlock( 26482 registry.select(import_block_editor68.store) 26483 ).getBlockSettings(clientId, "typography.fontSizes"); 26484 const hasFontSizes = fontSizes?.length > 0; 26485 replaceInnerBlocks( 26486 clientId, 26487 (0, import_blocks21.createBlocksFromInnerBlocksTemplate)( 26488 getInnerBlocksTemplate({ 26489 fontSize: hasFontSizes ? "large" : void 0 26490 }) 26491 ), 26492 isBlockSelected(clientId), 26493 getSelectedBlocksInitialCaretPosition() 26494 ); 26495 }; 26496 const onSelectMedia = async (newMedia) => { 26497 const mediaAttributes = attributesFromMedia(newMedia); 26498 const isImage = [newMedia?.type, newMedia?.media_type].includes( 26499 IMAGE_BACKGROUND_TYPE 26500 ); 26501 const averageBackgroundColor = await getMediaColor( 26502 isImage ? newMedia?.url : void 0 26503 ); 26504 const { attributes: currentAttrs, overlayColor: currentOverlay } = propsRef.current; 26505 let newOverlayColor = currentOverlay.color; 26506 if (!currentAttrs.isUserOverlayColor) { 26507 newOverlayColor = averageBackgroundColor; 26508 setOverlayColor(newOverlayColor); 26509 __unstableMarkNextChangeAsNotPersistent(); 26510 } 26511 const newDimRatio = currentAttrs.url === void 0 && currentAttrs.dimRatio === 100 ? 50 : currentAttrs.dimRatio; 26512 const newIsDark = compositeIsDark( 26513 newDimRatio, 26514 newOverlayColor, 26515 averageBackgroundColor 26516 ); 26517 if (backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id) { 26518 const { imageDefaultSize } = getSettings2(); 26519 if (sizeSlug && (newMedia?.sizes?.[sizeSlug] || newMedia?.media_details?.sizes?.[sizeSlug])) { 26520 mediaAttributes.sizeSlug = sizeSlug; 26521 mediaAttributes.url = newMedia?.sizes?.[sizeSlug]?.url || newMedia?.media_details?.sizes?.[sizeSlug]?.source_url; 26522 } else if (newMedia?.sizes?.[imageDefaultSize] || newMedia?.media_details?.sizes?.[imageDefaultSize]) { 26523 mediaAttributes.sizeSlug = imageDefaultSize; 26524 mediaAttributes.url = newMedia?.sizes?.[imageDefaultSize]?.url || newMedia?.media_details?.sizes?.[imageDefaultSize]?.source_url; 26525 } else { 26526 mediaAttributes.sizeSlug = DEFAULT_MEDIA_SIZE_SLUG; 26527 } 26528 } 26529 registry.batch(() => { 26530 setAttributes({ 26531 ...mediaAttributes, 26532 focalPoint: void 0, 26533 useFeaturedImage: void 0, 26534 dimRatio: newDimRatio, 26535 isDark: newIsDark, 26536 isUserOverlayColor: currentAttrs.isUserOverlayColor || false 26537 }); 26538 scaffoldInnerBlocks(); 26539 }); 26540 }; 26541 const onClearMedia = () => { 26542 let newOverlayColor = overlayColor.color; 26543 if (!isUserOverlayColor && overlayColor.color) { 26544 newOverlayColor = DEFAULT_OVERLAY_COLOR; 26545 setOverlayColor(void 0); 26546 __unstableMarkNextChangeAsNotPersistent(); 26547 } 26548 const newIsDark = compositeIsDark( 26549 dimRatio, 26550 newOverlayColor, 26551 DEFAULT_BACKGROUND_COLOR 26552 ); 26553 setAttributes({ 26554 url: void 0, 26555 id: void 0, 26556 backgroundType: void 0, 26557 focalPoint: void 0, 26558 hasParallax: void 0, 26559 isRepeated: void 0, 26560 useFeaturedImage: void 0, 26561 isDark: newIsDark 26562 }); 26563 }; 26564 const onSetOverlayColor = async (newOverlayColor) => { 26565 const averageBackgroundColor = await getMediaColor(url); 26566 const { attributes: currentAttrs } = propsRef.current; 26567 const newIsDark = compositeIsDark( 26568 currentAttrs.dimRatio, 26569 newOverlayColor, 26570 averageBackgroundColor 26571 ); 26572 setOverlayColor(newOverlayColor); 26573 __unstableMarkNextChangeAsNotPersistent(); 26574 registry.batch(() => { 26575 setAttributes({ 26576 isUserOverlayColor: true, 26577 isDark: newIsDark 26578 }); 26579 if (newOverlayColor) { 26580 scaffoldInnerBlocks(); 26581 } 26582 }); 26583 }; 26584 const onUpdateDimRatio = async (newDimRatio) => { 26585 const averageBackgroundColor = await getMediaColor(url); 26586 const { overlayColor: currentOverlay } = propsRef.current; 26587 const newIsDark = compositeIsDark( 26588 newDimRatio, 26589 currentOverlay.color, 26590 averageBackgroundColor 26591 ); 26592 setAttributes({ 26593 dimRatio: newDimRatio, 26594 isDark: newIsDark 26595 }); 26596 }; 26597 const onUploadError = (message) => { 26598 createErrorNotice(message, { type: "snackbar" }); 26599 }; 26600 const onSelectEmbedUrl = (embedUrl) => { 26601 const newDimRatio = originalUrl === void 0 && dimRatio === 100 ? 50 : dimRatio; 26602 setAttributes({ 26603 url: embedUrl, 26604 backgroundType: EMBED_VIDEO_BACKGROUND_TYPE, 26605 dimRatio: newDimRatio, 26606 id: void 0, 26607 focalPoint: void 0, 26608 hasParallax: void 0, 26609 isRepeated: void 0, 26610 useFeaturedImage: void 0 26611 }); 26612 }; 26613 const { embedPreview, isFetchingEmbed } = (0, import_data29.useSelect)( 26614 (select10) => { 26615 if (backgroundType !== EMBED_VIDEO_BACKGROUND_TYPE || !url) { 26616 return { 26617 embedPreview: void 0, 26618 isFetchingEmbed: false 26619 }; 26620 } 26621 const { getEmbedPreview, isRequestingEmbedPreview } = select10(import_core_data16.store); 26622 return { 26623 embedPreview: getEmbedPreview(url), 26624 isFetchingEmbed: isRequestingEmbedPreview(url) 26625 }; 26626 }, 26627 [url, backgroundType] 26628 ); 26629 const embedHtml = (0, import_element50.useMemo)(() => { 26630 if (backgroundType !== EMBED_VIDEO_BACKGROUND_TYPE || !embedPreview?.html) { 26631 return null; 26632 } 26633 return getBackgroundEmbedHtml(embedPreview.html); 26634 }, [embedPreview, backgroundType]); 26635 const [isSwappingMedia, setIsSwappingMedia] = (0, import_element50.useState)(false); 26636 const isUploadingMedia = isTemporaryMedia(id, url); 26637 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 26638 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 26639 const isEmbedVideoBackground = EMBED_VIDEO_BACKGROUND_TYPE === backgroundType; 26640 const blockEditingMode = (0, import_block_editor68.useBlockEditingMode)(); 26641 const hasNonContentControls = blockEditingMode === "default"; 26642 const [resizeListener, { height, width }] = (0, import_compose20.useResizeObserver)(); 26643 const resizableBoxDimensions = (0, import_element50.useMemo)(() => { 26644 return { 26645 height: minHeightUnit === "px" && minHeight ? minHeight : "auto", 26646 width: "auto" 26647 }; 26648 }, [minHeight, minHeightUnit]); 26649 const minHeightWithUnit = minHeight && minHeightUnit ? `$minHeight}$minHeightUnit}` : minHeight; 26650 const isImgElement = !(hasParallax || isRepeated); 26651 const style2 = { 26652 minHeight: minHeightWithUnit || void 0 26653 }; 26654 const backgroundImage = url ? `url($url})` : void 0; 26655 const backgroundPosition = mediaPosition(focalPoint); 26656 const bgStyle = { backgroundColor: overlayColor.color }; 26657 const mediaStyle = { 26658 objectPosition: focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 26659 }; 26660 const hasBackground = !!(url || overlayColor.color || gradientValue); 26661 const hasInnerBlocks = (0, import_data29.useSelect)( 26662 (select10) => select10(import_block_editor68.store).getBlock(clientId).innerBlocks.length > 0, 26663 [clientId] 26664 ); 26665 const ref = (0, import_element50.useRef)(); 26666 const blockProps = (0, import_block_editor68.useBlockProps)({ ref }); 26667 const innerBlocksProps = (0, import_block_editor68.useInnerBlocksProps)( 26668 { 26669 className: "wp-block-cover__inner-container" 26670 }, 26671 { 26672 allowedBlocks, 26673 templateLock, 26674 dropZoneElement: ref.current 26675 } 26676 ); 26677 const mediaElement = (0, import_element50.useRef)(); 26678 const editMediaButtonRef = (0, import_element50.useRef)(); 26679 const currentSettings = { 26680 isVideoBackground, 26681 isImageBackground, 26682 mediaElement, 26683 hasInnerBlocks, 26684 url, 26685 isImgElement, 26686 overlayColor 26687 }; 26688 const openCoverMediaEditorModal = (0, import_element50.useCallback)(() => { 26689 if (!id || !openMediaEditorModal) { 26690 return; 26691 } 26692 openMediaEditorModal({ 26693 id, 26694 onClose: () => { 26695 editMediaButtonRef.current?.focus(); 26696 }, 26697 onUpdate: async ({ id: newId, url: newUrl }) => { 26698 if (typeof newId !== "number") { 26699 return; 26700 } 26701 if (newId !== id && newUrl) { 26702 setIsSwappingMedia(true); 26703 } 26704 const nextAttributes = { 26705 id: newId, 26706 backgroundType: IMAGE_BACKGROUND_TYPE, 26707 ...newUrl ? { url: newUrl } : {}, 26708 ...newId !== id ? { sizeSlug: DEFAULT_MEDIA_SIZE_SLUG } : {} 26709 }; 26710 if (newUrl) { 26711 const averageBackgroundColor = await getMediaColor(newUrl); 26712 const { 26713 attributes: currentAttrs, 26714 overlayColor: currentOverlay 26715 } = propsRef.current; 26716 let newOverlayColor = currentOverlay.color; 26717 if (!currentAttrs.isUserOverlayColor) { 26718 newOverlayColor = averageBackgroundColor; 26719 setOverlayColor(newOverlayColor); 26720 __unstableMarkNextChangeAsNotPersistent(); 26721 } 26722 nextAttributes.isDark = compositeIsDark( 26723 currentAttrs.dimRatio, 26724 newOverlayColor, 26725 averageBackgroundColor 26726 ); 26727 nextAttributes.isUserOverlayColor = currentAttrs.isUserOverlayColor || false; 26728 } 26729 setAttributes(nextAttributes); 26730 const { 26731 hasParallax: currentHasParallax, 26732 isRepeated: currentIsRepeated 26733 } = propsRef.current.attributes; 26734 if (currentHasParallax || currentIsRepeated) { 26735 setIsSwappingMedia(false); 26736 } 26737 } 26738 }); 26739 }, [ 26740 id, 26741 openMediaEditorModal, 26742 setAttributes, 26743 setOverlayColor, 26744 __unstableMarkNextChangeAsNotPersistent 26745 ]); 26746 const showEditMediaButton = hasNonContentControls && !useFeaturedImage && isImageBackground && !!id && !!url && !isUploadingMedia && !!openMediaEditorModal; 26747 const toggleUseFeaturedImage = async () => { 26748 const newUseFeaturedImage = !useFeaturedImage; 26749 const averageBackgroundColor = newUseFeaturedImage ? await getMediaColor(mediaUrl) : DEFAULT_BACKGROUND_COLOR; 26750 const { attributes: currentAttrs, overlayColor: currentOverlay } = propsRef.current; 26751 const newOverlayColor = !currentAttrs.isUserOverlayColor ? averageBackgroundColor : currentOverlay.color; 26752 if (!currentAttrs.isUserOverlayColor) { 26753 if (newUseFeaturedImage) { 26754 setOverlayColor(newOverlayColor); 26755 } else { 26756 setOverlayColor(void 0); 26757 } 26758 __unstableMarkNextChangeAsNotPersistent(); 26759 } 26760 const newDimRatio = currentAttrs.dimRatio === 100 ? 50 : currentAttrs.dimRatio; 26761 const newIsDark = compositeIsDark( 26762 newDimRatio, 26763 newOverlayColor, 26764 averageBackgroundColor 26765 ); 26766 registry.batch(() => { 26767 setAttributes({ 26768 id: void 0, 26769 url: void 0, 26770 useFeaturedImage: newUseFeaturedImage, 26771 dimRatio: newDimRatio, 26772 backgroundType: useFeaturedImage ? IMAGE_BACKGROUND_TYPE : void 0, 26773 isDark: newIsDark 26774 }); 26775 if (newUseFeaturedImage) { 26776 scaffoldInnerBlocks(); 26777 } 26778 }); 26779 }; 26780 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26781 CoverBlockControls, 26782 { 26783 attributes: attributes2, 26784 setAttributes, 26785 onSelectMedia, 26786 onSelectEmbedUrl, 26787 currentSettings, 26788 toggleUseFeaturedImage, 26789 onClearMedia, 26790 blockEditingMode, 26791 onEditMedia: openCoverMediaEditorModal, 26792 editMediaButtonRef, 26793 showEditMediaButton, 26794 isEditMediaDisabled: isSwappingMedia 26795 } 26796 ); 26797 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26798 CoverInspectorControls, 26799 { 26800 attributes: attributes2, 26801 setAttributes, 26802 clientId, 26803 setOverlayColor: onSetOverlayColor, 26804 coverRef: ref, 26805 currentSettings, 26806 toggleUseFeaturedImage, 26807 updateDimRatio: onUpdateDimRatio, 26808 onClearMedia, 26809 featuredImage: media 26810 } 26811 ); 26812 const resizableCoverProps = { 26813 className: "block-library-cover__resize-container", 26814 clientId, 26815 height, 26816 minHeight: minHeightWithUnit, 26817 onResizeStart: () => { 26818 setAttributes({ minHeightUnit: "px" }); 26819 toggleSelection(false); 26820 }, 26821 onResize: (value) => { 26822 setAttributes({ minHeight: value }); 26823 }, 26824 onResizeStop: (newMinHeight) => { 26825 toggleSelection(true); 26826 setAttributes({ minHeight: newMinHeight }); 26827 }, 26828 // Hide the resize handle if an aspect ratio is set, as the aspect ratio takes precedence. 26829 showHandle: !attributes2.style?.dimensions?.aspectRatio, 26830 size: resizableBoxDimensions, 26831 width 26832 }; 26833 if (!useFeaturedImage && !hasInnerBlocks && !hasBackground) { 26834 return /* @__PURE__ */ (0, import_jsx_runtime268.jsxs)(import_jsx_runtime268.Fragment, { children: [ 26835 blockControls, 26836 inspectorControls, 26837 hasNonContentControls && isSelected && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(ResizableCoverPopover, { ...resizableCoverProps }), 26838 /* @__PURE__ */ (0, import_jsx_runtime268.jsxs)( 26839 TagName2, 26840 { 26841 ...blockProps, 26842 className: clsx_default("is-placeholder", blockProps.className), 26843 style: { 26844 ...blockProps.style, 26845 minHeight: minHeightWithUnit || void 0 26846 }, 26847 children: [ 26848 resizeListener, 26849 /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26850 CoverPlaceholder, 26851 { 26852 onSelectMedia, 26853 onError: onUploadError, 26854 toggleUseFeaturedImage, 26855 children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("div", { className: "wp-block-cover__placeholder-background-options", children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26856 import_block_editor68.ColorPalette, 26857 { 26858 disableCustomColors: true, 26859 value: overlayColor.color, 26860 onChange: onSetOverlayColor, 26861 clearable: false, 26862 presentation: "toggle-buttons", 26863 "aria-label": (0, import_i18n56.__)("Overlay color") 26864 } 26865 ) }) 26866 } 26867 ) 26868 ] 26869 } 26870 ) 26871 ] }); 26872 } 26873 const classes = clsx_default( 26874 { 26875 "is-dark-theme": isDark2, 26876 "is-light": !isDark2, 26877 "is-transient": isUploadingMedia || isSwappingMedia, 26878 "has-parallax": hasParallax, 26879 "is-repeated": isRepeated, 26880 "has-custom-content-position": !isContentPositionCenter(contentPosition) 26881 }, 26882 getPositionClassName(contentPosition) 26883 ); 26884 const showOverlay = url || !useFeaturedImage || useFeaturedImage && !url; 26885 return /* @__PURE__ */ (0, import_jsx_runtime268.jsxs)(import_jsx_runtime268.Fragment, { children: [ 26886 blockControls, 26887 inspectorControls, 26888 /* @__PURE__ */ (0, import_jsx_runtime268.jsxs)( 26889 TagName2, 26890 { 26891 ...blockProps, 26892 className: clsx_default(classes, blockProps.className), 26893 style: { ...style2, ...blockProps.style }, 26894 "data-url": url, 26895 children: [ 26896 resizeListener, 26897 !url && useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26898 import_components33.Placeholder, 26899 { 26900 className: "wp-block-cover__image--placeholder-image", 26901 withIllustration: true 26902 } 26903 ), 26904 url && isImageBackground && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26905 "img", 26906 { 26907 ref: mediaElement, 26908 className: "wp-block-cover__image-background", 26909 alt, 26910 src: url, 26911 style: mediaStyle, 26912 onLoad: () => setIsSwappingMedia(false), 26913 onError: () => setIsSwappingMedia(false) 26914 } 26915 ) : /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26916 "div", 26917 { 26918 ref: mediaElement, 26919 role: alt ? "img" : void 0, 26920 "aria-label": alt ? alt : void 0, 26921 className: clsx_default( 26922 classes, 26923 "wp-block-cover__image-background" 26924 ), 26925 style: { backgroundImage, backgroundPosition } 26926 } 26927 )), 26928 url && isVideoBackground && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26929 "video", 26930 { 26931 ref: mediaElement, 26932 className: "wp-block-cover__video-background", 26933 autoPlay: true, 26934 muted: true, 26935 loop: true, 26936 src: url, 26937 poster, 26938 style: mediaStyle 26939 } 26940 ), 26941 isEmbedVideoBackground && embedHtml && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26942 "div", 26943 { 26944 ref: mediaElement, 26945 className: "wp-block-cover__video-background wp-block-cover__embed-background", 26946 style: mediaStyle, 26947 children: /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26948 import_components33.SandBox, 26949 { 26950 allowSameOrigin: true, 26951 html: embedHtml, 26952 title: "Background video", 26953 styles: [ 26954 "iframe{position:fixed;top:0;left:0;width:100%;height:100%;}" 26955 ] 26956 } 26957 ) 26958 } 26959 ), 26960 isEmbedVideoBackground && !embedHtml && isFetchingEmbed && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(import_components33.Spinner, {}), 26961 showOverlay && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26962 "span", 26963 { 26964 "aria-hidden": "true", 26965 className: clsx_default( 26966 "wp-block-cover__background", 26967 dimRatioToClass(dimRatio), 26968 { 26969 [overlayColor.class]: overlayColor.class, 26970 "has-background-dim": dimRatio !== void 0, 26971 // For backwards compatibility. Former versions of the Cover Block applied 26972 // `.wp-block-cover__gradient-background` in the presence of 26973 // media, a gradient and a dim. 26974 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 26975 "has-background-gradient": gradientValue, 26976 [gradientClass]: gradientClass 26977 } 26978 ), 26979 style: { backgroundImage: gradientValue, ...bgStyle } 26980 } 26981 ), 26982 (isUploadingMedia || isSwappingMedia) && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(import_components33.Spinner, {}), 26983 /* @__PURE__ */ (0, import_jsx_runtime268.jsx)( 26984 CoverPlaceholder, 26985 { 26986 disableMediaButtons: true, 26987 onSelectMedia, 26988 onError: onUploadError, 26989 toggleUseFeaturedImage 26990 } 26991 ), 26992 /* @__PURE__ */ (0, import_jsx_runtime268.jsx)("div", { ...innerBlocksProps }) 26993 ] 26994 } 26995 ), 26996 hasNonContentControls && isSelected && /* @__PURE__ */ (0, import_jsx_runtime268.jsx)(ResizableCoverPopover, { ...resizableCoverProps }) 26997 ] }); 26998 } 26999 var edit_default7 = (0, import_compose20.compose)([ 27000 (0, import_block_editor68.withColors)({ overlayColor: "background-color" }) 27001 ])(CoverEdit); 27002 27003 // packages/block-library/build-module/cover/block.json 27004 var block_default31 = { 27005 $schema: "https://schemas.wp.org/trunk/block.json", 27006 apiVersion: 3, 27007 name: "core/cover", 27008 title: "Cover", 27009 category: "media", 27010 description: "Add an image or video with a text overlay.", 27011 textdomain: "default", 27012 attributes: { 27013 url: { 27014 type: "string", 27015 role: "content" 27016 }, 27017 useFeaturedImage: { 27018 type: "boolean", 27019 default: false 27020 }, 27021 id: { 27022 type: "number" 27023 }, 27024 alt: { 27025 type: "string", 27026 default: "" 27027 }, 27028 hasParallax: { 27029 type: "boolean", 27030 default: false 27031 }, 27032 isRepeated: { 27033 type: "boolean", 27034 default: false 27035 }, 27036 dimRatio: { 27037 type: "number", 27038 default: 100 27039 }, 27040 overlayColor: { 27041 type: "string" 27042 }, 27043 customOverlayColor: { 27044 type: "string" 27045 }, 27046 isUserOverlayColor: { 27047 type: "boolean" 27048 }, 27049 backgroundType: { 27050 type: "string", 27051 default: "image" 27052 }, 27053 focalPoint: { 27054 type: "object" 27055 }, 27056 minHeight: { 27057 type: "number" 27058 }, 27059 minHeightUnit: { 27060 type: "string" 27061 }, 27062 gradient: { 27063 type: "string" 27064 }, 27065 customGradient: { 27066 type: "string" 27067 }, 27068 contentPosition: { 27069 type: "string" 27070 }, 27071 isDark: { 27072 type: "boolean", 27073 default: true 27074 }, 27075 templateLock: { 27076 type: ["string", "boolean"], 27077 enum: ["all", "insert", "contentOnly", false] 27078 }, 27079 tagName: { 27080 type: "string", 27081 default: "div" 27082 }, 27083 sizeSlug: { 27084 type: "string" 27085 }, 27086 poster: { 27087 type: "string", 27088 source: "attribute", 27089 selector: "video", 27090 attribute: "poster" 27091 }, 27092 allowedVideoProviders: { 27093 type: "array", 27094 default: [ 27095 "youtube", 27096 "vimeo", 27097 "videopress", 27098 "animoto", 27099 "tiktok", 27100 "wordpress-tv" 27101 ] 27102 } 27103 }, 27104 usesContext: ["postId", "postType"], 27105 supports: { 27106 __experimentalOnEnter: true, 27107 anchor: true, 27108 align: true, 27109 html: false, 27110 shadow: true, 27111 spacing: { 27112 padding: true, 27113 margin: ["top", "bottom"], 27114 blockGap: true, 27115 __experimentalDefaultControls: { 27116 padding: true, 27117 blockGap: true 27118 } 27119 }, 27120 __experimentalBorder: { 27121 color: true, 27122 radius: true, 27123 style: true, 27124 width: true, 27125 __experimentalDefaultControls: { 27126 color: true, 27127 radius: true, 27128 style: true, 27129 width: true 27130 } 27131 }, 27132 color: { 27133 heading: true, 27134 text: true, 27135 background: false, 27136 __experimentalSkipSerialization: ["gradients"], 27137 enableContrastChecker: false 27138 }, 27139 dimensions: { 27140 aspectRatio: true 27141 }, 27142 typography: { 27143 fontSize: true, 27144 lineHeight: true, 27145 __experimentalFontFamily: true, 27146 __experimentalFontWeight: true, 27147 __experimentalFontStyle: true, 27148 __experimentalTextTransform: true, 27149 __experimentalTextDecoration: true, 27150 __experimentalLetterSpacing: true, 27151 __experimentalDefaultControls: { 27152 fontSize: true 27153 } 27154 }, 27155 layout: { 27156 allowJustification: false 27157 }, 27158 interactivity: { 27159 clientNavigation: true 27160 }, 27161 filter: { 27162 duotone: true 27163 }, 27164 allowedBlocks: true 27165 }, 27166 selectors: { 27167 filter: { 27168 duotone: ".wp-block-cover > .wp-block-cover__image-background, .wp-block-cover > .wp-block-cover__video-background" 27169 } 27170 }, 27171 editorStyle: "wp-block-cover-editor", 27172 style: "wp-block-cover" 27173 }; 27174 27175 // packages/block-library/build-module/cover/save.mjs 27176 var import_block_editor69 = __toESM(require_block_editor(), 1); 27177 var import_jsx_runtime269 = __toESM(require_jsx_runtime(), 1); 27178 function save14({ attributes: attributes2 }) { 27179 const { 27180 backgroundType, 27181 gradient, 27182 contentPosition, 27183 customGradient, 27184 customOverlayColor, 27185 dimRatio, 27186 focalPoint, 27187 useFeaturedImage, 27188 hasParallax, 27189 isDark: isDark2, 27190 isRepeated, 27191 overlayColor, 27192 url, 27193 alt, 27194 id, 27195 minHeight: minHeightProp, 27196 minHeightUnit, 27197 tagName: Tag, 27198 sizeSlug, 27199 poster 27200 } = attributes2; 27201 const overlayColorClass = (0, import_block_editor69.getColorClassName)( 27202 "background-color", 27203 overlayColor 27204 ); 27205 const gradientClass = (0, import_block_editor69.__experimentalGetGradientClass)(gradient); 27206 const minHeight = minHeightProp && minHeightUnit ? `$minHeightProp}$minHeightUnit}` : minHeightProp; 27207 const isImageBackground = IMAGE_BACKGROUND_TYPE === backgroundType; 27208 const isVideoBackground = VIDEO_BACKGROUND_TYPE === backgroundType; 27209 const isEmbedVideoBackground = EMBED_VIDEO_BACKGROUND_TYPE === backgroundType; 27210 const isImgElement = !(hasParallax || isRepeated); 27211 const style2 = { 27212 minHeight: minHeight || void 0 27213 }; 27214 const bgStyle = { 27215 backgroundColor: !overlayColorClass ? customOverlayColor : void 0, 27216 background: customGradient ? customGradient : void 0 27217 }; 27218 const objectPosition = ( 27219 // prettier-ignore 27220 focalPoint && isImgElement ? mediaPosition(focalPoint) : void 0 27221 ); 27222 const backgroundImage = url ? `url($url})` : void 0; 27223 const backgroundPosition = mediaPosition(focalPoint); 27224 const classes = clsx_default( 27225 { 27226 "is-light": !isDark2, 27227 "has-parallax": hasParallax, 27228 "is-repeated": isRepeated, 27229 "has-custom-content-position": !isContentPositionCenter(contentPosition) 27230 }, 27231 getPositionClassName(contentPosition) 27232 ); 27233 const imgClasses = clsx_default( 27234 "wp-block-cover__image-background", 27235 id ? `wp-image-$id}` : null, 27236 { 27237 [`size-$sizeSlug}`]: sizeSlug, 27238 "has-parallax": hasParallax, 27239 "is-repeated": isRepeated 27240 } 27241 ); 27242 const gradientValue = gradient || customGradient; 27243 return /* @__PURE__ */ (0, import_jsx_runtime269.jsxs)(Tag, { ...import_block_editor69.useBlockProps.save({ className: classes, style: style2 }), children: [ 27244 !useFeaturedImage && isImageBackground && url && (isImgElement ? /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 27245 "img", 27246 { 27247 className: imgClasses, 27248 alt, 27249 src: url, 27250 style: { objectPosition }, 27251 "data-object-fit": "cover", 27252 "data-object-position": objectPosition 27253 } 27254 ) : /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 27255 "div", 27256 { 27257 role: alt ? "img" : void 0, 27258 "aria-label": alt ? alt : void 0, 27259 className: imgClasses, 27260 style: { backgroundPosition, backgroundImage } 27261 } 27262 )), 27263 isVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 27264 "video", 27265 { 27266 className: clsx_default( 27267 "wp-block-cover__video-background", 27268 "intrinsic-ignore" 27269 ), 27270 autoPlay: true, 27271 muted: true, 27272 loop: true, 27273 playsInline: true, 27274 src: url, 27275 poster, 27276 style: { objectPosition }, 27277 "data-object-fit": "cover", 27278 "data-object-position": objectPosition 27279 } 27280 ), 27281 isEmbedVideoBackground && url && /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 27282 "figure", 27283 { 27284 className: clsx_default( 27285 "wp-block-cover__video-background", 27286 "wp-block-cover__embed-background", 27287 "wp-block-embed" 27288 ), 27289 children: /* @__PURE__ */ (0, import_jsx_runtime269.jsx)("div", { className: "wp-block-embed__wrapper", children: url }) 27290 } 27291 ), 27292 /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 27293 "span", 27294 { 27295 "aria-hidden": "true", 27296 className: clsx_default( 27297 "wp-block-cover__background", 27298 overlayColorClass, 27299 dimRatioToClass(dimRatio), 27300 { 27301 "has-background-dim": dimRatio !== void 0, 27302 // For backwards compatibility. Former versions of the Cover Block applied 27303 // `.wp-block-cover__gradient-background` in the presence of 27304 // media, a gradient and a dim. 27305 "wp-block-cover__gradient-background": url && gradientValue && dimRatio !== 0, 27306 "has-background-gradient": gradientValue, 27307 [gradientClass]: gradientClass 27308 } 27309 ), 27310 style: bgStyle 27311 } 27312 ), 27313 /* @__PURE__ */ (0, import_jsx_runtime269.jsx)( 27314 "div", 27315 { 27316 ...import_block_editor69.useInnerBlocksProps.save({ 27317 className: "wp-block-cover__inner-container" 27318 }) 27319 } 27320 ) 27321 ] }); 27322 } 27323 27324 // packages/block-library/build-module/cover/transforms.mjs 27325 var import_blocks22 = __toESM(require_blocks(), 1); 27326 var import_block_editor70 = __toESM(require_block_editor(), 1); 27327 var { cleanEmptyObject: cleanEmptyObject5 } = unlock(import_block_editor70.privateApis); 27328 var transforms6 = { 27329 from: [ 27330 { 27331 type: "block", 27332 blocks: ["core/image"], 27333 transform: ({ caption, url, alt, align, id, anchor, style: style2 }) => (0, import_blocks22.createBlock)( 27334 "core/cover", 27335 { 27336 dimRatio: 50, 27337 url, 27338 alt, 27339 align, 27340 id, 27341 anchor, 27342 style: { 27343 color: { 27344 duotone: style2?.color?.duotone 27345 } 27346 } 27347 }, 27348 [ 27349 (0, import_blocks22.createBlock)("core/paragraph", { 27350 content: caption, 27351 fontSize: "large", 27352 style: { 27353 typography: { 27354 textAlign: "center" 27355 } 27356 } 27357 }) 27358 ] 27359 ) 27360 }, 27361 { 27362 type: "block", 27363 blocks: ["core/video"], 27364 transform: ({ caption, src, align, id, anchor }) => (0, import_blocks22.createBlock)( 27365 "core/cover", 27366 { 27367 dimRatio: 50, 27368 url: src, 27369 align, 27370 id, 27371 backgroundType: VIDEO_BACKGROUND_TYPE, 27372 anchor 27373 }, 27374 [ 27375 (0, import_blocks22.createBlock)("core/paragraph", { 27376 content: caption, 27377 fontSize: "large", 27378 style: { 27379 typography: { 27380 textAlign: "center" 27381 } 27382 } 27383 }) 27384 ] 27385 ) 27386 }, 27387 { 27388 type: "block", 27389 blocks: ["core/group"], 27390 transform: (attributes2, innerBlocks) => { 27391 const { align, anchor, backgroundColor, gradient, style: style2 } = attributes2; 27392 if (innerBlocks?.length === 1 && innerBlocks[0]?.name === "core/cover") { 27393 return (0, import_blocks22.createBlock)( 27394 "core/cover", 27395 innerBlocks[0].attributes, 27396 innerBlocks[0].innerBlocks 27397 ); 27398 } 27399 const dimRatio = backgroundColor || gradient || style2?.color?.background || style2?.color?.gradient ? void 0 : 50; 27400 const parentAttributes = { 27401 align, 27402 anchor, 27403 dimRatio, 27404 overlayColor: backgroundColor, 27405 customOverlayColor: style2?.color?.background, 27406 gradient, 27407 customGradient: style2?.color?.gradient 27408 }; 27409 const attributesWithoutBackgroundColors = { 27410 ...attributes2, 27411 backgroundColor: void 0, 27412 gradient: void 0, 27413 style: cleanEmptyObject5({ 27414 ...attributes2?.style, 27415 color: style2?.color ? { 27416 ...style2?.color, 27417 background: void 0, 27418 gradient: void 0 27419 } : void 0 27420 }) 27421 }; 27422 return (0, import_blocks22.createBlock)("core/cover", parentAttributes, [ 27423 (0, import_blocks22.createBlock)( 27424 "core/group", 27425 attributesWithoutBackgroundColors, 27426 innerBlocks 27427 ) 27428 ]); 27429 } 27430 } 27431 ], 27432 to: [ 27433 { 27434 type: "block", 27435 blocks: ["core/image"], 27436 isMatch: ({ 27437 backgroundType, 27438 url, 27439 overlayColor, 27440 customOverlayColor, 27441 gradient, 27442 customGradient 27443 }) => { 27444 if (url) { 27445 return backgroundType === IMAGE_BACKGROUND_TYPE; 27446 } 27447 return !overlayColor && !customOverlayColor && !gradient && !customGradient; 27448 }, 27449 transform: ({ title, url, alt, align, id, anchor, style: style2 }) => (0, import_blocks22.createBlock)("core/image", { 27450 caption: title, 27451 url, 27452 alt, 27453 align, 27454 id, 27455 anchor, 27456 style: { 27457 color: { 27458 duotone: style2?.color?.duotone 27459 } 27460 } 27461 }) 27462 }, 27463 { 27464 type: "block", 27465 blocks: ["core/video"], 27466 isMatch: ({ 27467 backgroundType, 27468 url, 27469 overlayColor, 27470 customOverlayColor, 27471 gradient, 27472 customGradient 27473 }) => { 27474 if (url) { 27475 return backgroundType === VIDEO_BACKGROUND_TYPE; 27476 } 27477 return !overlayColor && !customOverlayColor && !gradient && !customGradient; 27478 }, 27479 transform: ({ title, url, align, id, anchor }) => (0, import_blocks22.createBlock)("core/video", { 27480 caption: title, 27481 src: url, 27482 id, 27483 align, 27484 anchor 27485 }) 27486 }, 27487 { 27488 type: "block", 27489 blocks: ["core/group"], 27490 isMatch: ({ url, useFeaturedImage }) => { 27491 if (url || useFeaturedImage) { 27492 return false; 27493 } 27494 return true; 27495 }, 27496 transform: (attributes2, innerBlocks) => { 27497 const transformedColorAttributes = { 27498 backgroundColor: attributes2?.overlayColor, 27499 gradient: attributes2?.gradient, 27500 style: cleanEmptyObject5({ 27501 ...attributes2?.style, 27502 color: attributes2?.customOverlayColor || attributes2?.customGradient || attributes2?.style?.color ? { 27503 background: attributes2?.customOverlayColor, 27504 gradient: attributes2?.customGradient, 27505 ...attributes2?.style?.color 27506 } : void 0 27507 }) 27508 }; 27509 if (innerBlocks?.length === 1 && innerBlocks[0]?.name === "core/group") { 27510 const groupAttributes = cleanEmptyObject5( 27511 innerBlocks[0].attributes || {} 27512 ); 27513 if (groupAttributes?.backgroundColor || groupAttributes?.gradient || groupAttributes?.style?.color?.background || groupAttributes?.style?.color?.gradient) { 27514 return (0, import_blocks22.createBlock)( 27515 "core/group", 27516 groupAttributes, 27517 innerBlocks[0]?.innerBlocks 27518 ); 27519 } 27520 return (0, import_blocks22.createBlock)( 27521 "core/group", 27522 { 27523 ...transformedColorAttributes, 27524 ...groupAttributes, 27525 style: cleanEmptyObject5({ 27526 ...groupAttributes?.style, 27527 color: transformedColorAttributes?.style?.color || groupAttributes?.style?.color ? { 27528 ...transformedColorAttributes?.style?.color, 27529 ...groupAttributes?.style?.color 27530 } : void 0 27531 }) 27532 }, 27533 innerBlocks[0]?.innerBlocks 27534 ); 27535 } 27536 return (0, import_blocks22.createBlock)( 27537 "core/group", 27538 { ...attributes2, ...transformedColorAttributes }, 27539 innerBlocks 27540 ); 27541 } 27542 } 27543 ] 27544 }; 27545 var transforms_default6 = transforms6; 27546 27547 // packages/block-library/build-module/cover/variations.mjs 27548 var import_i18n57 = __toESM(require_i18n(), 1); 27549 var variations3 = [ 27550 { 27551 name: "cover", 27552 title: (0, import_i18n57.__)("Cover"), 27553 description: (0, import_i18n57.__)("Add an image or video with a text overlay."), 27554 attributes: { layout: { type: "constrained" } }, 27555 isDefault: true, 27556 icon: cover_default 27557 } 27558 ]; 27559 var variations_default3 = variations3; 27560 27561 // packages/block-library/build-module/cover/index.mjs 27562 var { fieldsKey: fieldsKey4, formKey: formKey4 } = unlock(import_blocks23.privateApis); 27563 var { name: name30 } = block_default31; 27564 var settings30 = { 27565 icon: cover_default, 27566 example: { 27567 attributes: { 27568 customOverlayColor: "#065174", 27569 dimRatio: 40, 27570 url: "https://s.w.org/images/core/5.3/Windbuchencom.jpg", 27571 style: { 27572 typography: { 27573 fontSize: 48 27574 }, 27575 color: { 27576 text: "white" 27577 } 27578 } 27579 }, 27580 innerBlocks: [ 27581 { 27582 name: "core/paragraph", 27583 attributes: { 27584 content: `<strong>${(0, import_i18n58.__)("Snow Patrol")}</strong>`, 27585 style: { 27586 typography: { 27587 textAlign: "center" 27588 } 27589 } 27590 } 27591 } 27592 ] 27593 }, 27594 transforms: transforms_default6, 27595 save: save14, 27596 edit: edit_default7, 27597 deprecated: deprecated_default14, 27598 variations: variations_default3 27599 }; 27600 if (window.__experimentalContentOnlyInspectorFields) { 27601 settings30[fieldsKey4] = [ 27602 { 27603 id: "background", 27604 label: (0, import_i18n58.__)("Background"), 27605 type: "media", 27606 Edit: { 27607 control: "media", 27608 // TODO: replace with custom component 27609 // TODO - How to support custom gradient? 27610 // Build it into Media, or use a custom control? 27611 allowedTypes: ["image", "video"], 27612 multiple: false, 27613 useFeaturedImage: true 27614 }, 27615 getValue: ({ item }) => ({ 27616 id: item.id, 27617 url: item.url, 27618 alt: item.alt, 27619 mediaType: item.backgroundType, 27620 featuredImage: item.useFeaturedImage 27621 }), 27622 setValue: ({ value }) => ({ 27623 id: value.id, 27624 url: value.url, 27625 alt: value.alt, 27626 mediaType: value.backgroundType, 27627 useFeaturedImage: value.featuredImage 27628 }) 27629 } 27630 ]; 27631 settings30[formKey4] = { 27632 fields: ["background"] 27633 }; 27634 } 27635 var init30 = () => initBlock({ name: name30, metadata: block_default31, settings: settings30 }); 27636 27637 // packages/block-library/build-module/details/index.mjs 27638 var details_exports = {}; 27639 __export(details_exports, { 27640 init: () => init31, 27641 metadata: () => block_default32, 27642 name: () => name31, 27643 settings: () => settings31 27644 }); 27645 var import_i18n60 = __toESM(require_i18n(), 1); 27646 var import_blocks25 = __toESM(require_blocks(), 1); 27647 27648 // packages/block-library/build-module/details/block.json 27649 var block_default32 = { 27650 $schema: "https://schemas.wp.org/trunk/block.json", 27651 apiVersion: 3, 27652 name: "core/details", 27653 title: "Details", 27654 category: "text", 27655 description: "Hide and show additional content.", 27656 keywords: ["summary", "toggle", "disclosure"], 27657 textdomain: "default", 27658 attributes: { 27659 showContent: { 27660 type: "boolean", 27661 default: false 27662 }, 27663 summary: { 27664 type: "rich-text", 27665 source: "rich-text", 27666 selector: "summary", 27667 role: "content" 27668 }, 27669 name: { 27670 type: "string", 27671 source: "attribute", 27672 attribute: "name", 27673 selector: ".wp-block-details" 27674 }, 27675 placeholder: { 27676 type: "string" 27677 } 27678 }, 27679 supports: { 27680 __experimentalOnEnter: true, 27681 align: ["wide", "full"], 27682 anchor: true, 27683 color: { 27684 gradients: true, 27685 link: true, 27686 __experimentalDefaultControls: { 27687 background: true, 27688 text: true 27689 } 27690 }, 27691 __experimentalBorder: { 27692 color: true, 27693 width: true, 27694 style: true 27695 }, 27696 html: false, 27697 spacing: { 27698 margin: true, 27699 padding: true, 27700 blockGap: true, 27701 __experimentalDefaultControls: { 27702 margin: false, 27703 padding: false 27704 } 27705 }, 27706 typography: { 27707 fontSize: true, 27708 lineHeight: true, 27709 __experimentalFontFamily: true, 27710 __experimentalFontWeight: true, 27711 __experimentalFontStyle: true, 27712 __experimentalTextTransform: true, 27713 __experimentalTextDecoration: true, 27714 __experimentalLetterSpacing: true, 27715 __experimentalDefaultControls: { 27716 fontSize: true 27717 } 27718 }, 27719 layout: { 27720 allowEditing: false 27721 }, 27722 interactivity: { 27723 clientNavigation: true 27724 }, 27725 allowedBlocks: true 27726 }, 27727 editorStyle: "wp-block-details-editor", 27728 style: "wp-block-details" 27729 }; 27730 27731 // packages/block-library/build-module/details/edit.mjs 27732 var import_block_editor71 = __toESM(require_block_editor(), 1); 27733 var import_components34 = __toESM(require_components(), 1); 27734 var import_i18n59 = __toESM(require_i18n(), 1); 27735 var import_element51 = __toESM(require_element(), 1); 27736 var import_data30 = __toESM(require_data(), 1); 27737 var import_keycodes2 = __toESM(require_keycodes(), 1); 27738 var import_jsx_runtime270 = __toESM(require_jsx_runtime(), 1); 27739 function DetailsEdit({ attributes: attributes2, setAttributes, clientId }) { 27740 const { name: name118, showContent, summary, allowedBlocks, placeholder: placeholder2 } = attributes2; 27741 const blockProps = (0, import_block_editor71.useBlockProps)(); 27742 const innerBlocksProps = (0, import_block_editor71.useInnerBlocksProps)(blockProps, { 27743 __experimentalCaptureToolbars: true, 27744 allowedBlocks 27745 }); 27746 const [isOpen, setIsOpen] = (0, import_element51.useState)(showContent); 27747 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 27748 const hasSelectedInnerBlock = (0, import_data30.useSelect)( 27749 (select10) => select10(import_block_editor71.store).hasSelectedInnerBlock(clientId, true), 27750 [clientId] 27751 ); 27752 const handleSummaryKeyDown = (event) => { 27753 if (event.key === "Enter" && !event.shiftKey) { 27754 setIsOpen((prevIsOpen) => !prevIsOpen); 27755 event.preventDefault(); 27756 } 27757 }; 27758 const handleSummaryKeyUp = (event) => { 27759 if (event.key === " ") { 27760 event.preventDefault(); 27761 } 27762 }; 27763 return /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)(import_jsx_runtime270.Fragment, { children: [ 27764 /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(import_block_editor71.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)( 27765 import_components34.__experimentalToolsPanel, 27766 { 27767 label: (0, import_i18n59.__)("Settings"), 27768 resetAll: () => { 27769 setAttributes({ 27770 showContent: false 27771 }); 27772 }, 27773 dropdownMenuProps, 27774 children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)( 27775 import_components34.__experimentalToolsPanelItem, 27776 { 27777 isShownByDefault: true, 27778 label: (0, import_i18n59.__)("Open by default"), 27779 hasValue: () => showContent, 27780 onDeselect: () => { 27781 setAttributes({ 27782 showContent: false 27783 }); 27784 }, 27785 children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)( 27786 import_components34.ToggleControl, 27787 { 27788 label: (0, import_i18n59.__)("Open by default"), 27789 checked: showContent, 27790 onChange: () => setAttributes({ 27791 showContent: !showContent 27792 }) 27793 } 27794 ) 27795 } 27796 ) 27797 } 27798 ) }), 27799 /* @__PURE__ */ (0, import_jsx_runtime270.jsx)(import_block_editor71.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)( 27800 import_components34.TextControl, 27801 { 27802 label: (0, import_i18n59.__)("Name attribute"), 27803 value: name118 || "", 27804 onChange: (newName) => setAttributes({ name: newName }), 27805 help: (0, import_i18n59.__)( 27806 "Enables multiple Details blocks with the same name attribute to be connected, with only one open at a time." 27807 ) 27808 } 27809 ) }), 27810 /* @__PURE__ */ (0, import_jsx_runtime270.jsxs)( 27811 "details", 27812 { 27813 ...innerBlocksProps, 27814 open: isOpen || hasSelectedInnerBlock, 27815 onToggle: (event) => setIsOpen(event.target.open), 27816 name: name118 || "", 27817 children: [ 27818 /* @__PURE__ */ (0, import_jsx_runtime270.jsx)( 27819 "summary", 27820 { 27821 onKeyDown: (0, import_keycodes2.withIgnoreIMEEvents)(handleSummaryKeyDown), 27822 onKeyUp: handleSummaryKeyUp, 27823 children: /* @__PURE__ */ (0, import_jsx_runtime270.jsx)( 27824 import_block_editor71.RichText, 27825 { 27826 identifier: "summary", 27827 "aria-label": (0, import_i18n59.__)( 27828 "Write summary. Press Enter to expand or collapse the details." 27829 ), 27830 placeholder: placeholder2 || (0, import_i18n59.__)("Write summary\u2026"), 27831 withoutInteractiveFormatting: true, 27832 value: summary, 27833 onChange: (newSummary) => setAttributes({ summary: newSummary }) 27834 } 27835 ) 27836 } 27837 ), 27838 innerBlocksProps.children 27839 ] 27840 } 27841 ) 27842 ] }); 27843 } 27844 var edit_default8 = DetailsEdit; 27845 27846 // packages/block-library/build-module/details/save.mjs 27847 var import_block_editor72 = __toESM(require_block_editor(), 1); 27848 var import_jsx_runtime271 = __toESM(require_jsx_runtime(), 1); 27849 function save15({ attributes: attributes2 }) { 27850 const { name: name118, showContent } = attributes2; 27851 const summary = attributes2.summary ? attributes2.summary : "Details"; 27852 const blockProps = import_block_editor72.useBlockProps.save(); 27853 return /* @__PURE__ */ (0, import_jsx_runtime271.jsxs)( 27854 "details", 27855 { 27856 ...blockProps, 27857 name: name118 || void 0, 27858 open: showContent, 27859 children: [ 27860 /* @__PURE__ */ (0, import_jsx_runtime271.jsx)("summary", { children: /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(import_block_editor72.RichText.Content, { value: summary }) }), 27861 /* @__PURE__ */ (0, import_jsx_runtime271.jsx)(import_block_editor72.InnerBlocks.Content, {}) 27862 ] 27863 } 27864 ); 27865 } 27866 27867 // packages/block-library/build-module/details/transforms.mjs 27868 var import_blocks24 = __toESM(require_blocks(), 1); 27869 var transforms_default7 = { 27870 from: [ 27871 { 27872 type: "block", 27873 isMultiBlock: true, 27874 blocks: ["*"], 27875 isMatch({}, blocks) { 27876 return !(blocks.length === 1 && blocks[0].name === "core/details"); 27877 }, 27878 __experimentalConvert(blocks) { 27879 return (0, import_blocks24.createBlock)( 27880 "core/details", 27881 {}, 27882 blocks.map((block) => (0, import_blocks24.cloneSanitizedBlock)(block)) 27883 ); 27884 } 27885 } 27886 ] 27887 }; 27888 27889 // packages/block-library/build-module/details/index.mjs 27890 var { fieldsKey: fieldsKey5, formKey: formKey5 } = unlock(import_blocks25.privateApis); 27891 var { name: name31 } = block_default32; 27892 var TEMPLATE8 = [ 27893 [ 27894 "core/paragraph", 27895 { 27896 placeholder: (0, import_i18n60.__)("Type / to add a hidden block") 27897 } 27898 ] 27899 ]; 27900 var settings31 = { 27901 icon: details_default, 27902 template: TEMPLATE8, 27903 example: { 27904 attributes: { 27905 summary: (0, import_i18n60.__)("La Mancha"), 27906 showContent: true 27907 }, 27908 innerBlocks: [ 27909 { 27910 name: "core/paragraph", 27911 attributes: { 27912 content: (0, import_i18n60.__)( 27913 "In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing." 27914 ) 27915 } 27916 } 27917 ] 27918 }, 27919 __experimentalLabel(attributes2, { context }) { 27920 const { summary } = attributes2; 27921 const customName = attributes2?.metadata?.name; 27922 const hasSummary = summary?.trim().length > 0; 27923 if (context === "list-view" && (customName || hasSummary)) { 27924 return customName || summary; 27925 } 27926 if (context === "breadcrumb" && customName) { 27927 return customName; 27928 } 27929 if (context === "accessibility") { 27930 return !hasSummary ? (0, import_i18n60.__)("Details. Empty.") : (0, import_i18n60.sprintf)( 27931 /* translators: %s: accessibility text; summary title. */ 27932 (0, import_i18n60.__)("Details. %s"), 27933 summary 27934 ); 27935 } 27936 }, 27937 save: save15, 27938 edit: edit_default8, 27939 transforms: transforms_default7 27940 }; 27941 if (window.__experimentalContentOnlyInspectorFields) { 27942 settings31[fieldsKey5] = [ 27943 { 27944 id: "summary", 27945 label: (0, import_i18n60.__)("Summary"), 27946 type: "text", 27947 Edit: "rich-text" 27948 // TODO: replace with custom component 27949 } 27950 ]; 27951 settings31[formKey5] = { 27952 fields: ["summary"] 27953 }; 27954 } 27955 var init31 = () => initBlock({ name: name31, metadata: block_default32, settings: settings31 }); 27956 27957 // packages/block-library/build-module/embed/index.mjs 27958 var embed_exports = {}; 27959 __export(embed_exports, { 27960 init: () => init32, 27961 metadata: () => block_default7, 27962 name: () => name32, 27963 settings: () => settings32 27964 }); 27965 27966 // packages/block-library/build-module/embed/edit.mjs 27967 var import_i18n64 = __toESM(require_i18n(), 1); 27968 var import_element54 = __toESM(require_element(), 1); 27969 var import_data31 = __toESM(require_data(), 1); 27970 var import_block_editor76 = __toESM(require_block_editor(), 1); 27971 var import_core_data17 = __toESM(require_core_data(), 1); 27972 27973 // packages/block-library/build-module/embed/embed-controls.mjs 27974 var import_i18n61 = __toESM(require_i18n(), 1); 27975 var import_components35 = __toESM(require_components(), 1); 27976 var import_block_editor73 = __toESM(require_block_editor(), 1); 27977 var import_jsx_runtime272 = __toESM(require_jsx_runtime(), 1); 27978 function getResponsiveHelp(checked) { 27979 return checked ? (0, import_i18n61.__)( 27980 "This embed will preserve its aspect ratio when the browser is resized." 27981 ) : (0, import_i18n61.__)( 27982 "This embed may not preserve its aspect ratio when the browser is resized." 27983 ); 27984 } 27985 var EmbedControls = ({ 27986 blockSupportsResponsive, 27987 showEditButton, 27988 themeSupportsResponsive, 27989 allowResponsive, 27990 toggleResponsive, 27991 switchBackToURLInput 27992 }) => { 27993 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 27994 return /* @__PURE__ */ (0, import_jsx_runtime272.jsxs)(import_jsx_runtime272.Fragment, { children: [ 27995 /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(import_block_editor73.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(import_components35.ToolbarGroup, { children: showEditButton && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( 27996 import_components35.ToolbarButton, 27997 { 27998 className: "components-toolbar__control", 27999 label: (0, import_i18n61.__)("Edit URL"), 28000 icon: pencil_default, 28001 onClick: switchBackToURLInput 28002 } 28003 ) }) }), 28004 themeSupportsResponsive && blockSupportsResponsive && /* @__PURE__ */ (0, import_jsx_runtime272.jsx)(import_block_editor73.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( 28005 import_components35.__experimentalToolsPanel, 28006 { 28007 label: (0, import_i18n61.__)("Media settings"), 28008 resetAll: () => { 28009 toggleResponsive(true); 28010 }, 28011 dropdownMenuProps, 28012 children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( 28013 import_components35.__experimentalToolsPanelItem, 28014 { 28015 label: (0, import_i18n61.__)("Media settings"), 28016 isShownByDefault: true, 28017 hasValue: () => !allowResponsive, 28018 onDeselect: () => { 28019 toggleResponsive(!allowResponsive); 28020 }, 28021 children: /* @__PURE__ */ (0, import_jsx_runtime272.jsx)( 28022 import_components35.ToggleControl, 28023 { 28024 label: (0, import_i18n61.__)("Resize for smaller devices"), 28025 checked: allowResponsive, 28026 help: getResponsiveHelp, 28027 onChange: toggleResponsive 28028 } 28029 ) 28030 } 28031 ) 28032 } 28033 ) }) 28034 ] }); 28035 }; 28036 var embed_controls_default = EmbedControls; 28037 28038 // packages/block-library/build-module/embed/icons.mjs 28039 var import_components36 = __toESM(require_components(), 1); 28040 var import_jsx_runtime273 = __toESM(require_jsx_runtime(), 1); 28041 var embedContentIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zm-6-9.5L16 12l-2.5 2.8 1.1 1L18 12l-3.5-3.5-1 1zm-3 0l-1-1L6 12l3.5 3.8 1.1-1L8 12l2.5-2.5z" }) }); 28042 var embedAudioIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM13.2 7.7c-.4.4-.7 1.1-.7 1.9v3.7c-.4-.3-.8-.4-1.3-.4-1.2 0-2.2 1-2.2 2.2 0 1.2 1 2.2 2.2 2.2.5 0 1-.2 1.4-.5.9-.6 1.4-1.6 1.4-2.6V9.6c0-.4.1-.6.2-.8.3-.3 1-.3 1.6-.3h.2V7h-.2c-.7 0-1.8 0-2.6.7z" }) }); 28043 var embedPhotoIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.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-2zM9.2 4.5H19c.3 0 .5.2.5.5v8.4l-3-2.9c-.3-.3-.8-.3-1 0L11.9 14 9 12c-.3-.2-.6-.2-.8 0l-3.6 2.6V9.8l4.6-5.3zm9.8 15H5c-.3 0-.5-.2-.5-.5v-2.4l4.1-3 3 1.9c.3.2.7.2.9-.1L16 12l3.5 3.4V19c0 .3-.2.5-.5.5z" }) }); 28044 var embedVideoIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm.5 16c0 .3-.2.5-.5.5H5c-.3 0-.5-.2-.5-.5V9.8l4.7-5.3H19c.3 0 .5.2.5.5v14zM10 15l5-3-5-3v6z" }) }); 28045 var embedTwitterIcon = { 28046 foreground: "#000000", 28047 src: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M13.982 10.622 20.54 3h-1.554l-5.693 6.618L8.745 3H3.5l6.876 10.007L3.5 21h1.554l6.012-6.989L15.868 21h5.245l-7.131-10.378Zm-2.128 2.474-.697-.997-5.543-7.93H8l4.474 6.4.697.996 5.815 8.318h-2.387l-4.745-6.787Z" }) }) 28048 }; 28049 var embedYouTubeIcon = { 28050 foreground: "#ff0000", 28051 src: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M21.8 8s-.195-1.377-.795-1.984c-.76-.797-1.613-.8-2.004-.847-2.798-.203-6.996-.203-6.996-.203h-.01s-4.197 0-6.996.202c-.39.046-1.242.05-2.003.846C2.395 6.623 2.2 8 2.2 8S2 9.62 2 11.24v1.517c0 1.618.2 3.237.2 3.237s.195 1.378.795 1.985c.76.797 1.76.77 2.205.855 1.6.153 6.8.2 6.8.2s4.203-.005 7-.208c.392-.047 1.244-.05 2.005-.847.6-.607.795-1.985.795-1.985s.2-1.618.2-3.237v-1.517C22 9.62 21.8 8 21.8 8zM9.935 14.595v-5.62l5.403 2.82-5.403 2.8z" }) }) 28052 }; 28053 var embedFacebookIcon = { 28054 foreground: "#3b5998", 28055 src: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M20 3H4c-.6 0-1 .4-1 1v16c0 .5.4 1 1 1h8.6v-7h-2.3v-2.7h2.3v-2c0-2.3 1.4-3.6 3.5-3.6 1 0 1.8.1 2.1.1v2.4h-1.4c-1.1 0-1.3.5-1.3 1.3v1.7h2.7l-.4 2.8h-2.3v7H20c.5 0 1-.4 1-1V4c0-.6-.4-1-1-1z" }) }) 28056 }; 28057 var embedInstagramIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.G, { children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M12 4.622c2.403 0 2.688.01 3.637.052.877.04 1.354.187 1.67.31.42.163.72.358 1.036.673.315.315.51.615.673 1.035.123.317.27.794.31 1.67.043.95.052 1.235.052 3.638s-.01 2.688-.052 3.637c-.04.877-.187 1.354-.31 1.67-.163.42-.358.72-.673 1.036-.315.315-.615.51-1.035.673-.317.123-.794.27-1.67.31-.95.043-1.234.052-3.638.052s-2.688-.01-3.637-.052c-.877-.04-1.354-.187-1.67-.31-.42-.163-.72-.358-1.036-.673-.315-.315-.51-.615-.673-1.035-.123-.317-.27-.794-.31-1.67-.043-.95-.052-1.235-.052-3.638s.01-2.688.052-3.637c.04-.877.187-1.354.31-1.67.163-.42.358-.72.673-1.036.315-.315.615-.51 1.035-.673.317-.123.794-.27 1.67-.31.95-.043 1.235-.052 3.638-.052M12 3c-2.444 0-2.75.01-3.71.054s-1.613.196-2.185.418c-.592.23-1.094.538-1.594 1.04-.5.5-.807 1-1.037 1.593-.223.572-.375 1.226-.42 2.184C3.01 9.25 3 9.555 3 12s.01 2.75.054 3.71.196 1.613.418 2.186c.23.592.538 1.094 1.038 1.594s1.002.808 1.594 1.038c.572.222 1.227.375 2.185.418.96.044 1.266.054 3.71.054s2.75-.01 3.71-.054 1.613-.196 2.186-.418c.592-.23 1.094-.538 1.594-1.038s.808-1.002 1.038-1.594c.222-.572.375-1.227.418-2.185.044-.96.054-1.266.054-3.71s-.01-2.75-.054-3.71-.196-1.613-.418-2.186c-.23-.592-.538-1.094-1.038-1.594s-1.002-.808-1.594-1.038c-.572-.222-1.227-.375-2.185-.418C14.75 3.01 14.445 3 12 3zm0 4.378c-2.552 0-4.622 2.07-4.622 4.622s2.07 4.622 4.622 4.622 4.622-2.07 4.622-4.622S14.552 7.378 12 7.378zM12 15c-1.657 0-3-1.343-3-3s1.343-3 3-3 3 1.343 3 3-1.343 3-3 3zm4.804-8.884c-.596 0-1.08.484-1.08 1.08s.484 1.08 1.08 1.08c.596 0 1.08-.484 1.08-1.08s-.483-1.08-1.08-1.08z" }) }) }); 28058 var embedWordPressIcon = { 28059 foreground: "#0073AA", 28060 src: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.G, { children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M12.158 12.786l-2.698 7.84c.806.236 1.657.365 2.54.365 1.047 0 2.05-.18 2.986-.51-.024-.037-.046-.078-.065-.123l-2.762-7.57zM3.008 12c0 3.56 2.07 6.634 5.068 8.092L3.788 8.342c-.5 1.117-.78 2.354-.78 3.658zm15.06-.454c0-1.112-.398-1.88-.74-2.48-.456-.74-.883-1.368-.883-2.11 0-.825.627-1.595 1.51-1.595.04 0 .078.006.116.008-1.598-1.464-3.73-2.36-6.07-2.36-3.14 0-5.904 1.613-7.512 4.053.21.008.41.012.58.012.94 0 2.395-.114 2.395-.114.484-.028.54.684.057.74 0 0-.487.058-1.03.086l3.275 9.74 1.968-5.902-1.4-3.838c-.485-.028-.944-.085-.944-.085-.486-.03-.43-.77.056-.742 0 0 1.484.114 2.368.114.94 0 2.397-.114 2.397-.114.486-.028.543.684.058.74 0 0-.488.058-1.03.086l3.25 9.665.897-2.997c.456-1.17.684-2.137.684-2.907zm1.82-3.86c.04.286.06.593.06.924 0 .912-.17 1.938-.683 3.22l-2.746 7.94c2.672-1.558 4.47-4.454 4.47-7.77 0-1.564-.4-3.033-1.1-4.314zM12 22C6.486 22 2 17.514 2 12S6.486 2 12 2s10 4.486 10 10-4.486 10-10 10z" }) }) }) 28061 }; 28062 var embedSpotifyIcon = { 28063 foreground: "#1db954", 28064 src: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2m4.586 14.424c-.18.295-.563.387-.857.207-2.35-1.434-5.305-1.76-8.786-.963-.335.077-.67-.133-.746-.47-.077-.334.132-.67.47-.745 3.808-.87 7.076-.496 9.712 1.115.293.18.386.563.206.857M17.81 13.7c-.226.367-.706.482-1.072.257-2.687-1.652-6.785-2.13-9.965-1.166-.413.127-.848-.106-.973-.517-.125-.413.108-.848.52-.973 3.632-1.102 8.147-.568 11.234 1.328.366.226.48.707.256 1.072m.105-2.835C14.692 8.95 9.375 8.775 6.297 9.71c-.493.15-1.016-.13-1.166-.624-.148-.495.13-1.017.625-1.167 3.532-1.073 9.404-.866 13.115 1.337.445.264.59.838.327 1.282-.264.443-.838.59-1.282.325" }) }) 28065 }; 28066 var embedFlickrIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "m6.5 7c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5zm11 0c-2.75 0-5 2.25-5 5s2.25 5 5 5 5-2.25 5-5-2.25-5-5-5z" }) }); 28067 var embedVimeoIcon = { 28068 foreground: "#1ab7ea", 28069 src: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.G, { children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M22.396 7.164c-.093 2.026-1.507 4.8-4.245 8.32C15.323 19.16 12.93 21 10.97 21c-1.214 0-2.24-1.12-3.08-3.36-.56-2.052-1.118-4.105-1.68-6.158-.622-2.24-1.29-3.36-2.004-3.36-.156 0-.7.328-1.634.98l-.978-1.26c1.027-.903 2.04-1.806 3.037-2.71C6 3.95 7.03 3.328 7.716 3.265c1.62-.156 2.616.95 2.99 3.32.404 2.558.685 4.148.84 4.77.468 2.12.982 3.18 1.543 3.18.435 0 1.09-.687 1.963-2.064.872-1.376 1.34-2.422 1.402-3.142.125-1.187-.343-1.782-1.4-1.782-.5 0-1.013.115-1.542.34 1.023-3.35 2.977-4.976 5.862-4.883 2.14.063 3.148 1.45 3.024 4.16z" }) }) }) 28070 }; 28071 var embedRedditIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M22 12.068a2.184 2.184 0 0 0-2.186-2.186c-.592 0-1.13.233-1.524.609-1.505-1.075-3.566-1.774-5.86-1.864l1.004-4.695 3.261.699A1.56 1.56 0 1 0 18.255 3c-.61-.001-1.147.357-1.398.877l-3.638-.77a.382.382 0 0 0-.287.053.348.348 0 0 0-.161.251l-1.112 5.233c-2.33.072-4.426.77-5.95 1.864a2.201 2.201 0 0 0-1.523-.61 2.184 2.184 0 0 0-.896 4.176c-.036.215-.053.43-.053.663 0 3.37 3.924 6.111 8.763 6.111s8.763-2.724 8.763-6.11c0-.216-.017-.449-.053-.664A2.207 2.207 0 0 0 22 12.068Zm-15.018 1.56a1.56 1.56 0 0 1 3.118 0c0 .86-.699 1.558-1.559 1.558-.86.018-1.559-.699-1.559-1.559Zm8.728 4.139c-1.076 1.075-3.119 1.147-3.71 1.147-.61 0-2.652-.09-3.71-1.147a.4.4 0 0 1 0-.573.4.4 0 0 1 .574 0c.68.68 2.114.914 3.136.914 1.022 0 2.473-.233 3.136-.914a.4.4 0 0 1 .574 0 .436.436 0 0 1 0 .573Zm-.287-2.563a1.56 1.56 0 0 1 0-3.118c.86 0 1.56.699 1.56 1.56 0 .841-.7 1.558-1.56 1.558Z" }) }); 28072 var embedTumblrIcon = { 28073 foreground: "#35465c", 28074 src: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M19 3H5a2 2 0 00-2 2v14c0 1.1.9 2 2 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-5.69 14.66c-2.72 0-3.1-1.9-3.1-3.16v-3.56H8.49V8.99c1.7-.62 2.54-1.99 2.64-2.87 0-.06.06-.41.06-.58h1.9v3.1h2.17v2.3h-2.18v3.1c0 .47.13 1.3 1.2 1.26h1.1v2.36c-1.01.02-2.07 0-2.07 0z" }) }) 28075 }; 28076 var embedAmazonIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(import_components36.SVG, { viewBox: "0 0 24 24", children: [ 28077 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M18.42 14.58c-.51-.66-1.05-1.23-1.05-2.5V7.87c0-1.8.15-3.45-1.2-4.68-1.05-1.02-2.79-1.35-4.14-1.35-2.6 0-5.52.96-6.12 4.14-.06.36.18.54.4.57l2.66.3c.24-.03.42-.27.48-.5.24-1.12 1.17-1.63 2.2-1.63.56 0 1.22.21 1.55.7.4.56.33 1.31.33 1.97v.36c-1.59.18-3.66.27-5.16.93a4.63 4.63 0 0 0-2.93 4.44c0 2.82 1.8 4.23 4.1 4.23 1.95 0 3.03-.45 4.53-1.98.51.72.66 1.08 1.59 1.83.18.09.45.09.63-.1v.04l2.1-1.8c.24-.21.2-.48.03-.75zm-5.4-1.2c-.45.75-1.14 1.23-1.92 1.23-1.05 0-1.65-.81-1.65-1.98 0-2.31 2.1-2.73 4.08-2.73v.6c0 1.05.03 1.92-.5 2.88z" }), 28078 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M21.69 19.2a17.62 17.62 0 0 1-21.6-1.57c-.23-.2 0-.5.28-.33a23.88 23.88 0 0 0 20.93 1.3c.45-.19.84.3.39.6z" }), 28079 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M22.8 17.96c-.36-.45-2.22-.2-3.1-.12-.23.03-.3-.18-.05-.36 1.5-1.05 3.96-.75 4.26-.39.3.36-.1 2.82-1.5 4.02-.21.18-.42.1-.3-.15.3-.8 1.02-2.58.69-3z" }) 28080 ] }); 28081 var embedAnimotoIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)(import_components36.SVG, { viewBox: "0 0 24 24", children: [ 28082 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28083 import_components36.Path, 28084 { 28085 d: "m.0206909 21 19.8160091-13.07806 3.5831 6.20826z", 28086 fill: "#4bc7ee" 28087 } 28088 ), 28089 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28090 import_components36.Path, 28091 { 28092 d: "m23.7254 19.0205-10.1074-17.18468c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418h22.5655c1.279 0 1.8019-.8905 1.1599-1.9795z", 28093 fill: "#d4cdcb" 28094 } 28095 ), 28096 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28097 import_components36.Path, 28098 { 28099 d: "m.0206909 21 15.2439091-16.38571 4.3029 7.32271z", 28100 fill: "#c3d82e" 28101 } 28102 ), 28103 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28104 import_components36.Path, 28105 { 28106 d: "m13.618 1.83582c-.6421-1.114428-1.7087-1.114428-2.3249 0l-11.2931 19.16418 15.2646-16.38573z", 28107 fill: "#e4ecb0" 28108 } 28109 ), 28110 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "m.0206909 21 19.5468091-9.063 1.6621 2.8344z", fill: "#209dbd" }), 28111 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28112 import_components36.Path, 28113 { 28114 d: "m.0206909 21 17.9209091-11.82623 1.6259 2.76323z", 28115 fill: "#7cb3c9" 28116 } 28117 ) 28118 ] }); 28119 var embedDailymotionIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28120 import_components36.Path, 28121 { 28122 d: "M11.903 16.568c-1.82 0-3.124-1.281-3.124-2.967a2.987 2.987 0 0 1 2.989-2.989c1.663 0 2.944 1.304 2.944 3.034 0 1.663-1.281 2.922-2.81 2.922ZM17.997 3l-3.308.73v5.107c-.809-1.034-2.045-1.37-3.505-1.37-1.529 0-2.9.561-4.023 1.662-1.259 1.214-1.933 2.764-1.933 4.495 0 1.888.72 3.506 2.113 4.742 1.056.944 2.314 1.415 3.775 1.415 1.438 0 2.517-.382 3.573-1.415v1.415h3.308V3Z", 28123 fill: "#333436" 28124 } 28125 ) }); 28126 var embedPinterestIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { width: "24", height: "24", viewBox: "0 0 24 24", version: "1.1", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M12.289,2C6.617,2,3.606,5.648,3.606,9.622c0,1.846,1.025,4.146,2.666,4.878c0.25,0.111,0.381,0.063,0.439-0.169 c0.044-0.175,0.267-1.029,0.365-1.428c0.032-0.128,0.017-0.237-0.091-0.362C6.445,11.911,6.01,10.75,6.01,9.668 c0-2.777,2.194-5.464,5.933-5.464c3.23,0,5.49,2.108,5.49,5.122c0,3.407-1.794,5.768-4.13,5.768c-1.291,0-2.257-1.021-1.948-2.277 c0.372-1.495,1.089-3.112,1.089-4.191c0-0.967-0.542-1.775-1.663-1.775c-1.319,0-2.379,1.309-2.379,3.059 c0,1.115,0.394,1.869,0.394,1.869s-1.302,5.279-1.54,6.261c-0.405,1.666,0.053,4.368,0.094,4.604 c0.021,0.126,0.167,0.169,0.25,0.063c0.129-0.165,1.699-2.419,2.142-4.051c0.158-0.59,0.817-2.995,0.817-2.995 c0.43,0.784,1.681,1.446,3.013,1.446c3.963,0,6.822-3.494,6.822-7.833C20.394,5.112,16.849,2,12.289,2" }) }); 28127 var embedWolframIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 44 44", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.Path, { d: "M32.59521,22.001l4.31885-4.84473-6.34131-1.38379.646-6.459-5.94336,2.61035L22,6.31934l-3.27344,5.60351L12.78418,9.3125l.645,6.458L7.08643,17.15234,11.40479,21.999,7.08594,26.84375l6.34131,1.38379-.64551,6.458,5.94287-2.60938L22,37.68066l3.27344-5.60351,5.94287,2.61035-.64551-6.458,6.34277-1.38183Zm.44385,2.75244L30.772,23.97827l-1.59558-2.07391,1.97888.735Zm-8.82147,6.1579L22.75,33.424V30.88977l1.52228-2.22168ZM18.56226,13.48816,19.819,15.09534l-2.49219-.88642L15.94037,12.337Zm6.87719.00116,2.62043-1.15027-1.38654,1.86981L24.183,15.0946Zm3.59357,2.6029-1.22546,1.7381.07525-2.73486,1.44507-1.94867ZM22,29.33008l-2.16406-3.15686L22,23.23688l2.16406,2.93634Zm-4.25458-9.582-.10528-3.836,3.60986,1.284v3.73242Zm5.00458-2.552,3.60986-1.284-.10528,3.836L22.75,20.92853Zm-7.78174-1.10559-.29352-2.94263,1.44245,1.94739.07519,2.73321Zm2.30982,5.08319,3.50817,1.18164-2.16247,2.9342-3.678-1.08447Zm2.4486,7.49285L21.25,30.88977v2.53485L19.78052,30.91Zm3.48707-6.31121,3.50817-1.18164,2.33228,3.03137-3.678,1.08447Zm10.87219-4.28113-2.714,3.04529L28.16418,19.928l1.92176-2.72565ZM24.06036,12.81769l-2.06012,2.6322-2.059-2.63318L22,9.292ZM9.91455,18.07227l4.00079-.87195,1.921,2.72735-3.20794,1.19019Zm2.93024,4.565,1.9801-.73462L13.228,23.97827l-2.26838.77429Zm-1.55591,3.58819L13.701,25.4021l2.64935.78058-2.14447.67853Zm3.64868,1.977L18.19,27.17334l.08313,3.46332L14.52979,32.2793Zm10.7876,2.43549.08447-3.464,3.25165,1.03052.407,4.07684Zm4.06824-3.77478-2.14545-.68,2.65063-.781,2.41266.825Z" }) }); 28128 var embedPocketCastsIcon = { 28129 foreground: "#f43e37", 28130 src: /* @__PURE__ */ (0, import_jsx_runtime273.jsxs)( 28131 import_components36.SVG, 28132 { 28133 width: "24", 28134 height: "24", 28135 viewBox: "0 0 24 24", 28136 fill: "none", 28137 xmlns: "http://www.w3.org/2000/svg", 28138 children: [ 28139 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28140 import_components36.Path, 28141 { 28142 fillRule: "evenodd", 28143 clipRule: "evenodd", 28144 d: "M24,12A12,12,0,1,1,12,0,12,12,0,0,1,24,12Z" 28145 } 28146 ), 28147 /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28148 import_components36.Path, 28149 { 28150 fillRule: "evenodd", 28151 clipRule: "evenodd", 28152 d: "M2.67,12a9.33,9.33,0,0,1,18.66,0H19a7,7,0,1,0-7,7v2.33A9.33,9.33,0,0,1,2.67,12ZM12,17.6A5.6,5.6,0,1,1,17.6,12h-2A3.56,3.56,0,1,0,12,15.56Z", 28153 fill: "#fff" 28154 } 28155 ) 28156 ] 28157 } 28158 ) 28159 }; 28160 var embedBlueskyIcon = /* @__PURE__ */ (0, import_jsx_runtime273.jsx)(import_components36.SVG, { viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime273.jsx)( 28161 import_components36.Path, 28162 { 28163 fill: "#0a7aff", 28164 d: "M6.3,4.2c2.3,1.7,4.8,5.3,5.7,7.2.9-1.9,3.4-5.4,5.7-7.2,1.7-1.3,4.3-2.2,4.3.9s-.4,5.2-.6,5.9c-.7,2.6-3.3,3.2-5.6,2.8,4,.7,5.1,3,2.9,5.3-5,5.2-6.7-2.8-6.7-2.8,0,0-1.7,8-6.7,2.8-2.2-2.3-1.2-4.6,2.9-5.3-2.3.4-4.9-.3-5.6-2.8-.2-.7-.6-5.3-.6-5.9,0-3.1,2.7-2.1,4.3-.9h0Z" 28165 } 28166 ) }); 28167 28168 // packages/block-library/build-module/embed/embed-loading.mjs 28169 var import_components37 = __toESM(require_components(), 1); 28170 var import_jsx_runtime274 = __toESM(require_jsx_runtime(), 1); 28171 var EmbedLoading = () => /* @__PURE__ */ (0, import_jsx_runtime274.jsx)("div", { className: "wp-block-embed is-loading", children: /* @__PURE__ */ (0, import_jsx_runtime274.jsx)(import_components37.Spinner, {}) }); 28172 var embed_loading_default = EmbedLoading; 28173 28174 // packages/block-library/build-module/embed/embed-placeholder.mjs 28175 var import_i18n62 = __toESM(require_i18n(), 1); 28176 var import_components38 = __toESM(require_components(), 1); 28177 var import_block_editor74 = __toESM(require_block_editor(), 1); 28178 var import_jsx_runtime275 = __toESM(require_jsx_runtime(), 1); 28179 function EmbedPlaceholder({ 28180 icon: icon2, 28181 label, 28182 value, 28183 onSubmit, 28184 onChange, 28185 cannotEmbed, 28186 fallback: fallback2, 28187 tryAgain 28188 }) { 28189 return /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)( 28190 import_components38.Placeholder, 28191 { 28192 icon: /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(import_block_editor74.BlockIcon, { icon: icon2, showColors: true }), 28193 label, 28194 className: "wp-block-embed", 28195 instructions: (0, import_i18n62.__)( 28196 "Paste a link to the content you want to display on your site." 28197 ), 28198 children: [ 28199 /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)("form", { onSubmit, children: [ 28200 /* @__PURE__ */ (0, import_jsx_runtime275.jsx)( 28201 import_components38.__experimentalInputControl, 28202 { 28203 type: "url", 28204 value: value || "", 28205 className: "wp-block-embed__placeholder-input", 28206 label, 28207 hideLabelFromVision: true, 28208 placeholder: (0, import_i18n62.__)("Enter URL to embed here\u2026"), 28209 onChange 28210 } 28211 ), 28212 /* @__PURE__ */ (0, import_jsx_runtime275.jsx)(import_components38.Button, { __next40pxDefaultSize: true, variant: "primary", type: "submit", children: (0, import_i18n62._x)("Embed", "button label") }) 28213 ] }), 28214 /* @__PURE__ */ (0, import_jsx_runtime275.jsx)("div", { className: "wp-block-embed__learn-more", children: /* @__PURE__ */ (0, import_jsx_runtime275.jsx)( 28215 Link, 28216 { 28217 openInNewTab: true, 28218 href: (0, import_i18n62.__)( 28219 "https://wordpress.org/documentation/article/embeds/" 28220 ), 28221 children: (0, import_i18n62.__)("Learn more about embeds") 28222 } 28223 ) }), 28224 cannotEmbed && /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)( 28225 Stack, 28226 { 28227 direction: "column", 28228 gap: "md", 28229 className: "components-placeholder__error", 28230 children: [ 28231 /* @__PURE__ */ (0, import_jsx_runtime275.jsx)("div", { className: "components-placeholder__instructions", children: (0, import_i18n62.__)("Sorry, this content could not be embedded.") }), 28232 /* @__PURE__ */ (0, import_jsx_runtime275.jsxs)(Stack, { direction: "row", gap: "md", justify: "flex-start", children: [ 28233 /* @__PURE__ */ (0, import_jsx_runtime275.jsx)( 28234 import_components38.Button, 28235 { 28236 __next40pxDefaultSize: true, 28237 variant: "secondary", 28238 onClick: tryAgain, 28239 children: (0, import_i18n62._x)("Try again", "button label") 28240 } 28241 ), 28242 fallback2 && /* @__PURE__ */ (0, import_jsx_runtime275.jsx)( 28243 import_components38.Button, 28244 { 28245 __next40pxDefaultSize: true, 28246 variant: "secondary", 28247 onClick: fallback2, 28248 children: (0, import_i18n62._x)("Convert to link", "button label") 28249 } 28250 ) 28251 ] }) 28252 ] 28253 } 28254 ) 28255 ] 28256 } 28257 ); 28258 } 28259 28260 // packages/block-library/build-module/embed/embed-preview.mjs 28261 var import_i18n63 = __toESM(require_i18n(), 1); 28262 var import_components39 = __toESM(require_components(), 1); 28263 var import_block_editor75 = __toESM(require_block_editor(), 1); 28264 var import_element53 = __toESM(require_element(), 1); 28265 var import_url6 = __toESM(require_url(), 1); 28266 28267 // packages/block-library/build-module/embed/wp-embed-preview.mjs 28268 var import_compose21 = __toESM(require_compose(), 1); 28269 var import_element52 = __toESM(require_element(), 1); 28270 var import_jsx_runtime276 = __toESM(require_jsx_runtime(), 1); 28271 var attributeMap = { 28272 class: "className", 28273 frameborder: "frameBorder", 28274 marginheight: "marginHeight", 28275 marginwidth: "marginWidth" 28276 }; 28277 function WpEmbedPreview({ html }) { 28278 const ref = (0, import_element52.useRef)(); 28279 const props = (0, import_element52.useMemo)(() => { 28280 const doc = new window.DOMParser().parseFromString(html, "text/html"); 28281 const iframe = doc.querySelector("iframe"); 28282 const iframeProps = {}; 28283 if (!iframe) { 28284 return iframeProps; 28285 } 28286 Array.from(iframe.attributes).forEach(({ name: name118, value }) => { 28287 if (name118 === "style") { 28288 return; 28289 } 28290 iframeProps[attributeMap[name118] || name118] = value; 28291 }); 28292 return iframeProps; 28293 }, [html]); 28294 (0, import_element52.useEffect)(() => { 28295 const { ownerDocument: ownerDocument2 } = ref.current; 28296 const { defaultView } = ownerDocument2; 28297 function resizeWPembeds({ data: { secret, message, value } = {} }) { 28298 if (message !== "height" || secret !== props["data-secret"]) { 28299 return; 28300 } 28301 ref.current.height = value; 28302 } 28303 defaultView.addEventListener("message", resizeWPembeds); 28304 return () => { 28305 defaultView.removeEventListener("message", resizeWPembeds); 28306 }; 28307 }, []); 28308 return /* @__PURE__ */ (0, import_jsx_runtime276.jsx)("div", { className: "wp-block-embed__wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime276.jsx)( 28309 "iframe", 28310 { 28311 ref: (0, import_compose21.useMergeRefs)([ref, (0, import_compose21.useFocusableIframe)()]), 28312 title: props.title, 28313 ...props 28314 } 28315 ) }); 28316 } 28317 28318 // packages/block-library/build-module/embed/embed-preview.mjs 28319 var import_jsx_runtime277 = __toESM(require_jsx_runtime(), 1); 28320 function EmbedPreview({ 28321 preview, 28322 previewable, 28323 url, 28324 type, 28325 isSelected, 28326 className, 28327 icon: icon2, 28328 label 28329 }) { 28330 const [interactive, setInteractive] = (0, import_element53.useState)(false); 28331 if (!isSelected && interactive) { 28332 setInteractive(false); 28333 } 28334 const hideOverlay = () => { 28335 setInteractive(true); 28336 }; 28337 const { scripts } = preview; 28338 const html = "photo" === type ? getPhotoHtml(preview) : preview.html; 28339 const embedSourceUrl = (0, import_url6.getAuthority)(url); 28340 const iframeTitle = (0, import_i18n63.sprintf)( 28341 // translators: %s: host providing embed content e.g: www.youtube.com 28342 (0, import_i18n63.__)("Embedded content from %s"), 28343 embedSourceUrl 28344 ); 28345 const sandboxClassnames = clsx_default( 28346 type, 28347 className, 28348 "wp-block-embed__wrapper" 28349 ); 28350 const embedWrapper = "wp-embed" === type ? /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(WpEmbedPreview, { html }) : /* @__PURE__ */ (0, import_jsx_runtime277.jsxs)("div", { className: "wp-block-embed__wrapper", children: [ 28351 /* @__PURE__ */ (0, import_jsx_runtime277.jsx)( 28352 import_components39.SandBox, 28353 { 28354 allowSameOrigin: true, 28355 html, 28356 scripts, 28357 title: iframeTitle, 28358 type: sandboxClassnames, 28359 onFocus: hideOverlay 28360 } 28361 ), 28362 !interactive && /* @__PURE__ */ (0, import_jsx_runtime277.jsx)( 28363 "div", 28364 { 28365 className: "block-library-embed__interactive-overlay", 28366 onMouseUp: hideOverlay 28367 } 28368 ) 28369 ] }); 28370 return /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(import_jsx_runtime277.Fragment, { children: previewable ? embedWrapper : /* @__PURE__ */ (0, import_jsx_runtime277.jsxs)( 28371 import_components39.Placeholder, 28372 { 28373 icon: /* @__PURE__ */ (0, import_jsx_runtime277.jsx)(import_block_editor75.BlockIcon, { icon: icon2, showColors: true }), 28374 label, 28375 children: [ 28376 /* @__PURE__ */ (0, import_jsx_runtime277.jsx)("p", { className: "components-placeholder__error", children: /* @__PURE__ */ (0, import_jsx_runtime277.jsx)("a", { href: url, children: url }) }), 28377 /* @__PURE__ */ (0, import_jsx_runtime277.jsx)("p", { className: "components-placeholder__error", children: (0, import_i18n63.sprintf)( 28378 /* translators: %s: host providing embed content e.g: www.youtube.com */ 28379 (0, import_i18n63.__)( 28380 "Embedded content from %s can't be previewed in the editor." 28381 ), 28382 embedSourceUrl 28383 ) }) 28384 ] 28385 } 28386 ) }); 28387 } 28388 28389 // packages/block-library/build-module/embed/edit.mjs 28390 var import_jsx_runtime278 = __toESM(require_jsx_runtime(), 1); 28391 var EmbedEdit = (props) => { 28392 const { 28393 attributes: { 28394 providerNameSlug, 28395 previewable, 28396 responsive, 28397 url: attributesUrl 28398 }, 28399 attributes: attributes2, 28400 isSelected, 28401 onReplace, 28402 setAttributes, 28403 insertBlocksAfter, 28404 onFocus 28405 } = props; 28406 const defaultEmbedInfo = { 28407 title: (0, import_i18n64._x)("Embed", "block title"), 28408 icon: embedContentIcon 28409 }; 28410 const { icon: icon2, title } = getEmbedInfoByProvider(providerNameSlug) || defaultEmbedInfo; 28411 const [url, setURL] = (0, import_element54.useState)(attributesUrl); 28412 const [isEditingURL, setIsEditingURL] = (0, import_element54.useState)(false); 28413 const { invalidateResolution } = (0, import_data31.useDispatch)(import_core_data17.store); 28414 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data31.useDispatch)(import_block_editor76.store); 28415 const { 28416 preview, 28417 fetching, 28418 themeSupportsResponsive, 28419 cannotEmbed, 28420 hasResolved 28421 } = (0, import_data31.useSelect)( 28422 (select10) => { 28423 const { 28424 getEmbedPreview, 28425 isPreviewEmbedFallback, 28426 isRequestingEmbedPreview, 28427 getThemeSupports, 28428 hasFinishedResolution 28429 } = select10(import_core_data17.store); 28430 if (!attributesUrl) { 28431 return { fetching: false, cannotEmbed: false }; 28432 } 28433 const embedPreview = getEmbedPreview(attributesUrl); 28434 const previewIsFallback = isPreviewEmbedFallback(attributesUrl); 28435 const badEmbedProvider = embedPreview?.html === false && embedPreview?.type === void 0; 28436 const wordpressCantEmbed = embedPreview?.data?.status === 404; 28437 const validPreview = !!embedPreview && !badEmbedProvider && !wordpressCantEmbed; 28438 return { 28439 preview: validPreview ? embedPreview : void 0, 28440 fetching: isRequestingEmbedPreview(attributesUrl), 28441 themeSupportsResponsive: getThemeSupports()["responsive-embeds"], 28442 cannotEmbed: !validPreview || previewIsFallback, 28443 hasResolved: hasFinishedResolution("getEmbedPreview", [ 28444 attributesUrl 28445 ]) 28446 }; 28447 }, 28448 [attributesUrl] 28449 ); 28450 const getMergedAttributes = () => getMergedAttributesWithPreview( 28451 attributes2, 28452 preview, 28453 title, 28454 responsive 28455 ); 28456 function toggleResponsive(newAllowResponsive) { 28457 const { className: className2 } = attributes2; 28458 const { html } = preview; 28459 setAttributes({ 28460 allowResponsive: newAllowResponsive, 28461 className: getClassNames( 28462 html, 28463 className2, 28464 responsive && newAllowResponsive 28465 ) 28466 }); 28467 } 28468 (0, import_element54.useEffect)(() => { 28469 if (!cannotEmbed || !hasResolved || !attributesUrl) { 28470 return; 28471 } 28472 const newURL = attributesUrl.replace(/\/$/, ""); 28473 if (newURL === attributesUrl) { 28474 return; 28475 } 28476 setURL(newURL); 28477 setIsEditingURL(false); 28478 __unstableMarkNextChangeAsNotPersistent(); 28479 setAttributes({ url: newURL }); 28480 }, [ 28481 attributesUrl, 28482 cannotEmbed, 28483 hasResolved, 28484 setAttributes, 28485 __unstableMarkNextChangeAsNotPersistent 28486 ]); 28487 (0, import_element54.useEffect)(() => { 28488 if (!preview || isEditingURL) { 28489 return; 28490 } 28491 const mergedAttributes = getMergedAttributes(); 28492 if (onReplace) { 28493 const upgradedBlock = createUpgradedEmbedBlock( 28494 props, 28495 mergedAttributes 28496 ); 28497 if (upgradedBlock) { 28498 __unstableMarkNextChangeAsNotPersistent(); 28499 setAttributes(upgradedBlock.attributes); 28500 return; 28501 } 28502 } 28503 const hasChanges = Object.keys(mergedAttributes).some( 28504 (key) => mergedAttributes[key] !== attributes2[key] 28505 ); 28506 if (hasChanges) { 28507 __unstableMarkNextChangeAsNotPersistent(); 28508 setAttributes(mergedAttributes); 28509 } 28510 }, [preview, isEditingURL]); 28511 const blockProps = (0, import_block_editor76.useBlockProps)(); 28512 if (fetching) { 28513 return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)(embed_loading_default, {}) }); 28514 } 28515 const label = (0, import_i18n64.sprintf)((0, import_i18n64.__)("%s URL"), title); 28516 const showEmbedPlaceholder = !preview || cannotEmbed || isEditingURL; 28517 if (showEmbedPlaceholder) { 28518 return /* @__PURE__ */ (0, import_jsx_runtime278.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 28519 EmbedPlaceholder, 28520 { 28521 icon: icon2, 28522 label, 28523 onFocus, 28524 onSubmit: (event) => { 28525 if (event) { 28526 event.preventDefault(); 28527 } 28528 const rewrittenURL = rewriteXToTwitter(url); 28529 const blockClass = removeAspectRatioClasses( 28530 attributes2.className 28531 ); 28532 setURL(rewrittenURL); 28533 setAttributes({ 28534 url: rewrittenURL, 28535 ...findMoreSuitableBlock(rewrittenURL)?.attributes, 28536 className: blockClass 28537 }); 28538 setIsEditingURL(false); 28539 }, 28540 value: url, 28541 cannotEmbed, 28542 onChange: (value) => setURL(value), 28543 fallback: onReplace ? () => fallback(url, onReplace) : void 0, 28544 tryAgain: () => { 28545 invalidateResolution("getEmbedPreview", [url]); 28546 } 28547 } 28548 ) }); 28549 } 28550 const { 28551 caption, 28552 type, 28553 allowResponsive, 28554 className: classFromPreview 28555 } = getMergedAttributes(); 28556 const className = clsx_default(classFromPreview, props.className); 28557 return /* @__PURE__ */ (0, import_jsx_runtime278.jsxs)(import_jsx_runtime278.Fragment, { children: [ 28558 /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 28559 embed_controls_default, 28560 { 28561 showEditButton: preview && !cannotEmbed, 28562 themeSupportsResponsive, 28563 blockSupportsResponsive: responsive, 28564 allowResponsive, 28565 toggleResponsive, 28566 switchBackToURLInput: () => setIsEditingURL(true) 28567 } 28568 ), 28569 /* @__PURE__ */ (0, import_jsx_runtime278.jsxs)( 28570 "figure", 28571 { 28572 ...blockProps, 28573 className: clsx_default(blockProps.className, className, { 28574 [`is-type-$type}`]: type, 28575 [`is-provider-$providerNameSlug}`]: providerNameSlug, 28576 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 28577 }), 28578 children: [ 28579 /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 28580 EmbedPreview, 28581 { 28582 preview, 28583 previewable, 28584 className, 28585 url, 28586 type, 28587 caption, 28588 onCaptionChange: (value) => setAttributes({ caption: value }), 28589 isSelected, 28590 icon: icon2, 28591 label, 28592 insertBlocksAfter, 28593 attributes: attributes2, 28594 setAttributes 28595 } 28596 ), 28597 /* @__PURE__ */ (0, import_jsx_runtime278.jsx)( 28598 Caption, 28599 { 28600 attributes: attributes2, 28601 setAttributes, 28602 isSelected, 28603 insertBlocksAfter, 28604 label: (0, import_i18n64.__)("Embed caption text"), 28605 showToolbarButton: isSelected 28606 } 28607 ) 28608 ] 28609 } 28610 ) 28611 ] }); 28612 }; 28613 var edit_default9 = EmbedEdit; 28614 28615 // packages/block-library/build-module/embed/save.mjs 28616 var import_block_editor77 = __toESM(require_block_editor(), 1); 28617 var import_jsx_runtime279 = __toESM(require_jsx_runtime(), 1); 28618 function save16({ attributes: attributes2 }) { 28619 const { url, caption, type, providerNameSlug } = attributes2; 28620 if (!url) { 28621 return null; 28622 } 28623 const className = clsx_default("wp-block-embed", { 28624 [`is-type-$type}`]: type, 28625 [`is-provider-$providerNameSlug}`]: providerNameSlug, 28626 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 28627 }); 28628 return /* @__PURE__ */ (0, import_jsx_runtime279.jsxs)("figure", { ...import_block_editor77.useBlockProps.save({ className }), children: [ 28629 /* @__PURE__ */ (0, import_jsx_runtime279.jsx)("div", { className: "wp-block-embed__wrapper", children: ` 28630 $url} 28631 ` }), 28632 !import_block_editor77.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime279.jsx)( 28633 import_block_editor77.RichText.Content, 28634 { 28635 className: (0, import_block_editor77.__experimentalGetElementClassName)("caption"), 28636 tagName: "figcaption", 28637 value: caption 28638 } 28639 ) 28640 ] }); 28641 } 28642 28643 // packages/block-library/build-module/embed/transforms.mjs 28644 var import_blocks26 = __toESM(require_blocks(), 1); 28645 var import_url7 = __toESM(require_url(), 1); 28646 var { name: EMBED_BLOCK } = block_default7; 28647 var transforms7 = { 28648 from: [ 28649 { 28650 type: "raw", 28651 isMatch: (node) => { 28652 if (node.nodeName !== "P") { 28653 return false; 28654 } 28655 const trimmed = node.textContent.trim(); 28656 if (!(0, import_url7.isURL)(trimmed) || !/^https:\/\//i.test(trimmed) || trimmed.match(/https:\/\//gi)?.length !== 1) { 28657 return false; 28658 } 28659 return !/\.(?!(html?|php)$)[a-z0-9]+$/i.test( 28660 (0, import_url7.getFilename)(trimmed) || "" 28661 ); 28662 }, 28663 transform: (node) => { 28664 const url = rewriteXToTwitter(node.textContent.trim()); 28665 return (0, import_blocks26.createBlock)(EMBED_BLOCK, { 28666 url, 28667 ...findMoreSuitableBlock(url)?.attributes 28668 }); 28669 } 28670 }, 28671 { 28672 type: "shortcode", 28673 tag: "embed", 28674 transform: (_attrs, { shortcode }) => { 28675 const url = rewriteXToTwitter(shortcode.content?.trim()); 28676 return (0, import_blocks26.createBlock)(EMBED_BLOCK, { 28677 url, 28678 ...findMoreSuitableBlock(url)?.attributes 28679 }); 28680 } 28681 } 28682 ], 28683 to: [ 28684 { 28685 type: "block", 28686 blocks: ["core/paragraph"], 28687 isMatch: ({ url }) => !!url, 28688 transform: ({ url, caption, className }) => { 28689 let value = `<a href="$url}">$url}</a>`; 28690 if (caption?.trim()) { 28691 value += `<br />$caption}`; 28692 } 28693 return (0, import_blocks26.createBlock)("core/paragraph", { 28694 content: value, 28695 className: removeAspectRatioClasses(className) 28696 }); 28697 } 28698 } 28699 ] 28700 }; 28701 var transforms_default8 = transforms7; 28702 28703 // packages/block-library/build-module/embed/variations.mjs 28704 var import_i18n65 = __toESM(require_i18n(), 1); 28705 function getTitle(providerName) { 28706 return (0, import_i18n65.sprintf)( 28707 /* translators: %s: provider name */ 28708 (0, import_i18n65.__)("%s Embed"), 28709 providerName 28710 ); 28711 } 28712 var variations4 = [ 28713 { 28714 name: "twitter", 28715 title: getTitle("X"), 28716 icon: embedTwitterIcon, 28717 keywords: ["x", "twitter", "tweet", (0, import_i18n65.__)("social")], 28718 description: (0, import_i18n65.__)("Embed an X post."), 28719 patterns: [/^https?:\/\/(www\.)?twitter\.com\/.+/i], 28720 attributes: { providerNameSlug: "twitter", responsive: true } 28721 }, 28722 { 28723 name: "youtube", 28724 title: getTitle("YouTube"), 28725 icon: embedYouTubeIcon, 28726 keywords: [(0, import_i18n65.__)("music"), (0, import_i18n65.__)("video")], 28727 description: (0, import_i18n65.__)("Embed a YouTube video."), 28728 patterns: [ 28729 /^https?:\/\/((m|www)\.)?youtube\.com\/.+/i, 28730 /^https?:\/\/youtu\.be\/.+/i 28731 ], 28732 attributes: { providerNameSlug: "youtube", responsive: true } 28733 }, 28734 { 28735 // Deprecate Facebook Embed per FB policy 28736 // See: https://developers.facebook.com/docs/plugins/oembed-legacy 28737 name: "facebook", 28738 title: getTitle("Facebook"), 28739 icon: embedFacebookIcon, 28740 keywords: [(0, import_i18n65.__)("social")], 28741 description: (0, import_i18n65.__)("Embed a Facebook post."), 28742 scope: ["block"], 28743 patterns: [], 28744 attributes: { 28745 providerNameSlug: "facebook", 28746 previewable: false, 28747 responsive: true 28748 } 28749 }, 28750 { 28751 // Deprecate Instagram per FB policy 28752 // See: https://developers.facebook.com/docs/instagram/oembed-legacy 28753 name: "instagram", 28754 title: getTitle("Instagram"), 28755 icon: embedInstagramIcon, 28756 keywords: [(0, import_i18n65.__)("image"), (0, import_i18n65.__)("social")], 28757 description: (0, import_i18n65.__)("Embed an Instagram post."), 28758 scope: ["block"], 28759 patterns: [], 28760 attributes: { providerNameSlug: "instagram", responsive: true } 28761 }, 28762 { 28763 name: "wordpress", 28764 title: getTitle("WordPress"), 28765 icon: embedWordPressIcon, 28766 keywords: [(0, import_i18n65.__)("post"), (0, import_i18n65.__)("blog")], 28767 description: (0, import_i18n65.__)("Embed a WordPress post."), 28768 attributes: { 28769 providerNameSlug: "wordpress" 28770 } 28771 }, 28772 { 28773 name: "soundcloud", 28774 title: getTitle("SoundCloud"), 28775 icon: embedAudioIcon, 28776 keywords: [(0, import_i18n65.__)("music"), (0, import_i18n65.__)("audio")], 28777 description: (0, import_i18n65.__)("Embed SoundCloud content."), 28778 patterns: [/^https?:\/\/(www\.)?soundcloud\.com\/.+/i], 28779 attributes: { providerNameSlug: "soundcloud", responsive: true } 28780 }, 28781 { 28782 name: "spotify", 28783 title: getTitle("Spotify"), 28784 icon: embedSpotifyIcon, 28785 keywords: [(0, import_i18n65.__)("music"), (0, import_i18n65.__)("audio")], 28786 description: (0, import_i18n65.__)("Embed Spotify content."), 28787 patterns: [/^https?:\/\/(open|play)\.spotify\.com\/.+/i], 28788 attributes: { providerNameSlug: "spotify", responsive: true } 28789 }, 28790 { 28791 name: "flickr", 28792 title: getTitle("Flickr"), 28793 icon: embedFlickrIcon, 28794 keywords: [(0, import_i18n65.__)("image")], 28795 description: (0, import_i18n65.__)("Embed Flickr content."), 28796 patterns: [ 28797 /^https?:\/\/(www\.)?flickr\.com\/.+/i, 28798 /^https?:\/\/flic\.kr\/.+/i 28799 ], 28800 attributes: { providerNameSlug: "flickr", responsive: true } 28801 }, 28802 { 28803 name: "vimeo", 28804 title: getTitle("Vimeo"), 28805 icon: embedVimeoIcon, 28806 keywords: [(0, import_i18n65.__)("video")], 28807 description: (0, import_i18n65.__)("Embed a Vimeo video."), 28808 patterns: [/^https?:\/\/(www\.)?vimeo\.com\/.+/i], 28809 attributes: { providerNameSlug: "vimeo", responsive: true } 28810 }, 28811 { 28812 name: "animoto", 28813 title: getTitle("Animoto"), 28814 icon: embedAnimotoIcon, 28815 description: (0, import_i18n65.__)("Embed an Animoto video."), 28816 patterns: [/^https?:\/\/(www\.)?(animoto|video214)\.com\/.+/i], 28817 attributes: { providerNameSlug: "animoto", responsive: true } 28818 }, 28819 { 28820 name: "cloudup", 28821 title: getTitle("Cloudup"), 28822 icon: embedContentIcon, 28823 description: (0, import_i18n65.__)("Embed Cloudup content."), 28824 patterns: [/^https?:\/\/cloudup\.com\/.+/i], 28825 attributes: { providerNameSlug: "cloudup", responsive: true } 28826 }, 28827 { 28828 // Deprecated since CollegeHumor content is now powered by YouTube. 28829 name: "collegehumor", 28830 title: getTitle("CollegeHumor"), 28831 icon: embedVideoIcon, 28832 description: (0, import_i18n65.__)("Embed CollegeHumor content."), 28833 scope: ["block"], 28834 patterns: [], 28835 attributes: { providerNameSlug: "collegehumor", responsive: true } 28836 }, 28837 { 28838 name: "crowdsignal", 28839 title: getTitle("Crowdsignal"), 28840 icon: embedContentIcon, 28841 keywords: ["polldaddy", (0, import_i18n65.__)("survey")], 28842 description: (0, import_i18n65.__)("Embed Crowdsignal (formerly Polldaddy) content."), 28843 patterns: [ 28844 /^https?:\/\/((.+\.)?polldaddy\.com|poll\.fm|.+\.crowdsignal\.net|.+\.survey\.fm)\/.+/i 28845 ], 28846 attributes: { providerNameSlug: "crowdsignal", responsive: true } 28847 }, 28848 { 28849 name: "dailymotion", 28850 title: getTitle("Dailymotion"), 28851 icon: embedDailymotionIcon, 28852 keywords: [(0, import_i18n65.__)("video")], 28853 description: (0, import_i18n65.__)("Embed a Dailymotion video."), 28854 patterns: [/^https?:\/\/(www\.)?dailymotion\.com\/.+/i], 28855 attributes: { providerNameSlug: "dailymotion", responsive: true } 28856 }, 28857 { 28858 name: "imgur", 28859 title: getTitle("Imgur"), 28860 icon: embedPhotoIcon, 28861 description: (0, import_i18n65.__)("Embed Imgur content."), 28862 patterns: [/^https?:\/\/(.+\.)?imgur\.com\/.+/i], 28863 attributes: { providerNameSlug: "imgur", responsive: true } 28864 }, 28865 { 28866 name: "issuu", 28867 title: getTitle("Issuu"), 28868 icon: embedContentIcon, 28869 description: (0, import_i18n65.__)("Embed Issuu content."), 28870 patterns: [/^https?:\/\/(www\.)?issuu\.com\/.+/i], 28871 attributes: { providerNameSlug: "issuu", responsive: true } 28872 }, 28873 { 28874 name: "kickstarter", 28875 title: getTitle("Kickstarter"), 28876 icon: embedContentIcon, 28877 description: (0, import_i18n65.__)("Embed Kickstarter content."), 28878 patterns: [ 28879 /^https?:\/\/(www\.)?kickstarter\.com\/.+/i, 28880 /^https?:\/\/kck\.st\/.+/i 28881 ], 28882 attributes: { providerNameSlug: "kickstarter", responsive: true } 28883 }, 28884 { 28885 name: "mixcloud", 28886 title: getTitle("Mixcloud"), 28887 icon: embedAudioIcon, 28888 keywords: [(0, import_i18n65.__)("music"), (0, import_i18n65.__)("audio")], 28889 description: (0, import_i18n65.__)("Embed Mixcloud content."), 28890 patterns: [/^https?:\/\/(www\.)?mixcloud\.com\/.+/i], 28891 attributes: { providerNameSlug: "mixcloud", responsive: true } 28892 }, 28893 { 28894 name: "pocket-casts", 28895 title: getTitle("Pocket Casts"), 28896 icon: embedPocketCastsIcon, 28897 keywords: [(0, import_i18n65.__)("podcast"), (0, import_i18n65.__)("audio")], 28898 description: (0, import_i18n65.__)("Embed a podcast player from Pocket Casts."), 28899 patterns: [/^https:\/\/pca.st\/\w+/i], 28900 attributes: { providerNameSlug: "pocket-casts", responsive: true } 28901 }, 28902 { 28903 name: "reddit", 28904 title: getTitle("Reddit"), 28905 icon: embedRedditIcon, 28906 description: (0, import_i18n65.__)("Embed a Reddit thread."), 28907 patterns: [/^https?:\/\/(www\.)?reddit\.com\/.+/i], 28908 attributes: { providerNameSlug: "reddit", responsive: true } 28909 }, 28910 { 28911 name: "reverbnation", 28912 title: getTitle("ReverbNation"), 28913 icon: embedAudioIcon, 28914 description: (0, import_i18n65.__)("Embed ReverbNation content."), 28915 patterns: [/^https?:\/\/(www\.)?reverbnation\.com\/.+/i], 28916 attributes: { providerNameSlug: "reverbnation", responsive: true } 28917 }, 28918 { 28919 name: "scribd", 28920 title: getTitle("Scribd"), 28921 icon: embedContentIcon, 28922 description: (0, import_i18n65.__)("Embed Scribd content."), 28923 patterns: [/^https?:\/\/(www\.)?scribd\.com\/.+/i], 28924 attributes: { providerNameSlug: "scribd", responsive: true } 28925 }, 28926 { 28927 name: "smugmug", 28928 title: getTitle("SmugMug"), 28929 icon: embedPhotoIcon, 28930 description: (0, import_i18n65.__)("Embed SmugMug content."), 28931 patterns: [/^https?:\/\/(.+\.)?smugmug\.com\/.*/i], 28932 attributes: { 28933 providerNameSlug: "smugmug", 28934 previewable: false, 28935 responsive: true 28936 } 28937 }, 28938 { 28939 name: "speaker-deck", 28940 title: getTitle("Speaker Deck"), 28941 icon: embedContentIcon, 28942 description: (0, import_i18n65.__)("Embed Speaker Deck content."), 28943 patterns: [/^https?:\/\/(www\.)?speakerdeck\.com\/.+/i], 28944 attributes: { providerNameSlug: "speaker-deck", responsive: true } 28945 }, 28946 { 28947 name: "tiktok", 28948 title: getTitle("TikTok"), 28949 icon: embedVideoIcon, 28950 keywords: [(0, import_i18n65.__)("video")], 28951 description: (0, import_i18n65.__)("Embed a TikTok video."), 28952 patterns: [/^https?:\/\/(www\.)?tiktok\.com\/.+/i], 28953 attributes: { providerNameSlug: "tiktok", responsive: true } 28954 }, 28955 { 28956 name: "ted", 28957 title: getTitle("TED"), 28958 icon: embedVideoIcon, 28959 description: (0, import_i18n65.__)("Embed a TED video."), 28960 patterns: [/^https?:\/\/(www\.|embed\.)?ted\.com\/.+/i], 28961 attributes: { providerNameSlug: "ted", responsive: true } 28962 }, 28963 { 28964 name: "tumblr", 28965 title: getTitle("Tumblr"), 28966 icon: embedTumblrIcon, 28967 keywords: [(0, import_i18n65.__)("social")], 28968 description: (0, import_i18n65.__)("Embed a Tumblr post."), 28969 patterns: [/^https?:\/\/(.+)\.tumblr\.com\/.+/i], 28970 attributes: { providerNameSlug: "tumblr", responsive: true } 28971 }, 28972 { 28973 name: "videopress", 28974 title: getTitle("VideoPress"), 28975 icon: embedVideoIcon, 28976 keywords: [(0, import_i18n65.__)("video")], 28977 description: (0, import_i18n65.__)("Embed a VideoPress video."), 28978 patterns: [/^https?:\/\/videopress\.com\/.+/i], 28979 attributes: { providerNameSlug: "videopress", responsive: true } 28980 }, 28981 { 28982 name: "wordpress-tv", 28983 title: getTitle("WordPress.tv"), 28984 icon: embedVideoIcon, 28985 description: (0, import_i18n65.__)("Embed a WordPress.tv video."), 28986 patterns: [/^https?:\/\/wordpress\.tv\/.+/i], 28987 attributes: { providerNameSlug: "wordpress-tv", responsive: true } 28988 }, 28989 { 28990 name: "amazon-kindle", 28991 title: getTitle("Amazon Kindle"), 28992 icon: embedAmazonIcon, 28993 keywords: [(0, import_i18n65.__)("ebook")], 28994 description: (0, import_i18n65.__)("Embed Amazon Kindle content."), 28995 patterns: [ 28996 /^https?:\/\/([a-z0-9-]+\.)?(amazon|amzn)(\.[a-z]{2,4})+\/.+/i, 28997 /^https?:\/\/(www\.)?(a\.co|z\.cn)\/.+/i 28998 ], 28999 attributes: { providerNameSlug: "amazon-kindle" } 29000 }, 29001 { 29002 name: "pinterest", 29003 title: getTitle("Pinterest"), 29004 icon: embedPinterestIcon, 29005 keywords: [(0, import_i18n65.__)("social"), (0, import_i18n65.__)("bookmark")], 29006 description: (0, import_i18n65.__)("Embed Pinterest pins, boards, and profiles."), 29007 patterns: [ 29008 /^https?:\/\/([a-z]{2}|www)\.pinterest\.com(\.(au|mx))?\/.*/i 29009 ], 29010 attributes: { providerNameSlug: "pinterest" } 29011 }, 29012 { 29013 name: "wolfram-cloud", 29014 title: getTitle("Wolfram"), 29015 icon: embedWolframIcon, 29016 description: (0, import_i18n65.__)("Embed Wolfram notebook content."), 29017 patterns: [/^https?:\/\/(www\.)?wolframcloud\.com\/obj\/.+/i], 29018 attributes: { providerNameSlug: "wolfram-cloud", responsive: true } 29019 }, 29020 { 29021 name: "bluesky", 29022 title: getTitle("Bluesky"), 29023 icon: embedBlueskyIcon, 29024 description: (0, import_i18n65.__)("Embed a Bluesky post."), 29025 patterns: [/^https?:\/\/bsky\.app\/profile\/.+\/post\/.+/i], 29026 attributes: { providerNameSlug: "bluesky" } 29027 } 29028 ]; 29029 variations4.forEach((variation) => { 29030 if (variation.isActive) { 29031 return; 29032 } 29033 variation.isActive = (blockAttributes8, variationAttributes) => blockAttributes8.providerNameSlug === variationAttributes.providerNameSlug; 29034 }); 29035 var variations_default4 = variations4; 29036 29037 // packages/block-library/build-module/embed/deprecated.mjs 29038 var import_block_editor78 = __toESM(require_block_editor(), 1); 29039 var import_jsx_runtime280 = __toESM(require_jsx_runtime(), 1); 29040 var { attributes: blockAttributes3 } = block_default7; 29041 var v25 = { 29042 attributes: blockAttributes3, 29043 save({ attributes: attributes2 }) { 29044 const { url, caption, type, providerNameSlug } = attributes2; 29045 if (!url) { 29046 return null; 29047 } 29048 const className = clsx_default("wp-block-embed", { 29049 [`is-type-$type}`]: type, 29050 [`is-provider-$providerNameSlug}`]: providerNameSlug, 29051 [`wp-block-embed-$providerNameSlug}`]: providerNameSlug 29052 }); 29053 return /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)("figure", { ...import_block_editor78.useBlockProps.save({ className }), children: [ 29054 /* @__PURE__ */ (0, import_jsx_runtime280.jsx)("div", { className: "wp-block-embed__wrapper", children: ` 29055 $url} 29056 ` }), 29057 !import_block_editor78.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_block_editor78.RichText.Content, { tagName: "figcaption", value: caption }) 29058 ] }); 29059 } 29060 }; 29061 var v114 = { 29062 attributes: blockAttributes3, 29063 save({ attributes: { url, caption, type, providerNameSlug } }) { 29064 if (!url) { 29065 return null; 29066 } 29067 const embedClassName = clsx_default("wp-block-embed", { 29068 [`is-type-$type}`]: type, 29069 [`is-provider-$providerNameSlug}`]: providerNameSlug 29070 }); 29071 return /* @__PURE__ */ (0, import_jsx_runtime280.jsxs)("figure", { className: embedClassName, children: [ 29072 ` 29073 $url} 29074 `, 29075 !import_block_editor78.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime280.jsx)(import_block_editor78.RichText.Content, { tagName: "figcaption", value: caption }) 29076 ] }); 29077 } 29078 }; 29079 var deprecated5 = [v25, v114]; 29080 var deprecated_default15 = deprecated5; 29081 29082 // packages/block-library/build-module/embed/index.mjs 29083 var { name: name32 } = block_default7; 29084 var settings32 = { 29085 icon: embedContentIcon, 29086 edit: edit_default9, 29087 save: save16, 29088 transforms: transforms_default8, 29089 variations: variations_default4, 29090 deprecated: deprecated_default15 29091 }; 29092 var init32 = () => initBlock({ name: name32, metadata: block_default7, settings: settings32 }); 29093 29094 // packages/block-library/build-module/file/index.mjs 29095 var file_exports = {}; 29096 __export(file_exports, { 29097 init: () => init33, 29098 metadata: () => block_default33, 29099 name: () => name33, 29100 settings: () => settings33 29101 }); 29102 var import_i18n71 = __toESM(require_i18n(), 1); 29103 var import_blocks28 = __toESM(require_blocks(), 1); 29104 29105 // packages/block-library/build-module/file/deprecated.mjs 29106 var import_block_editor79 = __toESM(require_block_editor(), 1); 29107 var import_i18n66 = __toESM(require_i18n(), 1); 29108 var import_jsx_runtime281 = __toESM(require_jsx_runtime(), 1); 29109 var v33 = { 29110 attributes: { 29111 id: { 29112 type: "number" 29113 }, 29114 href: { 29115 type: "string" 29116 }, 29117 fileId: { 29118 type: "string", 29119 source: "attribute", 29120 selector: "a:not([download])", 29121 attribute: "id" 29122 }, 29123 fileName: { 29124 type: "string", 29125 source: "html", 29126 selector: "a:not([download])" 29127 }, 29128 textLinkHref: { 29129 type: "string", 29130 source: "attribute", 29131 selector: "a:not([download])", 29132 attribute: "href" 29133 }, 29134 textLinkTarget: { 29135 type: "string", 29136 source: "attribute", 29137 selector: "a:not([download])", 29138 attribute: "target" 29139 }, 29140 showDownloadButton: { 29141 type: "boolean", 29142 default: true 29143 }, 29144 downloadButtonText: { 29145 type: "string", 29146 source: "html", 29147 selector: "a[download]" 29148 }, 29149 displayPreview: { 29150 type: "boolean" 29151 }, 29152 previewHeight: { 29153 type: "number", 29154 default: 600 29155 } 29156 }, 29157 supports: { 29158 anchor: true, 29159 align: true 29160 }, 29161 save({ attributes: attributes2 }) { 29162 const { 29163 href, 29164 fileId, 29165 fileName, 29166 textLinkHref, 29167 textLinkTarget, 29168 showDownloadButton, 29169 downloadButtonText: downloadButtonText2, 29170 displayPreview, 29171 previewHeight 29172 } = attributes2; 29173 const pdfEmbedLabel = import_block_editor79.RichText.isEmpty(fileName) ? (0, import_i18n66.__)("PDF embed") : (0, import_i18n66.sprintf)( 29174 /* translators: %s: filename. */ 29175 (0, import_i18n66.__)("Embed of %s."), 29176 fileName 29177 ); 29178 const hasFilename = !import_block_editor79.RichText.isEmpty(fileName); 29179 const describedById = hasFilename ? fileId : void 0; 29180 return href && /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("div", { ...import_block_editor79.useBlockProps.save(), children: [ 29181 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_jsx_runtime281.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29182 "object", 29183 { 29184 className: "wp-block-file__embed", 29185 data: href, 29186 type: "application/pdf", 29187 style: { 29188 width: "100%", 29189 height: `$previewHeight}px` 29190 }, 29191 "aria-label": pdfEmbedLabel 29192 } 29193 ) }), 29194 hasFilename && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29195 "a", 29196 { 29197 id: describedById, 29198 href: textLinkHref, 29199 target: textLinkTarget, 29200 rel: textLinkTarget ? "noreferrer noopener" : void 0, 29201 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_block_editor79.RichText.Content, { value: fileName }) 29202 } 29203 ), 29204 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29205 "a", 29206 { 29207 href, 29208 className: clsx_default( 29209 "wp-block-file__button", 29210 (0, import_block_editor79.__experimentalGetElementClassName)("button") 29211 ), 29212 download: true, 29213 "aria-describedby": describedById, 29214 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_block_editor79.RichText.Content, { value: downloadButtonText2 }) 29215 } 29216 ) 29217 ] }); 29218 } 29219 }; 29220 var v26 = { 29221 attributes: { 29222 id: { 29223 type: "number" 29224 }, 29225 href: { 29226 type: "string" 29227 }, 29228 fileId: { 29229 type: "string", 29230 source: "attribute", 29231 selector: "a:not([download])", 29232 attribute: "id" 29233 }, 29234 fileName: { 29235 type: "string", 29236 source: "html", 29237 selector: "a:not([download])" 29238 }, 29239 textLinkHref: { 29240 type: "string", 29241 source: "attribute", 29242 selector: "a:not([download])", 29243 attribute: "href" 29244 }, 29245 textLinkTarget: { 29246 type: "string", 29247 source: "attribute", 29248 selector: "a:not([download])", 29249 attribute: "target" 29250 }, 29251 showDownloadButton: { 29252 type: "boolean", 29253 default: true 29254 }, 29255 downloadButtonText: { 29256 type: "string", 29257 source: "html", 29258 selector: "a[download]" 29259 }, 29260 displayPreview: { 29261 type: "boolean" 29262 }, 29263 previewHeight: { 29264 type: "number", 29265 default: 600 29266 } 29267 }, 29268 supports: { 29269 anchor: true, 29270 align: true 29271 }, 29272 save({ attributes: attributes2 }) { 29273 const { 29274 href, 29275 fileId, 29276 fileName, 29277 textLinkHref, 29278 textLinkTarget, 29279 showDownloadButton, 29280 downloadButtonText: downloadButtonText2, 29281 displayPreview, 29282 previewHeight 29283 } = attributes2; 29284 const pdfEmbedLabel = import_block_editor79.RichText.isEmpty(fileName) ? (0, import_i18n66.__)("PDF embed") : (0, import_i18n66.sprintf)( 29285 /* translators: %s: filename. */ 29286 (0, import_i18n66.__)("Embed of %s."), 29287 fileName 29288 ); 29289 const hasFilename = !import_block_editor79.RichText.isEmpty(fileName); 29290 const describedById = hasFilename ? fileId : void 0; 29291 return href && /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("div", { ...import_block_editor79.useBlockProps.save(), children: [ 29292 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_jsx_runtime281.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29293 "object", 29294 { 29295 className: "wp-block-file__embed", 29296 data: href, 29297 type: "application/pdf", 29298 style: { 29299 width: "100%", 29300 height: `$previewHeight}px` 29301 }, 29302 "aria-label": pdfEmbedLabel 29303 } 29304 ) }), 29305 hasFilename && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29306 "a", 29307 { 29308 id: describedById, 29309 href: textLinkHref, 29310 target: textLinkTarget, 29311 rel: textLinkTarget ? "noreferrer noopener" : void 0, 29312 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_block_editor79.RichText.Content, { value: fileName }) 29313 } 29314 ), 29315 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29316 "a", 29317 { 29318 href, 29319 className: "wp-block-file__button", 29320 download: true, 29321 "aria-describedby": describedById, 29322 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_block_editor79.RichText.Content, { value: downloadButtonText2 }) 29323 } 29324 ) 29325 ] }); 29326 } 29327 }; 29328 var v115 = { 29329 attributes: { 29330 id: { 29331 type: "number" 29332 }, 29333 href: { 29334 type: "string" 29335 }, 29336 fileName: { 29337 type: "string", 29338 source: "html", 29339 selector: "a:not([download])" 29340 }, 29341 textLinkHref: { 29342 type: "string", 29343 source: "attribute", 29344 selector: "a:not([download])", 29345 attribute: "href" 29346 }, 29347 textLinkTarget: { 29348 type: "string", 29349 source: "attribute", 29350 selector: "a:not([download])", 29351 attribute: "target" 29352 }, 29353 showDownloadButton: { 29354 type: "boolean", 29355 default: true 29356 }, 29357 downloadButtonText: { 29358 type: "string", 29359 source: "html", 29360 selector: "a[download]" 29361 }, 29362 displayPreview: { 29363 type: "boolean" 29364 }, 29365 previewHeight: { 29366 type: "number", 29367 default: 600 29368 } 29369 }, 29370 supports: { 29371 anchor: true, 29372 align: true 29373 }, 29374 save({ attributes: attributes2 }) { 29375 const { 29376 href, 29377 fileName, 29378 textLinkHref, 29379 textLinkTarget, 29380 showDownloadButton, 29381 downloadButtonText: downloadButtonText2, 29382 displayPreview, 29383 previewHeight 29384 } = attributes2; 29385 const pdfEmbedLabel = import_block_editor79.RichText.isEmpty(fileName) ? (0, import_i18n66.__)("PDF embed") : (0, import_i18n66.sprintf)( 29386 /* translators: %s: filename. */ 29387 (0, import_i18n66.__)("Embed of %s."), 29388 fileName 29389 ); 29390 return href && /* @__PURE__ */ (0, import_jsx_runtime281.jsxs)("div", { ...import_block_editor79.useBlockProps.save(), children: [ 29391 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_jsx_runtime281.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29392 "object", 29393 { 29394 className: "wp-block-file__embed", 29395 data: href, 29396 type: "application/pdf", 29397 style: { 29398 width: "100%", 29399 height: `$previewHeight}px` 29400 }, 29401 "aria-label": pdfEmbedLabel 29402 } 29403 ) }), 29404 !import_block_editor79.RichText.isEmpty(fileName) && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29405 "a", 29406 { 29407 href: textLinkHref, 29408 target: textLinkTarget, 29409 rel: textLinkTarget ? "noreferrer noopener" : void 0, 29410 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_block_editor79.RichText.Content, { value: fileName }) 29411 } 29412 ), 29413 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime281.jsx)( 29414 "a", 29415 { 29416 href, 29417 className: "wp-block-file__button", 29418 download: true, 29419 children: /* @__PURE__ */ (0, import_jsx_runtime281.jsx)(import_block_editor79.RichText.Content, { value: downloadButtonText2 }) 29420 } 29421 ) 29422 ] }); 29423 } 29424 }; 29425 var deprecated6 = [v33, v26, v115]; 29426 var deprecated_default16 = deprecated6; 29427 29428 // packages/block-library/build-module/file/edit.mjs 29429 var import_blob8 = __toESM(require_blob(), 1); 29430 var import_components41 = __toESM(require_components(), 1); 29431 var import_data32 = __toESM(require_data(), 1); 29432 var import_block_editor81 = __toESM(require_block_editor(), 1); 29433 var import_element55 = __toESM(require_element(), 1); 29434 var import_compose22 = __toESM(require_compose(), 1); 29435 var import_i18n68 = __toESM(require_i18n(), 1); 29436 var import_core_data18 = __toESM(require_core_data(), 1); 29437 var import_notices5 = __toESM(require_notices(), 1); 29438 var import_url8 = __toESM(require_url(), 1); 29439 29440 // packages/block-library/build-module/file/inspector.mjs 29441 var import_i18n67 = __toESM(require_i18n(), 1); 29442 var import_components40 = __toESM(require_components(), 1); 29443 var import_block_editor80 = __toESM(require_block_editor(), 1); 29444 var import_jsx_runtime282 = __toESM(require_jsx_runtime(), 1); 29445 function FileBlockInspector({ 29446 hrefs, 29447 openInNewWindow, 29448 showDownloadButton, 29449 changeLinkDestinationOption, 29450 changeOpenInNewWindow, 29451 changeShowDownloadButton, 29452 displayPreview, 29453 changeDisplayPreview, 29454 previewHeight, 29455 changePreviewHeight 29456 }) { 29457 const { href, textLinkHref, attachmentPage } = hrefs; 29458 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 29459 let linkDestinationOptions = [{ value: href, label: (0, import_i18n67.__)("URL") }]; 29460 if (attachmentPage) { 29461 linkDestinationOptions = [ 29462 { value: href, label: (0, import_i18n67.__)("Media file") }, 29463 { value: attachmentPage, label: (0, import_i18n67.__)("Attachment page") } 29464 ]; 29465 } 29466 return /* @__PURE__ */ (0, import_jsx_runtime282.jsx)(import_jsx_runtime282.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)(import_block_editor80.InspectorControls, { children: [ 29467 href.endsWith(".pdf") && /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)( 29468 import_components40.__experimentalToolsPanel, 29469 { 29470 label: (0, import_i18n67.__)("PDF settings"), 29471 resetAll: () => { 29472 changeDisplayPreview(true); 29473 changePreviewHeight(600); 29474 }, 29475 dropdownMenuProps, 29476 children: [ 29477 /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29478 import_components40.__experimentalToolsPanelItem, 29479 { 29480 label: (0, import_i18n67.__)("Show inline embed"), 29481 isShownByDefault: true, 29482 hasValue: () => !displayPreview, 29483 onDeselect: () => changeDisplayPreview(true), 29484 children: /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29485 import_components40.ToggleControl, 29486 { 29487 label: (0, import_i18n67.__)("Show inline embed"), 29488 help: displayPreview ? (0, import_i18n67.__)( 29489 "Note: Most phone and tablet browsers won't display embedded PDFs." 29490 ) : null, 29491 checked: !!displayPreview, 29492 onChange: changeDisplayPreview 29493 } 29494 ) 29495 } 29496 ), 29497 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29498 import_components40.__experimentalToolsPanelItem, 29499 { 29500 label: (0, import_i18n67.__)("Height in pixels"), 29501 isShownByDefault: true, 29502 hasValue: () => previewHeight !== 600, 29503 onDeselect: () => changePreviewHeight(600), 29504 children: /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29505 import_components40.RangeControl, 29506 { 29507 label: (0, import_i18n67.__)("Height in pixels"), 29508 min: MIN_PREVIEW_HEIGHT, 29509 max: Math.max( 29510 MAX_PREVIEW_HEIGHT, 29511 previewHeight 29512 ), 29513 value: previewHeight, 29514 onChange: changePreviewHeight 29515 } 29516 ) 29517 } 29518 ) 29519 ] 29520 } 29521 ), 29522 /* @__PURE__ */ (0, import_jsx_runtime282.jsxs)( 29523 import_components40.__experimentalToolsPanel, 29524 { 29525 label: (0, import_i18n67.__)("Settings"), 29526 resetAll: () => { 29527 changeLinkDestinationOption(href); 29528 changeOpenInNewWindow(false); 29529 changeShowDownloadButton(true); 29530 }, 29531 dropdownMenuProps, 29532 children: [ 29533 /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29534 import_components40.__experimentalToolsPanelItem, 29535 { 29536 label: (0, import_i18n67.__)("Link to"), 29537 isShownByDefault: true, 29538 hasValue: () => textLinkHref !== href, 29539 onDeselect: () => changeLinkDestinationOption(href), 29540 children: /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29541 import_components40.SelectControl, 29542 { 29543 label: (0, import_i18n67.__)("Link to"), 29544 value: textLinkHref, 29545 options: linkDestinationOptions, 29546 onChange: changeLinkDestinationOption 29547 } 29548 ) 29549 } 29550 ), 29551 /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29552 import_components40.__experimentalToolsPanelItem, 29553 { 29554 label: (0, import_i18n67.__)("Open in new tab"), 29555 isShownByDefault: true, 29556 hasValue: () => !!openInNewWindow, 29557 onDeselect: () => changeOpenInNewWindow(false), 29558 children: /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29559 import_components40.ToggleControl, 29560 { 29561 label: (0, import_i18n67.__)("Open in new tab"), 29562 checked: openInNewWindow, 29563 onChange: changeOpenInNewWindow 29564 } 29565 ) 29566 } 29567 ), 29568 /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29569 import_components40.__experimentalToolsPanelItem, 29570 { 29571 label: (0, import_i18n67.__)("Show download button"), 29572 isShownByDefault: true, 29573 hasValue: () => !showDownloadButton, 29574 onDeselect: () => changeShowDownloadButton(true), 29575 children: /* @__PURE__ */ (0, import_jsx_runtime282.jsx)( 29576 import_components40.ToggleControl, 29577 { 29578 label: (0, import_i18n67.__)("Show download button"), 29579 checked: showDownloadButton, 29580 onChange: changeShowDownloadButton 29581 } 29582 ) 29583 } 29584 ) 29585 ] 29586 } 29587 ) 29588 ] }) }); 29589 } 29590 29591 // packages/block-library/build-module/file/utils/index.mjs 29592 var browserSupportsPdfs = () => { 29593 if (window.navigator.pdfViewerEnabled) { 29594 return true; 29595 } 29596 if (window.navigator.userAgent.indexOf("Mobi") > -1) { 29597 return false; 29598 } 29599 if (window.navigator.userAgent.indexOf("Android") > -1) { 29600 return false; 29601 } 29602 if (window.navigator.userAgent.indexOf("Macintosh") > -1 && window.navigator.maxTouchPoints && window.navigator.maxTouchPoints > 2) { 29603 return false; 29604 } 29605 if (!!(window.ActiveXObject || "ActiveXObject" in window) && !(createActiveXObject("AcroPDF.PDF") || createActiveXObject("PDF.PdfCtrl"))) { 29606 return false; 29607 } 29608 return true; 29609 }; 29610 var createActiveXObject = (type) => { 29611 let ax; 29612 try { 29613 ax = new window.ActiveXObject(type); 29614 } catch { 29615 ax = void 0; 29616 } 29617 return ax; 29618 }; 29619 29620 // packages/block-library/build-module/file/edit.mjs 29621 var import_jsx_runtime283 = __toESM(require_jsx_runtime(), 1); 29622 var MIN_PREVIEW_HEIGHT = 200; 29623 var MAX_PREVIEW_HEIGHT = 2e3; 29624 function ClipboardToolbarButton({ text, disabled: disabled2 }) { 29625 const { createNotice } = (0, import_data32.useDispatch)(import_notices5.store); 29626 const ref = (0, import_compose22.useCopyToClipboard)(text, () => { 29627 createNotice("info", (0, import_i18n68.__)("Copied URL to clipboard."), { 29628 isDismissible: true, 29629 type: "snackbar" 29630 }); 29631 }); 29632 return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 29633 import_components41.ToolbarButton, 29634 { 29635 className: "components-clipboard-toolbar-button", 29636 ref, 29637 disabled: disabled2, 29638 children: (0, import_i18n68.__)("Copy URL") 29639 } 29640 ); 29641 } 29642 function FileEdit({ attributes: attributes2, isSelected, setAttributes, clientId }) { 29643 const { 29644 id, 29645 fileName, 29646 href, 29647 textLinkHref, 29648 textLinkTarget, 29649 showDownloadButton, 29650 downloadButtonText: downloadButtonText2, 29651 displayPreview, 29652 previewHeight 29653 } = attributes2; 29654 const [temporaryURL, setTemporaryURL] = (0, import_element55.useState)(attributes2.blob); 29655 const { media } = (0, import_data32.useSelect)( 29656 (select10) => ({ 29657 media: !!id ? select10(import_core_data18.store).getEntityRecord( 29658 "postType", 29659 "attachment", 29660 id, 29661 { context: "view" } 29662 ) : void 0 29663 }), 29664 [id] 29665 ); 29666 const { createErrorNotice } = (0, import_data32.useDispatch)(import_notices5.store); 29667 const { toggleSelection } = (0, import_data32.useDispatch)(import_block_editor81.store); 29668 useUploadMediaFromBlobURL({ 29669 url: temporaryURL, 29670 onChange: onSelectFile, 29671 onError: onUploadError 29672 }); 29673 function onSelectFile(newMedia) { 29674 if (!newMedia || !newMedia.url) { 29675 setAttributes({ 29676 href: void 0, 29677 fileName: void 0, 29678 textLinkHref: void 0, 29679 id: void 0, 29680 fileId: void 0, 29681 displayPreview: void 0, 29682 previewHeight: void 0 29683 }); 29684 setTemporaryURL(); 29685 return; 29686 } 29687 if ((0, import_blob8.isBlobURL)(newMedia.url)) { 29688 setTemporaryURL(newMedia.url); 29689 return; 29690 } 29691 const isPdf = ( 29692 // Media Library and REST API use different properties for mime type. 29693 (newMedia.mime || newMedia.mime_type) === "application/pdf" || (0, import_url8.getFilename)(newMedia.url).toLowerCase().endsWith(".pdf") 29694 ); 29695 const pdfAttributes = { 29696 displayPreview: isPdf ? attributes2.displayPreview ?? true : void 0, 29697 previewHeight: isPdf ? attributes2.previewHeight ?? 600 : void 0 29698 }; 29699 setAttributes({ 29700 href: newMedia.url, 29701 fileName: newMedia.title, 29702 textLinkHref: newMedia.url, 29703 id: newMedia.id, 29704 fileId: `wp-block-file--media-$clientId}`, 29705 blob: void 0, 29706 ...pdfAttributes 29707 }); 29708 setTemporaryURL(); 29709 } 29710 function onUploadError(message) { 29711 setAttributes({ href: void 0 }); 29712 createErrorNotice(message, { type: "snackbar" }); 29713 } 29714 function changeLinkDestinationOption(newHref) { 29715 setAttributes({ textLinkHref: newHref }); 29716 } 29717 function changeOpenInNewWindow(newValue) { 29718 setAttributes({ 29719 textLinkTarget: newValue ? "_blank" : false 29720 }); 29721 } 29722 function changeShowDownloadButton(newValue) { 29723 setAttributes({ showDownloadButton: newValue }); 29724 } 29725 function changeDisplayPreview(newValue) { 29726 setAttributes({ displayPreview: newValue }); 29727 } 29728 function handleOnResizeStop(event, direction, elt, delta) { 29729 toggleSelection(true); 29730 const newHeight = parseInt(previewHeight + delta.height, 10); 29731 setAttributes({ previewHeight: newHeight }); 29732 } 29733 function changePreviewHeight(newValue) { 29734 const newHeight = Math.max( 29735 parseInt(newValue, 10), 29736 MIN_PREVIEW_HEIGHT 29737 ); 29738 setAttributes({ previewHeight: newHeight }); 29739 } 29740 const attachmentPage = media && media.link; 29741 const blockProps = (0, import_block_editor81.useBlockProps)({ 29742 className: clsx_default( 29743 !!temporaryURL && (0, import_components41.__unstableGetAnimateClassName)({ type: "loading" }), 29744 { 29745 "is-transient": !!temporaryURL 29746 } 29747 ) 29748 }); 29749 const displayPreviewInEditor = browserSupportsPdfs() && displayPreview; 29750 if (!href && !temporaryURL) { 29751 return /* @__PURE__ */ (0, import_jsx_runtime283.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 29752 import_block_editor81.MediaPlaceholder, 29753 { 29754 icon: /* @__PURE__ */ (0, import_jsx_runtime283.jsx)(import_block_editor81.BlockIcon, { icon: file_default }), 29755 labels: { 29756 title: (0, import_i18n68.__)("File"), 29757 instructions: (0, import_i18n68.__)( 29758 "Drag and drop a file, upload, or choose from your library." 29759 ) 29760 }, 29761 onSelect: onSelectFile, 29762 onError: onUploadError, 29763 accept: "*" 29764 } 29765 ) }); 29766 } 29767 return /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(import_jsx_runtime283.Fragment, { children: [ 29768 /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 29769 FileBlockInspector, 29770 { 29771 hrefs: { 29772 href: href || temporaryURL, 29773 textLinkHref, 29774 attachmentPage 29775 }, 29776 ...{ 29777 openInNewWindow: !!textLinkTarget, 29778 showDownloadButton, 29779 changeLinkDestinationOption, 29780 changeOpenInNewWindow, 29781 changeShowDownloadButton, 29782 displayPreview, 29783 changeDisplayPreview, 29784 previewHeight, 29785 changePreviewHeight 29786 } 29787 } 29788 ), 29789 /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)(import_block_editor81.BlockControls, { group: "other", children: [ 29790 /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 29791 import_block_editor81.MediaReplaceFlow, 29792 { 29793 mediaId: id, 29794 mediaURL: href, 29795 accept: "*", 29796 onSelect: onSelectFile, 29797 onError: onUploadError, 29798 onReset: () => onSelectFile(void 0) 29799 } 29800 ), 29801 /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 29802 ClipboardToolbarButton, 29803 { 29804 text: href, 29805 disabled: (0, import_blob8.isBlobURL)(href) 29806 } 29807 ) 29808 ] }), 29809 /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)("div", { ...blockProps, children: [ 29810 displayPreviewInEditor && /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)( 29811 import_components41.ResizableBox, 29812 { 29813 size: { height: previewHeight, width: "100%" }, 29814 minHeight: MIN_PREVIEW_HEIGHT, 29815 maxHeight: MAX_PREVIEW_HEIGHT, 29816 grid: [1, 10], 29817 enable: { 29818 top: false, 29819 right: false, 29820 bottom: true, 29821 left: false, 29822 topRight: false, 29823 bottomRight: false, 29824 bottomLeft: false, 29825 topLeft: false 29826 }, 29827 onResizeStart: () => toggleSelection(false), 29828 onResizeStop: handleOnResizeStop, 29829 showHandle: isSelected, 29830 children: [ 29831 /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 29832 "object", 29833 { 29834 className: "wp-block-file__preview", 29835 data: href, 29836 type: "application/pdf", 29837 "aria-label": (0, import_i18n68.__)( 29838 "Embed of the selected PDF file." 29839 ) 29840 } 29841 ), 29842 !isSelected && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)("div", { className: "wp-block-file__preview-overlay" }) 29843 ] 29844 } 29845 ), 29846 /* @__PURE__ */ (0, import_jsx_runtime283.jsxs)("div", { className: "wp-block-file__content-wrapper", children: [ 29847 /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 29848 import_block_editor81.RichText, 29849 { 29850 identifier: "fileName", 29851 tagName: "a", 29852 value: fileName, 29853 placeholder: (0, import_i18n68.__)("Write file name\u2026"), 29854 withoutInteractiveFormatting: true, 29855 onChange: (text) => setAttributes({ 29856 fileName: removeAnchorTag(text) 29857 }), 29858 href: textLinkHref 29859 } 29860 ), 29861 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime283.jsx)("div", { className: "wp-block-file__button-richtext-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime283.jsx)( 29862 import_block_editor81.RichText, 29863 { 29864 identifier: "downloadButtonText", 29865 tagName: "div", 29866 "aria-label": (0, import_i18n68.__)("Download button text"), 29867 className: clsx_default( 29868 "wp-block-file__button", 29869 (0, import_block_editor81.__experimentalGetElementClassName)( 29870 "button" 29871 ) 29872 ), 29873 value: downloadButtonText2, 29874 withoutInteractiveFormatting: true, 29875 placeholder: (0, import_i18n68.__)("Add text\u2026"), 29876 onChange: (text) => setAttributes({ 29877 downloadButtonText: removeAnchorTag(text) 29878 }) 29879 } 29880 ) }) 29881 ] }) 29882 ] }) 29883 ] }); 29884 } 29885 var edit_default10 = FileEdit; 29886 29887 // packages/block-library/build-module/file/block.json 29888 var block_default33 = { 29889 $schema: "https://schemas.wp.org/trunk/block.json", 29890 apiVersion: 3, 29891 name: "core/file", 29892 title: "File", 29893 category: "media", 29894 description: "Add a link to a downloadable file.", 29895 keywords: ["document", "pdf", "download"], 29896 textdomain: "default", 29897 attributes: { 29898 id: { 29899 type: "number" 29900 }, 29901 blob: { 29902 type: "string", 29903 role: "local" 29904 }, 29905 href: { 29906 type: "string", 29907 role: "content" 29908 }, 29909 fileId: { 29910 type: "string", 29911 source: "attribute", 29912 selector: "a:not([download])", 29913 attribute: "id" 29914 }, 29915 fileName: { 29916 type: "rich-text", 29917 source: "rich-text", 29918 selector: "a:not([download])", 29919 role: "content" 29920 }, 29921 textLinkHref: { 29922 type: "string", 29923 source: "attribute", 29924 selector: "a:not([download])", 29925 attribute: "href", 29926 role: "content" 29927 }, 29928 textLinkTarget: { 29929 type: "string", 29930 source: "attribute", 29931 selector: "a:not([download])", 29932 attribute: "target" 29933 }, 29934 showDownloadButton: { 29935 type: "boolean", 29936 default: true 29937 }, 29938 downloadButtonText: { 29939 type: "rich-text", 29940 source: "rich-text", 29941 selector: "a[download]", 29942 role: "content" 29943 }, 29944 displayPreview: { 29945 type: "boolean" 29946 }, 29947 previewHeight: { 29948 type: "number", 29949 default: 600 29950 } 29951 }, 29952 supports: { 29953 anchor: true, 29954 align: true, 29955 spacing: { 29956 margin: true, 29957 padding: true 29958 }, 29959 color: { 29960 gradients: true, 29961 link: true, 29962 text: false, 29963 __experimentalDefaultControls: { 29964 background: true, 29965 link: true 29966 } 29967 }, 29968 __experimentalBorder: { 29969 radius: true, 29970 color: true, 29971 width: true, 29972 style: true, 29973 __experimentalDefaultControls: { 29974 radius: true, 29975 color: true, 29976 width: true, 29977 style: true 29978 } 29979 }, 29980 interactivity: true 29981 }, 29982 editorStyle: "wp-block-file-editor", 29983 style: "wp-block-file" 29984 }; 29985 29986 // packages/block-library/build-module/file/save.mjs 29987 var import_block_editor82 = __toESM(require_block_editor(), 1); 29988 var import_jsx_runtime284 = __toESM(require_jsx_runtime(), 1); 29989 function save17({ attributes: attributes2 }) { 29990 const { 29991 href, 29992 fileId, 29993 fileName, 29994 textLinkHref, 29995 textLinkTarget, 29996 showDownloadButton, 29997 downloadButtonText: downloadButtonText2, 29998 displayPreview, 29999 previewHeight 30000 } = attributes2; 30001 const pdfEmbedLabel = import_block_editor82.RichText.isEmpty(fileName) ? "PDF embed" : ( 30002 // To do: use toPlainText, but we need ensure it's RichTextData. See 30003 // https://github.com/WordPress/gutenberg/pull/56710. 30004 fileName.toString() 30005 ); 30006 const hasFilename = !import_block_editor82.RichText.isEmpty(fileName); 30007 const describedById = hasFilename ? fileId : void 0; 30008 return href && /* @__PURE__ */ (0, import_jsx_runtime284.jsxs)("div", { ...import_block_editor82.useBlockProps.save(), children: [ 30009 displayPreview && /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(import_jsx_runtime284.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime284.jsx)( 30010 "object", 30011 { 30012 className: "wp-block-file__embed", 30013 data: href, 30014 type: "application/pdf", 30015 style: { 30016 width: "100%", 30017 height: `$previewHeight}px` 30018 }, 30019 "aria-label": pdfEmbedLabel 30020 } 30021 ) }), 30022 hasFilename && /* @__PURE__ */ (0, import_jsx_runtime284.jsx)( 30023 "a", 30024 { 30025 id: describedById, 30026 href: textLinkHref, 30027 target: textLinkTarget, 30028 rel: textLinkTarget ? "noreferrer noopener" : void 0, 30029 children: /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(import_block_editor82.RichText.Content, { value: fileName }) 30030 } 30031 ), 30032 showDownloadButton && /* @__PURE__ */ (0, import_jsx_runtime284.jsx)( 30033 "a", 30034 { 30035 href, 30036 className: clsx_default( 30037 "wp-block-file__button", 30038 (0, import_block_editor82.__experimentalGetElementClassName)("button") 30039 ), 30040 download: true, 30041 "aria-describedby": describedById, 30042 children: /* @__PURE__ */ (0, import_jsx_runtime284.jsx)(import_block_editor82.RichText.Content, { value: downloadButtonText2 }) 30043 } 30044 ) 30045 ] }); 30046 } 30047 30048 // packages/block-library/build-module/file/transforms.mjs 30049 var import_blob9 = __toESM(require_blob(), 1); 30050 var import_blocks27 = __toESM(require_blocks(), 1); 30051 var import_data33 = __toESM(require_data(), 1); 30052 var import_core_data19 = __toESM(require_core_data(), 1); 30053 var import_i18n69 = __toESM(require_i18n(), 1); 30054 var import_url9 = __toESM(require_url(), 1); 30055 var downloadButtonText = (0, import_i18n69._x)("Download", "button label"); 30056 var toMediaTransform = (blockName, mediaType, srcAttribute) => ({ 30057 type: "block", 30058 blocks: [blockName], 30059 isMatch: ({ id }) => { 30060 if (!id) { 30061 return false; 30062 } 30063 const { getEntityRecord } = (0, import_data33.select)(import_core_data19.store); 30064 const media = getEntityRecord("postType", "attachment", id, { 30065 context: "view" 30066 }); 30067 return !!media && media.mime_type.includes(mediaType); 30068 }, 30069 transform: (attributes2) => { 30070 return (0, import_blocks27.createBlock)(blockName, { 30071 [srcAttribute]: attributes2.href, 30072 caption: attributes2.fileName, 30073 id: attributes2.id, 30074 anchor: attributes2.anchor 30075 }); 30076 } 30077 }); 30078 var transforms8 = { 30079 from: [ 30080 { 30081 type: "files", 30082 isMatch(files) { 30083 return files.length > 0; 30084 }, 30085 // We define a lower priority (higher number) than the default of 10. This 30086 // ensures that the File block is only created as a fallback. 30087 priority: 15, 30088 transform: (files) => { 30089 const blocks = []; 30090 files.forEach((file) => { 30091 const blobURL = (0, import_blob9.createBlobURL)(file); 30092 if (file.type.startsWith("video/")) { 30093 blocks.push( 30094 (0, import_blocks27.createBlock)("core/video", { 30095 blob: (0, import_blob9.createBlobURL)(file) 30096 }) 30097 ); 30098 } else if (file.type.startsWith("image/")) { 30099 blocks.push( 30100 (0, import_blocks27.createBlock)("core/image", { 30101 blob: (0, import_blob9.createBlobURL)(file) 30102 }) 30103 ); 30104 } else if (file.type.startsWith("audio/")) { 30105 blocks.push( 30106 (0, import_blocks27.createBlock)("core/audio", { 30107 blob: (0, import_blob9.createBlobURL)(file) 30108 }) 30109 ); 30110 } else { 30111 blocks.push( 30112 (0, import_blocks27.createBlock)("core/file", { 30113 blob: blobURL, 30114 fileName: file.name, 30115 downloadButtonText 30116 }) 30117 ); 30118 } 30119 }); 30120 return blocks; 30121 } 30122 }, 30123 { 30124 type: "block", 30125 blocks: ["core/audio", "core/video", "core/image"], 30126 transform: (attributes2) => { 30127 const href = attributes2.src ?? attributes2.url; 30128 return (0, import_blocks27.createBlock)("core/file", { 30129 href, 30130 fileName: attributes2.caption || (0, import_url9.getFilename)(href), 30131 textLinkHref: href, 30132 id: attributes2.id, 30133 anchor: attributes2.anchor, 30134 downloadButtonText 30135 }); 30136 } 30137 } 30138 ], 30139 to: [ 30140 toMediaTransform("core/audio", "audio", "src"), 30141 toMediaTransform("core/video", "video", "src"), 30142 toMediaTransform("core/image", "image", "url") 30143 ] 30144 }; 30145 var transforms_default9 = transforms8; 30146 30147 // packages/block-library/build-module/file/variations.mjs 30148 var import_i18n70 = __toESM(require_i18n(), 1); 30149 var variations5 = [ 30150 { 30151 name: "default", 30152 isDefault: true, 30153 // Translatable defaults can't live in `block.json`, so set it here. 30154 attributes: { 30155 downloadButtonText: (0, import_i18n70._x)("Download", "button label") 30156 } 30157 } 30158 ]; 30159 var variations_default5 = variations5; 30160 30161 // packages/block-library/build-module/file/index.mjs 30162 var { fieldsKey: fieldsKey6, formKey: formKey6 } = unlock(import_blocks28.privateApis); 30163 var { name: name33 } = block_default33; 30164 var settings33 = { 30165 icon: file_default, 30166 example: { 30167 attributes: { 30168 href: "https://upload.wikimedia.org/wikipedia/commons/d/dd/Armstrong_Small_Step.ogg", 30169 fileName: (0, import_i18n71._x)("Armstrong_Small_Step", "Name of the file") 30170 } 30171 }, 30172 transforms: transforms_default9, 30173 deprecated: deprecated_default16, 30174 edit: edit_default10, 30175 save: save17, 30176 variations: variations_default5 30177 }; 30178 if (window.__experimentalContentOnlyInspectorFields) { 30179 settings33[fieldsKey6] = [ 30180 { 30181 id: "file", 30182 label: (0, import_i18n71.__)("File"), 30183 type: "media", 30184 Edit: { 30185 control: "media", 30186 // TODO: replace with custom component 30187 allowedTypes: [], 30188 multiple: false 30189 }, 30190 getValue: ({ item }) => ({ 30191 id: item.id, 30192 url: item.href 30193 }), 30194 setValue: ({ value }) => ({ 30195 id: value.id, 30196 href: value.url 30197 }) 30198 }, 30199 { 30200 id: "fileName", 30201 label: (0, import_i18n71.__)("Filename"), 30202 type: "text", 30203 Edit: "rich-text" 30204 // TODO: replace with custom component 30205 }, 30206 { 30207 id: "downloadButtonText", 30208 label: (0, import_i18n71.__)("Button Text"), 30209 type: "text", 30210 Edit: "rich-text" 30211 // TODO: replace with custom component 30212 } 30213 ]; 30214 settings33[formKey6] = { 30215 fields: ["file", "fileName", "downloadButtonText"] 30216 }; 30217 } 30218 var init33 = () => initBlock({ name: name33, metadata: block_default33, settings: settings33 }); 30219 30220 // packages/block-library/build-module/gallery/index.mjs 30221 var gallery_exports = {}; 30222 __export(gallery_exports, { 30223 init: () => init34, 30224 metadata: () => block_default34, 30225 name: () => name34, 30226 settings: () => settings34 30227 }); 30228 30229 // packages/block-library/build-module/gallery/deprecated.mjs 30230 var import_block_editor83 = __toESM(require_block_editor(), 1); 30231 var import_blocks29 = __toESM(require_blocks(), 1); 30232 30233 // packages/block-library/build-module/gallery/constants.mjs 30234 var LINK_DESTINATION_NONE = "none"; 30235 var LINK_DESTINATION_MEDIA = "media"; 30236 var LINK_DESTINATION_LIGHTBOX = "lightbox"; 30237 var LINK_DESTINATION_ATTACHMENT = "attachment"; 30238 var LINK_DESTINATION_MEDIA_WP_CORE = "file"; 30239 var LINK_DESTINATION_ATTACHMENT_WP_CORE = "post"; 30240 var DEFAULT_MEDIA_SIZE_SLUG2 = "large"; 30241 var MAX_COLUMNS = 8; 30242 30243 // packages/block-library/build-module/gallery/deprecated.mjs 30244 var import_jsx_runtime285 = __toESM(require_jsx_runtime(), 1); 30245 var DEPRECATED_LINK_DESTINATION_MEDIA = "file"; 30246 var DEPRECATED_LINK_DESTINATION_ATTACHMENT = "post"; 30247 function defaultColumnsNumberV1(attributes2) { 30248 return Math.min(3, attributes2?.images?.length); 30249 } 30250 function getHrefAndDestination(image, destination) { 30251 switch (destination) { 30252 case DEPRECATED_LINK_DESTINATION_MEDIA: 30253 return { 30254 href: image?.source_url || image?.url, 30255 linkDestination: LINK_DESTINATION_MEDIA 30256 }; 30257 case DEPRECATED_LINK_DESTINATION_ATTACHMENT: 30258 return { 30259 href: image?.link, 30260 linkDestination: LINK_DESTINATION_ATTACHMENT 30261 }; 30262 case LINK_DESTINATION_MEDIA: 30263 return { 30264 href: image?.source_url || image?.url, 30265 linkDestination: LINK_DESTINATION_MEDIA 30266 }; 30267 case LINK_DESTINATION_ATTACHMENT: 30268 return { 30269 href: image?.link, 30270 linkDestination: LINK_DESTINATION_ATTACHMENT 30271 }; 30272 case LINK_DESTINATION_NONE: 30273 return { 30274 href: void 0, 30275 linkDestination: LINK_DESTINATION_NONE 30276 }; 30277 } 30278 return {}; 30279 } 30280 function runV2Migration(attributes2) { 30281 let linkTo = attributes2.linkTo ? attributes2.linkTo : "none"; 30282 if (linkTo === "post") { 30283 linkTo = "attachment"; 30284 } else if (linkTo === "file") { 30285 linkTo = "media"; 30286 } 30287 const imageBlocks = attributes2.images.map((image) => { 30288 return getImageBlock(image, attributes2.sizeSlug, linkTo); 30289 }); 30290 const { images, ids, ...restAttributes } = attributes2; 30291 return [ 30292 { 30293 ...restAttributes, 30294 linkTo, 30295 allowResize: false 30296 }, 30297 imageBlocks 30298 ]; 30299 } 30300 function getImageBlock(image, sizeSlug, linkTo) { 30301 return (0, import_blocks29.createBlock)("core/image", { 30302 ...image.id && { id: parseInt(image.id) }, 30303 url: image.url, 30304 alt: image.alt, 30305 caption: image.caption, 30306 sizeSlug, 30307 ...getHrefAndDestination(image, linkTo) 30308 }); 30309 } 30310 var v72 = { 30311 attributes: { 30312 images: { 30313 type: "array", 30314 default: [], 30315 source: "query", 30316 selector: ".blocks-gallery-item", 30317 query: { 30318 url: { 30319 type: "string", 30320 source: "attribute", 30321 selector: "img", 30322 attribute: "src" 30323 }, 30324 fullUrl: { 30325 type: "string", 30326 source: "attribute", 30327 selector: "img", 30328 attribute: "data-full-url" 30329 }, 30330 link: { 30331 type: "string", 30332 source: "attribute", 30333 selector: "img", 30334 attribute: "data-link" 30335 }, 30336 alt: { 30337 type: "string", 30338 source: "attribute", 30339 selector: "img", 30340 attribute: "alt", 30341 default: "" 30342 }, 30343 id: { 30344 type: "string", 30345 source: "attribute", 30346 selector: "img", 30347 attribute: "data-id" 30348 }, 30349 caption: { 30350 type: "string", 30351 source: "html", 30352 selector: ".blocks-gallery-item__caption" 30353 } 30354 } 30355 }, 30356 ids: { 30357 type: "array", 30358 items: { 30359 type: "number" 30360 }, 30361 default: [] 30362 }, 30363 shortCodeTransforms: { 30364 type: "array", 30365 default: [], 30366 items: { 30367 type: "object" 30368 } 30369 }, 30370 columns: { 30371 type: "number", 30372 minimum: 1, 30373 maximum: 8 30374 }, 30375 caption: { 30376 type: "string", 30377 source: "html", 30378 selector: ".blocks-gallery-caption" 30379 }, 30380 imageCrop: { 30381 type: "boolean", 30382 default: true 30383 }, 30384 fixedHeight: { 30385 type: "boolean", 30386 default: true 30387 }, 30388 linkTarget: { 30389 type: "string" 30390 }, 30391 linkTo: { 30392 type: "string" 30393 }, 30394 sizeSlug: { 30395 type: "string", 30396 default: "large" 30397 }, 30398 allowResize: { 30399 type: "boolean", 30400 default: false 30401 } 30402 }, 30403 save({ attributes: attributes2 }) { 30404 const { caption, columns, imageCrop } = attributes2; 30405 const className = clsx_default("has-nested-images", { 30406 [`columns-$columns}`]: columns !== void 0, 30407 [`columns-default`]: columns === void 0, 30408 "is-cropped": imageCrop 30409 }); 30410 const blockProps = import_block_editor83.useBlockProps.save({ className }); 30411 const innerBlocksProps = import_block_editor83.useInnerBlocksProps.save(blockProps); 30412 return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)("figure", { ...innerBlocksProps, children: [ 30413 innerBlocksProps.children, 30414 !import_block_editor83.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30415 import_block_editor83.RichText.Content, 30416 { 30417 tagName: "figcaption", 30418 className: "blocks-gallery-caption", 30419 value: caption 30420 } 30421 ) 30422 ] }); 30423 } 30424 }; 30425 var v62 = { 30426 attributes: { 30427 images: { 30428 type: "array", 30429 default: [], 30430 source: "query", 30431 selector: ".blocks-gallery-item", 30432 query: { 30433 url: { 30434 type: "string", 30435 source: "attribute", 30436 selector: "img", 30437 attribute: "src" 30438 }, 30439 fullUrl: { 30440 type: "string", 30441 source: "attribute", 30442 selector: "img", 30443 attribute: "data-full-url" 30444 }, 30445 link: { 30446 type: "string", 30447 source: "attribute", 30448 selector: "img", 30449 attribute: "data-link" 30450 }, 30451 alt: { 30452 type: "string", 30453 source: "attribute", 30454 selector: "img", 30455 attribute: "alt", 30456 default: "" 30457 }, 30458 id: { 30459 type: "string", 30460 source: "attribute", 30461 selector: "img", 30462 attribute: "data-id" 30463 }, 30464 caption: { 30465 type: "string", 30466 source: "html", 30467 selector: ".blocks-gallery-item__caption" 30468 } 30469 } 30470 }, 30471 ids: { 30472 type: "array", 30473 items: { 30474 type: "number" 30475 }, 30476 default: [] 30477 }, 30478 columns: { 30479 type: "number", 30480 minimum: 1, 30481 maximum: 8 30482 }, 30483 caption: { 30484 type: "string", 30485 source: "html", 30486 selector: ".blocks-gallery-caption" 30487 }, 30488 imageCrop: { 30489 type: "boolean", 30490 default: true 30491 }, 30492 fixedHeight: { 30493 type: "boolean", 30494 default: true 30495 }, 30496 linkTo: { 30497 type: "string" 30498 }, 30499 sizeSlug: { 30500 type: "string", 30501 default: "large" 30502 } 30503 }, 30504 supports: { 30505 anchor: true, 30506 align: true 30507 }, 30508 save({ attributes: attributes2 }) { 30509 const { 30510 images, 30511 columns = defaultColumnsNumberV1(attributes2), 30512 imageCrop, 30513 caption, 30514 linkTo 30515 } = attributes2; 30516 const className = `columns-$columns} $imageCrop ? "is-cropped" : ""}`; 30517 return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)("figure", { ...import_block_editor83.useBlockProps.save({ className }), children: [ 30518 /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("ul", { className: "blocks-gallery-grid", children: images.map((image) => { 30519 let href; 30520 switch (linkTo) { 30521 case DEPRECATED_LINK_DESTINATION_MEDIA: 30522 href = image.fullUrl || image.url; 30523 break; 30524 case DEPRECATED_LINK_DESTINATION_ATTACHMENT: 30525 href = image.link; 30526 break; 30527 } 30528 const img = /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30529 "img", 30530 { 30531 src: image.url, 30532 alt: image.alt, 30533 "data-id": image.id, 30534 "data-full-url": image.fullUrl, 30535 "data-link": image.link, 30536 className: image.id ? `wp-image-$image.id}` : null 30537 } 30538 ); 30539 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30540 "li", 30541 { 30542 className: "blocks-gallery-item", 30543 children: /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)("figure", { children: [ 30544 href ? /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("a", { href, children: img }) : img, 30545 !import_block_editor83.RichText.isEmpty(image.caption) && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30546 import_block_editor83.RichText.Content, 30547 { 30548 tagName: "figcaption", 30549 className: "blocks-gallery-item__caption", 30550 value: image.caption 30551 } 30552 ) 30553 ] }) 30554 }, 30555 image.id || image.url 30556 ); 30557 }) }), 30558 !import_block_editor83.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30559 import_block_editor83.RichText.Content, 30560 { 30561 tagName: "figcaption", 30562 className: "blocks-gallery-caption", 30563 value: caption 30564 } 30565 ) 30566 ] }); 30567 }, 30568 migrate(attributes2) { 30569 return runV2Migration(attributes2); 30570 } 30571 }; 30572 var v52 = { 30573 attributes: { 30574 images: { 30575 type: "array", 30576 default: [], 30577 source: "query", 30578 selector: ".blocks-gallery-item", 30579 query: { 30580 url: { 30581 type: "string", 30582 source: "attribute", 30583 selector: "img", 30584 attribute: "src" 30585 }, 30586 fullUrl: { 30587 type: "string", 30588 source: "attribute", 30589 selector: "img", 30590 attribute: "data-full-url" 30591 }, 30592 link: { 30593 type: "string", 30594 source: "attribute", 30595 selector: "img", 30596 attribute: "data-link" 30597 }, 30598 alt: { 30599 type: "string", 30600 source: "attribute", 30601 selector: "img", 30602 attribute: "alt", 30603 default: "" 30604 }, 30605 id: { 30606 type: "string", 30607 source: "attribute", 30608 selector: "img", 30609 attribute: "data-id" 30610 }, 30611 caption: { 30612 type: "string", 30613 source: "html", 30614 selector: ".blocks-gallery-item__caption" 30615 } 30616 } 30617 }, 30618 ids: { 30619 type: "array", 30620 items: { 30621 type: "number" 30622 }, 30623 default: [] 30624 }, 30625 columns: { 30626 type: "number", 30627 minimum: 1, 30628 maximum: 8 30629 }, 30630 caption: { 30631 type: "string", 30632 source: "html", 30633 selector: ".blocks-gallery-caption" 30634 }, 30635 imageCrop: { 30636 type: "boolean", 30637 default: true 30638 }, 30639 linkTo: { 30640 type: "string", 30641 default: "none" 30642 }, 30643 sizeSlug: { 30644 type: "string", 30645 default: "large" 30646 } 30647 }, 30648 supports: { 30649 align: true 30650 }, 30651 isEligible({ linkTo }) { 30652 return !linkTo || linkTo === "attachment" || linkTo === "media"; 30653 }, 30654 migrate(attributes2) { 30655 return runV2Migration(attributes2); 30656 }, 30657 save({ attributes: attributes2 }) { 30658 const { 30659 images, 30660 columns = defaultColumnsNumberV1(attributes2), 30661 imageCrop, 30662 caption, 30663 linkTo 30664 } = attributes2; 30665 return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)( 30666 "figure", 30667 { 30668 className: `columns-$columns} $imageCrop ? "is-cropped" : ""}`, 30669 children: [ 30670 /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("ul", { className: "blocks-gallery-grid", children: images.map((image) => { 30671 let href; 30672 switch (linkTo) { 30673 case "media": 30674 href = image.fullUrl || image.url; 30675 break; 30676 case "attachment": 30677 href = image.link; 30678 break; 30679 } 30680 const img = /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30681 "img", 30682 { 30683 src: image.url, 30684 alt: image.alt, 30685 "data-id": image.id, 30686 "data-full-url": image.fullUrl, 30687 "data-link": image.link, 30688 className: image.id ? `wp-image-$image.id}` : null 30689 } 30690 ); 30691 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30692 "li", 30693 { 30694 className: "blocks-gallery-item", 30695 children: /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)("figure", { children: [ 30696 href ? /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("a", { href, children: img }) : img, 30697 !import_block_editor83.RichText.isEmpty(image.caption) && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30698 import_block_editor83.RichText.Content, 30699 { 30700 tagName: "figcaption", 30701 className: "blocks-gallery-item__caption", 30702 value: image.caption 30703 } 30704 ) 30705 ] }) 30706 }, 30707 image.id || image.url 30708 ); 30709 }) }), 30710 !import_block_editor83.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30711 import_block_editor83.RichText.Content, 30712 { 30713 tagName: "figcaption", 30714 className: "blocks-gallery-caption", 30715 value: caption 30716 } 30717 ) 30718 ] 30719 } 30720 ); 30721 } 30722 }; 30723 var v42 = { 30724 attributes: { 30725 images: { 30726 type: "array", 30727 default: [], 30728 source: "query", 30729 selector: ".blocks-gallery-item", 30730 query: { 30731 url: { 30732 source: "attribute", 30733 selector: "img", 30734 attribute: "src" 30735 }, 30736 fullUrl: { 30737 source: "attribute", 30738 selector: "img", 30739 attribute: "data-full-url" 30740 }, 30741 link: { 30742 source: "attribute", 30743 selector: "img", 30744 attribute: "data-link" 30745 }, 30746 alt: { 30747 source: "attribute", 30748 selector: "img", 30749 attribute: "alt", 30750 default: "" 30751 }, 30752 id: { 30753 source: "attribute", 30754 selector: "img", 30755 attribute: "data-id" 30756 }, 30757 caption: { 30758 type: "string", 30759 source: "html", 30760 selector: ".blocks-gallery-item__caption" 30761 } 30762 } 30763 }, 30764 ids: { 30765 type: "array", 30766 default: [] 30767 }, 30768 columns: { 30769 type: "number" 30770 }, 30771 caption: { 30772 type: "string", 30773 source: "html", 30774 selector: ".blocks-gallery-caption" 30775 }, 30776 imageCrop: { 30777 type: "boolean", 30778 default: true 30779 }, 30780 linkTo: { 30781 type: "string", 30782 default: "none" 30783 } 30784 }, 30785 supports: { 30786 align: true 30787 }, 30788 isEligible({ ids }) { 30789 return ids && ids.some((id) => typeof id === "string"); 30790 }, 30791 migrate(attributes2) { 30792 return runV2Migration(attributes2); 30793 }, 30794 save({ attributes: attributes2 }) { 30795 const { 30796 images, 30797 columns = defaultColumnsNumberV1(attributes2), 30798 imageCrop, 30799 caption, 30800 linkTo 30801 } = attributes2; 30802 return /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)( 30803 "figure", 30804 { 30805 className: `columns-$columns} $imageCrop ? "is-cropped" : ""}`, 30806 children: [ 30807 /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("ul", { className: "blocks-gallery-grid", children: images.map((image) => { 30808 let href; 30809 switch (linkTo) { 30810 case "media": 30811 href = image.fullUrl || image.url; 30812 break; 30813 case "attachment": 30814 href = image.link; 30815 break; 30816 } 30817 const img = /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30818 "img", 30819 { 30820 src: image.url, 30821 alt: image.alt, 30822 "data-id": image.id, 30823 "data-full-url": image.fullUrl, 30824 "data-link": image.link, 30825 className: image.id ? `wp-image-$image.id}` : null 30826 } 30827 ); 30828 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30829 "li", 30830 { 30831 className: "blocks-gallery-item", 30832 children: /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)("figure", { children: [ 30833 href ? /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("a", { href, children: img }) : img, 30834 !import_block_editor83.RichText.isEmpty(image.caption) && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30835 import_block_editor83.RichText.Content, 30836 { 30837 tagName: "figcaption", 30838 className: "blocks-gallery-item__caption", 30839 value: image.caption 30840 } 30841 ) 30842 ] }) 30843 }, 30844 image.id || image.url 30845 ); 30846 }) }), 30847 !import_block_editor83.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30848 import_block_editor83.RichText.Content, 30849 { 30850 tagName: "figcaption", 30851 className: "blocks-gallery-caption", 30852 value: caption 30853 } 30854 ) 30855 ] 30856 } 30857 ); 30858 } 30859 }; 30860 var v34 = { 30861 attributes: { 30862 images: { 30863 type: "array", 30864 default: [], 30865 source: "query", 30866 selector: "ul.wp-block-gallery .blocks-gallery-item", 30867 query: { 30868 url: { 30869 source: "attribute", 30870 selector: "img", 30871 attribute: "src" 30872 }, 30873 fullUrl: { 30874 source: "attribute", 30875 selector: "img", 30876 attribute: "data-full-url" 30877 }, 30878 alt: { 30879 source: "attribute", 30880 selector: "img", 30881 attribute: "alt", 30882 default: "" 30883 }, 30884 id: { 30885 source: "attribute", 30886 selector: "img", 30887 attribute: "data-id" 30888 }, 30889 link: { 30890 source: "attribute", 30891 selector: "img", 30892 attribute: "data-link" 30893 }, 30894 caption: { 30895 type: "string", 30896 source: "html", 30897 selector: "figcaption" 30898 } 30899 } 30900 }, 30901 ids: { 30902 type: "array", 30903 default: [] 30904 }, 30905 columns: { 30906 type: "number" 30907 }, 30908 imageCrop: { 30909 type: "boolean", 30910 default: true 30911 }, 30912 linkTo: { 30913 type: "string", 30914 default: "none" 30915 } 30916 }, 30917 supports: { 30918 align: true 30919 }, 30920 save({ attributes: attributes2 }) { 30921 const { 30922 images, 30923 columns = defaultColumnsNumberV1(attributes2), 30924 imageCrop, 30925 linkTo 30926 } = attributes2; 30927 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30928 "ul", 30929 { 30930 className: `columns-$columns} $imageCrop ? "is-cropped" : ""}`, 30931 children: images.map((image) => { 30932 let href; 30933 switch (linkTo) { 30934 case "media": 30935 href = image.fullUrl || image.url; 30936 break; 30937 case "attachment": 30938 href = image.link; 30939 break; 30940 } 30941 const img = /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30942 "img", 30943 { 30944 src: image.url, 30945 alt: image.alt, 30946 "data-id": image.id, 30947 "data-full-url": image.fullUrl, 30948 "data-link": image.link, 30949 className: image.id ? `wp-image-$image.id}` : null 30950 } 30951 ); 30952 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30953 "li", 30954 { 30955 className: "blocks-gallery-item", 30956 children: /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)("figure", { children: [ 30957 href ? /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("a", { href, children: img }) : img, 30958 image.caption && image.caption.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 30959 import_block_editor83.RichText.Content, 30960 { 30961 tagName: "figcaption", 30962 value: image.caption 30963 } 30964 ) 30965 ] }) 30966 }, 30967 image.id || image.url 30968 ); 30969 }) 30970 } 30971 ); 30972 }, 30973 migrate(attributes2) { 30974 return runV2Migration(attributes2); 30975 } 30976 }; 30977 var v27 = { 30978 attributes: { 30979 images: { 30980 type: "array", 30981 default: [], 30982 source: "query", 30983 selector: "ul.wp-block-gallery .blocks-gallery-item", 30984 query: { 30985 url: { 30986 source: "attribute", 30987 selector: "img", 30988 attribute: "src" 30989 }, 30990 alt: { 30991 source: "attribute", 30992 selector: "img", 30993 attribute: "alt", 30994 default: "" 30995 }, 30996 id: { 30997 source: "attribute", 30998 selector: "img", 30999 attribute: "data-id" 31000 }, 31001 link: { 31002 source: "attribute", 31003 selector: "img", 31004 attribute: "data-link" 31005 }, 31006 caption: { 31007 type: "string", 31008 source: "html", 31009 selector: "figcaption" 31010 } 31011 } 31012 }, 31013 columns: { 31014 type: "number" 31015 }, 31016 imageCrop: { 31017 type: "boolean", 31018 default: true 31019 }, 31020 linkTo: { 31021 type: "string", 31022 default: "none" 31023 } 31024 }, 31025 isEligible({ images, ids }) { 31026 return images && images.length > 0 && (!ids && images || ids && images && ids.length !== images.length || images.some((id, index) => { 31027 if (!id && ids[index] !== null) { 31028 return true; 31029 } 31030 return parseInt(id, 10) !== ids[index]; 31031 })); 31032 }, 31033 migrate(attributes2) { 31034 return runV2Migration(attributes2); 31035 }, 31036 supports: { 31037 align: true 31038 }, 31039 save({ attributes: attributes2 }) { 31040 const { 31041 images, 31042 columns = defaultColumnsNumberV1(attributes2), 31043 imageCrop, 31044 linkTo 31045 } = attributes2; 31046 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 31047 "ul", 31048 { 31049 className: `columns-$columns} $imageCrop ? "is-cropped" : ""}`, 31050 children: images.map((image) => { 31051 let href; 31052 switch (linkTo) { 31053 case "media": 31054 href = image.url; 31055 break; 31056 case "attachment": 31057 href = image.link; 31058 break; 31059 } 31060 const img = /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 31061 "img", 31062 { 31063 src: image.url, 31064 alt: image.alt, 31065 "data-id": image.id, 31066 "data-link": image.link, 31067 className: image.id ? `wp-image-$image.id}` : null 31068 } 31069 ); 31070 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 31071 "li", 31072 { 31073 className: "blocks-gallery-item", 31074 children: /* @__PURE__ */ (0, import_jsx_runtime285.jsxs)("figure", { children: [ 31075 href ? /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("a", { href, children: img }) : img, 31076 image.caption && image.caption.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 31077 import_block_editor83.RichText.Content, 31078 { 31079 tagName: "figcaption", 31080 value: image.caption 31081 } 31082 ) 31083 ] }) 31084 }, 31085 image.id || image.url 31086 ); 31087 }) 31088 } 31089 ); 31090 } 31091 }; 31092 var v116 = { 31093 attributes: { 31094 images: { 31095 type: "array", 31096 default: [], 31097 source: "query", 31098 selector: "div.wp-block-gallery figure.blocks-gallery-image img", 31099 query: { 31100 url: { 31101 source: "attribute", 31102 attribute: "src" 31103 }, 31104 alt: { 31105 source: "attribute", 31106 attribute: "alt", 31107 default: "" 31108 }, 31109 id: { 31110 source: "attribute", 31111 attribute: "data-id" 31112 } 31113 } 31114 }, 31115 columns: { 31116 type: "number" 31117 }, 31118 imageCrop: { 31119 type: "boolean", 31120 default: true 31121 }, 31122 linkTo: { 31123 type: "string", 31124 default: "none" 31125 }, 31126 align: { 31127 type: "string", 31128 default: "none" 31129 } 31130 }, 31131 supports: { 31132 align: true 31133 }, 31134 save({ attributes: attributes2 }) { 31135 const { 31136 images, 31137 columns = defaultColumnsNumberV1(attributes2), 31138 align, 31139 imageCrop, 31140 linkTo 31141 } = attributes2; 31142 const className = clsx_default(`columns-$columns}`, { 31143 alignnone: align === "none", 31144 "is-cropped": imageCrop 31145 }); 31146 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("div", { className, children: images.map((image) => { 31147 let href; 31148 switch (linkTo) { 31149 case "media": 31150 href = image.url; 31151 break; 31152 case "attachment": 31153 href = image.link; 31154 break; 31155 } 31156 const img = /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 31157 "img", 31158 { 31159 src: image.url, 31160 alt: image.alt, 31161 "data-id": image.id 31162 } 31163 ); 31164 return /* @__PURE__ */ (0, import_jsx_runtime285.jsx)( 31165 "figure", 31166 { 31167 className: "blocks-gallery-image", 31168 children: href ? /* @__PURE__ */ (0, import_jsx_runtime285.jsx)("a", { href, children: img }) : img 31169 }, 31170 image.id || image.url 31171 ); 31172 }) }); 31173 }, 31174 migrate(attributes2) { 31175 return runV2Migration(attributes2); 31176 } 31177 }; 31178 var deprecated_default17 = [v72, v62, v52, v42, v34, v27, v116]; 31179 31180 // packages/block-library/build-module/gallery/edit.mjs 31181 var import_components43 = __toESM(require_components(), 1); 31182 var import_block_editor88 = __toESM(require_block_editor(), 1); 31183 var import_element60 = __toESM(require_element(), 1); 31184 var import_i18n75 = __toESM(require_i18n(), 1); 31185 var import_data37 = __toESM(require_data(), 1); 31186 var import_blocks31 = __toESM(require_blocks(), 1); 31187 var import_blob10 = __toESM(require_blob(), 1); 31188 var import_notices6 = __toESM(require_notices(), 1); 31189 31190 // packages/block-library/build-module/gallery/shared-icon.mjs 31191 var import_block_editor84 = __toESM(require_block_editor(), 1); 31192 var import_jsx_runtime286 = __toESM(require_jsx_runtime(), 1); 31193 var sharedIcon = /* @__PURE__ */ (0, import_jsx_runtime286.jsx)(import_block_editor84.BlockIcon, { icon: gallery_default }); 31194 31195 // packages/block-library/build-module/gallery/shared.mjs 31196 function defaultColumnsNumber(imageCount) { 31197 return imageCount ? Math.min(3, imageCount) : 3; 31198 } 31199 function isObject(value) { 31200 return !!value && typeof value === "object" && !Array.isArray(value); 31201 } 31202 function isGalleryFlexLayout(layout) { 31203 const layoutType = isObject(layout) ? layout.type : void 0; 31204 return typeof layoutType !== "string" || layoutType === "" || layoutType === "flex"; 31205 } 31206 var pickRelevantMediaFiles = (image, sizeSlug = "large") => { 31207 const imageProps = Object.fromEntries( 31208 Object.entries(image ?? {}).filter( 31209 ([key]) => ["alt", "id", "link"].includes(key) 31210 ) 31211 ); 31212 imageProps.url = image?.sizes?.[sizeSlug]?.url || image?.media_details?.sizes?.[sizeSlug]?.source_url || image?.url || image?.source_url; 31213 const fullUrl = image?.sizes?.full?.url || image?.media_details?.sizes?.full?.source_url; 31214 if (fullUrl) { 31215 imageProps.fullUrl = fullUrl; 31216 } 31217 return imageProps; 31218 }; 31219 31220 // packages/block-library/build-module/image/constants.mjs 31221 var MIN_SIZE2 = 20; 31222 var LINK_DESTINATION_NONE2 = "none"; 31223 var LINK_DESTINATION_MEDIA2 = "media"; 31224 var LINK_DESTINATION_ATTACHMENT2 = "attachment"; 31225 var LINK_DESTINATION_CUSTOM = "custom"; 31226 var NEW_TAB_REL2 = ["noopener"]; 31227 var ALLOWED_MEDIA_TYPES3 = ["image"]; 31228 var SIZED_LAYOUTS = ["flex", "grid"]; 31229 var DEFAULT_MEDIA_SIZE_SLUG3 = "full"; 31230 31231 // packages/block-library/build-module/gallery/utils.mjs 31232 function getHrefAndDestination2(image, galleryDestination, imageDestination, attributes2, lightboxSetting) { 31233 switch (imageDestination ? imageDestination : galleryDestination) { 31234 case LINK_DESTINATION_MEDIA_WP_CORE: 31235 case LINK_DESTINATION_MEDIA: 31236 return { 31237 href: image?.source_url || image?.url, 31238 linkDestination: LINK_DESTINATION_MEDIA2, 31239 lightbox: lightboxSetting?.enabled ? { ...attributes2?.lightbox, enabled: false } : void 0 31240 }; 31241 case LINK_DESTINATION_ATTACHMENT_WP_CORE: 31242 case LINK_DESTINATION_ATTACHMENT: 31243 return { 31244 href: image?.link, 31245 linkDestination: LINK_DESTINATION_ATTACHMENT2, 31246 lightbox: lightboxSetting?.enabled ? { ...attributes2?.lightbox, enabled: false } : void 0 31247 }; 31248 case LINK_DESTINATION_LIGHTBOX: 31249 return { 31250 href: void 0, 31251 lightbox: !lightboxSetting?.enabled ? { ...attributes2?.lightbox, enabled: true } : void 0, 31252 linkDestination: LINK_DESTINATION_NONE2 31253 }; 31254 case LINK_DESTINATION_NONE: 31255 return { 31256 href: void 0, 31257 linkDestination: LINK_DESTINATION_NONE2, 31258 lightbox: void 0 31259 }; 31260 } 31261 return {}; 31262 } 31263 31264 // packages/block-library/build-module/image/utils.mjs 31265 function evalAspectRatio(value) { 31266 const [width, height = 1] = value.split("/").map(Number); 31267 const aspectRatio = width / height; 31268 return aspectRatio === Infinity || aspectRatio === 0 ? NaN : aspectRatio; 31269 } 31270 function removeNewTabRel(currentRel) { 31271 let newRel = currentRel; 31272 if (currentRel !== void 0 && newRel) { 31273 NEW_TAB_REL2.forEach((relVal) => { 31274 const regExp = new RegExp("\\b" + relVal + "\\b", "gi"); 31275 newRel = newRel.replace(regExp, ""); 31276 }); 31277 if (newRel !== currentRel) { 31278 newRel = newRel.trim(); 31279 } 31280 if (!newRel) { 31281 newRel = void 0; 31282 } 31283 } 31284 return newRel; 31285 } 31286 function getUpdatedLinkTargetSettings(value, { rel }) { 31287 const linkTarget = value ? "_blank" : void 0; 31288 let updatedRel; 31289 if (!linkTarget && !rel) { 31290 updatedRel = void 0; 31291 } else { 31292 updatedRel = removeNewTabRel(rel); 31293 } 31294 return { 31295 linkTarget, 31296 rel: updatedRel 31297 }; 31298 } 31299 function getImageSizeAttributes(image, size) { 31300 const url = image?.media_details?.sizes?.[size]?.source_url; 31301 if (url) { 31302 return { url, width: void 0, height: void 0, sizeSlug: size }; 31303 } 31304 return {}; 31305 } 31306 function isValidFileType(file) { 31307 return ALLOWED_MEDIA_TYPES3.some( 31308 (mediaType) => file.type.indexOf(mediaType) === 0 31309 ); 31310 } 31311 function mediaPosition2({ x: x3, y: y2 } = { x: 0.5, y: 0.5 }) { 31312 return `$Math.round(x3 * 100)}% $Math.round(y2 * 100)}%`; 31313 } 31314 31315 // packages/block-library/build-module/gallery/gallery.mjs 31316 var import_i18n72 = __toESM(require_i18n(), 1); 31317 var import_jsx_runtime287 = __toESM(require_jsx_runtime(), 1); 31318 function Gallery(props) { 31319 const { 31320 attributes: attributes2, 31321 isSelected, 31322 setAttributes, 31323 insertBlocksAfter, 31324 blockProps, 31325 __unstableLayoutClassNames: layoutClassNames, 31326 isContentLocked, 31327 multiGallerySelection 31328 } = props; 31329 const { align, columns, imageCrop, layout } = attributes2; 31330 const isFlexLayout = isGalleryFlexLayout(layout); 31331 return /* @__PURE__ */ (0, import_jsx_runtime287.jsxs)( 31332 "figure", 31333 { 31334 ...blockProps, 31335 className: clsx_default( 31336 blockProps.className, 31337 layoutClassNames, 31338 "blocks-gallery-grid", 31339 { 31340 [`align$align}`]: align, 31341 [`columns-$columns}`]: isFlexLayout && columns !== void 0, 31342 [`columns-default`]: isFlexLayout && columns === void 0, 31343 "is-cropped": isFlexLayout && imageCrop 31344 } 31345 ), 31346 children: [ 31347 blockProps.children, 31348 /* @__PURE__ */ (0, import_jsx_runtime287.jsx)( 31349 Caption, 31350 { 31351 attributes: attributes2, 31352 setAttributes, 31353 isSelected, 31354 insertBlocksAfter, 31355 showToolbarButton: !multiGallerySelection && !isContentLocked, 31356 className: "blocks-gallery-caption", 31357 label: (0, import_i18n72.__)("Gallery caption text"), 31358 placeholder: (0, import_i18n72.__)("Add gallery caption") 31359 } 31360 ) 31361 ] 31362 } 31363 ); 31364 } 31365 31366 // packages/block-library/build-module/gallery/use-image-sizes.mjs 31367 var import_element56 = __toESM(require_element(), 1); 31368 function useImageSizes(images, isSelected, getSettings2) { 31369 return (0, import_element56.useMemo)(() => getImageSizing(), [images, isSelected]); 31370 function getImageSizing() { 31371 if (!images || images.length === 0) { 31372 return; 31373 } 31374 const { imageSizes } = getSettings2(); 31375 let resizedImages = {}; 31376 if (isSelected) { 31377 resizedImages = images.reduce((currentResizedImages, img) => { 31378 if (!img.id) { 31379 return currentResizedImages; 31380 } 31381 const sizes = imageSizes.reduce((currentSizes, size) => { 31382 const defaultUrl = img.sizes?.[size.slug]?.url; 31383 const mediaDetailsUrl = img.media_details?.sizes?.[size.slug]?.source_url; 31384 return { 31385 ...currentSizes, 31386 [size.slug]: defaultUrl || mediaDetailsUrl 31387 }; 31388 }, {}); 31389 return { 31390 ...currentResizedImages, 31391 [parseInt(img.id, 10)]: sizes 31392 }; 31393 }, {}); 31394 } 31395 const resizedImageSizes = Object.values(resizedImages); 31396 return imageSizes.filter( 31397 ({ slug }) => resizedImageSizes.some((sizes) => sizes[slug]) 31398 ).map(({ name: name118, slug }) => ({ value: slug, label: name118 })); 31399 } 31400 } 31401 31402 // packages/block-library/build-module/gallery/use-get-new-images.mjs 31403 var import_element57 = __toESM(require_element(), 1); 31404 function useGetNewImages(images, imageData) { 31405 const [currentImages, setCurrentImages] = (0, import_element57.useState)([]); 31406 return (0, import_element57.useMemo)(() => getNewImages(), [images, imageData]); 31407 function getNewImages() { 31408 let imagesUpdated = false; 31409 const newCurrentImages = currentImages.filter( 31410 (currentImg) => images.find((img) => { 31411 return currentImg.clientId === img.clientId; 31412 }) 31413 ); 31414 if (newCurrentImages.length < currentImages.length) { 31415 imagesUpdated = true; 31416 } 31417 images.forEach((image) => { 31418 if (image.fromSavedContent && !newCurrentImages.find( 31419 (currentImage) => currentImage.id === image.id 31420 )) { 31421 imagesUpdated = true; 31422 newCurrentImages.push(image); 31423 } 31424 }); 31425 const newImages = images.filter( 31426 (image) => !newCurrentImages.find( 31427 (currentImage) => image.clientId && currentImage.clientId === image.clientId 31428 ) && imageData?.find((img) => img.id === image.id) && !image.fromSavedContent 31429 ); 31430 if (imagesUpdated || newImages?.length > 0) { 31431 setCurrentImages([...newCurrentImages, ...newImages]); 31432 } 31433 return newImages.length > 0 ? newImages : null; 31434 } 31435 } 31436 31437 // packages/block-library/build-module/gallery/use-get-media.mjs 31438 var import_data34 = __toESM(require_data(), 1); 31439 var import_core_data20 = __toESM(require_core_data(), 1); 31440 var EMPTY_IMAGE_MEDIA = []; 31441 function useGetMedia(innerBlockImages) { 31442 return (0, import_data34.useSelect)( 31443 (select10) => { 31444 const imageIds = innerBlockImages.map((imageBlock) => imageBlock.attributes.id).filter((id) => id !== void 0); 31445 if (imageIds.length === 0) { 31446 return EMPTY_IMAGE_MEDIA; 31447 } 31448 return select10(import_core_data20.store).getEntityRecords( 31449 "postType", 31450 "attachment", 31451 { 31452 include: imageIds.join(","), 31453 per_page: -1, 31454 orderby: "include" 31455 } 31456 ) ?? EMPTY_IMAGE_MEDIA; 31457 }, 31458 [innerBlockImages] 31459 ); 31460 } 31461 31462 // packages/block-library/build-module/gallery/flex-styles.mjs 31463 var import_block_editor85 = __toESM(require_block_editor(), 1); 31464 var import_data35 = __toESM(require_data(), 1); 31465 31466 // packages/global-styles-engine/build-module/utils/object.mjs 31467 var getValueFromObjectPath = (object, path, defaultValue) => { 31468 const arrayPath = Array.isArray(path) ? path : path.split("."); 31469 let value = object; 31470 arrayPath.forEach((fieldName) => { 31471 value = value?.[fieldName]; 31472 }); 31473 return value ?? defaultValue; 31474 }; 31475 31476 // packages/global-styles-engine/build-module/utils/common.mjs 31477 var import_style_engine = __toESM(require_style_engine(), 1); 31478 function getResolvedRefValue(ruleValue, tree) { 31479 if (!ruleValue || !tree) { 31480 return ruleValue; 31481 } 31482 if (typeof ruleValue === "object" && "ref" in ruleValue && ruleValue?.ref) { 31483 const resolvedRuleValue = (0, import_style_engine.getCSSValueFromRawStyle)( 31484 getValueFromObjectPath(tree, ruleValue.ref) 31485 ); 31486 if (typeof resolvedRuleValue === "object" && resolvedRuleValue !== null && "ref" in resolvedRuleValue && resolvedRuleValue?.ref) { 31487 return void 0; 31488 } 31489 if (resolvedRuleValue === void 0) { 31490 return ruleValue; 31491 } 31492 return resolvedRuleValue; 31493 } 31494 return ruleValue; 31495 } 31496 function getResolvedThemeFilePath(file, themeFileURIs) { 31497 if (!file || !themeFileURIs || !Array.isArray(themeFileURIs)) { 31498 return file; 31499 } 31500 const uri = themeFileURIs.find( 31501 (themeFileUri) => themeFileUri?.name === file 31502 ); 31503 if (!uri?.href) { 31504 return file; 31505 } 31506 return uri?.href; 31507 } 31508 function getResolvedValue(ruleValue, tree) { 31509 if (!ruleValue || !tree) { 31510 return ruleValue; 31511 } 31512 const resolvedValue = getResolvedRefValue(ruleValue, tree); 31513 if (typeof resolvedValue === "object" && resolvedValue !== null && "url" in resolvedValue && resolvedValue?.url) { 31514 return { 31515 ...resolvedValue, 31516 url: getResolvedThemeFilePath( 31517 resolvedValue.url, 31518 tree?._links?.["wp:theme-file"] 31519 ) 31520 }; 31521 } 31522 return resolvedValue; 31523 } 31524 31525 // packages/global-styles-engine/build-module/utils/duotone.mjs 31526 function getValuesFromColors(colors = []) { 31527 const values = { 31528 r: [], 31529 g: [], 31530 b: [], 31531 a: [] 31532 }; 31533 colors.forEach((color) => { 31534 const rgbColor = w(color).toRgb(); 31535 values.r.push(rgbColor.r / 255); 31536 values.g.push(rgbColor.g / 255); 31537 values.b.push(rgbColor.b / 255); 31538 values.a.push(rgbColor.a); 31539 }); 31540 return values; 31541 } 31542 function getDuotoneUnsetStylesheet(selector) { 31543 return `$selector}{filter:none}`; 31544 } 31545 function getDuotoneStylesheet(selector, id) { 31546 return `$selector}{filter:url(#$id})}`; 31547 } 31548 function getDuotoneFilter(id, colors) { 31549 const values = getValuesFromColors(colors); 31550 return ` 31551 <svg 31552 xmlns:xlink="http://www.w3.org/1999/xlink" 31553 viewBox="0 0 0 0" 31554 width="0" 31555 height="0" 31556 focusable="false" 31557 role="none" 31558 aria-hidden="true" 31559 style="visibility: hidden; position: absolute; left: -9999px; overflow: hidden;" 31560 > 31561 <defs> 31562 <filter id="$id}"> 31563 <!-- 31564 Use sRGB instead of linearRGB so transparency looks correct. 31565 Use perceptual brightness to convert to grayscale. 31566 --> 31567 <feColorMatrix color-interpolation-filters="sRGB" type="matrix" values=" .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 .299 .587 .114 0 0 "></feColorMatrix> 31568 <!-- Use sRGB instead of linearRGB to be consistent with how CSS gradients work. --> 31569 <feComponentTransfer color-interpolation-filters="sRGB"> 31570 <feFuncR type="table" tableValues="$values.r.join(" ")}"></feFuncR> 31571 <feFuncG type="table" tableValues="$values.g.join(" ")}"></feFuncG> 31572 <feFuncB type="table" tableValues="$values.b.join(" ")}"></feFuncB> 31573 <feFuncA type="table" tableValues="$values.a.join(" ")}"></feFuncA> 31574 </feComponentTransfer> 31575 <!-- Re-mask the image with the original transparency since the feColorMatrix above loses that information. --> 31576 <feComposite in2="SourceGraphic" operator="in"></feComposite> 31577 </filter> 31578 </defs> 31579 </svg>`; 31580 } 31581 31582 // packages/global-styles-engine/build-module/utils/viewport.mjs 31583 var DEFAULT_VIEWPORT_BREAKPOINTS = { 31584 mobile: "480px", 31585 tablet: "782px" 31586 }; 31587 var VIEWPORT_SIZE_REGEXP = /^(\d+|\d*\.\d+)(px|em|rem)$/; 31588 var DEFAULT_FONT_SIZE = 16; 31589 function isViewportSettings(configOrSettings) { 31590 return "mobile" in configOrSettings || "tablet" in configOrSettings; 31591 } 31592 function getViewportSettings(configOrSettings) { 31593 if (!configOrSettings || typeof configOrSettings !== "object") { 31594 return {}; 31595 } 31596 if (isViewportSettings(configOrSettings)) { 31597 return configOrSettings; 31598 } 31599 return configOrSettings.settings?.viewport ?? {}; 31600 } 31601 function isValidViewportSize(value) { 31602 return typeof value === "string" && VIEWPORT_SIZE_REGEXP.test(value.trim()); 31603 } 31604 function getViewportBreakpointValueInPixels(value) { 31605 if (typeof value === "number") { 31606 return value; 31607 } 31608 if (typeof value !== "string") { 31609 return void 0; 31610 } 31611 const match = value.trim().match(VIEWPORT_SIZE_REGEXP); 31612 if (!match) { 31613 return void 0; 31614 } 31615 const numericValue = Number.parseFloat(match[1]); 31616 const unit = match[2]; 31617 return unit === "px" ? numericValue : numericValue * DEFAULT_FONT_SIZE; 31618 } 31619 function getViewportBreakpoints(configOrSettings) { 31620 const viewportSettings = getViewportSettings(configOrSettings); 31621 const breakpoints = {}; 31622 const breakpointValuesInPixels = {}; 31623 Object.keys(DEFAULT_VIEWPORT_BREAKPOINTS).forEach((breakpoint) => { 31624 const key = breakpoint; 31625 const value = viewportSettings[key]; 31626 const px = getViewportBreakpointValueInPixels(value); 31627 if (px !== void 0 && isValidViewportSize(value)) { 31628 breakpoints[key] = value.trim(); 31629 breakpointValuesInPixels[key] = px; 31630 } 31631 }); 31632 const breakpointNames = Object.keys(breakpoints); 31633 if (!breakpointNames.length) { 31634 return { ...DEFAULT_VIEWPORT_BREAKPOINTS }; 31635 } 31636 if (1 === breakpointNames.length) { 31637 return breakpoints; 31638 } 31639 const mobile = breakpoints.mobile; 31640 const tablet = breakpoints.tablet; 31641 if (breakpointValuesInPixels.mobile >= breakpointValuesInPixels.tablet) { 31642 return { mobile }; 31643 } 31644 return { mobile, tablet }; 31645 } 31646 function getResponsiveMediaQueries(configOrSettings) { 31647 const breakpoints = getViewportBreakpoints(configOrSettings); 31648 const mediaQueries = {}; 31649 if (breakpoints.mobile) { 31650 mediaQueries["@mobile"] = `@media (width <= $breakpoints.mobile})`; 31651 } 31652 if (breakpoints.tablet) { 31653 mediaQueries["@tablet"] = breakpoints.mobile ? `@media ($breakpoints.mobile} < width <= $breakpoints.tablet})` : `@media (width <= $breakpoints.tablet})`; 31654 } 31655 return mediaQueries; 31656 } 31657 31658 // packages/global-styles-engine/build-module/variation.mjs 31659 function getVariationStyle(globalStyles, name118, variation, { resolveRefs = true } = {}) { 31660 if (!globalStyles?.styles?.blocks?.[name118]?.variations?.[variation]) { 31661 return void 0; 31662 } 31663 const replaceRefs = (variationStyles) => { 31664 Object.keys(variationStyles).forEach((key) => { 31665 const value = variationStyles[key]; 31666 if (typeof value === "object" && value !== null) { 31667 if (value.ref !== void 0) { 31668 if (typeof value.ref !== "string" || value.ref.trim() === "") { 31669 delete variationStyles[key]; 31670 } else { 31671 const refValue = getValueFromObjectPath( 31672 globalStyles, 31673 value.ref 31674 ); 31675 if (refValue !== void 0 && refValue !== null) { 31676 variationStyles[key] = refValue; 31677 } else { 31678 delete variationStyles[key]; 31679 } 31680 } 31681 } else { 31682 replaceRefs(value); 31683 if (Object.keys(value).length === 0) { 31684 delete variationStyles[key]; 31685 } 31686 } 31687 } 31688 }); 31689 }; 31690 const styles = JSON.parse( 31691 JSON.stringify( 31692 globalStyles.styles.blocks[name118].variations[variation] 31693 ) 31694 ); 31695 if (resolveRefs) { 31696 replaceRefs(styles); 31697 } 31698 return styles; 31699 } 31700 31701 // packages/global-styles-engine/build-module/resolve-style.mjs 31702 var DEFAULT_STATE_VALUE = "default"; 31703 function isDefaultBlockStyleState2(selectedState) { 31704 const viewport = selectedState?.viewport; 31705 const pseudoState = selectedState?.pseudoState; 31706 return (!viewport || viewport === DEFAULT_STATE_VALUE) && (!pseudoState || pseudoState === DEFAULT_STATE_VALUE); 31707 } 31708 function getStyleStatePath(selectedState) { 31709 if (isDefaultBlockStyleState2(selectedState)) { 31710 return []; 31711 } 31712 return [selectedState.viewport, selectedState.pseudoState].filter( 31713 (state) => !!state && state !== DEFAULT_STATE_VALUE 31714 ); 31715 } 31716 function getStyleForState2(style2, selectedState) { 31717 const path = getStyleStatePath(selectedState); 31718 if (!path.length) { 31719 return style2; 31720 } 31721 return getValueFromObjectPath(style2, path); 31722 } 31723 var TREE_STRUCTURAL_KEYS = /* @__PURE__ */ new Set(["blocks", "variations", "css"]); 31724 var EMPTY_INHERITANCE = Object.freeze({ 31725 value: {}, 31726 sources: {} 31727 }); 31728 var SOURCE_DESCRIPTORS = { 31729 root: { layer: "root" }, 31730 element: { layer: "element" }, 31731 block: { layer: "block" }, 31732 blockVariation: { layer: "blockVariation" } 31733 }; 31734 function createSourceDescriptor(type) { 31735 const descriptor = SOURCE_DESCRIPTORS[type]; 31736 if (!descriptor) { 31737 return null; 31738 } 31739 return { ...descriptor }; 31740 } 31741 function createContribution(styles, source) { 31742 if (!styles || !source) { 31743 return null; 31744 } 31745 return { styles, source }; 31746 } 31747 function getPathKey(path) { 31748 return path.join("."); 31749 } 31750 function getSourceForPath(source) { 31751 return { ...source }; 31752 } 31753 function isExplicitEmpty(value) { 31754 if (value === "" || value === null) { 31755 return true; 31756 } 31757 if (typeof value === "object" && !Array.isArray(value) && Object.keys(value).length === 0) { 31758 return true; 31759 } 31760 return false; 31761 } 31762 function isRefObject(value) { 31763 return value !== null && typeof value === "object" && !Array.isArray(value) && typeof value.ref === "string"; 31764 } 31765 function pickLayerRootContribution(layer) { 31766 if (!layer || typeof layer !== "object" || Array.isArray(layer)) { 31767 return null; 31768 } 31769 const contribution = {}; 31770 for (const key of Object.keys(layer)) { 31771 if (TREE_STRUCTURAL_KEYS.has(key)) { 31772 continue; 31773 } 31774 if (key === "elements") { 31775 if (layer.elements && typeof layer.elements === "object") { 31776 contribution.elements = layer.elements; 31777 } 31778 continue; 31779 } 31780 if (isExplicitEmpty(layer[key])) { 31781 continue; 31782 } 31783 contribution[key] = layer[key]; 31784 } 31785 return Object.keys(contribution).length === 0 ? null : contribution; 31786 } 31787 var ATOMIC_OBJECT_KEYS = /* @__PURE__ */ new Set(["backgroundImage"]); 31788 function deepMergeDroppingEmpties(target, source, globalStyles, sourceMetadata, sources, path = []) { 31789 if (!source || typeof source !== "object" || Array.isArray(source)) { 31790 return target; 31791 } 31792 for (const key of Object.keys(source)) { 31793 let sourceValue = source[key]; 31794 if (isExplicitEmpty(sourceValue)) { 31795 continue; 31796 } 31797 if (isRefObject(sourceValue)) { 31798 if (sourceValue.ref.trim() === "") { 31799 continue; 31800 } 31801 const resolved = getValueFromObjectPath( 31802 globalStyles, 31803 sourceValue.ref 31804 ); 31805 if (resolved === void 0 || resolved === null || isRefObject(resolved)) { 31806 continue; 31807 } 31808 sourceValue = resolved; 31809 } 31810 const nextPath = [...path, key]; 31811 if (!ATOMIC_OBJECT_KEYS.has(key) && sourceValue !== null && typeof sourceValue === "object" && !Array.isArray(sourceValue) && !isRefObject(sourceValue)) { 31812 const existing = target[key] && typeof target[key] === "object" && !Array.isArray(target[key]) ? target[key] : {}; 31813 target[key] = deepMergeDroppingEmpties( 31814 { ...existing }, 31815 sourceValue, 31816 globalStyles, 31817 sourceMetadata, 31818 sources, 31819 nextPath 31820 ); 31821 } else { 31822 target[key] = ATOMIC_OBJECT_KEYS.has(key) && sourceValue !== null && typeof sourceValue === "object" && !Array.isArray(sourceValue) ? { ...sourceValue } : sourceValue; 31823 if (sourceMetadata && sources) { 31824 sources[getPathKey(nextPath)] = getSourceForPath(sourceMetadata); 31825 } 31826 } 31827 } 31828 return target; 31829 } 31830 function getStateSlice(layerObject, selectedState) { 31831 if (!layerObject) { 31832 return null; 31833 } 31834 const slice = getStyleForState2(layerObject, selectedState); 31835 return slice && typeof slice === "object" && !Array.isArray(slice) ? slice : null; 31836 } 31837 var NON_CASCADING_ROOT_PREFIXES = [ 31838 "color.background", 31839 "color.gradient", 31840 "background", 31841 "spacing", 31842 "dimensions", 31843 "border", 31844 "shadow", 31845 "filter" 31846 ]; 31847 function isNonCascadingRootPath(pathKey) { 31848 if (pathKey.startsWith("elements.")) { 31849 return false; 31850 } 31851 return NON_CASCADING_ROOT_PREFIXES.some( 31852 (prefix) => pathKey === prefix || pathKey.startsWith(`$prefix}.`) 31853 ); 31854 } 31855 function deleteAtPath(target, pathSegments) { 31856 if (!target || typeof target !== "object") { 31857 return; 31858 } 31859 const [head, ...rest] = pathSegments; 31860 if (rest.length === 0) { 31861 delete target[head]; 31862 return; 31863 } 31864 const child = target[head]; 31865 if (child && typeof child === "object") { 31866 deleteAtPath(child, rest); 31867 if (Object.keys(child).length === 0) { 31868 delete target[head]; 31869 } 31870 } 31871 } 31872 function dropNonCascadingRootLeaves(value, sources) { 31873 for (const pathKey of Object.keys(sources)) { 31874 if (sources[pathKey].layer === "root" && isNonCascadingRootPath(pathKey)) { 31875 deleteAtPath(value, pathKey.split(".")); 31876 delete sources[pathKey]; 31877 } 31878 } 31879 } 31880 function resolveThemeFileBackgroundImage(value, globalStyles, links) { 31881 const image = value?.background?.backgroundImage; 31882 if (!image) { 31883 return; 31884 } 31885 const resolved = getResolvedValue(image, { 31886 ...globalStyles, 31887 _links: links ?? void 0 31888 }); 31889 if (resolved !== void 0) { 31890 value.background.backgroundImage = resolved; 31891 } 31892 } 31893 function computeResolvedStyle(globalStyles, { 31894 blockName, 31895 variationName = null, 31896 elements = null, 31897 viewport = null, 31898 pseudoState = null 31899 } = {}) { 31900 if (!globalStyles || !globalStyles.styles) { 31901 return EMPTY_INHERITANCE; 31902 } 31903 if (!blockName) { 31904 return EMPTY_INHERITANCE; 31905 } 31906 const styles = globalStyles.styles; 31907 const selectedState = { viewport, pseudoState }; 31908 const root = styles; 31909 const block = styles.blocks?.[blockName] ?? null; 31910 const elementLayers = (elements ?? []).map((elementName) => styles.elements?.[elementName] ?? null).filter((layer) => !!layer); 31911 const variation = variationName ? getVariationStyle(globalStyles, blockName, variationName) ?? null : null; 31912 const contributions = [ 31913 createContribution( 31914 pickLayerRootContribution(root), 31915 createSourceDescriptor("root") 31916 ), 31917 ...elementLayers.map( 31918 (layer) => createContribution( 31919 pickLayerRootContribution(layer), 31920 createSourceDescriptor("element") 31921 ) 31922 ), 31923 block ? createContribution( 31924 pickLayerRootContribution(block), 31925 createSourceDescriptor("block") 31926 ) : null, 31927 variation ? createContribution( 31928 pickLayerRootContribution(variation), 31929 createSourceDescriptor("blockVariation") 31930 ) : null 31931 ]; 31932 if (!isDefaultBlockStyleState2(selectedState)) { 31933 contributions.push( 31934 createContribution( 31935 pickLayerRootContribution( 31936 getStateSlice(root, selectedState) 31937 ), 31938 createSourceDescriptor("root") 31939 ), 31940 ...elementLayers.map( 31941 (layer) => createContribution( 31942 pickLayerRootContribution( 31943 getStateSlice(layer, selectedState) 31944 ), 31945 createSourceDescriptor("element") 31946 ) 31947 ), 31948 block ? createContribution( 31949 pickLayerRootContribution( 31950 getStateSlice(block, selectedState) 31951 ), 31952 createSourceDescriptor("block") 31953 ) : null, 31954 variation ? createContribution( 31955 pickLayerRootContribution( 31956 getStateSlice(variation, selectedState) 31957 ), 31958 createSourceDescriptor("blockVariation") 31959 ) : null 31960 ); 31961 } 31962 const filteredContributions = contributions.filter( 31963 Boolean 31964 ); 31965 if (filteredContributions.length === 0) { 31966 return EMPTY_INHERITANCE; 31967 } 31968 const sources = {}; 31969 const value = filteredContributions.reduce( 31970 (mergedValue, contribution) => deepMergeDroppingEmpties( 31971 mergedValue, 31972 contribution.styles, 31973 globalStyles, 31974 contribution.source, 31975 sources 31976 ), 31977 {} 31978 ); 31979 dropNonCascadingRootLeaves(value, sources); 31980 resolveThemeFileBackgroundImage( 31981 value, 31982 globalStyles, 31983 globalStyles._links ?? null 31984 ); 31985 return { value, sources }; 31986 } 31987 var NO_LINKS = {}; 31988 var memo2 = /* @__PURE__ */ new WeakMap(); 31989 function resolveStyle2(globalStyles, context = {}) { 31990 const styleData = globalStyles?.styles; 31991 if (!styleData || typeof styleData !== "object") { 31992 return computeResolvedStyle(globalStyles, context); 31993 } 31994 let byLinks = memo2.get(styleData); 31995 if (!byLinks) { 31996 byLinks = /* @__PURE__ */ new WeakMap(); 31997 memo2.set(styleData, byLinks); 31998 } 31999 const linksKey = globalStyles?._links ?? NO_LINKS; 32000 let inner = byLinks.get(linksKey); 32001 if (!inner) { 32002 inner = /* @__PURE__ */ new Map(); 32003 byLinks.set(linksKey, inner); 32004 } 32005 const sliceKey = `$context.elements?.join(",") ?? ""}:$context.viewport ?? ""}:$context.pseudoState ?? ""}`; 32006 const key = (context.blockName || "") + "" + (context.variationName || "") + "" + sliceKey; 32007 if (inner.has(key)) { 32008 return inner.get(key); 32009 } 32010 const result = computeResolvedStyle(globalStyles, context); 32011 inner.set(key, result); 32012 return result; 32013 } 32014 32015 // packages/global-styles-engine/build-module/lock-unlock.mjs 32016 var import_private_apis2 = __toESM(require_private_apis(), 1); 32017 var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 32018 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 32019 "@wordpress/global-styles-engine" 32020 ); 32021 32022 // packages/global-styles-engine/build-module/private-apis.mjs 32023 var privateApis = {}; 32024 lock2(privateApis, { 32025 getResponsiveMediaQueries, 32026 getViewportBreakpoints, 32027 getViewportBreakpointValueInPixels, 32028 getDuotoneFilter, 32029 getDuotoneStylesheet, 32030 getDuotoneUnsetStylesheet, 32031 resolveStyle: resolveStyle2, 32032 getVariationStyle 32033 }); 32034 32035 // packages/block-library/build-module/gallery/responsive-styles.mjs 32036 function isObject2(value) { 32037 return !!value && typeof value === "object" && !Array.isArray(value); 32038 } 32039 function isValidGalleryColumns(value) { 32040 return Number.isInteger(value) && value >= 1 && value <= MAX_COLUMNS; 32041 } 32042 function getViewportGalleryStyle(style2, viewport) { 32043 if (!isObject2(style2) || !isObject2(style2[viewport])) { 32044 return {}; 32045 } 32046 return style2[viewport]; 32047 } 32048 function cleanObject(value) { 32049 if (!isObject2(value)) { 32050 return value; 32051 } 32052 const entries = Object.entries(value).filter( 32053 ([, entryValue]) => entryValue !== void 0 32054 ); 32055 return entries.length ? Object.fromEntries(entries) : void 0; 32056 } 32057 function getUpdatedGalleryStyle({ 32058 style: style2, 32059 viewport, 32060 baseSettings, 32061 settings: settings117 32062 }) { 32063 const currentStyle = isObject2(style2) ? style2 : {}; 32064 const nextViewportStyle = { 32065 ...getViewportGalleryStyle(currentStyle, viewport) 32066 }; 32067 Object.entries(settings117).forEach(([key, value]) => { 32068 if (value === void 0 || value === baseSettings[key]) { 32069 delete nextViewportStyle[key]; 32070 } else { 32071 nextViewportStyle[key] = value; 32072 } 32073 }); 32074 const cleanedViewportStyle = cleanObject(nextViewportStyle); 32075 const nextStyle = { ...currentStyle }; 32076 if (cleanedViewportStyle) { 32077 nextStyle[viewport] = cleanedViewportStyle; 32078 } else { 32079 delete nextStyle[viewport]; 32080 } 32081 return cleanObject(nextStyle); 32082 } 32083 function getGallerySelector(selector) { 32084 return `$selector}.wp-block-gallery.has-nested-images:where(.is-layout-flex)`; 32085 } 32086 function getImageSelector(selector) { 32087 return `$getGallerySelector( 32088 selector 32089 )} figure.wp-block-image:not(#individual-image)`; 32090 } 32091 function getColumnsCSS(selector, columns) { 32092 const width = columns === 1 ? "100%" : `calc((100% - (var(--wp--style--unstable-gallery-gap, 16px) * $columns - 1})) / $columns})`; 32093 return `$getImageSelector(selector)}{width:$width} !important;}`; 32094 } 32095 function getImageCropCSS(selector, imageCrop) { 32096 const imageSelector = getImageSelector(selector); 32097 const wrapperSelector = `$imageSelector} > div:not(.components-drop-zone)`; 32098 const linkSelector = `$imageSelector} > a`; 32099 const mediaSelector = `$imageSelector} a,$imageSelector} img`; 32100 if (imageCrop) { 32101 return `$imageSelector}{align-self:inherit !important;margin-bottom:0 !important;}$wrapperSelector},$linkSelector}{display:flex !important;}$mediaSelector}{width:100% !important;flex:1 0 0% !important;height:100% !important;object-fit:cover !important;}`; 32102 } 32103 return `$imageSelector}{align-self:auto !important;margin-top:0 !important;margin-bottom:auto !important;}$wrapperSelector}{display:block !important;}$linkSelector}{display:inline-block !important;}$mediaSelector}{width:auto !important;flex:0 1 auto !important;height:auto !important;object-fit:fill !important;}`; 32104 } 32105 function getGalleryResponsiveFlexCSS(selector, style2, mediaQueries) { 32106 if (!isObject2(mediaQueries)) { 32107 return ""; 32108 } 32109 return Object.entries(mediaQueries).map(([viewport, mediaQuery]) => { 32110 if (typeof mediaQuery !== "string") { 32111 return ""; 32112 } 32113 const viewportStyle = getViewportGalleryStyle(style2, viewport); 32114 let css = ""; 32115 if (isValidGalleryColumns(viewportStyle.columns)) { 32116 css += getColumnsCSS(selector, viewportStyle.columns); 32117 } 32118 if (typeof viewportStyle.imageCrop === "boolean") { 32119 css += getImageCropCSS(selector, viewportStyle.imageCrop); 32120 } 32121 return css ? `$mediaQuery}{$css}}` : ""; 32122 }).join(""); 32123 } 32124 32125 // packages/block-library/build-module/gallery/flex-styles.mjs 32126 var { getResponsiveMediaQueries: getResponsiveMediaQueries2 } = unlock(privateApis); 32127 var { globalStylesDataKey } = unlock(import_block_editor85.privateApis); 32128 var GALLERY_BLOCK_NAME = "core/gallery"; 32129 var FALLBACK_VALUE = `var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )`; 32130 function getGalleryGapCustomPropertyStyle(selector, blockGap) { 32131 let column = FALLBACK_VALUE; 32132 if (blockGap) { 32133 column = typeof blockGap === "string" ? (0, import_block_editor85.__experimentalGetGapCSSValue)(blockGap) || FALLBACK_VALUE : (0, import_block_editor85.__experimentalGetGapCSSValue)(blockGap?.left) || FALLBACK_VALUE; 32134 } 32135 return `$selector} { 32136 --wp--style--unstable-gallery-gap: $column === "0" ? "0px" : column} 32137 }`; 32138 } 32139 function getBlockGapValue(style2) { 32140 if (!Object.hasOwn(style2?.spacing || {}, "blockGap")) { 32141 return void 0; 32142 } 32143 return style2.spacing.blockGap; 32144 } 32145 function GalleryFlexStyles({ style: style2, clientId }) { 32146 const selector = `.wp-block-gallery-$clientId}`; 32147 const [viewportSettings] = (0, import_block_editor85.useSettings)("viewport"); 32148 const globalStyles = (0, import_data35.useSelect)( 32149 (select10) => select10(import_block_editor85.store).getSettings()?.[globalStylesDataKey], 32150 [] 32151 ); 32152 const globalGalleryStyles = globalStyles?.blocks?.[GALLERY_BLOCK_NAME] || {}; 32153 const styleBlockGap = getBlockGapValue(style2); 32154 const globalGalleryBlockGap = globalGalleryStyles?.spacing?.blockGap ?? FALLBACK_VALUE; 32155 const blockGap = styleBlockGap === void 0 ? globalGalleryBlockGap : styleBlockGap; 32156 let css = getGalleryGapCustomPropertyStyle(selector, blockGap); 32157 const responsiveMediaQueries = getResponsiveMediaQueries2(viewportSettings); 32158 Object.entries(responsiveMediaQueries).forEach( 32159 ([viewport, mediaQuery]) => { 32160 const styleViewportBlockGap = getBlockGapValue( 32161 style2?.[viewport] 32162 ); 32163 const globalViewportBlockGap = styleBlockGap === void 0 ? globalGalleryStyles?.[viewport]?.spacing?.blockGap : void 0; 32164 const viewportBlockGap = styleViewportBlockGap === void 0 ? globalViewportBlockGap : styleViewportBlockGap; 32165 if (viewportBlockGap === void 0 || viewportBlockGap === null) { 32166 return; 32167 } 32168 css += `$mediaQuery}{$getGalleryGapCustomPropertyStyle( 32169 selector, 32170 viewportBlockGap 32171 )}}`; 32172 } 32173 ); 32174 css += getGalleryResponsiveFlexCSS( 32175 selector, 32176 style2, 32177 responsiveMediaQueries 32178 ); 32179 (0, import_block_editor85.useStyleOverride)({ css }); 32180 return null; 32181 } 32182 32183 // packages/block-library/build-module/gallery/use-dynamic-gallery.mjs 32184 var import_element58 = __toESM(require_element(), 1); 32185 var import_data36 = __toESM(require_data(), 1); 32186 var import_block_editor86 = __toESM(require_block_editor(), 1); 32187 var import_core_data21 = __toESM(require_core_data(), 1); 32188 var import_blocks30 = __toESM(require_blocks(), 1); 32189 32190 // packages/block-library/build-module/gallery/dynamic-source.mjs 32191 var import_i18n73 = __toESM(require_i18n(), 1); 32192 var ATTACHED_MEDIA = "core/attached-media"; 32193 var DEFAULT_ORDERBY = "date"; 32194 var DEFAULT_ORDER = "desc"; 32195 var DYNAMIC_SOURCES = { 32196 [ATTACHED_MEDIA]: { 32197 // Short label for the entry affordance / future source chooser. Mirrors 32198 // the "Attached images" media inserter category name. 32199 title: (0, import_i18n73.__)("Use attached images"), 32200 // Help text shown beneath the Source controls. 32201 description: (0, import_i18n73.__)("Images attached to the post."), 32202 // Empty-state copy for the canvas preview. 32203 emptyMessage: (0, import_i18n73.__)("Images attached to the post will appear here.") 32204 } 32205 }; 32206 function getDynamicSource(source) { 32207 return DYNAMIC_SOURCES[source]; 32208 } 32209 var MAX_IMAGES = 100; 32210 function getSourceQuery(dynamicContent, { postId }) { 32211 const { source, args = {} } = dynamicContent ?? {}; 32212 switch (source) { 32213 case ATTACHED_MEDIA: 32214 if (!postId) { 32215 return null; 32216 } 32217 return { 32218 parent: postId, 32219 per_page: MAX_IMAGES, 32220 // The gallery only accepts images, so constrain the source to 32221 // image media (matching the server resolver). This keeps the 32222 // editor preview in step with the rendered output for posts 32223 // that also have non-image attachments. 32224 media_type: "image", 32225 // Map the camelCase `args` to the REST-named media collection 32226 // params. Unexpected values (only reachable via hand-edited 32227 // markup) are coerced back to the defaults — mirroring the server 32228 // resolver's allow list — so the editor preview stays in step with 32229 // the frontend instead of issuing an invalid REST query. 32230 orderby: args.orderBy === "date" || args.orderBy === "title" ? args.orderBy : DEFAULT_ORDERBY, 32231 order: args.order === "asc" || args.order === "desc" ? args.order : DEFAULT_ORDER 32232 }; 32233 } 32234 return null; 32235 } 32236 32237 // packages/block-library/build-module/gallery/use-dynamic-gallery.mjs 32238 var EMPTY_ARRAY3 = []; 32239 function buildImageBlockAttributes(media, galleryAttributes) { 32240 const { sizeSlug, linkTo, linkTarget, aspectRatio } = galleryAttributes; 32241 const hasAspectRatio = !!aspectRatio && aspectRatio !== "auto"; 32242 return { 32243 id: media.id, 32244 ...pickRelevantMediaFiles(media, sizeSlug), 32245 ...getHrefAndDestination2(media, linkTo), 32246 ...getUpdatedLinkTargetSettings(linkTarget, galleryAttributes), 32247 sizeSlug, 32248 // Raw caption, mirroring the frontend (`index.php`). Gap: the REST API 32249 // exposes no caption run through `wp_get_attachment_caption`, so neither 32250 // side applies that filter. 32251 caption: media.caption?.raw || "", 32252 alt: media.alt_text || "", 32253 aspectRatio: hasAspectRatio ? aspectRatio : void 0, 32254 // Pair `scale` with `aspectRatio` so the image crops rather than stretches, 32255 // matching the image block's UI and the frontend (`index.php`). 32256 scale: hasAspectRatio ? "cover" : void 0 32257 }; 32258 } 32259 function buildImageBlocks(media, galleryAttributes) { 32260 return media.map( 32261 (mediaItem) => (0, import_blocks30.createBlock)( 32262 "core/image", 32263 buildImageBlockAttributes(mediaItem, galleryAttributes) 32264 ) 32265 ); 32266 } 32267 function useDynamicGallery({ 32268 attributes: attributes2, 32269 setAttributes, 32270 clientId, 32271 postId, 32272 postType 32273 }) { 32274 const { dynamicContent } = attributes2; 32275 const canUseDynamicSource = !!postType; 32276 const sourceDescriptor = getDynamicSource(dynamicContent?.source); 32277 const sourceOrderby = dynamicContent?.args?.orderBy ?? DEFAULT_ORDERBY; 32278 const sourceOrder = dynamicContent?.args?.order ?? DEFAULT_ORDER; 32279 const registry = (0, import_data36.useRegistry)(); 32280 const { replaceInnerBlocks, __unstableMarkNextChangeAsNotPersistent } = (0, import_data36.useDispatch)(import_block_editor86.store); 32281 const query = (0, import_element58.useMemo)( 32282 () => dynamicContent ? getSourceQuery(dynamicContent, { postId }) : null, 32283 [dynamicContent, postId] 32284 ); 32285 const { dynamicMedia, dynamicMediaTotal, isResolvingDynamic } = (0, import_data36.useSelect)( 32286 (select10) => { 32287 if (!query) { 32288 return { 32289 dynamicMedia: EMPTY_ARRAY3, 32290 dynamicMediaTotal: 0, 32291 isResolvingDynamic: false 32292 }; 32293 } 32294 const selectorArgs = ["postType", "attachment", query]; 32295 return { 32296 dynamicMedia: select10(import_core_data21.store).getEntityRecords(...selectorArgs) ?? EMPTY_ARRAY3, 32297 // Total matching attachments (the `X-WP-Total` header), which the 32298 // query's `per_page` cap doesn't bound — so it reveals when the 32299 // post has more attached images than are shown. 32300 dynamicMediaTotal: select10(import_core_data21.store).getEntityRecordsTotalItems( 32301 ...selectorArgs 32302 ) ?? 0, 32303 isResolvingDynamic: !select10(import_core_data21.store).hasFinishedResolution( 32304 "getEntityRecords", 32305 selectorArgs 32306 ) 32307 }; 32308 }, 32309 [query] 32310 ); 32311 const hasMoreImagesThanCap = dynamicMediaTotal > MAX_IMAGES; 32312 const { sizeSlug, linkTo, linkTarget, aspectRatio } = attributes2; 32313 const imageAttributes = (0, import_element58.useMemo)( 32314 () => ({ sizeSlug, linkTo, linkTarget, aspectRatio }), 32315 [sizeSlug, linkTo, linkTarget, aspectRatio] 32316 ); 32317 const dynamicImageBlocks = (0, import_element58.useMemo)( 32318 () => buildImageBlocks(dynamicMedia, imageAttributes), 32319 [dynamicMedia, imageAttributes] 32320 ); 32321 const galleryContext = (0, import_element58.useMemo)( 32322 () => ({ 32323 allowResize: attributes2.allowResize ?? false, 32324 imageCrop: attributes2.imageCrop, 32325 fixedHeight: attributes2.fixedHeight, 32326 navigationButtonType: attributes2.navigationButtonType 32327 }), 32328 [ 32329 attributes2.allowResize, 32330 attributes2.imageCrop, 32331 attributes2.fixedHeight, 32332 attributes2.navigationButtonType 32333 ] 32334 ); 32335 function enableDynamicMode() { 32336 registry.batch(() => { 32337 setAttributes({ dynamicContent: { source: ATTACHED_MEDIA } }); 32338 __unstableMarkNextChangeAsNotPersistent(); 32339 replaceInnerBlocks(clientId, []); 32340 }); 32341 } 32342 function convertToStatic() { 32343 registry.batch(() => { 32344 replaceInnerBlocks( 32345 clientId, 32346 buildImageBlocks(dynamicMedia, imageAttributes) 32347 ); 32348 __unstableMarkNextChangeAsNotPersistent(); 32349 setAttributes({ dynamicContent: void 0 }); 32350 }); 32351 } 32352 function setSourceOrder(nextOrderby, nextOrder) { 32353 const nextArgs = { ...dynamicContent?.args }; 32354 delete nextArgs.orderBy; 32355 delete nextArgs.order; 32356 if (nextOrderby !== void 0 && (nextOrderby !== DEFAULT_ORDERBY || nextOrder !== DEFAULT_ORDER)) { 32357 nextArgs.orderBy = nextOrderby; 32358 nextArgs.order = nextOrder; 32359 } 32360 const nextSource = { ...dynamicContent }; 32361 if (Object.keys(nextArgs).length) { 32362 nextSource.args = nextArgs; 32363 } else { 32364 delete nextSource.args; 32365 } 32366 setAttributes({ dynamicContent: nextSource }); 32367 } 32368 function resetSource() { 32369 setAttributes({ 32370 dynamicContent: { source: dynamicContent.source } 32371 }); 32372 } 32373 return { 32374 dynamicContent, 32375 canUseDynamicSource, 32376 sourceDescriptor, 32377 hasMoreImagesThanCap, 32378 dynamicMediaTotal, 32379 sourceOrderby, 32380 sourceOrder, 32381 dynamicMedia, 32382 dynamicImageBlocks, 32383 isResolvingDynamic, 32384 galleryContext, 32385 enableDynamicMode, 32386 convertToStatic, 32387 setSourceOrder, 32388 resetSource 32389 }; 32390 } 32391 32392 // packages/block-library/build-module/gallery/dynamic-gallery.mjs 32393 var import_i18n74 = __toESM(require_i18n(), 1); 32394 var import_element59 = __toESM(require_element(), 1); 32395 var import_components42 = __toESM(require_components(), 1); 32396 var import_block_editor87 = __toESM(require_block_editor(), 1); 32397 var import_jsx_runtime288 = __toESM(require_jsx_runtime(), 1); 32398 var ORDER_OPTIONS = [ 32399 { label: (0, import_i18n74.__)("Newest to oldest"), value: "date/desc" }, 32400 { label: (0, import_i18n74.__)("Oldest to newest"), value: "date/asc" }, 32401 { 32402 /* translators: Label for ordering images by title in ascending order. */ 32403 label: (0, import_i18n74.__)("A \u2192 Z"), 32404 value: "title/asc" 32405 }, 32406 { 32407 /* translators: Label for ordering images by title in descending order. */ 32408 label: (0, import_i18n74.__)("Z \u2192 A"), 32409 value: "title/desc" 32410 } 32411 ]; 32412 function OrderControl({ orderby, order, onChange }) { 32413 return /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32414 import_components42.SelectControl, 32415 { 32416 label: (0, import_i18n74.__)("Order by"), 32417 value: `$orderby}/$order}`, 32418 options: ORDER_OPTIONS, 32419 onChange: (value) => { 32420 const [newOrderby, newOrder] = value.split("/"); 32421 onChange({ orderby: newOrderby, order: newOrder }); 32422 } 32423 } 32424 ); 32425 } 32426 function DetachGalleryDialog({ onConfirm, onCancel }) { 32427 return /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32428 import_components42.__experimentalConfirmDialog, 32429 { 32430 isOpen: true, 32431 title: (0, import_i18n74.__)("Detach Gallery"), 32432 __experimentalHideHeader: false, 32433 confirmButtonText: (0, import_i18n74.__)("Detach"), 32434 onConfirm, 32435 onCancel, 32436 size: "medium", 32437 children: (0, import_i18n74.__)( 32438 "The gallery displays the images attached to the post. Detaching will enable you to add, delete, or reorder images. However, new attachments will no longer be added automatically." 32439 ) 32440 } 32441 ); 32442 } 32443 function GallerySourcePanel({ 32444 dynamic, 32445 dropdownMenuProps, 32446 hasImages 32447 }) { 32448 const { 32449 dynamicContent, 32450 canUseDynamicSource, 32451 sourceDescriptor, 32452 sourceOrderby, 32453 sourceOrder, 32454 setSourceOrder, 32455 convertToStatic, 32456 enableDynamicMode, 32457 resetSource, 32458 isResolvingDynamic, 32459 hasMoreImagesThanCap, 32460 dynamicMediaTotal 32461 } = dynamic; 32462 const isDynamic = !!dynamicContent; 32463 const [isConfirming, setIsConfirming] = (0, import_element59.useState)(false); 32464 const [isConfirmingDetach, setIsConfirmingDetach] = (0, import_element59.useState)(false); 32465 function requestEnableDynamicMode() { 32466 if (hasImages) { 32467 setIsConfirming(true); 32468 } else { 32469 enableDynamicMode(); 32470 } 32471 } 32472 if (isDynamic) { 32473 return /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)(import_jsx_runtime288.Fragment, { children: [ 32474 /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)( 32475 import_components42.__experimentalToolsPanel, 32476 { 32477 label: (0, import_i18n74.__)("Source"), 32478 resetAll: resetSource, 32479 dropdownMenuProps, 32480 children: [ 32481 /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)("div", { className: "wp-block-gallery__source-settings", children: [ 32482 /* @__PURE__ */ (0, import_jsx_runtime288.jsx)("p", { className: "wp-block-gallery__source-description", children: sourceDescriptor?.description ?? (0, import_i18n74.__)("Dynamic images.") }), 32483 /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32484 import_components42.Button, 32485 { 32486 __next40pxDefaultSize: true, 32487 variant: "secondary", 32488 onClick: () => setIsConfirmingDetach(true), 32489 disabled: isResolvingDynamic, 32490 accessibleWhenDisabled: true, 32491 children: (0, import_i18n74.__)("Detach Gallery") 32492 } 32493 ) 32494 ] }), 32495 hasMoreImagesThanCap && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32496 import_components42.Notice, 32497 { 32498 className: "wp-block-gallery__source-notice", 32499 status: "warning", 32500 isDismissible: false, 32501 children: (0, import_i18n74.sprintf)( 32502 /* translators: 1: number of images shown. 2: total number of matching images. */ 32503 (0, import_i18n74.__)( 32504 "Only the first %1$d of %2$d images will be displayed." 32505 ), 32506 MAX_IMAGES, 32507 dynamicMediaTotal 32508 ) 32509 } 32510 ), 32511 /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32512 import_components42.__experimentalToolsPanelItem, 32513 { 32514 isShownByDefault: true, 32515 label: (0, import_i18n74.__)("Order by"), 32516 hasValue: () => sourceOrderby !== DEFAULT_ORDERBY || sourceOrder !== DEFAULT_ORDER, 32517 onDeselect: () => setSourceOrder(void 0, void 0), 32518 children: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32519 OrderControl, 32520 { 32521 orderby: sourceOrderby, 32522 order: sourceOrder, 32523 onChange: ({ orderby, order }) => setSourceOrder(orderby, order) 32524 } 32525 ) 32526 } 32527 ) 32528 ] 32529 } 32530 ), 32531 isConfirmingDetach && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32532 DetachGalleryDialog, 32533 { 32534 onConfirm: () => { 32535 convertToStatic(); 32536 setIsConfirmingDetach(false); 32537 }, 32538 onCancel: () => setIsConfirmingDetach(false) 32539 } 32540 ) 32541 ] }); 32542 } 32543 if (!canUseDynamicSource) { 32544 return null; 32545 } 32546 return /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)(import_jsx_runtime288.Fragment, { children: [ 32547 /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(import_components42.PanelBody, { title: (0, import_i18n74.__)("Source"), children: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)("div", { className: "wp-block-gallery__source-settings", children: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32548 import_components42.Button, 32549 { 32550 __next40pxDefaultSize: true, 32551 variant: "secondary", 32552 onClick: requestEnableDynamicMode, 32553 children: (0, import_i18n74.__)("Use images attached to the post") 32554 } 32555 ) }) }), 32556 isConfirming && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32557 import_components42.__experimentalConfirmDialog, 32558 { 32559 isOpen: true, 32560 title: (0, import_i18n74.__)("Use images attached to the post?"), 32561 __experimentalHideHeader: false, 32562 confirmButtonText: (0, import_i18n74.__)("Use attached images"), 32563 onConfirm: () => { 32564 enableDynamicMode(); 32565 setIsConfirming(false); 32566 }, 32567 onCancel: () => setIsConfirming(false), 32568 size: "medium", 32569 children: (0, import_i18n74.__)( 32570 "The images in this gallery will be replaced, but will remain in the media library." 32571 ) 32572 } 32573 ) 32574 ] }); 32575 } 32576 function GalleryImagesPreview({ imageBlocks, layout }) { 32577 const { children, ref, className } = (0, import_block_editor87.__experimentalUseBlockPreview)({ 32578 blocks: imageBlocks, 32579 layout 32580 }); 32581 return /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32582 "div", 32583 { 32584 ref, 32585 className, 32586 style: { display: "contents" }, 32587 children 32588 } 32589 ); 32590 } 32591 function GalleryDynamicView({ 32592 dynamic, 32593 blockProps, 32594 innerBlocksProps, 32595 attributes: attributes2, 32596 setAttributes, 32597 isSelected, 32598 insertBlocksAfter, 32599 isContentLocked, 32600 multiGallerySelection 32601 }) { 32602 const { 32603 sourceDescriptor, 32604 dynamicImageBlocks, 32605 galleryContext, 32606 isResolvingDynamic, 32607 convertToStatic 32608 } = dynamic; 32609 const blockEditingMode = (0, import_block_editor87.useBlockEditingMode)(); 32610 const [isConfirmingDetach, setIsConfirmingDetach] = (0, import_element59.useState)(false); 32611 const previewLayout = (0, import_element59.useMemo)( 32612 () => isGalleryFlexLayout(attributes2.layout) ? { ...attributes2.layout, type: "flex" } : attributes2.layout, 32613 [attributes2.layout] 32614 ); 32615 const emptyInstructions = isResolvingDynamic ? (0, import_i18n74.__)("Loading images\u2026") : sourceDescriptor?.emptyMessage ?? (0, import_i18n74.__)("Dynamic images will appear here."); 32616 return /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)(import_jsx_runtime288.Fragment, { children: [ 32617 blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)(import_jsx_runtime288.Fragment, { children: [ 32618 /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(import_block_editor87.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32619 import_components42.ToolbarButton, 32620 { 32621 onClick: () => setIsConfirmingDetach(true), 32622 disabled: isResolvingDynamic, 32623 children: (0, import_i18n74.__)("Detach") 32624 } 32625 ) }), 32626 isConfirmingDetach && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32627 DetachGalleryDialog, 32628 { 32629 onConfirm: () => { 32630 convertToStatic(); 32631 setIsConfirmingDetach(false); 32632 }, 32633 onCancel: () => setIsConfirmingDetach(false) 32634 } 32635 ) 32636 ] }), 32637 /* @__PURE__ */ (0, import_jsx_runtime288.jsxs)("figure", { ...blockProps, children: [ 32638 dynamicImageBlocks.length ? /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(import_block_editor87.BlockContextProvider, { value: galleryContext, children: /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32639 GalleryImagesPreview, 32640 { 32641 imageBlocks: dynamicImageBlocks, 32642 layout: previewLayout 32643 } 32644 ) }) : /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32645 import_components42.Placeholder, 32646 { 32647 icon: sharedIcon, 32648 label: (0, import_i18n74.__)("Gallery"), 32649 instructions: emptyInstructions, 32650 children: isResolvingDynamic && /* @__PURE__ */ (0, import_jsx_runtime288.jsx)(import_components42.Spinner, {}) 32651 } 32652 ), 32653 /* @__PURE__ */ (0, import_jsx_runtime288.jsx)( 32654 Caption, 32655 { 32656 attributes: attributes2, 32657 setAttributes, 32658 isSelected, 32659 insertBlocksAfter, 32660 showToolbarButton: !multiGallerySelection && !isContentLocked, 32661 className: "blocks-gallery-caption", 32662 label: (0, import_i18n74.__)("Gallery caption text"), 32663 placeholder: (0, import_i18n74.__)("Add gallery caption") 32664 } 32665 ) 32666 ] }), 32667 innerBlocksProps.children 32668 ] }); 32669 } 32670 32671 // packages/block-library/build-module/gallery/edit.mjs 32672 var import_jsx_runtime289 = __toESM(require_jsx_runtime(), 1); 32673 var LINK_OPTIONS = [ 32674 { 32675 icon: custom_link_default, 32676 label: (0, import_i18n75.__)("Link images to attachment pages"), 32677 value: LINK_DESTINATION_ATTACHMENT, 32678 noticeText: (0, import_i18n75.__)("Attachment Pages") 32679 }, 32680 { 32681 icon: image_default, 32682 label: (0, import_i18n75.__)("Link images to media files"), 32683 value: LINK_DESTINATION_MEDIA, 32684 noticeText: (0, import_i18n75.__)("Media Files") 32685 }, 32686 { 32687 icon: fullscreen_default, 32688 label: (0, import_i18n75.__)("Enlarge on click"), 32689 value: LINK_DESTINATION_LIGHTBOX, 32690 noticeText: (0, import_i18n75.__)("Lightbox effect"), 32691 infoText: (0, import_i18n75.__)("Scale images with a lightbox effect") 32692 }, 32693 { 32694 icon: link_off_default, 32695 label: (0, import_i18n75._x)("None", "Media item link option"), 32696 value: LINK_DESTINATION_NONE, 32697 noticeText: (0, import_i18n75.__)("None") 32698 } 32699 ]; 32700 var NAVIGATION_BUTTON_TYPE_OPTIONS = [ 32701 { 32702 label: (0, import_i18n75.__)("Icon"), 32703 value: "icon" 32704 }, 32705 { 32706 label: (0, import_i18n75.__)("Text"), 32707 value: "text" 32708 }, 32709 { 32710 label: (0, import_i18n75.__)("Both"), 32711 value: "both" 32712 } 32713 ]; 32714 var ALLOWED_MEDIA_TYPES4 = ["image"]; 32715 var PLACEHOLDER_TEXT = (0, import_i18n75.__)( 32716 "Drag and drop images, upload, or choose from your library." 32717 ); 32718 var DEFAULT_BLOCK3 = { name: "core/image" }; 32719 var EMPTY_ARRAY4 = []; 32720 function GalleryEdit(props) { 32721 const { 32722 setAttributes, 32723 attributes: attributes2, 32724 className, 32725 clientId, 32726 isSelected, 32727 insertBlocksAfter, 32728 isContentLocked, 32729 context, 32730 __unstableLayoutClassNames: layoutClassNames 32731 } = props; 32732 const postId = context?.postId; 32733 const postType = context?.postType; 32734 const blockEditingMode = (0, import_block_editor88.useBlockEditingMode)(); 32735 const [lightboxSetting, defaultRatios, themeRatios, showDefaultRatios] = (0, import_block_editor88.useSettings)( 32736 "blocks.core/image.lightbox", 32737 "dimensions.aspectRatios.default", 32738 "dimensions.aspectRatios.theme", 32739 "dimensions.defaultAspectRatios" 32740 ); 32741 const linkOptions = !lightboxSetting?.allowEditing ? LINK_OPTIONS.filter( 32742 (option) => option.value !== LINK_DESTINATION_LIGHTBOX 32743 ) : LINK_OPTIONS; 32744 const { 32745 align, 32746 navigationButtonType, 32747 columns, 32748 imageCrop, 32749 randomOrder, 32750 linkTarget, 32751 linkTo, 32752 sizeSlug, 32753 aspectRatio, 32754 layout 32755 } = attributes2; 32756 const isFlexLayout = isGalleryFlexLayout(layout); 32757 const previousLayoutRef = (0, import_element60.useRef)(layout); 32758 const { 32759 __unstableMarkNextChangeAsNotPersistent, 32760 replaceInnerBlocks, 32761 updateBlockAttributes, 32762 selectBlock 32763 } = (0, import_data37.useDispatch)(import_block_editor88.store); 32764 const { createSuccessNotice, createErrorNotice } = (0, import_data37.useDispatch)(import_notices6.store); 32765 (0, import_element60.useEffect)(() => { 32766 const previousLayout = previousLayoutRef.current; 32767 previousLayoutRef.current = layout; 32768 if (!isObject(previousLayout) || !isObject(layout) || previousLayout.type === layout.type) { 32769 return; 32770 } 32771 const nextLayout = { ...layout }; 32772 let hasPreservedGridSetting = false; 32773 if (!Object.hasOwn(layout, "columnCount") && Number.isInteger(previousLayout.columnCount) && previousLayout.columnCount > 0) { 32774 nextLayout.columnCount = previousLayout.columnCount; 32775 hasPreservedGridSetting = true; 32776 } 32777 if (!Object.hasOwn(layout, "minimumColumnWidth") && typeof previousLayout.minimumColumnWidth === "string") { 32778 nextLayout.minimumColumnWidth = previousLayout.minimumColumnWidth; 32779 hasPreservedGridSetting = true; 32780 } 32781 if (hasPreservedGridSetting) { 32782 previousLayoutRef.current = nextLayout; 32783 __unstableMarkNextChangeAsNotPersistent(); 32784 setAttributes({ layout: nextLayout }); 32785 } 32786 }, [layout, setAttributes, __unstableMarkNextChangeAsNotPersistent]); 32787 const { 32788 getBlock, 32789 getSettings: getSettings2, 32790 innerBlockImages, 32791 multiGallerySelection, 32792 selectedStyleState 32793 } = (0, import_data37.useSelect)( 32794 (select10) => { 32795 const { 32796 getBlockName, 32797 getMultiSelectedBlockClientIds, 32798 getSettings: _getSettings, 32799 getBlock: _getBlock, 32800 getSelectedBlockStyleState 32801 } = unlock(select10(import_block_editor88.store)); 32802 const multiSelectedClientIds = getMultiSelectedBlockClientIds(); 32803 return { 32804 getBlock: _getBlock, 32805 getSettings: _getSettings, 32806 innerBlockImages: _getBlock(clientId)?.innerBlocks ?? EMPTY_ARRAY4, 32807 multiGallerySelection: multiSelectedClientIds.length && multiSelectedClientIds.every( 32808 (_clientId) => getBlockName(_clientId) === "core/gallery" 32809 ), 32810 selectedStyleState: getSelectedBlockStyleState(clientId) 32811 }; 32812 }, 32813 [clientId] 32814 ); 32815 const isViewportStyleState = selectedStyleState?.viewport && selectedStyleState.viewport !== "default"; 32816 const viewportStyle = isViewportStyleState ? getViewportGalleryStyle( 32817 attributes2.style, 32818 selectedStyleState.viewport 32819 ) : {}; 32820 const baseColumns = isValidGalleryColumns(columns) ? columns : void 0; 32821 const baseImageCrop = typeof imageCrop === "boolean" ? imageCrop : true; 32822 const hasViewportColumns = isViewportStyleState && Object.hasOwn(viewportStyle, "columns") && isValidGalleryColumns(viewportStyle.columns); 32823 const hasViewportImageCrop = isViewportStyleState && Object.hasOwn(viewportStyle, "imageCrop") && typeof viewportStyle.imageCrop === "boolean"; 32824 const activeColumns = hasViewportColumns ? viewportStyle.columns : baseColumns; 32825 const activeImageCrop = hasViewportImageCrop ? viewportStyle.imageCrop : baseImageCrop; 32826 const images = (0, import_element60.useMemo)( 32827 () => innerBlockImages?.map((block) => ({ 32828 clientId: block.clientId, 32829 id: block.attributes.id, 32830 url: block.attributes.url, 32831 attributes: block.attributes, 32832 fromSavedContent: Boolean(block.originalContent) 32833 })), 32834 [innerBlockImages] 32835 ); 32836 const imageData = useGetMedia(innerBlockImages); 32837 const newImages = useGetNewImages(images, imageData); 32838 const hasImages = !!images.length; 32839 const isDynamic = !!attributes2.dynamicContent; 32840 const dynamic = useDynamicGallery({ 32841 attributes: attributes2, 32842 setAttributes, 32843 clientId, 32844 postId, 32845 postType 32846 }); 32847 const displayedImageCount = isDynamic ? dynamic.dynamicMedia.length : images.length; 32848 let hasLightboxImages; 32849 if (isDynamic) { 32850 hasLightboxImages = linkTo === LINK_DESTINATION_LIGHTBOX; 32851 } else if (lightboxSetting?.enabled) { 32852 hasLightboxImages = images.filter( 32853 (image) => image.attributes?.lightbox?.enabled === void 0 || image.attributes?.lightbox?.enabled === true 32854 ).length > 0; 32855 } else { 32856 hasLightboxImages = images.filter((image) => image.attributes.lightbox?.enabled).length > 0; 32857 } 32858 const themeOptions = themeRatios?.map(({ name: name118, ratio }) => ({ 32859 label: name118, 32860 value: ratio 32861 })); 32862 const defaultOptions = defaultRatios?.map(({ name: name118, ratio }) => ({ 32863 label: name118, 32864 value: ratio 32865 })); 32866 const aspectRatioOptions = [ 32867 { 32868 label: (0, import_i18n75._x)( 32869 "Original", 32870 "Aspect ratio option for dimensions control" 32871 ), 32872 value: "auto" 32873 }, 32874 ...showDefaultRatios ? defaultOptions || [] : [], 32875 ...themeOptions || [] 32876 ]; 32877 (0, import_element60.useEffect)(() => { 32878 newImages?.forEach((newImage) => { 32879 __unstableMarkNextChangeAsNotPersistent(); 32880 updateBlockAttributes(newImage.clientId, { 32881 ...buildImageAttributes(newImage.attributes), 32882 id: newImage.id, 32883 align: void 0 32884 }); 32885 }); 32886 }, [newImages]); 32887 const imageSizeOptions = useImageSizes( 32888 isDynamic ? dynamic.dynamicMedia : imageData, 32889 isSelected, 32890 getSettings2 32891 ); 32892 function buildImageAttributes(imageAttributes) { 32893 const image = imageAttributes.id ? imageData.find(({ id }) => id === imageAttributes.id) : null; 32894 let newClassName; 32895 if (imageAttributes.className && imageAttributes.className !== "") { 32896 newClassName = imageAttributes.className; 32897 } 32898 let newLinkTarget; 32899 if (imageAttributes.linkTarget || imageAttributes.rel) { 32900 newLinkTarget = { 32901 linkTarget: imageAttributes.linkTarget, 32902 rel: imageAttributes.rel 32903 }; 32904 } else { 32905 newLinkTarget = getUpdatedLinkTargetSettings( 32906 linkTarget, 32907 attributes2 32908 ); 32909 } 32910 return { 32911 ...pickRelevantMediaFiles(image, sizeSlug), 32912 ...getHrefAndDestination2( 32913 image, 32914 linkTo, 32915 imageAttributes?.linkDestination 32916 ), 32917 ...newLinkTarget, 32918 className: newClassName, 32919 sizeSlug, 32920 caption: imageAttributes.caption.length > 0 ? imageAttributes.caption : image.caption?.raw, 32921 alt: imageAttributes.alt || image.alt_text, 32922 aspectRatio: aspectRatio === "auto" ? void 0 : aspectRatio 32923 }; 32924 } 32925 function isValidFileType2(file) { 32926 const mediaTypeSelector = file.type; 32927 return ALLOWED_MEDIA_TYPES4.some( 32928 (mediaType) => mediaTypeSelector?.indexOf(mediaType) === 0 32929 ) || file.blob; 32930 } 32931 function updateImages(selectedImages) { 32932 const newFileUploads = Object.prototype.toString.call(selectedImages) === "[object FileList]"; 32933 const imageArray = newFileUploads ? Array.from(selectedImages).map((file) => { 32934 if (!file.url) { 32935 return { 32936 blob: (0, import_blob10.createBlobURL)(file) 32937 }; 32938 } 32939 return file; 32940 }) : selectedImages; 32941 if (!imageArray.every(isValidFileType2)) { 32942 createErrorNotice( 32943 (0, import_i18n75.__)( 32944 "If uploading to a gallery all files need to be image formats" 32945 ), 32946 { id: "gallery-upload-invalid-file", type: "snackbar" } 32947 ); 32948 } 32949 const processedImages = imageArray.filter((file) => file.url || isValidFileType2(file)).map((file) => { 32950 if (!file.url) { 32951 return { 32952 blob: file.blob || (0, import_blob10.createBlobURL)(file) 32953 }; 32954 } 32955 return file; 32956 }); 32957 const newOrderMap = processedImages.reduce( 32958 (result, image, index) => (result[image.id] = index, result), 32959 {} 32960 ); 32961 const existingImageBlocks = !newFileUploads ? innerBlockImages.filter( 32962 (block) => processedImages.find( 32963 (img) => img.id === block.attributes.id 32964 ) 32965 ) : innerBlockImages; 32966 const newImageList = processedImages.filter( 32967 (img) => !existingImageBlocks.find( 32968 (existingImg) => img.id === existingImg.attributes.id 32969 ) 32970 ); 32971 const newBlocks = newImageList.map((image) => { 32972 return (0, import_blocks31.createBlock)("core/image", { 32973 id: image.id, 32974 blob: image.blob, 32975 url: image.url, 32976 caption: image.caption, 32977 alt: image.alt 32978 }); 32979 }); 32980 replaceInnerBlocks( 32981 clientId, 32982 existingImageBlocks.concat(newBlocks).sort( 32983 (a2, b2) => newOrderMap[a2.attributes.id] - newOrderMap[b2.attributes.id] 32984 ) 32985 ); 32986 if (newBlocks?.length > 0) { 32987 selectBlock(newBlocks[0].clientId); 32988 } 32989 } 32990 function onUploadError(message) { 32991 createErrorNotice(message, { type: "snackbar" }); 32992 } 32993 function setLinkTo(value) { 32994 setAttributes({ linkTo: value }); 32995 const changedAttributes = {}; 32996 const blocks = []; 32997 getBlock(clientId).innerBlocks.forEach((block) => { 32998 blocks.push(block.clientId); 32999 const image = block.attributes.id ? imageData.find(({ id }) => id === block.attributes.id) : null; 33000 changedAttributes[block.clientId] = getHrefAndDestination2( 33001 image, 33002 value, 33003 false, 33004 block.attributes, 33005 lightboxSetting 33006 ); 33007 }); 33008 updateBlockAttributes(blocks, changedAttributes, { 33009 uniqueByBlock: true 33010 }); 33011 const linkToText = [...linkOptions].find( 33012 (linkType) => linkType.value === value 33013 ); 33014 createSuccessNotice( 33015 (0, import_i18n75.sprintf)( 33016 /* translators: %s: image size settings */ 33017 (0, import_i18n75.__)("All gallery image links updated to: %s"), 33018 linkToText.noticeText 33019 ), 33020 { 33021 id: "gallery-attributes-linkTo", 33022 type: "snackbar" 33023 } 33024 ); 33025 } 33026 function setGalleryFlexSettings(settings117) { 33027 if (!isViewportStyleState) { 33028 setAttributes(settings117); 33029 return; 33030 } 33031 setAttributes({ 33032 style: getUpdatedGalleryStyle({ 33033 style: attributes2.style, 33034 viewport: selectedStyleState.viewport, 33035 baseSettings: { 33036 columns: baseColumns, 33037 imageCrop: baseImageCrop 33038 }, 33039 settings: settings117 33040 }) 33041 }); 33042 } 33043 function setColumnsNumber(value) { 33044 setGalleryFlexSettings({ columns: value }); 33045 } 33046 function toggleImageCrop() { 33047 setGalleryFlexSettings({ imageCrop: !activeImageCrop }); 33048 } 33049 function toggleRandomOrder() { 33050 setAttributes({ randomOrder: !randomOrder }); 33051 } 33052 function toggleOpenInNewTab(openInNewTab) { 33053 const newLinkTarget = openInNewTab ? "_blank" : void 0; 33054 setAttributes({ linkTarget: newLinkTarget }); 33055 const changedAttributes = {}; 33056 const blocks = []; 33057 getBlock(clientId).innerBlocks.forEach((block) => { 33058 blocks.push(block.clientId); 33059 changedAttributes[block.clientId] = getUpdatedLinkTargetSettings( 33060 newLinkTarget, 33061 block.attributes 33062 ); 33063 }); 33064 updateBlockAttributes(blocks, changedAttributes, { 33065 uniqueByBlock: true 33066 }); 33067 const noticeText = openInNewTab ? (0, import_i18n75.__)("All gallery images updated to open in new tab") : (0, import_i18n75.__)("All gallery images updated to not open in new tab"); 33068 createSuccessNotice(noticeText, { 33069 id: "gallery-attributes-openInNewTab", 33070 type: "snackbar" 33071 }); 33072 } 33073 function updateImagesSize(newSizeSlug) { 33074 setAttributes({ sizeSlug: newSizeSlug }); 33075 const changedAttributes = {}; 33076 const blocks = []; 33077 getBlock(clientId).innerBlocks.forEach((block) => { 33078 blocks.push(block.clientId); 33079 const image = block.attributes.id ? imageData.find(({ id }) => id === block.attributes.id) : null; 33080 changedAttributes[block.clientId] = getImageSizeAttributes( 33081 image, 33082 newSizeSlug 33083 ); 33084 }); 33085 updateBlockAttributes(blocks, changedAttributes, { 33086 uniqueByBlock: true 33087 }); 33088 const imageSize = imageSizeOptions.find( 33089 (size) => size.value === newSizeSlug 33090 ); 33091 createSuccessNotice( 33092 (0, import_i18n75.sprintf)( 33093 /* translators: %s: image size settings */ 33094 (0, import_i18n75.__)("All gallery image sizes updated to: %s"), 33095 imageSize?.label ?? newSizeSlug 33096 ), 33097 { 33098 id: "gallery-attributes-sizeSlug", 33099 type: "snackbar" 33100 } 33101 ); 33102 } 33103 function setAspectRatio(value) { 33104 setAttributes({ aspectRatio: value }); 33105 const changedAttributes = {}; 33106 const blocks = []; 33107 getBlock(clientId).innerBlocks.forEach((block) => { 33108 blocks.push(block.clientId); 33109 changedAttributes[block.clientId] = { 33110 aspectRatio: value === "auto" ? void 0 : value 33111 }; 33112 }); 33113 updateBlockAttributes(blocks, changedAttributes, true); 33114 const aspectRatioText = aspectRatioOptions.find( 33115 (option) => option.value === value 33116 ); 33117 createSuccessNotice( 33118 (0, import_i18n75.sprintf)( 33119 /* translators: %s: aspect ratio setting */ 33120 (0, import_i18n75.__)("All gallery images updated to aspect ratio: %s"), 33121 aspectRatioText?.label || value 33122 ), 33123 { 33124 id: "gallery-attributes-aspectRatio", 33125 type: "snackbar" 33126 } 33127 ); 33128 } 33129 (0, import_element60.useEffect)(() => { 33130 if (!linkTo) { 33131 __unstableMarkNextChangeAsNotPersistent(); 33132 setAttributes({ 33133 linkTo: window?.wp?.media?.view?.settings?.defaultProps?.link || LINK_DESTINATION_NONE 33134 }); 33135 } 33136 }, [linkTo]); 33137 const hasImageIds = hasImages && images.some((image) => !!image.id); 33138 const imagesUploading = images.some( 33139 (img) => !img.id && img.url?.indexOf("blob:") === 0 33140 ); 33141 const mediaPlaceholderProps = { 33142 addToGallery: false, 33143 disableMediaButtons: imagesUploading, 33144 value: {} 33145 }; 33146 const blockProps = (0, import_block_editor88.useBlockProps)({ 33147 className: clsx_default( 33148 className, 33149 "has-nested-images", 33150 `wp-block-gallery-$clientId}`, 33151 // In dynamic mode there are no inner blocks and the gallery isn't 33152 // rendered through the `Gallery` component, so the classes that 33153 // component normally composes onto the `<figure>` (see `gallery.jsx`) 33154 // must be added here to keep the preview's flex/crop layout matching 33155 // the static gallery and the frontend. 33156 isDynamic && [ 33157 layoutClassNames, 33158 "blocks-gallery-grid", 33159 { 33160 [`align$align}`]: align, 33161 [`columns-$columns}`]: isFlexLayout && columns !== void 0, 33162 "columns-default": isFlexLayout && columns === void 0, 33163 "is-cropped": isFlexLayout && imageCrop 33164 } 33165 ] 33166 ) 33167 }); 33168 const innerBlocksProps = (0, import_block_editor88.useInnerBlocksProps)(blockProps, { 33169 defaultBlock: DEFAULT_BLOCK3, 33170 directInsert: true, 33171 orientation: "horizontal", 33172 renderAppender: false, 33173 // In dynamic mode nothing may be inserted: the images are resolved from 33174 // the source, not authored as inner blocks. `allowedBlocks: []` enforces 33175 // this in every context — unlike `templateLock: 'all'`, it isn't relaxed 33176 // to `contentOnly` by a content-locked ancestor — so it blocks insertion 33177 // and drag-and-drop (via `canInsertBlockType`). It's also what opts the 33178 // gallery out of the List View: a block that can't be inserted into and 33179 // has no inner blocks has nothing to navigate or add (see 33180 // `shouldRenderBlockListView`). This reaches the block's list settings 33181 // only while the inner blocks are mounted, which is why the dynamic view 33182 // still renders the (empty) inner blocks. 33183 allowedBlocks: isDynamic ? EMPTY_ARRAY4 : void 0 33184 }); 33185 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 33186 if (!hasImages && !isDynamic) { 33187 return /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)("div", { ...innerBlocksProps, children: [ 33188 innerBlocksProps.children, 33189 /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33190 import_block_editor88.MediaPlaceholder, 33191 { 33192 handleUpload: false, 33193 icon: sharedIcon, 33194 labels: { 33195 title: (0, import_i18n75.__)("Gallery"), 33196 instructions: PLACEHOLDER_TEXT 33197 }, 33198 onSelect: updateImages, 33199 allowedTypes: ALLOWED_MEDIA_TYPES4, 33200 multiple: true, 33201 onError: onUploadError, 33202 ...mediaPlaceholderProps, 33203 children: blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33204 import_components43.Button, 33205 { 33206 __next40pxDefaultSize: true, 33207 variant: "secondary", 33208 onClick: dynamic.enableDynamicMode, 33209 children: getDynamicSource(ATTACHED_MEDIA).title 33210 } 33211 ) 33212 } 33213 ) 33214 ] }); 33215 } 33216 const hasLinkTo = linkTo && linkTo !== "none"; 33217 return /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)(import_jsx_runtime289.Fragment, { children: [ 33218 /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)( 33219 import_block_editor88.InspectorControls, 33220 { 33221 group: isViewportStyleState && isFlexLayout ? "viewport" : "default", 33222 children: [ 33223 !isViewportStyleState && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33224 GallerySourcePanel, 33225 { 33226 dynamic, 33227 dropdownMenuProps, 33228 hasImages 33229 } 33230 ), 33231 /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)( 33232 import_components43.__experimentalToolsPanel, 33233 { 33234 label: (0, import_i18n75.__)("Settings"), 33235 resetAll: () => { 33236 if (isViewportStyleState) { 33237 setGalleryFlexSettings({ 33238 columns: void 0, 33239 imageCrop: void 0 33240 }); 33241 return; 33242 } 33243 setAttributes({ 33244 navigationButtonType: "icon", 33245 randomOrder: false, 33246 ...isFlexLayout && { 33247 columns: void 0, 33248 imageCrop: true 33249 } 33250 }); 33251 setAspectRatio("auto"); 33252 if (sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG2) { 33253 updateImagesSize(DEFAULT_MEDIA_SIZE_SLUG2); 33254 } 33255 if (linkTarget) { 33256 toggleOpenInNewTab(false); 33257 } 33258 }, 33259 dropdownMenuProps, 33260 children: [ 33261 isFlexLayout && displayedImageCount > 1 && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33262 import_components43.__experimentalToolsPanelItem, 33263 { 33264 isShownByDefault: true, 33265 label: (0, import_i18n75.__)("Columns"), 33266 hasValue: () => isViewportStyleState ? hasViewportColumns : !!activeColumns && activeColumns !== displayedImageCount, 33267 onDeselect: () => setColumnsNumber(void 0), 33268 children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33269 import_components43.RangeControl, 33270 { 33271 label: (0, import_i18n75.__)("Columns"), 33272 value: activeColumns ? activeColumns : defaultColumnsNumber( 33273 displayedImageCount 33274 ), 33275 onChange: setColumnsNumber, 33276 min: 1, 33277 max: Math.min( 33278 MAX_COLUMNS, 33279 displayedImageCount 33280 ), 33281 required: true 33282 } 33283 ) 33284 } 33285 ), 33286 !isViewportStyleState && imageSizeOptions?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33287 import_components43.__experimentalToolsPanelItem, 33288 { 33289 isShownByDefault: true, 33290 label: (0, import_i18n75.__)("Resolution"), 33291 hasValue: () => sizeSlug !== DEFAULT_MEDIA_SIZE_SLUG2, 33292 onDeselect: () => updateImagesSize(DEFAULT_MEDIA_SIZE_SLUG2), 33293 children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33294 import_components43.SelectControl, 33295 { 33296 label: (0, import_i18n75.__)("Resolution"), 33297 help: (0, import_i18n75.__)( 33298 "Select the size of the source images." 33299 ), 33300 value: sizeSlug, 33301 options: imageSizeOptions, 33302 onChange: updateImagesSize, 33303 hideCancelButton: true 33304 } 33305 ) 33306 } 33307 ), 33308 isFlexLayout && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33309 import_components43.__experimentalToolsPanelItem, 33310 { 33311 isShownByDefault: true, 33312 label: (0, import_i18n75.__)("Crop images to fit"), 33313 hasValue: () => isViewportStyleState ? hasViewportImageCrop : !activeImageCrop, 33314 onDeselect: () => setGalleryFlexSettings({ 33315 imageCrop: isViewportStyleState ? void 0 : true 33316 }), 33317 children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33318 import_components43.ToggleControl, 33319 { 33320 label: (0, import_i18n75.__)("Crop images to fit"), 33321 checked: activeImageCrop, 33322 onChange: toggleImageCrop 33323 } 33324 ) 33325 } 33326 ), 33327 !isViewportStyleState && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33328 import_components43.__experimentalToolsPanelItem, 33329 { 33330 isShownByDefault: true, 33331 label: (0, import_i18n75.__)("Randomize order"), 33332 hasValue: () => !!randomOrder, 33333 onDeselect: () => setAttributes({ randomOrder: false }), 33334 children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33335 import_components43.ToggleControl, 33336 { 33337 label: (0, import_i18n75.__)("Randomize order"), 33338 checked: !!randomOrder, 33339 onChange: toggleRandomOrder 33340 } 33341 ) 33342 } 33343 ), 33344 !isViewportStyleState && hasLinkTo && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33345 import_components43.__experimentalToolsPanelItem, 33346 { 33347 isShownByDefault: true, 33348 label: (0, import_i18n75.__)("Open images in new tab"), 33349 hasValue: () => !!linkTarget, 33350 onDeselect: () => toggleOpenInNewTab(false), 33351 children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33352 import_components43.ToggleControl, 33353 { 33354 label: (0, import_i18n75.__)("Open images in new tab"), 33355 checked: linkTarget === "_blank", 33356 onChange: toggleOpenInNewTab 33357 } 33358 ) 33359 } 33360 ), 33361 !isViewportStyleState && aspectRatioOptions.length > 1 && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33362 import_components43.__experimentalToolsPanelItem, 33363 { 33364 hasValue: () => !!aspectRatio && aspectRatio !== "auto", 33365 label: (0, import_i18n75.__)("Aspect ratio"), 33366 onDeselect: () => setAspectRatio("auto"), 33367 isShownByDefault: true, 33368 children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33369 import_components43.SelectControl, 33370 { 33371 label: (0, import_i18n75.__)("Aspect ratio"), 33372 help: (0, import_i18n75.__)( 33373 "Set a consistent aspect ratio for all images in the gallery." 33374 ), 33375 value: aspectRatio, 33376 options: aspectRatioOptions, 33377 onChange: setAspectRatio 33378 } 33379 ) 33380 } 33381 ), 33382 !isViewportStyleState && lightboxSetting?.allowEditing && hasLightboxImages && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33383 import_components43.__experimentalToolsPanelItem, 33384 { 33385 label: (0, import_i18n75.__)("Navigation button type"), 33386 isShownByDefault: true, 33387 hasValue: () => navigationButtonType !== "icon", 33388 onDeselect: () => setAttributes({ 33389 navigationButtonType: "icon" 33390 }), 33391 children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33392 import_components43.__experimentalToggleGroupControl, 33393 { 33394 label: (0, import_i18n75.__)("Navigation button type"), 33395 value: navigationButtonType, 33396 onChange: (value) => setAttributes({ 33397 navigationButtonType: value 33398 }), 33399 isBlock: true, 33400 help: (0, import_i18n75.__)( 33401 "Adjust the appearance of buttons in the lightbox." 33402 ), 33403 children: NAVIGATION_BUTTON_TYPE_OPTIONS.map( 33404 (option) => /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33405 import_components43.__experimentalToggleGroupControlOption, 33406 { 33407 value: option.value, 33408 label: option.label 33409 }, 33410 option.value 33411 ) 33412 ) 33413 } 33414 ) 33415 } 33416 ) 33417 ] 33418 } 33419 ) 33420 ] 33421 } 33422 ), 33423 /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(import_block_editor88.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(import_components43.ToolbarDropdownMenu, { icon: link_default, label: (0, import_i18n75.__)("Link"), children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(import_components43.MenuGroup, { children: linkOptions.map((linkItem) => { 33424 const isOptionSelected = linkTo === linkItem.value; 33425 return /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33426 import_components43.MenuItem, 33427 { 33428 isSelected: isOptionSelected, 33429 className: clsx_default( 33430 "components-dropdown-menu__menu-item", 33431 { 33432 "is-active": isOptionSelected 33433 } 33434 ), 33435 iconPosition: "left", 33436 icon: linkItem.icon, 33437 onClick: () => { 33438 setLinkTo(linkItem.value); 33439 onClose(); 33440 }, 33441 role: "menuitemradio", 33442 info: linkItem.infoText, 33443 children: linkItem.label 33444 }, 33445 linkItem.value 33446 ); 33447 }) }) }) }), 33448 /* @__PURE__ */ (0, import_jsx_runtime289.jsxs)(import_jsx_runtime289.Fragment, { children: [ 33449 !multiGallerySelection && !isDynamic && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)(import_block_editor88.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33450 import_block_editor88.MediaReplaceFlow, 33451 { 33452 allowedTypes: ALLOWED_MEDIA_TYPES4, 33453 handleUpload: false, 33454 onSelect: updateImages, 33455 name: (0, import_i18n75.__)("Add"), 33456 multiple: true, 33457 mediaIds: images.filter((image) => image.id).map((image) => image.id), 33458 addToGallery: hasImageIds, 33459 variant: "toolbar" 33460 } 33461 ) }), 33462 isFlexLayout && /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33463 GalleryFlexStyles, 33464 { 33465 style: attributes2.style, 33466 clientId 33467 } 33468 ) 33469 ] }), 33470 isDynamic ? /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33471 GalleryDynamicView, 33472 { 33473 ...props, 33474 dynamic, 33475 blockProps, 33476 innerBlocksProps, 33477 multiGallerySelection 33478 } 33479 ) : /* @__PURE__ */ (0, import_jsx_runtime289.jsx)( 33480 Gallery, 33481 { 33482 ...props, 33483 isContentLocked, 33484 images, 33485 blockProps: innerBlocksProps, 33486 insertBlocksAfter, 33487 multiGallerySelection 33488 } 33489 ) 33490 ] }); 33491 } 33492 33493 // packages/block-library/build-module/gallery/block.json 33494 var block_default34 = { 33495 $schema: "https://schemas.wp.org/trunk/block.json", 33496 apiVersion: 3, 33497 name: "core/gallery", 33498 title: "Gallery", 33499 category: "media", 33500 usesContext: ["galleryId", "postId", "postType"], 33501 allowedBlocks: ["core/image"], 33502 description: "Display multiple images in a rich gallery.", 33503 keywords: ["images", "photos"], 33504 textdomain: "default", 33505 attributes: { 33506 images: { 33507 type: "array", 33508 default: [], 33509 source: "query", 33510 selector: ".blocks-gallery-item", 33511 query: { 33512 url: { 33513 type: "string", 33514 source: "attribute", 33515 selector: "img", 33516 attribute: "src" 33517 }, 33518 fullUrl: { 33519 type: "string", 33520 source: "attribute", 33521 selector: "img", 33522 attribute: "data-full-url" 33523 }, 33524 link: { 33525 type: "string", 33526 source: "attribute", 33527 selector: "img", 33528 attribute: "data-link" 33529 }, 33530 alt: { 33531 type: "string", 33532 source: "attribute", 33533 selector: "img", 33534 attribute: "alt", 33535 default: "" 33536 }, 33537 id: { 33538 type: "string", 33539 source: "attribute", 33540 selector: "img", 33541 attribute: "data-id" 33542 }, 33543 caption: { 33544 type: "rich-text", 33545 source: "rich-text", 33546 selector: ".blocks-gallery-item__caption" 33547 } 33548 } 33549 }, 33550 ids: { 33551 type: "array", 33552 items: { 33553 type: "number" 33554 }, 33555 default: [] 33556 }, 33557 dynamicContent: { 33558 type: "object" 33559 }, 33560 navigationButtonType: { 33561 type: "string", 33562 default: "icon", 33563 enum: ["icon", "text", "both"] 33564 }, 33565 shortCodeTransforms: { 33566 type: "array", 33567 items: { 33568 type: "object" 33569 }, 33570 default: [] 33571 }, 33572 columns: { 33573 type: "number", 33574 minimum: 1, 33575 maximum: 8 33576 }, 33577 caption: { 33578 type: "rich-text", 33579 source: "rich-text", 33580 selector: ".blocks-gallery-caption", 33581 role: "content" 33582 }, 33583 imageCrop: { 33584 type: "boolean", 33585 default: true 33586 }, 33587 randomOrder: { 33588 type: "boolean", 33589 default: false 33590 }, 33591 fixedHeight: { 33592 type: "boolean", 33593 default: true 33594 }, 33595 linkTarget: { 33596 type: "string" 33597 }, 33598 linkTo: { 33599 type: "string" 33600 }, 33601 sizeSlug: { 33602 type: "string", 33603 default: "large" 33604 }, 33605 allowResize: { 33606 type: "boolean", 33607 default: false 33608 }, 33609 aspectRatio: { 33610 type: "string", 33611 default: "auto" 33612 } 33613 }, 33614 providesContext: { 33615 allowResize: "allowResize", 33616 imageCrop: "imageCrop", 33617 fixedHeight: "fixedHeight", 33618 navigationButtonType: "navigationButtonType" 33619 }, 33620 supports: { 33621 anchor: true, 33622 align: true, 33623 __experimentalBorder: { 33624 radius: true, 33625 color: true, 33626 width: true, 33627 style: true, 33628 __experimentalDefaultControls: { 33629 color: true, 33630 radius: true 33631 } 33632 }, 33633 html: false, 33634 units: ["px", "em", "rem", "vh", "vw"], 33635 spacing: { 33636 margin: true, 33637 padding: true, 33638 blockGap: { 33639 sides: ["horizontal", "vertical"], 33640 __experimentalDefault: "var( --wp--style--gallery-gap-default, var( --gallery-block--gutter-size, var( --wp--style--block-gap, 0.5em ) ) )" 33641 }, 33642 __experimentalDefaultControls: { 33643 blockGap: true, 33644 margin: false, 33645 padding: false 33646 } 33647 }, 33648 color: { 33649 text: false, 33650 background: true, 33651 gradients: true 33652 }, 33653 layout: { 33654 allowSwitching: false, 33655 allowInheriting: false, 33656 allowEditing: true, 33657 allowOrientation: false, 33658 allowJustification: false, 33659 allowVerticalAlignment: false, 33660 allowWrap: false, 33661 allowSizingOnChildren: true, 33662 default: { 33663 type: "flex" 33664 } 33665 }, 33666 interactivity: { 33667 clientNavigation: true 33668 }, 33669 listView: true 33670 }, 33671 editorStyle: "wp-block-gallery-editor", 33672 style: "wp-block-gallery" 33673 }; 33674 33675 // packages/block-library/build-module/gallery/save.mjs 33676 var import_block_editor89 = __toESM(require_block_editor(), 1); 33677 var import_jsx_runtime290 = __toESM(require_jsx_runtime(), 1); 33678 function saveWithInnerBlocks({ attributes: attributes2 }) { 33679 const { caption, columns, imageCrop, dynamicContent, layout } = attributes2; 33680 const isFlexLayout = isGalleryFlexLayout(layout); 33681 const captionElement = !import_block_editor89.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime290.jsx)( 33682 import_block_editor89.RichText.Content, 33683 { 33684 tagName: "figcaption", 33685 className: clsx_default( 33686 "blocks-gallery-caption", 33687 (0, import_block_editor89.__experimentalGetElementClassName)("caption") 33688 ), 33689 value: caption 33690 } 33691 ); 33692 if (dynamicContent) { 33693 return captionElement || null; 33694 } 33695 const className = clsx_default("has-nested-images", { 33696 [`columns-$columns}`]: isFlexLayout && columns !== void 0, 33697 [`columns-default`]: isFlexLayout && columns === void 0, 33698 "is-cropped": isFlexLayout && imageCrop 33699 }); 33700 const blockProps = import_block_editor89.useBlockProps.save({ className }); 33701 const innerBlocksProps = import_block_editor89.useInnerBlocksProps.save(blockProps); 33702 return /* @__PURE__ */ (0, import_jsx_runtime290.jsxs)("figure", { ...innerBlocksProps, children: [ 33703 innerBlocksProps.children, 33704 captionElement 33705 ] }); 33706 } 33707 33708 // packages/block-library/build-module/gallery/transforms.mjs 33709 var import_blocks32 = __toESM(require_blocks(), 1); 33710 var import_blob11 = __toESM(require_blob(), 1); 33711 var import_hooks25 = __toESM(require_hooks(), 1); 33712 var parseShortcodeIds = (ids) => { 33713 if (!ids) { 33714 return []; 33715 } 33716 return ids.split(",").map((id) => parseInt(id, 10)); 33717 }; 33718 var cloneInnerBlocks = (innerBlocks) => innerBlocks.map( 33719 (innerBlock) => (0, import_blocks32.createBlock)( 33720 innerBlock.name, 33721 innerBlock.attributes, 33722 cloneInnerBlocks(innerBlock.innerBlocks || []) 33723 ) 33724 ); 33725 function updateThirdPartyTransformToGallery(block) { 33726 if (block.name === "core/gallery" && block.attributes?.images.length > 0) { 33727 const innerBlocks = block.attributes.images.map( 33728 ({ url, id, alt }) => { 33729 return (0, import_blocks32.createBlock)("core/image", { 33730 url, 33731 id: id ? parseInt(id, 10) : null, 33732 alt, 33733 sizeSlug: block.attributes.sizeSlug, 33734 linkDestination: block.attributes.linkDestination 33735 }); 33736 } 33737 ); 33738 delete block.attributes.ids; 33739 delete block.attributes.images; 33740 block.innerBlocks = innerBlocks; 33741 } 33742 return block; 33743 } 33744 (0, import_hooks25.addFilter)( 33745 "blocks.switchToBlockType.transformedBlock", 33746 "core/gallery/update-third-party-transform-to", 33747 updateThirdPartyTransformToGallery 33748 ); 33749 function updateThirdPartyTransformFromGallery(toBlock, fromBlocks) { 33750 const from = Array.isArray(fromBlocks) ? fromBlocks : [fromBlocks]; 33751 const galleryBlock = from.find( 33752 (transformedBlock) => transformedBlock.name === "core/gallery" && transformedBlock.innerBlocks.length > 0 && !transformedBlock.attributes.images?.length > 0 && !toBlock.name.includes("core/") 33753 ); 33754 if (galleryBlock) { 33755 const images = galleryBlock.innerBlocks.map( 33756 ({ attributes: { url, id, alt } }) => ({ 33757 url, 33758 id: id ? parseInt(id, 10) : null, 33759 alt 33760 }) 33761 ); 33762 const ids = images.map(({ id }) => id); 33763 galleryBlock.attributes.images = images; 33764 galleryBlock.attributes.ids = ids; 33765 } 33766 return toBlock; 33767 } 33768 (0, import_hooks25.addFilter)( 33769 "blocks.switchToBlockType.transformedBlock", 33770 "core/gallery/update-third-party-transform-from", 33771 updateThirdPartyTransformFromGallery 33772 ); 33773 var transforms9 = { 33774 from: [ 33775 { 33776 type: "block", 33777 isMultiBlock: true, 33778 blocks: ["core/image"], 33779 transform: (attributes2) => { 33780 let { align, sizeSlug } = attributes2[0]; 33781 align = attributes2.every( 33782 (attribute) => attribute.align === align 33783 ) ? align : void 0; 33784 sizeSlug = attributes2.every( 33785 (attribute) => attribute.sizeSlug === sizeSlug 33786 ) ? sizeSlug : void 0; 33787 const validImages = attributes2.filter(({ url }) => url); 33788 const innerBlocks = validImages.map((image) => { 33789 image.width = void 0; 33790 image.height = void 0; 33791 return (0, import_blocks32.createBlock)("core/image", image); 33792 }); 33793 return (0, import_blocks32.createBlock)( 33794 "core/gallery", 33795 { 33796 align, 33797 sizeSlug 33798 }, 33799 innerBlocks 33800 ); 33801 } 33802 }, 33803 { 33804 type: "shortcode", 33805 tag: "gallery", 33806 transform({ named: { ids, columns = 3, link, orderby, size } }) { 33807 const imageIds = parseShortcodeIds(ids).map( 33808 (id) => parseInt(id, 10) 33809 ); 33810 let linkTo = LINK_DESTINATION_NONE; 33811 if (link === "post") { 33812 linkTo = LINK_DESTINATION_ATTACHMENT; 33813 } else if (link === "file") { 33814 linkTo = LINK_DESTINATION_MEDIA; 33815 } 33816 const galleryBlock = (0, import_blocks32.createBlock)( 33817 "core/gallery", 33818 { 33819 columns: parseInt(columns, 10), 33820 linkTo, 33821 randomOrder: orderby === "rand", 33822 ...size && { sizeSlug: size } 33823 }, 33824 imageIds.map( 33825 (imageId) => (0, import_blocks32.createBlock)("core/image", { 33826 id: imageId, 33827 ...size && { sizeSlug: size } 33828 }) 33829 ) 33830 ); 33831 return galleryBlock; 33832 }, 33833 isMatch({ named }) { 33834 return void 0 !== named.ids; 33835 } 33836 }, 33837 { 33838 // When created by drag and dropping multiple files on an insertion point. Because multiple 33839 // files must not be transformed to a gallery when dropped within a gallery there is another transform 33840 // within the image block to handle that case. Therefore this transform has to have priority 1 33841 // set so that it overrides the image block transformation when multiple images are dropped outside 33842 // of a gallery block. 33843 type: "files", 33844 priority: 1, 33845 isMatch(files) { 33846 return files.length !== 1 && files.every( 33847 (file) => file.type.indexOf("image/") === 0 33848 ); 33849 }, 33850 transform(files) { 33851 const innerBlocks = files.map( 33852 (file) => (0, import_blocks32.createBlock)("core/image", { 33853 blob: (0, import_blob11.createBlobURL)(file) 33854 }) 33855 ); 33856 return (0, import_blocks32.createBlock)("core/gallery", {}, innerBlocks); 33857 } 33858 } 33859 ], 33860 to: [ 33861 { 33862 type: "block", 33863 blocks: ["core/image"], 33864 // A dynamic gallery has no inner blocks — its images are resolved 33865 // from a source at render time — so this transform would produce a 33866 // single empty image and drop the source. 33867 isMatch: ({ dynamicContent }) => !dynamicContent, 33868 transform: ({ align }, innerBlocks) => { 33869 if (innerBlocks.length > 0) { 33870 return innerBlocks.map( 33871 ({ 33872 attributes: { 33873 url, 33874 alt, 33875 caption, 33876 title, 33877 href, 33878 rel, 33879 linkClass, 33880 id, 33881 sizeSlug: imageSizeSlug, 33882 linkDestination, 33883 linkTarget, 33884 anchor, 33885 className 33886 } 33887 }) => (0, import_blocks32.createBlock)("core/image", { 33888 align, 33889 url, 33890 alt, 33891 caption, 33892 title, 33893 href, 33894 rel, 33895 linkClass, 33896 id, 33897 sizeSlug: imageSizeSlug, 33898 linkDestination, 33899 linkTarget, 33900 anchor, 33901 className 33902 }) 33903 ); 33904 } 33905 return (0, import_blocks32.createBlock)("core/image", { align }); 33906 } 33907 }, 33908 { 33909 type: "block", 33910 blocks: ["core/group"], 33911 variationName: "group-grid", 33912 // As above: with no inner blocks to clone, a dynamic gallery would 33913 // transform into an empty grid. 33914 isMatch: ({ dynamicContent }) => !dynamicContent, 33915 transform: (attributes2, innerBlocks) => { 33916 const { 33917 allowResize, 33918 aspectRatio, 33919 caption, 33920 columns, 33921 dynamicContent, 33922 fixedHeight, 33923 ids, 33924 imageCrop, 33925 images, 33926 linkTarget, 33927 linkTo, 33928 navigationButtonType, 33929 randomOrder, 33930 shortCodeTransforms, 33931 sizeSlug, 33932 ...rest 33933 } = attributes2; 33934 return (0, import_blocks32.createBlock)( 33935 "core/group", 33936 { 33937 ...rest, 33938 layout: { 33939 type: "grid", 33940 columnCount: columns ?? defaultColumnsNumber(innerBlocks.length) 33941 } 33942 }, 33943 cloneInnerBlocks(innerBlocks) 33944 ); 33945 } 33946 } 33947 ] 33948 }; 33949 var transforms_default10 = transforms9; 33950 33951 // packages/block-library/build-module/gallery/variations.mjs 33952 var import_i18n76 = __toESM(require_i18n(), 1); 33953 var variations6 = [ 33954 { 33955 name: "dynamic-gallery", 33956 title: (0, import_i18n76.__)("Dynamic Gallery"), 33957 description: (0, import_i18n76.__)( 33958 "Display images from a source, such as those attached to the current post." 33959 ), 33960 attributes: { 33961 dynamicContent: { source: ATTACHED_MEDIA } 33962 }, 33963 // Match any gallery that has a dynamic source configured, regardless of 33964 // the specific source or options, so the variation's title and 33965 // description describe the block whenever it runs in dynamic mode. 33966 isActive: (blockAttributes8) => !!blockAttributes8.dynamicContent, 33967 // No scopes for now. While dynamic mode only supports the "attached to the 33968 // current post" source, `'inserter'` is intentionally omitted: a dedicated 33969 // inserter entry would surface in post-less contexts (templates, template 33970 // parts, synced patterns) where there's no post to resolve images from. The 33971 // entry point is instead the inspector toggle on a regular Gallery. 33972 // `isActive` still relabels the block card to "Dynamic Gallery" regardless 33973 // of scope. Revisit adding `'inserter'` in a follow-up as the feature grows 33974 // beyond the post-attached source. 33975 scope: [] 33976 }, 33977 { 33978 name: "gallery-flex", 33979 title: (0, import_i18n76.__)("Gallery"), 33980 description: (0, import_i18n76.__)("Arrange images in flexible rows."), 33981 icon: gallery_default, 33982 attributes: { 33983 layout: { 33984 type: "flex" 33985 } 33986 }, 33987 isActive: (blockAttributes8) => isGalleryFlexLayout(blockAttributes8.layout), 33988 scope: ["transform"] 33989 }, 33990 { 33991 name: "gallery-grid", 33992 title: (0, import_i18n76.__)("Gallery Grid"), 33993 description: (0, import_i18n76.__)("Arrange images in a grid."), 33994 icon: grid_default, 33995 attributes: { 33996 layout: { 33997 type: "grid" 33998 } 33999 }, 34000 isActive: (blockAttributes8) => blockAttributes8.layout?.type === "grid", 34001 scope: ["transform"] 34002 } 34003 ]; 34004 var variations_default6 = variations6; 34005 34006 // packages/block-library/build-module/gallery/index.mjs 34007 var { name: name34 } = block_default34; 34008 var settings34 = { 34009 icon: gallery_default, 34010 example: { 34011 attributes: { 34012 columns: 2 34013 }, 34014 innerBlocks: [ 34015 { 34016 name: "core/image", 34017 attributes: { 34018 url: "https://s.w.org/images/core/5.3/Glacial_lakes%2C_Bhutan.jpg" 34019 } 34020 }, 34021 { 34022 name: "core/image", 34023 attributes: { 34024 url: "https://s.w.org/images/core/5.3/Sediment_off_the_Yucatan_Peninsula.jpg" 34025 } 34026 } 34027 ] 34028 }, 34029 transforms: transforms_default10, 34030 variations: variations_default6, 34031 edit: GalleryEdit, 34032 save: saveWithInnerBlocks, 34033 deprecated: deprecated_default17 34034 }; 34035 var init34 = () => initBlock({ name: name34, metadata: block_default34, settings: settings34 }); 34036 34037 // packages/block-library/build-module/group/index.mjs 34038 var group_exports = {}; 34039 __export(group_exports, { 34040 init: () => init35, 34041 metadata: () => block_default35, 34042 name: () => name35, 34043 settings: () => settings35 34044 }); 34045 var import_i18n80 = __toESM(require_i18n(), 1); 34046 34047 // packages/block-library/build-module/group/deprecated.mjs 34048 var import_block_editor90 = __toESM(require_block_editor(), 1); 34049 var import_jsx_runtime291 = __toESM(require_jsx_runtime(), 1); 34050 var migrateAttributes = (attributes2) => { 34051 if (!attributes2.tagName) { 34052 attributes2 = { 34053 ...attributes2, 34054 tagName: "div" 34055 }; 34056 } 34057 if (!attributes2.customTextColor && !attributes2.customBackgroundColor) { 34058 return attributes2; 34059 } 34060 const style2 = { color: {} }; 34061 if (attributes2.customTextColor) { 34062 style2.color.text = attributes2.customTextColor; 34063 } 34064 if (attributes2.customBackgroundColor) { 34065 style2.color.background = attributes2.customBackgroundColor; 34066 } 34067 const { customTextColor, customBackgroundColor, ...restAttributes } = attributes2; 34068 return { 34069 ...restAttributes, 34070 style: style2 34071 }; 34072 }; 34073 var deprecated7 = [ 34074 // Version with default layout. 34075 { 34076 attributes: { 34077 tagName: { 34078 type: "string", 34079 default: "div" 34080 }, 34081 templateLock: { 34082 type: ["string", "boolean"], 34083 enum: ["all", "insert", false] 34084 } 34085 }, 34086 supports: { 34087 __experimentalOnEnter: true, 34088 __experimentalSettings: true, 34089 align: ["wide", "full"], 34090 anchor: true, 34091 ariaLabel: true, 34092 html: false, 34093 color: { 34094 gradients: true, 34095 link: true, 34096 __experimentalDefaultControls: { 34097 background: true, 34098 text: true 34099 } 34100 }, 34101 spacing: { 34102 margin: ["top", "bottom"], 34103 padding: true, 34104 blockGap: true, 34105 __experimentalDefaultControls: { 34106 padding: true, 34107 blockGap: true 34108 } 34109 }, 34110 __experimentalBorder: { 34111 color: true, 34112 radius: true, 34113 style: true, 34114 width: true, 34115 __experimentalDefaultControls: { 34116 color: true, 34117 radius: true, 34118 style: true, 34119 width: true 34120 } 34121 }, 34122 typography: { 34123 fontSize: true, 34124 lineHeight: true, 34125 __experimentalFontStyle: true, 34126 __experimentalFontWeight: true, 34127 __experimentalLetterSpacing: true, 34128 __experimentalTextTransform: true, 34129 __experimentalDefaultControls: { 34130 fontSize: true 34131 } 34132 }, 34133 layout: true 34134 }, 34135 save({ attributes: { tagName: Tag } }) { 34136 return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(Tag, { ...import_block_editor90.useInnerBlocksProps.save(import_block_editor90.useBlockProps.save()) }); 34137 }, 34138 isEligible: ({ layout }) => layout?.inherit || layout?.contentSize && layout?.type !== "constrained", 34139 migrate: (attributes2) => { 34140 const { layout = null } = attributes2; 34141 if (layout?.inherit || layout?.contentSize) { 34142 return { 34143 ...attributes2, 34144 layout: { 34145 ...layout, 34146 type: "constrained" 34147 } 34148 }; 34149 } 34150 } 34151 }, 34152 // Version of the block with the double div. 34153 { 34154 attributes: { 34155 tagName: { 34156 type: "string", 34157 default: "div" 34158 }, 34159 templateLock: { 34160 type: ["string", "boolean"], 34161 enum: ["all", "insert", false] 34162 } 34163 }, 34164 supports: { 34165 align: ["wide", "full"], 34166 anchor: true, 34167 color: { 34168 gradients: true, 34169 link: true 34170 }, 34171 spacing: { 34172 padding: true 34173 }, 34174 __experimentalBorder: { 34175 radius: true 34176 } 34177 }, 34178 save({ attributes: attributes2 }) { 34179 const { tagName: Tag } = attributes2; 34180 return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(Tag, { ...import_block_editor90.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)("div", { className: "wp-block-group__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(import_block_editor90.InnerBlocks.Content, {}) }) }); 34181 } 34182 }, 34183 // Version of the block without global styles support 34184 { 34185 attributes: { 34186 backgroundColor: { 34187 type: "string" 34188 }, 34189 customBackgroundColor: { 34190 type: "string" 34191 }, 34192 textColor: { 34193 type: "string" 34194 }, 34195 customTextColor: { 34196 type: "string" 34197 } 34198 }, 34199 supports: { 34200 align: ["wide", "full"], 34201 anchor: true, 34202 html: false 34203 }, 34204 migrate: migrateAttributes, 34205 save({ attributes: attributes2 }) { 34206 const { 34207 backgroundColor, 34208 customBackgroundColor, 34209 textColor, 34210 customTextColor 34211 } = attributes2; 34212 const backgroundClass = (0, import_block_editor90.getColorClassName)( 34213 "background-color", 34214 backgroundColor 34215 ); 34216 const textClass = (0, import_block_editor90.getColorClassName)("color", textColor); 34217 const className = clsx_default(backgroundClass, textClass, { 34218 "has-text-color": textColor || customTextColor, 34219 "has-background": backgroundColor || customBackgroundColor 34220 }); 34221 const styles = { 34222 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 34223 color: textClass ? void 0 : customTextColor 34224 }; 34225 return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)("div", { className, style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)("div", { className: "wp-block-group__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(import_block_editor90.InnerBlocks.Content, {}) }) }); 34226 } 34227 }, 34228 // Version of the group block with a bug that made text color class not applied. 34229 { 34230 attributes: { 34231 backgroundColor: { 34232 type: "string" 34233 }, 34234 customBackgroundColor: { 34235 type: "string" 34236 }, 34237 textColor: { 34238 type: "string" 34239 }, 34240 customTextColor: { 34241 type: "string" 34242 } 34243 }, 34244 migrate: migrateAttributes, 34245 supports: { 34246 align: ["wide", "full"], 34247 anchor: true, 34248 html: false 34249 }, 34250 save({ attributes: attributes2 }) { 34251 const { 34252 backgroundColor, 34253 customBackgroundColor, 34254 textColor, 34255 customTextColor 34256 } = attributes2; 34257 const backgroundClass = (0, import_block_editor90.getColorClassName)( 34258 "background-color", 34259 backgroundColor 34260 ); 34261 const textClass = (0, import_block_editor90.getColorClassName)("color", textColor); 34262 const className = clsx_default(backgroundClass, { 34263 "has-text-color": textColor || customTextColor, 34264 "has-background": backgroundColor || customBackgroundColor 34265 }); 34266 const styles = { 34267 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 34268 color: textClass ? void 0 : customTextColor 34269 }; 34270 return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)("div", { className, style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)("div", { className: "wp-block-group__inner-container", children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(import_block_editor90.InnerBlocks.Content, {}) }) }); 34271 } 34272 }, 34273 // v1 of group block. Deprecated to add an inner-container div around `InnerBlocks.Content`. 34274 { 34275 attributes: { 34276 backgroundColor: { 34277 type: "string" 34278 }, 34279 customBackgroundColor: { 34280 type: "string" 34281 } 34282 }, 34283 supports: { 34284 align: ["wide", "full"], 34285 anchor: true, 34286 html: false 34287 }, 34288 migrate: migrateAttributes, 34289 save({ attributes: attributes2 }) { 34290 const { backgroundColor, customBackgroundColor } = attributes2; 34291 const backgroundClass = (0, import_block_editor90.getColorClassName)( 34292 "background-color", 34293 backgroundColor 34294 ); 34295 const className = clsx_default(backgroundClass, { 34296 "has-background": backgroundColor || customBackgroundColor 34297 }); 34298 const styles = { 34299 backgroundColor: backgroundClass ? void 0 : customBackgroundColor 34300 }; 34301 return /* @__PURE__ */ (0, import_jsx_runtime291.jsx)("div", { className, style: styles, children: /* @__PURE__ */ (0, import_jsx_runtime291.jsx)(import_block_editor90.InnerBlocks.Content, {}) }); 34302 } 34303 } 34304 ]; 34305 var deprecated_default18 = deprecated7; 34306 34307 // packages/block-library/build-module/group/edit.mjs 34308 var import_data39 = __toESM(require_data(), 1); 34309 var import_block_editor92 = __toESM(require_block_editor(), 1); 34310 var import_element62 = __toESM(require_element(), 1); 34311 var import_i18n78 = __toESM(require_i18n(), 1); 34312 34313 // packages/block-library/build-module/group/placeholder.mjs 34314 var import_data38 = __toESM(require_data(), 1); 34315 var import_block_editor91 = __toESM(require_block_editor(), 1); 34316 var import_i18n77 = __toESM(require_i18n(), 1); 34317 var import_blocks33 = __toESM(require_blocks(), 1); 34318 var import_components44 = __toESM(require_components(), 1); 34319 var import_element61 = __toESM(require_element(), 1); 34320 var import_jsx_runtime292 = __toESM(require_jsx_runtime(), 1); 34321 var getGroupPlaceholderIcons = (name118 = "group") => { 34322 const icons = { 34323 group: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)( 34324 import_components44.SVG, 34325 { 34326 xmlns: "http://www.w3.org/2000/svg", 34327 width: "48", 34328 height: "48", 34329 viewBox: "0 0 48 48", 34330 children: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(import_components44.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Z" }) 34331 } 34332 ), 34333 "group-row": /* @__PURE__ */ (0, import_jsx_runtime292.jsx)( 34334 import_components44.SVG, 34335 { 34336 xmlns: "http://www.w3.org/2000/svg", 34337 width: "48", 34338 height: "48", 34339 viewBox: "0 0 48 48", 34340 children: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(import_components44.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v28a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10Z" }) 34341 } 34342 ), 34343 "group-stack": /* @__PURE__ */ (0, import_jsx_runtime292.jsx)( 34344 import_components44.SVG, 34345 { 34346 xmlns: "http://www.w3.org/2000/svg", 34347 width: "48", 34348 height: "48", 34349 viewBox: "0 0 48 48", 34350 children: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(import_components44.Path, { d: "M0 10a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm0 17a2 2 0 0 1 2-2h44a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Z" }) 34351 } 34352 ), 34353 "group-grid": /* @__PURE__ */ (0, import_jsx_runtime292.jsx)( 34354 import_components44.SVG, 34355 { 34356 xmlns: "http://www.w3.org/2000/svg", 34357 width: "48", 34358 height: "48", 34359 viewBox: "0 0 48 48", 34360 children: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)(import_components44.Path, { d: "M0 10a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V10Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V10ZM0 27a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V27Zm25 0a2 2 0 0 1 2-2h19a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H27a2 2 0 0 1-2-2V27Z" }) 34361 } 34362 ) 34363 }; 34364 return icons?.[name118]; 34365 }; 34366 function useShouldShowPlaceHolder({ 34367 attributes: attributes2 = { 34368 style: void 0, 34369 backgroundColor: void 0, 34370 textColor: void 0, 34371 fontSize: void 0 34372 }, 34373 usedLayoutType = "", 34374 hasInnerBlocks = false 34375 }) { 34376 const { style: style2, backgroundColor, textColor, fontSize } = attributes2; 34377 const [showPlaceholder, setShowPlaceholder] = (0, import_element61.useState)( 34378 !hasInnerBlocks && !backgroundColor && !fontSize && !textColor && !style2 && usedLayoutType !== "flex" && usedLayoutType !== "grid" 34379 ); 34380 (0, import_element61.useEffect)(() => { 34381 if (!!hasInnerBlocks || !!backgroundColor || !!fontSize || !!textColor || !!style2 || usedLayoutType === "flex") { 34382 setShowPlaceholder(false); 34383 } 34384 }, [ 34385 backgroundColor, 34386 fontSize, 34387 textColor, 34388 style2, 34389 usedLayoutType, 34390 hasInnerBlocks 34391 ]); 34392 return [showPlaceholder, setShowPlaceholder]; 34393 } 34394 function GroupPlaceHolder({ name: name118, onSelect }) { 34395 const variations20 = (0, import_data38.useSelect)( 34396 (select10) => select10(import_blocks33.store).getBlockVariations(name118, "block"), 34397 [name118] 34398 ); 34399 const blockProps = (0, import_block_editor91.useBlockProps)({ 34400 className: "wp-block-group__placeholder" 34401 }); 34402 (0, import_element61.useEffect)(() => { 34403 if (variations20 && variations20.length === 1) { 34404 onSelect(variations20[0]); 34405 } 34406 }, [onSelect, variations20]); 34407 return /* @__PURE__ */ (0, import_jsx_runtime292.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)( 34408 import_components44.Placeholder, 34409 { 34410 instructions: (0, import_i18n77.__)("Group blocks together. Select a layout:"), 34411 children: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)( 34412 "ul", 34413 { 34414 role: "list", 34415 className: "wp-block-group-placeholder__variations", 34416 "aria-label": (0, import_i18n77.__)("Block variations"), 34417 children: variations20.map((variation) => /* @__PURE__ */ (0, import_jsx_runtime292.jsx)("li", { children: /* @__PURE__ */ (0, import_jsx_runtime292.jsx)( 34418 import_components44.Button, 34419 { 34420 __next40pxDefaultSize: true, 34421 variant: "tertiary", 34422 icon: getGroupPlaceholderIcons( 34423 variation.name 34424 ), 34425 iconSize: 48, 34426 onClick: () => onSelect(variation), 34427 className: "wp-block-group-placeholder__variation-button", 34428 label: `$variation.title}: $variation.description}` 34429 } 34430 ) }, variation.name)) 34431 } 34432 ) 34433 } 34434 ) }); 34435 } 34436 var placeholder_default = GroupPlaceHolder; 34437 34438 // packages/block-library/build-module/group/edit.mjs 34439 var import_jsx_runtime293 = __toESM(require_jsx_runtime(), 1); 34440 var { HTMLElementControl: HTMLElementControl4 } = unlock(import_block_editor92.privateApis); 34441 function GroupEditControls({ tagName, onSelectTagName, clientId }) { 34442 return /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(import_block_editor92.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime293.jsx)( 34443 HTMLElementControl4, 34444 { 34445 tagName, 34446 onChange: onSelectTagName, 34447 clientId, 34448 options: [ 34449 { label: (0, import_i18n78.__)("Default (<div>)"), value: "div" }, 34450 { label: "<header>", value: "header" }, 34451 { label: "<main>", value: "main" }, 34452 { label: "<section>", value: "section" }, 34453 { label: "<article>", value: "article" }, 34454 { label: "<aside>", value: "aside" }, 34455 { label: "<footer>", value: "footer" } 34456 ] 34457 } 34458 ) }); 34459 } 34460 function GroupEdit({ attributes: attributes2, name: name118, setAttributes, clientId }) { 34461 const { hasInnerBlocks, themeSupportsLayout } = (0, import_data39.useSelect)( 34462 (select10) => { 34463 const { getBlock, getSettings: getSettings2 } = select10(import_block_editor92.store); 34464 const block = getBlock(clientId); 34465 return { 34466 hasInnerBlocks: !!(block && block.innerBlocks.length), 34467 themeSupportsLayout: getSettings2()?.supportsLayout 34468 }; 34469 }, 34470 [clientId] 34471 ); 34472 const { 34473 tagName: TagName2 = "div", 34474 templateLock, 34475 allowedBlocks, 34476 layout = {} 34477 } = attributes2; 34478 const { type = "default" } = layout; 34479 const layoutSupportEnabled = themeSupportsLayout || type === "flex" || type === "grid"; 34480 const ref = (0, import_element62.useRef)(); 34481 const blockProps = (0, import_block_editor92.useBlockProps)({ ref }); 34482 const [showPlaceholder, setShowPlaceholder] = useShouldShowPlaceHolder({ 34483 attributes: attributes2, 34484 usedLayoutType: type, 34485 hasInnerBlocks 34486 }); 34487 let renderAppender; 34488 if (showPlaceholder) { 34489 renderAppender = false; 34490 } else if (!hasInnerBlocks) { 34491 renderAppender = import_block_editor92.InnerBlocks.ButtonBlockAppender; 34492 } 34493 const innerBlocksProps = (0, import_block_editor92.useInnerBlocksProps)( 34494 layoutSupportEnabled ? blockProps : { className: "wp-block-group__inner-container" }, 34495 { 34496 dropZoneElement: ref.current, 34497 templateLock, 34498 allowedBlocks, 34499 renderAppender 34500 } 34501 ); 34502 const { selectBlock } = (0, import_data39.useDispatch)(import_block_editor92.store); 34503 const selectVariation = (nextVariation) => { 34504 setAttributes(nextVariation.attributes); 34505 selectBlock(clientId, -1); 34506 setShowPlaceholder(false); 34507 }; 34508 return /* @__PURE__ */ (0, import_jsx_runtime293.jsxs)(import_jsx_runtime293.Fragment, { children: [ 34509 /* @__PURE__ */ (0, import_jsx_runtime293.jsx)( 34510 GroupEditControls, 34511 { 34512 tagName: TagName2, 34513 onSelectTagName: (value) => setAttributes({ tagName: value }), 34514 clientId 34515 } 34516 ), 34517 showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime293.jsxs)("div", { children: [ 34518 innerBlocksProps.children, 34519 /* @__PURE__ */ (0, import_jsx_runtime293.jsx)( 34520 placeholder_default, 34521 { 34522 name: name118, 34523 onSelect: selectVariation 34524 } 34525 ) 34526 ] }), 34527 layoutSupportEnabled && !showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(TagName2, { ...innerBlocksProps }), 34528 !layoutSupportEnabled && !showPlaceholder && /* @__PURE__ */ (0, import_jsx_runtime293.jsx)(TagName2, { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime293.jsx)("div", { ...innerBlocksProps }) }) 34529 ] }); 34530 } 34531 var edit_default11 = GroupEdit; 34532 34533 // packages/block-library/build-module/group/block.json 34534 var block_default35 = { 34535 $schema: "https://schemas.wp.org/trunk/block.json", 34536 apiVersion: 3, 34537 name: "core/group", 34538 title: "Group", 34539 category: "design", 34540 description: "Gather blocks in a layout container.", 34541 keywords: ["container", "wrapper", "row", "section"], 34542 textdomain: "default", 34543 attributes: { 34544 tagName: { 34545 type: "string", 34546 default: "div" 34547 }, 34548 templateLock: { 34549 type: ["string", "boolean"], 34550 enum: ["all", "insert", "contentOnly", false] 34551 } 34552 }, 34553 supports: { 34554 __experimentalOnEnter: true, 34555 __experimentalSettings: true, 34556 align: ["wide", "full"], 34557 anchor: true, 34558 ariaLabel: true, 34559 html: false, 34560 background: { 34561 backgroundImage: true, 34562 backgroundSize: true, 34563 gradient: true, 34564 __experimentalDefaultControls: { 34565 backgroundImage: true, 34566 gradient: true 34567 } 34568 }, 34569 color: { 34570 gradients: true, 34571 heading: true, 34572 button: true, 34573 link: true, 34574 __experimentalDefaultControls: { 34575 background: true, 34576 text: true 34577 } 34578 }, 34579 shadow: true, 34580 spacing: { 34581 margin: ["top", "bottom"], 34582 padding: true, 34583 blockGap: ["horizontal", "vertical"], 34584 __experimentalDefaultControls: { 34585 padding: true, 34586 blockGap: true 34587 } 34588 }, 34589 dimensions: { 34590 minHeight: true, 34591 minWidth: true 34592 }, 34593 __experimentalBorder: { 34594 color: true, 34595 radius: true, 34596 style: true, 34597 width: true, 34598 __experimentalDefaultControls: { 34599 color: true, 34600 radius: true, 34601 style: true, 34602 width: true 34603 } 34604 }, 34605 position: { 34606 sticky: true 34607 }, 34608 typography: { 34609 fontSize: true, 34610 lineHeight: true, 34611 __experimentalFontFamily: true, 34612 __experimentalFontWeight: true, 34613 __experimentalFontStyle: true, 34614 __experimentalTextTransform: true, 34615 __experimentalTextDecoration: true, 34616 __experimentalLetterSpacing: true, 34617 __experimentalDefaultControls: { 34618 fontSize: true 34619 } 34620 }, 34621 layout: { 34622 allowSizingOnChildren: true 34623 }, 34624 interactivity: { 34625 clientNavigation: true 34626 }, 34627 allowedBlocks: true 34628 }, 34629 editorStyle: "wp-block-group-editor", 34630 style: "wp-block-group" 34631 }; 34632 34633 // packages/block-library/build-module/group/save.mjs 34634 var import_block_editor93 = __toESM(require_block_editor(), 1); 34635 var import_jsx_runtime294 = __toESM(require_jsx_runtime(), 1); 34636 function save18({ attributes: { tagName: Tag } }) { 34637 return /* @__PURE__ */ (0, import_jsx_runtime294.jsx)(Tag, { ...import_block_editor93.useInnerBlocksProps.save(import_block_editor93.useBlockProps.save()) }); 34638 } 34639 34640 // packages/block-library/build-module/group/transforms.mjs 34641 var import_blocks34 = __toESM(require_blocks(), 1); 34642 var transforms10 = { 34643 from: [ 34644 { 34645 type: "block", 34646 isMultiBlock: true, 34647 blocks: ["*"], 34648 __experimentalConvert(blocks) { 34649 const alignments = ["wide", "full"]; 34650 const widestAlignment = blocks.reduce( 34651 (accumulator, block) => { 34652 const { align } = block.attributes; 34653 return alignments.indexOf(align) > alignments.indexOf(accumulator) ? align : accumulator; 34654 }, 34655 void 0 34656 ); 34657 const groupInnerBlocks = blocks.map( 34658 (block) => (0, import_blocks34.cloneSanitizedBlock)(block) 34659 ); 34660 return (0, import_blocks34.createBlock)( 34661 "core/group", 34662 { 34663 align: widestAlignment, 34664 layout: { type: "constrained" } 34665 }, 34666 groupInnerBlocks 34667 ); 34668 } 34669 } 34670 ] 34671 }; 34672 var transforms_default11 = transforms10; 34673 34674 // packages/block-library/build-module/group/variations.mjs 34675 var import_i18n79 = __toESM(require_i18n(), 1); 34676 var example = { 34677 innerBlocks: [ 34678 { 34679 name: "core/paragraph", 34680 attributes: { 34681 content: (0, import_i18n79.__)("One.") 34682 } 34683 }, 34684 { 34685 name: "core/paragraph", 34686 attributes: { 34687 content: (0, import_i18n79.__)("Two.") 34688 } 34689 }, 34690 { 34691 name: "core/paragraph", 34692 attributes: { 34693 content: (0, import_i18n79.__)("Three.") 34694 } 34695 }, 34696 { 34697 name: "core/paragraph", 34698 attributes: { 34699 content: (0, import_i18n79.__)("Four.") 34700 } 34701 }, 34702 { 34703 name: "core/paragraph", 34704 attributes: { 34705 content: (0, import_i18n79.__)("Five.") 34706 } 34707 }, 34708 { 34709 name: "core/paragraph", 34710 attributes: { 34711 content: (0, import_i18n79.__)("Six.") 34712 } 34713 } 34714 ] 34715 }; 34716 var variations7 = [ 34717 { 34718 name: "group", 34719 title: (0, import_i18n79.__)("Group"), 34720 description: (0, import_i18n79.__)("Gather blocks in a container."), 34721 attributes: { layout: { type: "constrained" } }, 34722 isDefault: true, 34723 scope: ["block", "inserter", "transform"], 34724 icon: group_default 34725 }, 34726 { 34727 name: "group-row", 34728 title: (0, import_i18n79._x)("Row", "single horizontal line"), 34729 description: (0, import_i18n79.__)("Arrange blocks horizontally."), 34730 attributes: { layout: { type: "flex", flexWrap: "nowrap" } }, 34731 scope: ["block", "inserter", "transform"], 34732 isActive: ["layout.type"], 34733 icon: row_default, 34734 example 34735 }, 34736 { 34737 name: "group-stack", 34738 title: (0, import_i18n79.__)("Stack"), 34739 description: (0, import_i18n79.__)("Arrange blocks vertically."), 34740 attributes: { layout: { type: "flex", orientation: "vertical" } }, 34741 scope: ["block", "inserter", "transform"], 34742 isActive: ["layout.type", "layout.orientation"], 34743 icon: stack_default, 34744 example 34745 }, 34746 { 34747 name: "group-grid", 34748 title: (0, import_i18n79.__)("Grid"), 34749 description: (0, import_i18n79.__)("Arrange blocks in a grid."), 34750 attributes: { layout: { type: "grid" } }, 34751 scope: ["block", "inserter", "transform"], 34752 isActive: ["layout.type"], 34753 icon: grid_default, 34754 example 34755 } 34756 ]; 34757 var variations_default7 = variations7; 34758 34759 // packages/block-library/build-module/group/index.mjs 34760 var { name: name35 } = block_default35; 34761 var settings35 = { 34762 icon: group_default, 34763 example: { 34764 attributes: { 34765 layout: { 34766 type: "constrained", 34767 justifyContent: "center" 34768 }, 34769 style: { 34770 spacing: { 34771 padding: { 34772 top: "4em", 34773 right: "3em", 34774 bottom: "4em", 34775 left: "3em" 34776 } 34777 } 34778 } 34779 }, 34780 innerBlocks: [ 34781 { 34782 name: "core/heading", 34783 attributes: { 34784 content: (0, import_i18n80.__)("La Mancha"), 34785 style: { 34786 typography: { 34787 textAlign: "center" 34788 } 34789 } 34790 } 34791 }, 34792 { 34793 name: "core/paragraph", 34794 attributes: { 34795 style: { 34796 typography: { 34797 textAlign: "center" 34798 } 34799 }, 34800 content: (0, import_i18n80.__)( 34801 "In a village of La Mancha, the name of which I have no desire to call to mind, there lived not long since one of those gentlemen that keep a lance in the lance-rack, an old buckler, a lean hack, and a greyhound for coursing." 34802 ) 34803 } 34804 }, 34805 { 34806 name: "core/spacer", 34807 attributes: { 34808 height: "10px" 34809 } 34810 }, 34811 { 34812 name: "core/button", 34813 attributes: { 34814 text: (0, import_i18n80.__)("Read more") 34815 } 34816 } 34817 ], 34818 viewportWidth: 600 34819 }, 34820 transforms: transforms_default11, 34821 edit: edit_default11, 34822 save: save18, 34823 deprecated: deprecated_default18, 34824 variations: variations_default7 34825 }; 34826 var init35 = () => initBlock({ name: name35, metadata: block_default35, settings: settings35 }); 34827 34828 // packages/block-library/build-module/heading/index.mjs 34829 var heading_exports = {}; 34830 __export(heading_exports, { 34831 init: () => init36, 34832 metadata: () => block_default36, 34833 name: () => name36, 34834 settings: () => settings36 34835 }); 34836 var import_i18n84 = __toESM(require_i18n(), 1); 34837 var import_blocks36 = __toESM(require_blocks(), 1); 34838 34839 // packages/block-library/build-module/heading/deprecated.mjs 34840 var import_block_editor94 = __toESM(require_block_editor(), 1); 34841 var import_jsx_runtime295 = __toESM(require_jsx_runtime(), 1); 34842 var blockSupports = { 34843 className: false, 34844 anchor: true 34845 }; 34846 var blockAttributes4 = { 34847 align: { 34848 type: "string" 34849 }, 34850 content: { 34851 type: "string", 34852 source: "html", 34853 selector: "h1,h2,h3,h4,h5,h6", 34854 default: "" 34855 }, 34856 level: { 34857 type: "number", 34858 default: 2 34859 }, 34860 placeholder: { 34861 type: "string" 34862 } 34863 }; 34864 var migrateCustomColors2 = (attributes2) => { 34865 if (!attributes2.customTextColor) { 34866 return attributes2; 34867 } 34868 const style2 = { 34869 color: { 34870 text: attributes2.customTextColor 34871 } 34872 }; 34873 const { customTextColor, ...restAttributes } = attributes2; 34874 return { 34875 ...restAttributes, 34876 style: style2 34877 }; 34878 }; 34879 var TEXT_ALIGN_OPTIONS = ["left", "right", "center"]; 34880 var migrateTextAlign = (attributes2) => { 34881 const { align, ...rest } = attributes2; 34882 return TEXT_ALIGN_OPTIONS.includes(align) ? { ...rest, textAlign: align } : attributes2; 34883 }; 34884 var v117 = { 34885 supports: blockSupports, 34886 attributes: { 34887 ...blockAttributes4, 34888 customTextColor: { 34889 type: "string" 34890 }, 34891 textColor: { 34892 type: "string" 34893 } 34894 }, 34895 migrate: (attributes2) => migrate_text_align_default( 34896 migrateCustomColors2(migrateTextAlign(attributes2)) 34897 ), 34898 save({ attributes: attributes2 }) { 34899 const { align, level, content, textColor, customTextColor } = attributes2; 34900 const tagName = "h" + level; 34901 const textClass = (0, import_block_editor94.getColorClassName)("color", textColor); 34902 const className = clsx_default({ 34903 [textClass]: textClass 34904 }); 34905 return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( 34906 import_block_editor94.RichText.Content, 34907 { 34908 className: className ? className : void 0, 34909 tagName, 34910 style: { 34911 textAlign: align, 34912 color: textClass ? void 0 : customTextColor 34913 }, 34914 value: content 34915 } 34916 ); 34917 } 34918 }; 34919 var v28 = { 34920 attributes: { 34921 ...blockAttributes4, 34922 customTextColor: { 34923 type: "string" 34924 }, 34925 textColor: { 34926 type: "string" 34927 } 34928 }, 34929 migrate: (attributes2) => migrate_text_align_default( 34930 migrateCustomColors2(migrateTextAlign(attributes2)) 34931 ), 34932 save({ attributes: attributes2 }) { 34933 const { align, content, customTextColor, level, textColor } = attributes2; 34934 const tagName = "h" + level; 34935 const textClass = (0, import_block_editor94.getColorClassName)("color", textColor); 34936 const className = clsx_default({ 34937 [textClass]: textClass, 34938 [`has-text-align-$align}`]: align 34939 }); 34940 return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( 34941 import_block_editor94.RichText.Content, 34942 { 34943 className: className ? className : void 0, 34944 tagName, 34945 style: { 34946 color: textClass ? void 0 : customTextColor 34947 }, 34948 value: content 34949 } 34950 ); 34951 }, 34952 supports: blockSupports 34953 }; 34954 var v35 = { 34955 supports: blockSupports, 34956 attributes: { 34957 ...blockAttributes4, 34958 customTextColor: { 34959 type: "string" 34960 }, 34961 textColor: { 34962 type: "string" 34963 } 34964 }, 34965 migrate: (attributes2) => migrate_text_align_default( 34966 migrateCustomColors2(migrateTextAlign(attributes2)) 34967 ), 34968 save({ attributes: attributes2 }) { 34969 const { align, content, customTextColor, level, textColor } = attributes2; 34970 const tagName = "h" + level; 34971 const textClass = (0, import_block_editor94.getColorClassName)("color", textColor); 34972 const className = clsx_default({ 34973 [textClass]: textClass, 34974 "has-text-color": textColor || customTextColor, 34975 [`has-text-align-$align}`]: align 34976 }); 34977 return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)( 34978 import_block_editor94.RichText.Content, 34979 { 34980 className: className ? className : void 0, 34981 tagName, 34982 style: { 34983 color: textClass ? void 0 : customTextColor 34984 }, 34985 value: content 34986 } 34987 ); 34988 } 34989 }; 34990 var v43 = { 34991 supports: { 34992 align: ["wide", "full"], 34993 anchor: true, 34994 className: false, 34995 color: { link: true }, 34996 fontSize: true, 34997 lineHeight: true, 34998 __experimentalSelector: { 34999 "core/heading/h1": "h1", 35000 "core/heading/h2": "h2", 35001 "core/heading/h3": "h3", 35002 "core/heading/h4": "h4", 35003 "core/heading/h5": "h5", 35004 "core/heading/h6": "h6" 35005 }, 35006 __unstablePasteTextInline: true 35007 }, 35008 attributes: blockAttributes4, 35009 isEligible: ({ align }) => TEXT_ALIGN_OPTIONS.includes(align), 35010 migrate: (attributes2) => migrate_text_align_default( 35011 migrateCustomColors2(migrateTextAlign(attributes2)) 35012 ), 35013 save({ attributes: attributes2 }) { 35014 const { align, content, level } = attributes2; 35015 const TagName2 = "h" + level; 35016 const className = clsx_default({ 35017 [`has-text-align-$align}`]: align 35018 }); 35019 return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(TagName2, { ...import_block_editor94.useBlockProps.save({ className }), children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_block_editor94.RichText.Content, { value: content }) }); 35020 } 35021 }; 35022 var v53 = { 35023 supports: { 35024 align: ["wide", "full"], 35025 anchor: true, 35026 className: false, 35027 color: { 35028 gradients: true, 35029 link: true, 35030 __experimentalDefaultControls: { 35031 background: true, 35032 text: true 35033 } 35034 }, 35035 spacing: { 35036 margin: true, 35037 padding: true 35038 }, 35039 typography: { 35040 fontSize: true, 35041 lineHeight: true, 35042 __experimentalFontFamily: true, 35043 __experimentalFontStyle: true, 35044 __experimentalFontWeight: true, 35045 __experimentalLetterSpacing: true, 35046 __experimentalTextTransform: true, 35047 __experimentalTextDecoration: true, 35048 __experimentalDefaultControls: { 35049 fontSize: true, 35050 fontAppearance: true, 35051 textTransform: true 35052 } 35053 }, 35054 __experimentalSelector: "h1,h2,h3,h4,h5,h6", 35055 __unstablePasteTextInline: true, 35056 __experimentalSlashInserter: true 35057 }, 35058 attributes: { 35059 textAlign: { 35060 type: "string" 35061 }, 35062 content: { 35063 type: "string", 35064 source: "html", 35065 selector: "h1,h2,h3,h4,h5,h6", 35066 default: "", 35067 role: "content" 35068 }, 35069 level: { 35070 type: "number", 35071 default: 2 35072 }, 35073 placeholder: { 35074 type: "string" 35075 } 35076 }, 35077 save({ attributes: attributes2 }) { 35078 const { textAlign, content, level } = attributes2; 35079 const TagName2 = "h" + level; 35080 const className = clsx_default({ 35081 [`has-text-align-$textAlign}`]: textAlign 35082 }); 35083 return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(TagName2, { ...import_block_editor94.useBlockProps.save({ className }), children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_block_editor94.RichText.Content, { value: content }) }); 35084 }, 35085 migrate: (attributes2) => migrate_text_align_default( 35086 migrateCustomColors2(migrateTextAlign(attributes2)) 35087 ) 35088 }; 35089 var v63 = { 35090 supports: { 35091 align: ["wide", "full"], 35092 anchor: true, 35093 className: true, 35094 splitting: true, 35095 __experimentalBorder: { 35096 color: true, 35097 radius: true, 35098 style: true, 35099 width: true 35100 }, 35101 color: { 35102 gradients: true, 35103 link: true, 35104 __experimentalDefaultControls: { 35105 background: true, 35106 text: true 35107 } 35108 }, 35109 spacing: { 35110 margin: true, 35111 padding: true 35112 }, 35113 typography: { 35114 fontSize: true, 35115 lineHeight: true, 35116 __experimentalFontFamily: true, 35117 __experimentalFontStyle: true, 35118 __experimentalFontWeight: true, 35119 __experimentalLetterSpacing: true, 35120 __experimentalTextTransform: true, 35121 __experimentalTextDecoration: true, 35122 __experimentalWritingMode: true, 35123 fitText: true, 35124 __experimentalDefaultControls: { 35125 fontSize: true 35126 } 35127 }, 35128 __unstablePasteTextInline: true, 35129 __experimentalSlashInserter: true, 35130 interactivity: { 35131 clientNavigation: true 35132 } 35133 }, 35134 attributes: { 35135 textAlign: { 35136 type: "string" 35137 }, 35138 content: { 35139 type: "string", 35140 source: "html", 35141 selector: "h1,h2,h3,h4,h5,h6", 35142 default: "", 35143 role: "content" 35144 }, 35145 level: { 35146 type: "number", 35147 default: 2 35148 }, 35149 levelOptions: { 35150 type: "array" 35151 }, 35152 placeholder: { 35153 type: "string" 35154 } 35155 }, 35156 save({ attributes: attributes2 }) { 35157 const { textAlign, content, level } = attributes2; 35158 const TagName2 = "h" + level; 35159 const className = clsx_default({ 35160 [`has-text-align-$textAlign}`]: textAlign 35161 }); 35162 return /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(TagName2, { ...import_block_editor94.useBlockProps.save({ className }), children: /* @__PURE__ */ (0, import_jsx_runtime295.jsx)(import_block_editor94.RichText.Content, { value: content }) }); 35163 }, 35164 migrate: (attributes2) => migrate_text_align_default( 35165 migrateCustomColors2(migrateTextAlign(attributes2)) 35166 ), 35167 isEligible(attributes2) { 35168 return !!attributes2.textAlign || !!attributes2.className?.match( 35169 /\bhas-text-align-(left|center|right)\b/ 35170 ); 35171 } 35172 }; 35173 var deprecated8 = [v63, v53, v43, v35, v28, v117]; 35174 var deprecated_default19 = deprecated8; 35175 35176 // packages/block-library/build-module/heading/edit.mjs 35177 var import_i18n81 = __toESM(require_i18n(), 1); 35178 var import_element63 = __toESM(require_element(), 1); 35179 var import_data40 = __toESM(require_data(), 1); 35180 var import_block_editor95 = __toESM(require_block_editor(), 1); 35181 35182 // packages/block-library/build-module/heading/autogenerate-anchors.mjs 35183 var import_remove_accents = __toESM(require_remove_accents(), 1); 35184 var anchors = {}; 35185 var getTextWithoutMarkup = (text) => { 35186 const dummyElement = document.createElement("div"); 35187 dummyElement.innerHTML = text; 35188 return dummyElement.innerText; 35189 }; 35190 var getSlug = (content) => { 35191 return (0, import_remove_accents.default)(getTextWithoutMarkup(content)).replace(/[^\p{L}\p{N}]+/gu, "-").toLowerCase().replace(/(^-+)|(-+$)/g, ""); 35192 }; 35193 var generateAnchor = (clientId, content) => { 35194 const slug = getSlug(content); 35195 if ("" === slug) { 35196 return null; 35197 } 35198 delete anchors[clientId]; 35199 let anchor = slug; 35200 let i2 = 0; 35201 while (Object.values(anchors).includes(anchor)) { 35202 i2 += 1; 35203 anchor = slug + "-" + i2; 35204 } 35205 return anchor; 35206 }; 35207 var setAnchor = (clientId, anchor) => { 35208 anchors[clientId] = anchor; 35209 }; 35210 35211 // packages/block-library/build-module/heading/edit.mjs 35212 var import_jsx_runtime296 = __toESM(require_jsx_runtime(), 1); 35213 function HeadingEdit(props) { 35214 const { 35215 attributes: attributes2, 35216 setAttributes, 35217 mergeBlocks, 35218 onReplace, 35219 style: style2, 35220 clientId 35221 } = props; 35222 useDeprecatedTextAlign(props); 35223 const { content, level, placeholder: placeholder2, anchor } = attributes2; 35224 const tagName = "h" + level; 35225 const blockProps = (0, import_block_editor95.useBlockProps)({ 35226 style: style2 35227 }); 35228 const { canGenerateAnchors } = (0, import_data40.useSelect)((select10) => { 35229 const { getGlobalBlockCount, getSettings: getSettings2 } = select10(import_block_editor95.store); 35230 const settings117 = getSettings2(); 35231 return { 35232 canGenerateAnchors: !!settings117.generateAnchors || getGlobalBlockCount("core/table-of-contents") > 0 35233 }; 35234 }, []); 35235 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data40.useDispatch)(import_block_editor95.store); 35236 (0, import_element63.useEffect)(() => { 35237 if (!canGenerateAnchors) { 35238 return; 35239 } 35240 if (!anchor && content) { 35241 __unstableMarkNextChangeAsNotPersistent(); 35242 setAttributes({ 35243 anchor: generateAnchor(clientId, content) 35244 }); 35245 } 35246 setAnchor(clientId, anchor); 35247 return () => setAnchor(clientId, null); 35248 }, [ 35249 anchor, 35250 content, 35251 clientId, 35252 canGenerateAnchors, 35253 setAttributes, 35254 __unstableMarkNextChangeAsNotPersistent 35255 ]); 35256 const onContentChange = (value) => { 35257 const newAttrs = { content: value }; 35258 if (canGenerateAnchors && (!anchor || !value || generateAnchor(clientId, content) === anchor)) { 35259 newAttrs.anchor = generateAnchor(clientId, value); 35260 } 35261 setAttributes(newAttrs); 35262 }; 35263 return /* @__PURE__ */ (0, import_jsx_runtime296.jsx)( 35264 import_block_editor95.RichText, 35265 { 35266 identifier: "content", 35267 tagName, 35268 value: content, 35269 onChange: onContentChange, 35270 onMerge: mergeBlocks, 35271 onReplace, 35272 onRemove: onReplace ? () => onReplace([]) : void 0, 35273 placeholder: placeholder2 || (0, import_i18n81.__)("Heading"), 35274 ...blockProps 35275 } 35276 ); 35277 } 35278 var edit_default12 = HeadingEdit; 35279 35280 // packages/block-library/build-module/heading/block.json 35281 var block_default36 = { 35282 $schema: "https://schemas.wp.org/trunk/block.json", 35283 apiVersion: 3, 35284 name: "core/heading", 35285 title: "Heading", 35286 category: "text", 35287 description: "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content.", 35288 keywords: ["title", "subtitle"], 35289 textdomain: "default", 35290 attributes: { 35291 content: { 35292 type: "rich-text", 35293 source: "rich-text", 35294 selector: "h1,h2,h3,h4,h5,h6", 35295 role: "content" 35296 }, 35297 level: { 35298 type: "number", 35299 default: 2 35300 }, 35301 levelOptions: { 35302 type: "array" 35303 }, 35304 placeholder: { 35305 type: "string" 35306 } 35307 }, 35308 supports: { 35309 align: ["wide", "full"], 35310 anchor: true, 35311 className: true, 35312 splitting: true, 35313 __experimentalBorder: { 35314 color: true, 35315 radius: true, 35316 style: true, 35317 width: true 35318 }, 35319 color: { 35320 gradients: true, 35321 link: true, 35322 __experimentalDefaultControls: { 35323 background: true, 35324 text: true 35325 } 35326 }, 35327 spacing: { 35328 margin: true, 35329 padding: true, 35330 __experimentalDefaultControls: { 35331 margin: false, 35332 padding: false 35333 } 35334 }, 35335 typography: { 35336 fontSize: true, 35337 lineHeight: true, 35338 textAlign: true, 35339 __experimentalFontFamily: true, 35340 __experimentalFontStyle: true, 35341 __experimentalFontWeight: true, 35342 __experimentalLetterSpacing: true, 35343 __experimentalTextTransform: true, 35344 __experimentalTextDecoration: true, 35345 __experimentalWritingMode: true, 35346 fitText: true, 35347 __experimentalDefaultControls: { 35348 fontSize: true 35349 } 35350 }, 35351 __unstablePasteTextInline: true, 35352 __experimentalSlashInserter: true, 35353 interactivity: { 35354 clientNavigation: true 35355 } 35356 }, 35357 editorStyle: "wp-block-heading-editor", 35358 style: "wp-block-heading" 35359 }; 35360 35361 // packages/block-library/build-module/heading/save.mjs 35362 var import_block_editor96 = __toESM(require_block_editor(), 1); 35363 var import_jsx_runtime297 = __toESM(require_jsx_runtime(), 1); 35364 function save19({ attributes: attributes2 }) { 35365 const { content, level } = attributes2; 35366 const TagName2 = "h" + level; 35367 return /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(TagName2, { ...import_block_editor96.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime297.jsx)(import_block_editor96.RichText.Content, { value: content }) }); 35368 } 35369 35370 // packages/block-library/build-module/heading/transforms.mjs 35371 var import_blocks35 = __toESM(require_blocks(), 1); 35372 var import_i18n82 = __toESM(require_i18n(), 1); 35373 35374 // packages/block-library/build-module/heading/shared.mjs 35375 function getLevelFromHeadingNodeName(nodeName) { 35376 return Number(nodeName.substr(1)); 35377 } 35378 35379 // packages/block-library/build-module/heading/transforms.mjs 35380 var transforms11 = { 35381 from: [ 35382 { 35383 type: "block", 35384 isMultiBlock: true, 35385 blocks: ["core/paragraph"], 35386 // The level shortcuts are declared here as well as on the 35387 // variations, so that they reach a paragraph and not only a 35388 // heading. Both declarations describe the same shortcut, and only 35389 // one of them can apply to any given selection. 35390 shortcuts: [1, 2, 3, 4, 5, 6].map((level) => ({ 35391 name: `core/block-editor/transform-to-heading-$level}`, 35392 description: (0, import_i18n82.sprintf)( 35393 /* translators: %d: heading level e.g: "1", "2", "3" */ 35394 (0, import_i18n82.__)("Transform the selected block into a heading %d."), 35395 level 35396 ), 35397 keyCombination: { 35398 modifier: "access", 35399 character: `$level}` 35400 }, 35401 variationName: `h$level}` 35402 })), 35403 transform: (attributes2) => attributes2.map((_attributes) => { 35404 const { content, anchor, style: style2 } = _attributes; 35405 const textAlign = style2?.typography?.textAlign; 35406 return (0, import_blocks35.createBlock)("core/heading", { 35407 ...getTransformedAttributes( 35408 _attributes, 35409 "core/heading", 35410 ({ content: contentBinding }) => ({ 35411 content: contentBinding 35412 }) 35413 ), 35414 content, 35415 anchor, 35416 ...textAlign && { 35417 style: { 35418 typography: { 35419 textAlign 35420 } 35421 } 35422 } 35423 }); 35424 }) 35425 }, 35426 { 35427 type: "raw", 35428 selector: "h1,h2,h3,h4,h5,h6", 35429 schema: ({ phrasingContentSchema, isPaste }) => { 35430 const schema2 = { 35431 children: phrasingContentSchema, 35432 attributes: isPaste ? [] : ["style", "id"] 35433 }; 35434 return { 35435 h1: schema2, 35436 h2: schema2, 35437 h3: schema2, 35438 h4: schema2, 35439 h5: schema2, 35440 h6: schema2 35441 }; 35442 }, 35443 transform(node) { 35444 const attributes2 = (0, import_blocks35.getBlockAttributes)( 35445 "core/heading", 35446 node.outerHTML 35447 ); 35448 const { textAlign } = node.style || {}; 35449 attributes2.level = getLevelFromHeadingNodeName(node.nodeName); 35450 if (textAlign === "left" || textAlign === "center" || textAlign === "right") { 35451 attributes2.style = { 35452 ...attributes2.style, 35453 typography: { 35454 ...attributes2.style?.typography, 35455 textAlign 35456 } 35457 }; 35458 } 35459 return (0, import_blocks35.createBlock)("core/heading", attributes2); 35460 } 35461 }, 35462 ...[1, 2, 3, 4, 5, 6].map((level) => ({ 35463 type: "prefix", 35464 prefix: Array(level + 1).join("#"), 35465 transform(content) { 35466 return (0, import_blocks35.createBlock)("core/heading", { 35467 level, 35468 content 35469 }); 35470 } 35471 })), 35472 ...[1, 2, 3, 4, 5, 6].map((level) => ({ 35473 type: "enter", 35474 regExp: new RegExp(`^/(h|H)$level}$`), 35475 transform: () => (0, import_blocks35.createBlock)("core/heading", { level }) 35476 })) 35477 ], 35478 to: [ 35479 { 35480 type: "block", 35481 isMultiBlock: true, 35482 blocks: ["core/paragraph"], 35483 shortcuts: [ 35484 { 35485 name: "core/block-editor/transform-heading-to-paragraph", 35486 description: (0, import_i18n82.__)( 35487 "Transform the selected heading into a paragraph." 35488 ), 35489 keyCombination: { 35490 modifier: "access", 35491 character: "0" 35492 }, 35493 aliases: [ 35494 { 35495 modifier: "access", 35496 character: "7" 35497 } 35498 ] 35499 } 35500 ], 35501 transform: (attributes2) => attributes2.map((_attributes) => { 35502 const { content, style: style2 } = _attributes; 35503 const textAlign = style2?.typography?.textAlign; 35504 return (0, import_blocks35.createBlock)("core/paragraph", { 35505 ...getTransformedAttributes( 35506 _attributes, 35507 "core/paragraph", 35508 ({ content: contentBinding }) => ({ 35509 content: contentBinding 35510 }) 35511 ), 35512 content, 35513 ...textAlign && { 35514 style: { 35515 typography: { 35516 textAlign 35517 } 35518 } 35519 } 35520 }); 35521 }) 35522 } 35523 ] 35524 }; 35525 var transforms_default12 = transforms11; 35526 35527 // packages/block-library/build-module/heading/variations.mjs 35528 var import_i18n83 = __toESM(require_i18n(), 1); 35529 var LEVEL_ICONS = [ 35530 heading_level_1_default, 35531 heading_level_2_default, 35532 heading_level_3_default, 35533 heading_level_4_default, 35534 heading_level_5_default, 35535 heading_level_6_default 35536 ]; 35537 var variations8 = [ 35538 ...[1, 2, 3, 4, 5, 6].map((level) => ({ 35539 name: `h$level}`, 35540 title: (0, import_i18n83.sprintf)( 35541 /* translators: %d: heading level e.g: "1", "2", "3" */ 35542 (0, import_i18n83.__)("Heading %d"), 35543 level 35544 ), 35545 description: (0, import_i18n83.__)( 35546 "Introduce new sections and organize content to help visitors (and search engines) understand the structure of your content." 35547 ), 35548 icon: LEVEL_ICONS[level - 1], 35549 attributes: { level }, 35550 scope: ["block", "transform"], 35551 keywords: [`h$level}`], 35552 isActive: (blockAttributes8) => blockAttributes8.level === level, 35553 shortcut: { 35554 name: `core/block-editor/transform-to-heading-$level}`, 35555 description: (0, import_i18n83.sprintf)( 35556 /* translators: %d: heading level e.g: "1", "2", "3" */ 35557 (0, import_i18n83.__)("Transform the selected block into a heading %d."), 35558 level 35559 ), 35560 keyCombination: { 35561 modifier: "access", 35562 character: `$level}` 35563 } 35564 } 35565 })) 35566 ]; 35567 var variations_default8 = variations8; 35568 35569 // packages/block-library/build-module/heading/index.mjs 35570 var { fieldsKey: fieldsKey7, formKey: formKey7 } = unlock(import_blocks36.privateApis); 35571 var { name: name36 } = block_default36; 35572 var settings36 = { 35573 icon: heading_default, 35574 example: { 35575 attributes: { 35576 content: (0, import_i18n84.__)("Code is Poetry"), 35577 level: 2, 35578 style: { 35579 typography: { 35580 textAlign: "center" 35581 } 35582 } 35583 } 35584 }, 35585 __experimentalLabel(attributes2, { context }) { 35586 const { content, level } = attributes2; 35587 const customName = attributes2?.metadata?.name; 35588 const hasContent = content?.trim().length > 0; 35589 if (context === "list-view" && (customName || hasContent)) { 35590 return customName || content; 35591 } 35592 if (context === "breadcrumb" && customName) { 35593 return customName; 35594 } 35595 if (context === "accessibility") { 35596 return !hasContent ? (0, import_i18n84.sprintf)( 35597 /* translators: accessibility text. %s: heading level. */ 35598 (0, import_i18n84.__)("Level %s. Empty."), 35599 level 35600 ) : (0, import_i18n84.sprintf)( 35601 /* translators: accessibility text. 1: heading level. 2: heading content. */ 35602 (0, import_i18n84.__)("Level %1$s. %2$s"), 35603 level, 35604 content 35605 ); 35606 } 35607 }, 35608 transforms: transforms_default12, 35609 deprecated: deprecated_default19, 35610 merge(attributes2, attributesToMerge) { 35611 return { 35612 content: (attributes2.content || "") + (attributesToMerge.content || "") 35613 }; 35614 }, 35615 edit: edit_default12, 35616 save: save19, 35617 variations: variations_default8 35618 }; 35619 if (window.__experimentalContentOnlyInspectorFields) { 35620 settings36[fieldsKey7] = [ 35621 { 35622 id: "content", 35623 label: (0, import_i18n84.__)("Content"), 35624 type: "text", 35625 Edit: "rich-text" 35626 // TODO: replace with custom component 35627 } 35628 ]; 35629 settings36[formKey7] = { 35630 fields: ["content"] 35631 }; 35632 } 35633 var init36 = () => { 35634 const block = initBlock({ name: name36, metadata: block_default36, settings: settings36 }); 35635 const levelOptions = (0, import_blocks36.getBlockType)(name36)?.attributes?.levelOptions?.default; 35636 if (levelOptions) { 35637 [1, 2, 3, 4, 5, 6].forEach((level) => { 35638 if (!levelOptions.includes(level)) { 35639 (0, import_blocks36.unregisterBlockVariation)(name36, `h$level}`); 35640 } 35641 }); 35642 } 35643 return block; 35644 }; 35645 35646 // packages/block-library/build-module/home-link/index.mjs 35647 var home_link_exports = {}; 35648 __export(home_link_exports, { 35649 init: () => init37, 35650 metadata: () => block_default37, 35651 name: () => name37, 35652 settings: () => settings37 35653 }); 35654 var import_i18n86 = __toESM(require_i18n(), 1); 35655 35656 // packages/block-library/build-module/home-link/block.json 35657 var block_default37 = { 35658 $schema: "https://schemas.wp.org/trunk/block.json", 35659 apiVersion: 3, 35660 name: "core/home-link", 35661 category: "design", 35662 parent: ["core/navigation"], 35663 title: "Home Link", 35664 description: "Create a link that always points to the homepage of the site. Usually not necessary if there is already a site title link present in the header.", 35665 textdomain: "default", 35666 attributes: { 35667 label: { 35668 type: "string", 35669 role: "content" 35670 }, 35671 opensInNewTab: { 35672 type: "boolean", 35673 default: false 35674 }, 35675 description: { 35676 type: "string" 35677 } 35678 }, 35679 usesContext: [ 35680 "textColor", 35681 "customTextColor", 35682 "backgroundColor", 35683 "customBackgroundColor", 35684 "fontSize", 35685 "customFontSize", 35686 "style" 35687 ], 35688 supports: { 35689 anchor: true, 35690 reusable: false, 35691 html: false, 35692 typography: { 35693 fontSize: true, 35694 lineHeight: true, 35695 __experimentalFontFamily: true, 35696 __experimentalFontWeight: true, 35697 __experimentalFontStyle: true, 35698 __experimentalTextTransform: true, 35699 __experimentalTextDecoration: true, 35700 __experimentalLetterSpacing: true, 35701 __experimentalDefaultControls: { 35702 fontSize: true 35703 } 35704 }, 35705 interactivity: { 35706 clientNavigation: true 35707 } 35708 }, 35709 editorStyle: "wp-block-home-link-editor", 35710 style: "wp-block-home-link" 35711 }; 35712 35713 // packages/block-library/build-module/home-link/edit.mjs 35714 var import_block_editor97 = __toESM(require_block_editor(), 1); 35715 var import_components45 = __toESM(require_components(), 1); 35716 var import_i18n85 = __toESM(require_i18n(), 1); 35717 var import_data41 = __toESM(require_data(), 1); 35718 var import_core_data22 = __toESM(require_core_data(), 1); 35719 var import_dom10 = __toESM(require_dom(), 1); 35720 var import_jsx_runtime298 = __toESM(require_jsx_runtime(), 1); 35721 var preventDefault = (event) => event.preventDefault(); 35722 function HomeEdit({ attributes: attributes2, setAttributes, context }) { 35723 const { 35724 homeUrl, 35725 onNavigateToEntityRecord, 35726 frontPageId, 35727 frontPageTemplateId 35728 } = (0, import_data41.useSelect)((select10) => { 35729 const { getEntityRecord, getDefaultTemplateId, canUser } = select10(import_core_data22.store); 35730 const baseUrl = getEntityRecord("root", "__unstableBase")?.home; 35731 const canReadSettings = canUser("read", { 35732 kind: "root", 35733 name: "site" 35734 }); 35735 const site = canReadSettings ? getEntityRecord("root", "site") : null; 35736 const resolvedFrontPageId = site?.show_on_front === "page" ? site?.page_on_front : null; 35737 const resolvedFrontPageTemplateId = !resolvedFrontPageId ? getDefaultTemplateId({ slug: "front-page" }) : null; 35738 return { 35739 homeUrl: baseUrl, 35740 onNavigateToEntityRecord: select10(import_block_editor97.store).getSettings().onNavigateToEntityRecord, 35741 frontPageId: resolvedFrontPageId, 35742 frontPageTemplateId: resolvedFrontPageTemplateId 35743 }; 35744 }, []); 35745 const { textColor, backgroundColor, style: style2 } = context; 35746 const { label, opensInNewTab, description } = attributes2; 35747 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 35748 const blockProps = (0, import_block_editor97.useBlockProps)({ 35749 className: clsx_default("wp-block-navigation-item", { 35750 "has-text-color": !!textColor || !!style2?.color?.text, 35751 [`has-$textColor}-color`]: !!textColor, 35752 "has-background": !!backgroundColor || !!style2?.color?.background, 35753 [`has-$backgroundColor}-background-color`]: !!backgroundColor 35754 }), 35755 style: { 35756 color: style2?.color?.text, 35757 backgroundColor: style2?.color?.background 35758 } 35759 }); 35760 return /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)(import_jsx_runtime298.Fragment, { children: [ 35761 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)(import_block_editor97.InspectorControls, { group: "content", children: /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)( 35762 import_components45.__experimentalToolsPanel, 35763 { 35764 label: (0, import_i18n85.__)("Settings"), 35765 resetAll: () => { 35766 setAttributes({ 35767 label: "", 35768 opensInNewTab: false, 35769 description: "" 35770 }); 35771 }, 35772 dropdownMenuProps, 35773 children: [ 35774 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35775 import_components45.__experimentalToolsPanelItem, 35776 { 35777 hasValue: () => !!label, 35778 label: (0, import_i18n85.__)("Text"), 35779 onDeselect: () => setAttributes({ label: "" }), 35780 isShownByDefault: true, 35781 children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35782 import_components45.TextControl, 35783 { 35784 label: (0, import_i18n85.__)("Text"), 35785 value: label ? (0, import_dom10.__unstableStripHTML)(label) : "", 35786 onChange: (labelValue) => { 35787 setAttributes({ label: labelValue }); 35788 }, 35789 autoComplete: "off" 35790 } 35791 ) 35792 } 35793 ), 35794 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35795 import_components45.__experimentalToolsPanelItem, 35796 { 35797 hasValue: () => !!opensInNewTab, 35798 label: (0, import_i18n85.__)("Open in new tab"), 35799 onDeselect: () => setAttributes({ opensInNewTab: false }), 35800 isShownByDefault: true, 35801 children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35802 import_components45.CheckboxControl, 35803 { 35804 label: (0, import_i18n85.__)("Open in new tab"), 35805 checked: opensInNewTab, 35806 onChange: (value) => setAttributes({ opensInNewTab: value }) 35807 } 35808 ) 35809 } 35810 ), 35811 onNavigateToEntityRecord && (frontPageId || frontPageTemplateId) && /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35812 import_components45.Button, 35813 { 35814 variant: "secondary", 35815 onClick: () => { 35816 if (frontPageId) { 35817 onNavigateToEntityRecord({ 35818 postId: frontPageId, 35819 postType: "page" 35820 }); 35821 } else { 35822 onNavigateToEntityRecord({ 35823 postId: frontPageTemplateId, 35824 postType: "wp_template" 35825 }); 35826 } 35827 }, 35828 __next40pxDefaultSize: true, 35829 className: "navigation-link-to__action-button", 35830 children: (0, import_i18n85.__)("Edit") 35831 } 35832 ), 35833 homeUrl && /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35834 import_components45.Button, 35835 { 35836 variant: "secondary", 35837 href: homeUrl, 35838 target: "_blank", 35839 icon: external_default, 35840 iconPosition: "right", 35841 __next40pxDefaultSize: true, 35842 className: "navigation-link-to__action-button", 35843 children: (0, import_i18n85.__)("View") 35844 } 35845 ), 35846 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35847 import_components45.__experimentalToolsPanelItem, 35848 { 35849 hasValue: () => !!description, 35850 label: (0, import_i18n85.__)("Description"), 35851 onDeselect: () => setAttributes({ description: "" }), 35852 isShownByDefault: true, 35853 children: /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35854 import_components45.TextareaControl, 35855 { 35856 label: (0, import_i18n85.__)("Description"), 35857 value: description || "", 35858 onChange: (descriptionValue) => { 35859 setAttributes({ 35860 description: descriptionValue 35861 }); 35862 }, 35863 help: (0, import_i18n85.__)( 35864 "The description will be displayed in the menu if the current theme supports it." 35865 ) 35866 } 35867 ) 35868 } 35869 ) 35870 ] 35871 } 35872 ) }), 35873 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime298.jsxs)( 35874 "a", 35875 { 35876 className: "wp-block-home-link__content wp-block-navigation-item__content", 35877 href: homeUrl, 35878 onClick: preventDefault, 35879 children: [ 35880 /* @__PURE__ */ (0, import_jsx_runtime298.jsx)( 35881 import_block_editor97.RichText, 35882 { 35883 identifier: "label", 35884 className: "wp-block-home-link__label", 35885 value: label ?? (0, import_i18n85.__)("Home"), 35886 onChange: (labelValue) => { 35887 setAttributes({ label: labelValue }); 35888 }, 35889 "aria-label": (0, import_i18n85.__)("Home link text"), 35890 placeholder: (0, import_i18n85.__)("Add label\u2026"), 35891 withoutInteractiveFormatting: true 35892 } 35893 ), 35894 description && /* @__PURE__ */ (0, import_jsx_runtime298.jsx)("span", { className: "wp-block-navigation-item__description", children: description }) 35895 ] 35896 } 35897 ) }) 35898 ] }); 35899 } 35900 35901 // packages/block-library/build-module/home-link/save.mjs 35902 var import_block_editor98 = __toESM(require_block_editor(), 1); 35903 var import_jsx_runtime299 = __toESM(require_jsx_runtime(), 1); 35904 function save20() { 35905 return /* @__PURE__ */ (0, import_jsx_runtime299.jsx)(import_block_editor98.InnerBlocks.Content, {}); 35906 } 35907 35908 // packages/block-library/build-module/home-link/index.mjs 35909 var { name: name37 } = block_default37; 35910 var settings37 = { 35911 icon: home_default, 35912 edit: HomeEdit, 35913 save: save20, 35914 example: { 35915 attributes: { 35916 label: (0, import_i18n86._x)("Home Link", "block example") 35917 } 35918 } 35919 }; 35920 var init37 = () => initBlock({ name: name37, metadata: block_default37, settings: settings37 }); 35921 35922 // packages/block-library/build-module/html/index.mjs 35923 var html_exports = {}; 35924 __export(html_exports, { 35925 init: () => init38, 35926 metadata: () => block_default38, 35927 name: () => name38, 35928 settings: () => settings38 35929 }); 35930 var import_i18n90 = __toESM(require_i18n(), 1); 35931 35932 // packages/block-library/build-module/html/edit.mjs 35933 var import_i18n89 = __toESM(require_i18n(), 1); 35934 var import_element66 = __toESM(require_element(), 1); 35935 var import_block_editor101 = __toESM(require_block_editor(), 1); 35936 var import_blocks37 = __toESM(require_blocks(), 1); 35937 var import_data44 = __toESM(require_data(), 1); 35938 var import_deprecated21 = __toESM(require_deprecated(), 1); 35939 var import_components48 = __toESM(require_components(), 1); 35940 35941 // packages/block-library/build-module/html/modal.mjs 35942 var import_i18n88 = __toESM(require_i18n(), 1); 35943 var import_element65 = __toESM(require_element(), 1); 35944 var import_data43 = __toESM(require_data(), 1); 35945 var import_components47 = __toESM(require_components(), 1); 35946 var import_block_editor100 = __toESM(require_block_editor(), 1); 35947 var import_compose23 = __toESM(require_compose(), 1); 35948 35949 // packages/block-library/build-module/html/preview.mjs 35950 var import_element64 = __toESM(require_element(), 1); 35951 var import_block_editor99 = __toESM(require_block_editor(), 1); 35952 var import_components46 = __toESM(require_components(), 1); 35953 var import_data42 = __toESM(require_data(), 1); 35954 var import_i18n87 = __toESM(require_i18n(), 1); 35955 var import_jsx_runtime300 = __toESM(require_jsx_runtime(), 1); 35956 var DEFAULT_STYLES = ` 35957 html,body,:root { 35958 margin: 0 !important; 35959 padding: 0 !important; 35960 overflow: visible !important; 35961 min-height: auto !important; 35962 } 35963 `; 35964 function HTMLEditPreview({ content, isSelected }) { 35965 const settingStyles = (0, import_data42.useSelect)( 35966 (select10) => select10(import_block_editor99.store).getSettings().styles, 35967 [] 35968 ); 35969 const styles = (0, import_element64.useMemo)( 35970 () => [ 35971 DEFAULT_STYLES, 35972 ...(0, import_block_editor99.transformStyles)( 35973 (settingStyles ?? []).filter((style2) => style2.css) 35974 ) 35975 ], 35976 [settingStyles] 35977 ); 35978 return /* @__PURE__ */ (0, import_jsx_runtime300.jsxs)(import_jsx_runtime300.Fragment, { children: [ 35979 /* @__PURE__ */ (0, import_jsx_runtime300.jsx)( 35980 import_components46.SandBox, 35981 { 35982 html: content, 35983 styles, 35984 title: (0, import_i18n87.__)("Custom HTML Preview"), 35985 tabIndex: -1 35986 } 35987 ), 35988 !isSelected && /* @__PURE__ */ (0, import_jsx_runtime300.jsx)("div", { className: "block-library-html__preview-overlay" }) 35989 ] }); 35990 } 35991 35992 // packages/block-library/build-module/html/utils.mjs 35993 function parseContent(content = "") { 35994 if (!content || !content.trim()) { 35995 return { html: "", css: "", js: "" }; 35996 } 35997 const doc = document.implementation.createHTMLDocument(""); 35998 doc.body.innerHTML = content; 35999 const styleTag = doc.body.querySelector( 36000 'style[data-wp-block-html="css"]' 36001 ); 36002 const css = styleTag ? styleTag.textContent.trim() : ""; 36003 if (styleTag) { 36004 styleTag.remove(); 36005 } 36006 const scriptTag = doc.body.querySelector( 36007 'script[data-wp-block-html="js"]' 36008 ); 36009 const js = scriptTag ? scriptTag.textContent.trim() : ""; 36010 if (scriptTag) { 36011 scriptTag.remove(); 36012 } 36013 const html = doc.body.innerHTML.trim(); 36014 return { html, css, js }; 36015 } 36016 function serializeContent({ html = "", css = "", js = "" }) { 36017 const parts = []; 36018 if (css.trim()) { 36019 parts.push(`<style data-wp-block-html="css"> 36020 $css} 36021 </style>`); 36022 } 36023 if (js.trim()) { 36024 parts.push(`<script data-wp-block-html="js"> 36025 $js} 36026 <\/script>`); 36027 } 36028 if (html.trim()) { 36029 parts.push(html); 36030 } 36031 return parts.join("\n\n"); 36032 } 36033 36034 // packages/block-library/build-module/html/modal.mjs 36035 var import_jsx_runtime301 = __toESM(require_jsx_runtime(), 1); 36036 var { Tabs } = unlock(import_components47.privateApis); 36037 var { useNativeUndo } = unlock(import_block_editor100.privateApis); 36038 function HTMLEditModal({ onRequestClose, content, onUpdate }) { 36039 const { html, css, js } = parseContent(content); 36040 const [editedHtml, setEditedHtml] = (0, import_element65.useState)(html); 36041 const [editedCss, setEditedCss] = (0, import_element65.useState)(css); 36042 const [editedJs, setEditedJs] = (0, import_element65.useState)(js); 36043 const [isFullscreen, setIsFullscreen] = (0, import_element65.useState)(false); 36044 const nativeUndoRef = useNativeUndo(); 36045 const isMobileViewport = (0, import_compose23.useViewportMatch)("small", "<"); 36046 const { canUserUseUnfilteredHTML } = (0, import_data43.useSelect)((select10) => { 36047 const settings117 = select10(import_block_editor100.store).getSettings(); 36048 return { 36049 canUserUseUnfilteredHTML: settings117.__experimentalCanUserUseUnfilteredHTML 36050 }; 36051 }, []); 36052 const hasRestrictedContent = !canUserUseUnfilteredHTML && (css.trim() || js.trim()); 36053 const handleUpdate = () => { 36054 onUpdate( 36055 serializeContent({ 36056 html: editedHtml, 36057 css: canUserUseUnfilteredHTML ? editedCss : "", 36058 js: canUserUseUnfilteredHTML ? editedJs : "" 36059 }) 36060 ); 36061 }; 36062 const handleUpdateAndClose = () => { 36063 handleUpdate(); 36064 onRequestClose(); 36065 }; 36066 const toggleFullscreen = () => { 36067 setIsFullscreen((prevState) => !prevState); 36068 }; 36069 return /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(import_jsx_runtime301.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36070 import_components47.Modal, 36071 { 36072 title: (0, import_i18n88.__)("Edit HTML"), 36073 onRequestClose, 36074 className: "block-library-html__modal", 36075 size: "large", 36076 isDismissible: false, 36077 shouldCloseOnClickOutside: false, 36078 isFullScreen: isFullscreen, 36079 __experimentalHideHeader: true, 36080 children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(Tabs, { orientation: "horizontal", defaultTabId: "html", children: /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)(import_components47.__experimentalVStack, { expanded: true, children: [ 36081 /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)( 36082 import_components47.__experimentalHStack, 36083 { 36084 justify: "space-between", 36085 className: "block-library-html__modal-header", 36086 children: [ 36087 /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)(Tabs.TabList, { children: [ 36088 /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(Tabs.Tab, { tabId: "html", children: "HTML" }), 36089 canUserUseUnfilteredHTML && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(Tabs.Tab, { tabId: "css", children: "CSS" }), 36090 canUserUseUnfilteredHTML && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)(Tabs.Tab, { tabId: "js", children: (0, import_i18n88.__)("JavaScript") }) 36091 ] }) }), 36092 !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("div", { children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36093 import_components47.Button, 36094 { 36095 __next40pxDefaultSize: true, 36096 icon: isFullscreen ? square_default : fullscreen_default, 36097 label: (0, import_i18n88.__)( 36098 "Enable/disable fullscreen" 36099 ), 36100 onClick: toggleFullscreen, 36101 variant: "tertiary" 36102 } 36103 ) }) 36104 ] 36105 } 36106 ), 36107 hasRestrictedContent && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36108 import_components47.Notice, 36109 { 36110 status: "warning", 36111 isDismissible: false, 36112 className: "block-library-html__modal-notice", 36113 children: (0, import_i18n88.__)( 36114 "This block contains CSS or JavaScript that will be removed when you save because you do not have permission to use unfiltered HTML." 36115 ) 36116 } 36117 ), 36118 /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)( 36119 import_components47.Flex, 36120 { 36121 direction: isMobileViewport ? "column" : "row", 36122 className: "block-library-html__modal-tabs", 36123 align: "stretch", 36124 gap: 8, 36125 children: [ 36126 /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)( 36127 "div", 36128 { 36129 ref: nativeUndoRef, 36130 className: "block-library-html__modal-content", 36131 children: [ 36132 /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36133 Tabs.TabPanel, 36134 { 36135 tabId: "html", 36136 focusable: false, 36137 className: "block-library-html__modal-tab", 36138 children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36139 import_block_editor100.PlainText, 36140 { 36141 value: editedHtml, 36142 onChange: setEditedHtml, 36143 placeholder: (0, import_i18n88.__)("Write HTML\u2026"), 36144 "aria-label": (0, import_i18n88.__)("HTML"), 36145 className: "block-library-html__modal-editor", 36146 async: true 36147 } 36148 ) 36149 } 36150 ), 36151 canUserUseUnfilteredHTML && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36152 Tabs.TabPanel, 36153 { 36154 tabId: "css", 36155 focusable: false, 36156 className: "block-library-html__modal-tab", 36157 children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36158 import_block_editor100.PlainText, 36159 { 36160 value: editedCss, 36161 onChange: setEditedCss, 36162 placeholder: (0, import_i18n88.__)("Write CSS\u2026"), 36163 "aria-label": (0, import_i18n88.__)("CSS"), 36164 className: "block-library-html__modal-editor", 36165 async: true 36166 } 36167 ) 36168 } 36169 ), 36170 canUserUseUnfilteredHTML && /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36171 Tabs.TabPanel, 36172 { 36173 tabId: "js", 36174 focusable: false, 36175 className: "block-library-html__modal-tab", 36176 children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36177 import_block_editor100.PlainText, 36178 { 36179 value: editedJs, 36180 onChange: setEditedJs, 36181 placeholder: (0, import_i18n88.__)( 36182 "Write JavaScript\u2026" 36183 ), 36184 "aria-label": (0, import_i18n88.__)("JavaScript"), 36185 className: "block-library-html__modal-editor", 36186 async: true 36187 } 36188 ) 36189 } 36190 ) 36191 ] 36192 } 36193 ), 36194 /* @__PURE__ */ (0, import_jsx_runtime301.jsx)("div", { className: "block-library-html__preview", children: /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36195 HTMLEditPreview, 36196 { 36197 content: serializeContent({ 36198 html: editedHtml, 36199 css: editedCss, 36200 js: editedJs 36201 }) 36202 } 36203 ) }) 36204 ] 36205 } 36206 ), 36207 /* @__PURE__ */ (0, import_jsx_runtime301.jsxs)( 36208 import_components47.__experimentalHStack, 36209 { 36210 alignment: "center", 36211 justify: "flex-end", 36212 spacing: 4, 36213 className: "block-library-html__modal-footer", 36214 children: [ 36215 /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36216 import_components47.Button, 36217 { 36218 __next40pxDefaultSize: true, 36219 variant: "tertiary", 36220 onClick: onRequestClose, 36221 children: (0, import_i18n88.__)("Cancel") 36222 } 36223 ), 36224 /* @__PURE__ */ (0, import_jsx_runtime301.jsx)( 36225 import_components47.Button, 36226 { 36227 __next40pxDefaultSize: true, 36228 variant: "primary", 36229 onClick: handleUpdateAndClose, 36230 children: (0, import_i18n88.__)("Update") 36231 } 36232 ) 36233 ] 36234 } 36235 ) 36236 ] }) }) 36237 } 36238 ) }); 36239 } 36240 36241 // packages/block-library/build-module/html/edit.mjs 36242 var import_jsx_runtime302 = __toESM(require_jsx_runtime(), 1); 36243 var { InnerContent } = unlock(import_block_editor101.privateApis); 36244 function HTMLEdit({ clientId, attributes: attributes2 }) { 36245 const [isModalOpen, setIsModalOpen] = (0, import_element66.useState)(false); 36246 const registry = (0, import_data44.useRegistry)(); 36247 const { updateBlock, replaceInnerBlocks } = (0, import_data44.useDispatch)(import_block_editor101.store); 36248 const content = (0, import_data44.useSelect)( 36249 (select10) => { 36250 const block = select10(import_block_editor101.store).getBlock(clientId); 36251 return block ? (0, import_blocks37.getBlockContent)(block) : ""; 36252 }, 36253 [clientId] 36254 ); 36255 const blockProps = (0, import_block_editor101.useBlockProps)({ 36256 className: "block-library-html__edit" 36257 }); 36258 const onUpdate = (nextContent) => { 36259 if (nextContent === content) { 36260 return; 36261 } 36262 const [parsedBlock] = (0, import_blocks37.parse)( 36263 `<!-- wp:html --> 36264 $nextContent} 36265 <!-- /wp:html -->` 36266 ); 36267 const nextInnerBlocks = parsedBlock?.innerBlocks ?? []; 36268 const prevInnerBlocks = registry.select(import_block_editor101.store).getBlocks(clientId); 36269 const innerBlocksUnchanged = prevInnerBlocks.length === nextInnerBlocks.length && prevInnerBlocks.every( 36270 (block, index) => (0, import_blocks37.serialize)(block) === (0, import_blocks37.serialize)(nextInnerBlocks[index]) 36271 ); 36272 registry.batch(() => { 36273 updateBlock(clientId, { 36274 innerContent: parsedBlock?.innerContent ?? (nextContent ? [nextContent] : []) 36275 }); 36276 if (!innerBlocksUnchanged) { 36277 replaceInnerBlocks(clientId, nextInnerBlocks, false); 36278 } 36279 }); 36280 }; 36281 (0, import_element66.useEffect)(() => { 36282 if (!attributes2.content) { 36283 return; 36284 } 36285 (0, import_deprecated21.default)("The content attribute on the Custom HTML block", { 36286 since: "7.1", 36287 alternative: "inner content" 36288 }); 36289 updateBlock(clientId, { 36290 attributes: { content: void 0 }, 36291 innerContent: [attributes2.content] 36292 }); 36293 }, [attributes2.content]); 36294 if (!content?.trim()) { 36295 return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { ...blockProps, children: [ 36296 /* @__PURE__ */ (0, import_jsx_runtime302.jsx)( 36297 import_components48.Placeholder, 36298 { 36299 icon: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_block_editor101.BlockIcon, { icon: code_default }), 36300 label: (0, import_i18n89.__)("Custom HTML"), 36301 instructions: (0, import_i18n89.__)( 36302 "Add custom HTML code and preview how it looks." 36303 ), 36304 children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)( 36305 import_components48.Button, 36306 { 36307 __next40pxDefaultSize: true, 36308 variant: "primary", 36309 onClick: () => setIsModalOpen(true), 36310 children: (0, import_i18n89.__)("Edit HTML") 36311 } 36312 ) 36313 } 36314 ), 36315 isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)( 36316 HTMLEditModal, 36317 { 36318 onRequestClose: () => setIsModalOpen(false), 36319 content, 36320 onUpdate 36321 } 36322 ) 36323 ] }); 36324 } 36325 return /* @__PURE__ */ (0, import_jsx_runtime302.jsxs)("div", { ...blockProps, children: [ 36326 /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_block_editor101.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_components48.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_components48.ToolbarButton, { onClick: () => setIsModalOpen(true), children: (0, import_i18n89.__)("Edit code") }) }) }), 36327 /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_block_editor101.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(import_components48.__experimentalVStack, { className: "block-library-html__edit-code", expanded: true, children: /* @__PURE__ */ (0, import_jsx_runtime302.jsx)( 36328 import_components48.Button, 36329 { 36330 className: "block-library-html__edit-code-button", 36331 __next40pxDefaultSize: true, 36332 variant: "secondary", 36333 onClick: () => setIsModalOpen(true), 36334 children: (0, import_i18n89.__)("Edit code") 36335 } 36336 ) }) }), 36337 /* @__PURE__ */ (0, import_jsx_runtime302.jsx)(InnerContent, { clientId }), 36338 isModalOpen && /* @__PURE__ */ (0, import_jsx_runtime302.jsx)( 36339 HTMLEditModal, 36340 { 36341 onRequestClose: () => setIsModalOpen(false), 36342 content, 36343 onUpdate 36344 } 36345 ) 36346 ] }); 36347 } 36348 36349 // packages/block-library/build-module/html/block.json 36350 var block_default38 = { 36351 $schema: "https://schemas.wp.org/trunk/block.json", 36352 apiVersion: 3, 36353 name: "core/html", 36354 title: "Custom HTML", 36355 category: "widgets", 36356 description: "Add custom HTML code and preview it as you edit.", 36357 keywords: ["embed"], 36358 textdomain: "default", 36359 attributes: { 36360 content: { 36361 type: "string", 36362 role: "local" 36363 } 36364 }, 36365 supports: { 36366 customClassName: false, 36367 className: false, 36368 html: false, 36369 interactivity: { 36370 clientNavigation: true 36371 }, 36372 listView: true, 36373 customCSS: false, 36374 visibility: false 36375 }, 36376 editorStyle: "wp-block-html-editor" 36377 }; 36378 36379 // packages/block-library/build-module/html/save.mjs 36380 function save21() { 36381 return null; 36382 } 36383 36384 // packages/block-library/build-module/html/transforms.mjs 36385 var import_blocks38 = __toESM(require_blocks(), 1); 36386 var import_rich_text3 = __toESM(require_rich_text(), 1); 36387 var transforms12 = { 36388 from: [ 36389 { 36390 type: "block", 36391 blocks: ["core/code"], 36392 transform: ({ content: html }) => { 36393 const text = (0, import_rich_text3.create)({ html }).text; 36394 const [block] = (0, import_blocks38.parse)( 36395 `<!-- wp:html --> 36396 $text} 36397 <!-- /wp:html -->` 36398 ); 36399 return block ?? (0, import_blocks38.createBlock)("core/html", {}, [], [text]); 36400 } 36401 } 36402 ] 36403 }; 36404 var transforms_default13 = transforms12; 36405 36406 // packages/block-library/build-module/html/index.mjs 36407 var { name: name38 } = block_default38; 36408 var settings38 = { 36409 icon: html_default, 36410 example: { 36411 innerContent: [ 36412 "<marquee>" + (0, import_i18n90.__)("Welcome to the wonderful world of blocks\u2026") + "</marquee>" 36413 ] 36414 }, 36415 edit: HTMLEdit, 36416 save: save21, 36417 transforms: transforms_default13 36418 }; 36419 var init38 = () => initBlock({ name: name38, metadata: block_default38, settings: settings38 }); 36420 36421 // packages/block-library/build-module/icon/index.mjs 36422 var icon_exports = {}; 36423 __export(icon_exports, { 36424 init: () => init39, 36425 metadata: () => block_default39, 36426 name: () => name39, 36427 settings: () => settings39 36428 }); 36429 36430 // packages/block-library/build-module/icon/edit.mjs 36431 var import_i18n93 = __toESM(require_i18n(), 1); 36432 var import_components51 = __toESM(require_components(), 1); 36433 var import_block_editor102 = __toESM(require_block_editor(), 1); 36434 var import_element69 = __toESM(require_element(), 1); 36435 var import_primitives165 = __toESM(require_primitives(), 1); 36436 var import_data46 = __toESM(require_data(), 1); 36437 var import_core_data24 = __toESM(require_core_data(), 1); 36438 36439 // packages/block-library/build-module/icon/components/custom-inserter/index.mjs 36440 var import_i18n92 = __toESM(require_i18n(), 1); 36441 var import_components50 = __toESM(require_components(), 1); 36442 var import_element68 = __toESM(require_element(), 1); 36443 var import_compose25 = __toESM(require_compose(), 1); 36444 var import_data45 = __toESM(require_data(), 1); 36445 var import_core_data23 = __toESM(require_core_data(), 1); 36446 36447 // packages/block-library/build-module/icon/components/custom-inserter/icon-grid.mjs 36448 var import_i18n91 = __toESM(require_i18n(), 1); 36449 var import_components49 = __toESM(require_components(), 1); 36450 var import_compose24 = __toESM(require_compose(), 1); 36451 var import_element67 = __toESM(require_element(), 1); 36452 var import_dom11 = __toESM(require_dom(), 1); 36453 var import_jsx_runtime303 = __toESM(require_jsx_runtime(), 1); 36454 var BATCH_SIZE = 20; 36455 function IconGrid({ icons, onChange, value }) { 36456 const shownIcons = (0, import_compose24.useAsyncList)(icons, { 36457 step: BATCH_SIZE 36458 }); 36459 const selectedIconRef = (0, import_element67.useRef)(); 36460 const selectedIndex = icons?.findIndex((icon2) => icon2.name === value) ?? -1; 36461 const isReadyToScroll = selectedIndex >= 0 && (shownIcons.length >= selectedIndex + BATCH_SIZE || shownIcons.length === icons.length); 36462 (0, import_element67.useLayoutEffect)(() => { 36463 const node = selectedIconRef.current; 36464 if (!isReadyToScroll || !node) { 36465 return; 36466 } 36467 if ((0, import_dom11.getScrollContainer)(node)?.scrollTop) { 36468 return; 36469 } 36470 node.scrollIntoView({ block: "center" }); 36471 }, [isReadyToScroll]); 36472 return /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "wp-block-icon__inserter-grid", children: !icons?.length ? /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("div", { className: "wp-block-icon__inserter-grid-no-results", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("p", { children: (0, import_i18n91.__)("No results found.") }) }) : /* @__PURE__ */ (0, import_jsx_runtime303.jsx)( 36473 "div", 36474 { 36475 className: "wp-block-icon__inserter-grid-icons-list", 36476 "aria-label": (0, import_i18n91.__)("Icon library"), 36477 children: shownIcons.map((icon2) => { 36478 return /* @__PURE__ */ (0, import_jsx_runtime303.jsxs)( 36479 import_components49.Button, 36480 { 36481 ref: icon2.name === value ? selectedIconRef : void 0, 36482 className: "wp-block-icon__inserter-grid-icons-list-item", 36483 onClick: () => onChange(icon2.name), 36484 variant: icon2.name === value ? "primary" : void 0, 36485 __next40pxDefaultSize: true, 36486 children: [ 36487 /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("span", { className: "wp-block-icon__inserter-grid-icons-list-item-icon", children: /* @__PURE__ */ (0, import_jsx_runtime303.jsx)(html_renderer_default, { html: icon2.content }) }), 36488 /* @__PURE__ */ (0, import_jsx_runtime303.jsx)("span", { className: "wp-block-icon__inserter-grid-icons-list-item-title", children: icon2.label }) 36489 ] 36490 }, 36491 icon2.name 36492 ); 36493 }) 36494 } 36495 ) }); 36496 } 36497 36498 // packages/block-library/build-module/utils/search-patterns.mjs 36499 var import_remove_accents2 = __toESM(require_remove_accents(), 1); 36500 function normalizeSearchInput(input = "") { 36501 input = (0, import_remove_accents2.default)(input); 36502 input = input.trim().toLowerCase(); 36503 return input; 36504 } 36505 function getPatternSearchRank(pattern, searchValue) { 36506 const normalizedSearchValue = normalizeSearchInput(searchValue); 36507 const normalizedTitle = normalizeSearchInput(pattern.title); 36508 let rank = 0; 36509 if (normalizedSearchValue === normalizedTitle) { 36510 rank += 30; 36511 } else if (normalizedTitle.startsWith(normalizedSearchValue)) { 36512 rank += 20; 36513 } else { 36514 const searchTerms = normalizedSearchValue.split(" "); 36515 const hasMatchedTerms = searchTerms.every( 36516 (searchTerm) => normalizedTitle.includes(searchTerm) 36517 ); 36518 if (hasMatchedTerms) { 36519 rank += 10; 36520 } 36521 } 36522 return rank; 36523 } 36524 function searchPatterns(patterns = [], searchValue = "") { 36525 if (!searchValue) { 36526 return patterns; 36527 } 36528 const rankedPatterns = patterns.map((pattern) => { 36529 return [pattern, getPatternSearchRank(pattern, searchValue)]; 36530 }).filter(([, rank]) => rank > 0); 36531 rankedPatterns.sort(([, rank1], [, rank2]) => rank2 - rank1); 36532 return rankedPatterns.map(([pattern]) => pattern); 36533 } 36534 36535 // packages/block-library/build-module/icon/components/custom-inserter/index.mjs 36536 var import_jsx_runtime304 = __toESM(require_jsx_runtime(), 1); 36537 function CustomInserterModal({ onClose, value, onChange }) { 36538 const [searchInput, setSearchInput] = (0, import_element68.useState)(""); 36539 const [currentCollection, setCurrentCollection] = (0, import_element68.useState)(null); 36540 const debouncedSetSearchInput = (0, import_compose25.useDebounce)(setSearchInput, 300); 36541 const collections = (0, import_data45.useSelect)( 36542 (select10) => select10(import_core_data23.store).getEntityRecords( 36543 "root", 36544 "iconCollection" 36545 ), 36546 [] 36547 ); 36548 const selectedCollection = value?.split("/")[0]; 36549 const collectionSlug = currentCollection ?? (collections?.some(({ slug }) => slug === selectedCollection) ? selectedCollection : collections?.[0]?.slug) ?? null; 36550 const { icons, hasResolvedIcons } = (0, import_data45.useSelect)( 36551 (select10) => { 36552 if (collectionSlug === null) { 36553 return { icons: null, hasResolvedIcons: false }; 36554 } 36555 const query = collectionSlug === "" ? {} : { collection: collectionSlug }; 36556 const { getEntityRecords, hasFinishedResolution } = select10(import_core_data23.store); 36557 return { 36558 icons: getEntityRecords("root", "icon", query), 36559 hasResolvedIcons: hasFinishedResolution("getEntityRecords", [ 36560 "root", 36561 "icon", 36562 query 36563 ]) 36564 }; 36565 }, 36566 [collectionSlug] 36567 ); 36568 const filteredIcons = (0, import_element68.useMemo)(() => { 36569 if (!icons) { 36570 return []; 36571 } 36572 if (searchInput) { 36573 const input = normalizeSearchInput(searchInput); 36574 return icons.filter((icon2) => { 36575 const iconName = normalizeSearchInput(icon2.name); 36576 const iconLabel = normalizeSearchInput(icon2.label); 36577 return iconName.includes(input) || iconLabel.includes(input); 36578 }); 36579 } 36580 return icons; 36581 }, [searchInput, icons]); 36582 return /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36583 import_components50.Modal, 36584 { 36585 className: "wp-block-icon__inserter-modal", 36586 title: (0, import_i18n92.__)("Icon library"), 36587 onRequestClose: onClose, 36588 isFullScreen: true, 36589 children: /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)( 36590 tabs_exports.Root, 36591 { 36592 className: "wp-block-icon__inserter", 36593 orientation: "vertical", 36594 value: collectionSlug, 36595 onValueChange: setCurrentCollection, 36596 children: [ 36597 /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)( 36598 Stack, 36599 { 36600 direction: "column", 36601 gap: "lg", 36602 className: "wp-block-icon__inserter-sidebar", 36603 children: [ 36604 /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36605 import_components50.SearchControl, 36606 { 36607 value: searchInput, 36608 onChange: debouncedSetSearchInput 36609 } 36610 ), 36611 /* @__PURE__ */ (0, import_jsx_runtime304.jsxs)(tabs_exports.List, { children: [ 36612 /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(tabs_exports.Tab, { value: "", children: (0, import_i18n92.__)("All") }), 36613 collections?.map((collection) => /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36614 tabs_exports.Tab, 36615 { 36616 value: collection.slug, 36617 children: collection.label 36618 }, 36619 collection.slug 36620 )) 36621 ] }) 36622 ] 36623 } 36624 ), 36625 [{ slug: "" }, ...collections ?? []].map( 36626 (collection) => /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36627 tabs_exports.Panel, 36628 { 36629 tabIndex: -1, 36630 value: collection.slug, 36631 className: "wp-block-icon__inserter-panel", 36632 children: !hasResolvedIcons ? /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36633 "div", 36634 { 36635 className: "wp-block-icon__inserter-loading", 36636 role: "status", 36637 "aria-label": (0, import_i18n92.__)("Loading\u2026"), 36638 children: /* @__PURE__ */ (0, import_jsx_runtime304.jsx)(import_components50.Spinner, {}) 36639 } 36640 ) : /* @__PURE__ */ (0, import_jsx_runtime304.jsx)( 36641 IconGrid, 36642 { 36643 icons: filteredIcons, 36644 onChange, 36645 value 36646 } 36647 ) 36648 }, 36649 collection.slug 36650 ) 36651 ) 36652 ] 36653 } 36654 ) 36655 } 36656 ); 36657 } 36658 36659 // packages/block-library/build-module/icon/edit.mjs 36660 var import_jsx_runtime305 = __toESM(require_jsx_runtime(), 1); 36661 var IconPlaceholder = ({ className, style: style2 }) => /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)( 36662 import_primitives165.SVG, 36663 { 36664 xmlns: "http://www.w3.org/2000/svg", 36665 viewBox: "0 0 60 60", 36666 preserveAspectRatio: "none", 36667 fill: "none", 36668 "aria-hidden": "true", 36669 className: clsx_default("wp-block-icon__placeholder", className), 36670 style: style2, 36671 children: [ 36672 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_primitives165.Rect, { width: "60", height: "60", fill: "currentColor", fillOpacity: 0.1 }), 36673 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36674 import_primitives165.Path, 36675 { 36676 vectorEffect: "non-scaling-stroke", 36677 stroke: "currentColor", 36678 strokeOpacity: 0.25, 36679 d: "M60 60 0 0" 36680 } 36681 ) 36682 ] 36683 } 36684 ); 36685 function Edit13({ attributes: attributes2, setAttributes }) { 36686 const { icon: icon2, ariaLabel, flipHorizontal, flipVertical, rotation } = attributes2; 36687 const [isInserterOpen, setInserterOpen] = (0, import_element69.useState)(false); 36688 const isContentOnlyMode = (0, import_block_editor102.useBlockEditingMode)() === "contentOnly"; 36689 const colorProps = (0, import_block_editor102.__experimentalUseColorProps)(attributes2); 36690 const spacingProps = (0, import_block_editor102.__experimentalGetSpacingClassesAndStyles)({ 36691 style: { 36692 spacing: { 36693 padding: attributes2.style?.spacing?.padding 36694 } 36695 } 36696 }); 36697 const borderProps = (0, import_block_editor102.__experimentalUseBorderProps)(attributes2); 36698 const dimensionsProps = (0, import_block_editor102.getDimensionsClassesAndStyles)(attributes2); 36699 const selectedIcon = (0, import_data46.useSelect)( 36700 (select10) => { 36701 const { getEntityRecord } = select10(import_core_data24.store); 36702 return icon2 ? getEntityRecord("root", "icon", icon2) : null; 36703 }, 36704 [icon2] 36705 ); 36706 const iconToDisplay = selectedIcon?.content || ""; 36707 const flipClasses = { 36708 "is-flip-horizontal": flipHorizontal, 36709 "is-flip-vertical": flipVertical 36710 }; 36711 const rotationStyle = rotation ? { rotate: `$rotation}deg` } : {}; 36712 const blockControls = /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(import_jsx_runtime305.Fragment, { children: [ 36713 icon2 && /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(import_block_editor102.BlockControls, { group: "block", children: [ 36714 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36715 import_components51.ToolbarButton, 36716 { 36717 icon: flip_horizontal_default, 36718 label: (0, import_i18n93.__)("Flip horizontal"), 36719 isPressed: flipHorizontal, 36720 onClick: () => setAttributes({ 36721 flipHorizontal: !flipHorizontal 36722 }) 36723 } 36724 ), 36725 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36726 import_components51.ToolbarButton, 36727 { 36728 icon: flip_vertical_default, 36729 label: (0, import_i18n93.__)("Flip vertical"), 36730 isPressed: flipVertical, 36731 onClick: () => setAttributes({ 36732 flipVertical: !flipVertical 36733 }) 36734 } 36735 ), 36736 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36737 import_components51.ToolbarButton, 36738 { 36739 icon: rotate_right_default, 36740 label: (0, import_i18n93.__)("Rotate"), 36741 onClick: () => setAttributes({ 36742 rotation: ((rotation || 0) + 90) % 360 36743 }) 36744 } 36745 ) 36746 ] }), 36747 /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(import_block_editor102.BlockControls, { group: "other", children: [ 36748 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36749 import_components51.ToolbarButton, 36750 { 36751 onClick: () => { 36752 setInserterOpen(true); 36753 }, 36754 children: icon2 ? (0, import_i18n93.__)("Replace") : (0, import_i18n93.__)("Choose icon") 36755 } 36756 ), 36757 isContentOnlyMode && icon2 && // Add some extra controls for content attributes when content only mode is active. 36758 // With content only mode active, the inspector is hidden, so users need another way 36759 // to edit these attributes. 36760 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36761 import_components51.DropdownMenu, 36762 { 36763 icon: "", 36764 toggleProps: { 36765 as: import_components51.ToolbarButton 36766 }, 36767 popoverProps: { 36768 className: "is-alternate" 36769 }, 36770 text: (0, import_i18n93.__)("Label"), 36771 children: () => /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36772 import_components51.TextControl, 36773 { 36774 className: "wp-block-icon__toolbar-content", 36775 label: (0, import_i18n93.__)("Label"), 36776 value: ariaLabel || "", 36777 onChange: (value) => setAttributes({ 36778 ariaLabel: value 36779 }), 36780 help: (0, import_i18n93.__)( 36781 "Briefly describe the icon to help screen reader users. Leave blank for decorative icons." 36782 ) 36783 } 36784 ) 36785 } 36786 ) 36787 ] }) 36788 ] }); 36789 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 36790 const inspectorControls = icon2 && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_jsx_runtime305.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)(import_block_editor102.InspectorControls, { group: "settings", children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36791 import_components51.__experimentalToolsPanel, 36792 { 36793 label: (0, import_i18n93.__)("Settings"), 36794 resetAll: () => setAttributes({ 36795 ariaLabel: void 0 36796 }), 36797 dropdownMenuProps, 36798 children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36799 import_components51.__experimentalToolsPanelItem, 36800 { 36801 label: (0, import_i18n93.__)("Label"), 36802 isShownByDefault: true, 36803 hasValue: () => !!ariaLabel, 36804 onDeselect: () => setAttributes({ ariaLabel: void 0 }), 36805 children: /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36806 import_components51.TextControl, 36807 { 36808 label: (0, import_i18n93.__)("Label"), 36809 help: (0, import_i18n93.__)( 36810 "Briefly describe the icon to help screen reader users. Leave blank for decorative icons." 36811 ), 36812 value: ariaLabel || "", 36813 onChange: (value) => setAttributes({ ariaLabel: value }) 36814 } 36815 ) 36816 } 36817 ) 36818 } 36819 ) }) }); 36820 return /* @__PURE__ */ (0, import_jsx_runtime305.jsxs)(import_jsx_runtime305.Fragment, { children: [ 36821 blockControls, 36822 inspectorControls, 36823 /* @__PURE__ */ (0, import_jsx_runtime305.jsx)("div", { ...(0, import_block_editor102.useBlockProps)(), children: iconToDisplay ? /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36824 html_renderer_default, 36825 { 36826 html: iconToDisplay, 36827 wrapperProps: { 36828 className: clsx_default( 36829 colorProps.className, 36830 borderProps.className, 36831 spacingProps.className, 36832 dimensionsProps.className, 36833 flipClasses 36834 ), 36835 style: { 36836 ...colorProps.style, 36837 ...borderProps.style, 36838 ...spacingProps.style, 36839 ...dimensionsProps.style, 36840 ...rotationStyle 36841 } 36842 } 36843 } 36844 ) : /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36845 IconPlaceholder, 36846 { 36847 className: clsx_default( 36848 borderProps.className, 36849 spacingProps.className, 36850 dimensionsProps.className, 36851 flipClasses 36852 ), 36853 style: { 36854 ...borderProps.style, 36855 ...spacingProps.style, 36856 ...dimensionsProps.style, 36857 ...rotationStyle, 36858 height: "auto" 36859 } 36860 } 36861 ) }), 36862 isInserterOpen && /* @__PURE__ */ (0, import_jsx_runtime305.jsx)( 36863 CustomInserterModal, 36864 { 36865 onClose: () => setInserterOpen(false), 36866 value: attributes2.icon, 36867 onChange: (name118) => { 36868 setAttributes({ icon: name118 }); 36869 setInserterOpen(false); 36870 } 36871 } 36872 ) 36873 ] }); 36874 } 36875 var edit_default13 = Edit13; 36876 36877 // packages/block-library/build-module/icon/block.json 36878 var block_default39 = { 36879 apiVersion: 3, 36880 $schema: "https://schemas.wp.org/trunk/block.json", 36881 name: "core/icon", 36882 title: "Icon", 36883 category: "media", 36884 description: "Insert an SVG icon.", 36885 keywords: ["icon", "svg"], 36886 textdomain: "default", 36887 attributes: { 36888 icon: { 36889 type: "string", 36890 role: "content" 36891 }, 36892 flipHorizontal: { 36893 type: "boolean", 36894 default: false 36895 }, 36896 flipVertical: { 36897 type: "boolean", 36898 default: false 36899 }, 36900 rotation: { 36901 type: "number", 36902 default: 0 36903 } 36904 }, 36905 supports: { 36906 anchor: true, 36907 ariaLabel: { 36908 __experimentalSkipSerialization: true 36909 }, 36910 align: ["left", "center", "right"], 36911 html: false, 36912 color: { 36913 __experimentalSkipSerialization: true, 36914 __experimentalDefaultControls: { 36915 background: true, 36916 text: true 36917 } 36918 }, 36919 interactivity: { 36920 clientNavigation: true 36921 }, 36922 __experimentalBorder: { 36923 color: true, 36924 radius: true, 36925 style: true, 36926 width: true, 36927 __experimentalSkipSerialization: true, 36928 __experimentalDefaultControls: { 36929 color: false, 36930 radius: false, 36931 style: false, 36932 width: false 36933 } 36934 }, 36935 spacing: { 36936 padding: true, 36937 margin: true, 36938 __experimentalSkipSerialization: ["padding"], 36939 __experimentalDefaultControls: { 36940 margin: false, 36941 padding: false 36942 } 36943 }, 36944 dimensions: { 36945 width: true, 36946 __experimentalSkipSerialization: ["width"], 36947 __experimentalDefaultControls: { 36948 width: true 36949 } 36950 } 36951 }, 36952 selectors: { 36953 root: ".wp-block-icon svg", 36954 css: ".wp-block-icon", 36955 spacing: { 36956 margin: ".wp-block-icon" 36957 } 36958 }, 36959 style: "wp-block-icon", 36960 editorStyle: "wp-block-icon-editor" 36961 }; 36962 36963 // packages/block-library/build-module/icon/icon.mjs 36964 var import_components53 = __toESM(require_components(), 1); 36965 var import_jsx_runtime306 = __toESM(require_jsx_runtime(), 1); 36966 var icon = /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_components53.SVG, { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", fill: "none", children: /* @__PURE__ */ (0, import_jsx_runtime306.jsx)(import_components53.Path, { d: "M6 9.5h3.5V6H6v3.5Zm5 .5a1 1 0 0 1-.898.995L10 11H5.5l-.103-.005a1 1 0 0 1-.892-.893L4.5 10V5.5a1 1 0 0 1 1-1H10a1 1 0 0 1 1 1V10ZM18.25 7.75a2 2 0 1 0-4 0 2 2 0 0 0 4 0Zm1.5 0a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM6.88 13.535a1 1 0 0 1 1.74 0l2.534 4.472a1 1 0 0 1-.87 1.493H5.216a1 1 0 0 1-.87-1.493l2.534-4.472ZM6.074 18h3.352L7.75 15.041l-1.676 2.96ZM14.952 13h2.596a1 1 0 0 1 .866.5l1.298 2.25a1 1 0 0 1 0 1L18.414 19l-.074.11a1 1 0 0 1-.792.39h-2.596a1 1 0 0 1-.792-.39l-.074-.11-1.298-2.25a1.001 1.001 0 0 1 0-1l1.298-2.25a1 1 0 0 1 .866-.5Zm-.72 3.25 1.01 1.75h2.017l1.009-1.75-1.01-1.75h-2.017l-1.01 1.75Z" }) }); 36967 var icon_default2 = icon; 36968 36969 // packages/block-library/build-module/icon/variations.mjs 36970 var variations9 = [ 36971 { 36972 name: "default", 36973 isDefault: true, 36974 attributes: { icon: "core/info" } 36975 } 36976 ]; 36977 var variations_default9 = variations9; 36978 36979 // packages/block-library/build-module/icon/index.mjs 36980 var { name: name39 } = block_default39; 36981 var settings39 = { 36982 icon: icon_default2, 36983 example: { 36984 attributes: { 36985 icon: "core/info", 36986 style: { 36987 dimensions: { 36988 width: "48px" 36989 } 36990 } 36991 } 36992 }, 36993 variations: variations_default9, 36994 edit: edit_default13 36995 }; 36996 var init39 = () => initBlock({ name: name39, metadata: block_default39, settings: settings39 }); 36997 36998 // packages/block-library/build-module/image/index.mjs 36999 var image_exports = {}; 37000 __export(image_exports, { 37001 init: () => init40, 37002 metadata: () => block_default40, 37003 name: () => name40, 37004 settings: () => settings40 37005 }); 37006 var import_i18n97 = __toESM(require_i18n(), 1); 37007 var import_blocks42 = __toESM(require_blocks(), 1); 37008 37009 // packages/block-library/build-module/image/deprecated.mjs 37010 var import_block_editor103 = __toESM(require_block_editor(), 1); 37011 var import_jsx_runtime307 = __toESM(require_jsx_runtime(), 1); 37012 var v118 = { 37013 attributes: { 37014 url: { 37015 type: "string", 37016 source: "attribute", 37017 selector: "img", 37018 attribute: "src" 37019 }, 37020 alt: { 37021 type: "string", 37022 source: "attribute", 37023 selector: "img", 37024 attribute: "alt", 37025 default: "" 37026 }, 37027 caption: { 37028 type: "array", 37029 source: "children", 37030 selector: "figcaption" 37031 }, 37032 href: { 37033 type: "string", 37034 source: "attribute", 37035 selector: "a", 37036 attribute: "href" 37037 }, 37038 id: { 37039 type: "number" 37040 }, 37041 align: { 37042 type: "string" 37043 }, 37044 width: { 37045 type: "number" 37046 }, 37047 height: { 37048 type: "number" 37049 } 37050 }, 37051 save({ attributes: attributes2 }) { 37052 const { url, alt, caption, align, href, width, height } = attributes2; 37053 const extraImageProps = width || height ? { width, height } : {}; 37054 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("img", { src: url, alt, ...extraImageProps }); 37055 let figureStyle = {}; 37056 if (width) { 37057 figureStyle = { width }; 37058 } else if (align === "left" || align === "right") { 37059 figureStyle = { maxWidth: "50%" }; 37060 } 37061 return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)( 37062 "figure", 37063 { 37064 className: align ? `align$align}` : null, 37065 style: figureStyle, 37066 children: [ 37067 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("a", { href, children: image }) : image, 37068 !import_block_editor103.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_block_editor103.RichText.Content, { tagName: "figcaption", value: caption }) 37069 ] 37070 } 37071 ); 37072 } 37073 }; 37074 var v29 = { 37075 attributes: { 37076 url: { 37077 type: "string", 37078 source: "attribute", 37079 selector: "img", 37080 attribute: "src" 37081 }, 37082 alt: { 37083 type: "string", 37084 source: "attribute", 37085 selector: "img", 37086 attribute: "alt", 37087 default: "" 37088 }, 37089 caption: { 37090 type: "array", 37091 source: "children", 37092 selector: "figcaption" 37093 }, 37094 href: { 37095 type: "string", 37096 source: "attribute", 37097 selector: "a", 37098 attribute: "href" 37099 }, 37100 id: { 37101 type: "number" 37102 }, 37103 align: { 37104 type: "string" 37105 }, 37106 width: { 37107 type: "number" 37108 }, 37109 height: { 37110 type: "number" 37111 } 37112 }, 37113 save({ attributes: attributes2 }) { 37114 const { url, alt, caption, align, href, width, height, id } = attributes2; 37115 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37116 "img", 37117 { 37118 src: url, 37119 alt, 37120 className: id ? `wp-image-$id}` : null, 37121 width, 37122 height 37123 } 37124 ); 37125 return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("figure", { className: align ? `align$align}` : null, children: [ 37126 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("a", { href, children: image }) : image, 37127 !import_block_editor103.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_block_editor103.RichText.Content, { tagName: "figcaption", value: caption }) 37128 ] }); 37129 } 37130 }; 37131 var v36 = { 37132 attributes: { 37133 url: { 37134 type: "string", 37135 source: "attribute", 37136 selector: "img", 37137 attribute: "src" 37138 }, 37139 alt: { 37140 type: "string", 37141 source: "attribute", 37142 selector: "img", 37143 attribute: "alt", 37144 default: "" 37145 }, 37146 caption: { 37147 type: "array", 37148 source: "children", 37149 selector: "figcaption" 37150 }, 37151 href: { 37152 type: "string", 37153 source: "attribute", 37154 selector: "figure > a", 37155 attribute: "href" 37156 }, 37157 id: { 37158 type: "number" 37159 }, 37160 align: { 37161 type: "string" 37162 }, 37163 width: { 37164 type: "number" 37165 }, 37166 height: { 37167 type: "number" 37168 }, 37169 linkDestination: { 37170 type: "string", 37171 default: "none" 37172 } 37173 }, 37174 save({ attributes: attributes2 }) { 37175 const { url, alt, caption, align, href, width, height, id } = attributes2; 37176 const classes = clsx_default({ 37177 [`align$align}`]: align, 37178 "is-resized": width || height 37179 }); 37180 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37181 "img", 37182 { 37183 src: url, 37184 alt, 37185 className: id ? `wp-image-$id}` : null, 37186 width, 37187 height 37188 } 37189 ); 37190 return /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)("figure", { className: classes, children: [ 37191 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("a", { href, children: image }) : image, 37192 !import_block_editor103.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_block_editor103.RichText.Content, { tagName: "figcaption", value: caption }) 37193 ] }); 37194 } 37195 }; 37196 var v44 = { 37197 attributes: { 37198 align: { 37199 type: "string" 37200 }, 37201 url: { 37202 type: "string", 37203 source: "attribute", 37204 selector: "img", 37205 attribute: "src" 37206 }, 37207 alt: { 37208 type: "string", 37209 source: "attribute", 37210 selector: "img", 37211 attribute: "alt", 37212 default: "" 37213 }, 37214 caption: { 37215 type: "string", 37216 source: "html", 37217 selector: "figcaption" 37218 }, 37219 title: { 37220 type: "string", 37221 source: "attribute", 37222 selector: "img", 37223 attribute: "title" 37224 }, 37225 href: { 37226 type: "string", 37227 source: "attribute", 37228 selector: "figure > a", 37229 attribute: "href" 37230 }, 37231 rel: { 37232 type: "string", 37233 source: "attribute", 37234 selector: "figure > a", 37235 attribute: "rel" 37236 }, 37237 linkClass: { 37238 type: "string", 37239 source: "attribute", 37240 selector: "figure > a", 37241 attribute: "class" 37242 }, 37243 id: { 37244 type: "number" 37245 }, 37246 width: { 37247 type: "number" 37248 }, 37249 height: { 37250 type: "number" 37251 }, 37252 sizeSlug: { 37253 type: "string" 37254 }, 37255 linkDestination: { 37256 type: "string" 37257 }, 37258 linkTarget: { 37259 type: "string", 37260 source: "attribute", 37261 selector: "figure > a", 37262 attribute: "target" 37263 } 37264 }, 37265 supports: { 37266 anchor: true 37267 }, 37268 save({ attributes: attributes2 }) { 37269 const { 37270 url, 37271 alt, 37272 caption, 37273 align, 37274 href, 37275 rel, 37276 linkClass, 37277 width, 37278 height, 37279 id, 37280 linkTarget, 37281 sizeSlug, 37282 title 37283 } = attributes2; 37284 const newRel = !rel ? void 0 : rel; 37285 const classes = clsx_default({ 37286 [`align$align}`]: align, 37287 [`size-$sizeSlug}`]: sizeSlug, 37288 "is-resized": width || height 37289 }); 37290 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37291 "img", 37292 { 37293 src: url, 37294 alt, 37295 className: id ? `wp-image-$id}` : null, 37296 width, 37297 height, 37298 title 37299 } 37300 ); 37301 const figure = /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(import_jsx_runtime307.Fragment, { children: [ 37302 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37303 "a", 37304 { 37305 className: linkClass, 37306 href, 37307 target: linkTarget, 37308 rel: newRel, 37309 children: image 37310 } 37311 ) : image, 37312 !import_block_editor103.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_block_editor103.RichText.Content, { tagName: "figcaption", value: caption }) 37313 ] }); 37314 if ("left" === align || "right" === align || "center" === align) { 37315 return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("div", { ...import_block_editor103.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("figure", { className: classes, children: figure }) }); 37316 } 37317 return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("figure", { ...import_block_editor103.useBlockProps.save({ className: classes }), children: figure }); 37318 } 37319 }; 37320 var v54 = { 37321 attributes: { 37322 align: { 37323 type: "string" 37324 }, 37325 url: { 37326 type: "string", 37327 source: "attribute", 37328 selector: "img", 37329 attribute: "src" 37330 }, 37331 alt: { 37332 type: "string", 37333 source: "attribute", 37334 selector: "img", 37335 attribute: "alt", 37336 default: "" 37337 }, 37338 caption: { 37339 type: "string", 37340 source: "html", 37341 selector: "figcaption" 37342 }, 37343 title: { 37344 type: "string", 37345 source: "attribute", 37346 selector: "img", 37347 attribute: "title" 37348 }, 37349 href: { 37350 type: "string", 37351 source: "attribute", 37352 selector: "figure > a", 37353 attribute: "href" 37354 }, 37355 rel: { 37356 type: "string", 37357 source: "attribute", 37358 selector: "figure > a", 37359 attribute: "rel" 37360 }, 37361 linkClass: { 37362 type: "string", 37363 source: "attribute", 37364 selector: "figure > a", 37365 attribute: "class" 37366 }, 37367 id: { 37368 type: "number" 37369 }, 37370 width: { 37371 type: "number" 37372 }, 37373 height: { 37374 type: "number" 37375 }, 37376 sizeSlug: { 37377 type: "string" 37378 }, 37379 linkDestination: { 37380 type: "string" 37381 }, 37382 linkTarget: { 37383 type: "string", 37384 source: "attribute", 37385 selector: "figure > a", 37386 attribute: "target" 37387 } 37388 }, 37389 supports: { 37390 anchor: true, 37391 color: { 37392 __experimentalDuotone: "img", 37393 text: false, 37394 background: false 37395 }, 37396 __experimentalBorder: { 37397 radius: true, 37398 __experimentalDefaultControls: { 37399 radius: true 37400 } 37401 }, 37402 __experimentalStyle: { 37403 spacing: { 37404 margin: "0 0 1em 0" 37405 } 37406 } 37407 }, 37408 save({ attributes: attributes2 }) { 37409 const { 37410 url, 37411 alt, 37412 caption, 37413 align, 37414 href, 37415 rel, 37416 linkClass, 37417 width, 37418 height, 37419 id, 37420 linkTarget, 37421 sizeSlug, 37422 title 37423 } = attributes2; 37424 const newRel = !rel ? void 0 : rel; 37425 const classes = clsx_default({ 37426 [`align$align}`]: align, 37427 [`size-$sizeSlug}`]: sizeSlug, 37428 "is-resized": width || height 37429 }); 37430 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37431 "img", 37432 { 37433 src: url, 37434 alt, 37435 className: id ? `wp-image-$id}` : null, 37436 width, 37437 height, 37438 title 37439 } 37440 ); 37441 const figure = /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(import_jsx_runtime307.Fragment, { children: [ 37442 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37443 "a", 37444 { 37445 className: linkClass, 37446 href, 37447 target: linkTarget, 37448 rel: newRel, 37449 children: image 37450 } 37451 ) : image, 37452 !import_block_editor103.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)(import_block_editor103.RichText.Content, { tagName: "figcaption", value: caption }) 37453 ] }); 37454 return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("figure", { ...import_block_editor103.useBlockProps.save({ className: classes }), children: figure }); 37455 } 37456 }; 37457 var v64 = { 37458 attributes: { 37459 align: { 37460 type: "string" 37461 }, 37462 url: { 37463 type: "string", 37464 source: "attribute", 37465 selector: "img", 37466 attribute: "src", 37467 role: "content" 37468 }, 37469 alt: { 37470 type: "string", 37471 source: "attribute", 37472 selector: "img", 37473 attribute: "alt", 37474 default: "", 37475 role: "content" 37476 }, 37477 caption: { 37478 type: "string", 37479 source: "html", 37480 selector: "figcaption", 37481 role: "content" 37482 }, 37483 title: { 37484 type: "string", 37485 source: "attribute", 37486 selector: "img", 37487 attribute: "title", 37488 role: "content" 37489 }, 37490 href: { 37491 type: "string", 37492 source: "attribute", 37493 selector: "figure > a", 37494 attribute: "href", 37495 role: "content" 37496 }, 37497 rel: { 37498 type: "string", 37499 source: "attribute", 37500 selector: "figure > a", 37501 attribute: "rel" 37502 }, 37503 linkClass: { 37504 type: "string", 37505 source: "attribute", 37506 selector: "figure > a", 37507 attribute: "class" 37508 }, 37509 id: { 37510 type: "number", 37511 role: "content" 37512 }, 37513 width: { 37514 type: "number" 37515 }, 37516 height: { 37517 type: "number" 37518 }, 37519 aspectRatio: { 37520 type: "string" 37521 }, 37522 scale: { 37523 type: "string" 37524 }, 37525 sizeSlug: { 37526 type: "string" 37527 }, 37528 linkDestination: { 37529 type: "string" 37530 }, 37531 linkTarget: { 37532 type: "string", 37533 source: "attribute", 37534 selector: "figure > a", 37535 attribute: "target" 37536 } 37537 }, 37538 supports: { 37539 anchor: true, 37540 color: { 37541 text: false, 37542 background: false 37543 }, 37544 filter: { 37545 duotone: true 37546 }, 37547 __experimentalBorder: { 37548 color: true, 37549 radius: true, 37550 width: true, 37551 __experimentalSkipSerialization: true, 37552 __experimentalDefaultControls: { 37553 color: true, 37554 radius: true, 37555 width: true 37556 } 37557 } 37558 }, 37559 migrate(attributes2) { 37560 const { height, width } = attributes2; 37561 return { 37562 ...attributes2, 37563 width: typeof width === "number" ? `$width}px` : width, 37564 height: typeof height === "number" ? `$height}px` : height 37565 }; 37566 }, 37567 save({ attributes: attributes2 }) { 37568 const { 37569 url, 37570 alt, 37571 caption, 37572 align, 37573 href, 37574 rel, 37575 linkClass, 37576 width, 37577 height, 37578 aspectRatio, 37579 scale, 37580 id, 37581 linkTarget, 37582 sizeSlug, 37583 title 37584 } = attributes2; 37585 const newRel = !rel ? void 0 : rel; 37586 const borderProps = (0, import_block_editor103.__experimentalGetBorderClassesAndStyles)(attributes2); 37587 const classes = clsx_default({ 37588 [`align$align}`]: align, 37589 [`size-$sizeSlug}`]: sizeSlug, 37590 "is-resized": width || height, 37591 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 37592 }); 37593 const imageClasses = clsx_default(borderProps.className, { 37594 [`wp-image-$id}`]: !!id 37595 }); 37596 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37597 "img", 37598 { 37599 src: url, 37600 alt, 37601 className: imageClasses || void 0, 37602 style: { 37603 ...borderProps.style, 37604 aspectRatio, 37605 objectFit: scale 37606 }, 37607 width, 37608 height, 37609 title 37610 } 37611 ); 37612 const figure = /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(import_jsx_runtime307.Fragment, { children: [ 37613 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37614 "a", 37615 { 37616 className: linkClass, 37617 href, 37618 target: linkTarget, 37619 rel: newRel, 37620 children: image 37621 } 37622 ) : image, 37623 !import_block_editor103.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37624 import_block_editor103.RichText.Content, 37625 { 37626 className: (0, import_block_editor103.__experimentalGetElementClassName)( 37627 "caption" 37628 ), 37629 tagName: "figcaption", 37630 value: caption 37631 } 37632 ) 37633 ] }); 37634 return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("figure", { ...import_block_editor103.useBlockProps.save({ className: classes }), children: figure }); 37635 } 37636 }; 37637 var v73 = { 37638 attributes: { 37639 align: { 37640 type: "string" 37641 }, 37642 url: { 37643 type: "string", 37644 source: "attribute", 37645 selector: "img", 37646 attribute: "src", 37647 role: "content" 37648 }, 37649 alt: { 37650 type: "string", 37651 source: "attribute", 37652 selector: "img", 37653 attribute: "alt", 37654 default: "", 37655 role: "content" 37656 }, 37657 caption: { 37658 type: "string", 37659 source: "html", 37660 selector: "figcaption", 37661 role: "content" 37662 }, 37663 title: { 37664 type: "string", 37665 source: "attribute", 37666 selector: "img", 37667 attribute: "title", 37668 role: "content" 37669 }, 37670 href: { 37671 type: "string", 37672 source: "attribute", 37673 selector: "figure > a", 37674 attribute: "href", 37675 role: "content" 37676 }, 37677 rel: { 37678 type: "string", 37679 source: "attribute", 37680 selector: "figure > a", 37681 attribute: "rel" 37682 }, 37683 linkClass: { 37684 type: "string", 37685 source: "attribute", 37686 selector: "figure > a", 37687 attribute: "class" 37688 }, 37689 id: { 37690 type: "number", 37691 role: "content" 37692 }, 37693 width: { 37694 type: "number" 37695 }, 37696 height: { 37697 type: "number" 37698 }, 37699 aspectRatio: { 37700 type: "string" 37701 }, 37702 scale: { 37703 type: "string" 37704 }, 37705 sizeSlug: { 37706 type: "string" 37707 }, 37708 linkDestination: { 37709 type: "string" 37710 }, 37711 linkTarget: { 37712 type: "string", 37713 source: "attribute", 37714 selector: "figure > a", 37715 attribute: "target" 37716 } 37717 }, 37718 supports: { 37719 anchor: true, 37720 color: { 37721 text: false, 37722 background: false 37723 }, 37724 filter: { 37725 duotone: true 37726 }, 37727 __experimentalBorder: { 37728 color: true, 37729 radius: true, 37730 width: true, 37731 __experimentalSkipSerialization: true, 37732 __experimentalDefaultControls: { 37733 color: true, 37734 radius: true, 37735 width: true 37736 } 37737 } 37738 }, 37739 migrate(attributes2) { 37740 const { width, height } = attributes2; 37741 return { 37742 ...attributes2, 37743 width: typeof width === "number" ? `$width}px` : width, 37744 height: typeof height === "number" ? `$height}px` : height 37745 }; 37746 }, 37747 save({ attributes: attributes2 }) { 37748 const { 37749 url, 37750 alt, 37751 caption, 37752 align, 37753 href, 37754 rel, 37755 linkClass, 37756 width, 37757 height, 37758 aspectRatio, 37759 scale, 37760 id, 37761 linkTarget, 37762 sizeSlug, 37763 title 37764 } = attributes2; 37765 const newRel = !rel ? void 0 : rel; 37766 const borderProps = (0, import_block_editor103.__experimentalGetBorderClassesAndStyles)(attributes2); 37767 const classes = clsx_default({ 37768 [`align$align}`]: align, 37769 [`size-$sizeSlug}`]: sizeSlug, 37770 "is-resized": width || height, 37771 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 37772 }); 37773 const imageClasses = clsx_default(borderProps.className, { 37774 [`wp-image-$id}`]: !!id 37775 }); 37776 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37777 "img", 37778 { 37779 src: url, 37780 alt, 37781 className: imageClasses || void 0, 37782 style: { 37783 ...borderProps.style, 37784 aspectRatio, 37785 objectFit: scale, 37786 width, 37787 height 37788 }, 37789 width, 37790 height, 37791 title 37792 } 37793 ); 37794 const figure = /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(import_jsx_runtime307.Fragment, { children: [ 37795 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37796 "a", 37797 { 37798 className: linkClass, 37799 href, 37800 target: linkTarget, 37801 rel: newRel, 37802 children: image 37803 } 37804 ) : image, 37805 !import_block_editor103.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37806 import_block_editor103.RichText.Content, 37807 { 37808 className: (0, import_block_editor103.__experimentalGetElementClassName)( 37809 "caption" 37810 ), 37811 tagName: "figcaption", 37812 value: caption 37813 } 37814 ) 37815 ] }); 37816 return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("figure", { ...import_block_editor103.useBlockProps.save({ className: classes }), children: figure }); 37817 } 37818 }; 37819 var v82 = { 37820 attributes: { 37821 align: { 37822 type: "string" 37823 }, 37824 behaviors: { 37825 type: "object" 37826 }, 37827 url: { 37828 type: "string", 37829 source: "attribute", 37830 selector: "img", 37831 attribute: "src", 37832 role: "content" 37833 }, 37834 alt: { 37835 type: "string", 37836 source: "attribute", 37837 selector: "img", 37838 attribute: "alt", 37839 default: "", 37840 role: "content" 37841 }, 37842 caption: { 37843 type: "string", 37844 source: "html", 37845 selector: "figcaption", 37846 role: "content" 37847 }, 37848 title: { 37849 type: "string", 37850 source: "attribute", 37851 selector: "img", 37852 attribute: "title", 37853 role: "content" 37854 }, 37855 href: { 37856 type: "string", 37857 source: "attribute", 37858 selector: "figure > a", 37859 attribute: "href", 37860 role: "content" 37861 }, 37862 rel: { 37863 type: "string", 37864 source: "attribute", 37865 selector: "figure > a", 37866 attribute: "rel" 37867 }, 37868 linkClass: { 37869 type: "string", 37870 source: "attribute", 37871 selector: "figure > a", 37872 attribute: "class" 37873 }, 37874 id: { 37875 type: "number", 37876 role: "content" 37877 }, 37878 width: { 37879 type: "string" 37880 }, 37881 height: { 37882 type: "string" 37883 }, 37884 aspectRatio: { 37885 type: "string" 37886 }, 37887 scale: { 37888 type: "string" 37889 }, 37890 sizeSlug: { 37891 type: "string" 37892 }, 37893 linkDestination: { 37894 type: "string" 37895 }, 37896 linkTarget: { 37897 type: "string", 37898 source: "attribute", 37899 selector: "figure > a", 37900 attribute: "target" 37901 } 37902 }, 37903 supports: { 37904 anchor: true, 37905 color: { 37906 text: false, 37907 background: false 37908 }, 37909 filter: { 37910 duotone: true 37911 }, 37912 __experimentalBorder: { 37913 color: true, 37914 radius: true, 37915 width: true, 37916 __experimentalSkipSerialization: true, 37917 __experimentalDefaultControls: { 37918 color: true, 37919 radius: true, 37920 width: true 37921 } 37922 } 37923 }, 37924 migrate({ width, height, ...attributes2 }) { 37925 if (!attributes2.behaviors?.lightbox) { 37926 return attributes2; 37927 } 37928 const { 37929 behaviors: { 37930 lightbox: { enabled } 37931 } 37932 } = attributes2; 37933 const newAttributes = { 37934 ...attributes2, 37935 lightbox: { 37936 enabled 37937 } 37938 }; 37939 delete newAttributes.behaviors; 37940 return newAttributes; 37941 }, 37942 isEligible(attributes2) { 37943 return !!attributes2.behaviors; 37944 }, 37945 save({ attributes: attributes2 }) { 37946 const { 37947 url, 37948 alt, 37949 caption, 37950 align, 37951 href, 37952 rel, 37953 linkClass, 37954 width, 37955 height, 37956 aspectRatio, 37957 scale, 37958 id, 37959 linkTarget, 37960 sizeSlug, 37961 title 37962 } = attributes2; 37963 const newRel = !rel ? void 0 : rel; 37964 const borderProps = (0, import_block_editor103.__experimentalGetBorderClassesAndStyles)(attributes2); 37965 const classes = clsx_default({ 37966 [`align$align}`]: align, 37967 [`size-$sizeSlug}`]: sizeSlug, 37968 "is-resized": width || height, 37969 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 37970 }); 37971 const imageClasses = clsx_default(borderProps.className, { 37972 [`wp-image-$id}`]: !!id 37973 }); 37974 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37975 "img", 37976 { 37977 src: url, 37978 alt, 37979 className: imageClasses || void 0, 37980 style: { 37981 ...borderProps.style, 37982 aspectRatio, 37983 objectFit: scale, 37984 width, 37985 height 37986 }, 37987 title 37988 } 37989 ); 37990 const figure = /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(import_jsx_runtime307.Fragment, { children: [ 37991 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 37992 "a", 37993 { 37994 className: linkClass, 37995 href, 37996 target: linkTarget, 37997 rel: newRel, 37998 children: image 37999 } 38000 ) : image, 38001 !import_block_editor103.RichText.isEmpty(caption) && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 38002 import_block_editor103.RichText.Content, 38003 { 38004 className: (0, import_block_editor103.__experimentalGetElementClassName)( 38005 "caption" 38006 ), 38007 tagName: "figcaption", 38008 value: caption 38009 } 38010 ) 38011 ] }); 38012 return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("figure", { ...import_block_editor103.useBlockProps.save({ className: classes }), children: figure }); 38013 } 38014 }; 38015 var v92 = { 38016 attributes: { 38017 blob: { 38018 type: "string", 38019 role: "local" 38020 }, 38021 url: { 38022 type: "string", 38023 source: "attribute", 38024 selector: "img", 38025 attribute: "src", 38026 role: "content" 38027 }, 38028 alt: { 38029 type: "string", 38030 source: "attribute", 38031 selector: "img", 38032 attribute: "alt", 38033 default: "", 38034 role: "content" 38035 }, 38036 caption: { 38037 type: "rich-text", 38038 source: "rich-text", 38039 selector: "figcaption", 38040 role: "content" 38041 }, 38042 lightbox: { 38043 type: "object", 38044 enabled: { 38045 type: "boolean" 38046 } 38047 }, 38048 title: { 38049 type: "string", 38050 source: "attribute", 38051 selector: "img", 38052 attribute: "title", 38053 role: "content" 38054 }, 38055 href: { 38056 type: "string", 38057 source: "attribute", 38058 selector: "figure > a", 38059 attribute: "href", 38060 role: "content" 38061 }, 38062 rel: { 38063 type: "string", 38064 source: "attribute", 38065 selector: "figure > a", 38066 attribute: "rel" 38067 }, 38068 linkClass: { 38069 type: "string", 38070 source: "attribute", 38071 selector: "figure > a", 38072 attribute: "class" 38073 }, 38074 id: { 38075 type: "number", 38076 role: "content" 38077 }, 38078 width: { 38079 type: "string" 38080 }, 38081 height: { 38082 type: "string" 38083 }, 38084 aspectRatio: { 38085 type: "string" 38086 }, 38087 scale: { 38088 type: "string" 38089 }, 38090 focalPoint: { 38091 type: "object" 38092 }, 38093 sizeSlug: { 38094 type: "string" 38095 }, 38096 linkDestination: { 38097 type: "string" 38098 }, 38099 linkTarget: { 38100 type: "string", 38101 source: "attribute", 38102 selector: "figure > a", 38103 attribute: "target" 38104 } 38105 }, 38106 supports: { 38107 interactivity: true, 38108 align: ["left", "center", "right", "wide", "full"], 38109 anchor: true, 38110 color: { 38111 text: false, 38112 background: false 38113 }, 38114 filter: { 38115 duotone: true 38116 }, 38117 spacing: { 38118 margin: true 38119 }, 38120 __experimentalBorder: { 38121 color: true, 38122 radius: true, 38123 width: true, 38124 __experimentalSkipSerialization: true, 38125 __experimentalDefaultControls: { 38126 color: true, 38127 radius: true, 38128 width: true 38129 } 38130 }, 38131 shadow: { 38132 __experimentalSkipSerialization: true 38133 } 38134 }, 38135 save({ attributes: attributes2 }) { 38136 const { 38137 url, 38138 alt, 38139 caption, 38140 align, 38141 href, 38142 rel, 38143 linkClass, 38144 width, 38145 height, 38146 aspectRatio, 38147 scale, 38148 focalPoint, 38149 id, 38150 linkTarget, 38151 sizeSlug, 38152 title, 38153 metadata: { bindings = {} } = {} 38154 } = attributes2; 38155 const newRel = !rel ? void 0 : rel; 38156 const borderProps = (0, import_block_editor103.__experimentalGetBorderClassesAndStyles)(attributes2); 38157 const shadowProps = (0, import_block_editor103.__experimentalGetShadowClassesAndStyles)(attributes2); 38158 const classes = clsx_default({ 38159 alignnone: "none" === align, 38160 [`size-$sizeSlug}`]: sizeSlug, 38161 "is-resized": width || height, 38162 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 38163 }); 38164 const imageClasses = clsx_default(borderProps.className, { 38165 [`wp-image-$id}`]: !!id 38166 }); 38167 const image = /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 38168 "img", 38169 { 38170 src: url, 38171 alt, 38172 className: imageClasses || void 0, 38173 style: { 38174 ...borderProps.style, 38175 ...shadowProps.style, 38176 aspectRatio, 38177 objectFit: scale, 38178 objectPosition: focalPoint && scale ? mediaPosition2(focalPoint) : void 0, 38179 width, 38180 height 38181 }, 38182 title 38183 } 38184 ); 38185 const displayCaption = !import_block_editor103.RichText.isEmpty(caption) || bindings.caption || bindings?.__default?.source === "core/pattern-overrides"; 38186 const figure = /* @__PURE__ */ (0, import_jsx_runtime307.jsxs)(import_jsx_runtime307.Fragment, { children: [ 38187 href ? /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 38188 "a", 38189 { 38190 className: linkClass, 38191 href, 38192 target: linkTarget, 38193 rel: newRel, 38194 children: image 38195 } 38196 ) : image, 38197 displayCaption && /* @__PURE__ */ (0, import_jsx_runtime307.jsx)( 38198 import_block_editor103.RichText.Content, 38199 { 38200 className: (0, import_block_editor103.__experimentalGetElementClassName)( 38201 "caption" 38202 ), 38203 tagName: "figcaption", 38204 value: caption 38205 } 38206 ) 38207 ] }); 38208 return /* @__PURE__ */ (0, import_jsx_runtime307.jsx)("figure", { ...import_block_editor103.useBlockProps.save({ className: classes }), children: figure }); 38209 } 38210 }; 38211 var deprecated_default20 = [v92, v82, v73, v64, v54, v44, v36, v29, v118]; 38212 38213 // packages/block-library/build-module/image/edit.mjs 38214 var import_blob12 = __toESM(require_blob(), 1); 38215 var import_blocks40 = __toESM(require_blocks(), 1); 38216 var import_components56 = __toESM(require_components(), 1); 38217 var import_data50 = __toESM(require_data(), 1); 38218 var import_block_editor107 = __toESM(require_block_editor(), 1); 38219 var import_element74 = __toESM(require_element(), 1); 38220 var import_i18n96 = __toESM(require_i18n(), 1); 38221 var import_notices8 = __toESM(require_notices(), 1); 38222 var import_compose28 = __toESM(require_compose(), 1); 38223 var import_url12 = __toESM(require_url(), 1); 38224 var import_upload_media = __toESM(require_upload_media(), 1); 38225 38226 // packages/block-library/build-module/image/image.mjs 38227 var import_components55 = __toESM(require_components(), 1); 38228 var import_compose26 = __toESM(require_compose(), 1); 38229 var import_data49 = __toESM(require_data(), 1); 38230 var import_block_editor106 = __toESM(require_block_editor(), 1); 38231 var import_element72 = __toESM(require_element(), 1); 38232 var import_i18n95 = __toESM(require_i18n(), 1); 38233 var import_url11 = __toESM(require_url(), 1); 38234 var import_blocks39 = __toESM(require_blocks(), 1); 38235 var import_notices7 = __toESM(require_notices(), 1); 38236 var import_core_data26 = __toESM(require_core_data(), 1); 38237 38238 // packages/block-library/build-module/utils/media-control.mjs 38239 var import_components54 = __toESM(require_components(), 1); 38240 var import_block_editor104 = __toESM(require_block_editor(), 1); 38241 var import_dom12 = __toESM(require_dom(), 1); 38242 var import_element70 = __toESM(require_element(), 1); 38243 var import_i18n94 = __toESM(require_i18n(), 1); 38244 var import_data47 = __toESM(require_data(), 1); 38245 var import_url10 = __toESM(require_url(), 1); 38246 var import_jsx_runtime308 = __toESM(require_jsx_runtime(), 1); 38247 var focusToggleButton = (containerRef) => { 38248 window.requestAnimationFrame(() => { 38249 const [toggleButton] = import_dom12.focus.tabbable.find(containerRef?.current); 38250 if (!toggleButton) { 38251 return; 38252 } 38253 toggleButton.focus(); 38254 }); 38255 }; 38256 function MediaControlPreview({ 38257 url, 38258 filename, 38259 itemGroupProps, 38260 className, 38261 label 38262 }) { 38263 return /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(import_components54.__experimentalItemGroup, { ...itemGroupProps, as: "span", children: /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)(import_components54.__experimentalHStack, { justify: "flex-start", children: [ 38264 /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 38265 "span", 38266 { 38267 className: "block-library-utils__media-control__inspector-image-indicator", 38268 style: { 38269 backgroundImage: url ? `url($url})` : void 0 38270 } 38271 } 38272 ), 38273 /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(import_components54.FlexBlock, { children: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(import_components54.__experimentalTruncate, { numberOfLines: 1, className, children: filename ?? label }) }) 38274 ] }) }); 38275 } 38276 function MediaControl({ 38277 mediaId, 38278 mediaUrl, 38279 filename, 38280 allowedTypes, 38281 onSelect, 38282 onSelectURL, 38283 onError, 38284 onReset, 38285 isUploading = false, 38286 emptyLabel = (0, import_i18n94.__)("Media") 38287 }) { 38288 const { getSettings: getSettings2 } = (0, import_data47.useSelect)(import_block_editor104.store); 38289 const onFilesDrop = (filesList) => { 38290 const { mediaUpload } = getSettings2(); 38291 if (!mediaUpload) { 38292 return; 38293 } 38294 mediaUpload({ 38295 allowedTypes, 38296 filesList, 38297 onFileChange([media]) { 38298 onSelect(media); 38299 }, 38300 onError, 38301 multiple: false 38302 }); 38303 }; 38304 const containerRef = (0, import_element70.useRef)(); 38305 return /* @__PURE__ */ (0, import_jsx_runtime308.jsxs)( 38306 "div", 38307 { 38308 ref: containerRef, 38309 className: "block-library-utils__media-control", 38310 children: [ 38311 /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 38312 import_block_editor104.MediaReplaceFlow, 38313 { 38314 className: "block-library-utils__media-control__replace-flow", 38315 mediaId, 38316 mediaURL: mediaUrl, 38317 allowedTypes, 38318 onSelect, 38319 onSelectURL, 38320 onError, 38321 name: /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 38322 MediaControlPreview, 38323 { 38324 url: mediaUrl, 38325 filename, 38326 className: "block-library-utils__media-control__inspector-media-replace-title", 38327 label: mediaUrl ? (0, import_url10.getFilename)(filename) || emptyLabel : emptyLabel 38328 } 38329 ), 38330 renderToggle: (props) => /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(import_components54.Button, { ...props, __next40pxDefaultSize: true, children: isUploading ? /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(import_components54.Spinner, {}) : props.children }), 38331 onReset 38332 } 38333 ), 38334 mediaUrl && onReset && /* @__PURE__ */ (0, import_jsx_runtime308.jsx)( 38335 import_components54.Button, 38336 { 38337 label: (0, import_i18n94.__)("Reset"), 38338 className: "block-library-utils__media-control__reset", 38339 size: "small", 38340 icon: reset_default, 38341 onClick: () => { 38342 onReset(); 38343 focusToggleButton(containerRef); 38344 } 38345 } 38346 ), 38347 /* @__PURE__ */ (0, import_jsx_runtime308.jsx)(import_components54.DropZone, { onFilesDrop }) 38348 ] 38349 } 38350 ); 38351 } 38352 38353 // packages/block-library/build-module/image/use-open-image-media-editor-modal.mjs 38354 var import_core_data25 = __toESM(require_core_data(), 1); 38355 var import_block_editor105 = __toESM(require_block_editor(), 1); 38356 var import_dom13 = __toESM(require_dom(), 1); 38357 var import_data48 = __toESM(require_data(), 1); 38358 var import_element71 = __toESM(require_element(), 1); 38359 function normalizeImageBlockCaption(caption) { 38360 if (typeof caption !== "string") { 38361 return ""; 38362 } 38363 const textContent = (0, import_dom13.__unstableStripHTML)(caption).trim(); 38364 if (!textContent) { 38365 return ""; 38366 } 38367 return caption.replace(/\n/g, "<br>"); 38368 } 38369 function getAttachmentCaption(attachment) { 38370 const caption = attachment?.caption; 38371 if (typeof caption === "string") { 38372 return normalizeImageBlockCaption(caption); 38373 } 38374 if (caption && typeof caption === "object" && Object.hasOwn(caption, "raw")) { 38375 return normalizeImageBlockCaption(caption.raw); 38376 } 38377 return void 0; 38378 } 38379 function getImageBlockMetadataFromAttachment(attachment) { 38380 return { 38381 alt: typeof attachment?.alt_text === "string" ? attachment.alt_text : attachment?.alt || "", 38382 caption: getAttachmentCaption(attachment) 38383 }; 38384 } 38385 function normalizeMetadataAttribute(value) { 38386 return value || ""; 38387 } 38388 function getSyncedImageBlockAttributes(currentAttributes, originalAttachment, updatedAttachment) { 38389 if (!originalAttachment || !updatedAttachment) { 38390 return {}; 38391 } 38392 const originalMetadata = getImageBlockMetadataFromAttachment(originalAttachment); 38393 const updatedMetadata = getImageBlockMetadataFromAttachment(updatedAttachment); 38394 const syncedAttributes = {}; 38395 const normalizedCurrentAlt = normalizeMetadataAttribute( 38396 currentAttributes.alt 38397 ); 38398 if (originalMetadata.alt !== updatedMetadata.alt && (normalizedCurrentAlt === originalMetadata.alt || !normalizedCurrentAlt)) { 38399 syncedAttributes.alt = updatedMetadata.alt; 38400 } 38401 const normalizedCurrentCaption = normalizeMetadataAttribute( 38402 currentAttributes.caption 38403 ); 38404 if (originalMetadata.caption !== void 0 && updatedMetadata.caption !== void 0 && originalMetadata.caption !== updatedMetadata.caption && (normalizedCurrentCaption === originalMetadata.caption || !normalizedCurrentCaption)) { 38405 syncedAttributes.caption = updatedMetadata.caption || void 0; 38406 } 38407 return syncedAttributes; 38408 } 38409 function getNewAttachmentSizeAttributes(sizeSlug, attachment) { 38410 const sizes = attachment.media_details?.sizes; 38411 if (!sizeSlug || sizeSlug === DEFAULT_MEDIA_SIZE_SLUG3 || !sizes) { 38412 return void 0; 38413 } 38414 const sizeUrl = sizes[sizeSlug]?.source_url; 38415 if (sizeUrl) { 38416 return { url: sizeUrl }; 38417 } 38418 const fullUrl = attachment.source_url ?? sizes.full?.source_url; 38419 return fullUrl ? { url: fullUrl, sizeSlug: DEFAULT_MEDIA_SIZE_SLUG3 } : void 0; 38420 } 38421 function getNewAttachmentLinkAttributes(linkDestination, attachment) { 38422 if (linkDestination === LINK_DESTINATION_MEDIA2) { 38423 return attachment.source_url ? { href: attachment.source_url } : void 0; 38424 } 38425 if (linkDestination === LINK_DESTINATION_ATTACHMENT2) { 38426 return attachment.link ? { href: attachment.link } : void 0; 38427 } 38428 return void 0; 38429 } 38430 function getNewAttachmentImageBlockAttributes(blockAttributes8, attachment) { 38431 if (!attachment) { 38432 return void 0; 38433 } 38434 return { 38435 ...getNewAttachmentSizeAttributes( 38436 blockAttributes8.sizeSlug, 38437 attachment 38438 ), 38439 ...getNewAttachmentLinkAttributes( 38440 blockAttributes8.linkDestination, 38441 attachment 38442 ) 38443 }; 38444 } 38445 var { openMediaEditorModalKey: openMediaEditorModalKey2 } = unlock(import_block_editor105.privateApis); 38446 function getAttachmentFallbackForEmptyBlockMetadata({ alt, caption }) { 38447 const attachment = {}; 38448 if (!alt) { 38449 attachment.alt_text = ""; 38450 } 38451 if (!caption?.toString()) { 38452 attachment.caption = ""; 38453 } 38454 return Object.keys(attachment).length ? attachment : void 0; 38455 } 38456 function hasKnownAttachmentMetadata(attachment) { 38457 if (!attachment) { 38458 return false; 38459 } 38460 const hasKnownAlt = typeof attachment.alt_text === "string" || typeof attachment.alt === "string"; 38461 const hasKnownCaption = getImageBlockMetadataFromAttachment(attachment).caption !== void 0; 38462 return hasKnownAlt && hasKnownCaption; 38463 } 38464 function useOpenImageMediaEditorModal({ 38465 attributes: attributes2, 38466 setAttributes, 38467 onClose, 38468 onUrlChange 38469 }) { 38470 const { id, url, alt, caption, sizeSlug, linkDestination } = attributes2; 38471 const registry = (0, import_data48.useRegistry)(); 38472 const openMediaEditorModal = (0, import_data48.useSelect)( 38473 (select10) => select10(import_block_editor105.store).getSettings()[openMediaEditorModalKey2], 38474 [] 38475 ); 38476 const blockAttributesRef = (0, import_element71.useRef)({ 38477 id, 38478 url, 38479 alt, 38480 caption: caption?.toString(), 38481 sizeSlug, 38482 linkDestination 38483 }); 38484 const mediaEditorMetadataBaselineRef = (0, import_element71.useRef)(); 38485 const mediaEditorMetadataSyncRequestRef = (0, import_element71.useRef)(0); 38486 (0, import_element71.useEffect)(() => { 38487 blockAttributesRef.current = { 38488 id, 38489 url, 38490 alt, 38491 caption: caption?.toString(), 38492 sizeSlug, 38493 linkDestination 38494 }; 38495 }, [alt, caption, id, linkDestination, sizeSlug, url]); 38496 const getCachedAttachmentRecord = (0, import_element71.useCallback)( 38497 (attachmentId) => registry.select(import_core_data25.store).getEditedEntityRecord( 38498 "postType", 38499 "attachment", 38500 attachmentId 38501 ), 38502 [registry] 38503 ); 38504 const resolveAttachmentRecord = (0, import_element71.useCallback)( 38505 async (attachmentId) => { 38506 const resolveSelect = registry.resolveSelect(import_core_data25.store); 38507 try { 38508 return await resolveSelect.getEntityRecord( 38509 "postType", 38510 "attachment", 38511 attachmentId 38512 ); 38513 } catch { 38514 return void 0; 38515 } 38516 }, 38517 [registry] 38518 ); 38519 const resolveFreshAttachmentRecord = (0, import_element71.useCallback)( 38520 async (attachmentId) => { 38521 const { invalidateResolution } = registry.dispatch(import_core_data25.store); 38522 invalidateResolution("getEntityRecord", [ 38523 "postType", 38524 "attachment", 38525 attachmentId 38526 ]); 38527 return resolveAttachmentRecord(attachmentId); 38528 }, 38529 [registry, resolveAttachmentRecord] 38530 ); 38531 const handleMediaUpdate = (0, import_element71.useCallback)( 38532 async ({ id: newId, url: newUrl }) => { 38533 if (typeof newId !== "number") { 38534 return; 38535 } 38536 const originalAttachment = mediaEditorMetadataBaselineRef.current; 38537 mediaEditorMetadataBaselineRef.current = void 0; 38538 const syncRequest = ++mediaEditorMetadataSyncRequestRef.current; 38539 const nextAttributes = {}; 38540 const currentBlockAttributes = blockAttributesRef.current; 38541 const isNewAttachment = newId !== currentBlockAttributes.id; 38542 if (isNewAttachment) { 38543 nextAttributes.id = newId; 38544 nextAttributes.url = newUrl ?? currentBlockAttributes.url; 38545 if (nextAttributes.url !== currentBlockAttributes.url) { 38546 onUrlChange?.(nextAttributes.url); 38547 } 38548 blockAttributesRef.current = { 38549 ...blockAttributesRef.current, 38550 id: nextAttributes.id, 38551 url: nextAttributes.url 38552 }; 38553 } 38554 if (originalAttachment || isNewAttachment) { 38555 const resolvedAttachment = await resolveFreshAttachmentRecord(newId); 38556 if (syncRequest !== mediaEditorMetadataSyncRequestRef.current) { 38557 return; 38558 } 38559 const attachmentRecord = resolvedAttachment ?? getCachedAttachmentRecord(newId); 38560 const latestBlockAttributes = blockAttributesRef.current; 38561 if (originalAttachment) { 38562 const resolvedMetadataAttributes = getSyncedImageBlockAttributes( 38563 latestBlockAttributes, 38564 originalAttachment, 38565 attachmentRecord 38566 ); 38567 if (Object.keys(resolvedMetadataAttributes).length) { 38568 Object.assign( 38569 nextAttributes, 38570 resolvedMetadataAttributes 38571 ); 38572 } 38573 } 38574 if (isNewAttachment) { 38575 const derivedAttributes = getNewAttachmentImageBlockAttributes( 38576 latestBlockAttributes, 38577 attachmentRecord 38578 ); 38579 if (derivedAttributes) { 38580 Object.assign(nextAttributes, derivedAttributes); 38581 if (derivedAttributes.url && derivedAttributes.url !== latestBlockAttributes.url) { 38582 onUrlChange?.(derivedAttributes.url); 38583 } 38584 } 38585 } 38586 } 38587 if (Object.keys(nextAttributes).length) { 38588 blockAttributesRef.current = { 38589 ...blockAttributesRef.current, 38590 ...nextAttributes 38591 }; 38592 setAttributes(nextAttributes); 38593 } 38594 }, 38595 [ 38596 getCachedAttachmentRecord, 38597 onUrlChange, 38598 resolveFreshAttachmentRecord, 38599 setAttributes 38600 ] 38601 ); 38602 const openImageMediaEditorModal = (0, import_element71.useCallback)(async () => { 38603 if (!id || !openMediaEditorModal) { 38604 return; 38605 } 38606 const cachedAttachmentRecord = getCachedAttachmentRecord(id); 38607 const fallbackAttachmentRecord = getAttachmentFallbackForEmptyBlockMetadata( 38608 blockAttributesRef.current 38609 ); 38610 const resolvedAttachmentRecord = hasKnownAttachmentMetadata( 38611 cachedAttachmentRecord 38612 ) ? void 0 : await resolveAttachmentRecord(id); 38613 mediaEditorMetadataBaselineRef.current = resolvedAttachmentRecord || (hasKnownAttachmentMetadata(cachedAttachmentRecord) ? cachedAttachmentRecord : fallbackAttachmentRecord) || cachedAttachmentRecord; 38614 openMediaEditorModal({ 38615 id, 38616 onUpdate: handleMediaUpdate, 38617 onClose 38618 }); 38619 }, [ 38620 getCachedAttachmentRecord, 38621 handleMediaUpdate, 38622 id, 38623 onClose, 38624 openMediaEditorModal, 38625 resolveAttachmentRecord 38626 ]); 38627 return id && openMediaEditorModal ? openImageMediaEditorModal : void 0; 38628 } 38629 38630 // packages/block-library/build-module/image/image.mjs 38631 var import_jsx_runtime309 = __toESM(require_jsx_runtime(), 1); 38632 var { 38633 DimensionsTool, 38634 isDefaultBlockStyleState: isDefaultBlockStyleState3, 38635 ResolutionTool: ResolutionTool2, 38636 mediaEditKey, 38637 mediaSideloadFromUrlKey 38638 } = unlock(import_block_editor106.privateApis); 38639 var scaleOptions = [ 38640 { 38641 value: "cover", 38642 label: (0, import_i18n95._x)("Cover", "Scale option for dimensions control"), 38643 help: (0, import_i18n95.__)("Image covers the space evenly.") 38644 }, 38645 { 38646 value: "contain", 38647 label: (0, import_i18n95._x)("Contain", "Scale option for dimensions control"), 38648 help: (0, import_i18n95.__)("Image is contained without distortion.") 38649 } 38650 ]; 38651 var WRITEMODE_POPOVER_PROPS = { 38652 placement: "bottom-start" 38653 }; 38654 var ImageWrapper = ({ href, children }) => { 38655 if (!href) { 38656 return children; 38657 } 38658 return /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38659 "a", 38660 { 38661 href, 38662 onClick: (event) => event.preventDefault(), 38663 "aria-disabled": true, 38664 style: { 38665 // When the Image block is linked, 38666 // it's wrapped with a disabled <a /> tag. 38667 // Restore cursor style so it doesn't appear 'clickable' 38668 // and remove pointer events. Safari needs the display property. 38669 pointerEvents: "none", 38670 cursor: "default", 38671 display: "inline" 38672 }, 38673 children 38674 } 38675 ); 38676 }; 38677 function ContentOnlyControls({ 38678 attributes: attributes2, 38679 setAttributes, 38680 lockAltControls, 38681 lockAltControlsMessage, 38682 lockTitleControls, 38683 lockTitleControlsMessage 38684 }) { 38685 const [popoverAnchor, setPopoverAnchor] = (0, import_element72.useState)(null); 38686 const [isAltDialogOpen, setIsAltDialogOpen] = (0, import_element72.useState)(false); 38687 const [isTitleDialogOpen, setIsTitleDialogOpen] = (0, import_element72.useState)(false); 38688 return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_jsx_runtime309.Fragment, { children: [ 38689 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_components55.ToolbarItem, { ref: setPopoverAnchor, children: (toggleProps) => /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38690 import_components55.DropdownMenu, 38691 { 38692 icon: chevron_down_default, 38693 label: (0, import_i18n95.__)("More"), 38694 toggleProps: { 38695 ...toggleProps, 38696 description: (0, import_i18n95.__)("Displays more controls.") 38697 }, 38698 popoverProps: WRITEMODE_POPOVER_PROPS, 38699 children: ({ onClose }) => /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_jsx_runtime309.Fragment, { children: [ 38700 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38701 import_components55.MenuItem, 38702 { 38703 onClick: () => { 38704 setIsAltDialogOpen(true); 38705 onClose(); 38706 }, 38707 "aria-haspopup": "dialog", 38708 children: (0, import_i18n95._x)( 38709 "Alternative text", 38710 "Alternative text for an image. Block toolbar label, a low character count is preferred." 38711 ) 38712 } 38713 ), 38714 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38715 import_components55.MenuItem, 38716 { 38717 onClick: () => { 38718 setIsTitleDialogOpen(true); 38719 onClose(); 38720 }, 38721 "aria-haspopup": "dialog", 38722 children: (0, import_i18n95.__)("Title text") 38723 } 38724 ) 38725 ] }) 38726 } 38727 ) }), 38728 isAltDialogOpen && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38729 import_components55.Popover, 38730 { 38731 placement: "bottom-start", 38732 anchor: popoverAnchor, 38733 onClose: () => setIsAltDialogOpen(false), 38734 offset: 13, 38735 variant: "toolbar", 38736 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("div", { className: "wp-block-image__toolbar_content_textarea__container", children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38737 import_components55.TextareaControl, 38738 { 38739 className: "wp-block-image__toolbar_content_textarea", 38740 label: (0, import_i18n95.__)("Alternative text"), 38741 value: attributes2.alt || "", 38742 onChange: (value) => setAttributes({ alt: value }), 38743 disabled: lockAltControls, 38744 help: lockAltControls ? /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_jsx_runtime309.Fragment, { children: lockAltControlsMessage }) : /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_jsx_runtime309.Fragment, { children: [ 38745 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38746 import_components55.ExternalLink, 38747 { 38748 href: ( 38749 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 38750 (0, import_i18n95.__)( 38751 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 38752 ) 38753 ), 38754 children: (0, import_i18n95.__)( 38755 "Describe the purpose of the image." 38756 ) 38757 } 38758 ), 38759 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("br", {}), 38760 (0, import_i18n95.__)("Leave empty if decorative.") 38761 ] }) 38762 } 38763 ) }) 38764 } 38765 ), 38766 isTitleDialogOpen && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38767 import_components55.Popover, 38768 { 38769 placement: "bottom-start", 38770 anchor: popoverAnchor, 38771 onClose: () => setIsTitleDialogOpen(false), 38772 offset: 13, 38773 variant: "toolbar", 38774 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)("div", { className: "wp-block-image__toolbar_content_textarea__container", children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 38775 import_components55.TextControl, 38776 { 38777 className: "wp-block-image__toolbar_content_textarea", 38778 label: (0, import_i18n95.__)("Title attribute"), 38779 value: attributes2.title || "", 38780 onChange: (value) => setAttributes({ 38781 title: value 38782 }), 38783 disabled: lockTitleControls, 38784 help: lockTitleControls ? /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_jsx_runtime309.Fragment, { children: lockTitleControlsMessage }) : (0, import_element72.createInterpolateElement)( 38785 (0, import_i18n95.__)( 38786 "Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>" 38787 ), 38788 { 38789 a: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_components55.ExternalLink, { href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute" }) 38790 } 38791 ) 38792 } 38793 ) }) 38794 } 38795 ) 38796 ] }); 38797 } 38798 function Image2({ 38799 temporaryURL, 38800 isSideloading, 38801 attributes: attributes2, 38802 setAttributes, 38803 isSingleSelected, 38804 insertBlocksAfter, 38805 onReplace, 38806 onSelectImage, 38807 onSelectURL, 38808 onUploadError, 38809 context, 38810 clientId, 38811 blockEditingMode, 38812 parentLayoutType, 38813 maxContentWidth 38814 }) { 38815 const { 38816 url = "", 38817 alt, 38818 align, 38819 id, 38820 href, 38821 rel, 38822 linkClass, 38823 linkDestination, 38824 title, 38825 width, 38826 height, 38827 aspectRatio, 38828 scale, 38829 focalPoint, 38830 linkTarget, 38831 sizeSlug, 38832 lightbox, 38833 metadata, 38834 isDecorative 38835 } = attributes2; 38836 const [imageElement, setImageElement] = (0, import_element72.useState)(); 38837 const [resizeDelta, setResizeDelta] = (0, import_element72.useState)(null); 38838 const [pixelSize, setPixelSize] = (0, import_element72.useState)({}); 38839 const [offsetTop, setOffsetTop] = (0, import_element72.useState)(0); 38840 const setResizeObserved = (0, import_compose26.useResizeObserver)(([entry]) => { 38841 if (!resizeDelta) { 38842 const [box] = entry.borderBoxSize; 38843 setPixelSize({ width: box.inlineSize, height: box.blockSize }); 38844 } 38845 setOffsetTop(entry.target.offsetTop); 38846 }); 38847 const effectResizeableBoxPlacement = (0, import_element72.useCallback)(() => { 38848 setOffsetTop(imageElement?.offsetTop ?? 0); 38849 }, [imageElement]); 38850 const setRefs = (0, import_compose26.useMergeRefs)([setImageElement, setResizeObserved]); 38851 const { allowResize = true, imageCrop = false } = context; 38852 const isCroppedGalleryImage = imageCrop && parentLayoutType === "flex"; 38853 const { image, attachmentResolutionError } = (0, import_data49.useSelect)( 38854 (select10) => { 38855 const imageRecord = id && isSingleSelected ? select10(import_core_data26.store).getEntityRecord( 38856 "postType", 38857 "attachment", 38858 id, 38859 { context: "view" } 38860 ) : null; 38861 const resolutionError = id && isSingleSelected ? select10(import_core_data26.store).getResolutionError( 38862 "getEntityRecord", 38863 [ 38864 "postType", 38865 "attachment", 38866 id, 38867 { context: "view" } 38868 ] 38869 ) : null; 38870 return { 38871 image: imageRecord, 38872 attachmentResolutionError: resolutionError 38873 }; 38874 }, 38875 [id, isSingleSelected] 38876 ); 38877 const { 38878 canInsertCover, 38879 imageEditing, 38880 imageSizes, 38881 maxWidth, 38882 editMediaEntity 38883 } = (0, import_data49.useSelect)( 38884 (select10) => { 38885 const { getBlockRootClientId, canInsertBlockType, getSettings: getSettings22 } = select10(import_block_editor106.store); 38886 const rootClientId = getBlockRootClientId(clientId); 38887 const settings117 = getSettings22(); 38888 return { 38889 imageEditing: settings117.imageEditing, 38890 imageSizes: settings117.imageSizes, 38891 maxWidth: settings117.maxWidth, 38892 editMediaEntity: settings117?.[mediaEditKey], 38893 canInsertCover: canInsertBlockType( 38894 "core/cover", 38895 rootClientId 38896 ) 38897 }; 38898 }, 38899 [clientId] 38900 ); 38901 const { getBlock, getSettings: getSettings2 } = (0, import_data49.useSelect)(import_block_editor106.store); 38902 const cropButtonRef = (0, import_element72.useRef)(); 38903 const [pendingSwapUrl, setPendingSwapUrl] = (0, import_element72.useState)(); 38904 const isSwappingMedia = !!pendingSwapUrl; 38905 const handleMediaEditorModalClose = (0, import_element72.useCallback)( 38906 () => cropButtonRef.current?.focus(), 38907 [] 38908 ); 38909 const openImageMediaEditorModal = useOpenImageMediaEditorModal({ 38910 attributes: attributes2, 38911 setAttributes, 38912 onClose: handleMediaEditorModalClose, 38913 onUrlChange: setPendingSwapUrl 38914 }); 38915 const { 38916 replaceBlocks, 38917 toggleSelection, 38918 __unstableMarkNextChangeAsNotPersistent 38919 } = (0, import_data49.useDispatch)(import_block_editor106.store); 38920 const { createErrorNotice, createSuccessNotice } = (0, import_data49.useDispatch)(import_notices7.store); 38921 const { editEntityRecord } = (0, import_data49.useDispatch)(import_core_data26.store); 38922 const isLargeViewport = (0, import_compose26.useViewportMatch)("medium"); 38923 const isWideAligned = ["wide", "full"].includes(align); 38924 const [ 38925 { loadedNaturalWidth, loadedNaturalHeight }, 38926 setLoadedNaturalSize 38927 ] = (0, import_element72.useState)({}); 38928 const [hasImageErrored, setHasImageErrored] = (0, import_element72.useState)(false); 38929 const hasNonContentControls = blockEditingMode === "default"; 38930 const isContentOnlyMode = blockEditingMode === "contentOnly"; 38931 const showDimensionsControls = allowResize && hasNonContentControls; 38932 const isResizable = allowResize && hasNonContentControls && !isWideAligned && isLargeViewport; 38933 const isUploading = !!temporaryURL || isSideloading; 38934 const imageSizeOptions = imageSizes.filter( 38935 ({ slug }) => image?.media_details?.sizes?.[slug]?.source_url 38936 ).map(({ name: name118, slug }) => ({ value: slug, label: name118 })); 38937 (0, import_element72.useEffect)(() => { 38938 if (!id || !isSingleSelected) { 38939 return; 38940 } 38941 if (attachmentResolutionError?.status === 404) { 38942 __unstableMarkNextChangeAsNotPersistent(); 38943 setAttributes({ id: void 0 }); 38944 } 38945 }, [ 38946 id, 38947 isSingleSelected, 38948 attachmentResolutionError, 38949 setAttributes, 38950 __unstableMarkNextChangeAsNotPersistent 38951 ]); 38952 const canUploadExternalImage = isSingleSelected && isExternalImage(id, url) && !!getSettings2()[mediaSideloadFromUrlKey]; 38953 const { naturalWidth, naturalHeight } = (0, import_element72.useMemo)(() => { 38954 return { 38955 naturalWidth: imageElement?.naturalWidth || loadedNaturalWidth || void 0, 38956 naturalHeight: imageElement?.naturalHeight || loadedNaturalHeight || void 0 38957 }; 38958 }, [loadedNaturalWidth, loadedNaturalHeight, imageElement?.complete]); 38959 (0, import_element72.useEffect)(() => { 38960 if (pendingSwapUrl && pendingSwapUrl === url && imageElement?.complete) { 38961 setPendingSwapUrl(void 0); 38962 } 38963 }, [pendingSwapUrl, url, imageElement]); 38964 function onImageError() { 38965 setPendingSwapUrl(void 0); 38966 setHasImageErrored(true); 38967 const embedBlock = createUpgradedEmbedBlock({ attributes: { url } }); 38968 if (void 0 !== embedBlock && onReplace) { 38969 onReplace(embedBlock); 38970 } 38971 } 38972 function onImageLoad(event) { 38973 setPendingSwapUrl(void 0); 38974 setHasImageErrored(false); 38975 setLoadedNaturalSize({ 38976 loadedNaturalWidth: event.target?.naturalWidth, 38977 loadedNaturalHeight: event.target?.naturalHeight 38978 }); 38979 } 38980 function onSetHref(props) { 38981 setAttributes(props); 38982 } 38983 function onSetLightbox(enable) { 38984 if (enable && !lightboxSetting?.enabled) { 38985 setAttributes({ 38986 lightbox: { enabled: true }, 38987 isDecorative: false 38988 }); 38989 } else if (!enable && lightboxSetting?.enabled) { 38990 setAttributes({ 38991 lightbox: { enabled: false } 38992 }); 38993 } else { 38994 setAttributes({ 38995 lightbox: void 0 38996 }); 38997 } 38998 } 38999 function resetLightbox() { 39000 if (lightboxSetting?.enabled && lightboxSetting?.allowEditing) { 39001 setAttributes({ 39002 lightbox: { enabled: false } 39003 }); 39004 } else { 39005 setAttributes({ 39006 lightbox: void 0 39007 }); 39008 } 39009 } 39010 function onSetTitle(value) { 39011 setAttributes({ title: value }); 39012 } 39013 function updateAlt(newAlt) { 39014 setAttributes({ alt: newAlt }); 39015 } 39016 function updateIsDecorative(value) { 39017 setAttributes({ 39018 isDecorative: value || void 0, 39019 ...value && { 39020 alt: "", 39021 caption: void 0, 39022 href: void 0, 39023 linkDestination: void 0, 39024 linkTarget: void 0, 39025 rel: void 0 39026 } 39027 }); 39028 } 39029 const imperativeFocalPointPreview = (value) => { 39030 if (imageElement) { 39031 imageElement.style.setProperty( 39032 "object-position", 39033 mediaPosition2(value) 39034 ); 39035 } 39036 }; 39037 function updateImage(newSizeSlug) { 39038 const newUrl = image?.media_details?.sizes?.[newSizeSlug]?.source_url; 39039 if (!newUrl) { 39040 return null; 39041 } 39042 setAttributes({ 39043 url: newUrl, 39044 sizeSlug: newSizeSlug 39045 }); 39046 } 39047 function uploadExternal() { 39048 const mediaSideloadFromUrl = getSettings2()[mediaSideloadFromUrlKey]; 39049 if (!mediaSideloadFromUrl) { 39050 return; 39051 } 39052 mediaSideloadFromUrl({ 39053 url, 39054 onSuccess(img2) { 39055 onSelectImage(img2); 39056 createSuccessNotice((0, import_i18n95.__)("Image uploaded."), { 39057 type: "snackbar" 39058 }); 39059 }, 39060 onError(message) { 39061 createErrorNotice(message, { type: "snackbar" }); 39062 } 39063 }); 39064 } 39065 const canEditImage = id && naturalWidth && naturalHeight && imageEditing && !!editMediaEntity; 39066 const allowCrop = isSingleSelected && canEditImage && !!openImageMediaEditorModal && !isContentOnlyMode && !isUploading; 39067 function switchToCover() { 39068 replaceBlocks( 39069 clientId, 39070 (0, import_blocks39.switchToBlockType)(getBlock(clientId), "core/cover") 39071 ); 39072 } 39073 const dimensionsUnitsOptions = (0, import_components55.__experimentalUseCustomUnits)({ 39074 availableUnits: ["px"] 39075 }); 39076 const [lightboxSetting] = (0, import_block_editor106.useSettings)("lightbox"); 39077 const showLightboxSetting = ( 39078 // If a block-level override is set, we should give users the option to 39079 // remove that override, even if the lightbox UI is disabled in the settings. 39080 !!lightbox && lightbox?.enabled !== lightboxSetting?.enabled || lightboxSetting?.allowEditing 39081 ); 39082 const lightboxChecked = !!lightbox?.enabled || !lightbox && !!lightboxSetting?.enabled; 39083 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 39084 const selectedStyleState = (0, import_data49.useSelect)( 39085 (select10) => { 39086 if (!isSingleSelected) { 39087 return void 0; 39088 } 39089 const { getSelectedBlockStyleState } = unlock( 39090 select10(import_block_editor106.store) 39091 ); 39092 return getSelectedBlockStyleState(clientId); 39093 }, 39094 [clientId, isSingleSelected] 39095 ); 39096 const hasSelectedStyleState = !isDefaultBlockStyleState3(selectedStyleState); 39097 const selectedStyleStateKey = getStyleStateKey(selectedStyleState); 39098 const activeWidth = getActiveDimensionValue({ 39099 attributes: attributes2, 39100 selectedState: selectedStyleState, 39101 hasSelectedStyleState, 39102 attributeKey: "width" 39103 }); 39104 const activeHeight = getActiveDimensionValue({ 39105 attributes: attributes2, 39106 selectedState: selectedStyleState, 39107 hasSelectedStyleState, 39108 attributeKey: "height" 39109 }); 39110 const activeAspectRatio = getActiveDimensionValue({ 39111 attributes: attributes2, 39112 selectedState: selectedStyleState, 39113 hasSelectedStyleState, 39114 attributeKey: "aspectRatio" 39115 }); 39116 const activeScale = getActiveDimensionValue({ 39117 attributes: attributes2, 39118 selectedState: selectedStyleState, 39119 hasSelectedStyleState, 39120 attributeKey: "scale", 39121 styleKey: "objectFit" 39122 }); 39123 const setDimensionAttributes = (nextDimensions) => { 39124 setAttributes( 39125 getDimensionUpdateAttributes({ 39126 style: attributes2.style, 39127 selectedState: selectedStyleState, 39128 hasSelectedStyleState, 39129 nextDimensions, 39130 dimensionKeyMap: { scale: "objectFit" } 39131 }) 39132 ); 39133 }; 39134 const dimensionsControl = showDimensionsControls && (SIZED_LAYOUTS.includes(parentLayoutType) ? /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39135 DimensionsTool, 39136 { 39137 panelId: clientId, 39138 value: { aspectRatio: activeAspectRatio, scale: activeScale }, 39139 onChange: ({ aspectRatio: newAspectRatio }) => { 39140 setDimensionAttributes({ 39141 aspectRatio: newAspectRatio, 39142 scale: "cover" 39143 }); 39144 }, 39145 defaultAspectRatio: "auto", 39146 tools: ["aspectRatio"] 39147 }, 39148 selectedStyleStateKey 39149 ) : /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39150 DimensionsTool, 39151 { 39152 panelId: clientId, 39153 value: { 39154 width: activeWidth, 39155 height: activeHeight, 39156 scale: activeScale, 39157 aspectRatio: activeAspectRatio 39158 }, 39159 onChange: ({ 39160 width: newWidth, 39161 height: newHeight, 39162 scale: newScale, 39163 aspectRatio: newAspectRatio 39164 }) => { 39165 setDimensionAttributes({ 39166 // CSS includes `height: auto`, but we need 39167 // `width: auto` to fix the aspect ratio when 39168 // only height is set due to the width and 39169 // height attributes set via the server. 39170 width: !newWidth && newHeight ? "auto" : newWidth, 39171 height: newHeight, 39172 aspectRatio: newAspectRatio, 39173 scale: newScale 39174 }); 39175 }, 39176 defaultScale: "cover", 39177 defaultAspectRatio: "auto", 39178 scaleOptions, 39179 unitsOptions: dimensionsUnitsOptions, 39180 tools: isWideAligned ? ["aspectRatio", "scale"] : ["aspectRatio", "widthHeight", "scale"] 39181 }, 39182 selectedStyleStateKey 39183 )); 39184 const resetSettings = () => { 39185 setAttributes({ 39186 lightbox: void 0 39187 }); 39188 updateImage(DEFAULT_MEDIA_SIZE_SLUG3); 39189 }; 39190 const arePatternOverridesEnabled = metadata?.bindings?.__default?.source === "core/pattern-overrides"; 39191 const { 39192 lockUrlControls = false, 39193 lockHrefControls = false, 39194 lockAltControls = false, 39195 lockAltControlsMessage, 39196 lockTitleControls = false, 39197 lockTitleControlsMessage, 39198 hideCaptionControls = false 39199 } = (0, import_data49.useSelect)( 39200 (select10) => { 39201 if (!isSingleSelected) { 39202 return {}; 39203 } 39204 const { 39205 url: urlBinding, 39206 alt: altBinding, 39207 title: titleBinding, 39208 caption: captionBinding 39209 } = metadata?.bindings || {}; 39210 const hasParentPattern = !!context["pattern/overrides"]; 39211 const urlBindingSource = (0, import_blocks39.getBlockBindingsSource)( 39212 urlBinding?.source 39213 ); 39214 const altBindingSource = (0, import_blocks39.getBlockBindingsSource)( 39215 altBinding?.source 39216 ); 39217 const titleBindingSource = (0, import_blocks39.getBlockBindingsSource)( 39218 titleBinding?.source 39219 ); 39220 return { 39221 lockUrlControls: !!urlBinding && !urlBindingSource?.canUserEditValue?.({ 39222 select: select10, 39223 context, 39224 args: urlBinding?.args 39225 }), 39226 lockHrefControls: ( 39227 // Disable editing the link of the URL if the image is inside a pattern instance. 39228 // This is a temporary solution until we support overriding the link on the frontend. 39229 hasParentPattern || arePatternOverridesEnabled 39230 ), 39231 hideCaptionControls: !!captionBinding, 39232 lockAltControls: !!altBinding && !altBindingSource?.canUserEditValue?.({ 39233 select: select10, 39234 context, 39235 args: altBinding?.args 39236 }), 39237 lockAltControlsMessage: altBindingSource?.label ? (0, import_i18n95.sprintf)( 39238 /* translators: %s: Label of the bindings source. */ 39239 (0, import_i18n95.__)("Connected to %s"), 39240 altBindingSource.label 39241 ) : (0, import_i18n95.__)("Connected to dynamic data"), 39242 lockTitleControls: !!titleBinding && !titleBindingSource?.canUserEditValue?.({ 39243 select: select10, 39244 context, 39245 args: titleBinding?.args 39246 }), 39247 lockTitleControlsMessage: titleBindingSource?.label ? (0, import_i18n95.sprintf)( 39248 /* translators: %s: Label of the bindings source. */ 39249 (0, import_i18n95.__)("Connected to %s"), 39250 titleBindingSource.label 39251 ) : (0, import_i18n95.__)("Connected to dynamic data") 39252 }; 39253 }, 39254 [ 39255 arePatternOverridesEnabled, 39256 context, 39257 isSingleSelected, 39258 metadata?.bindings 39259 ] 39260 ); 39261 const showUrlInput = isSingleSelected && !lockHrefControls && !lockUrlControls && !isDecorative; 39262 const showCoverControls = isSingleSelected && canInsertCover && !isContentOnlyMode; 39263 const showBlockControls = showUrlInput || allowCrop || showCoverControls; 39264 const mediaControls = isSingleSelected && !lockUrlControls && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_jsx_runtime309.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_block_editor106.BlockControls, { group: isContentOnlyMode ? "inline" : "other", children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39265 import_block_editor106.MediaReplaceFlow, 39266 { 39267 mediaId: id, 39268 mediaURL: url, 39269 allowedTypes: ALLOWED_MEDIA_TYPES3, 39270 onSelect: onSelectImage, 39271 onSelectURL, 39272 onError: onUploadError, 39273 name: !url ? (0, import_i18n95.__)("Add image") : (0, import_i18n95.__)("Replace"), 39274 onReset: () => onSelectImage(void 0), 39275 variant: "toolbar" 39276 } 39277 ) }) }); 39278 const hasDataFormBlockFields = window?.__experimentalContentOnlyInspectorFields; 39279 const controls = /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_jsx_runtime309.Fragment, { children: [ 39280 showBlockControls && /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_block_editor106.BlockControls, { group: "block", children: [ 39281 showUrlInput && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39282 import_block_editor106.__experimentalImageURLInputUI, 39283 { 39284 url: href || "", 39285 onChangeUrl: onSetHref, 39286 linkDestination, 39287 mediaUrl: image && image.source_url || url, 39288 mediaLink: image && image.link, 39289 linkTarget, 39290 linkClass, 39291 rel, 39292 showLightboxSetting, 39293 lightboxEnabled: lightboxChecked, 39294 onSetLightbox, 39295 resetLightbox 39296 } 39297 ), 39298 allowCrop && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39299 import_components55.ToolbarButton, 39300 { 39301 ref: cropButtonRef, 39302 onClick: openImageMediaEditorModal, 39303 "aria-haspopup": "dialog", 39304 icon: crop_default, 39305 label: (0, import_i18n95.__)("Edit image"), 39306 disabled: isSwappingMedia 39307 } 39308 ), 39309 showCoverControls && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39310 import_components55.ToolbarButton, 39311 { 39312 icon: overlay_text_default, 39313 label: (0, import_i18n95.__)("Add text over image"), 39314 onClick: switchToCover 39315 } 39316 ) 39317 ] }), 39318 canUploadExternalImage && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_block_editor106.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_components55.ToolbarGroup, { children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39319 import_components55.ToolbarButton, 39320 { 39321 onClick: uploadExternal, 39322 icon: upload_default, 39323 label: (0, import_i18n95.__)("Upload to Media Library") 39324 } 39325 ) }) }), 39326 isContentOnlyMode && // Add some extra controls for content attributes when content only mode is active. 39327 // With content only mode active, the inspector is hidden, so users need another way 39328 // to edit these attributes. 39329 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_block_editor106.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39330 ContentOnlyControls, 39331 { 39332 attributes: attributes2, 39333 setAttributes, 39334 lockAltControls, 39335 lockAltControlsMessage, 39336 lockTitleControls, 39337 lockTitleControlsMessage 39338 } 39339 ) }), 39340 !hasDataFormBlockFields && isSingleSelected && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_block_editor106.InspectorControls, { group: "content", children: /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)( 39341 import_components55.__experimentalToolsPanel, 39342 { 39343 label: (0, import_i18n95.__)("Media"), 39344 resetAll: () => { 39345 onSelectImage(void 0); 39346 setAttributes({ isDecorative: false }); 39347 }, 39348 dropdownMenuProps, 39349 children: [ 39350 !lockUrlControls && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39351 import_components55.__experimentalToolsPanelItem, 39352 { 39353 label: (0, import_i18n95.__)("Image"), 39354 hasValue: () => !!url, 39355 onDeselect: () => onSelectImage(void 0), 39356 isShownByDefault: true, 39357 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39358 MediaControl, 39359 { 39360 mediaId: id, 39361 mediaUrl: url, 39362 alt, 39363 filename: image?.media_details?.sizes?.full?.file || image?.slug || (0, import_url11.getFilename)(url), 39364 allowedTypes: ALLOWED_MEDIA_TYPES3, 39365 onSelect: onSelectImage, 39366 onSelectURL, 39367 onError: onUploadError, 39368 onReset: () => onSelectImage(void 0), 39369 isUploading, 39370 emptyLabel: (0, import_i18n95.__)("Add image") 39371 } 39372 ) 39373 } 39374 ), 39375 !isDecorative && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39376 import_components55.__experimentalToolsPanelItem, 39377 { 39378 label: (0, import_i18n95.__)("Alternative text"), 39379 isShownByDefault: true, 39380 hasValue: () => !!alt, 39381 onDeselect: () => setAttributes({ alt: void 0 }), 39382 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39383 import_components55.TextareaControl, 39384 { 39385 label: (0, import_i18n95.__)("Alternative text"), 39386 value: alt || "", 39387 onChange: updateAlt, 39388 readOnly: lockAltControls, 39389 help: lockAltControls ? /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_jsx_runtime309.Fragment, { children: lockAltControlsMessage }) : /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39390 import_components55.ExternalLink, 39391 { 39392 href: ( 39393 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 39394 (0, import_i18n95.__)( 39395 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 39396 ) 39397 ), 39398 children: (0, import_i18n95.__)( 39399 "Describe the purpose of the image." 39400 ) 39401 } 39402 ) 39403 } 39404 ) 39405 } 39406 ), 39407 !lockAltControls && !lightboxChecked && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39408 import_components55.__experimentalToolsPanelItem, 39409 { 39410 label: (0, import_i18n95.__)("Mark as decorative"), 39411 isShownByDefault: true, 39412 hasValue: () => !!isDecorative, 39413 onDeselect: () => setAttributes({ isDecorative: false }), 39414 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39415 import_components55.CheckboxControl, 39416 { 39417 label: (0, import_i18n95.__)("Mark as decorative"), 39418 checked: !!isDecorative, 39419 onChange: updateIsDecorative, 39420 help: (0, import_i18n95.__)( 39421 "Hidden from assistive technologies." 39422 ) 39423 } 39424 ) 39425 } 39426 ) 39427 ] 39428 } 39429 ) }), 39430 /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)( 39431 import_block_editor106.InspectorControls, 39432 { 39433 group: "dimensions", 39434 resetAllFilter: (attrs) => { 39435 return getDimensionResetAttributes({ 39436 attributes: attrs, 39437 selectedState: selectedStyleState, 39438 hasSelectedStyleState, 39439 keys: ["aspectRatio", "height", "objectFit", "width"], 39440 defaultAttributes: { 39441 aspectRatio: void 0, 39442 width: void 0, 39443 height: void 0, 39444 scale: void 0, 39445 focalPoint: void 0 39446 } 39447 }); 39448 }, 39449 children: [ 39450 dimensionsControl, 39451 !hasSelectedStyleState && url && scale && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39452 import_components55.__experimentalToolsPanelItem, 39453 { 39454 label: (0, import_i18n95.__)("Focal point"), 39455 isShownByDefault: true, 39456 hasValue: () => !!focalPoint, 39457 onDeselect: () => setAttributes({ 39458 focalPoint: void 0 39459 }), 39460 panelId: clientId, 39461 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39462 import_components55.FocalPointPicker, 39463 { 39464 label: (0, import_i18n95.__)("Focal point"), 39465 url, 39466 value: focalPoint, 39467 onDragStart: imperativeFocalPointPreview, 39468 onDrag: imperativeFocalPointPreview, 39469 onChange: (newFocalPoint) => setAttributes({ 39470 focalPoint: newFocalPoint 39471 }) 39472 } 39473 ) 39474 } 39475 ) 39476 ] 39477 } 39478 ), 39479 !!imageSizeOptions.length && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_block_editor106.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39480 import_components55.__experimentalToolsPanel, 39481 { 39482 label: (0, import_i18n95.__)("Settings"), 39483 resetAll: resetSettings, 39484 dropdownMenuProps, 39485 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39486 ResolutionTool2, 39487 { 39488 value: sizeSlug, 39489 defaultValue: DEFAULT_MEDIA_SIZE_SLUG3, 39490 onChange: updateImage, 39491 options: imageSizeOptions 39492 } 39493 ) 39494 } 39495 ) }), 39496 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_block_editor106.InspectorControls, { group: "advanced", children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39497 import_components55.TextControl, 39498 { 39499 label: (0, import_i18n95.__)("Title attribute"), 39500 value: title || "", 39501 onChange: onSetTitle, 39502 readOnly: lockTitleControls, 39503 help: lockTitleControls ? /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_jsx_runtime309.Fragment, { children: lockTitleControlsMessage }) : (0, import_element72.createInterpolateElement)( 39504 (0, import_i18n95.__)( 39505 "Describe the role of this image on the page. <a>(Note: many devices and browsers do not display this text.)</a>" 39506 ), 39507 { 39508 a: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_components55.ExternalLink, { href: "https://www.w3.org/TR/html52/dom.html#the-title-attribute" }) 39509 } 39510 ) 39511 } 39512 ) }) 39513 ] }); 39514 const filename = (0, import_url11.getFilename)(url); 39515 let defaultedAlt; 39516 if (isDecorative) { 39517 defaultedAlt = filename ? (0, import_i18n95.sprintf)( 39518 /* translators: %s: file name */ 39519 (0, import_i18n95.__)( 39520 "This image has been marked as decorative; its file name is %s" 39521 ), 39522 filename 39523 ) : (0, import_i18n95.__)("This image has been marked as decorative."); 39524 } else if (alt) { 39525 defaultedAlt = alt; 39526 } else if (filename) { 39527 defaultedAlt = (0, import_i18n95.sprintf)( 39528 /* translators: %s: file name */ 39529 (0, import_i18n95.__)("This image has an empty alt attribute; its file name is %s"), 39530 filename 39531 ); 39532 } else { 39533 defaultedAlt = (0, import_i18n95.__)("This image has an empty alt attribute"); 39534 } 39535 const borderProps = (0, import_block_editor106.__experimentalUseBorderProps)(attributes2); 39536 const shadowProps = (0, import_block_editor106.__experimentalGetShadowClassesAndStyles)(attributes2); 39537 const { postType, postId, queryId } = context; 39538 const isDescendentOfQueryLoop = Number.isFinite(queryId); 39539 const img = /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(ImageWrapper, { href, children: temporaryURL && hasImageErrored ? ( 39540 // Show a placeholder during upload when the blob URL can't be loaded. This can 39541 // happen when the user uploads a HEIC image in a browser that doesn't support them. 39542 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39543 import_components55.Placeholder, 39544 { 39545 className: "wp-block-image__placeholder", 39546 withIllustration: true, 39547 children: /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_components55.Spinner, {}) 39548 } 39549 ) 39550 ) : /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_jsx_runtime309.Fragment, { children: [ 39551 /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39552 "img", 39553 { 39554 src: temporaryURL || url, 39555 alt: defaultedAlt, 39556 onError: onImageError, 39557 onLoad: onImageLoad, 39558 ref: setRefs, 39559 className: clsx_default(borderProps.className, { 39560 "is-swapping-media": isSwappingMedia 39561 }), 39562 width: naturalWidth, 39563 height: naturalHeight, 39564 style: { 39565 aspectRatio, 39566 ...resizeDelta ? { 39567 width: pixelSize.width + resizeDelta.width, 39568 height: pixelSize.height + resizeDelta.height 39569 } : (() => { 39570 const style2 = {}; 39571 if (width === "auto") { 39572 style2.width = "auto"; 39573 } else if (width !== void 0 && width !== null) { 39574 style2.width = typeof width === "number" ? `$width}px` : width; 39575 } 39576 if (height === "auto") { 39577 style2.height = "auto"; 39578 } else if (height !== void 0 && height !== null) { 39579 style2.height = typeof height === "number" ? `$height}px` : height; 39580 } else if (!isCroppedGalleryImage) { 39581 style2.height = "auto"; 39582 } 39583 return style2; 39584 })(), 39585 objectFit: scale, 39586 objectPosition: focalPoint && scale ? mediaPosition2(focalPoint) : void 0, 39587 ...borderProps.style, 39588 ...shadowProps.style 39589 } 39590 } 39591 ), 39592 (isUploading || isSwappingMedia) && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_components55.Spinner, {}) 39593 ] }) }); 39594 let resizableBox; 39595 if (isResizable && isSingleSelected && !isUploading && !SIZED_LAYOUTS.includes(parentLayoutType)) { 39596 const numericRatio = aspectRatio && evalAspectRatio(aspectRatio); 39597 const customRatio = pixelSize.width / pixelSize.height; 39598 const naturalRatio = naturalWidth / naturalHeight; 39599 const ratio = numericRatio || customRatio || naturalRatio || 1; 39600 const minWidth = naturalWidth < naturalHeight ? MIN_SIZE2 : MIN_SIZE2 * ratio; 39601 const minHeight = naturalHeight < naturalWidth ? MIN_SIZE2 : MIN_SIZE2 / ratio; 39602 const maxWidthBuffer = maxWidth * 2.5; 39603 const maxResizeWidth = maxContentWidth || maxWidthBuffer; 39604 let showRightHandle = false; 39605 let showLeftHandle = false; 39606 if (align === "center") { 39607 showRightHandle = true; 39608 showLeftHandle = true; 39609 } else if ((0, import_i18n95.isRTL)()) { 39610 if (align === "left") { 39611 showRightHandle = true; 39612 } else { 39613 showLeftHandle = true; 39614 } 39615 } else { 39616 if (align === "right") { 39617 showLeftHandle = true; 39618 } else { 39619 showRightHandle = true; 39620 } 39621 } 39622 resizableBox = /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39623 import_components55.ResizableBox, 39624 { 39625 ref: effectResizeableBoxPlacement, 39626 style: { 39627 position: "absolute", 39628 // To match the vertical-align: bottom of the img (from style.scss) 39629 // syncs the top with the img. This matters when the img height is 39630 // less than the line-height. 39631 inset: `${offsetTop}px 0 0 0` 39632 }, 39633 size: pixelSize, 39634 minWidth, 39635 maxWidth: maxResizeWidth, 39636 minHeight, 39637 maxHeight: maxResizeWidth / ratio, 39638 lockAspectRatio: ratio, 39639 enable: { 39640 top: false, 39641 right: showRightHandle, 39642 bottom: true, 39643 left: showLeftHandle 39644 }, 39645 onResizeStart: () => { 39646 toggleSelection(false); 39647 }, 39648 onResize: (event, direction, elt, delta) => { 39649 setResizeDelta(delta); 39650 }, 39651 onResizeStop: (event, direction, elt, delta) => { 39652 toggleSelection(true); 39653 setResizeDelta(null); 39654 setPixelSize((current) => ({ 39655 width: current.width + delta.width, 39656 height: current.height + delta.height 39657 })); 39658 if (maxContentWidth && // Only do this if the image is bigger than the container to prevent it from being squished. 39659 // TODO: Remove this check if the image support setting 100% width. 39660 naturalWidth >= maxContentWidth && Math.abs(elt.offsetWidth - maxContentWidth) < 10) { 39661 setAttributes({ 39662 width: void 0, 39663 height: void 0 39664 }); 39665 return; 39666 } 39667 setAttributes({ 39668 width: `${elt.offsetWidth}px`, 39669 height: "auto", 39670 aspectRatio: ratio === naturalRatio ? void 0 : String(ratio) 39671 }); 39672 }, 39673 resizeRatio: align === "center" ? 2 : 1 39674 } 39675 ); 39676 } 39677 if (!url && !temporaryURL) { 39678 return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_jsx_runtime309.Fragment, { children: [ 39679 mediaControls, 39680 controls 39681 ] }); 39682 } 39683 const setPostFeatureImage = () => { 39684 editEntityRecord("postType", postType, postId, { 39685 featured_media: id 39686 }); 39687 createSuccessNotice((0, import_i18n95.__)("Post featured image updated."), { 39688 type: "snackbar" 39689 }); 39690 }; 39691 const featuredImageControl = !isDescendentOfQueryLoop && postId && id ? /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_block_editor106.BlockSettingsMenuControls, { children: ({ canEdit, selectedClientIds }) => canEdit && selectedClientIds.length === 1 && clientId === selectedClientIds[0] && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)(import_components55.MenuItem, { onClick: setPostFeatureImage, children: (0, import_i18n95.__)("Set as featured image") }) }) : null; 39692 return /* @__PURE__ */ (0, import_jsx_runtime309.jsxs)(import_jsx_runtime309.Fragment, { children: [ 39693 mediaControls, 39694 controls, 39695 featuredImageControl, 39696 img, 39697 resizableBox, 39698 !isDecorative && /* @__PURE__ */ (0, import_jsx_runtime309.jsx)( 39699 Caption, 39700 { 39701 attributes: attributes2, 39702 setAttributes, 39703 isSelected: isSingleSelected, 39704 insertBlocksAfter, 39705 label: (0, import_i18n95.__)("Image caption text"), 39706 showToolbarButton: isSingleSelected && (hasNonContentControls || isContentOnlyMode) && !hideCaptionControls 39707 } 39708 ) 39709 ] }); 39710 } 39711 39712 // packages/block-library/build-module/image/use-max-width-observer.mjs 39713 var import_element73 = __toESM(require_element(), 1); 39714 var import_compose27 = __toESM(require_compose(), 1); 39715 var import_jsx_runtime310 = __toESM(require_jsx_runtime(), 1); 39716 function useMaxWidthObserver() { 39717 const [contentResizeListener, { width }] = (0, import_compose27.useResizeObserver)(); 39718 const observerRef = (0, import_element73.useRef)(); 39719 const maxWidthObserver = /* @__PURE__ */ (0, import_jsx_runtime310.jsx)( 39720 "div", 39721 { 39722 className: "wp-block", 39723 "aria-hidden": "true", 39724 style: { 39725 position: "absolute", 39726 inset: 0, 39727 width: "100%", 39728 height: 0, 39729 margin: 0 39730 }, 39731 ref: observerRef, 39732 children: contentResizeListener 39733 } 39734 ); 39735 return [maxWidthObserver, width]; 39736 } 39737 39738 // packages/block-library/build-module/image/edit.mjs 39739 var import_jsx_runtime311 = __toESM(require_jsx_runtime(), 1); 39740 var pickRelevantMediaFiles2 = (image, size) => { 39741 const imageProps = Object.fromEntries( 39742 Object.entries(image ?? {}).filter( 39743 ([key]) => ["alt", "id", "link", "caption"].includes(key) 39744 ) 39745 ); 39746 imageProps.url = image?.sizes?.[size]?.url || image?.media_details?.sizes?.[size]?.source_url || image.url; 39747 return imageProps; 39748 }; 39749 var isExternalImage = (id, url) => url && !id && !(0, import_blob12.isBlobURL)(url); 39750 function hasSize(image, size) { 39751 return "url" in (image?.sizes?.[size] ?? {}) || "source_url" in (image?.media_details?.sizes?.[size] ?? {}); 39752 } 39753 function ImageEdit({ 39754 attributes: attributes2, 39755 setAttributes, 39756 isSelected: isSingleSelected, 39757 className, 39758 insertBlocksAfter, 39759 onReplace, 39760 context, 39761 clientId, 39762 __unstableParentLayout: parentLayout 39763 }) { 39764 const { 39765 url = "", 39766 caption, 39767 id, 39768 width, 39769 height, 39770 sizeSlug, 39771 aspectRatio, 39772 scale, 39773 align, 39774 metadata 39775 } = attributes2; 39776 const [temporaryURL, setTemporaryURL] = (0, import_element74.useState)(attributes2.blob); 39777 const containerRef = (0, import_element74.useRef)(); 39778 const layoutType = parentLayout?.type || parentLayout?.default?.type; 39779 const isMaxWidthContainerWidth = !layoutType || layoutType !== "flex" && layoutType !== "grid"; 39780 const [maxWidthObserver, maxContentWidth] = useMaxWidthObserver(); 39781 const [placeholderResizeListener, { width: placeholderWidth }] = (0, import_compose28.useResizeObserver)(); 39782 const isSmallContainer = placeholderWidth && placeholderWidth < 160; 39783 const captionRef = (0, import_element74.useRef)(); 39784 (0, import_element74.useEffect)(() => { 39785 captionRef.current = caption; 39786 }, [caption]); 39787 const { __unstableMarkNextChangeAsNotPersistent, replaceBlock } = (0, import_data50.useDispatch)(import_block_editor107.store); 39788 (0, import_element74.useEffect)(() => { 39789 if (["wide", "full"].includes(align)) { 39790 __unstableMarkNextChangeAsNotPersistent(); 39791 setAttributes({ 39792 width: void 0, 39793 height: void 0 39794 }); 39795 } 39796 }, [__unstableMarkNextChangeAsNotPersistent, align, setAttributes]); 39797 const { 39798 getSettings: getSettings2, 39799 getBlockRootClientId, 39800 getBlockName, 39801 canInsertBlockType 39802 } = (0, import_data50.useSelect)(import_block_editor107.store); 39803 const blockEditingMode = (0, import_block_editor107.useBlockEditingMode)(); 39804 const { createErrorNotice } = (0, import_data50.useDispatch)(import_notices8.store); 39805 function onUploadError(message) { 39806 createErrorNotice(message, { 39807 type: "snackbar", 39808 explicitDismiss: true 39809 }); 39810 setTemporaryURL(); 39811 setAttributes({ 39812 src: void 0, 39813 id: void 0, 39814 url: void 0, 39815 blob: void 0 39816 }); 39817 } 39818 function onFilesPreUpload(files) { 39819 if (files.length === 1) { 39820 setTemporaryURL((0, import_blob12.createBlobURL)(files[0])); 39821 } 39822 } 39823 function onSelectImagesList(images) { 39824 const win = containerRef.current?.ownerDocument.defaultView; 39825 if (images.every((file) => file instanceof win.File)) { 39826 const files = images; 39827 const rootClientId = getBlockRootClientId(clientId); 39828 if (files.some((file) => !isValidFileType(file))) { 39829 createErrorNotice( 39830 (0, import_i18n96.__)( 39831 "If uploading to a gallery all files need to be image formats" 39832 ), 39833 { id: "gallery-upload-invalid-file", type: "snackbar" } 39834 ); 39835 } 39836 const imageBlocks = files.filter((file) => isValidFileType(file)).map( 39837 (file) => (0, import_blocks40.createBlock)("core/image", { 39838 blob: (0, import_blob12.createBlobURL)(file) 39839 }) 39840 ); 39841 if (getBlockName(rootClientId) === "core/gallery") { 39842 replaceBlock(clientId, imageBlocks); 39843 } else if (canInsertBlockType("core/gallery", rootClientId)) { 39844 const galleryBlock = (0, import_blocks40.createBlock)( 39845 "core/gallery", 39846 {}, 39847 imageBlocks 39848 ); 39849 replaceBlock(clientId, galleryBlock); 39850 } 39851 } 39852 } 39853 function onSelectImage(media) { 39854 if (Array.isArray(media)) { 39855 onSelectImagesList(media); 39856 return; 39857 } 39858 if (!media || !media.url) { 39859 setAttributes({ 39860 url: void 0, 39861 alt: void 0, 39862 id: void 0, 39863 title: void 0, 39864 caption: void 0, 39865 blob: void 0 39866 }); 39867 setTemporaryURL(); 39868 return; 39869 } 39870 if ((0, import_blob12.isBlobURL)(media.url)) { 39871 setTemporaryURL(media.url); 39872 return; 39873 } 39874 const { imageDefaultSize } = getSettings2(); 39875 let newSize = DEFAULT_MEDIA_SIZE_SLUG3; 39876 if (sizeSlug && hasSize(media, sizeSlug)) { 39877 newSize = sizeSlug; 39878 } else if (hasSize(media, imageDefaultSize)) { 39879 newSize = imageDefaultSize; 39880 } 39881 let mediaAttributes = pickRelevantMediaFiles2(media, newSize); 39882 if (typeof mediaAttributes.caption === "string" && mediaAttributes.caption.includes("\n")) { 39883 mediaAttributes.caption = mediaAttributes.caption.replace( 39884 /\n/g, 39885 "<br>" 39886 ); 39887 } 39888 if (captionRef.current && !mediaAttributes.caption) { 39889 const { caption: omittedCaption, ...restMediaAttributes } = mediaAttributes; 39890 mediaAttributes = restMediaAttributes; 39891 } 39892 let additionalAttributes; 39893 if (!media.id || media.id !== id) { 39894 additionalAttributes = { 39895 sizeSlug: newSize 39896 }; 39897 } 39898 let linkDestination = attributes2.linkDestination; 39899 if (!linkDestination) { 39900 switch (window?.wp?.media?.view?.settings?.defaultProps?.link || LINK_DESTINATION_NONE2) { 39901 case "file": 39902 case LINK_DESTINATION_MEDIA2: 39903 linkDestination = LINK_DESTINATION_MEDIA2; 39904 break; 39905 case "post": 39906 case LINK_DESTINATION_ATTACHMENT2: 39907 linkDestination = LINK_DESTINATION_ATTACHMENT2; 39908 break; 39909 case LINK_DESTINATION_CUSTOM: 39910 linkDestination = LINK_DESTINATION_CUSTOM; 39911 break; 39912 case LINK_DESTINATION_NONE2: 39913 linkDestination = LINK_DESTINATION_NONE2; 39914 break; 39915 } 39916 } 39917 let href; 39918 switch (linkDestination) { 39919 case LINK_DESTINATION_MEDIA2: 39920 href = media.url; 39921 break; 39922 case LINK_DESTINATION_ATTACHMENT2: 39923 href = media.link; 39924 break; 39925 } 39926 mediaAttributes.href = href; 39927 setAttributes({ 39928 blob: void 0, 39929 ...mediaAttributes, 39930 ...additionalAttributes, 39931 linkDestination 39932 }); 39933 setTemporaryURL(); 39934 } 39935 function onSelectURL(newURL) { 39936 const normalizedNewURL = (0, import_url12.getProtocol)(newURL) ? newURL : (0, import_url12.prependHTTPS)(newURL); 39937 if (normalizedNewURL !== url) { 39938 setAttributes({ 39939 blob: void 0, 39940 url: normalizedNewURL, 39941 id: void 0, 39942 sizeSlug: getSettings2().imageDefaultSize 39943 }); 39944 setTemporaryURL(); 39945 } 39946 } 39947 useUploadMediaFromBlobURL({ 39948 url: temporaryURL, 39949 allowedTypes: ALLOWED_MEDIA_TYPES3, 39950 onChange: onSelectImage, 39951 onError: onUploadError 39952 }); 39953 const isExternal = isExternalImage(id, url); 39954 const src = isExternal ? url : void 0; 39955 const isSideloading = (0, import_data50.useSelect)( 39956 (select10) => { 39957 if (!window.__clientSideMediaProcessing || !id) { 39958 return false; 39959 } 39960 return select10(import_upload_media.store).isUploadingById(id); 39961 }, 39962 [id] 39963 ); 39964 const mediaPreview = !!url && /* @__PURE__ */ (0, import_jsx_runtime311.jsx)( 39965 "img", 39966 { 39967 alt: (0, import_i18n96.__)("Edit image"), 39968 title: (0, import_i18n96.__)("Edit image"), 39969 className: "edit-image-preview", 39970 src: url 39971 } 39972 ); 39973 const borderProps = (0, import_block_editor107.__experimentalUseBorderProps)(attributes2); 39974 const shadowProps = (0, import_block_editor107.__experimentalGetShadowClassesAndStyles)(attributes2); 39975 const classes = clsx_default(className, { 39976 "is-transient": !!temporaryURL || isSideloading, 39977 "is-resized": !!width || !!height, 39978 [`size-$sizeSlug}`]: sizeSlug, 39979 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 39980 }); 39981 const blockProps = (0, import_block_editor107.useBlockProps)({ 39982 ref: containerRef, 39983 className: classes 39984 }); 39985 const { lockUrlControls = false, lockUrlControlsMessage } = (0, import_data50.useSelect)( 39986 (select10) => { 39987 if (!isSingleSelected) { 39988 return {}; 39989 } 39990 const blockBindingsSource = (0, import_blocks40.getBlockBindingsSource)( 39991 metadata?.bindings?.url?.source 39992 ); 39993 return { 39994 lockUrlControls: !!metadata?.bindings?.url && !blockBindingsSource?.canUserEditValue?.({ 39995 select: select10, 39996 context, 39997 args: metadata?.bindings?.url?.args 39998 }), 39999 lockUrlControlsMessage: blockBindingsSource?.label ? (0, import_i18n96.sprintf)( 40000 /* translators: %s: Label of the bindings source. */ 40001 (0, import_i18n96.__)("Connected to %s"), 40002 blockBindingsSource.label 40003 ) : (0, import_i18n96.__)("Connected to dynamic data") 40004 }; 40005 }, 40006 [context, isSingleSelected, metadata?.bindings?.url] 40007 ); 40008 const pinnedHeight = height === "auto" ? void 0 : height; 40009 const placeholder2 = (content) => { 40010 return /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)( 40011 import_components56.Placeholder, 40012 { 40013 className: clsx_default("block-editor-media-placeholder", { 40014 [borderProps.className]: !!borderProps.className && !isSingleSelected 40015 }), 40016 icon: !isSmallContainer && (lockUrlControls ? plugins_default : image_default), 40017 withIllustration: !isSingleSelected || isSmallContainer, 40018 label: !isSmallContainer && (0, import_i18n96.__)("Image"), 40019 instructions: !lockUrlControls && !isSmallContainer && (0, import_i18n96.__)( 40020 "Drag and drop an image, upload, or choose from your library." 40021 ), 40022 style: { 40023 aspectRatio: !(width && pinnedHeight) && aspectRatio ? aspectRatio : void 0, 40024 width: pinnedHeight && aspectRatio ? "100%" : width, 40025 height: width && aspectRatio ? "100%" : pinnedHeight, 40026 objectFit: scale, 40027 ...borderProps.style, 40028 ...shadowProps.style 40029 }, 40030 children: [ 40031 lockUrlControls && !isSmallContainer && lockUrlControlsMessage, 40032 !lockUrlControls && !isSmallContainer && content, 40033 placeholderResizeListener 40034 ] 40035 } 40036 ); 40037 }; 40038 return /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)(import_jsx_runtime311.Fragment, { children: [ 40039 /* @__PURE__ */ (0, import_jsx_runtime311.jsxs)("figure", { ...blockProps, children: [ 40040 /* @__PURE__ */ (0, import_jsx_runtime311.jsx)( 40041 Image2, 40042 { 40043 temporaryURL, 40044 isSideloading, 40045 attributes: attributes2, 40046 setAttributes, 40047 isSingleSelected, 40048 insertBlocksAfter, 40049 onReplace, 40050 onSelectImage, 40051 onSelectURL, 40052 onUploadError, 40053 context, 40054 clientId, 40055 blockEditingMode, 40056 parentLayoutType: layoutType, 40057 maxContentWidth 40058 } 40059 ), 40060 /* @__PURE__ */ (0, import_jsx_runtime311.jsx)( 40061 import_block_editor107.MediaPlaceholder, 40062 { 40063 icon: /* @__PURE__ */ (0, import_jsx_runtime311.jsx)(import_block_editor107.BlockIcon, { icon: image_default }), 40064 onSelect: onSelectImage, 40065 onSelectURL, 40066 onFilesPreUpload, 40067 onError: onUploadError, 40068 placeholder: placeholder2, 40069 allowedTypes: ALLOWED_MEDIA_TYPES3, 40070 handleUpload: (files) => files.length === 1, 40071 value: { id, src }, 40072 mediaPreview, 40073 disableMediaButtons: temporaryURL || url 40074 } 40075 ) 40076 ] }), 40077 // The listener cannot be placed as the first element as it will break the in-between inserter. 40078 // See https://github.com/WordPress/gutenberg/blob/71134165868298fc15e22896d0c28b41b3755ff7/packages/block-editor/src/components/block-list/use-in-between-inserter.js#L120 40079 isSingleSelected && isMaxWidthContainerWidth && maxWidthObserver 40080 ] }); 40081 } 40082 var edit_default14 = ImageEdit; 40083 40084 // packages/block-library/build-module/image/block.json 40085 var block_default40 = { 40086 $schema: "https://schemas.wp.org/trunk/block.json", 40087 apiVersion: 3, 40088 name: "core/image", 40089 title: "Image", 40090 category: "media", 40091 usesContext: [ 40092 "allowResize", 40093 "imageCrop", 40094 "fixedHeight", 40095 "navigationButtonType", 40096 "postId", 40097 "postType", 40098 "queryId", 40099 "galleryId" 40100 ], 40101 description: "Insert an image to make a visual statement.", 40102 keywords: ["img", "photo", "picture"], 40103 textdomain: "default", 40104 attributes: { 40105 blob: { 40106 type: "string", 40107 role: "local" 40108 }, 40109 url: { 40110 type: "string", 40111 source: "attribute", 40112 selector: "img", 40113 attribute: "src", 40114 role: "content" 40115 }, 40116 alt: { 40117 type: "string", 40118 source: "attribute", 40119 selector: "img", 40120 attribute: "alt", 40121 default: "", 40122 role: "content" 40123 }, 40124 caption: { 40125 type: "rich-text", 40126 source: "rich-text", 40127 selector: "figcaption", 40128 role: "content" 40129 }, 40130 lightbox: { 40131 type: "object", 40132 enabled: { 40133 type: "boolean" 40134 } 40135 }, 40136 title: { 40137 type: "string", 40138 source: "attribute", 40139 selector: "img", 40140 attribute: "title", 40141 role: "content" 40142 }, 40143 href: { 40144 type: "string", 40145 source: "attribute", 40146 selector: "figure > a", 40147 attribute: "href", 40148 role: "content" 40149 }, 40150 rel: { 40151 type: "string", 40152 source: "attribute", 40153 selector: "figure > a", 40154 attribute: "rel" 40155 }, 40156 linkClass: { 40157 type: "string", 40158 source: "attribute", 40159 selector: "figure > a", 40160 attribute: "class" 40161 }, 40162 id: { 40163 type: "number", 40164 role: "content" 40165 }, 40166 width: { 40167 type: "string" 40168 }, 40169 height: { 40170 type: "string" 40171 }, 40172 aspectRatio: { 40173 type: "string" 40174 }, 40175 scale: { 40176 type: "string" 40177 }, 40178 focalPoint: { 40179 type: "object" 40180 }, 40181 sizeSlug: { 40182 type: "string" 40183 }, 40184 linkDestination: { 40185 type: "string" 40186 }, 40187 linkTarget: { 40188 type: "string", 40189 source: "attribute", 40190 selector: "figure > a", 40191 attribute: "target" 40192 }, 40193 isDecorative: { 40194 type: "boolean", 40195 default: false 40196 } 40197 }, 40198 supports: { 40199 interactivity: true, 40200 align: ["left", "center", "right", "wide", "full"], 40201 anchor: true, 40202 color: { 40203 text: false, 40204 background: false 40205 }, 40206 filter: { 40207 duotone: true 40208 }, 40209 spacing: { 40210 margin: true 40211 }, 40212 __experimentalBorder: { 40213 color: true, 40214 radius: true, 40215 width: true, 40216 __experimentalSkipSerialization: true, 40217 __experimentalDefaultControls: { 40218 color: true, 40219 radius: true, 40220 width: true 40221 } 40222 }, 40223 shadow: { 40224 __experimentalSkipSerialization: true 40225 } 40226 }, 40227 selectors: { 40228 dimensions: ".wp-block-image img, .wp-block-image .components-placeholder", 40229 border: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", 40230 shadow: ".wp-block-image img, .wp-block-image .wp-block-image__crop-area, .wp-block-image .components-placeholder", 40231 filter: { 40232 duotone: ".wp-block-image img, .wp-block-image .components-placeholder" 40233 } 40234 }, 40235 styles: [ 40236 { 40237 name: "default", 40238 label: "Default", 40239 isDefault: true 40240 }, 40241 { name: "rounded", label: "Rounded" } 40242 ], 40243 editorStyle: "wp-block-image-editor", 40244 style: "wp-block-image" 40245 }; 40246 40247 // packages/block-library/build-module/image/save.mjs 40248 var import_block_editor108 = __toESM(require_block_editor(), 1); 40249 var import_jsx_runtime312 = __toESM(require_jsx_runtime(), 1); 40250 function save22({ attributes: attributes2 }) { 40251 const { 40252 url, 40253 alt, 40254 caption, 40255 align, 40256 href, 40257 rel, 40258 linkClass, 40259 width, 40260 height, 40261 aspectRatio, 40262 scale, 40263 focalPoint, 40264 id, 40265 linkTarget, 40266 sizeSlug, 40267 title, 40268 isDecorative, 40269 metadata: { bindings = {} } = {} 40270 } = attributes2; 40271 const newRel = !rel ? void 0 : rel; 40272 const borderProps = (0, import_block_editor108.__experimentalGetBorderClassesAndStyles)(attributes2); 40273 const shadowProps = (0, import_block_editor108.__experimentalGetShadowClassesAndStyles)(attributes2); 40274 const classes = clsx_default({ 40275 // All other align classes are handled by block supports. 40276 // `{ align: 'none' }` is unique to transforms for the image block. 40277 alignnone: "none" === align, 40278 [`size-$sizeSlug}`]: sizeSlug, 40279 "is-resized": width || height, 40280 "has-custom-border": !!borderProps.className || borderProps.style && Object.keys(borderProps.style).length > 0 40281 }); 40282 const imageClasses = clsx_default(borderProps.className, { 40283 [`wp-image-$id}`]: !!id 40284 }); 40285 const image = /* @__PURE__ */ (0, import_jsx_runtime312.jsx)( 40286 "img", 40287 { 40288 src: url, 40289 alt, 40290 className: imageClasses || void 0, 40291 style: (() => { 40292 const style2 = { 40293 ...borderProps.style, 40294 ...shadowProps.style, 40295 aspectRatio, 40296 objectFit: scale, 40297 objectPosition: focalPoint && scale ? mediaPosition2(focalPoint) : void 0 40298 }; 40299 if (width !== void 0 || height !== void 0) { 40300 if (width === "auto") { 40301 style2.width = "auto"; 40302 } else if (width !== void 0 && width !== null) { 40303 style2.width = typeof width === "number" ? `$width}px` : width; 40304 } 40305 if (height === "auto" || height === void 0 || height === null) { 40306 style2.height = "auto"; 40307 } else { 40308 style2.height = typeof height === "number" ? `$height}px` : height; 40309 } 40310 } 40311 return style2; 40312 })(), 40313 title, 40314 role: isDecorative ? "none" : void 0 40315 } 40316 ); 40317 const displayCaption = !import_block_editor108.RichText.isEmpty(caption) || bindings.caption || bindings?.__default?.source === "core/pattern-overrides"; 40318 const figure = /* @__PURE__ */ (0, import_jsx_runtime312.jsxs)(import_jsx_runtime312.Fragment, { children: [ 40319 href ? /* @__PURE__ */ (0, import_jsx_runtime312.jsx)( 40320 "a", 40321 { 40322 className: linkClass, 40323 href, 40324 target: linkTarget, 40325 rel: newRel, 40326 children: image 40327 } 40328 ) : image, 40329 displayCaption && /* @__PURE__ */ (0, import_jsx_runtime312.jsx)( 40330 import_block_editor108.RichText.Content, 40331 { 40332 className: (0, import_block_editor108.__experimentalGetElementClassName)("caption"), 40333 tagName: "figcaption", 40334 value: caption 40335 } 40336 ) 40337 ] }); 40338 return /* @__PURE__ */ (0, import_jsx_runtime312.jsx)("figure", { ...import_block_editor108.useBlockProps.save({ className: classes }), children: figure }); 40339 } 40340 40341 // packages/block-library/build-module/image/transforms.mjs 40342 var import_blob13 = __toESM(require_blob(), 1); 40343 var import_blocks41 = __toESM(require_blocks(), 1); 40344 var import_data51 = __toESM(require_data(), 1); 40345 var import_core_data27 = __toESM(require_core_data(), 1); 40346 function getCarriedGifConversionAttributes(attributes2) { 40347 const { align, anchor, className, style: style2 } = attributes2; 40348 const margin = style2?.spacing?.margin; 40349 return { 40350 ...align && { align }, 40351 ...anchor && { anchor }, 40352 ...className && { className }, 40353 ...margin && { style: { spacing: { margin } } } 40354 }; 40355 } 40356 function getAnimatedGifVideoCompanion(id, url) { 40357 if (!id) { 40358 return null; 40359 } 40360 const urlPath = url?.split(/[?#]/)[0]; 40361 if (!urlPath?.toLowerCase().endsWith(".gif")) { 40362 return null; 40363 } 40364 const record = (0, import_data51.select)(import_core_data27.store).getEntityRecord( 40365 "postType", 40366 "attachment", 40367 id, 40368 { context: "view" } 40369 ); 40370 const details = record?.media_details; 40371 if (!details?.animated_video || !record?.source_url) { 40372 return null; 40373 } 40374 const dir = record.source_url.slice( 40375 0, 40376 record.source_url.lastIndexOf("/") + 1 40377 ); 40378 return { 40379 src: dir + details.animated_video, 40380 poster: details.animated_video_poster ? dir + details.animated_video_poster : void 0, 40381 width: details.width, 40382 height: details.height 40383 }; 40384 } 40385 function stripFirstImage(attributes2, { shortcode }) { 40386 const { body } = document.implementation.createHTMLDocument(""); 40387 body.innerHTML = shortcode.content; 40388 let nodeToRemove = body.querySelector("img"); 40389 while (nodeToRemove && nodeToRemove.parentNode && nodeToRemove.parentNode !== body) { 40390 nodeToRemove = nodeToRemove.parentNode; 40391 } 40392 if (nodeToRemove) { 40393 nodeToRemove.parentNode.removeChild(nodeToRemove); 40394 } 40395 return body.innerHTML.trim(); 40396 } 40397 function getFirstAnchorAttributeFormHTML(html, attributeName) { 40398 const { body } = document.implementation.createHTMLDocument(""); 40399 body.innerHTML = html; 40400 const { firstElementChild } = body; 40401 if (firstElementChild && firstElementChild.nodeName === "A") { 40402 return firstElementChild.getAttribute(attributeName) || void 0; 40403 } 40404 } 40405 var imageSchema = { 40406 img: { 40407 attributes: ["src", "alt", "title", "width", "height"], 40408 classes: [ 40409 "alignleft", 40410 "aligncenter", 40411 "alignright", 40412 "alignnone", 40413 /^wp-image-\d+$/ 40414 ] 40415 } 40416 }; 40417 function parsePixelDimension(value) { 40418 return value && /^\d+$/.test(value) ? `$value}px` : void 0; 40419 } 40420 var schema = ({ phrasingContentSchema }) => ({ 40421 figure: { 40422 require: ["img"], 40423 children: { 40424 ...imageSchema, 40425 a: { 40426 attributes: ["href", "rel", "target"], 40427 classes: ["*"], 40428 children: imageSchema 40429 }, 40430 figcaption: { 40431 children: phrasingContentSchema 40432 } 40433 } 40434 } 40435 }); 40436 var transforms13 = { 40437 from: [ 40438 { 40439 type: "raw", 40440 isMatch: (node) => node.nodeName === "FIGURE" && !!node.querySelector("img"), 40441 schema, 40442 transform: (node) => { 40443 const img = node.querySelector("img"); 40444 const className = node.className + " " + img.className; 40445 const alignMatches = /(?:^|\s)align(left|center|right)(?:$|\s)/.exec( 40446 className 40447 ); 40448 const anchor = node.id === "" ? void 0 : node.id; 40449 const align = alignMatches ? alignMatches[1] : void 0; 40450 const idMatches = /(?:^|\s)wp-image-(\d+)(?:$|\s)/.exec( 40451 className 40452 ); 40453 const id = idMatches ? Number(idMatches[1]) : void 0; 40454 const anchorElement = node.querySelector("a"); 40455 const linkDestination = anchorElement && anchorElement.href ? "custom" : void 0; 40456 const href = anchorElement && anchorElement.href ? anchorElement.href : void 0; 40457 const rel = anchorElement && anchorElement.rel ? anchorElement.rel : void 0; 40458 const linkClass = anchorElement && anchorElement.className ? anchorElement.className : void 0; 40459 const widthValue = parsePixelDimension( 40460 img.getAttribute("width") 40461 ); 40462 const heightValue = parsePixelDimension( 40463 img.getAttribute("height") 40464 ); 40465 const widthNumber = parseInt(widthValue, 10); 40466 const heightNumber = parseInt(heightValue, 10); 40467 const aspectRatio = widthNumber && heightNumber ? String(widthNumber / heightNumber) : void 0; 40468 const width = widthValue || (heightValue ? "auto" : void 0); 40469 const height = widthValue ? "auto" : heightValue; 40470 const attributes2 = (0, import_blocks41.getBlockAttributes)( 40471 "core/image", 40472 node.outerHTML, 40473 { 40474 align, 40475 id, 40476 linkDestination, 40477 href, 40478 rel, 40479 linkClass, 40480 anchor, 40481 width, 40482 height, 40483 aspectRatio 40484 } 40485 ); 40486 if ((0, import_blob13.isBlobURL)(attributes2.url)) { 40487 attributes2.blob = attributes2.url; 40488 delete attributes2.url; 40489 } 40490 return (0, import_blocks41.createBlock)("core/image", attributes2); 40491 } 40492 }, 40493 { 40494 // Note: when dragging and dropping multiple files onto a gallery this overrides the 40495 // gallery transform in order to add new images to the gallery instead of 40496 // creating a new gallery. 40497 type: "files", 40498 isMatch(files) { 40499 return files.every( 40500 (file) => file.type.indexOf("image/") === 0 40501 ); 40502 }, 40503 transform(files) { 40504 const blocks = files.map((file) => { 40505 return (0, import_blocks41.createBlock)("core/image", { 40506 blob: (0, import_blob13.createBlobURL)(file) 40507 }); 40508 }); 40509 return blocks; 40510 } 40511 }, 40512 { 40513 type: "shortcode", 40514 tag: "caption", 40515 attributes: { 40516 url: { 40517 type: "string", 40518 source: "attribute", 40519 attribute: "src", 40520 selector: "img" 40521 }, 40522 alt: { 40523 type: "string", 40524 source: "attribute", 40525 attribute: "alt", 40526 selector: "img" 40527 }, 40528 caption: { 40529 shortcode: stripFirstImage 40530 }, 40531 href: { 40532 shortcode: (attributes2, { shortcode }) => { 40533 return getFirstAnchorAttributeFormHTML( 40534 shortcode.content, 40535 "href" 40536 ); 40537 } 40538 }, 40539 rel: { 40540 shortcode: (attributes2, { shortcode }) => { 40541 return getFirstAnchorAttributeFormHTML( 40542 shortcode.content, 40543 "rel" 40544 ); 40545 } 40546 }, 40547 linkClass: { 40548 shortcode: (attributes2, { shortcode }) => { 40549 return getFirstAnchorAttributeFormHTML( 40550 shortcode.content, 40551 "class" 40552 ); 40553 } 40554 }, 40555 id: { 40556 type: "number", 40557 shortcode: ({ named: { id } }) => { 40558 if (!id) { 40559 return; 40560 } 40561 return parseInt(id.replace("attachment_", ""), 10); 40562 } 40563 }, 40564 align: { 40565 type: "string", 40566 shortcode: ({ named: { align = "alignnone" } }) => { 40567 return align.replace("align", ""); 40568 } 40569 } 40570 } 40571 } 40572 ], 40573 to: [ 40574 { 40575 // Offer converting an animated GIF into the Video block's "GIF" 40576 // variation: a muted, looping, autoplaying video transcoded from 40577 // the GIF and sideloaded next to it when it was uploaded. Only 40578 // matches when that companion video exists, so ordinary images 40579 // never see this transform. 40580 type: "block", 40581 blocks: ["core/video"], 40582 isMatch: ({ id, url }) => !!getAnimatedGifVideoCompanion(id, url), 40583 transform(attributes2) { 40584 const { id, url, caption } = attributes2; 40585 const companion = getAnimatedGifVideoCompanion(id, url); 40586 return (0, import_blocks41.createBlock)("core/video", { 40587 ...getCarriedGifConversionAttributes(attributes2), 40588 id, 40589 src: companion.src, 40590 poster: companion.poster, 40591 caption, 40592 controls: false, 40593 loop: true, 40594 autoplay: true, 40595 muted: true, 40596 playsInline: true, 40597 /* 40598 * Carry the GIF's intrinsic dimensions so the <video> 40599 * keeps its aspect ratio from the first paint. Without 40600 * them the element collapses to the browser-default size 40601 * and then jumps once the poster/metadata load, which 40602 * shows up as a brief duplicated image during the swap. 40603 */ 40604 width: companion.width, 40605 height: companion.height 40606 }); 40607 } 40608 } 40609 ] 40610 }; 40611 var transforms_default14 = transforms13; 40612 40613 // packages/block-library/build-module/image/index.mjs 40614 var { fieldsKey: fieldsKey8, formKey: formKey8 } = unlock(import_blocks42.privateApis); 40615 var { name: name40 } = block_default40; 40616 var settings40 = { 40617 icon: image_default, 40618 example: { 40619 attributes: { 40620 sizeSlug: "large", 40621 url: "https://s.w.org/images/core/5.3/MtBlanc1.jpg", 40622 // translators: Caption accompanying an image of the Mont Blanc, which serves as an example for the Image block. 40623 caption: (0, import_i18n97.__)("Mont Blanc appears\u2014still, snowy, and serene.") 40624 } 40625 }, 40626 __experimentalLabel(attributes2, { context }) { 40627 const customName = attributes2?.metadata?.name; 40628 if ((context === "list-view" || context === "breadcrumb") && customName) { 40629 return customName; 40630 } 40631 if (context === "accessibility") { 40632 const { caption, alt, url } = attributes2; 40633 if (!url) { 40634 return (0, import_i18n97.__)("Empty"); 40635 } 40636 if (!alt) { 40637 return caption || ""; 40638 } 40639 return alt + (caption ? ". " + caption : ""); 40640 } 40641 }, 40642 getEditWrapperProps(attributes2) { 40643 return { 40644 "data-align": attributes2.align 40645 }; 40646 }, 40647 transforms: transforms_default14, 40648 edit: edit_default14, 40649 save: save22, 40650 deprecated: deprecated_default20 40651 }; 40652 if (window.__experimentalContentOnlyInspectorFields) { 40653 settings40[fieldsKey8] = [ 40654 { 40655 id: "image", 40656 label: (0, import_i18n97.__)("Image"), 40657 type: "media", 40658 Edit: { 40659 control: "media", 40660 // TODO: replace with custom component 40661 allowedTypes: ["image"], 40662 multiple: false 40663 }, 40664 getValue: ({ item }) => ({ 40665 id: item.id, 40666 url: item.url, 40667 alt: item.alt, 40668 caption: item.caption 40669 }), 40670 setValue: ({ value }) => ({ 40671 id: value.id, 40672 url: value.url, 40673 alt: value.alt, 40674 caption: value.caption 40675 }) 40676 }, 40677 { 40678 id: "link", 40679 label: (0, import_i18n97.__)("Link"), 40680 type: "url", 40681 Edit: "link", 40682 // TODO: replace with custom component 40683 getValue: ({ item }) => ({ 40684 url: item.href, 40685 rel: item.rel, 40686 linkTarget: item.linkTarget 40687 }), 40688 setValue: ({ value }) => ({ 40689 href: value.url, 40690 rel: value.rel, 40691 linkTarget: value.linkTarget 40692 }), 40693 isVisible: (item) => !item.isDecorative 40694 }, 40695 { 40696 id: "caption", 40697 label: (0, import_i18n97.__)("Caption"), 40698 type: "text", 40699 Edit: "rich-text", 40700 // TODO: replace with custom component 40701 isVisible: (item) => !item.isDecorative 40702 }, 40703 { 40704 id: "alt", 40705 label: (0, import_i18n97.__)("Alt text"), 40706 type: "text", 40707 isVisible: (item) => !item.isDecorative 40708 }, 40709 { 40710 id: "isDecorative", 40711 label: (0, import_i18n97.__)("Mark as decorative"), 40712 type: "boolean", 40713 setValue: ({ value }) => ({ 40714 isDecorative: value || void 0, 40715 ...value && { 40716 alt: "", 40717 caption: void 0, 40718 href: void 0, 40719 linkDestination: void 0, 40720 linkTarget: void 0, 40721 rel: void 0 40722 } 40723 }) 40724 } 40725 ]; 40726 settings40[formKey8] = { 40727 fields: ["image", "link", "caption", "alt", "isDecorative"] 40728 }; 40729 } 40730 var init40 = () => initBlock({ name: name40, metadata: block_default40, settings: settings40 }); 40731 40732 // packages/block-library/build-module/latest-comments/index.mjs 40733 var latest_comments_exports = {}; 40734 __export(latest_comments_exports, { 40735 init: () => init41, 40736 metadata: () => block_default41, 40737 name: () => name41, 40738 settings: () => settings41 40739 }); 40740 40741 // packages/block-library/build-module/latest-comments/block.json 40742 var block_default41 = { 40743 $schema: "https://schemas.wp.org/trunk/block.json", 40744 apiVersion: 3, 40745 name: "core/latest-comments", 40746 title: "Latest Comments", 40747 category: "widgets", 40748 description: "Display a list of your most recent comments.", 40749 keywords: ["recent comments"], 40750 textdomain: "default", 40751 attributes: { 40752 commentsToShow: { 40753 type: "number", 40754 default: 5, 40755 minimum: 1, 40756 maximum: 100 40757 }, 40758 displayAvatar: { 40759 type: "boolean", 40760 default: true 40761 }, 40762 displayDate: { 40763 type: "boolean", 40764 default: true 40765 }, 40766 displayContent: { 40767 type: "string", 40768 default: "excerpt", 40769 enum: ["none", "excerpt", "full"] 40770 } 40771 }, 40772 supports: { 40773 anchor: true, 40774 align: true, 40775 color: { 40776 gradients: true, 40777 link: true, 40778 __experimentalDefaultControls: { 40779 background: true, 40780 text: true, 40781 link: true 40782 } 40783 }, 40784 html: false, 40785 spacing: { 40786 margin: true, 40787 padding: true 40788 }, 40789 typography: { 40790 fontSize: true, 40791 lineHeight: true, 40792 __experimentalFontFamily: true, 40793 __experimentalFontWeight: true, 40794 __experimentalFontStyle: true, 40795 __experimentalTextTransform: true, 40796 __experimentalTextDecoration: true, 40797 __experimentalLetterSpacing: true, 40798 __experimentalDefaultControls: { 40799 fontSize: true 40800 } 40801 }, 40802 interactivity: { 40803 clientNavigation: true 40804 } 40805 }, 40806 style: "wp-block-latest-comments" 40807 }; 40808 40809 // packages/block-library/build-module/latest-comments/edit.mjs 40810 var import_block_editor109 = __toESM(require_block_editor(), 1); 40811 var import_components57 = __toESM(require_components(), 1); 40812 var import_i18n98 = __toESM(require_i18n(), 1); 40813 var import_server_side_render4 = __toESM(require_server_side_render(), 1); 40814 var import_compose29 = __toESM(require_compose(), 1); 40815 var import_jsx_runtime313 = __toESM(require_jsx_runtime(), 1); 40816 var MIN_COMMENTS = 1; 40817 var MAX_COMMENTS = 100; 40818 function LatestComments({ attributes: attributes2, setAttributes, name: name118 }) { 40819 const { commentsToShow, displayAvatar, displayDate, displayContent } = attributes2; 40820 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 40821 const { content, status, error: error2 } = (0, import_server_side_render4.useServerSideRender)({ 40822 attributes: attributes2, 40823 skipBlockSupportAttributes: true, 40824 block: name118, 40825 urlQueryArgs: { 40826 // The preview uses the site's locale to make it more true to how 40827 // the block appears on the frontend. Setting the locale 40828 // explicitly prevents any middleware from setting it to 'user'. 40829 _locale: "site" 40830 } 40831 }); 40832 const disabledRef = (0, import_compose29.useDisabled)(); 40833 const blockProps = (0, import_block_editor109.useBlockProps)({ ref: disabledRef }); 40834 return /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)(import_jsx_runtime313.Fragment, { children: [ 40835 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_block_editor109.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime313.jsxs)( 40836 import_components57.__experimentalToolsPanel, 40837 { 40838 label: (0, import_i18n98.__)("Settings"), 40839 resetAll: () => { 40840 setAttributes({ 40841 commentsToShow: 5, 40842 displayAvatar: true, 40843 displayDate: true, 40844 displayContent: "excerpt" 40845 }); 40846 }, 40847 dropdownMenuProps, 40848 children: [ 40849 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 40850 import_components57.__experimentalToolsPanelItem, 40851 { 40852 hasValue: () => !displayAvatar, 40853 label: (0, import_i18n98.__)("Display avatar"), 40854 onDeselect: () => setAttributes({ displayAvatar: true }), 40855 isShownByDefault: true, 40856 children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 40857 import_components57.ToggleControl, 40858 { 40859 label: (0, import_i18n98.__)("Display avatar"), 40860 checked: displayAvatar, 40861 onChange: () => setAttributes({ 40862 displayAvatar: !displayAvatar 40863 }) 40864 } 40865 ) 40866 } 40867 ), 40868 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 40869 import_components57.__experimentalToolsPanelItem, 40870 { 40871 hasValue: () => !displayDate, 40872 label: (0, import_i18n98.__)("Display date"), 40873 onDeselect: () => setAttributes({ displayDate: true }), 40874 isShownByDefault: true, 40875 children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 40876 import_components57.ToggleControl, 40877 { 40878 label: (0, import_i18n98.__)("Display date"), 40879 checked: displayDate, 40880 onChange: () => setAttributes({ displayDate: !displayDate }) 40881 } 40882 ) 40883 } 40884 ), 40885 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 40886 import_components57.__experimentalToolsPanelItem, 40887 { 40888 hasValue: () => displayContent !== "excerpt", 40889 label: (0, import_i18n98.__)("Display content"), 40890 onDeselect: () => setAttributes({ displayContent: "excerpt" }), 40891 isShownByDefault: true, 40892 children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 40893 import_components57.SelectControl, 40894 { 40895 label: (0, import_i18n98.__)("Display content"), 40896 value: displayContent, 40897 options: [ 40898 { label: (0, import_i18n98.__)("No content"), value: "none" }, 40899 { label: (0, import_i18n98.__)("Excerpt"), value: "excerpt" }, 40900 { label: (0, import_i18n98.__)("Full content"), value: "full" } 40901 ], 40902 onChange: (value) => setAttributes({ 40903 displayContent: value 40904 }) 40905 } 40906 ) 40907 } 40908 ), 40909 /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 40910 import_components57.__experimentalToolsPanelItem, 40911 { 40912 hasValue: () => commentsToShow !== 5, 40913 label: (0, import_i18n98.__)("Number of comments"), 40914 onDeselect: () => setAttributes({ commentsToShow: 5 }), 40915 isShownByDefault: true, 40916 children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)( 40917 import_components57.RangeControl, 40918 { 40919 label: (0, import_i18n98.__)("Number of comments"), 40920 value: commentsToShow, 40921 onChange: (value) => setAttributes({ commentsToShow: value }), 40922 min: MIN_COMMENTS, 40923 max: MAX_COMMENTS, 40924 required: true 40925 } 40926 ) 40927 } 40928 ) 40929 ] 40930 } 40931 ) }), 40932 status === "loading" && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(import_components57.Spinner, {}) }), 40933 status === "error" && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime313.jsx)("p", { children: (0, import_i18n98.sprintf)( 40934 /* translators: %s: error message returned when rendering the block. */ 40935 (0, import_i18n98.__)("Error: %s"), 40936 error2 40937 ) }) }), 40938 status === "success" && /* @__PURE__ */ (0, import_jsx_runtime313.jsx)(html_renderer_default, { wrapperProps: blockProps, html: content }) 40939 ] }); 40940 } 40941 40942 // packages/block-library/build-module/latest-comments/deprecated.mjs 40943 var v119 = { 40944 attributes: { 40945 commentsToShow: { 40946 type: "number", 40947 default: 5, 40948 minimum: 1, 40949 maximum: 100 40950 }, 40951 displayAvatar: { 40952 type: "boolean", 40953 default: true 40954 }, 40955 displayDate: { 40956 type: "boolean", 40957 default: true 40958 }, 40959 displayExcerpt: { 40960 type: "boolean", 40961 default: true 40962 } 40963 }, 40964 supports: { 40965 align: true, 40966 color: { 40967 gradients: true, 40968 link: true, 40969 __experimentalDefaultControls: { 40970 background: true, 40971 text: true, 40972 link: true 40973 } 40974 }, 40975 html: false, 40976 spacing: { 40977 margin: true, 40978 padding: true 40979 }, 40980 typography: { 40981 fontSize: true, 40982 lineHeight: true, 40983 __experimentalFontFamily: true, 40984 __experimentalFontWeight: true, 40985 __experimentalFontStyle: true, 40986 __experimentalTextTransform: true, 40987 __experimentalTextDecoration: true, 40988 __experimentalLetterSpacing: true, 40989 __experimentalDefaultControls: { 40990 fontSize: true 40991 } 40992 }, 40993 interactivity: { 40994 clientNavigation: true 40995 } 40996 }, 40997 isEligible(attributes2) { 40998 return attributes2?.displayExcerpt === false; 40999 }, 41000 migrate(attributes2) { 41001 return { 41002 ...attributes2, 41003 displayContent: attributes2.displayExcerpt ? "excerpt" : "none" 41004 }; 41005 } 41006 }; 41007 var deprecated_default21 = [v119]; 41008 41009 // packages/block-library/build-module/latest-comments/index.mjs 41010 var { name: name41 } = block_default41; 41011 var settings41 = { 41012 icon: comment_default, 41013 example: {}, 41014 edit: LatestComments, 41015 deprecated: deprecated_default21 41016 }; 41017 var init41 = () => initBlock({ name: name41, metadata: block_default41, settings: settings41 }); 41018 41019 // packages/block-library/build-module/latest-posts/index.mjs 41020 var latest_posts_exports = {}; 41021 __export(latest_posts_exports, { 41022 init: () => init42, 41023 metadata: () => block_default42, 41024 name: () => name42, 41025 settings: () => settings42 41026 }); 41027 41028 // packages/block-library/build-module/latest-posts/block.json 41029 var block_default42 = { 41030 $schema: "https://schemas.wp.org/trunk/block.json", 41031 apiVersion: 3, 41032 name: "core/latest-posts", 41033 title: "Latest Posts", 41034 category: "widgets", 41035 description: "Display a list of your most recent posts.", 41036 keywords: ["recent posts"], 41037 textdomain: "default", 41038 attributes: { 41039 categories: { 41040 type: "array", 41041 items: { 41042 type: "object" 41043 } 41044 }, 41045 selectedAuthor: { 41046 type: "number" 41047 }, 41048 postsToShow: { 41049 type: "number", 41050 default: 5 41051 }, 41052 displayPostContent: { 41053 type: "boolean", 41054 default: false 41055 }, 41056 displayPostContentRadio: { 41057 type: "string", 41058 default: "excerpt" 41059 }, 41060 excerptLength: { 41061 type: "number", 41062 default: 55 41063 }, 41064 displayAuthor: { 41065 type: "boolean", 41066 default: false 41067 }, 41068 displayPostDate: { 41069 type: "boolean", 41070 default: false 41071 }, 41072 order: { 41073 type: "string", 41074 default: "desc" 41075 }, 41076 orderBy: { 41077 type: "string", 41078 default: "date" 41079 }, 41080 displayFeaturedImage: { 41081 type: "boolean", 41082 default: false 41083 }, 41084 featuredImageAlign: { 41085 type: "string", 41086 enum: ["left", "center", "right"] 41087 }, 41088 featuredImageSizeSlug: { 41089 type: "string", 41090 default: "thumbnail" 41091 }, 41092 featuredImageSizeWidth: { 41093 type: "number", 41094 default: null 41095 }, 41096 featuredImageSizeHeight: { 41097 type: "number", 41098 default: null 41099 }, 41100 addLinkToFeaturedImage: { 41101 type: "boolean", 41102 default: false 41103 } 41104 }, 41105 supports: { 41106 anchor: true, 41107 align: true, 41108 html: false, 41109 layout: true, 41110 color: { 41111 gradients: true, 41112 link: true, 41113 __experimentalDefaultControls: { 41114 background: true, 41115 text: true, 41116 link: true 41117 } 41118 }, 41119 spacing: { 41120 margin: true, 41121 padding: true, 41122 blockGap: { 41123 __experimentalDefault: "1.25em" 41124 }, 41125 __experimentalDefaultControls: { 41126 blockGap: true 41127 } 41128 }, 41129 typography: { 41130 fontSize: true, 41131 lineHeight: true, 41132 __experimentalFontFamily: true, 41133 __experimentalFontWeight: true, 41134 __experimentalFontStyle: true, 41135 __experimentalTextTransform: true, 41136 __experimentalTextDecoration: true, 41137 __experimentalLetterSpacing: true, 41138 __experimentalDefaultControls: { 41139 fontSize: true 41140 } 41141 }, 41142 __experimentalBorder: { 41143 radius: true, 41144 color: true, 41145 width: true, 41146 style: true, 41147 __experimentalDefaultControls: { 41148 radius: true, 41149 color: true, 41150 width: true, 41151 style: true 41152 } 41153 }, 41154 interactivity: { 41155 clientNavigation: true 41156 } 41157 }, 41158 editorStyle: "wp-block-latest-posts-editor", 41159 style: "wp-block-latest-posts" 41160 }; 41161 41162 // packages/block-library/build-module/latest-posts/deprecated.mjs 41163 var currentSupports = { 41164 anchor: true, 41165 align: true, 41166 color: { 41167 gradients: true, 41168 link: true, 41169 __experimentalDefaultControls: { 41170 background: true, 41171 text: true, 41172 link: true 41173 } 41174 }, 41175 html: false, 41176 layout: true, 41177 spacing: { 41178 margin: true, 41179 padding: true, 41180 blockGap: { 41181 __experimentalDefault: "1.25em" 41182 }, 41183 __experimentalDefaultControls: { 41184 blockGap: true 41185 } 41186 }, 41187 typography: { 41188 fontSize: true, 41189 lineHeight: true, 41190 __experimentalFontFamily: true, 41191 __experimentalFontWeight: true, 41192 __experimentalFontStyle: true, 41193 __experimentalTextTransform: true, 41194 __experimentalTextDecoration: true, 41195 __experimentalLetterSpacing: true, 41196 __experimentalDefaultControls: { 41197 fontSize: true 41198 } 41199 }, 41200 __experimentalBorder: { 41201 radius: true, 41202 color: true, 41203 width: true, 41204 style: true, 41205 __experimentalDefaultControls: { 41206 radius: true, 41207 color: true, 41208 width: true, 41209 style: true 41210 } 41211 }, 41212 interactivity: { 41213 clientNavigation: true 41214 } 41215 }; 41216 var legacyLayoutAttributes = { 41217 postLayout: { 41218 type: "string", 41219 default: "list" 41220 }, 41221 columns: { 41222 type: "number", 41223 default: 3 41224 } 41225 }; 41226 var migrateCategories = (oldAttributes) => { 41227 if (!oldAttributes.categories || "string" !== typeof oldAttributes.categories) { 41228 return oldAttributes; 41229 } 41230 return { 41231 ...oldAttributes, 41232 categories: [{ id: Number(oldAttributes.categories) }] 41233 }; 41234 }; 41235 var migratePostLayout = (oldAttributes) => { 41236 const { postLayout, columns, ...attributesWithoutLegacyLayout } = oldAttributes; 41237 if (!postLayout) { 41238 return oldAttributes; 41239 } 41240 return { 41241 ...attributesWithoutLegacyLayout, 41242 layout: { 41243 type: postLayout === "grid" ? "grid" : "default", 41244 ...postLayout === "grid" && columns && { columnCount: columns } 41245 } 41246 }; 41247 }; 41248 var deprecated_default22 = [ 41249 { 41250 attributes: { 41251 ...block_default42.attributes, 41252 ...legacyLayoutAttributes, 41253 categories: { 41254 type: ["array", "string"] 41255 } 41256 }, 41257 supports: currentSupports, 41258 migrate: (oldAttributes) => migratePostLayout(migrateCategories(oldAttributes)), 41259 isEligible: ({ postLayout }) => postLayout, 41260 save: () => null 41261 }, 41262 { 41263 attributes: { 41264 ...block_default42.attributes, 41265 categories: { 41266 type: "string" 41267 } 41268 }, 41269 supports: { 41270 align: true, 41271 html: false 41272 }, 41273 migrate: migrateCategories, 41274 isEligible: ({ categories }) => categories && "string" === typeof categories, 41275 save: () => null 41276 } 41277 ]; 41278 41279 // packages/block-library/build-module/latest-posts/edit.mjs 41280 var import_components58 = __toESM(require_components(), 1); 41281 var import_i18n99 = __toESM(require_i18n(), 1); 41282 var import_date2 = __toESM(require_date(), 1); 41283 var import_block_editor110 = __toESM(require_block_editor(), 1); 41284 var import_data52 = __toESM(require_data(), 1); 41285 var import_core_data28 = __toESM(require_core_data(), 1); 41286 var import_notices9 = __toESM(require_notices(), 1); 41287 var import_compose30 = __toESM(require_compose(), 1); 41288 var import_element75 = __toESM(require_element(), 1); 41289 41290 // packages/block-library/build-module/latest-posts/constants.mjs 41291 var MIN_EXCERPT_LENGTH = 10; 41292 var MAX_EXCERPT_LENGTH = 100; 41293 var DEFAULT_EXCERPT_LENGTH = 55; 41294 41295 // packages/block-library/build-module/latest-posts/edit.mjs 41296 var import_jsx_runtime314 = __toESM(require_jsx_runtime(), 1); 41297 var CATEGORIES_LIST_QUERY = { 41298 per_page: -1, 41299 _fields: "id,name", 41300 context: "view" 41301 }; 41302 var USERS_LIST_QUERY = { 41303 per_page: -1, 41304 has_published_posts: ["post"], 41305 context: "view" 41306 }; 41307 var imageAlignmentOptions = [ 41308 { 41309 value: "none", 41310 icon: align_none_default, 41311 label: (0, import_i18n99.__)("None") 41312 }, 41313 { 41314 value: "left", 41315 icon: position_left_default, 41316 label: (0, import_i18n99.__)("Left") 41317 }, 41318 { 41319 value: "center", 41320 icon: position_center_default, 41321 label: (0, import_i18n99.__)("Center") 41322 }, 41323 { 41324 value: "right", 41325 icon: position_right_default, 41326 label: (0, import_i18n99.__)("Right") 41327 } 41328 ]; 41329 function getFeaturedImageDetails(post, size) { 41330 const image = post._embedded?.["wp:featuredmedia"]?.["0"]; 41331 return { 41332 url: image?.media_details?.sizes?.[size]?.source_url ?? image?.source_url, 41333 alt: image?.alt_text 41334 }; 41335 } 41336 function getCurrentAuthor(post) { 41337 return post._embedded?.author?.[0]; 41338 } 41339 function Controls({ attributes: attributes2, setAttributes }) { 41340 const { 41341 postsToShow, 41342 order, 41343 orderBy, 41344 categories, 41345 selectedAuthor, 41346 displayFeaturedImage, 41347 displayPostContentRadio, 41348 displayPostContent, 41349 displayPostDate, 41350 displayAuthor, 41351 excerptLength, 41352 featuredImageAlign, 41353 featuredImageSizeSlug, 41354 featuredImageSizeWidth, 41355 featuredImageSizeHeight, 41356 addLinkToFeaturedImage 41357 } = attributes2; 41358 const { 41359 imageSizes, 41360 defaultImageWidth, 41361 defaultImageHeight, 41362 categoriesList, 41363 authorList 41364 } = (0, import_data52.useSelect)( 41365 (select10) => { 41366 const { getEntityRecords, getUsers } = select10(import_core_data28.store); 41367 const settings117 = select10(import_block_editor110.store).getSettings(); 41368 return { 41369 defaultImageWidth: settings117.imageDimensions?.[featuredImageSizeSlug]?.width ?? 0, 41370 defaultImageHeight: settings117.imageDimensions?.[featuredImageSizeSlug]?.height ?? 0, 41371 imageSizes: settings117.imageSizes, 41372 categoriesList: getEntityRecords( 41373 "taxonomy", 41374 "category", 41375 CATEGORIES_LIST_QUERY 41376 ), 41377 authorList: getUsers(USERS_LIST_QUERY) 41378 }; 41379 }, 41380 [featuredImageSizeSlug] 41381 ); 41382 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 41383 const imageSizeOptions = imageSizes.filter(({ slug }) => slug !== "full").map(({ name: name118, slug }) => ({ 41384 value: slug, 41385 label: name118 41386 })); 41387 const categorySuggestions = categoriesList?.reduce((accumulator, category) => { 41388 accumulator[category.name] = category; 41389 return accumulator; 41390 }, {}) ?? {}; 41391 const selectCategories = (tokens) => { 41392 const hasNoSuggestion = tokens.some( 41393 (token) => typeof token === "string" && !categorySuggestions[token] 41394 ); 41395 if (hasNoSuggestion) { 41396 return; 41397 } 41398 const allCategories = tokens.map((token) => { 41399 return typeof token === "string" ? categorySuggestions[token] : token; 41400 }); 41401 if (allCategories.includes(null)) { 41402 return false; 41403 } 41404 setAttributes({ categories: allCategories }); 41405 }; 41406 return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_jsx_runtime314.Fragment, { children: [ 41407 /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)( 41408 import_components58.__experimentalToolsPanel, 41409 { 41410 label: (0, import_i18n99.__)("Post content"), 41411 resetAll: () => setAttributes({ 41412 displayPostContent: false, 41413 displayPostContentRadio: "excerpt", 41414 excerptLength: DEFAULT_EXCERPT_LENGTH 41415 }), 41416 dropdownMenuProps, 41417 children: [ 41418 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41419 import_components58.__experimentalToolsPanelItem, 41420 { 41421 hasValue: () => !!displayPostContent, 41422 label: (0, import_i18n99.__)("Display post content"), 41423 onDeselect: () => setAttributes({ displayPostContent: false }), 41424 isShownByDefault: true, 41425 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41426 import_components58.ToggleControl, 41427 { 41428 label: (0, import_i18n99.__)("Display post content"), 41429 checked: displayPostContent, 41430 onChange: (value) => setAttributes({ displayPostContent: value }) 41431 } 41432 ) 41433 } 41434 ), 41435 displayPostContent && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41436 import_components58.__experimentalToolsPanelItem, 41437 { 41438 hasValue: () => displayPostContentRadio !== "excerpt", 41439 label: (0, import_i18n99.__)("Content length"), 41440 onDeselect: () => setAttributes({ 41441 displayPostContentRadio: "excerpt" 41442 }), 41443 isShownByDefault: true, 41444 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41445 import_components58.RadioControl, 41446 { 41447 label: (0, import_i18n99.__)("Content length"), 41448 selected: displayPostContentRadio, 41449 options: [ 41450 { label: (0, import_i18n99.__)("Excerpt"), value: "excerpt" }, 41451 { 41452 label: (0, import_i18n99.__)("Full post"), 41453 value: "full_post" 41454 } 41455 ], 41456 onChange: (value) => setAttributes({ 41457 displayPostContentRadio: value 41458 }) 41459 } 41460 ) 41461 } 41462 ), 41463 displayPostContent && displayPostContentRadio === "excerpt" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41464 import_components58.__experimentalToolsPanelItem, 41465 { 41466 hasValue: () => excerptLength !== DEFAULT_EXCERPT_LENGTH, 41467 label: (0, import_i18n99.__)("Max number of words"), 41468 onDeselect: () => setAttributes({ 41469 excerptLength: DEFAULT_EXCERPT_LENGTH 41470 }), 41471 isShownByDefault: true, 41472 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41473 import_components58.RangeControl, 41474 { 41475 label: (0, import_i18n99.__)("Max number of words"), 41476 value: excerptLength, 41477 onChange: (value) => setAttributes({ excerptLength: value }), 41478 min: MIN_EXCERPT_LENGTH, 41479 max: MAX_EXCERPT_LENGTH 41480 } 41481 ) 41482 } 41483 ) 41484 ] 41485 } 41486 ), 41487 /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)( 41488 import_components58.__experimentalToolsPanel, 41489 { 41490 label: (0, import_i18n99.__)("Post meta"), 41491 resetAll: () => setAttributes({ 41492 displayAuthor: false, 41493 displayPostDate: false 41494 }), 41495 dropdownMenuProps, 41496 children: [ 41497 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41498 import_components58.__experimentalToolsPanelItem, 41499 { 41500 hasValue: () => !!displayAuthor, 41501 label: (0, import_i18n99.__)("Display author name"), 41502 onDeselect: () => setAttributes({ displayAuthor: false }), 41503 isShownByDefault: true, 41504 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41505 import_components58.ToggleControl, 41506 { 41507 label: (0, import_i18n99.__)("Display author name"), 41508 checked: displayAuthor, 41509 onChange: (value) => setAttributes({ displayAuthor: value }) 41510 } 41511 ) 41512 } 41513 ), 41514 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41515 import_components58.__experimentalToolsPanelItem, 41516 { 41517 hasValue: () => !!displayPostDate, 41518 label: (0, import_i18n99.__)("Display post date"), 41519 onDeselect: () => setAttributes({ displayPostDate: false }), 41520 isShownByDefault: true, 41521 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41522 import_components58.ToggleControl, 41523 { 41524 label: (0, import_i18n99.__)("Display post date"), 41525 checked: displayPostDate, 41526 onChange: (value) => setAttributes({ displayPostDate: value }) 41527 } 41528 ) 41529 } 41530 ) 41531 ] 41532 } 41533 ), 41534 /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)( 41535 import_components58.__experimentalToolsPanel, 41536 { 41537 label: (0, import_i18n99.__)("Featured image"), 41538 resetAll: () => setAttributes({ 41539 displayFeaturedImage: false, 41540 featuredImageAlign: void 0, 41541 featuredImageSizeSlug: "thumbnail", 41542 featuredImageSizeWidth: null, 41543 featuredImageSizeHeight: null, 41544 addLinkToFeaturedImage: false 41545 }), 41546 dropdownMenuProps, 41547 children: [ 41548 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41549 import_components58.__experimentalToolsPanelItem, 41550 { 41551 hasValue: () => !!displayFeaturedImage, 41552 label: (0, import_i18n99.__)("Display featured image"), 41553 onDeselect: () => setAttributes({ displayFeaturedImage: false }), 41554 isShownByDefault: true, 41555 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41556 import_components58.ToggleControl, 41557 { 41558 label: (0, import_i18n99.__)("Display featured image"), 41559 checked: displayFeaturedImage, 41560 onChange: (value) => setAttributes({ displayFeaturedImage: value }) 41561 } 41562 ) 41563 } 41564 ), 41565 displayFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_jsx_runtime314.Fragment, { children: [ 41566 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41567 import_components58.__experimentalToolsPanelItem, 41568 { 41569 hasValue: () => featuredImageSizeSlug !== "thumbnail" || featuredImageSizeWidth !== null || featuredImageSizeHeight !== null, 41570 label: (0, import_i18n99.__)("Image size"), 41571 onDeselect: () => setAttributes({ 41572 featuredImageSizeSlug: "thumbnail", 41573 featuredImageSizeWidth: null, 41574 featuredImageSizeHeight: null 41575 }), 41576 isShownByDefault: true, 41577 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41578 import_block_editor110.__experimentalImageSizeControl, 41579 { 41580 onChange: (value) => { 41581 const newAttrs = {}; 41582 if (value.hasOwnProperty("width")) { 41583 newAttrs.featuredImageSizeWidth = value.width; 41584 } 41585 if (value.hasOwnProperty("height")) { 41586 newAttrs.featuredImageSizeHeight = value.height; 41587 } 41588 setAttributes(newAttrs); 41589 }, 41590 slug: featuredImageSizeSlug, 41591 width: featuredImageSizeWidth, 41592 height: featuredImageSizeHeight, 41593 imageWidth: defaultImageWidth, 41594 imageHeight: defaultImageHeight, 41595 imageSizeOptions, 41596 imageSizeHelp: (0, import_i18n99.__)( 41597 "Select the size of the source image." 41598 ), 41599 onChangeImage: (value) => setAttributes({ 41600 featuredImageSizeSlug: value, 41601 featuredImageSizeWidth: void 0, 41602 featuredImageSizeHeight: void 0 41603 }) 41604 } 41605 ) 41606 } 41607 ), 41608 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41609 import_components58.__experimentalToolsPanelItem, 41610 { 41611 hasValue: () => !!featuredImageAlign, 41612 label: (0, import_i18n99.__)("Image alignment"), 41613 onDeselect: () => setAttributes({ 41614 featuredImageAlign: void 0 41615 }), 41616 isShownByDefault: true, 41617 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41618 import_components58.__experimentalToggleGroupControl, 41619 { 41620 className: "editor-latest-posts-image-alignment-control", 41621 label: (0, import_i18n99.__)("Image alignment"), 41622 value: featuredImageAlign || "none", 41623 onChange: (value) => setAttributes({ 41624 featuredImageAlign: value !== "none" ? value : void 0 41625 }), 41626 children: imageAlignmentOptions.map( 41627 ({ value, icon: icon2, label }) => { 41628 return /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41629 import_components58.__experimentalToggleGroupControlOptionIcon, 41630 { 41631 value, 41632 icon: icon2, 41633 label 41634 }, 41635 value 41636 ); 41637 } 41638 ) 41639 } 41640 ) 41641 } 41642 ), 41643 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41644 import_components58.__experimentalToolsPanelItem, 41645 { 41646 hasValue: () => !!addLinkToFeaturedImage, 41647 label: (0, import_i18n99.__)("Add link to featured image"), 41648 onDeselect: () => setAttributes({ 41649 addLinkToFeaturedImage: false 41650 }), 41651 isShownByDefault: true, 41652 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41653 import_components58.ToggleControl, 41654 { 41655 label: (0, import_i18n99.__)("Add link to featured image"), 41656 checked: addLinkToFeaturedImage, 41657 onChange: (value) => setAttributes({ 41658 addLinkToFeaturedImage: value 41659 }) 41660 } 41661 ) 41662 } 41663 ) 41664 ] }) 41665 ] 41666 } 41667 ), 41668 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41669 import_components58.__experimentalToolsPanel, 41670 { 41671 label: (0, import_i18n99.__)("Sorting and filtering"), 41672 resetAll: () => setAttributes({ 41673 order: "desc", 41674 orderBy: "date", 41675 postsToShow: 5, 41676 categories: void 0, 41677 selectedAuthor: void 0 41678 }), 41679 dropdownMenuProps, 41680 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41681 import_components58.__experimentalToolsPanelItem, 41682 { 41683 hasValue: () => order !== "desc" || orderBy !== "date" || postsToShow !== 5 || categories?.length > 0 || !!selectedAuthor, 41684 label: (0, import_i18n99.__)("Sort and filter"), 41685 onDeselect: () => setAttributes({ 41686 order: "desc", 41687 orderBy: "date", 41688 postsToShow: 5, 41689 categories: void 0, 41690 selectedAuthor: void 0 41691 }), 41692 isShownByDefault: true, 41693 children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41694 import_components58.QueryControls, 41695 { 41696 ...{ order, orderBy }, 41697 numberOfItems: postsToShow, 41698 onOrderChange: (value) => setAttributes({ order: value }), 41699 onOrderByChange: (value) => setAttributes({ orderBy: value }), 41700 onNumberOfItemsChange: (value) => setAttributes({ postsToShow: value }), 41701 categorySuggestions, 41702 onCategoryChange: selectCategories, 41703 selectedCategories: categories, 41704 onAuthorChange: (value) => setAttributes({ 41705 selectedAuthor: "" !== value ? Number(value) : void 0 41706 }), 41707 authorList: authorList ?? [], 41708 selectedAuthorId: selectedAuthor 41709 } 41710 ) 41711 } 41712 ) 41713 } 41714 ) 41715 ] }); 41716 } 41717 function LatestPostsEdit({ 41718 attributes: attributes2, 41719 setAttributes, 41720 __unstableLayoutClassNames 41721 }) { 41722 const instanceId = (0, import_compose30.useInstanceId)(LatestPostsEdit); 41723 const { 41724 postsToShow, 41725 order, 41726 orderBy, 41727 categories, 41728 selectedAuthor, 41729 displayFeaturedImage, 41730 displayPostContentRadio, 41731 displayPostContent, 41732 displayPostDate, 41733 displayAuthor, 41734 layout, 41735 postLayout, 41736 columns, 41737 excerptLength, 41738 featuredImageAlign, 41739 featuredImageSizeSlug, 41740 featuredImageSizeWidth, 41741 featuredImageSizeHeight, 41742 addLinkToFeaturedImage 41743 } = attributes2; 41744 const { type: savedLayoutType, minimumColumnWidth } = layout || {}; 41745 const layoutType = savedLayoutType || (postLayout === "grid" ? "grid" : "default"); 41746 const columnCount = layout?.columnCount ?? (!savedLayoutType ? columns : void 0) ?? 3; 41747 const { latestPosts } = (0, import_data52.useSelect)( 41748 (select10) => { 41749 const { getEntityRecords } = select10(import_core_data28.store); 41750 const catIds = categories && categories.length > 0 ? categories.map((cat) => cat.id) : []; 41751 const latestPostsQuery = Object.fromEntries( 41752 Object.entries({ 41753 categories: catIds, 41754 author: selectedAuthor, 41755 order, 41756 orderby: orderBy, 41757 per_page: postsToShow, 41758 _embed: "author,wp:featuredmedia", 41759 ignore_sticky: true 41760 }).filter(([, value]) => typeof value !== "undefined") 41761 ); 41762 return { 41763 latestPosts: getEntityRecords( 41764 "postType", 41765 "post", 41766 latestPostsQuery 41767 ) 41768 }; 41769 }, 41770 [postsToShow, order, orderBy, categories, selectedAuthor] 41771 ); 41772 const { createWarningNotice } = (0, import_data52.useDispatch)(import_notices9.store); 41773 const showRedirectionPreventedNotice = (event) => { 41774 event.preventDefault(); 41775 createWarningNotice((0, import_i18n99.__)("Links are disabled in the editor."), { 41776 id: `block-library/core/latest-posts/redirection-prevented/$instanceId}`, 41777 type: "snackbar" 41778 }); 41779 }; 41780 const hasPosts = !!latestPosts?.length; 41781 const inspectorControls = /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(import_block_editor110.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41782 Controls, 41783 { 41784 attributes: attributes2, 41785 setAttributes 41786 } 41787 ) }); 41788 const blockProps = (0, import_block_editor110.useBlockProps)({ 41789 className: clsx_default(__unstableLayoutClassNames, { 41790 "wp-block-latest-posts__list": true, 41791 "is-grid": layoutType === "grid", 41792 "has-dates": displayPostDate, 41793 "has-author": displayAuthor, 41794 [`columns-$columnCount}`]: layoutType === "grid" && columnCount, 41795 "has-native-responsive-grid": layoutType === "grid" && columnCount && minimumColumnWidth 41796 }) 41797 }); 41798 if (!hasPosts) { 41799 return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("div", { ...blockProps, children: [ 41800 inspectorControls, 41801 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(import_components58.Placeholder, { icon: pin_default, label: (0, import_i18n99.__)("Latest Posts"), children: !Array.isArray(latestPosts) ? /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(import_components58.Spinner, {}) : (0, import_i18n99.__)("No posts found.") }) 41802 ] }); 41803 } 41804 const displayPosts = latestPosts.length > postsToShow ? latestPosts.slice(0, postsToShow) : latestPosts; 41805 const setDisplayLayout = (newDisplayLayout) => setAttributes({ 41806 layout: { ...layout, ...newDisplayLayout }, 41807 postLayout: void 0, 41808 columns: void 0 41809 }); 41810 const layoutControls = [ 41811 { 41812 icon: list_default, 41813 title: (0, import_i18n99._x)("List view", "Latest posts block display setting"), 41814 onClick: () => setDisplayLayout({ type: "default" }), 41815 isActive: layoutType === "default" || layoutType === "constrained" 41816 }, 41817 { 41818 icon: grid_default, 41819 title: (0, import_i18n99._x)("Grid view", "Latest posts block display setting"), 41820 onClick: () => setDisplayLayout({ 41821 type: "grid", 41822 columnCount 41823 }), 41824 isActive: layoutType === "grid" 41825 } 41826 ]; 41827 const dateFormat = (0, import_date2.getSettings)().formats.date; 41828 return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_jsx_runtime314.Fragment, { children: [ 41829 inspectorControls, 41830 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(import_block_editor110.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)(import_components58.ToolbarGroup, { controls: layoutControls }) }), 41831 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("ul", { ...blockProps, children: displayPosts.map((post) => { 41832 const titleTrimmed = post.title.rendered.trim(); 41833 let excerpt = post.excerpt.rendered; 41834 const currentAuthor = getCurrentAuthor(post); 41835 const excerptElement = document.createElement("div"); 41836 excerptElement.innerHTML = excerpt; 41837 excerpt = excerptElement.textContent || excerptElement.innerText || ""; 41838 const { url: imageSourceUrl, alt: featuredImageAlt } = getFeaturedImageDetails(post, featuredImageSizeSlug); 41839 const imageClasses = clsx_default({ 41840 "wp-block-latest-posts__featured-image": true, 41841 [`align${featuredImageAlign}`]: !!featuredImageAlign 41842 }); 41843 const renderFeaturedImage = displayFeaturedImage && imageSourceUrl; 41844 const featuredImage = renderFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41845 "img", 41846 { 41847 src: imageSourceUrl, 41848 alt: featuredImageAlt, 41849 style: { 41850 maxWidth: featuredImageSizeWidth, 41851 maxHeight: featuredImageSizeHeight 41852 } 41853 } 41854 ); 41855 const needsReadMore = excerptLength < excerpt.trim().split(" ").length && post.excerpt.raw === ""; 41856 const postExcerpt = needsReadMore ? /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)(import_jsx_runtime314.Fragment, { children: [ 41857 excerpt.trim().split(" ", excerptLength).join(" "), 41858 (0, import_element75.createInterpolateElement)( 41859 (0, import_i18n99.sprintf)( 41860 /* translators: 1: Hidden accessibility text: Post title */ 41861 (0, import_i18n99.__)( 41862 "\u2026 <a>Read more<span>: %1$s</span></a>" 41863 ), 41864 titleTrimmed || (0, import_i18n99.__)("(no title)") 41865 ), 41866 { 41867 a: ( 41868 // eslint-disable-next-line jsx-a11y/anchor-has-content 41869 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41870 "a", 41871 { 41872 className: "wp-block-latest-posts__read-more", 41873 href: post.link, 41874 rel: "noopener", 41875 onClick: showRedirectionPreventedNotice 41876 } 41877 ) 41878 ), 41879 span: /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("span", { className: "screen-reader-text" }) 41880 } 41881 ) 41882 ] }) : excerpt; 41883 return /* @__PURE__ */ (0, import_jsx_runtime314.jsxs)("li", { children: [ 41884 renderFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: imageClasses, children: addLinkToFeaturedImage ? /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41885 "a", 41886 { 41887 href: post.link, 41888 onClick: showRedirectionPreventedNotice, 41889 children: featuredImage 41890 } 41891 ) : featuredImage }), 41892 /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41893 "a", 41894 { 41895 className: "wp-block-latest-posts__post-title", 41896 href: post.link, 41897 dangerouslySetInnerHTML: !!titleTrimmed ? { 41898 __html: titleTrimmed 41899 } : void 0, 41900 onClick: showRedirectionPreventedNotice, 41901 children: !titleTrimmed ? (0, import_i18n99.__)("(no title)") : null 41902 } 41903 ), 41904 displayAuthor && currentAuthor && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "wp-block-latest-posts__post-author", children: (0, import_i18n99.sprintf)( 41905 /* translators: byline. %s: author. */ 41906 (0, import_i18n99.__)("by %s"), 41907 currentAuthor.name 41908 ) }), 41909 displayPostDate && post.date_gmt && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41910 "time", 41911 { 41912 dateTime: (0, import_date2.format)("c", post.date_gmt), 41913 className: "wp-block-latest-posts__post-date", 41914 children: (0, import_date2.dateI18n)(dateFormat, post.date_gmt) 41915 } 41916 ), 41917 displayPostContent && displayPostContentRadio === "excerpt" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)("div", { className: "wp-block-latest-posts__post-excerpt", children: postExcerpt }), 41918 displayPostContent && displayPostContentRadio === "full_post" && /* @__PURE__ */ (0, import_jsx_runtime314.jsx)( 41919 "div", 41920 { 41921 className: "wp-block-latest-posts__post-full-content", 41922 dangerouslySetInnerHTML: { 41923 __html: post.content.rendered.trim() 41924 } 41925 } 41926 ) 41927 ] }, post.id); 41928 }) }) 41929 ] }); 41930 } 41931 41932 // packages/block-library/build-module/latest-posts/index.mjs 41933 var { name: name42 } = block_default42; 41934 var settings42 = { 41935 icon: post_list_default, 41936 example: {}, 41937 edit: LatestPostsEdit, 41938 deprecated: deprecated_default22 41939 }; 41940 var init42 = () => initBlock({ name: name42, metadata: block_default42, settings: settings42 }); 41941 41942 // packages/block-library/build-module/list/index.mjs 41943 var list_exports = {}; 41944 __export(list_exports, { 41945 init: () => init43, 41946 metadata: () => block_default43, 41947 name: () => name43, 41948 settings: () => settings43 41949 }); 41950 var import_i18n102 = __toESM(require_i18n(), 1); 41951 41952 // packages/block-library/build-module/list/deprecated.mjs 41953 var import_block_editor111 = __toESM(require_block_editor(), 1); 41954 41955 // packages/block-library/build-module/list/utils.mjs 41956 var import_blocks43 = __toESM(require_blocks(), 1); 41957 var LIST_STYLES = { 41958 A: "upper-alpha", 41959 a: "lower-alpha", 41960 I: "upper-roman", 41961 i: "lower-roman" 41962 }; 41963 function createListBlockFromDOMElement(listElement) { 41964 const type = listElement.getAttribute("type"); 41965 const listAttributes = { 41966 ordered: "OL" === listElement.tagName, 41967 anchor: listElement.id ? listElement.id : void 0, 41968 start: listElement.getAttribute("start") ? parseInt(listElement.getAttribute("start"), 10) : void 0, 41969 reversed: listElement.hasAttribute("reversed") ? true : void 0, 41970 type: type && LIST_STYLES[type] ? LIST_STYLES[type] : void 0 41971 }; 41972 const innerBlocks = Array.from(listElement.children).map( 41973 (listItem) => { 41974 const children = Array.from(listItem.childNodes).filter( 41975 (node) => node.nodeType !== node.TEXT_NODE || node.textContent.trim().length !== 0 41976 ); 41977 children.reverse(); 41978 const [nestedList, ...nodes] = children; 41979 const hasNestedList = nestedList?.tagName === "UL" || nestedList?.tagName === "OL"; 41980 if (!hasNestedList) { 41981 return (0, import_blocks43.createBlock)("core/list-item", { 41982 content: listItem.innerHTML 41983 }); 41984 } 41985 const htmlNodes = nodes.map((node) => { 41986 if (node.nodeType === node.TEXT_NODE) { 41987 return node.textContent; 41988 } 41989 return node.outerHTML; 41990 }); 41991 htmlNodes.reverse(); 41992 const childAttributes = { 41993 content: htmlNodes.join("").trim() 41994 }; 41995 const childInnerBlocks = [ 41996 createListBlockFromDOMElement(nestedList) 41997 ]; 41998 return (0, import_blocks43.createBlock)( 41999 "core/list-item", 42000 childAttributes, 42001 childInnerBlocks 42002 ); 42003 } 42004 ); 42005 return (0, import_blocks43.createBlock)("core/list", listAttributes, innerBlocks); 42006 } 42007 function migrateToListV2(attributes2) { 42008 const { values, start, reversed, ordered, type, ...otherAttributes } = attributes2; 42009 const list = document.createElement(ordered ? "ol" : "ul"); 42010 list.innerHTML = values; 42011 if (start) { 42012 list.setAttribute("start", start); 42013 } 42014 if (reversed) { 42015 list.setAttribute("reversed", true); 42016 } 42017 if (type) { 42018 list.setAttribute("type", type); 42019 } 42020 const [listBlock] = (0, import_blocks43.rawHandler)({ HTML: list.outerHTML }); 42021 return [ 42022 { ...otherAttributes, ...listBlock.attributes }, 42023 listBlock.innerBlocks 42024 ]; 42025 } 42026 function migrateTypeToInlineStyle(attributes2) { 42027 const { type } = attributes2; 42028 if (type && LIST_STYLES[type]) { 42029 return { 42030 ...attributes2, 42031 type: LIST_STYLES[type] 42032 }; 42033 } 42034 return attributes2; 42035 } 42036 42037 // packages/block-library/build-module/list/deprecated.mjs 42038 var import_jsx_runtime315 = __toESM(require_jsx_runtime(), 1); 42039 var v0 = { 42040 attributes: { 42041 ordered: { 42042 type: "boolean", 42043 default: false, 42044 role: "content" 42045 }, 42046 values: { 42047 type: "string", 42048 source: "html", 42049 selector: "ol,ul", 42050 multiline: "li", 42051 __unstableMultilineWrapperTags: ["ol", "ul"], 42052 default: "", 42053 role: "content" 42054 }, 42055 type: { 42056 type: "string" 42057 }, 42058 start: { 42059 type: "number" 42060 }, 42061 reversed: { 42062 type: "boolean" 42063 }, 42064 placeholder: { 42065 type: "string" 42066 } 42067 }, 42068 supports: { 42069 anchor: true, 42070 className: false, 42071 typography: { 42072 fontSize: true, 42073 __experimentalFontFamily: true 42074 }, 42075 color: { 42076 gradients: true, 42077 link: true 42078 }, 42079 __unstablePasteTextInline: true, 42080 __experimentalSelector: "ol,ul", 42081 __experimentalSlashInserter: true 42082 }, 42083 save({ attributes: attributes2 }) { 42084 const { ordered, values, type, reversed, start } = attributes2; 42085 const TagName2 = ordered ? "ol" : "ul"; 42086 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(TagName2, { ...import_block_editor111.useBlockProps.save({ type, reversed, start }), children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor111.RichText.Content, { value: values, multiline: "li" }) }); 42087 }, 42088 migrate: migrate_font_family_default, 42089 isEligible({ style: style2 }) { 42090 return style2?.typography?.fontFamily; 42091 } 42092 }; 42093 var v120 = { 42094 attributes: { 42095 ordered: { 42096 type: "boolean", 42097 default: false, 42098 role: "content" 42099 }, 42100 values: { 42101 type: "string", 42102 source: "html", 42103 selector: "ol,ul", 42104 multiline: "li", 42105 __unstableMultilineWrapperTags: ["ol", "ul"], 42106 default: "", 42107 role: "content" 42108 }, 42109 type: { 42110 type: "string" 42111 }, 42112 start: { 42113 type: "number" 42114 }, 42115 reversed: { 42116 type: "boolean" 42117 }, 42118 placeholder: { 42119 type: "string" 42120 } 42121 }, 42122 supports: { 42123 anchor: true, 42124 className: false, 42125 typography: { 42126 fontSize: true, 42127 __experimentalFontFamily: true, 42128 lineHeight: true, 42129 __experimentalFontStyle: true, 42130 __experimentalFontWeight: true, 42131 __experimentalLetterSpacing: true, 42132 __experimentalTextTransform: true, 42133 __experimentalDefaultControls: { 42134 fontSize: true 42135 } 42136 }, 42137 color: { 42138 gradients: true, 42139 link: true, 42140 __experimentalDefaultControls: { 42141 background: true, 42142 text: true 42143 } 42144 }, 42145 __unstablePasteTextInline: true, 42146 __experimentalSelector: "ol,ul", 42147 __experimentalSlashInserter: true 42148 }, 42149 save({ attributes: attributes2 }) { 42150 const { ordered, values, type, reversed, start } = attributes2; 42151 const TagName2 = ordered ? "ol" : "ul"; 42152 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(TagName2, { ...import_block_editor111.useBlockProps.save({ type, reversed, start }), children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor111.RichText.Content, { value: values, multiline: "li" }) }); 42153 }, 42154 migrate: migrateToListV2 42155 }; 42156 var v210 = { 42157 attributes: { 42158 ordered: { 42159 type: "boolean", 42160 default: false, 42161 role: "content" 42162 }, 42163 values: { 42164 type: "string", 42165 source: "html", 42166 selector: "ol,ul", 42167 multiline: "li", 42168 __unstableMultilineWrapperTags: ["ol", "ul"], 42169 default: "", 42170 role: "content" 42171 }, 42172 type: { 42173 type: "string" 42174 }, 42175 start: { 42176 type: "number" 42177 }, 42178 reversed: { 42179 type: "boolean" 42180 }, 42181 placeholder: { 42182 type: "string" 42183 } 42184 }, 42185 supports: { 42186 anchor: true, 42187 className: false, 42188 typography: { 42189 fontSize: true, 42190 lineHeight: true, 42191 __experimentalFontFamily: true, 42192 __experimentalFontWeight: true, 42193 __experimentalFontStyle: true, 42194 __experimentalTextTransform: true, 42195 __experimentalTextDecoration: true, 42196 __experimentalLetterSpacing: true, 42197 __experimentalDefaultControls: { 42198 fontSize: true 42199 } 42200 }, 42201 color: { 42202 gradients: true, 42203 link: true, 42204 __experimentalDefaultControls: { 42205 background: true, 42206 text: true 42207 } 42208 }, 42209 spacing: { 42210 margin: true, 42211 padding: true, 42212 __experimentalDefaultControls: { 42213 margin: false, 42214 padding: false 42215 } 42216 }, 42217 __unstablePasteTextInline: true, 42218 __experimentalSelector: "ol,ul", 42219 __experimentalSlashInserter: true 42220 }, 42221 isEligible({ type }) { 42222 return !!type; 42223 }, 42224 save({ attributes: attributes2 }) { 42225 const { ordered, type, reversed, start } = attributes2; 42226 const TagName2 = ordered ? "ol" : "ul"; 42227 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(TagName2, { ...import_block_editor111.useBlockProps.save({ type, reversed, start }), children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor111.InnerBlocks.Content, {}) }); 42228 }, 42229 migrate: migrateTypeToInlineStyle 42230 }; 42231 var v37 = { 42232 attributes: { 42233 ordered: { 42234 type: "boolean", 42235 default: false, 42236 role: "content" 42237 }, 42238 values: { 42239 type: "string", 42240 source: "html", 42241 selector: "ol,ul", 42242 multiline: "li", 42243 __unstableMultilineWrapperTags: ["ol", "ul"], 42244 default: "", 42245 role: "content" 42246 }, 42247 type: { 42248 type: "string" 42249 }, 42250 start: { 42251 type: "number" 42252 }, 42253 reversed: { 42254 type: "boolean" 42255 }, 42256 placeholder: { 42257 type: "string" 42258 } 42259 }, 42260 supports: { 42261 anchor: true, 42262 className: false, 42263 typography: { 42264 fontSize: true, 42265 lineHeight: true, 42266 __experimentalFontFamily: true, 42267 __experimentalFontWeight: true, 42268 __experimentalFontStyle: true, 42269 __experimentalTextTransform: true, 42270 __experimentalTextDecoration: true, 42271 __experimentalLetterSpacing: true, 42272 __experimentalDefaultControls: { 42273 fontSize: true 42274 } 42275 }, 42276 color: { 42277 gradients: true, 42278 link: true, 42279 __experimentalDefaultControls: { 42280 background: true, 42281 text: true 42282 } 42283 }, 42284 spacing: { 42285 margin: true, 42286 padding: true, 42287 __experimentalDefaultControls: { 42288 margin: false, 42289 padding: false 42290 } 42291 }, 42292 __unstablePasteTextInline: true, 42293 __experimentalSelector: "ol,ul", 42294 __experimentalOnMerge: "true", 42295 __experimentalSlashInserter: true 42296 }, 42297 save({ attributes: attributes2 }) { 42298 const { ordered, type, reversed, start } = attributes2; 42299 const TagName2 = ordered ? "ol" : "ul"; 42300 return /* @__PURE__ */ (0, import_jsx_runtime315.jsx)( 42301 TagName2, 42302 { 42303 ...import_block_editor111.useBlockProps.save({ 42304 reversed, 42305 start, 42306 style: { 42307 listStyleType: ordered && type !== "decimal" ? type : void 0 42308 } 42309 }), 42310 children: /* @__PURE__ */ (0, import_jsx_runtime315.jsx)(import_block_editor111.InnerBlocks.Content, {}) 42311 } 42312 ); 42313 } 42314 }; 42315 var deprecated_default23 = [v37, v210, v120, v0]; 42316 42317 // packages/block-library/build-module/list/edit.mjs 42318 var import_block_editor113 = __toESM(require_block_editor(), 1); 42319 var import_components60 = __toESM(require_components(), 1); 42320 var import_data53 = __toESM(require_data(), 1); 42321 var import_i18n101 = __toESM(require_i18n(), 1); 42322 var import_blocks44 = __toESM(require_blocks(), 1); 42323 var import_element77 = __toESM(require_element(), 1); 42324 var import_deprecated25 = __toESM(require_deprecated(), 1); 42325 42326 // packages/block-library/build-module/list/ordered-list-settings.mjs 42327 var import_i18n100 = __toESM(require_i18n(), 1); 42328 var import_block_editor112 = __toESM(require_block_editor(), 1); 42329 var import_components59 = __toESM(require_components(), 1); 42330 var import_jsx_runtime316 = __toESM(require_jsx_runtime(), 1); 42331 var LIST_STYLE_OPTIONS = [ 42332 { 42333 label: (0, import_i18n100.__)("Numbers"), 42334 value: "decimal" 42335 }, 42336 { 42337 label: (0, import_i18n100.__)("Uppercase letters"), 42338 value: "upper-alpha" 42339 }, 42340 { 42341 label: (0, import_i18n100.__)("Lowercase letters"), 42342 value: "lower-alpha" 42343 }, 42344 { 42345 label: (0, import_i18n100.__)("Uppercase Roman numerals"), 42346 value: "upper-roman" 42347 }, 42348 { 42349 label: (0, import_i18n100.__)("Lowercase Roman numerals"), 42350 value: "lower-roman" 42351 } 42352 ]; 42353 var OrderedListSettings = ({ setAttributes, reversed, start, type }) => { 42354 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 42355 return /* @__PURE__ */ (0, import_jsx_runtime316.jsx)(import_block_editor112.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime316.jsxs)( 42356 import_components59.__experimentalToolsPanel, 42357 { 42358 label: (0, import_i18n100.__)("Settings"), 42359 resetAll: () => { 42360 setAttributes({ 42361 type: void 0, 42362 start: void 0, 42363 reversed: void 0 42364 }); 42365 }, 42366 dropdownMenuProps, 42367 children: [ 42368 /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 42369 import_components59.__experimentalToolsPanelItem, 42370 { 42371 label: (0, import_i18n100.__)("List style"), 42372 isShownByDefault: true, 42373 hasValue: () => !!type, 42374 onDeselect: () => setAttributes({ 42375 type: void 0 42376 }), 42377 children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 42378 import_components59.SelectControl, 42379 { 42380 label: (0, import_i18n100.__)("List style"), 42381 options: LIST_STYLE_OPTIONS, 42382 value: type || "decimal", 42383 onChange: (newValue) => setAttributes({ type: newValue }) 42384 } 42385 ) 42386 } 42387 ), 42388 /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 42389 import_components59.__experimentalToolsPanelItem, 42390 { 42391 label: (0, import_i18n100.__)("Start value"), 42392 isShownByDefault: true, 42393 hasValue: () => !!start, 42394 onDeselect: () => setAttributes({ 42395 start: void 0 42396 }), 42397 children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 42398 import_components59.TextControl, 42399 { 42400 label: (0, import_i18n100.__)("Start value"), 42401 type: "number", 42402 onChange: (value) => { 42403 const int = parseInt(value, 10); 42404 setAttributes({ 42405 // It should be possible to unset the value, 42406 // e.g. with an empty string. 42407 start: isNaN(int) ? void 0 : int 42408 }); 42409 }, 42410 value: Number.isInteger(start) ? start.toString(10) : "", 42411 step: "1" 42412 } 42413 ) 42414 } 42415 ), 42416 /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 42417 import_components59.__experimentalToolsPanelItem, 42418 { 42419 label: (0, import_i18n100.__)("Reverse order"), 42420 isShownByDefault: true, 42421 hasValue: () => !!reversed, 42422 onDeselect: () => setAttributes({ 42423 reversed: void 0 42424 }), 42425 children: /* @__PURE__ */ (0, import_jsx_runtime316.jsx)( 42426 import_components59.ToggleControl, 42427 { 42428 label: (0, import_i18n100.__)("Reverse order"), 42429 checked: reversed || false, 42430 onChange: (value) => { 42431 setAttributes({ 42432 // Unset the attribute if not reversed. 42433 reversed: value || void 0 42434 }); 42435 } 42436 } 42437 ) 42438 } 42439 ) 42440 ] 42441 } 42442 ) }); 42443 }; 42444 var ordered_list_settings_default = OrderedListSettings; 42445 42446 // packages/block-library/build-module/list/tag-name.mjs 42447 var import_element76 = __toESM(require_element(), 1); 42448 var import_jsx_runtime317 = __toESM(require_jsx_runtime(), 1); 42449 function TagName(props, ref) { 42450 const { ordered, ...extraProps } = props; 42451 const Tag = ordered ? "ol" : "ul"; 42452 return /* @__PURE__ */ (0, import_jsx_runtime317.jsx)(Tag, { ref, ...extraProps }); 42453 } 42454 var tag_name_default = (0, import_element76.forwardRef)(TagName); 42455 42456 // packages/block-library/build-module/list/edit.mjs 42457 var import_jsx_runtime318 = __toESM(require_jsx_runtime(), 1); 42458 var DEFAULT_BLOCK4 = { 42459 name: "core/list-item" 42460 }; 42461 function useMigrateOnLoad(attributes2, clientId) { 42462 const registry = (0, import_data53.useRegistry)(); 42463 const { updateBlockAttributes, replaceInnerBlocks, selectBlock } = (0, import_data53.useDispatch)(import_block_editor113.store); 42464 (0, import_element77.useEffect)(() => { 42465 if (!attributes2.values) { 42466 return; 42467 } 42468 const [newAttributes, newInnerBlocks] = migrateToListV2(attributes2); 42469 (0, import_deprecated25.default)("Value attribute on the list block", { 42470 since: "6.0", 42471 version: "6.5", 42472 alternative: "inner blocks" 42473 }); 42474 const shouldReselectBlock = registry.select(import_block_editor113.store).hasSelectedInnerBlock(clientId, true); 42475 registry.batch(() => { 42476 updateBlockAttributes(clientId, newAttributes); 42477 replaceInnerBlocks(clientId, newInnerBlocks); 42478 if (shouldReselectBlock) { 42479 selectBlock(clientId); 42480 } 42481 }); 42482 }, [attributes2.values]); 42483 } 42484 function useOutdentList(clientId) { 42485 const { replaceBlocks, selectionChange } = (0, import_data53.useDispatch)(import_block_editor113.store); 42486 const { getBlockRootClientId, getBlockAttributes: getBlockAttributes4, getBlock } = (0, import_data53.useSelect)(import_block_editor113.store); 42487 return (0, import_element77.useCallback)(() => { 42488 const parentBlockId = getBlockRootClientId(clientId); 42489 const parentBlockAttributes = getBlockAttributes4(parentBlockId); 42490 const newParentBlock = (0, import_blocks44.createBlock)( 42491 "core/list-item", 42492 parentBlockAttributes 42493 ); 42494 const { innerBlocks } = getBlock(clientId); 42495 replaceBlocks([parentBlockId], [newParentBlock, ...innerBlocks]); 42496 selectionChange(innerBlocks[innerBlocks.length - 1].clientId); 42497 }, [clientId]); 42498 } 42499 function IndentUI({ clientId }) { 42500 const outdentList = useOutdentList(clientId); 42501 const canOutdent = (0, import_data53.useSelect)( 42502 (select10) => { 42503 const { getBlockRootClientId, getBlockName } = select10(import_block_editor113.store); 42504 return getBlockName(getBlockRootClientId(clientId)) === "core/list-item"; 42505 }, 42506 [clientId] 42507 ); 42508 return /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(import_jsx_runtime318.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime318.jsx)( 42509 import_components60.ToolbarButton, 42510 { 42511 icon: (0, import_i18n101.isRTL)() ? format_outdent_rtl_default : format_outdent_default, 42512 title: (0, import_i18n101.__)("Outdent"), 42513 description: (0, import_i18n101.__)("Outdent list item"), 42514 disabled: !canOutdent, 42515 onClick: outdentList 42516 } 42517 ) }); 42518 } 42519 function Edit14({ attributes: attributes2, setAttributes, clientId }) { 42520 const { ordered, type, reversed, start } = attributes2; 42521 const blockProps = (0, import_block_editor113.useBlockProps)({ 42522 style: { 42523 listStyleType: ordered && type !== "decimal" ? type : void 0 42524 } 42525 }); 42526 const innerBlocksProps = (0, import_block_editor113.useInnerBlocksProps)(blockProps, { 42527 defaultBlock: DEFAULT_BLOCK4, 42528 directInsert: true, 42529 templateLock: false, 42530 __experimentalCaptureToolbars: true 42531 }); 42532 useMigrateOnLoad(attributes2, clientId); 42533 const controls = /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)(import_block_editor113.BlockControls, { group: "block", children: [ 42534 /* @__PURE__ */ (0, import_jsx_runtime318.jsx)( 42535 import_components60.ToolbarButton, 42536 { 42537 icon: (0, import_i18n101.isRTL)() ? format_list_bullets_rtl_default : format_list_bullets_default, 42538 title: (0, import_i18n101.__)("Unordered"), 42539 description: (0, import_i18n101.__)("Convert to unordered list"), 42540 isActive: ordered === false, 42541 onClick: () => { 42542 setAttributes({ ordered: false }); 42543 } 42544 } 42545 ), 42546 /* @__PURE__ */ (0, import_jsx_runtime318.jsx)( 42547 import_components60.ToolbarButton, 42548 { 42549 icon: (0, import_i18n101.isRTL)() ? format_list_numbered_rtl_default : format_list_numbered_default, 42550 title: (0, import_i18n101.__)("Ordered"), 42551 description: (0, import_i18n101.__)("Convert to ordered list"), 42552 isActive: ordered === true, 42553 onClick: () => { 42554 setAttributes({ ordered: true }); 42555 } 42556 } 42557 ), 42558 /* @__PURE__ */ (0, import_jsx_runtime318.jsx)(IndentUI, { clientId }) 42559 ] }); 42560 return /* @__PURE__ */ (0, import_jsx_runtime318.jsxs)(import_jsx_runtime318.Fragment, { children: [ 42561 /* @__PURE__ */ (0, import_jsx_runtime318.jsx)( 42562 tag_name_default, 42563 { 42564 ordered, 42565 reversed, 42566 start, 42567 ...innerBlocksProps 42568 } 42569 ), 42570 controls, 42571 ordered && /* @__PURE__ */ (0, import_jsx_runtime318.jsx)( 42572 ordered_list_settings_default, 42573 { 42574 ...{ 42575 setAttributes, 42576 reversed, 42577 start, 42578 type 42579 } 42580 } 42581 ) 42582 ] }); 42583 } 42584 42585 // packages/block-library/build-module/list/block.json 42586 var block_default43 = { 42587 $schema: "https://schemas.wp.org/trunk/block.json", 42588 apiVersion: 3, 42589 name: "core/list", 42590 title: "List", 42591 category: "text", 42592 allowedBlocks: ["core/list-item"], 42593 description: "An organized collection of items displayed in a specific order.", 42594 keywords: ["bullet list", "ordered list", "numbered list"], 42595 textdomain: "default", 42596 attributes: { 42597 ordered: { 42598 type: "boolean", 42599 default: false, 42600 role: "content" 42601 }, 42602 values: { 42603 type: "string", 42604 source: "html", 42605 selector: "ol,ul", 42606 multiline: "li", 42607 default: "", 42608 role: "content" 42609 }, 42610 type: { 42611 type: "string" 42612 }, 42613 start: { 42614 type: "number" 42615 }, 42616 reversed: { 42617 type: "boolean" 42618 }, 42619 placeholder: { 42620 type: "string" 42621 } 42622 }, 42623 supports: { 42624 anchor: true, 42625 align: ["wide", "full"], 42626 html: false, 42627 __experimentalBorder: { 42628 color: true, 42629 radius: true, 42630 style: true, 42631 width: true 42632 }, 42633 typography: { 42634 fontSize: true, 42635 lineHeight: true, 42636 __experimentalFontFamily: true, 42637 __experimentalFontWeight: true, 42638 __experimentalFontStyle: true, 42639 __experimentalTextTransform: true, 42640 __experimentalTextDecoration: true, 42641 __experimentalLetterSpacing: true, 42642 __experimentalDefaultControls: { 42643 fontSize: true 42644 } 42645 }, 42646 color: { 42647 gradients: true, 42648 link: true, 42649 __experimentalDefaultControls: { 42650 background: true, 42651 text: true 42652 } 42653 }, 42654 spacing: { 42655 margin: true, 42656 padding: true, 42657 __experimentalDefaultControls: { 42658 margin: false, 42659 padding: false 42660 } 42661 }, 42662 __unstablePasteTextInline: true, 42663 __experimentalOnMerge: true, 42664 __experimentalSlashInserter: true, 42665 interactivity: { 42666 clientNavigation: true 42667 }, 42668 listView: true 42669 }, 42670 selectors: { 42671 border: ".wp-block-list:not(.wp-block-list .wp-block-list)" 42672 }, 42673 editorStyle: "wp-block-list-editor", 42674 style: "wp-block-list" 42675 }; 42676 42677 // packages/block-library/build-module/list/save.mjs 42678 var import_block_editor114 = __toESM(require_block_editor(), 1); 42679 var import_jsx_runtime319 = __toESM(require_jsx_runtime(), 1); 42680 function save23({ attributes: attributes2 }) { 42681 const { ordered, type, reversed, start } = attributes2; 42682 const TagName2 = ordered ? "ol" : "ul"; 42683 return /* @__PURE__ */ (0, import_jsx_runtime319.jsx)( 42684 TagName2, 42685 { 42686 ...import_block_editor114.useBlockProps.save({ 42687 reversed, 42688 start, 42689 style: { 42690 listStyleType: ordered && type !== "decimal" ? type : void 0 42691 } 42692 }), 42693 children: /* @__PURE__ */ (0, import_jsx_runtime319.jsx)(import_block_editor114.InnerBlocks.Content, {}) 42694 } 42695 ); 42696 } 42697 42698 // packages/block-library/build-module/list/transforms.mjs 42699 var import_blocks45 = __toESM(require_blocks(), 1); 42700 var import_rich_text4 = __toESM(require_rich_text(), 1); 42701 function getListContentSchema({ phrasingContentSchema }) { 42702 const listContentSchema = { 42703 ...phrasingContentSchema, 42704 ul: {}, 42705 ol: { attributes: ["type", "start", "reversed"] } 42706 }; 42707 ["ul", "ol"].forEach((tag) => { 42708 listContentSchema[tag].children = { 42709 li: { 42710 children: listContentSchema 42711 } 42712 }; 42713 }); 42714 return listContentSchema; 42715 } 42716 function getListContentFlat(blocks) { 42717 return blocks.flatMap(({ name: name118, attributes: attributes2, innerBlocks = [] }) => { 42718 if (name118 === "core/list-item") { 42719 return [attributes2.content, ...getListContentFlat(innerBlocks)]; 42720 } 42721 return getListContentFlat(innerBlocks); 42722 }); 42723 } 42724 var transforms14 = { 42725 from: [ 42726 { 42727 type: "block", 42728 isMultiBlock: true, 42729 blocks: ["core/paragraph", "core/heading"], 42730 transform: (blockAttributes8) => { 42731 let childBlocks = []; 42732 if (blockAttributes8.length > 1) { 42733 childBlocks = blockAttributes8.map(({ content }) => { 42734 return (0, import_blocks45.createBlock)("core/list-item", { content }); 42735 }); 42736 } else if (blockAttributes8.length === 1) { 42737 const value = (0, import_rich_text4.create)({ 42738 html: blockAttributes8[0].content 42739 }); 42740 childBlocks = (0, import_rich_text4.split)(value, "\n").map((result) => { 42741 return (0, import_blocks45.createBlock)("core/list-item", { 42742 content: (0, import_rich_text4.toHTMLString)({ value: result }) 42743 }); 42744 }); 42745 } 42746 return (0, import_blocks45.createBlock)( 42747 "core/list", 42748 { 42749 anchor: blockAttributes8.anchor 42750 }, 42751 childBlocks 42752 ); 42753 } 42754 }, 42755 { 42756 type: "raw", 42757 selector: "ol,ul", 42758 schema: (args) => ({ 42759 ol: getListContentSchema(args).ol, 42760 ul: getListContentSchema(args).ul 42761 }), 42762 transform: createListBlockFromDOMElement 42763 }, 42764 ...["*", "-"].map((prefix) => ({ 42765 type: "prefix", 42766 prefix, 42767 transform(content) { 42768 return (0, import_blocks45.createBlock)("core/list", {}, [ 42769 (0, import_blocks45.createBlock)("core/list-item", { content }) 42770 ]); 42771 } 42772 })), 42773 ...["1.", "1)"].map((prefix) => ({ 42774 type: "prefix", 42775 prefix, 42776 transform(content) { 42777 return (0, import_blocks45.createBlock)( 42778 "core/list", 42779 { 42780 ordered: true 42781 }, 42782 [(0, import_blocks45.createBlock)("core/list-item", { content })] 42783 ); 42784 } 42785 })) 42786 ], 42787 to: [ 42788 ...["core/paragraph", "core/heading"].map((block) => ({ 42789 type: "block", 42790 blocks: [block], 42791 transform: (_attributes, childBlocks) => { 42792 return getListContentFlat(childBlocks).map( 42793 (content) => (0, import_blocks45.createBlock)(block, { 42794 content 42795 }) 42796 ); 42797 } 42798 })) 42799 ] 42800 }; 42801 var transforms_default15 = transforms14; 42802 42803 // packages/block-library/build-module/list/index.mjs 42804 var { name: name43 } = block_default43; 42805 var TEMPLATE9 = [["core/list-item"]]; 42806 var settings43 = { 42807 icon: list_default, 42808 example: { 42809 innerBlocks: [ 42810 { 42811 name: "core/list-item", 42812 attributes: { content: (0, import_i18n102.__)("Alice.") } 42813 }, 42814 { 42815 name: "core/list-item", 42816 attributes: { content: (0, import_i18n102.__)("The White Rabbit.") } 42817 }, 42818 { 42819 name: "core/list-item", 42820 attributes: { content: (0, import_i18n102.__)("The Cheshire Cat.") } 42821 }, 42822 { 42823 name: "core/list-item", 42824 attributes: { content: (0, import_i18n102.__)("The Mad Hatter.") } 42825 }, 42826 { 42827 name: "core/list-item", 42828 attributes: { content: (0, import_i18n102.__)("The Queen of Hearts.") } 42829 } 42830 ] 42831 }, 42832 transforms: transforms_default15, 42833 template: TEMPLATE9, 42834 templateInsertUpdatesSelection: true, 42835 edit: Edit14, 42836 save: save23, 42837 deprecated: deprecated_default23 42838 }; 42839 var init43 = () => initBlock({ name: name43, metadata: block_default43, settings: settings43 }); 42840 42841 // packages/block-library/build-module/math/index.mjs 42842 var math_exports = {}; 42843 __export(math_exports, { 42844 init: () => init44, 42845 metadata: () => block_default44, 42846 name: () => name44, 42847 settings: () => settings44 42848 }); 42849 42850 // packages/block-library/build-module/math/edit.mjs 42851 var import_i18n103 = __toESM(require_i18n(), 1); 42852 var import_block_editor115 = __toESM(require_block_editor(), 1); 42853 var import_components61 = __toESM(require_components(), 1); 42854 var import_element78 = __toESM(require_element(), 1); 42855 var import_data54 = __toESM(require_data(), 1); 42856 var import_jsx_runtime320 = __toESM(require_jsx_runtime(), 1); 42857 function MathEdit({ attributes: attributes2, setAttributes, isSelected }) { 42858 const { latex, mathML } = attributes2; 42859 const [blockRef, setBlockRef] = (0, import_element78.useState)(); 42860 const [error2, setError] = (0, import_element78.useState)(null); 42861 const [latexToMathML, setLatexToMathML] = (0, import_element78.useState)(); 42862 const initialLatex = (0, import_element78.useRef)(latex); 42863 const formRef = (0, import_element78.useRef)(); 42864 const { __unstableMarkNextChangeAsNotPersistent } = (0, import_data54.useDispatch)(import_block_editor115.store); 42865 (0, import_element78.useEffect)(() => { 42866 import("@wordpress/latex-to-mathml").then((module) => { 42867 setLatexToMathML(() => module.default); 42868 if (initialLatex.current) { 42869 __unstableMarkNextChangeAsNotPersistent(); 42870 setAttributes({ 42871 mathML: module.default(initialLatex.current, { 42872 displayMode: true 42873 }) 42874 }); 42875 } 42876 }); 42877 }, [ 42878 initialLatex, 42879 setAttributes, 42880 __unstableMarkNextChangeAsNotPersistent 42881 ]); 42882 const blockProps = (0, import_block_editor115.useBlockProps)({ 42883 ref: setBlockRef, 42884 position: "relative" 42885 }); 42886 return /* @__PURE__ */ (0, import_jsx_runtime320.jsxs)("div", { ...blockProps, children: [ 42887 mathML ? /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 42888 "math", 42889 { 42890 display: "block", 42891 dangerouslySetInnerHTML: { __html: mathML } 42892 } 42893 ) : "\u200B", 42894 isSelected && /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 42895 import_components61.Popover, 42896 { 42897 placement: "bottom-start", 42898 offset: 8, 42899 anchor: blockRef, 42900 focusOnMount: false, 42901 onFocusOutside: () => formRef.current?.reportValidity(), 42902 __unstableSlotName: "__unstable-block-tools-after", 42903 children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 42904 "form", 42905 { 42906 ref: formRef, 42907 style: { padding: "4px", minWidth: "300px" }, 42908 onSubmit: (event) => event.preventDefault(), 42909 children: /* @__PURE__ */ (0, import_jsx_runtime320.jsx)( 42910 ValidatedTextareaControl, 42911 { 42912 label: (0, import_i18n103.__)("LaTeX math syntax"), 42913 hideLabelFromVision: true, 42914 value: latex ?? "", 42915 className: "wp-block-math__textarea-control", 42916 customValidity: error2 ? { type: "invalid", message: error2 } : void 0, 42917 onValueChange: (newLatex) => { 42918 if (!latexToMathML) { 42919 setAttributes({ latex: newLatex }); 42920 return; 42921 } 42922 let newMathML = ""; 42923 try { 42924 newMathML = latexToMathML(newLatex, { 42925 displayMode: true 42926 }); 42927 setError(null); 42928 } catch (err) { 42929 setError(err.message); 42930 } 42931 setAttributes({ 42932 mathML: newMathML, 42933 latex: newLatex 42934 }); 42935 }, 42936 placeholder: (0, import_i18n103.__)("e.g., x^2, \\frac{a}{b}") 42937 } 42938 ) 42939 } 42940 ) 42941 } 42942 ) 42943 ] }); 42944 } 42945 42946 // packages/block-library/build-module/math/block.json 42947 var block_default44 = { 42948 $schema: "https://schemas.wp.org/trunk/block.json", 42949 apiVersion: 3, 42950 name: "core/math", 42951 title: "Math", 42952 category: "text", 42953 description: "Display mathematical notation using LaTeX.", 42954 keywords: ["equation", "formula", "latex", "mathematics"], 42955 textdomain: "default", 42956 supports: { 42957 anchor: true, 42958 html: false, 42959 __experimentalBorder: { 42960 color: true, 42961 radius: true, 42962 style: true, 42963 width: true 42964 }, 42965 color: { 42966 gradients: true, 42967 __experimentalDefaultControls: { 42968 background: true, 42969 text: true 42970 } 42971 }, 42972 spacing: { 42973 margin: true, 42974 padding: true, 42975 __experimentalDefaultControls: { 42976 margin: false, 42977 padding: false 42978 } 42979 }, 42980 typography: { 42981 fontSize: true, 42982 __experimentalDefaultControls: { 42983 fontSize: true 42984 } 42985 }, 42986 interactivity: { 42987 clientNavigation: true 42988 } 42989 }, 42990 attributes: { 42991 latex: { 42992 type: "string", 42993 role: "content" 42994 }, 42995 mathML: { 42996 type: "string", 42997 source: "html", 42998 selector: "math" 42999 } 43000 } 43001 }; 43002 43003 // packages/block-library/build-module/math/save.mjs 43004 var import_block_editor116 = __toESM(require_block_editor(), 1); 43005 var import_jsx_runtime321 = __toESM(require_jsx_runtime(), 1); 43006 function save24({ attributes: attributes2 }) { 43007 const { latex, mathML } = attributes2; 43008 if (!latex) { 43009 return null; 43010 } 43011 return /* @__PURE__ */ (0, import_jsx_runtime321.jsx)("div", { ...import_block_editor116.useBlockProps.save(), children: /* @__PURE__ */ (0, import_jsx_runtime321.jsx)( 43012 "math", 43013 { 43014 display: "block", 43015 dangerouslySetInnerHTML: { __html: mathML } 43016 } 43017 ) }); 43018 } 43019 43020 // packages/block-library/build-module/math/deprecated.mjs 43021 var import_block_editor117 = __toESM(require_block_editor(), 1); 43022 var import_jsx_runtime322 = __toESM(require_jsx_runtime(), 1); 43023 var v121 = { 43024 attributes: { 43025 latex: { 43026 type: "string", 43027 role: "content" 43028 }, 43029 mathML: { 43030 type: "string", 43031 source: "html", 43032 selector: "math" 43033 } 43034 }, 43035 save({ attributes: attributes2 }) { 43036 const { latex, mathML } = attributes2; 43037 if (!latex) { 43038 return null; 43039 } 43040 return /* @__PURE__ */ (0, import_jsx_runtime322.jsx)( 43041 "math", 43042 { 43043 ...import_block_editor117.useBlockProps.save(), 43044 display: "block", 43045 dangerouslySetInnerHTML: { __html: mathML } 43046 } 43047 ); 43048 } 43049 }; 43050 var deprecated_default24 = [v121]; 43051 43052 // packages/block-library/build-module/math/index.mjs 43053 var { name: name44 } = block_default44; 43054 var settings44 = { 43055 icon: math_default, 43056 example: { 43057 attributes: { 43058 latex: "x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}", 43059 mathML: '<semantics><mrow><mi>x</mi><mo>=</mo><mfrac><mrow><mo lspace="0em" rspace="0em">\u2212</mo><mi>b</mi><mo>\xB1</mo><msqrt><mrow><msup><mi>b</mi><mn>2</mn></msup><mo>\u2212</mo><mn>4</mn><mi>a</mi><mi>c</mi></mrow></msqrt></mrow><mrow><mn>2</mn><mi>a</mi></mrow></mfrac></mrow><annotation encoding="application/x-tex">x = \\frac{-b \\pm \\sqrt{b^2-4ac}}{2a}</annotation></semantics>' 43060 }, 43061 viewportWidth: 300 43062 }, 43063 edit: MathEdit, 43064 save: save24, 43065 deprecated: deprecated_default24 43066 }; 43067 var init44 = () => initBlock({ name: name44, metadata: block_default44, settings: settings44 }); 43068 43069 // packages/block-library/build-module/list-item/index.mjs 43070 var list_item_exports = {}; 43071 __export(list_item_exports, { 43072 init: () => init45, 43073 metadata: () => block_default45, 43074 name: () => name45, 43075 settings: () => settings45 43076 }); 43077 var import_i18n105 = __toESM(require_i18n(), 1); 43078 var import_block_editor125 = __toESM(require_block_editor(), 1); 43079 var import_blocks50 = __toESM(require_blocks(), 1); 43080 43081 // packages/block-library/build-module/list-item/block.json 43082 var block_default45 = { 43083 $schema: "https://schemas.wp.org/trunk/block.json", 43084 apiVersion: 3, 43085 name: "core/list-item", 43086 title: "List Item", 43087 category: "text", 43088 parent: ["core/list"], 43089 allowedBlocks: ["core/list"], 43090 description: "An individual item within a list.", 43091 textdomain: "default", 43092 attributes: { 43093 placeholder: { 43094 type: "string" 43095 }, 43096 content: { 43097 type: "rich-text", 43098 source: "rich-text", 43099 selector: "li", 43100 role: "content" 43101 } 43102 }, 43103 supports: { 43104 anchor: true, 43105 html: false, 43106 className: false, 43107 splitting: true, 43108 __experimentalBorder: { 43109 color: true, 43110 radius: true, 43111 style: true, 43112 width: true 43113 }, 43114 color: { 43115 gradients: true, 43116 link: true, 43117 background: true, 43118 __experimentalDefaultControls: { 43119 text: true 43120 } 43121 }, 43122 spacing: { 43123 margin: true, 43124 padding: true, 43125 __experimentalDefaultControls: { 43126 margin: false, 43127 padding: false 43128 } 43129 }, 43130 typography: { 43131 fontSize: true, 43132 lineHeight: true, 43133 __experimentalFontFamily: true, 43134 __experimentalFontWeight: true, 43135 __experimentalFontStyle: true, 43136 __experimentalTextTransform: true, 43137 __experimentalTextDecoration: true, 43138 __experimentalLetterSpacing: true, 43139 __experimentalDefaultControls: { 43140 fontSize: true 43141 } 43142 }, 43143 interactivity: { 43144 clientNavigation: true 43145 } 43146 }, 43147 selectors: { 43148 root: ".wp-block-list > li", 43149 border: ".wp-block-list:not(.wp-block-list .wp-block-list) > li" 43150 } 43151 }; 43152 43153 // packages/block-library/build-module/list-item/edit.mjs 43154 var import_block_editor123 = __toESM(require_block_editor(), 1); 43155 var import_i18n104 = __toESM(require_i18n(), 1); 43156 var import_components62 = __toESM(require_components(), 1); 43157 var import_compose34 = __toESM(require_compose(), 1); 43158 var import_data59 = __toESM(require_data(), 1); 43159 var import_keycodes5 = __toESM(require_keycodes(), 1); 43160 43161 // packages/block-library/build-module/list-item/hooks/use-enter.mjs 43162 var import_blocks47 = __toESM(require_blocks(), 1); 43163 var import_compose31 = __toESM(require_compose(), 1); 43164 var import_rich_text5 = __toESM(require_rich_text(), 1); 43165 var import_data55 = __toESM(require_data(), 1); 43166 var import_block_editor119 = __toESM(require_block_editor(), 1); 43167 43168 // packages/block-library/build-module/list-item/utils.mjs 43169 var import_block_editor118 = __toESM(require_block_editor(), 1); 43170 var import_blocks46 = __toESM(require_blocks(), 1); 43171 function getIndentTarget(select10, clientId) { 43172 return select10.getPreviousBlockClientId(clientId); 43173 } 43174 function getOutdentTarget(select10, clientId) { 43175 const listId = select10.getBlockRootClientId(clientId); 43176 const parentListItemId = select10.getBlockRootClientId(listId); 43177 if (!parentListItemId || select10.getBlockName(parentListItemId) !== "core/list-item") { 43178 return void 0; 43179 } 43180 return parentListItemId; 43181 } 43182 function moveBlocksToNestedList(registry, clientIds, sourceListId, listItemId) { 43183 const { getBlockOrder, getBlock } = registry.select(import_block_editor118.store); 43184 const { moveBlocksToPosition, removeBlocks, insertBlock } = registry.dispatch(import_block_editor118.store); 43185 const nestedLists = getBlockOrder(listItemId); 43186 const nestedListId = nestedLists[nestedLists.length - 1]; 43187 if (nestedListId) { 43188 moveBlocksToPosition(clientIds, sourceListId, nestedListId); 43189 return; 43190 } 43191 const nestedList = (0, import_blocks46.cloneBlock)( 43192 getBlock(sourceListId), 43193 {}, 43194 clientIds.map((id) => getBlock(id)) 43195 ); 43196 registry.batch(() => { 43197 removeBlocks(clientIds, false); 43198 insertBlock(nestedList, 0, listItemId, false); 43199 }); 43200 } 43201 function indentListItems(registry, clientId) { 43202 const select10 = registry.select(import_block_editor118.store); 43203 const { 43204 getBlockRootClientId, 43205 getSelectedBlockClientIds, 43206 getSelectionStart, 43207 getSelectionEnd, 43208 hasMultiSelection, 43209 getMultiSelectedBlockClientIds 43210 } = select10; 43211 const { selectionChange, multiSelect } = registry.dispatch(import_block_editor118.store); 43212 const _hasMultiSelection = hasMultiSelection(); 43213 const clientIds = _hasMultiSelection ? getMultiSelectedBlockClientIds() : getSelectedBlockClientIds(); 43214 if (clientId === void 0) { 43215 clientId = clientIds[0]; 43216 } 43217 const previousSiblingId = getIndentTarget(select10, clientId); 43218 if (!previousSiblingId) { 43219 return false; 43220 } 43221 const rootClientId = getBlockRootClientId(clientId); 43222 const selectionStart = getSelectionStart(); 43223 const selectionEnd = getSelectionEnd(); 43224 registry.batch(() => { 43225 moveBlocksToNestedList( 43226 registry, 43227 clientIds, 43228 rootClientId, 43229 previousSiblingId 43230 ); 43231 if (!_hasMultiSelection) { 43232 selectionChange( 43233 clientIds[0], 43234 selectionEnd.attributeKey, 43235 selectionEnd.clientId === selectionStart.clientId ? selectionStart.offset : selectionEnd.offset, 43236 selectionEnd.offset 43237 ); 43238 } else { 43239 multiSelect(clientIds[0], clientIds[clientIds.length - 1]); 43240 } 43241 }); 43242 return true; 43243 } 43244 function outdentListItems(registry, clientIds) { 43245 const select10 = registry.select(import_block_editor118.store); 43246 const { 43247 getBlockRootClientId, 43248 getBlockName, 43249 getBlockOrder, 43250 getBlockIndex, 43251 getSelectedBlockClientIds 43252 } = select10; 43253 const { moveBlocksToPosition, removeBlock, multiSelect } = registry.dispatch(import_block_editor118.store); 43254 if (clientIds === void 0) { 43255 clientIds = getSelectedBlockClientIds(); 43256 } 43257 if (!Array.isArray(clientIds)) { 43258 clientIds = [clientIds]; 43259 } 43260 if (!clientIds.length) { 43261 return false; 43262 } 43263 const firstClientId = clientIds[0]; 43264 if (getBlockName(firstClientId) !== "core/list-item") { 43265 return false; 43266 } 43267 const parentListItemId = getOutdentTarget(select10, firstClientId); 43268 if (!parentListItemId) { 43269 return false; 43270 } 43271 const parentListId = getBlockRootClientId(firstClientId); 43272 const lastClientId = clientIds[clientIds.length - 1]; 43273 const order = getBlockOrder(parentListId); 43274 const followingListItems = order.slice(getBlockIndex(lastClientId) + 1); 43275 registry.batch(() => { 43276 if (followingListItems.length) { 43277 moveBlocksToNestedList( 43278 registry, 43279 followingListItems, 43280 parentListId, 43281 firstClientId 43282 ); 43283 } 43284 moveBlocksToPosition( 43285 clientIds, 43286 parentListId, 43287 getBlockRootClientId(parentListItemId), 43288 getBlockIndex(parentListItemId) + 1 43289 ); 43290 if (!getBlockOrder(parentListId).length) { 43291 const shouldSelectParent = false; 43292 removeBlock(parentListId, shouldSelectParent); 43293 } 43294 if (clientIds.length > 1) { 43295 multiSelect(firstClientId, lastClientId); 43296 } 43297 }); 43298 return true; 43299 } 43300 43301 // packages/block-library/build-module/list-item/hooks/use-enter.mjs 43302 var { subscribeOwnedListener } = unlock(import_rich_text5.privateApis); 43303 function useEnter2(clientId) { 43304 const registry = (0, import_data55.useRegistry)(); 43305 return (0, import_compose31.useRefEffect)( 43306 (element) => { 43307 function onBeforeInput(event) { 43308 if (event.defaultPrevented || event.inputType !== "insertParagraph") { 43309 return; 43310 } 43311 const select10 = registry.select(import_block_editor119.store); 43312 const { 43313 getBlock, 43314 getBlockAttributes: getBlockAttributes4, 43315 getBlockRootClientId, 43316 getBlockIndex 43317 } = select10; 43318 const { replaceBlocks, selectionChange } = registry.dispatch(import_block_editor119.store); 43319 const { content } = getBlockAttributes4(clientId) ?? {}; 43320 if (content?.length) { 43321 return; 43322 } 43323 event.preventDefault(); 43324 const canOutdent = !!getOutdentTarget(select10, clientId); 43325 if (canOutdent) { 43326 outdentListItems(registry); 43327 return; 43328 } 43329 const topParentListBlock = getBlock( 43330 getBlockRootClientId(clientId) 43331 ); 43332 const blockIndex = getBlockIndex(clientId); 43333 const head = (0, import_blocks47.cloneBlock)({ 43334 ...topParentListBlock, 43335 innerBlocks: topParentListBlock.innerBlocks.slice( 43336 0, 43337 blockIndex 43338 ) 43339 }); 43340 const middle = (0, import_blocks47.createBlock)((0, import_blocks47.getDefaultBlockName)()); 43341 const after = [ 43342 ...topParentListBlock.innerBlocks[blockIndex].innerBlocks[0]?.innerBlocks || [], 43343 ...topParentListBlock.innerBlocks.slice(blockIndex + 1) 43344 ]; 43345 const tail = after.length ? [ 43346 (0, import_blocks47.cloneBlock)({ 43347 ...topParentListBlock, 43348 innerBlocks: after 43349 }) 43350 ] : []; 43351 replaceBlocks( 43352 topParentListBlock.clientId, 43353 [head, middle, ...tail], 43354 1 43355 ); 43356 selectionChange(middle.clientId); 43357 } 43358 return subscribeOwnedListener( 43359 element, 43360 "beforeinput", 43361 onBeforeInput, 43362 true 43363 ); 43364 }, 43365 [clientId, registry] 43366 ); 43367 } 43368 43369 // packages/block-library/build-module/list-item/hooks/use-tab.mjs 43370 var import_compose32 = __toESM(require_compose(), 1); 43371 var import_rich_text6 = __toESM(require_rich_text(), 1); 43372 var import_keycodes3 = __toESM(require_keycodes(), 1); 43373 var import_block_editor120 = __toESM(require_block_editor(), 1); 43374 var import_data56 = __toESM(require_data(), 1); 43375 var import_dom14 = __toESM(require_dom(), 1); 43376 var { subscribeOwnedListener: subscribeOwnedListener2 } = unlock(import_rich_text6.privateApis); 43377 function useTab() { 43378 const registry = (0, import_data56.useRegistry)(); 43379 return (0, import_compose32.useRefEffect)( 43380 (element) => { 43381 function onKeyDown(event) { 43382 const { keyCode, shiftKey, altKey, metaKey, ctrlKey } = event; 43383 if (event.defaultPrevented || keyCode !== import_keycodes3.SPACE && keyCode !== import_keycodes3.TAB || // Shift selects outdent; other modifiers pass through. 43384 altKey || metaKey || ctrlKey) { 43385 return; 43386 } 43387 const { getSelectionStart, getSelectionEnd } = registry.select(import_block_editor120.store); 43388 const isAtStart = getSelectionStart().offset === 0 && getSelectionEnd().offset === 0; 43389 if (!isAtStart && !(keyCode === import_keycodes3.TAB && (0, import_dom14.isEntirelySelected)(element))) { 43390 return; 43391 } 43392 const move = shiftKey ? outdentListItems : indentListItems; 43393 if (move(registry)) { 43394 event.preventDefault(); 43395 } 43396 } 43397 return subscribeOwnedListener2( 43398 element, 43399 "keydown", 43400 onKeyDown, 43401 true 43402 ); 43403 }, 43404 [registry] 43405 ); 43406 } 43407 43408 // packages/block-library/build-module/list-item/hooks/use-multi-select-tab.mjs 43409 var import_compose33 = __toESM(require_compose(), 1); 43410 var import_keycodes4 = __toESM(require_keycodes(), 1); 43411 var import_block_editor121 = __toESM(require_block_editor(), 1); 43412 var import_data57 = __toESM(require_data(), 1); 43413 function useMultiSelectTab(clientId) { 43414 const registry = (0, import_data57.useRegistry)(); 43415 const isActive = (0, import_data57.useSelect)( 43416 (select10) => { 43417 const { 43418 hasMultiSelection, 43419 getMultiSelectedBlockClientIds, 43420 getBlockName 43421 } = select10(import_block_editor121.store); 43422 if (!hasMultiSelection()) { 43423 return false; 43424 } 43425 const clientIds = getMultiSelectedBlockClientIds(); 43426 return clientIds[0] === clientId && clientIds.every( 43427 (id) => getBlockName(id) === "core/list-item" 43428 ); 43429 }, 43430 [clientId] 43431 ); 43432 return (0, import_compose33.useRefEffect)( 43433 (element) => { 43434 if (!isActive) { 43435 return; 43436 } 43437 function onKeyDown(event) { 43438 const { keyCode, shiftKey, altKey, metaKey, ctrlKey } = event; 43439 if (keyCode !== import_keycodes4.TAB || event.defaultPrevented || altKey || metaKey || ctrlKey) { 43440 return; 43441 } 43442 if (!event.target.contains(element)) { 43443 return; 43444 } 43445 if (shiftKey) { 43446 if (outdentListItems(registry)) { 43447 event.preventDefault(); 43448 } 43449 } else if (indentListItems(registry)) { 43450 event.preventDefault(); 43451 } 43452 } 43453 const { ownerDocument: ownerDocument2 } = element; 43454 ownerDocument2.addEventListener("keydown", onKeyDown, true); 43455 return () => { 43456 ownerDocument2.removeEventListener("keydown", onKeyDown, true); 43457 }; 43458 }, 43459 [isActive, registry] 43460 ); 43461 } 43462 43463 // packages/block-library/build-module/list-item/hooks/use-merge.mjs 43464 var import_data58 = __toESM(require_data(), 1); 43465 var import_block_editor122 = __toESM(require_block_editor(), 1); 43466 var import_blocks48 = __toESM(require_blocks(), 1); 43467 function useMerge(clientId, onMerge) { 43468 const registry = (0, import_data58.useRegistry)(); 43469 return (forward) => { 43470 const select10 = registry.select(import_block_editor122.store); 43471 const { 43472 getPreviousBlockClientId, 43473 getNextBlockClientId, 43474 getBlockOrder, 43475 getBlockIndex, 43476 getBlockRootClientId, 43477 getBlockName, 43478 getBlock 43479 } = select10; 43480 const { mergeBlocks, moveBlocksToPosition, removeBlock, insertBlocks } = registry.dispatch(import_block_editor122.store); 43481 function getTrailingId(id) { 43482 const order = getBlockOrder(id); 43483 if (!order.length) { 43484 return id; 43485 } 43486 return getTrailingId(order[order.length - 1]); 43487 } 43488 function mergeWithNested(clientIdA, clientIdB) { 43489 registry.batch(() => { 43490 const [nestedListClientId] = getBlockOrder(clientIdB); 43491 if (nestedListClientId) { 43492 if (getPreviousBlockClientId(clientIdB) === clientIdA && !getBlockOrder(clientIdA).length) { 43493 moveBlocksToPosition( 43494 [nestedListClientId], 43495 clientIdB, 43496 clientIdA 43497 ); 43498 } else if (getOutdentTarget(select10, clientIdB) === clientIdA) { 43499 moveBlocksToPosition( 43500 getBlockOrder(nestedListClientId), 43501 nestedListClientId, 43502 getBlockRootClientId(clientIdB), 43503 getBlockIndex(clientIdB) + 1 43504 ); 43505 } else { 43506 moveBlocksToPosition( 43507 getBlockOrder(nestedListClientId), 43508 nestedListClientId, 43509 getBlockRootClientId(clientIdA) 43510 ); 43511 } 43512 } 43513 const listId = getBlockRootClientId(clientIdB); 43514 mergeBlocks(clientIdA, clientIdB); 43515 if (!getBlockOrder(listId).length) { 43516 removeBlock(listId, false); 43517 } 43518 }); 43519 } 43520 if (forward) { 43521 const innerListId = getBlockOrder(clientId)[0]; 43522 let nextBlockClientId; 43523 let listItemId = clientId; 43524 if (innerListId) { 43525 nextBlockClientId = getBlockOrder(innerListId)[0]; 43526 } else { 43527 while (!(nextBlockClientId = getNextBlockClientId(listItemId))) { 43528 const parentLi = getOutdentTarget(select10, listItemId); 43529 if (!parentLi) { 43530 break; 43531 } 43532 listItemId = parentLi; 43533 } 43534 } 43535 if (!nextBlockClientId) { 43536 const outerListId = getBlockRootClientId(listItemId); 43537 const followingBlockId = getNextBlockClientId(outerListId); 43538 if (followingBlockId) { 43539 if (getBlockName(followingBlockId) === "core/list") { 43540 registry.batch(() => { 43541 moveBlocksToPosition( 43542 getBlockOrder(followingBlockId), 43543 followingBlockId, 43544 outerListId 43545 ); 43546 removeBlock(followingBlockId, false); 43547 }); 43548 } else { 43549 const transformed = (0, import_blocks48.switchToBlockType)( 43550 getBlock(followingBlockId), 43551 "core/list" 43552 ); 43553 const newInnerBlocks = transformed?.[0]?.innerBlocks; 43554 if (newInnerBlocks?.length) { 43555 registry.batch(() => { 43556 insertBlocks( 43557 newInnerBlocks, 43558 void 0, 43559 outerListId, 43560 false 43561 ); 43562 removeBlock(followingBlockId, false); 43563 }); 43564 } 43565 } 43566 } 43567 } else { 43568 mergeWithNested(clientId, nextBlockClientId); 43569 } 43570 } else { 43571 const previousBlockClientId = getPreviousBlockClientId(clientId); 43572 if (previousBlockClientId) { 43573 const trailingId = getTrailingId(previousBlockClientId); 43574 mergeWithNested(trailingId, clientId); 43575 return; 43576 } 43577 const parentListItemId = getOutdentTarget(select10, clientId); 43578 if (parentListItemId) { 43579 mergeWithNested(parentListItemId, clientId); 43580 return; 43581 } 43582 const blockOrder = getBlockOrder(clientId); 43583 if ((0, import_blocks48.isUnmodifiedBlock)(getBlock(clientId), "content") && blockOrder.length > 0) { 43584 registry.batch(() => { 43585 outdentListItems( 43586 registry, 43587 getBlockOrder(blockOrder[0]) 43588 ); 43589 removeBlock(clientId, true); 43590 }); 43591 } else { 43592 onMerge(forward); 43593 } 43594 } 43595 }; 43596 } 43597 43598 // packages/block-library/build-module/list-item/edit.mjs 43599 var import_jsx_runtime323 = __toESM(require_jsx_runtime(), 1); 43600 function IndentUI2({ clientId }) { 43601 const registry = (0, import_data59.useRegistry)(); 43602 const { canIndent, canOutdent } = (0, import_data59.useSelect)( 43603 (select10) => { 43604 const storeSelect = select10(import_block_editor123.store); 43605 return { 43606 canIndent: !!getIndentTarget(storeSelect, clientId), 43607 canOutdent: !!getOutdentTarget(storeSelect, clientId) 43608 }; 43609 }, 43610 [clientId] 43611 ); 43612 return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(import_jsx_runtime323.Fragment, { children: [ 43613 /* @__PURE__ */ (0, import_jsx_runtime323.jsx)( 43614 import_components62.ToolbarButton, 43615 { 43616 icon: (0, import_i18n104.isRTL)() ? format_outdent_rtl_default : format_outdent_default, 43617 title: (0, import_i18n104.__)("Outdent"), 43618 shortcut: import_keycodes5.displayShortcut.shift("Tab"), 43619 description: (0, import_i18n104.__)("Outdent list item"), 43620 disabled: !canOutdent, 43621 onClick: () => outdentListItems(registry) 43622 } 43623 ), 43624 /* @__PURE__ */ (0, import_jsx_runtime323.jsx)( 43625 import_components62.ToolbarButton, 43626 { 43627 icon: (0, import_i18n104.isRTL)() ? format_indent_rtl_default : format_indent_default, 43628 title: (0, import_i18n104.__)("Indent"), 43629 shortcut: "Tab", 43630 description: (0, import_i18n104.__)("Indent list item"), 43631 disabled: !canIndent, 43632 onClick: () => indentListItems(registry, clientId) 43633 } 43634 ) 43635 ] }); 43636 } 43637 function ListItemEdit({ 43638 attributes: attributes2, 43639 setAttributes, 43640 clientId, 43641 mergeBlocks 43642 }) { 43643 const { placeholder: placeholder2, content } = attributes2; 43644 const blockProps = (0, import_block_editor123.useBlockProps)(); 43645 const innerBlocksProps = (0, import_block_editor123.useInnerBlocksProps)(blockProps, { 43646 renderAppender: false, 43647 __unstableDisableDropZone: true 43648 }); 43649 const useEnterRef = useEnter2(clientId); 43650 const useTabRef = useTab(); 43651 const useMultiSelectTabRef = useMultiSelectTab(clientId); 43652 const onMerge = useMerge(clientId, mergeBlocks); 43653 return /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)(import_jsx_runtime323.Fragment, { children: [ 43654 /* @__PURE__ */ (0, import_jsx_runtime323.jsxs)("li", { ...innerBlocksProps, children: [ 43655 /* @__PURE__ */ (0, import_jsx_runtime323.jsx)( 43656 import_block_editor123.RichText, 43657 { 43658 ref: (0, import_compose34.useMergeRefs)([ 43659 useEnterRef, 43660 useTabRef, 43661 useMultiSelectTabRef 43662 ]), 43663 identifier: "content", 43664 tagName: "div", 43665 onChange: (nextContent) => setAttributes({ content: nextContent }), 43666 value: content, 43667 "aria-label": (0, import_i18n104.__)("List text"), 43668 placeholder: placeholder2 || (0, import_i18n104.__)("List"), 43669 onMerge 43670 } 43671 ), 43672 innerBlocksProps.children 43673 ] }), 43674 /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(import_block_editor123.BlockControls, { group: "block", children: /* @__PURE__ */ (0, import_jsx_runtime323.jsx)(IndentUI2, { clientId }) }) 43675 ] }); 43676 } 43677 43678 // packages/block-library/build-module/list-item/save.mjs 43679 var import_block_editor124 = __toESM(require_block_editor(), 1); 43680 var import_jsx_runtime324 = __toESM(require_jsx_runtime(), 1); 43681 function save25({ attributes: attributes2 }) { 43682 return /* @__PURE__ */ (0, import_jsx_runtime324.jsxs)("li", { ...import_block_editor124.useBlockProps.save(), children: [ 43683 /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(import_block_editor124.RichText.Content, { value: attributes2.content }), 43684 /* @__PURE__ */ (0, import_jsx_runtime324.jsx)(import_block_editor124.InnerBlocks.Content, {}) 43685 ] }); 43686 } 43687 43688 // packages/block-library/build-module/list-item/transforms.mjs 43689 var import_blocks49 = __toESM(require_blocks(), 1); 43690 var transforms15 = { 43691 to: [ 43692 { 43693 type: "block", 43694 blocks: ["core/paragraph"], 43695 transform: (attributes2, innerBlocks = []) => [ 43696 (0, import_blocks49.createBlock)("core/paragraph", attributes2), 43697 ...innerBlocks.map((block) => (0, import_blocks49.cloneBlock)(block)) 43698 ] 43699 } 43700 ] 43701 }; 43702 var transforms_default16 = transforms15; 43703 43704 // packages/block-library/build-module/list-item/index.mjs 43705 var { fieldsKey: fieldsKey9, formKey: formKey9 } = unlock(import_blocks50.privateApis); 43706 var { name: name45 } = block_default45; 43707 var settings45 = { 43708 icon: list_item_default, 43709 edit: ListItemEdit, 43710 save: save25, 43711 merge(attributes2, attributesToMerge) { 43712 return { 43713 ...attributes2, 43714 content: attributes2.content + attributesToMerge.content 43715 }; 43716 }, 43717 transforms: transforms_default16, 43718 [unlock(import_block_editor125.privateApis).requiresWrapperOnCopy]: true, 43719 __experimentalLabel(attributes2, { context }) { 43720 const { content } = attributes2; 43721 const customName = attributes2?.metadata?.name; 43722 const hasContent = content?.trim().length > 0; 43723 if (context === "list-view" && (customName || hasContent)) { 43724 return customName || content; 43725 } 43726 if (context === "breadcrumb" && customName) { 43727 return customName; 43728 } 43729 } 43730 }; 43731 if (window.__experimentalContentOnlyInspectorFields) { 43732 settings45[fieldsKey9] = [ 43733 { 43734 id: "content", 43735 label: (0, import_i18n105.__)("Content"), 43736 type: "text", 43737 Edit: "rich-text" 43738 // TODO: replace with custom component 43739 } 43740 ]; 43741 settings45[formKey9] = { 43742 fields: ["content"] 43743 }; 43744 } 43745 var init45 = () => initBlock({ name: name45, metadata: block_default45, settings: settings45 }); 43746 43747 // packages/block-library/build-module/loginout/index.mjs 43748 var loginout_exports = {}; 43749 __export(loginout_exports, { 43750 init: () => init46, 43751 metadata: () => block_default46, 43752 name: () => name46, 43753 settings: () => settings46 43754 }); 43755 43756 // packages/block-library/build-module/loginout/edit.mjs 43757 var import_block_editor126 = __toESM(require_block_editor(), 1); 43758 var import_components63 = __toESM(require_components(), 1); 43759 var import_i18n106 = __toESM(require_i18n(), 1); 43760 var import_jsx_runtime325 = __toESM(require_jsx_runtime(), 1); 43761 function LoginOutEdit({ attributes: attributes2, setAttributes }) { 43762 const { displayLoginAsForm, redirectToCurrent } = attributes2; 43763 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 43764 return /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)(import_jsx_runtime325.Fragment, { children: [ 43765 /* @__PURE__ */ (0, import_jsx_runtime325.jsx)(import_block_editor126.InspectorControls, { children: /* @__PURE__ */ (0, import_jsx_runtime325.jsxs)( 43766 import_components63.__experimentalToolsPanel, 43767 { 43768 label: (0, import_i18n106.__)("Settings"), 43769 resetAll: () => { 43770 setAttributes({ 43771 displayLoginAsForm: false, 43772 redirectToCurrent: true 43773 }); 43774 }, 43775 dropdownMenuProps, 43776 children: [ 43777 /* @__PURE__ */ (0, import_jsx_runtime325.jsx)( 43778 import_components63.__experimentalToolsPanelItem, 43779 { 43780 label: (0, import_i18n106.__)("Display login as form"), 43781 isShownByDefault: true, 43782 hasValue: () => displayLoginAsForm, 43783 onDeselect: () => setAttributes({ displayLoginAsForm: false }), 43784 children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)( 43785 import_components63.ToggleControl, 43786 { 43787 label: (0, import_i18n106.__)("Display login as form"), 43788 checked: displayLoginAsForm, 43789 onChange: () => setAttributes({ 43790 displayLoginAsForm: !displayLoginAsForm 43791 }) 43792 } 43793 ) 43794 } 43795 ), 43796 /* @__PURE__ */ (0, import_jsx_runtime325.jsx)( 43797 import_components63.__experimentalToolsPanelItem, 43798 { 43799 label: (0, import_i18n106.__)("Redirect to current URL"), 43800 isShownByDefault: true, 43801 hasValue: () => !redirectToCurrent, 43802 onDeselect: () => setAttributes({ redirectToCurrent: true }), 43803 children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)( 43804 import_components63.ToggleControl, 43805 { 43806 label: (0, import_i18n106.__)("Redirect to current URL"), 43807 checked: redirectToCurrent, 43808 onChange: () => setAttributes({ 43809 redirectToCurrent: !redirectToCurrent 43810 }) 43811 } 43812 ) 43813 } 43814 ) 43815 ] 43816 } 43817 ) }), 43818 /* @__PURE__ */ (0, import_jsx_runtime325.jsx)( 43819 "div", 43820 { 43821 ...(0, import_block_editor126.useBlockProps)({ 43822 className: "logged-in" 43823 }), 43824 children: /* @__PURE__ */ (0, import_jsx_runtime325.jsx)("a", { href: "#login-pseudo-link", children: (0, import_i18n106.__)("Log out") }) 43825 } 43826 ) 43827 ] }); 43828 } 43829 43830 // packages/block-library/build-module/loginout/block.json 43831 var block_default46 = { 43832 $schema: "https://schemas.wp.org/trunk/block.json", 43833 apiVersion: 3, 43834 name: "core/loginout", 43835 title: "Login/out", 43836 category: "theme", 43837 description: "Show login & logout links.", 43838 keywords: ["login", "logout", "form"], 43839 textdomain: "default", 43840 attributes: { 43841 displayLoginAsForm: { 43842 type: "boolean", 43843 default: false 43844 }, 43845 redirectToCurrent: { 43846 type: "boolean", 43847 default: true 43848 } 43849 }, 43850 example: { 43851 viewportWidth: 350 43852 }, 43853 supports: { 43854 anchor: true, 43855 className: true, 43856 color: { 43857 background: true, 43858 text: false, 43859 gradients: true, 43860 link: true 43861 }, 43862 spacing: { 43863 margin: true, 43864 padding: true, 43865 __experimentalDefaultControls: { 43866 margin: false, 43867 padding: false 43868 } 43869 }, 43870 typography: { 43871 fontSize: true, 43872 lineHeight: true, 43873 __experimentalFontFamily: true, 43874 __experimentalFontWeight: true, 43875 __experimentalFontStyle: true, 43876 __experimentalTextTransform: true, 43877 __experimentalTextDecoration: true, 43878 __experimentalLetterSpacing: true, 43879 __experimentalDefaultControls: { 43880 fontSize: true 43881 } 43882 }, 43883 __experimentalBorder: { 43884 radius: true, 43885 color: true, 43886 width: true, 43887 style: true 43888 }, 43889 interactivity: { 43890 clientNavigation: true 43891 } 43892 }, 43893 style: "wp-block-loginout" 43894 }; 43895 43896 // packages/block-library/build-module/loginout/index.mjs 43897 var { name: name46 } = block_default46; 43898 var settings46 = { 43899 icon: login_default, 43900 edit: LoginOutEdit 43901 }; 43902 var init46 = () => initBlock({ name: name46, metadata: block_default46, settings: settings46 }); 43903 43904 // packages/block-library/build-module/media-text/index.mjs 43905 var media_text_exports = {}; 43906 __export(media_text_exports, { 43907 init: () => init47, 43908 metadata: () => block_default47, 43909 name: () => name47, 43910 settings: () => settings47 43911 }); 43912 var import_i18n110 = __toESM(require_i18n(), 1); 43913 var import_blocks52 = __toESM(require_blocks(), 1); 43914 43915 // packages/block-library/build-module/media-text/constants.mjs 43916 var import_i18n107 = __toESM(require_i18n(), 1); 43917 var DEFAULT_MEDIA_SIZE_SLUG4 = "full"; 43918 var WIDTH_CONSTRAINT_PERCENTAGE = 15; 43919 var LINK_DESTINATION_NONE3 = "none"; 43920 var LINK_DESTINATION_MEDIA3 = "media"; 43921 var LINK_DESTINATION_ATTACHMENT3 = "attachment"; 43922 var TEMPLATE10 = [ 43923 [ 43924 "core/paragraph", 43925 { 43926 placeholder: (0, import_i18n107._x)("Content\u2026", "content placeholder") 43927 } 43928 ] 43929 ]; 43930 43931 // packages/block-library/build-module/media-text/deprecated.mjs 43932 var import_block_editor127 = __toESM(require_block_editor(), 1); 43933 var import_compose35 = __toESM(require_compose(), 1); 43934 var import_jsx_runtime326 = __toESM(require_jsx_runtime(), 1); 43935 var v1ToV5ImageFillStyles = (url, focalPoint) => { 43936 return url ? { 43937 backgroundImage: `url($url})`, 43938 backgroundPosition: focalPoint ? `$focalPoint.x * 100}% $focalPoint.y * 100}%` : `50% 50%` 43939 } : {}; 43940 }; 43941 var v6ToV7ImageFillStyles = (url, focalPoint) => { 43942 return url ? { 43943 backgroundImage: `url($url})`, 43944 backgroundPosition: focalPoint ? `$Math.round(focalPoint.x * 100)}% $Math.round( 43945 focalPoint.y * 100 43946 )}%` : `50% 50%` 43947 } : {}; 43948 }; 43949 var DEFAULT_MEDIA_WIDTH = 50; 43950 var noop2 = () => { 43951 }; 43952 var migrateCustomColors3 = (attributes2) => { 43953 if (!attributes2.customBackgroundColor) { 43954 return attributes2; 43955 } 43956 const style2 = { 43957 color: { 43958 background: attributes2.customBackgroundColor 43959 } 43960 }; 43961 const { customBackgroundColor, ...restAttributes } = attributes2; 43962 return { 43963 ...restAttributes, 43964 style: style2 43965 }; 43966 }; 43967 var migrateDefaultAlign = (attributes2) => { 43968 if (attributes2.align) { 43969 return attributes2; 43970 } 43971 return { 43972 ...attributes2, 43973 align: "wide" 43974 }; 43975 }; 43976 var v0Attributes = { 43977 align: { 43978 type: "string", 43979 default: "wide" 43980 }, 43981 mediaAlt: { 43982 type: "string", 43983 source: "attribute", 43984 selector: "figure img", 43985 attribute: "alt", 43986 default: "" 43987 }, 43988 mediaPosition: { 43989 type: "string", 43990 default: "left" 43991 }, 43992 mediaId: { 43993 type: "number" 43994 }, 43995 mediaType: { 43996 type: "string" 43997 }, 43998 mediaWidth: { 43999 type: "number", 44000 default: 50 44001 }, 44002 isStackedOnMobile: { 44003 type: "boolean", 44004 default: false 44005 } 44006 }; 44007 var v4ToV5BlockAttributes = { 44008 ...v0Attributes, 44009 isStackedOnMobile: { 44010 type: "boolean", 44011 default: true 44012 }, 44013 mediaUrl: { 44014 type: "string", 44015 source: "attribute", 44016 selector: "figure video,figure img", 44017 attribute: "src" 44018 }, 44019 mediaLink: { 44020 type: "string" 44021 }, 44022 linkDestination: { 44023 type: "string" 44024 }, 44025 linkTarget: { 44026 type: "string", 44027 source: "attribute", 44028 selector: "figure a", 44029 attribute: "target" 44030 }, 44031 href: { 44032 type: "string", 44033 source: "attribute", 44034 selector: "figure a", 44035 attribute: "href" 44036 }, 44037 rel: { 44038 type: "string", 44039 source: "attribute", 44040 selector: "figure a", 44041 attribute: "rel" 44042 }, 44043 linkClass: { 44044 type: "string", 44045 source: "attribute", 44046 selector: "figure a", 44047 attribute: "class" 44048 }, 44049 mediaSizeSlug: { 44050 type: "string" 44051 }, 44052 verticalAlignment: { 44053 type: "string" 44054 }, 44055 imageFill: { 44056 type: "boolean" 44057 }, 44058 focalPoint: { 44059 type: "object" 44060 } 44061 }; 44062 var v6Attributes = { 44063 ...v4ToV5BlockAttributes, 44064 mediaAlt: { 44065 type: "string", 44066 source: "attribute", 44067 selector: "figure img", 44068 attribute: "alt", 44069 default: "", 44070 role: "content" 44071 }, 44072 mediaId: { 44073 type: "number", 44074 role: "content" 44075 }, 44076 mediaUrl: { 44077 type: "string", 44078 source: "attribute", 44079 selector: "figure video,figure img", 44080 attribute: "src", 44081 role: "content" 44082 }, 44083 href: { 44084 type: "string", 44085 source: "attribute", 44086 selector: "figure a", 44087 attribute: "href", 44088 role: "content" 44089 }, 44090 mediaType: { 44091 type: "string", 44092 role: "content" 44093 } 44094 }; 44095 var v7Attributes = { 44096 ...v6Attributes, 44097 align: { 44098 type: "string", 44099 // v7 changed the default for the `align` attribute. 44100 default: "none" 44101 }, 44102 // New attribute. 44103 useFeaturedImage: { 44104 type: "boolean", 44105 default: false 44106 } 44107 }; 44108 var v4ToV5Supports = { 44109 anchor: true, 44110 align: ["wide", "full"], 44111 html: false, 44112 color: { 44113 gradients: true, 44114 link: true 44115 } 44116 }; 44117 var v6Supports = { 44118 ...v4ToV5Supports, 44119 color: { 44120 gradients: true, 44121 link: true, 44122 __experimentalDefaultControls: { 44123 background: true, 44124 text: true 44125 } 44126 }, 44127 spacing: { 44128 margin: true, 44129 padding: true 44130 }, 44131 typography: { 44132 fontSize: true, 44133 lineHeight: true, 44134 __experimentalFontFamily: true, 44135 __experimentalFontWeight: true, 44136 __experimentalFontStyle: true, 44137 __experimentalTextTransform: true, 44138 __experimentalTextDecoration: true, 44139 __experimentalLetterSpacing: true, 44140 __experimentalDefaultControls: { 44141 fontSize: true 44142 } 44143 } 44144 }; 44145 var v7Supports = { 44146 ...v6Supports, 44147 __experimentalBorder: { 44148 color: true, 44149 radius: true, 44150 style: true, 44151 width: true, 44152 __experimentalDefaultControls: { 44153 color: true, 44154 radius: true, 44155 style: true, 44156 width: true 44157 } 44158 }, 44159 color: { 44160 gradients: true, 44161 heading: true, 44162 link: true, 44163 __experimentalDefaultControls: { 44164 background: true, 44165 text: true 44166 } 44167 }, 44168 interactivity: { 44169 clientNavigation: true 44170 } 44171 }; 44172 var v74 = { 44173 attributes: v7Attributes, 44174 supports: v7Supports, 44175 usesContext: ["postId", "postType"], 44176 save({ attributes: attributes2 }) { 44177 const { 44178 isStackedOnMobile, 44179 mediaAlt, 44180 mediaPosition: mediaPosition3, 44181 mediaType, 44182 mediaUrl, 44183 mediaWidth, 44184 mediaId, 44185 verticalAlignment, 44186 imageFill, 44187 focalPoint, 44188 linkClass, 44189 href, 44190 linkTarget, 44191 rel 44192 } = attributes2; 44193 const mediaSizeSlug = attributes2.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 44194 const newRel = !rel ? void 0 : rel; 44195 const imageClasses = clsx_default({ 44196 [`wp-image-${mediaId}`]: mediaId && mediaType === "image", 44197 [`size-${mediaSizeSlug}`]: mediaId && mediaType === "image" 44198 }); 44199 let image = mediaUrl ? /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44200 "img", 44201 { 44202 src: mediaUrl, 44203 alt: mediaAlt, 44204 className: imageClasses || null 44205 } 44206 ) : null; 44207 if (href) { 44208 image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44209 "a", 44210 { 44211 className: linkClass, 44212 href, 44213 target: linkTarget, 44214 rel: newRel, 44215 children: image 44216 } 44217 ); 44218 } 44219 const mediaTypeRenders = { 44220 image: () => image, 44221 video: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("video", { controls: true, src: mediaUrl }) 44222 }; 44223 const className = clsx_default({ 44224 "has-media-on-the-right": "right" === mediaPosition3, 44225 "is-stacked-on-mobile": isStackedOnMobile, 44226 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 44227 "is-image-fill": imageFill 44228 }); 44229 const backgroundStyles = imageFill ? v6ToV7ImageFillStyles(mediaUrl, focalPoint) : {}; 44230 let gridTemplateColumns; 44231 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 44232 gridTemplateColumns = "right" === mediaPosition3 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 44233 } 44234 const style2 = { 44235 gridTemplateColumns 44236 }; 44237 if ("right" === mediaPosition3) { 44238 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { ...import_block_editor127.useBlockProps.save({ className, style: style2 }), children: [ 44239 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44240 "div", 44241 { 44242 ...import_block_editor127.useInnerBlocksProps.save({ 44243 className: "wp-block-media-text__content" 44244 }) 44245 } 44246 ), 44247 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44248 "figure", 44249 { 44250 className: "wp-block-media-text__media", 44251 style: backgroundStyles, 44252 children: (mediaTypeRenders[mediaType] || noop2)() 44253 } 44254 ) 44255 ] }); 44256 } 44257 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { ...import_block_editor127.useBlockProps.save({ className, style: style2 }), children: [ 44258 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44259 "figure", 44260 { 44261 className: "wp-block-media-text__media", 44262 style: backgroundStyles, 44263 children: (mediaTypeRenders[mediaType] || noop2)() 44264 } 44265 ), 44266 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44267 "div", 44268 { 44269 ...import_block_editor127.useInnerBlocksProps.save({ 44270 className: "wp-block-media-text__content" 44271 }) 44272 } 44273 ) 44274 ] }); 44275 } 44276 }; 44277 var v65 = { 44278 attributes: v6Attributes, 44279 supports: v6Supports, 44280 save({ attributes: attributes2 }) { 44281 const { 44282 isStackedOnMobile, 44283 mediaAlt, 44284 mediaPosition: mediaPosition3, 44285 mediaType, 44286 mediaUrl, 44287 mediaWidth, 44288 mediaId, 44289 verticalAlignment, 44290 imageFill, 44291 focalPoint, 44292 linkClass, 44293 href, 44294 linkTarget, 44295 rel 44296 } = attributes2; 44297 const mediaSizeSlug = attributes2.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 44298 const newRel = !rel ? void 0 : rel; 44299 const imageClasses = clsx_default({ 44300 [`wp-image-${mediaId}`]: mediaId && mediaType === "image", 44301 [`size-${mediaSizeSlug}`]: mediaId && mediaType === "image" 44302 }); 44303 let image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44304 "img", 44305 { 44306 src: mediaUrl, 44307 alt: mediaAlt, 44308 className: imageClasses || null 44309 } 44310 ); 44311 if (href) { 44312 image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44313 "a", 44314 { 44315 className: linkClass, 44316 href, 44317 target: linkTarget, 44318 rel: newRel, 44319 children: image 44320 } 44321 ); 44322 } 44323 const mediaTypeRenders = { 44324 image: () => image, 44325 video: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("video", { controls: true, src: mediaUrl }) 44326 }; 44327 const className = clsx_default({ 44328 "has-media-on-the-right": "right" === mediaPosition3, 44329 "is-stacked-on-mobile": isStackedOnMobile, 44330 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 44331 "is-image-fill": imageFill 44332 }); 44333 const backgroundStyles = imageFill ? v6ToV7ImageFillStyles(mediaUrl, focalPoint) : {}; 44334 let gridTemplateColumns; 44335 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 44336 gridTemplateColumns = "right" === mediaPosition3 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 44337 } 44338 const style2 = { 44339 gridTemplateColumns 44340 }; 44341 if ("right" === mediaPosition3) { 44342 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { ...import_block_editor127.useBlockProps.save({ className, style: style2 }), children: [ 44343 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44344 "div", 44345 { 44346 ...import_block_editor127.useInnerBlocksProps.save({ 44347 className: "wp-block-media-text__content" 44348 }) 44349 } 44350 ), 44351 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44352 "figure", 44353 { 44354 className: "wp-block-media-text__media", 44355 style: backgroundStyles, 44356 children: (mediaTypeRenders[mediaType] || noop2)() 44357 } 44358 ) 44359 ] }); 44360 } 44361 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { ...import_block_editor127.useBlockProps.save({ className, style: style2 }), children: [ 44362 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44363 "figure", 44364 { 44365 className: "wp-block-media-text__media", 44366 style: backgroundStyles, 44367 children: (mediaTypeRenders[mediaType] || noop2)() 44368 } 44369 ), 44370 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44371 "div", 44372 { 44373 ...import_block_editor127.useInnerBlocksProps.save({ 44374 className: "wp-block-media-text__content" 44375 }) 44376 } 44377 ) 44378 ] }); 44379 }, 44380 migrate: migrateDefaultAlign, 44381 isEligible(attributes2, innerBlocks, { block }) { 44382 const { attributes: finalizedAttributes } = block; 44383 return attributes2.align === void 0 && !!finalizedAttributes.className?.includes("alignwide"); 44384 } 44385 }; 44386 var v55 = { 44387 attributes: v4ToV5BlockAttributes, 44388 supports: v4ToV5Supports, 44389 save({ attributes: attributes2 }) { 44390 const { 44391 isStackedOnMobile, 44392 mediaAlt, 44393 mediaPosition: mediaPosition3, 44394 mediaType, 44395 mediaUrl, 44396 mediaWidth, 44397 mediaId, 44398 verticalAlignment, 44399 imageFill, 44400 focalPoint, 44401 linkClass, 44402 href, 44403 linkTarget, 44404 rel 44405 } = attributes2; 44406 const mediaSizeSlug = attributes2.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 44407 const newRel = !rel ? void 0 : rel; 44408 const imageClasses = clsx_default({ 44409 [`wp-image-${mediaId}`]: mediaId && mediaType === "image", 44410 [`size-${mediaSizeSlug}`]: mediaId && mediaType === "image" 44411 }); 44412 let image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44413 "img", 44414 { 44415 src: mediaUrl, 44416 alt: mediaAlt, 44417 className: imageClasses || null 44418 } 44419 ); 44420 if (href) { 44421 image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44422 "a", 44423 { 44424 className: linkClass, 44425 href, 44426 target: linkTarget, 44427 rel: newRel, 44428 children: image 44429 } 44430 ); 44431 } 44432 const mediaTypeRenders = { 44433 image: () => image, 44434 video: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("video", { controls: true, src: mediaUrl }) 44435 }; 44436 const className = clsx_default({ 44437 "has-media-on-the-right": "right" === mediaPosition3, 44438 "is-stacked-on-mobile": isStackedOnMobile, 44439 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 44440 "is-image-fill": imageFill 44441 }); 44442 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 44443 let gridTemplateColumns; 44444 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 44445 gridTemplateColumns = "right" === mediaPosition3 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 44446 } 44447 const style2 = { 44448 gridTemplateColumns 44449 }; 44450 if ("right" === mediaPosition3) { 44451 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { ...import_block_editor127.useBlockProps.save({ className, style: style2 }), children: [ 44452 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44453 "div", 44454 { 44455 ...import_block_editor127.useInnerBlocksProps.save({ 44456 className: "wp-block-media-text__content" 44457 }) 44458 } 44459 ), 44460 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44461 "figure", 44462 { 44463 className: "wp-block-media-text__media", 44464 style: backgroundStyles, 44465 children: (mediaTypeRenders[mediaType] || noop2)() 44466 } 44467 ) 44468 ] }); 44469 } 44470 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { ...import_block_editor127.useBlockProps.save({ className, style: style2 }), children: [ 44471 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44472 "figure", 44473 { 44474 className: "wp-block-media-text__media", 44475 style: backgroundStyles, 44476 children: (mediaTypeRenders[mediaType] || noop2)() 44477 } 44478 ), 44479 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44480 "div", 44481 { 44482 ...import_block_editor127.useInnerBlocksProps.save({ 44483 className: "wp-block-media-text__content" 44484 }) 44485 } 44486 ) 44487 ] }); 44488 }, 44489 migrate: migrateDefaultAlign 44490 }; 44491 var v45 = { 44492 attributes: v4ToV5BlockAttributes, 44493 supports: v4ToV5Supports, 44494 save({ attributes: attributes2 }) { 44495 const { 44496 isStackedOnMobile, 44497 mediaAlt, 44498 mediaPosition: mediaPosition3, 44499 mediaType, 44500 mediaUrl, 44501 mediaWidth, 44502 mediaId, 44503 verticalAlignment, 44504 imageFill, 44505 focalPoint, 44506 linkClass, 44507 href, 44508 linkTarget, 44509 rel 44510 } = attributes2; 44511 const mediaSizeSlug = attributes2.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 44512 const newRel = !rel ? void 0 : rel; 44513 const imageClasses = clsx_default({ 44514 [`wp-image-${mediaId}`]: mediaId && mediaType === "image", 44515 [`size-${mediaSizeSlug}`]: mediaId && mediaType === "image" 44516 }); 44517 let image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44518 "img", 44519 { 44520 src: mediaUrl, 44521 alt: mediaAlt, 44522 className: imageClasses || null 44523 } 44524 ); 44525 if (href) { 44526 image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44527 "a", 44528 { 44529 className: linkClass, 44530 href, 44531 target: linkTarget, 44532 rel: newRel, 44533 children: image 44534 } 44535 ); 44536 } 44537 const mediaTypeRenders = { 44538 image: () => image, 44539 video: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("video", { controls: true, src: mediaUrl }) 44540 }; 44541 const className = clsx_default({ 44542 "has-media-on-the-right": "right" === mediaPosition3, 44543 "is-stacked-on-mobile": isStackedOnMobile, 44544 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 44545 "is-image-fill": imageFill 44546 }); 44547 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 44548 let gridTemplateColumns; 44549 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 44550 gridTemplateColumns = "right" === mediaPosition3 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 44551 } 44552 const style2 = { 44553 gridTemplateColumns 44554 }; 44555 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { ...import_block_editor127.useBlockProps.save({ className, style: style2 }), children: [ 44556 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44557 "figure", 44558 { 44559 className: "wp-block-media-text__media", 44560 style: backgroundStyles, 44561 children: (mediaTypeRenders[mediaType] || noop2)() 44562 } 44563 ), 44564 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44565 "div", 44566 { 44567 ...import_block_editor127.useInnerBlocksProps.save({ 44568 className: "wp-block-media-text__content" 44569 }) 44570 } 44571 ) 44572 ] }); 44573 }, 44574 migrate: migrateDefaultAlign 44575 }; 44576 var v38 = { 44577 attributes: { 44578 ...v0Attributes, 44579 isStackedOnMobile: { 44580 type: "boolean", 44581 default: true 44582 }, 44583 backgroundColor: { 44584 type: "string" 44585 }, 44586 customBackgroundColor: { 44587 type: "string" 44588 }, 44589 mediaLink: { 44590 type: "string" 44591 }, 44592 linkDestination: { 44593 type: "string" 44594 }, 44595 linkTarget: { 44596 type: "string", 44597 source: "attribute", 44598 selector: "figure a", 44599 attribute: "target" 44600 }, 44601 href: { 44602 type: "string", 44603 source: "attribute", 44604 selector: "figure a", 44605 attribute: "href" 44606 }, 44607 rel: { 44608 type: "string", 44609 source: "attribute", 44610 selector: "figure a", 44611 attribute: "rel" 44612 }, 44613 linkClass: { 44614 type: "string", 44615 source: "attribute", 44616 selector: "figure a", 44617 attribute: "class" 44618 }, 44619 verticalAlignment: { 44620 type: "string" 44621 }, 44622 imageFill: { 44623 type: "boolean" 44624 }, 44625 focalPoint: { 44626 type: "object" 44627 } 44628 }, 44629 migrate: (0, import_compose35.compose)(migrateCustomColors3, migrateDefaultAlign), 44630 save({ attributes: attributes2 }) { 44631 const { 44632 backgroundColor, 44633 customBackgroundColor, 44634 isStackedOnMobile, 44635 mediaAlt, 44636 mediaPosition: mediaPosition3, 44637 mediaType, 44638 mediaUrl, 44639 mediaWidth, 44640 mediaId, 44641 verticalAlignment, 44642 imageFill, 44643 focalPoint, 44644 linkClass, 44645 href, 44646 linkTarget, 44647 rel 44648 } = attributes2; 44649 const newRel = !rel ? void 0 : rel; 44650 let image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44651 "img", 44652 { 44653 src: mediaUrl, 44654 alt: mediaAlt, 44655 className: mediaId && mediaType === "image" ? `wp-image-${mediaId}` : null 44656 } 44657 ); 44658 if (href) { 44659 image = /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44660 "a", 44661 { 44662 className: linkClass, 44663 href, 44664 target: linkTarget, 44665 rel: newRel, 44666 children: image 44667 } 44668 ); 44669 } 44670 const mediaTypeRenders = { 44671 image: () => image, 44672 video: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("video", { controls: true, src: mediaUrl }) 44673 }; 44674 const backgroundClass = (0, import_block_editor127.getColorClassName)( 44675 "background-color", 44676 backgroundColor 44677 ); 44678 const className = clsx_default({ 44679 "has-media-on-the-right": "right" === mediaPosition3, 44680 "has-background": backgroundClass || customBackgroundColor, 44681 [backgroundClass]: backgroundClass, 44682 "is-stacked-on-mobile": isStackedOnMobile, 44683 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 44684 "is-image-fill": imageFill 44685 }); 44686 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 44687 let gridTemplateColumns; 44688 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 44689 gridTemplateColumns = "right" === mediaPosition3 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 44690 } 44691 const style2 = { 44692 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 44693 gridTemplateColumns 44694 }; 44695 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className, style: style2, children: [ 44696 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44697 "figure", 44698 { 44699 className: "wp-block-media-text__media", 44700 style: backgroundStyles, 44701 children: (mediaTypeRenders[mediaType] || noop2)() 44702 } 44703 ), 44704 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "wp-block-media-text__content", children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(import_block_editor127.InnerBlocks.Content, {}) }) 44705 ] }); 44706 } 44707 }; 44708 var v211 = { 44709 attributes: { 44710 ...v0Attributes, 44711 backgroundColor: { 44712 type: "string" 44713 }, 44714 customBackgroundColor: { 44715 type: "string" 44716 }, 44717 mediaUrl: { 44718 type: "string", 44719 source: "attribute", 44720 selector: "figure video,figure img", 44721 attribute: "src" 44722 }, 44723 verticalAlignment: { 44724 type: "string" 44725 }, 44726 imageFill: { 44727 type: "boolean" 44728 }, 44729 focalPoint: { 44730 type: "object" 44731 } 44732 }, 44733 migrate: (0, import_compose35.compose)(migrateCustomColors3, migrateDefaultAlign), 44734 save({ attributes: attributes2 }) { 44735 const { 44736 backgroundColor, 44737 customBackgroundColor, 44738 isStackedOnMobile, 44739 mediaAlt, 44740 mediaPosition: mediaPosition3, 44741 mediaType, 44742 mediaUrl, 44743 mediaWidth, 44744 mediaId, 44745 verticalAlignment, 44746 imageFill, 44747 focalPoint 44748 } = attributes2; 44749 const mediaTypeRenders = { 44750 image: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44751 "img", 44752 { 44753 src: mediaUrl, 44754 alt: mediaAlt, 44755 className: mediaId && mediaType === "image" ? `wp-image-${mediaId}` : null 44756 } 44757 ), 44758 video: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("video", { controls: true, src: mediaUrl }) 44759 }; 44760 const backgroundClass = (0, import_block_editor127.getColorClassName)( 44761 "background-color", 44762 backgroundColor 44763 ); 44764 const className = clsx_default({ 44765 "has-media-on-the-right": "right" === mediaPosition3, 44766 [backgroundClass]: backgroundClass, 44767 "is-stacked-on-mobile": isStackedOnMobile, 44768 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 44769 "is-image-fill": imageFill 44770 }); 44771 const backgroundStyles = imageFill ? v1ToV5ImageFillStyles(mediaUrl, focalPoint) : {}; 44772 let gridTemplateColumns; 44773 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 44774 gridTemplateColumns = "right" === mediaPosition3 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 44775 } 44776 const style2 = { 44777 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 44778 gridTemplateColumns 44779 }; 44780 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className, style: style2, children: [ 44781 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)( 44782 "figure", 44783 { 44784 className: "wp-block-media-text__media", 44785 style: backgroundStyles, 44786 children: (mediaTypeRenders[mediaType] || noop2)() 44787 } 44788 ), 44789 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "wp-block-media-text__content", children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(import_block_editor127.InnerBlocks.Content, {}) }) 44790 ] }); 44791 } 44792 }; 44793 var v123 = { 44794 attributes: { 44795 ...v0Attributes, 44796 backgroundColor: { 44797 type: "string" 44798 }, 44799 customBackgroundColor: { 44800 type: "string" 44801 }, 44802 mediaUrl: { 44803 type: "string", 44804 source: "attribute", 44805 selector: "figure video,figure img", 44806 attribute: "src" 44807 } 44808 }, 44809 migrate: migrateDefaultAlign, 44810 save({ attributes: attributes2 }) { 44811 const { 44812 backgroundColor, 44813 customBackgroundColor, 44814 isStackedOnMobile, 44815 mediaAlt, 44816 mediaPosition: mediaPosition3, 44817 mediaType, 44818 mediaUrl, 44819 mediaWidth 44820 } = attributes2; 44821 const mediaTypeRenders = { 44822 image: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("img", { src: mediaUrl, alt: mediaAlt }), 44823 video: () => /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("video", { controls: true, src: mediaUrl }) 44824 }; 44825 const backgroundClass = (0, import_block_editor127.getColorClassName)( 44826 "background-color", 44827 backgroundColor 44828 ); 44829 const className = clsx_default({ 44830 "has-media-on-the-right": "right" === mediaPosition3, 44831 [backgroundClass]: backgroundClass, 44832 "is-stacked-on-mobile": isStackedOnMobile 44833 }); 44834 let gridTemplateColumns; 44835 if (mediaWidth !== DEFAULT_MEDIA_WIDTH) { 44836 gridTemplateColumns = "right" === mediaPosition3 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 44837 } 44838 const style2 = { 44839 backgroundColor: backgroundClass ? void 0 : customBackgroundColor, 44840 gridTemplateColumns 44841 }; 44842 return /* @__PURE__ */ (0, import_jsx_runtime326.jsxs)("div", { className, style: style2, children: [ 44843 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || noop2)() }), 44844 /* @__PURE__ */ (0, import_jsx_runtime326.jsx)("div", { className: "wp-block-media-text__content", children: /* @__PURE__ */ (0, import_jsx_runtime326.jsx)(import_block_editor127.InnerBlocks.Content, {}) }) 44845 ] }); 44846 } 44847 }; 44848 var deprecated_default25 = [v74, v65, v55, v45, v38, v211, v123]; 44849 44850 // packages/block-library/build-module/media-text/edit.mjs 44851 var import_i18n109 = __toESM(require_i18n(), 1); 44852 var import_data61 = __toESM(require_data(), 1); 44853 var import_element80 = __toESM(require_element(), 1); 44854 var import_block_editor129 = __toESM(require_block_editor(), 1); 44855 var import_components65 = __toESM(require_components(), 1); 44856 var import_blob15 = __toESM(require_blob(), 1); 44857 var import_core_data29 = __toESM(require_core_data(), 1); 44858 44859 // packages/block-library/build-module/media-text/media-container.mjs 44860 var import_components64 = __toESM(require_components(), 1); 44861 var import_block_editor128 = __toESM(require_block_editor(), 1); 44862 var import_i18n108 = __toESM(require_i18n(), 1); 44863 var import_compose36 = __toESM(require_compose(), 1); 44864 var import_data60 = __toESM(require_data(), 1); 44865 var import_element79 = __toESM(require_element(), 1); 44866 var import_blob14 = __toESM(require_blob(), 1); 44867 var import_notices10 = __toESM(require_notices(), 1); 44868 44869 // packages/block-library/build-module/media-text/image-fill.mjs 44870 function imageFillStyles(url, focalPoint) { 44871 return url ? { 44872 objectPosition: focalPoint ? `$Math.round(focalPoint.x * 100)}% $Math.round( 44873 focalPoint.y * 100 44874 )}%` : `50% 50%` 44875 } : {}; 44876 } 44877 44878 // packages/block-library/build-module/media-text/media-container.mjs 44879 var import_jsx_runtime327 = __toESM(require_jsx_runtime(), 1); 44880 var ALLOWED_MEDIA_TYPES5 = ["image", "video"]; 44881 var noop3 = () => { 44882 }; 44883 var ResizableBoxContainer = (0, import_element79.forwardRef)( 44884 ({ isSelected, isStackedOnMobile, ...props }, ref) => { 44885 const isMobile = (0, import_compose36.useViewportMatch)("small", "<"); 44886 return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)( 44887 import_components64.ResizableBox, 44888 { 44889 ref, 44890 showHandle: isSelected && (!isMobile || !isStackedOnMobile), 44891 ...props 44892 } 44893 ); 44894 } 44895 ); 44896 function ToolbarEditButton({ 44897 mediaId, 44898 mediaUrl, 44899 onSelectMedia, 44900 toggleUseFeaturedImage, 44901 useFeaturedImage 44902 }) { 44903 return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(import_block_editor128.BlockControls, { group: "other", children: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)( 44904 import_block_editor128.MediaReplaceFlow, 44905 { 44906 mediaId, 44907 mediaURL: mediaUrl, 44908 allowedTypes: ALLOWED_MEDIA_TYPES5, 44909 onSelect: onSelectMedia, 44910 onToggleFeaturedImage: toggleUseFeaturedImage, 44911 useFeaturedImage, 44912 name: mediaUrl ? (0, import_i18n108.__)("Replace") : (0, import_i18n108.__)("Add media"), 44913 onReset: () => onSelectMedia(void 0) 44914 } 44915 ) }); 44916 } 44917 function PlaceholderContainer({ 44918 className, 44919 mediaUrl, 44920 onSelectMedia, 44921 toggleUseFeaturedImage 44922 }) { 44923 const { createErrorNotice } = (0, import_data60.useDispatch)(import_notices10.store); 44924 const onUploadError = (message) => { 44925 createErrorNotice(message, { type: "snackbar" }); 44926 }; 44927 const onFilesPreUpload = (files) => { 44928 if (files.length === 1) { 44929 onSelectMedia({ url: (0, import_blob14.createBlobURL)(files[0]) }); 44930 } 44931 }; 44932 return /* @__PURE__ */ (0, import_jsx_runtime327.jsx)( 44933 import_block_editor128.MediaPlaceholder, 44934 { 44935 icon: /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(import_block_editor128.BlockIcon, { icon: media_default }), 44936 labels: { 44937 title: (0, import_i18n108.__)("Media area") 44938 }, 44939 className, 44940 onSelect: onSelectMedia, 44941 onToggleFeaturedImage: toggleUseFeaturedImage, 44942 allowedTypes: ALLOWED_MEDIA_TYPES5, 44943 onFilesPreUpload, 44944 onError: onUploadError, 44945 disableMediaButtons: mediaUrl 44946 } 44947 ); 44948 } 44949 function MediaContainer(props, ref) { 44950 const { 44951 className, 44952 commitWidthChange, 44953 focalPoint, 44954 imageFill, 44955 isSelected, 44956 isStackedOnMobile, 44957 mediaAlt, 44958 mediaId, 44959 mediaPosition: mediaPosition3, 44960 mediaType, 44961 mediaUrl, 44962 mediaWidth, 44963 onSelectMedia, 44964 onWidthChange, 44965 enableResize, 44966 toggleUseFeaturedImage, 44967 useFeaturedImage, 44968 featuredImageURL, 44969 featuredImageAlt, 44970 refMedia 44971 } = props; 44972 const isTemporaryMedia2 = !mediaId && (0, import_blob14.isBlobURL)(mediaUrl); 44973 const { toggleSelection } = (0, import_data60.useDispatch)(import_block_editor128.store); 44974 const toolbarEditButton = /* @__PURE__ */ (0, import_jsx_runtime327.jsx)( 44975 ToolbarEditButton, 44976 { 44977 onSelectMedia, 44978 mediaUrl: useFeaturedImage && featuredImageURL ? featuredImageURL : mediaUrl, 44979 mediaId, 44980 toggleUseFeaturedImage, 44981 useFeaturedImage 44982 } 44983 ); 44984 if (mediaUrl || featuredImageURL || useFeaturedImage) { 44985 const onResizeStart = () => { 44986 toggleSelection(false); 44987 }; 44988 const onResize = (event, direction, elt) => { 44989 onWidthChange(parseInt(elt.style.width)); 44990 }; 44991 const onResizeStop = (event, direction, elt) => { 44992 toggleSelection(true); 44993 commitWidthChange(parseInt(elt.style.width)); 44994 }; 44995 const enablePositions = { 44996 right: enableResize && mediaPosition3 === "left", 44997 left: enableResize && mediaPosition3 === "right" 44998 }; 44999 const positionStyles = mediaType === "image" && imageFill ? imageFillStyles(mediaUrl || featuredImageURL, focalPoint) : {}; 45000 const mediaTypeRenderers = { 45001 image: () => useFeaturedImage && featuredImageURL ? /* @__PURE__ */ (0, import_jsx_runtime327.jsx)( 45002 "img", 45003 { 45004 ref: refMedia, 45005 src: featuredImageURL, 45006 alt: featuredImageAlt, 45007 style: positionStyles 45008 } 45009 ) : mediaUrl && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)( 45010 "img", 45011 { 45012 ref: refMedia, 45013 src: mediaUrl, 45014 alt: mediaAlt, 45015 style: positionStyles 45016 } 45017 ), 45018 video: () => /* @__PURE__ */ (0, import_jsx_runtime327.jsx)("video", { controls: true, ref: refMedia, src: mediaUrl }) 45019 }; 45020 return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)( 45021 ResizableBoxContainer, 45022 { 45023 as: "figure", 45024 className: clsx_default( 45025 className, 45026 "editor-media-container__resizer", 45027 { "is-transient": isTemporaryMedia2 } 45028 ), 45029 size: { width: mediaWidth + "%" }, 45030 minWidth: "10%", 45031 maxWidth: "100%", 45032 enable: enablePositions, 45033 onResizeStart, 45034 onResize, 45035 onResizeStop, 45036 axis: "x", 45037 isSelected, 45038 isStackedOnMobile, 45039 ref, 45040 children: [ 45041 toolbarEditButton, 45042 (mediaTypeRenderers[mediaType] || noop3)(), 45043 isTemporaryMedia2 && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(import_components64.Spinner, {}), 45044 !useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(PlaceholderContainer, { ...props }), 45045 !featuredImageURL && useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime327.jsx)( 45046 import_components64.Placeholder, 45047 { 45048 className: "wp-block-media-text--placeholder-image", 45049 style: positionStyles, 45050 withIllustration: true 45051 } 45052 ) 45053 ] 45054 } 45055 ); 45056 } 45057 return /* @__PURE__ */ (0, import_jsx_runtime327.jsxs)(import_jsx_runtime327.Fragment, { children: [ 45058 toolbarEditButton, 45059 /* @__PURE__ */ (0, import_jsx_runtime327.jsx)(PlaceholderContainer, { ...props }) 45060 ] }); 45061 } 45062 var media_container_default = (0, import_element79.forwardRef)(MediaContainer); 45063 45064 // packages/block-library/build-module/media-text/edit.mjs 45065 var import_jsx_runtime328 = __toESM(require_jsx_runtime(), 1); 45066 var { ResolutionTool: ResolutionTool3 } = unlock(import_block_editor129.privateApis); 45067 var applyWidthConstraints = (width) => Math.max( 45068 WIDTH_CONSTRAINT_PERCENTAGE, 45069 Math.min(width, 100 - WIDTH_CONSTRAINT_PERCENTAGE) 45070 ); 45071 function getImageSourceUrlBySizeSlug(image, slug) { 45072 return image?.media_details?.sizes?.[slug]?.source_url; 45073 } 45074 function attributesFromMedia2({ 45075 attributes: { linkDestination, href }, 45076 setAttributes 45077 }) { 45078 return (media) => { 45079 if (!media || !media.url) { 45080 setAttributes({ 45081 mediaAlt: void 0, 45082 mediaId: void 0, 45083 mediaType: void 0, 45084 mediaUrl: void 0, 45085 mediaLink: void 0, 45086 href: void 0, 45087 focalPoint: void 0, 45088 useFeaturedImage: false 45089 }); 45090 return; 45091 } 45092 if ((0, import_blob15.isBlobURL)(media.url)) { 45093 media.type = (0, import_blob15.getBlobTypeByURL)(media.url); 45094 } 45095 let mediaType; 45096 let src; 45097 if (media.media_type) { 45098 if (media.media_type === "image") { 45099 mediaType = "image"; 45100 } else { 45101 mediaType = "video"; 45102 } 45103 } else { 45104 mediaType = media.type; 45105 } 45106 if (mediaType === "image") { 45107 src = media.sizes?.large?.url || media.media_details?.sizes?.large?.source_url; 45108 } 45109 let newLinkDestination = linkDestination; 45110 let newHref = href; 45111 if (mediaType === "image") { 45112 if (!newLinkDestination) { 45113 switch (window?.wp?.media?.view?.settings?.defaultProps?.link || LINK_DESTINATION_NONE3) { 45114 case "file": 45115 case LINK_DESTINATION_MEDIA3: 45116 newLinkDestination = LINK_DESTINATION_MEDIA3; 45117 break; 45118 case "post": 45119 case LINK_DESTINATION_ATTACHMENT3: 45120 newLinkDestination = LINK_DESTINATION_ATTACHMENT3; 45121 break; 45122 case LINK_DESTINATION_NONE3: 45123 default: 45124 newLinkDestination = LINK_DESTINATION_NONE3; 45125 break; 45126 } 45127 } 45128 switch (newLinkDestination) { 45129 case LINK_DESTINATION_MEDIA3: 45130 newHref = media.url; 45131 break; 45132 case LINK_DESTINATION_ATTACHMENT3: 45133 newHref = media.link; 45134 break; 45135 } 45136 } 45137 setAttributes({ 45138 mediaAlt: media.alt, 45139 mediaId: media.id, 45140 mediaType, 45141 mediaUrl: src || media.url, 45142 mediaLink: media.link || void 0, 45143 href: newHref, 45144 linkDestination: newLinkDestination, 45145 focalPoint: void 0, 45146 useFeaturedImage: false 45147 }); 45148 }; 45149 } 45150 function MediaTextResolutionTool({ image, value, onChange }) { 45151 const { imageSizes } = (0, import_data61.useSelect)((select10) => { 45152 const { getSettings: getSettings2 } = select10(import_block_editor129.store); 45153 return { 45154 imageSizes: getSettings2().imageSizes 45155 }; 45156 }, []); 45157 if (!imageSizes?.length) { 45158 return null; 45159 } 45160 const imageSizeOptions = imageSizes.filter(({ slug }) => getImageSourceUrlBySizeSlug(image, slug)).map(({ name: name118, slug }) => ({ value: slug, label: name118 })); 45161 return /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45162 ResolutionTool3, 45163 { 45164 value, 45165 defaultValue: DEFAULT_MEDIA_SIZE_SLUG4, 45166 options: imageSizeOptions, 45167 onChange 45168 } 45169 ); 45170 } 45171 function MediaTextEdit({ 45172 attributes: attributes2, 45173 isSelected, 45174 setAttributes, 45175 context: { postId, postType } 45176 }) { 45177 const { 45178 focalPoint, 45179 href, 45180 imageFill, 45181 isStackedOnMobile, 45182 linkClass, 45183 linkDestination, 45184 linkTarget, 45185 mediaAlt, 45186 mediaId, 45187 mediaPosition: mediaPosition3, 45188 mediaType, 45189 mediaUrl, 45190 mediaWidth, 45191 mediaSizeSlug, 45192 rel, 45193 verticalAlignment, 45194 allowedBlocks, 45195 useFeaturedImage 45196 } = attributes2; 45197 const [featuredImage] = (0, import_core_data29.useEntityProp)( 45198 "postType", 45199 postType, 45200 "featured_media", 45201 postId 45202 ); 45203 const { featuredImageMedia } = (0, import_data61.useSelect)( 45204 (select10) => { 45205 return { 45206 featuredImageMedia: featuredImage && useFeaturedImage ? select10(import_core_data29.store).getEntityRecord( 45207 "postType", 45208 "attachment", 45209 featuredImage, 45210 { 45211 context: "view" 45212 } 45213 ) : void 0 45214 }; 45215 }, 45216 [featuredImage, useFeaturedImage] 45217 ); 45218 const { image } = (0, import_data61.useSelect)( 45219 (select10) => { 45220 return { 45221 image: mediaId && isSelected ? select10(import_core_data29.store).getEntityRecord( 45222 "postType", 45223 "attachment", 45224 mediaId, 45225 { 45226 context: "view" 45227 } 45228 ) : null 45229 }; 45230 }, 45231 [isSelected, mediaId] 45232 ); 45233 const featuredImageURL = useFeaturedImage ? featuredImageMedia?.source_url : ""; 45234 const featuredImageAlt = useFeaturedImage ? featuredImageMedia?.alt_text : ""; 45235 const toggleUseFeaturedImage = () => { 45236 setAttributes({ 45237 imageFill: false, 45238 mediaType: "image", 45239 mediaId: void 0, 45240 mediaUrl: void 0, 45241 mediaAlt: void 0, 45242 mediaLink: void 0, 45243 linkDestination: void 0, 45244 linkTarget: void 0, 45245 linkClass: void 0, 45246 rel: void 0, 45247 href: void 0, 45248 useFeaturedImage: !useFeaturedImage 45249 }); 45250 }; 45251 const refMedia = (0, import_element80.useRef)(); 45252 const imperativeFocalPointPreview = (value) => { 45253 const { style: style22 } = refMedia.current; 45254 const { x: x3, y: y2 } = value; 45255 style22.objectPosition = `$x3 * 100}% $y2 * 100}%`; 45256 }; 45257 const [temporaryMediaWidth, setTemporaryMediaWidth] = (0, import_element80.useState)(null); 45258 const onSelectMedia = attributesFromMedia2({ attributes: attributes2, setAttributes }); 45259 const onSetHref = (props) => { 45260 setAttributes(props); 45261 }; 45262 const onWidthChange = (width) => { 45263 setTemporaryMediaWidth(applyWidthConstraints(width)); 45264 }; 45265 const commitWidthChange = (width) => { 45266 setAttributes({ 45267 mediaWidth: applyWidthConstraints(width) 45268 }); 45269 setTemporaryMediaWidth(null); 45270 }; 45271 const classNames = clsx_default({ 45272 "has-media-on-the-right": "right" === mediaPosition3, 45273 "is-selected": isSelected, 45274 "is-stacked-on-mobile": isStackedOnMobile, 45275 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 45276 "is-image-fill-element": imageFill 45277 }); 45278 const widthString = `${temporaryMediaWidth || mediaWidth}%`; 45279 const gridTemplateColumns = "right" === mediaPosition3 ? `1fr ${widthString}` : `${widthString} 1fr`; 45280 const style2 = { 45281 gridTemplateColumns, 45282 msGridColumns: gridTemplateColumns 45283 }; 45284 const onMediaAltChange = (newMediaAlt) => { 45285 setAttributes({ mediaAlt: newMediaAlt }); 45286 }; 45287 const onVerticalAlignmentChange = (alignment) => { 45288 setAttributes({ verticalAlignment: alignment }); 45289 }; 45290 const updateImage = (newMediaSizeSlug) => { 45291 const newUrl = getImageSourceUrlBySizeSlug(image, newMediaSizeSlug); 45292 if (!newUrl) { 45293 return null; 45294 } 45295 setAttributes({ 45296 mediaUrl: newUrl, 45297 mediaSizeSlug: newMediaSizeSlug 45298 }); 45299 }; 45300 const dropdownMenuProps = useToolsPanelDropdownMenuProps(); 45301 const mediaTextGeneralSettings = /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)( 45302 import_components65.__experimentalToolsPanel, 45303 { 45304 label: (0, import_i18n109.__)("Settings"), 45305 resetAll: () => { 45306 setAttributes({ 45307 isStackedOnMobile: true, 45308 imageFill: false, 45309 mediaAlt: "", 45310 focalPoint: void 0, 45311 mediaWidth: 50 45312 }); 45313 updateImage(DEFAULT_MEDIA_SIZE_SLUG4); 45314 }, 45315 dropdownMenuProps, 45316 children: [ 45317 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45318 import_components65.__experimentalToolsPanelItem, 45319 { 45320 label: (0, import_i18n109.__)("Media width"), 45321 isShownByDefault: true, 45322 hasValue: () => mediaWidth !== 50, 45323 onDeselect: () => setAttributes({ mediaWidth: 50 }), 45324 children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45325 import_components65.RangeControl, 45326 { 45327 label: (0, import_i18n109.__)("Media width"), 45328 value: temporaryMediaWidth || mediaWidth, 45329 onChange: commitWidthChange, 45330 min: WIDTH_CONSTRAINT_PERCENTAGE, 45331 max: 100 - WIDTH_CONSTRAINT_PERCENTAGE 45332 } 45333 ) 45334 } 45335 ), 45336 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45337 import_components65.__experimentalToolsPanelItem, 45338 { 45339 label: (0, import_i18n109.__)("Stack on mobile"), 45340 isShownByDefault: true, 45341 hasValue: () => !isStackedOnMobile, 45342 onDeselect: () => setAttributes({ isStackedOnMobile: true }), 45343 children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45344 import_components65.ToggleControl, 45345 { 45346 label: (0, import_i18n109.__)("Stack on mobile"), 45347 checked: isStackedOnMobile, 45348 onChange: () => setAttributes({ 45349 isStackedOnMobile: !isStackedOnMobile 45350 }) 45351 } 45352 ) 45353 } 45354 ), 45355 mediaType === "image" && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45356 import_components65.__experimentalToolsPanelItem, 45357 { 45358 label: (0, import_i18n109.__)("Crop image to fill"), 45359 isShownByDefault: true, 45360 hasValue: () => !!imageFill, 45361 onDeselect: () => setAttributes({ imageFill: false }), 45362 children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45363 import_components65.ToggleControl, 45364 { 45365 label: (0, import_i18n109.__)("Crop image to fill"), 45366 checked: !!imageFill, 45367 onChange: () => setAttributes({ 45368 imageFill: !imageFill 45369 }) 45370 } 45371 ) 45372 } 45373 ), 45374 imageFill && (mediaUrl || featuredImageURL) && mediaType === "image" && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45375 import_components65.__experimentalToolsPanelItem, 45376 { 45377 label: (0, import_i18n109.__)("Focal point"), 45378 isShownByDefault: true, 45379 hasValue: () => !!focalPoint, 45380 onDeselect: () => setAttributes({ focalPoint: void 0 }), 45381 children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45382 import_components65.FocalPointPicker, 45383 { 45384 label: (0, import_i18n109.__)("Focal point"), 45385 url: useFeaturedImage && featuredImageURL ? featuredImageURL : mediaUrl, 45386 value: focalPoint, 45387 onChange: (value) => setAttributes({ focalPoint: value }), 45388 onDragStart: imperativeFocalPointPreview, 45389 onDrag: imperativeFocalPointPreview 45390 } 45391 ) 45392 } 45393 ), 45394 mediaType === "image" && mediaUrl && !useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45395 import_components65.__experimentalToolsPanelItem, 45396 { 45397 label: (0, import_i18n109.__)("Alternative text"), 45398 isShownByDefault: true, 45399 hasValue: () => !!mediaAlt, 45400 onDeselect: () => setAttributes({ mediaAlt: "" }), 45401 children: /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45402 import_components65.TextareaControl, 45403 { 45404 label: (0, import_i18n109.__)("Alternative text"), 45405 value: mediaAlt, 45406 onChange: onMediaAltChange, 45407 help: /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)(import_jsx_runtime328.Fragment, { children: [ 45408 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45409 import_components65.ExternalLink, 45410 { 45411 href: ( 45412 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. 45413 (0, import_i18n109.__)( 45414 "https://www.w3.org/WAI/tutorials/images/decision-tree/" 45415 ) 45416 ), 45417 children: (0, import_i18n109.__)( 45418 "Describe the purpose of the image." 45419 ) 45420 } 45421 ), 45422 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)("br", {}), 45423 (0, import_i18n109.__)("Leave empty if decorative.") 45424 ] }) 45425 } 45426 ) 45427 } 45428 ), 45429 mediaType === "image" && !useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45430 MediaTextResolutionTool, 45431 { 45432 image, 45433 value: mediaSizeSlug, 45434 onChange: updateImage 45435 } 45436 ) 45437 ] 45438 } 45439 ); 45440 const blockProps = (0, import_block_editor129.useBlockProps)({ 45441 className: classNames, 45442 style: style2 45443 }); 45444 const innerBlocksProps = (0, import_block_editor129.useInnerBlocksProps)( 45445 { className: "wp-block-media-text__content" }, 45446 { allowedBlocks } 45447 ); 45448 const blockEditingMode = (0, import_block_editor129.useBlockEditingMode)(); 45449 return /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)(import_jsx_runtime328.Fragment, { children: [ 45450 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)(import_block_editor129.InspectorControls, { children: mediaTextGeneralSettings }), 45451 /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)(import_block_editor129.BlockControls, { group: "block", children: [ 45452 blockEditingMode === "default" && /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)(import_jsx_runtime328.Fragment, { children: [ 45453 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45454 import_block_editor129.BlockVerticalAlignmentControl, 45455 { 45456 onChange: onVerticalAlignmentChange, 45457 value: verticalAlignment, 45458 label: (0, import_i18n109.__)("Align media and text vertically") 45459 } 45460 ), 45461 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45462 import_components65.ToolbarButton, 45463 { 45464 icon: pull_left_default, 45465 title: (0, import_i18n109.__)("Show media on left"), 45466 isActive: mediaPosition3 === "left", 45467 onClick: () => setAttributes({ mediaPosition: "left" }) 45468 } 45469 ), 45470 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45471 import_components65.ToolbarButton, 45472 { 45473 icon: pull_right_default, 45474 title: (0, import_i18n109.__)("Show media on right"), 45475 isActive: mediaPosition3 === "right", 45476 onClick: () => setAttributes({ mediaPosition: "right" }) 45477 } 45478 ) 45479 ] }), 45480 mediaType === "image" && !useFeaturedImage && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45481 import_block_editor129.__experimentalImageURLInputUI, 45482 { 45483 url: href || "", 45484 onChangeUrl: onSetHref, 45485 linkDestination, 45486 mediaType, 45487 mediaUrl: image && image.source_url, 45488 mediaLink: image && image.link, 45489 linkTarget, 45490 linkClass, 45491 rel 45492 } 45493 ) 45494 ] }), 45495 /* @__PURE__ */ (0, import_jsx_runtime328.jsxs)("div", { ...blockProps, children: [ 45496 mediaPosition3 === "right" && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { ...innerBlocksProps }), 45497 /* @__PURE__ */ (0, import_jsx_runtime328.jsx)( 45498 media_container_default, 45499 { 45500 className: "wp-block-media-text__media", 45501 onSelectMedia, 45502 onWidthChange, 45503 commitWidthChange, 45504 refMedia, 45505 enableResize: blockEditingMode === "default", 45506 toggleUseFeaturedImage, 45507 ...{ 45508 focalPoint, 45509 imageFill, 45510 isSelected, 45511 isStackedOnMobile, 45512 mediaAlt, 45513 mediaId, 45514 mediaPosition: mediaPosition3, 45515 mediaType, 45516 mediaUrl, 45517 mediaWidth, 45518 useFeaturedImage, 45519 featuredImageURL, 45520 featuredImageAlt 45521 } 45522 } 45523 ), 45524 mediaPosition3 !== "right" && /* @__PURE__ */ (0, import_jsx_runtime328.jsx)("div", { ...innerBlocksProps }) 45525 ] }) 45526 ] }); 45527 } 45528 var edit_default15 = MediaTextEdit; 45529 45530 // packages/block-library/build-module/media-text/block.json 45531 var block_default47 = { 45532 $schema: "https://schemas.wp.org/trunk/block.json", 45533 apiVersion: 3, 45534 name: "core/media-text", 45535 title: "Media & Text", 45536 category: "media", 45537 description: "Set media and words side-by-side for a richer layout.", 45538 keywords: ["image", "video"], 45539 textdomain: "default", 45540 attributes: { 45541 align: { 45542 type: "string", 45543 default: "none" 45544 }, 45545 mediaAlt: { 45546 type: "string", 45547 source: "attribute", 45548 selector: "figure img", 45549 attribute: "alt", 45550 default: "", 45551 role: "content" 45552 }, 45553 mediaPosition: { 45554 type: "string", 45555 default: "left" 45556 }, 45557 mediaId: { 45558 type: "number", 45559 role: "content" 45560 }, 45561 mediaUrl: { 45562 type: "string", 45563 source: "attribute", 45564 selector: "figure video,figure img", 45565 attribute: "src", 45566 role: "content" 45567 }, 45568 mediaLink: { 45569 type: "string" 45570 }, 45571 linkDestination: { 45572 type: "string" 45573 }, 45574 linkTarget: { 45575 type: "string", 45576 source: "attribute", 45577 selector: "figure a", 45578 attribute: "target" 45579 }, 45580 href: { 45581 type: "string", 45582 source: "attribute", 45583 selector: "figure a", 45584 attribute: "href", 45585 role: "content" 45586 }, 45587 rel: { 45588 type: "string", 45589 source: "attribute", 45590 selector: "figure a", 45591 attribute: "rel" 45592 }, 45593 linkClass: { 45594 type: "string", 45595 source: "attribute", 45596 selector: "figure a", 45597 attribute: "class" 45598 }, 45599 mediaType: { 45600 type: "string", 45601 role: "content" 45602 }, 45603 mediaWidth: { 45604 type: "number", 45605 default: 50 45606 }, 45607 mediaSizeSlug: { 45608 type: "string" 45609 }, 45610 isStackedOnMobile: { 45611 type: "boolean", 45612 default: true 45613 }, 45614 verticalAlignment: { 45615 type: "string" 45616 }, 45617 imageFill: { 45618 type: "boolean" 45619 }, 45620 focalPoint: { 45621 type: "object" 45622 }, 45623 useFeaturedImage: { 45624 type: "boolean", 45625 default: false 45626 } 45627 }, 45628 usesContext: ["postId", "postType"], 45629 supports: { 45630 anchor: true, 45631 align: ["wide", "full"], 45632 html: false, 45633 __experimentalBorder: { 45634 color: true, 45635 radius: true, 45636 style: true, 45637 width: true, 45638 __experimentalDefaultControls: { 45639 color: true, 45640 radius: true, 45641 style: true, 45642 width: true 45643 } 45644 }, 45645 color: { 45646 gradients: true, 45647 heading: true, 45648 link: true, 45649 __experimentalDefaultControls: { 45650 background: true, 45651 text: true 45652 } 45653 }, 45654 spacing: { 45655 margin: true, 45656 padding: true 45657 }, 45658 typography: { 45659 fontSize: true, 45660 lineHeight: true, 45661 __experimentalFontFamily: true, 45662 __experimentalFontWeight: true, 45663 __experimentalFontStyle: true, 45664 __experimentalTextTransform: true, 45665 __experimentalTextDecoration: true, 45666 __experimentalLetterSpacing: true, 45667 __experimentalDefaultControls: { 45668 fontSize: true 45669 } 45670 }, 45671 interactivity: { 45672 clientNavigation: true 45673 }, 45674 allowedBlocks: true 45675 }, 45676 editorStyle: "wp-block-media-text-editor", 45677 style: "wp-block-media-text" 45678 }; 45679 45680 // packages/block-library/build-module/media-text/save.mjs 45681 var import_block_editor130 = __toESM(require_block_editor(), 1); 45682 var import_jsx_runtime329 = __toESM(require_jsx_runtime(), 1); 45683 var DEFAULT_MEDIA_WIDTH2 = 50; 45684 var noop4 = () => { 45685 }; 45686 function save26({ attributes: attributes2 }) { 45687 const { 45688 isStackedOnMobile, 45689 mediaAlt, 45690 mediaPosition: mediaPosition3, 45691 mediaType, 45692 mediaUrl, 45693 mediaWidth, 45694 mediaId, 45695 verticalAlignment, 45696 imageFill, 45697 focalPoint, 45698 linkClass, 45699 href, 45700 linkTarget, 45701 rel 45702 } = attributes2; 45703 const mediaSizeSlug = attributes2.mediaSizeSlug || DEFAULT_MEDIA_SIZE_SLUG4; 45704 const newRel = !rel ? void 0 : rel; 45705 const imageClasses = clsx_default({ 45706 [`wp-image-${mediaId}`]: mediaId && mediaType === "image", 45707 [`size-${mediaSizeSlug}`]: mediaId && mediaType === "image" 45708 }); 45709 const positionStyles = imageFill ? imageFillStyles(mediaUrl, focalPoint) : {}; 45710 let image = mediaUrl ? /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 45711 "img", 45712 { 45713 src: mediaUrl, 45714 alt: mediaAlt, 45715 className: imageClasses || null, 45716 style: positionStyles 45717 } 45718 ) : null; 45719 if (href) { 45720 image = /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 45721 "a", 45722 { 45723 className: linkClass, 45724 href, 45725 target: linkTarget, 45726 rel: newRel, 45727 children: image 45728 } 45729 ); 45730 } 45731 const mediaTypeRenders = { 45732 image: () => image, 45733 video: () => /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("video", { controls: true, src: mediaUrl }) 45734 }; 45735 const className = clsx_default({ 45736 "has-media-on-the-right": "right" === mediaPosition3, 45737 "is-stacked-on-mobile": isStackedOnMobile, 45738 [`is-vertically-aligned-$verticalAlignment}`]: verticalAlignment, 45739 "is-image-fill-element": imageFill 45740 }); 45741 let gridTemplateColumns; 45742 if (mediaWidth !== DEFAULT_MEDIA_WIDTH2) { 45743 gridTemplateColumns = "right" === mediaPosition3 ? `auto $mediaWidth}%` : `$mediaWidth}% auto`; 45744 } 45745 const style2 = { 45746 gridTemplateColumns 45747 }; 45748 if ("right" === mediaPosition3) { 45749 return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("div", { ...import_block_editor130.useBlockProps.save({ className, style: style2 }), children: [ 45750 /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 45751 "div", 45752 { 45753 ...import_block_editor130.useInnerBlocksProps.save({ 45754 className: "wp-block-media-text__content" 45755 }) 45756 } 45757 ), 45758 /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || noop4)() }) 45759 ] }); 45760 } 45761 return /* @__PURE__ */ (0, import_jsx_runtime329.jsxs)("div", { ...import_block_editor130.useBlockProps.save({ className, style: style2 }), children: [ 45762 /* @__PURE__ */ (0, import_jsx_runtime329.jsx)("figure", { className: "wp-block-media-text__media", children: (mediaTypeRenders[mediaType] || noop4)() }), 45763 /* @__PURE__ */ (0, import_jsx_runtime329.jsx)( 45764 "div", 45765 { 45766 ...import_block_editor130.useInnerBlocksProps.save({ 45767 className: "wp-block-media-text__content" 45768 }) 45769 } 45770 ) 45771 ] }); 45772 } 45773 45774 // packages/block-library/build-module/media-text/transforms.mjs 45775 var import_blocks51 = __toESM(require_blocks(), 1); 45776 var transforms16 = { 45777 from: [ 45778 { 45779 type: "block", 45780 blocks: ["core/image"], 45781 transform: ({ alt, url, id, anchor }) => (0, import_blocks51.createBlock)("core/media-text", { 45782 mediaAlt: alt, 45783 mediaId: id, 45784 mediaUrl: url, 45785 mediaType: "image", 45786 anchor 45787 }) 45788 }, 45789 { 45790 type: "block", 45791 blocks: ["core/video"], 45792 transform: ({ src, id, anchor }) => (0, import_blocks51.createBlock)("core/media-text", { 45793 mediaId: id, 45794 mediaUrl: src, 45795 mediaType: "video", 45796 anchor 45797 }) 45798 }, 45799 { 45800 type: "block", 45801 blocks: ["core/cover"], 45802 transform: ({ 45803 align, 45804 alt, 45805 anchor, 45806 backgroundType, 45807 customGradient, 45808 customOverlayColor, 45809 g