PluginProbe
Gutenberg / 24.1.0
Gutenberg v24.1.0
24.1.0 24.0.0 23.9.1 23.9.0 23.8.0 23.7.2 23.7.1 23.7.0 23.6.1 23.6.2 23.6.0 23.5.3 23.5.2 23.5.1 23.5.0 23.4.0 23.3.2 23.3.1 23.3.0 23.2.0 23.2.1 23.2.2 23.1.1 23.1.0 23.0.1 All 404 releases
gutenberg / build / widgets / hello-dolly / render.js

render.js in Gutenberg 24.1.0, at build/widgets/hello-dolly/render.js

1,017 lines 39.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 var __create = Object.create;
2 var __defProp = Object.defineProperty;
3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4 var __getOwnPropNames = Object.getOwnPropertyNames;
5 var __getProtoOf = Object.getPrototypeOf;
6 var __hasOwnProp = Object.prototype.hasOwnProperty;
7 var __commonJS = (cb, mod) => function __require() {
8 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
9 };
10 var __copyProps = (to, from, except, desc) => {
11 if (from && typeof from === "object" || typeof from === "function") {
12 for (let key of __getOwnPropNames(from))
13 if (!__hasOwnProp.call(to, key) && key !== except)
14 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15 }
16 return to;
17 };
18 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
19 // If the importer is in node compatibility mode or this is not an ESM
20 // file that has been converted to a CommonJS file using a Babel-
21 // compatible transform (i.e. "__esModule" has not been set), then set
22 // "default" to the CommonJS "module.exports" for node compatibility.
23 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
24 mod
25 ));
26
27 // package-external:@wordpress/element
28 var require_element = __commonJS({
29 "package-external:@wordpress/element"(exports, module) {
30 module.exports = window.wp.element;
31 }
32 });
33
34 // package-external:@wordpress/i18n
35 var require_i18n = __commonJS({
36 "package-external:@wordpress/i18n"(exports, module) {
37 module.exports = window.wp.i18n;
38 }
39 });
40
41 // vendor-external:react
42 var require_react = __commonJS({
43 "vendor-external:react"(exports, module) {
44 module.exports = window.React;
45 }
46 });
47
48 // vendor-external:react/jsx-runtime
49 var require_jsx_runtime = __commonJS({
50 "vendor-external:react/jsx-runtime"(exports, module) {
51 module.exports = window.ReactJSXRuntime;
52 }
53 });
54
55 // widgets/hello-dolly/render.tsx
56 var import_element4 = __toESM(require_element());
57 var import_i18n = __toESM(require_i18n());
58
59 // node_modules/clsx/dist/clsx.mjs
60 function r(e) {
61 var t, f, n = "";
62 if ("string" == typeof e || "number" == typeof e) n += e;
63 else if ("object" == typeof e) if (Array.isArray(e)) {
64 var o = e.length;
65 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f);
66 } else for (f in e) e[f] && (n && (n += " "), n += f);
67 return n;
68 }
69 function clsx() {
70 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t);
71 return n;
72 }
73 var clsx_default = clsx;
74
75 // node_modules/@base-ui/utils/createLogOnce.mjs
76 var loggedMessages;
77 if (true) {
78 loggedMessages = /* @__PURE__ */ new Set();
79 }
80 function createLogOnce(severity, prefix) {
81 return function logOnce(...messages) {
82 if (true) {
83 const message = messages.join(" ");
84 const output = prefix ? `${prefix}: ${message}` : message;
85 const key = `${severity}:${output}`;
86 if (!loggedMessages.has(key)) {
87 loggedMessages.add(key);
88 if (severity === "warn") {
89 console.warn(output);
90 } else {
91 console.error(output);
92 }
93 }
94 }
95 };
96 }
97
98 // node_modules/@base-ui/utils/useRefWithInit.mjs
99 var React = __toESM(require_react(), 1);
100 var UNINITIALIZED = {};
101 function useRefWithInit(init, initArg) {
102 const ref = React.useRef(UNINITIALIZED);
103 if (ref.current === UNINITIALIZED) {
104 ref.current = init(initArg);
105 }
106 return ref;
107 }
108
109 // node_modules/@base-ui/utils/warn.mjs
110 var warn = createLogOnce("warn", "Base UI");
111
112 // node_modules/@base-ui/utils/empty.mjs
113 var EMPTY_ARRAY = Object.freeze([]);
114 var EMPTY_OBJECT = Object.freeze({});
115
116 // node_modules/@base-ui/react/internals/useRenderElement.mjs
117 var React4 = __toESM(require_react(), 1);
118
119 // node_modules/@base-ui/utils/useMergedRefs.mjs
120 function useMergedRefs(a, b, c, d) {
121 const forkRef = useRefWithInit(createForkRef).current;
122 if (didChange(forkRef, a, b, c, d)) {
123 update(forkRef, [a, b, c, d]);
124 }
125 return forkRef.callback;
126 }
127 function useMergedRefsN(refs) {
128 const forkRef = useRefWithInit(createForkRef).current;
129 if (didChangeN(forkRef, refs)) {
130 update(forkRef, refs);
131 }
132 return forkRef.callback;
133 }
134 function createForkRef() {
135 return {
136 callback: null,
137 cleanup: null,
138 refs: []
139 };
140 }
141 function didChange(forkRef, a, b, c, d) {
142 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
143 }
144 function didChangeN(forkRef, newRefs) {
145 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
146 }
147 function update(forkRef, refs) {
148 forkRef.refs = refs;
149 if (refs.every((ref) => ref == null)) {
150 forkRef.callback = null;
151 return;
152 }
153 forkRef.callback = (instance) => {
154 if (forkRef.cleanup) {
155 forkRef.cleanup();
156 forkRef.cleanup = null;
157 }
158 if (instance != null) {
159 const cleanupCallbacks = Array(refs.length).fill(null);
160 for (let i = 0; i < refs.length; i += 1) {
161 const ref = refs[i];
162 if (ref == null) {
163 continue;
164 }
165 switch (typeof ref) {
166 case "function": {
167 const refCleanup = ref(instance);
168 if (typeof refCleanup === "function") {
169 cleanupCallbacks[i] = refCleanup;
170 }
171 break;
172 }
173 case "object": {
174 ref.current = instance;
175 break;
176 }
177 default:
178 }
179 }
180 forkRef.cleanup = () => {
181 for (let i = 0; i < refs.length; i += 1) {
182 const ref = refs[i];
183 if (ref == null) {
184 continue;
185 }
186 switch (typeof ref) {
187 case "function": {
188 const cleanupCallback = cleanupCallbacks[i];
189 if (typeof cleanupCallback === "function") {
190 cleanupCallback();
191 } else {
192 void ref(null);
193 }
194 break;
195 }
196 case "object": {
197 ref.current = null;
198 break;
199 }
200 default:
201 }
202 }
203 };
204 }
205 };
206 }
207
208 // node_modules/@base-ui/utils/getReactElementRef.mjs
209 var React3 = __toESM(require_react(), 1);
210
211 // node_modules/@base-ui/utils/reactVersion.mjs
212 var React2 = __toESM(require_react(), 1);
213 var majorVersion = parseInt(React2.version, 10);
214 function isReactVersionAtLeast(reactVersionToCheck) {
215 return majorVersion >= reactVersionToCheck;
216 }
217
218 // node_modules/@base-ui/utils/getReactElementRef.mjs
219 function getReactElementRef(element) {
220 if (!/* @__PURE__ */ React3.isValidElement(element)) {
221 return null;
222 }
223 const reactElement = element;
224 const propsWithRef = reactElement.props;
225 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
226 }
227
228 // node_modules/@base-ui/utils/mergeObjects.mjs
229 function mergeObjects(a, b) {
230 if (a && !b) {
231 return a;
232 }
233 if (!a && b) {
234 return b;
235 }
236 if (a || b) {
237 return {
238 ...a,
239 ...b
240 };
241 }
242 return void 0;
243 }
244
245 // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
246 function getStateAttributesProps(state, customMapping) {
247 const props = {};
248 for (const key in state) {
249 const value = state[key];
250 if (customMapping?.hasOwnProperty(key)) {
251 const customProps = customMapping[key](value);
252 if (customProps != null) {
253 Object.assign(props, customProps);
254 }
255 continue;
256 }
257 if (value === true) {
258 props[`data-${key.toLowerCase()}`] = "";
259 } else if (value) {
260 props[`data-${key.toLowerCase()}`] = value.toString();
261 }
262 }
263 return props;
264 }
265
266 // node_modules/@base-ui/react/utils/resolveClassName.mjs
267 function resolveClassName(className, state) {
268 return typeof className === "function" ? className(state) : className;
269 }
270
271 // node_modules/@base-ui/react/utils/resolveStyle.mjs
272 function resolveStyle(style, state) {
273 return typeof style === "function" ? style(state) : style;
274 }
275
276 // node_modules/@base-ui/react/merge-props/mergeProps.mjs
277 var EMPTY_PROPS = {};
278 function mergeProps(a, b, c, d, e) {
279 if (!c && !d && !e && !a) {
280 return createInitialMergedProps(b);
281 }
282 let merged = createInitialMergedProps(a);
283 if (b) {
284 merged = mergeInto(merged, b);
285 }
286 if (c) {
287 merged = mergeInto(merged, c);
288 }
289 if (d) {
290 merged = mergeInto(merged, d);
291 }
292 if (e) {
293 merged = mergeInto(merged, e);
294 }
295 return merged;
296 }
297 function mergePropsN(props) {
298 if (props.length === 0) {
299 return EMPTY_PROPS;
300 }
301 if (props.length === 1) {
302 return createInitialMergedProps(props[0]);
303 }
304 let merged = createInitialMergedProps(props[0]);
305 for (let i = 1; i < props.length; i += 1) {
306 merged = mergeInto(merged, props[i]);
307 }
308 return merged;
309 }
310 function createInitialMergedProps(inputProps) {
311 if (isPropsGetter(inputProps)) {
312 return {
313 ...resolvePropsGetter(inputProps, EMPTY_PROPS)
314 };
315 }
316 return copyInitialProps(inputProps);
317 }
318 function mergeInto(merged, inputProps) {
319 if (isPropsGetter(inputProps)) {
320 return resolvePropsGetter(inputProps, merged);
321 }
322 return mutablyMergeInto(merged, inputProps);
323 }
324 function copyInitialProps(inputProps) {
325 const copiedProps = {
326 ...inputProps
327 };
328 for (const propName in copiedProps) {
329 const propValue = copiedProps[propName];
330 if (isEventHandler(propName, propValue)) {
331 copiedProps[propName] = wrapEventHandler(propValue);
332 }
333 }
334 return copiedProps;
335 }
336 function mutablyMergeInto(mergedProps, externalProps) {
337 if (!externalProps) {
338 return mergedProps;
339 }
340 for (const propName in externalProps) {
341 const externalPropValue = externalProps[propName];
342 switch (propName) {
343 case "style": {
344 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue);
345 break;
346 }
347 case "className": {
348 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue);
349 break;
350 }
351 default: {
352 if (isEventHandler(propName, externalPropValue)) {
353 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue);
354 } else {
355 mergedProps[propName] = externalPropValue;
356 }
357 }
358 }
359 }
360 return mergedProps;
361 }
362 function isEventHandler(key, value) {
363 const code0 = key.charCodeAt(0);
364 const code1 = key.charCodeAt(1);
365 const code2 = key.charCodeAt(2);
366 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined");
367 }
368 function isPropsGetter(inputProps) {
369 return typeof inputProps === "function";
370 }
371 function resolvePropsGetter(inputProps, previousProps) {
372 if (isPropsGetter(inputProps)) {
373 return inputProps(previousProps);
374 }
375 return inputProps ?? EMPTY_PROPS;
376 }
377 function mergeEventHandlers(ourHandler, theirHandler) {
378 if (!theirHandler) {
379 return ourHandler;
380 }
381 if (!ourHandler) {
382 return wrapEventHandler(theirHandler);
383 }
384 return (...args) => {
385 const event = args[0];
386 if (isSyntheticEvent(event)) {
387 const baseUIEvent = event;
388 makeEventPreventable(baseUIEvent);
389 const result2 = theirHandler(...args);
390 if (!baseUIEvent.baseUIHandlerPrevented) {
391 ourHandler?.(...args);
392 }
393 return result2;
394 }
395 const result = theirHandler(...args);
396 ourHandler?.(...args);
397 return result;
398 };
399 }
400 function wrapEventHandler(handler) {
401 if (!handler) {
402 return handler;
403 }
404 return (...args) => {
405 const event = args[0];
406 if (isSyntheticEvent(event)) {
407 makeEventPreventable(event);
408 }
409 return handler(...args);
410 };
411 }
412 function makeEventPreventable(event) {
413 event.preventBaseUIHandler = () => {
414 event.baseUIHandlerPrevented = true;
415 };
416 return event;
417 }
418 function mergeClassNames(ourClassName, theirClassName) {
419 if (theirClassName) {
420 if (ourClassName) {
421 return theirClassName + " " + ourClassName;
422 }
423 return theirClassName;
424 }
425 return ourClassName;
426 }
427 function isSyntheticEvent(event) {
428 return event != null && typeof event === "object" && "nativeEvent" in event;
429 }
430
431 // node_modules/@base-ui/react/internals/useRenderElement.mjs
432 var import_react = __toESM(require_react(), 1);
433 function useRenderElement(element, componentProps, params = {}) {
434 let renderProp = componentProps.render;
435 if (params.enabled !== false) {
436 renderProp = unwrapLazyRenderProp(renderProp);
437 }
438 const outProps = useRenderElementProps(componentProps, params, renderProp);
439 if (params.enabled === false) {
440 return null;
441 }
442 const state = params.state ?? EMPTY_OBJECT;
443 return evaluateRenderProp(element, renderProp, outProps, state);
444 }
445 function useRenderElementProps(componentProps, params, renderProp) {
446 const {
447 className: classNameProp,
448 style: styleProp
449 } = componentProps;
450 const {
451 state = EMPTY_OBJECT,
452 ref,
453 props,
454 stateAttributesMapping,
455 enabled = true
456 } = params;
457 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
458 const style = enabled ? resolveStyle(styleProp, state) : void 0;
459 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT;
460 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
461 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
462 if (typeof document !== "undefined") {
463 if (!enabled) {
464 void useMergedRefs(null, null);
465 } else if (Array.isArray(ref)) {
466 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
467 } else {
468 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
469 }
470 }
471 if (!enabled) {
472 return EMPTY_OBJECT;
473 }
474 if (className !== void 0) {
475 outProps.className = mergeClassNames(outProps.className, className);
476 }
477 if (style !== void 0) {
478 outProps.style = mergeObjects(outProps.style, style);
479 }
480 return outProps;
481 }
482 function resolveRenderFunctionProps(props) {
483 if (Array.isArray(props)) {
484 return mergePropsN(props);
485 }
486 return mergeProps(void 0, props);
487 }
488 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
489 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
490 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
491 function unwrapLazyRenderProp(render) {
492 if (render?.$$typeof !== REACT_LAZY_TYPE) {
493 return render;
494 }
495 const unwrapped = React4.Children.toArray(render)[0];
496 return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render;
497 }
498 function evaluateRenderProp(element, render, props, state) {
499 if (render) {
500 if (typeof render === "function") {
501 if (true) {
502 warnIfRenderPropLooksLikeComponent(render);
503 }
504 return render(props, state);
505 }
506 const mergedProps = mergeProps(props, render.props);
507 mergedProps.ref = props.ref;
508 if (true) {
509 if (!/* @__PURE__ */ React4.isValidElement(render)) {
510 throw new Error(["Base UI: The `render` prop was provided an invalid React element as `React.isValidElement(render)` is `false`.", "A valid React element must be provided to the `render` prop because it is cloned with props to replace the default element.", "https://base-ui.com/r/invalid-render-prop"].join("\n"));
511 }
512 }
513 return /* @__PURE__ */ React4.cloneElement(render, mergedProps);
514 }
515 if (element) {
516 if (typeof element === "string") {
517 return renderTag(element, props);
518 }
519 }
520 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8));
521 }
522 function warnIfRenderPropLooksLikeComponent(renderFn) {
523 const functionName = renderFn.name;
524 if (functionName.length === 0) {
525 return;
526 }
527 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) {
528 return;
529 }
530 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) {
531 return;
532 }
533 warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop");
534 }
535 function renderTag(Tag, props) {
536 if (Tag === "button") {
537 return /* @__PURE__ */ (0, import_react.createElement)("button", {
538 type: "button",
539 ...props,
540 key: props.key
541 });
542 }
543 if (Tag === "img") {
544 return /* @__PURE__ */ (0, import_react.createElement)("img", {
545 alt: "",
546 ...props,
547 key: props.key
548 });
549 }
550 return /* @__PURE__ */ React4.createElement(Tag, props);
551 }
552
553 // node_modules/@base-ui/react/use-render/useRender.mjs
554 function useRender(params) {
555 return useRenderElement(params.defaultTagName ?? "div", params, params);
556 }
557
558 // packages/ui/build-module/text/text.mjs
559 var import_element = __toESM(require_element(), 1);
560 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
561 function getRuntime() {
562 const globalScope = globalThis;
563 if (globalScope.__wpStyleRuntime) {
564 return globalScope.__wpStyleRuntime;
565 }
566 globalScope.__wpStyleRuntime = {
567 documents: /* @__PURE__ */ new Map(),
568 styles: /* @__PURE__ */ new Map(),
569 injectedStyles: /* @__PURE__ */ new WeakMap()
570 };
571 if (typeof document !== "undefined") {
572 registerDocument(document);
573 }
574 return globalScope.__wpStyleRuntime;
575 }
576 function documentContainsStyleHash(targetDocument, hash) {
577 if (!targetDocument.head) {
578 return false;
579 }
580 for (const style of targetDocument.head.querySelectorAll(
581 `style[${STYLE_HASH_ATTRIBUTE}]`
582 )) {
583 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) {
584 return true;
585 }
586 }
587 return false;
588 }
589 function injectStyle(targetDocument, hash, css) {
590 if (!targetDocument.head) {
591 return;
592 }
593 const runtime = getRuntime();
594 let injectedStyles = runtime.injectedStyles.get(targetDocument);
595 if (!injectedStyles) {
596 injectedStyles = /* @__PURE__ */ new Set();
597 runtime.injectedStyles.set(targetDocument, injectedStyles);
598 }
599 if (injectedStyles.has(hash)) {
600 return;
601 }
602 if (documentContainsStyleHash(targetDocument, hash)) {
603 injectedStyles.add(hash);
604 return;
605 }
606 const style = targetDocument.createElement("style");
607 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash);
608 style.appendChild(targetDocument.createTextNode(css));
609 targetDocument.head.appendChild(style);
610 injectedStyles.add(hash);
611 }
612 function registerDocument(targetDocument) {
613 const runtime = getRuntime();
614 runtime.documents.set(
615 targetDocument,
616 (runtime.documents.get(targetDocument) ?? 0) + 1
617 );
618 for (const [hash, css] of runtime.styles) {
619 injectStyle(targetDocument, hash, css);
620 }
621 return () => {
622 const count = runtime.documents.get(targetDocument);
623 if (count === void 0) {
624 return;
625 }
626 if (count <= 1) {
627 runtime.documents.delete(targetDocument);
628 return;
629 }
630 runtime.documents.set(targetDocument, count - 1);
631 };
632 }
633 function registerStyle(hash, css) {
634 const runtime = getRuntime();
635 runtime.styles.set(hash, css);
636 for (const targetDocument of runtime.documents.keys()) {
637 injectStyle(targetDocument, hash, css);
638 }
639 }
640 if (typeof process === "undefined" || true) {
641 registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
642 }
643 var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" };
644 if (typeof process === "undefined" || true) {
645 registerStyle("e8e31009f5", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}");
646 }
647 var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
648 var Text = (0, import_element.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) {
649 const element = useRender({
650 render,
651 defaultTagName: "span",
652 ref,
653 props: mergeProps(props, {
654 className: clsx_default(
655 style_default.text,
656 global_css_defense_default.heading,
657 global_css_defense_default.p,
658 style_default[variant],
659 className
660 )
661 })
662 });
663 return element;
664 });
665
666 // packages/ui/build-module/visually-hidden/visually-hidden.mjs
667 var import_element2 = __toESM(require_element(), 1);
668 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
669 function getRuntime2() {
670 const globalScope = globalThis;
671 if (globalScope.__wpStyleRuntime) {
672 return globalScope.__wpStyleRuntime;
673 }
674 globalScope.__wpStyleRuntime = {
675 documents: /* @__PURE__ */ new Map(),
676 styles: /* @__PURE__ */ new Map(),
677 injectedStyles: /* @__PURE__ */ new WeakMap()
678 };
679 if (typeof document !== "undefined") {
680 registerDocument2(document);
681 }
682 return globalScope.__wpStyleRuntime;
683 }
684 function documentContainsStyleHash2(targetDocument, hash) {
685 if (!targetDocument.head) {
686 return false;
687 }
688 for (const style of targetDocument.head.querySelectorAll(
689 `style[${STYLE_HASH_ATTRIBUTE2}]`
690 )) {
691 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) {
692 return true;
693 }
694 }
695 return false;
696 }
697 function injectStyle2(targetDocument, hash, css) {
698 if (!targetDocument.head) {
699 return;
700 }
701 const runtime = getRuntime2();
702 let injectedStyles = runtime.injectedStyles.get(targetDocument);
703 if (!injectedStyles) {
704 injectedStyles = /* @__PURE__ */ new Set();
705 runtime.injectedStyles.set(targetDocument, injectedStyles);
706 }
707 if (injectedStyles.has(hash)) {
708 return;
709 }
710 if (documentContainsStyleHash2(targetDocument, hash)) {
711 injectedStyles.add(hash);
712 return;
713 }
714 const style = targetDocument.createElement("style");
715 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash);
716 style.appendChild(targetDocument.createTextNode(css));
717 targetDocument.head.appendChild(style);
718 injectedStyles.add(hash);
719 }
720 function registerDocument2(targetDocument) {
721 const runtime = getRuntime2();
722 runtime.documents.set(
723 targetDocument,
724 (runtime.documents.get(targetDocument) ?? 0) + 1
725 );
726 for (const [hash, css] of runtime.styles) {
727 injectStyle2(targetDocument, hash, css);
728 }
729 return () => {
730 const count = runtime.documents.get(targetDocument);
731 if (count === void 0) {
732 return;
733 }
734 if (count <= 1) {
735 runtime.documents.delete(targetDocument);
736 return;
737 }
738 runtime.documents.set(targetDocument, count - 1);
739 };
740 }
741 function registerStyle2(hash, css) {
742 const runtime = getRuntime2();
743 runtime.styles.set(hash, css);
744 for (const targetDocument of runtime.documents.keys()) {
745 injectStyle2(targetDocument, hash, css);
746 }
747 }
748 if (typeof process === "undefined" || true) {
749 registerStyle2("f4df7461e9", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}}}");
750 }
751 var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
752 var VisuallyHidden = (0, import_element2.forwardRef)(
753 function VisuallyHidden2({ render, ...restProps }, ref) {
754 const element = useRender({
755 render,
756 ref,
757 props: mergeProps(
758 { className: style_default2["visually-hidden"] },
759 restProps,
760 {
761 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it.
762 "data-visually-hidden": ""
763 }
764 )
765 });
766 return element;
767 }
768 );
769
770 // packages/ui/build-module/stack/stack.mjs
771 var import_element3 = __toESM(require_element(), 1);
772 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
773 function getRuntime3() {
774 const globalScope = globalThis;
775 if (globalScope.__wpStyleRuntime) {
776 return globalScope.__wpStyleRuntime;
777 }
778 globalScope.__wpStyleRuntime = {
779 documents: /* @__PURE__ */ new Map(),
780 styles: /* @__PURE__ */ new Map(),
781 injectedStyles: /* @__PURE__ */ new WeakMap()
782 };
783 if (typeof document !== "undefined") {
784 registerDocument3(document);
785 }
786 return globalScope.__wpStyleRuntime;
787 }
788 function documentContainsStyleHash3(targetDocument, hash) {
789 if (!targetDocument.head) {
790 return false;
791 }
792 for (const style of targetDocument.head.querySelectorAll(
793 `style[${STYLE_HASH_ATTRIBUTE3}]`
794 )) {
795 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) {
796 return true;
797 }
798 }
799 return false;
800 }
801 function injectStyle3(targetDocument, hash, css) {
802 if (!targetDocument.head) {
803 return;
804 }
805 const runtime = getRuntime3();
806 let injectedStyles = runtime.injectedStyles.get(targetDocument);
807 if (!injectedStyles) {
808 injectedStyles = /* @__PURE__ */ new Set();
809 runtime.injectedStyles.set(targetDocument, injectedStyles);
810 }
811 if (injectedStyles.has(hash)) {
812 return;
813 }
814 if (documentContainsStyleHash3(targetDocument, hash)) {
815 injectedStyles.add(hash);
816 return;
817 }
818 const style = targetDocument.createElement("style");
819 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash);
820 style.appendChild(targetDocument.createTextNode(css));
821 targetDocument.head.appendChild(style);
822 injectedStyles.add(hash);
823 }
824 function registerDocument3(targetDocument) {
825 const runtime = getRuntime3();
826 runtime.documents.set(
827 targetDocument,
828 (runtime.documents.get(targetDocument) ?? 0) + 1
829 );
830 for (const [hash, css] of runtime.styles) {
831 injectStyle3(targetDocument, hash, css);
832 }
833 return () => {
834 const count = runtime.documents.get(targetDocument);
835 if (count === void 0) {
836 return;
837 }
838 if (count <= 1) {
839 runtime.documents.delete(targetDocument);
840 return;
841 }
842 runtime.documents.set(targetDocument, count - 1);
843 };
844 }
845 function registerStyle3(hash, css) {
846 const runtime = getRuntime3();
847 runtime.styles.set(hash, css);
848 for (const targetDocument of runtime.documents.keys()) {
849 injectStyle3(targetDocument, hash, css);
850 }
851 }
852 if (typeof process === "undefined" || true) {
853 registerStyle3("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
854 }
855 var style_default3 = { "stack": "_19ce0419607e1896__stack" };
856 var gapTokens = {
857 xs: "var(--wpds-dimension-gap-xs, 4px)",
858 sm: "var(--wpds-dimension-gap-sm, 8px)",
859 md: "var(--wpds-dimension-gap-md, 12px)",
860 lg: "var(--wpds-dimension-gap-lg, 16px)",
861 xl: "var(--wpds-dimension-gap-xl, 24px)",
862 "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
863 "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
864 };
865 var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
866 const style = {
867 gap: gap && gapTokens[gap],
868 alignItems: align,
869 justifyContent: justify,
870 flexDirection: direction,
871 flexWrap: wrap
872 };
873 const element = useRender({
874 render,
875 ref,
876 props: mergeProps(props, { style, className: style_default3.stack })
877 });
878 return element;
879 });
880
881 // packages/style-runtime/src/index.ts
882 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
883 function getRuntime4() {
884 const globalScope = globalThis;
885 if (globalScope.__wpStyleRuntime) {
886 return globalScope.__wpStyleRuntime;
887 }
888 globalScope.__wpStyleRuntime = {
889 documents: /* @__PURE__ */ new Map(),
890 styles: /* @__PURE__ */ new Map(),
891 injectedStyles: /* @__PURE__ */ new WeakMap()
892 };
893 if (typeof document !== "undefined") {
894 registerDocument4(document);
895 }
896 return globalScope.__wpStyleRuntime;
897 }
898 function documentContainsStyleHash4(targetDocument, hash) {
899 if (!targetDocument.head) {
900 return false;
901 }
902 for (const style of targetDocument.head.querySelectorAll(
903 `style[${STYLE_HASH_ATTRIBUTE4}]`
904 )) {
905 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
906 return true;
907 }
908 }
909 return false;
910 }
911 function injectStyle4(targetDocument, hash, css) {
912 if (!targetDocument.head) {
913 return;
914 }
915 const runtime = getRuntime4();
916 let injectedStyles = runtime.injectedStyles.get(targetDocument);
917 if (!injectedStyles) {
918 injectedStyles = /* @__PURE__ */ new Set();
919 runtime.injectedStyles.set(targetDocument, injectedStyles);
920 }
921 if (injectedStyles.has(hash)) {
922 return;
923 }
924 if (documentContainsStyleHash4(targetDocument, hash)) {
925 injectedStyles.add(hash);
926 return;
927 }
928 const style = targetDocument.createElement("style");
929 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
930 style.appendChild(targetDocument.createTextNode(css));
931 targetDocument.head.appendChild(style);
932 injectedStyles.add(hash);
933 }
934 function registerDocument4(targetDocument) {
935 const runtime = getRuntime4();
936 runtime.documents.set(
937 targetDocument,
938 (runtime.documents.get(targetDocument) ?? 0) + 1
939 );
940 for (const [hash, css] of runtime.styles) {
941 injectStyle4(targetDocument, hash, css);
942 }
943 return () => {
944 const count = runtime.documents.get(targetDocument);
945 if (count === void 0) {
946 return;
947 }
948 if (count <= 1) {
949 runtime.documents.delete(targetDocument);
950 return;
951 }
952 runtime.documents.set(targetDocument, count - 1);
953 };
954 }
955 function registerStyle4(hash, css) {
956 const runtime = getRuntime4();
957 runtime.styles.set(hash, css);
958 for (const targetDocument of runtime.documents.keys()) {
959 injectStyle4(targetDocument, hash, css);
960 }
961 }
962
963 // widgets/hello-dolly/style.module.css
964 if (typeof process === "undefined" || true) {
965 registerStyle4("3bce80a8be", "._0a72644d00175b3d__root{background-color:var(--wpds-color-background-surface-brand,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 9%,#fff));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));height:100%;padding:var(--wpds-dimension-padding-2xl,24px)}._27db09cc57742421__quote{font-family:Georgia,Times New Roman,Times,serif;font-style:italic;text-align:center}");
966 }
967 var style_default4 = { "root": "_0a72644d00175b3d__root", "quote": "_27db09cc57742421__quote" };
968
969 // widgets/hello-dolly/render.tsx
970 var import_jsx_runtime = __toESM(require_jsx_runtime());
971 var DOLLY_LYRICS = [
972 "Hello, Dolly",
973 "Well, hello, Dolly",
974 "It's so nice to have you back where you belong",
975 "You're lookin' swell, Dolly",
976 "I can tell, Dolly",
977 "You're still glowin', you're still crowin'",
978 "You're still goin' strong",
979 "I feel the room swayin'",
980 "While the band's playin'",
981 "One of our old favorite songs from way back when",
982 "So, take her wrap, fellas",
983 "Dolly, never go away again",
984 "Hello, Dolly",
985 "Well, hello, Dolly",
986 "It's so nice to have you back where you belong",
987 "You're lookin' swell, Dolly",
988 "I can tell, Dolly",
989 "You're still glowin', you're still crowin'",
990 "You're still goin' strong",
991 "I feel the room swayin'",
992 "While the band's playin'",
993 "One of our old favorite songs from way back when",
994 "So, golly, gee, fellas",
995 "Have a little faith in me, fellas",
996 "Dolly, never go away",
997 "Promise, you'll never go away",
998 "Dolly'll never go away again"
999 ];
1000 function HelloDolly() {
1001 const quote = (0, import_element4.useMemo)(() => {
1002 return DOLLY_LYRICS[Math.floor(Math.random() * DOLLY_LYRICS.length)];
1003 }, []);
1004 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Stack, { align: "center", justify: "center", className: style_default4.root, children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(Text, { variant: "body-xl", render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("p", {}), className: style_default4.quote, children: [
1005 /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", {}), children: [
1006 (0, import_i18n.__)(
1007 "Quote from Hello Dolly song, by Jerry Herman:"
1008 ),
1009 " "
1010 ] }),
1011 /* @__PURE__ */ (0, import_jsx_runtime.jsx)("span", { dir: "ltr", lang: "en", children: quote })
1012 ] }) });
1013 }
1014 export {
1015 HelloDolly as default
1016 };
1017