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
← All changes | build/scripts/format-library/index.js +4698 -1799 23.4.0 → 24.1.0 View file →
@@ -1,4 +1,6 @@
1 +(function() {
2 +"use strict";
1 3 var wp;
2 4 (wp ||= {}).formatLibrary = (() => {
3 5 var __create = Object.create;
4 6 var __defProp = Object.defineProperty;
@@ -107,9 +109,9 @@
107 109 function is(x, y) {
108 110 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y;
109 111 }
110 112 function useSyncExternalStore$2(subscribe2, getSnapshot2) {
111 - didWarnOld18Alpha || void 0 === React31.startTransition || (didWarnOld18Alpha = true, console.error(
113 + didWarnOld18Alpha || void 0 === React51.startTransition || (didWarnOld18Alpha = true, console.error(
112 114 "You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."
113 115 ));
114 116 var value = getSnapshot2();
115 117 if (!didWarnUncachedGetSnapshot) {
@@ -117,9 +119,9 @@
117 119 objectIs(value, cachedValue) || (console.error(
118 120 "The result of getSnapshot should be cached to avoid an infinite loop"
119 121 ), didWarnUncachedGetSnapshot = true);
120 122 }
121 - cachedValue = useState17({
123 + cachedValue = useState21({
122 124 inst: { value, getSnapshot: getSnapshot2 }
123 125 });
124 126 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1];
125 127 useLayoutEffect3(
@@ -155,10 +157,10 @@
155 157 function useSyncExternalStore$1(subscribe2, getSnapshot2) {
156 158 return getSnapshot2();
157 159 }
158 160 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());
159 - var React31 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState17 = React31.useState, useEffect14 = React31.useEffect, useLayoutEffect3 = React31.useLayoutEffect, useDebugValue = React31.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
160 - exports.useSyncExternalStore = void 0 !== React31.useSyncExternalStore ? React31.useSyncExternalStore : shim;
161 + var React51 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState21 = React51.useState, useEffect14 = React51.useEffect, useLayoutEffect3 = React51.useLayoutEffect, useDebugValue = React51.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2;
162 + exports.useSyncExternalStore = void 0 !== React51.useSyncExternalStore ? React51.useSyncExternalStore : shim;
161 163 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());
162 164 })();
163 165 }
164 166 });
@@ -174,15 +176,8 @@
174 176 }
175 177 }
176 178 });
177 179
178 - // package-external:@wordpress/a11y
179 - var require_a11y = __commonJS({
180 - "package-external:@wordpress/a11y"(exports, module) {
181 - module.exports = window.wp.a11y;
182 - }
183 - });
184 -
185 180 // package-external:@wordpress/compose
186 181 var require_compose = __commonJS({
187 182 "package-external:@wordpress/compose"(exports, module) {
188 183 module.exports = window.wp.compose;
@@ -188,12 +183,12 @@
188 183 module.exports = window.wp.compose;
189 184 }
190 185 });
191 186
192 - // package-external:@wordpress/private-apis
193 - var require_private_apis = __commonJS({
194 - "package-external:@wordpress/private-apis"(exports, module) {
195 - module.exports = window.wp.privateApis;
187 + // package-external:@wordpress/a11y
188 + var require_a11y = __commonJS({
189 + "package-external:@wordpress/a11y"(exports, module) {
190 + module.exports = window.wp.a11y;
196 191 }
197 192 });
198 193
199 194 // package-external:@wordpress/url
@@ -227,13 +222,19 @@
227 222
228 223 // packages/icons/build-module/icon/index.mjs
229 224 var import_element = __toESM(require_element(), 1);
230 225 var icon_default = (0, import_element.forwardRef)(
231 - ({ icon, size = 24, ...props }, ref) => {
226 + ({ icon, size = 24, style, ...props }, ref) => {
227 + const intrinsicStyle = icon.props.style;
228 + const mergedStyle = intrinsicStyle || style ? { ...intrinsicStyle, ...style } : void 0;
232 229 return (0, import_element.cloneElement)(icon, {
233 230 width: size,
234 231 height: size,
235 232 ...props,
233 + // Merge styles so the icon's intrinsic style (e.g. `fill: none` on
234 + // stroke-based icons) is preserved unless the consumer overrides
235 + // the same property explicitly.
236 + ...mergedStyle ? { style: mergedStyle } : {},
236 237 ref
237 238 });
238 239 }
239 240 );
@@ -240,77 +241,107 @@
240 241
241 242 // packages/icons/build-module/library/button.mjs
242 243 var import_primitives = __toESM(require_primitives(), 1);
243 244 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1);
244 - var button_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M8 12.5h8V11H8v1.5Z M19 6.5H5a2 2 0 0 0-2 2V15a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V8.5a2 2 0 0 0-2-2ZM5 8h14a.5.5 0 0 1 .5.5V15a.5.5 0 0 1-.5.5H5a.5.5 0 0 1-.5-.5V8.5A.5.5 0 0 1 5 8Z" }) });
245 + var button_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M8 11.75H16M5 16.25H19C19.6904 16.25 20.25 15.6904 20.25 15V8.5C20.25 7.80964 19.6904 7.25 19 7.25H5C4.30964 7.25 3.75 7.80964 3.75 8.5V15C3.75 15.6904 4.30964 16.25 5 16.25Z", vectorEffect: "non-scaling-stroke" }) });
245 246
246 247 // packages/icons/build-module/library/chevron-right.mjs
247 248 var import_primitives2 = __toESM(require_primitives(), 1);
248 249 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1);
249 - var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) });
250 + var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M10 6.5L15 12L10 17.5", vectorEffect: "non-scaling-stroke" }) });
250 251
251 252 // packages/icons/build-module/library/code.mjs
252 253 var import_primitives3 = __toESM(require_primitives(), 1);
253 254 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1);
254 - var code_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M20.8 10.7l-4.3-4.3-1.1 1.1 4.3 4.3c.1.1.1.3 0 .4l-4.3 4.3 1.1 1.1 4.3-4.3c.7-.8.7-1.9 0-2.6zM4.2 11.8l4.3-4.3-1-1-4.3 4.3c-.7.7-.7 1.8 0 2.5l4.3 4.3 1.1-1.1-4.3-4.3c-.2-.1-.2-.3-.1-.4z" }) });
255 + var code_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M7.99997 7L3.70708 11.2929C3.31655 11.6834 3.31655 12.3166 3.70708 12.7071L7.99997 17M16 17L20.2929 12.7071C20.6834 12.3166 20.6834 11.6834 20.2929 11.2929L16 7", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }) });
255 256
256 257 // packages/icons/build-module/library/color.mjs
257 258 var import_primitives4 = __toESM(require_primitives(), 1);
258 259 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
259 - var color_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M17.2 10.9c-.5-1-1.2-2.1-2.1-3.2-.6-.9-1.3-1.7-2.1-2.6L12 4l-1 1.1c-.6.9-1.3 1.7-2 2.6-.8 1.2-1.5 2.3-2 3.2-.6 1.2-1 2.2-1 3 0 3.4 2.7 6.1 6.1 6.1s6.1-2.7 6.1-6.1c0-.8-.3-1.8-1-3zm-5.1 7.6c-2.5 0-4.6-2.1-4.6-4.6 0-.3.1-1 .8-2.3.5-.9 1.1-1.9 2-3.1.7-.9 1.3-1.7 1.8-2.3.7.8 1.3 1.6 1.8 2.3.8 1.1 1.5 2.2 2 3.1.7 1.3.8 2 .8 2.3 0 2.5-2.1 4.6-4.6 4.6z" }) });
260 + var color_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M17.25 14C17.25 16.8995 14.8995 19.25 12 19.25C9.10051 19.25 6.75 16.8995 6.75 14C6.75 11.1005 10 7.37 12 5.12C14 7.37 17.25 11.1005 17.25 14Z", vectorEffect: "non-scaling-stroke" }) });
260 261
261 - // packages/icons/build-module/library/format-bold.mjs
262 + // packages/icons/build-module/library/error.mjs
262 263 var import_primitives5 = __toESM(require_primitives(), 1);
263 264 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
264 - var format_bold_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M14.7 11.3c1-.6 1.5-1.6 1.5-3 0-2.3-1.3-3.4-4-3.4H7v14h5.8c1.4 0 2.5-.3 3.3-1 .8-.7 1.2-1.7 1.2-2.9.1-1.9-.8-3.1-2.6-3.7zm-5.1-4h2.3c.6 0 1.1.1 1.4.4.3.3.5.7.5 1.2s-.2 1-.5 1.2c-.3.3-.8.4-1.4.4H9.6V7.3zm4.6 9c-.4.3-1 .4-1.7.4H9.6v-3.9h2.9c.7 0 1.3.2 1.7.5.4.3.6.8.6 1.5s-.2 1.2-.6 1.5z" }) });
265 + var error_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M12 9L12 14M12 15.5V17M11.1284 5.04947L3.83827 18.0097C3.46331 18.6763 3.94502 19.5 4.70985 19.5H19.2902C20.055 19.5 20.5367 18.6763 20.1617 18.0097L12.8716 5.04947C12.4893 4.36982 11.5107 4.36982 11.1284 5.04947Z", vectorEffect: "non-scaling-stroke" }) });
265 266
266 - // packages/icons/build-module/library/format-italic.mjs
267 + // packages/icons/build-module/library/format-bold.mjs
267 268 var import_primitives6 = __toESM(require_primitives(), 1);
268 269 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1);
269 - var format_italic_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M12.5 5L10 19h1.9l2.5-14z" }) });
270 + var format_bold_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M13 11.5H7.75M13 11.5L13.7412 11.6059C15.3242 11.832 16.5 13.1877 16.5 14.7868C16.5 16.5614 15.0614 18 13.2868 18H7.75C7.75 18 7.75 14.9338 7.75 11.5M13 11.5L13.2913 11.4417C14.5756 11.1849 15.5 10.0573 15.5 8.74755C15.5 7.23012 14.2699 6 12.7525 6H7.75C7.75 7.65199 7.75 9.63049 7.75 11.5", vectorEffect: "non-scaling-stroke" }) });
270 271
271 - // packages/icons/build-module/library/format-strikethrough.mjs
272 + // packages/icons/build-module/library/format-italic.mjs
272 273 var import_primitives7 = __toESM(require_primitives(), 1);
273 274 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1);
274 - var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M9.1 9v-.5c0-.6.2-1.1.7-1.4.5-.3 1.2-.5 2-.5.7 0 1.4.1 2.1.3.7.2 1.4.5 2.1.9l.2-1.9c-.6-.3-1.2-.5-1.9-.7-.8-.1-1.6-.2-2.4-.2-1.5 0-2.7.3-3.6 1-.8.7-1.2 1.5-1.2 2.6V9h2zM20 12H4v1h8.3c.3.1.6.2.8.3.5.2.9.5 1.1.8.3.3.4.7.4 1.2 0 .7-.2 1.1-.8 1.5-.5.3-1.2.5-2.1.5-.8 0-1.6-.1-2.4-.3-.8-.2-1.5-.5-2.2-.8L7 18.1c.5.2 1.2.4 2 .6.8.2 1.6.3 2.4.3 1.7 0 3-.3 3.9-1 .9-.7 1.3-1.6 1.3-2.8 0-.9-.2-1.7-.7-2.2H20v-1z" }) });
275 + var format_italic_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M11 19L13.5 5", vectorEffect: "non-scaling-stroke" }) });
275 276
276 - // packages/icons/build-module/library/help.mjs
277 + // packages/icons/build-module/library/format-strikethrough.mjs
277 278 var import_primitives8 = __toESM(require_primitives(), 1);
278 279 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1);
279 - var help_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M12 4a8 8 0 1 1 .001 16.001A8 8 0 0 1 12 4Zm0 1.5a6.5 6.5 0 1 0-.001 13.001A6.5 6.5 0 0 0 12 5.5Zm.75 11h-1.5V15h1.5v1.5Zm-.445-9.234a3 3 0 0 1 .445 5.89V14h-1.5v-1.25c0-.57.452-.958.917-1.01A1.5 1.5 0 0 0 12 8.75a1.5 1.5 0 0 0-1.5 1.5H9a3 3 0 0 1 3.305-2.984Z" }) });
280 + var format_strikethrough_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M9 16.1554C12 18.02 15 16.5283 15 14.2908C15 13.6314 14.6839 12.999 14.1213 12.5328C14.108 12.5217 14.0945 12.5108 14.081 12.5M9 9.31845C9 7.49773 11.4313 6.3247 13.9199 7.4278M5.5 12.5H14.081M18.5 12.5H14.081", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }) });
280 281
281 - // packages/icons/build-module/library/language.mjs
282 + // packages/icons/build-module/library/help.mjs
282 283 var import_primitives9 = __toESM(require_primitives(), 1);
283 284 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1);
284 - var language_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M17.5 10h-1.7l-3.7 10.5h1.7l.9-2.6h3.9l.9 2.6h1.7L17.5 10zm-2.2 6.3 1.4-4 1.4 4h-2.8zm-4.8-3.8c1.6-1.8 2.9-3.6 3.7-5.7H16V5.2h-5.8V3H8.8v2.2H3v1.5h9.6c-.7 1.6-1.8 3.1-3.1 4.6C8.6 10.2 7.8 9 7.2 8H5.6c.6 1.4 1.7 2.9 2.9 4.4l-2.4 2.4c-.3.4-.7.8-1.1 1.2l1 1 1.2-1.2c.8-.8 1.6-1.5 2.3-2.3.8.9 1.7 1.7 2.5 2.5l.6-1.5c-.7-.6-1.4-1.3-2.1-2z" }) });
285 + var help_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
286 + /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M9.75 10.25C9.75 9.00736 10.7574 8 12 8C13.2426 8 14.25 9.00736 14.25 10.25C14.25 11.4083 13.3748 12.3621 12.2496 12.4863C12.1124 12.5015 12 12.6119 12 12.75V14M12 15V16.5", vectorEffect: "non-scaling-stroke" }),
287 + /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" })
288 + ] });
285 289
286 - // packages/icons/build-module/library/link.mjs
290 + // packages/icons/build-module/library/inline-image.mjs
287 291 var import_primitives10 = __toESM(require_primitives(), 1);
288 292 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1);
289 - var link_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M10 17.389H8.444A5.194 5.194 0 1 1 8.444 7H10v1.5H8.444a3.694 3.694 0 0 0 0 7.389H10v1.5ZM14 7h1.556a5.194 5.194 0 0 1 0 10.39H14v-1.5h1.556a3.694 3.694 0 0 0 0-7.39H14V7Zm-4.5 6h5v-1.5h-5V13Z" }) });
293 + var inline_image_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M13.25 11.3197L11.4155 9.48453C11.3765 9.44547 11.3132 9.44546 11.2741 9.48452L9.05837 11.7003C9.02448 11.7341 8.97132 11.7392 8.93163 11.7124L7.0648 10.4495C7.03003 10.426 6.98426 10.4267 6.95022 10.4513L4.75 12.0405M13.25 11.3197V7C13.25 6.30964 12.6904 5.75 12 5.75H6C5.30964 5.75 4.75 6.30965 4.75 7V12.0405M13.25 11.3197V13C13.25 13.6904 12.6904 14.25 12 14.25H6C5.30964 14.25 4.75 13.6904 4.75 13V12.0405M16 14H20M4 18H20", vectorEffect: "non-scaling-stroke" }) });
290 294
291 - // packages/icons/build-module/library/math.mjs
295 + // packages/icons/build-module/library/language.mjs
292 296 var import_primitives11 = __toESM(require_primitives(), 1);
293 297 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1);
294 - var math_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M11.2 6.8c-.7 0-1.4.5-1.6 1.1l-2.8 7.5-1.2-1.8c-.1-.2-.4-.3-.6-.3H3v1.5h1.6l1.2 1.8c.6.9 1.9.7 2.2-.3l2.9-7.9s.1-.2.2-.2h7.8V6.7h-7.8Zm5.3 3.4-1.9 1.9-1.9-1.9-1.1 1.1 1.9 1.9-1.9 1.9 1.1 1.1 1.9-1.9 1.9 1.9 1.1-1.1-1.9-1.9 1.9-1.9-1.1-1.1Z" }) });
298 + var language_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsxs)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
299 + /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M3 6H9.5M16 6H13.5M9.5 6V3M9.5 6H13.5M13.5 6C13.0477 7.24386 11.7361 9.79194 9.44037 12.5512M5.5 16.5C7.04336 15.2139 8.35238 13.8588 9.44037 12.5512M6.5 8C6.9232 8.9522 7.93743 10.7507 9.44037 12.5512M12.5 15.5C11.3314 14.6235 10.305 13.587 9.44037 12.5512", vectorEffect: "non-scaling-stroke" }),
300 + /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M13.75 20V19.75L14.6667 17M14.6667 17L16.75 10.75H17.25L19.3333 17L20.25 19.75V20M19.3333 17H14.6667", vectorEffect: "non-scaling-stroke" })
301 + ] });
295 302
296 - // packages/icons/build-module/library/subscript.mjs
303 + // packages/icons/build-module/library/link.mjs
297 304 var import_primitives12 = __toESM(require_primitives(), 1);
298 305 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1);
299 - var subscript_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M16.9 18.3l.8-1.2c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.1-.3-.4-.5-.6-.7-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.2 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3L15 19.4h4.3v-1.2h-2.4zM14.1 7.2h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) });
306 + var link_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M9.5 12L14.5 12M10 7.75H8.25C5.90279 7.75 4 9.65279 4 12C4 14.3472 5.90279 16.25 8.25 16.25H10M14 16.25H15.75C18.0972 16.25 20 14.3472 20 12C20 9.65279 18.0972 7.75 15.75 7.75L14 7.75", vectorEffect: "non-scaling-stroke" }) });
300 307
301 - // packages/icons/build-module/library/superscript.mjs
308 + // packages/icons/build-module/library/math.mjs
302 309 var import_primitives13 = __toESM(require_primitives(), 1);
303 310 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1);
304 - var superscript_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.Path, { d: "M16.9 10.3l.8-1.3c.4-.6.7-1.2.9-1.6.2-.4.3-.8.3-1.2 0-.3-.1-.7-.2-1-.2-.2-.4-.4-.7-.6-.3-.2-.6-.3-1-.3s-.8.1-1.1.2c-.3.1-.7.3-1 .6l.1 1.3c.3-.3.5-.5.8-.6s.6-.2.9-.2c.3 0 .5.1.7.2.2.2.2.4.2.7 0 .3-.1.5-.2.8-.1.3-.4.7-.8 1.3l-1.8 2.8h4.3v-1.2h-2.2zm-2.8-3.1h-2L9.5 11 6.9 7.2h-2l3.6 5.3L4.7 18h2l2.7-4 2.7 4h2l-3.8-5.5 3.8-5.3z" }) });
311 + var math_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.Path, { d: "M3 14H5L6.8916 16.3645C6.93974 16.4247 7.03496 16.4101 7.06289 16.3383L10.2521 8.13755C10.4015 7.75318 10.7717 7.5 11.1841 7.5H19M17 11L14.5 13.5M12 16L14.5 13.5M14.5 13.5L17 16M14.5 13.5L12 11", vectorEffect: "non-scaling-stroke" }) });
305 312
306 - // packages/icons/build-module/library/text-color.mjs
313 + // packages/icons/build-module/library/published.mjs
307 314 var import_primitives14 = __toESM(require_primitives(), 1);
308 315 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1);
309 - var text_color_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12.9 6h-2l-4 11h1.9l1.1-3h4.2l1.1 3h1.9L12.9 6zm-2.5 6.5l1.5-4.9 1.7 4.9h-3.2z" }) });
316 + var published_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
317 + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round", vectorEffect: "non-scaling-stroke" }),
318 + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M9 12L11 14L15 10", vectorEffect: "non-scaling-stroke" })
319 + ] });
310 320
321 + // packages/icons/build-module/library/subscript.mjs
322 + var import_primitives15 = __toESM(require_primitives(), 1);
323 + var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
324 + var subscript_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
325 + /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M17.75 18.5988H15.75C15.75 16.5322 17.75 17.0489 17.75 15.4989C17.75 14.7239 16.75 14.0738 15.75 14.8488", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }),
326 + /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M10 12L13 7.4V7M10 12L7 7.4L7.00004 7M10 12L7 16.6V17M10 12L13 16.6V17", vectorEffect: "non-scaling-stroke" })
327 + ] });
328 +
329 + // packages/icons/build-module/library/superscript.mjs
330 + var import_primitives16 = __toESM(require_primitives(), 1);
331 + var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
332 + var superscript_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [
333 + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.Path, { d: "M17.75 8.59884H15.75C15.75 6.53219 17.75 7.04885 17.75 5.49887C17.75 4.72388 16.75 4.07384 15.75 4.84884", strokeLinecap: "square", vectorEffect: "non-scaling-stroke" }),
334 + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.Path, { d: "M10 12L13 7.4V7M10 12L7 7.4L7.00004 7M10 12L7 16.6V17M10 12L13 16.6V17", vectorEffect: "non-scaling-stroke" })
335 + ] });
336 +
337 + // packages/icons/build-module/library/text-color.mjs
338 + var import_primitives17 = __toESM(require_primitives(), 1);
339 + var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
340 + var text_color_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.Path, { d: "M8 17.5V17.223L9.01577 14.1757M9.01577 14.1757L11.3243 7.25H11.8784L14.1869 14.1757L15.2027 17.223V17.5M14.1869 14.1757H9.01577", vectorEffect: "non-scaling-stroke" }) });
341 +
311 342 // packages/format-library/build-module/bold/index.mjs
312 - var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1);
343 + var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
313 344 var name = "core/bold";
314 345 var title = (0, import_i18n.__)("Bold");
315 346 var bold = {
316 347 name,
@@ -316,18 +347,24 @@
316 347 name,
317 348 title,
318 349 tagName: "strong",
319 350 className: null,
320 - edit({ isActive, value, onChange, onFocus, isVisible = true }) {
351 + edit({
352 + isActive,
353 + value,
354 + onChange,
355 + onFocus,
356 + isVisible = true
357 + }) {
321 358 function onToggle() {
322 359 onChange((0, import_rich_text.toggleFormat)(value, { type: name, title }));
323 360 }
324 361 function onClick() {
325 - onChange((0, import_rich_text.toggleFormat)(value, { type: name }));
362 + onChange((0, import_rich_text.toggleFormat)(value, { type: name, title }));
326 363 onFocus();
327 364 }
328 - return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [
329 - /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
365 + return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_jsx_runtime18.Fragment, { children: [
366 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
330 367 import_block_editor.RichTextShortcut,
331 368 {
332 369 type: "primary",
333 370 character: "b",
@@ -333,9 +370,9 @@
333 370 character: "b",
334 371 onUse: onToggle
335 372 }
336 373 ),
337 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
374 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
338 375 import_block_editor.RichTextToolbarButton,
339 376 {
340 377 name: "bold",
341 378 icon: format_bold_default,
@@ -345,9 +382,9 @@
345 382 shortcutType: "primary",
346 383 shortcutCharacter: "b"
347 384 }
348 385 ),
349 - /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(
386 + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
350 387 import_block_editor.__unstableRichTextInputEvent,
351 388 {
352 389 inputType: "formatBold",
353 390 onInput: onToggle
@@ -360,9 +397,9 @@
360 397 // packages/format-library/build-module/code/index.mjs
361 398 var import_i18n2 = __toESM(require_i18n(), 1);
362 399 var import_rich_text2 = __toESM(require_rich_text(), 1);
363 400 var import_block_editor2 = __toESM(require_block_editor(), 1);
364 - var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1);
401 + var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
365 402 var name2 = "core/code";
366 403 var title2 = (0, import_i18n2.__)("Inline code");
367 404 var code = {
368 405 name: name2,
@@ -392,15 +429,20 @@
392 429 value = (0, import_rich_text2.remove)(value, endIndex, endIndex + 1);
393 430 value = (0, import_rich_text2.applyFormat)(value, { type: name2 }, startIndex, endIndex);
394 431 return value;
395 432 },
396 - edit({ value, onChange, onFocus, isActive }) {
433 + edit({
434 + value,
435 + onChange,
436 + onFocus,
437 + isActive
438 + }) {
397 439 function onClick() {
398 440 onChange((0, import_rich_text2.toggleFormat)(value, { type: name2, title: title2 }));
399 441 onFocus();
400 442 }
401 - return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [
402 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
443 + return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_jsx_runtime19.Fragment, { children: [
444 + /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
403 445 import_block_editor2.RichTextShortcut,
404 446 {
405 447 type: "access",
406 448 character: "x",
@@ -406,9 +448,9 @@
406 448 character: "x",
407 449 onUse: onClick
408 450 }
409 451 ),
410 - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(
452 + /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
411 453 import_block_editor2.RichTextToolbarButton,
412 454 {
413 455 icon: code_default,
414 456 title: title2,
@@ -439,27 +481,38 @@
439 481 return n;
440 482 }
441 483 var clsx_default = clsx;
442 484
443 - // node_modules/@base-ui/utils/esm/useControlled.js
485 + // node_modules/@base-ui/utils/useControlled.mjs
444 486 var React = __toESM(require_react(), 1);
445 487
446 - // node_modules/@base-ui/utils/esm/error.js
447 - var set;
488 + // node_modules/@base-ui/utils/createLogOnce.mjs
489 + var loggedMessages;
448 490 if (true) {
449 - set = /* @__PURE__ */ new Set();
491 + loggedMessages = /* @__PURE__ */ new Set();
450 492 }
451 - function error(...messages) {
452 - if (true) {
453 - const messageKey = messages.join(" ");
454 - if (!set.has(messageKey)) {
455 - set.add(messageKey);
456 - console.error(`Base UI: ${messageKey}`);
493 + function createLogOnce(severity, prefix) {
494 + return function logOnce(...messages) {
495 + if (true) {
496 + const message = messages.join(" ");
497 + const output = prefix ? `${prefix}: ${message}` : message;
498 + const key = `${severity}:${output}`;
499 + if (!loggedMessages.has(key)) {
500 + loggedMessages.add(key);
501 + if (severity === "warn") {
502 + console.warn(output);
503 + } else {
504 + console.error(output);
505 + }
506 + }
457 507 }
458 - }
508 + };
459 509 }
460 510
461 - // node_modules/@base-ui/utils/esm/useControlled.js
511 + // node_modules/@base-ui/utils/error.mjs
512 + var error = createLogOnce("error", "Base UI");
513 +
514 + // node_modules/@base-ui/utils/useControlled.mjs
462 515 function useControlled({
463 516 controlled,
464 517 default: defaultProp,
465 518 name: name16,
@@ -468,9 +521,9 @@
468 521 const {
469 522 current: isControlled
470 523 } = React.useRef(controlled !== void 0);
471 524 const [valueState, setValue] = React.useState(defaultProp);
472 - const value = isControlled ? controlled : valueState;
525 + const value = isControlled && controlled !== void 0 ? controlled : valueState;
473 526 if (true) {
474 527 React.useEffect(() => {
475 528 if (isControlled !== (controlled !== void 0)) {
476 529 error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name16} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name16} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n"));
@@ -518,15 +571,15 @@
518 571 return "__unserializable__";
519 572 }
520 573 }
521 574
522 - // node_modules/@base-ui/utils/esm/safeReact.js
575 + // node_modules/@base-ui/utils/safeReact.mjs
523 576 var React2 = __toESM(require_react(), 1);
524 577 var SafeReact = {
525 578 ...React2
526 579 };
527 580
528 - // node_modules/@base-ui/utils/esm/useRefWithInit.js
581 + // node_modules/@base-ui/utils/useRefWithInit.mjs
529 582 var React3 = __toESM(require_react(), 1);
530 583 var UNINITIALIZED = {};
531 584 function useRefWithInit(init, initArg) {
532 585 const ref = React3.useRef(UNINITIALIZED);
@@ -535,9 +588,9 @@
535 588 }
536 589 return ref;
537 590 }
538 591
539 - // node_modules/@base-ui/utils/esm/useStableCallback.js
592 + // node_modules/@base-ui/utils/useStableCallback.mjs
540 593 var useInsertionEffect = SafeReact.useInsertionEffect;
541 594 var useSafeInsertionEffect = (
542 595 // React 17 doesn't have useInsertionEffect.
543 596 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late.
@@ -568,33 +621,27 @@
568 621 );
569 622 }
570 623 }
571 624
572 - // node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js
625 + // node_modules/@base-ui/utils/warn.mjs
626 + var warn = createLogOnce("warn", "Base UI");
627 +
628 + // node_modules/@base-ui/utils/empty.mjs
629 + function NOOP() {
630 + }
631 + var EMPTY_ARRAY = Object.freeze([]);
632 + var EMPTY_OBJECT = Object.freeze({});
633 +
634 + // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
635 + var React6 = __toESM(require_react(), 1);
636 +
637 + // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs
573 638 var React4 = __toESM(require_react(), 1);
574 639 var noop = () => {
575 640 };
576 641 var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop;
577 642
578 - // node_modules/@base-ui/utils/esm/warn.js
579 - var set2;
580 - if (true) {
581 - set2 = /* @__PURE__ */ new Set();
582 - }
583 - function warn(...messages) {
584 - if (true) {
585 - const messageKey = messages.join(" ");
586 - if (!set2.has(messageKey)) {
587 - set2.add(messageKey);
588 - console.warn(`Base UI: ${messageKey}`);
589 - }
590 - }
591 - }
592 -
593 - // node_modules/@base-ui/react/esm/internals/composite/list/CompositeList.js
594 - var React6 = __toESM(require_react(), 1);
595 -
596 - // node_modules/@base-ui/react/esm/internals/composite/list/CompositeListContext.js
643 + // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs
597 644 var React5 = __toESM(require_react(), 1);
598 645 var CompositeListContext = /* @__PURE__ */ React5.createContext({
599 646 register: () => {
600 647 },
@@ -599,15 +646,10 @@
599 646 register: () => {
600 647 },
601 648 unregister: () => {
602 649 },
603 - subscribeMapChange: () => {
604 - return () => {
605 - };
650 + subscribeMapChange: () => () => {
606 651 },
607 - elementsRef: {
608 - current: []
609 - },
610 652 nextIndexRef: {
611 653 current: 0
612 654 }
613 655 });
@@ -615,10 +657,10 @@
615 657 function useCompositeListContext() {
616 658 return React5.useContext(CompositeListContext);
617 659 }
618 660
619 - // node_modules/@base-ui/react/esm/internals/composite/list/CompositeList.js
620 - var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1);
661 + // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs
662 + var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
621 663 function CompositeList(props) {
622 664 const {
623 665 children,
624 666 elementsRef,
@@ -625,88 +667,123 @@
625 667 labelsRef,
626 668 onMapChange: onMapChangeProp
627 669 } = props;
628 670 const onMapChange = useStableCallback(onMapChangeProp);
629 - const nextIndexRef = React6.useRef(0);
671 + const [, setMapTick] = React6.useState(false);
630 672 const listeners = useRefWithInit(createListeners).current;
631 673 const map = useRefWithInit(createMap).current;
632 - const [mapTick, setMapTick] = React6.useState(0);
633 - const lastTickRef = React6.useRef(mapTick);
634 - const register = useStableCallback((node, metadata) => {
635 - map.set(node, metadata ?? null);
636 - lastTickRef.current += 1;
637 - setMapTick(lastTickRef.current);
674 + const nextIndexRef = React6.useRef(0);
675 + const isDirtyRef = React6.useRef(true);
676 + const itemsRef = React6.useRef(null);
677 + const mutationObserverRef = React6.useRef(null);
678 + const scheduleMapUpdate = useStableCallback(() => {
679 + if (isDirtyRef.current) {
680 + return;
681 + }
682 + isDirtyRef.current = true;
683 + setMapTick((tick) => !tick);
638 684 });
685 + const register = useStableCallback((node, registration) => {
686 + map.set(node, registration);
687 + scheduleMapUpdate();
688 + });
639 689 const unregister = useStableCallback((node) => {
640 690 map.delete(node);
641 - lastTickRef.current += 1;
642 - setMapTick(lastTickRef.current);
691 + scheduleMapUpdate();
643 692 });
644 - const sortedMap = React6.useMemo(() => {
645 - disableEslintWarning(mapTick);
646 - const newMap = /* @__PURE__ */ new Map();
647 - const sortedNodes = Array.from(map.keys()).filter((node) => node.isConnected).sort(sortByDocumentPosition);
648 - sortedNodes.forEach((node, index) => {
649 - const metadata = map.get(node) ?? {};
650 - newMap.set(node, {
651 - ...metadata,
652 - index
693 + const syncRefs = useStableCallback((items) => {
694 + const nextMap = /* @__PURE__ */ new Map();
695 + elementsRef.current.length = 0;
696 + if (labelsRef) {
697 + labelsRef.current.length = 0;
698 + }
699 + items.forEach((item) => {
700 + nextMap.set(item.element, {
701 + ...item.registration.metadata ?? {},
702 + index: item.index
653 703 });
704 + elementsRef.current[item.index] = item.element;
705 + if (labelsRef) {
706 + labelsRef.current[item.index] = item.registration.label !== void 0 ? item.registration.label : item.registration.textRef?.current?.textContent ?? item.element.textContent;
707 + }
654 708 });
655 - return newMap;
656 - }, [map, mapTick]);
657 - useIsoLayoutEffect(() => {
658 - if (typeof MutationObserver !== "function" || sortedMap.size === 0) {
659 - return void 0;
709 + nextIndexRef.current = elementsRef.current.length;
710 + return nextMap;
711 + });
712 + function observe(sortedNodes) {
713 + mutationObserverRef.current?.disconnect();
714 + mutationObserverRef.current = null;
715 + if (typeof MutationObserver !== "function" || sortedNodes.length < 2) {
716 + return;
660 717 }
661 718 const mutationObserver = new MutationObserver((entries) => {
662 - const diff = /* @__PURE__ */ new Set();
663 - const updateDiff = (node) => diff.has(node) ? diff.delete(node) : diff.add(node);
664 - entries.forEach((entry) => {
665 - entry.removedNodes.forEach(updateDiff);
666 - entry.addedNodes.forEach(updateDiff);
667 - });
668 - if (diff.size === 0) {
669 - lastTickRef.current += 1;
670 - setMapTick(lastTickRef.current);
719 + if (!hasMovedNode(entries)) {
720 + return;
671 721 }
722 + let previousConnectedNode = null;
723 + for (const node of sortedNodes) {
724 + if (!node.isConnected) {
725 + continue;
726 + }
727 + if (previousConnectedNode && sortByDocumentPosition(previousConnectedNode, node) > 0) {
728 + mutationObserver.disconnect();
729 + scheduleMapUpdate();
730 + return;
731 + }
732 + previousConnectedNode = node;
733 + }
672 734 });
673 - sortedMap.forEach((_, node) => {
674 - if (node.parentElement) {
675 - mutationObserver.observe(node.parentElement, {
676 - childList: true
677 - });
735 + mutationObserverRef.current = mutationObserver;
736 + const roots = /* @__PURE__ */ new Set();
737 + for (let i = 1; i < sortedNodes.length; i += 1) {
738 + const root = getCommonAncestor(sortedNodes[i - 1], sortedNodes[i]);
739 + if (root) {
740 + roots.add(root);
678 741 }
742 + }
743 + roots.forEach((root) => mutationObserver.observe(root, {
744 + childList: true
745 + }));
746 + }
747 + const flush = useStableCallback(() => {
748 + const [items, automaticNodes] = getCompositeListSnapshot(map);
749 + const nextMap = syncRefs(items);
750 + const previousItems = itemsRef.current;
751 + const changed = !previousItems || previousItems.length !== items.length || items.some((item, index2) => {
752 + const previousItem = previousItems[index2];
753 + return item.index !== previousItem.index || item.element !== previousItem.element || item.registration.index !== previousItem.registration.index || item.registration.metadata !== previousItem.registration.metadata;
679 754 });
680 - return () => {
681 - mutationObserver.disconnect();
682 - };
683 - }, [sortedMap]);
755 + observe(automaticNodes);
756 + itemsRef.current = items;
757 + isDirtyRef.current = false;
758 + if (!changed) {
759 + return;
760 + }
761 + listeners.forEach((listener) => listener(nextMap));
762 + onMapChange(nextMap);
763 + });
684 764 useIsoLayoutEffect(() => {
685 - const shouldUpdateLengths = lastTickRef.current === mapTick;
686 - if (shouldUpdateLengths) {
687 - if (elementsRef.current.length !== sortedMap.size) {
688 - elementsRef.current.length = sortedMap.size;
689 - }
690 - if (labelsRef && labelsRef.current.length !== sortedMap.size) {
691 - labelsRef.current.length = sortedMap.size;
692 - }
693 - nextIndexRef.current = sortedMap.size;
765 + if (!isDirtyRef.current && itemsRef.current) {
766 + syncRefs(itemsRef.current);
694 767 }
695 - onMapChange(sortedMap);
696 - }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]);
697 - useIsoLayoutEffect(() => {
698 768 return () => {
699 769 elementsRef.current = [];
770 + if (labelsRef) {
771 + labelsRef.current = [];
772 + }
700 773 };
701 - }, [elementsRef]);
774 + }, [elementsRef, labelsRef, syncRefs]);
702 775 useIsoLayoutEffect(() => {
776 + if (isDirtyRef.current) {
777 + flush();
778 + }
779 + });
780 + useIsoLayoutEffect(() => {
703 781 return () => {
704 - if (labelsRef) {
705 - labelsRef.current = [];
706 - }
782 + mutationObserverRef.current?.disconnect();
783 + isDirtyRef.current = true;
707 784 };
708 - }, [labelsRef]);
785 + }, []);
709 786 const subscribeMapChange = useStableCallback((fn) => {
710 787 listeners.add(fn);
711 788 return () => {
712 789 listeners.delete(fn);
@@ -711,20 +788,15 @@
711 788 return () => {
712 789 listeners.delete(fn);
713 790 };
714 791 });
715 - useIsoLayoutEffect(() => {
716 - listeners.forEach((l) => l(sortedMap));
717 - }, [listeners, sortedMap]);
718 792 const contextValue = React6.useMemo(() => ({
719 793 register,
720 794 unregister,
721 795 subscribeMapChange,
722 - elementsRef,
723 - labelsRef,
724 796 nextIndexRef
725 - }), [register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]);
726 - return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CompositeListContext.Provider, {
797 + }), [register, unregister, subscribeMapChange, nextIndexRef]);
798 + return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(CompositeListContext.Provider, {
727 799 value: contextValue,
728 800 children
729 801 });
730 802 }
@@ -733,34 +805,69 @@
733 805 }
734 806 function createListeners() {
735 807 return /* @__PURE__ */ new Set();
736 808 }
737 - function sortByDocumentPosition(a, b) {
738 - const position = a.compareDocumentPosition(b);
739 - if (position & Node.DOCUMENT_POSITION_FOLLOWING || position & Node.DOCUMENT_POSITION_CONTAINED_BY) {
740 - return -1;
809 + function getCompositeListSnapshot(map) {
810 + const reservedIndices = /* @__PURE__ */ new Set();
811 + const items = [];
812 + const automaticItems = [];
813 + map.forEach((registration, node) => {
814 + if (!node.isConnected) {
815 + return;
816 + }
817 + const index2 = registration.index;
818 + const item = {
819 + index: index2 ?? -1,
820 + element: node,
821 + registration
822 + };
823 + if (index2 === null) {
824 + automaticItems.push(item);
825 + } else if (index2 >= 0) {
826 + reservedIndices.add(index2);
827 + items.push(item);
828 + }
829 + });
830 + let nextAutomaticIndex = 0;
831 + automaticItems.sort((a, b) => sortByDocumentPosition(a.element, b.element));
832 + automaticItems.forEach((item) => {
833 + while (reservedIndices.has(nextAutomaticIndex)) {
834 + nextAutomaticIndex += 1;
835 + }
836 + item.index = nextAutomaticIndex;
837 + items.push(item);
838 + nextAutomaticIndex += 1;
839 + });
840 + if (reservedIndices.size > 0) {
841 + items.sort((a, b) => a.index - b.index);
741 842 }
742 - if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) {
743 - return 1;
843 + return [items, automaticItems.map((item) => item.element)];
844 + }
845 + function getCommonAncestor(firstNode, lastNode) {
846 + let ancestor = firstNode.parentElement;
847 + while (ancestor && !ancestor.contains(lastNode)) {
848 + ancestor = ancestor.parentElement;
744 849 }
745 - return 0;
850 + return ancestor;
746 851 }
747 - function disableEslintWarning(_) {
852 + function hasMovedNode(entries) {
853 + for (const entry of entries) {
854 + for (let i = 0; i < entry.removedNodes.length; i += 1) {
855 + if (entry.removedNodes[i].isConnected) {
856 + return true;
857 + }
858 + }
859 + }
860 + return false;
748 861 }
749 -
750 - // node_modules/@base-ui/react/esm/internals/direction-context/DirectionContext.js
751 - var React7 = __toESM(require_react(), 1);
752 - var DirectionContext = /* @__PURE__ */ React7.createContext(void 0);
753 - if (true) DirectionContext.displayName = "DirectionContext";
754 - function useDirection() {
755 - const context = React7.useContext(DirectionContext);
756 - return context?.direction ?? "ltr";
862 + function sortByDocumentPosition(a, b) {
863 + return a.compareDocumentPosition(b) & Node.DOCUMENT_POSITION_FOLLOWING ? -1 : 1;
757 864 }
758 865
759 - // node_modules/@base-ui/react/esm/internals/useRenderElement.js
760 - var React10 = __toESM(require_react(), 1);
866 + // node_modules/@base-ui/react/internals/useRenderElement.mjs
867 + var React9 = __toESM(require_react(), 1);
761 868
762 - // node_modules/@base-ui/utils/esm/useMergedRefs.js
869 + // node_modules/@base-ui/utils/useMergedRefs.mjs
763 870 function useMergedRefs(a, b, c, d) {
764 871 const forkRef = useRefWithInit(createForkRef).current;
765 872 if (didChange(forkRef, a, b, c, d)) {
766 873 update(forkRef, [a, b, c, d]);
@@ -784,9 +891,9 @@
784 891 function didChange(forkRef, a, b, c, d) {
785 892 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d;
786 893 }
787 894 function didChangeN(forkRef, newRefs) {
788 - return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]);
895 + return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]);
789 896 }
790 897 function update(forkRef, refs) {
791 898 forkRef.refs = refs;
792 899 if (refs.every((ref) => ref == null)) {
@@ -831,9 +938,9 @@
831 938 const cleanupCallback = cleanupCallbacks[i];
832 939 if (typeof cleanupCallback === "function") {
833 940 cleanupCallback();
834 941 } else {
835 - ref(null);
942 + void ref(null);
836 943 }
837 944 break;
838 945 }
839 946 case "object": {
@@ -847,21 +954,21 @@
847 954 }
848 955 };
849 956 }
850 957
851 - // node_modules/@base-ui/utils/esm/getReactElementRef.js
852 - var React9 = __toESM(require_react(), 1);
958 + // node_modules/@base-ui/utils/getReactElementRef.mjs
959 + var React8 = __toESM(require_react(), 1);
853 960
854 - // node_modules/@base-ui/utils/esm/reactVersion.js
855 - var React8 = __toESM(require_react(), 1);
856 - var majorVersion = parseInt(React8.version, 10);
961 + // node_modules/@base-ui/utils/reactVersion.mjs
962 + var React7 = __toESM(require_react(), 1);
963 + var majorVersion = parseInt(React7.version, 10);
857 964 function isReactVersionAtLeast(reactVersionToCheck) {
858 965 return majorVersion >= reactVersionToCheck;
859 966 }
860 967
861 - // node_modules/@base-ui/utils/esm/getReactElementRef.js
968 + // node_modules/@base-ui/utils/getReactElementRef.mjs
862 969 function getReactElementRef(element) {
863 - if (!/* @__PURE__ */ React9.isValidElement(element)) {
970 + if (!/* @__PURE__ */ React8.isValidElement(element)) {
864 971 return null;
865 972 }
866 973 const reactElement = element;
867 974 const propsWithRef = reactElement.props;
@@ -867,9 +974,9 @@
867 974 const propsWithRef = reactElement.props;
868 975 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null;
869 976 }
870 977
871 - // node_modules/@base-ui/utils/esm/mergeObjects.js
978 + // node_modules/@base-ui/utils/mergeObjects.mjs
872 979 function mergeObjects(a, b) {
873 980 if (a && !b) {
874 981 return a;
875 982 }
@@ -884,15 +991,9 @@
884 991 }
885 992 return void 0;
886 993 }
887 994
888 - // node_modules/@base-ui/utils/esm/empty.js
889 - function NOOP() {
890 - }
891 - var EMPTY_ARRAY = Object.freeze([]);
892 - var EMPTY_OBJECT = Object.freeze({});
893 -
894 - // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js
995 + // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs
895 996 function getStateAttributesProps(state, customMapping) {
896 997 const props = {};
897 998 for (const key in state) {
898 999 const value = state[key];
@@ -911,19 +1012,19 @@
911 1012 }
912 1013 return props;
913 1014 }
914 1015
915 - // node_modules/@base-ui/react/esm/utils/resolveClassName.js
1016 + // node_modules/@base-ui/react/utils/resolveClassName.mjs
916 1017 function resolveClassName(className, state) {
917 1018 return typeof className === "function" ? className(state) : className;
918 1019 }
919 1020
920 - // node_modules/@base-ui/react/esm/utils/resolveStyle.js
1021 + // node_modules/@base-ui/react/utils/resolveStyle.mjs
921 1022 function resolveStyle(style, state) {
922 1023 return typeof style === "function" ? style(state) : style;
923 1024 }
924 1025
925 - // node_modules/@base-ui/react/esm/merge-props/mergeProps.js
1026 + // node_modules/@base-ui/react/merge-props/mergeProps.mjs
926 1027 var EMPTY_PROPS = {};
927 1028 function mergeProps(a, b, c, d, e) {
928 1029 if (!c && !d && !e && !a) {
929 1030 return createInitialMergedProps(b);
@@ -1076,13 +1177,16 @@
1076 1177 function isSyntheticEvent(event) {
1077 1178 return event != null && typeof event === "object" && "nativeEvent" in event;
1078 1179 }
1079 1180
1080 - // node_modules/@base-ui/react/esm/internals/useRenderElement.js
1181 + // node_modules/@base-ui/react/internals/useRenderElement.mjs
1081 1182 var import_react = __toESM(require_react(), 1);
1082 1183 function useRenderElement(element, componentProps, params = {}) {
1083 - const renderProp = componentProps.render;
1084 - const outProps = useRenderElementProps(componentProps, params);
1184 + let renderProp = componentProps.render;
1185 + if (params.enabled !== false) {
1186 + renderProp = unwrapLazyRenderProp(renderProp);
1187 + }
1188 + const outProps = useRenderElementProps(componentProps, params, renderProp);
1085 1189 if (params.enabled === false) {
1086 1190 return null;
1087 1191 }
1088 1192 const state = params.state ?? EMPTY_OBJECT;
@@ -1087,29 +1191,28 @@
1087 1191 }
1088 1192 const state = params.state ?? EMPTY_OBJECT;
1089 1193 return evaluateRenderProp(element, renderProp, outProps, state);
1090 1194 }
1091 - function useRenderElementProps(componentProps, params = {}) {
1195 + function useRenderElementProps(componentProps, params, renderProp) {
1092 1196 const {
1093 1197 className: classNameProp,
1094 - style: styleProp,
1095 - render: renderProp
1198 + style: styleProp
1096 1199 } = componentProps;
1097 1200 const {
1098 1201 state = EMPTY_OBJECT,
1099 1202 ref,
1100 1203 props,
1101 - stateAttributesMapping: stateAttributesMapping3,
1204 + stateAttributesMapping: stateAttributesMapping4,
1102 1205 enabled = true
1103 1206 } = params;
1104 1207 const className = enabled ? resolveClassName(classNameProp, state) : void 0;
1105 1208 const style = enabled ? resolveStyle(styleProp, state) : void 0;
1106 - const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping3) : EMPTY_OBJECT;
1209 + const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping4) : EMPTY_OBJECT;
1107 1210 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0;
1108 1211 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT;
1109 1212 if (typeof document !== "undefined") {
1110 1213 if (!enabled) {
1111 - useMergedRefs(null, null);
1214 + void useMergedRefs(null, null);
1112 1215 } else if (Array.isArray(ref)) {
1113 1216 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]);
1114 1217 } else {
1115 1218 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref);
@@ -1134,8 +1237,15 @@
1134 1237 }
1135 1238 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy");
1136 1239 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/;
1137 1240 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/;
1241 + function unwrapLazyRenderProp(render) {
1242 + if (render?.$$typeof !== REACT_LAZY_TYPE) {
1243 + return render;
1244 + }
1245 + const unwrapped = React9.Children.toArray(render)[0];
1246 + return /* @__PURE__ */ React9.isValidElement(unwrapped) ? unwrapped : render;
1247 + }
1138 1248 function evaluateRenderProp(element, render, props, state) {
1139 1249 if (render) {
1140 1250 if (typeof render === "function") {
1141 1251 if (true) {
@@ -1144,19 +1254,14 @@
1144 1254 return render(props, state);
1145 1255 }
1146 1256 const mergedProps = mergeProps(props, render.props);
1147 1257 mergedProps.ref = props.ref;
1148 - let newElement = render;
1149 - if (newElement?.$$typeof === REACT_LAZY_TYPE) {
1150 - const children = React10.Children.toArray(render);
1151 - newElement = children[0];
1152 - }
1153 1258 if (true) {
1154 - if (!/* @__PURE__ */ React10.isValidElement(newElement)) {
1259 + if (!/* @__PURE__ */ React9.isValidElement(render)) {
1155 1260 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"));
1156 1261 }
1157 1262 }
1158 - return /* @__PURE__ */ React10.cloneElement(newElement, mergedProps);
1263 + return /* @__PURE__ */ React9.cloneElement(render, mergedProps);
1159 1264 }
1160 1265 if (element) {
1161 1266 if (typeof element === "string") {
1162 1267 return renderTag(element, props);
@@ -1191,12 +1296,40 @@
1191 1296 ...props,
1192 1297 key: props.key
1193 1298 });
1194 1299 }
1195 - return /* @__PURE__ */ React10.createElement(Tag, props);
1300 + return /* @__PURE__ */ React9.createElement(Tag, props);
1196 1301 }
1197 1302
1198 - // node_modules/@base-ui/react/esm/internals/reason-parts.js
1303 + // node_modules/@base-ui/utils/useId.mjs
1304 + var React10 = __toESM(require_react(), 1);
1305 + var globalId = 0;
1306 + function useGlobalId(idOverride, prefix = "mui") {
1307 + const [defaultId, setDefaultId] = React10.useState(idOverride);
1308 + const id = idOverride || defaultId;
1309 + React10.useEffect(() => {
1310 + if (defaultId == null) {
1311 + globalId += 1;
1312 + setDefaultId(`${prefix}-${globalId}`);
1313 + }
1314 + }, [defaultId, prefix]);
1315 + return id;
1316 + }
1317 + var maybeReactUseId = SafeReact.useId;
1318 + function useId(idOverride, prefix) {
1319 + if (maybeReactUseId !== void 0) {
1320 + const reactId = maybeReactUseId();
1321 + return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
1322 + }
1323 + return useGlobalId(idOverride, prefix);
1324 + }
1325 +
1326 + // node_modules/@base-ui/react/internals/useBaseUiId.mjs
1327 + function useBaseUiId(idOverride) {
1328 + return useId(idOverride, "base-ui");
1329 + }
1330 +
1331 + // node_modules/@base-ui/react/internals/reason-parts.mjs
1199 1332 var reason_parts_exports = {};
1200 1333 __export(reason_parts_exports, {
1201 1334 cancelOpen: () => cancelOpen,
1202 1335 chipRemovePress: () => chipRemovePress,
@@ -1269,9 +1402,9 @@
1269 1402 var imperativeAction = "imperative-action";
1270 1403 var swipe = "swipe";
1271 1404 var windowResize = "window-resize";
1272 1405
1273 - // node_modules/@base-ui/react/esm/internals/createBaseUIEventDetails.js
1406 + // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs
1274 1407 function createChangeEventDetails(reason, event, trigger, customProperties) {
1275 1408 let canceled = false;
1276 1409 let allowPropagation = false;
1277 1410 const custom = customProperties ?? EMPTY_OBJECT;
@@ -1295,48 +1428,19 @@
1295 1428 };
1296 1429 return details;
1297 1430 }
1298 1431
1299 - // node_modules/@base-ui/utils/esm/useId.js
1432 + // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1433 + var React12 = __toESM(require_react(), 1);
1434 +
1435 + // node_modules/@base-ui/utils/useOnMount.mjs
1300 1436 var React11 = __toESM(require_react(), 1);
1301 - var globalId = 0;
1302 - function useGlobalId(idOverride, prefix = "mui") {
1303 - const [defaultId, setDefaultId] = React11.useState(idOverride);
1304 - const id = idOverride || defaultId;
1305 - React11.useEffect(() => {
1306 - if (defaultId == null) {
1307 - globalId += 1;
1308 - setDefaultId(`${prefix}-${globalId}`);
1309 - }
1310 - }, [defaultId, prefix]);
1311 - return id;
1312 - }
1313 - var maybeReactUseId = SafeReact.useId;
1314 - function useId(idOverride, prefix) {
1315 - if (maybeReactUseId !== void 0) {
1316 - const reactId = maybeReactUseId();
1317 - return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId);
1318 - }
1319 - return useGlobalId(idOverride, prefix);
1320 - }
1321 -
1322 - // node_modules/@base-ui/react/esm/internals/useBaseUiId.js
1323 - function useBaseUiId(idOverride) {
1324 - return useId(idOverride, "base-ui");
1325 - }
1326 -
1327 - // node_modules/@base-ui/react/esm/internals/useTransitionStatus.js
1328 - var React13 = __toESM(require_react(), 1);
1329 -
1330 - // node_modules/@base-ui/utils/esm/useOnMount.js
1331 - var React12 = __toESM(require_react(), 1);
1332 - var EMPTY = [];
1333 1437 function useOnMount(fn) {
1334 - React12.useEffect(fn, EMPTY);
1438 + React11.useEffect(fn, EMPTY_ARRAY);
1335 1439 }
1336 1440
1337 - // node_modules/@base-ui/utils/esm/useAnimationFrame.js
1338 - var EMPTY2 = null;
1441 + // node_modules/@base-ui/utils/useAnimationFrame.mjs
1442 + var EMPTY = null;
1339 1443 var LAST_RAF = globalThis.requestAnimationFrame;
1340 1444 var Scheduler = class {
1341 1445 /* This implementation uses an array as a backing data-structure for frame callbacks.
1342 1446 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
@@ -1375,13 +1479,16 @@
1375 1479 }
1376 1480 return id;
1377 1481 }
1378 1482 cancel(id) {
1379 - const index = id - this.startId;
1380 - if (index < 0 || index >= this.callbacks.length) {
1483 + const index2 = id - this.startId;
1484 + if (index2 < 0 || index2 >= this.callbacks.length) {
1381 1485 return;
1382 1486 }
1383 - this.callbacks[index] = null;
1487 + if (this.callbacks[index2] === null) {
1488 + return;
1489 + }
1490 + this.callbacks[index2] = null;
1384 1491 this.callbacksCount -= 1;
1385 1492 }
1386 1493 };
1387 1494 var scheduler = new Scheduler();
@@ -1394,9 +1501,9 @@
1394 1501 }
1395 1502 static cancel(id) {
1396 1503 return scheduler.cancel(id);
1397 1504 }
1398 - currentId = EMPTY2;
1505 + currentId = EMPTY;
1399 1506 /**
1400 1507 * Executes `fn` after `delay`, clearing any previously scheduled call.
1401 1508 */
1402 1509 request(fn) {
@@ -1401,16 +1508,16 @@
1401 1508 */
1402 1509 request(fn) {
1403 1510 this.cancel();
1404 1511 this.currentId = scheduler.request(() => {
1405 - this.currentId = EMPTY2;
1512 + this.currentId = EMPTY;
1406 1513 fn();
1407 1514 });
1408 1515 }
1409 1516 cancel = () => {
1410 - if (this.currentId !== EMPTY2) {
1517 + if (this.currentId !== EMPTY) {
1411 1518 scheduler.cancel(this.currentId);
1412 - this.currentId = EMPTY2;
1519 + this.currentId = EMPTY;
1413 1520 }
1414 1521 };
1415 1522 disposeEffect = () => {
1416 1523 return this.cancel;
@@ -1421,12 +1528,12 @@
1421 1528 useOnMount(timeout.disposeEffect);
1422 1529 return timeout;
1423 1530 }
1424 1531
1425 - // node_modules/@base-ui/react/esm/internals/useTransitionStatus.js
1426 - function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) {
1427 - const [transitionStatus, setTransitionStatus] = React13.useState(open && enableIdleState ? "idle" : void 0);
1428 - const [mounted, setMounted] = React13.useState(open);
1532 + // node_modules/@base-ui/react/internals/useTransitionStatus.mjs
1533 + function useTransitionStatus(open, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) {
1534 + const [transitionStatus, setTransitionStatus] = React12.useState(open && enableIdleState ? "idle" : void 0);
1535 + const [mounted, setMounted] = React12.useState(open && !animateInitialOpen);
1429 1536 if (open && !mounted) {
1430 1537 setMounted(true);
1431 1538 setTransitionStatus("starting");
1432 1539 }
@@ -1478,21 +1585,16 @@
1478 1585 transitionStatus
1479 1586 };
1480 1587 }
1481 1588
1482 - // node_modules/@base-ui/react/esm/internals/composite/list/useCompositeListItem.js
1483 - var React14 = __toESM(require_react(), 1);
1484 - var IndexGuessBehavior = /* @__PURE__ */ (function(IndexGuessBehavior2) {
1485 - IndexGuessBehavior2[IndexGuessBehavior2["None"] = 0] = "None";
1486 - IndexGuessBehavior2[IndexGuessBehavior2["GuessFromOrder"] = 1] = "GuessFromOrder";
1487 - return IndexGuessBehavior2;
1488 - })({});
1589 + // node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs
1590 + var React13 = __toESM(require_react(), 1);
1489 1591 function useCompositeListItem(params = {}) {
1490 1592 const {
1593 + guess,
1491 1594 label,
1492 1595 metadata,
1493 1596 textRef,
1494 - indexGuessBehavior,
1495 1597 index: externalIndex
1496 1598 } = params;
1497 1599 const {
1498 1600 register,
@@ -1497,14 +1599,12 @@
1497 1599 const {
1498 1600 register,
1499 1601 unregister,
1500 1602 subscribeMapChange,
1501 - elementsRef,
1502 - labelsRef,
1503 1603 nextIndexRef
1504 1604 } = useCompositeListContext();
1505 - const indexRef = React14.useRef(-1);
1506 - const [index, setIndex] = React14.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => {
1605 + const indexRef = React13.useRef(-1);
1606 + const [internalIndex, setInternalIndex] = React13.useState(externalIndex == null && guess ? () => {
1507 1607 if (indexRef.current === -1) {
1508 1608 const newIndex = nextIndexRef.current;
1509 1609 nextIndexRef.current += 1;
1510 1610 indexRef.current = newIndex;
@@ -1509,33 +1609,26 @@
1509 1609 nextIndexRef.current += 1;
1510 1610 indexRef.current = newIndex;
1511 1611 }
1512 1612 return indexRef.current;
1513 - } : -1));
1514 - const componentRef = React14.useRef(null);
1515 - const ref = React14.useCallback((node) => {
1613 + } : -1);
1614 + const index2 = externalIndex ?? internalIndex;
1615 + const componentRef = React13.useRef(null);
1616 + const ref = React13.useCallback((node) => {
1617 + const previousNode = componentRef.current;
1618 + if (previousNode) {
1619 + unregister(previousNode);
1620 + }
1516 1621 componentRef.current = node;
1517 - if (index !== -1 && node !== null) {
1518 - elementsRef.current[index] = node;
1519 - if (labelsRef) {
1520 - const isLabelDefined = label !== void 0;
1521 - labelsRef.current[index] = isLabelDefined ? label : textRef?.current?.textContent ?? node.textContent;
1522 - }
1523 - }
1524 - }, [index, elementsRef, labelsRef, label, textRef]);
1525 - useIsoLayoutEffect(() => {
1526 - if (externalIndex != null) {
1527 - return void 0;
1528 - }
1529 - const node = componentRef.current;
1530 1622 if (node) {
1531 - register(node, metadata);
1532 - return () => {
1533 - unregister(node);
1534 - };
1623 + register(node, {
1624 + metadata: metadata ?? null,
1625 + index: externalIndex ?? null,
1626 + label,
1627 + textRef
1628 + });
1535 1629 }
1536 - return void 0;
1537 - }, [externalIndex, register, unregister, metadata]);
1630 + }, [externalIndex, register, unregister, metadata, label, textRef]);
1538 1631 useIsoLayoutEffect(() => {
1539 1632 if (externalIndex != null) {
1540 1633 return void 0;
1541 1634 }
@@ -1541,29 +1634,33 @@
1541 1634 }
1542 1635 return subscribeMapChange((map) => {
1543 1636 const i = componentRef.current ? map.get(componentRef.current)?.index : null;
1544 1637 if (i != null) {
1545 - setIndex(i);
1638 + setInternalIndex(i);
1546 1639 }
1547 1640 });
1548 - }, [externalIndex, subscribeMapChange, setIndex]);
1549 - return React14.useMemo(() => ({
1641 + }, [externalIndex, subscribeMapChange]);
1642 + return {
1550 1643 ref,
1551 - index
1552 - }), [index, ref]);
1644 + index: index2
1645 + };
1553 1646 }
1554 1647
1555 - // node_modules/@base-ui/react/esm/internals/stateAttributesMapping.js
1556 - var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) {
1557 - TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style";
1558 - TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style";
1559 - return TransitionStatusDataAttributes2;
1560 - })({});
1648 + // node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs
1649 + var TransitionStatusDataAttributes_exports = {};
1650 + __export(TransitionStatusDataAttributes_exports, {
1651 + endingStyle: () => endingStyle,
1652 + startingStyle: () => startingStyle
1653 + });
1654 + var startingStyle = "data-starting-style";
1655 + var endingStyle = "data-ending-style";
1656 +
1657 + // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs
1561 1658 var STARTING_HOOK = {
1562 - [TransitionStatusDataAttributes.startingStyle]: ""
1659 + [startingStyle]: ""
1563 1660 };
1564 1661 var ENDING_HOOK = {
1565 - [TransitionStatusDataAttributes.endingStyle]: ""
1662 + [endingStyle]: ""
1566 1663 };
1567 1664 var transitionStatusMapping = {
1568 1665 transitionStatus(value) {
1569 1666 if (value === "starting") {
@@ -1575,24 +1672,35 @@
1575 1672 return null;
1576 1673 }
1577 1674 };
1578 1675
1579 - // node_modules/@base-ui/utils/esm/isElementDisabled.js
1580 - function isElementDisabled(element) {
1581 - return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
1582 - }
1676 + // node_modules/@base-ui/react/internals/use-button/useButton.mjs
1677 + var React16 = __toESM(require_react(), 1);
1583 1678
1584 - // node_modules/@base-ui/react/esm/internals/use-button/useButton.js
1585 - var React17 = __toESM(require_react(), 1);
1586 -
1587 1679 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs
1588 1680 function hasWindow() {
1589 1681 return typeof window !== "undefined";
1590 1682 }
1683 + function getNodeName(node) {
1684 + if (isNode(node)) {
1685 + return (node.nodeName || "").toLowerCase();
1686 + }
1687 + return "#document";
1688 + }
1591 1689 function getWindow(node) {
1592 1690 var _node$ownerDocument;
1593 1691 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;
1594 1692 }
1693 + function getDocumentElement(node) {
1694 + var _ref;
1695 + return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;
1696 + }
1697 + function isNode(value) {
1698 + if (!hasWindow()) {
1699 + return false;
1700 + }
1701 + return value instanceof Node || value instanceof getWindow(value).Node;
1702 + }
1595 1703 function isHTMLElement(value) {
1596 1704 if (!hasWindow()) {
1597 1705 return false;
1598 1706 }
@@ -1603,18 +1711,34 @@
1603 1711 return false;
1604 1712 }
1605 1713 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;
1606 1714 }
1715 + function isLastTraversableNode(node) {
1716 + return /^(html|body|#document)$/.test(getNodeName(node));
1717 + }
1607 1718 function getComputedStyle2(element) {
1608 1719 return getWindow(element).getComputedStyle(element);
1609 1720 }
1721 + function getParentNode(node) {
1722 + if (getNodeName(node) === "html") {
1723 + return node;
1724 + }
1725 + const result = (
1726 + // Step into the shadow DOM of the parent of a slotted node.
1727 + node.assignedSlot || // DOM Element detected.
1728 + node.parentNode || // ShadowRoot detected.
1729 + isShadowRoot(node) && node.host || // Fallback.
1730 + getDocumentElement(node)
1731 + );
1732 + return isShadowRoot(result) ? result.host : result;
1733 + }
1610 1734
1611 - // node_modules/@base-ui/react/esm/internals/composite/root/CompositeRootContext.js
1612 - var React15 = __toESM(require_react(), 1);
1613 - var CompositeRootContext = /* @__PURE__ */ React15.createContext(void 0);
1735 + // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs
1736 + var React14 = __toESM(require_react(), 1);
1737 + var CompositeRootContext = /* @__PURE__ */ React14.createContext(void 0);
1614 1738 if (true) CompositeRootContext.displayName = "CompositeRootContext";
1615 1739 function useCompositeRootContext(optional = false) {
1616 - const context = React15.useContext(CompositeRootContext);
1740 + const context = React14.useContext(CompositeRootContext);
1617 1741 if (context === void 0 && !optional) {
1618 1742 throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16));
1619 1743 }
1620 1744 return context;
@@ -1619,10 +1743,10 @@
1619 1743 }
1620 1744 return context;
1621 1745 }
1622 1746
1623 - // node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js
1624 - var React16 = __toESM(require_react(), 1);
1747 + // node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs
1748 + var React15 = __toESM(require_react(), 1);
1625 1749 function useFocusableWhenDisabled(parameters) {
1626 1750 const {
1627 1751 focusableWhenDisabled,
1628 1752 disabled: disabled2,
@@ -1631,9 +1755,9 @@
1631 1755 isNativeButton
1632 1756 } = parameters;
1633 1757 const isFocusableComposite = composite && focusableWhenDisabled !== false;
1634 1758 const isNonFocusableComposite = composite && focusableWhenDisabled === false;
1635 - const props = React16.useMemo(() => {
1759 + const props = React15.useMemo(() => {
1636 1760 const additionalProps = {
1637 1761 // allow Tabbing away from focusableWhenDisabled elements
1638 1762 onKeyDown(event) {
1639 1763 if (disabled2 && focusableWhenDisabled && event.key !== "Tab") {
@@ -1659,9 +1783,30 @@
1659 1783 props
1660 1784 };
1661 1785 }
1662 1786
1663 - // node_modules/@base-ui/react/esm/internals/use-button/useButton.js
1787 + // node_modules/@base-ui/utils/owner.mjs
1788 + function ownerDocument(node) {
1789 + return node?.ownerDocument || document;
1790 + }
1791 +
1792 + // node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs
1793 + function dispatchClickWithModifiers(target, sourceEvent, {
1794 + detail = 0
1795 + } = {}) {
1796 + target.dispatchEvent(new (getWindow(target)).PointerEvent("click", {
1797 + bubbles: true,
1798 + cancelable: true,
1799 + composed: true,
1800 + detail,
1801 + shiftKey: sourceEvent.shiftKey,
1802 + ctrlKey: sourceEvent.ctrlKey,
1803 + altKey: sourceEvent.altKey,
1804 + metaKey: sourceEvent.metaKey
1805 + }));
1806 + }
1807 +
1808 + // node_modules/@base-ui/react/internals/use-button/useButton.mjs
1664 1809 function useButton(parameters = {}) {
1665 1810 const {
1666 1811 disabled: disabled2 = false,
1667 1812 focusableWhenDisabled,
@@ -1668,9 +1813,9 @@
1668 1813 tabIndex = 0,
1669 1814 native: isNativeButton = true,
1670 1815 composite: compositeProp
1671 1816 } = parameters;
1672 - const elementRef = React17.useRef(null);
1817 + const elementRef = React16.useRef(null);
1673 1818 const compositeRootContext = useCompositeRootContext(true);
1674 1819 const isCompositeItem = compositeProp ?? compositeRootContext !== void 0;
1675 1820 const {
1676 1821 props: focusableWhenDisabledProps
@@ -1681,9 +1826,9 @@
1681 1826 tabIndex,
1682 1827 isNativeButton
1683 1828 });
1684 1829 if (true) {
1685 - React17.useEffect(() => {
1830 + React16.useEffect(() => {
1686 1831 if (!elementRef.current) {
1687 1832 return;
1688 1833 }
1689 1834 const isButtonTag = isButtonElement(elementRef.current);
@@ -1699,9 +1844,9 @@
1699 1844 error(`${message}${ownerStackMessage}`);
1700 1845 }
1701 1846 }, [isNativeButton]);
1702 1847 }
1703 - const updateDisabled = React17.useCallback(() => {
1848 + const updateDisabled = React16.useCallback(() => {
1704 1849 const element = elementRef.current;
1705 1850 if (!isButtonElement(element)) {
1706 1851 return;
1707 1852 }
@@ -1709,9 +1854,9 @@
1709 1854 element.disabled = false;
1710 1855 }
1711 1856 }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]);
1712 1857 useIsoLayoutEffect(updateDisabled, [updateDisabled]);
1713 - const getButtonProps = React17.useCallback((externalProps = {}) => {
1858 + const getButtonProps = React16.useCallback((externalProps = {}) => {
1714 1859 const {
1715 1860 onClick: externalOnClick,
1716 1861 onMouseDown: externalOnMouseDown,
1717 1862 onKeyUp: externalOnKeyUp,
@@ -1754,25 +1899,28 @@
1754 1899 if (event.defaultPrevented && isTextNavigationRole) {
1755 1900 return;
1756 1901 }
1757 1902 event.preventDefault();
1758 - if (isLink || isNativeButton && isButton) {
1759 - currentTarget.click();
1903 + if (!isNativeButton || isButton) {
1760 1904 event.preventBaseUIHandler();
1761 - } else if (shouldClick) {
1762 - externalOnClick?.(event);
1763 - event.preventBaseUIHandler();
1905 + dispatchClickWithModifiers(currentTarget, event);
1764 1906 }
1765 1907 return;
1766 1908 }
1767 - if (shouldClick) {
1768 - if (!isNativeButton && (isSpaceKey || isEnterKey)) {
1909 + if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) {
1910 + if (isCurrentTarget && isLink && isSpaceKey) {
1769 1911 event.preventDefault();
1770 1912 }
1771 - if (!isNativeButton && isEnterKey) {
1772 - externalOnClick?.(event);
1773 - }
1913 + return;
1774 1914 }
1915 + if (event.defaultPrevented) {
1916 + return;
1917 + }
1918 + event.preventDefault();
1919 + if (isEnterKey) {
1920 + event.preventBaseUIHandler();
1921 + dispatchClickWithModifiers(currentTarget, event);
1922 + }
1775 1923 },
1776 1924 onKeyUp(event) {
1777 1925 if (disabled2) {
1778 1926 return;
@@ -1785,10 +1933,11 @@
1785 1933 }
1786 1934 if (event.baseUIHandlerPrevented) {
1787 1935 return;
1788 1936 }
1789 - if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === " ") {
1790 - externalOnClick?.(event);
1937 + if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") {
1938 + event.preventBaseUIHandler();
1939 + dispatchClickWithModifiers(event.currentTarget, event);
1791 1940 }
1792 1941 },
1793 1942 onPointerDown(event) {
1794 1943 if (disabled2) {
@@ -1815,18 +1964,168 @@
1815 1964 function isButtonElement(elem) {
1816 1965 return isHTMLElement(elem) && elem.tagName === "BUTTON";
1817 1966 }
1818 1967 function isValidLinkElement(elem) {
1819 - return Boolean(elem?.tagName === "A" && elem?.href);
1968 + return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href);
1820 1969 }
1821 1970
1822 - // node_modules/@base-ui/react/esm/floating-ui-react/utils/constants.js
1823 - var ARROW_LEFT = "ArrowLeft";
1824 - var ARROW_RIGHT = "ArrowRight";
1825 - var ARROW_UP = "ArrowUp";
1826 - var ARROW_DOWN = "ArrowDown";
1971 + // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
1972 + var React17 = __toESM(require_react(), 1);
1827 1973
1828 - // node_modules/@base-ui/react/esm/internals/shadowDom.js
1974 + // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1975 + var ReactDOM = __toESM(require_react_dom(), 1);
1976 +
1977 + // node_modules/@base-ui/react/utils/resolveRef.mjs
1978 + function resolveRef(maybeRef) {
1979 + if (maybeRef == null) {
1980 + return maybeRef;
1981 + }
1982 + return "current" in maybeRef ? maybeRef.current : maybeRef;
1983 + }
1984 +
1985 + // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs
1986 + var pendingCallbacks = null;
1987 + function flushBeforePaint(fn) {
1988 + if (!pendingCallbacks) {
1989 + const callbacks = [];
1990 + pendingCallbacks = callbacks;
1991 + queueMicrotask(() => {
1992 + pendingCallbacks = null;
1993 + ReactDOM.flushSync(() => {
1994 + for (const callback of callbacks) {
1995 + callback();
1996 + }
1997 + });
1998 + });
1999 + }
2000 + pendingCallbacks.push(fn);
2001 + }
2002 + function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) {
2003 + const frame = useAnimationFrame();
2004 + return useStableCallback((fnToExecute, signal = null) => {
2005 + frame.cancel();
2006 + const element = resolveRef(elementOrRef);
2007 + if (element == null) {
2008 + return;
2009 + }
2010 + const resolvedElement = element;
2011 + const done = () => {
2012 + if (!batch) {
2013 + ReactDOM.flushSync(fnToExecute);
2014 + return;
2015 + }
2016 + flushBeforePaint(() => {
2017 + if (!signal?.aborted) {
2018 + fnToExecute();
2019 + }
2020 + });
2021 + };
2022 + if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
2023 + fnToExecute();
2024 + return;
2025 + }
2026 + function exec() {
2027 + Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => {
2028 + if (!signal?.aborted) {
2029 + done();
2030 + }
2031 + }, () => {
2032 + if (signal?.aborted) {
2033 + return;
2034 + }
2035 + const currentAnimations = resolvedElement.getAnimations();
2036 + if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
2037 + exec();
2038 + return;
2039 + }
2040 + done();
2041 + });
2042 + }
2043 + if (waitForStartingStyleRemoved) {
2044 + const startingStyleAttribute = startingStyle;
2045 + if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
2046 + frame.request(exec);
2047 + return;
2048 + }
2049 + const attributeObserver = new MutationObserver(() => {
2050 + if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
2051 + attributeObserver.disconnect();
2052 + exec();
2053 + }
2054 + });
2055 + attributeObserver.observe(resolvedElement, {
2056 + attributes: true,
2057 + attributeFilter: [startingStyleAttribute]
2058 + });
2059 + signal?.addEventListener("abort", () => attributeObserver.disconnect(), {
2060 + once: true
2061 + });
2062 + return;
2063 + }
2064 + frame.request(exec);
2065 + });
2066 + }
2067 +
2068 + // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs
2069 + function useOpenChangeComplete(parameters) {
2070 + const {
2071 + enabled = true,
2072 + open,
2073 + ref,
2074 + batch = false,
2075 + onComplete: onCompleteParam
2076 + } = parameters;
2077 + const onComplete = useStableCallback(onCompleteParam);
2078 + const runOnceAnimationsFinish = useAnimationsFinished(ref, open, batch);
2079 + React17.useEffect(() => {
2080 + if (!enabled) {
2081 + return void 0;
2082 + }
2083 + const abortController = new AbortController();
2084 + runOnceAnimationsFinish(onComplete, abortController.signal);
2085 + return () => {
2086 + abortController.abort();
2087 + };
2088 + }, [enabled, open, onComplete, runOnceAnimationsFinish]);
2089 + }
2090 +
2091 + // node_modules/@base-ui/utils/useTimeout.mjs
2092 + var EMPTY2 = 0;
2093 + var Timeout = class _Timeout {
2094 + static create() {
2095 + return new _Timeout();
2096 + }
2097 + currentId = EMPTY2;
2098 + /**
2099 + * Executes `fn` after `delay`, clearing any previously scheduled call.
2100 + */
2101 + start(delay, fn) {
2102 + this.clear();
2103 + this.currentId = setTimeout(() => {
2104 + this.currentId = EMPTY2;
2105 + fn();
2106 + }, delay);
2107 + }
2108 + isStarted() {
2109 + return this.currentId !== EMPTY2;
2110 + }
2111 + clear = () => {
2112 + if (this.currentId !== EMPTY2) {
2113 + clearTimeout(this.currentId);
2114 + this.currentId = EMPTY2;
2115 + }
2116 + };
2117 + disposeEffect = () => {
2118 + return this.clear;
2119 + };
2120 + };
2121 + function useTimeout() {
2122 + const timeout = useRefWithInit(Timeout.create).current;
2123 + useOnMount(timeout.disposeEffect);
2124 + return timeout;
2125 + }
2126 +
2127 + // node_modules/@base-ui/utils/shadowDom.mjs
1829 2128 function activeElement(doc) {
1830 2129 let element = doc.activeElement;
1831 2130 while (element?.shadowRoot?.activeElement != null) {
1832 2131 element = element.shadowRoot.activeElement;
@@ -1853,30 +2152,20 @@
1853 2152 return false;
1854 2153 }
1855 2154 function getTarget(event) {
1856 2155 if ("composedPath" in event) {
1857 - return event.composedPath()[0];
2156 + return event.composedPath()[0] ?? event.target;
1858 2157 }
1859 2158 return event.target;
1860 2159 }
1861 2160
1862 - // node_modules/@base-ui/react/esm/floating-ui-react/utils/event.js
1863 - function stopEvent(event) {
1864 - event.preventDefault();
1865 - event.stopPropagation();
1866 - }
1867 -
1868 2161 // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs
1869 2162 var round = Math.round;
1870 - var floor = Math.floor;
1871 2163
1872 - // node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js
1873 - function isDifferentGridRow(index, cols, prevRow) {
1874 - return Math.floor(index / cols) !== prevRow;
2164 + // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs
2165 + function isIndexOutOfListBounds(list, index2) {
2166 + return index2 < 0 || index2 >= list.length;
1875 2167 }
1876 - function isIndexOutOfListBounds(list, index) {
1877 - return index < 0 || index >= list.length;
1878 - }
1879 2168 function getMinListIndex(listRef, disabledIndices) {
1880 2169 return findNonDisabledListIndex(listRef.current, {
1881 2170 disabledIndices
1882 2171 });
@@ -1893,330 +2182,20 @@
1893 2182 decrement = false,
1894 2183 disabledIndices,
1895 2184 amount = 1
1896 2185 } = {}) {
1897 - let index = startingIndex;
2186 + let index2 = startingIndex;
1898 2187 do {
1899 - index += decrement ? -amount : amount;
1900 - } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices));
1901 - return index;
2188 + index2 += decrement ? -amount : amount;
2189 + } while (index2 >= 0 && index2 <= list.length - 1 && isListIndexDisabled(list, index2, disabledIndices));
2190 + return index2;
1902 2191 }
1903 - function getGridNavigatedIndex(list, {
1904 - event,
1905 - orientation,
1906 - loopFocus,
1907 - onLoop,
1908 - rtl,
1909 - cols,
1910 - disabledIndices,
1911 - minIndex,
1912 - maxIndex,
1913 - prevIndex,
1914 - stopEvent: stop = false
1915 - }) {
1916 - let nextIndex = prevIndex;
1917 - let verticalDirection;
1918 - if (event.key === ARROW_UP) {
1919 - verticalDirection = "up";
1920 - } else if (event.key === ARROW_DOWN) {
1921 - verticalDirection = "down";
1922 - }
1923 - if (verticalDirection) {
1924 - const rows = [];
1925 - const rowIndexMap = [];
1926 - let hasRoleRow = false;
1927 - let visibleItemCount = 0;
1928 - {
1929 - let currentRowEl = null;
1930 - let currentRowIndex = -1;
1931 - list.forEach((el, idx) => {
1932 - if (el == null) {
1933 - return;
1934 - }
1935 - visibleItemCount += 1;
1936 - const rowEl = el.closest('[role="row"]');
1937 - if (rowEl) {
1938 - hasRoleRow = true;
1939 - }
1940 - if (rowEl !== currentRowEl || currentRowIndex === -1) {
1941 - currentRowEl = rowEl;
1942 - currentRowIndex += 1;
1943 - rows[currentRowIndex] = [];
1944 - }
1945 - rows[currentRowIndex].push(idx);
1946 - rowIndexMap[idx] = currentRowIndex;
1947 - });
1948 - }
1949 - let hasDomRows = false;
1950 - let inferredDomCols = 0;
1951 - if (hasRoleRow) {
1952 - for (const row of rows) {
1953 - const rowLength = row.length;
1954 - if (rowLength > inferredDomCols) {
1955 - inferredDomCols = rowLength;
1956 - }
1957 - if (rowLength !== cols) {
1958 - hasDomRows = true;
1959 - }
1960 - }
1961 - }
1962 - const hasVirtualizedGaps = hasDomRows && visibleItemCount < list.length;
1963 - const verticalCols = inferredDomCols || cols;
1964 - const navigateVertically = (direction) => {
1965 - if (!hasDomRows || prevIndex === -1) {
1966 - return void 0;
1967 - }
1968 - const currentRow = rowIndexMap[prevIndex];
1969 - if (currentRow == null) {
1970 - return void 0;
1971 - }
1972 - const colInRow = rows[currentRow].indexOf(prevIndex);
1973 - const step = direction === "up" ? -1 : 1;
1974 - for (let nextRow = currentRow + step, i = 0; i < rows.length; i += 1, nextRow += step) {
1975 - if (nextRow < 0 || nextRow >= rows.length) {
1976 - if (!loopFocus || hasVirtualizedGaps) {
1977 - return void 0;
1978 - }
1979 - nextRow = nextRow < 0 ? rows.length - 1 : 0;
1980 - if (onLoop) {
1981 - const clampedCol = Math.min(colInRow, rows[nextRow].length - 1);
1982 - const targetItemIndex = rows[nextRow][clampedCol] ?? rows[nextRow][0];
1983 - const returnedItemIndex = onLoop(event, prevIndex, targetItemIndex);
1984 - nextRow = rowIndexMap[returnedItemIndex] ?? nextRow;
1985 - }
1986 - }
1987 - const targetRow = rows[nextRow];
1988 - for (let col = Math.min(colInRow, targetRow.length - 1); col >= 0; col -= 1) {
1989 - const candidate = targetRow[col];
1990 - if (!isListIndexDisabled(list, candidate, disabledIndices)) {
1991 - return candidate;
1992 - }
1993 - }
1994 - }
1995 - return void 0;
1996 - };
1997 - const navigateVerticallyWithInferredRows = (direction) => {
1998 - if (!hasVirtualizedGaps || prevIndex === -1) {
1999 - return void 0;
2000 - }
2001 - const colInRow = prevIndex % verticalCols;
2002 - const rowStep = direction === "up" ? -verticalCols : verticalCols;
2003 - const lastRowStart = maxIndex - maxIndex % verticalCols;
2004 - const rowCount = floor(maxIndex / verticalCols) + 1;
2005 - for (let rowStart = prevIndex - colInRow + rowStep, i = 0; i < rowCount; i += 1, rowStart += rowStep) {
2006 - if (rowStart < 0 || rowStart > maxIndex) {
2007 - if (!loopFocus) {
2008 - return void 0;
2009 - }
2010 - rowStart = rowStart < 0 ? lastRowStart : 0;
2011 - }
2012 - const rowEnd = Math.min(rowStart + verticalCols - 1, maxIndex);
2013 - for (let candidate = Math.min(rowStart + colInRow, rowEnd); candidate >= rowStart; candidate -= 1) {
2014 - if (!isListIndexDisabled(list, candidate, disabledIndices)) {
2015 - return candidate;
2016 - }
2017 - }
2018 - }
2019 - return void 0;
2020 - };
2021 - if (stop) {
2022 - stopEvent(event);
2023 - }
2024 - const verticalCandidate = navigateVertically(verticalDirection) ?? navigateVerticallyWithInferredRows(verticalDirection);
2025 - if (verticalCandidate !== void 0) {
2026 - nextIndex = verticalCandidate;
2027 - } else if (prevIndex === -1) {
2028 - nextIndex = verticalDirection === "up" ? maxIndex : minIndex;
2029 - } else {
2030 - nextIndex = findNonDisabledListIndex(list, {
2031 - startingIndex: prevIndex,
2032 - amount: verticalCols,
2033 - decrement: verticalDirection === "up",
2034 - disabledIndices
2035 - });
2036 - if (loopFocus) {
2037 - if (verticalDirection === "up" && (prevIndex - verticalCols < minIndex || nextIndex < 0)) {
2038 - const col = prevIndex % verticalCols;
2039 - const maxCol = maxIndex % verticalCols;
2040 - const offset = maxIndex - (maxCol - col);
2041 - if (maxCol === col) {
2042 - nextIndex = maxIndex;
2043 - } else {
2044 - nextIndex = maxCol > col ? offset : offset - verticalCols;
2045 - }
2046 - if (onLoop) {
2047 - nextIndex = onLoop(event, prevIndex, nextIndex);
2048 - }
2049 - }
2050 - if (verticalDirection === "down" && prevIndex + verticalCols > maxIndex) {
2051 - nextIndex = findNonDisabledListIndex(list, {
2052 - startingIndex: prevIndex % verticalCols - verticalCols,
2053 - amount: verticalCols,
2054 - disabledIndices
2055 - });
2056 - if (onLoop) {
2057 - nextIndex = onLoop(event, prevIndex, nextIndex);
2058 - }
2059 - }
2060 - }
2061 - }
2062 - if (isIndexOutOfListBounds(list, nextIndex)) {
2063 - nextIndex = prevIndex;
2064 - }
2065 - }
2066 - if (orientation === "both") {
2067 - const prevRow = floor(prevIndex / cols);
2068 - if (event.key === (rtl ? ARROW_LEFT : ARROW_RIGHT)) {
2069 - if (stop) {
2070 - stopEvent(event);
2071 - }
2072 - if (prevIndex % cols !== cols - 1) {
2073 - nextIndex = findNonDisabledListIndex(list, {
2074 - startingIndex: prevIndex,
2075 - disabledIndices
2076 - });
2077 - if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
2078 - nextIndex = findNonDisabledListIndex(list, {
2079 - startingIndex: prevIndex - prevIndex % cols - 1,
2080 - disabledIndices
2081 - });
2082 - if (onLoop) {
2083 - nextIndex = onLoop(event, prevIndex, nextIndex);
2084 - }
2085 - }
2086 - } else if (loopFocus) {
2087 - nextIndex = findNonDisabledListIndex(list, {
2088 - startingIndex: prevIndex - prevIndex % cols - 1,
2089 - disabledIndices
2090 - });
2091 - if (onLoop) {
2092 - nextIndex = onLoop(event, prevIndex, nextIndex);
2093 - }
2094 - }
2095 - if (isDifferentGridRow(nextIndex, cols, prevRow)) {
2096 - nextIndex = prevIndex;
2097 - }
2098 - }
2099 - if (event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT)) {
2100 - if (stop) {
2101 - stopEvent(event);
2102 - }
2103 - if (prevIndex % cols !== 0) {
2104 - nextIndex = findNonDisabledListIndex(list, {
2105 - startingIndex: prevIndex,
2106 - decrement: true,
2107 - disabledIndices
2108 - });
2109 - if (loopFocus && isDifferentGridRow(nextIndex, cols, prevRow)) {
2110 - nextIndex = findNonDisabledListIndex(list, {
2111 - startingIndex: prevIndex + (cols - prevIndex % cols),
2112 - decrement: true,
2113 - disabledIndices
2114 - });
2115 - if (onLoop) {
2116 - nextIndex = onLoop(event, prevIndex, nextIndex);
2117 - }
2118 - }
2119 - } else if (loopFocus) {
2120 - nextIndex = findNonDisabledListIndex(list, {
2121 - startingIndex: prevIndex + (cols - prevIndex % cols),
2122 - decrement: true,
2123 - disabledIndices
2124 - });
2125 - if (onLoop) {
2126 - nextIndex = onLoop(event, prevIndex, nextIndex);
2127 - }
2128 - }
2129 - if (isDifferentGridRow(nextIndex, cols, prevRow)) {
2130 - nextIndex = prevIndex;
2131 - }
2132 - }
2133 - const lastRow = floor(maxIndex / cols) === prevRow;
2134 - if (isIndexOutOfListBounds(list, nextIndex)) {
2135 - if (loopFocus && lastRow) {
2136 - nextIndex = event.key === (rtl ? ARROW_RIGHT : ARROW_LEFT) ? maxIndex : findNonDisabledListIndex(list, {
2137 - startingIndex: prevIndex - prevIndex % cols - 1,
2138 - disabledIndices
2139 - });
2140 - if (onLoop) {
2141 - nextIndex = onLoop(event, prevIndex, nextIndex);
2142 - }
2143 - } else {
2144 - nextIndex = prevIndex;
2145 - }
2146 - }
2147 - }
2148 - return nextIndex;
2149 - }
2150 - function createGridCellMap(sizes, cols, dense) {
2151 - const cellMap = [];
2152 - let startIndex = 0;
2153 - sizes.forEach(({
2154 - width,
2155 - height
2156 - }, index) => {
2157 - if (width > cols) {
2158 - if (true) {
2159 - throw new Error(`[Floating UI]: Invalid grid - item width at index ${index} is greater than grid columns`);
2160 - }
2161 - }
2162 - let itemPlaced = false;
2163 - if (dense) {
2164 - startIndex = 0;
2165 - }
2166 - while (!itemPlaced) {
2167 - const targetCells = [];
2168 - for (let i = 0; i < width; i += 1) {
2169 - for (let j = 0; j < height; j += 1) {
2170 - targetCells.push(startIndex + i + j * cols);
2171 - }
2172 - }
2173 - if (startIndex % cols + width <= cols && targetCells.every((cell) => cellMap[cell] == null)) {
2174 - targetCells.forEach((cell) => {
2175 - cellMap[cell] = index;
2176 - });
2177 - itemPlaced = true;
2178 - } else {
2179 - startIndex += 1;
2180 - }
2181 - }
2182 - });
2183 - return [...cellMap];
2184 - }
2185 - function getGridCellIndexOfCorner(index, sizes, cellMap, cols, corner) {
2186 - if (index === -1) {
2187 - return -1;
2188 - }
2189 - const firstCellIndex = cellMap.indexOf(index);
2190 - const sizeItem = sizes[index];
2191 - switch (corner) {
2192 - case "tl":
2193 - return firstCellIndex;
2194 - case "tr":
2195 - if (!sizeItem) {
2196 - return firstCellIndex;
2197 - }
2198 - return firstCellIndex + sizeItem.width - 1;
2199 - case "bl":
2200 - if (!sizeItem) {
2201 - return firstCellIndex;
2202 - }
2203 - return firstCellIndex + (sizeItem.height - 1) * cols;
2204 - case "br":
2205 - return cellMap.lastIndexOf(index);
2206 - default:
2207 - return -1;
2208 - }
2209 - }
2210 - function getGridCellIndices(indices, cellMap) {
2211 - return cellMap.flatMap((index, cellIndex) => indices.includes(index) ? [cellIndex] : []);
2212 - }
2213 - function isListIndexDisabled(list, index, disabledIndices) {
2214 - const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index) : disabledIndices?.includes(index) ?? false;
2192 + function isListIndexDisabled(list, index2, disabledIndices) {
2193 + const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index2) : disabledIndices?.includes(index2) ?? false;
2215 2194 if (isExplicitlyDisabled) {
2216 2195 return true;
2217 2196 }
2218 - const element = list[index];
2197 + const element = list[index2];
2219 2198 if (!element) {
2220 2199 return false;
2221 2200 }
2222 2201 if (!isElementVisible(element)) {
@@ -2221,8 +2200,11 @@
2221 2200 }
2222 2201 if (!isElementVisible(element)) {
2223 2202 return true;
2224 2203 }
2204 + if (element.matches(":disabled")) {
2205 + return true;
2206 + }
2225 2207 return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true");
2226 2208 }
2227 2209 function isHiddenByStyles(styles) {
2228 2210 return styles.visibility === "hidden" || styles.visibility === "collapse";
@@ -2236,31 +2218,27 @@
2236 2218 }
2237 2219 return styles.display !== "none" && styles.display !== "contents";
2238 2220 }
2239 2221
2240 - // node_modules/@base-ui/utils/esm/owner.js
2241 - function ownerDocument(node) {
2242 - return node?.ownerDocument || document;
2222 + // node_modules/@base-ui/utils/useForcedRerendering.mjs
2223 + var React18 = __toESM(require_react(), 1);
2224 + function useForcedRerendering() {
2225 + const [, setState] = React18.useState({});
2226 + return React18.useCallback(() => {
2227 + setState({});
2228 + }, []);
2243 2229 }
2244 2230
2245 - // node_modules/@base-ui/react/esm/internals/composite/composite.js
2246 - var ARROW_UP2 = "ArrowUp";
2247 - var ARROW_DOWN2 = "ArrowDown";
2248 - var ARROW_LEFT2 = "ArrowLeft";
2249 - var ARROW_RIGHT2 = "ArrowRight";
2231 + // node_modules/@base-ui/react/internals/composite/composite.mjs
2232 + var ARROW_UP = "ArrowUp";
2233 + var ARROW_DOWN = "ArrowDown";
2234 + var ARROW_LEFT = "ArrowLeft";
2235 + var ARROW_RIGHT = "ArrowRight";
2250 2236 var HOME = "Home";
2251 2237 var END = "End";
2252 - var HORIZONTAL_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT2, ARROW_RIGHT2]);
2253 - var HORIZONTAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT2, ARROW_RIGHT2, HOME, END]);
2254 - var VERTICAL_KEYS = /* @__PURE__ */ new Set([ARROW_UP2, ARROW_DOWN2]);
2255 - var VERTICAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_UP2, ARROW_DOWN2, HOME, END]);
2256 - var ARROW_KEYS = /* @__PURE__ */ new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]);
2257 - var COMPOSITE_KEYS = /* @__PURE__ */ new Set([...ARROW_KEYS, HOME, END]);
2238 + var COMPOSITE_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN, ARROW_LEFT, ARROW_RIGHT, HOME, END]);
2258 2239 var SHIFT = "Shift";
2259 - var CONTROL = "Control";
2260 - var ALT = "Alt";
2261 - var META = "Meta";
2262 - var MODIFIER_KEYS = /* @__PURE__ */ new Set([SHIFT, CONTROL, ALT, META]);
2240 + var MODIFIER_KEYS = [SHIFT, "Control", "Alt", "Meta"];
2263 2241 function isInputElement(element) {
2264 2242 return isHTMLElement(element) && element.tagName === "INPUT";
2265 2243 }
2266 2244 function isNativeInput(element) {
@@ -2291,9 +2269,9 @@
2291 2269 targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
2292 2270 }
2293 2271 }
2294 2272 if (direction === "rtl") {
2295 - if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
2273 + if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) {
2296 2274 targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft;
2297 2275 } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) {
2298 2276 targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight;
2299 2277 }
@@ -2340,123 +2318,591 @@
2340 2318 scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0
2341 2319 };
2342 2320 }
2343 2321
2344 - // node_modules/@base-ui/react/esm/internals/useOpenChangeComplete.js
2345 - var React18 = __toESM(require_react(), 1);
2322 + // node_modules/@base-ui/utils/inertValue.mjs
2323 + function inertValue(value) {
2324 + if (isReactVersionAtLeast(19)) {
2325 + return value;
2326 + }
2327 + return value ? "true" : void 0;
2328 + }
2346 2329
2347 - // node_modules/@base-ui/react/esm/internals/useAnimationsFinished.js
2348 - var ReactDOM = __toESM(require_react_dom(), 1);
2330 + // node_modules/@base-ui/react/internals/useValueChanged.mjs
2331 + var React19 = __toESM(require_react(), 1);
2332 + function useValueChanged(value, onChange) {
2333 + const valueRef = React19.useRef(value);
2334 + const onChangeCallback = useStableCallback(onChange);
2335 + useIsoLayoutEffect(() => {
2336 + if (valueRef.current !== value) {
2337 + onChangeCallback(valueRef.current);
2338 + }
2339 + valueRef.current = value;
2340 + }, [value, onChangeCallback]);
2341 + }
2349 2342
2350 - // node_modules/@base-ui/react/esm/utils/resolveRef.js
2351 - function resolveRef(maybeRef) {
2352 - if (maybeRef == null) {
2353 - return maybeRef;
2343 + // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
2344 + var React20 = __toESM(require_react(), 1);
2345 +
2346 + // node_modules/@base-ui/react/field/control/FieldControlDataAttributes.mjs
2347 + var valid = "data-valid";
2348 + var invalid = "data-invalid";
2349 +
2350 + // node_modules/@base-ui/react/internals/field-constants/constants.mjs
2351 + var DEFAULT_VALIDITY_STATE = {
2352 + badInput: false,
2353 + customError: false,
2354 + patternMismatch: false,
2355 + rangeOverflow: false,
2356 + rangeUnderflow: false,
2357 + stepMismatch: false,
2358 + tooLong: false,
2359 + tooShort: false,
2360 + typeMismatch: false,
2361 + valid: null,
2362 + valueMissing: false
2363 + };
2364 + var DEFAULT_FIELD_STATE_ATTRIBUTES = {
2365 + valid: null,
2366 + touched: false,
2367 + dirty: false,
2368 + filled: false,
2369 + focused: false
2370 + };
2371 + var DEFAULT_FIELD_ROOT_STATE = {
2372 + disabled: false,
2373 + ...DEFAULT_FIELD_STATE_ATTRIBUTES
2374 + };
2375 + var fieldValidityMapping = {
2376 + valid(value) {
2377 + if (value === null) {
2378 + return null;
2379 + }
2380 + if (value) {
2381 + return {
2382 + [valid]: ""
2383 + };
2384 + }
2385 + return {
2386 + [invalid]: ""
2387 + };
2354 2388 }
2355 - return "current" in maybeRef ? maybeRef.current : maybeRef;
2389 + };
2390 +
2391 + // node_modules/@base-ui/react/internals/field-root-context/FieldRootContext.mjs
2392 + var DEFAULT_FIELD_ROOT_CONTEXT = {
2393 + invalid: void 0,
2394 + name: void 0,
2395 + validityData: {
2396 + state: DEFAULT_VALIDITY_STATE,
2397 + errors: [],
2398 + error: "",
2399 + value: "",
2400 + initialValue: null
2401 + },
2402 + setValidityData: NOOP,
2403 + disabled: void 0,
2404 + setTouched: NOOP,
2405 + setDirty: NOOP,
2406 + setFilled: NOOP,
2407 + setFocused: NOOP,
2408 + validationMode: "onSubmit",
2409 + shouldValidateOnChange: () => false,
2410 + state: DEFAULT_FIELD_ROOT_STATE,
2411 + registerFieldControl: NOOP,
2412 + validation: {
2413 + getValidationProps: (_disabled, props = EMPTY_OBJECT) => props,
2414 + inputRef: {
2415 + current: null
2416 + },
2417 + registeredInputs: /* @__PURE__ */ new Map(),
2418 + registerInput: NOOP,
2419 + getInputControl: () => null,
2420 + commit: async () => {
2421 + },
2422 + change: NOOP
2423 + }
2424 + };
2425 + var FieldRootContext = /* @__PURE__ */ React20.createContext(DEFAULT_FIELD_ROOT_CONTEXT);
2426 + if (true) FieldRootContext.displayName = "FieldRootContext";
2427 + function useFieldRootContext(optional = true) {
2428 + const context = React20.useContext(FieldRootContext);
2429 + if (context.setValidityData === NOOP && !optional) {
2430 + throw new Error(true ? "Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>." : formatErrorMessage_default(28));
2431 + }
2432 + return context;
2356 2433 }
2357 2434
2358 - // node_modules/@base-ui/react/esm/internals/useAnimationsFinished.js
2359 - function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) {
2360 - const frame = useAnimationFrame();
2361 - return useStableCallback((fnToExecute, signal = null) => {
2362 - frame.cancel();
2363 - const element = resolveRef(elementOrRef);
2364 - if (element == null) {
2435 + // node_modules/@base-ui/react/internals/field-register-control/useRegisterFieldControl.mjs
2436 + function useRegisterFieldControl(controlRef, id, value, getFormValueOverride, enabled = true, name16) {
2437 + const {
2438 + registerFieldControl
2439 + } = useFieldRootContext();
2440 + const sourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
2441 + useIsoLayoutEffect(() => {
2442 + const source = sourceRef.current;
2443 + if (!enabled) {
2444 + registerFieldControl(source, void 0);
2365 2445 return;
2366 2446 }
2367 - const resolvedElement = element;
2368 - const done = () => {
2369 - ReactDOM.flushSync(fnToExecute);
2447 + const registration = {
2448 + controlRef,
2449 + getValue: getFormValueOverride,
2450 + id,
2451 + name: name16,
2452 + value
2370 2453 };
2371 - if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) {
2372 - fnToExecute();
2454 + registerFieldControl(source, registration);
2455 + }, [controlRef, enabled, getFormValueOverride, id, name16, registerFieldControl, sourceRef, value]);
2456 + useIsoLayoutEffect(() => {
2457 + const source = sourceRef.current;
2458 + return () => {
2459 + registerFieldControl(source, void 0);
2460 + };
2461 + }, [registerFieldControl, sourceRef]);
2462 + }
2463 +
2464 + // node_modules/@base-ui/react/internals/form-context/FormContext.mjs
2465 + var React21 = __toESM(require_react(), 1);
2466 + var FormContext = /* @__PURE__ */ React21.createContext({
2467 + elementRef: {
2468 + current: null
2469 + },
2470 + formRef: {
2471 + current: {
2472 + fields: /* @__PURE__ */ new Map()
2473 + }
2474 + },
2475 + errors: {},
2476 + clearErrors: NOOP,
2477 + validationMode: "onSubmit",
2478 + submitCountRef: {
2479 + current: 0
2480 + }
2481 + });
2482 + if (true) FormContext.displayName = "FormContext";
2483 + function useFormContext() {
2484 + return React21.useContext(FormContext);
2485 + }
2486 +
2487 + // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2488 + var React23 = __toESM(require_react(), 1);
2489 +
2490 + // node_modules/@base-ui/react/internals/labelable-provider/LabelableContext.mjs
2491 + var React22 = __toESM(require_react(), 1);
2492 + var LabelableContext = /* @__PURE__ */ React22.createContext({
2493 + controlId: void 0,
2494 + registerControlId: NOOP,
2495 + resetControlId: NOOP,
2496 + labelId: void 0,
2497 + setLabelId: NOOP,
2498 + messageIds: [],
2499 + setMessageIds: NOOP,
2500 + getDescriptionProps: (externalProps) => externalProps
2501 + });
2502 + if (true) LabelableContext.displayName = "LabelableContext";
2503 + function useLabelableContext() {
2504 + return React22.useContext(LabelableContext);
2505 + }
2506 +
2507 + // node_modules/@base-ui/react/internals/labelable-provider/useLabelableId.mjs
2508 + function useLabelableId(params = {}) {
2509 + const {
2510 + id,
2511 + enabled = true
2512 + } = params;
2513 + const {
2514 + controlId,
2515 + registerControlId,
2516 + resetControlId
2517 + } = useLabelableContext();
2518 + const defaultId = useBaseUiId();
2519 + const controlSourceRef = useRefWithInit(() => /* @__PURE__ */ Symbol());
2520 + const hasRegisteredRef = React23.useRef(false);
2521 + const hadExplicitIdRef = React23.useRef(false);
2522 + const unregisterControlId = useStableCallback(() => {
2523 + if (!hasRegisteredRef.current || registerControlId === NOOP) {
2373 2524 return;
2374 2525 }
2375 - function exec() {
2376 - Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => {
2377 - if (!signal?.aborted) {
2378 - done();
2526 + hasRegisteredRef.current = false;
2527 + registerControlId(controlSourceRef.current, void 0);
2528 + });
2529 + useIsoLayoutEffect(() => {
2530 + if (!enabled || registerControlId === NOOP) {
2531 + unregisterControlId();
2532 + return void 0;
2533 + }
2534 + let nextId;
2535 + if (id !== void 0) {
2536 + hadExplicitIdRef.current = true;
2537 + nextId = id;
2538 + } else if (hadExplicitIdRef.current) {
2539 + nextId = defaultId;
2540 + } else {
2541 + resetControlId();
2542 + return void 0;
2543 + }
2544 + if (nextId === void 0) {
2545 + unregisterControlId();
2546 + return void 0;
2547 + }
2548 + hasRegisteredRef.current = true;
2549 + registerControlId(controlSourceRef.current, nextId);
2550 + return void 0;
2551 + }, [id, enabled, registerControlId, resetControlId, defaultId, controlSourceRef, unregisterControlId]);
2552 + useIsoLayoutEffect(() => {
2553 + return unregisterControlId;
2554 + }, [unregisterControlId]);
2555 + return (enabled ? controlId : void 0) ?? id ?? defaultId;
2556 + }
2557 +
2558 + // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs
2559 + var React24 = __toESM(require_react(), 1);
2560 + var DirectionContext = /* @__PURE__ */ React24.createContext(void 0);
2561 + if (true) DirectionContext.displayName = "DirectionContext";
2562 + function useDirection() {
2563 + const context = React24.useContext(DirectionContext);
2564 + return context?.direction ?? "ltr";
2565 + }
2566 +
2567 + // node_modules/@base-ui/react/field/item/FieldItemContext.mjs
2568 + var React25 = __toESM(require_react(), 1);
2569 + var FieldItemContext = /* @__PURE__ */ React25.createContext({
2570 + disabled: false
2571 + });
2572 + if (true) FieldItemContext.displayName = "FieldItemContext";
2573 + function useFieldItemContext() {
2574 + const context = React25.useContext(FieldItemContext);
2575 + return context;
2576 + }
2577 +
2578 + // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
2579 + var React26 = __toESM(require_react(), 1);
2580 +
2581 + // node_modules/@base-ui/react/field/utils/getCombinedFieldValidityData.mjs
2582 + function getCombinedFieldValidityData(validityData, invalid2) {
2583 + return {
2584 + ...validityData,
2585 + state: {
2586 + ...validityData.state,
2587 + valid: !invalid2 && validityData.state.valid
2588 + }
2589 + };
2590 + }
2591 +
2592 + // node_modules/@base-ui/react/field/root/useFieldValidation.mjs
2593 + var validityKeys = Object.keys(DEFAULT_VALIDITY_STATE);
2594 + function isEligibleInput(input, formElement) {
2595 + if (input.matches(":disabled")) {
2596 + return false;
2597 + }
2598 + if (!formElement || input.form === formElement) {
2599 + return true;
2600 + }
2601 + return input.form === null && !input.hasAttribute("form");
2602 + }
2603 + function findRepresentativeInput(inputs, formElement) {
2604 + let fallback = null;
2605 + for (const input of inputs.keys()) {
2606 + if (!isEligibleInput(input, formElement)) {
2607 + continue;
2608 + }
2609 + if (!input.validity.valid) {
2610 + return input;
2611 + }
2612 + fallback ??= input;
2613 + }
2614 + return fallback;
2615 + }
2616 + function makeState(customError) {
2617 + return {
2618 + ...DEFAULT_VALIDITY_STATE,
2619 + valid: !customError,
2620 + customError
2621 + };
2622 + }
2623 + function getNativeErrors(element) {
2624 + return element && element.validationMessage ? [element.validationMessage] : [];
2625 + }
2626 + function useFieldValidation(params) {
2627 + const {
2628 + elementRef,
2629 + formRef
2630 + } = useFormContext();
2631 + const {
2632 + setValidityData,
2633 + validate,
2634 + validityData,
2635 + validationDebounceTime,
2636 + invalid: invalid2,
2637 + markedDirtyRef,
2638 + state,
2639 + shouldValidateOnChange,
2640 + validationMode,
2641 + registeredFieldIdRef
2642 + } = params;
2643 + const {
2644 + controlId,
2645 + getDescriptionProps
2646 + } = useLabelableContext();
2647 + const timeout = useTimeout();
2648 + const inputRef = React26.useRef(null);
2649 + const registeredInputs = useRefWithInit(() => /* @__PURE__ */ new Map()).current;
2650 + const validationCommitIdRef = React26.useRef(0);
2651 + const customValidityRef = React26.useRef(null);
2652 + const registerInput = React26.useCallback((element, registration) => {
2653 + registeredInputs.set(element, registration);
2654 + return () => {
2655 + registeredInputs.delete(element);
2656 + };
2657 + }, [registeredInputs]);
2658 + const getInputControl = useStableCallback(() => {
2659 + const element = findRepresentativeInput(registeredInputs, elementRef.current);
2660 + return element && registeredInputs.get(element)?.controlRef.current || null;
2661 + });
2662 + const commit = useStableCallback(async (value, revalidate = false) => {
2663 + validationCommitIdRef.current += 1;
2664 + const validationCommitId = validationCommitIdRef.current;
2665 + function updateRegisteredFieldValidity(nextValidityData, externalInvalid = invalid2) {
2666 + const fieldId = registeredFieldIdRef.current ?? controlId;
2667 + if (fieldId == null) {
2668 + return;
2669 + }
2670 + const currentFieldData = formRef.current.fields.get(fieldId);
2671 + if (!currentFieldData) {
2672 + return;
2673 + }
2674 + const validityDataWithFormErrors = getCombinedFieldValidityData(nextValidityData, externalInvalid);
2675 + formRef.current.fields.set(fieldId, {
2676 + ...currentFieldData,
2677 + validityData: validityDataWithFormErrors
2678 + });
2679 + }
2680 + function makeValidityData(validityState, errorMessages) {
2681 + const errors = validityState.valid === false ? errorMessages : [];
2682 + return {
2683 + value,
2684 + state: validityState,
2685 + error: errors[0] ?? "",
2686 + errors,
2687 + initialValue: validityData.initialValue
2688 + };
2689 + }
2690 + function setCustomValidity(element2, message) {
2691 + const displaced = element2.validity.customError ? element2.validationMessage : "";
2692 + const ownedMessage = message.replace(/\r\n?/g, "\n");
2693 + element2.setCustomValidity(ownedMessage);
2694 + customValidityRef.current = [element2, ownedMessage, displaced];
2695 + }
2696 + function clearCustomValidity() {
2697 + const record = customValidityRef.current;
2698 + customValidityRef.current = null;
2699 + if (record && (!record[0].willValidate || record[0].validationMessage === record[1])) {
2700 + record[0].setCustomValidity(record[2]);
2701 + }
2702 + }
2703 + function publish(validityState, errorMessages, externalInvalid) {
2704 + const nextValidityData = makeValidityData(validityState, errorMessages);
2705 + updateRegisteredFieldValidity(nextValidityData, externalInvalid);
2706 + setValidityData(nextValidityData);
2707 + }
2708 + function getState(el) {
2709 + const computedState = validityKeys.reduce((acc, key) => {
2710 + acc[key] = el.validity[key];
2711 + return acc;
2712 + }, {});
2713 + let hasOnlyValueMissingError = false;
2714 + for (const key of validityKeys) {
2715 + if (key === "valid") {
2716 + continue;
2379 2717 }
2380 - }).catch(() => {
2381 - if (treatAbortedAsFinished) {
2382 - if (!signal?.aborted) {
2383 - done();
2384 - }
2718 + if (key === "valueMissing" && computedState[key]) {
2719 + hasOnlyValueMissingError = true;
2720 + } else if (computedState[key]) {
2721 + return computedState;
2722 + }
2723 + }
2724 + if (hasOnlyValueMissingError && !markedDirtyRef.current) {
2725 + computedState.valid = true;
2726 + computedState.valueMissing = false;
2727 + }
2728 + return computedState;
2729 + }
2730 + function resolveRepresentativeInput() {
2731 + return registeredInputs.size > 0 ? findRepresentativeInput(registeredInputs, elementRef.current) : inputRef.current;
2732 + }
2733 + let element = resolveRepresentativeInput();
2734 + function refreshState() {
2735 + element = resolveRepresentativeInput();
2736 + return element?.willValidate ? getState(element) : makeState(false);
2737 + }
2738 + if (revalidate) {
2739 + if (state.valid !== false || !element) {
2740 + return;
2741 + }
2742 + if (!element.validity.valueMissing) {
2743 + clearCustomValidity();
2744 + const currentElement = resolveRepresentativeInput();
2745 + const foreign = currentElement?.validity.customError ? getNativeErrors(currentElement) : [];
2746 + publish(makeState(foreign.length > 0), foreign, false);
2747 + return;
2748 + }
2749 + for (const key of validityKeys) {
2750 + if (key !== "valid" && key !== "valueMissing" && key !== "customError" && element.validity[key]) {
2385 2751 return;
2386 2752 }
2387 - const currentAnimations = resolvedElement.getAnimations();
2388 - if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) {
2389 - exec();
2753 + }
2754 + }
2755 + timeout.clear();
2756 + clearCustomValidity();
2757 + let nextState = refreshState();
2758 + let validationErrors = getNativeErrors(element);
2759 + const isValidatingOnChange = shouldValidateOnChange();
2760 + if (validationErrors.length === 0 || isValidatingOnChange) {
2761 + const formValues = Array.from(formRef.current.fields.values()).reduce((acc, field) => {
2762 + if (field.name) {
2763 + acc[field.name] = field.getValue();
2390 2764 }
2391 - });
2392 - }
2393 - if (waitForStartingStyleRemoved) {
2394 - const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle;
2395 - if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
2396 - frame.request(exec);
2397 - return;
2765 + return acc;
2766 + }, {});
2767 + const resultOrPromise = validate(value, formValues);
2768 + let result;
2769 + if (typeof resultOrPromise === "object" && resultOrPromise !== null && "then" in resultOrPromise) {
2770 + if (nextState.valid === false) {
2771 + publish(nextState, validationErrors);
2772 + } else if (validationMode === "onSubmit" || !validityData.state.customError) {
2773 + nextState.valid = null;
2774 + publish(nextState, validationErrors);
2775 + }
2776 + result = await resultOrPromise;
2777 + if (validationCommitId !== validationCommitIdRef.current) {
2778 + return;
2779 + }
2780 + nextState = refreshState();
2781 + } else {
2782 + result = resultOrPromise;
2398 2783 }
2399 - const attributeObserver = new MutationObserver(() => {
2400 - if (!resolvedElement.hasAttribute(startingStyleAttribute)) {
2401 - attributeObserver.disconnect();
2402 - exec();
2784 + validationErrors = result ? [].concat(result).filter(Boolean) : [];
2785 + if (validationErrors.length > 0) {
2786 + nextState.valid = false;
2787 + nextState.customError = true;
2788 + if (element?.willValidate) {
2789 + setCustomValidity(element, validationErrors.join("\n"));
2403 2790 }
2791 + } else {
2792 + validationErrors = getNativeErrors(element);
2793 + }
2794 + }
2795 + publish(nextState, validationErrors);
2796 + });
2797 + const change = useStableCallback((value, cancelPending = false) => {
2798 + timeout.clear();
2799 + validationCommitIdRef.current += 1;
2800 + if (cancelPending) {
2801 + return;
2802 + }
2803 + const validateOnChange = shouldValidateOnChange();
2804 + if (validateOnChange && value !== "" && validationDebounceTime) {
2805 + timeout.start(validationDebounceTime, () => {
2806 + commit(value);
2404 2807 });
2405 - attributeObserver.observe(resolvedElement, {
2406 - attributes: true,
2407 - attributeFilter: [startingStyleAttribute]
2408 - });
2409 - signal?.addEventListener("abort", () => attributeObserver.disconnect(), {
2410 - once: true
2411 - });
2412 - return;
2808 + } else {
2809 + commit(value, !validateOnChange);
2413 2810 }
2414 - frame.request(exec);
2415 2811 });
2812 + const getValidationProps = React26.useCallback((disabled2, externalProps = {}) => mergeProps(getDescriptionProps(externalProps), state.valid === false && !state.disabled && !disabled2 ? {
2813 + "aria-invalid": true
2814 + } : EMPTY_OBJECT), [getDescriptionProps, state.disabled, state.valid]);
2815 + return React26.useMemo(() => ({
2816 + getValidationProps,
2817 + inputRef,
2818 + registeredInputs,
2819 + registerInput,
2820 + getInputControl,
2821 + commit,
2822 + change
2823 + }), [getValidationProps, registeredInputs, registerInput, getInputControl, commit, change]);
2416 2824 }
2417 2825
2418 - // node_modules/@base-ui/react/esm/internals/useOpenChangeComplete.js
2419 - function useOpenChangeComplete(parameters) {
2420 - const {
2421 - enabled = true,
2422 - open,
2423 - ref,
2424 - onComplete: onCompleteParam
2425 - } = parameters;
2426 - const onComplete = useStableCallback(onCompleteParam);
2427 - const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false);
2428 - React18.useEffect(() => {
2429 - if (!enabled) {
2430 - return void 0;
2431 - }
2432 - const abortController = new AbortController();
2433 - runOnceAnimationsFinish(onComplete, abortController.signal);
2826 + // node_modules/@base-ui/react/utils/useRegisteredLabelId.mjs
2827 + function useRegisteredLabelId(idProp, setLabelId) {
2828 + const id = useBaseUiId(idProp);
2829 + useIsoLayoutEffect(() => {
2830 + setLabelId(id);
2434 2831 return () => {
2435 - abortController.abort();
2832 + setLabelId((currentId) => currentId === id ? void 0 : currentId);
2436 2833 };
2437 - }, [enabled, open, onComplete, runOnceAnimationsFinish]);
2834 + }, [id, setLabelId]);
2835 + return id;
2438 2836 }
2439 2837
2440 - // node_modules/@base-ui/utils/esm/useForcedRerendering.js
2441 - var React19 = __toESM(require_react(), 1);
2442 - function useForcedRerendering() {
2443 - const [, setState] = React19.useState({});
2444 - return React19.useCallback(() => {
2445 - setState({});
2446 - }, []);
2838 + // node_modules/@base-ui/react/internals/labelable-provider/useLabel.mjs
2839 + function useLabel(params = {}) {
2840 + const {
2841 + id: idProp,
2842 + fallbackControlId,
2843 + native = false,
2844 + setLabelId: setLabelIdProp,
2845 + focusControl: focusControlProp
2846 + } = params;
2847 + const {
2848 + controlId: contextControlId,
2849 + setLabelId: setContextLabelId
2850 + } = useLabelableContext();
2851 + const syncLabelId = useStableCallback((nextLabelId) => {
2852 + setContextLabelId(nextLabelId);
2853 + setLabelIdProp?.(nextLabelId);
2854 + });
2855 + const id = useRegisteredLabelId(idProp, syncLabelId);
2856 + const resolvedControlId = contextControlId ?? fallbackControlId;
2857 + function focusControl(event) {
2858 + if (focusControlProp) {
2859 + focusControlProp(event, resolvedControlId);
2860 + return;
2861 + }
2862 + if (!resolvedControlId) {
2863 + return;
2864 + }
2865 + const controlElement = ownerDocument(event.currentTarget).getElementById(resolvedControlId);
2866 + if (isHTMLElement(controlElement)) {
2867 + focusElementWithVisible(controlElement);
2868 + }
2869 + }
2870 + function handleInteraction(event) {
2871 + const target = getTarget(event.nativeEvent);
2872 + if (target?.closest("button,input,select,textarea")) {
2873 + return;
2874 + }
2875 + if (!event.defaultPrevented && event.detail > 1) {
2876 + event.preventDefault();
2877 + }
2878 + if (native) {
2879 + return;
2880 + }
2881 + focusControl(event);
2882 + }
2883 + return native ? {
2884 + id,
2885 + htmlFor: resolvedControlId,
2886 + onMouseDown: handleInteraction
2887 + } : {
2888 + id,
2889 + onClick: handleInteraction,
2890 + onPointerDown(event) {
2891 + event.preventDefault();
2892 + }
2893 + };
2447 2894 }
2448 -
2449 - // node_modules/@base-ui/utils/esm/inertValue.js
2450 - function inertValue(value) {
2451 - if (isReactVersionAtLeast(19)) {
2452 - return value;
2453 - }
2454 - return value ? "true" : void 0;
2895 + function focusElementWithVisible(element) {
2896 + element.focus({
2897 + // Available from Chrome 144+ (January 2026).
2898 + // Safari and Firefox already support it.
2899 + focusVisible: true
2900 + });
2455 2901 }
2456 2902
2457 - // node_modules/@base-ui/react/esm/internals/composite/item/useCompositeItem.js
2458 - var React20 = __toESM(require_react(), 1);
2903 + // node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs
2904 + var React27 = __toESM(require_react(), 1);
2459 2905 function useCompositeItem(params = {}) {
2460 2906 const {
2461 2907 highlightItemOnHover,
2462 2908 highlightedIndex,
@@ -2463,17 +2909,17 @@
2463 2909 onHighlightedIndexChange
2464 2910 } = useCompositeRootContext();
2465 2911 const {
2466 2912 ref,
2467 - index
2913 + index: index2
2468 2914 } = useCompositeListItem(params);
2469 - const isHighlighted = highlightedIndex === index;
2470 - const itemRef = React20.useRef(null);
2915 + const isHighlighted = highlightedIndex === index2;
2916 + const itemRef = React27.useRef(null);
2471 2917 const mergedRef = useMergedRefs(ref, itemRef);
2472 - const compositeProps = React20.useMemo(() => ({
2918 + const compositeProps = {
2473 2919 tabIndex: isHighlighted ? 0 : -1,
2474 2920 onFocus() {
2475 - onHighlightedIndexChange(index);
2921 + onHighlightedIndexChange(index2);
2476 2922 },
2477 2923 onMouseMove() {
2478 2924 const item = itemRef.current;
2479 2925 if (!highlightItemOnHover || !item) {
@@ -2483,17 +2929,17 @@
2483 2929 if (!isHighlighted && !disabled2) {
2484 2930 item.focus();
2485 2931 }
2486 2932 }
2487 - }), [isHighlighted, onHighlightedIndexChange, index, highlightItemOnHover]);
2933 + };
2488 2934 return {
2489 2935 compositeProps,
2490 2936 compositeRef: mergedRef,
2491 - index
2937 + index: index2
2492 2938 };
2493 2939 }
2494 2940
2495 - // node_modules/@base-ui/react/esm/utils/getCssDimensions.js
2941 + // node_modules/@base-ui/react/utils/getCssDimensions.mjs
2496 2942 function getCssDimensions(element) {
2497 2943 const css = getComputedStyle2(element);
2498 2944 let width = parseFloat(css.width) || 0;
2499 2945 let height = parseFloat(css.height) || 0;
@@ -2510,236 +2956,1083 @@
2510 2956 height
2511 2957 };
2512 2958 }
2513 2959
2514 - // node_modules/@base-ui/react/esm/internals/csp-context/CSPContext.js
2515 - var React21 = __toESM(require_react(), 1);
2516 - var CSPContext = /* @__PURE__ */ React21.createContext(void 0);
2960 + // node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs
2961 + var React28 = __toESM(require_react(), 1);
2962 + var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
2963 + var DirectionProvider = function DirectionProvider2(props) {
2964 + const {
2965 + direction = "ltr"
2966 + } = props;
2967 + const contextValue = React28.useMemo(() => ({
2968 + direction
2969 + }), [direction]);
2970 + return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(DirectionContext.Provider, {
2971 + value: contextValue,
2972 + children: props.children
2973 + });
2974 + };
2975 + if (true) DirectionProvider.displayName = "DirectionProvider";
2976 +
2977 + // node_modules/@base-ui/utils/isElementDisabled.mjs
2978 + function isElementDisabled(element) {
2979 + return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true";
2980 + }
2981 +
2982 + // node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs
2983 + var React29 = __toESM(require_react(), 1);
2984 + var CSPContext = /* @__PURE__ */ React29.createContext(void 0);
2517 2985 if (true) CSPContext.displayName = "CSPContext";
2518 2986 var DEFAULT_CSP_CONTEXT_VALUE = {
2519 2987 disableStyleElements: false
2520 2988 };
2521 2989 function useCSPContext() {
2522 - return React21.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
2990 + return React29.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE;
2523 2991 }
2524 2992
2525 - // node_modules/@base-ui/react/esm/internals/composite/root/CompositeRoot.js
2526 - var React23 = __toESM(require_react(), 1);
2993 + // node_modules/@base-ui/react/utils/getElementTransform.mjs
2994 + function getElementTransform(element, computedStyle) {
2995 + const transform = (computedStyle ?? getWindow(element).getComputedStyle(element)).transform;
2996 + let translateX = 0;
2997 + let translateY = 0;
2998 + let scale = 1;
2999 + if (transform && transform !== "none") {
3000 + const matrix = transform.match(/matrix(?:3d)?\(([^)]+)\)/);
3001 + if (matrix) {
3002 + const values = matrix[1].split(", ").map(parseFloat);
3003 + if (values.length === 6) {
3004 + translateX = values[4];
3005 + translateY = values[5];
3006 + scale = Math.sqrt(values[0] * values[0] + values[1] * values[1]);
3007 + } else if (values.length === 16) {
3008 + translateX = values[12];
3009 + translateY = values[13];
3010 + scale = values[0];
3011 + }
3012 + }
3013 + }
3014 + return {
3015 + x: translateX,
3016 + y: translateY,
3017 + scale
3018 + };
3019 + }
2527 3020
2528 - // node_modules/@base-ui/react/esm/internals/composite/root/useCompositeRoot.js
2529 - var React22 = __toESM(require_react(), 1);
3021 + // node_modules/@base-ui/react/field/index.parts.mjs
3022 + var index_parts_exports = {};
3023 + __export(index_parts_exports, {
3024 + Control: () => FieldControl,
3025 + Description: () => FieldDescription,
3026 + Error: () => FieldError,
3027 + Item: () => FieldItem,
3028 + Label: () => FieldLabel,
3029 + Root: () => FieldRoot,
3030 + Validity: () => FieldValidity
3031 + });
2530 3032
2531 - // node_modules/@base-ui/react/esm/internals/composite/constants.js
3033 + // node_modules/@base-ui/react/field/root/FieldRoot.mjs
3034 + var React33 = __toESM(require_react(), 1);
3035 +
3036 + // node_modules/@base-ui/react/fieldset/root/FieldsetRootContext.mjs
3037 + var React30 = __toESM(require_react(), 1);
3038 + var FieldsetRootContext = /* @__PURE__ */ React30.createContext(void 0);
3039 + if (true) FieldsetRootContext.displayName = "FieldsetRootContext";
3040 + function useFieldsetRootContext(optional = false) {
3041 + const context = React30.useContext(FieldsetRootContext);
3042 + if (!context && !optional) {
3043 + throw new Error(true ? "Base UI: FieldsetRootContext is missing. Fieldset parts must be placed within <Fieldset.Root>." : formatErrorMessage_default(86));
3044 + }
3045 + return context;
3046 + }
3047 +
3048 + // node_modules/@base-ui/react/internals/labelable-provider/LabelableProvider.mjs
3049 + var React31 = __toESM(require_react(), 1);
3050 + var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
3051 + var LabelableProvider = function LabelableProvider2(props) {
3052 + const defaultId = useBaseUiId();
3053 + const [controlIdState, setControlIdState] = React31.useState(defaultId);
3054 + const [labelId, setLabelId] = React31.useState();
3055 + const [messageIds, setMessageIds] = React31.useState([]);
3056 + const controlId = controlIdState === void 0 ? defaultId : controlIdState;
3057 + const registrationsRef = useRefWithInit(() => /* @__PURE__ */ new Map());
3058 + const {
3059 + messageIds: parentMessageIds
3060 + } = useLabelableContext();
3061 + const registerControlId = useStableCallback((source, nextId) => {
3062 + const registrations = registrationsRef.current;
3063 + if (nextId === void 0) {
3064 + registrations.delete(source);
3065 + } else {
3066 + registrations.set(source, nextId);
3067 + }
3068 + setControlIdState((prev) => {
3069 + if (registrations.size === 0) {
3070 + return prev;
3071 + }
3072 + let nextControlId;
3073 + for (const id of registrations.values()) {
3074 + if (id === prev) {
3075 + return prev;
3076 + }
3077 + if (nextControlId === void 0) {
3078 + nextControlId = id;
3079 + }
3080 + }
3081 + return nextControlId;
3082 + });
3083 + });
3084 + const resetControlId = useStableCallback(() => {
3085 + if (registrationsRef.current.size === 0) {
3086 + setControlIdState(defaultId);
3087 + }
3088 + });
3089 + const getDescriptionProps = React31.useCallback((externalProps) => {
3090 + const ids = externalProps["aria-describedby"] ? externalProps["aria-describedby"].split(" ") : [];
3091 + ids.push(...parentMessageIds, ...messageIds);
3092 + return {
3093 + ...externalProps,
3094 + "aria-describedby": Array.from(new Set(ids)).join(" ") || void 0
3095 + };
3096 + }, [parentMessageIds, messageIds]);
3097 + const contextValue = React31.useMemo(() => ({
3098 + controlId,
3099 + registerControlId,
3100 + resetControlId,
3101 + labelId,
3102 + setLabelId,
3103 + messageIds,
3104 + setMessageIds,
3105 + getDescriptionProps
3106 + }), [controlId, registerControlId, resetControlId, labelId, setLabelId, messageIds, setMessageIds, getDescriptionProps]);
3107 + return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LabelableContext.Provider, {
3108 + value: contextValue,
3109 + children: props.children
3110 + });
3111 + };
3112 + if (true) LabelableProvider.displayName = "LabelableProvider";
3113 +
3114 + // node_modules/@base-ui/react/internals/field-register-control/useFieldControlRegistration.mjs
3115 + var React32 = __toESM(require_react(), 1);
3116 + function useFieldControlRegistration(params) {
3117 + const {
3118 + change,
3119 + commit,
3120 + invalid: invalid2,
3121 + markedDirtyRef,
3122 + name: name16,
3123 + setRegisteredFieldName,
3124 + registeredFieldIdRef,
3125 + setValidityData,
3126 + validityData
3127 + } = params;
3128 + const {
3129 + formRef
3130 + } = useFormContext();
3131 + const activeFieldControlSourceRef = React32.useRef(null);
3132 + const registrationRef = React32.useRef(null);
3133 + const initialValueCapturedRef = React32.useRef(false);
3134 + const getValueForForm = useStableCallback(() => {
3135 + const registration = registrationRef.current;
3136 + if (!registration) {
3137 + return void 0;
3138 + }
3139 + if (registration.getValue) {
3140 + return registration.getValue();
3141 + }
3142 + return registration.value;
3143 + });
3144 + function getRegistrationValue(registration) {
3145 + return registration.value === void 0 ? getValueForForm() : registration.value;
3146 + }
3147 + const validate = useStableCallback(() => {
3148 + const registration = registrationRef.current;
3149 + markedDirtyRef.current = true;
3150 + if (!registration) {
3151 + commit(validityData.value);
3152 + return;
3153 + }
3154 + commit(getRegistrationValue(registration));
3155 + });
3156 + function refreshRegistration() {
3157 + const registration = registrationRef.current;
3158 + if (!registration || !registration.id) {
3159 + return;
3160 + }
3161 + formRef.current.fields.set(registration.id, {
3162 + getValue: getValueForForm,
3163 + name: name16 ?? registration.name,
3164 + controlRef: registration.controlRef,
3165 + validityData: getCombinedFieldValidityData(validityData, invalid2),
3166 + validate
3167 + });
3168 + }
3169 + function deleteRegistration(id = registrationRef.current?.id) {
3170 + if (id) {
3171 + formRef.current.fields.delete(id);
3172 + }
3173 + }
3174 + function captureInitialValue(registration) {
3175 + if (initialValueCapturedRef.current) {
3176 + return;
3177 + }
3178 + initialValueCapturedRef.current = true;
3179 + const initialValue = getRegistrationValue(registration);
3180 + setValidityData((prev) => prev.initialValue === initialValue ? prev : {
3181 + ...prev,
3182 + initialValue
3183 + });
3184 + }
3185 + useIsoLayoutEffect(() => {
3186 + const registration = registrationRef.current;
3187 + if (!registration || !registration.id) {
3188 + return;
3189 + }
3190 + setRegisteredFieldName(name16 ? void 0 : registration.name);
3191 + formRef.current.fields.set(registration.id, {
3192 + getValue: getValueForForm,
3193 + name: name16 ?? registration.name,
3194 + controlRef: registration.controlRef,
3195 + validityData: getCombinedFieldValidityData(validityData, invalid2),
3196 + validate
3197 + });
3198 + }, [formRef, getValueForForm, invalid2, name16, setRegisteredFieldName, validate, validityData]);
3199 + useIsoLayoutEffect(() => {
3200 + const fields = formRef.current.fields;
3201 + return () => {
3202 + const id = registrationRef.current?.id;
3203 + if (id) {
3204 + fields.delete(id);
3205 + }
3206 + };
3207 + }, [formRef]);
3208 + const register = useStableCallback((source, registration) => {
3209 + if (!registration) {
3210 + if (activeFieldControlSourceRef.current === source) {
3211 + activeFieldControlSourceRef.current = null;
3212 + change(void 0, true);
3213 + deleteRegistration();
3214 + registrationRef.current = null;
3215 + setRegisteredFieldName(void 0);
3216 + registeredFieldIdRef.current = void 0;
3217 + }
3218 + return;
3219 + }
3220 + const previousId = registrationRef.current?.id;
3221 + const previousSource = activeFieldControlSourceRef.current;
3222 + if (previousSource && previousSource !== source) {
3223 + change(void 0, true);
3224 + }
3225 + activeFieldControlSourceRef.current = source;
3226 + registrationRef.current = registration;
3227 + if (!name16) {
3228 + setRegisteredFieldName(registration.name);
3229 + }
3230 + registeredFieldIdRef.current = registration.id;
3231 + if (previousId && previousId !== registration.id) {
3232 + deleteRegistration(previousId);
3233 + }
3234 + captureInitialValue(registration);
3235 + refreshRegistration();
3236 + });
3237 + return [validate, register];
3238 + }
3239 +
3240 + // node_modules/@base-ui/react/field/root/FieldRoot.mjs
3241 + var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
3242 + var FieldRootInner = /* @__PURE__ */ React33.forwardRef(function FieldRootInner2(componentProps, forwardedRef) {
3243 + const {
3244 + errors,
3245 + validationMode: formValidationMode,
3246 + submitCountRef
3247 + } = useFormContext();
3248 + const {
3249 + render,
3250 + className,
3251 + validate: validateProp,
3252 + validationDebounceTime = 0,
3253 + validationMode = formValidationMode,
3254 + name: name16,
3255 + disabled: disabledProp = false,
3256 + invalid: invalidProp,
3257 + dirty: dirtyProp,
3258 + touched: touchedProp,
3259 + actionsRef,
3260 + style,
3261 + ...elementProps
3262 + } = componentProps;
3263 + const disabledFieldset = useFieldsetRootContext(true)?.disabled;
3264 + const validate = useStableCallback(validateProp || (() => null));
3265 + const disabled2 = disabledFieldset || disabledProp;
3266 + const [touchedState, setTouchedUnwrapped] = React33.useState(false);
3267 + const [dirtyState, setDirtyUnwrapped] = React33.useState(false);
3268 + const [filled, setFilled] = React33.useState(false);
3269 + const [focused, setFocused] = React33.useState(false);
3270 + const dirty = dirtyProp ?? dirtyState;
3271 + const touched = touchedProp ?? touchedState;
3272 + const markedDirtyRef = React33.useRef(dirty);
3273 + const registeredFieldIdRef = React33.useRef(void 0);
3274 + const [registeredFieldName, setRegisteredFieldName] = React33.useState();
3275 + const effectiveName = name16 ?? registeredFieldName;
3276 + useIsoLayoutEffect(() => {
3277 + if (dirtyProp !== void 0) {
3278 + markedDirtyRef.current = dirtyProp;
3279 + }
3280 + }, [dirtyProp]);
3281 + const setDirty = useStableCallback((value) => {
3282 + if (dirtyProp !== void 0) {
3283 + return;
3284 + }
3285 + if (value) {
3286 + markedDirtyRef.current = true;
3287 + }
3288 + setDirtyUnwrapped(value);
3289 + });
3290 + const setTouched = useStableCallback((value) => {
3291 + if (touchedProp !== void 0) {
3292 + return;
3293 + }
3294 + setTouchedUnwrapped(value);
3295 + });
3296 + const shouldValidateOnChange = useStableCallback(() => validationMode === "onChange" || validationMode === "onSubmit" && submitCountRef.current > 0);
3297 + const formError = effectiveName && Object.hasOwn(errors, effectiveName) ? errors[effectiveName] : null;
3298 + const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
3299 + const invalid2 = invalidProp === true || hasFormError;
3300 + const [validityData, setValidityData] = React33.useState({
3301 + state: DEFAULT_VALIDITY_STATE,
3302 + error: "",
3303 + errors: [],
3304 + value: null,
3305 + initialValue: null
3306 + });
3307 + const valid2 = !invalid2 && (disabled2 ? null : validityData.state.valid);
3308 + const state = React33.useMemo(() => ({
3309 + disabled: disabled2,
3310 + touched,
3311 + dirty,
3312 + valid: valid2,
3313 + filled,
3314 + focused
3315 + }), [disabled2, touched, dirty, valid2, filled, focused]);
3316 + const validation = useFieldValidation({
3317 + setValidityData,
3318 + validate,
3319 + validityData,
3320 + validationDebounceTime,
3321 + invalid: invalid2,
3322 + markedDirtyRef,
3323 + state,
3324 + shouldValidateOnChange,
3325 + validationMode,
3326 + registeredFieldIdRef
3327 + });
3328 + const [validateFieldControl, registerFieldControl] = useFieldControlRegistration({
3329 + change: validation.change,
3330 + commit: validation.commit,
3331 + invalid: invalid2,
3332 + markedDirtyRef,
3333 + name: name16,
3334 + setRegisteredFieldName,
3335 + registeredFieldIdRef,
3336 + setValidityData,
3337 + validityData
3338 + });
3339 + React33.useImperativeHandle(actionsRef, () => ({
3340 + validate: validateFieldControl
3341 + }), [validateFieldControl]);
3342 + const contextValue = React33.useMemo(() => ({
3343 + invalid: invalid2,
3344 + name: effectiveName,
3345 + validityData,
3346 + setValidityData,
3347 + disabled: disabled2,
3348 + setTouched,
3349 + setDirty,
3350 + setFilled,
3351 + setFocused,
3352 + validationMode,
3353 + shouldValidateOnChange,
3354 + state,
3355 + registerFieldControl,
3356 + validation
3357 + }), [invalid2, effectiveName, validityData, disabled2, setTouched, setDirty, setFilled, setFocused, validationMode, shouldValidateOnChange, state, registerFieldControl, validation]);
3358 + const element = useRenderElement("div", componentProps, {
3359 + ref: forwardedRef,
3360 + state,
3361 + props: elementProps,
3362 + stateAttributesMapping: fieldValidityMapping
3363 + });
3364 + return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootContext.Provider, {
3365 + value: contextValue,
3366 + children: element
3367 + });
3368 + });
3369 + if (true) FieldRootInner.displayName = "FieldRootInner";
3370 + var FieldRoot = /* @__PURE__ */ React33.forwardRef(function FieldRoot2(componentProps, forwardedRef) {
3371 + return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(LabelableProvider, {
3372 + children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(FieldRootInner, {
3373 + ...componentProps,
3374 + ref: forwardedRef
3375 + })
3376 + });
3377 + });
3378 + if (true) FieldRoot.displayName = "FieldRoot";
3379 +
3380 + // node_modules/@base-ui/react/field/label/FieldLabel.mjs
3381 + var React34 = __toESM(require_react(), 1);
3382 + var FieldLabel = /* @__PURE__ */ React34.forwardRef(function FieldLabel2(componentProps, forwardedRef) {
3383 + const {
3384 + render,
3385 + className,
3386 + style,
3387 + id: idProp,
3388 + nativeLabel = true,
3389 + ...elementProps
3390 + } = componentProps;
3391 + const fieldRootContext = useFieldRootContext(false);
3392 + const fieldItemContext = useFieldItemContext();
3393 + const {
3394 + labelId
3395 + } = useLabelableContext();
3396 + const state = {
3397 + ...fieldRootContext.state,
3398 + disabled: fieldRootContext.disabled || fieldItemContext.disabled
3399 + };
3400 + const labelRef = React34.useRef(null);
3401 + const labelProps = useLabel({
3402 + id: labelId ?? idProp,
3403 + native: nativeLabel
3404 + });
3405 + if (true) {
3406 + React34.useEffect(() => {
3407 + if (!labelRef.current) {
3408 + return;
3409 + }
3410 + const isLabelTag = labelRef.current.tagName === "LABEL";
3411 + if (nativeLabel) {
3412 + if (!isLabelTag) {
3413 + const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
3414 + const message = "<Field.Label> expected a <label> element because the `nativeLabel` prop is true. Rendering a non-<label> disables native label association, so `htmlFor` will not work. Use a real <label> in the `render` prop, or set `nativeLabel` to `false`.";
3415 + error(`${message}${ownerStackMessage}`);
3416 + }
3417 + } else if (isLabelTag) {
3418 + const ownerStackMessage = SafeReact.captureOwnerStack?.() || "";
3419 + const message = "<Field.Label> expected a non-<label> element because the `nativeLabel` prop is false. Rendering a <label> assumes native label behavior while Base UI treats it as non-native, which can cause unexpected pointer behavior. Use a non-<label> in the `render` prop, or set `nativeLabel` to `true`.";
3420 + error(`${message}${ownerStackMessage}`);
3421 + }
3422 + }, [nativeLabel]);
3423 + }
3424 + const element = useRenderElement("label", componentProps, {
3425 + ref: [forwardedRef, labelRef],
3426 + state,
3427 + props: [labelProps, elementProps],
3428 + stateAttributesMapping: fieldValidityMapping
3429 + });
3430 + return element;
3431 + });
3432 + if (true) FieldLabel.displayName = "FieldLabel";
3433 +
3434 + // node_modules/@base-ui/react/field/error/FieldError.mjs
3435 + var React35 = __toESM(require_react(), 1);
3436 + var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
3437 + var stateAttributesMapping = {
3438 + ...fieldValidityMapping,
3439 + ...transitionStatusMapping
3440 + };
3441 + var FieldError = /* @__PURE__ */ React35.forwardRef(function FieldError2(componentProps, forwardedRef) {
3442 + const {
3443 + render,
3444 + id: idProp,
3445 + className,
3446 + match,
3447 + style,
3448 + ...elementProps
3449 + } = componentProps;
3450 + const id = useBaseUiId(idProp);
3451 + const {
3452 + validityData,
3453 + state: fieldState,
3454 + name: name16
3455 + } = useFieldRootContext(false);
3456 + const {
3457 + setMessageIds
3458 + } = useLabelableContext();
3459 + const {
3460 + errors
3461 + } = useFormContext();
3462 + const formError = name16 && Object.hasOwn(errors, name16) ? errors[name16] : null;
3463 + const hasFormError = !!(Array.isArray(formError) ? formError.length : formError);
3464 + const hasSpecificMatch = typeof match === "string";
3465 + let rendered = false;
3466 + if (match === true) {
3467 + rendered = true;
3468 + } else if (fieldState.disabled) {
3469 + rendered = false;
3470 + } else if (hasSpecificMatch) {
3471 + rendered = Boolean(validityData.state[match]);
3472 + } else {
3473 + rendered = hasFormError || validityData.state.valid === false;
3474 + }
3475 + const {
3476 + mounted,
3477 + transitionStatus,
3478 + setMounted
3479 + } = useTransitionStatus(rendered);
3480 + useIsoLayoutEffect(() => {
3481 + if (!rendered || !id) {
3482 + return void 0;
3483 + }
3484 + setMessageIds((v) => v.concat(id));
3485 + return () => {
3486 + setMessageIds((v) => v.filter((item) => item !== id));
3487 + };
3488 + }, [rendered, id, setMessageIds]);
3489 + const errorRef = React35.useRef(null);
3490 + const [lastRenderedMessage, setLastRenderedMessage] = React35.useState(null);
3491 + const [lastRenderedMessageKey, setLastRenderedMessageKey] = React35.useState(null);
3492 + let error2 = validityData.error;
3493 + if (!hasSpecificMatch && hasFormError) {
3494 + error2 = formError;
3495 + } else if (validityData.errors.length > 1) {
3496 + error2 = validityData.errors;
3497 + }
3498 + let errorMessage = error2;
3499 + if (Array.isArray(error2)) {
3500 + errorMessage = error2.length > 1 ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("ul", {
3501 + children: error2.map((message) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("li", {
3502 + children: message
3503 + }, message))
3504 + }) : error2[0];
3505 + }
3506 + const errorKey = Array.isArray(error2) ? JSON.stringify(error2) : error2;
3507 + if (rendered && errorKey !== lastRenderedMessageKey) {
3508 + setLastRenderedMessageKey(errorKey);
3509 + setLastRenderedMessage(errorMessage);
3510 + }
3511 + useOpenChangeComplete({
3512 + open: rendered,
3513 + ref: errorRef,
3514 + onComplete() {
3515 + if (!rendered) {
3516 + setMounted(false);
3517 + }
3518 + }
3519 + });
3520 + const state = {
3521 + ...fieldState,
3522 + transitionStatus
3523 + };
3524 + const element = useRenderElement("div", componentProps, {
3525 + ref: [forwardedRef, errorRef],
3526 + state,
3527 + props: [{
3528 + id,
3529 + children: rendered ? errorMessage : lastRenderedMessage
3530 + }, elementProps],
3531 + stateAttributesMapping,
3532 + enabled: mounted
3533 + });
3534 + if (!mounted) {
3535 + return null;
3536 + }
3537 + return element;
3538 + });
3539 + if (true) FieldError.displayName = "FieldError";
3540 +
3541 + // node_modules/@base-ui/react/field/description/FieldDescription.mjs
3542 + var React36 = __toESM(require_react(), 1);
3543 + var FieldDescription = /* @__PURE__ */ React36.forwardRef(function FieldDescription2(componentProps, forwardedRef) {
3544 + const {
3545 + render,
3546 + id: idProp,
3547 + className,
3548 + style,
3549 + ...elementProps
3550 + } = componentProps;
3551 + const id = useBaseUiId(idProp);
3552 + const fieldRootContext = useFieldRootContext(false);
3553 + const fieldItemContext = useFieldItemContext();
3554 + const {
3555 + setMessageIds
3556 + } = useLabelableContext();
3557 + const state = {
3558 + ...fieldRootContext.state,
3559 + disabled: fieldRootContext.disabled || fieldItemContext.disabled
3560 + };
3561 + useIsoLayoutEffect(() => {
3562 + if (!id) {
3563 + return void 0;
3564 + }
3565 + setMessageIds((v) => v.concat(id));
3566 + return () => {
3567 + setMessageIds((v) => v.filter((item) => item !== id));
3568 + };
3569 + }, [id, setMessageIds]);
3570 + const element = useRenderElement("p", componentProps, {
3571 + ref: forwardedRef,
3572 + state,
3573 + props: [{
3574 + id
3575 + }, elementProps],
3576 + stateAttributesMapping: fieldValidityMapping
3577 + });
3578 + return element;
3579 + });
3580 + if (true) FieldDescription.displayName = "FieldDescription";
3581 +
3582 + // node_modules/@base-ui/react/field/control/FieldControl.mjs
3583 + var React37 = __toESM(require_react(), 1);
3584 + var FieldControl = /* @__PURE__ */ React37.forwardRef(function FieldControl2(componentProps, forwardedRef) {
3585 + const {
3586 + render,
3587 + className,
3588 + id: idProp,
3589 + name: nameProp,
3590 + value: valueProp,
3591 + disabled: disabledProp = false,
3592 + onValueChange,
3593 + defaultValue,
3594 + autoFocus = false,
3595 + style,
3596 + ...elementProps
3597 + } = componentProps;
3598 + const {
3599 + state: fieldState,
3600 + name: fieldName,
3601 + disabled: fieldDisabled,
3602 + setTouched,
3603 + setDirty,
3604 + validityData,
3605 + setFocused,
3606 + setFilled,
3607 + validationMode,
3608 + validation
3609 + } = useFieldRootContext();
3610 + const {
3611 + clearErrors,
3612 + elementRef: formElementRef,
3613 + submitCountRef
3614 + } = useFormContext();
3615 + const disabled2 = fieldDisabled || disabledProp;
3616 + const name16 = fieldName ?? nameProp;
3617 + const state = {
3618 + ...fieldState,
3619 + disabled: disabled2
3620 + };
3621 + const {
3622 + labelId
3623 + } = useLabelableContext();
3624 + const id = useLabelableId({
3625 + id: idProp
3626 + });
3627 + const [valueUnwrapped] = useControlled({
3628 + controlled: valueProp,
3629 + default: defaultValue,
3630 + name: "FieldControl",
3631 + state: "value"
3632 + });
3633 + const isControlled = valueProp !== void 0;
3634 + const value = isControlled ? valueUnwrapped : void 0;
3635 + const serializedValue = value == null ? void 0 : String(value);
3636 + const getValueFromInput = useStableCallback(() => validation.inputRef.current?.value);
3637 + useRegisterFieldControl(validation.inputRef, id, serializedValue, getValueFromInput, !disabled2, nameProp);
3638 + useIsoLayoutEffect(() => {
3639 + const currentValue = serializedValue ?? validation.inputRef.current?.value;
3640 + if (currentValue !== void 0) {
3641 + setFilled(currentValue !== "");
3642 + }
3643 + }, [serializedValue, validation.inputRef, setFilled]);
3644 + useValueChanged(serializedValue, () => {
3645 + if (serializedValue === void 0) {
3646 + return;
3647 + }
3648 + clearErrors(name16);
3649 + setDirty(serializedValue !== (validityData.initialValue ?? ""));
3650 + validation.change(serializedValue);
3651 + });
3652 + const inputRef = React37.useRef(null);
3653 + const enterValidationTimeout = useTimeout();
3654 + useIsoLayoutEffect(() => {
3655 + if (autoFocus && inputRef.current === activeElement(ownerDocument(inputRef.current))) {
3656 + setFocused(true);
3657 + }
3658 + }, [autoFocus, setFocused]);
3659 + const element = useRenderElement("input", componentProps, {
3660 + ref: [forwardedRef, inputRef],
3661 + state,
3662 + props: [{
3663 + id,
3664 + disabled: disabled2,
3665 + name: name16,
3666 + ref: validation.inputRef,
3667 + "aria-labelledby": labelId,
3668 + autoFocus,
3669 + ...isControlled ? {
3670 + value
3671 + } : {
3672 + defaultValue
3673 + },
3674 + onChange(event) {
3675 + const inputValue = event.currentTarget.value;
3676 + const details = createChangeEventDetails(reason_parts_exports.none, event.nativeEvent);
3677 + onValueChange?.(inputValue, details);
3678 + if (isControlled) {
3679 + return;
3680 + }
3681 + setDirty(inputValue !== (validityData.initialValue ?? ""));
3682 + setFilled(inputValue !== "");
3683 + if (!event.nativeEvent.defaultPrevented && !details.isCanceled) {
3684 + clearErrors(name16);
3685 + validation.change(inputValue);
3686 + }
3687 + },
3688 + onFocus() {
3689 + setFocused(true);
3690 + },
3691 + onBlur(event) {
3692 + setTouched(true);
3693 + setFocused(false);
3694 + if (validationMode === "onBlur") {
3695 + const inputValue = event.currentTarget.value;
3696 + validation.commit(inputValue);
3697 + if (isControlled) {
3698 + queueMicrotask(() => {
3699 + const nextValue = validation.inputRef.current?.value;
3700 + if (nextValue !== void 0 && nextValue !== inputValue && nextValue !== (validityData.initialValue ?? "")) {
3701 + validation.commit(nextValue);
3702 + }
3703 + });
3704 + }
3705 + }
3706 + },
3707 + onKeyDown(event) {
3708 + if (event.currentTarget.tagName === "INPUT" && event.key === "Enter") {
3709 + setTouched(true);
3710 + const value2 = event.currentTarget.value;
3711 + const form = event.currentTarget.form;
3712 + if (form && form === formElementRef.current && !event.defaultPrevented) {
3713 + const input = event.currentTarget;
3714 + const submitCount = submitCountRef.current;
3715 + enterValidationTimeout.start(0, () => {
3716 + if (submitCountRef.current === submitCount) {
3717 + validation.commit(input.value);
3718 + }
3719 + });
3720 + } else {
3721 + validation.commit(value2);
3722 + }
3723 + }
3724 + }
3725 + }, elementProps, (props) => validation.getValidationProps(disabled2, props)],
3726 + stateAttributesMapping: fieldValidityMapping
3727 + });
3728 + return element;
3729 + });
3730 + if (true) FieldControl.displayName = "FieldControl";
3731 +
3732 + // node_modules/@base-ui/react/field/validity/FieldValidity.mjs
3733 + var React38 = __toESM(require_react(), 1);
3734 + var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
3735 + var FieldValidity = function FieldValidity2(props) {
3736 + const {
3737 + children
3738 + } = props;
3739 + const {
3740 + validityData,
3741 + invalid: invalid2
3742 + } = useFieldRootContext(false);
3743 + const combinedFieldValidityData = React38.useMemo(() => getCombinedFieldValidityData(validityData, invalid2), [validityData, invalid2]);
3744 + const isInvalid = combinedFieldValidityData.state.valid === false;
3745 + const {
3746 + transitionStatus
3747 + } = useTransitionStatus(isInvalid);
3748 + const fieldValidityState = React38.useMemo(() => {
3749 + return {
3750 + ...combinedFieldValidityData,
3751 + validity: combinedFieldValidityData.state,
3752 + transitionStatus
3753 + };
3754 + }, [combinedFieldValidityData, transitionStatus]);
3755 + return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(React38.Fragment, {
3756 + children: children(fieldValidityState)
3757 + });
3758 + };
3759 + if (true) FieldValidity.displayName = "FieldValidity";
3760 +
3761 + // node_modules/@base-ui/react/field/item/FieldItem.mjs
3762 + var React39 = __toESM(require_react(), 1);
3763 + var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
3764 + var FieldItem = /* @__PURE__ */ React39.forwardRef(function FieldItem2(componentProps, forwardedRef) {
3765 + const {
3766 + render,
3767 + className,
3768 + style,
3769 + disabled: disabledProp = false,
3770 + ...elementProps
3771 + } = componentProps;
3772 + const {
3773 + state: fieldState,
3774 + disabled: rootDisabled
3775 + } = useFieldRootContext(false);
3776 + const disabled2 = rootDisabled || disabledProp;
3777 + const state = {
3778 + ...fieldState,
3779 + disabled: disabled2
3780 + };
3781 + const fieldItemContext = React39.useMemo(() => ({
3782 + disabled: disabled2
3783 + }), [disabled2]);
3784 + const element = useRenderElement("div", componentProps, {
3785 + ref: forwardedRef,
3786 + state,
3787 + props: elementProps,
3788 + stateAttributesMapping: fieldValidityMapping
3789 + });
3790 + return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(LabelableProvider, {
3791 + children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FieldItemContext.Provider, {
3792 + value: fieldItemContext,
3793 + children: element
3794 + })
3795 + });
3796 + });
3797 + if (true) FieldItem.displayName = "FieldItem";
3798 +
3799 + // node_modules/@base-ui/react/input/Input.mjs
3800 + var React40 = __toESM(require_react(), 1);
3801 + var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
3802 + var Input = /* @__PURE__ */ React40.forwardRef(function Input2(props, forwardedRef) {
3803 + return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Control, {
3804 + ref: forwardedRef,
3805 + ...props
3806 + });
3807 + });
3808 + if (true) Input.displayName = "Input";
3809 +
3810 + // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
3811 + var React42 = __toESM(require_react(), 1);
3812 +
3813 + // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
3814 + var React41 = __toESM(require_react(), 1);
3815 +
3816 + // node_modules/@base-ui/react/internals/composite/constants.mjs
2532 3817 var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active";
2533 3818
2534 - // node_modules/@base-ui/react/esm/internals/composite/root/useCompositeRoot.js
2535 - var EMPTY_ARRAY2 = [];
3819 + // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs
2536 3820 function useCompositeRoot(params) {
2537 3821 const {
2538 - itemSizes,
2539 - cols = 1,
2540 3822 loopFocus = true,
3823 + orientation = "both",
3824 + grid,
2541 3825 onLoop,
2542 - dense = false,
2543 - orientation = "both",
2544 3826 direction,
2545 3827 highlightedIndex: externalHighlightedIndex,
2546 3828 onHighlightedIndexChange: externalSetHighlightedIndex,
2547 3829 rootRef: externalRef,
2548 3830 enableHomeAndEndKeys = false,
2549 - stopEventPropagation = false,
3831 + stopEventPropagation,
2550 3832 disabledIndices,
2551 - modifierKeys = EMPTY_ARRAY2
3833 + modifierKeys = EMPTY_ARRAY
2552 3834 } = params;
2553 - const [internalHighlightedIndex, internalSetHighlightedIndex] = React22.useState(0);
2554 - const isGrid = cols > 1;
2555 - const rootRef = React22.useRef(null);
3835 + const [internalHighlightedIndex, internalSetHighlightedIndex] = React41.useState(0);
3836 + const isGrid = grid != null;
3837 + const rootRef = React41.useRef(null);
2556 3838 const mergedRef = useMergedRefs(rootRef, externalRef);
2557 - const elementsRef = React22.useRef([]);
2558 - const hasSetDefaultIndexRef = React22.useRef(false);
3839 + const elementsRef = React41.useRef([]);
3840 + const hasSetDefaultIndexRef = React41.useRef(false);
3841 + const highlightedElementRef = React41.useRef(null);
2559 3842 const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex;
2560 - const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => {
2561 - (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index);
3843 + const onHighlightedIndexChange = useStableCallback((index2, shouldScrollIntoView = false) => {
3844 + highlightedElementRef.current = elementsRef.current[index2] ?? null;
3845 + (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index2);
2562 3846 if (shouldScrollIntoView) {
2563 - const newActiveItem = elementsRef.current[index];
3847 + const newActiveItem = elementsRef.current[index2];
2564 3848 scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation);
2565 3849 }
2566 3850 });
2567 3851 const onMapChange = useStableCallback((map) => {
2568 - if (map.size === 0 || hasSetDefaultIndexRef.current) {
3852 + if (map.size === 0) {
2569 3853 return;
2570 3854 }
3855 + if (hasSetDefaultIndexRef.current) {
3856 + const elements = elementsRef.current;
3857 + const nextIndex = elements.indexOf(highlightedElementRef.current);
3858 + if (nextIndex === -1) {
3859 + const replacement = elements[highlightedIndex];
3860 + if (!replacement || isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {
3861 + onHighlightedIndexChange(getFallbackIndex(elements, disabledIndices));
3862 + } else {
3863 + highlightedElementRef.current = replacement;
3864 + }
3865 + } else if (nextIndex !== highlightedIndex) {
3866 + onHighlightedIndexChange(nextIndex);
3867 + }
3868 + return;
3869 + }
2571 3870 hasSetDefaultIndexRef.current = true;
2572 3871 const sortedElements = Array.from(map.keys());
2573 3872 const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null;
2574 - const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1;
3873 + const activeIndex = activeItem ? map.get(activeItem)?.index ?? -1 : -1;
2575 3874 if (activeIndex !== -1) {
2576 3875 onHighlightedIndexChange(activeIndex);
3876 + } else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) {
3877 + const firstEnabledIndex = findNonDisabledListIndex(sortedElements, {
3878 + disabledIndices
3879 + });
3880 + if (!isIndexOutOfListBounds(sortedElements, firstEnabledIndex)) {
3881 + onHighlightedIndexChange(firstEnabledIndex);
3882 + }
2577 3883 }
2578 3884 scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation);
2579 3885 });
3886 + useIsoLayoutEffect(() => {
3887 + if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current) {
3888 + return;
3889 + }
3890 + const elements = elementsRef.current;
3891 + if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) {
3892 + const firstEnabledIndex = findNonDisabledListIndex(elements, {
3893 + disabledIndices
3894 + });
3895 + if (!isIndexOutOfListBounds(elements, firstEnabledIndex)) {
3896 + onHighlightedIndexChange(firstEnabledIndex);
3897 + }
3898 + }
3899 + }, [disabledIndices, externalHighlightedIndex, highlightedIndex, elementsRef, onHighlightedIndexChange]);
2580 3900 const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => {
2581 3901 if (!onLoop) {
2582 3902 return nextIndex;
2583 3903 }
2584 - return onLoop?.(event, prevIndex, nextIndex, elementsRef);
3904 + return onLoop(event, prevIndex, nextIndex, elementsRef);
2585 3905 });
2586 - const props = React22.useMemo(() => ({
2587 - "aria-orientation": orientation === "both" ? void 0 : orientation,
2588 - ref: mergedRef,
2589 - onFocus(event) {
2590 - const element = rootRef.current;
2591 - const target = getTarget(event.nativeEvent);
2592 - if (!element || target == null || !isNativeInput(target)) {
3906 + const onKeyDown = useStableCallback((event) => {
3907 + const isHomeOrEnd = event.key === HOME || event.key === END;
3908 + if (!COMPOSITE_KEYS.has(event.key) || !enableHomeAndEndKeys && isHomeOrEnd) {
3909 + return;
3910 + }
3911 + if (isModifierKeySet(event, modifierKeys)) {
3912 + return;
3913 + }
3914 + const element = rootRef.current;
3915 + if (!element) {
3916 + return;
3917 + }
3918 + const isRtl = direction === "rtl";
3919 + const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT;
3920 + const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT;
3921 + const forwardKey = orientation === "vertical" ? ARROW_DOWN : horizontalForwardKey;
3922 + const backwardKey = orientation === "vertical" ? ARROW_UP : horizontalBackwardKey;
3923 + const target = getTarget(event.nativeEvent);
3924 + if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
3925 + const selectionStart = target.selectionStart;
3926 + const selectionEnd = target.selectionEnd;
3927 + const textContent = target.value;
3928 + if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {
2593 3929 return;
2594 3930 }
2595 - target.setSelectionRange(0, target.value.length ?? 0);
2596 - },
2597 - onKeyDown(event) {
2598 - const RELEVANT_KEYS = enableHomeAndEndKeys ? COMPOSITE_KEYS : ARROW_KEYS;
2599 - if (!RELEVANT_KEYS.has(event.key)) {
3931 + if (event.key !== backwardKey && selectionStart < textContent.length) {
2600 3932 return;
2601 3933 }
2602 - if (isModifierKeySet(event, modifierKeys)) {
3934 + if (event.key !== forwardKey && selectionStart > 0) {
2603 3935 return;
2604 3936 }
2605 - const element = rootRef.current;
2606 - if (!element) {
2607 - return;
3937 + }
3938 + let nextIndex = highlightedIndex;
3939 + const minIndex = getMinListIndex(elementsRef, disabledIndices);
3940 + const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
3941 + if (grid != null) {
3942 + nextIndex = grid({
3943 + disabledIndices,
3944 + elementsRef,
3945 + event,
3946 + highlightedIndex,
3947 + loopFocus,
3948 + maxIndex,
3949 + minIndex,
3950 + onLoop: wrappedOnLoop,
3951 + orientation,
3952 + rtl: isRtl
3953 + });
3954 + }
3955 + const isForwardKey = orientation !== "vertical" && event.key === horizontalForwardKey || orientation !== "horizontal" && event.key === ARROW_DOWN;
3956 + const isBackwardKey = orientation !== "vertical" && event.key === horizontalBackwardKey || orientation !== "horizontal" && event.key === ARROW_UP;
3957 + if (enableHomeAndEndKeys) {
3958 + if (event.key === HOME) {
3959 + nextIndex = minIndex;
3960 + } else if (event.key === END) {
3961 + nextIndex = maxIndex;
2608 3962 }
2609 - const isRtl = direction === "rtl";
2610 - const horizontalForwardKey = isRtl ? ARROW_LEFT2 : ARROW_RIGHT2;
2611 - const forwardKey = {
2612 - horizontal: horizontalForwardKey,
2613 - vertical: ARROW_DOWN2,
2614 - both: horizontalForwardKey
2615 - }[orientation];
2616 - const horizontalBackwardKey = isRtl ? ARROW_RIGHT2 : ARROW_LEFT2;
2617 - const backwardKey = {
2618 - horizontal: horizontalBackwardKey,
2619 - vertical: ARROW_UP2,
2620 - both: horizontalBackwardKey
2621 - }[orientation];
2622 - const target = getTarget(event.nativeEvent);
2623 - if (target != null && isNativeInput(target) && !isElementDisabled(target)) {
2624 - const selectionStart = target.selectionStart;
2625 - const selectionEnd = target.selectionEnd;
2626 - const textContent = target.value ?? "";
2627 - if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) {
2628 - return;
3963 + }
3964 + if (nextIndex === highlightedIndex && (isForwardKey || isBackwardKey)) {
3965 + if (loopFocus && nextIndex === maxIndex && isForwardKey) {
3966 + nextIndex = minIndex;
3967 + if (onLoop) {
3968 + nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
2629 3969 }
2630 - if (event.key !== backwardKey && selectionStart < textContent.length) {
2631 - return;
3970 + } else if (loopFocus && nextIndex === minIndex && isBackwardKey) {
3971 + nextIndex = maxIndex;
3972 + if (onLoop) {
3973 + nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
2632 3974 }
2633 - if (event.key !== forwardKey && selectionStart > 0) {
2634 - return;
2635 - }
3975 + } else {
3976 + nextIndex = findNonDisabledListIndex(elementsRef.current, {
3977 + startingIndex: nextIndex,
3978 + decrement: isBackwardKey,
3979 + disabledIndices
3980 + });
2636 3981 }
2637 - let nextIndex = highlightedIndex;
2638 - const minIndex = getMinListIndex(elementsRef, disabledIndices);
2639 - const maxIndex = getMaxListIndex(elementsRef, disabledIndices);
2640 - if (isGrid) {
2641 - const sizes = itemSizes || Array.from({
2642 - length: elementsRef.current.length
2643 - }, () => ({
2644 - width: 1,
2645 - height: 1
2646 - }));
2647 - const cellMap = createGridCellMap(sizes, cols, dense);
2648 - const minGridIndex = cellMap.findIndex((index) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices));
2649 - const maxGridIndex = cellMap.reduce((foundIndex, index, cellIndex) => index != null && !isListIndexDisabled(elementsRef.current, index, disabledIndices) ? cellIndex : foundIndex, -1);
2650 - nextIndex = cellMap[getGridNavigatedIndex(cellMap.map((itemIndex) => itemIndex != null ? elementsRef.current[itemIndex] : null), {
2651 - event,
2652 - orientation,
2653 - loopFocus,
2654 - onLoop: wrappedOnLoop,
2655 - cols,
2656 - // treat undefined (empty grid spaces) as disabled indices so we
2657 - // don't end up in them
2658 - disabledIndices: getGridCellIndices([...disabledIndices || elementsRef.current.map((_, index) => isListIndexDisabled(elementsRef.current, index) ? index : void 0), void 0], cellMap),
2659 - minIndex: minGridIndex,
2660 - maxIndex: maxGridIndex,
2661 - prevIndex: getGridCellIndexOfCorner(
2662 - highlightedIndex > maxIndex ? minIndex : highlightedIndex,
2663 - sizes,
2664 - cellMap,
2665 - cols,
2666 - // use a corner matching the edge closest to the direction we're
2667 - // moving in so we don't end up in the same item. Prefer
2668 - // top/left over bottom/right.
2669 - // eslint-disable-next-line no-nested-ternary
2670 - event.key === ARROW_DOWN2 ? "bl" : event.key === ARROW_RIGHT2 ? "tr" : "tl"
2671 - ),
2672 - rtl: isRtl
2673 - })];
3982 + }
3983 + if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
3984 + if (stopEventPropagation) {
3985 + event.stopPropagation();
2674 3986 }
2675 - const forwardKeys = {
2676 - horizontal: [horizontalForwardKey],
2677 - vertical: [ARROW_DOWN2],
2678 - both: [horizontalForwardKey, ARROW_DOWN2]
2679 - }[orientation];
2680 - const backwardKeys = {
2681 - horizontal: [horizontalBackwardKey],
2682 - vertical: [ARROW_UP2],
2683 - both: [horizontalBackwardKey, ARROW_UP2]
2684 - }[orientation];
2685 - const preventedKeys = isGrid ? RELEVANT_KEYS : {
2686 - horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS,
2687 - vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS,
2688 - both: RELEVANT_KEYS
2689 - }[orientation];
2690 - if (enableHomeAndEndKeys) {
2691 - if (event.key === HOME) {
2692 - nextIndex = minIndex;
2693 - } else if (event.key === END) {
2694 - nextIndex = maxIndex;
2695 - }
3987 + if (isGrid || isHomeOrEnd || isForwardKey || isBackwardKey) {
3988 + event.preventDefault();
2696 3989 }
2697 - if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) {
2698 - if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) {
2699 - nextIndex = minIndex;
2700 - if (onLoop) {
2701 - nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
2702 - }
2703 - } else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) {
2704 - nextIndex = maxIndex;
2705 - if (onLoop) {
2706 - nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef);
2707 - }
2708 - } else {
2709 - nextIndex = findNonDisabledListIndex(elementsRef.current, {
2710 - startingIndex: nextIndex,
2711 - decrement: backwardKeys.includes(event.key),
2712 - disabledIndices
2713 - });
2714 - }
3990 + onHighlightedIndexChange(nextIndex, true);
3991 + queueMicrotask(() => {
3992 + elementsRef.current[nextIndex]?.focus();
3993 + });
3994 + }
3995 + });
3996 + const props = {
3997 + ref: mergedRef,
3998 + onFocus(event) {
3999 + const element = rootRef.current;
4000 + const target = getTarget(event.nativeEvent);
4001 + if (!element || target == null || !isNativeInput(target)) {
4002 + return;
2715 4003 }
2716 - if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) {
2717 - if (stopEventPropagation) {
2718 - event.stopPropagation();
2719 - }
2720 - if (preventedKeys.has(event.key)) {
2721 - event.preventDefault();
2722 - }
2723 - onHighlightedIndexChange(nextIndex, true);
2724 - queueMicrotask(() => {
2725 - elementsRef.current[nextIndex]?.focus();
2726 - });
2727 - }
2728 - }
2729 - }), [cols, dense, direction, disabledIndices, elementsRef, enableHomeAndEndKeys, highlightedIndex, isGrid, itemSizes, loopFocus, onLoop, wrappedOnLoop, mergedRef, modifierKeys, onHighlightedIndexChange, orientation, stopEventPropagation]);
2730 - return React22.useMemo(() => ({
4004 + target.setSelectionRange(0, target.value.length);
4005 + },
4006 + onKeyDown
4007 + };
4008 + return {
2731 4009 props,
2732 4010 highlightedIndex,
2733 4011 onHighlightedIndexChange,
2734 4012 elementsRef,
2735 - disabledIndices,
2736 4013 onMapChange,
2737 - relayKeyboardEvent: props.onKeyDown
2738 - }), [props, highlightedIndex, onHighlightedIndexChange, elementsRef, disabledIndices, onMapChange]);
4014 + relayKeyboardEvent: onKeyDown
4015 + };
2739 4016 }
4017 + function getFallbackIndex(elements, disabledIndices) {
4018 + let fallbackIndex = -1;
4019 + for (let index2 = 0; index2 < elements.length; index2 += 1) {
4020 + const element = elements[index2];
4021 + if (!element || isListIndexDisabled(elements, index2, disabledIndices)) {
4022 + continue;
4023 + }
4024 + if (element.hasAttribute(ACTIVE_COMPOSITE_ITEM)) {
4025 + return index2;
4026 + }
4027 + if (fallbackIndex === -1) {
4028 + fallbackIndex = index2;
4029 + }
4030 + }
4031 + return Math.max(fallbackIndex, 0);
4032 + }
2740 4033 function isModifierKeySet(event, ignoredModifierKeys) {
2741 - for (const key of MODIFIER_KEYS.values()) {
4034 + for (const key of MODIFIER_KEYS) {
2742 4035 if (ignoredModifierKeys.includes(key)) {
2743 4036 continue;
2744 4037 }
2745 4038 if (event.getModifierState(key)) {
@@ -2748,10 +4041,10 @@
2748 4041 }
2749 4042 return false;
2750 4043 }
2751 4044
2752 - // node_modules/@base-ui/react/esm/internals/composite/root/CompositeRoot.js
2753 - var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1);
4045 + // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs
4046 + var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
2754 4047 function CompositeRoot(componentProps) {
2755 4048 const {
2756 4049 render,
2757 4050 className,
@@ -2758,17 +4051,15 @@
2758 4051 style,
2759 4052 refs = EMPTY_ARRAY,
2760 4053 props = EMPTY_ARRAY,
2761 4054 state = EMPTY_OBJECT,
2762 - stateAttributesMapping: stateAttributesMapping3,
4055 + stateAttributesMapping: stateAttributesMapping4,
2763 4056 highlightedIndex: highlightedIndexProp,
2764 4057 onHighlightedIndexChange: onHighlightedIndexChangeProp,
2765 4058 orientation,
2766 - dense,
2767 - itemSizes,
4059 + grid,
2768 4060 loopFocus,
2769 4061 onLoop,
2770 - cols,
2771 4062 enableHomeAndEndKeys,
2772 4063 onMapChange: onMapChangeProp,
2773 4064 stopEventPropagation = true,
2774 4065 rootRef,
@@ -2786,13 +4077,11 @@
2786 4077 elementsRef,
2787 4078 onMapChange: onMapChangeUnwrapped,
2788 4079 relayKeyboardEvent
2789 4080 } = useCompositeRoot({
2790 - itemSizes,
2791 - cols,
4081 + grid,
2792 4082 loopFocus,
2793 4083 onLoop,
2794 - dense,
2795 4084 orientation,
2796 4085 highlightedIndex: highlightedIndexProp,
2797 4086 onHighlightedIndexChange: onHighlightedIndexChangeProp,
2798 4087 rootRef,
@@ -2805,19 +4094,19 @@
2805 4094 const element = useRenderElement(tag, componentProps, {
2806 4095 state,
2807 4096 ref: refs,
2808 4097 props: [defaultProps, ...props, elementProps],
2809 - stateAttributesMapping: stateAttributesMapping3
4098 + stateAttributesMapping: stateAttributesMapping4
2810 4099 });
2811 - const contextValue = React23.useMemo(() => ({
4100 + const contextValue = React42.useMemo(() => ({
2812 4101 highlightedIndex,
2813 4102 onHighlightedIndexChange,
2814 4103 highlightItemOnHover,
2815 4104 relayKeyboardEvent
2816 4105 }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]);
2817 - return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CompositeRootContext.Provider, {
4106 + return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompositeRootContext.Provider, {
2818 4107 value: contextValue,
2819 - children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CompositeList, {
4108 + children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CompositeList, {
2820 4109 elementsRef,
2821 4110 onMapChange: (newMap) => {
2822 4111 onMapChangeProp?.(newMap);
2823 4112 onMapChangeUnwrapped(newMap);
@@ -2826,9 +4115,12 @@
2826 4115 })
2827 4116 });
2828 4117 }
2829 4118
2830 - // node_modules/@base-ui/react/esm/utils/useIsHydrating.js
4119 + // node_modules/@base-ui/react/internals/prehydrationScript.stub.mjs
4120 + var script = "";
4121 +
4122 + // node_modules/@base-ui/react/utils/useIsHydrating.mjs
2831 4123 var import_shim = __toESM(require_shim(), 1);
2832 4124 function subscribe() {
2833 4125 return NOOP;
2834 4126 }
@@ -2841,11 +4133,34 @@
2841 4133 function useIsHydrating() {
2842 4134 return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot);
2843 4135 }
2844 4136
2845 - // node_modules/@base-ui/react/esm/tabs/index.parts.js
2846 - var index_parts_exports = {};
2847 - __export(index_parts_exports, {
4137 + // node_modules/@base-ui/react/internals/PrehydrationScript.mjs
4138 + var React43 = __toESM(require_react(), 1);
4139 + var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
4140 + function PrehydrationScript(props) {
4141 + const {
4142 + script: script2
4143 + } = props;
4144 + const {
4145 + nonce
4146 + } = useCSPContext();
4147 + const isHydrating = useIsHydrating();
4148 + if (!isHydrating) {
4149 + return null;
4150 + }
4151 + return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("script", {
4152 + nonce,
4153 + dangerouslySetInnerHTML: {
4154 + __html: script2
4155 + },
4156 + suppressHydrationWarning: true
4157 + });
4158 + }
4159 +
4160 + // node_modules/@base-ui/react/tabs/index.parts.mjs
4161 + var index_parts_exports2 = {};
4162 + __export(index_parts_exports2, {
2848 4163 Indicator: () => TabsIndicator,
2849 4164 List: () => TabsList,
2850 4165 Panel: () => TabsPanel,
2851 4166 Root: () => TabsRoot,
@@ -2851,17 +4166,17 @@
2851 4166 Root: () => TabsRoot,
2852 4167 Tab: () => TabsTab
2853 4168 });
2854 4169
2855 - // node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
2856 - var React25 = __toESM(require_react(), 1);
4170 + // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
4171 + var React45 = __toESM(require_react(), 1);
2857 4172
2858 - // node_modules/@base-ui/react/esm/tabs/root/TabsRootContext.js
2859 - var React24 = __toESM(require_react(), 1);
2860 - var TabsRootContext = /* @__PURE__ */ React24.createContext(void 0);
4173 + // node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs
4174 + var React44 = __toESM(require_react(), 1);
4175 + var TabsRootContext = /* @__PURE__ */ React44.createContext(void 0);
2861 4176 if (true) TabsRootContext.displayName = "TabsRootContext";
2862 4177 function useTabsRootContext() {
2863 - const context = React24.useContext(TabsRootContext);
4178 + const context = React44.useContext(TabsRootContext);
2864 4179 if (context === void 0) {
2865 4180 throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64));
2866 4181 }
2867 4182 return context;
@@ -2866,25 +4181,21 @@
2866 4181 }
2867 4182 return context;
2868 4183 }
2869 4184
2870 - // node_modules/@base-ui/react/esm/tabs/root/TabsRootDataAttributes.js
2871 - var TabsRootDataAttributes = /* @__PURE__ */ (function(TabsRootDataAttributes2) {
2872 - TabsRootDataAttributes2["activationDirection"] = "data-activation-direction";
2873 - TabsRootDataAttributes2["orientation"] = "data-orientation";
2874 - return TabsRootDataAttributes2;
2875 - })({});
4185 + // node_modules/@base-ui/react/tabs/root/TabsRootDataAttributes.mjs
4186 + var activationDirection = "data-activation-direction";
2876 4187
2877 - // node_modules/@base-ui/react/esm/tabs/root/stateAttributesMapping.js
4188 + // node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs
2878 4189 var tabsStateAttributesMapping = {
2879 4190 tabActivationDirection: (dir) => ({
2880 - [TabsRootDataAttributes.activationDirection]: dir
4191 + [activationDirection]: dir
2881 4192 })
2882 4193 };
2883 4194
2884 - // node_modules/@base-ui/react/esm/tabs/root/TabsRoot.js
2885 - var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1);
2886 - var TabsRoot = /* @__PURE__ */ React25.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
4195 + // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs
4196 + var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
4197 + var TabsRoot = /* @__PURE__ */ React45.forwardRef(function TabsRoot2(componentProps, forwardedRef) {
2887 4198 const {
2888 4199 className,
2889 4200 defaultValue: defaultValueProp = 0,
2890 4201 onValueChange: onValueChangeProp,
@@ -2894,10 +4205,10 @@
2894 4205 style,
2895 4206 ...elementProps
2896 4207 } = componentProps;
2897 4208 const hasExplicitDefaultValueProp = componentProps.defaultValue !== void 0;
2898 - const tabPanelRefs = React25.useRef([]);
2899 - const [mountedTabPanels, setMountedTabPanels] = React25.useState(() => /* @__PURE__ */ new Map());
4209 + const tabPanelRefs = React45.useRef([]);
4210 + const [mountedTabPanels, setMountedTabPanels] = React45.useState(() => /* @__PURE__ */ new Map());
2900 4211 const [value, setValue] = useControlled({
2901 4212 controlled: valueProp,
2902 4213 default: defaultValueProp,
2903 4214 name: "Tabs",
@@ -2903,21 +4214,12 @@
2903 4214 name: "Tabs",
2904 4215 state: "value"
2905 4216 });
2906 4217 const isControlled = valueProp !== void 0;
2907 - const [tabMap, setTabMap] = React25.useState(() => /* @__PURE__ */ new Map());
2908 - const getTabElementBySelectedValue = React25.useCallback((selectedValue) => {
2909 - if (selectedValue === void 0) {
2910 - return null;
2911 - }
2912 - for (const [tabElement, tabMetadata] of tabMap.entries()) {
2913 - if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) {
2914 - return tabElement;
2915 - }
2916 - }
2917 - return null;
2918 - }, [tabMap]);
2919 - const [activationDirectionState, setActivationDirectionState] = React25.useState(() => ({
4218 + const [tabMap, setTabMap] = React45.useState(() => /* @__PURE__ */ new Map());
4219 + const lastKnownTabElementRef = React45.useRef(void 0);
4220 + const getTabElementBySelectedValue = React45.useCallback((selectedValue) => findTabElement(tabMap, selectedValue), [tabMap]);
4221 + const [activationDirectionState, setActivationDirectionState] = React45.useState(() => ({
2920 4222 previousValue: value,
2921 4223 tabActivationDirection: "none"
2922 4224 }));
2923 4225 const {
@@ -2941,10 +4243,10 @@
2941 4243 tabActivationDirection
2942 4244 });
2943 4245 }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]);
2944 4246 const onValueChange = useStableCallback((newValue, eventDetails) => {
2945 - const activationDirection = computeActivationDirection(value, newValue, orientation, tabMap);
2946 - eventDetails.activationDirection = activationDirection;
4247 + const activationDirection2 = computeActivationDirection(value, newValue, orientation, tabMap);
4248 + eventDetails.activationDirection = activationDirection2;
2947 4249 onValueChangeProp?.(newValue, eventDetails);
2948 4250 if (eventDetails.isCanceled) {
2949 4251 return;
2950 4252 }
@@ -2956,38 +4258,35 @@
2956 4258 }));
2957 4259 });
2958 4260 const registerMountedTabPanel = useStableCallback((panelValue, panelId) => {
2959 4261 setMountedTabPanels((prev) => {
2960 - if (prev.get(panelValue) === panelId) {
2961 - return prev;
2962 - }
2963 4262 const next = new Map(prev);
2964 4263 next.set(panelValue, panelId);
2965 4264 return next;
2966 4265 });
4266 + return () => {
4267 + setMountedTabPanels((prev) => {
4268 + if (prev.get(panelValue) !== panelId) {
4269 + return prev;
4270 + }
4271 + const next = new Map(prev);
4272 + next.delete(panelValue);
4273 + return next;
4274 + });
4275 + };
2967 4276 });
2968 - const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => {
2969 - setMountedTabPanels((prev) => {
2970 - if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) {
2971 - return prev;
2972 - }
2973 - const next = new Map(prev);
2974 - next.delete(panelValue);
2975 - return next;
2976 - });
2977 - });
2978 - const getTabPanelIdByValue = React25.useCallback((tabValue) => {
4277 + const getTabPanelIdByValue = React45.useCallback((tabValue) => {
2979 4278 return mountedTabPanels.get(tabValue);
2980 4279 }, [mountedTabPanels]);
2981 - const getTabIdByPanelValue = React25.useCallback((tabPanelValue) => {
4280 + const getTabIdByPanelValue = React45.useCallback((tabPanelValue) => {
2982 4281 for (const tabMetadata of tabMap.values()) {
2983 - if (tabPanelValue === tabMetadata?.value) {
2984 - return tabMetadata?.id;
4282 + if (tabPanelValue === tabMetadata.value) {
4283 + return tabMetadata.id;
2985 4284 }
2986 4285 }
2987 4286 return void 0;
2988 4287 }, [tabMap]);
2989 - const tabsContextValue = React25.useMemo(() => ({
4288 + const tabsContextValue = React45.useMemo(() => ({
2990 4289 getTabElementBySelectedValue,
2991 4290 getTabIdByPanelValue,
2992 4291 getTabPanelIdByValue,
2993 4292 onValueChange,
@@ -2993,31 +4292,31 @@
2993 4292 onValueChange,
2994 4293 orientation,
2995 4294 registerMountedTabPanel,
2996 4295 setTabMap,
2997 - unregisterMountedTabPanel,
2998 4296 tabActivationDirection,
2999 4297 value
3000 - }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, unregisterMountedTabPanel, tabActivationDirection, value]);
3001 - const selectedTabMetadata = React25.useMemo(() => {
4298 + }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, tabActivationDirection, value]);
4299 + const selectedTabMetadata = React45.useMemo(() => {
3002 4300 for (const tabMetadata of tabMap.values()) {
3003 - if (tabMetadata != null && tabMetadata.value === value) {
4301 + if (tabMetadata.value === value) {
3004 4302 return tabMetadata;
3005 4303 }
3006 4304 }
3007 4305 return void 0;
3008 4306 }, [tabMap, value]);
3009 - const firstEnabledTabValue = React25.useMemo(() => {
4307 + const firstEnabledTabValue = React45.useMemo(() => {
3010 4308 for (const tabMetadata of tabMap.values()) {
3011 - if (tabMetadata != null && !tabMetadata.disabled) {
4309 + if (!tabMetadata.disabled) {
3012 4310 return tabMetadata.value;
3013 4311 }
3014 4312 }
3015 4313 return void 0;
3016 4314 }, [tabMap]);
3017 - const shouldNotifyInitialValueChangeRef = React25.useRef(!hasExplicitDefaultValueProp);
3018 - const shouldHonorDisabledDefaultValueRef = React25.useRef(hasExplicitDefaultValueProp);
3019 - const didRegisterTabsRef = React25.useRef(false);
4315 + const shouldNotifyInitialValueChangeRef = React45.useRef(!hasExplicitDefaultValueProp);
4316 + const initialDefaultValueRef = React45.useRef(defaultValueProp);
4317 + const shouldHonorDisabledDefaultValueRef = React45.useRef(hasExplicitDefaultValueProp);
4318 + const didRegisterTabsRef = React45.useRef(false);
3020 4319 useIsoLayoutEffect(() => {
3021 4320 if (isControlled) {
3022 4321 return;
3023 4322 }
@@ -3022,34 +4321,29 @@
3022 4321 return;
3023 4322 }
3024 4323 function commitAutomaticValueChange(fallbackValue, fallbackReason) {
3025 4324 setValue(fallbackValue);
3026 - setActivationDirectionState((prev) => {
3027 - if (prev.previousValue === fallbackValue && prev.tabActivationDirection === "none") {
3028 - return prev;
3029 - }
3030 - return {
3031 - previousValue: fallbackValue,
3032 - tabActivationDirection: "none"
3033 - };
4325 + setActivationDirectionState({
4326 + previousValue: fallbackValue,
4327 + tabActivationDirection: "none"
3034 4328 });
3035 4329 notifyAutomaticValueChange(fallbackValue, fallbackReason);
3036 4330 shouldNotifyInitialValueChangeRef.current = false;
3037 4331 }
3038 4332 if (tabMap.size === 0) {
3039 - if (!didRegisterTabsRef.current || value === null) {
3040 - return;
4333 + if (didRegisterTabsRef.current && value !== null && !lastKnownTabElementRef.current?.isConnected) {
4334 + commitAutomaticValueChange(null, reason_parts_exports.missing);
3041 4335 }
3042 - commitAutomaticValueChange(null, reason_parts_exports.missing);
3043 4336 return;
3044 4337 }
3045 4338 didRegisterTabsRef.current = true;
4339 + lastKnownTabElementRef.current = tabMap.keys().next().value;
3046 4340 const selectionIsDisabled = selectedTabMetadata?.disabled;
3047 4341 const selectionIsMissing = selectedTabMetadata == null && value !== null;
3048 - if (!selectionIsDisabled && value === defaultValueProp) {
4342 + if (!selectionIsDisabled && value === initialDefaultValueRef.current) {
3049 4343 shouldHonorDisabledDefaultValueRef.current = false;
3050 4344 }
3051 - if (shouldHonorDisabledDefaultValueRef.current && selectionIsDisabled && value === defaultValueProp) {
4345 + if (shouldHonorDisabledDefaultValueRef.current && selectionIsDisabled && value === initialDefaultValueRef.current) {
3052 4346 return;
3053 4347 }
3054 4348 const shouldNotifyInitialValueChange = shouldNotifyInitialValueChangeRef.current;
3055 4349 if (selectionIsDisabled || selectionIsMissing) {
@@ -3070,9 +4364,9 @@
3070 4364 if (shouldNotifyInitialValueChange && selectedTabMetadata != null) {
3071 4365 notifyAutomaticValueChange(value, reason_parts_exports.initial);
3072 4366 shouldNotifyInitialValueChangeRef.current = false;
3073 4367 }
3074 - }, [defaultValueProp, firstEnabledTabValue, isControlled, notifyAutomaticValueChange, selectedTabMetadata, setValue, tabMap, value]);
4368 + }, [firstEnabledTabValue, isControlled, notifyAutomaticValueChange, selectedTabMetadata, setValue, tabMap, value]);
3075 4369 const state = {
3076 4370 orientation,
3077 4371 tabActivationDirection
3078 4372 };
@@ -3081,11 +4375,11 @@
3081 4375 ref: forwardedRef,
3082 4376 props: elementProps,
3083 4377 stateAttributesMapping: tabsStateAttributesMapping
3084 4378 });
3085 - return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabsRootContext.Provider, {
4379 + return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(TabsRootContext.Provider, {
3086 4380 value: tabsContextValue,
3087 - children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CompositeList, {
4381 + children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CompositeList, {
3088 4382 elementsRef: tabPanelRefs,
3089 4383 children: element
3090 4384 })
3091 4385 });
@@ -3090,67 +4384,49 @@
3090 4384 })
3091 4385 });
3092 4386 });
3093 4387 if (true) TabsRoot.displayName = "TabsRoot";
4388 + function findTabElement(tabMap, value) {
4389 + for (const [tabElement, tabMetadata] of tabMap.entries()) {
4390 + if (value === tabMetadata.value) {
4391 + return tabElement;
4392 + }
4393 + }
4394 + return null;
4395 + }
3094 4396 function computeActivationDirection(oldValue, newValue, orientation, tabMap) {
3095 4397 if (oldValue == null || newValue == null) {
3096 4398 return "none";
3097 4399 }
3098 - let oldTab = null;
3099 - let newTab = null;
3100 - for (const [tabElement, tabMetadata] of tabMap.entries()) {
3101 - if (tabMetadata == null) {
3102 - continue;
3103 - }
3104 - const tabValue = tabMetadata.value ?? tabMetadata.index;
3105 - if (oldValue === tabValue) {
3106 - oldTab = tabElement;
3107 - }
3108 - if (newValue === tabValue) {
3109 - newTab = tabElement;
3110 - }
3111 - if (oldTab != null && newTab != null) {
3112 - break;
3113 - }
3114 - }
4400 + const [positionProp, backward, forward] = orientation === "horizontal" ? ["left", "left", "right"] : ["top", "up", "down"];
4401 + const oldTab = findTabElement(tabMap, oldValue);
4402 + const newTab = findTabElement(tabMap, newValue);
3115 4403 if (oldTab == null || newTab == null) {
3116 4404 if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) {
3117 - if (orientation === "horizontal") {
3118 - return newValue > oldValue ? "right" : "left";
3119 - }
3120 - return newValue > oldValue ? "down" : "up";
4405 + return newValue > oldValue ? forward : backward;
3121 4406 }
3122 4407 return "none";
3123 4408 }
3124 - const oldRect = oldTab.getBoundingClientRect();
3125 - const newRect = newTab.getBoundingClientRect();
3126 - if (orientation === "horizontal") {
3127 - if (newRect.left < oldRect.left) {
3128 - return "left";
3129 - }
3130 - if (newRect.left > oldRect.left) {
3131 - return "right";
3132 - }
3133 - } else {
3134 - if (newRect.top < oldRect.top) {
3135 - return "up";
3136 - }
3137 - if (newRect.top > oldRect.top) {
3138 - return "down";
3139 - }
4409 + const oldPosition = oldTab.getBoundingClientRect()[positionProp];
4410 + const newPosition = newTab.getBoundingClientRect()[positionProp];
4411 + if (newPosition < oldPosition) {
4412 + return backward;
3140 4413 }
4414 + if (newPosition > oldPosition) {
4415 + return forward;
4416 + }
3141 4417 return "none";
3142 4418 }
3143 4419
3144 - // node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
3145 - var React27 = __toESM(require_react(), 1);
4420 + // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
4421 + var React47 = __toESM(require_react(), 1);
3146 4422
3147 - // node_modules/@base-ui/react/esm/tabs/list/TabsListContext.js
3148 - var React26 = __toESM(require_react(), 1);
3149 - var TabsListContext = /* @__PURE__ */ React26.createContext(void 0);
4423 + // node_modules/@base-ui/react/tabs/list/TabsListContext.mjs
4424 + var React46 = __toESM(require_react(), 1);
4425 + var TabsListContext = /* @__PURE__ */ React46.createContext(void 0);
3150 4426 if (true) TabsListContext.displayName = "TabsListContext";
3151 4427 function useTabsListContext() {
3152 - const context = React26.useContext(TabsListContext);
4428 + const context = React46.useContext(TabsListContext);
3153 4429 if (context === void 0) {
3154 4430 throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65));
3155 4431 }
3156 4432 return context;
@@ -3155,10 +4431,10 @@
3155 4431 }
3156 4432 return context;
3157 4433 }
3158 4434
3159 - // node_modules/@base-ui/react/esm/tabs/tab/TabsTab.js
3160 - var TabsTab = /* @__PURE__ */ React27.forwardRef(function TabsTab2(componentProps, forwardedRef) {
4435 + // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs
4436 + var TabsTab = /* @__PURE__ */ React47.forwardRef(function TabsTab2(componentProps, forwardedRef) {
3161 4437 const {
3162 4438 className,
3163 4439 disabled: disabled2 = false,
3164 4440 render,
@@ -3170,20 +4446,23 @@
3170 4446 } = componentProps;
3171 4447 const {
3172 4448 value: activeTabValue,
3173 4449 getTabPanelIdByValue,
3174 - orientation
4450 + onValueChange,
4451 + orientation,
4452 + tabActivationDirection
3175 4453 } = useTabsRootContext();
3176 4454 const {
3177 4455 activateOnFocus,
3178 - highlightedTabIndex,
3179 - onTabActivation,
3180 4456 registerTabResizeObserverElement,
3181 - setHighlightedTabIndex,
3182 4457 tabsListElement
3183 4458 } = useTabsListContext();
4459 + const {
4460 + highlightedIndex,
4461 + onHighlightedIndexChange
4462 + } = useCompositeRootContext();
3184 4463 const id = useBaseUiId(idProp);
3185 - const tabMetadata = React27.useMemo(() => ({
4464 + const tabMetadata = React47.useMemo(() => ({
3186 4465 disabled: disabled2,
3187 4466 id,
3188 4467 value
3189 4468 }), [disabled2, id, value]);
@@ -3189,9 +4468,9 @@
3189 4468 }), [disabled2, id, value]);
3190 4469 const {
3191 4470 compositeProps,
3192 4471 compositeRef,
3193 - index
4472 + index: index2
3194 4473 // hook is used instead of the CompositeItem component
3195 4474 // because the index is needed for Tab internals
3196 4475 } = useCompositeItem({
3197 4476 metadata: tabMetadata
@@ -3196,23 +4475,20 @@
3196 4475 } = useCompositeItem({
3197 4476 metadata: tabMetadata
3198 4477 });
3199 4478 const active = value === activeTabValue;
3200 - const isNavigatingRef = React27.useRef(false);
3201 - const tabElementRef = React27.useRef(null);
3202 - React27.useEffect(() => {
3203 - const tabElement = tabElementRef.current;
3204 - if (!tabElement) {
3205 - return void 0;
3206 - }
3207 - return registerTabResizeObserverElement(tabElement);
3208 - }, [registerTabResizeObserverElement]);
4479 + const isNavigatingRef = React47.useRef(false);
4480 + const unobserveTabElementRef = React47.useRef(null);
4481 + const observeTabElement = useStableCallback((element2) => {
4482 + unobserveTabElementRef.current?.();
4483 + unobserveTabElementRef.current = element2 ? registerTabResizeObserverElement(element2) : null;
4484 + });
3209 4485 useIsoLayoutEffect(() => {
3210 4486 if (isNavigatingRef.current) {
3211 4487 isNavigatingRef.current = false;
3212 4488 return;
3213 4489 }
3214 - if (!(active && index > -1 && highlightedTabIndex !== index)) {
4490 + if (!(active && index2 > -1 && highlightedIndex !== index2)) {
3215 4491 return;
3216 4492 }
3217 4493 const listElement = tabsListElement;
3218 4494 if (listElement != null) {
@@ -3221,11 +4497,11 @@
3221 4497 return;
3222 4498 }
3223 4499 }
3224 4500 if (!disabled2) {
3225 - setHighlightedTabIndex(index);
4501 + onHighlightedIndexChange(index2);
3226 4502 }
3227 - }, [active, index, highlightedTabIndex, setHighlightedTabIndex, disabled2, tabsListElement]);
4503 + }, [active, index2, highlightedIndex, onHighlightedIndexChange, disabled2, tabsListElement]);
3228 4504 const {
3229 4505 getButtonProps,
3230 4506 buttonRef
3231 4507 } = useButton({
@@ -3233,33 +4509,28 @@
3233 4509 native: nativeButton,
3234 4510 focusableWhenDisabled: true
3235 4511 });
3236 4512 const tabPanelId = getTabPanelIdByValue(value);
3237 - const isPressingRef = React27.useRef(false);
3238 - const isMainButtonRef = React27.useRef(false);
4513 + const isPressingRef = React47.useRef(false);
4514 + const isMainButtonRef = React47.useRef(false);
4515 + function activate(event) {
4516 + onValueChange(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
4517 + activationDirection: "none"
4518 + }));
4519 + }
3239 4520 function onClick(event) {
3240 4521 if (active || disabled2) {
3241 4522 return;
3242 4523 }
3243 - onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
3244 - activationDirection: "none"
3245 - }));
4524 + activate(event);
3246 4525 }
3247 4526 function onFocus(event) {
3248 - if (active) {
4527 + if (active || disabled2) {
3249 4528 return;
3250 4529 }
3251 - if (index > -1 && !disabled2) {
3252 - setHighlightedTabIndex(index);
3253 - }
3254 - if (disabled2) {
3255 - return;
3256 - }
3257 4530 if (activateOnFocus && (!isPressingRef.current || // keyboard or touch focus
3258 - isPressingRef.current && isMainButtonRef.current)) {
3259 - onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, {
3260 - activationDirection: "none"
3261 - }));
4531 + isMainButtonRef.current)) {
4532 + activate(event);
3262 4533 }
3263 4534 }
3264 4535 function onPointerDown(event) {
3265 4536 if (active || disabled2) {
@@ -3265,28 +4536,28 @@
3265 4536 if (active || disabled2) {
3266 4537 return;
3267 4538 }
3268 4539 isPressingRef.current = true;
3269 - function handlePointerUp() {
4540 + isMainButtonRef.current = event.button === 0;
4541 + const doc = ownerDocument(event.currentTarget);
4542 + function handlePointerEnd() {
3270 4543 isPressingRef.current = false;
3271 4544 isMainButtonRef.current = false;
4545 + doc.removeEventListener("pointerup", handlePointerEnd);
4546 + doc.removeEventListener("pointercancel", handlePointerEnd);
3272 4547 }
3273 - if (!event.button || event.button === 0) {
3274 - isMainButtonRef.current = true;
3275 - const doc = ownerDocument(event.currentTarget);
3276 - doc.addEventListener("pointerup", handlePointerUp, {
3277 - once: true
3278 - });
3279 - }
4548 + doc.addEventListener("pointerup", handlePointerEnd);
4549 + doc.addEventListener("pointercancel", handlePointerEnd);
3280 4550 }
3281 4551 const state = {
3282 4552 disabled: disabled2,
3283 4553 active,
3284 - orientation
4554 + orientation,
4555 + tabActivationDirection
3285 4556 };
3286 4557 const element = useRenderElement("button", componentProps, {
3287 4558 state,
3288 - ref: [forwardedRef, buttonRef, compositeRef, tabElementRef],
4559 + ref: [forwardedRef, buttonRef, compositeRef, observeTabElement],
3289 4560 props: [compositeProps, {
3290 4561 role: "tab",
3291 4562 "aria-controls": tabPanelId,
3292 4563 "aria-selected": active,
@@ -3297,39 +4568,36 @@
3297 4568 [ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0,
3298 4569 onKeyDownCapture() {
3299 4570 isNavigatingRef.current = true;
3300 4571 }
3301 - }, elementProps, getButtonProps]
4572 + }, elementProps, getButtonProps],
4573 + stateAttributesMapping: tabsStateAttributesMapping
3302 4574 });
3303 4575 return element;
3304 4576 });
3305 4577 if (true) TabsTab.displayName = "TabsTab";
3306 4578
3307 - // node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicator.js
3308 - var React28 = __toESM(require_react(), 1);
4579 + // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
4580 + var React48 = __toESM(require_react(), 1);
3309 4581
3310 - // node_modules/@base-ui/react/esm/tabs/indicator/prehydrationScript.min.js
3311 - var script = '!function(){const t=document.currentScript.previousElementSibling;if(!t)return;const e=t.closest(\'[role="tablist"]\');if(!e)return;const i=e.querySelector("[data-active]");if(!i)return;if(0===i.offsetWidth||0===e.offsetWidth)return;let o=0,n=0,h=0,l=0,r=0,f=0;function s(t){const e=getComputedStyle(t);let i=parseFloat(e.width)||0,o=parseFloat(e.height)||0;return(Math.round(i)!==t.offsetWidth||Math.round(o)!==t.offsetHeight)&&(i=t.offsetWidth,o=t.offsetHeight),{width:i,height:o}}if(null!=i&&null!=e){const{width:t,height:c}=s(i),{width:u,height:d}=s(e),a=i.getBoundingClientRect(),g=e.getBoundingClientRect(),p=u>0?g.width/u:1,b=d>0?g.height/d:1;if(Math.abs(p)>Number.EPSILON&&Math.abs(b)>Number.EPSILON){const t=a.left-g.left,i=a.top-g.top;o=t/p+e.scrollLeft-e.clientLeft,h=i/b+e.scrollTop-e.clientTop}else o=i.offsetLeft,h=i.offsetTop;r=t,f=c,n=e.scrollWidth-o-r,l=e.scrollHeight-h-f}function c(e,i){t.style.setProperty(`--active-tab-${e}`,`${i}px`)}c("left",o),c("right",n),c("top",h),c("bottom",l),c("width",r),c("height",f),r>0&&f>0&&t.removeAttribute("hidden")}();';
4582 + // node_modules/@base-ui/react/tabs/indicator/TabsIndicatorCssVars.mjs
4583 + var activeTabLeft = "--active-tab-left";
4584 + var activeTabRight = "--active-tab-right";
4585 + var activeTabTop = "--active-tab-top";
4586 + var activeTabBottom = "--active-tab-bottom";
4587 + var activeTabWidth = "--active-tab-width";
4588 + var activeTabHeight = "--active-tab-height";
3312 4589
3313 - // node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicatorCssVars.js
3314 - var TabsIndicatorCssVars = /* @__PURE__ */ (function(TabsIndicatorCssVars2) {
3315 - TabsIndicatorCssVars2["activeTabLeft"] = "--active-tab-left";
3316 - TabsIndicatorCssVars2["activeTabRight"] = "--active-tab-right";
3317 - TabsIndicatorCssVars2["activeTabTop"] = "--active-tab-top";
3318 - TabsIndicatorCssVars2["activeTabBottom"] = "--active-tab-bottom";
3319 - TabsIndicatorCssVars2["activeTabWidth"] = "--active-tab-width";
3320 - TabsIndicatorCssVars2["activeTabHeight"] = "--active-tab-height";
3321 - return TabsIndicatorCssVars2;
3322 - })({});
3323 -
3324 - // node_modules/@base-ui/react/esm/tabs/indicator/TabsIndicator.js
3325 - var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1);
3326 - var stateAttributesMapping = {
4590 + // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs
4591 + var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
4592 + var _PrehydrationScript;
4593 + var stateAttributesMapping2 = {
3327 4594 ...tabsStateAttributesMapping,
3328 4595 activeTabPosition: () => null,
3329 4596 activeTabSize: () => null
3330 4597 };
3331 - var TabsIndicator = /* @__PURE__ */ React28.forwardRef(function TabsIndicator2(componentProps, forwardedRef) {
4598 + var MAX_LAYOUT_ROUNDING_ERROR = 2;
4599 + var TabsIndicator = /* @__PURE__ */ React48.forwardRef(function TabsIndicator2(componentProps, forwardedRef) {
3332 4600 const {
3333 4601 className,
3334 4602 render,
3335 4603 renderBeforeHydration = false,
@@ -3336,11 +4604,8 @@
3336 4604 style: styleProp,
3337 4605 ...elementProps
3338 4606 } = componentProps;
3339 4607 const {
3340 - nonce
3341 - } = useCSPContext();
3342 - const {
3343 4608 getTabElementBySelectedValue,
3344 4609 orientation,
3345 4610 tabActivationDirection,
3346 4611 value
@@ -3348,11 +4613,10 @@
3348 4613 const {
3349 4614 tabsListElement,
3350 4615 registerIndicatorUpdateListener
3351 4616 } = useTabsListContext();
3352 - const isHydrating = useIsHydrating();
3353 4617 const rerender = useForcedRerendering();
3354 - React28.useEffect(() => {
4618 + React48.useEffect(() => {
3355 4619 return registerIndicatorUpdateListener(rerender);
3356 4620 }, [registerIndicatorUpdateListener, rerender]);
3357 4621 let left = 0;
3358 4622 let right = 0;
@@ -3362,10 +4626,10 @@
3362 4626 let height = 0;
3363 4627 let isTabSelected = false;
3364 4628 if (value != null && tabsListElement != null) {
3365 4629 const activeTab = getTabElementBySelectedValue(value);
3366 - isTabSelected = true;
3367 4630 if (activeTab != null) {
4631 + isTabSelected = true;
3368 4632 const {
3369 4633 width: computedWidth,
3370 4634 height: computedHeight
3371 4635 } = getCssDimensions(activeTab);
@@ -3376,17 +4640,17 @@
3376 4640 const tabRect = activeTab.getBoundingClientRect();
3377 4641 const tabsListRect = tabsListElement.getBoundingClientRect();
3378 4642 const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1;
3379 4643 const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1;
3380 - const hasNonZeroScale = Math.abs(scaleX) > Number.EPSILON && Math.abs(scaleY) > Number.EPSILON;
3381 - if (hasNonZeroScale) {
3382 - const tabLeftDelta = tabRect.left - tabsListRect.left;
3383 - const tabTopDelta = tabRect.top - tabsListRect.top;
3384 - left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;
3385 - top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;
3386 - } else {
3387 - left = activeTab.offsetLeft;
3388 - top = activeTab.offsetTop;
4644 + const layoutOffset = getLayoutOffset(activeTab, tabsListElement);
4645 + left = layoutOffset.left;
4646 + top = layoutOffset.top;
4647 + const rectLeft = (tabRect.left - tabsListRect.left) / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft;
4648 + const rectTop = (tabRect.top - tabsListRect.top) / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop;
4649 + const tabTranslation = getActiveTabTranslation(activeTab);
4650 + if (Math.abs(rectLeft - tabTranslation.x - left) <= MAX_LAYOUT_ROUNDING_ERROR && Math.abs(rectTop - tabTranslation.y - top) <= MAX_LAYOUT_ROUNDING_ERROR) {
4651 + left = rectLeft;
4652 + top = rectTop;
3389 4653 }
3390 4654 width = computedWidth;
3391 4655 height = computedHeight;
3392 4656 right = tabsListElement.scrollWidth - left - width;
@@ -3403,14 +4667,14 @@
3403 4667 width,
3404 4668 height
3405 4669 } : null;
3406 4670 const style = isTabSelected ? {
3407 - [TabsIndicatorCssVars.activeTabLeft]: `${left}px`,
3408 - [TabsIndicatorCssVars.activeTabRight]: `${right}px`,
3409 - [TabsIndicatorCssVars.activeTabTop]: `${top}px`,
3410 - [TabsIndicatorCssVars.activeTabBottom]: `${bottom}px`,
3411 - [TabsIndicatorCssVars.activeTabWidth]: `${width}px`,
3412 - [TabsIndicatorCssVars.activeTabHeight]: `${height}px`
4671 + [activeTabLeft]: `${left}px`,
4672 + [activeTabRight]: `${right}px`,
4673 + [activeTabTop]: `${top}px`,
4674 + [activeTabBottom]: `${bottom}px`,
4675 + [activeTabWidth]: `${width}px`,
4676 + [activeTabHeight]: `${height}px`
3413 4677 } : void 0;
3414 4678 const displayIndicator = isTabSelected && width > 0 && height > 0;
3415 4679 const state = {
3416 4680 orientation,
@@ -3428,45 +4692,101 @@
3428 4692 // do not display the indicator before the layout is settled
3429 4693 }, elementProps, {
3430 4694 suppressHydrationWarning: true
3431 4695 }],
3432 - stateAttributesMapping
4696 + stateAttributesMapping: stateAttributesMapping2
3433 4697 });
3434 4698 if (value == null) {
3435 4699 return null;
3436 4700 }
3437 - return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(React28.Fragment, {
3438 - children: [element, isHydrating && renderBeforeHydration && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("script", {
3439 - nonce,
3440 - dangerouslySetInnerHTML: {
3441 - __html: script
3442 - },
3443 - suppressHydrationWarning: true
3444 - })]
4701 + return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(React48.Fragment, {
4702 + children: [element, renderBeforeHydration && (_PrehydrationScript || (_PrehydrationScript = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(PrehydrationScript, {
4703 + script
4704 + })))]
3445 4705 });
3446 4706 });
3447 4707 if (true) TabsIndicator.displayName = "TabsIndicator";
4708 + function getLayoutOffset(element, ancestor) {
4709 + const elementOffset = getCumulativeOffset(element);
4710 + const ancestorOffset = getCumulativeOffset(ancestor);
4711 + let left = elementOffset.left - ancestorOffset.left - ancestor.clientLeft;
4712 + let top = elementOffset.top - ancestorOffset.top - ancestor.clientTop;
4713 + let node = getParentNode(element);
4714 + while (isHTMLElement(node) && node !== ancestor && !isLastTraversableNode(node)) {
4715 + left -= node.scrollLeft;
4716 + top -= node.scrollTop;
4717 + node = getParentNode(node);
4718 + }
4719 + return {
4720 + left,
4721 + top
4722 + };
4723 + }
4724 + function getCumulativeOffset(element) {
4725 + let left = 0;
4726 + let top = 0;
4727 + let currentElement = element;
4728 + while (currentElement != null) {
4729 + left += currentElement.offsetLeft;
4730 + top += currentElement.offsetTop;
4731 + const offsetParent = currentElement.offsetParent;
4732 + if (offsetParent != null) {
4733 + left += offsetParent.clientLeft;
4734 + top += offsetParent.clientTop;
4735 + }
4736 + currentElement = offsetParent;
4737 + }
4738 + return {
4739 + left,
4740 + top
4741 + };
4742 + }
4743 + function getActiveTabTranslation(element) {
4744 + const computedStyle = getWindow(element).getComputedStyle(element);
4745 + const {
4746 + x,
4747 + y
4748 + } = getElementTransform(element, computedStyle);
4749 + let translateX = x;
4750 + let translateY = y;
4751 + const {
4752 + translate
4753 + } = computedStyle;
4754 + if (translate && translate !== "none") {
4755 + const parts = translate.split(" ");
4756 + translateX += resolveTranslateLength(parts[0], element.offsetWidth);
4757 + translateY += resolveTranslateLength(parts[1], element.offsetHeight);
4758 + }
4759 + return {
4760 + x: translateX,
4761 + y: translateY
4762 + };
4763 + }
4764 + function resolveTranslateLength(value, referenceSize) {
4765 + if (!value) {
4766 + return 0;
4767 + }
4768 + const numeric = parseFloat(value);
4769 + if (!Number.isFinite(numeric)) {
4770 + return 0;
4771 + }
4772 + return value.endsWith("%") ? numeric / 100 * referenceSize : numeric;
4773 + }
3448 4774
3449 - // node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
3450 - var React29 = __toESM(require_react(), 1);
4775 + // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
4776 + var React49 = __toESM(require_react(), 1);
3451 4777
3452 - // node_modules/@base-ui/react/esm/tabs/panel/TabsPanelDataAttributes.js
3453 - var TabsPanelDataAttributes = (function(TabsPanelDataAttributes2) {
3454 - TabsPanelDataAttributes2["index"] = "data-index";
3455 - TabsPanelDataAttributes2["activationDirection"] = "data-activation-direction";
3456 - TabsPanelDataAttributes2["orientation"] = "data-orientation";
3457 - TabsPanelDataAttributes2["hidden"] = "data-hidden";
3458 - TabsPanelDataAttributes2[TabsPanelDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle";
3459 - TabsPanelDataAttributes2[TabsPanelDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle";
3460 - return TabsPanelDataAttributes2;
3461 - })({});
4778 + // node_modules/@base-ui/react/tabs/panel/TabsPanelDataAttributes.mjs
4779 + var index = "data-index";
4780 + var startingStyle2 = TransitionStatusDataAttributes_exports.startingStyle;
4781 + var endingStyle2 = TransitionStatusDataAttributes_exports.endingStyle;
3462 4782
3463 - // node_modules/@base-ui/react/esm/tabs/panel/TabsPanel.js
3464 - var stateAttributesMapping2 = {
4783 + // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs
4784 + var stateAttributesMapping3 = {
3465 4785 ...tabsStateAttributesMapping,
3466 4786 ...transitionStatusMapping
3467 4787 };
3468 - var TabsPanel = /* @__PURE__ */ React29.forwardRef(function TabsPanel2(componentProps, forwardedRef) {
4788 + var TabsPanel = /* @__PURE__ */ React49.forwardRef(function TabsPanel2(componentProps, forwardedRef) {
3469 4789 const {
3470 4790 className,
3471 4791 value,
3472 4792 render,
@@ -3478,22 +4798,15 @@
3478 4798 value: selectedValue,
3479 4799 getTabIdByPanelValue,
3480 4800 orientation,
3481 4801 tabActivationDirection,
3482 - registerMountedTabPanel,
3483 - unregisterMountedTabPanel
4802 + registerMountedTabPanel
3484 4803 } = useTabsRootContext();
3485 4804 const id = useBaseUiId();
3486 - const metadata = React29.useMemo(() => ({
3487 - id,
3488 - value
3489 - }), [id, value]);
3490 4805 const {
3491 4806 ref: listItemRef,
3492 - index
3493 - } = useCompositeListItem({
3494 - metadata
3495 - });
4807 + index: index2
4808 + } = useCompositeListItem();
3496 4809 const open = value === selectedValue;
3497 4810 const {
3498 4811 mounted,
3499 4812 transitionStatus,
@@ -3506,9 +4819,9 @@
3506 4819 orientation,
3507 4820 tabActivationDirection,
3508 4821 transitionStatus
3509 4822 };
3510 - const panelRef = React29.useRef(null);
4823 + const panelRef = React49.useRef(null);
3511 4824 const element = useRenderElement("div", componentProps, {
3512 4825 state,
3513 4826 ref: [forwardedRef, listItemRef, panelRef],
3514 4827 props: [{
@@ -3517,11 +4830,12 @@
3517 4830 id,
3518 4831 role: "tabpanel",
3519 4832 tabIndex: open ? 0 : -1,
3520 4833 inert: inertValue(!open),
3521 - [TabsPanelDataAttributes.index]: index
4834 + // Computed key: a plain literal key fails the DOM-props excess property check.
4835 + [index]: index2
3522 4836 }, elementProps],
3523 - stateAttributesMapping: stateAttributesMapping2
4837 + stateAttributesMapping: stateAttributesMapping3
3524 4838 });
3525 4839 useOpenChangeComplete({
3526 4840 open,
3527 4841 ref: panelRef,
@@ -3531,19 +4845,13 @@
3531 4845 }
3532 4846 }
3533 4847 });
3534 4848 useIsoLayoutEffect(() => {
3535 - if (hidden && !keepMounted) {
4849 + if (id == null || hidden && !keepMounted) {
3536 4850 return void 0;
3537 4851 }
3538 - if (id == null) {
3539 - return void 0;
3540 - }
3541 - registerMountedTabPanel(value, id);
3542 - return () => {
3543 - unregisterMountedTabPanel(value, id);
3544 - };
3545 - }, [hidden, keepMounted, value, id, registerMountedTabPanel, unregisterMountedTabPanel]);
4852 + return registerMountedTabPanel(value, id);
4853 + }, [hidden, keepMounted, value, id, registerMountedTabPanel]);
3546 4854 const shouldRender = keepMounted || mounted;
3547 4855 if (!shouldRender) {
3548 4856 return null;
3549 4857 }
@@ -3550,12 +4858,12 @@
3550 4858 return element;
3551 4859 });
3552 4860 if (true) TabsPanel.displayName = "TabsPanel";
3553 4861
3554 - // node_modules/@base-ui/react/esm/tabs/list/TabsList.js
3555 - var React30 = __toESM(require_react(), 1);
3556 - var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1);
3557 - var TabsList = /* @__PURE__ */ React30.forwardRef(function TabsList2(componentProps, forwardedRef) {
4862 + // node_modules/@base-ui/react/tabs/list/TabsList.mjs
4863 + var React50 = __toESM(require_react(), 1);
4864 + var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
4865 + var TabsList = /* @__PURE__ */ React50.forwardRef(function TabsList2(componentProps, forwardedRef) {
3558 4866 const {
3559 4867 activateOnFocus = false,
3560 4868 className,
3561 4869 loopFocus = true,
@@ -3563,20 +4871,18 @@
3563 4871 style,
3564 4872 ...elementProps
3565 4873 } = componentProps;
3566 4874 const {
3567 - onValueChange,
3568 4875 orientation,
3569 - value,
3570 4876 setTabMap,
3571 4877 tabActivationDirection
3572 4878 } = useTabsRootContext();
3573 - const [highlightedTabIndex, setHighlightedTabIndex] = React30.useState(0);
3574 - const [tabsListElement, setTabsListElement] = React30.useState(null);
3575 - const indicatorUpdateListenersRef = React30.useRef(/* @__PURE__ */ new Set());
3576 - const tabResizeObserverElementsRef = React30.useRef(/* @__PURE__ */ new Set());
3577 - const resizeObserverRef = React30.useRef(null);
3578 - React30.useEffect(() => {
4879 + const [highlightedTabIndex, setHighlightedTabIndex] = React50.useState(0);
4880 + const [tabsListElement, setTabsListElement] = React50.useState(null);
4881 + const indicatorUpdateListenersRef = React50.useRef(/* @__PURE__ */ new Set());
4882 + const tabResizeObserverElementsRef = React50.useRef(/* @__PURE__ */ new Set());
4883 + const resizeObserverRef = React50.useRef(null);
4884 + useIsoLayoutEffect(() => {
3579 4885 if (typeof ResizeObserver === "undefined") {
3580 4886 return void 0;
3581 4887 }
3582 4888 const resizeObserver = new ResizeObserver(() => {
@@ -3609,13 +4915,8 @@
3609 4915 tabResizeObserverElementsRef.current.delete(element);
3610 4916 resizeObserverRef.current?.unobserve(element);
3611 4917 };
3612 4918 });
3613 - const onTabActivation = useStableCallback((newValue, eventDetails) => {
3614 - if (newValue !== value) {
3615 - onValueChange(newValue, eventDetails);
3616 - }
3617 - });
3618 4919 const state = {
3619 4920 orientation,
3620 4921 tabActivationDirection
3621 4922 };
@@ -3622,20 +4923,17 @@
3622 4923 const defaultProps = {
3623 4924 "aria-orientation": orientation === "vertical" ? "vertical" : void 0,
3624 4925 role: "tablist"
3625 4926 };
3626 - const tabsListContextValue = React30.useMemo(() => ({
4927 + const tabsListContextValue = React50.useMemo(() => ({
3627 4928 activateOnFocus,
3628 - highlightedTabIndex,
3629 4929 registerIndicatorUpdateListener,
3630 4930 registerTabResizeObserverElement,
3631 - onTabActivation,
3632 - setHighlightedTabIndex,
3633 4931 tabsListElement
3634 - }), [activateOnFocus, highlightedTabIndex, registerIndicatorUpdateListener, registerTabResizeObserverElement, onTabActivation, setHighlightedTabIndex, tabsListElement]);
3635 - return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TabsListContext.Provider, {
4932 + }), [activateOnFocus, registerIndicatorUpdateListener, registerTabResizeObserverElement, tabsListElement]);
4933 + return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(TabsListContext.Provider, {
3636 4934 value: tabsListContextValue,
3637 - children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CompositeRoot, {
4935 + children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(CompositeRoot, {
3638 4936 render,
3639 4937 className,
3640 4938 style,
3641 4939 state,
@@ -3653,33 +4951,24 @@
3653 4951 });
3654 4952 });
3655 4953 if (true) TabsList.displayName = "TabsList";
3656 4954
3657 - // node_modules/@base-ui/react/esm/use-render/useRender.js
4955 + // node_modules/@base-ui/react/use-render/useRender.mjs
3658 4956 function useRender(params) {
3659 4957 return useRenderElement(params.defaultTagName ?? "div", params, params);
3660 4958 }
3661 4959
3662 - // packages/ui/build-module/icon/icon.mjs
4960 + // packages/ui/build-module/utils/direction-provider.mjs
4961 + var import_i18n3 = __toESM(require_i18n(), 1);
4962 + var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
4963 + function DirectionProvider3({ children }) {
4964 + return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(DirectionProvider, { direction: (0, import_i18n3.isRTL)() ? "rtl" : "ltr", children });
4965 + }
4966 +
4967 + // packages/ui/build-module/link/link.mjs
3663 4968 var import_element2 = __toESM(require_element(), 1);
3664 - var import_primitives15 = __toESM(require_primitives(), 1);
3665 - var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1);
3666 - var Icon = (0, import_element2.forwardRef)(function Icon2({ icon, size = 24, ...restProps }, ref) {
3667 - return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
3668 - import_primitives15.SVG,
3669 - {
3670 - ref,
3671 - fill: "currentColor",
3672 - ...icon.props,
3673 - ...restProps,
3674 - width: size,
3675 - height: size
3676 - }
3677 - );
3678 - });
3679 -
3680 - // packages/ui/build-module/stack/stack.mjs
3681 - var import_element3 = __toESM(require_element(), 1);
4969 + var import_i18n4 = __toESM(require_i18n(), 1);
4970 + var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
3682 4971 var STYLE_HASH_ATTRIBUTE = "data-wp-hash";
3683 4972 function getRuntime() {
3684 4973 const globalScope = globalThis;
3685 4974 if (globalScope.__wpStyleRuntime) {
@@ -3759,69 +5048,89 @@
3759 5048 injectStyle(targetDocument, hash, css);
3760 5049 }
3761 5050 }
3762 5051 if (typeof process === "undefined" || true) {
3763 - registerStyle("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
5052 + registerStyle("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
3764 5053 }
3765 - var style_default = { "stack": "_19ce0419607e1896__stack" };
3766 - var gapTokens = {
3767 - xs: "var(--wpds-dimension-gap-xs, 4px)",
3768 - sm: "var(--wpds-dimension-gap-sm, 8px)",
3769 - md: "var(--wpds-dimension-gap-md, 12px)",
3770 - lg: "var(--wpds-dimension-gap-lg, 16px)",
3771 - xl: "var(--wpds-dimension-gap-xl, 24px)",
3772 - "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
3773 - "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
3774 - };
3775 - var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
3776 - const style = {
3777 - gap: gap && gapTokens[gap],
3778 - alignItems: align,
3779 - justifyContent: justify,
3780 - flexDirection: direction,
3781 - flexWrap: wrap
3782 - };
5054 + var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
5055 + if (typeof process === "undefined" || true) {
5056 + registerStyle("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
5057 + }
5058 + var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
5059 + if (typeof process === "undefined" || true) {
5060 + registerStyle("e8e6a9be37", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-default,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}');
5061 + }
5062 + var style_default = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" };
5063 + if (typeof process === "undefined" || true) {
5064 + 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)}");
5065 + }
5066 + 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" };
5067 + var Link = (0, import_element2.forwardRef)(function Link2({
5068 + children,
5069 + variant = "default",
5070 + tone = "brand",
5071 + openInNewTab = false,
5072 + target,
5073 + render,
5074 + className,
5075 + ...props
5076 + }, ref) {
5077 + const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? "");
3783 5078 const element = useRender({
3784 5079 render,
5080 + defaultTagName: "a",
3785 5081 ref,
3786 - props: mergeProps(props, { style, className: style_default.stack })
5082 + props: mergeProps(props, {
5083 + className: clsx_default(
5084 + global_css_defense_default.a,
5085 + resets_default["box-sizing"],
5086 + focus_module_default["outset-ring--focus-except-active"],
5087 + variant !== "unstyled" && style_default.link,
5088 + variant !== "unstyled" && style_default[`is-${tone}`],
5089 + variant === "unstyled" && style_default["is-unstyled"],
5090 + className
5091 + ),
5092 + target: target ?? (openInNewTab ? "_blank" : void 0),
5093 + children: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
5094 + children,
5095 + shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
5096 + "span",
5097 + {
5098 + className: style_default["link-icon"],
5099 + role: "img",
5100 + "aria-label": (
5101 + /* translators: accessibility text appended to link text */
5102 + (0, import_i18n4.__)("(opens in a new tab)")
5103 + )
5104 + }
5105 + )
5106 + ] })
5107 + })
3787 5108 });
3788 5109 return element;
3789 5110 });
3790 5111
3791 - // packages/ui/build-module/utils/use-schedule-validation.mjs
3792 - var import_element4 = __toESM(require_element(), 1);
3793 - function useScheduleValidation(validate) {
3794 - const validateRef = (0, import_element4.useRef)(validate);
3795 - validateRef.current = validate;
3796 - const timerRef = (0, import_element4.useRef)(null);
3797 - const unmountedRef = (0, import_element4.useRef)(false);
3798 - const scheduleValidation = (0, import_element4.useCallback)(() => {
3799 - if (unmountedRef.current) {
3800 - return;
5112 + // packages/ui/build-module/icon/icon.mjs
5113 + var import_element3 = __toESM(require_element(), 1);
5114 + var import_primitives18 = __toESM(require_primitives(), 1);
5115 + var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
5116 + var Icon = (0, import_element3.forwardRef)(function Icon2({ icon, size = 24, style, ...restProps }, ref) {
5117 + const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0;
5118 + return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
5119 + import_primitives18.SVG,
5120 + {
5121 + ref,
5122 + ...icon.props,
5123 + ...restProps,
5124 + ...mergedStyle ? { style: mergedStyle } : {},
5125 + width: size,
5126 + height: size
3801 5127 }
3802 - if (timerRef.current) {
3803 - clearTimeout(timerRef.current);
3804 - }
3805 - timerRef.current = setTimeout(() => {
3806 - validateRef.current();
3807 - timerRef.current = null;
3808 - }, 0);
3809 - }, []);
3810 - (0, import_element4.useEffect)(() => {
3811 - unmountedRef.current = false;
3812 - return () => {
3813 - unmountedRef.current = true;
3814 - if (timerRef.current) {
3815 - clearTimeout(timerRef.current);
3816 - }
3817 - };
3818 - }, []);
3819 - return scheduleValidation;
3820 - }
5128 + );
5129 + });
3821 5130
3822 5131 // packages/ui/build-module/visually-hidden/visually-hidden.mjs
3823 - var import_element5 = __toESM(require_element(), 1);
5132 + var import_element4 = __toESM(require_element(), 1);
3824 5133 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash";
3825 5134 function getRuntime2() {
3826 5135 const globalScope = globalThis;
3827 5136 if (globalScope.__wpStyleRuntime) {
@@ -3901,12 +5210,12 @@
3901 5210 injectStyle2(targetDocument, hash, css);
3902 5211 }
3903 5212 }
3904 5213 if (typeof process === "undefined" || true) {
3905 - registerStyle2("fa606a57ae", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.f37b9e2e191ebd66__visually-hidden{word-wrap:normal;border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;word-break:normal}}}");
5214 + 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}}}");
3906 5215 }
3907 5216 var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" };
3908 - var VisuallyHidden = (0, import_element5.forwardRef)(
5217 + var VisuallyHidden = (0, import_element4.forwardRef)(
3909 5218 function VisuallyHidden2({ render, ...restProps }, ref) {
3910 5219 const element = useRender({
3911 5220 render,
3912 5221 ref,
@@ -3922,12 +5231,10 @@
3922 5231 return element;
3923 5232 }
3924 5233 );
3925 5234
3926 - // packages/ui/build-module/link/link.mjs
3927 - var import_element6 = __toESM(require_element(), 1);
3928 - var import_i18n3 = __toESM(require_i18n(), 1);
3929 - var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1);
5235 + // packages/ui/build-module/stack/stack.mjs
5236 + var import_element5 = __toESM(require_element(), 1);
3930 5237 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash";
3931 5238 function getRuntime3() {
3932 5239 const globalScope = globalThis;
3933 5240 if (globalScope.__wpStyleRuntime) {
@@ -4007,81 +5314,1594 @@
4007 5314 injectStyle3(targetDocument, hash, css);
4008 5315 }
4009 5316 }
4010 5317 if (typeof process === "undefined" || true) {
4011 - registerStyle3("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
5318 + registerStyle3("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}");
4012 5319 }
4013 - var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
5320 + var style_default3 = { "stack": "_19ce0419607e1896__stack" };
5321 + var gapTokens = {
5322 + xs: "var(--wpds-dimension-gap-xs, 4px)",
5323 + sm: "var(--wpds-dimension-gap-sm, 8px)",
5324 + md: "var(--wpds-dimension-gap-md, 12px)",
5325 + lg: "var(--wpds-dimension-gap-lg, 16px)",
5326 + xl: "var(--wpds-dimension-gap-xl, 24px)",
5327 + "2xl": "var(--wpds-dimension-gap-2xl, 32px)",
5328 + "3xl": "var(--wpds-dimension-gap-3xl, 40px)"
5329 + };
5330 + var Stack = (0, import_element5.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) {
5331 + const style = {
5332 + gap: gap && gapTokens[gap],
5333 + alignItems: align,
5334 + justifyContent: justify,
5335 + flexDirection: direction,
5336 + flexWrap: wrap
5337 + };
5338 + const element = useRender({
5339 + render,
5340 + ref,
5341 + props: mergeProps(props, { style, className: style_default3.stack })
5342 + });
5343 + return element;
5344 + });
5345 +
5346 + // packages/ui/build-module/utils/use-schedule-validation.mjs
5347 + var import_compose = __toESM(require_compose(), 1);
5348 + var import_element6 = __toESM(require_element(), 1);
5349 + function useScheduleValidation(validate) {
5350 + const validateEvent = (0, import_compose.useEvent)(validate);
5351 + const timerRef = (0, import_element6.useRef)(null);
5352 + const unmountedRef = (0, import_element6.useRef)(false);
5353 + const scheduleValidation = (0, import_element6.useCallback)(() => {
5354 + if (unmountedRef.current) {
5355 + return;
5356 + }
5357 + if (timerRef.current) {
5358 + clearTimeout(timerRef.current);
5359 + }
5360 + timerRef.current = setTimeout(() => {
5361 + validateEvent();
5362 + timerRef.current = null;
5363 + }, 0);
5364 + }, [validateEvent]);
5365 + (0, import_element6.useEffect)(() => {
5366 + unmountedRef.current = false;
5367 + return () => {
5368 + unmountedRef.current = true;
5369 + if (timerRef.current) {
5370 + clearTimeout(timerRef.current);
5371 + }
5372 + };
5373 + }, []);
5374 + return scheduleValidation;
5375 + }
5376 +
5377 + // packages/ui/build-module/form/primitives/input/input.mjs
5378 + var import_element9 = __toESM(require_element(), 1);
5379 +
5380 + // packages/ui/build-module/form/primitives/input-layout/input-layout.mjs
5381 + var import_element7 = __toESM(require_element(), 1);
5382 + var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
5383 + var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
5384 + function getRuntime4() {
5385 + const globalScope = globalThis;
5386 + if (globalScope.__wpStyleRuntime) {
5387 + return globalScope.__wpStyleRuntime;
5388 + }
5389 + globalScope.__wpStyleRuntime = {
5390 + documents: /* @__PURE__ */ new Map(),
5391 + styles: /* @__PURE__ */ new Map(),
5392 + injectedStyles: /* @__PURE__ */ new WeakMap()
5393 + };
5394 + if (typeof document !== "undefined") {
5395 + registerDocument4(document);
5396 + }
5397 + return globalScope.__wpStyleRuntime;
5398 + }
5399 + function documentContainsStyleHash4(targetDocument, hash) {
5400 + if (!targetDocument.head) {
5401 + return false;
5402 + }
5403 + for (const style of targetDocument.head.querySelectorAll(
5404 + `style[${STYLE_HASH_ATTRIBUTE4}]`
5405 + )) {
5406 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
5407 + return true;
5408 + }
5409 + }
5410 + return false;
5411 + }
5412 + function injectStyle4(targetDocument, hash, css) {
5413 + if (!targetDocument.head) {
5414 + return;
5415 + }
5416 + const runtime = getRuntime4();
5417 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5418 + if (!injectedStyles) {
5419 + injectedStyles = /* @__PURE__ */ new Set();
5420 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5421 + }
5422 + if (injectedStyles.has(hash)) {
5423 + return;
5424 + }
5425 + if (documentContainsStyleHash4(targetDocument, hash)) {
5426 + injectedStyles.add(hash);
5427 + return;
5428 + }
5429 + const style = targetDocument.createElement("style");
5430 + style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
5431 + style.appendChild(targetDocument.createTextNode(css));
5432 + targetDocument.head.appendChild(style);
5433 + injectedStyles.add(hash);
5434 + }
5435 + function registerDocument4(targetDocument) {
5436 + const runtime = getRuntime4();
5437 + runtime.documents.set(
5438 + targetDocument,
5439 + (runtime.documents.get(targetDocument) ?? 0) + 1
5440 + );
5441 + for (const [hash, css] of runtime.styles) {
5442 + injectStyle4(targetDocument, hash, css);
5443 + }
5444 + return () => {
5445 + const count = runtime.documents.get(targetDocument);
5446 + if (count === void 0) {
5447 + return;
5448 + }
5449 + if (count <= 1) {
5450 + runtime.documents.delete(targetDocument);
5451 + return;
5452 + }
5453 + runtime.documents.set(targetDocument, count - 1);
5454 + };
5455 + }
5456 + function registerStyle4(hash, css) {
5457 + const runtime = getRuntime4();
5458 + runtime.styles.set(hash, css);
5459 + for (const targetDocument of runtime.documents.keys()) {
5460 + injectStyle4(targetDocument, hash, css);
5461 + }
5462 + }
4014 5463 if (typeof process === "undefined" || true) {
4015 - registerStyle3("693cd16544", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._08e8a2e44959f892__outset-ring--focus,._970d04df7376df67__outset-ring--focus-within-except-active,.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible,.cd83dfc2126a0846__outset-ring--focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active,.ecadb9e080e2dfa5__outset-ring--focus-parent-visible{@media not (prefers-reduced-motion){--_gcd-a-transition:outline 0.1s ease-out;transition:outline .1s ease-out}outline:0 solid transparent;outline-offset:1px}._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9))}}}");
5464 + registerStyle4("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)}");
4016 5465 }
4017 - var focus_default = { "outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus", "outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active", "outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible", "outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within", "outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active", "outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible" };
5466 + var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
4018 5467 if (typeof process === "undefined" || true) {
4019 - registerStyle3("9f01019e30", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-fg-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-fg-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-regular,400);line-height:1;margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}}');
5468 + registerStyle4("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
4020 5469 }
4021 - var style_default3 = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" };
5470 + var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
4022 5471 if (typeof process === "undefined" || true) {
4023 - registerStyle3("d5c1b736fd", "._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);&: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-fg-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-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-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-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));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)}");
5472 + registerStyle4("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
4024 5473 }
4025 - 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" };
4026 - var Link = (0, import_element6.forwardRef)(function Link2({
4027 - children,
4028 - variant = "default",
4029 - tone = "brand",
4030 - openInNewTab = false,
4031 - render,
4032 - className,
4033 - ...props
4034 - }, ref) {
4035 - const element = useRender({
4036 - render,
4037 - defaultTagName: "a",
4038 - ref,
4039 - props: mergeProps(props, {
5474 + var style_default4 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" };
5475 + var InputLayout = (0, import_element7.forwardRef)(
5476 + function InputLayout2({
5477 + className,
5478 + children,
5479 + visuallyDisabled,
5480 + size = "default",
5481 + isBorderless,
5482 + prefix,
5483 + suffix,
5484 + ...restProps
5485 + }, ref) {
5486 + return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(
5487 + "div",
5488 + {
5489 + ref,
5490 + className: clsx_default(
5491 + global_css_defense_default2.div,
5492 + resets_default2["box-sizing"],
5493 + style_default4["input-layout"],
5494 + style_default4[`is-size-${size}`],
5495 + visuallyDisabled && style_default4["is-disabled"],
5496 + isBorderless && style_default4["is-borderless"],
5497 + className
5498 + ),
5499 + ...restProps,
5500 + children: [
5501 + import_element7.Children.count(prefix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5502 + "div",
5503 + {
5504 + className: style_default4["slot-wrapper"],
5505 + "data-slot-type": "prefix",
5506 + children: prefix
5507 + }
5508 + ),
5509 + children,
5510 + import_element7.Children.count(suffix) > 0 && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
5511 + "div",
5512 + {
5513 + className: style_default4["slot-wrapper"],
5514 + "data-slot-type": "suffix",
5515 + children: suffix
5516 + }
5517 + )
5518 + ]
5519 + }
5520 + );
5521 + }
5522 + );
5523 +
5524 + // packages/ui/build-module/form/primitives/input-layout/slot.mjs
5525 + var import_element8 = __toESM(require_element(), 1);
5526 + var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
5527 + var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
5528 + function getRuntime5() {
5529 + const globalScope = globalThis;
5530 + if (globalScope.__wpStyleRuntime) {
5531 + return globalScope.__wpStyleRuntime;
5532 + }
5533 + globalScope.__wpStyleRuntime = {
5534 + documents: /* @__PURE__ */ new Map(),
5535 + styles: /* @__PURE__ */ new Map(),
5536 + injectedStyles: /* @__PURE__ */ new WeakMap()
5537 + };
5538 + if (typeof document !== "undefined") {
5539 + registerDocument5(document);
5540 + }
5541 + return globalScope.__wpStyleRuntime;
5542 + }
5543 + function documentContainsStyleHash5(targetDocument, hash) {
5544 + if (!targetDocument.head) {
5545 + return false;
5546 + }
5547 + for (const style of targetDocument.head.querySelectorAll(
5548 + `style[${STYLE_HASH_ATTRIBUTE5}]`
5549 + )) {
5550 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
5551 + return true;
5552 + }
5553 + }
5554 + return false;
5555 + }
5556 + function injectStyle5(targetDocument, hash, css) {
5557 + if (!targetDocument.head) {
5558 + return;
5559 + }
5560 + const runtime = getRuntime5();
5561 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5562 + if (!injectedStyles) {
5563 + injectedStyles = /* @__PURE__ */ new Set();
5564 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5565 + }
5566 + if (injectedStyles.has(hash)) {
5567 + return;
5568 + }
5569 + if (documentContainsStyleHash5(targetDocument, hash)) {
5570 + injectedStyles.add(hash);
5571 + return;
5572 + }
5573 + const style = targetDocument.createElement("style");
5574 + style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
5575 + style.appendChild(targetDocument.createTextNode(css));
5576 + targetDocument.head.appendChild(style);
5577 + injectedStyles.add(hash);
5578 + }
5579 + function registerDocument5(targetDocument) {
5580 + const runtime = getRuntime5();
5581 + runtime.documents.set(
5582 + targetDocument,
5583 + (runtime.documents.get(targetDocument) ?? 0) + 1
5584 + );
5585 + for (const [hash, css] of runtime.styles) {
5586 + injectStyle5(targetDocument, hash, css);
5587 + }
5588 + return () => {
5589 + const count = runtime.documents.get(targetDocument);
5590 + if (count === void 0) {
5591 + return;
5592 + }
5593 + if (count <= 1) {
5594 + runtime.documents.delete(targetDocument);
5595 + return;
5596 + }
5597 + runtime.documents.set(targetDocument, count - 1);
5598 + };
5599 + }
5600 + function registerStyle5(hash, css) {
5601 + const runtime = getRuntime5();
5602 + runtime.styles.set(hash, css);
5603 + for (const targetDocument of runtime.documents.keys()) {
5604 + injectStyle5(targetDocument, hash, css);
5605 + }
5606 + }
5607 + if (typeof process === "undefined" || true) {
5608 + registerStyle5("e4f4f9600b", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.cb2baafdc08746bb__input-layout{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-md,12px);background-color:var(--wpds-color-background-interactive-neutral,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:var(--wpds-border-width-xs,1px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:max(var(--wpds-typography-font-size-md,13px),16px);height:var(--wpds-dimension-size-lg,40px);line-height:1;@media (min-width:600px){font-size:var(--wpds-typography-font-size-md,13px)}&._0c807a84cbb94e0c__is-size-compact{height:var(--wpds-dimension-size-md,32px)}&._0c807a84cbb94e0c__is-size-compact,&.ed67cda122dc1e7b__is-size-small{--wp-ui-input-layout-padding-inline:var(--wpds-dimension-padding-sm,8px)}&.ed67cda122dc1e7b__is-size-small{height:var(--wpds-dimension-size-sm,24px)}&._6fb7104732387680__is-disabled,&:has([data-can-disable-input-layout][data-disabled]){color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);@media (forced-colors:active){color:GrayText}&:not(._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-disabled,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText}}}&._8097270636ca6100__is-borderless{background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);border-color:transparent}&:has(._0d7afad74a057888__input-layout-slot:focus-within){--_gcd-div-outline:none;outline:none}&:hover:not(._6fb7104732387680__is-disabled,:has([data-can-disable-input-layout][data-disabled]),._8097270636ca6100__is-borderless){background-color:var(--wpds-color-background-interactive-neutral-active,var(--wpds-color-background-surface-neutral-strong,#fff));border-color:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e)}&:has(:invalid[data-validity-visible]){--focus-color:var(--wpds-color-stroke-interactive-error,#cc1818);border-color:var(--wpds-color-stroke-interactive-error,#cc1818);&:hover{border-color:var(--wpds-color-stroke-interactive-error-active,#9d0000)}}}.c192b41a12b4387b__slot-wrapper{display:contents}._0d7afad74a057888__input-layout-slot{align-items:center;display:flex;&._0c952682762ca288__is-padding-minimal{--wp-ui-input-layout-prefix-padding-start:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px));--wp-ui-input-layout-suffix-padding-end:calc(var(--wp-ui-input-layout-padding-inline) - var(--wpds-dimension-padding-xs, 4px))}[data-slot-type=prefix] &{padding-inline-start:var(--wp-ui-input-layout-prefix-padding-start,var(--wp-ui-input-layout-padding-inline))}[data-slot-type=suffix] &{padding-inline-end:var(--wp-ui-input-layout-suffix-padding-end,var(--wp-ui-input-layout-padding-inline))}}}}');
5609 + }
5610 + var style_default5 = { "input-layout": "cb2baafdc08746bb__input-layout", "is-size-compact": "_0c807a84cbb94e0c__is-size-compact", "is-size-small": "ed67cda122dc1e7b__is-size-small", "is-disabled": "_6fb7104732387680__is-disabled", "is-borderless": "_8097270636ca6100__is-borderless", "input-layout-slot": "_0d7afad74a057888__input-layout-slot", "slot-wrapper": "c192b41a12b4387b__slot-wrapper", "is-padding-minimal": "_0c952682762ca288__is-padding-minimal" };
5611 + var InputLayoutSlot = (0, import_element8.forwardRef)(function InputLayoutSlot2({ padding = "default", className, ...restProps }, ref) {
5612 + return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
5613 + "div",
5614 + {
5615 + ref,
4040 5616 className: clsx_default(
4041 - global_css_defense_default.a,
4042 - resets_default["box-sizing"],
4043 - focus_default["outset-ring--focus"],
4044 - variant !== "unstyled" && style_default3.link,
4045 - variant !== "unstyled" && style_default3[`is-${tone}`],
4046 - variant === "unstyled" && style_default3["is-unstyled"],
5617 + style_default5["input-layout-slot"],
5618 + style_default5[`is-padding-${padding}`],
4047 5619 className
4048 5620 ),
4049 - target: openInNewTab ? "_blank" : void 0,
4050 - children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [
4051 - children,
4052 - openInNewTab && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(
4053 - "span",
5621 + ...restProps
5622 + }
5623 + );
5624 + });
5625 + InputLayoutSlot.displayName = "InputLayout.Slot";
5626 +
5627 + // packages/ui/build-module/form/primitives/input-layout/index.mjs
5628 + var InputLayout3 = Object.assign(InputLayout, {
5629 + Slot: InputLayoutSlot
5630 + });
5631 +
5632 + // packages/ui/build-module/form/primitives/input/input.mjs
5633 + var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
5634 + var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
5635 + function getRuntime6() {
5636 + const globalScope = globalThis;
5637 + if (globalScope.__wpStyleRuntime) {
5638 + return globalScope.__wpStyleRuntime;
5639 + }
5640 + globalScope.__wpStyleRuntime = {
5641 + documents: /* @__PURE__ */ new Map(),
5642 + styles: /* @__PURE__ */ new Map(),
5643 + injectedStyles: /* @__PURE__ */ new WeakMap()
5644 + };
5645 + if (typeof document !== "undefined") {
5646 + registerDocument6(document);
5647 + }
5648 + return globalScope.__wpStyleRuntime;
5649 + }
5650 + function documentContainsStyleHash6(targetDocument, hash) {
5651 + if (!targetDocument.head) {
5652 + return false;
5653 + }
5654 + for (const style of targetDocument.head.querySelectorAll(
5655 + `style[${STYLE_HASH_ATTRIBUTE6}]`
5656 + )) {
5657 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
5658 + return true;
5659 + }
5660 + }
5661 + return false;
5662 + }
5663 + function injectStyle6(targetDocument, hash, css) {
5664 + if (!targetDocument.head) {
5665 + return;
5666 + }
5667 + const runtime = getRuntime6();
5668 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5669 + if (!injectedStyles) {
5670 + injectedStyles = /* @__PURE__ */ new Set();
5671 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5672 + }
5673 + if (injectedStyles.has(hash)) {
5674 + return;
5675 + }
5676 + if (documentContainsStyleHash6(targetDocument, hash)) {
5677 + injectedStyles.add(hash);
5678 + return;
5679 + }
5680 + const style = targetDocument.createElement("style");
5681 + style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
5682 + style.appendChild(targetDocument.createTextNode(css));
5683 + targetDocument.head.appendChild(style);
5684 + injectedStyles.add(hash);
5685 + }
5686 + function registerDocument6(targetDocument) {
5687 + const runtime = getRuntime6();
5688 + runtime.documents.set(
5689 + targetDocument,
5690 + (runtime.documents.get(targetDocument) ?? 0) + 1
5691 + );
5692 + for (const [hash, css] of runtime.styles) {
5693 + injectStyle6(targetDocument, hash, css);
5694 + }
5695 + return () => {
5696 + const count = runtime.documents.get(targetDocument);
5697 + if (count === void 0) {
5698 + return;
5699 + }
5700 + if (count <= 1) {
5701 + runtime.documents.delete(targetDocument);
5702 + return;
5703 + }
5704 + runtime.documents.set(targetDocument, count - 1);
5705 + };
5706 + }
5707 + function registerStyle6(hash, css) {
5708 + const runtime = getRuntime6();
5709 + runtime.styles.set(hash, css);
5710 + for (const targetDocument of runtime.documents.keys()) {
5711 + injectStyle6(targetDocument, hash, css);
5712 + }
5713 + }
5714 + if (typeof process === "undefined" || true) {
5715 + registerStyle6("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)}");
5716 + }
5717 + var global_css_defense_default3 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5718 + if (typeof process === "undefined" || true) {
5719 + registerStyle6("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
5720 + }
5721 + var focus_module_default2 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
5722 + if (typeof process === "undefined" || true) {
5723 + registerStyle6("1a25f6a232", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._2ae7be2fc1bb17a3__input{--_gcd-input-padding:var(--wp-ui-input-padding-block,0px) var(--wp-ui-input-layout-padding-inline,0px);background:transparent;border:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);font-family:inherit;font-size:inherit;line-height:inherit;outline:none;padding-block:var(--wp-ui-input-padding-block,0);padding-inline:var(--wp-ui-input-layout-padding-inline,0);width:100%;&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-weak,#707070)}&:disabled,&[aria-disabled=true]{--_gcd-input-placeholder-color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);&::placeholder{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}@media (forced-colors:active){color:GrayText}}&[type=email],&[type=url]{direction:ltr}&[type=number]{appearance:textfield;&::-webkit-inner-spin-button,&::-webkit-outer-spin-button{appearance:none;margin:0}}}}}");
5724 + }
5725 + var style_default6 = { "input": "_2ae7be2fc1bb17a3__input" };
5726 + var Input3 = (0, import_element9.forwardRef)(function Input22({ className, size = "default", prefix, suffix, style, ...restProps }, ref) {
5727 + return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5728 + InputLayout3,
5729 + {
5730 + className: clsx_default(
5731 + focus_module_default2["outset-ring--focus-within"],
5732 + className
5733 + ),
5734 + style,
5735 + size,
5736 + visuallyDisabled: restProps.disabled,
5737 + prefix,
5738 + suffix,
5739 + children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
5740 + Input,
5741 + {
5742 + ref,
5743 + className: clsx_default(global_css_defense_default3.input, style_default6.input),
5744 + ...restProps
5745 + }
5746 + )
5747 + }
5748 + );
5749 + });
5750 +
5751 + // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs
5752 + var import_i18n5 = __toESM(require_i18n(), 1);
5753 + var import_element11 = __toESM(require_element(), 1);
5754 +
5755 + // packages/ui/build-module/spinner/spinner.mjs
5756 + var import_element10 = __toESM(require_element(), 1);
5757 + var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
5758 + var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash";
5759 + function getRuntime7() {
5760 + const globalScope = globalThis;
5761 + if (globalScope.__wpStyleRuntime) {
5762 + return globalScope.__wpStyleRuntime;
5763 + }
5764 + globalScope.__wpStyleRuntime = {
5765 + documents: /* @__PURE__ */ new Map(),
5766 + styles: /* @__PURE__ */ new Map(),
5767 + injectedStyles: /* @__PURE__ */ new WeakMap()
5768 + };
5769 + if (typeof document !== "undefined") {
5770 + registerDocument7(document);
5771 + }
5772 + return globalScope.__wpStyleRuntime;
5773 + }
5774 + function documentContainsStyleHash7(targetDocument, hash) {
5775 + if (!targetDocument.head) {
5776 + return false;
5777 + }
5778 + for (const style of targetDocument.head.querySelectorAll(
5779 + `style[${STYLE_HASH_ATTRIBUTE7}]`
5780 + )) {
5781 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) {
5782 + return true;
5783 + }
5784 + }
5785 + return false;
5786 + }
5787 + function injectStyle7(targetDocument, hash, css) {
5788 + if (!targetDocument.head) {
5789 + return;
5790 + }
5791 + const runtime = getRuntime7();
5792 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5793 + if (!injectedStyles) {
5794 + injectedStyles = /* @__PURE__ */ new Set();
5795 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5796 + }
5797 + if (injectedStyles.has(hash)) {
5798 + return;
5799 + }
5800 + if (documentContainsStyleHash7(targetDocument, hash)) {
5801 + injectedStyles.add(hash);
5802 + return;
5803 + }
5804 + const style = targetDocument.createElement("style");
5805 + style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash);
5806 + style.appendChild(targetDocument.createTextNode(css));
5807 + targetDocument.head.appendChild(style);
5808 + injectedStyles.add(hash);
5809 + }
5810 + function registerDocument7(targetDocument) {
5811 + const runtime = getRuntime7();
5812 + runtime.documents.set(
5813 + targetDocument,
5814 + (runtime.documents.get(targetDocument) ?? 0) + 1
5815 + );
5816 + for (const [hash, css] of runtime.styles) {
5817 + injectStyle7(targetDocument, hash, css);
5818 + }
5819 + return () => {
5820 + const count = runtime.documents.get(targetDocument);
5821 + if (count === void 0) {
5822 + return;
5823 + }
5824 + if (count <= 1) {
5825 + runtime.documents.delete(targetDocument);
5826 + return;
5827 + }
5828 + runtime.documents.set(targetDocument, count - 1);
5829 + };
5830 + }
5831 + function registerStyle7(hash, css) {
5832 + const runtime = getRuntime7();
5833 + runtime.styles.set(hash, css);
5834 + for (const targetDocument of runtime.documents.keys()) {
5835 + injectStyle7(targetDocument, hash, css);
5836 + }
5837 + }
5838 + if (typeof process === "undefined" || true) {
5839 + registerStyle7("bbbecfe373", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.ab4d64c07c0ba587__spinner{background-color:transparent;display:inline-block;height:var(--wpds-dimension-size-2xs,16px);opacity:1;overflow:visible;position:relative;width:var(--wpds-dimension-size-2xs,16px)}.a7654e10245bb7d2__indicator,.dc51f80c84b35fe2__track{fill:transparent;stroke-width:1.5px}.dc51f80c84b35fe2__track{stroke:var(--wpds-color-background-track-neutral,#dbdbdb)}.a7654e10245bb7d2__indicator{stroke:var(--wpds-color-background-thumb-brand,var(--wp-admin-theme-color,#3858e9));stroke-linecap:round;animation:_02322d973909703c__spinner-spin 1.4s linear infinite both;transform-origin:50% 50%}@keyframes _02322d973909703c__spinner-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}}}");
5840 + }
5841 + var style_default7 = { "spinner": "ab4d64c07c0ba587__spinner", "track": "dc51f80c84b35fe2__track", "indicator": "a7654e10245bb7d2__indicator", "spinner-spin": "_02322d973909703c__spinner-spin" };
5842 + var Spinner = (0, import_element10.forwardRef)(
5843 + function Spinner2({ className, ...props }, ref) {
5844 + return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(
5845 + "svg",
5846 + {
5847 + className: clsx_default(style_default7.spinner, className),
5848 + viewBox: "0 0 100 100",
5849 + xmlns: "http://www.w3.org/2000/svg",
5850 + role: "presentation",
5851 + focusable: "false",
5852 + ...props,
5853 + ref,
5854 + children: [
5855 + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5856 + "circle",
5857 + {
5858 + className: style_default7.track,
5859 + cx: "50",
5860 + cy: "50",
5861 + r: "50",
5862 + vectorEffect: "non-scaling-stroke"
5863 + }
5864 + ),
5865 + /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
5866 + "path",
5867 + {
5868 + className: style_default7.indicator,
5869 + d: "m 50 0 a 50 50 0 0 1 50 50",
5870 + vectorEffect: "non-scaling-stroke"
5871 + }
5872 + )
5873 + ]
5874 + }
5875 + );
5876 + }
5877 + );
5878 +
5879 + // packages/ui/build-module/form/primitives/validity-indicator/validity-indicator.mjs
5880 + var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
5881 + var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash";
5882 + function getRuntime8() {
5883 + const globalScope = globalThis;
5884 + if (globalScope.__wpStyleRuntime) {
5885 + return globalScope.__wpStyleRuntime;
5886 + }
5887 + globalScope.__wpStyleRuntime = {
5888 + documents: /* @__PURE__ */ new Map(),
5889 + styles: /* @__PURE__ */ new Map(),
5890 + injectedStyles: /* @__PURE__ */ new WeakMap()
5891 + };
5892 + if (typeof document !== "undefined") {
5893 + registerDocument8(document);
5894 + }
5895 + return globalScope.__wpStyleRuntime;
5896 + }
5897 + function documentContainsStyleHash8(targetDocument, hash) {
5898 + if (!targetDocument.head) {
5899 + return false;
5900 + }
5901 + for (const style of targetDocument.head.querySelectorAll(
5902 + `style[${STYLE_HASH_ATTRIBUTE8}]`
5903 + )) {
5904 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) {
5905 + return true;
5906 + }
5907 + }
5908 + return false;
5909 + }
5910 + function injectStyle8(targetDocument, hash, css) {
5911 + if (!targetDocument.head) {
5912 + return;
5913 + }
5914 + const runtime = getRuntime8();
5915 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
5916 + if (!injectedStyles) {
5917 + injectedStyles = /* @__PURE__ */ new Set();
5918 + runtime.injectedStyles.set(targetDocument, injectedStyles);
5919 + }
5920 + if (injectedStyles.has(hash)) {
5921 + return;
5922 + }
5923 + if (documentContainsStyleHash8(targetDocument, hash)) {
5924 + injectedStyles.add(hash);
5925 + return;
5926 + }
5927 + const style = targetDocument.createElement("style");
5928 + style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash);
5929 + style.appendChild(targetDocument.createTextNode(css));
5930 + targetDocument.head.appendChild(style);
5931 + injectedStyles.add(hash);
5932 + }
5933 + function registerDocument8(targetDocument) {
5934 + const runtime = getRuntime8();
5935 + runtime.documents.set(
5936 + targetDocument,
5937 + (runtime.documents.get(targetDocument) ?? 0) + 1
5938 + );
5939 + for (const [hash, css] of runtime.styles) {
5940 + injectStyle8(targetDocument, hash, css);
5941 + }
5942 + return () => {
5943 + const count = runtime.documents.get(targetDocument);
5944 + if (count === void 0) {
5945 + return;
5946 + }
5947 + if (count <= 1) {
5948 + runtime.documents.delete(targetDocument);
5949 + return;
5950 + }
5951 + runtime.documents.set(targetDocument, count - 1);
5952 + };
5953 + }
5954 + function registerStyle8(hash, css) {
5955 + const runtime = getRuntime8();
5956 + runtime.styles.set(hash, css);
5957 + for (const targetDocument of runtime.documents.keys()) {
5958 + injectStyle8(targetDocument, hash, css);
5959 + }
5960 + }
5961 + if (typeof process === "undefined" || true) {
5962 + registerStyle8("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)}");
5963 + }
5964 + var global_css_defense_default4 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
5965 + if (typeof process === "undefined" || true) {
5966 + registerStyle8("d11816833c", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7a7ac88e306348e7__indicator{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);align-items:flex-start;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);gap:var(--wpds-dimension-gap-xs,4px);line-height:var(--wpds-typography-line-height-xs,16px);@media not (prefers-reduced-motion){animation:_48722cc5dd090ce4__indicator-jump var(--wpds-motion-duration-md,.2s) cubic-bezier(.68,-.55,.27,1.55)}}._57a3bbbfbe38a5c6__is-invalid{color:var(--wpds-color-foreground-content-error-weak,#cc1818)}._9e944dc198aac10b__is-valid{color:var(--wpds-color-foreground-content-success-weak,#008030)}.e482806667437c6a__indicator-icon{flex-shrink:0}._6e46434cc23019d2__indicator-spinner{height:var(--wpds-dimension-size-3xs,12px);margin:2px;width:var(--wpds-dimension-size-3xs,12px)}@keyframes _48722cc5dd090ce4__indicator-jump{0%{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:translateY(0)}}}}');
5967 + }
5968 + var style_default8 = { "indicator": "_7a7ac88e306348e7__indicator", "indicator-jump": "_48722cc5dd090ce4__indicator-jump", "is-invalid": "_57a3bbbfbe38a5c6__is-invalid", "is-valid": "_9e944dc198aac10b__is-valid", "indicator-icon": "e482806667437c6a__indicator-icon", "indicator-spinner": "_6e46434cc23019d2__indicator-spinner" };
5969 + var ICON = {
5970 + valid: published_default,
5971 + invalid: error_default
5972 + };
5973 + function ValidityIndicator({
5974 + id,
5975 + type,
5976 + message
5977 + }) {
5978 + return /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)(
5979 + "p",
5980 + {
5981 + id,
5982 + className: clsx_default(
5983 + global_css_defense_default4.p,
5984 + style_default8.indicator,
5985 + style_default8[`is-${type}`]
5986 + ),
5987 + children: [
5988 + type === "validating" ? /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(Spinner, { className: style_default8["indicator-spinner"] }) : /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
5989 + Icon,
4054 5990 {
4055 - className: style_default3["link-icon"],
4056 - role: "img",
4057 - "aria-label": (
4058 - /* translators: accessibility text appended to link text */
4059 - (0, import_i18n3.__)("(opens in a new tab)")
4060 - )
5991 + className: style_default8["indicator-icon"],
5992 + icon: ICON[type],
5993 + size: 16,
5994 + fill: "currentColor"
4061 5995 }
4062 - )
5996 + ),
5997 + message
5998 + ]
5999 + }
6000 + );
6001 + }
6002 +
6003 + // packages/ui/build-module/form/primitives/control-with-error/control-with-error.mjs
6004 + var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
6005 + var DEFAULT_RENDER = (props) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(Stack, { ...props, direction: "column", gap: "sm" });
6006 + function appendRequiredIndicator(label, required, markWhenOptional) {
6007 + let suffix;
6008 + if (required && !markWhenOptional) {
6009 + suffix = `(${(0, import_i18n5.__)("Required")})`;
6010 + } else if (!required && markWhenOptional) {
6011 + suffix = `(${(0, import_i18n5.__)("Optional")})`;
6012 + }
6013 + if (!suffix) {
6014 + return label;
6015 + }
6016 + if (typeof label === "string") {
6017 + return `${label} ${suffix}`;
6018 + }
6019 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
6020 + label,
6021 + " ",
6022 + suffix
6023 + ] });
6024 + }
6025 + var VALIDITY_VISIBLE_ATTRIBUTE = "data-validity-visible";
6026 + var ControlWithError = (0, import_element11.forwardRef)(function ControlWithError2({
6027 + required,
6028 + markWhenOptional,
6029 + customValidity,
6030 + getValidityTarget,
6031 + children,
6032 + render = DEFAULT_RENDER,
6033 + ...restProps
6034 + }, forwardedRef) {
6035 + const [errorMessage, setErrorMessage] = (0, import_element11.useState)();
6036 + const [statusMessage, setStatusMessage] = (0, import_element11.useState)();
6037 + const [showMessage, setShowMessage] = (0, import_element11.useState)(false);
6038 + const [isTouched, setIsTouched] = (0, import_element11.useState)(false);
6039 + const wrapperRef = (0, import_element11.useRef)(null);
6040 + (0, import_element11.useEffect)(() => {
6041 + const validityTarget = getValidityTarget();
6042 + const handler = () => {
6043 + if (customValidity?.type !== "validating") {
6044 + setErrorMessage(validityTarget?.validationMessage);
6045 + }
6046 + setShowMessage(true);
6047 + validityTarget?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, "");
6048 + };
6049 + validityTarget?.addEventListener("invalid", handler);
6050 + return () => validityTarget?.removeEventListener("invalid", handler);
6051 + }, [customValidity?.type, getValidityTarget]);
6052 + (0, import_element11.useEffect)(() => {
6053 + const validityTarget = getValidityTarget();
6054 + const suppressNativePopover = (event) => {
6055 + event.preventDefault();
6056 + if (!event.isTrusted) {
6057 + return;
6058 + }
6059 + const target = event.target;
6060 + const firstErrorInForm = Array.from(
6061 + target.form?.elements ?? []
6062 + ).find((el) => !el.validity.valid);
6063 + if (!target.form || firstErrorInForm === target) {
6064 + target.focus();
6065 + }
6066 + };
6067 + const radioSiblings = validityTarget?.type === "radio" && validityTarget?.name ? Array.from(
6068 + wrapperRef.current?.querySelectorAll(
6069 + `input[type="radio"][name="${validityTarget?.name}"]`
6070 + ) ?? []
6071 + ).filter((sibling) => sibling !== validityTarget) : [];
6072 + validityTarget?.addEventListener("invalid", suppressNativePopover);
6073 + radioSiblings.forEach(
6074 + (sibling) => sibling.addEventListener("invalid", suppressNativePopover)
6075 + );
6076 + return () => {
6077 + validityTarget?.removeEventListener(
6078 + "invalid",
6079 + suppressNativePopover
6080 + );
6081 + radioSiblings.forEach(
6082 + (sibling) => sibling.removeEventListener("invalid", suppressNativePopover)
6083 + );
6084 + };
6085 + }, [getValidityTarget]);
6086 + (0, import_element11.useEffect)(() => {
6087 + const validityTarget = getValidityTarget();
6088 + if (!customValidity?.type) {
6089 + validityTarget?.setCustomValidity("");
6090 + setErrorMessage(validityTarget?.validationMessage);
6091 + setStatusMessage(void 0);
6092 + return;
6093 + }
6094 + switch (customValidity.type) {
6095 + case "validating": {
6096 + validityTarget?.setCustomValidity("");
6097 + setErrorMessage(void 0);
6098 + setStatusMessage({
6099 + type: "validating",
6100 + message: customValidity.message
6101 + });
6102 + break;
6103 + }
6104 + case "valid": {
6105 + validityTarget?.setCustomValidity("");
6106 + setErrorMessage(validityTarget?.validationMessage);
6107 + setStatusMessage({
6108 + type: "valid",
6109 + message: customValidity.message
6110 + });
6111 + break;
6112 + }
6113 + case "invalid": {
6114 + validityTarget?.setCustomValidity(
6115 + customValidity.message ?? ""
6116 + );
6117 + setErrorMessage(validityTarget?.validationMessage);
6118 + setStatusMessage(void 0);
6119 + break;
6120 + }
6121 + }
6122 + }, [customValidity, getValidityTarget]);
6123 + (0, import_element11.useEffect)(() => {
6124 + if (!isTouched || showMessage) {
6125 + return;
6126 + }
6127 + if (customValidity?.type === "validating") {
6128 + const timer = setTimeout(() => {
6129 + setShowMessage(true);
6130 + }, 1e3);
6131 + return () => clearTimeout(timer);
6132 + }
6133 + setShowMessage(true);
6134 + }, [isTouched, customValidity?.type, showMessage]);
6135 + const onBlur = (event) => {
6136 + if (event.relatedTarget && event.currentTarget.contains(event.relatedTarget)) {
6137 + return;
6138 + }
6139 + if (!isTouched) {
6140 + setIsTouched(true);
6141 + getValidityTarget()?.setAttribute(VALIDITY_VISIBLE_ATTRIBUTE, "");
6142 + }
6143 + const validityTarget = getValidityTarget();
6144 + const isValidating = customValidity?.type === "validating";
6145 + window.queueMicrotask(() => {
6146 + if (!isValidating) {
6147 + setErrorMessage(validityTarget?.validationMessage);
6148 + }
6149 + });
6150 + };
6151 + const messageId = (0, import_element11.useId)();
6152 + const message = (() => {
6153 + if (errorMessage) {
6154 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6155 + ValidityIndicator,
6156 + {
6157 + id: messageId,
6158 + type: "invalid",
6159 + message: errorMessage
6160 + }
6161 + );
6162 + }
6163 + if (statusMessage?.type) {
6164 + return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
6165 + ValidityIndicator,
6166 + {
6167 + id: messageId,
6168 + type: statusMessage.type,
6169 + message: statusMessage.message
6170 + }
6171 + );
6172 + }
6173 + return null;
6174 + })();
6175 + const visibleMessage = showMessage ? message : null;
6176 + (0, import_element11.useEffect)(() => {
6177 + const target = getValidityTarget();
6178 + if (!target) {
6179 + return;
6180 + }
6181 + function setDescribedBy(el, shouldAdd) {
6182 + const ids = (el.getAttribute("aria-describedby") ?? "").split(" ").filter((id) => id && id !== messageId);
6183 + if (shouldAdd) {
6184 + ids.push(messageId);
6185 + }
6186 + if (ids.length) {
6187 + el.setAttribute("aria-describedby", ids.join(" "));
6188 + } else {
6189 + el.removeAttribute("aria-describedby");
6190 + }
6191 + }
6192 + setDescribedBy(target, !!visibleMessage);
6193 + return () => setDescribedBy(target, false);
6194 + }, [visibleMessage, messageId, getValidityTarget]);
6195 + return useRender({
6196 + render,
6197 + ref: [forwardedRef, wrapperRef],
6198 + props: mergeProps(restProps, {
6199 + onBlur,
6200 + children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)(import_jsx_runtime41.Fragment, { children: [
6201 + (0, import_element11.cloneElement)(children, {
6202 + label: appendRequiredIndicator(
6203 + children.props.label,
6204 + required,
6205 + markWhenOptional
6206 + ),
6207 + required
6208 + }),
6209 + visibleMessage
4063 6210 ] })
4064 6211 })
4065 6212 });
4066 - return element;
4067 6213 });
4068 6214
6215 + // packages/ui/build-module/form/primitives/field/index.mjs
6216 + var field_exports = {};
6217 + __export(field_exports, {
6218 + Control: () => Control,
6219 + Description: () => Description,
6220 + Details: () => Details,
6221 + Item: () => Item,
6222 + Label: () => Label,
6223 + Root: () => Root,
6224 + VisualLabel: () => VisualLabel
6225 + });
6226 +
6227 + // packages/ui/build-module/form/primitives/field/root.mjs
6228 + var import_element12 = __toESM(require_element(), 1);
6229 + var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
6230 + var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash";
6231 + function getRuntime9() {
6232 + const globalScope = globalThis;
6233 + if (globalScope.__wpStyleRuntime) {
6234 + return globalScope.__wpStyleRuntime;
6235 + }
6236 + globalScope.__wpStyleRuntime = {
6237 + documents: /* @__PURE__ */ new Map(),
6238 + styles: /* @__PURE__ */ new Map(),
6239 + injectedStyles: /* @__PURE__ */ new WeakMap()
6240 + };
6241 + if (typeof document !== "undefined") {
6242 + registerDocument9(document);
6243 + }
6244 + return globalScope.__wpStyleRuntime;
6245 + }
6246 + function documentContainsStyleHash9(targetDocument, hash) {
6247 + if (!targetDocument.head) {
6248 + return false;
6249 + }
6250 + for (const style of targetDocument.head.querySelectorAll(
6251 + `style[${STYLE_HASH_ATTRIBUTE9}]`
6252 + )) {
6253 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) {
6254 + return true;
6255 + }
6256 + }
6257 + return false;
6258 + }
6259 + function injectStyle9(targetDocument, hash, css) {
6260 + if (!targetDocument.head) {
6261 + return;
6262 + }
6263 + const runtime = getRuntime9();
6264 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6265 + if (!injectedStyles) {
6266 + injectedStyles = /* @__PURE__ */ new Set();
6267 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6268 + }
6269 + if (injectedStyles.has(hash)) {
6270 + return;
6271 + }
6272 + if (documentContainsStyleHash9(targetDocument, hash)) {
6273 + injectedStyles.add(hash);
6274 + return;
6275 + }
6276 + const style = targetDocument.createElement("style");
6277 + style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash);
6278 + style.appendChild(targetDocument.createTextNode(css));
6279 + targetDocument.head.appendChild(style);
6280 + injectedStyles.add(hash);
6281 + }
6282 + function registerDocument9(targetDocument) {
6283 + const runtime = getRuntime9();
6284 + runtime.documents.set(
6285 + targetDocument,
6286 + (runtime.documents.get(targetDocument) ?? 0) + 1
6287 + );
6288 + for (const [hash, css] of runtime.styles) {
6289 + injectStyle9(targetDocument, hash, css);
6290 + }
6291 + return () => {
6292 + const count = runtime.documents.get(targetDocument);
6293 + if (count === void 0) {
6294 + return;
6295 + }
6296 + if (count <= 1) {
6297 + runtime.documents.delete(targetDocument);
6298 + return;
6299 + }
6300 + runtime.documents.set(targetDocument, count - 1);
6301 + };
6302 + }
6303 + function registerStyle9(hash, css) {
6304 + const runtime = getRuntime9();
6305 + runtime.styles.set(hash, css);
6306 + for (const targetDocument of runtime.documents.keys()) {
6307 + injectStyle9(targetDocument, hash, css);
6308 + }
6309 + }
6310 + if (typeof process === "undefined" || true) {
6311 + registerStyle9("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}");
6312 + }
6313 + var resets_default3 = { "box-sizing": "_336cd3e4e743482f__box-sizing" };
6314 + var DEFAULT_RENDER2 = (props) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Stack, { ...props, direction: "column", gap: "sm" });
6315 + var Root = (0, import_element12.forwardRef)(function Root2({ className, render = DEFAULT_RENDER2, ...restProps }, ref) {
6316 + return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
6317 + index_parts_exports.Root,
6318 + {
6319 + ref,
6320 + className: clsx_default(resets_default3["box-sizing"], className),
6321 + render,
6322 + ...restProps
6323 + }
6324 + );
6325 + });
6326 +
6327 + // packages/ui/build-module/form/primitives/field/item.mjs
6328 + var import_element13 = __toESM(require_element(), 1);
6329 + var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
6330 + var Item = (0, import_element13.forwardRef)(function Item2(props, ref) {
6331 + return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(index_parts_exports.Item, { ref, ...props });
6332 + });
6333 +
6334 + // packages/ui/build-module/form/primitives/field/label.mjs
6335 + var import_element14 = __toESM(require_element(), 1);
6336 + var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
6337 + var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash";
6338 + function getRuntime10() {
6339 + const globalScope = globalThis;
6340 + if (globalScope.__wpStyleRuntime) {
6341 + return globalScope.__wpStyleRuntime;
6342 + }
6343 + globalScope.__wpStyleRuntime = {
6344 + documents: /* @__PURE__ */ new Map(),
6345 + styles: /* @__PURE__ */ new Map(),
6346 + injectedStyles: /* @__PURE__ */ new WeakMap()
6347 + };
6348 + if (typeof document !== "undefined") {
6349 + registerDocument10(document);
6350 + }
6351 + return globalScope.__wpStyleRuntime;
6352 + }
6353 + function documentContainsStyleHash10(targetDocument, hash) {
6354 + if (!targetDocument.head) {
6355 + return false;
6356 + }
6357 + for (const style of targetDocument.head.querySelectorAll(
6358 + `style[${STYLE_HASH_ATTRIBUTE10}]`
6359 + )) {
6360 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) {
6361 + return true;
6362 + }
6363 + }
6364 + return false;
6365 + }
6366 + function injectStyle10(targetDocument, hash, css) {
6367 + if (!targetDocument.head) {
6368 + return;
6369 + }
6370 + const runtime = getRuntime10();
6371 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6372 + if (!injectedStyles) {
6373 + injectedStyles = /* @__PURE__ */ new Set();
6374 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6375 + }
6376 + if (injectedStyles.has(hash)) {
6377 + return;
6378 + }
6379 + if (documentContainsStyleHash10(targetDocument, hash)) {
6380 + injectedStyles.add(hash);
6381 + return;
6382 + }
6383 + const style = targetDocument.createElement("style");
6384 + style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash);
6385 + style.appendChild(targetDocument.createTextNode(css));
6386 + targetDocument.head.appendChild(style);
6387 + injectedStyles.add(hash);
6388 + }
6389 + function registerDocument10(targetDocument) {
6390 + const runtime = getRuntime10();
6391 + runtime.documents.set(
6392 + targetDocument,
6393 + (runtime.documents.get(targetDocument) ?? 0) + 1
6394 + );
6395 + for (const [hash, css] of runtime.styles) {
6396 + injectStyle10(targetDocument, hash, css);
6397 + }
6398 + return () => {
6399 + const count = runtime.documents.get(targetDocument);
6400 + if (count === void 0) {
6401 + return;
6402 + }
6403 + if (count <= 1) {
6404 + runtime.documents.delete(targetDocument);
6405 + return;
6406 + }
6407 + runtime.documents.set(targetDocument, count - 1);
6408 + };
6409 + }
6410 + function registerStyle10(hash, css) {
6411 + const runtime = getRuntime10();
6412 + runtime.styles.set(hash, css);
6413 + for (const targetDocument of runtime.documents.keys()) {
6414 + injectStyle10(targetDocument, hash, css);
6415 + }
6416 + }
6417 + if (typeof process === "undefined" || true) {
6418 + registerStyle10("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6419 + }
6420 + var field_default = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6421 + var Label = (0, import_element14.forwardRef)(
6422 + function Label2({ className, hideFromVision, variant, ...restProps }, ref) {
6423 + const label = /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6424 + index_parts_exports.Label,
6425 + {
6426 + ref,
6427 + className: clsx_default(
6428 + field_default.label,
6429 + variant && field_default[`is-${variant}`],
6430 + className
6431 + ),
6432 + ...restProps
6433 + }
6434 + );
6435 + if (hideFromVision) {
6436 + return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(VisuallyHidden, { render: label });
6437 + }
6438 + return label;
6439 + }
6440 + );
6441 +
6442 + // packages/ui/build-module/form/primitives/field/description.mjs
6443 + var import_element15 = __toESM(require_element(), 1);
6444 + var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1);
6445 + var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash";
6446 + function getRuntime11() {
6447 + const globalScope = globalThis;
6448 + if (globalScope.__wpStyleRuntime) {
6449 + return globalScope.__wpStyleRuntime;
6450 + }
6451 + globalScope.__wpStyleRuntime = {
6452 + documents: /* @__PURE__ */ new Map(),
6453 + styles: /* @__PURE__ */ new Map(),
6454 + injectedStyles: /* @__PURE__ */ new WeakMap()
6455 + };
6456 + if (typeof document !== "undefined") {
6457 + registerDocument11(document);
6458 + }
6459 + return globalScope.__wpStyleRuntime;
6460 + }
6461 + function documentContainsStyleHash11(targetDocument, hash) {
6462 + if (!targetDocument.head) {
6463 + return false;
6464 + }
6465 + for (const style of targetDocument.head.querySelectorAll(
6466 + `style[${STYLE_HASH_ATTRIBUTE11}]`
6467 + )) {
6468 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) {
6469 + return true;
6470 + }
6471 + }
6472 + return false;
6473 + }
6474 + function injectStyle11(targetDocument, hash, css) {
6475 + if (!targetDocument.head) {
6476 + return;
6477 + }
6478 + const runtime = getRuntime11();
6479 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6480 + if (!injectedStyles) {
6481 + injectedStyles = /* @__PURE__ */ new Set();
6482 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6483 + }
6484 + if (injectedStyles.has(hash)) {
6485 + return;
6486 + }
6487 + if (documentContainsStyleHash11(targetDocument, hash)) {
6488 + injectedStyles.add(hash);
6489 + return;
6490 + }
6491 + const style = targetDocument.createElement("style");
6492 + style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash);
6493 + style.appendChild(targetDocument.createTextNode(css));
6494 + targetDocument.head.appendChild(style);
6495 + injectedStyles.add(hash);
6496 + }
6497 + function registerDocument11(targetDocument) {
6498 + const runtime = getRuntime11();
6499 + runtime.documents.set(
6500 + targetDocument,
6501 + (runtime.documents.get(targetDocument) ?? 0) + 1
6502 + );
6503 + for (const [hash, css] of runtime.styles) {
6504 + injectStyle11(targetDocument, hash, css);
6505 + }
6506 + return () => {
6507 + const count = runtime.documents.get(targetDocument);
6508 + if (count === void 0) {
6509 + return;
6510 + }
6511 + if (count <= 1) {
6512 + runtime.documents.delete(targetDocument);
6513 + return;
6514 + }
6515 + runtime.documents.set(targetDocument, count - 1);
6516 + };
6517 + }
6518 + function registerStyle11(hash, css) {
6519 + const runtime = getRuntime11();
6520 + runtime.styles.set(hash, css);
6521 + for (const targetDocument of runtime.documents.keys()) {
6522 + injectStyle11(targetDocument, hash, css);
6523 + }
6524 + }
6525 + if (typeof process === "undefined" || true) {
6526 + registerStyle11("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)}");
6527 + }
6528 + var global_css_defense_default5 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
6529 + if (typeof process === "undefined" || true) {
6530 + registerStyle11("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6531 + }
6532 + var field_default2 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6533 + var Description = (0, import_element15.forwardRef)(function Description2({ className, ...restProps }, ref) {
6534 + return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(
6535 + index_parts_exports.Description,
6536 + {
6537 + ref,
6538 + className: clsx_default(
6539 + global_css_defense_default5.p,
6540 + field_default2.description,
6541 + className
6542 + ),
6543 + ...restProps
6544 + }
6545 + );
6546 + });
6547 +
6548 + // packages/ui/build-module/form/primitives/field/details.mjs
6549 + var import_element16 = __toESM(require_element(), 1);
6550 + var import_i18n6 = __toESM(require_i18n(), 1);
6551 + var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1);
6552 + var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash";
6553 + function getRuntime12() {
6554 + const globalScope = globalThis;
6555 + if (globalScope.__wpStyleRuntime) {
6556 + return globalScope.__wpStyleRuntime;
6557 + }
6558 + globalScope.__wpStyleRuntime = {
6559 + documents: /* @__PURE__ */ new Map(),
6560 + styles: /* @__PURE__ */ new Map(),
6561 + injectedStyles: /* @__PURE__ */ new WeakMap()
6562 + };
6563 + if (typeof document !== "undefined") {
6564 + registerDocument12(document);
6565 + }
6566 + return globalScope.__wpStyleRuntime;
6567 + }
6568 + function documentContainsStyleHash12(targetDocument, hash) {
6569 + if (!targetDocument.head) {
6570 + return false;
6571 + }
6572 + for (const style of targetDocument.head.querySelectorAll(
6573 + `style[${STYLE_HASH_ATTRIBUTE12}]`
6574 + )) {
6575 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) {
6576 + return true;
6577 + }
6578 + }
6579 + return false;
6580 + }
6581 + function injectStyle12(targetDocument, hash, css) {
6582 + if (!targetDocument.head) {
6583 + return;
6584 + }
6585 + const runtime = getRuntime12();
6586 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6587 + if (!injectedStyles) {
6588 + injectedStyles = /* @__PURE__ */ new Set();
6589 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6590 + }
6591 + if (injectedStyles.has(hash)) {
6592 + return;
6593 + }
6594 + if (documentContainsStyleHash12(targetDocument, hash)) {
6595 + injectedStyles.add(hash);
6596 + return;
6597 + }
6598 + const style = targetDocument.createElement("style");
6599 + style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash);
6600 + style.appendChild(targetDocument.createTextNode(css));
6601 + targetDocument.head.appendChild(style);
6602 + injectedStyles.add(hash);
6603 + }
6604 + function registerDocument12(targetDocument) {
6605 + const runtime = getRuntime12();
6606 + runtime.documents.set(
6607 + targetDocument,
6608 + (runtime.documents.get(targetDocument) ?? 0) + 1
6609 + );
6610 + for (const [hash, css] of runtime.styles) {
6611 + injectStyle12(targetDocument, hash, css);
6612 + }
6613 + return () => {
6614 + const count = runtime.documents.get(targetDocument);
6615 + if (count === void 0) {
6616 + return;
6617 + }
6618 + if (count <= 1) {
6619 + runtime.documents.delete(targetDocument);
6620 + return;
6621 + }
6622 + runtime.documents.set(targetDocument, count - 1);
6623 + };
6624 + }
6625 + function registerStyle12(hash, css) {
6626 + const runtime = getRuntime12();
6627 + runtime.styles.set(hash, css);
6628 + for (const targetDocument of runtime.documents.keys()) {
6629 + injectStyle12(targetDocument, hash, css);
6630 + }
6631 + }
6632 + if (typeof process === "undefined" || true) {
6633 + registerStyle12("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6634 + }
6635 + var field_default3 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6636 + var Details = (0, import_element16.forwardRef)(
6637 + function Details2({ className, ...restProps }, ref) {
6638 + return /* @__PURE__ */ (0, import_jsx_runtime46.jsxs)(import_jsx_runtime46.Fragment, { children: [
6639 + /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(index_parts_exports.Description, {}), children: (0, import_i18n6.__)("More details follow the field.") }),
6640 + /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(
6641 + "div",
6642 + {
6643 + ref,
6644 + className: clsx_default(field_default3.description, className),
6645 + ...restProps
6646 + }
6647 + )
6648 + ] });
6649 + }
6650 + );
6651 +
6652 + // packages/ui/build-module/form/primitives/field/control.mjs
6653 + var import_element17 = __toESM(require_element(), 1);
6654 + var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1);
6655 + var Control = (0, import_element17.forwardRef)(
6656 + function Control2(props, ref) {
6657 + return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(index_parts_exports.Control, { ref, ...props });
6658 + }
6659 + );
6660 +
6661 + // packages/ui/build-module/form/primitives/field/visual-label.mjs
6662 + var import_element18 = __toESM(require_element(), 1);
6663 + var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash";
6664 + function getRuntime13() {
6665 + const globalScope = globalThis;
6666 + if (globalScope.__wpStyleRuntime) {
6667 + return globalScope.__wpStyleRuntime;
6668 + }
6669 + globalScope.__wpStyleRuntime = {
6670 + documents: /* @__PURE__ */ new Map(),
6671 + styles: /* @__PURE__ */ new Map(),
6672 + injectedStyles: /* @__PURE__ */ new WeakMap()
6673 + };
6674 + if (typeof document !== "undefined") {
6675 + registerDocument13(document);
6676 + }
6677 + return globalScope.__wpStyleRuntime;
6678 + }
6679 + function documentContainsStyleHash13(targetDocument, hash) {
6680 + if (!targetDocument.head) {
6681 + return false;
6682 + }
6683 + for (const style of targetDocument.head.querySelectorAll(
6684 + `style[${STYLE_HASH_ATTRIBUTE13}]`
6685 + )) {
6686 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) {
6687 + return true;
6688 + }
6689 + }
6690 + return false;
6691 + }
6692 + function injectStyle13(targetDocument, hash, css) {
6693 + if (!targetDocument.head) {
6694 + return;
6695 + }
6696 + const runtime = getRuntime13();
6697 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6698 + if (!injectedStyles) {
6699 + injectedStyles = /* @__PURE__ */ new Set();
6700 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6701 + }
6702 + if (injectedStyles.has(hash)) {
6703 + return;
6704 + }
6705 + if (documentContainsStyleHash13(targetDocument, hash)) {
6706 + injectedStyles.add(hash);
6707 + return;
6708 + }
6709 + const style = targetDocument.createElement("style");
6710 + style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash);
6711 + style.appendChild(targetDocument.createTextNode(css));
6712 + targetDocument.head.appendChild(style);
6713 + injectedStyles.add(hash);
6714 + }
6715 + function registerDocument13(targetDocument) {
6716 + const runtime = getRuntime13();
6717 + runtime.documents.set(
6718 + targetDocument,
6719 + (runtime.documents.get(targetDocument) ?? 0) + 1
6720 + );
6721 + for (const [hash, css] of runtime.styles) {
6722 + injectStyle13(targetDocument, hash, css);
6723 + }
6724 + return () => {
6725 + const count = runtime.documents.get(targetDocument);
6726 + if (count === void 0) {
6727 + return;
6728 + }
6729 + if (count <= 1) {
6730 + runtime.documents.delete(targetDocument);
6731 + return;
6732 + }
6733 + runtime.documents.set(targetDocument, count - 1);
6734 + };
6735 + }
6736 + function registerStyle13(hash, css) {
6737 + const runtime = getRuntime13();
6738 + runtime.styles.set(hash, css);
6739 + for (const targetDocument of runtime.documents.keys()) {
6740 + injectStyle13(targetDocument, hash, css);
6741 + }
6742 + }
6743 + if (typeof process === "undefined" || true) {
6744 + registerStyle13("df33c48b2d", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._2d5ad850b2f90964__label{--wp-ui-field-label-line-height:var(--wpds-typography-line-height-xs,16px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wp-ui-field-label-line-height);text-transform:uppercase;&._17c4214649230bea__is-plain{font-size:var(--wpds-typography-font-size-md,13px);font-weight:var(--wpds-typography-font-weight-default,400);text-transform:none}}._08a3750500e0233f__description{--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);--_gcd-p-margin:0;text-wrap:pretty;color:var(--wpds-color-foreground-content-neutral-weak,#707070);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}');
6745 + }
6746 + var field_default4 = { "label": "_2d5ad850b2f90964__label", "is-plain": "_17c4214649230bea__is-plain", "description": "_08a3750500e0233f__description" };
6747 + var VisualLabel = (0, import_element18.forwardRef)(
6748 + function VisualLabel2({ className, render, variant, ...restProps }, ref) {
6749 + return useRender({
6750 + defaultTagName: "span",
6751 + render,
6752 + ref,
6753 + props: mergeProps(restProps, {
6754 + className: clsx_default(
6755 + field_default4.label,
6756 + variant && field_default4[`is-${variant}`],
6757 + className
6758 + )
6759 + })
6760 + });
6761 + }
6762 + );
6763 + VisualLabel.displayName = "Field.VisualLabel";
6764 +
6765 + // packages/ui/build-module/form/input-control/input-control.mjs
6766 + var import_element19 = __toESM(require_element(), 1);
6767 + var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1);
6768 + var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash";
6769 + function getRuntime14() {
6770 + const globalScope = globalThis;
6771 + if (globalScope.__wpStyleRuntime) {
6772 + return globalScope.__wpStyleRuntime;
6773 + }
6774 + globalScope.__wpStyleRuntime = {
6775 + documents: /* @__PURE__ */ new Map(),
6776 + styles: /* @__PURE__ */ new Map(),
6777 + injectedStyles: /* @__PURE__ */ new WeakMap()
6778 + };
6779 + if (typeof document !== "undefined") {
6780 + registerDocument14(document);
6781 + }
6782 + return globalScope.__wpStyleRuntime;
6783 + }
6784 + function documentContainsStyleHash14(targetDocument, hash) {
6785 + if (!targetDocument.head) {
6786 + return false;
6787 + }
6788 + for (const style of targetDocument.head.querySelectorAll(
6789 + `style[${STYLE_HASH_ATTRIBUTE14}]`
6790 + )) {
6791 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) {
6792 + return true;
6793 + }
6794 + }
6795 + return false;
6796 + }
6797 + function injectStyle14(targetDocument, hash, css) {
6798 + if (!targetDocument.head) {
6799 + return;
6800 + }
6801 + const runtime = getRuntime14();
6802 + let injectedStyles = runtime.injectedStyles.get(targetDocument);
6803 + if (!injectedStyles) {
6804 + injectedStyles = /* @__PURE__ */ new Set();
6805 + runtime.injectedStyles.set(targetDocument, injectedStyles);
6806 + }
6807 + if (injectedStyles.has(hash)) {
6808 + return;
6809 + }
6810 + if (documentContainsStyleHash14(targetDocument, hash)) {
6811 + injectedStyles.add(hash);
6812 + return;
6813 + }
6814 + const style = targetDocument.createElement("style");
6815 + style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash);
6816 + style.appendChild(targetDocument.createTextNode(css));
6817 + targetDocument.head.appendChild(style);
6818 + injectedStyles.add(hash);
6819 + }
6820 + function registerDocument14(targetDocument) {
6821 + const runtime = getRuntime14();
6822 + runtime.documents.set(
6823 + targetDocument,
6824 + (runtime.documents.get(targetDocument) ?? 0) + 1
6825 + );
6826 + for (const [hash, css] of runtime.styles) {
6827 + injectStyle14(targetDocument, hash, css);
6828 + }
6829 + return () => {
6830 + const count = runtime.documents.get(targetDocument);
6831 + if (count === void 0) {
6832 + return;
6833 + }
6834 + if (count <= 1) {
6835 + runtime.documents.delete(targetDocument);
6836 + return;
6837 + }
6838 + runtime.documents.set(targetDocument, count - 1);
6839 + };
6840 + }
6841 + function registerStyle14(hash, css) {
6842 + const runtime = getRuntime14();
6843 + runtime.styles.set(hash, css);
6844 + for (const targetDocument of runtime.documents.keys()) {
6845 + injectStyle14(targetDocument, hash, css);
6846 + }
6847 + }
6848 + if (typeof process === "undefined" || true) {
6849 + registerStyle14("0c752c3d08", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer compositions{@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.a9211a7e6af24bed__root input[type=date]:not([data-filled]):not(:focus),.a9211a7e6af24bed__root input[type=datetime-local]:not([data-filled]):not(:focus),.a9211a7e6af24bed__root input[type=time]:not([data-filled]):not(:focus){--_gcd-input-color:transparent;--_gcd-input-color-disabled:transparent;color:transparent;&:disabled::-webkit-datetime-edit-text{color:transparent}}}}}");
6850 + }
6851 + var style_default9 = { "root": "a9211a7e6af24bed__root" };
6852 + var InputControl = (0, import_element19.forwardRef)(
6853 + function InputControl2({
6854 + className,
6855 + label,
6856 + description,
6857 + details,
6858 + hideLabelFromVision,
6859 + ...restProps
6860 + }, ref) {
6861 + return /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(field_exports.Root, { className: clsx_default(style_default9.root, className), children: [
6862 + /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Label, { hideFromVision: hideLabelFromVision, children: label }),
6863 + /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(Input3, { ref, ...restProps }),
6864 + description && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Description, { children: description }),
6865 + details && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)(field_exports.Details, { children: details })
6866 + ] });
6867 + }
6868 + );
6869 +
6870 + // packages/ui/build-module/form/with-validation/validated-input-control/validated-input-control.mjs
6871 + var import_element20 = __toESM(require_element(), 1);
6872 + var import_compose2 = __toESM(require_compose(), 1);
6873 + var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1);
6874 + var ValidatedInputControl = (0, import_element20.forwardRef)(function ValidatedInputControl2({ required, markWhenOptional, customValidity, ...restProps }, forwardedRef) {
6875 + const validityTargetRef = (0, import_element20.useRef)(null);
6876 + const mergedRefs = (0, import_compose2.useMergeRefs)([forwardedRef, validityTargetRef]);
6877 + return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(
6878 + ControlWithError,
6879 + {
6880 + required,
6881 + markWhenOptional,
6882 + customValidity,
6883 + getValidityTarget: () => validityTargetRef.current,
6884 + children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(InputControl, { ref: mergedRefs, ...restProps })
6885 + }
6886 + );
6887 + });
6888 +
4069 6889 // packages/ui/build-module/tabs/index.mjs
4070 6890 var tabs_exports = {};
4071 6891 __export(tabs_exports, {
4072 6892 List: () => List,
4073 6893 Panel: () => Panel,
4074 - Root: () => Root,
6894 + Root: () => Root3,
4075 6895 Tab: () => Tab
4076 6896 });
4077 6897
4078 6898 // packages/ui/build-module/tabs/list.mjs
4079 - var import_element7 = __toESM(require_element(), 1);
4080 - var import_compose = __toESM(require_compose(), 1);
4081 - var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1);
4082 - var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash";
4083 - function getRuntime4() {
6899 + var import_element21 = __toESM(require_element(), 1);
6900 + var import_compose3 = __toESM(require_compose(), 1);
6901 + var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1);
6902 + var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash";
6903 + function getRuntime15() {
4084 6904 const globalScope = globalThis;
4085 6905 if (globalScope.__wpStyleRuntime) {
4086 6906 return globalScope.__wpStyleRuntime;
4087 6907 }
@@ -4090,30 +6910,30 @@
4090 6910 styles: /* @__PURE__ */ new Map(),
4091 6911 injectedStyles: /* @__PURE__ */ new WeakMap()
4092 6912 };
4093 6913 if (typeof document !== "undefined") {
4094 - registerDocument4(document);
6914 + registerDocument15(document);
4095 6915 }
4096 6916 return globalScope.__wpStyleRuntime;
4097 6917 }
4098 - function documentContainsStyleHash4(targetDocument, hash) {
6918 + function documentContainsStyleHash15(targetDocument, hash) {
4099 6919 if (!targetDocument.head) {
4100 6920 return false;
4101 6921 }
4102 6922 for (const style of targetDocument.head.querySelectorAll(
4103 - `style[${STYLE_HASH_ATTRIBUTE4}]`
6923 + `style[${STYLE_HASH_ATTRIBUTE15}]`
4104 6924 )) {
4105 - if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) {
6925 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) {
4106 6926 return true;
4107 6927 }
4108 6928 }
4109 6929 return false;
4110 6930 }
4111 - function injectStyle4(targetDocument, hash, css) {
6931 + function injectStyle15(targetDocument, hash, css) {
4112 6932 if (!targetDocument.head) {
4113 6933 return;
4114 6934 }
4115 - const runtime = getRuntime4();
6935 + const runtime = getRuntime15();
4116 6936 let injectedStyles = runtime.injectedStyles.get(targetDocument);
4117 6937 if (!injectedStyles) {
4118 6938 injectedStyles = /* @__PURE__ */ new Set();
4119 6939 runtime.injectedStyles.set(targetDocument, injectedStyles);
@@ -4120,26 +6940,26 @@
4120 6940 }
4121 6941 if (injectedStyles.has(hash)) {
4122 6942 return;
4123 6943 }
4124 - if (documentContainsStyleHash4(targetDocument, hash)) {
6944 + if (documentContainsStyleHash15(targetDocument, hash)) {
4125 6945 injectedStyles.add(hash);
4126 6946 return;
4127 6947 }
4128 6948 const style = targetDocument.createElement("style");
4129 - style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash);
6949 + style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash);
4130 6950 style.appendChild(targetDocument.createTextNode(css));
4131 6951 targetDocument.head.appendChild(style);
4132 6952 injectedStyles.add(hash);
4133 6953 }
4134 - function registerDocument4(targetDocument) {
4135 - const runtime = getRuntime4();
6954 + function registerDocument15(targetDocument) {
6955 + const runtime = getRuntime15();
4136 6956 runtime.documents.set(
4137 6957 targetDocument,
4138 6958 (runtime.documents.get(targetDocument) ?? 0) + 1
4139 6959 );
4140 6960 for (const [hash, css] of runtime.styles) {
4141 - injectStyle4(targetDocument, hash, css);
6961 + injectStyle15(targetDocument, hash, css);
4142 6962 }
4143 6963 return () => {
4144 6964 const count = runtime.documents.get(targetDocument);
4145 6965 if (count === void 0) {
@@ -4151,21 +6971,21 @@
4151 6971 }
4152 6972 runtime.documents.set(targetDocument, count - 1);
4153 6973 };
4154 6974 }
4155 - function registerStyle4(hash, css) {
4156 - const runtime = getRuntime4();
6975 + function registerStyle15(hash, css) {
6976 + const runtime = getRuntime15();
4157 6977 runtime.styles.set(hash, css);
4158 6978 for (const targetDocument of runtime.documents.keys()) {
4159 - injectStyle4(targetDocument, hash, css);
6979 + injectStyle15(targetDocument, hash, css);
4160 6980 }
4161 6981 }
4162 6982 if (typeof process === "undefined" || true) {
4163 - registerStyle4("8e0be0c342", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
6983 + registerStyle15("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
4164 6984 }
4165 - var style_default4 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
6985 + var style_default10 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
4166 6986 var SCROLL_EPSILON = 1;
4167 - var List = (0, import_element7.forwardRef)(
6987 + var List = (0, import_element21.forwardRef)(
4168 6988 function TabList({
4169 6989 children,
4170 6990 variant = "default",
4171 6991 className,
@@ -4171,15 +6991,15 @@
4171 6991 className,
4172 6992 activateOnFocus,
4173 6993 ...otherProps
4174 6994 }, forwardedRef) {
4175 - const [listEl, setListEl] = (0, import_element7.useState)(null);
4176 - const [overflow, setOverflow] = (0, import_element7.useState)({
6995 + const [listEl, setListEl] = (0, import_element21.useState)(null);
6996 + const [overflow, setOverflow] = (0, import_element21.useState)({
4177 6997 first: false,
4178 6998 last: false,
4179 6999 isScrolling: false
4180 7000 });
4181 - (0, import_element7.useEffect)(() => {
7001 + (0, import_element21.useEffect)(() => {
4182 7002 if (!listEl) {
4183 7003 return;
4184 7004 }
4185 7005 const measureOverflow = () => {
@@ -4191,16 +7011,28 @@
4191 7011 // (right edge) and becomes negative toward the "end" (left edge).
4192 7012 // Normalize value for correct first/last detection logic.
4193 7013 -scrollLeft
4194 7014 ) : scrollLeft;
4195 - setOverflow({
7015 + const next = {
4196 7016 first: scrollFromStart > SCROLL_EPSILON,
4197 7017 last: scrollFromStart < maxScroll - SCROLL_EPSILON,
4198 7018 isScrolling: scrollWidth > clientWidth
4199 - });
7019 + };
7020 + setOverflow(
7021 + (prev) => prev.first === next.first && prev.last === next.last && prev.isScrolling === next.isScrolling ? prev : next
7022 + );
4200 7023 };
4201 7024 const resizeObserver = new ResizeObserver(measureOverflow);
4202 - resizeObserver.observe(listEl);
7025 + const observeTabs = () => {
7026 + resizeObserver.disconnect();
7027 + resizeObserver.observe(listEl);
7028 + listEl.querySelectorAll('[role="tab"]').forEach((tab) => resizeObserver.observe(tab));
7029 + };
7030 + const mutationObserver = new MutationObserver(observeTabs);
7031 + mutationObserver.observe(listEl, {
7032 + childList: true,
7033 + subtree: true
7034 + });
4203 7035 let scrollTick = false;
4204 7036 const throttleMeasureOverflowOnScroll = () => {
4205 7037 if (!scrollTick) {
4206 7038 requestAnimationFrame(() => {
@@ -4214,8 +7046,9 @@
4214 7046 "scroll",
4215 7047 throttleMeasureOverflowOnScroll,
4216 7048 { passive: true }
4217 7049 );
7050 + observeTabs();
4218 7051 measureOverflow();
4219 7052 return () => {
4220 7053 listEl.removeEventListener(
4221 7054 "scroll",
@@ -4221,25 +7054,26 @@
4221 7054 "scroll",
4222 7055 throttleMeasureOverflowOnScroll
4223 7056 );
4224 7057 resizeObserver.disconnect();
7058 + mutationObserver.disconnect();
4225 7059 };
4226 7060 }, [listEl]);
4227 - const mergedListRef = (0, import_compose.useMergeRefs)([
7061 + const mergedListRef = (0, import_compose3.useMergeRefs)([
4228 7062 forwardedRef,
4229 7063 (el) => setListEl(el)
4230 7064 ]);
4231 - return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
4232 - index_parts_exports.List,
7065 + return /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(
7066 + index_parts_exports2.List,
4233 7067 {
4234 7068 ref: mergedListRef,
4235 7069 activateOnFocus,
4236 7070 "data-select-on-move": activateOnFocus ? "true" : "false",
4237 7071 className: clsx_default(
4238 - style_default4.tablist,
4239 - overflow.first && style_default4["is-overflowing-first"],
4240 - overflow.last && style_default4["is-overflowing-last"],
4241 - style_default4[`is-${variant}-variant`],
7072 + style_default10.tablist,
7073 + overflow.first && style_default10["is-overflowing-first"],
7074 + overflow.last && style_default10["is-overflowing-last"],
7075 + style_default10[`is-${variant}-variant`],
4242 7076 className
4243 7077 ),
4244 7078 ...otherProps,
4245 7079 tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0),
@@ -4244,9 +7078,9 @@
4244 7078 ...otherProps,
4245 7079 tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0),
4246 7080 children: [
4247 7081 children,
4248 - /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(index_parts_exports.Indicator, { className: style_default4.indicator })
7082 + /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(index_parts_exports2.Indicator, { className: style_default10.indicator })
4249 7083 ]
4250 7084 }
4251 7085 );
4252 7086 }
@@ -4252,18 +7086,18 @@
4252 7086 }
4253 7087 );
4254 7088
4255 7089 // packages/ui/build-module/tabs/panel.mjs
4256 - var import_element9 = __toESM(require_element(), 1);
7090 + var import_element23 = __toESM(require_element(), 1);
4257 7091
4258 7092 // packages/ui/build-module/tabs/context.mjs
4259 - var import_element8 = __toESM(require_element(), 1);
4260 - var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1);
7093 + var import_element22 = __toESM(require_element(), 1);
7094 + var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1);
4261 7095 var VALIDATION_ENABLED = true;
4262 - var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element8.createContext)(null) : null;
7096 + var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element22.createContext)(null) : null;
4263 7097 function useRegisterTabDev() {
4264 - const context = (0, import_element8.useContext)(TabsValidationContext);
4265 - (0, import_element8.useEffect)(() => {
7098 + const context = (0, import_element22.useContext)(TabsValidationContext);
7099 + (0, import_element22.useEffect)(() => {
4266 7100 if (context) {
4267 7101 return context.registerTab();
4268 7102 }
4269 7103 return void 0;
@@ -4272,10 +7106,10 @@
4272 7106 function useRegisterTabProd() {
4273 7107 }
4274 7108 var useRegisterTab = VALIDATION_ENABLED ? useRegisterTabDev : useRegisterTabProd;
4275 7109 function useRegisterPanelDev() {
4276 - const context = (0, import_element8.useContext)(TabsValidationContext);
4277 - (0, import_element8.useEffect)(() => {
7110 + const context = (0, import_element22.useContext)(TabsValidationContext);
7111 + (0, import_element22.useEffect)(() => {
4278 7112 if (context) {
4279 7113 return context.registerPanel();
4280 7114 }
4281 7115 return void 0;
@@ -4286,10 +7120,10 @@
4286 7120 var useRegisterPanel = VALIDATION_ENABLED ? useRegisterPanelDev : useRegisterPanelProd;
4287 7121 function TabsValidationProviderDev({
4288 7122 children
4289 7123 }) {
4290 - const tabCountRef = (0, import_element8.useRef)(0);
4291 - const panelCountRef = (0, import_element8.useRef)(0);
7124 + const tabCountRef = (0, import_element22.useRef)(0);
7125 + const panelCountRef = (0, import_element22.useRef)(0);
4292 7126 const scheduleValidation = useScheduleValidation(() => {
4293 7127 const tabCount = tabCountRef.current;
4294 7128 const panelCount = panelCountRef.current;
4295 7129 if (tabCount !== panelCount) {
@@ -4297,9 +7131,9 @@
4297 7131 `Tabs: Tab/Panel count mismatch (${tabCount} Tabs, ${panelCount} Panels). Each Tab must be associated with exactly one Panel. Mismatched or missing associations can break screen reader navigation and violate WAI-ARIA Tabs pattern requirements.`
4298 7132 );
4299 7133 }
4300 7134 });
4301 - const registerTab = (0, import_element8.useCallback)(() => {
7135 + const registerTab = (0, import_element22.useCallback)(() => {
4302 7136 tabCountRef.current += 1;
4303 7137 scheduleValidation();
4304 7138 return () => {
4305 7139 tabCountRef.current -= 1;
@@ -4305,9 +7139,9 @@
4305 7139 tabCountRef.current -= 1;
4306 7140 scheduleValidation();
4307 7141 };
4308 7142 }, [scheduleValidation]);
4309 - const registerPanel = (0, import_element8.useCallback)(() => {
7143 + const registerPanel = (0, import_element22.useCallback)(() => {
4310 7144 panelCountRef.current += 1;
4311 7145 scheduleValidation();
4312 7146 return () => {
4313 7147 panelCountRef.current -= 1;
@@ -4313,9 +7147,9 @@
4313 7147 panelCountRef.current -= 1;
4314 7148 scheduleValidation();
4315 7149 };
4316 7150 }, [scheduleValidation]);
4317 - const contextValue = (0, import_element8.useMemo)(
7151 + const contextValue = (0, import_element22.useMemo)(
4318 7152 () => ({
4319 7153 registerTab,
4320 7154 registerPanel
4321 7155 }),
@@ -4320,21 +7154,21 @@
4320 7154 registerPanel
4321 7155 }),
4322 7156 [registerTab, registerPanel]
4323 7157 );
4324 - return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TabsValidationContext.Provider, { value: contextValue, children });
7158 + return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(TabsValidationContext.Provider, { value: contextValue, children });
4325 7159 }
4326 7160 function TabsValidationProviderProd({
4327 7161 children
4328 7162 }) {
4329 - return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children });
7163 + return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_jsx_runtime51.Fragment, { children });
4330 7164 }
4331 7165 var TabsValidationProvider = VALIDATION_ENABLED ? TabsValidationProviderDev : TabsValidationProviderProd;
4332 7166
4333 7167 // packages/ui/build-module/tabs/panel.mjs
4334 - var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1);
4335 - var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash";
4336 - function getRuntime5() {
7168 + var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1);
7169 + var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash";
7170 + function getRuntime16() {
4337 7171 const globalScope = globalThis;
4338 7172 if (globalScope.__wpStyleRuntime) {
4339 7173 return globalScope.__wpStyleRuntime;
4340 7174 }
@@ -4343,30 +7177,30 @@
4343 7177 styles: /* @__PURE__ */ new Map(),
4344 7178 injectedStyles: /* @__PURE__ */ new WeakMap()
4345 7179 };
4346 7180 if (typeof document !== "undefined") {
4347 - registerDocument5(document);
7181 + registerDocument16(document);
4348 7182 }
4349 7183 return globalScope.__wpStyleRuntime;
4350 7184 }
4351 - function documentContainsStyleHash5(targetDocument, hash) {
7185 + function documentContainsStyleHash16(targetDocument, hash) {
4352 7186 if (!targetDocument.head) {
4353 7187 return false;
4354 7188 }
4355 7189 for (const style of targetDocument.head.querySelectorAll(
4356 - `style[${STYLE_HASH_ATTRIBUTE5}]`
7190 + `style[${STYLE_HASH_ATTRIBUTE16}]`
4357 7191 )) {
4358 - if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) {
7192 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) {
4359 7193 return true;
4360 7194 }
4361 7195 }
4362 7196 return false;
4363 7197 }
4364 - function injectStyle5(targetDocument, hash, css) {
7198 + function injectStyle16(targetDocument, hash, css) {
4365 7199 if (!targetDocument.head) {
4366 7200 return;
4367 7201 }
4368 - const runtime = getRuntime5();
7202 + const runtime = getRuntime16();
4369 7203 let injectedStyles = runtime.injectedStyles.get(targetDocument);
4370 7204 if (!injectedStyles) {
4371 7205 injectedStyles = /* @__PURE__ */ new Set();
4372 7206 runtime.injectedStyles.set(targetDocument, injectedStyles);
@@ -4373,26 +7207,26 @@
4373 7207 }
4374 7208 if (injectedStyles.has(hash)) {
4375 7209 return;
4376 7210 }
4377 - if (documentContainsStyleHash5(targetDocument, hash)) {
7211 + if (documentContainsStyleHash16(targetDocument, hash)) {
4378 7212 injectedStyles.add(hash);
4379 7213 return;
4380 7214 }
4381 7215 const style = targetDocument.createElement("style");
4382 - style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash);
7216 + style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash);
4383 7217 style.appendChild(targetDocument.createTextNode(css));
4384 7218 targetDocument.head.appendChild(style);
4385 7219 injectedStyles.add(hash);
4386 7220 }
4387 - function registerDocument5(targetDocument) {
4388 - const runtime = getRuntime5();
7221 + function registerDocument16(targetDocument) {
7222 + const runtime = getRuntime16();
4389 7223 runtime.documents.set(
4390 7224 targetDocument,
4391 7225 (runtime.documents.get(targetDocument) ?? 0) + 1
4392 7226 );
4393 7227 for (const [hash, css] of runtime.styles) {
4394 - injectStyle5(targetDocument, hash, css);
7228 + injectStyle16(targetDocument, hash, css);
4395 7229 }
4396 7230 return () => {
4397 7231 const count = runtime.documents.get(targetDocument);
4398 7232 if (count === void 0) {
@@ -4404,33 +7238,33 @@
4404 7238 }
4405 7239 runtime.documents.set(targetDocument, count - 1);
4406 7240 };
4407 7241 }
4408 - function registerStyle5(hash, css) {
4409 - const runtime = getRuntime5();
7242 + function registerStyle16(hash, css) {
7243 + const runtime = getRuntime16();
4410 7244 runtime.styles.set(hash, css);
4411 7245 for (const targetDocument of runtime.documents.keys()) {
4412 - injectStyle5(targetDocument, hash, css);
7246 + injectStyle16(targetDocument, hash, css);
4413 7247 }
4414 7248 }
4415 7249 if (typeof process === "undefined" || true) {
4416 - registerStyle5("d5c1b736fd", "._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);&: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-fg-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-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-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-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));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)}");
7250 + registerStyle16("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)}");
4417 7251 }
4418 - var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" };
7252 + var global_css_defense_default6 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li" };
4419 7253 if (typeof process === "undefined" || true) {
4420 - registerStyle5("693cd16544", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._08e8a2e44959f892__outset-ring--focus,._970d04df7376df67__outset-ring--focus-within-except-active,.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible,.cd83dfc2126a0846__outset-ring--focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active,.ecadb9e080e2dfa5__outset-ring--focus-parent-visible{@media not (prefers-reduced-motion){--_gcd-a-transition:outline 0.1s ease-out;transition:outline .1s ease-out}outline:0 solid transparent;outline-offset:1px}._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9))}}}");
7254 + registerStyle16("08122b3d53", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within,:focus-visible ._81935a08e952f267__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}");
4421 7255 }
4422 - var focus_default2 = { "outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus", "outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active", "outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible", "outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within", "outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active", "outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible" };
4423 - var Panel = (0, import_element9.forwardRef)(
7256 + var focus_module_default3 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-parent-visible": "_81935a08e952f267__outset-ring--focus-parent-visible", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" };
7257 + var Panel = (0, import_element23.forwardRef)(
4424 7258 function TabPanel({ className, ...otherProps }, forwardedRef) {
4425 7259 useRegisterPanel();
4426 - return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
4427 - index_parts_exports.Panel,
7260 + return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(
7261 + index_parts_exports2.Panel,
4428 7262 {
4429 7263 ref: forwardedRef,
4430 7264 className: clsx_default(
4431 - global_css_defense_default2.div,
4432 - focus_default2["outset-ring--focus-visible"],
7265 + global_css_defense_default6.div,
7266 + focus_module_default3["outset-ring--focus-visible"],
4433 7267 className
4434 7268 ),
4435 7269 ...otherProps
4436 7270 }
@@ -4438,21 +7272,21 @@
4438 7272 }
4439 7273 );
4440 7274
4441 7275 // packages/ui/build-module/tabs/root.mjs
4442 - var import_element10 = __toESM(require_element(), 1);
4443 - var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1);
4444 - var Root = (0, import_element10.forwardRef)(
7276 + var import_element24 = __toESM(require_element(), 1);
7277 + var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1);
7278 + var Root3 = (0, import_element24.forwardRef)(
4445 7279 function TabsRoot3({ ...otherProps }, forwardedRef) {
4446 - return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TabsValidationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Root, { ref: forwardedRef, ...otherProps }) });
7280 + return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(TabsValidationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(index_parts_exports2.Root, { ref: forwardedRef, ...otherProps }) }) });
4447 7281 }
4448 7282 );
4449 7283
4450 7284 // packages/ui/build-module/tabs/tab.mjs
4451 - var import_element11 = __toESM(require_element(), 1);
4452 - var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1);
4453 - var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash";
4454 - function getRuntime6() {
7285 + var import_element25 = __toESM(require_element(), 1);
7286 + var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1);
7287 + var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash";
7288 + function getRuntime17() {
4455 7289 const globalScope = globalThis;
4456 7290 if (globalScope.__wpStyleRuntime) {
4457 7291 return globalScope.__wpStyleRuntime;
4458 7292 }
@@ -4461,30 +7295,30 @@
4461 7295 styles: /* @__PURE__ */ new Map(),
4462 7296 injectedStyles: /* @__PURE__ */ new WeakMap()
4463 7297 };
4464 7298 if (typeof document !== "undefined") {
4465 - registerDocument6(document);
7299 + registerDocument17(document);
4466 7300 }
4467 7301 return globalScope.__wpStyleRuntime;
4468 7302 }
4469 - function documentContainsStyleHash6(targetDocument, hash) {
7303 + function documentContainsStyleHash17(targetDocument, hash) {
4470 7304 if (!targetDocument.head) {
4471 7305 return false;
4472 7306 }
4473 7307 for (const style of targetDocument.head.querySelectorAll(
4474 - `style[${STYLE_HASH_ATTRIBUTE6}]`
7308 + `style[${STYLE_HASH_ATTRIBUTE17}]`
4475 7309 )) {
4476 - if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) {
7310 + if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) {
4477 7311 return true;
4478 7312 }
4479 7313 }
4480 7314 return false;
4481 7315 }
4482 - function injectStyle6(targetDocument, hash, css) {
7316 + function injectStyle17(targetDocument, hash, css) {
4483 7317 if (!targetDocument.head) {
4484 7318 return;
4485 7319 }
4486 - const runtime = getRuntime6();
7320 + const runtime = getRuntime17();
4487 7321 let injectedStyles = runtime.injectedStyles.get(targetDocument);
4488 7322 if (!injectedStyles) {
4489 7323 injectedStyles = /* @__PURE__ */ new Set();
4490 7324 runtime.injectedStyles.set(targetDocument, injectedStyles);
@@ -4491,26 +7325,26 @@
4491 7325 }
4492 7326 if (injectedStyles.has(hash)) {
4493 7327 return;
4494 7328 }
4495 - if (documentContainsStyleHash6(targetDocument, hash)) {
7329 + if (documentContainsStyleHash17(targetDocument, hash)) {
4496 7330 injectedStyles.add(hash);
4497 7331 return;
4498 7332 }
4499 7333 const style = targetDocument.createElement("style");
4500 - style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash);
7334 + style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash);
4501 7335 style.appendChild(targetDocument.createTextNode(css));
4502 7336 targetDocument.head.appendChild(style);
4503 7337 injectedStyles.add(hash);
4504 7338 }
4505 - function registerDocument6(targetDocument) {
4506 - const runtime = getRuntime6();
7339 + function registerDocument17(targetDocument) {
7340 + const runtime = getRuntime17();
4507 7341 runtime.documents.set(
4508 7342 targetDocument,
4509 7343 (runtime.documents.get(targetDocument) ?? 0) + 1
4510 7344 );
4511 7345 for (const [hash, css] of runtime.styles) {
4512 - injectStyle6(targetDocument, hash, css);
7346 + injectStyle17(targetDocument, hash, css);
4513 7347 }
4514 7348 return () => {
4515 7349 const count = runtime.documents.get(targetDocument);
4516 7350 if (count === void 0) {
@@ -4522,30 +7356,30 @@
4522 7356 }
4523 7357 runtime.documents.set(targetDocument, count - 1);
4524 7358 };
4525 7359 }
4526 - function registerStyle6(hash, css) {
4527 - const runtime = getRuntime6();
7360 + function registerStyle17(hash, css) {
7361 + const runtime = getRuntime17();
4528 7362 runtime.styles.set(hash, css);
4529 7363 for (const targetDocument of runtime.documents.keys()) {
4530 - injectStyle6(targetDocument, hash, css);
7364 + injectStyle17(targetDocument, hash, css);
4531 7365 }
4532 7366 }
4533 7367 if (typeof process === "undefined" || true) {
4534 - registerStyle6("8e0be0c342", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-factor:1;--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-factor:-1;--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-bg-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:40px;padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
7368 + registerStyle17("54ae3f4680", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._7313adbc8a112e90__tablist{--direction-start:left;--direction-end:right;align-items:stretch;display:flex;overflow-inline:auto;overscroll-behavior-inline:none;position:relative;&:dir(rtl){--direction-start:right;--direction-end:left}&[data-orientation=horizontal]{--fade-width:4rem;--fade-gradient-base:transparent 0%,#000 var(--fade-width);--fade-gradient-composed:var(--fade-gradient-base),#000 60%,transparent 50%;width:fit-content;&._9f2ac729c68a735a__is-overflowing-first{mask-image:linear-gradient(to var(--direction-end),var(--fade-gradient-base))}&._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to var(--direction-start),var(--fade-gradient-base))}&._9f2ac729c68a735a__is-overflowing-first._81c799c1f3cdd261__is-overflowing-last{mask-image:linear-gradient(to right,var(--fade-gradient-composed)),linear-gradient(to left,var(--fade-gradient-composed))}&._59228b5227f38a99__is-minimal-variant{gap:1rem}}&[data-orientation=vertical]{flex-direction:column}}._1c37dcfaa1ad8cda__indicator{@media not (prefers-reduced-motion){transition-duration:.2s;transition-property:translate,width,height,border-radius,border-block;transition-timing-function:ease-out}outline:2px solid transparent;outline-offset:-1px;pointer-events:none;position:absolute;&[data-orientation=horizontal]{background-color:var(--wpds-color-stroke-interactive-neutral-strong,#6e6e6e);bottom:0;height:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px));left:0;translate:var(--active-tab-left) 0;width:var(--active-tab-width);z-index:1}&[data-orientation=vertical]{background-color:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);border-radius:var(--wpds-border-radius-sm,2px);height:var(--active-tab-height);left:50%;top:0;translate:-50% var(--active-tab-top);width:100%;z-index:0}._7313adbc8a112e90__tablist[data-select-on-move=true]:has(:focus-visible)\n &[data-orientation=vertical]{border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));box-sizing:border-box}}.a5fd8814f195aa5e__tab{align-items:center;background:transparent;border:none;border-radius:0;box-shadow:none;color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);cursor:var(--wpds-cursor-control,pointer);display:flex;flex:1 0 auto;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-md,13px);font-weight:400;line-height:1.2;outline:none;padding:0;position:relative;white-space:nowrap;z-index:1;&[data-disabled]{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d);cursor:default;@media (forced-colors:active){color:GrayText}}&:not([data-disabled]):is(:hover,:focus-visible){color:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e)}&:after{border-radius:var(--wpds-border-radius-sm,2px);opacity:0;outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9));pointer-events:none;position:absolute;z-index:-1;@media not (prefers-reduced-motion){transition:opacity .1s linear}}&:focus-visible:after{opacity:1}[data-orientation=horizontal] &{height:48px;padding-inline:var(--wpds-dimension-padding-lg,16px);scroll-margin:24px;&:after{content:"";inset:var(--wpds-dimension-padding-md,12px)}}._59228b5227f38a99__is-minimal-variant[data-orientation=horizontal] &{padding-inline:0;&:after{inset-inline:round(up,var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)),1px)}}[data-orientation=vertical] &{min-height:var(--wpds-dimension-size-lg,40px);padding:var(--wpds-dimension-padding-sm,8px) var(--wpds-dimension-padding-md,12px)}[data-orientation=vertical][data-select-on-move=false] &:after{content:"";inset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}._5dfc77e6edd345d4__tab-children{align-items:center;display:flex;flex-grow:1;[data-orientation=horizontal] &{justify-content:center}[data-orientation=vertical] &{justify-content:start}}._4a20e969d15e5ac1__tab-chevron{flex-shrink:0;margin-inline-end:calc(var(--wpds-dimension-gap-xs, 4px)*-1);opacity:0;[data-orientation=horizontal] &{display:none}[role=tab]:is([aria-selected=true],:focus-visible,:hover) &{opacity:1}@media not (prefers-reduced-motion){[data-select-on-move=true]\n [role=tab]:is([aria-selected=true])\n &{transition:opacity .15s linear .15s}}&:dir(rtl){rotate:180deg}}}}');
4535 7369 }
4536 - var style_default5 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
4537 - var Tab = (0, import_element11.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) {
7370 + var style_default11 = { "tablist": "_7313adbc8a112e90__tablist", "is-overflowing-first": "_9f2ac729c68a735a__is-overflowing-first", "is-overflowing-last": "_81c799c1f3cdd261__is-overflowing-last", "is-minimal-variant": "_59228b5227f38a99__is-minimal-variant", "indicator": "_1c37dcfaa1ad8cda__indicator", "tab": "a5fd8814f195aa5e__tab", "tab-children": "_5dfc77e6edd345d4__tab-children", "tab-chevron": "_4a20e969d15e5ac1__tab-chevron" };
7371 + var Tab = (0, import_element25.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) {
4538 7372 useRegisterTab();
4539 - return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
4540 - index_parts_exports.Tab,
7373 + return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(
7374 + index_parts_exports2.Tab,
4541 7375 {
4542 7376 ref: forwardedRef,
4543 - className: clsx_default(style_default5.tab, className),
7377 + className: clsx_default(style_default11.tab, className),
4544 7378 ...otherProps,
4545 7379 children: [
4546 - /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: style_default5["tab-children"], children }),
4547 - /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { icon: chevron_right_default, className: style_default5["tab-chevron"] })
7380 + /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("span", { className: style_default11["tab-children"], children }),
7381 + /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Icon, { icon: chevron_right_default, className: style_default11["tab-chevron"] })
4548 7382 ]
4549 7383 }
4550 7384 );
4551 7385 });
@@ -4550,16 +7384,16 @@
4550 7384 );
4551 7385 });
4552 7386
4553 7387 // packages/format-library/build-module/image/index.mjs
4554 - var import_i18n4 = __toESM(require_i18n(), 1);
4555 - var import_element12 = __toESM(require_element(), 1);
7388 + var import_i18n7 = __toESM(require_i18n(), 1);
7389 + var import_element26 = __toESM(require_element(), 1);
4556 7390 var import_rich_text3 = __toESM(require_rich_text(), 1);
4557 7391 var import_block_editor3 = __toESM(require_block_editor(), 1);
4558 - var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1);
7392 + var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1);
4559 7393 var ALLOWED_MEDIA_TYPES = ["image"];
4560 7394 var name3 = "core/image";
4561 - var title3 = (0, import_i18n4.__)("Inline image");
7395 + var title3 = (0, import_i18n7.__)("Inline image");
4562 7396 function getCurrentImageId(activeObjectAttributes) {
4563 7397 if (!activeObjectAttributes?.className) {
4564 7398 return void 0;
4565 7399 }
@@ -4568,9 +7402,9 @@
4568 7402 }
4569 7403 var image = {
4570 7404 name: name3,
4571 7405 title: title3,
4572 - keywords: [(0, import_i18n4.__)("photo"), (0, import_i18n4.__)("media")],
7406 + keywords: [(0, import_i18n7.__)("photo"), (0, import_i18n7.__)("media")],
4573 7407 object: true,
4574 7408 tagName: "img",
4575 7409 className: null,
4576 7410 attributes: {
@@ -4580,25 +7414,32 @@
4580 7414 alt: "alt"
4581 7415 },
4582 7416 edit: Edit
4583 7417 };
4584 - function InlineUI({ value, onChange, activeObjectAttributes, contentRef }) {
4585 - const { style, alt } = activeObjectAttributes;
7418 + function InlineUI({
7419 + value,
7420 + onChange,
7421 + activeObjectAttributes,
7422 + contentRef
7423 + }) {
7424 + const style = activeObjectAttributes?.style;
7425 + const alt = activeObjectAttributes?.alt;
4586 7426 const width = style?.replace(/\D/g, "");
4587 - const [editedWidth, setEditedWidth] = (0, import_element12.useState)(width);
4588 - const [editedAlt, setEditedAlt] = (0, import_element12.useState)(alt);
7427 + const [editedWidth, setEditedWidth] = (0, import_element26.useState)(width);
7428 + const [editedAlt, setEditedAlt] = (0, import_element26.useState)(alt);
4589 7429 const hasChanged = editedWidth !== width || editedAlt !== alt;
4590 7430 const popoverAnchor = (0, import_rich_text3.useAnchor)({
7431 + // eslint-disable-next-line react-hooks/refs
4591 7432 editableContentElement: contentRef.current,
4592 7433 settings: image
4593 7434 });
4594 - return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7435 + return /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4595 7436 import_components.Popover,
4596 7437 {
4597 7438 focusOnMount: false,
4598 7439 anchor: popoverAnchor,
4599 7440 className: "block-editor-format-toolbar__image-popover",
4600 - children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7441 + children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4601 7442 "form",
4602 7443 {
4603 7444 className: "block-editor-format-toolbar__image-container-content",
4604 7445 onSubmit: (event) => {
@@ -4607,9 +7448,9 @@
4607 7448 type: name3,
4608 7449 attributes: {
4609 7450 ...activeObjectAttributes,
4610 7451 style: editedWidth ? `width: ${editedWidth}px;` : "",
4611 - alt: editedAlt
7452 + alt: editedAlt ?? ""
4612 7453 }
4613 7454 };
4614 7455 onChange({
4615 7456 ...value,
@@ -4616,14 +7457,13 @@
4616 7457 replacements: newReplacements
4617 7458 });
4618 7459 event.preventDefault();
4619 7460 },
4620 - children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Stack, { direction: "column", gap: "lg", children: [
4621 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7461 + children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(Stack, { direction: "column", gap: "lg", children: [
7462 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4622 7463 import_components.__experimentalNumberControl,
4623 7464 {
4624 - __next40pxDefaultSize: true,
4625 - label: (0, import_i18n4.__)("Width"),
7465 + label: (0, import_i18n7.__)("Width"),
4626 7466 value: editedWidth,
4627 7467 min: 1,
4628 7468 onChange: (newWidth) => {
4629 7469 setEditedWidth(newWidth);
@@ -4629,38 +7469,38 @@
4629 7469 setEditedWidth(newWidth);
4630 7470 }
4631 7471 }
4632 7472 ),
4633 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7473 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4634 7474 import_components.TextareaControl,
4635 7475 {
4636 - label: (0, import_i18n4.__)("Alternative text"),
4637 - value: editedAlt,
7476 + label: (0, import_i18n7.__)("Alternative text"),
7477 + value: editedAlt ?? "",
4638 7478 onChange: (newAlt) => {
4639 7479 setEditedAlt(newAlt);
4640 7480 },
4641 - help: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
4642 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7481 + help: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_jsx_runtime55.Fragment, { children: [
7482 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4643 7483 Link,
4644 7484 {
4645 7485 openInNewTab: true,
4646 7486 href: (
4647 7487 // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations.
4648 - (0, import_i18n4.__)(
7488 + (0, import_i18n7.__)(
4649 7489 "https://www.w3.org/WAI/tutorials/images/decision-tree/"
4650 7490 )
4651 7491 ),
4652 - children: (0, import_i18n4.__)(
7492 + children: (0, import_i18n7.__)(
4653 7493 "Describe the purpose of the image."
4654 7494 )
4655 7495 }
4656 7496 ),
4657 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("br", {}),
4658 - (0, import_i18n4.__)("Leave empty if decorative.")
7497 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("br", {}),
7498 + (0, import_i18n7.__)("Leave empty if decorative.")
4659 7499 ] })
4660 7500 }
4661 7501 ),
4662 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7502 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4663 7503 import_components.Button,
4664 7504 {
4665 7505 disabled: !hasChanged,
4666 7506 accessibleWhenDisabled: true,
@@ -4666,9 +7506,9 @@
4666 7506 accessibleWhenDisabled: true,
4667 7507 variant: "primary",
4668 7508 type: "submit",
4669 7509 size: "compact",
4670 - children: (0, import_i18n4.__)("Apply")
7510 + children: (0, import_i18n7.__)("Apply")
4671 7511 }
4672 7512 ) })
4673 7513 ] })
4674 7514 }
@@ -4683,15 +7523,20 @@
4683 7523 isObjectActive,
4684 7524 activeObjectAttributes,
4685 7525 contentRef
4686 7526 }) {
4687 - return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_block_editor3.MediaUploadCheck, { children: [
4688 - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7527 + return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_block_editor3.MediaUploadCheck, { children: [
7528 + /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4689 7529 import_block_editor3.MediaUpload,
4690 7530 {
4691 7531 allowedTypes: ALLOWED_MEDIA_TYPES,
4692 7532 value: getCurrentImageId(activeObjectAttributes),
4693 - onSelect: ({ id, url, alt, width: imgWidth }) => {
7533 + onSelect: ({
7534 + id,
7535 + url,
7536 + alt,
7537 + width: imgWidth
7538 + }) => {
4694 7539 onChange(
4695 7540 (0, import_rich_text3.insertObject)(value, {
4696 7541 type: name3,
4697 7542 attributes: {
@@ -4706,20 +7551,13 @@
4706 7551 })
4707 7552 );
4708 7553 onFocus();
4709 7554 },
4710 - render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7555 + render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4711 7556 import_block_editor3.RichTextToolbarButton,
4712 7557 {
4713 - icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
4714 - import_components.SVG,
4715 - {
4716 - xmlns: "http://www.w3.org/2000/svg",
4717 - viewBox: "0 0 24 24",
4718 - children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components.Path, { d: "M4 18.5h16V17H4v1.5zM16 13v1.5h4V13h-4zM5.1 15h7.8c.6 0 1.1-.5 1.1-1.1V6.1c0-.6-.5-1.1-1.1-1.1H5.1C4.5 5 4 5.5 4 6.1v7.8c0 .6.5 1.1 1.1 1.1zm.4-8.5h7V10l-1-1c-.3-.3-.8-.3-1 0l-1.6 1.5-1.2-.7c-.3-.2-.6-.2-.9 0l-1.3 1V6.5zm0 6.1l1.8-1.3 1.3.8c.3.2.7.2.9-.1l1.5-1.4 1.5 1.4v1.5h-7v-.9z" })
4719 - }
4720 - ),
4721 - title: isObjectActive ? (0, import_i18n4.__)("Replace image") : title3,
7558 + icon: inline_image_default,
7559 + title: isObjectActive ? (0, import_i18n7.__)("Replace image") : title3,
4722 7560 onClick: open,
4723 7561 isActive: isObjectActive
4724 7562 }
4725 7563 )
@@ -4724,9 +7562,9 @@
4724 7562 }
4725 7563 )
4726 7564 }
4727 7565 ),
4728 - isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
7566 + isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(
4729 7567 InlineUI,
4730 7568 {
4731 7569 value,
4732 7570 onChange,
@@ -4737,29 +7575,35 @@
4737 7575 ] });
4738 7576 }
4739 7577
4740 7578 // packages/format-library/build-module/italic/index.mjs
4741 - var import_i18n5 = __toESM(require_i18n(), 1);
7579 + var import_i18n8 = __toESM(require_i18n(), 1);
4742 7580 var import_rich_text4 = __toESM(require_rich_text(), 1);
4743 7581 var import_block_editor4 = __toESM(require_block_editor(), 1);
4744 - var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1);
7582 + var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1);
4745 7583 var name4 = "core/italic";
4746 - var title4 = (0, import_i18n5.__)("Italic");
7584 + var title4 = (0, import_i18n8.__)("Italic");
4747 7585 var italic = {
4748 7586 name: name4,
4749 7587 title: title4,
4750 7588 tagName: "em",
4751 7589 className: null,
4752 - edit({ isActive, value, onChange, onFocus, isVisible = true }) {
7590 + edit({
7591 + isActive,
7592 + value,
7593 + onChange,
7594 + onFocus,
7595 + isVisible = true
7596 + }) {
4753 7597 function onToggle() {
4754 7598 onChange((0, import_rich_text4.toggleFormat)(value, { type: name4, title: title4 }));
4755 7599 }
4756 7600 function onClick() {
4757 - onChange((0, import_rich_text4.toggleFormat)(value, { type: name4 }));
7601 + onChange((0, import_rich_text4.toggleFormat)(value, { type: name4, title: title4 }));
4758 7602 onFocus();
4759 7603 }
4760 - return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
4761 - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
7604 + return /* @__PURE__ */ (0, import_jsx_runtime56.jsxs)(import_jsx_runtime56.Fragment, { children: [
7605 + /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
4762 7606 import_block_editor4.RichTextShortcut,
4763 7607 {
4764 7608 type: "primary",
4765 7609 character: "i",
@@ -4765,9 +7609,9 @@
4765 7609 character: "i",
4766 7610 onUse: onToggle
4767 7611 }
4768 7612 ),
4769 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
7613 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
4770 7614 import_block_editor4.RichTextToolbarButton,
4771 7615 {
4772 7616 name: "italic",
4773 7617 icon: format_italic_default,
@@ -4777,9 +7621,9 @@
4777 7621 shortcutType: "primary",
4778 7622 shortcutCharacter: "i"
4779 7623 }
4780 7624 ),
4781 - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
7625 + /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(
4782 7626 import_block_editor4.__unstableRichTextInputEvent,
4783 7627 {
4784 7628 inputType: "formatItalic",
4785 7629 onInput: onToggle
@@ -4789,10 +7633,10 @@
4789 7633 }
4790 7634 };
4791 7635
4792 7636 // packages/format-library/build-module/link/index.mjs
4793 - var import_i18n8 = __toESM(require_i18n(), 1);
4794 - var import_element15 = __toESM(require_element(), 1);
7637 + var import_i18n11 = __toESM(require_i18n(), 1);
7638 + var import_element29 = __toESM(require_element(), 1);
4795 7639 var import_rich_text6 = __toESM(require_rich_text(), 1);
4796 7640 var import_url3 = __toESM(require_url(), 1);
4797 7641 var import_block_editor6 = __toESM(require_block_editor(), 1);
4798 7642 var import_html_entities = __toESM(require_html_entities(), 1);
@@ -4798,10 +7642,10 @@
4798 7642 var import_html_entities = __toESM(require_html_entities(), 1);
4799 7643 var import_a11y2 = __toESM(require_a11y(), 1);
4800 7644
4801 7645 // packages/format-library/build-module/link/inline.mjs
4802 - var import_element14 = __toESM(require_element(), 1);
4803 - var import_i18n7 = __toESM(require_i18n(), 1);
7646 + var import_element28 = __toESM(require_element(), 1);
7647 + var import_i18n10 = __toESM(require_i18n(), 1);
4804 7648 var import_a11y = __toESM(require_a11y(), 1);
4805 7649 var import_components3 = __toESM(require_components(), 1);
4806 7650 var import_url2 = __toESM(require_url(), 1);
4807 7651 var import_rich_text5 = __toESM(require_rich_text(), 1);
@@ -4819,9 +7663,9 @@
4819 7663 return false;
4820 7664 }
4821 7665 if (/^\S+:/.test(trimmedHref)) {
4822 7666 const protocol = (0, import_url.getProtocol)(trimmedHref);
4823 - if (!(0, import_url.isValidProtocol)(protocol)) {
7667 + if (!protocol || !(0, import_url.isValidProtocol)(protocol)) {
4824 7668 return false;
4825 7669 }
4826 7670 if (protocol.startsWith("http") && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) {
4827 7671 return false;
@@ -4826,9 +7670,9 @@
4826 7670 if (protocol.startsWith("http") && !/^https?:\/\/[^\/\s]/i.test(trimmedHref)) {
4827 7671 return false;
4828 7672 }
4829 7673 const authority = (0, import_url.getAuthority)(trimmedHref);
4830 - if (!(0, import_url.isValidAuthority)(authority)) {
7674 + if (!authority || !(0, import_url.isValidAuthority)(authority)) {
4831 7675 return false;
4832 7676 }
4833 7677 const path = (0, import_url.getPath)(trimmedHref);
4834 7678 if (path && !(0, import_url.isValidPath)(path)) {
@@ -4913,12 +7757,11 @@
4913 7757 initialIndex = endIndex - 1;
4914 7758 } else {
4915 7759 return EMPTY_BOUNDARIES;
4916 7760 }
4917 - const index = newFormats[initialIndex].indexOf(targetFormat);
4918 - const walkingArgs = [newFormats, initialIndex, targetFormat, index];
4919 - startIndex = walkToStart(...walkingArgs);
4920 - endIndex = walkToEnd(...walkingArgs);
7761 + const index2 = newFormats[initialIndex].indexOf(targetFormat);
7762 + startIndex = walkToStart(newFormats, initialIndex, targetFormat, index2);
7763 + endIndex = walkToEnd(newFormats, initialIndex, targetFormat, index2);
4921 7764 startIndex = startIndex < 0 ? 0 : startIndex;
4922 7765 return {
4923 7766 start: startIndex,
4924 7767 end: endIndex + 1
@@ -4924,9 +7767,9 @@
4924 7767 end: endIndex + 1
4925 7768 };
4926 7769 }
4927 7770 function walkToBoundary(formats, initialIndex, targetFormatRef, formatIndex, direction) {
4928 - let index = initialIndex;
7771 + let index2 = initialIndex;
4929 7772 const directions = {
4930 7773 forwards: 1,
4931 7774 backwards: -1
4932 7775 };
@@ -4931,28 +7774,31 @@
4931 7774 backwards: -1
4932 7775 };
4933 7776 const directionIncrement = directions[direction] || 1;
4934 7777 const inverseDirectionIncrement = directionIncrement * -1;
4935 - while (formats[index] && formats[index][formatIndex] === targetFormatRef) {
4936 - index = index + directionIncrement;
7778 + while (formats[index2] && formats[index2][formatIndex] === targetFormatRef) {
7779 + index2 = index2 + directionIncrement;
4937 7780 }
4938 - index = index + inverseDirectionIncrement;
4939 - return index;
7781 + index2 = index2 + inverseDirectionIncrement;
7782 + return index2;
4940 7783 }
4941 - var partialRight = (fn, ...partialArgs) => (...args) => fn(...args, ...partialArgs);
4942 - var walkToStart = partialRight(walkToBoundary, "backwards");
4943 - var walkToEnd = partialRight(walkToBoundary, "forwards");
7784 + var walkToStart = (...args) => walkToBoundary(...args, "backwards");
7785 + var walkToEnd = (...args) => walkToBoundary(...args, "forwards");
4944 7786
4945 7787 // packages/format-library/build-module/link/css-classes-setting.mjs
4946 - var import_element13 = __toESM(require_element(), 1);
4947 - var import_compose2 = __toESM(require_compose(), 1);
4948 - var import_i18n6 = __toESM(require_i18n(), 1);
7788 + var import_element27 = __toESM(require_element(), 1);
7789 + var import_compose4 = __toESM(require_compose(), 1);
7790 + var import_i18n9 = __toESM(require_i18n(), 1);
4949 7791 var import_components2 = __toESM(require_components(), 1);
4950 - var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1);
4951 - var CSSClassesSettingComponent = ({ setting, value, onChange }) => {
4952 - const hasValue = value ? value?.cssClasses?.length > 0 : false;
4953 - const [isSettingActive, setIsSettingActive] = (0, import_element13.useState)(hasValue);
4954 - const instanceId = (0, import_compose2.useInstanceId)(CSSClassesSettingComponent);
7792 + var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1);
7793 + var CSSClassesSettingComponent = ({
7794 + setting,
7795 + value,
7796 + onChange
7797 + }) => {
7798 + const hasValue = !!value?.cssClasses?.length;
7799 + const [isSettingActive, setIsSettingActive] = (0, import_element27.useState)(hasValue);
7800 + const instanceId = (0, import_compose4.useInstanceId)(CSSClassesSettingComponent);
4955 7801 const controlledRegionId = `css-classes-setting-${instanceId}`;
4956 7802 const handleSettingChange = (newValue) => {
4957 7803 const sanitizedValue = typeof newValue === "string" ? newValue.replace(/,/g, " ").replace(/\s+/g, " ").trim() : newValue;
4958 7804 onChange({
@@ -4969,12 +7815,12 @@
4969 7815 } else {
4970 7816 setIsSettingActive(true);
4971 7817 }
4972 7818 };
4973 - return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("fieldset", { children: [
4974 - /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("legend", {}), children: setting.title }),
4975 - /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Stack, { direction: "column", gap: "md", children: [
4976 - /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
7819 + return /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)("fieldset", { children: [
7820 + /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("legend", {}), children: setting.title }),
7821 + /* @__PURE__ */ (0, import_jsx_runtime57.jsxs)(Stack, { direction: "column", gap: "md", children: [
7822 + /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4977 7823 import_components2.CheckboxControl,
4978 7824 {
4979 7825 label: setting.title,
4980 7826 onChange: handleCheckboxChange,
@@ -4982,19 +7828,18 @@
4982 7828 "aria-expanded": isSettingActive,
4983 7829 "aria-controls": isSettingActive ? controlledRegionId : void 0
4984 7830 }
4985 7831 ),
4986 - isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
7832 + isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime57.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)(
4987 7833 import_components2.__experimentalInputControl,
4988 7834 {
4989 - label: (0, import_i18n6.__)("CSS classes"),
7835 + label: (0, import_i18n9.__)("CSS classes"),
4990 7836 value: value?.cssClasses,
4991 7837 onChange: handleSettingChange,
4992 - help: (0, import_i18n6.__)(
7838 + help: (0, import_i18n9.__)(
4993 7839 "Separate multiple classes with spaces."
4994 7840 ),
4995 - __unstableInputWidth: "100%",
4996 - __next40pxDefaultSize: true
7841 + __unstableInputWidth: "100%"
4997 7842 }
4998 7843 ) })
4999 7844 ] })
5000 7845 ] });
@@ -5001,28 +7846,26 @@
5001 7846 };
5002 7847 var css_classes_setting_default = CSSClassesSettingComponent;
5003 7848
5004 7849 // packages/format-library/build-module/link/inline.mjs
5005 - var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1);
7850 + var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1);
5006 7851 var LINK_SETTINGS = [
5007 7852 ...import_block_editor5.LinkControl.DEFAULT_LINK_SETTINGS,
5008 7853 {
5009 7854 id: "nofollow",
5010 - title: (0, import_i18n7.__)("Mark as nofollow")
7855 + title: (0, import_i18n10.__)("Mark as nofollow")
5011 7856 },
5012 7857 {
5013 7858 id: "cssClasses",
5014 - title: (0, import_i18n7.__)("Additional CSS class(es)"),
5015 - render: (setting, value, onChange) => {
5016 - return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
5017 - css_classes_setting_default,
5018 - {
5019 - setting,
5020 - value,
5021 - onChange
5022 - }
5023 - );
5024 - }
7859 + title: (0, import_i18n10.__)("Additional CSS class(es)"),
7860 + render: (setting, value, onChange) => /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
7861 + css_classes_setting_default,
7862 + {
7863 + setting,
7864 + value,
7865 + onChange
7866 + }
7867 + )
5025 7868 }
5026 7869 ];
5027 7870 function InlineLinkUI({
5028 7871 isActive,
@@ -5048,9 +7891,9 @@
5048 7891 };
5049 7892 },
5050 7893 []
5051 7894 );
5052 - const linkValue = (0, import_element14.useMemo)(
7895 + const linkValue = (0, import_element28.useMemo)(
5053 7896 () => ({
5054 7897 url: activeAttributes.url,
5055 7898 type: activeAttributes.type,
5056 7899 id: activeAttributes.id,
@@ -5072,9 +7915,9 @@
5072 7915 function removeLink() {
5073 7916 const newValue = (0, import_rich_text5.removeFormat)(value, "core/link");
5074 7917 onChange(newValue);
5075 7918 stopAddingLink();
5076 - (0, import_a11y.speak)((0, import_i18n7.__)("Link removed."), "assertive");
7919 + (0, import_a11y.speak)((0, import_i18n10.__)("Link removed."), "assertive");
5077 7920 }
5078 7921 function onChangeLink(nextValue) {
5079 7922 const hasLink = linkValue?.url;
5080 7923 const isNewLink = !hasLink;
@@ -5081,9 +7924,9 @@
5081 7924 nextValue = {
5082 7925 ...linkValue,
5083 7926 ...nextValue
5084 7927 };
5085 - const newUrl = (0, import_url2.prependHTTPS)(nextValue.url);
7928 + const newUrl = (0, import_url2.prependHTTPS)(nextValue?.url ?? "");
5086 7929 const linkFormat = createLinkFormat({
5087 7930 url: newUrl,
5088 7931 type: nextValue.type,
5089 7932 id: nextValue.id !== void 0 && nextValue.id !== null ? String(nextValue.id) : void 0,
@@ -5124,13 +7967,13 @@
5124 7967 newValue = (0, import_rich_text5.applyFormat)(newValue, linkFormat, 0, newText.length);
5125 7968 const boundary = getFormatBoundary(value, {
5126 7969 type: "core/link"
5127 7970 });
5128 - const [valBefore, valAfter] = (0, import_rich_text5.split)(
5129 - value,
5130 - boundary.start,
5131 - boundary.start
5132 - );
7971 + const splitValue = (0, import_rich_text5.split)(value, boundary.start, boundary.start);
7972 + if (!splitValue) {
7973 + return;
7974 + }
7975 + const [valBefore, valAfter] = splitValue;
5133 7976 const newValAfter = (0, import_rich_text5.replace)(valAfter, richTextText, newValue);
5134 7977 newValue = (0, import_rich_text5.concat)(valBefore, newValAfter);
5135 7978 }
5136 7979 onChange(newValue);
@@ -5138,25 +7981,24 @@
5138 7981 stopAddingLink();
5139 7982 }
5140 7983 if (!isValidHref(newUrl)) {
5141 7984 (0, import_a11y.speak)(
5142 - (0, import_i18n7.__)(
7985 + (0, import_i18n10.__)(
5143 7986 "Warning: the link has been inserted but may have errors. Please test it."
5144 7987 ),
5145 7988 "assertive"
5146 7989 );
5147 7990 } else if (isActive) {
5148 - (0, import_a11y.speak)((0, import_i18n7.__)("Link edited."), "assertive");
7991 + (0, import_a11y.speak)((0, import_i18n10.__)("Link edited."), "assertive");
5149 7992 } else {
5150 - (0, import_a11y.speak)((0, import_i18n7.__)("Link inserted."), "assertive");
7993 + (0, import_a11y.speak)((0, import_i18n10.__)("Link inserted."), "assertive");
5151 7994 }
5152 7995 }
7996 + const anchorSettings = { ...link, isActive };
5153 7997 const popoverAnchor = (0, import_rich_text5.useAnchor)({
7998 + // eslint-disable-next-line react-hooks/refs
5154 7999 editableContentElement: contentRef.current,
5155 - settings: {
5156 - ...link,
5157 - isActive
5158 - }
8000 + settings: anchorSettings
5159 8001 });
5160 8002 async function handleCreate(pageTitle) {
5161 8003 const page = await createPageEntity({
5162 8004 title: pageTitle,
@@ -5170,18 +8012,18 @@
5170 8012 kind: "post-type"
5171 8013 };
5172 8014 }
5173 8015 function createButtonText(searchTerm) {
5174 - return (0, import_element14.createInterpolateElement)(
5175 - (0, import_i18n7.sprintf)(
8016 + return (0, import_element28.createInterpolateElement)(
8017 + (0, import_i18n10.sprintf)(
5176 8018 /* translators: %s: search term. */
5177 - (0, import_i18n7.__)("Create page: <mark>%s</mark>"),
8019 + (0, import_i18n10.__)("Create page: <mark>%s</mark>"),
5178 8020 searchTerm
5179 8021 ),
5180 - { mark: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("mark", {}) }
8022 + { mark: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)("mark", {}) }
5181 8023 );
5182 8024 }
5183 - return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
8025 + return /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5184 8026 import_components3.Popover,
5185 8027 {
5186 8028 anchor: popoverAnchor,
5187 8029 animate: false,
@@ -5191,9 +8033,9 @@
5191 8033 offset: 8,
5192 8034 shift: true,
5193 8035 focusOnMount,
5194 8036 constrainTabbing: true,
5195 - children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
8037 + children: /* @__PURE__ */ (0, import_jsx_runtime58.jsx)(
5196 8038 import_block_editor5.LinkControl,
5197 8039 {
5198 8040 value: linkValue,
5199 8041 onChange: onChangeLink,
@@ -5224,10 +8066,10 @@
5224 8066 if (isActive) {
5225 8067 const boundary = getFormatBoundary(value, {
5226 8068 type: "core/link"
5227 8069 });
5228 - textStart = boundary.start;
5229 - textEnd = boundary.end;
8070 + textStart = boundary.start ?? value.start;
8071 + textEnd = boundary.end ?? value.end;
5230 8072 }
5231 8073 return (0, import_rich_text5.slice)(value, textStart, textEnd);
5232 8074 }
5233 8075 var inline_default = InlineLinkUI;
@@ -5232,11 +8074,11 @@
5232 8074 }
5233 8075 var inline_default = InlineLinkUI;
5234 8076
5235 8077 // packages/format-library/build-module/link/index.mjs
5236 - var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1);
8078 + var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1);
5237 8079 var name5 = "core/link";
5238 - var title5 = (0, import_i18n8.__)("Link");
8080 + var title5 = (0, import_i18n11.__)("Link");
5239 8081 function Edit2({
5240 8082 isActive,
5241 8083 activeAttributes,
5242 8084 value,
@@ -5244,22 +8086,24 @@
5244 8086 onFocus,
5245 8087 contentRef,
5246 8088 isVisible = true
5247 8089 }) {
5248 - const [addingLink, setAddingLink] = (0, import_element15.useState)(false);
5249 - const [openedBy, setOpenedBy] = (0, import_element15.useState)(null);
5250 - (0, import_element15.useEffect)(() => {
8090 + const [addingLink, setAddingLink] = (0, import_element29.useState)(false);
8091 + const [openedBy, setOpenedBy] = (0, import_element29.useState)(null);
8092 + (0, import_element29.useEffect)(() => {
5251 8093 if (!isActive) {
5252 8094 setAddingLink(false);
5253 8095 }
5254 8096 }, [isActive]);
5255 - (0, import_element15.useLayoutEffect)(() => {
8097 + (0, import_element29.useLayoutEffect)(() => {
5256 8098 const editableContentElement = contentRef.current;
5257 8099 if (!editableContentElement) {
5258 8100 return;
5259 8101 }
5260 8102 function handleClick(event) {
5261 - const link2 = event.target.closest("[contenteditable] a");
8103 + const link2 = event.target.closest(
8104 + "[contenteditable] a"
8105 + );
5262 8106 if (!link2 || // other formats (e.g. bold) may be nested within the link.
5263 8107 !isActive) {
5264 8108 return;
5265 8109 }
@@ -5322,14 +8166,14 @@
5322 8166 setOpenedBy(null);
5323 8167 }
5324 8168 function onRemoveFormat() {
5325 8169 onChange((0, import_rich_text6.removeFormat)(value, name5));
5326 - (0, import_a11y2.speak)((0, import_i18n8.__)("Link removed."), "assertive");
8170 + (0, import_a11y2.speak)((0, import_i18n11.__)("Link removed."), "assertive");
5327 8171 }
5328 8172 const shouldAutoFocus = !(openedBy?.el?.tagName === "A" && openedBy?.action === "click");
5329 8173 const hasSelection = !(0, import_rich_text6.isCollapsed)(value);
5330 - return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [
5331 - hasSelection && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
8174 + return /* @__PURE__ */ (0, import_jsx_runtime59.jsxs)(import_jsx_runtime59.Fragment, { children: [
8175 + hasSelection && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5332 8176 import_block_editor6.RichTextShortcut,
5333 8177 {
5334 8178 type: "primary",
5335 8179 character: "k",
@@ -5335,9 +8179,9 @@
5335 8179 character: "k",
5336 8180 onUse: addLink
5337 8181 }
5338 8182 ),
5339 - /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
8183 + /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5340 8184 import_block_editor6.RichTextShortcut,
5341 8185 {
5342 8186 type: "primaryShift",
5343 8187 character: "k",
@@ -5343,14 +8187,14 @@
5343 8187 character: "k",
5344 8188 onUse: onRemoveFormat
5345 8189 }
5346 8190 ),
5347 - isVisible && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
8191 + isVisible && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5348 8192 import_block_editor6.RichTextToolbarButton,
5349 8193 {
5350 8194 name: "link",
5351 8195 icon: link_default,
5352 - title: isActive ? (0, import_i18n8.__)("Link") : title5,
8196 + title: isActive ? (0, import_i18n11.__)("Link") : title5,
5353 8197 onClick: (event) => {
5354 8198 addLink(event.currentTarget);
5355 8199 },
5356 8200 isActive: isActive || addingLink,
@@ -5359,9 +8203,9 @@
5359 8203 "aria-haspopup": "true",
5360 8204 "aria-expanded": addingLink
5361 8205 }
5362 8206 ),
5363 - isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(
8207 + isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime59.jsx)(
5364 8208 inline_default,
5365 8209 {
5366 8210 stopAddingLink,
5367 8211 onFocusOutside,
@@ -5417,14 +8261,14 @@
5417 8261 edit: Edit2
5418 8262 };
5419 8263
5420 8264 // packages/format-library/build-module/strikethrough/index.mjs
5421 - var import_i18n9 = __toESM(require_i18n(), 1);
8265 + var import_i18n12 = __toESM(require_i18n(), 1);
5422 8266 var import_rich_text7 = __toESM(require_rich_text(), 1);
5423 8267 var import_block_editor7 = __toESM(require_block_editor(), 1);
5424 - var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1);
8268 + var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1);
5425 8269 var name6 = "core/strikethrough";
5426 - var title6 = (0, import_i18n9.__)("Strikethrough");
8270 + var title6 = (0, import_i18n12.__)("Strikethrough");
5427 8271 var strikethrough = {
5428 8272 name: name6,
5429 8273 title: title6,
5430 8274 tagName: "s",
@@ -5433,10 +8277,10 @@
5433 8277 function onClick() {
5434 8278 onChange((0, import_rich_text7.toggleFormat)(value, { type: name6, title: title6 }));
5435 8279 onFocus();
5436 8280 }
5437 - return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [
5438 - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
8281 + return /* @__PURE__ */ (0, import_jsx_runtime60.jsxs)(import_jsx_runtime60.Fragment, { children: [
8282 + /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5439 8283 import_block_editor7.RichTextShortcut,
5440 8284 {
5441 8285 type: "access",
5442 8286 character: "d",
@@ -5442,9 +8286,9 @@
5442 8286 character: "d",
5443 8287 onUse: onClick
5444 8288 }
5445 8289 ),
5446 - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(
8290 + /* @__PURE__ */ (0, import_jsx_runtime60.jsx)(
5447 8291 import_block_editor7.RichTextToolbarButton,
5448 8292 {
5449 8293 icon: format_strikethrough_default,
5450 8294 title: title6,
@@ -5457,14 +8301,14 @@
5457 8301 }
5458 8302 };
5459 8303
5460 8304 // packages/format-library/build-module/underline/index.mjs
5461 - var import_i18n10 = __toESM(require_i18n(), 1);
8305 + var import_i18n13 = __toESM(require_i18n(), 1);
5462 8306 var import_rich_text8 = __toESM(require_rich_text(), 1);
5463 8307 var import_block_editor8 = __toESM(require_block_editor(), 1);
5464 - var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1);
8308 + var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1);
5465 8309 var name7 = "core/underline";
5466 - var title7 = (0, import_i18n10.__)("Underline");
8310 + var title7 = (0, import_i18n13.__)("Underline");
5467 8311 var underline = {
5468 8312 name: name7,
5469 8313 title: title7,
5470 8314 tagName: "span",
@@ -5483,10 +8327,10 @@
5483 8327 title: title7
5484 8328 })
5485 8329 );
5486 8330 };
5487 - return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [
5488 - /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
8331 + return /* @__PURE__ */ (0, import_jsx_runtime61.jsxs)(import_jsx_runtime61.Fragment, { children: [
8332 + /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5489 8333 import_block_editor8.RichTextShortcut,
5490 8334 {
5491 8335 type: "primary",
5492 8336 character: "u",
@@ -5492,9 +8336,9 @@
5492 8336 character: "u",
5493 8337 onUse: onToggle
5494 8338 }
5495 8339 ),
5496 - /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(
8340 + /* @__PURE__ */ (0, import_jsx_runtime61.jsx)(
5497 8341 import_block_editor8.__unstableRichTextInputEvent,
5498 8342 {
5499 8343 inputType: "formatUnderline",
5500 8344 onInput: onToggle
@@ -5504,38 +8348,41 @@
5504 8348 }
5505 8349 };
5506 8350
5507 8351 // packages/format-library/build-module/text-color/index.mjs
5508 - var import_i18n12 = __toESM(require_i18n(), 1);
5509 - var import_element17 = __toESM(require_element(), 1);
8352 + var import_i18n15 = __toESM(require_i18n(), 1);
8353 + var import_element31 = __toESM(require_element(), 1);
5510 8354 var import_block_editor10 = __toESM(require_block_editor(), 1);
5511 8355 var import_rich_text10 = __toESM(require_rich_text(), 1);
5512 8356
5513 8357 // packages/format-library/build-module/text-color/inline.mjs
5514 - var import_element16 = __toESM(require_element(), 1);
8358 + var import_element30 = __toESM(require_element(), 1);
5515 8359 var import_data2 = __toESM(require_data(), 1);
5516 8360 var import_rich_text9 = __toESM(require_rich_text(), 1);
5517 8361 var import_block_editor9 = __toESM(require_block_editor(), 1);
5518 8362 var import_components4 = __toESM(require_components(), 1);
5519 - var import_i18n11 = __toESM(require_i18n(), 1);
5520 - var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1);
8363 + var import_i18n14 = __toESM(require_i18n(), 1);
8364 + var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1);
5521 8365 var TABS = [
5522 - { name: "color", title: (0, import_i18n11.__)("Text") },
5523 - { name: "backgroundColor", title: (0, import_i18n11.__)("Background") }
8366 + { name: "color", title: (0, import_i18n14.__)("Text") },
8367 + { name: "backgroundColor", title: (0, import_i18n14.__)("Background") }
5524 8368 ];
5525 8369 function parseCSS(css = "") {
5526 - return css.split(";").reduce((accumulator, rule) => {
5527 - if (rule) {
5528 - const [property, value] = rule.split(":");
5529 - if (property === "color") {
5530 - accumulator.color = value;
8370 + return css.split(";").reduce(
8371 + (accumulator, rule) => {
8372 + if (rule) {
8373 + const [property, value] = rule.split(":");
8374 + if (property === "color") {
8375 + accumulator.color = value;
8376 + }
8377 + if (property === "background-color" && value !== transparentValue) {
8378 + accumulator.backgroundColor = value;
8379 + }
5531 8380 }
5532 - if (property === "background-color" && value !== transparentValue) {
5533 - accumulator.backgroundColor = value;
5534 - }
5535 - }
5536 - return accumulator;
5537 - }, {});
8381 + return accumulator;
8382 + },
8383 + {}
8384 + );
5538 8385 }
5539 8386 function parseClassName(className = "", colorSettings) {
5540 8387 return className.split(" ").reduce((accumulator, name16) => {
5541 8388 if (name16.startsWith("has-") && name16.endsWith("-color")) {
@@ -5554,10 +8401,10 @@
5554 8401 if (!activeColorFormat) {
5555 8402 return {};
5556 8403 }
5557 8404 return {
5558 - ...parseCSS(activeColorFormat.attributes.style),
5559 - ...parseClassName(activeColorFormat.attributes.class, colorSettings)
8405 + ...parseCSS(activeColorFormat.attributes?.style),
8406 + ...parseClassName(activeColorFormat.attributes?.class, colorSettings)
5560 8407 };
5561 8408 }
5562 8409 function setColors(value, name16, colorSettings, colors) {
5563 8410 const { color, backgroundColor } = {
@@ -5576,10 +8423,16 @@
5576 8423 styles.push(["background-color", transparentValue].join(":"));
5577 8424 }
5578 8425 if (color) {
5579 8426 const colorObject = (0, import_block_editor9.getColorObjectByColorValue)(colorSettings, color);
5580 - if (colorObject) {
5581 - classNames.push((0, import_block_editor9.getColorClassName)("color", colorObject.slug));
8427 + if (colorObject && colorObject.slug) {
8428 + const colorClassName = (0, import_block_editor9.getColorClassName)(
8429 + "color",
8430 + colorObject.slug
8431 + );
8432 + if (colorClassName) {
8433 + classNames.push(colorClassName);
8434 + }
5582 8435 } else {
5583 8436 styles.push(["color", color].join(":"));
5584 8437 }
5585 8438 }
@@ -5595,13 +8448,13 @@
5595 8448 const colors = (0, import_data2.useSelect)((select) => {
5596 8449 const { getSettings } = select(import_block_editor9.store);
5597 8450 return getSettings().colors ?? [];
5598 8451 }, []);
5599 - const activeColors = (0, import_element16.useMemo)(
8452 + const activeColors = (0, import_element30.useMemo)(
5600 8453 () => getActiveColors(value, name16, colors),
5601 8454 [name16, value, colors]
5602 8455 );
5603 - return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
8456 + return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5604 8457 import_block_editor9.ColorPalette,
5605 8458 {
5606 8459 value: activeColors[property],
5607 8460 onChange: (color) => {
@@ -5621,26 +8474,28 @@
5621 8474 onClose,
5622 8475 contentRef,
5623 8476 isActive
5624 8477 }) {
8478 + const anchorSettings = { ...textColor, isActive };
5625 8479 const popoverAnchor = (0, import_rich_text9.useAnchor)({
8480 + // eslint-disable-next-line react-hooks/refs
5626 8481 editableContentElement: contentRef.current,
5627 - settings: { ...textColor, isActive }
8482 + settings: anchorSettings
5628 8483 });
5629 - return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
8484 + return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5630 8485 import_components4.Popover,
5631 8486 {
5632 8487 onClose,
5633 8488 className: "format-library__inline-color-popover",
5634 8489 anchor: popoverAnchor,
5635 - children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(tabs_exports.Root, { defaultValue: TABS[0].name, children: [
5636 - /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(tabs_exports.List, { children: TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(tabs_exports.Tab, { value: tab.name, children: tab.title }, tab.name)) }),
5637 - TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
8490 + children: /* @__PURE__ */ (0, import_jsx_runtime62.jsxs)(tabs_exports.Root, { defaultValue: TABS[0].name, children: [
8491 + /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(tabs_exports.List, { children: TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(tabs_exports.Tab, { value: tab.name, children: tab.title }, tab.name)) }),
8492 + TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5638 8493 tabs_exports.Panel,
5639 8494 {
5640 8495 value: tab.name,
5641 8496 tabIndex: -1,
5642 - children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(
8497 + children: /* @__PURE__ */ (0, import_jsx_runtime62.jsx)(
5643 8498 ColorPicker,
5644 8499 {
5645 8500 name: name16,
5646 8501 property: tab.name,
@@ -5656,18 +8511,18 @@
5656 8511 );
5657 8512 }
5658 8513
5659 8514 // packages/format-library/build-module/text-color/index.mjs
5660 - var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1);
8515 + var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1);
5661 8516 var transparentValue = "rgba(0, 0, 0, 0)";
5662 8517 var name8 = "core/text-color";
5663 - var title8 = (0, import_i18n12.__)("Highlight");
5664 - var EMPTY_ARRAY3 = [];
8518 + var title8 = (0, import_i18n15.__)("Highlight");
8519 + var EMPTY_ARRAY2 = [];
5665 8520 function getComputedStyleProperty(element, property) {
5666 8521 const { ownerDocument: ownerDocument2 } = element;
5667 8522 const { defaultView } = ownerDocument2;
5668 - const style = defaultView.getComputedStyle(element);
5669 - const value = style.getPropertyValue(property);
8523 + const style = defaultView?.getComputedStyle(element);
8524 + const value = style?.getPropertyValue(property);
5670 8525 if (property === "background-color" && value === transparentValue && element.parentElement) {
5671 8526 return getComputedStyleProperty(element.parentElement, property);
5672 8527 }
5673 8528 return value;
@@ -5672,9 +8527,9 @@
5672 8527 }
5673 8528 return value;
5674 8529 }
5675 8530 function fillComputedColors(element, { color, backgroundColor }) {
5676 - if (!color && !backgroundColor) {
8531 + if (!element || !color && !backgroundColor) {
5677 8532 return;
5678 8533 }
5679 8534 return {
5680 8535 color: color || getComputedStyleProperty(element, "color"),
@@ -5687,14 +8542,14 @@
5687 8542 isActive,
5688 8543 activeAttributes,
5689 8544 contentRef
5690 8545 }) {
5691 - const [allowCustomControl, colors = EMPTY_ARRAY3] = (0, import_block_editor10.useSettings)(
8546 + const [allowCustomControl, colors = EMPTY_ARRAY2] = (0, import_block_editor10.useSettings)(
5692 8547 "color.custom",
5693 8548 "color.palette"
5694 8549 );
5695 - const [isAddingColor, setIsAddingColor] = (0, import_element17.useState)(false);
5696 - const colorIndicatorStyle = (0, import_element17.useMemo)(
8550 + const [isAddingColor, setIsAddingColor] = (0, import_element31.useState)(false);
8551 + const colorIndicatorStyle = (0, import_element31.useMemo)(
5697 8552 () => fillComputedColors(
5698 8553 contentRef.current,
5699 8554 getActiveColors(value, name8, colors)
5700 8555 ),
@@ -5703,15 +8558,15 @@
5703 8558 const hasColorsToChoose = !!colors.length || allowCustomControl;
5704 8559 if (!hasColorsToChoose && !isActive) {
5705 8560 return null;
5706 8561 }
5707 - return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [
5708 - /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
8562 + return /* @__PURE__ */ (0, import_jsx_runtime63.jsxs)(import_jsx_runtime63.Fragment, { children: [
8563 + /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5709 8564 import_block_editor10.RichTextToolbarButton,
5710 8565 {
5711 8566 className: "format-library-text-color-button",
5712 8567 isActive,
5713 - icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
8568 + icon: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5714 8569 icon_default,
5715 8570 {
5716 8571 icon: Object.keys(activeAttributes).length ? text_color_default : color_default,
5717 8572 style: colorIndicatorStyle
@@ -5721,14 +8576,13 @@
5721 8576 onClick: hasColorsToChoose ? () => setIsAddingColor(true) : () => onChange((0, import_rich_text10.removeFormat)(value, name8)),
5722 8577 role: "menuitemcheckbox"
5723 8578 }
5724 8579 ),
5725 - isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(
8580 + isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(
5726 8581 InlineColorUI,
5727 8582 {
5728 8583 name: name8,
5729 8584 onClose: () => setIsAddingColor(false),
5730 - activeAttributes,
5731 8585 value,
5732 8586 onChange,
5733 8587 contentRef,
5734 8588 isActive
@@ -5748,14 +8602,14 @@
5748 8602 edit: TextColorEdit
5749 8603 };
5750 8604
5751 8605 // packages/format-library/build-module/subscript/index.mjs
5752 - var import_i18n13 = __toESM(require_i18n(), 1);
8606 + var import_i18n16 = __toESM(require_i18n(), 1);
5753 8607 var import_rich_text11 = __toESM(require_rich_text(), 1);
5754 8608 var import_block_editor11 = __toESM(require_block_editor(), 1);
5755 - var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1);
8609 + var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1);
5756 8610 var name9 = "core/subscript";
5757 - var title9 = (0, import_i18n13.__)("Subscript");
8611 + var title9 = (0, import_i18n16.__)("Subscript");
5758 8612 var subscript = {
5759 8613 name: name9,
5760 8614 title: title9,
5761 8615 tagName: "sub",
@@ -5767,9 +8621,9 @@
5767 8621 function onClick() {
5768 8622 onToggle();
5769 8623 onFocus();
5770 8624 }
5771 - return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(
8625 + return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)(
5772 8626 import_block_editor11.RichTextToolbarButton,
5773 8627 {
5774 8628 icon: subscript_default,
5775 8629 title: title9,
@@ -5781,14 +8635,14 @@
5781 8635 }
5782 8636 };
5783 8637
5784 8638 // packages/format-library/build-module/superscript/index.mjs
5785 - var import_i18n14 = __toESM(require_i18n(), 1);
8639 + var import_i18n17 = __toESM(require_i18n(), 1);
5786 8640 var import_rich_text12 = __toESM(require_rich_text(), 1);
5787 8641 var import_block_editor12 = __toESM(require_block_editor(), 1);
5788 - var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1);
8642 + var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1);
5789 8643 var name10 = "core/superscript";
5790 - var title10 = (0, import_i18n14.__)("Superscript");
8644 + var title10 = (0, import_i18n17.__)("Superscript");
5791 8645 var superscript = {
5792 8646 name: name10,
5793 8647 title: title10,
5794 8648 tagName: "sup",
@@ -5800,9 +8654,9 @@
5800 8654 function onClick() {
5801 8655 onToggle();
5802 8656 onFocus();
5803 8657 }
5804 - return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(
8658 + return /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(
5805 8659 import_block_editor12.RichTextToolbarButton,
5806 8660 {
5807 8661 icon: superscript_default,
5808 8662 title: title10,
@@ -5814,14 +8668,14 @@
5814 8668 }
5815 8669 };
5816 8670
5817 8671 // packages/format-library/build-module/keyboard/index.mjs
5818 - var import_i18n15 = __toESM(require_i18n(), 1);
8672 + var import_i18n18 = __toESM(require_i18n(), 1);
5819 8673 var import_rich_text13 = __toESM(require_rich_text(), 1);
5820 8674 var import_block_editor13 = __toESM(require_block_editor(), 1);
5821 - var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1);
8675 + var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1);
5822 8676 var name11 = "core/keyboard";
5823 - var title11 = (0, import_i18n15.__)("Keyboard input");
8677 + var title11 = (0, import_i18n18.__)("Keyboard input");
5824 8678 var keyboard2 = {
5825 8679 name: name11,
5826 8680 title: title11,
5827 8681 tagName: "kbd",
@@ -5833,9 +8687,9 @@
5833 8687 function onClick() {
5834 8688 onToggle();
5835 8689 onFocus();
5836 8690 }
5837 - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(
8691 + return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(
5838 8692 import_block_editor13.RichTextToolbarButton,
5839 8693 {
5840 8694 icon: button_default,
5841 8695 title: title11,
@@ -5847,14 +8701,14 @@
5847 8701 }
5848 8702 };
5849 8703
5850 8704 // packages/format-library/build-module/unknown/index.mjs
5851 - var import_i18n16 = __toESM(require_i18n(), 1);
8705 + var import_i18n19 = __toESM(require_i18n(), 1);
5852 8706 var import_rich_text14 = __toESM(require_rich_text(), 1);
5853 8707 var import_block_editor14 = __toESM(require_block_editor(), 1);
5854 - var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1);
8708 + var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1);
5855 8709 var name12 = "core/unknown";
5856 - var title12 = (0, import_i18n16.__)("Clear Unknown Formatting");
8710 + var title12 = (0, import_i18n19.__)("Clear Unknown Formatting");
5857 8711 function selectionContainsUnknownFormats(value) {
5858 8712 if ((0, import_rich_text14.isCollapsed)(value)) {
5859 8713 return false;
5860 8714 }
@@ -5875,9 +8729,9 @@
5875 8729 function onClick() {
5876 8730 onChange((0, import_rich_text14.removeFormat)(value, name12));
5877 8731 onFocus();
5878 8732 }
5879 - return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(
8733 + return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(
5880 8734 import_block_editor14.RichTextToolbarButton,
5881 8735 {
5882 8736 name: "unknown",
5883 8737 icon: help_default,
@@ -5889,16 +8743,16 @@
5889 8743 }
5890 8744 };
5891 8745
5892 8746 // packages/format-library/build-module/language/index.mjs
5893 - var import_i18n17 = __toESM(require_i18n(), 1);
8747 + var import_i18n20 = __toESM(require_i18n(), 1);
5894 8748 var import_block_editor15 = __toESM(require_block_editor(), 1);
5895 8749 var import_components5 = __toESM(require_components(), 1);
5896 - var import_element18 = __toESM(require_element(), 1);
8750 + var import_element32 = __toESM(require_element(), 1);
5897 8751 var import_rich_text15 = __toESM(require_rich_text(), 1);
5898 - var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1);
8752 + var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1);
5899 8753 var name13 = "core/language";
5900 - var title13 = (0, import_i18n17.__)("Language");
8754 + var title13 = (0, import_i18n20.__)("Language");
5901 8755 var language = {
5902 8756 name: name13,
5903 8757 title: title13,
5904 8758 tagName: "bdo",
@@ -5909,14 +8763,14 @@
5909 8763 },
5910 8764 edit: Edit3
5911 8765 };
5912 8766 function Edit3({ isActive, value, onChange, contentRef }) {
5913 - const [isPopoverVisible, setIsPopoverVisible] = (0, import_element18.useState)(false);
8767 + const [isPopoverVisible, setIsPopoverVisible] = (0, import_element32.useState)(false);
5914 8768 const togglePopover = () => {
5915 8769 setIsPopoverVisible((state) => !state);
5916 8770 };
5917 - return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [
5918 - /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8771 + return /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(import_jsx_runtime68.Fragment, { children: [
8772 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5919 8773 import_block_editor15.RichTextToolbarButton,
5920 8774 {
5921 8775 icon: language_default,
5922 8776 label: title13,
@@ -5931,9 +8785,9 @@
5931 8785 isActive,
5932 8786 role: "menuitemcheckbox"
5933 8787 }
5934 8788 ),
5935 - isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8789 + isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5936 8790 InlineLanguageUI,
5937 8791 {
5938 8792 value,
5939 8793 onChange,
@@ -5942,25 +8796,31 @@
5942 8796 }
5943 8797 )
5944 8798 ] });
5945 8799 }
5946 - function InlineLanguageUI({ value, contentRef, onChange, onClose }) {
8800 + function InlineLanguageUI({
8801 + value,
8802 + contentRef,
8803 + onChange,
8804 + onClose
8805 + }) {
5947 8806 const popoverAnchor = (0, import_rich_text15.useAnchor)({
8807 + // eslint-disable-next-line react-hooks/refs
5948 8808 editableContentElement: contentRef.current,
5949 8809 settings: language
5950 8810 });
5951 - const [lang, setLang] = (0, import_element18.useState)("");
5952 - const [dir, setDir] = (0, import_element18.useState)("ltr");
5953 - return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8811 + const [lang, setLang] = (0, import_element32.useState)("");
8812 + const [dir, setDir] = (0, import_element32.useState)("ltr");
8813 + return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5954 8814 import_components5.Popover,
5955 8815 {
5956 8816 className: "block-editor-format-toolbar__language-popover",
5957 8817 anchor: popoverAnchor,
5958 8818 onClose,
5959 - children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
8819 + children: /* @__PURE__ */ (0, import_jsx_runtime68.jsxs)(
5960 8820 Stack,
5961 8821 {
5962 - render: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("form", {}),
8822 + render: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("form", {}),
5963 8823 direction: "column",
5964 8824 gap: "lg",
5965 8825 className: "block-editor-format-toolbar__language-container-content",
5966 8826 onSubmit: (event) => {
@@ -5976,33 +8836,31 @@
5976 8836 );
5977 8837 onClose();
5978 8838 },
5979 8839 children: [
5980 - /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8840 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5981 8841 import_components5.TextControl,
5982 8842 {
5983 - __next40pxDefaultSize: true,
5984 8843 label: title13,
5985 8844 value: lang,
5986 8845 onChange: (val) => setLang(val),
5987 - help: (0, import_i18n17.__)(
8846 + help: (0, import_i18n20.__)(
5988 8847 'A valid language attribute, like "en" or "fr".'
5989 8848 )
5990 8849 }
5991 8850 ),
5992 - /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8851 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
5993 8852 import_components5.SelectControl,
5994 8853 {
5995 - __next40pxDefaultSize: true,
5996 - label: (0, import_i18n17.__)("Text direction"),
8854 + label: (0, import_i18n20.__)("Text direction"),
5997 8855 value: dir,
5998 8856 options: [
5999 8857 {
6000 - label: (0, import_i18n17.__)("Left to right"),
8858 + label: (0, import_i18n20.__)("Left to right"),
6001 8859 value: "ltr"
6002 8860 },
6003 8861 {
6004 - label: (0, import_i18n17.__)("Right to left"),
8862 + label: (0, import_i18n20.__)("Right to left"),
6005 8863 value: "rtl"
6006 8864 }
6007 8865 ],
6008 8866 onChange: (val) => setDir(val)
@@ -6007,15 +8865,15 @@
6007 8865 ],
6008 8866 onChange: (val) => setDir(val)
6009 8867 }
6010 8868 ),
6011 - /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
8869 + /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(
6012 8870 import_components5.Button,
6013 8871 {
6014 8872 __next40pxDefaultSize: true,
6015 8873 variant: "primary",
6016 8874 type: "submit",
6017 - text: (0, import_i18n17.__)("Apply")
8875 + text: (0, import_i18n20.__)("Apply")
6018 8876 }
6019 8877 ) })
6020 8878 ]
6021 8879 }
@@ -6024,27 +8882,16 @@
6024 8882 );
6025 8883 }
6026 8884
6027 8885 // packages/format-library/build-module/math/index.mjs
6028 - var import_i18n18 = __toESM(require_i18n(), 1);
6029 - var import_element19 = __toESM(require_element(), 1);
8886 + var import_i18n21 = __toESM(require_i18n(), 1);
8887 + var import_element33 = __toESM(require_element(), 1);
6030 8888 var import_rich_text16 = __toESM(require_rich_text(), 1);
6031 8889 var import_block_editor16 = __toESM(require_block_editor(), 1);
6032 8890 var import_components6 = __toESM(require_components(), 1);
6033 - var import_a11y3 = __toESM(require_a11y(), 1);
6034 -
6035 - // packages/format-library/build-module/lock-unlock.mjs
6036 - var import_private_apis = __toESM(require_private_apis(), 1);
6037 - var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)(
6038 - "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.",
6039 - "@wordpress/format-library"
6040 - );
6041 -
6042 - // packages/format-library/build-module/math/index.mjs
6043 - var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1);
6044 - var { Badge: WCBadge } = unlock(import_components6.privateApis);
8891 + var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1);
6045 8892 var name14 = "core/math";
6046 - var title14 = (0, import_i18n18.__)("Math");
8893 + var title14 = (0, import_i18n21.__)("Math");
6047 8894 function InlineUI2({
6048 8895 value,
6049 8896 onChange,
6050 8897 activeAttributes,
@@ -6050,34 +8897,32 @@
6050 8897 activeAttributes,
6051 8898 contentRef,
6052 8899 latexToMathML
6053 8900 }) {
6054 - const [latex, setLatex] = (0, import_element19.useState)(
8901 + const [latex, setLatex] = (0, import_element33.useState)(
6055 8902 activeAttributes?.["data-latex"] || ""
6056 8903 );
6057 - const [error2, setError] = (0, import_element19.useState)(null);
8904 + const [error2, setError] = (0, import_element33.useState)(null);
8905 + const formRef = (0, import_element33.useRef)(null);
6058 8906 const popoverAnchor = (0, import_rich_text16.useAnchor)({
8907 + // eslint-disable-next-line react-hooks/refs
6059 8908 editableContentElement: contentRef.current,
6060 8909 settings: math
6061 8910 });
6062 8911 const handleLatexChange = (newLatex) => {
8912 + setLatex(newLatex);
6063 8913 let mathML = "";
6064 - setLatex(newLatex);
6065 - if (newLatex) {
8914 + if (newLatex && latexToMathML) {
6066 8915 try {
6067 8916 mathML = latexToMathML(newLatex, { displayMode: false });
6068 8917 setError(null);
6069 8918 } catch (err) {
6070 - setError(err.message);
6071 - (0, import_a11y3.speak)(
6072 - (0, import_i18n18.sprintf)(
6073 - /* translators: %s: error message returned when parsing LaTeX. */
6074 - (0, import_i18n18.__)("Error parsing mathematical expression: %s"),
6075 - err.message
6076 - )
8919 + setError(
8920 + err instanceof Error ? err.message : (0, import_i18n21.__)("Could not parse the LaTeX math syntax.")
6077 8921 );
6078 - return;
6079 8922 }
8923 + } else {
8924 + setError(null);
6080 8925 }
6081 8926 const newReplacements = value.replacements.slice();
6082 8927 newReplacements[value.start] = {
6083 8928 type: name14,
@@ -6090,9 +8935,9 @@
6090 8935 ...value,
6091 8936 replacements: newReplacements
6092 8937 });
6093 8938 };
6094 - return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
8939 + return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
6095 8940 import_components6.Popover,
6096 8941 {
6097 8942 placement: "bottom-start",
6098 8943 offset: 8,
@@ -6097,39 +8942,43 @@
6097 8942 placement: "bottom-start",
6098 8943 offset: 8,
6099 8944 focusOnMount: false,
6100 8945 anchor: popoverAnchor,
8946 + onFocusOutside: () => formRef.current?.reportValidity(),
6101 8947 className: "block-editor-format-toolbar__math-popover",
6102 - children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { style: { minWidth: "300px", padding: "4px" }, children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(Stack, { direction: "column", gap: "xs", children: [
6103 - /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
6104 - import_components6.TextControl,
6105 - {
6106 - __next40pxDefaultSize: true,
6107 - hideLabelFromVision: true,
6108 - label: (0, import_i18n18.__)("LaTeX math syntax"),
6109 - value: latex,
6110 - onChange: handleLatexChange,
6111 - placeholder: (0, import_i18n18.__)("e.g., x^2, \\frac{a}{b}"),
6112 - autoComplete: "off",
6113 - className: "block-editor-format-toolbar__math-input"
6114 - }
6115 - ),
6116 - error2 && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
6117 - /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
6118 - WCBadge,
6119 - {
6120 - intent: "error",
6121 - className: "wp-block-math__error",
6122 - children: (0, import_i18n18.sprintf)(
6123 - /* translators: %s: error message returned when parsing LaTeX. */
6124 - (0, import_i18n18.__)("Error: %s"),
6125 - error2
6126 - )
6127 - }
6128 - ),
6129 - /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("style", { children: ".wp-block-math__error .components-badge__content{white-space:normal}" })
6130 - ] })
6131 - ] }) })
8948 + children: /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(
8949 + "form",
8950 + {
8951 + ref: formRef,
8952 + style: { minWidth: "300px", padding: "16px" },
8953 + onSubmit: (event) => event.preventDefault(),
8954 + children: [
8955 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
8956 + ValidatedInputControl,
8957 + {
8958 + label: (0, import_i18n21.__)("LaTeX math syntax"),
8959 + value: latex,
8960 + customValidity: error2 ? { type: "invalid", message: error2 } : void 0,
8961 + onValueChange: handleLatexChange,
8962 + placeholder: (0, import_i18n21.__)("e.g., x^2, \\frac{a}{b}, \\sqrt{x}"),
8963 + autoComplete: "off",
8964 + className: "block-editor-format-toolbar__math-input"
8965 + }
8966 + ),
8967 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
8968 + Link,
8969 + {
8970 + openInNewTab: true,
8971 + className: "block-editor-format-toolbar__math-learn-more",
8972 + href: (0, import_i18n21.__)(
8973 + "https://wordpress.org/documentation/article/math-block/"
8974 + ),
8975 + children: (0, import_i18n21.__)("Learn more about LaTeX syntax")
8976 + }
8977 + )
8978 + ]
8979 + }
8980 + )
6132 8981 }
6133 8982 );
6134 8983 }
6135 8984 function Edit4({
@@ -6139,36 +8988,52 @@
6139 8988 isObjectActive,
6140 8989 activeObjectAttributes,
6141 8990 contentRef
6142 8991 }) {
6143 - const [latexToMathML, setLatexToMathML] = (0, import_element19.useState)();
6144 - (0, import_element19.useEffect)(() => {
8992 + const [latexToMathML, setLatexToMathML] = (0, import_element33.useState)();
8993 + (0, import_element33.useEffect)(() => {
6145 8994 import("@wordpress/latex-to-mathml").then((module) => {
6146 8995 setLatexToMathML(() => module.default);
6147 8996 });
6148 8997 }, []);
6149 - return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [
6150 - /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
8998 + function onClick() {
8999 + let newValue;
9000 + if (isObjectActive) {
9001 + const latex = activeObjectAttributes?.["data-latex"] || "";
9002 + newValue = (0, import_rich_text16.insert)(value, latex);
9003 + newValue.start = newValue.end - latex.length;
9004 + } else {
9005 + const selectedText = (0, import_rich_text16.getTextContent)((0, import_rich_text16.slice)(value));
9006 + let innerHTML = "";
9007 + if (selectedText && latexToMathML) {
9008 + try {
9009 + innerHTML = latexToMathML(selectedText, {
9010 + displayMode: false
9011 + });
9012 + } catch {
9013 + }
9014 + }
9015 + newValue = (0, import_rich_text16.insertObject)(value, {
9016 + type: name14,
9017 + attributes: { "data-latex": selectedText },
9018 + innerHTML
9019 + });
9020 + newValue.start = newValue.end - 1;
9021 + }
9022 + onChange(newValue);
9023 + onFocus();
9024 + }
9025 + return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(import_jsx_runtime69.Fragment, { children: [
9026 + /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
6151 9027 import_block_editor16.RichTextToolbarButton,
6152 9028 {
6153 9029 icon: math_default,
6154 9030 title: title14,
6155 - onClick: () => {
6156 - const newValue = (0, import_rich_text16.insertObject)(value, {
6157 - type: name14,
6158 - attributes: {
6159 - "data-latex": ""
6160 - },
6161 - innerHTML: ""
6162 - });
6163 - newValue.start = newValue.end - 1;
6164 - onChange(newValue);
6165 - onFocus();
6166 - },
9031 + onClick,
6167 9032 isActive: isObjectActive
6168 9033 }
6169 9034 ),
6170 - isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
9035 + isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(
6171 9036 InlineUI2,
6172 9037 {
6173 9038 value,
6174 9039 onChange,
@@ -6191,31 +9056,63 @@
6191 9056 edit: Edit4
6192 9057 };
6193 9058
6194 9059 // packages/format-library/build-module/non-breaking-space/index.mjs
6195 - var import_i18n19 = __toESM(require_i18n(), 1);
9060 + var import_i18n22 = __toESM(require_i18n(), 1);
6196 9061 var import_rich_text17 = __toESM(require_rich_text(), 1);
6197 9062 var import_block_editor17 = __toESM(require_block_editor(), 1);
6198 - var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1);
9063 + var import_components7 = __toESM(require_components(), 1);
9064 + var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1);
6199 9065 var name15 = "core/non-breaking-space";
6200 - var title15 = (0, import_i18n19.__)("Non breaking space");
9066 + var title15 = (0, import_i18n22.__)("Non breaking space");
9067 + function PopoverAnchor({ contentRef }) {
9068 + const popoverAnchor = (0, import_rich_text17.useAnchor)({
9069 + // eslint-disable-next-line react-hooks/refs
9070 + editableContentElement: contentRef.current,
9071 + settings: nonBreakingSpace
9072 + });
9073 + return /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(import_components7.Popover, { anchor: popoverAnchor, children: /* @__PURE__ */ (0, import_jsx_runtime70.jsx)("div", { style: { whiteSpace: "nowrap", padding: "4px" }, children: (0, import_i18n22.__)("Non-breaking space") }) });
9074 + }
6201 9075 var nonBreakingSpace = {
6202 9076 name: name15,
6203 9077 title: title15,
6204 - tagName: "nbsp",
6205 - className: null,
6206 - edit({ value, onChange }) {
9078 + tagName: "span",
9079 + className: "non-breaking-space",
9080 + edit({ value, onChange, contentRef }) {
6207 9081 function addNonBreakingSpace() {
6208 9082 onChange((0, import_rich_text17.insert)(value, "\xA0"));
6209 9083 }
6210 - return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(
6211 - import_block_editor17.RichTextShortcut,
6212 - {
6213 - type: "primaryShift",
6214 - character: " ",
6215 - onUse: addNonBreakingSpace
6216 - }
6217 - );
9084 + const selectedValue = value.start && value.end ? value.text.slice(value.start, value.end) : null;
9085 + return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_jsx_runtime70.Fragment, { children: [
9086 + /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(
9087 + import_block_editor17.RichTextShortcut,
9088 + {
9089 + type: "primaryShift",
9090 + character: " ",
9091 + onUse: addNonBreakingSpace
9092 + }
9093 + ),
9094 + selectedValue === "\xA0" && /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PopoverAnchor, { contentRef })
9095 + ] });
9096 + },
9097 + __experimentalCreatePrepareEditableTree() {
9098 + return (formats, text) => {
9099 + const NBSP = "\xA0";
9100 + let record = { formats, text };
9101 + let index2 = -1;
9102 + do {
9103 + index2 = text.indexOf(NBSP, index2 + 1);
9104 + if (index2 !== -1) {
9105 + record = (0, import_rich_text17.applyFormat)(
9106 + record,
9107 + { type: name15 },
9108 + index2,
9109 + index2 + 1
9110 + );
9111 + }
9112 + } while (index2 !== -1);
9113 + return record.formats;
9114 + };
6218 9115 }
6219 9116 };
6220 9117
6221 9118 // packages/format-library/build-module/default-formats.mjs
@@ -6254,5 +9151,7 @@
6254 9151 * This source code is licensed under the MIT license found in the
6255 9152 * LICENSE file in the root directory of this source tree.
6256 9153 *)
6257 9154 */
9155 +(window.wp ||= {}).formatLibrary = wp.formatLibrary;
9156 +})();
6258 9157 //# sourceMappingURL=index.js.map