[ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 /******/ (() => { // webpackBootstrap 2 /******/ "use strict"; 3 /******/ var __webpack_modules__ = ({ 4 5 /***/ 4140: 6 /***/ ((__unused_webpack_module, exports, __webpack_require__) => { 7 8 9 10 var m = __webpack_require__(5795); 11 if (true) { 12 exports.H = m.createRoot; 13 exports.c = m.hydrateRoot; 14 } else { var i; } 15 16 17 /***/ }), 18 19 /***/ 5795: 20 /***/ ((module) => { 21 22 module.exports = window["ReactDOM"]; 23 24 /***/ }) 25 26 /******/ }); 27 /************************************************************************/ 28 /******/ // The module cache 29 /******/ var __webpack_module_cache__ = {}; 30 /******/ 31 /******/ // The require function 32 /******/ function __webpack_require__(moduleId) { 33 /******/ // Check if module is in cache 34 /******/ var cachedModule = __webpack_module_cache__[moduleId]; 35 /******/ if (cachedModule !== undefined) { 36 /******/ return cachedModule.exports; 37 /******/ } 38 /******/ // Create a new module (and put it into the cache) 39 /******/ var module = __webpack_module_cache__[moduleId] = { 40 /******/ // no module.id needed 41 /******/ // no module.loaded needed 42 /******/ exports: {} 43 /******/ }; 44 /******/ 45 /******/ // Execute the module function 46 /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); 47 /******/ 48 /******/ // Return the exports of the module 49 /******/ return module.exports; 50 /******/ } 51 /******/ 52 /************************************************************************/ 53 /******/ /* webpack/runtime/define property getters */ 54 /******/ (() => { 55 /******/ // define getter functions for harmony exports 56 /******/ __webpack_require__.d = (exports, definition) => { 57 /******/ for(var key in definition) { 58 /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { 59 /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); 60 /******/ } 61 /******/ } 62 /******/ }; 63 /******/ })(); 64 /******/ 65 /******/ /* webpack/runtime/hasOwnProperty shorthand */ 66 /******/ (() => { 67 /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) 68 /******/ })(); 69 /******/ 70 /******/ /* webpack/runtime/make namespace object */ 71 /******/ (() => { 72 /******/ // define __esModule on exports 73 /******/ __webpack_require__.r = (exports) => { 74 /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) { 75 /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' }); 76 /******/ } 77 /******/ Object.defineProperty(exports, '__esModule', { value: true }); 78 /******/ }; 79 /******/ })(); 80 /******/ 81 /************************************************************************/ 82 var __webpack_exports__ = {}; 83 // ESM COMPAT FLAG 84 __webpack_require__.r(__webpack_exports__); 85 86 // EXPORTS 87 __webpack_require__.d(__webpack_exports__, { 88 Children: () => (/* reexport */ external_React_namespaceObject.Children), 89 Component: () => (/* reexport */ external_React_namespaceObject.Component), 90 Fragment: () => (/* reexport */ external_React_namespaceObject.Fragment), 91 Platform: () => (/* reexport */ platform), 92 PureComponent: () => (/* reexport */ external_React_namespaceObject.PureComponent), 93 RawHTML: () => (/* reexport */ RawHTML), 94 StrictMode: () => (/* reexport */ external_React_namespaceObject.StrictMode), 95 Suspense: () => (/* reexport */ external_React_namespaceObject.Suspense), 96 cloneElement: () => (/* reexport */ external_React_namespaceObject.cloneElement), 97 concatChildren: () => (/* reexport */ concatChildren), 98 createContext: () => (/* reexport */ external_React_namespaceObject.createContext), 99 createElement: () => (/* reexport */ external_React_namespaceObject.createElement), 100 createInterpolateElement: () => (/* reexport */ create_interpolate_element), 101 createPortal: () => (/* reexport */ external_ReactDOM_.createPortal), 102 createRef: () => (/* reexport */ external_React_namespaceObject.createRef), 103 createRoot: () => (/* reexport */ client/* createRoot */.H), 104 findDOMNode: () => (/* reexport */ external_ReactDOM_.findDOMNode), 105 flushSync: () => (/* reexport */ external_ReactDOM_.flushSync), 106 forwardRef: () => (/* reexport */ external_React_namespaceObject.forwardRef), 107 hydrate: () => (/* reexport */ external_ReactDOM_.hydrate), 108 hydrateRoot: () => (/* reexport */ client/* hydrateRoot */.c), 109 isEmptyElement: () => (/* reexport */ isEmptyElement), 110 isValidElement: () => (/* reexport */ external_React_namespaceObject.isValidElement), 111 lazy: () => (/* reexport */ external_React_namespaceObject.lazy), 112 memo: () => (/* reexport */ external_React_namespaceObject.memo), 113 render: () => (/* reexport */ external_ReactDOM_.render), 114 renderToString: () => (/* reexport */ serialize), 115 startTransition: () => (/* reexport */ external_React_namespaceObject.startTransition), 116 switchChildrenNodeName: () => (/* reexport */ switchChildrenNodeName), 117 unmountComponentAtNode: () => (/* reexport */ external_ReactDOM_.unmountComponentAtNode), 118 useCallback: () => (/* reexport */ external_React_namespaceObject.useCallback), 119 useContext: () => (/* reexport */ external_React_namespaceObject.useContext), 120 useDebugValue: () => (/* reexport */ external_React_namespaceObject.useDebugValue), 121 useDeferredValue: () => (/* reexport */ external_React_namespaceObject.useDeferredValue), 122 useEffect: () => (/* reexport */ external_React_namespaceObject.useEffect), 123 useId: () => (/* reexport */ external_React_namespaceObject.useId), 124 useImperativeHandle: () => (/* reexport */ external_React_namespaceObject.useImperativeHandle), 125 useInsertionEffect: () => (/* reexport */ external_React_namespaceObject.useInsertionEffect), 126 useLayoutEffect: () => (/* reexport */ external_React_namespaceObject.useLayoutEffect), 127 useMemo: () => (/* reexport */ external_React_namespaceObject.useMemo), 128 useReducer: () => (/* reexport */ external_React_namespaceObject.useReducer), 129 useRef: () => (/* reexport */ external_React_namespaceObject.useRef), 130 useState: () => (/* reexport */ external_React_namespaceObject.useState), 131 useSyncExternalStore: () => (/* reexport */ external_React_namespaceObject.useSyncExternalStore), 132 useTransition: () => (/* reexport */ external_React_namespaceObject.useTransition) 133 }); 134 135 ;// external "React" 136 const external_React_namespaceObject = window["React"]; 137 ;// ./node_modules/@wordpress/element/build-module/create-interpolate-element.js 138 /** 139 * Internal dependencies 140 */ 141 142 143 /** 144 * Object containing a React element. 145 * 146 * @typedef {import('react').ReactElement} Element 147 */ 148 149 let indoc, offset, output, stack; 150 151 /** 152 * Matches tags in the localized string 153 * 154 * This is used for extracting the tag pattern groups for parsing the localized 155 * string and along with the map converting it to a react element. 156 * 157 * There are four references extracted using this tokenizer: 158 * 159 * match: Full match of the tag (i.e. <strong>, </strong>, <br/>) 160 * isClosing: The closing slash, if it exists. 161 * name: The name portion of the tag (strong, br) (if ) 162 * isSelfClosed: The slash on a self closing tag, if it exists. 163 * 164 * @type {RegExp} 165 */ 166 const tokenizer = /<(\/)?(\w+)\s*(\/)?>/g; 167 168 /** 169 * The stack frame tracking parse progress. 170 * 171 * @typedef Frame 172 * 173 * @property {Element} element A parent element which may still have 174 * @property {number} tokenStart Offset at which parent element first 175 * appears. 176 * @property {number} tokenLength Length of string marking start of parent 177 * element. 178 * @property {number} [prevOffset] Running offset at which parsing should 179 * continue. 180 * @property {number} [leadingTextStart] Offset at which last closing element 181 * finished, used for finding text between 182 * elements. 183 * @property {Element[]} children Children. 184 */ 185 186 /** 187 * Tracks recursive-descent parse state. 188 * 189 * This is a Stack frame holding parent elements until all children have been 190 * parsed. 191 * 192 * @private 193 * @param {Element} element A parent element which may still have 194 * nested children not yet parsed. 195 * @param {number} tokenStart Offset at which parent element first 196 * appears. 197 * @param {number} tokenLength Length of string marking start of parent 198 * element. 199 * @param {number} [prevOffset] Running offset at which parsing should 200 * continue. 201 * @param {number} [leadingTextStart] Offset at which last closing element 202 * finished, used for finding text between 203 * elements. 204 * 205 * @return {Frame} The stack frame tracking parse progress. 206 */ 207 function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) { 208 return { 209 element, 210 tokenStart, 211 tokenLength, 212 prevOffset, 213 leadingTextStart, 214 children: [] 215 }; 216 } 217 218 /** 219 * This function creates an interpolated element from a passed in string with 220 * specific tags matching how the string should be converted to an element via 221 * the conversion map value. 222 * 223 * @example 224 * For example, for the given string: 225 * 226 * "This is a <span>string</span> with <a>a link</a> and a self-closing 227 * <CustomComponentB/> tag" 228 * 229 * You would have something like this as the conversionMap value: 230 * 231 * ```js 232 * { 233 * span: <span />, 234 * a: <a href={ 'https://github.com' } />, 235 * CustomComponentB: <CustomComponent />, 236 * } 237 * ``` 238 * 239 * @param {string} interpolatedString The interpolation string to be parsed. 240 * @param {Record<string, Element>} conversionMap The map used to convert the string to 241 * a react element. 242 * @throws {TypeError} 243 * @return {Element} A wp element. 244 */ 245 const createInterpolateElement = (interpolatedString, conversionMap) => { 246 indoc = interpolatedString; 247 offset = 0; 248 output = []; 249 stack = []; 250 tokenizer.lastIndex = 0; 251 if (!isValidConversionMap(conversionMap)) { 252 throw new TypeError('The conversionMap provided is not valid. It must be an object with values that are React Elements'); 253 } 254 do { 255 // twiddle our thumbs 256 } while (proceed(conversionMap)); 257 return (0,external_React_namespaceObject.createElement)(external_React_namespaceObject.Fragment, null, ...output); 258 }; 259 260 /** 261 * Validate conversion map. 262 * 263 * A map is considered valid if it's an object and every value in the object 264 * is a React Element 265 * 266 * @private 267 * 268 * @param {Object} conversionMap The map being validated. 269 * 270 * @return {boolean} True means the map is valid. 271 */ 272 const isValidConversionMap = conversionMap => { 273 const isObject = typeof conversionMap === 'object'; 274 const values = isObject && Object.values(conversionMap); 275 return isObject && values.length && values.every(element => (0,external_React_namespaceObject.isValidElement)(element)); 276 }; 277 278 /** 279 * This is the iterator over the matches in the string. 280 * 281 * @private 282 * 283 * @param {Object} conversionMap The conversion map for the string. 284 * 285 * @return {boolean} true for continuing to iterate, false for finished. 286 */ 287 function proceed(conversionMap) { 288 const next = nextToken(); 289 const [tokenType, name, startOffset, tokenLength] = next; 290 const stackDepth = stack.length; 291 const leadingTextStart = startOffset > offset ? offset : null; 292 if (!conversionMap[name]) { 293 addText(); 294 return false; 295 } 296 switch (tokenType) { 297 case 'no-more-tokens': 298 if (stackDepth !== 0) { 299 const { 300 leadingTextStart: stackLeadingText, 301 tokenStart 302 } = stack.pop(); 303 output.push(indoc.substr(stackLeadingText, tokenStart)); 304 } 305 addText(); 306 return false; 307 case 'self-closed': 308 if (0 === stackDepth) { 309 if (null !== leadingTextStart) { 310 output.push(indoc.substr(leadingTextStart, startOffset - leadingTextStart)); 311 } 312 output.push(conversionMap[name]); 313 offset = startOffset + tokenLength; 314 return true; 315 } 316 317 // Otherwise we found an inner element. 318 addChild(createFrame(conversionMap[name], startOffset, tokenLength)); 319 offset = startOffset + tokenLength; 320 return true; 321 case 'opener': 322 stack.push(createFrame(conversionMap[name], startOffset, tokenLength, startOffset + tokenLength, leadingTextStart)); 323 offset = startOffset + tokenLength; 324 return true; 325 case 'closer': 326 // If we're not nesting then this is easy - close the block. 327 if (1 === stackDepth) { 328 closeOuterElement(startOffset); 329 offset = startOffset + tokenLength; 330 return true; 331 } 332 333 // Otherwise we're nested and we have to close out the current 334 // block and add it as a innerBlock to the parent. 335 const stackTop = stack.pop(); 336 const text = indoc.substr(stackTop.prevOffset, startOffset - stackTop.prevOffset); 337 stackTop.children.push(text); 338 stackTop.prevOffset = startOffset + tokenLength; 339 const frame = createFrame(stackTop.element, stackTop.tokenStart, stackTop.tokenLength, startOffset + tokenLength); 340 frame.children = stackTop.children; 341 addChild(frame); 342 offset = startOffset + tokenLength; 343 return true; 344 default: 345 addText(); 346 return false; 347 } 348 } 349 350 /** 351 * Grabs the next token match in the string and returns it's details. 352 * 353 * @private 354 * 355 * @return {Array} An array of details for the token matched. 356 */ 357 function nextToken() { 358 const matches = tokenizer.exec(indoc); 359 // We have no more tokens. 360 if (null === matches) { 361 return ['no-more-tokens']; 362 } 363 const startedAt = matches.index; 364 const [match, isClosing, name, isSelfClosed] = matches; 365 const length = match.length; 366 if (isSelfClosed) { 367 return ['self-closed', name, startedAt, length]; 368 } 369 if (isClosing) { 370 return ['closer', name, startedAt, length]; 371 } 372 return ['opener', name, startedAt, length]; 373 } 374 375 /** 376 * Pushes text extracted from the indoc string to the output stack given the 377 * current rawLength value and offset (if rawLength is provided ) or the 378 * indoc.length and offset. 379 * 380 * @private 381 */ 382 function addText() { 383 const length = indoc.length - offset; 384 if (0 === length) { 385 return; 386 } 387 output.push(indoc.substr(offset, length)); 388 } 389 390 /** 391 * Pushes a child element to the associated parent element's children for the 392 * parent currently active in the stack. 393 * 394 * @private 395 * 396 * @param {Frame} frame The Frame containing the child element and it's 397 * token information. 398 */ 399 function addChild(frame) { 400 const { 401 element, 402 tokenStart, 403 tokenLength, 404 prevOffset, 405 children 406 } = frame; 407 const parent = stack[stack.length - 1]; 408 const text = indoc.substr(parent.prevOffset, tokenStart - parent.prevOffset); 409 if (text) { 410 parent.children.push(text); 411 } 412 parent.children.push((0,external_React_namespaceObject.cloneElement)(element, null, ...children)); 413 parent.prevOffset = prevOffset ? prevOffset : tokenStart + tokenLength; 414 } 415 416 /** 417 * This is called for closing tags. It creates the element currently active in 418 * the stack. 419 * 420 * @private 421 * 422 * @param {number} endOffset Offset at which the closing tag for the element 423 * begins in the string. If this is greater than the 424 * prevOffset attached to the element, then this 425 * helps capture any remaining nested text nodes in 426 * the element. 427 */ 428 function closeOuterElement(endOffset) { 429 const { 430 element, 431 leadingTextStart, 432 prevOffset, 433 tokenStart, 434 children 435 } = stack.pop(); 436 const text = endOffset ? indoc.substr(prevOffset, endOffset - prevOffset) : indoc.substr(prevOffset); 437 if (text) { 438 children.push(text); 439 } 440 if (null !== leadingTextStart) { 441 output.push(indoc.substr(leadingTextStart, tokenStart - leadingTextStart)); 442 } 443 output.push((0,external_React_namespaceObject.cloneElement)(element, null, ...children)); 444 } 445 /* harmony default export */ const create_interpolate_element = (createInterpolateElement); 446 447 ;// ./node_modules/@wordpress/element/build-module/react.js 448 /** 449 * External dependencies 450 */ 451 // eslint-disable-next-line @typescript-eslint/no-restricted-imports 452 453 454 /** 455 * Object containing a React element. 456 * 457 * @typedef {import('react').ReactElement} Element 458 */ 459 460 /** 461 * Object containing a React component. 462 * 463 * @typedef {import('react').ComponentType} ComponentType 464 */ 465 466 /** 467 * Object containing a React synthetic event. 468 * 469 * @typedef {import('react').SyntheticEvent} SyntheticEvent 470 */ 471 472 /** 473 * Object containing a React ref object. 474 * 475 * @template T 476 * @typedef {import('react').RefObject<T>} RefObject<T> 477 */ 478 479 /** 480 * Object containing a React ref callback. 481 * 482 * @template T 483 * @typedef {import('react').RefCallback<T>} RefCallback<T> 484 */ 485 486 /** 487 * Object containing a React ref. 488 * 489 * @template T 490 * @typedef {import('react').Ref<T>} Ref<T> 491 */ 492 493 /** 494 * Object that provides utilities for dealing with React children. 495 */ 496 497 498 /** 499 * Creates a copy of an element with extended props. 500 * 501 * @param {Element} element Element 502 * @param {?Object} props Props to apply to cloned element 503 * 504 * @return {Element} Cloned element. 505 */ 506 507 508 /** 509 * A base class to create WordPress Components (Refs, state and lifecycle hooks) 510 */ 511 512 513 /** 514 * Creates a context object containing two components: a provider and consumer. 515 * 516 * @param {Object} defaultValue A default data stored in the context. 517 * 518 * @return {Object} Context object. 519 */ 520 521 522 /** 523 * Returns a new element of given type. Type can be either a string tag name or 524 * another function which itself returns an element. 525 * 526 * @param {?(string|Function)} type Tag name or element creator 527 * @param {Object} props Element properties, either attribute 528 * set to apply to DOM node or values to 529 * pass through to element creator 530 * @param {...Element} children Descendant elements 531 * 532 * @return {Element} Element. 533 */ 534 535 536 /** 537 * Returns an object tracking a reference to a rendered element via its 538 * `current` property as either a DOMElement or Element, dependent upon the 539 * type of element rendered with the ref attribute. 540 * 541 * @return {Object} Ref object. 542 */ 543 544 545 /** 546 * Component enhancer used to enable passing a ref to its wrapped component. 547 * Pass a function argument which receives `props` and `ref` as its arguments, 548 * returning an element using the forwarded ref. The return value is a new 549 * component which forwards its ref. 550 * 551 * @param {Function} forwarder Function passed `props` and `ref`, expected to 552 * return an element. 553 * 554 * @return {Component} Enhanced component. 555 */ 556 557 558 /** 559 * A component which renders its children without any wrapping element. 560 */ 561 562 563 /** 564 * Checks if an object is a valid React Element. 565 * 566 * @param {Object} objectToCheck The object to be checked. 567 * 568 * @return {boolean} true if objectToTest is a valid React Element and false otherwise. 569 */ 570 571 572 /** 573 * @see https://react.dev/reference/react/memo 574 */ 575 576 577 /** 578 * Component that activates additional checks and warnings for its descendants. 579 */ 580 581 582 /** 583 * @see https://react.dev/reference/react/useCallback 584 */ 585 586 587 /** 588 * @see https://react.dev/reference/react/useContext 589 */ 590 591 592 /** 593 * @see https://react.dev/reference/react/useDebugValue 594 */ 595 596 597 /** 598 * @see https://react.dev/reference/react/useDeferredValue 599 */ 600 601 602 /** 603 * @see https://react.dev/reference/react/useEffect 604 */ 605 606 607 /** 608 * @see https://react.dev/reference/react/useId 609 */ 610 611 612 /** 613 * @see https://react.dev/reference/react/useImperativeHandle 614 */ 615 616 617 /** 618 * @see https://react.dev/reference/react/useInsertionEffect 619 */ 620 621 622 /** 623 * @see https://react.dev/reference/react/useLayoutEffect 624 */ 625 626 627 /** 628 * @see https://react.dev/reference/react/useMemo 629 */ 630 631 632 /** 633 * @see https://react.dev/reference/react/useReducer 634 */ 635 636 637 /** 638 * @see https://react.dev/reference/react/useRef 639 */ 640 641 642 /** 643 * @see https://react.dev/reference/react/useState 644 */ 645 646 647 /** 648 * @see https://react.dev/reference/react/useSyncExternalStore 649 */ 650 651 652 /** 653 * @see https://react.dev/reference/react/useTransition 654 */ 655 656 657 /** 658 * @see https://react.dev/reference/react/startTransition 659 */ 660 661 662 /** 663 * @see https://react.dev/reference/react/lazy 664 */ 665 666 667 /** 668 * @see https://react.dev/reference/react/Suspense 669 */ 670 671 672 /** 673 * @see https://react.dev/reference/react/PureComponent 674 */ 675 676 677 /** 678 * Concatenate two or more React children objects. 679 * 680 * @param {...?Object} childrenArguments Array of children arguments (array of arrays/strings/objects) to concatenate. 681 * 682 * @return {Array} The concatenated value. 683 */ 684 function concatChildren(...childrenArguments) { 685 return childrenArguments.reduce((accumulator, children, i) => { 686 external_React_namespaceObject.Children.forEach(children, (child, j) => { 687 if (child && 'string' !== typeof child) { 688 child = (0,external_React_namespaceObject.cloneElement)(child, { 689 key: [i, j].join() 690 }); 691 } 692 accumulator.push(child); 693 }); 694 return accumulator; 695 }, []); 696 } 697 698 /** 699 * Switches the nodeName of all the elements in the children object. 700 * 701 * @param {?Object} children Children object. 702 * @param {string} nodeName Node name. 703 * 704 * @return {?Object} The updated children object. 705 */ 706 function switchChildrenNodeName(children, nodeName) { 707 return children && external_React_namespaceObject.Children.map(children, (elt, index) => { 708 if (typeof elt?.valueOf() === 'string') { 709 return (0,external_React_namespaceObject.createElement)(nodeName, { 710 key: index 711 }, elt); 712 } 713 const { 714 children: childrenProp, 715 ...props 716 } = elt.props; 717 return (0,external_React_namespaceObject.createElement)(nodeName, { 718 key: index, 719 ...props 720 }, childrenProp); 721 }); 722 } 723 724 // EXTERNAL MODULE: external "ReactDOM" 725 var external_ReactDOM_ = __webpack_require__(5795); 726 // EXTERNAL MODULE: ./node_modules/react-dom/client.js 727 var client = __webpack_require__(4140); 728 ;// ./node_modules/@wordpress/element/build-module/react-platform.js 729 /** 730 * External dependencies 731 */ 732 733 734 735 /** 736 * Creates a portal into which a component can be rendered. 737 * 738 * @see https://github.com/facebook/react/issues/10309#issuecomment-318433235 739 * 740 * @param {import('react').ReactElement} child Any renderable child, such as an element, 741 * string, or fragment. 742 * @param {HTMLElement} container DOM node into which element should be rendered. 743 */ 744 745 746 /** 747 * Finds the dom node of a React component. 748 * 749 * @param {import('react').ComponentType} component Component's instance. 750 */ 751 752 753 /** 754 * Forces React to flush any updates inside the provided callback synchronously. 755 * 756 * @param {Function} callback Callback to run synchronously. 757 */ 758 759 760 /** 761 * Renders a given element into the target DOM node. 762 * 763 * @deprecated since WordPress 6.2.0. Use `createRoot` instead. 764 * @see https://react.dev/reference/react-dom/render 765 */ 766 767 768 /** 769 * Hydrates a given element into the target DOM node. 770 * 771 * @deprecated since WordPress 6.2.0. Use `hydrateRoot` instead. 772 * @see https://react.dev/reference/react-dom/hydrate 773 */ 774 775 776 /** 777 * Creates a new React root for the target DOM node. 778 * 779 * @since 6.2.0 Introduced in WordPress core. 780 * @see https://react.dev/reference/react-dom/client/createRoot 781 */ 782 783 784 /** 785 * Creates a new React root for the target DOM node and hydrates it with a pre-generated markup. 786 * 787 * @since 6.2.0 Introduced in WordPress core. 788 * @see https://react.dev/reference/react-dom/client/hydrateRoot 789 */ 790 791 792 /** 793 * Removes any mounted element from the target DOM node. 794 * 795 * @deprecated since WordPress 6.2.0. Use `root.unmount()` instead. 796 * @see https://react.dev/reference/react-dom/unmountComponentAtNode 797 */ 798 799 800 ;// ./node_modules/@wordpress/element/build-module/utils.js 801 /** 802 * Checks if the provided WP element is empty. 803 * 804 * @param {*} element WP element to check. 805 * @return {boolean} True when an element is considered empty. 806 */ 807 const isEmptyElement = element => { 808 if (typeof element === 'number') { 809 return false; 810 } 811 if (typeof element?.valueOf() === 'string' || Array.isArray(element)) { 812 return !element.length; 813 } 814 return !element; 815 }; 816 817 ;// ./node_modules/@wordpress/element/build-module/platform.js 818 /** 819 * Parts of this source were derived and modified from react-native-web, 820 * released under the MIT license. 821 * 822 * Copyright (c) 2016-present, Nicolas Gallagher. 823 * Copyright (c) 2015-present, Facebook, Inc. 824 * 825 */ 826 const Platform = { 827 OS: 'web', 828 select: spec => 'web' in spec ? spec.web : spec.default, 829 isWeb: true 830 }; 831 /** 832 * Component used to detect the current Platform being used. 833 * Use Platform.OS === 'web' to detect if running on web enviroment. 834 * 835 * This is the same concept as the React Native implementation. 836 * 837 * @see https://reactnative.dev/docs/platform-specific-code#platform-module 838 * 839 * Here is an example of how to use the select method: 840 * @example 841 * ```js 842 * import { Platform } from '@wordpress/element'; 843 * 844 * const placeholderLabel = Platform.select( { 845 * native: __( 'Add media' ), 846 * web: __( 'Drag images, upload new ones or select files from your library.' ), 847 * } ); 848 * ``` 849 */ 850 /* harmony default export */ const platform = (Platform); 851 852 ;// ./node_modules/is-plain-object/dist/is-plain-object.mjs 853 /*! 854 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 855 * 856 * Copyright (c) 2014-2017, Jon Schlinkert. 857 * Released under the MIT License. 858 */ 859 860 function isObject(o) { 861 return Object.prototype.toString.call(o) === '[object Object]'; 862 } 863 864 function isPlainObject(o) { 865 var ctor,prot; 866 867 if (isObject(o) === false) return false; 868 869 // If has modified constructor 870 ctor = o.constructor; 871 if (ctor === undefined) return true; 872 873 // If has modified prototype 874 prot = ctor.prototype; 875 if (isObject(prot) === false) return false; 876 877 // If constructor does not have an Object-specific method 878 if (prot.hasOwnProperty('isPrototypeOf') === false) { 879 return false; 880 } 881 882 // Most likely a plain Object 883 return true; 884 } 885 886 887 888 ;// ./node_modules/tslib/tslib.es6.mjs 889 /****************************************************************************** 890 Copyright (c) Microsoft Corporation. 891 892 Permission to use, copy, modify, and/or distribute this software for any 893 purpose with or without fee is hereby granted. 894 895 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH 896 REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 897 AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, 898 INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM 899 LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR 900 OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR 901 PERFORMANCE OF THIS SOFTWARE. 902 ***************************************************************************** */ 903 /* global Reflect, Promise, SuppressedError, Symbol, Iterator */ 904 905 var extendStatics = function(d, b) { 906 extendStatics = Object.setPrototypeOf || 907 ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 908 function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; 909 return extendStatics(d, b); 910 }; 911 912 function __extends(d, b) { 913 if (typeof b !== "function" && b !== null) 914 throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); 915 extendStatics(d, b); 916 function __() { this.constructor = d; } 917 d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 918 } 919 920 var __assign = function() { 921 __assign = Object.assign || function __assign(t) { 922 for (var s, i = 1, n = arguments.length; i < n; i++) { 923 s = arguments[i]; 924 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 925 } 926 return t; 927 } 928 return __assign.apply(this, arguments); 929 } 930 931 function __rest(s, e) { 932 var t = {}; 933 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) 934 t[p] = s[p]; 935 if (s != null && typeof Object.getOwnPropertySymbols === "function") 936 for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { 937 if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) 938 t[p[i]] = s[p[i]]; 939 } 940 return t; 941 } 942 943 function __decorate(decorators, target, key, desc) { 944 var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; 945 if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); 946 else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; 947 return c > 3 && r && Object.defineProperty(target, key, r), r; 948 } 949 950 function __param(paramIndex, decorator) { 951 return function (target, key) { decorator(target, key, paramIndex); } 952 } 953 954 function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) { 955 function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; } 956 var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value"; 957 var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null; 958 var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {}); 959 var _, done = false; 960 for (var i = decorators.length - 1; i >= 0; i--) { 961 var context = {}; 962 for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p]; 963 for (var p in contextIn.access) context.access[p] = contextIn.access[p]; 964 context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); }; 965 var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context); 966 if (kind === "accessor") { 967 if (result === void 0) continue; 968 if (result === null || typeof result !== "object") throw new TypeError("Object expected"); 969 if (_ = accept(result.get)) descriptor.get = _; 970 if (_ = accept(result.set)) descriptor.set = _; 971 if (_ = accept(result.init)) initializers.unshift(_); 972 } 973 else if (_ = accept(result)) { 974 if (kind === "field") initializers.unshift(_); 975 else descriptor[key] = _; 976 } 977 } 978 if (target) Object.defineProperty(target, contextIn.name, descriptor); 979 done = true; 980 }; 981 982 function __runInitializers(thisArg, initializers, value) { 983 var useValue = arguments.length > 2; 984 for (var i = 0; i < initializers.length; i++) { 985 value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg); 986 } 987 return useValue ? value : void 0; 988 }; 989 990 function __propKey(x) { 991 return typeof x === "symbol" ? x : "".concat(x); 992 }; 993 994 function __setFunctionName(f, name, prefix) { 995 if (typeof name === "symbol") name = name.description ? "[".concat(name.description, "]") : ""; 996 return Object.defineProperty(f, "name", { configurable: true, value: prefix ? "".concat(prefix, " ", name) : name }); 997 }; 998 999 function __metadata(metadataKey, metadataValue) { 1000 if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue); 1001 } 1002 1003 function __awaiter(thisArg, _arguments, P, generator) { 1004 function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } 1005 return new (P || (P = Promise))(function (resolve, reject) { 1006 function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } 1007 function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } 1008 function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } 1009 step((generator = generator.apply(thisArg, _arguments || [])).next()); 1010 }); 1011 } 1012 1013 function __generator(thisArg, body) { 1014 var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype); 1015 return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; 1016 function verb(n) { return function (v) { return step([n, v]); }; } 1017 function step(op) { 1018 if (f) throw new TypeError("Generator is already executing."); 1019 while (g && (g = 0, op[0] && (_ = 0)), _) try { 1020 if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; 1021 if (y = 0, t) op = [op[0] & 2, t.value]; 1022 switch (op[0]) { 1023 case 0: case 1: t = op; break; 1024 case 4: _.label++; return { value: op[1], done: false }; 1025 case 5: _.label++; y = op[1]; op = [0]; continue; 1026 case 7: op = _.ops.pop(); _.trys.pop(); continue; 1027 default: 1028 if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } 1029 if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } 1030 if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } 1031 if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } 1032 if (t[2]) _.ops.pop(); 1033 _.trys.pop(); continue; 1034 } 1035 op = body.call(thisArg, _); 1036 } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } 1037 if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; 1038 } 1039 } 1040 1041 var __createBinding = Object.create ? (function(o, m, k, k2) { 1042 if (k2 === undefined) k2 = k; 1043 var desc = Object.getOwnPropertyDescriptor(m, k); 1044 if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { 1045 desc = { enumerable: true, get: function() { return m[k]; } }; 1046 } 1047 Object.defineProperty(o, k2, desc); 1048 }) : (function(o, m, k, k2) { 1049 if (k2 === undefined) k2 = k; 1050 o[k2] = m[k]; 1051 }); 1052 1053 function __exportStar(m, o) { 1054 for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p); 1055 } 1056 1057 function __values(o) { 1058 var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0; 1059 if (m) return m.call(o); 1060 if (o && typeof o.length === "number") return { 1061 next: function () { 1062 if (o && i >= o.length) o = void 0; 1063 return { value: o && o[i++], done: !o }; 1064 } 1065 }; 1066 throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined."); 1067 } 1068 1069 function __read(o, n) { 1070 var m = typeof Symbol === "function" && o[Symbol.iterator]; 1071 if (!m) return o; 1072 var i = m.call(o), r, ar = [], e; 1073 try { 1074 while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value); 1075 } 1076 catch (error) { e = { error: error }; } 1077 finally { 1078 try { 1079 if (r && !r.done && (m = i["return"])) m.call(i); 1080 } 1081 finally { if (e) throw e.error; } 1082 } 1083 return ar; 1084 } 1085 1086 /** @deprecated */ 1087 function __spread() { 1088 for (var ar = [], i = 0; i < arguments.length; i++) 1089 ar = ar.concat(__read(arguments[i])); 1090 return ar; 1091 } 1092 1093 /** @deprecated */ 1094 function __spreadArrays() { 1095 for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length; 1096 for (var r = Array(s), k = 0, i = 0; i < il; i++) 1097 for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) 1098 r[k] = a[j]; 1099 return r; 1100 } 1101 1102 function __spreadArray(to, from, pack) { 1103 if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) { 1104 if (ar || !(i in from)) { 1105 if (!ar) ar = Array.prototype.slice.call(from, 0, i); 1106 ar[i] = from[i]; 1107 } 1108 } 1109 return to.concat(ar || Array.prototype.slice.call(from)); 1110 } 1111 1112 function __await(v) { 1113 return this instanceof __await ? (this.v = v, this) : new __await(v); 1114 } 1115 1116 function __asyncGenerator(thisArg, _arguments, generator) { 1117 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 1118 var g = generator.apply(thisArg, _arguments || []), i, q = []; 1119 return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb("next"), verb("throw"), verb("return", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i; 1120 function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; } 1121 function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } } 1122 function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } 1123 function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } 1124 function fulfill(value) { resume("next", value); } 1125 function reject(value) { resume("throw", value); } 1126 function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } 1127 } 1128 1129 function __asyncDelegator(o) { 1130 var i, p; 1131 return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i; 1132 function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; } 1133 } 1134 1135 function __asyncValues(o) { 1136 if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); 1137 var m = o[Symbol.asyncIterator], i; 1138 return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i); 1139 function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; } 1140 function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); } 1141 } 1142 1143 function __makeTemplateObject(cooked, raw) { 1144 if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; } 1145 return cooked; 1146 }; 1147 1148 var __setModuleDefault = Object.create ? (function(o, v) { 1149 Object.defineProperty(o, "default", { enumerable: true, value: v }); 1150 }) : function(o, v) { 1151 o["default"] = v; 1152 }; 1153 1154 function __importStar(mod) { 1155 if (mod && mod.__esModule) return mod; 1156 var result = {}; 1157 if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); 1158 __setModuleDefault(result, mod); 1159 return result; 1160 } 1161 1162 function __importDefault(mod) { 1163 return (mod && mod.__esModule) ? mod : { default: mod }; 1164 } 1165 1166 function __classPrivateFieldGet(receiver, state, kind, f) { 1167 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter"); 1168 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it"); 1169 return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver); 1170 } 1171 1172 function __classPrivateFieldSet(receiver, state, value, kind, f) { 1173 if (kind === "m") throw new TypeError("Private method is not writable"); 1174 if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter"); 1175 if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it"); 1176 return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value; 1177 } 1178 1179 function __classPrivateFieldIn(state, receiver) { 1180 if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object"); 1181 return typeof state === "function" ? receiver === state : state.has(receiver); 1182 } 1183 1184 function __addDisposableResource(env, value, async) { 1185 if (value !== null && value !== void 0) { 1186 if (typeof value !== "object" && typeof value !== "function") throw new TypeError("Object expected."); 1187 var dispose, inner; 1188 if (async) { 1189 if (!Symbol.asyncDispose) throw new TypeError("Symbol.asyncDispose is not defined."); 1190 dispose = value[Symbol.asyncDispose]; 1191 } 1192 if (dispose === void 0) { 1193 if (!Symbol.dispose) throw new TypeError("Symbol.dispose is not defined."); 1194 dispose = value[Symbol.dispose]; 1195 if (async) inner = dispose; 1196 } 1197 if (typeof dispose !== "function") throw new TypeError("Object not disposable."); 1198 if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } }; 1199 env.stack.push({ value: value, dispose: dispose, async: async }); 1200 } 1201 else if (async) { 1202 env.stack.push({ async: true }); 1203 } 1204 return value; 1205 } 1206 1207 var _SuppressedError = typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) { 1208 var e = new Error(message); 1209 return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e; 1210 }; 1211 1212 function __disposeResources(env) { 1213 function fail(e) { 1214 env.error = env.hasError ? new _SuppressedError(e, env.error, "An error was suppressed during disposal.") : e; 1215 env.hasError = true; 1216 } 1217 var r, s = 0; 1218 function next() { 1219 while (r = env.stack.pop()) { 1220 try { 1221 if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next); 1222 if (r.dispose) { 1223 var result = r.dispose.call(r.value); 1224 if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); }); 1225 } 1226 else s |= 1; 1227 } 1228 catch (e) { 1229 fail(e); 1230 } 1231 } 1232 if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve(); 1233 if (env.hasError) throw env.error; 1234 } 1235 return next(); 1236 } 1237 1238 /* harmony default export */ const tslib_es6 = ({ 1239 __extends, 1240 __assign, 1241 __rest, 1242 __decorate, 1243 __param, 1244 __metadata, 1245 __awaiter, 1246 __generator, 1247 __createBinding, 1248 __exportStar, 1249 __values, 1250 __read, 1251 __spread, 1252 __spreadArrays, 1253 __spreadArray, 1254 __await, 1255 __asyncGenerator, 1256 __asyncDelegator, 1257 __asyncValues, 1258 __makeTemplateObject, 1259 __importStar, 1260 __importDefault, 1261 __classPrivateFieldGet, 1262 __classPrivateFieldSet, 1263 __classPrivateFieldIn, 1264 __addDisposableResource, 1265 __disposeResources, 1266 }); 1267 1268 ;// ./node_modules/lower-case/dist.es2015/index.js 1269 /** 1270 * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt 1271 */ 1272 var SUPPORTED_LOCALE = { 1273 tr: { 1274 regexp: /\u0130|\u0049|\u0049\u0307/g, 1275 map: { 1276 İ: "\u0069", 1277 I: "\u0131", 1278 İ: "\u0069", 1279 }, 1280 }, 1281 az: { 1282 regexp: /\u0130/g, 1283 map: { 1284 İ: "\u0069", 1285 I: "\u0131", 1286 İ: "\u0069", 1287 }, 1288 }, 1289 lt: { 1290 regexp: /\u0049|\u004A|\u012E|\u00CC|\u00CD|\u0128/g, 1291 map: { 1292 I: "\u0069\u0307", 1293 J: "\u006A\u0307", 1294 Į: "\u012F\u0307", 1295 Ì: "\u0069\u0307\u0300", 1296 Í: "\u0069\u0307\u0301", 1297 Ĩ: "\u0069\u0307\u0303", 1298 }, 1299 }, 1300 }; 1301 /** 1302 * Localized lower case. 1303 */ 1304 function localeLowerCase(str, locale) { 1305 var lang = SUPPORTED_LOCALE[locale.toLowerCase()]; 1306 if (lang) 1307 return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; })); 1308 return lowerCase(str); 1309 } 1310 /** 1311 * Lower case as a function. 1312 */ 1313 function lowerCase(str) { 1314 return str.toLowerCase(); 1315 } 1316 1317 ;// ./node_modules/no-case/dist.es2015/index.js 1318 1319 // Support camel case ("camelCase" -> "camel Case" and "CAMELCase" -> "CAMEL Case"). 1320 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 1321 // Remove all non-word characters. 1322 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 1323 /** 1324 * Normalize the string into something other libraries can manipulate easier. 1325 */ 1326 function noCase(input, options) { 1327 if (options === void 0) { options = {}; } 1328 var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? " " : _d; 1329 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 1330 var start = 0; 1331 var end = result.length; 1332 // Trim the delimiter from around the output string. 1333 while (result.charAt(start) === "\0") 1334 start++; 1335 while (result.charAt(end - 1) === "\0") 1336 end--; 1337 // Transform each token independently. 1338 return result.slice(start, end).split("\0").map(transform).join(delimiter); 1339 } 1340 /** 1341 * Replace `re` in the input string with the replacement value. 1342 */ 1343 function replace(input, re, value) { 1344 if (re instanceof RegExp) 1345 return input.replace(re, value); 1346 return re.reduce(function (input, re) { return input.replace(re, value); }, input); 1347 } 1348 1349 ;// ./node_modules/dot-case/dist.es2015/index.js 1350 1351 1352 function dotCase(input, options) { 1353 if (options === void 0) { options = {}; } 1354 return noCase(input, __assign({ delimiter: "." }, options)); 1355 } 1356 1357 ;// ./node_modules/param-case/dist.es2015/index.js 1358 1359 1360 function paramCase(input, options) { 1361 if (options === void 0) { options = {}; } 1362 return dotCase(input, __assign({ delimiter: "-" }, options)); 1363 } 1364 1365 ;// external ["wp","escapeHtml"] 1366 const external_wp_escapeHtml_namespaceObject = window["wp"]["escapeHtml"]; 1367 ;// ./node_modules/@wordpress/element/build-module/raw-html.js 1368 /** 1369 * Internal dependencies 1370 */ 1371 1372 1373 /** @typedef {{children: string} & import('react').ComponentPropsWithoutRef<'div'>} RawHTMLProps */ 1374 1375 /** 1376 * Component used as equivalent of Fragment with unescaped HTML, in cases where 1377 * it is desirable to render dangerous HTML without needing a wrapper element. 1378 * To preserve additional props, a `div` wrapper _will_ be created if any props 1379 * aside from `children` are passed. 1380 * 1381 * @param {RawHTMLProps} props Children should be a string of HTML or an array 1382 * of strings. Other props will be passed through 1383 * to the div wrapper. 1384 * 1385 * @return {JSX.Element} Dangerously-rendering component. 1386 */ 1387 function RawHTML({ 1388 children, 1389 ...props 1390 }) { 1391 let rawHtml = ''; 1392 1393 // Cast children as an array, and concatenate each element if it is a string. 1394 external_React_namespaceObject.Children.toArray(children).forEach(child => { 1395 if (typeof child === 'string' && child.trim() !== '') { 1396 rawHtml += child; 1397 } 1398 }); 1399 1400 // The `div` wrapper will be stripped by the `renderElement` serializer in 1401 // `./serialize.js` unless there are non-children props present. 1402 return (0,external_React_namespaceObject.createElement)('div', { 1403 dangerouslySetInnerHTML: { 1404 __html: rawHtml 1405 }, 1406 ...props 1407 }); 1408 } 1409 1410 ;// ./node_modules/@wordpress/element/build-module/serialize.js 1411 /** 1412 * Parts of this source were derived and modified from fast-react-render, 1413 * released under the MIT license. 1414 * 1415 * https://github.com/alt-j/fast-react-render 1416 * 1417 * Copyright (c) 2016 Andrey Morozov 1418 * 1419 * Permission is hereby granted, free of charge, to any person obtaining a copy 1420 * of this software and associated documentation files (the "Software"), to deal 1421 * in the Software without restriction, including without limitation the rights 1422 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 1423 * copies of the Software, and to permit persons to whom the Software is 1424 * furnished to do so, subject to the following conditions: 1425 * 1426 * The above copyright notice and this permission notice shall be included in 1427 * all copies or substantial portions of the Software. 1428 * 1429 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 1430 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 1431 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 1432 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 1433 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 1434 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 1435 * THE SOFTWARE. 1436 */ 1437 1438 /** 1439 * External dependencies 1440 */ 1441 1442 1443 1444 /** 1445 * WordPress dependencies 1446 */ 1447 1448 1449 /** 1450 * Internal dependencies 1451 */ 1452 1453 1454 1455 /** @typedef {import('react').ReactElement} ReactElement */ 1456 1457 const { 1458 Provider, 1459 Consumer 1460 } = (0,external_React_namespaceObject.createContext)(undefined); 1461 const ForwardRef = (0,external_React_namespaceObject.forwardRef)(() => { 1462 return null; 1463 }); 1464 1465 /** 1466 * Valid attribute types. 1467 * 1468 * @type {Set<string>} 1469 */ 1470 const ATTRIBUTES_TYPES = new Set(['string', 'boolean', 'number']); 1471 1472 /** 1473 * Element tags which can be self-closing. 1474 * 1475 * @type {Set<string>} 1476 */ 1477 const SELF_CLOSING_TAGS = new Set(['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']); 1478 1479 /** 1480 * Boolean attributes are attributes whose presence as being assigned is 1481 * meaningful, even if only empty. 1482 * 1483 * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#boolean-attributes 1484 * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3 1485 * 1486 * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ] 1487 * .filter( ( tr ) => tr.lastChild.textContent.indexOf( 'Boolean attribute' ) !== -1 ) 1488 * .reduce( ( result, tr ) => Object.assign( result, { 1489 * [ tr.firstChild.textContent.trim() ]: true 1490 * } ), {} ) ).sort(); 1491 * 1492 * @type {Set<string>} 1493 */ 1494 const BOOLEAN_ATTRIBUTES = new Set(['allowfullscreen', 'allowpaymentrequest', 'allowusermedia', 'async', 'autofocus', 'autoplay', 'checked', 'controls', 'default', 'defer', 'disabled', 'download', 'formnovalidate', 'hidden', 'ismap', 'itemscope', 'loop', 'multiple', 'muted', 'nomodule', 'novalidate', 'open', 'playsinline', 'readonly', 'required', 'reversed', 'selected', 'typemustmatch']); 1495 1496 /** 1497 * Enumerated attributes are attributes which must be of a specific value form. 1498 * Like boolean attributes, these are meaningful if specified, even if not of a 1499 * valid enumerated value. 1500 * 1501 * See: https://html.spec.whatwg.org/multipage/common-microsyntaxes.html#enumerated-attribute 1502 * Extracted from: https://html.spec.whatwg.org/multipage/indices.html#attributes-3 1503 * 1504 * Object.keys( [ ...document.querySelectorAll( '#attributes-1 > tbody > tr' ) ] 1505 * .filter( ( tr ) => /^("(.+?)";?\s*)+/.test( tr.lastChild.textContent.trim() ) ) 1506 * .reduce( ( result, tr ) => Object.assign( result, { 1507 * [ tr.firstChild.textContent.trim() ]: true 1508 * } ), {} ) ).sort(); 1509 * 1510 * Some notable omissions: 1511 * 1512 * - `alt`: https://blog.whatwg.org/omit-alt 1513 * 1514 * @type {Set<string>} 1515 */ 1516 const ENUMERATED_ATTRIBUTES = new Set(['autocapitalize', 'autocomplete', 'charset', 'contenteditable', 'crossorigin', 'decoding', 'dir', 'draggable', 'enctype', 'formenctype', 'formmethod', 'http-equiv', 'inputmode', 'kind', 'method', 'preload', 'scope', 'shape', 'spellcheck', 'translate', 'type', 'wrap']); 1517 1518 /** 1519 * Set of CSS style properties which support assignment of unitless numbers. 1520 * Used in rendering of style properties, where `px` unit is assumed unless 1521 * property is included in this set or value is zero. 1522 * 1523 * Generated via: 1524 * 1525 * Object.entries( document.createElement( 'div' ).style ) 1526 * .filter( ( [ key ] ) => ( 1527 * ! /^(webkit|ms|moz)/.test( key ) && 1528 * ( e.style[ key ] = 10 ) && 1529 * e.style[ key ] === '10' 1530 * ) ) 1531 * .map( ( [ key ] ) => key ) 1532 * .sort(); 1533 * 1534 * @type {Set<string>} 1535 */ 1536 const CSS_PROPERTIES_SUPPORTS_UNITLESS = new Set(['animation', 'animationIterationCount', 'baselineShift', 'borderImageOutset', 'borderImageSlice', 'borderImageWidth', 'columnCount', 'cx', 'cy', 'fillOpacity', 'flexGrow', 'flexShrink', 'floodOpacity', 'fontWeight', 'gridColumnEnd', 'gridColumnStart', 'gridRowEnd', 'gridRowStart', 'lineHeight', 'opacity', 'order', 'orphans', 'r', 'rx', 'ry', 'shapeImageThreshold', 'stopOpacity', 'strokeDasharray', 'strokeDashoffset', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'tabSize', 'widows', 'x', 'y', 'zIndex', 'zoom']); 1537 1538 /** 1539 * Returns true if the specified string is prefixed by one of an array of 1540 * possible prefixes. 1541 * 1542 * @param {string} string String to check. 1543 * @param {string[]} prefixes Possible prefixes. 1544 * 1545 * @return {boolean} Whether string has prefix. 1546 */ 1547 function hasPrefix(string, prefixes) { 1548 return prefixes.some(prefix => string.indexOf(prefix) === 0); 1549 } 1550 1551 /** 1552 * Returns true if the given prop name should be ignored in attributes 1553 * serialization, or false otherwise. 1554 * 1555 * @param {string} attribute Attribute to check. 1556 * 1557 * @return {boolean} Whether attribute should be ignored. 1558 */ 1559 function isInternalAttribute(attribute) { 1560 return 'key' === attribute || 'children' === attribute; 1561 } 1562 1563 /** 1564 * Returns the normal form of the element's attribute value for HTML. 1565 * 1566 * @param {string} attribute Attribute name. 1567 * @param {*} value Non-normalized attribute value. 1568 * 1569 * @return {*} Normalized attribute value. 1570 */ 1571 function getNormalAttributeValue(attribute, value) { 1572 switch (attribute) { 1573 case 'style': 1574 return renderStyle(value); 1575 } 1576 return value; 1577 } 1578 /** 1579 * This is a map of all SVG attributes that have dashes. Map(lower case prop => dashed lower case attribute). 1580 * We need this to render e.g strokeWidth as stroke-width. 1581 * 1582 * List from: https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute. 1583 */ 1584 const SVG_ATTRIBUTE_WITH_DASHES_LIST = ['accentHeight', 'alignmentBaseline', 'arabicForm', 'baselineShift', 'capHeight', 'clipPath', 'clipRule', 'colorInterpolation', 'colorInterpolationFilters', 'colorProfile', 'colorRendering', 'dominantBaseline', 'enableBackground', 'fillOpacity', 'fillRule', 'floodColor', 'floodOpacity', 'fontFamily', 'fontSize', 'fontSizeAdjust', 'fontStretch', 'fontStyle', 'fontVariant', 'fontWeight', 'glyphName', 'glyphOrientationHorizontal', 'glyphOrientationVertical', 'horizAdvX', 'horizOriginX', 'imageRendering', 'letterSpacing', 'lightingColor', 'markerEnd', 'markerMid', 'markerStart', 'overlinePosition', 'overlineThickness', 'paintOrder', 'panose1', 'pointerEvents', 'renderingIntent', 'shapeRendering', 'stopColor', 'stopOpacity', 'strikethroughPosition', 'strikethroughThickness', 'strokeDasharray', 'strokeDashoffset', 'strokeLinecap', 'strokeLinejoin', 'strokeMiterlimit', 'strokeOpacity', 'strokeWidth', 'textAnchor', 'textDecoration', 'textRendering', 'underlinePosition', 'underlineThickness', 'unicodeBidi', 'unicodeRange', 'unitsPerEm', 'vAlphabetic', 'vHanging', 'vIdeographic', 'vMathematical', 'vectorEffect', 'vertAdvY', 'vertOriginX', 'vertOriginY', 'wordSpacing', 'writingMode', 'xmlnsXlink', 'xHeight'].reduce((map, attribute) => { 1585 // The keys are lower-cased for more robust lookup. 1586 map[attribute.toLowerCase()] = attribute; 1587 return map; 1588 }, {}); 1589 1590 /** 1591 * This is a map of all case-sensitive SVG attributes. Map(lowercase key => proper case attribute). 1592 * The keys are lower-cased for more robust lookup. 1593 * Note that this list only contains attributes that contain at least one capital letter. 1594 * Lowercase attributes don't need mapping, since we lowercase all attributes by default. 1595 */ 1596 const CASE_SENSITIVE_SVG_ATTRIBUTES = ['allowReorder', 'attributeName', 'attributeType', 'autoReverse', 'baseFrequency', 'baseProfile', 'calcMode', 'clipPathUnits', 'contentScriptType', 'contentStyleType', 'diffuseConstant', 'edgeMode', 'externalResourcesRequired', 'filterRes', 'filterUnits', 'glyphRef', 'gradientTransform', 'gradientUnits', 'kernelMatrix', 'kernelUnitLength', 'keyPoints', 'keySplines', 'keyTimes', 'lengthAdjust', 'limitingConeAngle', 'markerHeight', 'markerUnits', 'markerWidth', 'maskContentUnits', 'maskUnits', 'numOctaves', 'pathLength', 'patternContentUnits', 'patternTransform', 'patternUnits', 'pointsAtX', 'pointsAtY', 'pointsAtZ', 'preserveAlpha', 'preserveAspectRatio', 'primitiveUnits', 'refX', 'refY', 'repeatCount', 'repeatDur', 'requiredExtensions', 'requiredFeatures', 'specularConstant', 'specularExponent', 'spreadMethod', 'startOffset', 'stdDeviation', 'stitchTiles', 'suppressContentEditableWarning', 'suppressHydrationWarning', 'surfaceScale', 'systemLanguage', 'tableValues', 'targetX', 'targetY', 'textLength', 'viewBox', 'viewTarget', 'xChannelSelector', 'yChannelSelector'].reduce((map, attribute) => { 1597 // The keys are lower-cased for more robust lookup. 1598 map[attribute.toLowerCase()] = attribute; 1599 return map; 1600 }, {}); 1601 1602 /** 1603 * This is a map of all SVG attributes that have colons. 1604 * Keys are lower-cased and stripped of their colons for more robust lookup. 1605 */ 1606 const SVG_ATTRIBUTES_WITH_COLONS = ['xlink:actuate', 'xlink:arcrole', 'xlink:href', 'xlink:role', 'xlink:show', 'xlink:title', 'xlink:type', 'xml:base', 'xml:lang', 'xml:space', 'xmlns:xlink'].reduce((map, attribute) => { 1607 map[attribute.replace(':', '').toLowerCase()] = attribute; 1608 return map; 1609 }, {}); 1610 1611 /** 1612 * Returns the normal form of the element's attribute name for HTML. 1613 * 1614 * @param {string} attribute Non-normalized attribute name. 1615 * 1616 * @return {string} Normalized attribute name. 1617 */ 1618 function getNormalAttributeName(attribute) { 1619 switch (attribute) { 1620 case 'htmlFor': 1621 return 'for'; 1622 case 'className': 1623 return 'class'; 1624 } 1625 const attributeLowerCase = attribute.toLowerCase(); 1626 if (CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]) { 1627 return CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]; 1628 } else if (SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]) { 1629 return paramCase(SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]); 1630 } else if (SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]) { 1631 return SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]; 1632 } 1633 return attributeLowerCase; 1634 } 1635 1636 /** 1637 * Returns the normal form of the style property name for HTML. 1638 * 1639 * - Converts property names to kebab-case, e.g. 'backgroundColor' → 'background-color' 1640 * - Leaves custom attributes alone, e.g. '--myBackgroundColor' → '--myBackgroundColor' 1641 * - Converts vendor-prefixed property names to -kebab-case, e.g. 'MozTransform' → '-moz-transform' 1642 * 1643 * @param {string} property Property name. 1644 * 1645 * @return {string} Normalized property name. 1646 */ 1647 function getNormalStylePropertyName(property) { 1648 if (property.startsWith('--')) { 1649 return property; 1650 } 1651 if (hasPrefix(property, ['ms', 'O', 'Moz', 'Webkit'])) { 1652 return '-' + paramCase(property); 1653 } 1654 return paramCase(property); 1655 } 1656 1657 /** 1658 * Returns the normal form of the style property value for HTML. Appends a 1659 * default pixel unit if numeric, not a unitless property, and not zero. 1660 * 1661 * @param {string} property Property name. 1662 * @param {*} value Non-normalized property value. 1663 * 1664 * @return {*} Normalized property value. 1665 */ 1666 function getNormalStylePropertyValue(property, value) { 1667 if (typeof value === 'number' && 0 !== value && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) { 1668 return value + 'px'; 1669 } 1670 return value; 1671 } 1672 1673 /** 1674 * Serializes a React element to string. 1675 * 1676 * @param {import('react').ReactNode} element Element to serialize. 1677 * @param {Object} [context] Context object. 1678 * @param {Object} [legacyContext] Legacy context object. 1679 * 1680 * @return {string} Serialized element. 1681 */ 1682 function renderElement(element, context, legacyContext = {}) { 1683 if (null === element || undefined === element || false === element) { 1684 return ''; 1685 } 1686 if (Array.isArray(element)) { 1687 return renderChildren(element, context, legacyContext); 1688 } 1689 switch (typeof element) { 1690 case 'string': 1691 return (0,external_wp_escapeHtml_namespaceObject.escapeHTML)(element); 1692 case 'number': 1693 return element.toString(); 1694 } 1695 const { 1696 type, 1697 props 1698 } = /** @type {{type?: any, props?: any}} */ 1699 element; 1700 switch (type) { 1701 case external_React_namespaceObject.StrictMode: 1702 case external_React_namespaceObject.Fragment: 1703 return renderChildren(props.children, context, legacyContext); 1704 case RawHTML: 1705 const { 1706 children, 1707 ...wrapperProps 1708 } = props; 1709 return renderNativeComponent(!Object.keys(wrapperProps).length ? null : 'div', { 1710 ...wrapperProps, 1711 dangerouslySetInnerHTML: { 1712 __html: children 1713 } 1714 }, context, legacyContext); 1715 } 1716 switch (typeof type) { 1717 case 'string': 1718 return renderNativeComponent(type, props, context, legacyContext); 1719 case 'function': 1720 if (type.prototype && typeof type.prototype.render === 'function') { 1721 return renderComponent(type, props, context, legacyContext); 1722 } 1723 return renderElement(type(props, legacyContext), context, legacyContext); 1724 } 1725 switch (type && type.$$typeof) { 1726 case Provider.$$typeof: 1727 return renderChildren(props.children, props.value, legacyContext); 1728 case Consumer.$$typeof: 1729 return renderElement(props.children(context || type._currentValue), context, legacyContext); 1730 case ForwardRef.$$typeof: 1731 return renderElement(type.render(props), context, legacyContext); 1732 } 1733 return ''; 1734 } 1735 1736 /** 1737 * Serializes a native component type to string. 1738 * 1739 * @param {?string} type Native component type to serialize, or null if 1740 * rendering as fragment of children content. 1741 * @param {Object} props Props object. 1742 * @param {Object} [context] Context object. 1743 * @param {Object} [legacyContext] Legacy context object. 1744 * 1745 * @return {string} Serialized element. 1746 */ 1747 function renderNativeComponent(type, props, context, legacyContext = {}) { 1748 let content = ''; 1749 if (type === 'textarea' && props.hasOwnProperty('value')) { 1750 // Textarea children can be assigned as value prop. If it is, render in 1751 // place of children. Ensure to omit so it is not assigned as attribute 1752 // as well. 1753 content = renderChildren(props.value, context, legacyContext); 1754 const { 1755 value, 1756 ...restProps 1757 } = props; 1758 props = restProps; 1759 } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === 'string') { 1760 // Dangerous content is left unescaped. 1761 content = props.dangerouslySetInnerHTML.__html; 1762 } else if (typeof props.children !== 'undefined') { 1763 content = renderChildren(props.children, context, legacyContext); 1764 } 1765 if (!type) { 1766 return content; 1767 } 1768 const attributes = renderAttributes(props); 1769 if (SELF_CLOSING_TAGS.has(type)) { 1770 return '<' + type + attributes + '/>'; 1771 } 1772 return '<' + type + attributes + '>' + content + '</' + type + '>'; 1773 } 1774 1775 /** @typedef {import('react').ComponentType} ComponentType */ 1776 1777 /** 1778 * Serializes a non-native component type to string. 1779 * 1780 * @param {ComponentType} Component Component type to serialize. 1781 * @param {Object} props Props object. 1782 * @param {Object} [context] Context object. 1783 * @param {Object} [legacyContext] Legacy context object. 1784 * 1785 * @return {string} Serialized element 1786 */ 1787 function renderComponent(Component, props, context, legacyContext = {}) { 1788 const instance = new ( /** @type {import('react').ComponentClass} */ 1789 Component)(props, legacyContext); 1790 if (typeof 1791 // Ignore reason: Current prettier reformats parens and mangles type assertion 1792 // prettier-ignore 1793 /** @type {{getChildContext?: () => unknown}} */ 1794 instance.getChildContext === 'function') { 1795 Object.assign(legacyContext, /** @type {{getChildContext?: () => unknown}} */instance.getChildContext()); 1796 } 1797 const html = renderElement(instance.render(), context, legacyContext); 1798 return html; 1799 } 1800 1801 /** 1802 * Serializes an array of children to string. 1803 * 1804 * @param {import('react').ReactNodeArray} children Children to serialize. 1805 * @param {Object} [context] Context object. 1806 * @param {Object} [legacyContext] Legacy context object. 1807 * 1808 * @return {string} Serialized children. 1809 */ 1810 function renderChildren(children, context, legacyContext = {}) { 1811 let result = ''; 1812 children = Array.isArray(children) ? children : [children]; 1813 for (let i = 0; i < children.length; i++) { 1814 const child = children[i]; 1815 result += renderElement(child, context, legacyContext); 1816 } 1817 return result; 1818 } 1819 1820 /** 1821 * Renders a props object as a string of HTML attributes. 1822 * 1823 * @param {Object} props Props object. 1824 * 1825 * @return {string} Attributes string. 1826 */ 1827 function renderAttributes(props) { 1828 let result = ''; 1829 for (const key in props) { 1830 const attribute = getNormalAttributeName(key); 1831 if (!(0,external_wp_escapeHtml_namespaceObject.isValidAttributeName)(attribute)) { 1832 continue; 1833 } 1834 let value = getNormalAttributeValue(key, props[key]); 1835 1836 // If value is not of serializable type, skip. 1837 if (!ATTRIBUTES_TYPES.has(typeof value)) { 1838 continue; 1839 } 1840 1841 // Don't render internal attribute names. 1842 if (isInternalAttribute(key)) { 1843 continue; 1844 } 1845 const isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); 1846 1847 // Boolean attribute should be omitted outright if its value is false. 1848 if (isBooleanAttribute && value === false) { 1849 continue; 1850 } 1851 const isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ['data-', 'aria-']) || ENUMERATED_ATTRIBUTES.has(attribute); 1852 1853 // Only write boolean value as attribute if meaningful. 1854 if (typeof value === 'boolean' && !isMeaningfulAttribute) { 1855 continue; 1856 } 1857 result += ' ' + attribute; 1858 1859 // Boolean attributes should write attribute name, but without value. 1860 // Mere presence of attribute name is effective truthiness. 1861 if (isBooleanAttribute) { 1862 continue; 1863 } 1864 if (typeof value === 'string') { 1865 value = (0,external_wp_escapeHtml_namespaceObject.escapeAttribute)(value); 1866 } 1867 result += '="' + value + '"'; 1868 } 1869 return result; 1870 } 1871 1872 /** 1873 * Renders a style object as a string attribute value. 1874 * 1875 * @param {Object} style Style object. 1876 * 1877 * @return {string} Style attribute value. 1878 */ 1879 function renderStyle(style) { 1880 // Only generate from object, e.g. tolerate string value. 1881 if (!isPlainObject(style)) { 1882 return style; 1883 } 1884 let result; 1885 for (const property in style) { 1886 const value = style[property]; 1887 if (null === value || undefined === value) { 1888 continue; 1889 } 1890 if (result) { 1891 result += ';'; 1892 } else { 1893 result = ''; 1894 } 1895 const normalName = getNormalStylePropertyName(property); 1896 const normalValue = getNormalStylePropertyValue(property, value); 1897 result += normalName + ':' + normalValue; 1898 } 1899 return result; 1900 } 1901 /* harmony default export */ const serialize = (renderElement); 1902 1903 ;// ./node_modules/@wordpress/element/build-module/index.js 1904 1905 1906 1907 1908 1909 1910 1911 1912 (window.wp = window.wp || {}).element = __webpack_exports__; 1913 /******/ })() 1914 ;
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated : Sat Dec 21 08:20:01 2024 | Cross-referenced by PHPXref |