| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 (function() { 2 "use strict"; 3 var wp; 4 (wp ||= {}).element = (() => { 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 __commonJS = (cb, mod) => function __require() { 12 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 13 }; 14 var __export = (target, all) => { 15 for (var name in all) 16 __defProp(target, name, { get: all[name], enumerable: true }); 17 }; 18 var __copyProps = (to, from, except, desc) => { 19 if (from && typeof from === "object" || typeof from === "function") { 20 for (let key of __getOwnPropNames(from)) 21 if (!__hasOwnProp.call(to, key) && key !== except) 22 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 23 } 24 return to; 25 }; 26 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 27 // If the importer is in node compatibility mode or this is not an ESM 28 // file that has been converted to a CommonJS file using a Babel- 29 // compatible transform (i.e. "__esModule" has not been set), then set 30 // "default" to the CommonJS "module.exports" for node compatibility. 31 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 32 mod 33 )); 34 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); 35 36 // vendor-external:react 37 var require_react = __commonJS({ 38 "vendor-external:react"(exports, module) { 39 module.exports = window.React; 40 } 41 }); 42 43 // vendor-external:react-dom 44 var require_react_dom = __commonJS({ 45 "vendor-external:react-dom"(exports, module) { 46 module.exports = window.ReactDOM; 47 } 48 }); 49 50 // vendor-external:react-dom/client 51 var require_client = __commonJS({ 52 "vendor-external:react-dom/client"(exports, module) { 53 module.exports = window.ReactDOM; 54 } 55 }); 56 57 // package-external:@wordpress/escape-html 58 var require_escape_html = __commonJS({ 59 "package-external:@wordpress/escape-html"(exports, module) { 60 module.exports = window.wp.escapeHtml; 61 } 62 }); 63 64 // packages/element/build-module/index.mjs 65 var index_exports = {}; 66 __export(index_exports, { 67 Children: () => import_react.Children, 68 Component: () => import_react.Component, 69 Fragment: () => import_react.Fragment, 70 Platform: () => platform_default, 71 PureComponent: () => import_react.PureComponent, 72 RawHTML: () => RawHTML, 73 StrictMode: () => import_react.StrictMode, 74 Suspense: () => import_react.Suspense, 75 cloneElement: () => import_react.cloneElement, 76 concatChildren: () => concatChildren, 77 createContext: () => import_react.createContext, 78 createElement: () => import_react.createElement, 79 createInterpolateElement: () => create_interpolate_element_default, 80 createPortal: () => createPortal, 81 createRef: () => import_react.createRef, 82 createRoot: () => import_client.createRoot, 83 findDOMNode: () => findDOMNode, 84 flushSync: () => flushSync, 85 forwardRef: () => import_react.forwardRef, 86 hydrate: () => hydrate, 87 hydrateRoot: () => import_client.hydrateRoot, 88 isEmptyElement: () => isEmptyElement, 89 isValidElement: () => import_react.isValidElement, 90 lazy: () => import_react.lazy, 91 memo: () => import_react.memo, 92 render: () => render, 93 renderToString: () => serialize_default, 94 startTransition: () => import_react.startTransition, 95 switchChildrenNodeName: () => switchChildrenNodeName, 96 unmountComponentAtNode: () => unmountComponentAtNode, 97 useCallback: () => import_react.useCallback, 98 useContext: () => import_react.useContext, 99 useDebugValue: () => import_react.useDebugValue, 100 useDeferredValue: () => import_react.useDeferredValue, 101 useEffect: () => import_react.useEffect, 102 useId: () => import_react.useId, 103 useImperativeHandle: () => import_react.useImperativeHandle, 104 useInsertionEffect: () => import_react.useInsertionEffect, 105 useLayoutEffect: () => import_react.useLayoutEffect, 106 useMemo: () => import_react.useMemo, 107 useReducer: () => import_react.useReducer, 108 useRef: () => import_react.useRef, 109 useState: () => import_react.useState, 110 useSyncExternalStore: () => import_react.useSyncExternalStore, 111 useTransition: () => import_react.useTransition 112 }); 113 114 // packages/element/build-module/react.mjs 115 var import_react = __toESM(require_react(), 1); 116 function concatChildren(...childrenArguments) { 117 return childrenArguments.reduce( 118 (accumulator, children, i) => { 119 import_react.Children.forEach(children, (child, j) => { 120 if ((0, import_react.isValidElement)(child) && typeof child !== "string") { 121 child = (0, import_react.cloneElement)(child, { 122 key: [i, j].join() 123 }); 124 } 125 accumulator.push(child); 126 }); 127 return accumulator; 128 }, 129 [] 130 ); 131 } 132 function switchChildrenNodeName(children, nodeName) { 133 return children && import_react.Children.map(children, (elt, index) => { 134 if (typeof elt?.valueOf() === "string") { 135 return (0, import_react.createElement)(nodeName, { key: index }, elt); 136 } 137 if (!(0, import_react.isValidElement)(elt)) { 138 return elt; 139 } 140 const { children: childrenProp, ...props } = elt.props; 141 return (0, import_react.createElement)( 142 nodeName, 143 { key: index, ...props }, 144 childrenProp 145 ); 146 }); 147 } 148 149 // packages/element/build-module/create-interpolate-element.mjs 150 var indoc; 151 var offset; 152 var output; 153 var stack; 154 var tokenizer = /<(\/)?(\w+)\s*(\/)?>/g; 155 function createFrame(element, tokenStart, tokenLength, prevOffset, leadingTextStart) { 156 return { 157 element, 158 tokenStart, 159 tokenLength, 160 prevOffset, 161 leadingTextStart, 162 children: [] 163 }; 164 } 165 function createInterpolateElement(interpolatedString, conversionMap) { 166 indoc = interpolatedString; 167 offset = 0; 168 output = []; 169 stack = []; 170 tokenizer.lastIndex = 0; 171 if (!isValidConversionMap(conversionMap)) { 172 throw new TypeError( 173 "The conversionMap provided is not valid. It must be an object with values that are React Elements" 174 ); 175 } 176 do { 177 } while (proceed(conversionMap)); 178 return (0, import_react.createElement)(import_react.Fragment, null, ...output); 179 } 180 var isValidConversionMap = (conversionMap) => { 181 const isObject2 = typeof conversionMap === "object" && conversionMap !== null; 182 const values = isObject2 && Object.values(conversionMap); 183 return isObject2 && values.length > 0 && values.every((element) => (0, import_react.isValidElement)(element)); 184 }; 185 function proceed(conversionMap) { 186 const next = nextToken(); 187 const [tokenType, name, startOffset, tokenLength] = next; 188 const stackDepth = stack.length; 189 const leadingTextStart = startOffset > offset ? offset : null; 190 if (name && !conversionMap[name]) { 191 addText(); 192 return false; 193 } 194 switch (tokenType) { 195 case "no-more-tokens": 196 if (stackDepth !== 0) { 197 const { leadingTextStart: stackLeadingText, tokenStart } = stack.pop(); 198 output.push(indoc.substr(stackLeadingText, tokenStart)); 199 } 200 addText(); 201 return false; 202 case "self-closed": 203 if (0 === stackDepth) { 204 if (null !== leadingTextStart) { 205 output.push( 206 indoc.substr( 207 leadingTextStart, 208 startOffset - leadingTextStart 209 ) 210 ); 211 } 212 output.push(conversionMap[name]); 213 offset = startOffset + tokenLength; 214 return true; 215 } 216 addChild( 217 createFrame(conversionMap[name], startOffset, tokenLength) 218 ); 219 offset = startOffset + tokenLength; 220 return true; 221 case "opener": 222 stack.push( 223 createFrame( 224 conversionMap[name], 225 startOffset, 226 tokenLength, 227 startOffset + tokenLength, 228 leadingTextStart 229 ) 230 ); 231 offset = startOffset + tokenLength; 232 return true; 233 case "closer": 234 if (0 === stackDepth) { 235 if (true) { 236 console.warn( 237 `Unmatched closing tag '</$name}>' in createInterpolateElement. The rest of the string was not interpolated.` 238 ); 239 } 240 addText(); 241 return false; 242 } 243 if (1 === stackDepth) { 244 closeOuterElement(startOffset); 245 offset = startOffset + tokenLength; 246 return true; 247 } 248 const stackTop = stack.pop(); 249 const text = indoc.substr( 250 stackTop.prevOffset, 251 startOffset - stackTop.prevOffset 252 ); 253 stackTop.children.push(text); 254 stackTop.prevOffset = startOffset + tokenLength; 255 const frame = createFrame( 256 stackTop.element, 257 stackTop.tokenStart, 258 stackTop.tokenLength, 259 startOffset + tokenLength 260 ); 261 frame.children = stackTop.children; 262 addChild(frame); 263 offset = startOffset + tokenLength; 264 return true; 265 default: 266 addText(); 267 return false; 268 } 269 } 270 function nextToken() { 271 const matches = tokenizer.exec(indoc); 272 if (null === matches) { 273 return ["no-more-tokens"]; 274 } 275 const startedAt = matches.index; 276 const [match, isClosing, name, isSelfClosed] = matches; 277 const length = match.length; 278 if (isSelfClosed) { 279 return ["self-closed", name, startedAt, length]; 280 } 281 if (isClosing) { 282 return ["closer", name, startedAt, length]; 283 } 284 return ["opener", name, startedAt, length]; 285 } 286 function addText() { 287 const length = indoc.length - offset; 288 if (0 === length) { 289 return; 290 } 291 output.push(indoc.substr(offset, length)); 292 } 293 function addChild(frame) { 294 const { element, tokenStart, tokenLength, prevOffset, children } = frame; 295 const parent = stack[stack.length - 1]; 296 const text = indoc.substr( 297 parent.prevOffset, 298 tokenStart - parent.prevOffset 299 ); 300 if (text) { 301 parent.children.push(text); 302 } 303 parent.children.push((0, import_react.cloneElement)(element, null, ...children)); 304 parent.prevOffset = prevOffset ? prevOffset : tokenStart + tokenLength; 305 } 306 function closeOuterElement(endOffset) { 307 const { element, leadingTextStart, prevOffset, tokenStart, children } = stack.pop(); 308 const text = endOffset ? indoc.substr(prevOffset, endOffset - prevOffset) : indoc.substr(prevOffset); 309 if (text) { 310 children.push(text); 311 } 312 if (null !== leadingTextStart) { 313 output.push( 314 indoc.substr(leadingTextStart, tokenStart - leadingTextStart) 315 ); 316 } 317 output.push((0, import_react.cloneElement)(element, null, ...children)); 318 } 319 var create_interpolate_element_default = createInterpolateElement; 320 321 // packages/element/build-module/react-platform.mjs 322 var ReactDOM = __toESM(require_react_dom(), 1); 323 var import_client = __toESM(require_client(), 1); 324 var { 325 createPortal, 326 flushSync, 327 /* eslint-disable react/no-deprecated */ 328 // @ts-expect-error Removed from @types/react-dom; still present at runtime. 329 findDOMNode, 330 // @ts-expect-error Removed from @types/react-dom; still present at runtime. 331 render, 332 // @ts-expect-error Removed from @types/react-dom; still present at runtime. 333 hydrate, 334 // @ts-expect-error Removed from @types/react-dom; still present at runtime. 335 unmountComponentAtNode 336 /* eslint-enable react/no-deprecated */ 337 } = ReactDOM; 338 339 // packages/element/build-module/utils.mjs 340 var isEmptyElement = (element) => { 341 if (typeof element === "number") { 342 return false; 343 } 344 if (typeof element?.valueOf() === "string" || Array.isArray(element)) { 345 return !element.length; 346 } 347 return !element; 348 }; 349 350 // packages/element/build-module/platform.mjs 351 var Platform = { 352 /** Platform identifier. Will always be `'web'` in this module. */ 353 OS: "web", 354 /** 355 * Select a value based on the platform. 356 * 357 * @template T 358 * @param spec - Object with optional platform-specific values. 359 * @return The selected value. 360 */ 361 select(spec) { 362 return "web" in spec ? spec.web : spec.default; 363 }, 364 /** Whether the platform is web */ 365 isWeb: true 366 }; 367 var platform_default = Platform; 368 369 // node_modules/.store/is-plain-object@5.1.0-5G_-lUnpSwJHYfRbkIxLrw/node_modules/is-plain-object/dist/is-plain-object.mjs 370 function isObject(o) { 371 return Object.prototype.toString.call(o) === "[object Object]"; 372 } 373 function isPlainObject(o) { 374 var ctor, prot; 375 if (isObject(o) === false) return false; 376 ctor = o.constructor; 377 if (ctor === void 0) return true; 378 prot = ctor.prototype; 379 if (isObject(prot) === false) return false; 380 if (prot.hasOwnProperty("isPrototypeOf") === false) { 381 return false; 382 } 383 return true; 384 } 385 386 // node_modules/.store/tslib@2.8.1-LT-dxu1EkVy7OUDyVf5glQ/node_modules/tslib/tslib.es6.mjs 387 var __assign = function() { 388 __assign = Object.assign || function __assign2(t) { 389 for (var s, i = 1, n = arguments.length; i < n; i++) { 390 s = arguments[i]; 391 for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; 392 } 393 return t; 394 }; 395 return __assign.apply(this, arguments); 396 }; 397 398 // node_modules/.store/lower-case@2.0.2-5YZP5nczP5_f_8Vt5KBPjA/node_modules/lower-case/dist.es2015/index.js 399 function lowerCase(str) { 400 return str.toLowerCase(); 401 } 402 403 // node_modules/.store/no-case@3.0.4-R4Hzt6qn-erEsTak7ojDpg/node_modules/no-case/dist.es2015/index.js 404 var DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g]; 405 var DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi; 406 function noCase(input, options) { 407 if (options === void 0) { 408 options = {}; 409 } 410 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; 411 var result = replace(replace(input, splitRegexp, "$1\0$2"), stripRegexp, "\0"); 412 var start = 0; 413 var end = result.length; 414 while (result.charAt(start) === "\0") 415 start++; 416 while (result.charAt(end - 1) === "\0") 417 end--; 418 return result.slice(start, end).split("\0").map(transform).join(delimiter); 419 } 420 function replace(input, re, value) { 421 if (re instanceof RegExp) 422 return input.replace(re, value); 423 return re.reduce(function(input2, re2) { 424 return input2.replace(re2, value); 425 }, input); 426 } 427 428 // node_modules/.store/dot-case@3.0.4-hi-rLWlWmiZ169n4dWcbUA/node_modules/dot-case/dist.es2015/index.js 429 function dotCase(input, options) { 430 if (options === void 0) { 431 options = {}; 432 } 433 return noCase(input, __assign({ delimiter: "." }, options)); 434 } 435 436 // node_modules/.store/param-case@3.0.4-rdAht_VwpGpefPRylN2bTA/node_modules/param-case/dist.es2015/index.js 437 function paramCase(input, options) { 438 if (options === void 0) { 439 options = {}; 440 } 441 return dotCase(input, __assign({ delimiter: "-" }, options)); 442 } 443 444 // packages/element/build-module/serialize.mjs 445 var import_escape_html = __toESM(require_escape_html(), 1); 446 447 // packages/element/build-module/raw-html.mjs 448 function RawHTML({ children, ...props }) { 449 let rawHtml = ""; 450 import_react.Children.toArray(children).forEach((child) => { 451 if (typeof child === "string" && child.trim() !== "") { 452 rawHtml += child; 453 } 454 }); 455 return (0, import_react.createElement)("div", { 456 dangerouslySetInnerHTML: { __html: rawHtml }, 457 ...props 458 }); 459 } 460 461 // packages/element/build-module/serialize.mjs 462 var Context = (0, import_react.createContext)(void 0); 463 Context.displayName = "ElementContext"; 464 var { Provider, Consumer } = Context; 465 var ForwardRef = (0, import_react.forwardRef)(() => { 466 return null; 467 }); 468 var Memo = (0, import_react.memo)(() => { 469 return null; 470 }); 471 var ATTRIBUTES_TYPES = /* @__PURE__ */ new Set(["string", "boolean", "number"]); 472 var SELF_CLOSING_TAGS = /* @__PURE__ */ new Set([ 473 "area", 474 "base", 475 "br", 476 "col", 477 "command", 478 "embed", 479 "hr", 480 "img", 481 "input", 482 "keygen", 483 "link", 484 "meta", 485 "param", 486 "source", 487 "track", 488 "wbr" 489 ]); 490 var BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([ 491 "allowfullscreen", 492 "allowpaymentrequest", 493 "allowusermedia", 494 "async", 495 "autofocus", 496 "autoplay", 497 "checked", 498 "controls", 499 "default", 500 "defer", 501 "disabled", 502 "download", 503 "formnovalidate", 504 "hidden", 505 "ismap", 506 "itemscope", 507 "loop", 508 "multiple", 509 "muted", 510 "nomodule", 511 "novalidate", 512 "open", 513 "playsinline", 514 "readonly", 515 "required", 516 "reversed", 517 "selected", 518 "typemustmatch" 519 ]); 520 var ENUMERATED_ATTRIBUTES = /* @__PURE__ */ new Set([ 521 "autocapitalize", 522 "autocomplete", 523 "charset", 524 "contenteditable", 525 "crossorigin", 526 "decoding", 527 "dir", 528 "draggable", 529 "enctype", 530 "formenctype", 531 "formmethod", 532 "http-equiv", 533 "inputmode", 534 "kind", 535 "method", 536 "preload", 537 "scope", 538 "shape", 539 "spellcheck", 540 "translate", 541 "type", 542 "wrap" 543 ]); 544 var CSS_PROPERTIES_SUPPORTS_UNITLESS = /* @__PURE__ */ new Set([ 545 "animation", 546 "animationIterationCount", 547 "baselineShift", 548 "borderImageOutset", 549 "borderImageSlice", 550 "borderImageWidth", 551 "columnCount", 552 "cx", 553 "cy", 554 "fillOpacity", 555 "flexGrow", 556 "flexShrink", 557 "floodOpacity", 558 "fontWeight", 559 "gridColumnEnd", 560 "gridColumnStart", 561 "gridRowEnd", 562 "gridRowStart", 563 "lineHeight", 564 "opacity", 565 "order", 566 "orphans", 567 "r", 568 "rx", 569 "ry", 570 "shapeImageThreshold", 571 "stopOpacity", 572 "strokeDasharray", 573 "strokeDashoffset", 574 "strokeMiterlimit", 575 "strokeOpacity", 576 "strokeWidth", 577 "tabSize", 578 "widows", 579 "x", 580 "y", 581 "zIndex", 582 "zoom" 583 ]); 584 function hasPrefix(string, prefixes) { 585 return prefixes.some((prefix) => string.indexOf(prefix) === 0); 586 } 587 function isInternalAttribute(attribute) { 588 return "key" === attribute || "children" === attribute; 589 } 590 function getNormalAttributeValue(attribute, value) { 591 switch (attribute) { 592 case "style": 593 return renderStyle(value); 594 } 595 return value; 596 } 597 var SVG_ATTRIBUTE_WITH_DASHES_LIST = [ 598 "accentHeight", 599 "alignmentBaseline", 600 "arabicForm", 601 "baselineShift", 602 "capHeight", 603 "clipPath", 604 "clipRule", 605 "colorInterpolation", 606 "colorInterpolationFilters", 607 "colorProfile", 608 "colorRendering", 609 "dominantBaseline", 610 "enableBackground", 611 "fillOpacity", 612 "fillRule", 613 "floodColor", 614 "floodOpacity", 615 "fontFamily", 616 "fontSize", 617 "fontSizeAdjust", 618 "fontStretch", 619 "fontStyle", 620 "fontVariant", 621 "fontWeight", 622 "glyphName", 623 "glyphOrientationHorizontal", 624 "glyphOrientationVertical", 625 "horizAdvX", 626 "horizOriginX", 627 "imageRendering", 628 "letterSpacing", 629 "lightingColor", 630 "markerEnd", 631 "markerMid", 632 "markerStart", 633 "overlinePosition", 634 "overlineThickness", 635 "paintOrder", 636 "panose1", 637 "pointerEvents", 638 "renderingIntent", 639 "shapeRendering", 640 "stopColor", 641 "stopOpacity", 642 "strikethroughPosition", 643 "strikethroughThickness", 644 "strokeDasharray", 645 "strokeDashoffset", 646 "strokeLinecap", 647 "strokeLinejoin", 648 "strokeMiterlimit", 649 "strokeOpacity", 650 "strokeWidth", 651 "textAnchor", 652 "textDecoration", 653 "textRendering", 654 "underlinePosition", 655 "underlineThickness", 656 "unicodeBidi", 657 "unicodeRange", 658 "unitsPerEm", 659 "vAlphabetic", 660 "vHanging", 661 "vIdeographic", 662 "vMathematical", 663 "vectorEffect", 664 "vertAdvY", 665 "vertOriginX", 666 "vertOriginY", 667 "wordSpacing", 668 "writingMode", 669 "xmlnsXlink", 670 "xHeight" 671 ].reduce( 672 (map, attribute) => { 673 map[attribute.toLowerCase()] = attribute; 674 return map; 675 }, 676 {} 677 ); 678 var CASE_SENSITIVE_SVG_ATTRIBUTES = [ 679 "allowReorder", 680 "attributeName", 681 "attributeType", 682 "autoReverse", 683 "baseFrequency", 684 "baseProfile", 685 "calcMode", 686 "clipPathUnits", 687 "contentScriptType", 688 "contentStyleType", 689 "diffuseConstant", 690 "edgeMode", 691 "externalResourcesRequired", 692 "filterRes", 693 "filterUnits", 694 "glyphRef", 695 "gradientTransform", 696 "gradientUnits", 697 "kernelMatrix", 698 "kernelUnitLength", 699 "keyPoints", 700 "keySplines", 701 "keyTimes", 702 "lengthAdjust", 703 "limitingConeAngle", 704 "markerHeight", 705 "markerUnits", 706 "markerWidth", 707 "maskContentUnits", 708 "maskUnits", 709 "numOctaves", 710 "pathLength", 711 "patternContentUnits", 712 "patternTransform", 713 "patternUnits", 714 "pointsAtX", 715 "pointsAtY", 716 "pointsAtZ", 717 "preserveAlpha", 718 "preserveAspectRatio", 719 "primitiveUnits", 720 "refX", 721 "refY", 722 "repeatCount", 723 "repeatDur", 724 "requiredExtensions", 725 "requiredFeatures", 726 "specularConstant", 727 "specularExponent", 728 "spreadMethod", 729 "startOffset", 730 "stdDeviation", 731 "stitchTiles", 732 "suppressContentEditableWarning", 733 "suppressHydrationWarning", 734 "surfaceScale", 735 "systemLanguage", 736 "tableValues", 737 "targetX", 738 "targetY", 739 "textLength", 740 "viewBox", 741 "viewTarget", 742 "xChannelSelector", 743 "yChannelSelector" 744 ].reduce( 745 (map, attribute) => { 746 map[attribute.toLowerCase()] = attribute; 747 return map; 748 }, 749 {} 750 ); 751 var SVG_ATTRIBUTES_WITH_COLONS = [ 752 "xlink:actuate", 753 "xlink:arcrole", 754 "xlink:href", 755 "xlink:role", 756 "xlink:show", 757 "xlink:title", 758 "xlink:type", 759 "xml:base", 760 "xml:lang", 761 "xml:space", 762 "xmlns:xlink" 763 ].reduce( 764 (map, attribute) => { 765 map[attribute.replace(":", "").toLowerCase()] = attribute; 766 return map; 767 }, 768 {} 769 ); 770 function getNormalAttributeName(attribute) { 771 switch (attribute) { 772 case "htmlFor": 773 return "for"; 774 case "className": 775 return "class"; 776 } 777 const attributeLowerCase = attribute.toLowerCase(); 778 if (CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]) { 779 return CASE_SENSITIVE_SVG_ATTRIBUTES[attributeLowerCase]; 780 } else if (SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase]) { 781 return paramCase( 782 SVG_ATTRIBUTE_WITH_DASHES_LIST[attributeLowerCase] 783 ); 784 } else if (SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]) { 785 return SVG_ATTRIBUTES_WITH_COLONS[attributeLowerCase]; 786 } 787 return attributeLowerCase; 788 } 789 function getNormalStylePropertyName(property) { 790 if (property.startsWith("--")) { 791 return property; 792 } 793 if (hasPrefix(property, ["ms", "O", "Moz", "Webkit"])) { 794 return "-" + paramCase(property); 795 } 796 return paramCase(property); 797 } 798 function getNormalStylePropertyValue(property, value) { 799 if (typeof value === "number" && 0 !== value && !hasPrefix(property, ["--"]) && !CSS_PROPERTIES_SUPPORTS_UNITLESS.has(property)) { 800 return value + "px"; 801 } 802 return value; 803 } 804 function renderElement(element, context, legacyContext = {}) { 805 if (null === element || void 0 === element || false === element) { 806 return ""; 807 } 808 if (Array.isArray(element)) { 809 return renderChildren(element, context, legacyContext); 810 } 811 switch (typeof element) { 812 case "string": 813 return (0, import_escape_html.escapeHTML)(element); 814 case "number": 815 return element.toString(); 816 } 817 const { type, props } = element; 818 switch (type) { 819 case import_react.StrictMode: 820 case import_react.Fragment: 821 return renderChildren(props.children, context, legacyContext); 822 case RawHTML: 823 const { children, ...wrapperProps } = props; 824 return renderNativeComponent( 825 !Object.keys(wrapperProps).length ? null : "div", 826 { 827 ...wrapperProps, 828 dangerouslySetInnerHTML: { __html: children } 829 }, 830 context, 831 legacyContext 832 ); 833 } 834 switch (typeof type) { 835 case "string": 836 return renderNativeComponent(type, props, context, legacyContext); 837 case "function": 838 if (type.prototype && typeof type.prototype.render === "function") { 839 return renderComponent(type, props, context, legacyContext); 840 } 841 return renderElement( 842 type(props, legacyContext), 843 context, 844 legacyContext 845 ); 846 } 847 switch (type && type.$$typeof) { 848 case Provider.$$typeof: 849 return renderChildren(props.children, props.value, legacyContext); 850 case Consumer.$$typeof: 851 const contextValue = context !== void 0 ? context : (type._context || type)._currentValue; 852 return renderElement( 853 props.children(contextValue), 854 context, 855 legacyContext 856 ); 857 case ForwardRef.$$typeof: 858 return renderElement( 859 type.render(props), 860 context, 861 legacyContext 862 ); 863 case Memo.$$typeof: 864 return renderElement( 865 (0, import_react.createElement)(type.type, props), 866 context, 867 legacyContext 868 ); 869 } 870 return ""; 871 } 872 function renderNativeComponent(type, props, context, legacyContext = {}) { 873 let content = ""; 874 if (type === "textarea" && props.hasOwnProperty("value")) { 875 content = renderChildren(props.value, context, legacyContext); 876 const { value, ...restProps } = props; 877 props = restProps; 878 } else if (props.dangerouslySetInnerHTML && typeof props.dangerouslySetInnerHTML.__html === "string") { 879 content = props.dangerouslySetInnerHTML.__html; 880 } else if (typeof props.children !== "undefined") { 881 content = renderChildren(props.children, context, legacyContext); 882 } 883 if (!type) { 884 return content; 885 } 886 const attributes = renderAttributes(props); 887 if (SELF_CLOSING_TAGS.has(type)) { 888 return "<" + type + attributes + "/>"; 889 } 890 return "<" + type + attributes + ">" + content + "</" + type + ">"; 891 } 892 function renderComponent(Component2, props, context, legacyContext = {}) { 893 const instance = new Component2(props, legacyContext); 894 if (typeof instance.getChildContext === "function") { 895 Object.assign(legacyContext, instance.getChildContext()); 896 } 897 const html = renderElement(instance.render(), context, legacyContext); 898 return html; 899 } 900 function renderChildren(children, context, legacyContext = {}) { 901 let result = ""; 902 const childrenArray = Array.isArray(children) ? children : [children]; 903 for (let i = 0; i < childrenArray.length; i++) { 904 const child = childrenArray[i]; 905 result += renderElement(child, context, legacyContext); 906 } 907 return result; 908 } 909 function renderAttributes(props) { 910 let result = ""; 911 for (const key in props) { 912 const attribute = getNormalAttributeName(key); 913 if (!(0, import_escape_html.isValidAttributeName)(attribute)) { 914 continue; 915 } 916 let value = getNormalAttributeValue(key, props[key]); 917 if (!ATTRIBUTES_TYPES.has(typeof value)) { 918 continue; 919 } 920 if (isInternalAttribute(key)) { 921 continue; 922 } 923 const isBooleanAttribute = BOOLEAN_ATTRIBUTES.has(attribute); 924 if (isBooleanAttribute && value === false) { 925 continue; 926 } 927 const isMeaningfulAttribute = isBooleanAttribute || hasPrefix(key, ["data-", "aria-"]) || ENUMERATED_ATTRIBUTES.has(attribute); 928 if (typeof value === "boolean" && !isMeaningfulAttribute) { 929 continue; 930 } 931 result += " " + attribute; 932 if (isBooleanAttribute) { 933 continue; 934 } 935 if (typeof value === "string") { 936 value = (0, import_escape_html.escapeAttribute)(value); 937 } 938 result += '="' + value + '"'; 939 } 940 return result; 941 } 942 function renderStyle(style) { 943 if (!isPlainObject(style)) { 944 return style; 945 } 946 let result; 947 const styleObj = style; 948 for (const property in styleObj) { 949 const value = styleObj[property]; 950 if (null === value || void 0 === value) { 951 continue; 952 } 953 if (result) { 954 result += ";"; 955 } else { 956 result = ""; 957 } 958 const normalName = getNormalStylePropertyName(property); 959 const normalValue = getNormalStylePropertyValue(property, value); 960 result += normalName + ":" + normalValue; 961 } 962 return result; 963 } 964 var serialize_default = renderElement; 965 return __toCommonJS(index_exports); 966 })(); 967 /*! Bundled license information: 968 969 is-plain-object/dist/is-plain-object.mjs: 970 (*! 971 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 972 * 973 * Copyright (c) 2014-2017, Jon Schlinkert. 974 * Released under the MIT License. 975 *) 976 */ 977 (window.wp ||= {}).element = wp.element; 978 })();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Sat Oct 24 08:20:34 2026 | Cross-referenced by PHPXref |