| @@ -14,12 +14,8 @@ | ||
| 14 | 14 | }); |
| 15 | 15 | var __commonJS = (cb, mod) => function __require2() { |
| 16 | 16 | return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; |
| 17 | 17 | }; |
| 18 | - var __export = (target, all) => { | |
| 19 | - for (var name16 in all) | |
| 20 | - __defProp(target, name16, { get: all[name16], enumerable: true }); | |
| 21 | - }; | |
| 22 | 18 | var __copyProps = (to, from, except, desc) => { |
| 23 | 19 | if (from && typeof from === "object" || typeof from === "function") { |
| 24 | 20 | for (let key of __getOwnPropNames(from)) |
| 25 | 21 | if (!__hasOwnProp.call(to, key) && key !== except) |
| @@ -84,98 +80,22 @@ | ||
| 84 | 80 | module.exports = window.wp.components; |
| 85 | 81 | } |
| 86 | 82 | }); |
| 87 | 83 | |
| 88 | - // vendor-external:react | |
| 89 | - var require_react = __commonJS({ | |
| 90 | - "vendor-external:react"(exports, module) { | |
| 91 | - module.exports = window.React; | |
| 84 | + // package-external:@wordpress/url | |
| 85 | + var require_url = __commonJS({ | |
| 86 | + "package-external:@wordpress/url"(exports, module) { | |
| 87 | + module.exports = window.wp.url; | |
| 92 | 88 | } |
| 93 | 89 | }); |
| 94 | 90 | |
| 95 | - // vendor-external:react-dom | |
| 96 | - var require_react_dom = __commonJS({ | |
| 97 | - "vendor-external:react-dom"(exports, module) { | |
| 98 | - module.exports = window.ReactDOM; | |
| 91 | + // package-external:@wordpress/html-entities | |
| 92 | + var require_html_entities = __commonJS({ | |
| 93 | + "package-external:@wordpress/html-entities"(exports, module) { | |
| 94 | + module.exports = window.wp.htmlEntities; | |
| 99 | 95 | } |
| 100 | 96 | }); |
| 101 | 97 | |
| 102 | - // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js | |
| 103 | - var require_use_sync_external_store_shim_development = __commonJS({ | |
| 104 | - "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { | |
| 105 | - "use strict"; | |
| 106 | - (function() { | |
| 107 | - function is(x, y) { | |
| 108 | - return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; | |
| 109 | - } | |
| 110 | - function useSyncExternalStore$2(subscribe2, getSnapshot2) { | |
| 111 | - didWarnOld18Alpha || void 0 === React31.startTransition || (didWarnOld18Alpha = true, console.error( | |
| 112 | - "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 | - )); | |
| 114 | - var value = getSnapshot2(); | |
| 115 | - if (!didWarnUncachedGetSnapshot) { | |
| 116 | - var cachedValue = getSnapshot2(); | |
| 117 | - objectIs(value, cachedValue) || (console.error( | |
| 118 | - "The result of getSnapshot should be cached to avoid an infinite loop" | |
| 119 | - ), didWarnUncachedGetSnapshot = true); | |
| 120 | - } | |
| 121 | - cachedValue = useState17({ | |
| 122 | - inst: { value, getSnapshot: getSnapshot2 } | |
| 123 | - }); | |
| 124 | - var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; | |
| 125 | - useLayoutEffect3( | |
| 126 | - function() { | |
| 127 | - inst.value = value; | |
| 128 | - inst.getSnapshot = getSnapshot2; | |
| 129 | - checkIfSnapshotChanged(inst) && forceUpdate({ inst }); | |
| 130 | - }, | |
| 131 | - [subscribe2, value, getSnapshot2] | |
| 132 | - ); | |
| 133 | - useEffect12( | |
| 134 | - function() { | |
| 135 | - checkIfSnapshotChanged(inst) && forceUpdate({ inst }); | |
| 136 | - return subscribe2(function() { | |
| 137 | - checkIfSnapshotChanged(inst) && forceUpdate({ inst }); | |
| 138 | - }); | |
| 139 | - }, | |
| 140 | - [subscribe2] | |
| 141 | - ); | |
| 142 | - useDebugValue(value); | |
| 143 | - return value; | |
| 144 | - } | |
| 145 | - function checkIfSnapshotChanged(inst) { | |
| 146 | - var latestGetSnapshot = inst.getSnapshot; | |
| 147 | - inst = inst.value; | |
| 148 | - try { | |
| 149 | - var nextValue = latestGetSnapshot(); | |
| 150 | - return !objectIs(inst, nextValue); | |
| 151 | - } catch (error2) { | |
| 152 | - return true; | |
| 153 | - } | |
| 154 | - } | |
| 155 | - function useSyncExternalStore$1(subscribe2, getSnapshot2) { | |
| 156 | - return getSnapshot2(); | |
| 157 | - } | |
| 158 | - "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, useEffect12 = 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 | - "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); | |
| 162 | - })(); | |
| 163 | - } | |
| 164 | - }); | |
| 165 | - | |
| 166 | - // node_modules/use-sync-external-store/shim/index.js | |
| 167 | - var require_shim = __commonJS({ | |
| 168 | - "node_modules/use-sync-external-store/shim/index.js"(exports, module) { | |
| 169 | - "use strict"; | |
| 170 | - if (false) { | |
| 171 | - module.exports = null; | |
| 172 | - } else { | |
| 173 | - module.exports = require_use_sync_external_store_shim_development(); | |
| 174 | - } | |
| 175 | - } | |
| 176 | - }); | |
| 177 | - | |
| 178 | 98 | // package-external:@wordpress/a11y |
| 179 | 99 | var require_a11y = __commonJS({ |
| 180 | 100 | "package-external:@wordpress/a11y"(exports, module) { |
| 181 | 101 | module.exports = window.wp.a11y; |
| @@ -181,8 +101,15 @@ | ||
| 181 | 101 | module.exports = window.wp.a11y; |
| 182 | 102 | } |
| 183 | 103 | }); |
| 184 | 104 | |
| 105 | + // package-external:@wordpress/data | |
| 106 | + var require_data = __commonJS({ | |
| 107 | + "package-external:@wordpress/data"(exports, module) { | |
| 108 | + module.exports = window.wp.data; | |
| 109 | + } | |
| 110 | + }); | |
| 111 | + | |
| 185 | 112 | // package-external:@wordpress/compose |
| 186 | 113 | var require_compose = __commonJS({ |
| 187 | 114 | "package-external:@wordpress/compose"(exports, module) { |
| 188 | 115 | module.exports = window.wp.compose; |
| @@ -195,29 +122,8 @@ | ||
| 195 | 122 | module.exports = window.wp.privateApis; |
| 196 | 123 | } |
| 197 | 124 | }); |
| 198 | 125 | |
| 199 | - // package-external:@wordpress/url | |
| 200 | - var require_url = __commonJS({ | |
| 201 | - "package-external:@wordpress/url"(exports, module) { | |
| 202 | - module.exports = window.wp.url; | |
| 203 | - } | |
| 204 | - }); | |
| 205 | - | |
| 206 | - // package-external:@wordpress/html-entities | |
| 207 | - var require_html_entities = __commonJS({ | |
| 208 | - "package-external:@wordpress/html-entities"(exports, module) { | |
| 209 | - module.exports = window.wp.htmlEntities; | |
| 210 | - } | |
| 211 | - }); | |
| 212 | - | |
| 213 | - // package-external:@wordpress/data | |
| 214 | - var require_data = __commonJS({ | |
| 215 | - "package-external:@wordpress/data"(exports, module) { | |
| 216 | - module.exports = window.wp.data; | |
| 217 | - } | |
| 218 | - }); | |
| 219 | - | |
| 220 | 126 | // packages/format-library/build-module/index.mjs |
| 221 | 127 | var import_rich_text18 = __toESM(require_rich_text(), 1); |
| 222 | 128 | |
| 223 | 129 | // packages/format-library/build-module/bold/index.mjs |
| @@ -240,77 +146,72 @@ | ||
| 240 | 146 | |
| 241 | 147 | // packages/icons/build-module/library/button.mjs |
| 242 | 148 | var import_primitives = __toESM(require_primitives(), 1); |
| 243 | 149 | 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", fill: "currentColor", 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" }) }); | |
| 150 | + 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 | 151 | |
| 246 | - // packages/icons/build-module/library/chevron-right.mjs | |
| 152 | + // packages/icons/build-module/library/code.mjs | |
| 247 | 153 | var import_primitives2 = __toESM(require_primitives(), 1); |
| 248 | 154 | 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", fill: "currentColor", 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" }) }); | |
| 155 | + var code_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: "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" }) }); | |
| 250 | 156 | |
| 251 | - // packages/icons/build-module/library/code.mjs | |
| 157 | + // packages/icons/build-module/library/color.mjs | |
| 252 | 158 | var import_primitives3 = __toESM(require_primitives(), 1); |
| 253 | 159 | 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", fill: "currentColor", 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" }) }); | |
| 160 | + var color_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: "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" }) }); | |
| 255 | 161 | |
| 256 | - // packages/icons/build-module/library/color.mjs | |
| 162 | + // packages/icons/build-module/library/format-bold.mjs | |
| 257 | 163 | var import_primitives4 = __toESM(require_primitives(), 1); |
| 258 | 164 | 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", fill: "currentColor", 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" }) }); | |
| 165 | + var format_bold_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: "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" }) }); | |
| 260 | 166 | |
| 261 | - // packages/icons/build-module/library/format-bold.mjs | |
| 167 | + // packages/icons/build-module/library/format-italic.mjs | |
| 262 | 168 | var import_primitives5 = __toESM(require_primitives(), 1); |
| 263 | 169 | 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", fill: "currentColor", 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" }) }); | |
| 170 | + var format_italic_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: "M12.5 5L10 19h1.9l2.5-14z" }) }); | |
| 265 | 171 | |
| 266 | - // packages/icons/build-module/library/format-italic.mjs | |
| 172 | + // packages/icons/build-module/library/format-strikethrough.mjs | |
| 267 | 173 | var import_primitives6 = __toESM(require_primitives(), 1); |
| 268 | 174 | 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", fill: "currentColor", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M12.5 5L10 19h1.9l2.5-14z" }) }); | |
| 175 | + var format_strikethrough_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: "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" }) }); | |
| 270 | 176 | |
| 271 | - // packages/icons/build-module/library/format-strikethrough.mjs | |
| 177 | + // packages/icons/build-module/library/help.mjs | |
| 272 | 178 | var import_primitives7 = __toESM(require_primitives(), 1); |
| 273 | 179 | 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", fill: "currentColor", 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" }) }); | |
| 180 | + var help_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: "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" }) }); | |
| 275 | 181 | |
| 276 | - // packages/icons/build-module/library/help.mjs | |
| 182 | + // packages/icons/build-module/library/language.mjs | |
| 277 | 183 | var import_primitives8 = __toESM(require_primitives(), 1); |
| 278 | 184 | 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", fill: "currentColor", 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" }) }); | |
| 185 | + var language_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: "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" }) }); | |
| 280 | 186 | |
| 281 | - // packages/icons/build-module/library/language.mjs | |
| 187 | + // packages/icons/build-module/library/link.mjs | |
| 282 | 188 | var import_primitives9 = __toESM(require_primitives(), 1); |
| 283 | 189 | 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", fill: "currentColor", 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" }) }); | |
| 190 | + var link_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: "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" }) }); | |
| 285 | 191 | |
| 286 | - // packages/icons/build-module/library/link.mjs | |
| 192 | + // packages/icons/build-module/library/math.mjs | |
| 287 | 193 | var import_primitives10 = __toESM(require_primitives(), 1); |
| 288 | 194 | 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", fill: "currentColor", 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" }) }); | |
| 195 | + var math_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: "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" }) }); | |
| 290 | 196 | |
| 291 | - // packages/icons/build-module/library/math.mjs | |
| 197 | + // packages/icons/build-module/library/subscript.mjs | |
| 292 | 198 | var import_primitives11 = __toESM(require_primitives(), 1); |
| 293 | 199 | 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", fill: "currentColor", 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" }) }); | |
| 200 | + var subscript_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: "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" }) }); | |
| 295 | 201 | |
| 296 | - // packages/icons/build-module/library/subscript.mjs | |
| 202 | + // packages/icons/build-module/library/superscript.mjs | |
| 297 | 203 | var import_primitives12 = __toESM(require_primitives(), 1); |
| 298 | 204 | 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", fill: "currentColor", 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" }) }); | |
| 205 | + var superscript_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 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" }) }); | |
| 300 | 206 | |
| 301 | - // packages/icons/build-module/library/superscript.mjs | |
| 207 | + // packages/icons/build-module/library/text-color.mjs | |
| 302 | 208 | var import_primitives13 = __toESM(require_primitives(), 1); |
| 303 | 209 | 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", fill: "currentColor", 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" }) }); | |
| 210 | + var text_color_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: "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" }) }); | |
| 305 | 211 | |
| 306 | - // packages/icons/build-module/library/text-color.mjs | |
| 307 | - var import_primitives14 = __toESM(require_primitives(), 1); | |
| 212 | + // packages/format-library/build-module/bold/index.mjs | |
| 308 | 213 | 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", fill: "currentColor", 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" }) }); | |
| 310 | - | |
| 311 | - // packages/format-library/build-module/bold/index.mjs | |
| 312 | - var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); | |
| 313 | 214 | var name = "core/bold"; |
| 314 | 215 | var title = (0, import_i18n.__)("Bold"); |
| 315 | 216 | var bold = { |
| 316 | 217 | name, |
| @@ -324,10 +225,10 @@ | ||
| 324 | 225 | function onClick() { |
| 325 | 226 | onChange((0, import_rich_text.toggleFormat)(value, { type: name })); |
| 326 | 227 | onFocus(); |
| 327 | 228 | } |
| 328 | - return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [ | |
| 329 | - /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( | |
| 229 | + return /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_jsx_runtime14.Fragment, { children: [ | |
| 230 | + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( | |
| 330 | 231 | import_block_editor.RichTextShortcut, |
| 331 | 232 | { |
| 332 | 233 | type: "primary", |
| 333 | 234 | character: "b", |
| @@ -333,9 +234,9 @@ | ||
| 333 | 234 | character: "b", |
| 334 | 235 | onUse: onToggle |
| 335 | 236 | } |
| 336 | 237 | ), |
| 337 | - isVisible && /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( | |
| 238 | + isVisible && /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( | |
| 338 | 239 | import_block_editor.RichTextToolbarButton, |
| 339 | 240 | { |
| 340 | 241 | name: "bold", |
| 341 | 242 | icon: format_bold_default, |
| @@ -345,9 +246,9 @@ | ||
| 345 | 246 | shortcutType: "primary", |
| 346 | 247 | shortcutCharacter: "b" |
| 347 | 248 | } |
| 348 | 249 | ), |
| 349 | - /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( | |
| 250 | + /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( | |
| 350 | 251 | import_block_editor.__unstableRichTextInputEvent, |
| 351 | 252 | { |
| 352 | 253 | inputType: "formatBold", |
| 353 | 254 | onInput: onToggle |
| @@ -360,9 +261,9 @@ | ||
| 360 | 261 | // packages/format-library/build-module/code/index.mjs |
| 361 | 262 | var import_i18n2 = __toESM(require_i18n(), 1); |
| 362 | 263 | var import_rich_text2 = __toESM(require_rich_text(), 1); |
| 363 | 264 | var import_block_editor2 = __toESM(require_block_editor(), 1); |
| 364 | - var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); | |
| 265 | + var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); | |
| 365 | 266 | var name2 = "core/code"; |
| 366 | 267 | var title2 = (0, import_i18n2.__)("Inline code"); |
| 367 | 268 | var code = { |
| 368 | 269 | name: name2, |
| @@ -397,10 +298,10 @@ | ||
| 397 | 298 | function onClick() { |
| 398 | 299 | onChange((0, import_rich_text2.toggleFormat)(value, { type: name2, title: title2 })); |
| 399 | 300 | onFocus(); |
| 400 | 301 | } |
| 401 | - return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [ | |
| 402 | - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 302 | + return /* @__PURE__ */ (0, import_jsx_runtime15.jsxs)(import_jsx_runtime15.Fragment, { children: [ | |
| 303 | + /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( | |
| 403 | 304 | import_block_editor2.RichTextShortcut, |
| 404 | 305 | { |
| 405 | 306 | type: "access", |
| 406 | 307 | character: "x", |
| @@ -406,9 +307,9 @@ | ||
| 406 | 307 | character: "x", |
| 407 | 308 | onUse: onClick |
| 408 | 309 | } |
| 409 | 310 | ), |
| 410 | - /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 311 | + /* @__PURE__ */ (0, import_jsx_runtime15.jsx)( | |
| 411 | 312 | import_block_editor2.RichTextToolbarButton, |
| 412 | 313 | { |
| 413 | 314 | icon: code_default, |
| 414 | 315 | title: title2, |
| @@ -422,3830 +323,16 @@ | ||
| 422 | 323 | }; |
| 423 | 324 | |
| 424 | 325 | // packages/format-library/build-module/image/index.mjs |
| 425 | 326 | var import_components = __toESM(require_components(), 1); |
| 426 | - | |
| 427 | - // node_modules/clsx/dist/clsx.mjs | |
| 428 | - function r(e) { | |
| 429 | - var t, f, n = ""; | |
| 430 | - if ("string" == typeof e || "number" == typeof e) n += e; | |
| 431 | - else if ("object" == typeof e) if (Array.isArray(e)) { | |
| 432 | - var o = e.length; | |
| 433 | - for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); | |
| 434 | - } else for (f in e) e[f] && (n && (n += " "), n += f); | |
| 435 | - return n; | |
| 436 | - } | |
| 437 | - function clsx() { | |
| 438 | - for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); | |
| 439 | - return n; | |
| 440 | - } | |
| 441 | - var clsx_default = clsx; | |
| 442 | - | |
| 443 | - // node_modules/@base-ui/utils/useControlled.mjs | |
| 444 | - var React = __toESM(require_react(), 1); | |
| 445 | - | |
| 446 | - // node_modules/@base-ui/utils/error.mjs | |
| 447 | - var set; | |
| 448 | - if (true) { | |
| 449 | - set = /* @__PURE__ */ new Set(); | |
| 450 | - } | |
| 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}`); | |
| 457 | - } | |
| 458 | - } | |
| 459 | - } | |
| 460 | - | |
| 461 | - // node_modules/@base-ui/utils/useControlled.mjs | |
| 462 | - function useControlled({ | |
| 463 | - controlled, | |
| 464 | - default: defaultProp, | |
| 465 | - name: name16, | |
| 466 | - state = "value" | |
| 467 | - }) { | |
| 468 | - const { | |
| 469 | - current: isControlled | |
| 470 | - } = React.useRef(controlled !== void 0); | |
| 471 | - const [valueState, setValue] = React.useState(defaultProp); | |
| 472 | - const value = isControlled ? controlled : valueState; | |
| 473 | - if (true) { | |
| 474 | - React.useEffect(() => { | |
| 475 | - if (isControlled !== (controlled !== void 0)) { | |
| 476 | - 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")); | |
| 477 | - } | |
| 478 | - }, [state, name16, controlled]); | |
| 479 | - const { | |
| 480 | - current: defaultValue | |
| 481 | - } = React.useRef(defaultProp); | |
| 482 | - React.useEffect(() => { | |
| 483 | - if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) { | |
| 484 | - error([`A component is changing the default ${state} state of an uncontrolled ${name16} after being initialized. To suppress this warning opt to use a controlled ${name16}.`].join("\n")); | |
| 485 | - } | |
| 486 | - }, [defaultProp]); | |
| 487 | - } | |
| 488 | - const setValueIfUncontrolled = React.useCallback((newValue) => { | |
| 489 | - if (!isControlled) { | |
| 490 | - setValue(newValue); | |
| 491 | - } | |
| 492 | - }, []); | |
| 493 | - return [value, setValueIfUncontrolled]; | |
| 494 | - } | |
| 495 | - function serializeToDevModeString(input) { | |
| 496 | - let nextId = 0; | |
| 497 | - const seen = /* @__PURE__ */ new WeakMap(); | |
| 498 | - try { | |
| 499 | - const result = JSON.stringify(input, function replacer(key, value) { | |
| 500 | - if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) { | |
| 501 | - return void 0; | |
| 502 | - } | |
| 503 | - if (typeof value === "bigint") { | |
| 504 | - return `__bigint__:${value}`; | |
| 505 | - } | |
| 506 | - if (value !== null && typeof value === "object") { | |
| 507 | - const id = seen.get(value); | |
| 508 | - if (id !== void 0) { | |
| 509 | - return `__object__:${id}`; | |
| 510 | - } | |
| 511 | - seen.set(value, nextId); | |
| 512 | - nextId += 1; | |
| 513 | - } | |
| 514 | - return value; | |
| 515 | - }); | |
| 516 | - return result ?? `__top__:${typeof input}`; | |
| 517 | - } catch { | |
| 518 | - return "__unserializable__"; | |
| 519 | - } | |
| 520 | - } | |
| 521 | - | |
| 522 | - // node_modules/@base-ui/utils/safeReact.mjs | |
| 523 | - var React2 = __toESM(require_react(), 1); | |
| 524 | - var SafeReact = { | |
| 525 | - ...React2 | |
| 526 | - }; | |
| 527 | - | |
| 528 | - // node_modules/@base-ui/utils/useRefWithInit.mjs | |
| 529 | - var React3 = __toESM(require_react(), 1); | |
| 530 | - var UNINITIALIZED = {}; | |
| 531 | - function useRefWithInit(init, initArg) { | |
| 532 | - const ref = React3.useRef(UNINITIALIZED); | |
| 533 | - if (ref.current === UNINITIALIZED) { | |
| 534 | - ref.current = init(initArg); | |
| 535 | - } | |
| 536 | - return ref; | |
| 537 | - } | |
| 538 | - | |
| 539 | - // node_modules/@base-ui/utils/useStableCallback.mjs | |
| 540 | - var useInsertionEffect = SafeReact.useInsertionEffect; | |
| 541 | - var useSafeInsertionEffect = ( | |
| 542 | - // React 17 doesn't have useInsertionEffect. | |
| 543 | - useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. | |
| 544 | - useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() | |
| 545 | - ); | |
| 546 | - function useStableCallback(callback) { | |
| 547 | - const stable = useRefWithInit(createStableCallback).current; | |
| 548 | - stable.next = callback; | |
| 549 | - useSafeInsertionEffect(stable.effect); | |
| 550 | - return stable.trampoline; | |
| 551 | - } | |
| 552 | - function createStableCallback() { | |
| 553 | - const stable = { | |
| 554 | - next: void 0, | |
| 555 | - callback: assertNotCalled, | |
| 556 | - trampoline: (...args) => stable.callback?.(...args), | |
| 557 | - effect: () => { | |
| 558 | - stable.callback = stable.next; | |
| 559 | - } | |
| 560 | - }; | |
| 561 | - return stable; | |
| 562 | - } | |
| 563 | - function assertNotCalled() { | |
| 564 | - if (true) { | |
| 565 | - throw ( | |
| 566 | - /* minify-error-disabled */ | |
| 567 | - new Error("Base UI: Cannot call an event handler while rendering.") | |
| 568 | - ); | |
| 569 | - } | |
| 570 | - } | |
| 571 | - | |
| 572 | - // node_modules/@base-ui/utils/useIsoLayoutEffect.mjs | |
| 573 | - var React4 = __toESM(require_react(), 1); | |
| 574 | - var noop = () => { | |
| 575 | - }; | |
| 576 | - var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop; | |
| 577 | - | |
| 578 | - // node_modules/@base-ui/utils/warn.mjs | |
| 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/internals/composite/list/CompositeList.mjs | |
| 594 | - var React6 = __toESM(require_react(), 1); | |
| 595 | - | |
| 596 | - // node_modules/@base-ui/react/internals/composite/list/CompositeListContext.mjs | |
| 597 | - var React5 = __toESM(require_react(), 1); | |
| 598 | - var CompositeListContext = /* @__PURE__ */ React5.createContext({ | |
| 599 | - register: () => { | |
| 600 | - }, | |
| 601 | - unregister: () => { | |
| 602 | - }, | |
| 603 | - subscribeMapChange: () => { | |
| 604 | - return () => { | |
| 605 | - }; | |
| 606 | - }, | |
| 607 | - elementsRef: { | |
| 608 | - current: [] | |
| 609 | - }, | |
| 610 | - nextIndexRef: { | |
| 611 | - current: 0 | |
| 612 | - } | |
| 613 | - }); | |
| 614 | - if (true) CompositeListContext.displayName = "CompositeListContext"; | |
| 615 | - function useCompositeListContext() { | |
| 616 | - return React5.useContext(CompositeListContext); | |
| 617 | - } | |
| 618 | - | |
| 619 | - // node_modules/@base-ui/react/internals/composite/list/CompositeList.mjs | |
| 620 | - var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); | |
| 621 | - function CompositeList(props) { | |
| 622 | - const { | |
| 623 | - children, | |
| 624 | - elementsRef, | |
| 625 | - labelsRef, | |
| 626 | - onMapChange: onMapChangeProp | |
| 627 | - } = props; | |
| 628 | - const onMapChange = useStableCallback(onMapChangeProp); | |
| 629 | - const nextIndexRef = React6.useRef(0); | |
| 630 | - const listeners = useRefWithInit(createListeners).current; | |
| 631 | - 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); | |
| 638 | - }); | |
| 639 | - const unregister = useStableCallback((node) => { | |
| 640 | - map.delete(node); | |
| 641 | - lastTickRef.current += 1; | |
| 642 | - setMapTick(lastTickRef.current); | |
| 643 | - }); | |
| 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 | |
| 653 | - }); | |
| 654 | - }); | |
| 655 | - return newMap; | |
| 656 | - }, [map, mapTick]); | |
| 657 | - useIsoLayoutEffect(() => { | |
| 658 | - if (typeof MutationObserver !== "function" || sortedMap.size === 0) { | |
| 659 | - return void 0; | |
| 660 | - } | |
| 661 | - 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); | |
| 671 | - } | |
| 672 | - }); | |
| 673 | - sortedMap.forEach((_, node) => { | |
| 674 | - if (node.parentElement) { | |
| 675 | - mutationObserver.observe(node.parentElement, { | |
| 676 | - childList: true | |
| 677 | - }); | |
| 678 | - } | |
| 679 | - }); | |
| 680 | - return () => { | |
| 681 | - mutationObserver.disconnect(); | |
| 682 | - }; | |
| 683 | - }, [sortedMap]); | |
| 684 | - 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; | |
| 694 | - } | |
| 695 | - onMapChange(sortedMap); | |
| 696 | - }, [onMapChange, sortedMap, elementsRef, labelsRef, mapTick]); | |
| 697 | - useIsoLayoutEffect(() => { | |
| 698 | - return () => { | |
| 699 | - elementsRef.current = []; | |
| 700 | - }; | |
| 701 | - }, [elementsRef]); | |
| 702 | - useIsoLayoutEffect(() => { | |
| 703 | - return () => { | |
| 704 | - if (labelsRef) { | |
| 705 | - labelsRef.current = []; | |
| 706 | - } | |
| 707 | - }; | |
| 708 | - }, [labelsRef]); | |
| 709 | - const subscribeMapChange = useStableCallback((fn) => { | |
| 710 | - listeners.add(fn); | |
| 711 | - return () => { | |
| 712 | - listeners.delete(fn); | |
| 713 | - }; | |
| 714 | - }); | |
| 715 | - useIsoLayoutEffect(() => { | |
| 716 | - listeners.forEach((l) => l(sortedMap)); | |
| 717 | - }, [listeners, sortedMap]); | |
| 718 | - const contextValue = React6.useMemo(() => ({ | |
| 719 | - register, | |
| 720 | - unregister, | |
| 721 | - subscribeMapChange, | |
| 722 | - elementsRef, | |
| 723 | - labelsRef, | |
| 724 | - nextIndexRef | |
| 725 | - }), [register, unregister, subscribeMapChange, elementsRef, labelsRef, nextIndexRef]); | |
| 726 | - return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(CompositeListContext.Provider, { | |
| 727 | - value: contextValue, | |
| 728 | - children | |
| 729 | - }); | |
| 730 | - } | |
| 731 | - function createMap() { | |
| 732 | - return /* @__PURE__ */ new Map(); | |
| 733 | - } | |
| 734 | - function createListeners() { | |
| 735 | - return /* @__PURE__ */ new Set(); | |
| 736 | - } | |
| 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; | |
| 741 | - } | |
| 742 | - if (position & Node.DOCUMENT_POSITION_PRECEDING || position & Node.DOCUMENT_POSITION_CONTAINS) { | |
| 743 | - return 1; | |
| 744 | - } | |
| 745 | - return 0; | |
| 746 | - } | |
| 747 | - function disableEslintWarning(_) { | |
| 748 | - } | |
| 749 | - | |
| 750 | - // node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs | |
| 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"; | |
| 757 | - } | |
| 758 | - | |
| 759 | - // node_modules/@base-ui/react/internals/useRenderElement.mjs | |
| 760 | - var React10 = __toESM(require_react(), 1); | |
| 761 | - | |
| 762 | - // node_modules/@base-ui/utils/useMergedRefs.mjs | |
| 763 | - function useMergedRefs(a, b, c, d) { | |
| 764 | - const forkRef = useRefWithInit(createForkRef).current; | |
| 765 | - if (didChange(forkRef, a, b, c, d)) { | |
| 766 | - update(forkRef, [a, b, c, d]); | |
| 767 | - } | |
| 768 | - return forkRef.callback; | |
| 769 | - } | |
| 770 | - function useMergedRefsN(refs) { | |
| 771 | - const forkRef = useRefWithInit(createForkRef).current; | |
| 772 | - if (didChangeN(forkRef, refs)) { | |
| 773 | - update(forkRef, refs); | |
| 774 | - } | |
| 775 | - return forkRef.callback; | |
| 776 | - } | |
| 777 | - function createForkRef() { | |
| 778 | - return { | |
| 779 | - callback: null, | |
| 780 | - cleanup: null, | |
| 781 | - refs: [] | |
| 782 | - }; | |
| 783 | - } | |
| 784 | - function didChange(forkRef, a, b, c, d) { | |
| 785 | - return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; | |
| 786 | - } | |
| 787 | - function didChangeN(forkRef, newRefs) { | |
| 788 | - return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]); | |
| 789 | - } | |
| 790 | - function update(forkRef, refs) { | |
| 791 | - forkRef.refs = refs; | |
| 792 | - if (refs.every((ref) => ref == null)) { | |
| 793 | - forkRef.callback = null; | |
| 794 | - return; | |
| 795 | - } | |
| 796 | - forkRef.callback = (instance) => { | |
| 797 | - if (forkRef.cleanup) { | |
| 798 | - forkRef.cleanup(); | |
| 799 | - forkRef.cleanup = null; | |
| 800 | - } | |
| 801 | - if (instance != null) { | |
| 802 | - const cleanupCallbacks = Array(refs.length).fill(null); | |
| 803 | - for (let i = 0; i < refs.length; i += 1) { | |
| 804 | - const ref = refs[i]; | |
| 805 | - if (ref == null) { | |
| 806 | - continue; | |
| 807 | - } | |
| 808 | - switch (typeof ref) { | |
| 809 | - case "function": { | |
| 810 | - const refCleanup = ref(instance); | |
| 811 | - if (typeof refCleanup === "function") { | |
| 812 | - cleanupCallbacks[i] = refCleanup; | |
| 813 | - } | |
| 814 | - break; | |
| 815 | - } | |
| 816 | - case "object": { | |
| 817 | - ref.current = instance; | |
| 818 | - break; | |
| 819 | - } | |
| 820 | - default: | |
| 821 | - } | |
| 822 | - } | |
| 823 | - forkRef.cleanup = () => { | |
| 824 | - for (let i = 0; i < refs.length; i += 1) { | |
| 825 | - const ref = refs[i]; | |
| 826 | - if (ref == null) { | |
| 827 | - continue; | |
| 828 | - } | |
| 829 | - switch (typeof ref) { | |
| 830 | - case "function": { | |
| 831 | - const cleanupCallback = cleanupCallbacks[i]; | |
| 832 | - if (typeof cleanupCallback === "function") { | |
| 833 | - cleanupCallback(); | |
| 834 | - } else { | |
| 835 | - ref(null); | |
| 836 | - } | |
| 837 | - break; | |
| 838 | - } | |
| 839 | - case "object": { | |
| 840 | - ref.current = null; | |
| 841 | - break; | |
| 842 | - } | |
| 843 | - default: | |
| 844 | - } | |
| 845 | - } | |
| 846 | - }; | |
| 847 | - } | |
| 848 | - }; | |
| 849 | - } | |
| 850 | - | |
| 851 | - // node_modules/@base-ui/utils/getReactElementRef.mjs | |
| 852 | - var React9 = __toESM(require_react(), 1); | |
| 853 | - | |
| 854 | - // node_modules/@base-ui/utils/reactVersion.mjs | |
| 855 | - var React8 = __toESM(require_react(), 1); | |
| 856 | - var majorVersion = parseInt(React8.version, 10); | |
| 857 | - function isReactVersionAtLeast(reactVersionToCheck) { | |
| 858 | - return majorVersion >= reactVersionToCheck; | |
| 859 | - } | |
| 860 | - | |
| 861 | - // node_modules/@base-ui/utils/getReactElementRef.mjs | |
| 862 | - function getReactElementRef(element) { | |
| 863 | - if (!/* @__PURE__ */ React9.isValidElement(element)) { | |
| 864 | - return null; | |
| 865 | - } | |
| 866 | - const reactElement = element; | |
| 867 | - const propsWithRef = reactElement.props; | |
| 868 | - return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; | |
| 869 | - } | |
| 870 | - | |
| 871 | - // node_modules/@base-ui/utils/mergeObjects.mjs | |
| 872 | - function mergeObjects(a, b) { | |
| 873 | - if (a && !b) { | |
| 874 | - return a; | |
| 875 | - } | |
| 876 | - if (!a && b) { | |
| 877 | - return b; | |
| 878 | - } | |
| 879 | - if (a || b) { | |
| 880 | - return { | |
| 881 | - ...a, | |
| 882 | - ...b | |
| 883 | - }; | |
| 884 | - } | |
| 885 | - return void 0; | |
| 886 | - } | |
| 887 | - | |
| 888 | - // node_modules/@base-ui/utils/empty.mjs | |
| 889 | - function NOOP() { | |
| 890 | - } | |
| 891 | - var EMPTY_ARRAY = Object.freeze([]); | |
| 892 | - var EMPTY_OBJECT = Object.freeze({}); | |
| 893 | - | |
| 894 | - // node_modules/@base-ui/react/internals/getStateAttributesProps.mjs | |
| 895 | - function getStateAttributesProps(state, customMapping) { | |
| 896 | - const props = {}; | |
| 897 | - for (const key in state) { | |
| 898 | - const value = state[key]; | |
| 899 | - if (customMapping?.hasOwnProperty(key)) { | |
| 900 | - const customProps = customMapping[key](value); | |
| 901 | - if (customProps != null) { | |
| 902 | - Object.assign(props, customProps); | |
| 903 | - } | |
| 904 | - continue; | |
| 905 | - } | |
| 906 | - if (value === true) { | |
| 907 | - props[`data-${key.toLowerCase()}`] = ""; | |
| 908 | - } else if (value) { | |
| 909 | - props[`data-${key.toLowerCase()}`] = value.toString(); | |
| 910 | - } | |
| 911 | - } | |
| 912 | - return props; | |
| 913 | - } | |
| 914 | - | |
| 915 | - // node_modules/@base-ui/react/utils/resolveClassName.mjs | |
| 916 | - function resolveClassName(className, state) { | |
| 917 | - return typeof className === "function" ? className(state) : className; | |
| 918 | - } | |
| 919 | - | |
| 920 | - // node_modules/@base-ui/react/utils/resolveStyle.mjs | |
| 921 | - function resolveStyle(style, state) { | |
| 922 | - return typeof style === "function" ? style(state) : style; | |
| 923 | - } | |
| 924 | - | |
| 925 | - // node_modules/@base-ui/react/merge-props/mergeProps.mjs | |
| 926 | - var EMPTY_PROPS = {}; | |
| 927 | - function mergeProps(a, b, c, d, e) { | |
| 928 | - if (!c && !d && !e && !a) { | |
| 929 | - return createInitialMergedProps(b); | |
| 930 | - } | |
| 931 | - let merged = createInitialMergedProps(a); | |
| 932 | - if (b) { | |
| 933 | - merged = mergeInto(merged, b); | |
| 934 | - } | |
| 935 | - if (c) { | |
| 936 | - merged = mergeInto(merged, c); | |
| 937 | - } | |
| 938 | - if (d) { | |
| 939 | - merged = mergeInto(merged, d); | |
| 940 | - } | |
| 941 | - if (e) { | |
| 942 | - merged = mergeInto(merged, e); | |
| 943 | - } | |
| 944 | - return merged; | |
| 945 | - } | |
| 946 | - function mergePropsN(props) { | |
| 947 | - if (props.length === 0) { | |
| 948 | - return EMPTY_PROPS; | |
| 949 | - } | |
| 950 | - if (props.length === 1) { | |
| 951 | - return createInitialMergedProps(props[0]); | |
| 952 | - } | |
| 953 | - let merged = createInitialMergedProps(props[0]); | |
| 954 | - for (let i = 1; i < props.length; i += 1) { | |
| 955 | - merged = mergeInto(merged, props[i]); | |
| 956 | - } | |
| 957 | - return merged; | |
| 958 | - } | |
| 959 | - function createInitialMergedProps(inputProps) { | |
| 960 | - if (isPropsGetter(inputProps)) { | |
| 961 | - return { | |
| 962 | - ...resolvePropsGetter(inputProps, EMPTY_PROPS) | |
| 963 | - }; | |
| 964 | - } | |
| 965 | - return copyInitialProps(inputProps); | |
| 966 | - } | |
| 967 | - function mergeInto(merged, inputProps) { | |
| 968 | - if (isPropsGetter(inputProps)) { | |
| 969 | - return resolvePropsGetter(inputProps, merged); | |
| 970 | - } | |
| 971 | - return mutablyMergeInto(merged, inputProps); | |
| 972 | - } | |
| 973 | - function copyInitialProps(inputProps) { | |
| 974 | - const copiedProps = { | |
| 975 | - ...inputProps | |
| 976 | - }; | |
| 977 | - for (const propName in copiedProps) { | |
| 978 | - const propValue = copiedProps[propName]; | |
| 979 | - if (isEventHandler(propName, propValue)) { | |
| 980 | - copiedProps[propName] = wrapEventHandler(propValue); | |
| 981 | - } | |
| 982 | - } | |
| 983 | - return copiedProps; | |
| 984 | - } | |
| 985 | - function mutablyMergeInto(mergedProps, externalProps) { | |
| 986 | - if (!externalProps) { | |
| 987 | - return mergedProps; | |
| 988 | - } | |
| 989 | - for (const propName in externalProps) { | |
| 990 | - const externalPropValue = externalProps[propName]; | |
| 991 | - switch (propName) { | |
| 992 | - case "style": { | |
| 993 | - mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); | |
| 994 | - break; | |
| 995 | - } | |
| 996 | - case "className": { | |
| 997 | - mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); | |
| 998 | - break; | |
| 999 | - } | |
| 1000 | - default: { | |
| 1001 | - if (isEventHandler(propName, externalPropValue)) { | |
| 1002 | - mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); | |
| 1003 | - } else { | |
| 1004 | - mergedProps[propName] = externalPropValue; | |
| 1005 | - } | |
| 1006 | - } | |
| 1007 | - } | |
| 1008 | - } | |
| 1009 | - return mergedProps; | |
| 1010 | - } | |
| 1011 | - function isEventHandler(key, value) { | |
| 1012 | - const code0 = key.charCodeAt(0); | |
| 1013 | - const code1 = key.charCodeAt(1); | |
| 1014 | - const code2 = key.charCodeAt(2); | |
| 1015 | - return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); | |
| 1016 | - } | |
| 1017 | - function isPropsGetter(inputProps) { | |
| 1018 | - return typeof inputProps === "function"; | |
| 1019 | - } | |
| 1020 | - function resolvePropsGetter(inputProps, previousProps) { | |
| 1021 | - if (isPropsGetter(inputProps)) { | |
| 1022 | - return inputProps(previousProps); | |
| 1023 | - } | |
| 1024 | - return inputProps ?? EMPTY_PROPS; | |
| 1025 | - } | |
| 1026 | - function mergeEventHandlers(ourHandler, theirHandler) { | |
| 1027 | - if (!theirHandler) { | |
| 1028 | - return ourHandler; | |
| 1029 | - } | |
| 1030 | - if (!ourHandler) { | |
| 1031 | - return wrapEventHandler(theirHandler); | |
| 1032 | - } | |
| 1033 | - return (...args) => { | |
| 1034 | - const event = args[0]; | |
| 1035 | - if (isSyntheticEvent(event)) { | |
| 1036 | - const baseUIEvent = event; | |
| 1037 | - makeEventPreventable(baseUIEvent); | |
| 1038 | - const result2 = theirHandler(...args); | |
| 1039 | - if (!baseUIEvent.baseUIHandlerPrevented) { | |
| 1040 | - ourHandler?.(...args); | |
| 1041 | - } | |
| 1042 | - return result2; | |
| 1043 | - } | |
| 1044 | - const result = theirHandler(...args); | |
| 1045 | - ourHandler?.(...args); | |
| 1046 | - return result; | |
| 1047 | - }; | |
| 1048 | - } | |
| 1049 | - function wrapEventHandler(handler) { | |
| 1050 | - if (!handler) { | |
| 1051 | - return handler; | |
| 1052 | - } | |
| 1053 | - return (...args) => { | |
| 1054 | - const event = args[0]; | |
| 1055 | - if (isSyntheticEvent(event)) { | |
| 1056 | - makeEventPreventable(event); | |
| 1057 | - } | |
| 1058 | - return handler(...args); | |
| 1059 | - }; | |
| 1060 | - } | |
| 1061 | - function makeEventPreventable(event) { | |
| 1062 | - event.preventBaseUIHandler = () => { | |
| 1063 | - event.baseUIHandlerPrevented = true; | |
| 1064 | - }; | |
| 1065 | - return event; | |
| 1066 | - } | |
| 1067 | - function mergeClassNames(ourClassName, theirClassName) { | |
| 1068 | - if (theirClassName) { | |
| 1069 | - if (ourClassName) { | |
| 1070 | - return theirClassName + " " + ourClassName; | |
| 1071 | - } | |
| 1072 | - return theirClassName; | |
| 1073 | - } | |
| 1074 | - return ourClassName; | |
| 1075 | - } | |
| 1076 | - function isSyntheticEvent(event) { | |
| 1077 | - return event != null && typeof event === "object" && "nativeEvent" in event; | |
| 1078 | - } | |
| 1079 | - | |
| 1080 | - // node_modules/@base-ui/react/internals/useRenderElement.mjs | |
| 1081 | - var import_react = __toESM(require_react(), 1); | |
| 1082 | - function useRenderElement(element, componentProps, params = {}) { | |
| 1083 | - const renderProp = componentProps.render; | |
| 1084 | - const outProps = useRenderElementProps(componentProps, params); | |
| 1085 | - if (params.enabled === false) { | |
| 1086 | - return null; | |
| 1087 | - } | |
| 1088 | - const state = params.state ?? EMPTY_OBJECT; | |
| 1089 | - return evaluateRenderProp(element, renderProp, outProps, state); | |
| 1090 | - } | |
| 1091 | - function useRenderElementProps(componentProps, params = {}) { | |
| 1092 | - const { | |
| 1093 | - className: classNameProp, | |
| 1094 | - style: styleProp, | |
| 1095 | - render: renderProp | |
| 1096 | - } = componentProps; | |
| 1097 | - const { | |
| 1098 | - state = EMPTY_OBJECT, | |
| 1099 | - ref, | |
| 1100 | - props, | |
| 1101 | - stateAttributesMapping: stateAttributesMapping3, | |
| 1102 | - enabled = true | |
| 1103 | - } = params; | |
| 1104 | - const className = enabled ? resolveClassName(classNameProp, state) : void 0; | |
| 1105 | - const style = enabled ? resolveStyle(styleProp, state) : void 0; | |
| 1106 | - const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping3) : EMPTY_OBJECT; | |
| 1107 | - const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; | |
| 1108 | - const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; | |
| 1109 | - if (typeof document !== "undefined") { | |
| 1110 | - if (!enabled) { | |
| 1111 | - useMergedRefs(null, null); | |
| 1112 | - } else if (Array.isArray(ref)) { | |
| 1113 | - outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); | |
| 1114 | - } else { | |
| 1115 | - outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); | |
| 1116 | - } | |
| 1117 | - } | |
| 1118 | - if (!enabled) { | |
| 1119 | - return EMPTY_OBJECT; | |
| 1120 | - } | |
| 1121 | - if (className !== void 0) { | |
| 1122 | - outProps.className = mergeClassNames(outProps.className, className); | |
| 1123 | - } | |
| 1124 | - if (style !== void 0) { | |
| 1125 | - outProps.style = mergeObjects(outProps.style, style); | |
| 1126 | - } | |
| 1127 | - return outProps; | |
| 1128 | - } | |
| 1129 | - function resolveRenderFunctionProps(props) { | |
| 1130 | - if (Array.isArray(props)) { | |
| 1131 | - return mergePropsN(props); | |
| 1132 | - } | |
| 1133 | - return mergeProps(void 0, props); | |
| 1134 | - } | |
| 1135 | - var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); | |
| 1136 | - var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; | |
| 1137 | - var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; | |
| 1138 | - function evaluateRenderProp(element, render, props, state) { | |
| 1139 | - if (render) { | |
| 1140 | - if (typeof render === "function") { | |
| 1141 | - if (true) { | |
| 1142 | - warnIfRenderPropLooksLikeComponent(render); | |
| 1143 | - } | |
| 1144 | - return render(props, state); | |
| 1145 | - } | |
| 1146 | - const mergedProps = mergeProps(props, render.props); | |
| 1147 | - 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 | - if (true) { | |
| 1154 | - if (!/* @__PURE__ */ React10.isValidElement(newElement)) { | |
| 1155 | - 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 | - } | |
| 1157 | - } | |
| 1158 | - return /* @__PURE__ */ React10.cloneElement(newElement, mergedProps); | |
| 1159 | - } | |
| 1160 | - if (element) { | |
| 1161 | - if (typeof element === "string") { | |
| 1162 | - return renderTag(element, props); | |
| 1163 | - } | |
| 1164 | - } | |
| 1165 | - throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); | |
| 1166 | - } | |
| 1167 | - function warnIfRenderPropLooksLikeComponent(renderFn) { | |
| 1168 | - const functionName = renderFn.name; | |
| 1169 | - if (functionName.length === 0) { | |
| 1170 | - return; | |
| 1171 | - } | |
| 1172 | - if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { | |
| 1173 | - return; | |
| 1174 | - } | |
| 1175 | - if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { | |
| 1176 | - return; | |
| 1177 | - } | |
| 1178 | - warn(`The \`render\` prop received a function named \`${functionName}\` that starts with an uppercase letter.`, "This usually means a React component was passed directly as `render={Component}`.", "Base UI calls `render` as a plain function, which can break the Rules of Hooks during reconciliation.", "If this is an intentional render callback, rename it to start with a lowercase letter.", "Use `render={<Component />}` or `render={(props) => <Component {...props} />}` instead.", "https://base-ui.com/r/invalid-render-prop"); | |
| 1179 | - } | |
| 1180 | - function renderTag(Tag, props) { | |
| 1181 | - if (Tag === "button") { | |
| 1182 | - return /* @__PURE__ */ (0, import_react.createElement)("button", { | |
| 1183 | - type: "button", | |
| 1184 | - ...props, | |
| 1185 | - key: props.key | |
| 1186 | - }); | |
| 1187 | - } | |
| 1188 | - if (Tag === "img") { | |
| 1189 | - return /* @__PURE__ */ (0, import_react.createElement)("img", { | |
| 1190 | - alt: "", | |
| 1191 | - ...props, | |
| 1192 | - key: props.key | |
| 1193 | - }); | |
| 1194 | - } | |
| 1195 | - return /* @__PURE__ */ React10.createElement(Tag, props); | |
| 1196 | - } | |
| 1197 | - | |
| 1198 | - // node_modules/@base-ui/utils/useId.mjs | |
| 1199 | - var React11 = __toESM(require_react(), 1); | |
| 1200 | - var globalId = 0; | |
| 1201 | - function useGlobalId(idOverride, prefix = "mui") { | |
| 1202 | - const [defaultId, setDefaultId] = React11.useState(idOverride); | |
| 1203 | - const id = idOverride || defaultId; | |
| 1204 | - React11.useEffect(() => { | |
| 1205 | - if (defaultId == null) { | |
| 1206 | - globalId += 1; | |
| 1207 | - setDefaultId(`${prefix}-${globalId}`); | |
| 1208 | - } | |
| 1209 | - }, [defaultId, prefix]); | |
| 1210 | - return id; | |
| 1211 | - } | |
| 1212 | - var maybeReactUseId = SafeReact.useId; | |
| 1213 | - function useId(idOverride, prefix) { | |
| 1214 | - if (maybeReactUseId !== void 0) { | |
| 1215 | - const reactId = maybeReactUseId(); | |
| 1216 | - return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId); | |
| 1217 | - } | |
| 1218 | - return useGlobalId(idOverride, prefix); | |
| 1219 | - } | |
| 1220 | - | |
| 1221 | - // node_modules/@base-ui/react/internals/useBaseUiId.mjs | |
| 1222 | - function useBaseUiId(idOverride) { | |
| 1223 | - return useId(idOverride, "base-ui"); | |
| 1224 | - } | |
| 1225 | - | |
| 1226 | - // node_modules/@base-ui/react/internals/reason-parts.mjs | |
| 1227 | - var reason_parts_exports = {}; | |
| 1228 | - __export(reason_parts_exports, { | |
| 1229 | - cancelOpen: () => cancelOpen, | |
| 1230 | - chipRemovePress: () => chipRemovePress, | |
| 1231 | - clearPress: () => clearPress, | |
| 1232 | - closePress: () => closePress, | |
| 1233 | - closeWatcher: () => closeWatcher, | |
| 1234 | - decrementPress: () => decrementPress, | |
| 1235 | - disabled: () => disabled, | |
| 1236 | - drag: () => drag, | |
| 1237 | - escapeKey: () => escapeKey, | |
| 1238 | - focusOut: () => focusOut, | |
| 1239 | - imperativeAction: () => imperativeAction, | |
| 1240 | - incrementPress: () => incrementPress, | |
| 1241 | - initial: () => initial, | |
| 1242 | - inputBlur: () => inputBlur, | |
| 1243 | - inputChange: () => inputChange, | |
| 1244 | - inputClear: () => inputClear, | |
| 1245 | - inputPaste: () => inputPaste, | |
| 1246 | - inputPress: () => inputPress, | |
| 1247 | - itemPress: () => itemPress, | |
| 1248 | - keyboard: () => keyboard, | |
| 1249 | - linkPress: () => linkPress, | |
| 1250 | - listNavigation: () => listNavigation, | |
| 1251 | - missing: () => missing, | |
| 1252 | - none: () => none, | |
| 1253 | - outsidePress: () => outsidePress, | |
| 1254 | - pointer: () => pointer, | |
| 1255 | - scrub: () => scrub, | |
| 1256 | - siblingOpen: () => siblingOpen, | |
| 1257 | - swipe: () => swipe, | |
| 1258 | - trackPress: () => trackPress, | |
| 1259 | - triggerFocus: () => triggerFocus, | |
| 1260 | - triggerHover: () => triggerHover, | |
| 1261 | - triggerPress: () => triggerPress, | |
| 1262 | - wheel: () => wheel, | |
| 1263 | - windowResize: () => windowResize | |
| 1264 | - }); | |
| 1265 | - var none = "none"; | |
| 1266 | - var triggerPress = "trigger-press"; | |
| 1267 | - var triggerHover = "trigger-hover"; | |
| 1268 | - var triggerFocus = "trigger-focus"; | |
| 1269 | - var outsidePress = "outside-press"; | |
| 1270 | - var itemPress = "item-press"; | |
| 1271 | - var closePress = "close-press"; | |
| 1272 | - var linkPress = "link-press"; | |
| 1273 | - var clearPress = "clear-press"; | |
| 1274 | - var chipRemovePress = "chip-remove-press"; | |
| 1275 | - var trackPress = "track-press"; | |
| 1276 | - var incrementPress = "increment-press"; | |
| 1277 | - var decrementPress = "decrement-press"; | |
| 1278 | - var inputChange = "input-change"; | |
| 1279 | - var inputClear = "input-clear"; | |
| 1280 | - var inputBlur = "input-blur"; | |
| 1281 | - var inputPaste = "input-paste"; | |
| 1282 | - var inputPress = "input-press"; | |
| 1283 | - var focusOut = "focus-out"; | |
| 1284 | - var escapeKey = "escape-key"; | |
| 1285 | - var closeWatcher = "close-watcher"; | |
| 1286 | - var listNavigation = "list-navigation"; | |
| 1287 | - var keyboard = "keyboard"; | |
| 1288 | - var pointer = "pointer"; | |
| 1289 | - var drag = "drag"; | |
| 1290 | - var wheel = "wheel"; | |
| 1291 | - var scrub = "scrub"; | |
| 1292 | - var cancelOpen = "cancel-open"; | |
| 1293 | - var siblingOpen = "sibling-open"; | |
| 1294 | - var disabled = "disabled"; | |
| 1295 | - var missing = "missing"; | |
| 1296 | - var initial = "initial"; | |
| 1297 | - var imperativeAction = "imperative-action"; | |
| 1298 | - var swipe = "swipe"; | |
| 1299 | - var windowResize = "window-resize"; | |
| 1300 | - | |
| 1301 | - // node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs | |
| 1302 | - function createChangeEventDetails(reason, event, trigger, customProperties) { | |
| 1303 | - let canceled = false; | |
| 1304 | - let allowPropagation = false; | |
| 1305 | - const custom = customProperties ?? EMPTY_OBJECT; | |
| 1306 | - const details = { | |
| 1307 | - reason, | |
| 1308 | - event: event ?? new Event("base-ui"), | |
| 1309 | - cancel() { | |
| 1310 | - canceled = true; | |
| 1311 | - }, | |
| 1312 | - allowPropagation() { | |
| 1313 | - allowPropagation = true; | |
| 1314 | - }, | |
| 1315 | - get isCanceled() { | |
| 1316 | - return canceled; | |
| 1317 | - }, | |
| 1318 | - get isPropagationAllowed() { | |
| 1319 | - return allowPropagation; | |
| 1320 | - }, | |
| 1321 | - trigger, | |
| 1322 | - ...custom | |
| 1323 | - }; | |
| 1324 | - return details; | |
| 1325 | - } | |
| 1326 | - | |
| 1327 | - // node_modules/@base-ui/react/internals/useTransitionStatus.mjs | |
| 1328 | - var React13 = __toESM(require_react(), 1); | |
| 1329 | - | |
| 1330 | - // node_modules/@base-ui/utils/useOnMount.mjs | |
| 1331 | - var React12 = __toESM(require_react(), 1); | |
| 1332 | - var EMPTY = []; | |
| 1333 | - function useOnMount(fn) { | |
| 1334 | - React12.useEffect(fn, EMPTY); | |
| 1335 | - } | |
| 1336 | - | |
| 1337 | - // node_modules/@base-ui/utils/useAnimationFrame.mjs | |
| 1338 | - var EMPTY2 = null; | |
| 1339 | - var LAST_RAF = globalThis.requestAnimationFrame; | |
| 1340 | - var Scheduler = class { | |
| 1341 | - /* This implementation uses an array as a backing data-structure for frame callbacks. | |
| 1342 | - * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it | |
| 1343 | - * never calls the native `cancelAnimationFrame` if there are no frames left. This can | |
| 1344 | - * be much more efficient if there is a call pattern that alterns as | |
| 1345 | - * "request-cancel-request-cancel-…". | |
| 1346 | - * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation | |
| 1347 | - * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ | |
| 1348 | - callbacks = []; | |
| 1349 | - callbacksCount = 0; | |
| 1350 | - nextId = 1; | |
| 1351 | - startId = 1; | |
| 1352 | - isScheduled = false; | |
| 1353 | - tick = (timestamp) => { | |
| 1354 | - this.isScheduled = false; | |
| 1355 | - const currentCallbacks = this.callbacks; | |
| 1356 | - const currentCallbacksCount = this.callbacksCount; | |
| 1357 | - this.callbacks = []; | |
| 1358 | - this.callbacksCount = 0; | |
| 1359 | - this.startId = this.nextId; | |
| 1360 | - if (currentCallbacksCount > 0) { | |
| 1361 | - for (let i = 0; i < currentCallbacks.length; i += 1) { | |
| 1362 | - currentCallbacks[i]?.(timestamp); | |
| 1363 | - } | |
| 1364 | - } | |
| 1365 | - }; | |
| 1366 | - request(fn) { | |
| 1367 | - const id = this.nextId; | |
| 1368 | - this.nextId += 1; | |
| 1369 | - this.callbacks.push(fn); | |
| 1370 | - this.callbacksCount += 1; | |
| 1371 | - const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); | |
| 1372 | - if (!this.isScheduled || didRAFChange) { | |
| 1373 | - requestAnimationFrame(this.tick); | |
| 1374 | - this.isScheduled = true; | |
| 1375 | - } | |
| 1376 | - return id; | |
| 1377 | - } | |
| 1378 | - cancel(id) { | |
| 1379 | - const index = id - this.startId; | |
| 1380 | - if (index < 0 || index >= this.callbacks.length) { | |
| 1381 | - return; | |
| 1382 | - } | |
| 1383 | - this.callbacks[index] = null; | |
| 1384 | - this.callbacksCount -= 1; | |
| 1385 | - } | |
| 1386 | - }; | |
| 1387 | - var scheduler = new Scheduler(); | |
| 1388 | - var AnimationFrame = class _AnimationFrame { | |
| 1389 | - static create() { | |
| 1390 | - return new _AnimationFrame(); | |
| 1391 | - } | |
| 1392 | - static request(fn) { | |
| 1393 | - return scheduler.request(fn); | |
| 1394 | - } | |
| 1395 | - static cancel(id) { | |
| 1396 | - return scheduler.cancel(id); | |
| 1397 | - } | |
| 1398 | - currentId = EMPTY2; | |
| 1399 | - /** | |
| 1400 | - * Executes `fn` after `delay`, clearing any previously scheduled call. | |
| 1401 | - */ | |
| 1402 | - request(fn) { | |
| 1403 | - this.cancel(); | |
| 1404 | - this.currentId = scheduler.request(() => { | |
| 1405 | - this.currentId = EMPTY2; | |
| 1406 | - fn(); | |
| 1407 | - }); | |
| 1408 | - } | |
| 1409 | - cancel = () => { | |
| 1410 | - if (this.currentId !== EMPTY2) { | |
| 1411 | - scheduler.cancel(this.currentId); | |
| 1412 | - this.currentId = EMPTY2; | |
| 1413 | - } | |
| 1414 | - }; | |
| 1415 | - disposeEffect = () => { | |
| 1416 | - return this.cancel; | |
| 1417 | - }; | |
| 1418 | - }; | |
| 1419 | - function useAnimationFrame() { | |
| 1420 | - const timeout = useRefWithInit(AnimationFrame.create).current; | |
| 1421 | - useOnMount(timeout.disposeEffect); | |
| 1422 | - return timeout; | |
| 1423 | - } | |
| 1424 | - | |
| 1425 | - // node_modules/@base-ui/react/internals/useTransitionStatus.mjs | |
| 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); | |
| 1429 | - if (open && !mounted) { | |
| 1430 | - setMounted(true); | |
| 1431 | - setTransitionStatus("starting"); | |
| 1432 | - } | |
| 1433 | - if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { | |
| 1434 | - setTransitionStatus("ending"); | |
| 1435 | - } | |
| 1436 | - if (!open && !mounted && transitionStatus === "ending") { | |
| 1437 | - setTransitionStatus(void 0); | |
| 1438 | - } | |
| 1439 | - useIsoLayoutEffect(() => { | |
| 1440 | - if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { | |
| 1441 | - const frame = AnimationFrame.request(() => { | |
| 1442 | - setTransitionStatus("ending"); | |
| 1443 | - }); | |
| 1444 | - return () => { | |
| 1445 | - AnimationFrame.cancel(frame); | |
| 1446 | - }; | |
| 1447 | - } | |
| 1448 | - return void 0; | |
| 1449 | - }, [open, mounted, transitionStatus, deferEndingState]); | |
| 1450 | - useIsoLayoutEffect(() => { | |
| 1451 | - if (!open || enableIdleState) { | |
| 1452 | - return void 0; | |
| 1453 | - } | |
| 1454 | - const frame = AnimationFrame.request(() => { | |
| 1455 | - setTransitionStatus(void 0); | |
| 1456 | - }); | |
| 1457 | - return () => { | |
| 1458 | - AnimationFrame.cancel(frame); | |
| 1459 | - }; | |
| 1460 | - }, [enableIdleState, open]); | |
| 1461 | - useIsoLayoutEffect(() => { | |
| 1462 | - if (!open || !enableIdleState) { | |
| 1463 | - return void 0; | |
| 1464 | - } | |
| 1465 | - if (open && mounted && transitionStatus !== "idle") { | |
| 1466 | - setTransitionStatus("starting"); | |
| 1467 | - } | |
| 1468 | - const frame = AnimationFrame.request(() => { | |
| 1469 | - setTransitionStatus("idle"); | |
| 1470 | - }); | |
| 1471 | - return () => { | |
| 1472 | - AnimationFrame.cancel(frame); | |
| 1473 | - }; | |
| 1474 | - }, [enableIdleState, open, mounted, transitionStatus]); | |
| 1475 | - return { | |
| 1476 | - mounted, | |
| 1477 | - setMounted, | |
| 1478 | - transitionStatus | |
| 1479 | - }; | |
| 1480 | - } | |
| 1481 | - | |
| 1482 | - // node_modules/@base-ui/react/internals/composite/list/useCompositeListItem.mjs | |
| 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 | - })({}); | |
| 1489 | - function useCompositeListItem(params = {}) { | |
| 1490 | - const { | |
| 1491 | - label, | |
| 1492 | - metadata, | |
| 1493 | - textRef, | |
| 1494 | - indexGuessBehavior, | |
| 1495 | - index: externalIndex | |
| 1496 | - } = params; | |
| 1497 | - const { | |
| 1498 | - register, | |
| 1499 | - unregister, | |
| 1500 | - subscribeMapChange, | |
| 1501 | - elementsRef, | |
| 1502 | - labelsRef, | |
| 1503 | - nextIndexRef | |
| 1504 | - } = useCompositeListContext(); | |
| 1505 | - const indexRef = React14.useRef(-1); | |
| 1506 | - const [index, setIndex] = React14.useState(externalIndex ?? (indexGuessBehavior === IndexGuessBehavior.GuessFromOrder ? () => { | |
| 1507 | - if (indexRef.current === -1) { | |
| 1508 | - const newIndex = nextIndexRef.current; | |
| 1509 | - nextIndexRef.current += 1; | |
| 1510 | - indexRef.current = newIndex; | |
| 1511 | - } | |
| 1512 | - return indexRef.current; | |
| 1513 | - } : -1)); | |
| 1514 | - const componentRef = React14.useRef(null); | |
| 1515 | - const ref = React14.useCallback((node) => { | |
| 1516 | - 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 | - if (node) { | |
| 1531 | - register(node, metadata); | |
| 1532 | - return () => { | |
| 1533 | - unregister(node); | |
| 1534 | - }; | |
| 1535 | - } | |
| 1536 | - return void 0; | |
| 1537 | - }, [externalIndex, register, unregister, metadata]); | |
| 1538 | - useIsoLayoutEffect(() => { | |
| 1539 | - if (externalIndex != null) { | |
| 1540 | - return void 0; | |
| 1541 | - } | |
| 1542 | - return subscribeMapChange((map) => { | |
| 1543 | - const i = componentRef.current ? map.get(componentRef.current)?.index : null; | |
| 1544 | - if (i != null) { | |
| 1545 | - setIndex(i); | |
| 1546 | - } | |
| 1547 | - }); | |
| 1548 | - }, [externalIndex, subscribeMapChange, setIndex]); | |
| 1549 | - return { | |
| 1550 | - ref, | |
| 1551 | - index | |
| 1552 | - }; | |
| 1553 | - } | |
| 1554 | - | |
| 1555 | - // node_modules/@base-ui/react/internals/stateAttributesMapping.mjs | |
| 1556 | - var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { | |
| 1557 | - TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; | |
| 1558 | - TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; | |
| 1559 | - return TransitionStatusDataAttributes2; | |
| 1560 | - })({}); | |
| 1561 | - var STARTING_HOOK = { | |
| 1562 | - [TransitionStatusDataAttributes.startingStyle]: "" | |
| 1563 | - }; | |
| 1564 | - var ENDING_HOOK = { | |
| 1565 | - [TransitionStatusDataAttributes.endingStyle]: "" | |
| 1566 | - }; | |
| 1567 | - var transitionStatusMapping = { | |
| 1568 | - transitionStatus(value) { | |
| 1569 | - if (value === "starting") { | |
| 1570 | - return STARTING_HOOK; | |
| 1571 | - } | |
| 1572 | - if (value === "ending") { | |
| 1573 | - return ENDING_HOOK; | |
| 1574 | - } | |
| 1575 | - return null; | |
| 1576 | - } | |
| 1577 | - }; | |
| 1578 | - | |
| 1579 | - // node_modules/@base-ui/react/internals/use-button/useButton.mjs | |
| 1580 | - var React17 = __toESM(require_react(), 1); | |
| 1581 | - | |
| 1582 | - // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs | |
| 1583 | - function hasWindow() { | |
| 1584 | - return typeof window !== "undefined"; | |
| 1585 | - } | |
| 1586 | - function getWindow(node) { | |
| 1587 | - var _node$ownerDocument; | |
| 1588 | - return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; | |
| 1589 | - } | |
| 1590 | - function isHTMLElement(value) { | |
| 1591 | - if (!hasWindow()) { | |
| 1592 | - return false; | |
| 1593 | - } | |
| 1594 | - return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; | |
| 1595 | - } | |
| 1596 | - function isShadowRoot(value) { | |
| 1597 | - if (!hasWindow() || typeof ShadowRoot === "undefined") { | |
| 1598 | - return false; | |
| 1599 | - } | |
| 1600 | - return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; | |
| 1601 | - } | |
| 1602 | - function getComputedStyle2(element) { | |
| 1603 | - return getWindow(element).getComputedStyle(element); | |
| 1604 | - } | |
| 1605 | - | |
| 1606 | - // node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs | |
| 1607 | - var React15 = __toESM(require_react(), 1); | |
| 1608 | - var CompositeRootContext = /* @__PURE__ */ React15.createContext(void 0); | |
| 1609 | - if (true) CompositeRootContext.displayName = "CompositeRootContext"; | |
| 1610 | - function useCompositeRootContext(optional = false) { | |
| 1611 | - const context = React15.useContext(CompositeRootContext); | |
| 1612 | - if (context === void 0 && !optional) { | |
| 1613 | - throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16)); | |
| 1614 | - } | |
| 1615 | - return context; | |
| 1616 | - } | |
| 1617 | - | |
| 1618 | - // node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs | |
| 1619 | - var React16 = __toESM(require_react(), 1); | |
| 1620 | - function useFocusableWhenDisabled(parameters) { | |
| 1621 | - const { | |
| 1622 | - focusableWhenDisabled, | |
| 1623 | - disabled: disabled2, | |
| 1624 | - composite = false, | |
| 1625 | - tabIndex: tabIndexProp = 0, | |
| 1626 | - isNativeButton | |
| 1627 | - } = parameters; | |
| 1628 | - const isFocusableComposite = composite && focusableWhenDisabled !== false; | |
| 1629 | - const isNonFocusableComposite = composite && focusableWhenDisabled === false; | |
| 1630 | - const props = React16.useMemo(() => { | |
| 1631 | - const additionalProps = { | |
| 1632 | - // allow Tabbing away from focusableWhenDisabled elements | |
| 1633 | - onKeyDown(event) { | |
| 1634 | - if (disabled2 && focusableWhenDisabled && event.key !== "Tab") { | |
| 1635 | - event.preventDefault(); | |
| 1636 | - } | |
| 1637 | - } | |
| 1638 | - }; | |
| 1639 | - if (!composite) { | |
| 1640 | - additionalProps.tabIndex = tabIndexProp; | |
| 1641 | - if (!isNativeButton && disabled2) { | |
| 1642 | - additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1; | |
| 1643 | - } | |
| 1644 | - } | |
| 1645 | - if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) { | |
| 1646 | - additionalProps["aria-disabled"] = disabled2; | |
| 1647 | - } | |
| 1648 | - if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) { | |
| 1649 | - additionalProps.disabled = disabled2; | |
| 1650 | - } | |
| 1651 | - return additionalProps; | |
| 1652 | - }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]); | |
| 1653 | - return { | |
| 1654 | - props | |
| 1655 | - }; | |
| 1656 | - } | |
| 1657 | - | |
| 1658 | - // node_modules/@base-ui/react/internals/use-button/useButton.mjs | |
| 1659 | - function useButton(parameters = {}) { | |
| 1660 | - const { | |
| 1661 | - disabled: disabled2 = false, | |
| 1662 | - focusableWhenDisabled, | |
| 1663 | - tabIndex = 0, | |
| 1664 | - native: isNativeButton = true, | |
| 1665 | - composite: compositeProp | |
| 1666 | - } = parameters; | |
| 1667 | - const elementRef = React17.useRef(null); | |
| 1668 | - const compositeRootContext = useCompositeRootContext(true); | |
| 1669 | - const isCompositeItem = compositeProp ?? compositeRootContext !== void 0; | |
| 1670 | - const { | |
| 1671 | - props: focusableWhenDisabledProps | |
| 1672 | - } = useFocusableWhenDisabled({ | |
| 1673 | - focusableWhenDisabled, | |
| 1674 | - disabled: disabled2, | |
| 1675 | - composite: isCompositeItem, | |
| 1676 | - tabIndex, | |
| 1677 | - isNativeButton | |
| 1678 | - }); | |
| 1679 | - if (true) { | |
| 1680 | - React17.useEffect(() => { | |
| 1681 | - if (!elementRef.current) { | |
| 1682 | - return; | |
| 1683 | - } | |
| 1684 | - const isButtonTag = isButtonElement(elementRef.current); | |
| 1685 | - if (isNativeButton) { | |
| 1686 | - if (!isButtonTag) { | |
| 1687 | - const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; | |
| 1688 | - const message = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`."; | |
| 1689 | - error(`${message}${ownerStackMessage}`); | |
| 1690 | - } | |
| 1691 | - } else if (isButtonTag) { | |
| 1692 | - const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; | |
| 1693 | - const message = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`."; | |
| 1694 | - error(`${message}${ownerStackMessage}`); | |
| 1695 | - } | |
| 1696 | - }, [isNativeButton]); | |
| 1697 | - } | |
| 1698 | - const updateDisabled = React17.useCallback(() => { | |
| 1699 | - const element = elementRef.current; | |
| 1700 | - if (!isButtonElement(element)) { | |
| 1701 | - return; | |
| 1702 | - } | |
| 1703 | - if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) { | |
| 1704 | - element.disabled = false; | |
| 1705 | - } | |
| 1706 | - }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]); | |
| 1707 | - useIsoLayoutEffect(updateDisabled, [updateDisabled]); | |
| 1708 | - const getButtonProps = React17.useCallback((externalProps = {}) => { | |
| 1709 | - const { | |
| 1710 | - onClick: externalOnClick, | |
| 1711 | - onMouseDown: externalOnMouseDown, | |
| 1712 | - onKeyUp: externalOnKeyUp, | |
| 1713 | - onKeyDown: externalOnKeyDown, | |
| 1714 | - onPointerDown: externalOnPointerDown, | |
| 1715 | - ...otherExternalProps | |
| 1716 | - } = externalProps; | |
| 1717 | - return mergeProps({ | |
| 1718 | - onClick(event) { | |
| 1719 | - if (disabled2) { | |
| 1720 | - event.preventDefault(); | |
| 1721 | - return; | |
| 1722 | - } | |
| 1723 | - externalOnClick?.(event); | |
| 1724 | - }, | |
| 1725 | - onMouseDown(event) { | |
| 1726 | - if (!disabled2) { | |
| 1727 | - externalOnMouseDown?.(event); | |
| 1728 | - } | |
| 1729 | - }, | |
| 1730 | - onKeyDown(event) { | |
| 1731 | - if (disabled2) { | |
| 1732 | - return; | |
| 1733 | - } | |
| 1734 | - makeEventPreventable(event); | |
| 1735 | - externalOnKeyDown?.(event); | |
| 1736 | - if (event.baseUIHandlerPrevented) { | |
| 1737 | - return; | |
| 1738 | - } | |
| 1739 | - const isCurrentTarget = event.target === event.currentTarget; | |
| 1740 | - const currentTarget = event.currentTarget; | |
| 1741 | - const isButton = isButtonElement(currentTarget); | |
| 1742 | - const isLink = !isNativeButton && isValidLinkElement(currentTarget); | |
| 1743 | - const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink); | |
| 1744 | - const isEnterKey = event.key === "Enter"; | |
| 1745 | - const isSpaceKey = event.key === " "; | |
| 1746 | - const role = currentTarget.getAttribute("role"); | |
| 1747 | - const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell"; | |
| 1748 | - if (isCurrentTarget && isCompositeItem && isSpaceKey) { | |
| 1749 | - if (event.defaultPrevented && isTextNavigationRole) { | |
| 1750 | - return; | |
| 1751 | - } | |
| 1752 | - event.preventDefault(); | |
| 1753 | - if (isLink || isNativeButton && isButton) { | |
| 1754 | - currentTarget.click(); | |
| 1755 | - event.preventBaseUIHandler(); | |
| 1756 | - } else if (shouldClick) { | |
| 1757 | - externalOnClick?.(event); | |
| 1758 | - event.preventBaseUIHandler(); | |
| 1759 | - } | |
| 1760 | - return; | |
| 1761 | - } | |
| 1762 | - if (shouldClick) { | |
| 1763 | - if (!isNativeButton && (isSpaceKey || isEnterKey)) { | |
| 1764 | - event.preventDefault(); | |
| 1765 | - } | |
| 1766 | - if (!isNativeButton && isEnterKey) { | |
| 1767 | - externalOnClick?.(event); | |
| 1768 | - } | |
| 1769 | - } | |
| 1770 | - }, | |
| 1771 | - onKeyUp(event) { | |
| 1772 | - if (disabled2) { | |
| 1773 | - return; | |
| 1774 | - } | |
| 1775 | - makeEventPreventable(event); | |
| 1776 | - externalOnKeyUp?.(event); | |
| 1777 | - if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") { | |
| 1778 | - event.preventDefault(); | |
| 1779 | - return; | |
| 1780 | - } | |
| 1781 | - if (event.baseUIHandlerPrevented) { | |
| 1782 | - return; | |
| 1783 | - } | |
| 1784 | - if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === " ") { | |
| 1785 | - externalOnClick?.(event); | |
| 1786 | - } | |
| 1787 | - }, | |
| 1788 | - onPointerDown(event) { | |
| 1789 | - if (disabled2) { | |
| 1790 | - event.preventDefault(); | |
| 1791 | - return; | |
| 1792 | - } | |
| 1793 | - externalOnPointerDown?.(event); | |
| 1794 | - } | |
| 1795 | - }, isNativeButton ? { | |
| 1796 | - type: "button" | |
| 1797 | - } : { | |
| 1798 | - role: "button" | |
| 1799 | - }, focusableWhenDisabledProps, otherExternalProps); | |
| 1800 | - }, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]); | |
| 1801 | - const buttonRef = useStableCallback((element) => { | |
| 1802 | - elementRef.current = element; | |
| 1803 | - updateDisabled(); | |
| 1804 | - }); | |
| 1805 | - return { | |
| 1806 | - getButtonProps, | |
| 1807 | - buttonRef | |
| 1808 | - }; | |
| 1809 | - } | |
| 1810 | - function isButtonElement(elem) { | |
| 1811 | - return isHTMLElement(elem) && elem.tagName === "BUTTON"; | |
| 1812 | - } | |
| 1813 | - function isValidLinkElement(elem) { | |
| 1814 | - return Boolean(elem?.tagName === "A" && elem?.href); | |
| 1815 | - } | |
| 1816 | - | |
| 1817 | - // node_modules/@base-ui/utils/owner.mjs | |
| 1818 | - function ownerDocument(node) { | |
| 1819 | - return node?.ownerDocument || document; | |
| 1820 | - } | |
| 1821 | - | |
| 1822 | - // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs | |
| 1823 | - var React18 = __toESM(require_react(), 1); | |
| 1824 | - | |
| 1825 | - // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs | |
| 1826 | - var ReactDOM = __toESM(require_react_dom(), 1); | |
| 1827 | - | |
| 1828 | - // node_modules/@base-ui/react/utils/resolveRef.mjs | |
| 1829 | - function resolveRef(maybeRef) { | |
| 1830 | - if (maybeRef == null) { | |
| 1831 | - return maybeRef; | |
| 1832 | - } | |
| 1833 | - return "current" in maybeRef ? maybeRef.current : maybeRef; | |
| 1834 | - } | |
| 1835 | - | |
| 1836 | - // node_modules/@base-ui/react/internals/useAnimationsFinished.mjs | |
| 1837 | - function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) { | |
| 1838 | - const frame = useAnimationFrame(); | |
| 1839 | - return useStableCallback((fnToExecute, signal = null) => { | |
| 1840 | - frame.cancel(); | |
| 1841 | - const element = resolveRef(elementOrRef); | |
| 1842 | - if (element == null) { | |
| 1843 | - return; | |
| 1844 | - } | |
| 1845 | - const resolvedElement = element; | |
| 1846 | - const done = () => { | |
| 1847 | - ReactDOM.flushSync(fnToExecute); | |
| 1848 | - }; | |
| 1849 | - if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { | |
| 1850 | - fnToExecute(); | |
| 1851 | - return; | |
| 1852 | - } | |
| 1853 | - function exec() { | |
| 1854 | - Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { | |
| 1855 | - if (!signal?.aborted) { | |
| 1856 | - done(); | |
| 1857 | - } | |
| 1858 | - }).catch(() => { | |
| 1859 | - if (treatAbortedAsFinished) { | |
| 1860 | - if (!signal?.aborted) { | |
| 1861 | - done(); | |
| 1862 | - } | |
| 1863 | - return; | |
| 1864 | - } | |
| 1865 | - const currentAnimations = resolvedElement.getAnimations(); | |
| 1866 | - if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { | |
| 1867 | - exec(); | |
| 1868 | - } | |
| 1869 | - }); | |
| 1870 | - } | |
| 1871 | - if (waitForStartingStyleRemoved) { | |
| 1872 | - const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle; | |
| 1873 | - if (!resolvedElement.hasAttribute(startingStyleAttribute)) { | |
| 1874 | - frame.request(exec); | |
| 1875 | - return; | |
| 1876 | - } | |
| 1877 | - const attributeObserver = new MutationObserver(() => { | |
| 1878 | - if (!resolvedElement.hasAttribute(startingStyleAttribute)) { | |
| 1879 | - attributeObserver.disconnect(); | |
| 1880 | - exec(); | |
| 1881 | - } | |
| 1882 | - }); | |
| 1883 | - attributeObserver.observe(resolvedElement, { | |
| 1884 | - attributes: true, | |
| 1885 | - attributeFilter: [startingStyleAttribute] | |
| 1886 | - }); | |
| 1887 | - signal?.addEventListener("abort", () => attributeObserver.disconnect(), { | |
| 1888 | - once: true | |
| 1889 | - }); | |
| 1890 | - return; | |
| 1891 | - } | |
| 1892 | - frame.request(exec); | |
| 1893 | - }); | |
| 1894 | - } | |
| 1895 | - | |
| 1896 | - // node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs | |
| 1897 | - function useOpenChangeComplete(parameters) { | |
| 1898 | - const { | |
| 1899 | - enabled = true, | |
| 1900 | - open, | |
| 1901 | - ref, | |
| 1902 | - onComplete: onCompleteParam | |
| 1903 | - } = parameters; | |
| 1904 | - const onComplete = useStableCallback(onCompleteParam); | |
| 1905 | - const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false); | |
| 1906 | - React18.useEffect(() => { | |
| 1907 | - if (!enabled) { | |
| 1908 | - return void 0; | |
| 1909 | - } | |
| 1910 | - const abortController = new AbortController(); | |
| 1911 | - runOnceAnimationsFinish(onComplete, abortController.signal); | |
| 1912 | - return () => { | |
| 1913 | - abortController.abort(); | |
| 1914 | - }; | |
| 1915 | - }, [enabled, open, onComplete, runOnceAnimationsFinish]); | |
| 1916 | - } | |
| 1917 | - | |
| 1918 | - // node_modules/@base-ui/react/internals/shadowDom.mjs | |
| 1919 | - function activeElement(doc) { | |
| 1920 | - let element = doc.activeElement; | |
| 1921 | - while (element?.shadowRoot?.activeElement != null) { | |
| 1922 | - element = element.shadowRoot.activeElement; | |
| 1923 | - } | |
| 1924 | - return element; | |
| 1925 | - } | |
| 1926 | - function contains(parent, child) { | |
| 1927 | - if (!parent || !child) { | |
| 1928 | - return false; | |
| 1929 | - } | |
| 1930 | - const rootNode = child.getRootNode?.(); | |
| 1931 | - if (parent.contains(child)) { | |
| 1932 | - return true; | |
| 1933 | - } | |
| 1934 | - if (rootNode && isShadowRoot(rootNode)) { | |
| 1935 | - let next = child; | |
| 1936 | - while (next) { | |
| 1937 | - if (parent === next) { | |
| 1938 | - return true; | |
| 1939 | - } | |
| 1940 | - next = next.parentNode || next.host; | |
| 1941 | - } | |
| 1942 | - } | |
| 1943 | - return false; | |
| 1944 | - } | |
| 1945 | - function getTarget(event) { | |
| 1946 | - if ("composedPath" in event) { | |
| 1947 | - return event.composedPath()[0]; | |
| 1948 | - } | |
| 1949 | - return event.target; | |
| 1950 | - } | |
| 1951 | - | |
| 1952 | - // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs | |
| 1953 | - var round = Math.round; | |
| 1954 | - | |
| 1955 | - // node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs | |
| 1956 | - function isIndexOutOfListBounds(list, index) { | |
| 1957 | - return index < 0 || index >= list.length; | |
| 1958 | - } | |
| 1959 | - function getMinListIndex(listRef, disabledIndices) { | |
| 1960 | - return findNonDisabledListIndex(listRef.current, { | |
| 1961 | - disabledIndices | |
| 1962 | - }); | |
| 1963 | - } | |
| 1964 | - function getMaxListIndex(listRef, disabledIndices) { | |
| 1965 | - return findNonDisabledListIndex(listRef.current, { | |
| 1966 | - decrement: true, | |
| 1967 | - startingIndex: listRef.current.length, | |
| 1968 | - disabledIndices | |
| 1969 | - }); | |
| 1970 | - } | |
| 1971 | - function findNonDisabledListIndex(list, { | |
| 1972 | - startingIndex = -1, | |
| 1973 | - decrement = false, | |
| 1974 | - disabledIndices, | |
| 1975 | - amount = 1 | |
| 1976 | - } = {}) { | |
| 1977 | - let index = startingIndex; | |
| 1978 | - do { | |
| 1979 | - index += decrement ? -amount : amount; | |
| 1980 | - } while (index >= 0 && index <= list.length - 1 && isListIndexDisabled(list, index, disabledIndices)); | |
| 1981 | - return index; | |
| 1982 | - } | |
| 1983 | - function isListIndexDisabled(list, index, disabledIndices) { | |
| 1984 | - const isExplicitlyDisabled = typeof disabledIndices === "function" ? disabledIndices(index) : disabledIndices?.includes(index) ?? false; | |
| 1985 | - if (isExplicitlyDisabled) { | |
| 1986 | - return true; | |
| 1987 | - } | |
| 1988 | - const element = list[index]; | |
| 1989 | - if (!element) { | |
| 1990 | - return false; | |
| 1991 | - } | |
| 1992 | - if (!isElementVisible(element)) { | |
| 1993 | - return true; | |
| 1994 | - } | |
| 1995 | - return !disabledIndices && (element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true"); | |
| 1996 | - } | |
| 1997 | - function isHiddenByStyles(styles) { | |
| 1998 | - return styles.visibility === "hidden" || styles.visibility === "collapse"; | |
| 1999 | - } | |
| 2000 | - function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { | |
| 2001 | - if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { | |
| 2002 | - return false; | |
| 2003 | - } | |
| 2004 | - if (typeof element.checkVisibility === "function") { | |
| 2005 | - return element.checkVisibility(); | |
| 2006 | - } | |
| 2007 | - return styles.display !== "none" && styles.display !== "contents"; | |
| 2008 | - } | |
| 2009 | - | |
| 2010 | - // node_modules/@base-ui/utils/useForcedRerendering.mjs | |
| 2011 | - var React19 = __toESM(require_react(), 1); | |
| 2012 | - function useForcedRerendering() { | |
| 2013 | - const [, setState] = React19.useState({}); | |
| 2014 | - return React19.useCallback(() => { | |
| 2015 | - setState({}); | |
| 2016 | - }, []); | |
| 2017 | - } | |
| 2018 | - | |
| 2019 | - // node_modules/@base-ui/react/internals/composite/composite.mjs | |
| 2020 | - var ARROW_UP = "ArrowUp"; | |
| 2021 | - var ARROW_DOWN = "ArrowDown"; | |
| 2022 | - var ARROW_LEFT = "ArrowLeft"; | |
| 2023 | - var ARROW_RIGHT = "ArrowRight"; | |
| 2024 | - var HOME = "Home"; | |
| 2025 | - var END = "End"; | |
| 2026 | - var HORIZONTAL_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT, ARROW_RIGHT]); | |
| 2027 | - var HORIZONTAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_LEFT, ARROW_RIGHT, HOME, END]); | |
| 2028 | - var VERTICAL_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN]); | |
| 2029 | - var VERTICAL_KEYS_WITH_EXTRA_KEYS = /* @__PURE__ */ new Set([ARROW_UP, ARROW_DOWN, HOME, END]); | |
| 2030 | - var ARROW_KEYS = /* @__PURE__ */ new Set([...HORIZONTAL_KEYS, ...VERTICAL_KEYS]); | |
| 2031 | - var COMPOSITE_KEYS = /* @__PURE__ */ new Set([...ARROW_KEYS, HOME, END]); | |
| 2032 | - var SHIFT = "Shift"; | |
| 2033 | - var CONTROL = "Control"; | |
| 2034 | - var ALT = "Alt"; | |
| 2035 | - var META = "Meta"; | |
| 2036 | - var MODIFIER_KEYS = /* @__PURE__ */ new Set([SHIFT, CONTROL, ALT, META]); | |
| 2037 | - function isInputElement(element) { | |
| 2038 | - return isHTMLElement(element) && element.tagName === "INPUT"; | |
| 2039 | - } | |
| 2040 | - function isNativeInput(element) { | |
| 2041 | - if (isInputElement(element) && element.selectionStart != null) { | |
| 2042 | - return true; | |
| 2043 | - } | |
| 2044 | - if (isHTMLElement(element) && element.tagName === "TEXTAREA") { | |
| 2045 | - return true; | |
| 2046 | - } | |
| 2047 | - return false; | |
| 2048 | - } | |
| 2049 | - function scrollIntoViewIfNeeded(scrollContainer, element, direction, orientation) { | |
| 2050 | - if (!scrollContainer || !element || !element.scrollTo) { | |
| 2051 | - return; | |
| 2052 | - } | |
| 2053 | - let targetX = scrollContainer.scrollLeft; | |
| 2054 | - let targetY = scrollContainer.scrollTop; | |
| 2055 | - const isOverflowingX = scrollContainer.clientWidth < scrollContainer.scrollWidth; | |
| 2056 | - const isOverflowingY = scrollContainer.clientHeight < scrollContainer.scrollHeight; | |
| 2057 | - if (isOverflowingX && orientation !== "vertical") { | |
| 2058 | - const elementOffsetLeft = getOffset(scrollContainer, element, "left"); | |
| 2059 | - const containerStyles = getStyles(scrollContainer); | |
| 2060 | - const elementStyles = getStyles(element); | |
| 2061 | - if (direction === "ltr") { | |
| 2062 | - if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) { | |
| 2063 | - targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight; | |
| 2064 | - } else if (elementOffsetLeft - elementStyles.scrollMarginLeft < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) { | |
| 2065 | - targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft; | |
| 2066 | - } | |
| 2067 | - } | |
| 2068 | - if (direction === "rtl") { | |
| 2069 | - if (elementOffsetLeft - elementStyles.scrollMarginRight < scrollContainer.scrollLeft + containerStyles.scrollPaddingLeft) { | |
| 2070 | - targetX = elementOffsetLeft - elementStyles.scrollMarginLeft - containerStyles.scrollPaddingLeft; | |
| 2071 | - } else if (elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight > scrollContainer.scrollLeft + scrollContainer.clientWidth - containerStyles.scrollPaddingRight) { | |
| 2072 | - targetX = elementOffsetLeft + element.offsetWidth + elementStyles.scrollMarginRight - scrollContainer.clientWidth + containerStyles.scrollPaddingRight; | |
| 2073 | - } | |
| 2074 | - } | |
| 2075 | - } | |
| 2076 | - if (isOverflowingY && orientation !== "horizontal") { | |
| 2077 | - const elementOffsetTop = getOffset(scrollContainer, element, "top"); | |
| 2078 | - const containerStyles = getStyles(scrollContainer); | |
| 2079 | - const elementStyles = getStyles(element); | |
| 2080 | - if (elementOffsetTop - elementStyles.scrollMarginTop < scrollContainer.scrollTop + containerStyles.scrollPaddingTop) { | |
| 2081 | - targetY = elementOffsetTop - elementStyles.scrollMarginTop - containerStyles.scrollPaddingTop; | |
| 2082 | - } else if (elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom > scrollContainer.scrollTop + scrollContainer.clientHeight - containerStyles.scrollPaddingBottom) { | |
| 2083 | - targetY = elementOffsetTop + element.offsetHeight + elementStyles.scrollMarginBottom - scrollContainer.clientHeight + containerStyles.scrollPaddingBottom; | |
| 2084 | - } | |
| 2085 | - } | |
| 2086 | - scrollContainer.scrollTo({ | |
| 2087 | - left: targetX, | |
| 2088 | - top: targetY, | |
| 2089 | - behavior: "auto" | |
| 2090 | - }); | |
| 2091 | - } | |
| 2092 | - function getOffset(ancestor, element, side) { | |
| 2093 | - const propName = side === "left" ? "offsetLeft" : "offsetTop"; | |
| 2094 | - let result = 0; | |
| 2095 | - while (element.offsetParent) { | |
| 2096 | - result += element[propName]; | |
| 2097 | - if (element.offsetParent === ancestor) { | |
| 2098 | - break; | |
| 2099 | - } | |
| 2100 | - element = element.offsetParent; | |
| 2101 | - } | |
| 2102 | - return result; | |
| 2103 | - } | |
| 2104 | - function getStyles(element) { | |
| 2105 | - const styles = getComputedStyle(element); | |
| 2106 | - return { | |
| 2107 | - scrollMarginTop: parseFloat(styles.scrollMarginTop) || 0, | |
| 2108 | - scrollMarginRight: parseFloat(styles.scrollMarginRight) || 0, | |
| 2109 | - scrollMarginBottom: parseFloat(styles.scrollMarginBottom) || 0, | |
| 2110 | - scrollMarginLeft: parseFloat(styles.scrollMarginLeft) || 0, | |
| 2111 | - scrollPaddingTop: parseFloat(styles.scrollPaddingTop) || 0, | |
| 2112 | - scrollPaddingRight: parseFloat(styles.scrollPaddingRight) || 0, | |
| 2113 | - scrollPaddingBottom: parseFloat(styles.scrollPaddingBottom) || 0, | |
| 2114 | - scrollPaddingLeft: parseFloat(styles.scrollPaddingLeft) || 0 | |
| 2115 | - }; | |
| 2116 | - } | |
| 2117 | - | |
| 2118 | - // node_modules/@base-ui/utils/inertValue.mjs | |
| 2119 | - function inertValue(value) { | |
| 2120 | - if (isReactVersionAtLeast(19)) { | |
| 2121 | - return value; | |
| 2122 | - } | |
| 2123 | - return value ? "true" : void 0; | |
| 2124 | - } | |
| 2125 | - | |
| 2126 | - // node_modules/@base-ui/react/internals/composite/item/useCompositeItem.mjs | |
| 2127 | - var React20 = __toESM(require_react(), 1); | |
| 2128 | - function useCompositeItem(params = {}) { | |
| 2129 | - const { | |
| 2130 | - highlightItemOnHover, | |
| 2131 | - highlightedIndex, | |
| 2132 | - onHighlightedIndexChange | |
| 2133 | - } = useCompositeRootContext(); | |
| 2134 | - const { | |
| 2135 | - ref, | |
| 2136 | - index | |
| 2137 | - } = useCompositeListItem(params); | |
| 2138 | - const isHighlighted = highlightedIndex === index; | |
| 2139 | - const itemRef = React20.useRef(null); | |
| 2140 | - const mergedRef = useMergedRefs(ref, itemRef); | |
| 2141 | - const compositeProps = { | |
| 2142 | - tabIndex: isHighlighted ? 0 : -1, | |
| 2143 | - onFocus() { | |
| 2144 | - onHighlightedIndexChange(index); | |
| 2145 | - }, | |
| 2146 | - onMouseMove() { | |
| 2147 | - const item = itemRef.current; | |
| 2148 | - if (!highlightItemOnHover || !item) { | |
| 2149 | - return; | |
| 2150 | - } | |
| 2151 | - const disabled2 = item.hasAttribute("disabled") || item.ariaDisabled === "true"; | |
| 2152 | - if (!isHighlighted && !disabled2) { | |
| 2153 | - item.focus(); | |
| 2154 | - } | |
| 2155 | - } | |
| 2156 | - }; | |
| 2157 | - return { | |
| 2158 | - compositeProps, | |
| 2159 | - compositeRef: mergedRef, | |
| 2160 | - index | |
| 2161 | - }; | |
| 2162 | - } | |
| 2163 | - | |
| 2164 | - // node_modules/@base-ui/react/utils/getCssDimensions.mjs | |
| 2165 | - function getCssDimensions(element) { | |
| 2166 | - const css = getComputedStyle2(element); | |
| 2167 | - let width = parseFloat(css.width) || 0; | |
| 2168 | - let height = parseFloat(css.height) || 0; | |
| 2169 | - const hasOffset = isHTMLElement(element); | |
| 2170 | - const offsetWidth = hasOffset ? element.offsetWidth : width; | |
| 2171 | - const offsetHeight = hasOffset ? element.offsetHeight : height; | |
| 2172 | - const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; | |
| 2173 | - if (shouldFallback) { | |
| 2174 | - width = offsetWidth; | |
| 2175 | - height = offsetHeight; | |
| 2176 | - } | |
| 2177 | - return { | |
| 2178 | - width, | |
| 2179 | - height | |
| 2180 | - }; | |
| 2181 | - } | |
| 2182 | - | |
| 2183 | - // node_modules/@base-ui/utils/isElementDisabled.mjs | |
| 2184 | - function isElementDisabled(element) { | |
| 2185 | - return element == null || element.hasAttribute("disabled") || element.getAttribute("aria-disabled") === "true"; | |
| 2186 | - } | |
| 2187 | - | |
| 2188 | - // node_modules/@base-ui/react/internals/csp-context/CSPContext.mjs | |
| 2189 | - var React21 = __toESM(require_react(), 1); | |
| 2190 | - var CSPContext = /* @__PURE__ */ React21.createContext(void 0); | |
| 2191 | - if (true) CSPContext.displayName = "CSPContext"; | |
| 2192 | - var DEFAULT_CSP_CONTEXT_VALUE = { | |
| 2193 | - disableStyleElements: false | |
| 2194 | - }; | |
| 2195 | - function useCSPContext() { | |
| 2196 | - return React21.useContext(CSPContext) ?? DEFAULT_CSP_CONTEXT_VALUE; | |
| 2197 | - } | |
| 2198 | - | |
| 2199 | - // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs | |
| 2200 | - var React23 = __toESM(require_react(), 1); | |
| 2201 | - | |
| 2202 | - // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs | |
| 2203 | - var React22 = __toESM(require_react(), 1); | |
| 2204 | - | |
| 2205 | - // node_modules/@base-ui/react/internals/composite/constants.mjs | |
| 2206 | - var ACTIVE_COMPOSITE_ITEM = "data-composite-item-active"; | |
| 2207 | - | |
| 2208 | - // node_modules/@base-ui/react/internals/composite/root/useCompositeRoot.mjs | |
| 2209 | - var EMPTY_ARRAY2 = []; | |
| 2210 | - function useCompositeRoot(params) { | |
| 2211 | - const { | |
| 2212 | - loopFocus = true, | |
| 2213 | - orientation = "both", | |
| 2214 | - grid, | |
| 2215 | - onLoop, | |
| 2216 | - direction, | |
| 2217 | - highlightedIndex: externalHighlightedIndex, | |
| 2218 | - onHighlightedIndexChange: externalSetHighlightedIndex, | |
| 2219 | - rootRef: externalRef, | |
| 2220 | - enableHomeAndEndKeys = false, | |
| 2221 | - stopEventPropagation = false, | |
| 2222 | - disabledIndices, | |
| 2223 | - modifierKeys = EMPTY_ARRAY2 | |
| 2224 | - } = params; | |
| 2225 | - const [internalHighlightedIndex, internalSetHighlightedIndex] = React22.useState(0); | |
| 2226 | - const isGrid = grid != null; | |
| 2227 | - const rootRef = React22.useRef(null); | |
| 2228 | - const mergedRef = useMergedRefs(rootRef, externalRef); | |
| 2229 | - const elementsRef = React22.useRef([]); | |
| 2230 | - const hasSetDefaultIndexRef = React22.useRef(false); | |
| 2231 | - const highlightedIndex = externalHighlightedIndex ?? internalHighlightedIndex; | |
| 2232 | - const onHighlightedIndexChange = useStableCallback((index, shouldScrollIntoView = false) => { | |
| 2233 | - (externalSetHighlightedIndex ?? internalSetHighlightedIndex)(index); | |
| 2234 | - if (shouldScrollIntoView) { | |
| 2235 | - const newActiveItem = elementsRef.current[index]; | |
| 2236 | - scrollIntoViewIfNeeded(rootRef.current, newActiveItem, direction, orientation); | |
| 2237 | - } | |
| 2238 | - }); | |
| 2239 | - const onMapChange = useStableCallback((map) => { | |
| 2240 | - if (map.size === 0 || hasSetDefaultIndexRef.current) { | |
| 2241 | - return; | |
| 2242 | - } | |
| 2243 | - hasSetDefaultIndexRef.current = true; | |
| 2244 | - const sortedElements = Array.from(map.keys()); | |
| 2245 | - const activeItem = sortedElements.find((compositeElement) => compositeElement?.hasAttribute(ACTIVE_COMPOSITE_ITEM)) ?? null; | |
| 2246 | - const activeIndex = activeItem ? sortedElements.indexOf(activeItem) : -1; | |
| 2247 | - if (activeIndex !== -1) { | |
| 2248 | - onHighlightedIndexChange(activeIndex); | |
| 2249 | - } else if (isListIndexDisabled(sortedElements, highlightedIndex, disabledIndices)) { | |
| 2250 | - const firstEnabledIndex = findNonDisabledListIndex(sortedElements, { | |
| 2251 | - disabledIndices | |
| 2252 | - }); | |
| 2253 | - if (!isIndexOutOfListBounds(sortedElements, firstEnabledIndex)) { | |
| 2254 | - onHighlightedIndexChange(firstEnabledIndex); | |
| 2255 | - } | |
| 2256 | - } | |
| 2257 | - scrollIntoViewIfNeeded(rootRef.current, activeItem, direction, orientation); | |
| 2258 | - }); | |
| 2259 | - useIsoLayoutEffect(() => { | |
| 2260 | - if (disabledIndices == null || externalHighlightedIndex != null || !hasSetDefaultIndexRef.current) { | |
| 2261 | - return; | |
| 2262 | - } | |
| 2263 | - const elements = elementsRef.current; | |
| 2264 | - if (isListIndexDisabled(elements, highlightedIndex, disabledIndices)) { | |
| 2265 | - const firstEnabledIndex = findNonDisabledListIndex(elements, { | |
| 2266 | - disabledIndices | |
| 2267 | - }); | |
| 2268 | - if (!isIndexOutOfListBounds(elements, firstEnabledIndex)) { | |
| 2269 | - onHighlightedIndexChange(firstEnabledIndex); | |
| 2270 | - } | |
| 2271 | - } | |
| 2272 | - }, [disabledIndices, externalHighlightedIndex, highlightedIndex, elementsRef, onHighlightedIndexChange]); | |
| 2273 | - const wrappedOnLoop = useStableCallback((event, prevIndex, nextIndex) => { | |
| 2274 | - if (!onLoop) { | |
| 2275 | - return nextIndex; | |
| 2276 | - } | |
| 2277 | - return onLoop(event, prevIndex, nextIndex, elementsRef); | |
| 2278 | - }); | |
| 2279 | - const onKeyDown = useStableCallback((event) => { | |
| 2280 | - const RELEVANT_KEYS = enableHomeAndEndKeys ? COMPOSITE_KEYS : ARROW_KEYS; | |
| 2281 | - if (!RELEVANT_KEYS.has(event.key)) { | |
| 2282 | - return; | |
| 2283 | - } | |
| 2284 | - if (isModifierKeySet(event, modifierKeys)) { | |
| 2285 | - return; | |
| 2286 | - } | |
| 2287 | - const element = rootRef.current; | |
| 2288 | - if (!element) { | |
| 2289 | - return; | |
| 2290 | - } | |
| 2291 | - const isRtl = direction === "rtl"; | |
| 2292 | - const horizontalForwardKey = isRtl ? ARROW_LEFT : ARROW_RIGHT; | |
| 2293 | - const forwardKey = { | |
| 2294 | - horizontal: horizontalForwardKey, | |
| 2295 | - vertical: ARROW_DOWN, | |
| 2296 | - both: horizontalForwardKey | |
| 2297 | - }[orientation]; | |
| 2298 | - const horizontalBackwardKey = isRtl ? ARROW_RIGHT : ARROW_LEFT; | |
| 2299 | - const backwardKey = { | |
| 2300 | - horizontal: horizontalBackwardKey, | |
| 2301 | - vertical: ARROW_UP, | |
| 2302 | - both: horizontalBackwardKey | |
| 2303 | - }[orientation]; | |
| 2304 | - const target = getTarget(event.nativeEvent); | |
| 2305 | - if (target != null && isNativeInput(target) && !isElementDisabled(target)) { | |
| 2306 | - const selectionStart = target.selectionStart; | |
| 2307 | - const selectionEnd = target.selectionEnd; | |
| 2308 | - const textContent = target.value ?? ""; | |
| 2309 | - if (selectionStart == null || event.shiftKey || selectionStart !== selectionEnd) { | |
| 2310 | - return; | |
| 2311 | - } | |
| 2312 | - if (event.key !== backwardKey && selectionStart < textContent.length) { | |
| 2313 | - return; | |
| 2314 | - } | |
| 2315 | - if (event.key !== forwardKey && selectionStart > 0) { | |
| 2316 | - return; | |
| 2317 | - } | |
| 2318 | - } | |
| 2319 | - let nextIndex = highlightedIndex; | |
| 2320 | - const minIndex = getMinListIndex(elementsRef, disabledIndices); | |
| 2321 | - const maxIndex = getMaxListIndex(elementsRef, disabledIndices); | |
| 2322 | - if (grid != null) { | |
| 2323 | - nextIndex = grid({ | |
| 2324 | - disabledIndices, | |
| 2325 | - elementsRef, | |
| 2326 | - event, | |
| 2327 | - highlightedIndex, | |
| 2328 | - loopFocus, | |
| 2329 | - maxIndex, | |
| 2330 | - minIndex, | |
| 2331 | - onLoop: wrappedOnLoop, | |
| 2332 | - orientation, | |
| 2333 | - rtl: isRtl | |
| 2334 | - }); | |
| 2335 | - } | |
| 2336 | - const forwardKeys = { | |
| 2337 | - horizontal: [horizontalForwardKey], | |
| 2338 | - vertical: [ARROW_DOWN], | |
| 2339 | - both: [horizontalForwardKey, ARROW_DOWN] | |
| 2340 | - }[orientation]; | |
| 2341 | - const backwardKeys = { | |
| 2342 | - horizontal: [horizontalBackwardKey], | |
| 2343 | - vertical: [ARROW_UP], | |
| 2344 | - both: [horizontalBackwardKey, ARROW_UP] | |
| 2345 | - }[orientation]; | |
| 2346 | - const preventedKeys = isGrid ? RELEVANT_KEYS : { | |
| 2347 | - horizontal: enableHomeAndEndKeys ? HORIZONTAL_KEYS_WITH_EXTRA_KEYS : HORIZONTAL_KEYS, | |
| 2348 | - vertical: enableHomeAndEndKeys ? VERTICAL_KEYS_WITH_EXTRA_KEYS : VERTICAL_KEYS, | |
| 2349 | - both: RELEVANT_KEYS | |
| 2350 | - }[orientation]; | |
| 2351 | - if (enableHomeAndEndKeys) { | |
| 2352 | - if (event.key === HOME) { | |
| 2353 | - nextIndex = minIndex; | |
| 2354 | - } else if (event.key === END) { | |
| 2355 | - nextIndex = maxIndex; | |
| 2356 | - } | |
| 2357 | - } | |
| 2358 | - if (nextIndex === highlightedIndex && (forwardKeys.includes(event.key) || backwardKeys.includes(event.key))) { | |
| 2359 | - if (loopFocus && nextIndex === maxIndex && forwardKeys.includes(event.key)) { | |
| 2360 | - nextIndex = minIndex; | |
| 2361 | - if (onLoop) { | |
| 2362 | - nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef); | |
| 2363 | - } | |
| 2364 | - } else if (loopFocus && nextIndex === minIndex && backwardKeys.includes(event.key)) { | |
| 2365 | - nextIndex = maxIndex; | |
| 2366 | - if (onLoop) { | |
| 2367 | - nextIndex = onLoop(event, highlightedIndex, nextIndex, elementsRef); | |
| 2368 | - } | |
| 2369 | - } else { | |
| 2370 | - nextIndex = findNonDisabledListIndex(elementsRef.current, { | |
| 2371 | - startingIndex: nextIndex, | |
| 2372 | - decrement: backwardKeys.includes(event.key), | |
| 2373 | - disabledIndices | |
| 2374 | - }); | |
| 2375 | - } | |
| 2376 | - } | |
| 2377 | - if (nextIndex !== highlightedIndex && !isIndexOutOfListBounds(elementsRef.current, nextIndex)) { | |
| 2378 | - if (stopEventPropagation) { | |
| 2379 | - event.stopPropagation(); | |
| 2380 | - } | |
| 2381 | - if (preventedKeys.has(event.key)) { | |
| 2382 | - event.preventDefault(); | |
| 2383 | - } | |
| 2384 | - onHighlightedIndexChange(nextIndex, true); | |
| 2385 | - queueMicrotask(() => { | |
| 2386 | - elementsRef.current[nextIndex]?.focus(); | |
| 2387 | - }); | |
| 2388 | - } | |
| 2389 | - }); | |
| 2390 | - const props = { | |
| 2391 | - ref: mergedRef, | |
| 2392 | - onFocus(event) { | |
| 2393 | - const element = rootRef.current; | |
| 2394 | - const target = getTarget(event.nativeEvent); | |
| 2395 | - if (!element || target == null || !isNativeInput(target)) { | |
| 2396 | - return; | |
| 2397 | - } | |
| 2398 | - target.setSelectionRange(0, target.value.length ?? 0); | |
| 2399 | - }, | |
| 2400 | - onKeyDown | |
| 2401 | - }; | |
| 2402 | - return { | |
| 2403 | - props, | |
| 2404 | - highlightedIndex, | |
| 2405 | - onHighlightedIndexChange, | |
| 2406 | - elementsRef, | |
| 2407 | - disabledIndices, | |
| 2408 | - onMapChange, | |
| 2409 | - relayKeyboardEvent: onKeyDown | |
| 2410 | - }; | |
| 2411 | - } | |
| 2412 | - function isModifierKeySet(event, ignoredModifierKeys) { | |
| 2413 | - for (const key of MODIFIER_KEYS.values()) { | |
| 2414 | - if (ignoredModifierKeys.includes(key)) { | |
| 2415 | - continue; | |
| 2416 | - } | |
| 2417 | - if (event.getModifierState(key)) { | |
| 2418 | - return true; | |
| 2419 | - } | |
| 2420 | - } | |
| 2421 | - return false; | |
| 2422 | - } | |
| 2423 | - | |
| 2424 | - // node_modules/@base-ui/react/internals/composite/root/CompositeRoot.mjs | |
| 2425 | - var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); | |
| 2426 | - function CompositeRoot(componentProps) { | |
| 2427 | - const { | |
| 2428 | - render, | |
| 2429 | - className, | |
| 2430 | - style, | |
| 2431 | - refs = EMPTY_ARRAY, | |
| 2432 | - props = EMPTY_ARRAY, | |
| 2433 | - state = EMPTY_OBJECT, | |
| 2434 | - stateAttributesMapping: stateAttributesMapping3, | |
| 2435 | - highlightedIndex: highlightedIndexProp, | |
| 2436 | - onHighlightedIndexChange: onHighlightedIndexChangeProp, | |
| 2437 | - orientation, | |
| 2438 | - grid, | |
| 2439 | - loopFocus, | |
| 2440 | - onLoop, | |
| 2441 | - enableHomeAndEndKeys, | |
| 2442 | - onMapChange: onMapChangeProp, | |
| 2443 | - stopEventPropagation = true, | |
| 2444 | - rootRef, | |
| 2445 | - disabledIndices, | |
| 2446 | - modifierKeys, | |
| 2447 | - highlightItemOnHover = false, | |
| 2448 | - tag = "div", | |
| 2449 | - ...elementProps | |
| 2450 | - } = componentProps; | |
| 2451 | - const direction = useDirection(); | |
| 2452 | - const { | |
| 2453 | - props: defaultProps, | |
| 2454 | - highlightedIndex, | |
| 2455 | - onHighlightedIndexChange, | |
| 2456 | - elementsRef, | |
| 2457 | - onMapChange: onMapChangeUnwrapped, | |
| 2458 | - relayKeyboardEvent | |
| 2459 | - } = useCompositeRoot({ | |
| 2460 | - grid, | |
| 2461 | - loopFocus, | |
| 2462 | - onLoop, | |
| 2463 | - orientation, | |
| 2464 | - highlightedIndex: highlightedIndexProp, | |
| 2465 | - onHighlightedIndexChange: onHighlightedIndexChangeProp, | |
| 2466 | - rootRef, | |
| 2467 | - stopEventPropagation, | |
| 2468 | - enableHomeAndEndKeys, | |
| 2469 | - direction, | |
| 2470 | - disabledIndices, | |
| 2471 | - modifierKeys | |
| 2472 | - }); | |
| 2473 | - const element = useRenderElement(tag, componentProps, { | |
| 2474 | - state, | |
| 2475 | - ref: refs, | |
| 2476 | - props: [defaultProps, ...props, elementProps], | |
| 2477 | - stateAttributesMapping: stateAttributesMapping3 | |
| 2478 | - }); | |
| 2479 | - const contextValue = React23.useMemo(() => ({ | |
| 2480 | - highlightedIndex, | |
| 2481 | - onHighlightedIndexChange, | |
| 2482 | - highlightItemOnHover, | |
| 2483 | - relayKeyboardEvent | |
| 2484 | - }), [highlightedIndex, onHighlightedIndexChange, highlightItemOnHover, relayKeyboardEvent]); | |
| 2485 | - return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CompositeRootContext.Provider, { | |
| 2486 | - value: contextValue, | |
| 2487 | - children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(CompositeList, { | |
| 2488 | - elementsRef, | |
| 2489 | - onMapChange: (newMap) => { | |
| 2490 | - onMapChangeProp?.(newMap); | |
| 2491 | - onMapChangeUnwrapped(newMap); | |
| 2492 | - }, | |
| 2493 | - children: element | |
| 2494 | - }) | |
| 2495 | - }); | |
| 2496 | - } | |
| 2497 | - | |
| 2498 | - // node_modules/@base-ui/react/utils/useIsHydrating.mjs | |
| 2499 | - var import_shim = __toESM(require_shim(), 1); | |
| 2500 | - function subscribe() { | |
| 2501 | - return NOOP; | |
| 2502 | - } | |
| 2503 | - function getSnapshot() { | |
| 2504 | - return false; | |
| 2505 | - } | |
| 2506 | - function getServerSnapshot() { | |
| 2507 | - return true; | |
| 2508 | - } | |
| 2509 | - function useIsHydrating() { | |
| 2510 | - return (0, import_shim.useSyncExternalStore)(subscribe, getSnapshot, getServerSnapshot); | |
| 2511 | - } | |
| 2512 | - | |
| 2513 | - // node_modules/@base-ui/react/tabs/index.parts.mjs | |
| 2514 | - var index_parts_exports = {}; | |
| 2515 | - __export(index_parts_exports, { | |
| 2516 | - Indicator: () => TabsIndicator, | |
| 2517 | - List: () => TabsList, | |
| 2518 | - Panel: () => TabsPanel, | |
| 2519 | - Root: () => TabsRoot, | |
| 2520 | - Tab: () => TabsTab | |
| 2521 | - }); | |
| 2522 | - | |
| 2523 | - // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs | |
| 2524 | - var React25 = __toESM(require_react(), 1); | |
| 2525 | - | |
| 2526 | - // node_modules/@base-ui/react/tabs/root/TabsRootContext.mjs | |
| 2527 | - var React24 = __toESM(require_react(), 1); | |
| 2528 | - var TabsRootContext = /* @__PURE__ */ React24.createContext(void 0); | |
| 2529 | - if (true) TabsRootContext.displayName = "TabsRootContext"; | |
| 2530 | - function useTabsRootContext() { | |
| 2531 | - const context = React24.useContext(TabsRootContext); | |
| 2532 | - if (context === void 0) { | |
| 2533 | - throw new Error(true ? "Base UI: TabsRootContext is missing. Tabs parts must be placed within <Tabs.Root>." : formatErrorMessage_default(64)); | |
| 2534 | - } | |
| 2535 | - return context; | |
| 2536 | - } | |
| 2537 | - | |
| 2538 | - // node_modules/@base-ui/react/tabs/root/TabsRootDataAttributes.mjs | |
| 2539 | - var TabsRootDataAttributes = /* @__PURE__ */ (function(TabsRootDataAttributes2) { | |
| 2540 | - TabsRootDataAttributes2["activationDirection"] = "data-activation-direction"; | |
| 2541 | - TabsRootDataAttributes2["orientation"] = "data-orientation"; | |
| 2542 | - return TabsRootDataAttributes2; | |
| 2543 | - })({}); | |
| 2544 | - | |
| 2545 | - // node_modules/@base-ui/react/tabs/root/stateAttributesMapping.mjs | |
| 2546 | - var tabsStateAttributesMapping = { | |
| 2547 | - tabActivationDirection: (dir) => ({ | |
| 2548 | - [TabsRootDataAttributes.activationDirection]: dir | |
| 2549 | - }) | |
| 2550 | - }; | |
| 2551 | - | |
| 2552 | - // node_modules/@base-ui/react/tabs/root/TabsRoot.mjs | |
| 2553 | - var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); | |
| 2554 | - var TabsRoot = /* @__PURE__ */ React25.forwardRef(function TabsRoot2(componentProps, forwardedRef) { | |
| 2555 | - const { | |
| 2556 | - className, | |
| 2557 | - defaultValue: defaultValueProp = 0, | |
| 2558 | - onValueChange: onValueChangeProp, | |
| 2559 | - orientation = "horizontal", | |
| 2560 | - render, | |
| 2561 | - value: valueProp, | |
| 2562 | - style, | |
| 2563 | - ...elementProps | |
| 2564 | - } = componentProps; | |
| 2565 | - const hasExplicitDefaultValueProp = componentProps.defaultValue !== void 0; | |
| 2566 | - const tabPanelRefs = React25.useRef([]); | |
| 2567 | - const [mountedTabPanels, setMountedTabPanels] = React25.useState(() => /* @__PURE__ */ new Map()); | |
| 2568 | - const [value, setValue] = useControlled({ | |
| 2569 | - controlled: valueProp, | |
| 2570 | - default: defaultValueProp, | |
| 2571 | - name: "Tabs", | |
| 2572 | - state: "value" | |
| 2573 | - }); | |
| 2574 | - const isControlled = valueProp !== void 0; | |
| 2575 | - const [tabMap, setTabMap] = React25.useState(() => /* @__PURE__ */ new Map()); | |
| 2576 | - const lastKnownTabElementRef = React25.useRef(void 0); | |
| 2577 | - const getTabElementBySelectedValue = React25.useCallback((selectedValue) => { | |
| 2578 | - if (selectedValue === void 0) { | |
| 2579 | - return null; | |
| 2580 | - } | |
| 2581 | - for (const [tabElement, tabMetadata] of tabMap.entries()) { | |
| 2582 | - if (tabMetadata != null && selectedValue === (tabMetadata.value ?? tabMetadata.index)) { | |
| 2583 | - return tabElement; | |
| 2584 | - } | |
| 2585 | - } | |
| 2586 | - return null; | |
| 2587 | - }, [tabMap]); | |
| 2588 | - const [activationDirectionState, setActivationDirectionState] = React25.useState(() => ({ | |
| 2589 | - previousValue: value, | |
| 2590 | - tabActivationDirection: "none" | |
| 2591 | - })); | |
| 2592 | - const { | |
| 2593 | - previousValue, | |
| 2594 | - tabActivationDirection: committedTabActivationDirection | |
| 2595 | - } = activationDirectionState; | |
| 2596 | - let tabActivationDirection = committedTabActivationDirection; | |
| 2597 | - let directionComputationIncomplete = false; | |
| 2598 | - if (previousValue !== value) { | |
| 2599 | - tabActivationDirection = computeActivationDirection(previousValue, value, orientation, tabMap); | |
| 2600 | - directionComputationIncomplete = previousValue != null && value != null && getTabElementBySelectedValue(value) == null; | |
| 2601 | - } | |
| 2602 | - const nextPreviousValue = directionComputationIncomplete ? previousValue : value; | |
| 2603 | - const shouldSyncActivationDirectionState = previousValue !== nextPreviousValue || committedTabActivationDirection !== tabActivationDirection; | |
| 2604 | - useIsoLayoutEffect(() => { | |
| 2605 | - if (!shouldSyncActivationDirectionState) { | |
| 2606 | - return; | |
| 2607 | - } | |
| 2608 | - setActivationDirectionState({ | |
| 2609 | - previousValue: nextPreviousValue, | |
| 2610 | - tabActivationDirection | |
| 2611 | - }); | |
| 2612 | - }, [nextPreviousValue, shouldSyncActivationDirectionState, tabActivationDirection]); | |
| 2613 | - const onValueChange = useStableCallback((newValue, eventDetails) => { | |
| 2614 | - const activationDirection = computeActivationDirection(value, newValue, orientation, tabMap); | |
| 2615 | - eventDetails.activationDirection = activationDirection; | |
| 2616 | - onValueChangeProp?.(newValue, eventDetails); | |
| 2617 | - if (eventDetails.isCanceled) { | |
| 2618 | - return; | |
| 2619 | - } | |
| 2620 | - setValue(newValue); | |
| 2621 | - }); | |
| 2622 | - const notifyAutomaticValueChange = useStableCallback((nextValue, reason) => { | |
| 2623 | - onValueChangeProp?.(nextValue, createChangeEventDetails(reason, void 0, void 0, { | |
| 2624 | - activationDirection: "none" | |
| 2625 | - })); | |
| 2626 | - }); | |
| 2627 | - const registerMountedTabPanel = useStableCallback((panelValue, panelId) => { | |
| 2628 | - setMountedTabPanels((prev) => { | |
| 2629 | - if (prev.get(panelValue) === panelId) { | |
| 2630 | - return prev; | |
| 2631 | - } | |
| 2632 | - const next = new Map(prev); | |
| 2633 | - next.set(panelValue, panelId); | |
| 2634 | - return next; | |
| 2635 | - }); | |
| 2636 | - }); | |
| 2637 | - const unregisterMountedTabPanel = useStableCallback((panelValue, panelId) => { | |
| 2638 | - setMountedTabPanels((prev) => { | |
| 2639 | - if (!prev.has(panelValue) || prev.get(panelValue) !== panelId) { | |
| 2640 | - return prev; | |
| 2641 | - } | |
| 2642 | - const next = new Map(prev); | |
| 2643 | - next.delete(panelValue); | |
| 2644 | - return next; | |
| 2645 | - }); | |
| 2646 | - }); | |
| 2647 | - const getTabPanelIdByValue = React25.useCallback((tabValue) => { | |
| 2648 | - return mountedTabPanels.get(tabValue); | |
| 2649 | - }, [mountedTabPanels]); | |
| 2650 | - const getTabIdByPanelValue = React25.useCallback((tabPanelValue) => { | |
| 2651 | - for (const tabMetadata of tabMap.values()) { | |
| 2652 | - if (tabPanelValue === tabMetadata?.value) { | |
| 2653 | - return tabMetadata?.id; | |
| 2654 | - } | |
| 2655 | - } | |
| 2656 | - return void 0; | |
| 2657 | - }, [tabMap]); | |
| 2658 | - const tabsContextValue = React25.useMemo(() => ({ | |
| 2659 | - getTabElementBySelectedValue, | |
| 2660 | - getTabIdByPanelValue, | |
| 2661 | - getTabPanelIdByValue, | |
| 2662 | - onValueChange, | |
| 2663 | - orientation, | |
| 2664 | - registerMountedTabPanel, | |
| 2665 | - setTabMap, | |
| 2666 | - unregisterMountedTabPanel, | |
| 2667 | - tabActivationDirection, | |
| 2668 | - value | |
| 2669 | - }), [getTabElementBySelectedValue, getTabIdByPanelValue, getTabPanelIdByValue, onValueChange, orientation, registerMountedTabPanel, setTabMap, unregisterMountedTabPanel, tabActivationDirection, value]); | |
| 2670 | - const selectedTabMetadata = React25.useMemo(() => { | |
| 2671 | - for (const tabMetadata of tabMap.values()) { | |
| 2672 | - if (tabMetadata != null && tabMetadata.value === value) { | |
| 2673 | - return tabMetadata; | |
| 2674 | - } | |
| 2675 | - } | |
| 2676 | - return void 0; | |
| 2677 | - }, [tabMap, value]); | |
| 2678 | - const firstEnabledTabValue = React25.useMemo(() => { | |
| 2679 | - for (const tabMetadata of tabMap.values()) { | |
| 2680 | - if (tabMetadata != null && !tabMetadata.disabled) { | |
| 2681 | - return tabMetadata.value; | |
| 2682 | - } | |
| 2683 | - } | |
| 2684 | - return void 0; | |
| 2685 | - }, [tabMap]); | |
| 2686 | - const shouldNotifyInitialValueChangeRef = React25.useRef(!hasExplicitDefaultValueProp); | |
| 2687 | - const initialDefaultValueRef = React25.useRef(defaultValueProp); | |
| 2688 | - const shouldHonorDisabledDefaultValueRef = React25.useRef(hasExplicitDefaultValueProp); | |
| 2689 | - const didRegisterTabsRef = React25.useRef(false); | |
| 2690 | - useIsoLayoutEffect(() => { | |
| 2691 | - if (isControlled) { | |
| 2692 | - return; | |
| 2693 | - } | |
| 2694 | - function commitAutomaticValueChange(fallbackValue, fallbackReason) { | |
| 2695 | - setValue(fallbackValue); | |
| 2696 | - setActivationDirectionState((prev) => { | |
| 2697 | - if (prev.previousValue === fallbackValue && prev.tabActivationDirection === "none") { | |
| 2698 | - return prev; | |
| 2699 | - } | |
| 2700 | - return { | |
| 2701 | - previousValue: fallbackValue, | |
| 2702 | - tabActivationDirection: "none" | |
| 2703 | - }; | |
| 2704 | - }); | |
| 2705 | - notifyAutomaticValueChange(fallbackValue, fallbackReason); | |
| 2706 | - shouldNotifyInitialValueChangeRef.current = false; | |
| 2707 | - } | |
| 2708 | - if (tabMap.size === 0) { | |
| 2709 | - if (didRegisterTabsRef.current && value !== null && !lastKnownTabElementRef.current?.isConnected) { | |
| 2710 | - commitAutomaticValueChange(null, reason_parts_exports.missing); | |
| 2711 | - } | |
| 2712 | - return; | |
| 2713 | - } | |
| 2714 | - didRegisterTabsRef.current = true; | |
| 2715 | - lastKnownTabElementRef.current = tabMap.keys().next().value; | |
| 2716 | - const selectionIsDisabled = selectedTabMetadata?.disabled; | |
| 2717 | - const selectionIsMissing = selectedTabMetadata == null && value !== null; | |
| 2718 | - if (!selectionIsDisabled && value === initialDefaultValueRef.current) { | |
| 2719 | - shouldHonorDisabledDefaultValueRef.current = false; | |
| 2720 | - } | |
| 2721 | - if (shouldHonorDisabledDefaultValueRef.current && selectionIsDisabled && value === initialDefaultValueRef.current) { | |
| 2722 | - return; | |
| 2723 | - } | |
| 2724 | - const shouldNotifyInitialValueChange = shouldNotifyInitialValueChangeRef.current; | |
| 2725 | - if (selectionIsDisabled || selectionIsMissing) { | |
| 2726 | - const fallbackValue = firstEnabledTabValue ?? null; | |
| 2727 | - if (value === fallbackValue) { | |
| 2728 | - shouldNotifyInitialValueChangeRef.current = false; | |
| 2729 | - return; | |
| 2730 | - } | |
| 2731 | - let fallbackReason = reason_parts_exports.missing; | |
| 2732 | - if (shouldNotifyInitialValueChange) { | |
| 2733 | - fallbackReason = reason_parts_exports.initial; | |
| 2734 | - } else if (selectionIsDisabled) { | |
| 2735 | - fallbackReason = reason_parts_exports.disabled; | |
| 2736 | - } | |
| 2737 | - commitAutomaticValueChange(fallbackValue, fallbackReason); | |
| 2738 | - return; | |
| 2739 | - } | |
| 2740 | - if (shouldNotifyInitialValueChange && selectedTabMetadata != null) { | |
| 2741 | - notifyAutomaticValueChange(value, reason_parts_exports.initial); | |
| 2742 | - shouldNotifyInitialValueChangeRef.current = false; | |
| 2743 | - } | |
| 2744 | - }, [firstEnabledTabValue, isControlled, notifyAutomaticValueChange, selectedTabMetadata, setValue, tabMap, value]); | |
| 2745 | - const state = { | |
| 2746 | - orientation, | |
| 2747 | - tabActivationDirection | |
| 2748 | - }; | |
| 2749 | - const element = useRenderElement("div", componentProps, { | |
| 2750 | - state, | |
| 2751 | - ref: forwardedRef, | |
| 2752 | - props: elementProps, | |
| 2753 | - stateAttributesMapping: tabsStateAttributesMapping | |
| 2754 | - }); | |
| 2755 | - return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(TabsRootContext.Provider, { | |
| 2756 | - value: tabsContextValue, | |
| 2757 | - children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(CompositeList, { | |
| 2758 | - elementsRef: tabPanelRefs, | |
| 2759 | - children: element | |
| 2760 | - }) | |
| 2761 | - }); | |
| 2762 | - }); | |
| 2763 | - if (true) TabsRoot.displayName = "TabsRoot"; | |
| 2764 | - function computeActivationDirection(oldValue, newValue, orientation, tabMap) { | |
| 2765 | - if (oldValue == null || newValue == null) { | |
| 2766 | - return "none"; | |
| 2767 | - } | |
| 2768 | - let oldTab = null; | |
| 2769 | - let newTab = null; | |
| 2770 | - for (const [tabElement, tabMetadata] of tabMap.entries()) { | |
| 2771 | - if (tabMetadata == null) { | |
| 2772 | - continue; | |
| 2773 | - } | |
| 2774 | - const tabValue = tabMetadata.value ?? tabMetadata.index; | |
| 2775 | - if (oldValue === tabValue) { | |
| 2776 | - oldTab = tabElement; | |
| 2777 | - } | |
| 2778 | - if (newValue === tabValue) { | |
| 2779 | - newTab = tabElement; | |
| 2780 | - } | |
| 2781 | - if (oldTab != null && newTab != null) { | |
| 2782 | - break; | |
| 2783 | - } | |
| 2784 | - } | |
| 2785 | - if (oldTab == null || newTab == null) { | |
| 2786 | - if (oldTab !== newTab && (typeof oldValue === "number" || typeof oldValue === "string") && typeof oldValue === typeof newValue) { | |
| 2787 | - if (orientation === "horizontal") { | |
| 2788 | - return newValue > oldValue ? "right" : "left"; | |
| 2789 | - } | |
| 2790 | - return newValue > oldValue ? "down" : "up"; | |
| 2791 | - } | |
| 2792 | - return "none"; | |
| 2793 | - } | |
| 2794 | - const oldRect = oldTab.getBoundingClientRect(); | |
| 2795 | - const newRect = newTab.getBoundingClientRect(); | |
| 2796 | - if (orientation === "horizontal") { | |
| 2797 | - if (newRect.left < oldRect.left) { | |
| 2798 | - return "left"; | |
| 2799 | - } | |
| 2800 | - if (newRect.left > oldRect.left) { | |
| 2801 | - return "right"; | |
| 2802 | - } | |
| 2803 | - } else { | |
| 2804 | - if (newRect.top < oldRect.top) { | |
| 2805 | - return "up"; | |
| 2806 | - } | |
| 2807 | - if (newRect.top > oldRect.top) { | |
| 2808 | - return "down"; | |
| 2809 | - } | |
| 2810 | - } | |
| 2811 | - return "none"; | |
| 2812 | - } | |
| 2813 | - | |
| 2814 | - // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs | |
| 2815 | - var React27 = __toESM(require_react(), 1); | |
| 2816 | - | |
| 2817 | - // node_modules/@base-ui/react/tabs/list/TabsListContext.mjs | |
| 2818 | - var React26 = __toESM(require_react(), 1); | |
| 2819 | - var TabsListContext = /* @__PURE__ */ React26.createContext(void 0); | |
| 2820 | - if (true) TabsListContext.displayName = "TabsListContext"; | |
| 2821 | - function useTabsListContext() { | |
| 2822 | - const context = React26.useContext(TabsListContext); | |
| 2823 | - if (context === void 0) { | |
| 2824 | - throw new Error(true ? "Base UI: TabsListContext is missing. TabsList parts must be placed within <Tabs.List>." : formatErrorMessage_default(65)); | |
| 2825 | - } | |
| 2826 | - return context; | |
| 2827 | - } | |
| 2828 | - | |
| 2829 | - // node_modules/@base-ui/react/tabs/tab/TabsTab.mjs | |
| 2830 | - var TabsTab = /* @__PURE__ */ React27.forwardRef(function TabsTab2(componentProps, forwardedRef) { | |
| 2831 | - const { | |
| 2832 | - className, | |
| 2833 | - disabled: disabled2 = false, | |
| 2834 | - render, | |
| 2835 | - value, | |
| 2836 | - id: idProp, | |
| 2837 | - nativeButton = true, | |
| 2838 | - style, | |
| 2839 | - ...elementProps | |
| 2840 | - } = componentProps; | |
| 2841 | - const { | |
| 2842 | - value: activeTabValue, | |
| 2843 | - getTabPanelIdByValue, | |
| 2844 | - orientation, | |
| 2845 | - tabActivationDirection | |
| 2846 | - } = useTabsRootContext(); | |
| 2847 | - const { | |
| 2848 | - activateOnFocus, | |
| 2849 | - highlightedTabIndex, | |
| 2850 | - onTabActivation, | |
| 2851 | - registerTabResizeObserverElement, | |
| 2852 | - setHighlightedTabIndex, | |
| 2853 | - tabsListElement | |
| 2854 | - } = useTabsListContext(); | |
| 2855 | - const id = useBaseUiId(idProp); | |
| 2856 | - const tabMetadata = React27.useMemo(() => ({ | |
| 2857 | - disabled: disabled2, | |
| 2858 | - id, | |
| 2859 | - value | |
| 2860 | - }), [disabled2, id, value]); | |
| 2861 | - const { | |
| 2862 | - compositeProps, | |
| 2863 | - compositeRef, | |
| 2864 | - index | |
| 2865 | - // hook is used instead of the CompositeItem component | |
| 2866 | - // because the index is needed for Tab internals | |
| 2867 | - } = useCompositeItem({ | |
| 2868 | - metadata: tabMetadata | |
| 2869 | - }); | |
| 2870 | - const active = value === activeTabValue; | |
| 2871 | - const isNavigatingRef = React27.useRef(false); | |
| 2872 | - const tabElementRef = React27.useRef(null); | |
| 2873 | - useIsoLayoutEffect(() => { | |
| 2874 | - const tabElement = tabElementRef.current; | |
| 2875 | - if (!tabElement) { | |
| 2876 | - return void 0; | |
| 2877 | - } | |
| 2878 | - return registerTabResizeObserverElement(tabElement); | |
| 2879 | - }, [registerTabResizeObserverElement]); | |
| 2880 | - useIsoLayoutEffect(() => { | |
| 2881 | - if (isNavigatingRef.current) { | |
| 2882 | - isNavigatingRef.current = false; | |
| 2883 | - return; | |
| 2884 | - } | |
| 2885 | - if (!(active && index > -1 && highlightedTabIndex !== index)) { | |
| 2886 | - return; | |
| 2887 | - } | |
| 2888 | - const listElement = tabsListElement; | |
| 2889 | - if (listElement != null) { | |
| 2890 | - const activeEl = activeElement(ownerDocument(listElement)); | |
| 2891 | - if (activeEl && contains(listElement, activeEl)) { | |
| 2892 | - return; | |
| 2893 | - } | |
| 2894 | - } | |
| 2895 | - if (!disabled2) { | |
| 2896 | - setHighlightedTabIndex(index); | |
| 2897 | - } | |
| 2898 | - }, [active, index, highlightedTabIndex, setHighlightedTabIndex, disabled2, tabsListElement]); | |
| 2899 | - const { | |
| 2900 | - getButtonProps, | |
| 2901 | - buttonRef | |
| 2902 | - } = useButton({ | |
| 2903 | - disabled: disabled2, | |
| 2904 | - native: nativeButton, | |
| 2905 | - focusableWhenDisabled: true | |
| 2906 | - }); | |
| 2907 | - const tabPanelId = getTabPanelIdByValue(value); | |
| 2908 | - const isPressingRef = React27.useRef(false); | |
| 2909 | - const isMainButtonRef = React27.useRef(false); | |
| 2910 | - function onClick(event) { | |
| 2911 | - if (active || disabled2) { | |
| 2912 | - return; | |
| 2913 | - } | |
| 2914 | - onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, { | |
| 2915 | - activationDirection: "none" | |
| 2916 | - })); | |
| 2917 | - } | |
| 2918 | - function onFocus(event) { | |
| 2919 | - if (active) { | |
| 2920 | - return; | |
| 2921 | - } | |
| 2922 | - if (index > -1 && !disabled2) { | |
| 2923 | - setHighlightedTabIndex(index); | |
| 2924 | - } | |
| 2925 | - if (disabled2) { | |
| 2926 | - return; | |
| 2927 | - } | |
| 2928 | - if (activateOnFocus && (!isPressingRef.current || // keyboard or touch focus | |
| 2929 | - isPressingRef.current && isMainButtonRef.current)) { | |
| 2930 | - onTabActivation(value, createChangeEventDetails(reason_parts_exports.none, event.nativeEvent, void 0, { | |
| 2931 | - activationDirection: "none" | |
| 2932 | - })); | |
| 2933 | - } | |
| 2934 | - } | |
| 2935 | - function onPointerDown(event) { | |
| 2936 | - if (active || disabled2) { | |
| 2937 | - return; | |
| 2938 | - } | |
| 2939 | - isPressingRef.current = true; | |
| 2940 | - function handlePointerUp() { | |
| 2941 | - isPressingRef.current = false; | |
| 2942 | - isMainButtonRef.current = false; | |
| 2943 | - } | |
| 2944 | - if (!event.button || event.button === 0) { | |
| 2945 | - isMainButtonRef.current = true; | |
| 2946 | - const doc = ownerDocument(event.currentTarget); | |
| 2947 | - doc.addEventListener("pointerup", handlePointerUp, { | |
| 2948 | - once: true | |
| 2949 | - }); | |
| 2950 | - } | |
| 2951 | - } | |
| 2952 | - const state = { | |
| 2953 | - disabled: disabled2, | |
| 2954 | - active, | |
| 2955 | - orientation, | |
| 2956 | - tabActivationDirection | |
| 2957 | - }; | |
| 2958 | - const element = useRenderElement("button", componentProps, { | |
| 2959 | - state, | |
| 2960 | - ref: [forwardedRef, buttonRef, compositeRef, tabElementRef], | |
| 2961 | - props: [compositeProps, { | |
| 2962 | - role: "tab", | |
| 2963 | - "aria-controls": tabPanelId, | |
| 2964 | - "aria-selected": active, | |
| 2965 | - id, | |
| 2966 | - onClick, | |
| 2967 | - onFocus, | |
| 2968 | - onPointerDown, | |
| 2969 | - [ACTIVE_COMPOSITE_ITEM]: active ? "" : void 0, | |
| 2970 | - onKeyDownCapture() { | |
| 2971 | - isNavigatingRef.current = true; | |
| 2972 | - } | |
| 2973 | - }, elementProps, getButtonProps], | |
| 2974 | - stateAttributesMapping: tabsStateAttributesMapping | |
| 2975 | - }); | |
| 2976 | - return element; | |
| 2977 | - }); | |
| 2978 | - if (true) TabsTab.displayName = "TabsTab"; | |
| 2979 | - | |
| 2980 | - // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs | |
| 2981 | - var React28 = __toESM(require_react(), 1); | |
| 2982 | - | |
| 2983 | - // node_modules/@base-ui/react/tabs/indicator/prehydrationScript.min.mjs | |
| 2984 | - 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")}();'; | |
| 2985 | - | |
| 2986 | - // node_modules/@base-ui/react/tabs/indicator/TabsIndicatorCssVars.mjs | |
| 2987 | - var TabsIndicatorCssVars = /* @__PURE__ */ (function(TabsIndicatorCssVars2) { | |
| 2988 | - TabsIndicatorCssVars2["activeTabLeft"] = "--active-tab-left"; | |
| 2989 | - TabsIndicatorCssVars2["activeTabRight"] = "--active-tab-right"; | |
| 2990 | - TabsIndicatorCssVars2["activeTabTop"] = "--active-tab-top"; | |
| 2991 | - TabsIndicatorCssVars2["activeTabBottom"] = "--active-tab-bottom"; | |
| 2992 | - TabsIndicatorCssVars2["activeTabWidth"] = "--active-tab-width"; | |
| 2993 | - TabsIndicatorCssVars2["activeTabHeight"] = "--active-tab-height"; | |
| 2994 | - return TabsIndicatorCssVars2; | |
| 2995 | - })({}); | |
| 2996 | - | |
| 2997 | - // node_modules/@base-ui/react/tabs/indicator/TabsIndicator.mjs | |
| 2998 | - var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); | |
| 2999 | - var stateAttributesMapping = { | |
| 3000 | - ...tabsStateAttributesMapping, | |
| 3001 | - activeTabPosition: () => null, | |
| 3002 | - activeTabSize: () => null | |
| 3003 | - }; | |
| 3004 | - var TabsIndicator = /* @__PURE__ */ React28.forwardRef(function TabsIndicator2(componentProps, forwardedRef) { | |
| 3005 | - const { | |
| 3006 | - className, | |
| 3007 | - render, | |
| 3008 | - renderBeforeHydration = false, | |
| 3009 | - style: styleProp, | |
| 3010 | - ...elementProps | |
| 3011 | - } = componentProps; | |
| 3012 | - const { | |
| 3013 | - nonce | |
| 3014 | - } = useCSPContext(); | |
| 3015 | - const { | |
| 3016 | - getTabElementBySelectedValue, | |
| 3017 | - orientation, | |
| 3018 | - tabActivationDirection, | |
| 3019 | - value | |
| 3020 | - } = useTabsRootContext(); | |
| 3021 | - const { | |
| 3022 | - tabsListElement, | |
| 3023 | - registerIndicatorUpdateListener | |
| 3024 | - } = useTabsListContext(); | |
| 3025 | - const isHydrating = useIsHydrating(); | |
| 3026 | - const rerender = useForcedRerendering(); | |
| 3027 | - React28.useEffect(() => { | |
| 3028 | - return registerIndicatorUpdateListener(rerender); | |
| 3029 | - }, [registerIndicatorUpdateListener, rerender]); | |
| 3030 | - let left = 0; | |
| 3031 | - let right = 0; | |
| 3032 | - let top = 0; | |
| 3033 | - let bottom = 0; | |
| 3034 | - let width = 0; | |
| 3035 | - let height = 0; | |
| 3036 | - let isTabSelected = false; | |
| 3037 | - if (value != null && tabsListElement != null) { | |
| 3038 | - const activeTab = getTabElementBySelectedValue(value); | |
| 3039 | - if (activeTab != null) { | |
| 3040 | - isTabSelected = true; | |
| 3041 | - const { | |
| 3042 | - width: computedWidth, | |
| 3043 | - height: computedHeight | |
| 3044 | - } = getCssDimensions(activeTab); | |
| 3045 | - const { | |
| 3046 | - width: tabListWidth, | |
| 3047 | - height: tabListHeight | |
| 3048 | - } = getCssDimensions(tabsListElement); | |
| 3049 | - const tabRect = activeTab.getBoundingClientRect(); | |
| 3050 | - const tabsListRect = tabsListElement.getBoundingClientRect(); | |
| 3051 | - const scaleX = tabListWidth > 0 ? tabsListRect.width / tabListWidth : 1; | |
| 3052 | - const scaleY = tabListHeight > 0 ? tabsListRect.height / tabListHeight : 1; | |
| 3053 | - const hasNonZeroScale = Math.abs(scaleX) > Number.EPSILON && Math.abs(scaleY) > Number.EPSILON; | |
| 3054 | - if (hasNonZeroScale) { | |
| 3055 | - const tabLeftDelta = tabRect.left - tabsListRect.left; | |
| 3056 | - const tabTopDelta = tabRect.top - tabsListRect.top; | |
| 3057 | - left = tabLeftDelta / scaleX + tabsListElement.scrollLeft - tabsListElement.clientLeft; | |
| 3058 | - top = tabTopDelta / scaleY + tabsListElement.scrollTop - tabsListElement.clientTop; | |
| 3059 | - } else { | |
| 3060 | - left = activeTab.offsetLeft; | |
| 3061 | - top = activeTab.offsetTop; | |
| 3062 | - } | |
| 3063 | - width = computedWidth; | |
| 3064 | - height = computedHeight; | |
| 3065 | - right = tabsListElement.scrollWidth - left - width; | |
| 3066 | - bottom = tabsListElement.scrollHeight - top - height; | |
| 3067 | - } | |
| 3068 | - } | |
| 3069 | - const activeTabPosition = isTabSelected ? { | |
| 3070 | - left, | |
| 3071 | - right, | |
| 3072 | - top, | |
| 3073 | - bottom | |
| 3074 | - } : null; | |
| 3075 | - const activeTabSize = isTabSelected ? { | |
| 3076 | - width, | |
| 3077 | - height | |
| 3078 | - } : null; | |
| 3079 | - const style = isTabSelected ? { | |
| 3080 | - [TabsIndicatorCssVars.activeTabLeft]: `${left}px`, | |
| 3081 | - [TabsIndicatorCssVars.activeTabRight]: `${right}px`, | |
| 3082 | - [TabsIndicatorCssVars.activeTabTop]: `${top}px`, | |
| 3083 | - [TabsIndicatorCssVars.activeTabBottom]: `${bottom}px`, | |
| 3084 | - [TabsIndicatorCssVars.activeTabWidth]: `${width}px`, | |
| 3085 | - [TabsIndicatorCssVars.activeTabHeight]: `${height}px` | |
| 3086 | - } : void 0; | |
| 3087 | - const displayIndicator = isTabSelected && width > 0 && height > 0; | |
| 3088 | - const state = { | |
| 3089 | - orientation, | |
| 3090 | - activeTabPosition, | |
| 3091 | - activeTabSize, | |
| 3092 | - tabActivationDirection | |
| 3093 | - }; | |
| 3094 | - const element = useRenderElement("span", componentProps, { | |
| 3095 | - state, | |
| 3096 | - ref: forwardedRef, | |
| 3097 | - props: [{ | |
| 3098 | - role: "presentation", | |
| 3099 | - style, | |
| 3100 | - hidden: !displayIndicator | |
| 3101 | - // do not display the indicator before the layout is settled | |
| 3102 | - }, elementProps, { | |
| 3103 | - suppressHydrationWarning: true | |
| 3104 | - }], | |
| 3105 | - stateAttributesMapping | |
| 3106 | - }); | |
| 3107 | - if (value == null) { | |
| 3108 | - return null; | |
| 3109 | - } | |
| 3110 | - return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(React28.Fragment, { | |
| 3111 | - children: [element, isHydrating && renderBeforeHydration && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)("script", { | |
| 3112 | - nonce, | |
| 3113 | - dangerouslySetInnerHTML: { | |
| 3114 | - __html: script | |
| 3115 | - }, | |
| 3116 | - suppressHydrationWarning: true | |
| 3117 | - })] | |
| 3118 | - }); | |
| 3119 | - }); | |
| 3120 | - if (true) TabsIndicator.displayName = "TabsIndicator"; | |
| 3121 | - | |
| 3122 | - // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs | |
| 3123 | - var React29 = __toESM(require_react(), 1); | |
| 3124 | - | |
| 3125 | - // node_modules/@base-ui/react/tabs/panel/TabsPanelDataAttributes.mjs | |
| 3126 | - var TabsPanelDataAttributes = (function(TabsPanelDataAttributes2) { | |
| 3127 | - TabsPanelDataAttributes2["index"] = "data-index"; | |
| 3128 | - TabsPanelDataAttributes2["activationDirection"] = "data-activation-direction"; | |
| 3129 | - TabsPanelDataAttributes2["orientation"] = "data-orientation"; | |
| 3130 | - TabsPanelDataAttributes2["hidden"] = "data-hidden"; | |
| 3131 | - TabsPanelDataAttributes2[TabsPanelDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; | |
| 3132 | - TabsPanelDataAttributes2[TabsPanelDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; | |
| 3133 | - return TabsPanelDataAttributes2; | |
| 3134 | - })({}); | |
| 3135 | - | |
| 3136 | - // node_modules/@base-ui/react/tabs/panel/TabsPanel.mjs | |
| 3137 | - var stateAttributesMapping2 = { | |
| 3138 | - ...tabsStateAttributesMapping, | |
| 3139 | - ...transitionStatusMapping | |
| 3140 | - }; | |
| 3141 | - var TabsPanel = /* @__PURE__ */ React29.forwardRef(function TabsPanel2(componentProps, forwardedRef) { | |
| 3142 | - const { | |
| 3143 | - className, | |
| 3144 | - value, | |
| 3145 | - render, | |
| 3146 | - keepMounted = false, | |
| 3147 | - style, | |
| 3148 | - ...elementProps | |
| 3149 | - } = componentProps; | |
| 3150 | - const { | |
| 3151 | - value: selectedValue, | |
| 3152 | - getTabIdByPanelValue, | |
| 3153 | - orientation, | |
| 3154 | - tabActivationDirection, | |
| 3155 | - registerMountedTabPanel, | |
| 3156 | - unregisterMountedTabPanel | |
| 3157 | - } = useTabsRootContext(); | |
| 3158 | - const id = useBaseUiId(); | |
| 3159 | - const metadata = React29.useMemo(() => ({ | |
| 3160 | - id, | |
| 3161 | - value | |
| 3162 | - }), [id, value]); | |
| 3163 | - const { | |
| 3164 | - ref: listItemRef, | |
| 3165 | - index | |
| 3166 | - } = useCompositeListItem({ | |
| 3167 | - metadata | |
| 3168 | - }); | |
| 3169 | - const open = value === selectedValue; | |
| 3170 | - const { | |
| 3171 | - mounted, | |
| 3172 | - transitionStatus, | |
| 3173 | - setMounted | |
| 3174 | - } = useTransitionStatus(open); | |
| 3175 | - const hidden = !mounted; | |
| 3176 | - const correspondingTabId = getTabIdByPanelValue(value); | |
| 3177 | - const state = { | |
| 3178 | - hidden, | |
| 3179 | - orientation, | |
| 3180 | - tabActivationDirection, | |
| 3181 | - transitionStatus | |
| 3182 | - }; | |
| 3183 | - const panelRef = React29.useRef(null); | |
| 3184 | - const element = useRenderElement("div", componentProps, { | |
| 3185 | - state, | |
| 3186 | - ref: [forwardedRef, listItemRef, panelRef], | |
| 3187 | - props: [{ | |
| 3188 | - "aria-labelledby": correspondingTabId, | |
| 3189 | - hidden, | |
| 3190 | - id, | |
| 3191 | - role: "tabpanel", | |
| 3192 | - tabIndex: open ? 0 : -1, | |
| 3193 | - inert: inertValue(!open), | |
| 3194 | - [TabsPanelDataAttributes.index]: index | |
| 3195 | - }, elementProps], | |
| 3196 | - stateAttributesMapping: stateAttributesMapping2 | |
| 3197 | - }); | |
| 3198 | - useOpenChangeComplete({ | |
| 3199 | - open, | |
| 3200 | - ref: panelRef, | |
| 3201 | - onComplete() { | |
| 3202 | - if (!open) { | |
| 3203 | - setMounted(false); | |
| 3204 | - } | |
| 3205 | - } | |
| 3206 | - }); | |
| 3207 | - useIsoLayoutEffect(() => { | |
| 3208 | - if (hidden && !keepMounted) { | |
| 3209 | - return void 0; | |
| 3210 | - } | |
| 3211 | - if (id == null) { | |
| 3212 | - return void 0; | |
| 3213 | - } | |
| 3214 | - registerMountedTabPanel(value, id); | |
| 3215 | - return () => { | |
| 3216 | - unregisterMountedTabPanel(value, id); | |
| 3217 | - }; | |
| 3218 | - }, [hidden, keepMounted, value, id, registerMountedTabPanel, unregisterMountedTabPanel]); | |
| 3219 | - const shouldRender = keepMounted || mounted; | |
| 3220 | - if (!shouldRender) { | |
| 3221 | - return null; | |
| 3222 | - } | |
| 3223 | - return element; | |
| 3224 | - }); | |
| 3225 | - if (true) TabsPanel.displayName = "TabsPanel"; | |
| 3226 | - | |
| 3227 | - // node_modules/@base-ui/react/tabs/list/TabsList.mjs | |
| 3228 | - var React30 = __toESM(require_react(), 1); | |
| 3229 | - var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); | |
| 3230 | - var TabsList = /* @__PURE__ */ React30.forwardRef(function TabsList2(componentProps, forwardedRef) { | |
| 3231 | - const { | |
| 3232 | - activateOnFocus = false, | |
| 3233 | - className, | |
| 3234 | - loopFocus = true, | |
| 3235 | - render, | |
| 3236 | - style, | |
| 3237 | - ...elementProps | |
| 3238 | - } = componentProps; | |
| 3239 | - const { | |
| 3240 | - onValueChange, | |
| 3241 | - orientation, | |
| 3242 | - value, | |
| 3243 | - setTabMap, | |
| 3244 | - tabActivationDirection | |
| 3245 | - } = useTabsRootContext(); | |
| 3246 | - const [highlightedTabIndex, setHighlightedTabIndex] = React30.useState(0); | |
| 3247 | - const [tabsListElement, setTabsListElement] = React30.useState(null); | |
| 3248 | - const indicatorUpdateListenersRef = React30.useRef(/* @__PURE__ */ new Set()); | |
| 3249 | - const tabResizeObserverElementsRef = React30.useRef(/* @__PURE__ */ new Set()); | |
| 3250 | - const resizeObserverRef = React30.useRef(null); | |
| 3251 | - useIsoLayoutEffect(() => { | |
| 3252 | - if (typeof ResizeObserver === "undefined") { | |
| 3253 | - return void 0; | |
| 3254 | - } | |
| 3255 | - const resizeObserver = new ResizeObserver(() => { | |
| 3256 | - indicatorUpdateListenersRef.current.forEach((listener) => { | |
| 3257 | - listener(); | |
| 3258 | - }); | |
| 3259 | - }); | |
| 3260 | - resizeObserverRef.current = resizeObserver; | |
| 3261 | - if (tabsListElement) { | |
| 3262 | - resizeObserver.observe(tabsListElement); | |
| 3263 | - } | |
| 3264 | - tabResizeObserverElementsRef.current.forEach((element) => { | |
| 3265 | - resizeObserver.observe(element); | |
| 3266 | - }); | |
| 3267 | - return () => { | |
| 3268 | - resizeObserver.disconnect(); | |
| 3269 | - resizeObserverRef.current = null; | |
| 3270 | - }; | |
| 3271 | - }, [tabsListElement]); | |
| 3272 | - const registerIndicatorUpdateListener = useStableCallback((listener) => { | |
| 3273 | - indicatorUpdateListenersRef.current.add(listener); | |
| 3274 | - return () => { | |
| 3275 | - indicatorUpdateListenersRef.current.delete(listener); | |
| 3276 | - }; | |
| 3277 | - }); | |
| 3278 | - const registerTabResizeObserverElement = useStableCallback((element) => { | |
| 3279 | - tabResizeObserverElementsRef.current.add(element); | |
| 3280 | - resizeObserverRef.current?.observe(element); | |
| 3281 | - return () => { | |
| 3282 | - tabResizeObserverElementsRef.current.delete(element); | |
| 3283 | - resizeObserverRef.current?.unobserve(element); | |
| 3284 | - }; | |
| 3285 | - }); | |
| 3286 | - const onTabActivation = useStableCallback((newValue, eventDetails) => { | |
| 3287 | - if (newValue !== value) { | |
| 3288 | - onValueChange(newValue, eventDetails); | |
| 3289 | - } | |
| 3290 | - }); | |
| 3291 | - const state = { | |
| 3292 | - orientation, | |
| 3293 | - tabActivationDirection | |
| 3294 | - }; | |
| 3295 | - const defaultProps = { | |
| 3296 | - "aria-orientation": orientation === "vertical" ? "vertical" : void 0, | |
| 3297 | - role: "tablist" | |
| 3298 | - }; | |
| 3299 | - const tabsListContextValue = React30.useMemo(() => ({ | |
| 3300 | - activateOnFocus, | |
| 3301 | - highlightedTabIndex, | |
| 3302 | - registerIndicatorUpdateListener, | |
| 3303 | - registerTabResizeObserverElement, | |
| 3304 | - onTabActivation, | |
| 3305 | - setHighlightedTabIndex, | |
| 3306 | - tabsListElement | |
| 3307 | - }), [activateOnFocus, highlightedTabIndex, registerIndicatorUpdateListener, registerTabResizeObserverElement, onTabActivation, setHighlightedTabIndex, tabsListElement]); | |
| 3308 | - return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(TabsListContext.Provider, { | |
| 3309 | - value: tabsListContextValue, | |
| 3310 | - children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(CompositeRoot, { | |
| 3311 | - render, | |
| 3312 | - className, | |
| 3313 | - style, | |
| 3314 | - state, | |
| 3315 | - refs: [forwardedRef, setTabsListElement], | |
| 3316 | - props: [defaultProps, elementProps], | |
| 3317 | - stateAttributesMapping: tabsStateAttributesMapping, | |
| 3318 | - highlightedIndex: highlightedTabIndex, | |
| 3319 | - enableHomeAndEndKeys: true, | |
| 3320 | - loopFocus, | |
| 3321 | - orientation, | |
| 3322 | - onHighlightedIndexChange: setHighlightedTabIndex, | |
| 3323 | - onMapChange: setTabMap, | |
| 3324 | - disabledIndices: EMPTY_ARRAY | |
| 3325 | - }) | |
| 3326 | - }); | |
| 3327 | - }); | |
| 3328 | - if (true) TabsList.displayName = "TabsList"; | |
| 3329 | - | |
| 3330 | - // node_modules/@base-ui/react/use-render/useRender.mjs | |
| 3331 | - function useRender(params) { | |
| 3332 | - return useRenderElement(params.defaultTagName ?? "div", params, params); | |
| 3333 | - } | |
| 3334 | - | |
| 3335 | - // packages/ui/build-module/icon/icon.mjs | |
| 327 | + var import_i18n3 = __toESM(require_i18n(), 1); | |
| 3336 | 328 | var import_element2 = __toESM(require_element(), 1); |
| 3337 | - var import_primitives15 = __toESM(require_primitives(), 1); | |
| 3338 | - var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); | |
| 3339 | - var Icon = (0, import_element2.forwardRef)(function Icon2({ icon, size = 24, ...restProps }, ref) { | |
| 3340 | - return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( | |
| 3341 | - import_primitives15.SVG, | |
| 3342 | - { | |
| 3343 | - ref, | |
| 3344 | - ...icon.props, | |
| 3345 | - ...restProps, | |
| 3346 | - width: size, | |
| 3347 | - height: size | |
| 3348 | - } | |
| 3349 | - ); | |
| 3350 | - }); | |
| 3351 | - | |
| 3352 | - // packages/ui/build-module/stack/stack.mjs | |
| 3353 | - var import_element3 = __toESM(require_element(), 1); | |
| 3354 | - var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; | |
| 3355 | - function getRuntime() { | |
| 3356 | - const globalScope = globalThis; | |
| 3357 | - if (globalScope.__wpStyleRuntime) { | |
| 3358 | - return globalScope.__wpStyleRuntime; | |
| 3359 | - } | |
| 3360 | - globalScope.__wpStyleRuntime = { | |
| 3361 | - documents: /* @__PURE__ */ new Map(), | |
| 3362 | - styles: /* @__PURE__ */ new Map(), | |
| 3363 | - injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 3364 | - }; | |
| 3365 | - if (typeof document !== "undefined") { | |
| 3366 | - registerDocument(document); | |
| 3367 | - } | |
| 3368 | - return globalScope.__wpStyleRuntime; | |
| 3369 | - } | |
| 3370 | - function documentContainsStyleHash(targetDocument, hash) { | |
| 3371 | - if (!targetDocument.head) { | |
| 3372 | - return false; | |
| 3373 | - } | |
| 3374 | - for (const style of targetDocument.head.querySelectorAll( | |
| 3375 | - `style[${STYLE_HASH_ATTRIBUTE}]` | |
| 3376 | - )) { | |
| 3377 | - if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { | |
| 3378 | - return true; | |
| 3379 | - } | |
| 3380 | - } | |
| 3381 | - return false; | |
| 3382 | - } | |
| 3383 | - function injectStyle(targetDocument, hash, css) { | |
| 3384 | - if (!targetDocument.head) { | |
| 3385 | - return; | |
| 3386 | - } | |
| 3387 | - const runtime = getRuntime(); | |
| 3388 | - let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 3389 | - if (!injectedStyles) { | |
| 3390 | - injectedStyles = /* @__PURE__ */ new Set(); | |
| 3391 | - runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 3392 | - } | |
| 3393 | - if (injectedStyles.has(hash)) { | |
| 3394 | - return; | |
| 3395 | - } | |
| 3396 | - if (documentContainsStyleHash(targetDocument, hash)) { | |
| 3397 | - injectedStyles.add(hash); | |
| 3398 | - return; | |
| 3399 | - } | |
| 3400 | - const style = targetDocument.createElement("style"); | |
| 3401 | - style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); | |
| 3402 | - style.appendChild(targetDocument.createTextNode(css)); | |
| 3403 | - targetDocument.head.appendChild(style); | |
| 3404 | - injectedStyles.add(hash); | |
| 3405 | - } | |
| 3406 | - function registerDocument(targetDocument) { | |
| 3407 | - const runtime = getRuntime(); | |
| 3408 | - runtime.documents.set( | |
| 3409 | - targetDocument, | |
| 3410 | - (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 3411 | - ); | |
| 3412 | - for (const [hash, css] of runtime.styles) { | |
| 3413 | - injectStyle(targetDocument, hash, css); | |
| 3414 | - } | |
| 3415 | - return () => { | |
| 3416 | - const count = runtime.documents.get(targetDocument); | |
| 3417 | - if (count === void 0) { | |
| 3418 | - return; | |
| 3419 | - } | |
| 3420 | - if (count <= 1) { | |
| 3421 | - runtime.documents.delete(targetDocument); | |
| 3422 | - return; | |
| 3423 | - } | |
| 3424 | - runtime.documents.set(targetDocument, count - 1); | |
| 3425 | - }; | |
| 3426 | - } | |
| 3427 | - function registerStyle(hash, css) { | |
| 3428 | - const runtime = getRuntime(); | |
| 3429 | - runtime.styles.set(hash, css); | |
| 3430 | - for (const targetDocument of runtime.documents.keys()) { | |
| 3431 | - injectStyle(targetDocument, hash, css); | |
| 3432 | - } | |
| 3433 | - } | |
| 3434 | - if (typeof process === "undefined" || true) { | |
| 3435 | - registerStyle("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); | |
| 3436 | - } | |
| 3437 | - var style_default = { "stack": "_19ce0419607e1896__stack" }; | |
| 3438 | - var gapTokens = { | |
| 3439 | - xs: "var(--wpds-dimension-gap-xs, 4px)", | |
| 3440 | - sm: "var(--wpds-dimension-gap-sm, 8px)", | |
| 3441 | - md: "var(--wpds-dimension-gap-md, 12px)", | |
| 3442 | - lg: "var(--wpds-dimension-gap-lg, 16px)", | |
| 3443 | - xl: "var(--wpds-dimension-gap-xl, 24px)", | |
| 3444 | - "2xl": "var(--wpds-dimension-gap-2xl, 32px)", | |
| 3445 | - "3xl": "var(--wpds-dimension-gap-3xl, 40px)" | |
| 3446 | - }; | |
| 3447 | - var Stack = (0, import_element3.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { | |
| 3448 | - const style = { | |
| 3449 | - gap: gap && gapTokens[gap], | |
| 3450 | - alignItems: align, | |
| 3451 | - justifyContent: justify, | |
| 3452 | - flexDirection: direction, | |
| 3453 | - flexWrap: wrap | |
| 3454 | - }; | |
| 3455 | - const element = useRender({ | |
| 3456 | - render, | |
| 3457 | - ref, | |
| 3458 | - props: mergeProps(props, { style, className: style_default.stack }) | |
| 3459 | - }); | |
| 3460 | - return element; | |
| 3461 | - }); | |
| 3462 | - | |
| 3463 | - // packages/ui/build-module/utils/use-schedule-validation.mjs | |
| 3464 | - var import_element4 = __toESM(require_element(), 1); | |
| 3465 | - function useScheduleValidation(validate) { | |
| 3466 | - const validateRef = (0, import_element4.useRef)(validate); | |
| 3467 | - validateRef.current = validate; | |
| 3468 | - const timerRef = (0, import_element4.useRef)(null); | |
| 3469 | - const unmountedRef = (0, import_element4.useRef)(false); | |
| 3470 | - const scheduleValidation = (0, import_element4.useCallback)(() => { | |
| 3471 | - if (unmountedRef.current) { | |
| 3472 | - return; | |
| 3473 | - } | |
| 3474 | - if (timerRef.current) { | |
| 3475 | - clearTimeout(timerRef.current); | |
| 3476 | - } | |
| 3477 | - timerRef.current = setTimeout(() => { | |
| 3478 | - validateRef.current(); | |
| 3479 | - timerRef.current = null; | |
| 3480 | - }, 0); | |
| 3481 | - }, []); | |
| 3482 | - (0, import_element4.useEffect)(() => { | |
| 3483 | - unmountedRef.current = false; | |
| 3484 | - return () => { | |
| 3485 | - unmountedRef.current = true; | |
| 3486 | - if (timerRef.current) { | |
| 3487 | - clearTimeout(timerRef.current); | |
| 3488 | - } | |
| 3489 | - }; | |
| 3490 | - }, []); | |
| 3491 | - return scheduleValidation; | |
| 3492 | - } | |
| 3493 | - | |
| 3494 | - // packages/ui/build-module/visually-hidden/visually-hidden.mjs | |
| 3495 | - var import_element5 = __toESM(require_element(), 1); | |
| 3496 | - var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; | |
| 3497 | - function getRuntime2() { | |
| 3498 | - const globalScope = globalThis; | |
| 3499 | - if (globalScope.__wpStyleRuntime) { | |
| 3500 | - return globalScope.__wpStyleRuntime; | |
| 3501 | - } | |
| 3502 | - globalScope.__wpStyleRuntime = { | |
| 3503 | - documents: /* @__PURE__ */ new Map(), | |
| 3504 | - styles: /* @__PURE__ */ new Map(), | |
| 3505 | - injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 3506 | - }; | |
| 3507 | - if (typeof document !== "undefined") { | |
| 3508 | - registerDocument2(document); | |
| 3509 | - } | |
| 3510 | - return globalScope.__wpStyleRuntime; | |
| 3511 | - } | |
| 3512 | - function documentContainsStyleHash2(targetDocument, hash) { | |
| 3513 | - if (!targetDocument.head) { | |
| 3514 | - return false; | |
| 3515 | - } | |
| 3516 | - for (const style of targetDocument.head.querySelectorAll( | |
| 3517 | - `style[${STYLE_HASH_ATTRIBUTE2}]` | |
| 3518 | - )) { | |
| 3519 | - if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { | |
| 3520 | - return true; | |
| 3521 | - } | |
| 3522 | - } | |
| 3523 | - return false; | |
| 3524 | - } | |
| 3525 | - function injectStyle2(targetDocument, hash, css) { | |
| 3526 | - if (!targetDocument.head) { | |
| 3527 | - return; | |
| 3528 | - } | |
| 3529 | - const runtime = getRuntime2(); | |
| 3530 | - let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 3531 | - if (!injectedStyles) { | |
| 3532 | - injectedStyles = /* @__PURE__ */ new Set(); | |
| 3533 | - runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 3534 | - } | |
| 3535 | - if (injectedStyles.has(hash)) { | |
| 3536 | - return; | |
| 3537 | - } | |
| 3538 | - if (documentContainsStyleHash2(targetDocument, hash)) { | |
| 3539 | - injectedStyles.add(hash); | |
| 3540 | - return; | |
| 3541 | - } | |
| 3542 | - const style = targetDocument.createElement("style"); | |
| 3543 | - style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); | |
| 3544 | - style.appendChild(targetDocument.createTextNode(css)); | |
| 3545 | - targetDocument.head.appendChild(style); | |
| 3546 | - injectedStyles.add(hash); | |
| 3547 | - } | |
| 3548 | - function registerDocument2(targetDocument) { | |
| 3549 | - const runtime = getRuntime2(); | |
| 3550 | - runtime.documents.set( | |
| 3551 | - targetDocument, | |
| 3552 | - (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 3553 | - ); | |
| 3554 | - for (const [hash, css] of runtime.styles) { | |
| 3555 | - injectStyle2(targetDocument, hash, css); | |
| 3556 | - } | |
| 3557 | - return () => { | |
| 3558 | - const count = runtime.documents.get(targetDocument); | |
| 3559 | - if (count === void 0) { | |
| 3560 | - return; | |
| 3561 | - } | |
| 3562 | - if (count <= 1) { | |
| 3563 | - runtime.documents.delete(targetDocument); | |
| 3564 | - return; | |
| 3565 | - } | |
| 3566 | - runtime.documents.set(targetDocument, count - 1); | |
| 3567 | - }; | |
| 3568 | - } | |
| 3569 | - function registerStyle2(hash, css) { | |
| 3570 | - const runtime = getRuntime2(); | |
| 3571 | - runtime.styles.set(hash, css); | |
| 3572 | - for (const targetDocument of runtime.documents.keys()) { | |
| 3573 | - injectStyle2(targetDocument, hash, css); | |
| 3574 | - } | |
| 3575 | - } | |
| 3576 | - if (typeof process === "undefined" || true) { | |
| 3577 | - 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}}}"); | |
| 3578 | - } | |
| 3579 | - var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; | |
| 3580 | - var VisuallyHidden = (0, import_element5.forwardRef)( | |
| 3581 | - function VisuallyHidden2({ render, ...restProps }, ref) { | |
| 3582 | - const element = useRender({ | |
| 3583 | - render, | |
| 3584 | - ref, | |
| 3585 | - props: mergeProps( | |
| 3586 | - { className: style_default2["visually-hidden"] }, | |
| 3587 | - restProps, | |
| 3588 | - { | |
| 3589 | - // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. | |
| 3590 | - "data-visually-hidden": "" | |
| 3591 | - } | |
| 3592 | - ) | |
| 3593 | - }); | |
| 3594 | - return element; | |
| 3595 | - } | |
| 3596 | - ); | |
| 3597 | - | |
| 3598 | - // packages/ui/build-module/link/link.mjs | |
| 3599 | - var import_element6 = __toESM(require_element(), 1); | |
| 3600 | - var import_i18n3 = __toESM(require_i18n(), 1); | |
| 3601 | - var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); | |
| 3602 | - var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; | |
| 3603 | - function getRuntime3() { | |
| 3604 | - const globalScope = globalThis; | |
| 3605 | - if (globalScope.__wpStyleRuntime) { | |
| 3606 | - return globalScope.__wpStyleRuntime; | |
| 3607 | - } | |
| 3608 | - globalScope.__wpStyleRuntime = { | |
| 3609 | - documents: /* @__PURE__ */ new Map(), | |
| 3610 | - styles: /* @__PURE__ */ new Map(), | |
| 3611 | - injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 3612 | - }; | |
| 3613 | - if (typeof document !== "undefined") { | |
| 3614 | - registerDocument3(document); | |
| 3615 | - } | |
| 3616 | - return globalScope.__wpStyleRuntime; | |
| 3617 | - } | |
| 3618 | - function documentContainsStyleHash3(targetDocument, hash) { | |
| 3619 | - if (!targetDocument.head) { | |
| 3620 | - return false; | |
| 3621 | - } | |
| 3622 | - for (const style of targetDocument.head.querySelectorAll( | |
| 3623 | - `style[${STYLE_HASH_ATTRIBUTE3}]` | |
| 3624 | - )) { | |
| 3625 | - if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) { | |
| 3626 | - return true; | |
| 3627 | - } | |
| 3628 | - } | |
| 3629 | - return false; | |
| 3630 | - } | |
| 3631 | - function injectStyle3(targetDocument, hash, css) { | |
| 3632 | - if (!targetDocument.head) { | |
| 3633 | - return; | |
| 3634 | - } | |
| 3635 | - const runtime = getRuntime3(); | |
| 3636 | - let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 3637 | - if (!injectedStyles) { | |
| 3638 | - injectedStyles = /* @__PURE__ */ new Set(); | |
| 3639 | - runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 3640 | - } | |
| 3641 | - if (injectedStyles.has(hash)) { | |
| 3642 | - return; | |
| 3643 | - } | |
| 3644 | - if (documentContainsStyleHash3(targetDocument, hash)) { | |
| 3645 | - injectedStyles.add(hash); | |
| 3646 | - return; | |
| 3647 | - } | |
| 3648 | - const style = targetDocument.createElement("style"); | |
| 3649 | - style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash); | |
| 3650 | - style.appendChild(targetDocument.createTextNode(css)); | |
| 3651 | - targetDocument.head.appendChild(style); | |
| 3652 | - injectedStyles.add(hash); | |
| 3653 | - } | |
| 3654 | - function registerDocument3(targetDocument) { | |
| 3655 | - const runtime = getRuntime3(); | |
| 3656 | - runtime.documents.set( | |
| 3657 | - targetDocument, | |
| 3658 | - (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 3659 | - ); | |
| 3660 | - for (const [hash, css] of runtime.styles) { | |
| 3661 | - injectStyle3(targetDocument, hash, css); | |
| 3662 | - } | |
| 3663 | - return () => { | |
| 3664 | - const count = runtime.documents.get(targetDocument); | |
| 3665 | - if (count === void 0) { | |
| 3666 | - return; | |
| 3667 | - } | |
| 3668 | - if (count <= 1) { | |
| 3669 | - runtime.documents.delete(targetDocument); | |
| 3670 | - return; | |
| 3671 | - } | |
| 3672 | - runtime.documents.set(targetDocument, count - 1); | |
| 3673 | - }; | |
| 3674 | - } | |
| 3675 | - function registerStyle3(hash, css) { | |
| 3676 | - const runtime = getRuntime3(); | |
| 3677 | - runtime.styles.set(hash, css); | |
| 3678 | - for (const targetDocument of runtime.documents.keys()) { | |
| 3679 | - injectStyle3(targetDocument, hash, css); | |
| 3680 | - } | |
| 3681 | - } | |
| 3682 | - if (typeof process === "undefined" || true) { | |
| 3683 | - registerStyle3("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); | |
| 3684 | - } | |
| 3685 | - var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; | |
| 3686 | - if (typeof process === "undefined" || true) { | |
| 3687 | - registerStyle3("5f8e7aa0bc", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._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,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,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,var(--wp-admin-theme-color,#3858e9));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); | |
| 3688 | - } | |
| 3689 | - 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" }; | |
| 3690 | - if (typeof process === "undefined" || true) { | |
| 3691 | - registerStyle3("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"}}}'); | |
| 3692 | - } | |
| 3693 | - 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" }; | |
| 3694 | - if (typeof process === "undefined" || true) { | |
| 3695 | - registerStyle3("af6d9984a6", "._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-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))}&::placeholder{color:var(--_gcd-input-placeholder-color,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)}"); | |
| 3696 | - } | |
| 3697 | - 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" }; | |
| 3698 | - var Link = (0, import_element6.forwardRef)(function Link2({ | |
| 3699 | - children, | |
| 3700 | - variant = "default", | |
| 3701 | - tone = "brand", | |
| 3702 | - openInNewTab = false, | |
| 3703 | - render, | |
| 3704 | - className, | |
| 3705 | - ...props | |
| 3706 | - }, ref) { | |
| 3707 | - const element = useRender({ | |
| 3708 | - render, | |
| 3709 | - defaultTagName: "a", | |
| 3710 | - ref, | |
| 3711 | - props: mergeProps(props, { | |
| 3712 | - className: clsx_default( | |
| 3713 | - global_css_defense_default.a, | |
| 3714 | - resets_default["box-sizing"], | |
| 3715 | - focus_default["outset-ring--focus-except-active"], | |
| 3716 | - variant !== "unstyled" && style_default3.link, | |
| 3717 | - variant !== "unstyled" && style_default3[`is-${tone}`], | |
| 3718 | - variant === "unstyled" && style_default3["is-unstyled"], | |
| 3719 | - className | |
| 3720 | - ), | |
| 3721 | - target: openInNewTab ? "_blank" : void 0, | |
| 3722 | - children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(import_jsx_runtime23.Fragment, { children: [ | |
| 3723 | - children, | |
| 3724 | - openInNewTab && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( | |
| 3725 | - "span", | |
| 3726 | - { | |
| 3727 | - className: style_default3["link-icon"], | |
| 3728 | - role: "img", | |
| 3729 | - "aria-label": ( | |
| 3730 | - /* translators: accessibility text appended to link text */ | |
| 3731 | - (0, import_i18n3.__)("(opens in a new tab)") | |
| 3732 | - ) | |
| 3733 | - } | |
| 3734 | - ) | |
| 3735 | - ] }) | |
| 3736 | - }) | |
| 3737 | - }); | |
| 3738 | - return element; | |
| 3739 | - }); | |
| 3740 | - | |
| 3741 | - // packages/ui/build-module/tabs/index.mjs | |
| 3742 | - var tabs_exports = {}; | |
| 3743 | - __export(tabs_exports, { | |
| 3744 | - List: () => List, | |
| 3745 | - Panel: () => Panel, | |
| 3746 | - Root: () => Root, | |
| 3747 | - Tab: () => Tab | |
| 3748 | - }); | |
| 3749 | - | |
| 3750 | - // packages/ui/build-module/tabs/list.mjs | |
| 3751 | - var import_element7 = __toESM(require_element(), 1); | |
| 3752 | - var import_compose = __toESM(require_compose(), 1); | |
| 3753 | - var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); | |
| 3754 | - var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; | |
| 3755 | - function getRuntime4() { | |
| 3756 | - const globalScope = globalThis; | |
| 3757 | - if (globalScope.__wpStyleRuntime) { | |
| 3758 | - return globalScope.__wpStyleRuntime; | |
| 3759 | - } | |
| 3760 | - globalScope.__wpStyleRuntime = { | |
| 3761 | - documents: /* @__PURE__ */ new Map(), | |
| 3762 | - styles: /* @__PURE__ */ new Map(), | |
| 3763 | - injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 3764 | - }; | |
| 3765 | - if (typeof document !== "undefined") { | |
| 3766 | - registerDocument4(document); | |
| 3767 | - } | |
| 3768 | - return globalScope.__wpStyleRuntime; | |
| 3769 | - } | |
| 3770 | - function documentContainsStyleHash4(targetDocument, hash) { | |
| 3771 | - if (!targetDocument.head) { | |
| 3772 | - return false; | |
| 3773 | - } | |
| 3774 | - for (const style of targetDocument.head.querySelectorAll( | |
| 3775 | - `style[${STYLE_HASH_ATTRIBUTE4}]` | |
| 3776 | - )) { | |
| 3777 | - if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) { | |
| 3778 | - return true; | |
| 3779 | - } | |
| 3780 | - } | |
| 3781 | - return false; | |
| 3782 | - } | |
| 3783 | - function injectStyle4(targetDocument, hash, css) { | |
| 3784 | - if (!targetDocument.head) { | |
| 3785 | - return; | |
| 3786 | - } | |
| 3787 | - const runtime = getRuntime4(); | |
| 3788 | - let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 3789 | - if (!injectedStyles) { | |
| 3790 | - injectedStyles = /* @__PURE__ */ new Set(); | |
| 3791 | - runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 3792 | - } | |
| 3793 | - if (injectedStyles.has(hash)) { | |
| 3794 | - return; | |
| 3795 | - } | |
| 3796 | - if (documentContainsStyleHash4(targetDocument, hash)) { | |
| 3797 | - injectedStyles.add(hash); | |
| 3798 | - return; | |
| 3799 | - } | |
| 3800 | - const style = targetDocument.createElement("style"); | |
| 3801 | - style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash); | |
| 3802 | - style.appendChild(targetDocument.createTextNode(css)); | |
| 3803 | - targetDocument.head.appendChild(style); | |
| 3804 | - injectedStyles.add(hash); | |
| 3805 | - } | |
| 3806 | - function registerDocument4(targetDocument) { | |
| 3807 | - const runtime = getRuntime4(); | |
| 3808 | - runtime.documents.set( | |
| 3809 | - targetDocument, | |
| 3810 | - (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 3811 | - ); | |
| 3812 | - for (const [hash, css] of runtime.styles) { | |
| 3813 | - injectStyle4(targetDocument, hash, css); | |
| 3814 | - } | |
| 3815 | - return () => { | |
| 3816 | - const count = runtime.documents.get(targetDocument); | |
| 3817 | - if (count === void 0) { | |
| 3818 | - return; | |
| 3819 | - } | |
| 3820 | - if (count <= 1) { | |
| 3821 | - runtime.documents.delete(targetDocument); | |
| 3822 | - return; | |
| 3823 | - } | |
| 3824 | - runtime.documents.set(targetDocument, count - 1); | |
| 3825 | - }; | |
| 3826 | - } | |
| 3827 | - function registerStyle4(hash, css) { | |
| 3828 | - const runtime = getRuntime4(); | |
| 3829 | - runtime.styles.set(hash, css); | |
| 3830 | - for (const targetDocument of runtime.documents.keys()) { | |
| 3831 | - injectStyle4(targetDocument, hash, css); | |
| 3832 | - } | |
| 3833 | - } | |
| 3834 | - if (typeof process === "undefined" || true) { | |
| 3835 | - registerStyle4("bb8cbb8f31", '@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-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}}}}'); | |
| 3836 | - } | |
| 3837 | - 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" }; | |
| 3838 | - var SCROLL_EPSILON = 1; | |
| 3839 | - var List = (0, import_element7.forwardRef)( | |
| 3840 | - function TabList({ | |
| 3841 | - children, | |
| 3842 | - variant = "default", | |
| 3843 | - className, | |
| 3844 | - activateOnFocus, | |
| 3845 | - ...otherProps | |
| 3846 | - }, forwardedRef) { | |
| 3847 | - const [listEl, setListEl] = (0, import_element7.useState)(null); | |
| 3848 | - const [overflow, setOverflow] = (0, import_element7.useState)({ | |
| 3849 | - first: false, | |
| 3850 | - last: false, | |
| 3851 | - isScrolling: false | |
| 3852 | - }); | |
| 3853 | - (0, import_element7.useEffect)(() => { | |
| 3854 | - if (!listEl) { | |
| 3855 | - return; | |
| 3856 | - } | |
| 3857 | - const measureOverflow = () => { | |
| 3858 | - const { scrollWidth, clientWidth, scrollLeft } = listEl; | |
| 3859 | - const maxScroll = Math.max(scrollWidth - clientWidth, 0); | |
| 3860 | - const direction = listEl.dir || (typeof window !== "undefined" ? window.getComputedStyle(listEl).direction : "ltr"); | |
| 3861 | - const scrollFromStart = direction === "rtl" && scrollLeft < 0 ? ( | |
| 3862 | - // In RTL layouts, scrollLeft is typically 0 at the visual "start" | |
| 3863 | - // (right edge) and becomes negative toward the "end" (left edge). | |
| 3864 | - // Normalize value for correct first/last detection logic. | |
| 3865 | - -scrollLeft | |
| 3866 | - ) : scrollLeft; | |
| 3867 | - const next = { | |
| 3868 | - first: scrollFromStart > SCROLL_EPSILON, | |
| 3869 | - last: scrollFromStart < maxScroll - SCROLL_EPSILON, | |
| 3870 | - isScrolling: scrollWidth > clientWidth | |
| 3871 | - }; | |
| 3872 | - setOverflow( | |
| 3873 | - (prev) => prev.first === next.first && prev.last === next.last && prev.isScrolling === next.isScrolling ? prev : next | |
| 3874 | - ); | |
| 3875 | - }; | |
| 3876 | - const resizeObserver = new ResizeObserver(measureOverflow); | |
| 3877 | - const observeTabs = () => { | |
| 3878 | - resizeObserver.disconnect(); | |
| 3879 | - resizeObserver.observe(listEl); | |
| 3880 | - listEl.querySelectorAll('[role="tab"]').forEach((tab) => resizeObserver.observe(tab)); | |
| 3881 | - }; | |
| 3882 | - const mutationObserver = new MutationObserver(observeTabs); | |
| 3883 | - mutationObserver.observe(listEl, { | |
| 3884 | - childList: true, | |
| 3885 | - subtree: true | |
| 3886 | - }); | |
| 3887 | - let scrollTick = false; | |
| 3888 | - const throttleMeasureOverflowOnScroll = () => { | |
| 3889 | - if (!scrollTick) { | |
| 3890 | - requestAnimationFrame(() => { | |
| 3891 | - measureOverflow(); | |
| 3892 | - scrollTick = false; | |
| 3893 | - }); | |
| 3894 | - scrollTick = true; | |
| 3895 | - } | |
| 3896 | - }; | |
| 3897 | - listEl.addEventListener( | |
| 3898 | - "scroll", | |
| 3899 | - throttleMeasureOverflowOnScroll, | |
| 3900 | - { passive: true } | |
| 3901 | - ); | |
| 3902 | - observeTabs(); | |
| 3903 | - measureOverflow(); | |
| 3904 | - return () => { | |
| 3905 | - listEl.removeEventListener( | |
| 3906 | - "scroll", | |
| 3907 | - throttleMeasureOverflowOnScroll | |
| 3908 | - ); | |
| 3909 | - resizeObserver.disconnect(); | |
| 3910 | - mutationObserver.disconnect(); | |
| 3911 | - }; | |
| 3912 | - }, [listEl]); | |
| 3913 | - const mergedListRef = (0, import_compose.useMergeRefs)([ | |
| 3914 | - forwardedRef, | |
| 3915 | - (el) => setListEl(el) | |
| 3916 | - ]); | |
| 3917 | - return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)( | |
| 3918 | - index_parts_exports.List, | |
| 3919 | - { | |
| 3920 | - ref: mergedListRef, | |
| 3921 | - activateOnFocus, | |
| 3922 | - "data-select-on-move": activateOnFocus ? "true" : "false", | |
| 3923 | - className: clsx_default( | |
| 3924 | - style_default4.tablist, | |
| 3925 | - overflow.first && style_default4["is-overflowing-first"], | |
| 3926 | - overflow.last && style_default4["is-overflowing-last"], | |
| 3927 | - style_default4[`is-${variant}-variant`], | |
| 3928 | - className | |
| 3929 | - ), | |
| 3930 | - ...otherProps, | |
| 3931 | - tabIndex: otherProps.tabIndex ?? (overflow.isScrolling ? -1 : void 0), | |
| 3932 | - children: [ | |
| 3933 | - children, | |
| 3934 | - /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(index_parts_exports.Indicator, { className: style_default4.indicator }) | |
| 3935 | - ] | |
| 3936 | - } | |
| 3937 | - ); | |
| 3938 | - } | |
| 3939 | - ); | |
| 3940 | - | |
| 3941 | - // packages/ui/build-module/tabs/panel.mjs | |
| 3942 | - var import_element9 = __toESM(require_element(), 1); | |
| 3943 | - | |
| 3944 | - // packages/ui/build-module/tabs/context.mjs | |
| 3945 | - var import_element8 = __toESM(require_element(), 1); | |
| 3946 | - var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); | |
| 3947 | - var VALIDATION_ENABLED = true; | |
| 3948 | - var TabsValidationContext = VALIDATION_ENABLED ? (0, import_element8.createContext)(null) : null; | |
| 3949 | - function useRegisterTabDev() { | |
| 3950 | - const context = (0, import_element8.useContext)(TabsValidationContext); | |
| 3951 | - (0, import_element8.useEffect)(() => { | |
| 3952 | - if (context) { | |
| 3953 | - return context.registerTab(); | |
| 3954 | - } | |
| 3955 | - return void 0; | |
| 3956 | - }, [context]); | |
| 3957 | - } | |
| 3958 | - function useRegisterTabProd() { | |
| 3959 | - } | |
| 3960 | - var useRegisterTab = VALIDATION_ENABLED ? useRegisterTabDev : useRegisterTabProd; | |
| 3961 | - function useRegisterPanelDev() { | |
| 3962 | - const context = (0, import_element8.useContext)(TabsValidationContext); | |
| 3963 | - (0, import_element8.useEffect)(() => { | |
| 3964 | - if (context) { | |
| 3965 | - return context.registerPanel(); | |
| 3966 | - } | |
| 3967 | - return void 0; | |
| 3968 | - }, [context]); | |
| 3969 | - } | |
| 3970 | - function useRegisterPanelProd() { | |
| 3971 | - } | |
| 3972 | - var useRegisterPanel = VALIDATION_ENABLED ? useRegisterPanelDev : useRegisterPanelProd; | |
| 3973 | - function TabsValidationProviderDev({ | |
| 3974 | - children | |
| 3975 | - }) { | |
| 3976 | - const tabCountRef = (0, import_element8.useRef)(0); | |
| 3977 | - const panelCountRef = (0, import_element8.useRef)(0); | |
| 3978 | - const scheduleValidation = useScheduleValidation(() => { | |
| 3979 | - const tabCount = tabCountRef.current; | |
| 3980 | - const panelCount = panelCountRef.current; | |
| 3981 | - if (tabCount !== panelCount) { | |
| 3982 | - throw new Error( | |
| 3983 | - `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.` | |
| 3984 | - ); | |
| 3985 | - } | |
| 3986 | - }); | |
| 3987 | - const registerTab = (0, import_element8.useCallback)(() => { | |
| 3988 | - tabCountRef.current += 1; | |
| 3989 | - scheduleValidation(); | |
| 3990 | - return () => { | |
| 3991 | - tabCountRef.current -= 1; | |
| 3992 | - scheduleValidation(); | |
| 3993 | - }; | |
| 3994 | - }, [scheduleValidation]); | |
| 3995 | - const registerPanel = (0, import_element8.useCallback)(() => { | |
| 3996 | - panelCountRef.current += 1; | |
| 3997 | - scheduleValidation(); | |
| 3998 | - return () => { | |
| 3999 | - panelCountRef.current -= 1; | |
| 4000 | - scheduleValidation(); | |
| 4001 | - }; | |
| 4002 | - }, [scheduleValidation]); | |
| 4003 | - const contextValue = (0, import_element8.useMemo)( | |
| 4004 | - () => ({ | |
| 4005 | - registerTab, | |
| 4006 | - registerPanel | |
| 4007 | - }), | |
| 4008 | - [registerTab, registerPanel] | |
| 4009 | - ); | |
| 4010 | - return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(TabsValidationContext.Provider, { value: contextValue, children }); | |
| 4011 | - } | |
| 4012 | - function TabsValidationProviderProd({ | |
| 4013 | - children | |
| 4014 | - }) { | |
| 4015 | - return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(import_jsx_runtime25.Fragment, { children }); | |
| 4016 | - } | |
| 4017 | - var TabsValidationProvider = VALIDATION_ENABLED ? TabsValidationProviderDev : TabsValidationProviderProd; | |
| 4018 | - | |
| 4019 | - // packages/ui/build-module/tabs/panel.mjs | |
| 4020 | - var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); | |
| 4021 | - var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; | |
| 4022 | - function getRuntime5() { | |
| 4023 | - const globalScope = globalThis; | |
| 4024 | - if (globalScope.__wpStyleRuntime) { | |
| 4025 | - return globalScope.__wpStyleRuntime; | |
| 4026 | - } | |
| 4027 | - globalScope.__wpStyleRuntime = { | |
| 4028 | - documents: /* @__PURE__ */ new Map(), | |
| 4029 | - styles: /* @__PURE__ */ new Map(), | |
| 4030 | - injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 4031 | - }; | |
| 4032 | - if (typeof document !== "undefined") { | |
| 4033 | - registerDocument5(document); | |
| 4034 | - } | |
| 4035 | - return globalScope.__wpStyleRuntime; | |
| 4036 | - } | |
| 4037 | - function documentContainsStyleHash5(targetDocument, hash) { | |
| 4038 | - if (!targetDocument.head) { | |
| 4039 | - return false; | |
| 4040 | - } | |
| 4041 | - for (const style of targetDocument.head.querySelectorAll( | |
| 4042 | - `style[${STYLE_HASH_ATTRIBUTE5}]` | |
| 4043 | - )) { | |
| 4044 | - if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) { | |
| 4045 | - return true; | |
| 4046 | - } | |
| 4047 | - } | |
| 4048 | - return false; | |
| 4049 | - } | |
| 4050 | - function injectStyle5(targetDocument, hash, css) { | |
| 4051 | - if (!targetDocument.head) { | |
| 4052 | - return; | |
| 4053 | - } | |
| 4054 | - const runtime = getRuntime5(); | |
| 4055 | - let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 4056 | - if (!injectedStyles) { | |
| 4057 | - injectedStyles = /* @__PURE__ */ new Set(); | |
| 4058 | - runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 4059 | - } | |
| 4060 | - if (injectedStyles.has(hash)) { | |
| 4061 | - return; | |
| 4062 | - } | |
| 4063 | - if (documentContainsStyleHash5(targetDocument, hash)) { | |
| 4064 | - injectedStyles.add(hash); | |
| 4065 | - return; | |
| 4066 | - } | |
| 4067 | - const style = targetDocument.createElement("style"); | |
| 4068 | - style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash); | |
| 4069 | - style.appendChild(targetDocument.createTextNode(css)); | |
| 4070 | - targetDocument.head.appendChild(style); | |
| 4071 | - injectedStyles.add(hash); | |
| 4072 | - } | |
| 4073 | - function registerDocument5(targetDocument) { | |
| 4074 | - const runtime = getRuntime5(); | |
| 4075 | - runtime.documents.set( | |
| 4076 | - targetDocument, | |
| 4077 | - (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 4078 | - ); | |
| 4079 | - for (const [hash, css] of runtime.styles) { | |
| 4080 | - injectStyle5(targetDocument, hash, css); | |
| 4081 | - } | |
| 4082 | - return () => { | |
| 4083 | - const count = runtime.documents.get(targetDocument); | |
| 4084 | - if (count === void 0) { | |
| 4085 | - return; | |
| 4086 | - } | |
| 4087 | - if (count <= 1) { | |
| 4088 | - runtime.documents.delete(targetDocument); | |
| 4089 | - return; | |
| 4090 | - } | |
| 4091 | - runtime.documents.set(targetDocument, count - 1); | |
| 4092 | - }; | |
| 4093 | - } | |
| 4094 | - function registerStyle5(hash, css) { | |
| 4095 | - const runtime = getRuntime5(); | |
| 4096 | - runtime.styles.set(hash, css); | |
| 4097 | - for (const targetDocument of runtime.documents.keys()) { | |
| 4098 | - injectStyle5(targetDocument, hash, css); | |
| 4099 | - } | |
| 4100 | - } | |
| 4101 | - if (typeof process === "undefined" || true) { | |
| 4102 | - registerStyle5("af6d9984a6", "._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-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))}&::placeholder{color:var(--_gcd-input-placeholder-color,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)}"); | |
| 4103 | - } | |
| 4104 | - 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" }; | |
| 4105 | - if (typeof process === "undefined" || true) { | |
| 4106 | - registerStyle5("5f8e7aa0bc", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._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,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,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,var(--wp-admin-theme-color,#3858e9));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); | |
| 4107 | - } | |
| 4108 | - 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" }; | |
| 4109 | - var Panel = (0, import_element9.forwardRef)( | |
| 4110 | - function TabPanel({ className, ...otherProps }, forwardedRef) { | |
| 4111 | - useRegisterPanel(); | |
| 4112 | - return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( | |
| 4113 | - index_parts_exports.Panel, | |
| 4114 | - { | |
| 4115 | - ref: forwardedRef, | |
| 4116 | - className: clsx_default( | |
| 4117 | - global_css_defense_default2.div, | |
| 4118 | - focus_default2["outset-ring--focus-visible"], | |
| 4119 | - className | |
| 4120 | - ), | |
| 4121 | - ...otherProps | |
| 4122 | - } | |
| 4123 | - ); | |
| 4124 | - } | |
| 4125 | - ); | |
| 4126 | - | |
| 4127 | - // packages/ui/build-module/tabs/root.mjs | |
| 4128 | - var import_element10 = __toESM(require_element(), 1); | |
| 4129 | - var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); | |
| 4130 | - var Root = (0, import_element10.forwardRef)( | |
| 4131 | - function TabsRoot3({ ...otherProps }, forwardedRef) { | |
| 4132 | - return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(TabsValidationProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Root, { ref: forwardedRef, ...otherProps }) }); | |
| 4133 | - } | |
| 4134 | - ); | |
| 4135 | - | |
| 4136 | - // packages/ui/build-module/tabs/tab.mjs | |
| 4137 | - var import_element11 = __toESM(require_element(), 1); | |
| 4138 | - var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); | |
| 4139 | - var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash"; | |
| 4140 | - function getRuntime6() { | |
| 4141 | - const globalScope = globalThis; | |
| 4142 | - if (globalScope.__wpStyleRuntime) { | |
| 4143 | - return globalScope.__wpStyleRuntime; | |
| 4144 | - } | |
| 4145 | - globalScope.__wpStyleRuntime = { | |
| 4146 | - documents: /* @__PURE__ */ new Map(), | |
| 4147 | - styles: /* @__PURE__ */ new Map(), | |
| 4148 | - injectedStyles: /* @__PURE__ */ new WeakMap() | |
| 4149 | - }; | |
| 4150 | - if (typeof document !== "undefined") { | |
| 4151 | - registerDocument6(document); | |
| 4152 | - } | |
| 4153 | - return globalScope.__wpStyleRuntime; | |
| 4154 | - } | |
| 4155 | - function documentContainsStyleHash6(targetDocument, hash) { | |
| 4156 | - if (!targetDocument.head) { | |
| 4157 | - return false; | |
| 4158 | - } | |
| 4159 | - for (const style of targetDocument.head.querySelectorAll( | |
| 4160 | - `style[${STYLE_HASH_ATTRIBUTE6}]` | |
| 4161 | - )) { | |
| 4162 | - if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) { | |
| 4163 | - return true; | |
| 4164 | - } | |
| 4165 | - } | |
| 4166 | - return false; | |
| 4167 | - } | |
| 4168 | - function injectStyle6(targetDocument, hash, css) { | |
| 4169 | - if (!targetDocument.head) { | |
| 4170 | - return; | |
| 4171 | - } | |
| 4172 | - const runtime = getRuntime6(); | |
| 4173 | - let injectedStyles = runtime.injectedStyles.get(targetDocument); | |
| 4174 | - if (!injectedStyles) { | |
| 4175 | - injectedStyles = /* @__PURE__ */ new Set(); | |
| 4176 | - runtime.injectedStyles.set(targetDocument, injectedStyles); | |
| 4177 | - } | |
| 4178 | - if (injectedStyles.has(hash)) { | |
| 4179 | - return; | |
| 4180 | - } | |
| 4181 | - if (documentContainsStyleHash6(targetDocument, hash)) { | |
| 4182 | - injectedStyles.add(hash); | |
| 4183 | - return; | |
| 4184 | - } | |
| 4185 | - const style = targetDocument.createElement("style"); | |
| 4186 | - style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash); | |
| 4187 | - style.appendChild(targetDocument.createTextNode(css)); | |
| 4188 | - targetDocument.head.appendChild(style); | |
| 4189 | - injectedStyles.add(hash); | |
| 4190 | - } | |
| 4191 | - function registerDocument6(targetDocument) { | |
| 4192 | - const runtime = getRuntime6(); | |
| 4193 | - runtime.documents.set( | |
| 4194 | - targetDocument, | |
| 4195 | - (runtime.documents.get(targetDocument) ?? 0) + 1 | |
| 4196 | - ); | |
| 4197 | - for (const [hash, css] of runtime.styles) { | |
| 4198 | - injectStyle6(targetDocument, hash, css); | |
| 4199 | - } | |
| 4200 | - return () => { | |
| 4201 | - const count = runtime.documents.get(targetDocument); | |
| 4202 | - if (count === void 0) { | |
| 4203 | - return; | |
| 4204 | - } | |
| 4205 | - if (count <= 1) { | |
| 4206 | - runtime.documents.delete(targetDocument); | |
| 4207 | - return; | |
| 4208 | - } | |
| 4209 | - runtime.documents.set(targetDocument, count - 1); | |
| 4210 | - }; | |
| 4211 | - } | |
| 4212 | - function registerStyle6(hash, css) { | |
| 4213 | - const runtime = getRuntime6(); | |
| 4214 | - runtime.styles.set(hash, css); | |
| 4215 | - for (const targetDocument of runtime.documents.keys()) { | |
| 4216 | - injectStyle6(targetDocument, hash, css); | |
| 4217 | - } | |
| 4218 | - } | |
| 4219 | - if (typeof process === "undefined" || true) { | |
| 4220 | - registerStyle6("bb8cbb8f31", '@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-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}}}}'); | |
| 4221 | - } | |
| 4222 | - 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" }; | |
| 4223 | - var Tab = (0, import_element11.forwardRef)(function Tab2({ className, children, ...otherProps }, forwardedRef) { | |
| 4224 | - useRegisterTab(); | |
| 4225 | - return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)( | |
| 4226 | - index_parts_exports.Tab, | |
| 4227 | - { | |
| 4228 | - ref: forwardedRef, | |
| 4229 | - className: clsx_default(style_default5.tab, className), | |
| 4230 | - ...otherProps, | |
| 4231 | - children: [ | |
| 4232 | - /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { className: style_default5["tab-children"], children }), | |
| 4233 | - /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Icon, { icon: chevron_right_default, className: style_default5["tab-chevron"] }) | |
| 4234 | - ] | |
| 4235 | - } | |
| 4236 | - ); | |
| 4237 | - }); | |
| 4238 | - | |
| 4239 | - // packages/format-library/build-module/image/index.mjs | |
| 4240 | - var import_i18n4 = __toESM(require_i18n(), 1); | |
| 4241 | - var import_element12 = __toESM(require_element(), 1); | |
| 4242 | 329 | var import_rich_text3 = __toESM(require_rich_text(), 1); |
| 4243 | 330 | var import_block_editor3 = __toESM(require_block_editor(), 1); |
| 4244 | - var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); | |
| 331 | + var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); | |
| 4245 | 332 | var ALLOWED_MEDIA_TYPES = ["image"]; |
| 4246 | 333 | var name3 = "core/image"; |
| 4247 | - var title3 = (0, import_i18n4.__)("Inline image"); | |
| 334 | + var title3 = (0, import_i18n3.__)("Inline image"); | |
| 4248 | 335 | function getCurrentImageId(activeObjectAttributes) { |
| 4249 | 336 | if (!activeObjectAttributes?.className) { |
| 4250 | 337 | return void 0; |
| 4251 | 338 | } |
| @@ -4254,9 +341,9 @@ | ||
| 4254 | 341 | } |
| 4255 | 342 | var image = { |
| 4256 | 343 | name: name3, |
| 4257 | 344 | title: title3, |
| 4258 | - keywords: [(0, import_i18n4.__)("photo"), (0, import_i18n4.__)("media")], | |
| 345 | + keywords: [(0, import_i18n3.__)("photo"), (0, import_i18n3.__)("media")], | |
| 4259 | 346 | object: true, |
| 4260 | 347 | tagName: "img", |
| 4261 | 348 | className: null, |
| 4262 | 349 | attributes: { |
| @@ -4269,22 +356,22 @@ | ||
| 4269 | 356 | }; |
| 4270 | 357 | function InlineUI({ value, onChange, activeObjectAttributes, contentRef }) { |
| 4271 | 358 | const { style, alt } = activeObjectAttributes; |
| 4272 | 359 | const width = style?.replace(/\D/g, ""); |
| 4273 | - const [editedWidth, setEditedWidth] = (0, import_element12.useState)(width); | |
| 4274 | - const [editedAlt, setEditedAlt] = (0, import_element12.useState)(alt); | |
| 360 | + const [editedWidth, setEditedWidth] = (0, import_element2.useState)(width); | |
| 361 | + const [editedAlt, setEditedAlt] = (0, import_element2.useState)(alt); | |
| 4275 | 362 | const hasChanged = editedWidth !== width || editedAlt !== alt; |
| 4276 | 363 | const popoverAnchor = (0, import_rich_text3.useAnchor)({ |
| 4277 | 364 | editableContentElement: contentRef.current, |
| 4278 | 365 | settings: image |
| 4279 | 366 | }); |
| 4280 | - return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 367 | + return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4281 | 368 | import_components.Popover, |
| 4282 | 369 | { |
| 4283 | 370 | focusOnMount: false, |
| 4284 | 371 | anchor: popoverAnchor, |
| 4285 | 372 | className: "block-editor-format-toolbar__image-popover", |
| 4286 | - children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 373 | + children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4287 | 374 | "form", |
| 4288 | 375 | { |
| 4289 | 376 | className: "block-editor-format-toolbar__image-container-content", |
| 4290 | 377 | onSubmit: (event) => { |
| @@ -4302,13 +389,14 @@ | ||
| 4302 | 389 | replacements: newReplacements |
| 4303 | 390 | }); |
| 4304 | 391 | event.preventDefault(); |
| 4305 | 392 | }, |
| 4306 | - children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Stack, { direction: "column", gap: "lg", children: [ | |
| 4307 | - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 393 | + children: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_components.__experimentalVStack, { spacing: 4, children: [ | |
| 394 | + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4308 | 395 | import_components.__experimentalNumberControl, |
| 4309 | 396 | { |
| 4310 | - label: (0, import_i18n4.__)("Width"), | |
| 397 | + __next40pxDefaultSize: true, | |
| 398 | + label: (0, import_i18n3.__)("Width"), | |
| 4311 | 399 | value: editedWidth, |
| 4312 | 400 | min: 1, |
| 4313 | 401 | onChange: (newWidth) => { |
| 4314 | 402 | setEditedWidth(newWidth); |
| @@ -4314,38 +402,37 @@ | ||
| 4314 | 402 | setEditedWidth(newWidth); |
| 4315 | 403 | } |
| 4316 | 404 | } |
| 4317 | 405 | ), |
| 4318 | - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 406 | + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4319 | 407 | import_components.TextareaControl, |
| 4320 | 408 | { |
| 4321 | - label: (0, import_i18n4.__)("Alternative text"), | |
| 409 | + label: (0, import_i18n3.__)("Alternative text"), | |
| 4322 | 410 | value: editedAlt, |
| 4323 | 411 | onChange: (newAlt) => { |
| 4324 | 412 | setEditedAlt(newAlt); |
| 4325 | 413 | }, |
| 4326 | - help: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [ | |
| 4327 | - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 4328 | - Link, | |
| 414 | + help: /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_jsx_runtime16.Fragment, { children: [ | |
| 415 | + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 416 | + import_components.ExternalLink, | |
| 4329 | 417 | { |
| 4330 | - openInNewTab: true, | |
| 4331 | 418 | href: ( |
| 4332 | 419 | // translators: Localized tutorial, if one exists. W3C Web Accessibility Initiative link has list of existing translations. |
| 4333 | - (0, import_i18n4.__)( | |
| 420 | + (0, import_i18n3.__)( | |
| 4334 | 421 | "https://www.w3.org/WAI/tutorials/images/decision-tree/" |
| 4335 | 422 | ) |
| 4336 | 423 | ), |
| 4337 | - children: (0, import_i18n4.__)( | |
| 424 | + children: (0, import_i18n3.__)( | |
| 4338 | 425 | "Describe the purpose of the image." |
| 4339 | 426 | ) |
| 4340 | 427 | } |
| 4341 | 428 | ), |
| 4342 | - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("br", {}), | |
| 4343 | - (0, import_i18n4.__)("Leave empty if decorative.") | |
| 429 | + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)("br", {}), | |
| 430 | + (0, import_i18n3.__)("Leave empty if decorative.") | |
| 4344 | 431 | ] }) |
| 4345 | 432 | } |
| 4346 | 433 | ), |
| 4347 | - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 434 | + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_components.__experimentalHStack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4348 | 435 | import_components.Button, |
| 4349 | 436 | { |
| 4350 | 437 | disabled: !hasChanged, |
| 4351 | 438 | accessibleWhenDisabled: true, |
| @@ -4351,9 +438,9 @@ | ||
| 4351 | 438 | accessibleWhenDisabled: true, |
| 4352 | 439 | variant: "primary", |
| 4353 | 440 | type: "submit", |
| 4354 | 441 | size: "compact", |
| 4355 | - children: (0, import_i18n4.__)("Apply") | |
| 442 | + children: (0, import_i18n3.__)("Apply") | |
| 4356 | 443 | } |
| 4357 | 444 | ) }) |
| 4358 | 445 | ] }) |
| 4359 | 446 | } |
| @@ -4368,10 +455,10 @@ | ||
| 4368 | 455 | isObjectActive, |
| 4369 | 456 | activeObjectAttributes, |
| 4370 | 457 | contentRef |
| 4371 | 458 | }) { |
| 4372 | - return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_block_editor3.MediaUploadCheck, { children: [ | |
| 4373 | - /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 459 | + return /* @__PURE__ */ (0, import_jsx_runtime16.jsxs)(import_block_editor3.MediaUploadCheck, { children: [ | |
| 460 | + /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4374 | 461 | import_block_editor3.MediaUpload, |
| 4375 | 462 | { |
| 4376 | 463 | allowedTypes: ALLOWED_MEDIA_TYPES, |
| 4377 | 464 | value: getCurrentImageId(activeObjectAttributes), |
| @@ -4391,20 +478,20 @@ | ||
| 4391 | 478 | }) |
| 4392 | 479 | ); |
| 4393 | 480 | onFocus(); |
| 4394 | 481 | }, |
| 4395 | - render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 482 | + render: ({ open }) => /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4396 | 483 | import_block_editor3.RichTextToolbarButton, |
| 4397 | 484 | { |
| 4398 | - icon: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 485 | + icon: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4399 | 486 | import_components.SVG, |
| 4400 | 487 | { |
| 4401 | 488 | xmlns: "http://www.w3.org/2000/svg", |
| 4402 | 489 | viewBox: "0 0 24 24", |
| 4403 | - 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" }) | |
| 490 | + children: /* @__PURE__ */ (0, import_jsx_runtime16.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" }) | |
| 4404 | 491 | } |
| 4405 | 492 | ), |
| 4406 | - title: isObjectActive ? (0, import_i18n4.__)("Replace image") : title3, | |
| 493 | + title: isObjectActive ? (0, import_i18n3.__)("Replace image") : title3, | |
| 4407 | 494 | onClick: open, |
| 4408 | 495 | isActive: isObjectActive |
| 4409 | 496 | } |
| 4410 | 497 | ) |
| @@ -4409,9 +496,9 @@ | ||
| 4409 | 496 | } |
| 4410 | 497 | ) |
| 4411 | 498 | } |
| 4412 | 499 | ), |
| 4413 | - isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 500 | + isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( | |
| 4414 | 501 | InlineUI, |
| 4415 | 502 | { |
| 4416 | 503 | value, |
| 4417 | 504 | onChange, |
| @@ -4422,14 +509,14 @@ | ||
| 4422 | 509 | ] }); |
| 4423 | 510 | } |
| 4424 | 511 | |
| 4425 | 512 | // packages/format-library/build-module/italic/index.mjs |
| 4426 | - var import_i18n5 = __toESM(require_i18n(), 1); | |
| 513 | + var import_i18n4 = __toESM(require_i18n(), 1); | |
| 4427 | 514 | var import_rich_text4 = __toESM(require_rich_text(), 1); |
| 4428 | 515 | var import_block_editor4 = __toESM(require_block_editor(), 1); |
| 4429 | - var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); | |
| 516 | + var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); | |
| 4430 | 517 | var name4 = "core/italic"; |
| 4431 | - var title4 = (0, import_i18n5.__)("Italic"); | |
| 518 | + var title4 = (0, import_i18n4.__)("Italic"); | |
| 4432 | 519 | var italic = { |
| 4433 | 520 | name: name4, |
| 4434 | 521 | title: title4, |
| 4435 | 522 | tagName: "em", |
| @@ -4441,10 +528,10 @@ | ||
| 4441 | 528 | function onClick() { |
| 4442 | 529 | onChange((0, import_rich_text4.toggleFormat)(value, { type: name4 })); |
| 4443 | 530 | onFocus(); |
| 4444 | 531 | } |
| 4445 | - return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [ | |
| 4446 | - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 532 | + return /* @__PURE__ */ (0, import_jsx_runtime17.jsxs)(import_jsx_runtime17.Fragment, { children: [ | |
| 533 | + /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( | |
| 4447 | 534 | import_block_editor4.RichTextShortcut, |
| 4448 | 535 | { |
| 4449 | 536 | type: "primary", |
| 4450 | 537 | character: "i", |
| @@ -4450,9 +537,9 @@ | ||
| 4450 | 537 | character: "i", |
| 4451 | 538 | onUse: onToggle |
| 4452 | 539 | } |
| 4453 | 540 | ), |
| 4454 | - isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 541 | + isVisible && /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( | |
| 4455 | 542 | import_block_editor4.RichTextToolbarButton, |
| 4456 | 543 | { |
| 4457 | 544 | name: "italic", |
| 4458 | 545 | icon: format_italic_default, |
| @@ -4462,9 +549,9 @@ | ||
| 4462 | 549 | shortcutType: "primary", |
| 4463 | 550 | shortcutCharacter: "i" |
| 4464 | 551 | } |
| 4465 | 552 | ), |
| 4466 | - /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 553 | + /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( | |
| 4467 | 554 | import_block_editor4.__unstableRichTextInputEvent, |
| 4468 | 555 | { |
| 4469 | 556 | inputType: "formatItalic", |
| 4470 | 557 | onInput: onToggle |
| @@ -4474,10 +561,10 @@ | ||
| 4474 | 561 | } |
| 4475 | 562 | }; |
| 4476 | 563 | |
| 4477 | 564 | // packages/format-library/build-module/link/index.mjs |
| 4478 | - var import_i18n8 = __toESM(require_i18n(), 1); | |
| 4479 | - var import_element15 = __toESM(require_element(), 1); | |
| 565 | + var import_i18n7 = __toESM(require_i18n(), 1); | |
| 566 | + var import_element5 = __toESM(require_element(), 1); | |
| 4480 | 567 | var import_rich_text6 = __toESM(require_rich_text(), 1); |
| 4481 | 568 | var import_url3 = __toESM(require_url(), 1); |
| 4482 | 569 | var import_block_editor6 = __toESM(require_block_editor(), 1); |
| 4483 | 570 | var import_html_entities = __toESM(require_html_entities(), 1); |
| @@ -4483,10 +570,10 @@ | ||
| 4483 | 570 | var import_html_entities = __toESM(require_html_entities(), 1); |
| 4484 | 571 | var import_a11y2 = __toESM(require_a11y(), 1); |
| 4485 | 572 | |
| 4486 | 573 | // packages/format-library/build-module/link/inline.mjs |
| 4487 | - var import_element14 = __toESM(require_element(), 1); | |
| 4488 | - var import_i18n7 = __toESM(require_i18n(), 1); | |
| 574 | + var import_element4 = __toESM(require_element(), 1); | |
| 575 | + var import_i18n6 = __toESM(require_i18n(), 1); | |
| 4489 | 576 | var import_a11y = __toESM(require_a11y(), 1); |
| 4490 | 577 | var import_components3 = __toESM(require_components(), 1); |
| 4491 | 578 | var import_url2 = __toESM(require_url(), 1); |
| 4492 | 579 | var import_rich_text5 = __toESM(require_rich_text(), 1); |
| @@ -4554,9 +641,9 @@ | ||
| 4554 | 641 | format.attributes.id = id; |
| 4555 | 642 | } |
| 4556 | 643 | if (opensInNewWindow) { |
| 4557 | 644 | format.attributes.target = "_blank"; |
| 4558 | - format.attributes.rel = format.attributes.rel ? format.attributes.rel + " noopener" : "noopener"; | |
| 645 | + format.attributes.rel = format.attributes.rel ? format.attributes.rel + " noreferrer noopener" : "noreferrer noopener"; | |
| 4559 | 646 | } |
| 4560 | 647 | if (nofollow) { |
| 4561 | 648 | format.attributes.rel = format.attributes.rel ? format.attributes.rel + " nofollow" : "nofollow"; |
| 4562 | 649 | } |
| @@ -4627,17 +714,17 @@ | ||
| 4627 | 714 | var walkToStart = partialRight(walkToBoundary, "backwards"); |
| 4628 | 715 | var walkToEnd = partialRight(walkToBoundary, "forwards"); |
| 4629 | 716 | |
| 4630 | 717 | // packages/format-library/build-module/link/css-classes-setting.mjs |
| 4631 | - var import_element13 = __toESM(require_element(), 1); | |
| 4632 | - var import_compose2 = __toESM(require_compose(), 1); | |
| 4633 | - var import_i18n6 = __toESM(require_i18n(), 1); | |
| 718 | + var import_element3 = __toESM(require_element(), 1); | |
| 719 | + var import_compose = __toESM(require_compose(), 1); | |
| 720 | + var import_i18n5 = __toESM(require_i18n(), 1); | |
| 4634 | 721 | var import_components2 = __toESM(require_components(), 1); |
| 4635 | - var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); | |
| 722 | + var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); | |
| 4636 | 723 | var CSSClassesSettingComponent = ({ setting, value, onChange }) => { |
| 4637 | 724 | const hasValue = value ? value?.cssClasses?.length > 0 : false; |
| 4638 | - const [isSettingActive, setIsSettingActive] = (0, import_element13.useState)(hasValue); | |
| 4639 | - const instanceId = (0, import_compose2.useInstanceId)(CSSClassesSettingComponent); | |
| 725 | + const [isSettingActive, setIsSettingActive] = (0, import_element3.useState)(hasValue); | |
| 726 | + const instanceId = (0, import_compose.useInstanceId)(CSSClassesSettingComponent); | |
| 4640 | 727 | const controlledRegionId = `css-classes-setting-${instanceId}`; |
| 4641 | 728 | const handleSettingChange = (newValue) => { |
| 4642 | 729 | const sanitizedValue = typeof newValue === "string" ? newValue.replace(/,/g, " ").replace(/\s+/g, " ").trim() : newValue; |
| 4643 | 730 | onChange({ |
| @@ -4654,12 +741,12 @@ | ||
| 4654 | 741 | } else { |
| 4655 | 742 | setIsSettingActive(true); |
| 4656 | 743 | } |
| 4657 | 744 | }; |
| 4658 | - return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)("fieldset", { children: [ | |
| 4659 | - /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(VisuallyHidden, { render: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("legend", {}), children: setting.title }), | |
| 4660 | - /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Stack, { direction: "column", gap: "md", children: [ | |
| 4661 | - /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( | |
| 745 | + return /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)("fieldset", { children: [ | |
| 746 | + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_components2.VisuallyHidden, { as: "legend", children: setting.title }), | |
| 747 | + /* @__PURE__ */ (0, import_jsx_runtime18.jsxs)(import_components2.__experimentalVStack, { spacing: 3, children: [ | |
| 748 | + /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( | |
| 4662 | 749 | import_components2.CheckboxControl, |
| 4663 | 750 | { |
| 4664 | 751 | label: setting.title, |
| 4665 | 752 | onChange: handleCheckboxChange, |
| @@ -4667,18 +754,19 @@ | ||
| 4667 | 754 | "aria-expanded": isSettingActive, |
| 4668 | 755 | "aria-controls": isSettingActive ? controlledRegionId : void 0 |
| 4669 | 756 | } |
| 4670 | 757 | ), |
| 4671 | - isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( | |
| 758 | + isSettingActive && /* @__PURE__ */ (0, import_jsx_runtime18.jsx)("div", { id: controlledRegionId, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( | |
| 4672 | 759 | import_components2.__experimentalInputControl, |
| 4673 | 760 | { |
| 4674 | - label: (0, import_i18n6.__)("CSS classes"), | |
| 761 | + label: (0, import_i18n5.__)("CSS classes"), | |
| 4675 | 762 | value: value?.cssClasses, |
| 4676 | 763 | onChange: handleSettingChange, |
| 4677 | - help: (0, import_i18n6.__)( | |
| 764 | + help: (0, import_i18n5.__)( | |
| 4678 | 765 | "Separate multiple classes with spaces." |
| 4679 | 766 | ), |
| 4680 | - __unstableInputWidth: "100%" | |
| 767 | + __unstableInputWidth: "100%", | |
| 768 | + __next40pxDefaultSize: true | |
| 4681 | 769 | } |
| 4682 | 770 | ) }) |
| 4683 | 771 | ] }) |
| 4684 | 772 | ] }); |
| @@ -4685,20 +773,20 @@ | ||
| 4685 | 773 | }; |
| 4686 | 774 | var css_classes_setting_default = CSSClassesSettingComponent; |
| 4687 | 775 | |
| 4688 | 776 | // packages/format-library/build-module/link/inline.mjs |
| 4689 | - var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); | |
| 777 | + var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); | |
| 4690 | 778 | var LINK_SETTINGS = [ |
| 4691 | 779 | ...import_block_editor5.LinkControl.DEFAULT_LINK_SETTINGS, |
| 4692 | 780 | { |
| 4693 | 781 | id: "nofollow", |
| 4694 | - title: (0, import_i18n7.__)("Mark as nofollow") | |
| 782 | + title: (0, import_i18n6.__)("Mark as nofollow") | |
| 4695 | 783 | }, |
| 4696 | 784 | { |
| 4697 | 785 | id: "cssClasses", |
| 4698 | - title: (0, import_i18n7.__)("Additional CSS class(es)"), | |
| 786 | + title: (0, import_i18n6.__)("Additional CSS class(es)"), | |
| 4699 | 787 | render: (setting, value, onChange) => { |
| 4700 | - return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( | |
| 788 | + return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( | |
| 4701 | 789 | css_classes_setting_default, |
| 4702 | 790 | { |
| 4703 | 791 | setting, |
| 4704 | 792 | value, |
| @@ -4732,9 +820,9 @@ | ||
| 4732 | 820 | }; |
| 4733 | 821 | }, |
| 4734 | 822 | [] |
| 4735 | 823 | ); |
| 4736 | - const linkValue = (0, import_element14.useMemo)( | |
| 824 | + const linkValue = (0, import_element4.useMemo)( | |
| 4737 | 825 | () => ({ |
| 4738 | 826 | url: activeAttributes.url, |
| 4739 | 827 | type: activeAttributes.type, |
| 4740 | 828 | id: activeAttributes.id, |
| @@ -4756,9 +844,9 @@ | ||
| 4756 | 844 | function removeLink() { |
| 4757 | 845 | const newValue = (0, import_rich_text5.removeFormat)(value, "core/link"); |
| 4758 | 846 | onChange(newValue); |
| 4759 | 847 | stopAddingLink(); |
| 4760 | - (0, import_a11y.speak)((0, import_i18n7.__)("Link removed."), "assertive"); | |
| 848 | + (0, import_a11y.speak)((0, import_i18n6.__)("Link removed."), "assertive"); | |
| 4761 | 849 | } |
| 4762 | 850 | function onChangeLink(nextValue) { |
| 4763 | 851 | const hasLink = linkValue?.url; |
| 4764 | 852 | const isNewLink = !hasLink; |
| @@ -4822,17 +910,17 @@ | ||
| 4822 | 910 | stopAddingLink(); |
| 4823 | 911 | } |
| 4824 | 912 | if (!isValidHref(newUrl)) { |
| 4825 | 913 | (0, import_a11y.speak)( |
| 4826 | - (0, import_i18n7.__)( | |
| 914 | + (0, import_i18n6.__)( | |
| 4827 | 915 | "Warning: the link has been inserted but may have errors. Please test it." |
| 4828 | 916 | ), |
| 4829 | 917 | "assertive" |
| 4830 | 918 | ); |
| 4831 | 919 | } else if (isActive) { |
| 4832 | - (0, import_a11y.speak)((0, import_i18n7.__)("Link edited."), "assertive"); | |
| 920 | + (0, import_a11y.speak)((0, import_i18n6.__)("Link edited."), "assertive"); | |
| 4833 | 921 | } else { |
| 4834 | - (0, import_a11y.speak)((0, import_i18n7.__)("Link inserted."), "assertive"); | |
| 922 | + (0, import_a11y.speak)((0, import_i18n6.__)("Link inserted."), "assertive"); | |
| 4835 | 923 | } |
| 4836 | 924 | } |
| 4837 | 925 | const popoverAnchor = (0, import_rich_text5.useAnchor)({ |
| 4838 | 926 | editableContentElement: contentRef.current, |
| @@ -4854,18 +942,18 @@ | ||
| 4854 | 942 | kind: "post-type" |
| 4855 | 943 | }; |
| 4856 | 944 | } |
| 4857 | 945 | function createButtonText(searchTerm) { |
| 4858 | - return (0, import_element14.createInterpolateElement)( | |
| 4859 | - (0, import_i18n7.sprintf)( | |
| 946 | + return (0, import_element4.createInterpolateElement)( | |
| 947 | + (0, import_i18n6.sprintf)( | |
| 4860 | 948 | /* translators: %s: search term. */ |
| 4861 | - (0, import_i18n7.__)("Create page: <mark>%s</mark>"), | |
| 949 | + (0, import_i18n6.__)("Create page: <mark>%s</mark>"), | |
| 4862 | 950 | searchTerm |
| 4863 | 951 | ), |
| 4864 | - { mark: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("mark", {}) } | |
| 952 | + { mark: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)("mark", {}) } | |
| 4865 | 953 | ); |
| 4866 | 954 | } |
| 4867 | - return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( | |
| 955 | + return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( | |
| 4868 | 956 | import_components3.Popover, |
| 4869 | 957 | { |
| 4870 | 958 | anchor: popoverAnchor, |
| 4871 | 959 | animate: false, |
| @@ -4875,9 +963,9 @@ | ||
| 4875 | 963 | offset: 8, |
| 4876 | 964 | shift: true, |
| 4877 | 965 | focusOnMount, |
| 4878 | 966 | constrainTabbing: true, |
| 4879 | - children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( | |
| 967 | + children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( | |
| 4880 | 968 | import_block_editor5.LinkControl, |
| 4881 | 969 | { |
| 4882 | 970 | value: linkValue, |
| 4883 | 971 | onChange: onChangeLink, |
| @@ -4916,11 +1004,11 @@ | ||
| 4916 | 1004 | } |
| 4917 | 1005 | var inline_default = InlineLinkUI; |
| 4918 | 1006 | |
| 4919 | 1007 | // packages/format-library/build-module/link/index.mjs |
| 4920 | - var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); | |
| 1008 | + var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); | |
| 4921 | 1009 | var name5 = "core/link"; |
| 4922 | - var title5 = (0, import_i18n8.__)("Link"); | |
| 1010 | + var title5 = (0, import_i18n7.__)("Link"); | |
| 4923 | 1011 | function Edit2({ |
| 4924 | 1012 | isActive, |
| 4925 | 1013 | activeAttributes, |
| 4926 | 1014 | value, |
| @@ -4928,16 +1016,16 @@ | ||
| 4928 | 1016 | onFocus, |
| 4929 | 1017 | contentRef, |
| 4930 | 1018 | isVisible = true |
| 4931 | 1019 | }) { |
| 4932 | - const [addingLink, setAddingLink] = (0, import_element15.useState)(false); | |
| 4933 | - const [openedBy, setOpenedBy] = (0, import_element15.useState)(null); | |
| 4934 | - (0, import_element15.useEffect)(() => { | |
| 1020 | + const [addingLink, setAddingLink] = (0, import_element5.useState)(false); | |
| 1021 | + const [openedBy, setOpenedBy] = (0, import_element5.useState)(null); | |
| 1022 | + (0, import_element5.useEffect)(() => { | |
| 4935 | 1023 | if (!isActive) { |
| 4936 | 1024 | setAddingLink(false); |
| 4937 | 1025 | } |
| 4938 | 1026 | }, [isActive]); |
| 4939 | - (0, import_element15.useLayoutEffect)(() => { | |
| 1027 | + (0, import_element5.useLayoutEffect)(() => { | |
| 4940 | 1028 | const editableContentElement = contentRef.current; |
| 4941 | 1029 | if (!editableContentElement) { |
| 4942 | 1030 | return; |
| 4943 | 1031 | } |
| @@ -5006,14 +1094,14 @@ | ||
| 5006 | 1094 | setOpenedBy(null); |
| 5007 | 1095 | } |
| 5008 | 1096 | function onRemoveFormat() { |
| 5009 | 1097 | onChange((0, import_rich_text6.removeFormat)(value, name5)); |
| 5010 | - (0, import_a11y2.speak)((0, import_i18n8.__)("Link removed."), "assertive"); | |
| 1098 | + (0, import_a11y2.speak)((0, import_i18n7.__)("Link removed."), "assertive"); | |
| 5011 | 1099 | } |
| 5012 | 1100 | const shouldAutoFocus = !(openedBy?.el?.tagName === "A" && openedBy?.action === "click"); |
| 5013 | 1101 | const hasSelection = !(0, import_rich_text6.isCollapsed)(value); |
| 5014 | - return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(import_jsx_runtime33.Fragment, { children: [ | |
| 5015 | - hasSelection && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( | |
| 1102 | + return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_jsx_runtime20.Fragment, { children: [ | |
| 1103 | + hasSelection && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( | |
| 5016 | 1104 | import_block_editor6.RichTextShortcut, |
| 5017 | 1105 | { |
| 5018 | 1106 | type: "primary", |
| 5019 | 1107 | character: "k", |
| @@ -5019,9 +1107,9 @@ | ||
| 5019 | 1107 | character: "k", |
| 5020 | 1108 | onUse: addLink |
| 5021 | 1109 | } |
| 5022 | 1110 | ), |
| 5023 | - /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( | |
| 1111 | + /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( | |
| 5024 | 1112 | import_block_editor6.RichTextShortcut, |
| 5025 | 1113 | { |
| 5026 | 1114 | type: "primaryShift", |
| 5027 | 1115 | character: "k", |
| @@ -5027,14 +1115,14 @@ | ||
| 5027 | 1115 | character: "k", |
| 5028 | 1116 | onUse: onRemoveFormat |
| 5029 | 1117 | } |
| 5030 | 1118 | ), |
| 5031 | - isVisible && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( | |
| 1119 | + isVisible && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( | |
| 5032 | 1120 | import_block_editor6.RichTextToolbarButton, |
| 5033 | 1121 | { |
| 5034 | 1122 | name: "link", |
| 5035 | 1123 | icon: link_default, |
| 5036 | - title: isActive ? (0, import_i18n8.__)("Link") : title5, | |
| 1124 | + title: isActive ? (0, import_i18n7.__)("Link") : title5, | |
| 5037 | 1125 | onClick: (event) => { |
| 5038 | 1126 | addLink(event.currentTarget); |
| 5039 | 1127 | }, |
| 5040 | 1128 | isActive: isActive || addingLink, |
| @@ -5043,9 +1131,9 @@ | ||
| 5043 | 1131 | "aria-haspopup": "true", |
| 5044 | 1132 | "aria-expanded": addingLink |
| 5045 | 1133 | } |
| 5046 | 1134 | ), |
| 5047 | - isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( | |
| 1135 | + isVisible && addingLink && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)( | |
| 5048 | 1136 | inline_default, |
| 5049 | 1137 | { |
| 5050 | 1138 | stopAddingLink, |
| 5051 | 1139 | onFocusOutside, |
| @@ -5101,14 +1189,14 @@ | ||
| 5101 | 1189 | edit: Edit2 |
| 5102 | 1190 | }; |
| 5103 | 1191 | |
| 5104 | 1192 | // packages/format-library/build-module/strikethrough/index.mjs |
| 5105 | - var import_i18n9 = __toESM(require_i18n(), 1); | |
| 1193 | + var import_i18n8 = __toESM(require_i18n(), 1); | |
| 5106 | 1194 | var import_rich_text7 = __toESM(require_rich_text(), 1); |
| 5107 | 1195 | var import_block_editor7 = __toESM(require_block_editor(), 1); |
| 5108 | - var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); | |
| 1196 | + var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); | |
| 5109 | 1197 | var name6 = "core/strikethrough"; |
| 5110 | - var title6 = (0, import_i18n9.__)("Strikethrough"); | |
| 1198 | + var title6 = (0, import_i18n8.__)("Strikethrough"); | |
| 5111 | 1199 | var strikethrough = { |
| 5112 | 1200 | name: name6, |
| 5113 | 1201 | title: title6, |
| 5114 | 1202 | tagName: "s", |
| @@ -5117,10 +1205,10 @@ | ||
| 5117 | 1205 | function onClick() { |
| 5118 | 1206 | onChange((0, import_rich_text7.toggleFormat)(value, { type: name6, title: title6 })); |
| 5119 | 1207 | onFocus(); |
| 5120 | 1208 | } |
| 5121 | - return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(import_jsx_runtime34.Fragment, { children: [ | |
| 5122 | - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( | |
| 1209 | + return /* @__PURE__ */ (0, import_jsx_runtime21.jsxs)(import_jsx_runtime21.Fragment, { children: [ | |
| 1210 | + /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( | |
| 5123 | 1211 | import_block_editor7.RichTextShortcut, |
| 5124 | 1212 | { |
| 5125 | 1213 | type: "access", |
| 5126 | 1214 | character: "d", |
| @@ -5126,9 +1214,9 @@ | ||
| 5126 | 1214 | character: "d", |
| 5127 | 1215 | onUse: onClick |
| 5128 | 1216 | } |
| 5129 | 1217 | ), |
| 5130 | - /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( | |
| 1218 | + /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( | |
| 5131 | 1219 | import_block_editor7.RichTextToolbarButton, |
| 5132 | 1220 | { |
| 5133 | 1221 | icon: format_strikethrough_default, |
| 5134 | 1222 | title: title6, |
| @@ -5141,14 +1229,14 @@ | ||
| 5141 | 1229 | } |
| 5142 | 1230 | }; |
| 5143 | 1231 | |
| 5144 | 1232 | // packages/format-library/build-module/underline/index.mjs |
| 5145 | - var import_i18n10 = __toESM(require_i18n(), 1); | |
| 1233 | + var import_i18n9 = __toESM(require_i18n(), 1); | |
| 5146 | 1234 | var import_rich_text8 = __toESM(require_rich_text(), 1); |
| 5147 | 1235 | var import_block_editor8 = __toESM(require_block_editor(), 1); |
| 5148 | - var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); | |
| 1236 | + var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); | |
| 5149 | 1237 | var name7 = "core/underline"; |
| 5150 | - var title7 = (0, import_i18n10.__)("Underline"); | |
| 1238 | + var title7 = (0, import_i18n9.__)("Underline"); | |
| 5151 | 1239 | var underline = { |
| 5152 | 1240 | name: name7, |
| 5153 | 1241 | title: title7, |
| 5154 | 1242 | tagName: "span", |
| @@ -5167,10 +1255,10 @@ | ||
| 5167 | 1255 | title: title7 |
| 5168 | 1256 | }) |
| 5169 | 1257 | ); |
| 5170 | 1258 | }; |
| 5171 | - return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(import_jsx_runtime35.Fragment, { children: [ | |
| 5172 | - /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( | |
| 1259 | + return /* @__PURE__ */ (0, import_jsx_runtime22.jsxs)(import_jsx_runtime22.Fragment, { children: [ | |
| 1260 | + /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( | |
| 5173 | 1261 | import_block_editor8.RichTextShortcut, |
| 5174 | 1262 | { |
| 5175 | 1263 | type: "primary", |
| 5176 | 1264 | character: "u", |
| @@ -5176,9 +1264,9 @@ | ||
| 5176 | 1264 | character: "u", |
| 5177 | 1265 | onUse: onToggle |
| 5178 | 1266 | } |
| 5179 | 1267 | ), |
| 5180 | - /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( | |
| 1268 | + /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( | |
| 5181 | 1269 | import_block_editor8.__unstableRichTextInputEvent, |
| 5182 | 1270 | { |
| 5183 | 1271 | inputType: "formatUnderline", |
| 5184 | 1272 | onInput: onToggle |
| @@ -5188,24 +1276,34 @@ | ||
| 5188 | 1276 | } |
| 5189 | 1277 | }; |
| 5190 | 1278 | |
| 5191 | 1279 | // packages/format-library/build-module/text-color/index.mjs |
| 5192 | - var import_i18n12 = __toESM(require_i18n(), 1); | |
| 5193 | - var import_element17 = __toESM(require_element(), 1); | |
| 1280 | + var import_i18n11 = __toESM(require_i18n(), 1); | |
| 1281 | + var import_element7 = __toESM(require_element(), 1); | |
| 5194 | 1282 | var import_block_editor10 = __toESM(require_block_editor(), 1); |
| 5195 | 1283 | var import_rich_text10 = __toESM(require_rich_text(), 1); |
| 5196 | 1284 | |
| 5197 | 1285 | // packages/format-library/build-module/text-color/inline.mjs |
| 5198 | - var import_element16 = __toESM(require_element(), 1); | |
| 1286 | + var import_element6 = __toESM(require_element(), 1); | |
| 5199 | 1287 | var import_data2 = __toESM(require_data(), 1); |
| 5200 | 1288 | var import_rich_text9 = __toESM(require_rich_text(), 1); |
| 5201 | 1289 | var import_block_editor9 = __toESM(require_block_editor(), 1); |
| 5202 | 1290 | var import_components4 = __toESM(require_components(), 1); |
| 5203 | - var import_i18n11 = __toESM(require_i18n(), 1); | |
| 5204 | - var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); | |
| 1291 | + var import_i18n10 = __toESM(require_i18n(), 1); | |
| 1292 | + | |
| 1293 | + // packages/format-library/build-module/lock-unlock.mjs | |
| 1294 | + var import_private_apis = __toESM(require_private_apis(), 1); | |
| 1295 | + var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( | |
| 1296 | + "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", | |
| 1297 | + "@wordpress/format-library" | |
| 1298 | + ); | |
| 1299 | + | |
| 1300 | + // packages/format-library/build-module/text-color/inline.mjs | |
| 1301 | + var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); | |
| 1302 | + var { Tabs } = unlock(import_components4.privateApis); | |
| 5205 | 1303 | var TABS = [ |
| 5206 | - { name: "color", title: (0, import_i18n11.__)("Text") }, | |
| 5207 | - { name: "backgroundColor", title: (0, import_i18n11.__)("Background") } | |
| 1304 | + { name: "color", title: (0, import_i18n10.__)("Text") }, | |
| 1305 | + { name: "backgroundColor", title: (0, import_i18n10.__)("Background") } | |
| 5208 | 1306 | ]; |
| 5209 | 1307 | function parseCSS(css = "") { |
| 5210 | 1308 | return css.split(";").reduce((accumulator, rule) => { |
| 5211 | 1309 | if (rule) { |
| @@ -5279,13 +1377,13 @@ | ||
| 5279 | 1377 | const colors = (0, import_data2.useSelect)((select) => { |
| 5280 | 1378 | const { getSettings } = select(import_block_editor9.store); |
| 5281 | 1379 | return getSettings().colors ?? []; |
| 5282 | 1380 | }, []); |
| 5283 | - const activeColors = (0, import_element16.useMemo)( | |
| 1381 | + const activeColors = (0, import_element6.useMemo)( | |
| 5284 | 1382 | () => getActiveColors(value, name16, colors), |
| 5285 | 1383 | [name16, value, colors] |
| 5286 | 1384 | ); |
| 5287 | - return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 1385 | + return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( | |
| 5288 | 1386 | import_block_editor9.ColorPalette, |
| 5289 | 1387 | { |
| 5290 | 1388 | value: activeColors[property], |
| 5291 | 1389 | onChange: (color) => { |
| @@ -5309,22 +1407,22 @@ | ||
| 5309 | 1407 | const popoverAnchor = (0, import_rich_text9.useAnchor)({ |
| 5310 | 1408 | editableContentElement: contentRef.current, |
| 5311 | 1409 | settings: { ...textColor, isActive } |
| 5312 | 1410 | }); |
| 5313 | - return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 1411 | + return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( | |
| 5314 | 1412 | import_components4.Popover, |
| 5315 | 1413 | { |
| 5316 | 1414 | onClose, |
| 5317 | 1415 | className: "format-library__inline-color-popover", |
| 5318 | 1416 | anchor: popoverAnchor, |
| 5319 | - children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(tabs_exports.Root, { defaultValue: TABS[0].name, children: [ | |
| 5320 | - /* @__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)) }), | |
| 5321 | - TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 5322 | - tabs_exports.Panel, | |
| 1417 | + children: /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Tabs, { children: [ | |
| 1418 | + /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tabs.TabList, { children: TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(Tabs.Tab, { tabId: tab.name, children: tab.title }, tab.name)) }), | |
| 1419 | + TABS.map((tab) => /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( | |
| 1420 | + Tabs.TabPanel, | |
| 5323 | 1421 | { |
| 5324 | - value: tab.name, | |
| 5325 | - tabIndex: -1, | |
| 5326 | - children: /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( | |
| 1422 | + tabId: tab.name, | |
| 1423 | + focusable: false, | |
| 1424 | + children: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( | |
| 5327 | 1425 | ColorPicker, |
| 5328 | 1426 | { |
| 5329 | 1427 | name: name16, |
| 5330 | 1428 | property: tab.name, |
| @@ -5340,16 +1438,16 @@ | ||
| 5340 | 1438 | ); |
| 5341 | 1439 | } |
| 5342 | 1440 | |
| 5343 | 1441 | // packages/format-library/build-module/text-color/index.mjs |
| 5344 | - var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); | |
| 1442 | + var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); | |
| 5345 | 1443 | var transparentValue = "rgba(0, 0, 0, 0)"; |
| 5346 | 1444 | var name8 = "core/text-color"; |
| 5347 | - var title8 = (0, import_i18n12.__)("Highlight"); | |
| 5348 | - var EMPTY_ARRAY3 = []; | |
| 1445 | + var title8 = (0, import_i18n11.__)("Highlight"); | |
| 1446 | + var EMPTY_ARRAY = []; | |
| 5349 | 1447 | function getComputedStyleProperty(element, property) { |
| 5350 | - const { ownerDocument: ownerDocument2 } = element; | |
| 5351 | - const { defaultView } = ownerDocument2; | |
| 1448 | + const { ownerDocument } = element; | |
| 1449 | + const { defaultView } = ownerDocument; | |
| 5352 | 1450 | const style = defaultView.getComputedStyle(element); |
| 5353 | 1451 | const value = style.getPropertyValue(property); |
| 5354 | 1452 | if (property === "background-color" && value === transparentValue && element.parentElement) { |
| 5355 | 1453 | return getComputedStyleProperty(element.parentElement, property); |
| @@ -5371,14 +1469,14 @@ | ||
| 5371 | 1469 | isActive, |
| 5372 | 1470 | activeAttributes, |
| 5373 | 1471 | contentRef |
| 5374 | 1472 | }) { |
| 5375 | - const [allowCustomControl, colors = EMPTY_ARRAY3] = (0, import_block_editor10.useSettings)( | |
| 1473 | + const [allowCustomControl, colors = EMPTY_ARRAY] = (0, import_block_editor10.useSettings)( | |
| 5376 | 1474 | "color.custom", |
| 5377 | 1475 | "color.palette" |
| 5378 | 1476 | ); |
| 5379 | - const [isAddingColor, setIsAddingColor] = (0, import_element17.useState)(false); | |
| 5380 | - const colorIndicatorStyle = (0, import_element17.useMemo)( | |
| 1477 | + const [isAddingColor, setIsAddingColor] = (0, import_element7.useState)(false); | |
| 1478 | + const colorIndicatorStyle = (0, import_element7.useMemo)( | |
| 5381 | 1479 | () => fillComputedColors( |
| 5382 | 1480 | contentRef.current, |
| 5383 | 1481 | getActiveColors(value, name8, colors) |
| 5384 | 1482 | ), |
| @@ -5387,15 +1485,15 @@ | ||
| 5387 | 1485 | const hasColorsToChoose = !!colors.length || allowCustomControl; |
| 5388 | 1486 | if (!hasColorsToChoose && !isActive) { |
| 5389 | 1487 | return null; |
| 5390 | 1488 | } |
| 5391 | - return /* @__PURE__ */ (0, import_jsx_runtime37.jsxs)(import_jsx_runtime37.Fragment, { children: [ | |
| 5392 | - /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( | |
| 1489 | + return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [ | |
| 1490 | + /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( | |
| 5393 | 1491 | import_block_editor10.RichTextToolbarButton, |
| 5394 | 1492 | { |
| 5395 | 1493 | className: "format-library-text-color-button", |
| 5396 | 1494 | isActive, |
| 5397 | - icon: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( | |
| 1495 | + icon: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( | |
| 5398 | 1496 | icon_default, |
| 5399 | 1497 | { |
| 5400 | 1498 | icon: Object.keys(activeAttributes).length ? text_color_default : color_default, |
| 5401 | 1499 | style: colorIndicatorStyle |
| @@ -5405,9 +1503,9 @@ | ||
| 5405 | 1503 | onClick: hasColorsToChoose ? () => setIsAddingColor(true) : () => onChange((0, import_rich_text10.removeFormat)(value, name8)), |
| 5406 | 1504 | role: "menuitemcheckbox" |
| 5407 | 1505 | } |
| 5408 | 1506 | ), |
| 5409 | - isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime37.jsx)( | |
| 1507 | + isAddingColor && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( | |
| 5410 | 1508 | InlineColorUI, |
| 5411 | 1509 | { |
| 5412 | 1510 | name: name8, |
| 5413 | 1511 | onClose: () => setIsAddingColor(false), |
| @@ -5432,14 +1530,14 @@ | ||
| 5432 | 1530 | edit: TextColorEdit |
| 5433 | 1531 | }; |
| 5434 | 1532 | |
| 5435 | 1533 | // packages/format-library/build-module/subscript/index.mjs |
| 5436 | - var import_i18n13 = __toESM(require_i18n(), 1); | |
| 1534 | + var import_i18n12 = __toESM(require_i18n(), 1); | |
| 5437 | 1535 | var import_rich_text11 = __toESM(require_rich_text(), 1); |
| 5438 | 1536 | var import_block_editor11 = __toESM(require_block_editor(), 1); |
| 5439 | - var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); | |
| 1537 | + var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); | |
| 5440 | 1538 | var name9 = "core/subscript"; |
| 5441 | - var title9 = (0, import_i18n13.__)("Subscript"); | |
| 1539 | + var title9 = (0, import_i18n12.__)("Subscript"); | |
| 5442 | 1540 | var subscript = { |
| 5443 | 1541 | name: name9, |
| 5444 | 1542 | title: title9, |
| 5445 | 1543 | tagName: "sub", |
| @@ -5451,9 +1549,9 @@ | ||
| 5451 | 1549 | function onClick() { |
| 5452 | 1550 | onToggle(); |
| 5453 | 1551 | onFocus(); |
| 5454 | 1552 | } |
| 5455 | - return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( | |
| 1553 | + return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( | |
| 5456 | 1554 | import_block_editor11.RichTextToolbarButton, |
| 5457 | 1555 | { |
| 5458 | 1556 | icon: subscript_default, |
| 5459 | 1557 | title: title9, |
| @@ -5465,14 +1563,14 @@ | ||
| 5465 | 1563 | } |
| 5466 | 1564 | }; |
| 5467 | 1565 | |
| 5468 | 1566 | // packages/format-library/build-module/superscript/index.mjs |
| 5469 | - var import_i18n14 = __toESM(require_i18n(), 1); | |
| 1567 | + var import_i18n13 = __toESM(require_i18n(), 1); | |
| 5470 | 1568 | var import_rich_text12 = __toESM(require_rich_text(), 1); |
| 5471 | 1569 | var import_block_editor12 = __toESM(require_block_editor(), 1); |
| 5472 | - var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); | |
| 1570 | + var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); | |
| 5473 | 1571 | var name10 = "core/superscript"; |
| 5474 | - var title10 = (0, import_i18n14.__)("Superscript"); | |
| 1572 | + var title10 = (0, import_i18n13.__)("Superscript"); | |
| 5475 | 1573 | var superscript = { |
| 5476 | 1574 | name: name10, |
| 5477 | 1575 | title: title10, |
| 5478 | 1576 | tagName: "sup", |
| @@ -5484,9 +1582,9 @@ | ||
| 5484 | 1582 | function onClick() { |
| 5485 | 1583 | onToggle(); |
| 5486 | 1584 | onFocus(); |
| 5487 | 1585 | } |
| 5488 | - return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( | |
| 1586 | + return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( | |
| 5489 | 1587 | import_block_editor12.RichTextToolbarButton, |
| 5490 | 1588 | { |
| 5491 | 1589 | icon: superscript_default, |
| 5492 | 1590 | title: title10, |
| @@ -5498,15 +1596,15 @@ | ||
| 5498 | 1596 | } |
| 5499 | 1597 | }; |
| 5500 | 1598 | |
| 5501 | 1599 | // packages/format-library/build-module/keyboard/index.mjs |
| 5502 | - var import_i18n15 = __toESM(require_i18n(), 1); | |
| 1600 | + var import_i18n14 = __toESM(require_i18n(), 1); | |
| 5503 | 1601 | var import_rich_text13 = __toESM(require_rich_text(), 1); |
| 5504 | 1602 | var import_block_editor13 = __toESM(require_block_editor(), 1); |
| 5505 | - var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); | |
| 1603 | + var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); | |
| 5506 | 1604 | var name11 = "core/keyboard"; |
| 5507 | - var title11 = (0, import_i18n15.__)("Keyboard input"); | |
| 5508 | - var keyboard2 = { | |
| 1605 | + var title11 = (0, import_i18n14.__)("Keyboard input"); | |
| 1606 | + var keyboard = { | |
| 5509 | 1607 | name: name11, |
| 5510 | 1608 | title: title11, |
| 5511 | 1609 | tagName: "kbd", |
| 5512 | 1610 | className: null, |
| @@ -5517,9 +1615,9 @@ | ||
| 5517 | 1615 | function onClick() { |
| 5518 | 1616 | onToggle(); |
| 5519 | 1617 | onFocus(); |
| 5520 | 1618 | } |
| 5521 | - return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( | |
| 1619 | + return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( | |
| 5522 | 1620 | import_block_editor13.RichTextToolbarButton, |
| 5523 | 1621 | { |
| 5524 | 1622 | icon: button_default, |
| 5525 | 1623 | title: title11, |
| @@ -5531,14 +1629,14 @@ | ||
| 5531 | 1629 | } |
| 5532 | 1630 | }; |
| 5533 | 1631 | |
| 5534 | 1632 | // packages/format-library/build-module/unknown/index.mjs |
| 5535 | - var import_i18n16 = __toESM(require_i18n(), 1); | |
| 1633 | + var import_i18n15 = __toESM(require_i18n(), 1); | |
| 5536 | 1634 | var import_rich_text14 = __toESM(require_rich_text(), 1); |
| 5537 | 1635 | var import_block_editor14 = __toESM(require_block_editor(), 1); |
| 5538 | - var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); | |
| 1636 | + var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); | |
| 5539 | 1637 | var name12 = "core/unknown"; |
| 5540 | - var title12 = (0, import_i18n16.__)("Clear Unknown Formatting"); | |
| 1638 | + var title12 = (0, import_i18n15.__)("Clear Unknown Formatting"); | |
| 5541 | 1639 | function selectionContainsUnknownFormats(value) { |
| 5542 | 1640 | if ((0, import_rich_text14.isCollapsed)(value)) { |
| 5543 | 1641 | return false; |
| 5544 | 1642 | } |
| @@ -5559,9 +1657,9 @@ | ||
| 5559 | 1657 | function onClick() { |
| 5560 | 1658 | onChange((0, import_rich_text14.removeFormat)(value, name12)); |
| 5561 | 1659 | onFocus(); |
| 5562 | 1660 | } |
| 5563 | - return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( | |
| 1661 | + return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( | |
| 5564 | 1662 | import_block_editor14.RichTextToolbarButton, |
| 5565 | 1663 | { |
| 5566 | 1664 | name: "unknown", |
| 5567 | 1665 | icon: help_default, |
| @@ -5573,16 +1671,16 @@ | ||
| 5573 | 1671 | } |
| 5574 | 1672 | }; |
| 5575 | 1673 | |
| 5576 | 1674 | // packages/format-library/build-module/language/index.mjs |
| 5577 | - var import_i18n17 = __toESM(require_i18n(), 1); | |
| 1675 | + var import_i18n16 = __toESM(require_i18n(), 1); | |
| 5578 | 1676 | var import_block_editor15 = __toESM(require_block_editor(), 1); |
| 5579 | 1677 | var import_components5 = __toESM(require_components(), 1); |
| 5580 | - var import_element18 = __toESM(require_element(), 1); | |
| 1678 | + var import_element8 = __toESM(require_element(), 1); | |
| 5581 | 1679 | var import_rich_text15 = __toESM(require_rich_text(), 1); |
| 5582 | - var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); | |
| 1680 | + var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); | |
| 5583 | 1681 | var name13 = "core/language"; |
| 5584 | - var title13 = (0, import_i18n17.__)("Language"); | |
| 1682 | + var title13 = (0, import_i18n16.__)("Language"); | |
| 5585 | 1683 | var language = { |
| 5586 | 1684 | name: name13, |
| 5587 | 1685 | title: title13, |
| 5588 | 1686 | tagName: "bdo", |
| @@ -5593,14 +1691,14 @@ | ||
| 5593 | 1691 | }, |
| 5594 | 1692 | edit: Edit3 |
| 5595 | 1693 | }; |
| 5596 | 1694 | function Edit3({ isActive, value, onChange, contentRef }) { |
| 5597 | - const [isPopoverVisible, setIsPopoverVisible] = (0, import_element18.useState)(false); | |
| 1695 | + const [isPopoverVisible, setIsPopoverVisible] = (0, import_element8.useState)(false); | |
| 5598 | 1696 | const togglePopover = () => { |
| 5599 | 1697 | setIsPopoverVisible((state) => !state); |
| 5600 | 1698 | }; |
| 5601 | - return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_jsx_runtime42.Fragment, { children: [ | |
| 5602 | - /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( | |
| 1699 | + return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [ | |
| 1700 | + /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 5603 | 1701 | import_block_editor15.RichTextToolbarButton, |
| 5604 | 1702 | { |
| 5605 | 1703 | icon: language_default, |
| 5606 | 1704 | label: title13, |
| @@ -5615,9 +1713,9 @@ | ||
| 5615 | 1713 | isActive, |
| 5616 | 1714 | role: "menuitemcheckbox" |
| 5617 | 1715 | } |
| 5618 | 1716 | ), |
| 5619 | - isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( | |
| 1717 | + isPopoverVisible && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 5620 | 1718 | InlineLanguageUI, |
| 5621 | 1719 | { |
| 5622 | 1720 | value, |
| 5623 | 1721 | onChange, |
| @@ -5631,22 +1729,21 @@ | ||
| 5631 | 1729 | const popoverAnchor = (0, import_rich_text15.useAnchor)({ |
| 5632 | 1730 | editableContentElement: contentRef.current, |
| 5633 | 1731 | settings: language |
| 5634 | 1732 | }); |
| 5635 | - const [lang, setLang] = (0, import_element18.useState)(""); | |
| 5636 | - const [dir, setDir] = (0, import_element18.useState)("ltr"); | |
| 5637 | - return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( | |
| 1733 | + const [lang, setLang] = (0, import_element8.useState)(""); | |
| 1734 | + const [dir, setDir] = (0, import_element8.useState)("ltr"); | |
| 1735 | + return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 5638 | 1736 | import_components5.Popover, |
| 5639 | 1737 | { |
| 5640 | 1738 | className: "block-editor-format-toolbar__language-popover", |
| 5641 | 1739 | anchor: popoverAnchor, |
| 5642 | 1740 | onClose, |
| 5643 | - children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)( | |
| 5644 | - Stack, | |
| 1741 | + children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)( | |
| 1742 | + import_components5.__experimentalVStack, | |
| 5645 | 1743 | { |
| 5646 | - render: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("form", {}), | |
| 5647 | - direction: "column", | |
| 5648 | - gap: "lg", | |
| 1744 | + as: "form", | |
| 1745 | + spacing: 4, | |
| 5649 | 1746 | className: "block-editor-format-toolbar__language-container-content", |
| 5650 | 1747 | onSubmit: (event) => { |
| 5651 | 1748 | event.preventDefault(); |
| 5652 | 1749 | onChange( |
| @@ -5660,31 +1757,33 @@ | ||
| 5660 | 1757 | ); |
| 5661 | 1758 | onClose(); |
| 5662 | 1759 | }, |
| 5663 | 1760 | children: [ |
| 5664 | - /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( | |
| 1761 | + /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 5665 | 1762 | import_components5.TextControl, |
| 5666 | 1763 | { |
| 1764 | + __next40pxDefaultSize: true, | |
| 5667 | 1765 | label: title13, |
| 5668 | 1766 | value: lang, |
| 5669 | 1767 | onChange: (val) => setLang(val), |
| 5670 | - help: (0, import_i18n17.__)( | |
| 1768 | + help: (0, import_i18n16.__)( | |
| 5671 | 1769 | 'A valid language attribute, like "en" or "fr".' |
| 5672 | 1770 | ) |
| 5673 | 1771 | } |
| 5674 | 1772 | ), |
| 5675 | - /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( | |
| 1773 | + /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 5676 | 1774 | import_components5.SelectControl, |
| 5677 | 1775 | { |
| 5678 | - label: (0, import_i18n17.__)("Text direction"), | |
| 1776 | + __next40pxDefaultSize: true, | |
| 1777 | + label: (0, import_i18n16.__)("Text direction"), | |
| 5679 | 1778 | value: dir, |
| 5680 | 1779 | options: [ |
| 5681 | 1780 | { |
| 5682 | - label: (0, import_i18n17.__)("Left to right"), | |
| 1781 | + label: (0, import_i18n16.__)("Left to right"), | |
| 5683 | 1782 | value: "ltr" |
| 5684 | 1783 | }, |
| 5685 | 1784 | { |
| 5686 | - label: (0, import_i18n17.__)("Right to left"), | |
| 1785 | + label: (0, import_i18n16.__)("Right to left"), | |
| 5687 | 1786 | value: "rtl" |
| 5688 | 1787 | } |
| 5689 | 1788 | ], |
| 5690 | 1789 | onChange: (val) => setDir(val) |
| @@ -5689,15 +1788,15 @@ | ||
| 5689 | 1788 | ], |
| 5690 | 1789 | onChange: (val) => setDir(val) |
| 5691 | 1790 | } |
| 5692 | 1791 | ), |
| 5693 | - /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(Stack, { justify: "right", children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( | |
| 1792 | + /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(import_components5.__experimentalHStack, { alignment: "right", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( | |
| 5694 | 1793 | import_components5.Button, |
| 5695 | 1794 | { |
| 5696 | 1795 | __next40pxDefaultSize: true, |
| 5697 | 1796 | variant: "primary", |
| 5698 | 1797 | type: "submit", |
| 5699 | - text: (0, import_i18n17.__)("Apply") | |
| 1798 | + text: (0, import_i18n16.__)("Apply") | |
| 5700 | 1799 | } |
| 5701 | 1800 | ) }) |
| 5702 | 1801 | ] |
| 5703 | 1802 | } |
| @@ -5706,27 +1805,18 @@ | ||
| 5706 | 1805 | ); |
| 5707 | 1806 | } |
| 5708 | 1807 | |
| 5709 | 1808 | // packages/format-library/build-module/math/index.mjs |
| 5710 | - var import_i18n18 = __toESM(require_i18n(), 1); | |
| 5711 | - var import_element19 = __toESM(require_element(), 1); | |
| 1809 | + var import_i18n17 = __toESM(require_i18n(), 1); | |
| 1810 | + var import_element9 = __toESM(require_element(), 1); | |
| 5712 | 1811 | var import_rich_text16 = __toESM(require_rich_text(), 1); |
| 5713 | 1812 | var import_block_editor16 = __toESM(require_block_editor(), 1); |
| 5714 | 1813 | var import_components6 = __toESM(require_components(), 1); |
| 5715 | 1814 | var import_a11y3 = __toESM(require_a11y(), 1); |
| 5716 | - | |
| 5717 | - // packages/format-library/build-module/lock-unlock.mjs | |
| 5718 | - var import_private_apis = __toESM(require_private_apis(), 1); | |
| 5719 | - var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( | |
| 5720 | - "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", | |
| 5721 | - "@wordpress/format-library" | |
| 5722 | - ); | |
| 5723 | - | |
| 5724 | - // packages/format-library/build-module/math/index.mjs | |
| 5725 | - var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); | |
| 5726 | - var { Badge: WCBadge } = unlock(import_components6.privateApis); | |
| 1815 | + var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); | |
| 1816 | + var { Badge } = unlock(import_components6.privateApis); | |
| 5727 | 1817 | var name14 = "core/math"; |
| 5728 | - var title14 = (0, import_i18n18.__)("Math"); | |
| 1818 | + var title14 = (0, import_i18n17.__)("Math"); | |
| 5729 | 1819 | function InlineUI2({ |
| 5730 | 1820 | value, |
| 5731 | 1821 | onChange, |
| 5732 | 1822 | activeAttributes, |
| @@ -5732,12 +1822,12 @@ | ||
| 5732 | 1822 | activeAttributes, |
| 5733 | 1823 | contentRef, |
| 5734 | 1824 | latexToMathML |
| 5735 | 1825 | }) { |
| 5736 | - const [latex, setLatex] = (0, import_element19.useState)( | |
| 1826 | + const [latex, setLatex] = (0, import_element9.useState)( | |
| 5737 | 1827 | activeAttributes?.["data-latex"] || "" |
| 5738 | 1828 | ); |
| 5739 | - const [error2, setError] = (0, import_element19.useState)(null); | |
| 1829 | + const [error, setError] = (0, import_element9.useState)(null); | |
| 5740 | 1830 | const popoverAnchor = (0, import_rich_text16.useAnchor)({ |
| 5741 | 1831 | editableContentElement: contentRef.current, |
| 5742 | 1832 | settings: math |
| 5743 | 1833 | }); |
| @@ -5750,11 +1840,11 @@ | ||
| 5750 | 1840 | setError(null); |
| 5751 | 1841 | } catch (err) { |
| 5752 | 1842 | setError(err.message); |
| 5753 | 1843 | (0, import_a11y3.speak)( |
| 5754 | - (0, import_i18n18.sprintf)( | |
| 1844 | + (0, import_i18n17.sprintf)( | |
| 5755 | 1845 | /* translators: %s: error message returned when parsing LaTeX. */ |
| 5756 | - (0, import_i18n18.__)("Error parsing mathematical expression: %s"), | |
| 1846 | + (0, import_i18n17.__)("Error parsing mathematical expression: %s"), | |
| 5757 | 1847 | err.message |
| 5758 | 1848 | ) |
| 5759 | 1849 | ); |
| 5760 | 1850 | return; |
| @@ -5772,9 +1862,9 @@ | ||
| 5772 | 1862 | ...value, |
| 5773 | 1863 | replacements: newReplacements |
| 5774 | 1864 | }); |
| 5775 | 1865 | }; |
| 5776 | - return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( | |
| 1866 | + return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 5777 | 1867 | import_components6.Popover, |
| 5778 | 1868 | { |
| 5779 | 1869 | placement: "bottom-start", |
| 5780 | 1870 | offset: 8, |
| @@ -5780,35 +1870,36 @@ | ||
| 5780 | 1870 | offset: 8, |
| 5781 | 1871 | focusOnMount: false, |
| 5782 | 1872 | anchor: popoverAnchor, |
| 5783 | 1873 | className: "block-editor-format-toolbar__math-popover", |
| 5784 | - 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: [ | |
| 5785 | - /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( | |
| 1874 | + children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("div", { style: { minWidth: "300px", padding: "4px" }, children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_components6.__experimentalVStack, { spacing: 1, children: [ | |
| 1875 | + /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 5786 | 1876 | import_components6.TextControl, |
| 5787 | 1877 | { |
| 1878 | + __next40pxDefaultSize: true, | |
| 5788 | 1879 | hideLabelFromVision: true, |
| 5789 | - label: (0, import_i18n18.__)("LaTeX math syntax"), | |
| 1880 | + label: (0, import_i18n17.__)("LaTeX math syntax"), | |
| 5790 | 1881 | value: latex, |
| 5791 | 1882 | onChange: handleLatexChange, |
| 5792 | - placeholder: (0, import_i18n18.__)("e.g., x^2, \\frac{a}{b}"), | |
| 1883 | + placeholder: (0, import_i18n17.__)("e.g., x^2, \\frac{a}{b}"), | |
| 5793 | 1884 | autoComplete: "off", |
| 5794 | 1885 | className: "block-editor-format-toolbar__math-input" |
| 5795 | 1886 | } |
| 5796 | 1887 | ), |
| 5797 | - error2 && /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [ | |
| 5798 | - /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( | |
| 5799 | - WCBadge, | |
| 1888 | + error && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [ | |
| 1889 | + /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 1890 | + Badge, | |
| 5800 | 1891 | { |
| 5801 | 1892 | intent: "error", |
| 5802 | 1893 | className: "wp-block-math__error", |
| 5803 | - children: (0, import_i18n18.sprintf)( | |
| 1894 | + children: (0, import_i18n17.sprintf)( | |
| 5804 | 1895 | /* translators: %s: error message returned when parsing LaTeX. */ |
| 5805 | - (0, import_i18n18.__)("Error: %s"), | |
| 5806 | - error2 | |
| 1896 | + (0, import_i18n17.__)("Error: %s"), | |
| 1897 | + error | |
| 5807 | 1898 | ) |
| 5808 | 1899 | } |
| 5809 | 1900 | ), |
| 5810 | - /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("style", { children: ".wp-block-math__error .components-badge__content{white-space:normal}" }) | |
| 1901 | + /* @__PURE__ */ (0, import_jsx_runtime30.jsx)("style", { children: ".wp-block-math__error .components-badge__content{white-space:normal}" }) | |
| 5811 | 1902 | ] }) |
| 5812 | 1903 | ] }) }) |
| 5813 | 1904 | } |
| 5814 | 1905 | ); |
| @@ -5820,52 +1911,36 @@ | ||
| 5820 | 1911 | isObjectActive, |
| 5821 | 1912 | activeObjectAttributes, |
| 5822 | 1913 | contentRef |
| 5823 | 1914 | }) { |
| 5824 | - const [latexToMathML, setLatexToMathML] = (0, import_element19.useState)(); | |
| 5825 | - (0, import_element19.useEffect)(() => { | |
| 1915 | + const [latexToMathML, setLatexToMathML] = (0, import_element9.useState)(); | |
| 1916 | + (0, import_element9.useEffect)(() => { | |
| 5826 | 1917 | import("@wordpress/latex-to-mathml").then((module) => { |
| 5827 | 1918 | setLatexToMathML(() => module.default); |
| 5828 | 1919 | }); |
| 5829 | 1920 | }, []); |
| 5830 | - function onClick() { | |
| 5831 | - let newValue; | |
| 5832 | - if (isObjectActive) { | |
| 5833 | - const latex = activeObjectAttributes?.["data-latex"] || ""; | |
| 5834 | - newValue = (0, import_rich_text16.insert)(value, latex); | |
| 5835 | - newValue.start = newValue.end - latex.length; | |
| 5836 | - } else { | |
| 5837 | - const selectedText = (0, import_rich_text16.getTextContent)((0, import_rich_text16.slice)(value)); | |
| 5838 | - let innerHTML = ""; | |
| 5839 | - if (selectedText && latexToMathML) { | |
| 5840 | - try { | |
| 5841 | - innerHTML = latexToMathML(selectedText, { | |
| 5842 | - displayMode: false | |
| 5843 | - }); | |
| 5844 | - } catch { | |
| 5845 | - } | |
| 5846 | - } | |
| 5847 | - newValue = (0, import_rich_text16.insertObject)(value, { | |
| 5848 | - type: name14, | |
| 5849 | - attributes: { "data-latex": selectedText }, | |
| 5850 | - innerHTML | |
| 5851 | - }); | |
| 5852 | - newValue.start = newValue.end - 1; | |
| 5853 | - } | |
| 5854 | - onChange(newValue); | |
| 5855 | - onFocus(); | |
| 5856 | - } | |
| 5857 | - return /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(import_jsx_runtime43.Fragment, { children: [ | |
| 5858 | - /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( | |
| 1921 | + return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [ | |
| 1922 | + /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 5859 | 1923 | import_block_editor16.RichTextToolbarButton, |
| 5860 | 1924 | { |
| 5861 | 1925 | icon: math_default, |
| 5862 | 1926 | title: title14, |
| 5863 | - onClick, | |
| 1927 | + onClick: () => { | |
| 1928 | + const newValue = (0, import_rich_text16.insertObject)(value, { | |
| 1929 | + type: name14, | |
| 1930 | + attributes: { | |
| 1931 | + "data-latex": "" | |
| 1932 | + }, | |
| 1933 | + innerHTML: "" | |
| 1934 | + }); | |
| 1935 | + newValue.start = newValue.end - 1; | |
| 1936 | + onChange(newValue); | |
| 1937 | + onFocus(); | |
| 1938 | + }, | |
| 5864 | 1939 | isActive: isObjectActive |
| 5865 | 1940 | } |
| 5866 | 1941 | ), |
| 5867 | - isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( | |
| 1942 | + isObjectActive && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( | |
| 5868 | 1943 | InlineUI2, |
| 5869 | 1944 | { |
| 5870 | 1945 | value, |
| 5871 | 1946 | onChange, |
| @@ -5888,14 +1963,14 @@ | ||
| 5888 | 1963 | edit: Edit4 |
| 5889 | 1964 | }; |
| 5890 | 1965 | |
| 5891 | 1966 | // packages/format-library/build-module/non-breaking-space/index.mjs |
| 5892 | - var import_i18n19 = __toESM(require_i18n(), 1); | |
| 1967 | + var import_i18n18 = __toESM(require_i18n(), 1); | |
| 5893 | 1968 | var import_rich_text17 = __toESM(require_rich_text(), 1); |
| 5894 | 1969 | var import_block_editor17 = __toESM(require_block_editor(), 1); |
| 5895 | - var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); | |
| 1970 | + var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); | |
| 5896 | 1971 | var name15 = "core/non-breaking-space"; |
| 5897 | - var title15 = (0, import_i18n19.__)("Non breaking space"); | |
| 1972 | + var title15 = (0, import_i18n18.__)("Non breaking space"); | |
| 5898 | 1973 | var nonBreakingSpace = { |
| 5899 | 1974 | name: name15, |
| 5900 | 1975 | title: title15, |
| 5901 | 1976 | tagName: "nbsp", |
| @@ -5903,9 +1978,9 @@ | ||
| 5903 | 1978 | edit({ value, onChange }) { |
| 5904 | 1979 | function addNonBreakingSpace() { |
| 5905 | 1980 | onChange((0, import_rich_text17.insert)(value, "\xA0")); |
| 5906 | 1981 | } |
| 5907 | - return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( | |
| 1982 | + return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( | |
| 5908 | 1983 | import_block_editor17.RichTextShortcut, |
| 5909 | 1984 | { |
| 5910 | 1985 | type: "primaryShift", |
| 5911 | 1986 | character: " ", |
| @@ -5926,9 +2001,9 @@ | ||
| 5926 | 2001 | underline, |
| 5927 | 2002 | textColor, |
| 5928 | 2003 | subscript, |
| 5929 | 2004 | superscript, |
| 5930 | - keyboard2, | |
| 2005 | + keyboard, | |
| 5931 | 2006 | unknown, |
| 5932 | 2007 | language, |
| 5933 | 2008 | math, |
| 5934 | 2009 | nonBreakingSpace |
| @@ -5938,18 +2013,5 @@ | ||
| 5938 | 2013 | default_formats_default.forEach( |
| 5939 | 2014 | ({ name: name16, ...settings }) => (0, import_rich_text18.registerFormatType)(name16, settings) |
| 5940 | 2015 | ); |
| 5941 | 2016 | })(); |
| 5942 | -/*! Bundled license information: | |
| 5943 | - | |
| 5944 | -use-sync-external-store/cjs/use-sync-external-store-shim.development.js: | |
| 5945 | - (** | |
| 5946 | - * @license React | |
| 5947 | - * use-sync-external-store-shim.development.js | |
| 5948 | - * | |
| 5949 | - * Copyright (c) Meta Platforms, Inc. and affiliates. | |
| 5950 | - * | |
| 5951 | - * This source code is licensed under the MIT license found in the | |
| 5952 | - * LICENSE file in the root directory of this source tree. | |
| 5953 | - *) | |
| 5954 | -*/ | |
| 5955 | 2017 | //# sourceMappingURL=index.js.map |