| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 (function() { 2 var wp; 3 (wp ||= {}).editWidgets = (() => { 4 var __create = Object.create; 5 var __defProp = Object.defineProperty; 6 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 7 var __getOwnPropNames = Object.getOwnPropertyNames; 8 var __getProtoOf = Object.getPrototypeOf; 9 var __hasOwnProp = Object.prototype.hasOwnProperty; 10 var __commonJS = (cb, mod) => function __require() { 11 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 12 }; 13 var __export = (target, all) => { 14 for (var name2 in all) 15 __defProp(target, name2, { get: all[name2], enumerable: true }); 16 }; 17 var __copyProps = (to, from, except, desc) => { 18 if (from && typeof from === "object" || typeof from === "function") { 19 for (let key of __getOwnPropNames(from)) 20 if (!__hasOwnProp.call(to, key) && key !== except) 21 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 22 } 23 return to; 24 }; 25 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 26 // If the importer is in node compatibility mode or this is not an ESM 27 // file that has been converted to a CommonJS file using a Babel- 28 // compatible transform (i.e. "__esModule" has not been set), then set 29 // "default" to the CommonJS "module.exports" for node compatibility. 30 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 31 mod 32 )); 33 var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); 34 35 // package-external:@wordpress/blocks 36 var require_blocks = __commonJS({ 37 "package-external:@wordpress/blocks"(exports, module) { 38 module.exports = window.wp.blocks; 39 } 40 }); 41 42 // package-external:@wordpress/data 43 var require_data = __commonJS({ 44 "package-external:@wordpress/data"(exports, module) { 45 module.exports = window.wp.data; 46 } 47 }); 48 49 // package-external:@wordpress/deprecated 50 var require_deprecated = __commonJS({ 51 "package-external:@wordpress/deprecated"(exports, module) { 52 module.exports = window.wp.deprecated; 53 } 54 }); 55 56 // package-external:@wordpress/element 57 var require_element = __commonJS({ 58 "package-external:@wordpress/element"(exports, module) { 59 module.exports = window.wp.element; 60 } 61 }); 62 63 // package-external:@wordpress/block-library 64 var require_block_library = __commonJS({ 65 "package-external:@wordpress/block-library"(exports, module) { 66 module.exports = window.wp.blockLibrary; 67 } 68 }); 69 70 // package-external:@wordpress/core-data 71 var require_core_data = __commonJS({ 72 "package-external:@wordpress/core-data"(exports, module) { 73 module.exports = window.wp.coreData; 74 } 75 }); 76 77 // package-external:@wordpress/widgets 78 var require_widgets = __commonJS({ 79 "package-external:@wordpress/widgets"(exports, module) { 80 module.exports = window.wp.widgets; 81 } 82 }); 83 84 // package-external:@wordpress/preferences 85 var require_preferences = __commonJS({ 86 "package-external:@wordpress/preferences"(exports, module) { 87 module.exports = window.wp.preferences; 88 } 89 }); 90 91 // package-external:@wordpress/api-fetch 92 var require_api_fetch = __commonJS({ 93 "package-external:@wordpress/api-fetch"(exports, module) { 94 module.exports = window.wp.apiFetch; 95 } 96 }); 97 98 // package-external:@wordpress/i18n 99 var require_i18n = __commonJS({ 100 "package-external:@wordpress/i18n"(exports, module) { 101 module.exports = window.wp.i18n; 102 } 103 }); 104 105 // package-external:@wordpress/notices 106 var require_notices = __commonJS({ 107 "package-external:@wordpress/notices"(exports, module) { 108 module.exports = window.wp.notices; 109 } 110 }); 111 112 // package-external:@wordpress/components 113 var require_components = __commonJS({ 114 "package-external:@wordpress/components"(exports, module) { 115 module.exports = window.wp.components; 116 } 117 }); 118 119 // package-external:@wordpress/primitives 120 var require_primitives = __commonJS({ 121 "package-external:@wordpress/primitives"(exports, module) { 122 module.exports = window.wp.primitives; 123 } 124 }); 125 126 // vendor-external:react/jsx-runtime 127 var require_jsx_runtime = __commonJS({ 128 "vendor-external:react/jsx-runtime"(exports, module) { 129 module.exports = window.ReactJSXRuntime; 130 } 131 }); 132 133 // package-external:@wordpress/viewport 134 var require_viewport = __commonJS({ 135 "package-external:@wordpress/viewport"(exports, module) { 136 module.exports = window.wp.viewport; 137 } 138 }); 139 140 // package-external:@wordpress/compose 141 var require_compose = __commonJS({ 142 "package-external:@wordpress/compose"(exports, module) { 143 module.exports = window.wp.compose; 144 } 145 }); 146 147 // package-external:@wordpress/plugins 148 var require_plugins = __commonJS({ 149 "package-external:@wordpress/plugins"(exports, module) { 150 module.exports = window.wp.plugins; 151 } 152 }); 153 154 // vendor-external:react 155 var require_react = __commonJS({ 156 "vendor-external:react"(exports, module) { 157 module.exports = window.React; 158 } 159 }); 160 161 // vendor-external:react-dom 162 var require_react_dom = __commonJS({ 163 "vendor-external:react-dom"(exports, module) { 164 module.exports = window.ReactDOM; 165 } 166 }); 167 168 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js 169 var require_use_sync_external_store_shim_development = __commonJS({ 170 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { 171 "use strict"; 172 (function() { 173 function is(x, y) { 174 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 175 } 176 function useSyncExternalStore$2(subscribe, getSnapshot) { 177 didWarnOld18Alpha || void 0 === React60.startTransition || (didWarnOld18Alpha = true, console.error( 178 "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." 179 )); 180 var value = getSnapshot(); 181 if (!didWarnUncachedGetSnapshot) { 182 var cachedValue = getSnapshot(); 183 objectIs(value, cachedValue) || (console.error( 184 "The result of getSnapshot should be cached to avoid an infinite loop" 185 ), didWarnUncachedGetSnapshot = true); 186 } 187 cachedValue = useState21({ 188 inst: { value, getSnapshot } 189 }); 190 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; 191 useLayoutEffect4( 192 function() { 193 inst.value = value; 194 inst.getSnapshot = getSnapshot; 195 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 196 }, 197 [subscribe, value, getSnapshot] 198 ); 199 useEffect25( 200 function() { 201 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 202 return subscribe(function() { 203 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 204 }); 205 }, 206 [subscribe] 207 ); 208 useDebugValue2(value); 209 return value; 210 } 211 function checkIfSnapshotChanged(inst) { 212 var latestGetSnapshot = inst.getSnapshot; 213 inst = inst.value; 214 try { 215 var nextValue = latestGetSnapshot(); 216 return !objectIs(inst, nextValue); 217 } catch (error2) { 218 return true; 219 } 220 } 221 function useSyncExternalStore$1(subscribe, getSnapshot) { 222 return getSnapshot(); 223 } 224 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 225 var React60 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState21 = React60.useState, useEffect25 = React60.useEffect, useLayoutEffect4 = React60.useLayoutEffect, useDebugValue2 = React60.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; 226 exports.useSyncExternalStore = void 0 !== React60.useSyncExternalStore ? React60.useSyncExternalStore : shim; 227 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 228 })(); 229 } 230 }); 231 232 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/index.js 233 var require_shim = __commonJS({ 234 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/index.js"(exports, module) { 235 "use strict"; 236 if (false) { 237 module.exports = null; 238 } else { 239 module.exports = require_use_sync_external_store_shim_development(); 240 } 241 } 242 }); 243 244 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js 245 var require_with_selector_development = __commonJS({ 246 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { 247 "use strict"; 248 (function() { 249 function is(x, y) { 250 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 251 } 252 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 253 var React60 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef29 = React60.useRef, useEffect25 = React60.useEffect, useMemo24 = React60.useMemo, useDebugValue2 = React60.useDebugValue; 254 exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { 255 var instRef = useRef29(null); 256 if (null === instRef.current) { 257 var inst = { hasValue: false, value: null }; 258 instRef.current = inst; 259 } else inst = instRef.current; 260 instRef = useMemo24( 261 function() { 262 function memoizedSelector(nextSnapshot) { 263 if (!hasMemo) { 264 hasMemo = true; 265 memoizedSnapshot = nextSnapshot; 266 nextSnapshot = selector(nextSnapshot); 267 if (void 0 !== isEqual && inst.hasValue) { 268 var currentSelection = inst.value; 269 if (isEqual(currentSelection, nextSnapshot)) 270 return memoizedSelection = currentSelection; 271 } 272 return memoizedSelection = nextSnapshot; 273 } 274 currentSelection = memoizedSelection; 275 if (objectIs(memoizedSnapshot, nextSnapshot)) 276 return currentSelection; 277 var nextSelection = selector(nextSnapshot); 278 if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) 279 return memoizedSnapshot = nextSnapshot, currentSelection; 280 memoizedSnapshot = nextSnapshot; 281 return memoizedSelection = nextSelection; 282 } 283 var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; 284 return [ 285 function() { 286 return memoizedSelector(getSnapshot()); 287 }, 288 null === maybeGetServerSnapshot ? void 0 : function() { 289 return memoizedSelector(maybeGetServerSnapshot()); 290 } 291 ]; 292 }, 293 [getSnapshot, getServerSnapshot, selector, isEqual] 294 ); 295 var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]); 296 useEffect25( 297 function() { 298 inst.hasValue = true; 299 inst.value = value; 300 }, 301 [value] 302 ); 303 useDebugValue2(value); 304 return value; 305 }; 306 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 307 })(); 308 } 309 }); 310 311 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/with-selector.js 312 var require_with_selector = __commonJS({ 313 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { 314 "use strict"; 315 if (false) { 316 module.exports = null; 317 } else { 318 module.exports = require_with_selector_development(); 319 } 320 } 321 }); 322 323 // package-external:@wordpress/a11y 324 var require_a11y = __commonJS({ 325 "package-external:@wordpress/a11y"(exports, module) { 326 module.exports = window.wp.a11y; 327 } 328 }); 329 330 // package-external:@wordpress/theme 331 var require_theme = __commonJS({ 332 "package-external:@wordpress/theme"(exports, module) { 333 module.exports = window.wp.theme; 334 } 335 }); 336 337 // package-external:@wordpress/private-apis 338 var require_private_apis = __commonJS({ 339 "package-external:@wordpress/private-apis"(exports, module) { 340 module.exports = window.wp.privateApis; 341 } 342 }); 343 344 // package-external:@wordpress/block-editor 345 var require_block_editor = __commonJS({ 346 "package-external:@wordpress/block-editor"(exports, module) { 347 module.exports = window.wp.blockEditor; 348 } 349 }); 350 351 // package-external:@wordpress/hooks 352 var require_hooks = __commonJS({ 353 "package-external:@wordpress/hooks"(exports, module) { 354 module.exports = window.wp.hooks; 355 } 356 }); 357 358 // package-external:@wordpress/media-utils 359 var require_media_utils = __commonJS({ 360 "package-external:@wordpress/media-utils"(exports, module) { 361 module.exports = window.wp.mediaUtils; 362 } 363 }); 364 365 // package-external:@wordpress/patterns 366 var require_patterns = __commonJS({ 367 "package-external:@wordpress/patterns"(exports, module) { 368 module.exports = window.wp.patterns; 369 } 370 }); 371 372 // package-external:@wordpress/keyboard-shortcuts 373 var require_keyboard_shortcuts = __commonJS({ 374 "package-external:@wordpress/keyboard-shortcuts"(exports, module) { 375 module.exports = window.wp.keyboardShortcuts; 376 } 377 }); 378 379 // package-external:@wordpress/keycodes 380 var require_keycodes = __commonJS({ 381 "package-external:@wordpress/keycodes"(exports, module) { 382 module.exports = window.wp.keycodes; 383 } 384 }); 385 386 // package-external:@wordpress/url 387 var require_url = __commonJS({ 388 "package-external:@wordpress/url"(exports, module) { 389 module.exports = window.wp.url; 390 } 391 }); 392 393 // package-external:@wordpress/dom 394 var require_dom = __commonJS({ 395 "package-external:@wordpress/dom"(exports, module) { 396 module.exports = window.wp.dom; 397 } 398 }); 399 400 // packages/edit-widgets/build-module/index.mjs 401 var index_exports = {}; 402 __export(index_exports, { 403 initialize: () => initialize, 404 initializeEditor: () => initializeEditor, 405 reinitializeEditor: () => reinitializeEditor, 406 store: () => store2 407 }); 408 var import_blocks3 = __toESM(require_blocks(), 1); 409 var import_data33 = __toESM(require_data(), 1); 410 var import_deprecated6 = __toESM(require_deprecated(), 1); 411 var import_element71 = __toESM(require_element(), 1); 412 var import_block_library = __toESM(require_block_library(), 1); 413 var import_core_data12 = __toESM(require_core_data(), 1); 414 var import_widgets5 = __toESM(require_widgets(), 1); 415 var import_preferences10 = __toESM(require_preferences(), 1); 416 417 // packages/edit-widgets/build-module/store/index.mjs 418 var import_api_fetch = __toESM(require_api_fetch(), 1); 419 var import_data8 = __toESM(require_data(), 1); 420 421 // packages/edit-widgets/build-module/store/reducer.mjs 422 var import_data = __toESM(require_data(), 1); 423 function widgetAreasOpenState(state = {}, action) { 424 const { type } = action; 425 switch (type) { 426 case "SET_WIDGET_AREAS_OPEN_STATE": { 427 return action.widgetAreasOpenState; 428 } 429 case "SET_IS_WIDGET_AREA_OPEN": { 430 const { clientId, isOpen } = action; 431 return { 432 ...state, 433 [clientId]: isOpen 434 }; 435 } 436 default: { 437 return state; 438 } 439 } 440 } 441 function blockInserterPanel(state = false, action) { 442 switch (action.type) { 443 case "SET_IS_LIST_VIEW_OPENED": 444 return action.isOpen ? false : state; 445 case "SET_IS_INSERTER_OPENED": 446 return action.value; 447 } 448 return state; 449 } 450 function listViewPanel(state = false, action) { 451 switch (action.type) { 452 case "SET_IS_INSERTER_OPENED": 453 return action.value ? false : state; 454 case "SET_IS_LIST_VIEW_OPENED": 455 return action.isOpen; 456 } 457 return state; 458 } 459 function listViewToggleRef(state = { current: null }) { 460 return state; 461 } 462 function inserterSidebarToggleRef(state = { current: null }) { 463 return state; 464 } 465 function widgetSavingLock(state = {}, action) { 466 switch (action.type) { 467 case "LOCK_WIDGET_SAVING": 468 return { ...state, [action.lockName]: true }; 469 case "UNLOCK_WIDGET_SAVING": { 470 const { [action.lockName]: removedLockName, ...restState } = state; 471 return restState; 472 } 473 } 474 return state; 475 } 476 var reducer_default = (0, import_data.combineReducers)({ 477 blockInserterPanel, 478 inserterSidebarToggleRef, 479 listViewPanel, 480 listViewToggleRef, 481 widgetAreasOpenState, 482 widgetSavingLock 483 }); 484 485 // packages/edit-widgets/build-module/store/resolvers.mjs 486 var resolvers_exports = {}; 487 __export(resolvers_exports, { 488 getWidgetAreas: () => getWidgetAreas, 489 getWidgets: () => getWidgets 490 }); 491 var import_blocks2 = __toESM(require_blocks(), 1); 492 var import_core_data2 = __toESM(require_core_data(), 1); 493 494 // packages/edit-widgets/build-module/store/actions.mjs 495 var actions_exports2 = {}; 496 __export(actions_exports2, { 497 closeGeneralSidebar: () => closeGeneralSidebar, 498 lockWidgetSaving: () => lockWidgetSaving, 499 moveBlockToWidgetArea: () => moveBlockToWidgetArea, 500 persistStubPost: () => persistStubPost, 501 saveEditedWidgetAreas: () => saveEditedWidgetAreas, 502 saveWidgetArea: () => saveWidgetArea, 503 saveWidgetAreas: () => saveWidgetAreas, 504 setIsInserterOpened: () => setIsInserterOpened, 505 setIsListViewOpened: () => setIsListViewOpened, 506 setIsWidgetAreaOpen: () => setIsWidgetAreaOpen, 507 setWidgetAreasOpenState: () => setWidgetAreasOpenState, 508 setWidgetIdForClientId: () => setWidgetIdForClientId, 509 unlockWidgetSaving: () => unlockWidgetSaving 510 }); 511 var import_i18n8 = __toESM(require_i18n(), 1); 512 var import_notices = __toESM(require_notices(), 1); 513 514 // node_modules/.store/clsx@2.1.1-XOLP1vUL9vEGfpiXm37fAw/node_modules/clsx/dist/clsx.mjs 515 function r(e) { 516 var t, f, n = ""; 517 if ("string" == typeof e || "number" == typeof e) n += e; 518 else if ("object" == typeof e) if (Array.isArray(e)) { 519 var o = e.length; 520 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); 521 } else for (f in e) e[f] && (n && (n += " "), n += f); 522 return n; 523 } 524 function clsx() { 525 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); 526 return n; 527 } 528 var clsx_default = clsx; 529 530 // packages/interface/build-module/components/complementary-area/index.mjs 531 var import_components4 = __toESM(require_components(), 1); 532 var import_data6 = __toESM(require_data(), 1); 533 var import_i18n = __toESM(require_i18n(), 1); 534 535 // packages/icons/build-module/library/caution.mjs 536 var import_primitives = __toESM(require_primitives(), 1); 537 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 538 var caution_default = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_primitives.Path, { d: "M12 8L12 13M12 14.5L12 16M4.75 12C4.75 7.99593 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12Z", strokeLinejoin: "round" }) }); 539 540 // packages/icons/build-module/library/check.mjs 541 var import_primitives2 = __toESM(require_primitives(), 1); 542 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 543 var check_default = /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(import_primitives2.Path, { d: "M7 12L10 15L17 8" }) }); 544 545 // packages/icons/build-module/library/chevron-down.mjs 546 var import_primitives3 = __toESM(require_primitives(), 1); 547 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); 548 var chevron_down_default = /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(import_primitives3.Path, { d: "M7 11L12 15L17 11" }) }); 549 550 // packages/icons/build-module/library/close-small.mjs 551 var import_primitives4 = __toESM(require_primitives(), 1); 552 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); 553 var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_primitives4.Path, { d: "M7.75 16.25L16.25 7.75M16.25 16.25L7.75 7.75" }) }); 554 555 // packages/icons/build-module/library/drawer-left.mjs 556 var import_primitives5 = __toESM(require_primitives(), 1); 557 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); 558 var drawer_left_default = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(import_primitives5.Path, { d: "M9.75 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V18C4.75 18.6904 5.30964 19.25 6 19.25H9.75M9.75 4.75H18C18.6904 4.75 19.25 5.30964 19.25 6V18C19.25 18.6904 18.6904 19.25 18 19.25H9.75M9.75 4.75V19.25" }) }); 559 560 // packages/icons/build-module/library/drawer-right.mjs 561 var import_primitives6 = __toESM(require_primitives(), 1); 562 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); 563 var drawer_right_default = /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_primitives6.Path, { d: "M14.25 19.25L18 19.25C18.6904 19.25 19.25 18.6904 19.25 18L19.25 6C19.25 5.30964 18.6904 4.75 18 4.75L14.25 4.75M14.25 19.25L6 19.25C5.30964 19.25 4.75 18.6904 4.75 18L4.75 6C4.75 5.30964 5.30965 4.75 6 4.75L14.25 4.75M14.25 19.25L14.25 4.75" }) }); 564 565 // packages/icons/build-module/library/error.mjs 566 var import_primitives7 = __toESM(require_primitives(), 1); 567 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); 568 var error_default = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(import_primitives7.Path, { d: "M12 9L12 14M12 15.5V17M11.1284 5.04947L3.83827 18.0097C3.46331 18.6763 3.94502 19.5 4.70985 19.5H19.2902C20.055 19.5 20.5367 18.6763 20.1617 18.0097L12.8716 5.04947C12.4893 4.36982 11.5107 4.36982 11.1284 5.04947Z" }) }); 569 570 // packages/icons/build-module/library/external.mjs 571 var import_primitives8 = __toESM(require_primitives(), 1); 572 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); 573 var external_default = /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_primitives8.Path, { d: "M9.5 6.25H6.5C5.80964 6.25 5.25 6.80964 5.25 7.5V17.5C5.25 18.1904 5.80964 18.75 6.5 18.75H16.5C17.1904 18.75 17.75 18.1904 17.75 17.5V14.5M11.5 12.5L18.75 5.25M12.5 5.25H18.75V11.5" }) }); 574 575 // packages/icons/build-module/library/info.mjs 576 var import_primitives9 = __toESM(require_primitives(), 1); 577 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); 578 var info_default = /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(import_primitives9.Path, { d: "M12 16V11M12 9.5V8M19.25 12C19.25 16.0041 16.0041 19.25 12 19.25C7.99594 19.25 4.75 16.0041 4.75 12C4.75 7.99594 7.99594 4.75 12 4.75C16.0041 4.75 19.25 7.99594 19.25 12Z", strokeLinejoin: "round" }) }); 579 580 // packages/icons/build-module/library/layout.mjs 581 var import_primitives10 = __toESM(require_primitives(), 1); 582 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); 583 var layout_default = /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(import_primitives10.Path, { d: "M9.75 19.25H18C18.6904 19.25 19.25 18.6904 19.25 18V9.75M9.75 19.25H6C5.30964 19.25 4.75 18.6904 4.75 18V9.75M9.75 19.25V9.75M19.25 9.75V6C19.25 5.30964 18.6904 4.75 18 4.75H6C5.30964 4.75 4.75 5.30964 4.75 6V9.75M19.25 9.75H9.75M9.75 9.75H4.75" }) }); 584 585 // packages/icons/build-module/library/list-view.mjs 586 var import_primitives11 = __toESM(require_primitives(), 1); 587 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); 588 var list_view_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives11.Path, { d: "M10 17.5H21M6.5 12H17.5M3 6.5H14", strokeLinejoin: "round" }) }); 589 590 // packages/icons/build-module/library/more-vertical.mjs 591 var import_primitives12 = __toESM(require_primitives(), 1); 592 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); 593 var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_primitives12.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 594 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z", fill: "currentColor", stroke: "none" }), 595 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z", fill: "currentColor", stroke: "none" }), 596 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z", fill: "currentColor", stroke: "none" }), 597 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M11.75 18.25L12.25 18.25L12.25 17.75L11.75 17.75L11.75 18.25Z" }), 598 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M11.75 12.25L12.25 12.25L12.25 11.75L11.75 11.75L11.75 12.25Z" }), 599 /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives12.Path, { d: "M11.75 6.25L12.25 6.25L12.25 5.75L11.75 5.75L11.75 6.25Z" }) 600 ] }); 601 602 // packages/icons/build-module/library/plus.mjs 603 var import_primitives13 = __toESM(require_primitives(), 1); 604 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); 605 var plus_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives13.Path, { d: "M12 18V6M18 12H6" }) }); 606 607 // packages/icons/build-module/library/published.mjs 608 var import_primitives14 = __toESM(require_primitives(), 1); 609 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); 610 var published_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsxs)(import_primitives14.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: [ 611 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M12 19.25C16.0041 19.25 19.25 16.0041 19.25 12C19.25 7.99594 16.0041 4.75 12 4.75C7.99594 4.75 4.75 7.99594 4.75 12C4.75 16.0041 7.99594 19.25 12 19.25Z", strokeLinejoin: "round" }), 612 /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives14.Path, { d: "M9 12L11 14L15 10" }) 613 ] }); 614 615 // packages/icons/build-module/library/redo.mjs 616 var import_primitives15 = __toESM(require_primitives(), 1); 617 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); 618 var redo_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives15.Path, { d: "M15 15L18.5 11L15 7M18.5 11H8C5 11 4.75 13.8 4.75 17" }) }); 619 620 // packages/icons/build-module/library/star-empty.mjs 621 var import_primitives16 = __toESM(require_primitives(), 1); 622 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); 623 var star_empty_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives16.Path, { d: "M12 5.71576L13.6106 8.97924C13.7563 9.27438 14.0379 9.47895 14.3636 9.52628L17.965 10.0496L15.359 12.5899C15.1233 12.8196 15.0157 13.1506 15.0714 13.475L15.6866 17.0619L12.4653 15.3684C12.174 15.2152 11.826 15.2152 11.5347 15.3684L8.31341 17.0619L8.92861 13.475C8.98425 13.1506 8.8767 12.8196 8.64102 12.5899L6.03497 10.0496L9.63644 9.52628C9.96215 9.47895 10.2437 9.27438 10.3894 8.97924L12 5.71576Z" }) }); 624 625 // packages/icons/build-module/library/star-filled.mjs 626 var import_primitives17 = __toESM(require_primitives(), 1); 627 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); 628 var star_filled_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives17.Path, { d: "M12 5.71576L13.6106 8.97924C13.7563 9.27438 14.0379 9.47895 14.3636 9.52628L17.965 10.0496L15.359 12.5899C15.1233 12.8196 15.0157 13.1506 15.0714 13.475L15.6866 17.0619L12.4653 15.3684C12.174 15.2152 11.826 15.2152 11.5347 15.3684L8.31341 17.0619L8.92861 13.475C8.98425 13.1506 8.8767 12.8196 8.64102 12.5899L6.03497 10.0496L9.63644 9.52628C9.96215 9.47895 10.2437 9.27438 10.3894 8.97924L12 5.71576Z", fill: "currentColor" }) }); 629 630 // packages/icons/build-module/library/undo.mjs 631 var import_primitives18 = __toESM(require_primitives(), 1); 632 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); 633 var undo_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives18.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", style: { fill: "none" }, stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives18.Path, { d: "M8.25 15L4.75 11L8.25 7M4.75 11H15.25C18.25 11 18.5 13.8 18.5 17" }) }); 634 635 // packages/interface/build-module/components/complementary-area/index.mjs 636 var import_element3 = __toESM(require_element(), 1); 637 var import_viewport = __toESM(require_viewport(), 1); 638 var import_preferences3 = __toESM(require_preferences(), 1); 639 var import_compose2 = __toESM(require_compose(), 1); 640 var import_plugins2 = __toESM(require_plugins(), 1); 641 642 // packages/interface/build-module/components/complementary-area-toggle/index.mjs 643 var import_components = __toESM(require_components(), 1); 644 var import_data5 = __toESM(require_data(), 1); 645 var import_plugins = __toESM(require_plugins(), 1); 646 647 // packages/interface/build-module/store/index.mjs 648 var import_data4 = __toESM(require_data(), 1); 649 650 // packages/interface/build-module/store/actions.mjs 651 var actions_exports = {}; 652 __export(actions_exports, { 653 closeModal: () => closeModal, 654 disableComplementaryArea: () => disableComplementaryArea, 655 enableComplementaryArea: () => enableComplementaryArea, 656 openModal: () => openModal, 657 pinItem: () => pinItem, 658 setDefaultComplementaryArea: () => setDefaultComplementaryArea, 659 setFeatureDefaults: () => setFeatureDefaults, 660 setFeatureValue: () => setFeatureValue, 661 toggleFeature: () => toggleFeature, 662 unpinItem: () => unpinItem 663 }); 664 var import_deprecated2 = __toESM(require_deprecated(), 1); 665 var import_preferences = __toESM(require_preferences(), 1); 666 667 // packages/interface/build-module/store/deprecated.mjs 668 var import_deprecated = __toESM(require_deprecated(), 1); 669 function normalizeComplementaryAreaScope(scope) { 670 if (["core/edit-post", "core/edit-site"].includes(scope)) { 671 (0, import_deprecated.default)(`$scope} interface scope`, { 672 alternative: "core interface scope", 673 hint: "core/edit-post and core/edit-site are merging.", 674 version: "6.6" 675 }); 676 return "core"; 677 } 678 return scope; 679 } 680 function normalizeComplementaryAreaName(scope, name2) { 681 if (scope === "core" && name2 === "edit-site/template") { 682 (0, import_deprecated.default)(`edit-site/template sidebar`, { 683 alternative: "edit-post/document", 684 version: "6.6" 685 }); 686 return "edit-post/document"; 687 } 688 if (scope === "core" && name2 === "edit-site/block-inspector") { 689 (0, import_deprecated.default)(`edit-site/block-inspector sidebar`, { 690 alternative: "edit-post/block", 691 version: "6.6" 692 }); 693 return "edit-post/block"; 694 } 695 return name2; 696 } 697 698 // packages/interface/build-module/store/actions.mjs 699 var setDefaultComplementaryArea = (scope, area) => { 700 scope = normalizeComplementaryAreaScope(scope); 701 area = normalizeComplementaryAreaName(scope, area); 702 return { 703 type: "SET_DEFAULT_COMPLEMENTARY_AREA", 704 scope, 705 area 706 }; 707 }; 708 var enableComplementaryArea = (scope, area) => ({ registry, dispatch: dispatch2 }) => { 709 if (!area) { 710 return; 711 } 712 scope = normalizeComplementaryAreaScope(scope); 713 area = normalizeComplementaryAreaName(scope, area); 714 const isComplementaryAreaVisible = registry.select(import_preferences.store).get(scope, "isComplementaryAreaVisible"); 715 if (!isComplementaryAreaVisible) { 716 registry.dispatch(import_preferences.store).set(scope, "isComplementaryAreaVisible", true); 717 } 718 dispatch2({ 719 type: "ENABLE_COMPLEMENTARY_AREA", 720 scope, 721 area 722 }); 723 }; 724 var disableComplementaryArea = (scope) => ({ registry }) => { 725 scope = normalizeComplementaryAreaScope(scope); 726 const isComplementaryAreaVisible = registry.select(import_preferences.store).get(scope, "isComplementaryAreaVisible"); 727 if (isComplementaryAreaVisible) { 728 registry.dispatch(import_preferences.store).set(scope, "isComplementaryAreaVisible", false); 729 } 730 }; 731 var pinItem = (scope, item) => ({ registry }) => { 732 if (!item) { 733 return; 734 } 735 scope = normalizeComplementaryAreaScope(scope); 736 item = normalizeComplementaryAreaName(scope, item); 737 const pinnedItems = registry.select(import_preferences.store).get(scope, "pinnedItems"); 738 if (pinnedItems?.[item] === true) { 739 return; 740 } 741 registry.dispatch(import_preferences.store).set(scope, "pinnedItems", { 742 ...pinnedItems, 743 [item]: true 744 }); 745 }; 746 var unpinItem = (scope, item) => ({ registry }) => { 747 if (!item) { 748 return; 749 } 750 scope = normalizeComplementaryAreaScope(scope); 751 item = normalizeComplementaryAreaName(scope, item); 752 const pinnedItems = registry.select(import_preferences.store).get(scope, "pinnedItems"); 753 registry.dispatch(import_preferences.store).set(scope, "pinnedItems", { 754 ...pinnedItems, 755 [item]: false 756 }); 757 }; 758 function toggleFeature(scope, featureName) { 759 return function({ registry }) { 760 (0, import_deprecated2.default)(`dispatch( 'core/interface' ).toggleFeature`, { 761 since: "6.0", 762 alternative: `dispatch( 'core/preferences' ).toggle` 763 }); 764 registry.dispatch(import_preferences.store).toggle(scope, featureName); 765 }; 766 } 767 function setFeatureValue(scope, featureName, value) { 768 return function({ registry }) { 769 (0, import_deprecated2.default)(`dispatch( 'core/interface' ).setFeatureValue`, { 770 since: "6.0", 771 alternative: `dispatch( 'core/preferences' ).set` 772 }); 773 registry.dispatch(import_preferences.store).set(scope, featureName, !!value); 774 }; 775 } 776 function setFeatureDefaults(scope, defaults) { 777 return function({ registry }) { 778 (0, import_deprecated2.default)(`dispatch( 'core/interface' ).setFeatureDefaults`, { 779 since: "6.0", 780 alternative: `dispatch( 'core/preferences' ).setDefaults` 781 }); 782 registry.dispatch(import_preferences.store).setDefaults(scope, defaults); 783 }; 784 } 785 function openModal(name2) { 786 return { 787 type: "OPEN_MODAL", 788 name: name2 789 }; 790 } 791 function closeModal() { 792 return { 793 type: "CLOSE_MODAL" 794 }; 795 } 796 797 // packages/interface/build-module/store/selectors.mjs 798 var selectors_exports = {}; 799 __export(selectors_exports, { 800 getActiveComplementaryArea: () => getActiveComplementaryArea, 801 isComplementaryAreaLoading: () => isComplementaryAreaLoading, 802 isFeatureActive: () => isFeatureActive, 803 isItemPinned: () => isItemPinned, 804 isModalActive: () => isModalActive 805 }); 806 var import_data2 = __toESM(require_data(), 1); 807 var import_deprecated4 = __toESM(require_deprecated(), 1); 808 var import_preferences2 = __toESM(require_preferences(), 1); 809 var getActiveComplementaryArea = (0, import_data2.createRegistrySelector)( 810 (select) => (state, scope) => { 811 scope = normalizeComplementaryAreaScope(scope); 812 const isComplementaryAreaVisible = select(import_preferences2.store).get( 813 scope, 814 "isComplementaryAreaVisible" 815 ); 816 if (isComplementaryAreaVisible === void 0) { 817 return void 0; 818 } 819 if (isComplementaryAreaVisible === false) { 820 return null; 821 } 822 return state?.complementaryAreas?.[scope]; 823 } 824 ); 825 var isComplementaryAreaLoading = (0, import_data2.createRegistrySelector)( 826 (select) => (state, scope) => { 827 scope = normalizeComplementaryAreaScope(scope); 828 const isVisible = select(import_preferences2.store).get( 829 scope, 830 "isComplementaryAreaVisible" 831 ); 832 const identifier = state?.complementaryAreas?.[scope]; 833 return isVisible && identifier === void 0; 834 } 835 ); 836 var isItemPinned = (0, import_data2.createRegistrySelector)( 837 (select) => (state, scope, item) => { 838 scope = normalizeComplementaryAreaScope(scope); 839 item = normalizeComplementaryAreaName(scope, item); 840 const pinnedItems = select( 841 import_preferences2.store 842 ).get(scope, "pinnedItems"); 843 return pinnedItems?.[item] ?? true; 844 } 845 ); 846 var isFeatureActive = (0, import_data2.createRegistrySelector)( 847 (select) => (state, scope, featureName) => { 848 (0, import_deprecated4.default)( 849 `select( 'core/interface' ).isFeatureActive( scope, featureName )`, 850 { 851 since: "6.0", 852 alternative: `select( 'core/preferences' ).get( scope, featureName )` 853 } 854 ); 855 return !!select(import_preferences2.store).get(scope, featureName); 856 } 857 ); 858 function isModalActive(state, modalName) { 859 return state.activeModal === modalName; 860 } 861 862 // packages/interface/build-module/store/reducer.mjs 863 var import_data3 = __toESM(require_data(), 1); 864 function complementaryAreas(state = {}, action) { 865 switch (action.type) { 866 case "SET_DEFAULT_COMPLEMENTARY_AREA": { 867 const { scope, area } = action; 868 if (state[scope]) { 869 return state; 870 } 871 return { 872 ...state, 873 [scope]: area 874 }; 875 } 876 case "ENABLE_COMPLEMENTARY_AREA": { 877 const { scope, area } = action; 878 return { 879 ...state, 880 [scope]: area 881 }; 882 } 883 } 884 return state; 885 } 886 function activeModal(state = null, action) { 887 switch (action.type) { 888 case "OPEN_MODAL": 889 return action.name; 890 case "CLOSE_MODAL": 891 return null; 892 } 893 return state; 894 } 895 var reducer_default2 = (0, import_data3.combineReducers)({ 896 complementaryAreas, 897 activeModal 898 }); 899 900 // packages/interface/build-module/store/constants.mjs 901 var STORE_NAME = "core/interface"; 902 903 // packages/interface/build-module/store/index.mjs 904 var store = (0, import_data4.createReduxStore)(STORE_NAME, { 905 reducer: reducer_default2, 906 actions: actions_exports, 907 selectors: selectors_exports 908 }); 909 (0, import_data4.register)(store); 910 911 // packages/interface/build-module/components/complementary-area-toggle/index.mjs 912 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); 913 function roleSupportsCheckedState(role) { 914 return [ 915 "checkbox", 916 "option", 917 "radio", 918 "switch", 919 "menuitemcheckbox", 920 "menuitemradio", 921 "treeitem" 922 ].includes(role); 923 } 924 function ComplementaryAreaToggle({ 925 as = import_components.Button, 926 scope, 927 identifier: identifierProp, 928 icon: iconProp, 929 selectedIcon, 930 name: name2, 931 shortcut, 932 ...props 933 }) { 934 const ComponentToUse = as; 935 const context = (0, import_plugins.usePluginContext)(); 936 const icon = iconProp || context.icon; 937 const identifier = identifierProp || `$context.name}/$name2}`; 938 const isSelected = (0, import_data5.useSelect)( 939 (select) => select(store).getActiveComplementaryArea(scope) === identifier, 940 [identifier, scope] 941 ); 942 const { enableComplementaryArea: enableComplementaryArea2, disableComplementaryArea: disableComplementaryArea2 } = (0, import_data5.useDispatch)(store); 943 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)( 944 ComponentToUse, 945 { 946 icon: selectedIcon && isSelected ? selectedIcon : icon, 947 "aria-controls": identifier.replace("/", ":"), 948 "aria-checked": roleSupportsCheckedState(props.role) ? isSelected : void 0, 949 onClick: () => { 950 if (isSelected) { 951 disableComplementaryArea2(scope); 952 } else { 953 enableComplementaryArea2(scope, identifier); 954 } 955 }, 956 shortcut, 957 ...props 958 } 959 ); 960 } 961 962 // packages/interface/build-module/components/complementary-area-header/index.mjs 963 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); 964 var ComplementaryAreaHeader = ({ 965 children, 966 className, 967 toggleButtonProps 968 }) => { 969 const toggleButton = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(ComplementaryAreaToggle, { icon: close_small_default, ...toggleButtonProps }); 970 return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)( 971 "div", 972 { 973 className: clsx_default( 974 "components-panel__header", 975 "interface-complementary-area-header", 976 className 977 ), 978 tabIndex: -1, 979 children: [ 980 children, 981 toggleButton 982 ] 983 } 984 ); 985 }; 986 var complementary_area_header_default = ComplementaryAreaHeader; 987 988 // packages/interface/build-module/components/complementary-area-more-menu-item/index.mjs 989 var import_compose = __toESM(require_compose(), 1); 990 var import_element2 = __toESM(require_element(), 1); 991 992 // packages/interface/build-module/components/action-item/index.mjs 993 var import_components2 = __toESM(require_components(), 1); 994 var import_element = __toESM(require_element(), 1); 995 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); 996 function ActionItemSlot({ 997 name: name2, 998 as: Component2 = import_components2.MenuGroup, 999 fillProps = {}, 1000 children, 1001 ...props 1002 }) { 1003 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components2.Slot, { name: name2, fillProps, children: (fills) => { 1004 const items = import_element.Children.toArray(fills); 1005 if (!items.length) { 1006 return null; 1007 } 1008 if (typeof children === "function") { 1009 return children(items); 1010 } 1011 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(Component2, { ...props, children: items }); 1012 } }); 1013 } 1014 function ActionItem({ name: name2, as, onClick, ...props }) { 1015 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_components2.Fill, { name: name2, children: ({ as: slotAs = import_components2.MenuItem, onClick: slotOnClick }) => { 1016 const Component2 = as ?? slotAs; 1017 const handlers = [onClick, slotOnClick].filter(Boolean); 1018 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( 1019 Component2, 1020 { 1021 onClick: handlers.length ? (...args) => handlers.forEach( 1022 (handler) => handler(...args) 1023 ) : void 0, 1024 ...props 1025 } 1026 ); 1027 } }); 1028 } 1029 ActionItem.Slot = ActionItemSlot; 1030 var action_item_default = ActionItem; 1031 1032 // packages/interface/build-module/components/complementary-area-more-menu-item/index.mjs 1033 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); 1034 var menuItems = (0, import_compose.observableMap)(); 1035 function useHasComplementaryAreaMenuItem(scope, target) { 1036 return !!(0, import_compose.useObservableValue)(menuItems, `$scope}/$target}`); 1037 } 1038 function DefaultComplementaryAreaMoreMenuItem({ 1039 scope, 1040 target, 1041 ...props 1042 }) { 1043 return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( 1044 ComplementaryAreaToggle, 1045 { 1046 as: (toggleProps) => /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( 1047 action_item_default, 1048 { 1049 name: `$scope}/plugin-more-menu`, 1050 ...toggleProps 1051 } 1052 ), 1053 role: "menuitemcheckbox", 1054 name: target, 1055 scope, 1056 ...props 1057 } 1058 ); 1059 } 1060 1061 // packages/interface/build-module/components/pinned-items/index.mjs 1062 var import_components3 = __toESM(require_components(), 1); 1063 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); 1064 function PinnedItems({ scope, ...props }) { 1065 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components3.Fill, { name: `PinnedItems/$scope}`, ...props }); 1066 } 1067 function PinnedItemsSlot({ 1068 scope, 1069 className, 1070 ...props 1071 }) { 1072 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(import_components3.Slot, { name: `PinnedItems/$scope}`, ...props, children: (fills) => fills?.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( 1073 "div", 1074 { 1075 className: clsx_default( 1076 className, 1077 "interface-pinned-items" 1078 ), 1079 children: fills 1080 } 1081 ) }); 1082 } 1083 PinnedItems.Slot = PinnedItemsSlot; 1084 var pinned_items_default = PinnedItems; 1085 1086 // packages/interface/build-module/components/complementary-area/index.mjs 1087 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); 1088 var ANIMATION_DURATION = 0.3; 1089 function ComplementaryAreaSlot({ 1090 scope, 1091 ...props 1092 }) { 1093 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components4.Slot, { name: `ComplementaryArea/$scope}`, ...props }); 1094 } 1095 var variants = { 1096 // `auto` leaves the width to the area's own stylesheet, so it stays in one 1097 // place. framer-motion measures the element to animate, then restores 1098 // `auto`. 1099 open: { width: "auto" }, 1100 // Resolved with the `custom` value passed to `AnimatePresence`, which is 1101 // the only way an already removed element can be given a fresh transition. 1102 closed: (transition) => ({ 1103 width: 0, 1104 transition 1105 }) 1106 }; 1107 function renderContainer(render, props) { 1108 if ((0, import_element3.isValidElement)(render)) { 1109 return (0, import_element3.cloneElement)(render, { 1110 ...props, 1111 className: clsx_default(render.props.className, props.className), 1112 style: { ...render.props.style, ...props.style } 1113 }); 1114 } 1115 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("div", { ...props }); 1116 } 1117 function ComplementaryAreaFill({ 1118 activeArea, 1119 isActive, 1120 scope, 1121 children, 1122 className, 1123 id, 1124 render 1125 }) { 1126 const disableMotion = (0, import_compose2.useReducedMotion)(); 1127 const isMobileViewport = (0, import_compose2.useViewportMatch)("medium", "<"); 1128 const previousActiveArea = (0, import_compose2.usePrevious)(activeArea); 1129 const isSwitchingAreas = !!previousActiveArea && !!activeArea && activeArea !== previousActiveArea; 1130 const transition = { 1131 type: "tween", 1132 duration: disableMotion || isMobileViewport || isSwitchingAreas ? 0 : ANIMATION_DURATION, 1133 ease: [0.6, 0, 0.4, 1] 1134 }; 1135 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components4.Fill, { name: `ComplementaryArea/$scope}`, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components4.__unstableAnimatePresence, { initial: false, custom: transition, children: isActive && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 1136 import_components4.__unstableMotion.div, 1137 { 1138 variants, 1139 initial: "closed", 1140 animate: "open", 1141 exit: "closed", 1142 transition, 1143 className: "interface-complementary-area__fill", 1144 children: renderContainer(render, { 1145 id, 1146 className, 1147 children 1148 }) 1149 } 1150 ) }) }); 1151 } 1152 function useAdjustComplementaryListener(scope, identifier, activeArea, isActive, isSmall) { 1153 const previousIsSmallRef = (0, import_element3.useRef)(false); 1154 const shouldOpenWhenNotSmallRef = (0, import_element3.useRef)(false); 1155 const { enableComplementaryArea: enableComplementaryArea2, disableComplementaryArea: disableComplementaryArea2 } = (0, import_data6.useDispatch)(store); 1156 (0, import_element3.useEffect)(() => { 1157 if (isActive && isSmall && !previousIsSmallRef.current) { 1158 disableComplementaryArea2(scope); 1159 shouldOpenWhenNotSmallRef.current = true; 1160 } else if ( 1161 // If there is a flag indicating the complementary area should be 1162 // enabled when we go from small to big window size and we are going 1163 // from a small to big window size. 1164 shouldOpenWhenNotSmallRef.current && !isSmall && previousIsSmallRef.current 1165 ) { 1166 shouldOpenWhenNotSmallRef.current = false; 1167 enableComplementaryArea2(scope, identifier); 1168 } else if ( 1169 // If the flag is indicating the current complementary should be 1170 // reopened but another complementary area becomes active, remove 1171 // the flag. 1172 shouldOpenWhenNotSmallRef.current && activeArea && activeArea !== identifier 1173 ) { 1174 shouldOpenWhenNotSmallRef.current = false; 1175 } 1176 if (isSmall !== previousIsSmallRef.current) { 1177 previousIsSmallRef.current = isSmall; 1178 } 1179 }, [ 1180 isActive, 1181 isSmall, 1182 scope, 1183 identifier, 1184 activeArea, 1185 disableComplementaryArea2, 1186 enableComplementaryArea2 1187 ]); 1188 } 1189 function ComplementaryArea({ 1190 children, 1191 className, 1192 closeLabel = (0, import_i18n.__)("Close plugin"), 1193 identifier: identifierProp, 1194 header, 1195 headerClassName, 1196 icon: iconProp, 1197 isPinnable = true, 1198 panelClassName, 1199 render, 1200 scope, 1201 name: name2, 1202 title, 1203 toggleShortcut, 1204 isActiveByDefault 1205 }) { 1206 const context = (0, import_plugins2.usePluginContext)(); 1207 const icon = iconProp || context.icon; 1208 const identifier = identifierProp || `$context.name}/$name2}`; 1209 const [isReady, setIsReady] = (0, import_element3.useState)(false); 1210 const { 1211 isLoading, 1212 isActive, 1213 isPinned, 1214 activeArea, 1215 isSmall, 1216 isLarge, 1217 showIconLabels 1218 } = (0, import_data6.useSelect)( 1219 (select) => { 1220 const { 1221 getActiveComplementaryArea: getActiveComplementaryArea2, 1222 isComplementaryAreaLoading: isComplementaryAreaLoading2, 1223 isItemPinned: isItemPinned2 1224 } = select(store); 1225 const { get } = select(import_preferences3.store); 1226 const _activeArea = getActiveComplementaryArea2(scope); 1227 return { 1228 isLoading: isComplementaryAreaLoading2(scope), 1229 isActive: _activeArea === identifier, 1230 isPinned: isItemPinned2(scope, identifier), 1231 activeArea: _activeArea, 1232 isSmall: select(import_viewport.store).isViewportMatch("< medium"), 1233 isLarge: select(import_viewport.store).isViewportMatch("large"), 1234 showIconLabels: get("core", "showIconLabels") 1235 }; 1236 }, 1237 [identifier, scope] 1238 ); 1239 const hasMenuItem = useHasComplementaryAreaMenuItem(scope, name2); 1240 const isMobileViewport = (0, import_compose2.useViewportMatch)("medium", "<"); 1241 useAdjustComplementaryListener( 1242 scope, 1243 identifier, 1244 activeArea, 1245 isActive, 1246 isSmall 1247 ); 1248 const { 1249 enableComplementaryArea: enableComplementaryArea2, 1250 disableComplementaryArea: disableComplementaryArea2, 1251 pinItem: pinItem2, 1252 unpinItem: unpinItem2 1253 } = (0, import_data6.useDispatch)(store); 1254 (0, import_element3.useEffect)(() => { 1255 if (isActiveByDefault && activeArea === void 0 && !isSmall) { 1256 enableComplementaryArea2(scope, identifier); 1257 } else if (activeArea === void 0 && isSmall) { 1258 disableComplementaryArea2(scope); 1259 } 1260 setIsReady(true); 1261 }, [ 1262 activeArea, 1263 isActiveByDefault, 1264 scope, 1265 identifier, 1266 isSmall, 1267 enableComplementaryArea2, 1268 disableComplementaryArea2 1269 ]); 1270 if (!isReady) { 1271 return; 1272 } 1273 return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [ 1274 isPinnable && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(pinned_items_default, { scope, children: isPinned && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 1275 ComplementaryAreaToggle, 1276 { 1277 scope, 1278 identifier, 1279 isPressed: isActive && (!showIconLabels || isLarge), 1280 "aria-expanded": isActive, 1281 "aria-disabled": isLoading, 1282 label: title, 1283 icon: showIconLabels ? check_default : icon, 1284 showTooltip: !showIconLabels, 1285 variant: showIconLabels ? "tertiary" : void 0, 1286 size: "compact", 1287 shortcut: toggleShortcut 1288 } 1289 ) }), 1290 name2 && isPinnable && !hasMenuItem && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 1291 DefaultComplementaryAreaMoreMenuItem, 1292 { 1293 target: name2, 1294 scope, 1295 icon, 1296 identifier, 1297 children: title 1298 } 1299 ), 1300 /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)( 1301 ComplementaryAreaFill, 1302 { 1303 activeArea, 1304 isActive, 1305 className: clsx_default("interface-complementary-area", className), 1306 scope, 1307 id: identifier.replace("/", ":"), 1308 render, 1309 children: [ 1310 /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 1311 complementary_area_header_default, 1312 { 1313 className: headerClassName, 1314 toggleButtonProps: { 1315 label: closeLabel, 1316 size: "compact", 1317 shortcut: toggleShortcut, 1318 scope, 1319 identifier 1320 }, 1321 children: header || /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(import_jsx_runtime24.Fragment, { children: [ 1322 /* @__PURE__ */ (0, import_jsx_runtime24.jsx)("h2", { className: "interface-complementary-area-header__title", children: title }), 1323 isPinnable && !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 1324 import_components4.Button, 1325 { 1326 className: "interface-complementary-area__pin-unpin-item", 1327 icon: isPinned ? star_filled_default : star_empty_default, 1328 label: isPinned ? (0, import_i18n.__)("Unpin from toolbar") : (0, import_i18n.__)("Pin to toolbar"), 1329 onClick: () => (isPinned ? unpinItem2 : pinItem2)( 1330 scope, 1331 identifier 1332 ), 1333 isPressed: isPinned, 1334 size: "compact" 1335 } 1336 ) 1337 ] }) 1338 } 1339 ), 1340 /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(import_components4.Panel, { className: panelClassName, children }) 1341 ] 1342 } 1343 ) 1344 ] }); 1345 } 1346 ComplementaryArea.Slot = ComplementaryAreaSlot; 1347 var complementary_area_default = ComplementaryArea; 1348 1349 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useRenderElement.mjs 1350 var React4 = __toESM(require_react(), 1); 1351 1352 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useRefWithInit.mjs 1353 var React = __toESM(require_react(), 1); 1354 var UNINITIALIZED = {}; 1355 function useRefWithInit(init, initArg) { 1356 const ref = React.useRef(UNINITIALIZED); 1357 if (ref.current === UNINITIALIZED) { 1358 ref.current = init(initArg); 1359 } 1360 return ref; 1361 } 1362 1363 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useMergedRefs.mjs 1364 function useMergedRefs(a, b, c, d) { 1365 const forkRef = useRefWithInit(createForkRef).current; 1366 if (didChange(forkRef, a, b, c, d)) { 1367 update(forkRef, [a, b, c, d]); 1368 } 1369 return forkRef.callback; 1370 } 1371 function useMergedRefsN(refs) { 1372 const forkRef = useRefWithInit(createForkRef).current; 1373 if (didChangeN(forkRef, refs)) { 1374 update(forkRef, refs); 1375 } 1376 return forkRef.callback; 1377 } 1378 function createForkRef() { 1379 return { 1380 callback: null, 1381 cleanup: null, 1382 refs: [] 1383 }; 1384 } 1385 function didChange(forkRef, a, b, c, d) { 1386 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; 1387 } 1388 function didChangeN(forkRef, newRefs) { 1389 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]); 1390 } 1391 function update(forkRef, refs) { 1392 forkRef.refs = refs; 1393 if (refs.every((ref) => ref == null)) { 1394 forkRef.callback = null; 1395 return; 1396 } 1397 forkRef.callback = (instance) => { 1398 if (forkRef.cleanup) { 1399 forkRef.cleanup(); 1400 forkRef.cleanup = null; 1401 } 1402 if (instance != null) { 1403 const cleanupCallbacks = Array(refs.length).fill(null); 1404 for (let i = 0; i < refs.length; i += 1) { 1405 const ref = refs[i]; 1406 if (ref == null) { 1407 continue; 1408 } 1409 switch (typeof ref) { 1410 case "function": { 1411 const refCleanup = ref(instance); 1412 if (typeof refCleanup === "function") { 1413 cleanupCallbacks[i] = refCleanup; 1414 } 1415 break; 1416 } 1417 case "object": { 1418 ref.current = instance; 1419 break; 1420 } 1421 default: 1422 } 1423 } 1424 forkRef.cleanup = () => { 1425 for (let i = 0; i < refs.length; i += 1) { 1426 const ref = refs[i]; 1427 if (ref == null) { 1428 continue; 1429 } 1430 switch (typeof ref) { 1431 case "function": { 1432 const cleanupCallback = cleanupCallbacks[i]; 1433 if (typeof cleanupCallback === "function") { 1434 cleanupCallback(); 1435 } else { 1436 void ref(null); 1437 } 1438 break; 1439 } 1440 case "object": { 1441 ref.current = null; 1442 break; 1443 } 1444 default: 1445 } 1446 } 1447 }; 1448 } 1449 }; 1450 } 1451 1452 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/getReactElementRef.mjs 1453 var React3 = __toESM(require_react(), 1); 1454 1455 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/reactVersion.mjs 1456 var React2 = __toESM(require_react(), 1); 1457 var majorVersion = parseInt(React2.version, 10); 1458 function isReactVersionAtLeast(reactVersionToCheck) { 1459 return majorVersion >= reactVersionToCheck; 1460 } 1461 1462 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/getReactElementRef.mjs 1463 function getReactElementRef(element) { 1464 if (!/* @__PURE__ */ React3.isValidElement(element)) { 1465 return null; 1466 } 1467 const reactElement = element; 1468 const propsWithRef = reactElement.props; 1469 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; 1470 } 1471 1472 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/mergeObjects.mjs 1473 function mergeObjects(a, b) { 1474 if (a && !b) { 1475 return a; 1476 } 1477 if (!a && b) { 1478 return b; 1479 } 1480 if (a || b) { 1481 return { 1482 ...a, 1483 ...b 1484 }; 1485 } 1486 return void 0; 1487 } 1488 1489 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/createLogOnce.mjs 1490 var loggedMessages; 1491 if (true) { 1492 loggedMessages = /* @__PURE__ */ new Set(); 1493 } 1494 function createLogOnce(severity, prefix) { 1495 return function logOnce(...messages) { 1496 if (true) { 1497 const message = messages.join(" "); 1498 const output = prefix ? `$prefix}: $message}` : message; 1499 const key = `$severity}:$output}`; 1500 if (!loggedMessages.has(key)) { 1501 loggedMessages.add(key); 1502 if (severity === "warn") { 1503 console.warn(output); 1504 } else { 1505 console.error(output); 1506 } 1507 } 1508 } 1509 }; 1510 } 1511 1512 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/warn.mjs 1513 var warn = createLogOnce("warn", "Base UI"); 1514 1515 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/empty.mjs 1516 function NOOP() { 1517 } 1518 var EMPTY_ARRAY = Object.freeze([]); 1519 var EMPTY_OBJECT = Object.freeze({}); 1520 1521 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs 1522 function getStateAttributesProps(state, customMapping) { 1523 const props = {}; 1524 for (const key in state) { 1525 const value = state[key]; 1526 if (customMapping?.hasOwnProperty(key)) { 1527 const customProps = customMapping[key](value); 1528 if (customProps != null) { 1529 Object.assign(props, customProps); 1530 } 1531 continue; 1532 } 1533 if (value === true) { 1534 props[`data-$key.toLowerCase()}`] = ""; 1535 } else if (value) { 1536 props[`data-$key.toLowerCase()}`] = value.toString(); 1537 } 1538 } 1539 return props; 1540 } 1541 1542 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveClassName.mjs 1543 function resolveClassName(className, state) { 1544 return typeof className === "function" ? className(state) : className; 1545 } 1546 1547 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveStyle.mjs 1548 function resolveStyle(style, state) { 1549 return typeof style === "function" ? style(state) : style; 1550 } 1551 1552 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/merge-props/mergeProps.mjs 1553 var EMPTY_PROPS = {}; 1554 function mergeProps(a, b, c, d, e) { 1555 if (!c && !d && !e && !a) { 1556 return createInitialMergedProps(b); 1557 } 1558 let merged = createInitialMergedProps(a); 1559 if (b) { 1560 merged = mergeInto(merged, b); 1561 } 1562 if (c) { 1563 merged = mergeInto(merged, c); 1564 } 1565 if (d) { 1566 merged = mergeInto(merged, d); 1567 } 1568 if (e) { 1569 merged = mergeInto(merged, e); 1570 } 1571 return merged; 1572 } 1573 function mergePropsN(props) { 1574 if (props.length === 0) { 1575 return EMPTY_PROPS; 1576 } 1577 if (props.length === 1) { 1578 return createInitialMergedProps(props[0]); 1579 } 1580 let merged = createInitialMergedProps(props[0]); 1581 for (let i = 1; i < props.length; i += 1) { 1582 merged = mergeInto(merged, props[i]); 1583 } 1584 return merged; 1585 } 1586 function createInitialMergedProps(inputProps) { 1587 if (isPropsGetter(inputProps)) { 1588 return { 1589 ...inputProps(EMPTY_PROPS) 1590 }; 1591 } 1592 return copyInitialProps(inputProps); 1593 } 1594 function mergeInto(merged, inputProps) { 1595 if (isPropsGetter(inputProps)) { 1596 return inputProps(merged); 1597 } 1598 return mutablyMergeInto(merged, inputProps); 1599 } 1600 function copyInitialProps(inputProps) { 1601 const copiedProps = { 1602 ...inputProps 1603 }; 1604 for (const propName in copiedProps) { 1605 const propValue = copiedProps[propName]; 1606 if (isEventHandler(propName, propValue)) { 1607 copiedProps[propName] = wrapEventHandler(propValue); 1608 } 1609 } 1610 return copiedProps; 1611 } 1612 function mutablyMergeInto(mergedProps, externalProps) { 1613 if (!externalProps) { 1614 return mergedProps; 1615 } 1616 for (const propName in externalProps) { 1617 const externalPropValue = externalProps[propName]; 1618 switch (propName) { 1619 case "style": { 1620 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); 1621 break; 1622 } 1623 case "className": { 1624 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); 1625 break; 1626 } 1627 default: { 1628 if (isEventHandler(propName, externalPropValue)) { 1629 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); 1630 } else { 1631 mergedProps[propName] = externalPropValue; 1632 } 1633 } 1634 } 1635 } 1636 return mergedProps; 1637 } 1638 function isEventHandler(key, value) { 1639 const code0 = key.charCodeAt(0); 1640 const code1 = key.charCodeAt(1); 1641 const code2 = key.charCodeAt(2); 1642 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); 1643 } 1644 function isPropsGetter(inputProps) { 1645 return typeof inputProps === "function"; 1646 } 1647 function mergeEventHandlers(ourHandler, theirHandler) { 1648 if (!theirHandler) { 1649 return ourHandler; 1650 } 1651 if (!ourHandler) { 1652 return wrapEventHandler(theirHandler); 1653 } 1654 return (...args) => { 1655 const event = args[0]; 1656 if (isSyntheticEvent(event)) { 1657 const baseUIEvent = event; 1658 makeEventPreventable(baseUIEvent); 1659 const result2 = theirHandler(...args); 1660 if (!baseUIEvent.baseUIHandlerPrevented) { 1661 ourHandler?.(...args); 1662 } 1663 return result2; 1664 } 1665 const result = theirHandler(...args); 1666 ourHandler?.(...args); 1667 return result; 1668 }; 1669 } 1670 function wrapEventHandler(handler) { 1671 if (!handler) { 1672 return handler; 1673 } 1674 return (...args) => { 1675 const event = args[0]; 1676 if (isSyntheticEvent(event)) { 1677 makeEventPreventable(event); 1678 } 1679 return handler(...args); 1680 }; 1681 } 1682 function makeEventPreventable(event) { 1683 event.preventBaseUIHandler = () => { 1684 event.baseUIHandlerPrevented = true; 1685 }; 1686 return event; 1687 } 1688 function mergeClassNames(ourClassName, theirClassName) { 1689 if (theirClassName) { 1690 if (ourClassName) { 1691 return theirClassName + " " + ourClassName; 1692 } 1693 return theirClassName; 1694 } 1695 return ourClassName; 1696 } 1697 function isSyntheticEvent(event) { 1698 return event != null && typeof event === "object" && "nativeEvent" in event; 1699 } 1700 1701 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useRenderElement.mjs 1702 var import_react = __toESM(require_react(), 1); 1703 function useRenderElement(element, componentProps, params = {}) { 1704 let renderProp = componentProps.render; 1705 if (params.enabled !== false) { 1706 renderProp = unwrapLazyRenderProp(renderProp); 1707 } 1708 const outProps = useRenderElementProps(componentProps, params, renderProp); 1709 if (params.enabled === false) { 1710 return null; 1711 } 1712 const state = params.state ?? EMPTY_OBJECT; 1713 return evaluateRenderProp(element, renderProp, outProps, state); 1714 } 1715 function useRenderElementProps(componentProps, params, renderProp) { 1716 const { 1717 className: classNameProp, 1718 style: styleProp 1719 } = componentProps; 1720 const { 1721 state = EMPTY_OBJECT, 1722 ref, 1723 props, 1724 stateAttributesMapping: stateAttributesMapping2, 1725 enabled = true 1726 } = params; 1727 const className = enabled ? resolveClassName(classNameProp, state) : void 0; 1728 const style = enabled ? resolveStyle(styleProp, state) : void 0; 1729 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping2) : EMPTY_OBJECT; 1730 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; 1731 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; 1732 if (typeof document !== "undefined") { 1733 if (!enabled) { 1734 void useMergedRefs(null, null); 1735 } else if (Array.isArray(ref)) { 1736 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); 1737 } else { 1738 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); 1739 } 1740 } 1741 if (!enabled) { 1742 return EMPTY_OBJECT; 1743 } 1744 if (className !== void 0) { 1745 outProps.className = mergeClassNames(outProps.className, className); 1746 } 1747 if (style !== void 0) { 1748 outProps.style = mergeObjects(outProps.style, style); 1749 } 1750 return outProps; 1751 } 1752 function resolveRenderFunctionProps(props) { 1753 if (Array.isArray(props)) { 1754 return mergePropsN(props); 1755 } 1756 return mergeProps(void 0, props); 1757 } 1758 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 1759 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; 1760 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; 1761 function unwrapLazyRenderProp(render) { 1762 if (render?.$$typeof !== REACT_LAZY_TYPE) { 1763 return render; 1764 } 1765 const unwrapped = React4.Children.toArray(render)[0]; 1766 return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render; 1767 } 1768 function evaluateRenderProp(element, render, props, state) { 1769 if (render) { 1770 if (typeof render === "function") { 1771 if (true) { 1772 warnIfRenderPropLooksLikeComponent(render); 1773 } 1774 return render(props, state); 1775 } 1776 const mergedProps = mergeProps(props, render.props); 1777 mergedProps.ref = props.ref; 1778 if (true) { 1779 if (!/* @__PURE__ */ React4.isValidElement(render)) { 1780 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")); 1781 } 1782 } 1783 return /* @__PURE__ */ React4.cloneElement(render, mergedProps); 1784 } 1785 return renderTag(element, props); 1786 } 1787 function warnIfRenderPropLooksLikeComponent(renderFn) { 1788 const functionName = renderFn.name; 1789 if (functionName.length === 0) { 1790 return; 1791 } 1792 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { 1793 return; 1794 } 1795 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { 1796 return; 1797 } 1798 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"); 1799 } 1800 function renderTag(Tag, props) { 1801 if (Tag === "button") { 1802 return /* @__PURE__ */ (0, import_react.createElement)("button", { 1803 type: "button", 1804 ...props, 1805 key: props.key 1806 }); 1807 } 1808 if (Tag === "img") { 1809 return /* @__PURE__ */ (0, import_react.createElement)("img", { 1810 alt: "", 1811 ...props, 1812 key: props.key 1813 }); 1814 } 1815 return /* @__PURE__ */ React4.createElement(Tag, props); 1816 } 1817 1818 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/safeReact.mjs 1819 var React5 = __toESM(require_react(), 1); 1820 var SafeReact = { 1821 ...React5 1822 }; 1823 1824 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useStableCallback.mjs 1825 var useInsertionEffect = SafeReact.useInsertionEffect; 1826 var useSafeInsertionEffect = ( 1827 // React 17 doesn't have useInsertionEffect. 1828 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. 1829 useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() 1830 ); 1831 function useStableCallback(callback) { 1832 const stable = useRefWithInit(createStableCallback).current; 1833 stable.next = callback; 1834 useSafeInsertionEffect(stable.effect); 1835 return stable.trampoline; 1836 } 1837 function createStableCallback() { 1838 const stable = { 1839 next: void 0, 1840 callback: assertNotCalled, 1841 trampoline: (...args) => stable.callback?.(...args), 1842 effect: () => { 1843 stable.callback = stable.next; 1844 } 1845 }; 1846 return stable; 1847 } 1848 function assertNotCalled() { 1849 if (true) { 1850 throw ( 1851 /* minify-error-disabled */ 1852 new Error("Base UI: Cannot call an event handler while rendering.") 1853 ); 1854 } 1855 } 1856 1857 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs 1858 var React6 = __toESM(require_react(), 1); 1859 var noop = () => { 1860 }; 1861 var useIsoLayoutEffect = typeof document !== "undefined" ? React6.useLayoutEffect : noop; 1862 1863 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 1864 var React8 = __toESM(require_react(), 1); 1865 1866 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 1867 var ReactDOM = __toESM(require_react_dom(), 1); 1868 1869 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useOnMount.mjs 1870 var React7 = __toESM(require_react(), 1); 1871 function useOnMount(fn) { 1872 React7.useEffect(fn, EMPTY_ARRAY); 1873 } 1874 1875 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useAnimationFrame.mjs 1876 var EMPTY = null; 1877 var LAST_RAF = globalThis.requestAnimationFrame; 1878 var Scheduler = class { 1879 /* This implementation uses an array as a backing data-structure for frame callbacks. 1880 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it 1881 * never calls the native `cancelAnimationFrame` if there are no frames left. This can 1882 * be much more efficient if there is a call pattern that alterns as 1883 * "request-cancel-request-cancel-…". 1884 * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation 1885 * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ 1886 callbacks = []; 1887 callbacksCount = 0; 1888 nextId = 1; 1889 startId = 1; 1890 isScheduled = false; 1891 tick = (timestamp) => { 1892 this.isScheduled = false; 1893 const currentCallbacks = this.callbacks; 1894 const currentCallbacksCount = this.callbacksCount; 1895 this.callbacks = []; 1896 this.callbacksCount = 0; 1897 this.startId = this.nextId; 1898 if (currentCallbacksCount > 0) { 1899 for (let i = 0; i < currentCallbacks.length; i += 1) { 1900 currentCallbacks[i]?.(timestamp); 1901 } 1902 } 1903 }; 1904 request(fn) { 1905 const id = this.nextId; 1906 this.nextId += 1; 1907 this.callbacks.push(fn); 1908 this.callbacksCount += 1; 1909 const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); 1910 if (!this.isScheduled || didRAFChange) { 1911 requestAnimationFrame(this.tick); 1912 this.isScheduled = true; 1913 } 1914 return id; 1915 } 1916 cancel(id) { 1917 const index2 = id - this.startId; 1918 if (index2 < 0 || index2 >= this.callbacks.length) { 1919 return; 1920 } 1921 if (this.callbacks[index2] === null) { 1922 return; 1923 } 1924 this.callbacks[index2] = null; 1925 this.callbacksCount -= 1; 1926 } 1927 }; 1928 var scheduler = new Scheduler(); 1929 var AnimationFrame = class _AnimationFrame { 1930 static create() { 1931 return new _AnimationFrame(); 1932 } 1933 static request(fn) { 1934 return scheduler.request(fn); 1935 } 1936 static cancel(id) { 1937 return scheduler.cancel(id); 1938 } 1939 currentId = EMPTY; 1940 /** 1941 * Executes `fn` after `delay`, clearing any previously scheduled call. 1942 */ 1943 request(fn) { 1944 this.cancel(); 1945 this.currentId = scheduler.request(() => { 1946 this.currentId = EMPTY; 1947 fn(); 1948 }); 1949 } 1950 cancel = () => { 1951 if (this.currentId !== EMPTY) { 1952 scheduler.cancel(this.currentId); 1953 this.currentId = EMPTY; 1954 } 1955 }; 1956 disposeEffect = () => { 1957 return this.cancel; 1958 }; 1959 }; 1960 function useAnimationFrame() { 1961 const timeout = useRefWithInit(AnimationFrame.create).current; 1962 useOnMount(timeout.disposeEffect); 1963 return timeout; 1964 } 1965 1966 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveRef.mjs 1967 function resolveRef(maybeRef) { 1968 if (maybeRef == null) { 1969 return maybeRef; 1970 } 1971 return "current" in maybeRef ? maybeRef.current : maybeRef; 1972 } 1973 1974 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/getFiniteAnimations.mjs 1975 function getFiniteAnimations(element, options) { 1976 return element.getAnimations(options).filter((animation) => { 1977 const timing = animation.effect?.getTiming(); 1978 return timing?.duration !== Infinity && timing?.iterations !== Infinity; 1979 }); 1980 } 1981 1982 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs 1983 var TransitionStatusDataAttributes_exports = {}; 1984 __export(TransitionStatusDataAttributes_exports, { 1985 endingStyle: () => endingStyle, 1986 startingStyle: () => startingStyle 1987 }); 1988 var startingStyle = "data-starting-style"; 1989 var endingStyle = "data-ending-style"; 1990 1991 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 1992 var pendingCallbacks = null; 1993 function flushBeforePaint(fn) { 1994 if (!pendingCallbacks) { 1995 const callbacks = []; 1996 pendingCallbacks = callbacks; 1997 queueMicrotask(() => { 1998 pendingCallbacks = null; 1999 ReactDOM.flushSync(() => { 2000 for (const callback of callbacks) { 2001 callback(); 2002 } 2003 }); 2004 }); 2005 } 2006 pendingCallbacks.push(fn); 2007 } 2008 function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) { 2009 const frame = useAnimationFrame(); 2010 return useStableCallback((fnToExecute, signal = null) => { 2011 frame.cancel(); 2012 const element = resolveRef(elementOrRef); 2013 if (element == null) { 2014 return; 2015 } 2016 const resolvedElement = element; 2017 const done = () => { 2018 if (!batch) { 2019 ReactDOM.flushSync(fnToExecute); 2020 return; 2021 } 2022 flushBeforePaint(() => { 2023 if (!signal?.aborted) { 2024 fnToExecute(); 2025 } 2026 }); 2027 }; 2028 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { 2029 fnToExecute(); 2030 return; 2031 } 2032 function exec() { 2033 Promise.all(getFiniteAnimations(resolvedElement).map((animation) => animation.finished.then(NOOP))).then(() => { 2034 if (!signal?.aborted) { 2035 done(); 2036 } 2037 }, () => { 2038 if (signal?.aborted) { 2039 return; 2040 } 2041 const currentAnimations = getFiniteAnimations(resolvedElement); 2042 if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { 2043 exec(); 2044 return; 2045 } 2046 done(); 2047 }); 2048 } 2049 if (waitForStartingStyleRemoved) { 2050 const startingStyleAttribute = startingStyle; 2051 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 2052 frame.request(exec); 2053 return; 2054 } 2055 const attributeObserver = new MutationObserver(() => { 2056 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 2057 attributeObserver.disconnect(); 2058 exec(); 2059 } 2060 }); 2061 attributeObserver.observe(resolvedElement, { 2062 attributes: true, 2063 attributeFilter: [startingStyleAttribute] 2064 }); 2065 signal?.addEventListener("abort", () => attributeObserver.disconnect(), { 2066 once: true 2067 }); 2068 return; 2069 } 2070 frame.request(exec); 2071 }); 2072 } 2073 2074 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 2075 function useOpenChangeComplete(parameters) { 2076 const { 2077 enabled = true, 2078 open: open3, 2079 ref, 2080 batch = false, 2081 onComplete: onCompleteParam 2082 } = parameters; 2083 const onComplete = useStableCallback(onCompleteParam); 2084 const runOnceAnimationsFinish = useAnimationsFinished(ref, open3, batch); 2085 React8.useEffect(() => { 2086 if (!enabled) { 2087 return void 0; 2088 } 2089 const abortController = new AbortController(); 2090 runOnceAnimationsFinish(onComplete, abortController.signal); 2091 return () => { 2092 abortController.abort(); 2093 }; 2094 }, [enabled, open3, onComplete, runOnceAnimationsFinish]); 2095 } 2096 2097 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs 2098 var STARTING_HOOK = { 2099 [startingStyle]: "" 2100 }; 2101 var ENDING_HOOK = { 2102 [endingStyle]: "" 2103 }; 2104 var transitionStatusMapping = { 2105 transitionStatus(value) { 2106 if (value === "starting") { 2107 return STARTING_HOOK; 2108 } 2109 if (value === "ending") { 2110 return ENDING_HOOK; 2111 } 2112 return null; 2113 } 2114 }; 2115 2116 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useTransitionStatus.mjs 2117 var React9 = __toESM(require_react(), 1); 2118 function useTransitionStatus(open3, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) { 2119 const [transitionStatus, setTransitionStatus] = React9.useState(open3 && enableIdleState ? "idle" : void 0); 2120 const [mounted, setMounted] = React9.useState(open3 && !animateInitialOpen); 2121 if (open3 && !mounted) { 2122 setMounted(true); 2123 setTransitionStatus("starting"); 2124 } 2125 if (!open3 && mounted && transitionStatus !== "ending" && !deferEndingState) { 2126 setTransitionStatus("ending"); 2127 } 2128 if (!open3 && !mounted && transitionStatus === "ending") { 2129 setTransitionStatus(void 0); 2130 } 2131 useIsoLayoutEffect(() => { 2132 if (!open3 && mounted && transitionStatus !== "ending" && deferEndingState) { 2133 const frame = AnimationFrame.request(() => { 2134 setTransitionStatus("ending"); 2135 }); 2136 return () => { 2137 AnimationFrame.cancel(frame); 2138 }; 2139 } 2140 return void 0; 2141 }, [open3, mounted, transitionStatus, deferEndingState]); 2142 useIsoLayoutEffect(() => { 2143 if (!open3 || enableIdleState || transitionStatus === void 0) { 2144 return void 0; 2145 } 2146 const frame = AnimationFrame.request(() => { 2147 setTransitionStatus(void 0); 2148 }); 2149 return () => { 2150 AnimationFrame.cancel(frame); 2151 }; 2152 }, [enableIdleState, open3, transitionStatus]); 2153 useIsoLayoutEffect(() => { 2154 if (!open3 || !enableIdleState) { 2155 return void 0; 2156 } 2157 if (open3 && mounted && transitionStatus !== "idle") { 2158 setTransitionStatus("starting"); 2159 } 2160 const frame = AnimationFrame.request(() => { 2161 setTransitionStatus("idle"); 2162 }); 2163 return () => { 2164 AnimationFrame.cancel(frame); 2165 }; 2166 }, [enableIdleState, open3, mounted, transitionStatus]); 2167 return { 2168 mounted, 2169 setMounted, 2170 transitionStatus 2171 }; 2172 } 2173 2174 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useTimeout.mjs 2175 var EMPTY2 = 0; 2176 var Timeout = class _Timeout { 2177 static create() { 2178 return new _Timeout(); 2179 } 2180 currentId = EMPTY2; 2181 /** 2182 * Executes `fn` after `delay`, clearing any previously scheduled call. 2183 */ 2184 start(delay, fn) { 2185 this.clear(); 2186 this.currentId = setTimeout(() => { 2187 this.currentId = EMPTY2; 2188 fn(); 2189 }, delay); 2190 } 2191 isStarted() { 2192 return this.currentId !== EMPTY2; 2193 } 2194 clear = () => { 2195 if (this.currentId !== EMPTY2) { 2196 clearTimeout(this.currentId); 2197 this.currentId = EMPTY2; 2198 } 2199 }; 2200 disposeEffect = () => { 2201 return this.clear; 2202 }; 2203 }; 2204 function useTimeout() { 2205 const timeout = useRefWithInit(Timeout.create).current; 2206 useOnMount(timeout.disposeEffect); 2207 return timeout; 2208 } 2209 2210 // packages/ui/build-module/icon/icon.mjs 2211 var import_element4 = __toESM(require_element(), 1); 2212 var import_primitives19 = __toESM(require_primitives(), 1); 2213 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); 2214 var Icon = (0, import_element4.forwardRef)( 2215 function UnforwardedIcon({ icon, size: size4 = 24, style, ...restProps }, ref) { 2216 const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0; 2217 return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( 2218 import_primitives19.SVG, 2219 { 2220 ref, 2221 ...icon.props, 2222 ...restProps, 2223 ...mergedStyle ? { style: mergedStyle } : {}, 2224 width: size4, 2225 height: size4 2226 } 2227 ); 2228 } 2229 ); 2230 2231 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useControlled.mjs 2232 var React10 = __toESM(require_react(), 1); 2233 2234 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/error.mjs 2235 var error = createLogOnce("error", "Base UI"); 2236 2237 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useControlled.mjs 2238 function useControlled({ 2239 controlled, 2240 default: defaultProp, 2241 name: name2, 2242 state = "value" 2243 }) { 2244 const { 2245 current: isControlled 2246 } = React10.useRef(controlled !== void 0); 2247 const [valueState, setValue] = React10.useState(() => defaultProp); 2248 const value = isControlled && controlled !== void 0 ? controlled : valueState; 2249 if (true) { 2250 React10.useEffect(() => { 2251 if (isControlled !== (controlled !== void 0)) { 2252 error([`A component is changing the $isControlled ? "" : "un"}controlled $state} state of $name2} to be $isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled $name2} 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")); 2253 } 2254 }, [state, name2, controlled]); 2255 const { 2256 current: defaultValue 2257 } = React10.useRef(defaultProp); 2258 React10.useEffect(() => { 2259 if (!isControlled && serializeToDevModeString(defaultValue) !== serializeToDevModeString(defaultProp)) { 2260 error([`A component is changing the default $state} state of an uncontrolled $name2} after being initialized. To suppress this warning opt to use a controlled $name2}.`].join("\n")); 2261 } 2262 }, [defaultProp]); 2263 } 2264 const setValueIfUncontrolled = React10.useCallback((newValue) => { 2265 if (!isControlled) { 2266 setValue(newValue); 2267 } 2268 }, []); 2269 return [value, setValueIfUncontrolled]; 2270 } 2271 function serializeToDevModeString(input) { 2272 let nextId = 0; 2273 const seen = /* @__PURE__ */ new WeakMap(); 2274 try { 2275 const result = JSON.stringify(input, function replacer(key, value) { 2276 if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) { 2277 return void 0; 2278 } 2279 if (typeof value === "bigint") { 2280 return `__bigint__:$value}`; 2281 } 2282 if (value !== null && typeof value === "object") { 2283 const id = seen.get(value); 2284 if (id !== void 0) { 2285 return `__object__:$id}`; 2286 } 2287 seen.set(value, nextId); 2288 nextId += 1; 2289 } 2290 return value; 2291 }); 2292 return result ?? `__top__:$typeof input}`; 2293 } catch { 2294 return "__unserializable__"; 2295 } 2296 } 2297 2298 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useId.mjs 2299 var React12 = __toESM(require_react(), 1); 2300 2301 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useForcedRerendering.mjs 2302 var React11 = __toESM(require_react(), 1); 2303 function useForcedRerendering() { 2304 const [, setState] = React11.useState({}); 2305 return React11.useCallback(() => { 2306 setState({}); 2307 }, []); 2308 } 2309 2310 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useId.mjs 2311 var globalId = 0; 2312 function useGlobalId(idOverride, prefix = "mui") { 2313 const defaultId = React12.useRef(void 0); 2314 const forceRerender = useForcedRerendering(); 2315 const id = idOverride ?? defaultId.current; 2316 React12.useEffect(() => { 2317 if (defaultId.current == null) { 2318 globalId += 1; 2319 defaultId.current = `$prefix}-$globalId}`; 2320 if (idOverride == null) { 2321 forceRerender(); 2322 } 2323 } 2324 }, [idOverride, prefix, forceRerender]); 2325 return id; 2326 } 2327 var maybeReactUseId = SafeReact.useId; 2328 function useId(idOverride, prefix) { 2329 if (maybeReactUseId !== void 0) { 2330 const reactId = maybeReactUseId(); 2331 return idOverride ?? (prefix ? `$prefix}-$reactId}` : reactId); 2332 } 2333 return useGlobalId(idOverride, prefix); 2334 } 2335 2336 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useBaseUiId.mjs 2337 function useBaseUiId(idOverride) { 2338 return useId(idOverride, "base-ui"); 2339 } 2340 2341 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs 2342 var React13 = __toESM(require_react(), 1); 2343 2344 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs 2345 function createChangeEventDetails(reason, event, trigger, customProperties) { 2346 let canceled = false; 2347 let allowPropagation = false; 2348 const custom = customProperties ?? EMPTY_OBJECT; 2349 const details = { 2350 reason, 2351 event: event ?? new Event("base-ui"), 2352 cancel() { 2353 canceled = true; 2354 }, 2355 allowPropagation() { 2356 allowPropagation = true; 2357 }, 2358 get isCanceled() { 2359 return canceled; 2360 }, 2361 get isPropagationAllowed() { 2362 return allowPropagation; 2363 }, 2364 trigger, 2365 ...custom 2366 }; 2367 return details; 2368 } 2369 2370 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/reason-parts.mjs 2371 var reason_parts_exports = {}; 2372 __export(reason_parts_exports, { 2373 cancelOpen: () => cancelOpen, 2374 chipRemovePress: () => chipRemovePress, 2375 clearPress: () => clearPress, 2376 closePress: () => closePress, 2377 closeWatcher: () => closeWatcher, 2378 decrementPress: () => decrementPress, 2379 disabled: () => disabled, 2380 drag: () => drag, 2381 escapeKey: () => escapeKey, 2382 focusOut: () => focusOut, 2383 imperativeAction: () => imperativeAction, 2384 incrementPress: () => incrementPress, 2385 initial: () => initial, 2386 inputBlur: () => inputBlur, 2387 inputChange: () => inputChange, 2388 inputClear: () => inputClear, 2389 inputPaste: () => inputPaste, 2390 inputPress: () => inputPress, 2391 itemPress: () => itemPress, 2392 keyboard: () => keyboard, 2393 linkPress: () => linkPress, 2394 listNavigation: () => listNavigation, 2395 missing: () => missing, 2396 none: () => none, 2397 outsidePress: () => outsidePress, 2398 pointer: () => pointer, 2399 popupClose: () => popupClose, 2400 scrub: () => scrub, 2401 siblingOpen: () => siblingOpen, 2402 swipe: () => swipe, 2403 trackPress: () => trackPress, 2404 triggerFocus: () => triggerFocus, 2405 triggerHover: () => triggerHover, 2406 triggerPress: () => triggerPress, 2407 wheel: () => wheel, 2408 windowResize: () => windowResize 2409 }); 2410 var none = "none"; 2411 var triggerPress = "trigger-press"; 2412 var triggerHover = "trigger-hover"; 2413 var triggerFocus = "trigger-focus"; 2414 var outsidePress = "outside-press"; 2415 var itemPress = "item-press"; 2416 var closePress = "close-press"; 2417 var linkPress = "link-press"; 2418 var clearPress = "clear-press"; 2419 var chipRemovePress = "chip-remove-press"; 2420 var trackPress = "track-press"; 2421 var incrementPress = "increment-press"; 2422 var decrementPress = "decrement-press"; 2423 var inputChange = "input-change"; 2424 var inputClear = "input-clear"; 2425 var inputBlur = "input-blur"; 2426 var inputPaste = "input-paste"; 2427 var inputPress = "input-press"; 2428 var focusOut = "focus-out"; 2429 var escapeKey = "escape-key"; 2430 var closeWatcher = "close-watcher"; 2431 var listNavigation = "list-navigation"; 2432 var keyboard = "keyboard"; 2433 var pointer = "pointer"; 2434 var drag = "drag"; 2435 var wheel = "wheel"; 2436 var scrub = "scrub"; 2437 var popupClose = "popup-close"; 2438 var cancelOpen = "cancel-open"; 2439 var siblingOpen = "sibling-open"; 2440 var disabled = "disabled"; 2441 var missing = "missing"; 2442 var initial = "initial"; 2443 var imperativeAction = "imperative-action"; 2444 var swipe = "swipe"; 2445 var windowResize = "window-resize"; 2446 2447 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/root/useCollapsibleRoot.mjs 2448 function useCollapsibleRoot(parameters) { 2449 const { 2450 open: openParam, 2451 defaultOpen = false, 2452 onOpenChange, 2453 disabled: disabled2 2454 } = parameters; 2455 const [open3, setOpen] = useControlled({ 2456 controlled: openParam, 2457 default: defaultOpen, 2458 name: "Collapsible", 2459 state: "open" 2460 }); 2461 const { 2462 mounted, 2463 setMounted, 2464 transitionStatus 2465 } = useTransitionStatus(open3, true, true); 2466 const defaultPanelId = useBaseUiId(); 2467 const [registeredPanelId, setPanelIdState] = React13.useState(); 2468 const panelId = registeredPanelId === null ? void 0 : registeredPanelId ?? defaultPanelId; 2469 const handleTrigger = useStableCallback((event) => { 2470 const nextOpen = !open3; 2471 const eventDetails = createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent); 2472 onOpenChange(nextOpen, eventDetails); 2473 if (eventDetails.isCanceled) { 2474 return; 2475 } 2476 setOpen(nextOpen); 2477 }); 2478 return React13.useMemo(() => ({ 2479 defaultPanelId, 2480 disabled: disabled2, 2481 handleTrigger, 2482 mounted, 2483 open: open3, 2484 panelId, 2485 setMounted, 2486 setOpen, 2487 setPanelIdState, 2488 transitionStatus 2489 }), [defaultPanelId, disabled2, handleTrigger, mounted, open3, panelId, setMounted, setOpen, setPanelIdState, transitionStatus]); 2490 } 2491 2492 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/root/CollapsibleRootContext.mjs 2493 var React14 = __toESM(require_react(), 1); 2494 var CollapsibleRootContext = /* @__PURE__ */ React14.createContext(void 0); 2495 if (true) CollapsibleRootContext.displayName = "CollapsibleRootContext"; 2496 function useCollapsibleRootContext() { 2497 const context = React14.useContext(CollapsibleRootContext); 2498 if (context === void 0) { 2499 throw new Error(true ? "Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within <Collapsible.Root>." : formatErrorMessage_default(15)); 2500 } 2501 return context; 2502 } 2503 2504 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelDataAttributes.mjs 2505 var open = "data-open"; 2506 var closed = "data-closed"; 2507 var startingStyle2 = TransitionStatusDataAttributes_exports.startingStyle; 2508 var endingStyle2 = TransitionStatusDataAttributes_exports.endingStyle; 2509 2510 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/trigger/CollapsibleTriggerDataAttributes.mjs 2511 var panelOpen = "data-panel-open"; 2512 2513 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/collapsibleOpenStateMapping.mjs 2514 var PANEL_OPEN_HOOK = { 2515 [open]: "" 2516 }; 2517 var PANEL_CLOSED_HOOK = { 2518 [closed]: "" 2519 }; 2520 var triggerOpenStateMapping = { 2521 open(value) { 2522 if (value) { 2523 return { 2524 [panelOpen]: "" 2525 }; 2526 } 2527 return null; 2528 } 2529 }; 2530 var collapsibleOpenStateMapping = { 2531 open(value) { 2532 if (value) { 2533 return PANEL_OPEN_HOOK; 2534 } 2535 return PANEL_CLOSED_HOOK; 2536 } 2537 }; 2538 2539 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/use-button/useButton.mjs 2540 var React17 = __toESM(require_react(), 1); 2541 2542 // node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 2543 function hasWindow() { 2544 return typeof window !== "undefined"; 2545 } 2546 function getNodeName(node) { 2547 if (isNode(node)) { 2548 return (node.nodeName || "").toLowerCase(); 2549 } 2550 return "#document"; 2551 } 2552 function getWindow(node) { 2553 var _node$ownerDocument; 2554 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 2555 } 2556 function getDocumentElement(node) { 2557 var _ref; 2558 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 2559 } 2560 function isNode(value) { 2561 if (!hasWindow()) { 2562 return false; 2563 } 2564 return value instanceof Node || value instanceof getWindow(value).Node; 2565 } 2566 function isElement(value) { 2567 if (!hasWindow()) { 2568 return false; 2569 } 2570 return value instanceof Element || value instanceof getWindow(value).Element; 2571 } 2572 function isHTMLElement(value) { 2573 if (!hasWindow()) { 2574 return false; 2575 } 2576 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 2577 } 2578 function isShadowRoot(value) { 2579 if (!hasWindow() || typeof ShadowRoot === "undefined") { 2580 return false; 2581 } 2582 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 2583 } 2584 function isOverflowElement(element) { 2585 const { 2586 overflow, 2587 overflowX, 2588 overflowY, 2589 display 2590 } = getComputedStyle2(element); 2591 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; 2592 } 2593 function isTableElement(element) { 2594 return /^(table|td|th)$/.test(getNodeName(element)); 2595 } 2596 function isTopLayer(element) { 2597 try { 2598 if (element.matches(":popover-open")) { 2599 return true; 2600 } 2601 } catch (_e) { 2602 } 2603 try { 2604 return element.matches(":modal"); 2605 } catch (_e) { 2606 return false; 2607 } 2608 } 2609 var willChangeRe = /transform|translate|scale|rotate|perspective|filter/; 2610 var containRe = /paint|layout|strict|content/; 2611 var isNotNone = (value) => !!value && value !== "none"; 2612 var isWebKitValue; 2613 function isContainingBlock(elementOrCss) { 2614 const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; 2615 return isNotNone(css.transform) || isNotNone(css.translate) || isNotNone(css.scale) || isNotNone(css.rotate) || isNotNone(css.perspective) || !isWebKit() && (isNotNone(css.backdropFilter) || isNotNone(css.filter)) || willChangeRe.test(css.willChange || "") || containRe.test(css.contain || ""); 2616 } 2617 function getContainingBlock(element) { 2618 let currentNode = getParentNode(element); 2619 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 2620 if (isContainingBlock(currentNode)) { 2621 return currentNode; 2622 } else if (isTopLayer(currentNode)) { 2623 return null; 2624 } 2625 currentNode = getParentNode(currentNode); 2626 } 2627 return null; 2628 } 2629 function isWebKit() { 2630 if (isWebKitValue == null) { 2631 isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); 2632 } 2633 return isWebKitValue; 2634 } 2635 function isLastTraversableNode(node) { 2636 return /^(html|body|#document)$/.test(getNodeName(node)); 2637 } 2638 function getComputedStyle2(element) { 2639 return getWindow(element).getComputedStyle(element); 2640 } 2641 function getNodeScroll(element) { 2642 if (isElement(element)) { 2643 return { 2644 scrollLeft: element.scrollLeft, 2645 scrollTop: element.scrollTop 2646 }; 2647 } 2648 return { 2649 scrollLeft: element.scrollX, 2650 scrollTop: element.scrollY 2651 }; 2652 } 2653 function getParentNode(node) { 2654 if (getNodeName(node) === "html") { 2655 return node; 2656 } 2657 const result = ( 2658 // Step into the shadow DOM of the parent of a slotted node. 2659 node.assignedSlot || // DOM Element detected. 2660 node.parentNode || // ShadowRoot detected. 2661 isShadowRoot(node) && node.host || // Fallback. 2662 getDocumentElement(node) 2663 ); 2664 return isShadowRoot(result) ? result.host : result; 2665 } 2666 function getNearestOverflowAncestor(node) { 2667 const parentNode = getParentNode(node); 2668 if (isLastTraversableNode(parentNode)) { 2669 return (node.ownerDocument || node).body; 2670 } 2671 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 2672 return parentNode; 2673 } 2674 return getNearestOverflowAncestor(parentNode); 2675 } 2676 function getOverflowAncestors(node, list, traverseIframes) { 2677 var _node$ownerDocument2; 2678 if (list === void 0) { 2679 list = []; 2680 } 2681 if (traverseIframes === void 0) { 2682 traverseIframes = true; 2683 } 2684 const scrollableAncestor = getNearestOverflowAncestor(node); 2685 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 2686 const win = getWindow(scrollableAncestor); 2687 if (isBody) { 2688 const frameElement = getFrameElement(win); 2689 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 2690 } else { 2691 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 2692 } 2693 } 2694 function getFrameElement(win) { 2695 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 2696 } 2697 2698 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/composite/root/CompositeRootContext.mjs 2699 var React15 = __toESM(require_react(), 1); 2700 var CompositeRootContext = /* @__PURE__ */ React15.createContext(void 0); 2701 if (true) CompositeRootContext.displayName = "CompositeRootContext"; 2702 function useCompositeRootContext(optional = false) { 2703 const context = React15.useContext(CompositeRootContext); 2704 if (context === void 0 && !optional) { 2705 throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16)); 2706 } 2707 return context; 2708 } 2709 2710 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/useFocusableWhenDisabled.mjs 2711 var React16 = __toESM(require_react(), 1); 2712 function useFocusableWhenDisabled(parameters) { 2713 const { 2714 focusableWhenDisabled, 2715 disabled: disabled2, 2716 composite = false, 2717 tabIndex: tabIndexProp = 0, 2718 isNativeButton 2719 } = parameters; 2720 const isFocusableComposite = composite && focusableWhenDisabled !== false; 2721 const isNonFocusableComposite = composite && focusableWhenDisabled === false; 2722 const props = React16.useMemo(() => { 2723 const additionalProps = { 2724 // allow Tabbing away from focusableWhenDisabled elements 2725 onKeyDown(event) { 2726 if (disabled2 && focusableWhenDisabled && event.key !== "Tab") { 2727 event.preventDefault(); 2728 } 2729 } 2730 }; 2731 if (!composite) { 2732 additionalProps.tabIndex = tabIndexProp; 2733 if (!isNativeButton && disabled2) { 2734 additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1; 2735 } 2736 } 2737 if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) { 2738 additionalProps["aria-disabled"] = disabled2; 2739 } 2740 if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) { 2741 additionalProps.disabled = disabled2; 2742 } 2743 return additionalProps; 2744 }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]); 2745 return { 2746 props 2747 }; 2748 } 2749 2750 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/owner.mjs 2751 function ownerDocument(node) { 2752 return node?.ownerDocument || document; 2753 } 2754 2755 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/dispatchClickWithModifiers.mjs 2756 function dispatchClickWithModifiers(target, sourceEvent, { 2757 detail = 0, 2758 pointerType = "" 2759 } = {}) { 2760 target.dispatchEvent(new (getWindow(target)).PointerEvent("click", { 2761 bubbles: true, 2762 cancelable: true, 2763 composed: true, 2764 detail, 2765 pointerType, 2766 shiftKey: sourceEvent.shiftKey, 2767 ctrlKey: sourceEvent.ctrlKey, 2768 altKey: sourceEvent.altKey, 2769 metaKey: sourceEvent.metaKey 2770 })); 2771 } 2772 2773 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/use-button/useButton.mjs 2774 function useButton(parameters = {}) { 2775 const { 2776 disabled: disabled2 = false, 2777 focusableWhenDisabled, 2778 tabIndex = 0, 2779 native: isNativeButton = true, 2780 composite: compositeProp 2781 } = parameters; 2782 const elementRef = React17.useRef(null); 2783 const compositeRootContext = useCompositeRootContext(true); 2784 const isCompositeItem = compositeProp ?? compositeRootContext !== void 0; 2785 const { 2786 props: focusableWhenDisabledProps 2787 } = useFocusableWhenDisabled({ 2788 focusableWhenDisabled, 2789 disabled: disabled2, 2790 composite: isCompositeItem, 2791 tabIndex, 2792 isNativeButton 2793 }); 2794 if (true) { 2795 React17.useEffect(() => { 2796 if (!elementRef.current) { 2797 return; 2798 } 2799 const isButtonTag = isButtonElement(elementRef.current); 2800 if (isNativeButton) { 2801 if (!isButtonTag) { 2802 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 2803 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`."; 2804 error(`$message}$ownerStackMessage}`); 2805 } 2806 } else if (isButtonTag) { 2807 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 2808 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`."; 2809 error(`$message}$ownerStackMessage}`); 2810 } 2811 }, [isNativeButton]); 2812 } 2813 const updateDisabled = React17.useCallback(() => { 2814 const element = elementRef.current; 2815 if (!isButtonElement(element)) { 2816 return; 2817 } 2818 if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) { 2819 element.disabled = false; 2820 } 2821 }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]); 2822 useIsoLayoutEffect(updateDisabled, [updateDisabled]); 2823 const getButtonProps = React17.useCallback((externalProps = {}) => { 2824 const { 2825 onClick: externalOnClick, 2826 onMouseDown: externalOnMouseDown, 2827 onKeyUp: externalOnKeyUp, 2828 onKeyDown: externalOnKeyDown, 2829 onPointerDown: externalOnPointerDown, 2830 ...otherExternalProps 2831 } = externalProps; 2832 return mergeProps({ 2833 onClick(event) { 2834 if (disabled2) { 2835 event.preventDefault(); 2836 return; 2837 } 2838 externalOnClick?.(event); 2839 }, 2840 onMouseDown(event) { 2841 if (!disabled2) { 2842 externalOnMouseDown?.(event); 2843 } 2844 }, 2845 onKeyDown(event) { 2846 if (disabled2) { 2847 return; 2848 } 2849 makeEventPreventable(event); 2850 externalOnKeyDown?.(event); 2851 if (event.baseUIHandlerPrevented) { 2852 return; 2853 } 2854 const isCurrentTarget = event.target === event.currentTarget; 2855 const currentTarget = event.currentTarget; 2856 const isButton = isButtonElement(currentTarget); 2857 const isLink = !isNativeButton && isValidLinkElement(currentTarget); 2858 const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink); 2859 const isEnterKey = event.key === "Enter"; 2860 const isSpaceKey = event.key === " "; 2861 const role = currentTarget.getAttribute("role"); 2862 const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell"; 2863 if (isCurrentTarget && isCompositeItem && isSpaceKey) { 2864 if (event.defaultPrevented && isTextNavigationRole) { 2865 return; 2866 } 2867 event.preventDefault(); 2868 if (!isNativeButton || isButton) { 2869 event.preventBaseUIHandler(); 2870 dispatchClickWithModifiers(currentTarget, event); 2871 } 2872 return; 2873 } 2874 if (!shouldClick || isNativeButton || !isSpaceKey && !isEnterKey) { 2875 if (isCurrentTarget && isLink && isSpaceKey) { 2876 event.preventDefault(); 2877 } 2878 return; 2879 } 2880 if (event.defaultPrevented) { 2881 return; 2882 } 2883 event.preventDefault(); 2884 if (isEnterKey) { 2885 event.preventBaseUIHandler(); 2886 dispatchClickWithModifiers(currentTarget, event); 2887 } 2888 }, 2889 onKeyUp(event) { 2890 if (disabled2) { 2891 return; 2892 } 2893 makeEventPreventable(event); 2894 externalOnKeyUp?.(event); 2895 if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") { 2896 event.preventDefault(); 2897 return; 2898 } 2899 if (event.baseUIHandlerPrevented) { 2900 return; 2901 } 2902 if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && !event.defaultPrevented && event.key === " ") { 2903 event.preventBaseUIHandler(); 2904 dispatchClickWithModifiers(event.currentTarget, event); 2905 } 2906 }, 2907 onPointerDown(event) { 2908 if (disabled2) { 2909 event.preventDefault(); 2910 return; 2911 } 2912 externalOnPointerDown?.(event); 2913 } 2914 }, isNativeButton ? { 2915 type: "button" 2916 } : { 2917 role: "button" 2918 }, focusableWhenDisabledProps, otherExternalProps); 2919 }, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]); 2920 const buttonRef = useStableCallback((element) => { 2921 elementRef.current = element; 2922 updateDisabled(); 2923 }); 2924 return { 2925 getButtonProps, 2926 buttonRef 2927 }; 2928 } 2929 function isButtonElement(elem) { 2930 return isHTMLElement(elem) && elem.tagName === "BUTTON"; 2931 } 2932 function isValidLinkElement(elem) { 2933 return isHTMLElement(elem) && elem.tagName === "A" && Boolean(elem.href); 2934 } 2935 2936 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/panel/useCollapsiblePanel.mjs 2937 var React18 = __toESM(require_react(), 1); 2938 2939 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/addEventListener.mjs 2940 function addEventListener(target, type, listener, options) { 2941 target.addEventListener(type, listener, options); 2942 return () => { 2943 target.removeEventListener(type, listener, options); 2944 }; 2945 } 2946 2947 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useValueAsRef.mjs 2948 function useValueAsRef(value) { 2949 const latest = useRefWithInit(createLatestRef, value).current; 2950 latest.next = value; 2951 useIsoLayoutEffect(latest.effect); 2952 return latest; 2953 } 2954 function createLatestRef(value) { 2955 const latest = { 2956 current: value, 2957 next: value, 2958 effect: () => { 2959 latest.current = latest.next; 2960 } 2961 }; 2962 return latest; 2963 } 2964 2965 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/panel/useCollapsiblePanel.mjs 2966 var EMPTY_DIMENSIONS = { 2967 height: void 0, 2968 width: void 0 2969 }; 2970 function useCollapsiblePanel(parameters) { 2971 const { 2972 externalRef, 2973 hiddenUntilFound, 2974 id: idParam, 2975 keepMounted, 2976 mounted, 2977 onOpenChange, 2978 open: open3, 2979 setMounted, 2980 setOpen, 2981 transitionStatus 2982 } = parameters; 2983 const panelRef = React18.useRef(null); 2984 const animationTypeRef = React18.useRef(null); 2985 const [dimensions, setDimensionsUnwrapped] = React18.useState(EMPTY_DIMENSIONS); 2986 const lastMeasuredDimensionsRef = React18.useRef(EMPTY_DIMENSIONS); 2987 const shouldSkipNextOpenRef = React18.useRef(false); 2988 const shouldPreventMountAnimationRef = React18.useRef(open3); 2989 const shouldPreventActivityResumeAnimationRef = React18.useRef(false); 2990 const [forcePanelIdle, setForcePanelIdle] = React18.useState(false); 2991 const pendingTemporaryStyleRestoreRef = React18.useRef(null); 2992 const mergedPanelRef = useMergedRefs(externalRef, panelRef); 2993 const latestOpenRef = useValueAsRef(open3); 2994 const runOnceCloseAnimationsFinish = useAnimationsFinished(panelRef); 2995 const hidden = !open3 && !mounted; 2996 const panelTransitionStatus = forcePanelIdle ? "idle" : transitionStatus; 2997 const shouldPreventOpenAnimation = open3 && // These 2 refs are safe to read in render, they are only written from committed 2998 // layout/effect paths and gate one-shot motion suppression for the next open 2999 // lifecycle. They intentionally expose the last committed motion snapshot. 3000 (shouldPreventMountAnimationRef.current || shouldPreventActivityResumeAnimationRef.current); 3001 const renderedDimensions = !open3 && mounted && // These 2 refs are also safe to read in render, both hold the last committed 3002 // animation mode and measurement. This fallback only restores a previously 3003 // measured pixel size after the live dimensions state has been reset back to `auto`. 3004 animationTypeRef.current === "css-animation" && dimensions.height === void 0 && dimensions.width === void 0 ? lastMeasuredDimensionsRef.current : dimensions; 3005 const shouldPersistHiddenTransitionStyles = hiddenUntilFound && hidden && animationTypeRef.current !== "css-animation"; 3006 const setDimensions = useStableCallback((nextDimensions, shouldCacheMeasurement = true) => { 3007 if (shouldCacheMeasurement) { 3008 lastMeasuredDimensionsRef.current = nextDimensions; 3009 } 3010 setDimensionsUnwrapped(nextDimensions); 3011 }); 3012 const restorePendingTemporaryStyle = useStableCallback(() => { 3013 pendingTemporaryStyleRestoreRef.current?.(); 3014 pendingTemporaryStyleRestoreRef.current = null; 3015 }); 3016 const setPendingTemporaryStyleRestore = useStableCallback((restore) => { 3017 restorePendingTemporaryStyle(); 3018 pendingTemporaryStyleRestoreRef.current = () => { 3019 pendingTemporaryStyleRestoreRef.current = null; 3020 restore(); 3021 }; 3022 }); 3023 const markActivityResumeAnimationSuppressed = useStableCallback(() => { 3024 if (open3 && mounted && animationTypeRef.current === "css-animation") { 3025 shouldPreventActivityResumeAnimationRef.current = true; 3026 } 3027 }); 3028 useIsoLayoutEffect(() => { 3029 if (!forcePanelIdle || transitionStatus === "starting") { 3030 return; 3031 } 3032 setForcePanelIdle(false); 3033 }, [forcePanelIdle, transitionStatus]); 3034 React18.useEffect(() => { 3035 return () => { 3036 markActivityResumeAnimationSuppressed(); 3037 restorePendingTemporaryStyle(); 3038 }; 3039 }, [markActivityResumeAnimationSuppressed, restorePendingTemporaryStyle]); 3040 useIsoLayoutEffect(() => { 3041 if (!open3) { 3042 shouldPreventMountAnimationRef.current = false; 3043 shouldPreventActivityResumeAnimationRef.current = false; 3044 } 3045 const panel = panelRef.current; 3046 if (!panel) { 3047 return void 0; 3048 } 3049 if (!open3 && pendingTemporaryStyleRestoreRef.current) { 3050 restorePendingTemporaryStyle(); 3051 } 3052 const animationType = getAnimationType(panel, shouldPreventOpenAnimation); 3053 animationTypeRef.current = animationType; 3054 if (open3 && transitionStatus === "idle" && shouldPreventMountAnimationRef.current && animationType === "css-animation") { 3055 lastMeasuredDimensionsRef.current = getDimensions(panel); 3056 return void 0; 3057 } 3058 if (open3 && transitionStatus === "starting") { 3059 const skipNextOpen = shouldSkipNextOpenRef.current; 3060 shouldSkipNextOpenRef.current = false; 3061 if (animationType === "none") { 3062 setDimensions(getDimensions(panel)); 3063 setForcePanelIdle(true); 3064 return void 0; 3065 } 3066 if (animationType === "css-transition") { 3067 const restoreLayoutStyles = resetLayoutStyles(panel); 3068 setDimensions(getDimensions(panel)); 3069 if (!skipNextOpen) { 3070 return restoreLayoutStyles; 3071 } 3072 const restoreTransitionDuration = setTemporaryStyle(panel, "transition-duration", "0s"); 3073 setPendingTemporaryStyleRestore(restoreTransitionDuration); 3074 setForcePanelIdle(true); 3075 return restoreLayoutStyles; 3076 } 3077 setDimensions(getDimensions(panel)); 3078 const restoreAnimationName = setTemporaryStyle(panel, "animation-name", "none"); 3079 if (!skipNextOpen) { 3080 restoreAnimationName(); 3081 return void 0; 3082 } 3083 const restoreAnimationDuration = setTemporaryStyle(panel, "animation-duration", "0s"); 3084 restoreAnimationName(); 3085 setPendingTemporaryStyleRestore(restoreAnimationDuration); 3086 setForcePanelIdle(true); 3087 return void 0; 3088 } 3089 if (!open3 && mounted && (transitionStatus === "idle" || transitionStatus === "starting")) { 3090 if (animationType === "none") { 3091 setDimensions(EMPTY_DIMENSIONS, false); 3092 setMounted(false); 3093 return void 0; 3094 } 3095 setDimensions(getDimensions(panel)); 3096 return void 0; 3097 } 3098 if (transitionStatus !== "ending") { 3099 return void 0; 3100 } 3101 if (animationType === "none") { 3102 setMounted(false); 3103 return void 0; 3104 } 3105 const nextDimensions = getDimensions(panel); 3106 const hasMeasuredSize = nextDimensions.height > 0 || nextDimensions.width > 0; 3107 if (!hasMeasuredSize) { 3108 setMounted(false); 3109 return void 0; 3110 } 3111 setDimensions(nextDimensions); 3112 if (animationType === "css-animation") { 3113 const restoreAnimationName = setTemporaryStyle(panel, "animation-name", "none"); 3114 restoreAnimationName(); 3115 } 3116 return void 0; 3117 }, [mounted, open3, restorePendingTemporaryStyle, setDimensions, setMounted, setPendingTemporaryStyleRestore, shouldPreventOpenAnimation, transitionStatus]); 3118 useOpenChangeComplete({ 3119 enabled: open3 && mounted && panelTransitionStatus === "idle", 3120 open: true, 3121 ref: panelRef, 3122 onComplete() { 3123 if (!open3) { 3124 return; 3125 } 3126 setDimensions(EMPTY_DIMENSIONS, false); 3127 } 3128 }); 3129 React18.useEffect(() => { 3130 if (open3 || !mounted || panelTransitionStatus !== "ending") { 3131 return void 0; 3132 } 3133 const panel = panelRef.current; 3134 if (!panel) { 3135 setMounted(false); 3136 setDimensions(EMPTY_DIMENSIONS, false); 3137 return void 0; 3138 } 3139 const abortController = new AbortController(); 3140 let endingStyleFrame = -1; 3141 function handleComplete() { 3142 if (latestOpenRef.current) { 3143 return; 3144 } 3145 setMounted(false); 3146 setDimensions(EMPTY_DIMENSIONS, false); 3147 } 3148 endingStyleFrame = AnimationFrame.request(() => { 3149 runOnceCloseAnimationsFinish(handleComplete, abortController.signal); 3150 }); 3151 return () => { 3152 AnimationFrame.cancel(endingStyleFrame); 3153 abortController.abort(); 3154 }; 3155 }, [latestOpenRef, mounted, open3, panelTransitionStatus, runOnceCloseAnimationsFinish, setDimensions, setMounted]); 3156 useIsoLayoutEffect(() => { 3157 const panel = panelRef.current; 3158 if (!panel || !hiddenUntilFound || !hidden) { 3159 return; 3160 } 3161 panel.setAttribute("hidden", "until-found"); 3162 }, [hidden, hiddenUntilFound]); 3163 React18.useEffect(function registerBeforeMatchListener() { 3164 const panel = panelRef.current; 3165 if (!panel) { 3166 return void 0; 3167 } 3168 const revealDecisionTimeout = Timeout.create(); 3169 let revertRevealFrame = -1; 3170 const scheduleRevealRevert = (revertSkippedMotion, restoreStartingStyle) => { 3171 revealDecisionTimeout.start(0, () => { 3172 if (latestOpenRef.current) { 3173 return; 3174 } 3175 revertRevealFrame = AnimationFrame.request(() => { 3176 if (latestOpenRef.current) { 3177 return; 3178 } 3179 if (revertSkippedMotion) { 3180 shouldSkipNextOpenRef.current = false; 3181 } 3182 if (restoreStartingStyle) { 3183 panel.setAttribute(startingStyle2, ""); 3184 } 3185 panel.setAttribute("hidden", "until-found"); 3186 }); 3187 }); 3188 }; 3189 const handleBeforeMatch = (event) => { 3190 const eventDetails = createChangeEventDetails(reason_parts_exports.none, event); 3191 onOpenChange(true, eventDetails); 3192 if (eventDetails.isCanceled) { 3193 scheduleRevealRevert(false, false); 3194 return; 3195 } 3196 shouldSkipNextOpenRef.current = true; 3197 const hadStartingStyle = panel.hasAttribute(startingStyle2); 3198 panel.removeAttribute(startingStyle2); 3199 setOpen(true); 3200 scheduleRevealRevert(true, hadStartingStyle); 3201 }; 3202 const cleanupBeforeMatchListener = addEventListener(panel, "beforematch", handleBeforeMatch); 3203 return () => { 3204 revealDecisionTimeout.clear(); 3205 AnimationFrame.cancel(revertRevealFrame); 3206 cleanupBeforeMatchListener(); 3207 }; 3208 }, [latestOpenRef, onOpenChange, setOpen]); 3209 const shouldRender = keepMounted || hiddenUntilFound || mounted || open3; 3210 return { 3211 height: renderedDimensions.height, 3212 props: { 3213 ...shouldPersistHiddenTransitionStyles ? { 3214 [startingStyle2]: "" 3215 } : void 0, 3216 hidden, 3217 id: idParam 3218 }, 3219 ref: mergedPanelRef, 3220 shouldPreventOpenAnimation, 3221 shouldRender, 3222 transitionStatus: panelTransitionStatus, 3223 width: renderedDimensions.width 3224 }; 3225 } 3226 function getDimensions(element) { 3227 return { 3228 height: element.scrollHeight, 3229 width: element.scrollWidth 3230 }; 3231 } 3232 function getAnimationType(element, hasSuppressedMountAnimation) { 3233 const panelStyles = getWindow(element).getComputedStyle(element); 3234 const hasAnimation = (panelStyles.animationName.split(",").map((name2) => name2.trim()).some((name2) => name2 !== "" && name2 !== "none") || hasSuppressedMountAnimation) && hasNonZeroDuration(panelStyles.animationDuration); 3235 const hasTransition = hasNonZeroDuration(panelStyles.transitionDuration); 3236 if (hasAnimation && hasTransition) { 3237 if (true) { 3238 warn("CSS transitions and CSS animations both detected on Collapsible or Accordion panel.", "Only one of either animation type should be used."); 3239 } 3240 return "css-transition"; 3241 } 3242 if (hasTransition) { 3243 return "css-transition"; 3244 } 3245 if (hasAnimation) { 3246 return "css-animation"; 3247 } 3248 return "none"; 3249 } 3250 function hasNonZeroDuration(value) { 3251 return value.split(",").map((part) => part.trim()).some((part) => part !== "" && Number.parseFloat(part) > 0); 3252 } 3253 function setTemporaryStyle(element, property, value) { 3254 const previousValue = element.style.getPropertyValue(property); 3255 const previousPriority = element.style.getPropertyPriority(property); 3256 element.style.setProperty(property, value); 3257 return () => { 3258 if (previousValue === "") { 3259 element.style.removeProperty(property); 3260 return; 3261 } 3262 element.style.setProperty(property, previousValue, previousPriority); 3263 }; 3264 } 3265 function resetLayoutStyles(element) { 3266 const originalLayoutStyles = { 3267 "justify-content": element.style.justifyContent, 3268 "align-items": element.style.alignItems, 3269 "align-content": element.style.alignContent, 3270 "justify-items": element.style.justifyItems 3271 }; 3272 Object.keys(originalLayoutStyles).forEach((key) => { 3273 element.style.setProperty(key, "initial", "important"); 3274 }); 3275 function restoreLayoutStyles() { 3276 Object.entries(originalLayoutStyles).forEach(([key, value]) => { 3277 if (value === "") { 3278 element.style.removeProperty(key); 3279 return; 3280 } 3281 element.style.setProperty(key, value); 3282 }); 3283 } 3284 const frame = AnimationFrame.request(restoreLayoutStyles); 3285 return () => { 3286 AnimationFrame.cancel(frame); 3287 restoreLayoutStyles(); 3288 }; 3289 } 3290 3291 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/parts.mjs 3292 var parts_exports = {}; 3293 __export(parts_exports, { 3294 engine: () => engine_exports, 3295 env: () => env_exports, 3296 mediaQuery: () => media_query_exports, 3297 os: () => os_exports, 3298 screenReader: () => screen_reader_exports 3299 }); 3300 3301 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/os.mjs 3302 var os_exports = {}; 3303 __export(os_exports, { 3304 android: () => android, 3305 apple: () => apple, 3306 ios: () => ios, 3307 linux: () => linux, 3308 mac: () => mac, 3309 windows: () => windows 3310 }); 3311 3312 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/shared.mjs 3313 function readRawData() { 3314 if (typeof navigator === "undefined") { 3315 return { 3316 userAgent: "", 3317 platform: "", 3318 maxTouchPoints: 0 3319 }; 3320 } 3321 if (true) { 3322 const uaData = navigator.userAgentData; 3323 if (uaData && Array.isArray(uaData.brands)) { 3324 return { 3325 userAgent: uaData.brands.map(({ 3326 brand, 3327 version: version2 3328 }) => `$brand}/$version2}`).join(" "), 3329 platform: uaData.platform ?? navigator.platform ?? "", 3330 maxTouchPoints: navigator.maxTouchPoints ?? 0 3331 }; 3332 } 3333 } 3334 return { 3335 userAgent: navigator.userAgent, 3336 platform: navigator.platform ?? "", 3337 maxTouchPoints: navigator.maxTouchPoints ?? 0 3338 }; 3339 } 3340 var { 3341 userAgent, 3342 platform, 3343 maxTouchPoints 3344 } = readRawData(); 3345 var lowerUserAgent = userAgent.toLowerCase(); 3346 var lowerPlatform = platform.toLowerCase(); 3347 3348 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/os.mjs 3349 var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1; 3350 var ANDROID_STRING = "android"; 3351 var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING); 3352 var mac = !ios && lowerPlatform.startsWith("mac"); 3353 var windows = lowerPlatform.startsWith("win"); 3354 var linux = !android && /^(linux|chrome os)/.test(lowerPlatform); 3355 var apple = mac || ios; 3356 3357 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/engine.mjs 3358 var engine_exports = {}; 3359 __export(engine_exports, { 3360 blink: () => blink, 3361 gecko: () => gecko, 3362 webkit: () => webkit 3363 }); 3364 var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none"); 3365 var gecko = !webkit && lowerUserAgent.includes("firefox"); 3366 var blink = !webkit && lowerUserAgent.includes("chrom"); 3367 3368 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/screen-reader.mjs 3369 var screen_reader_exports = {}; 3370 __export(screen_reader_exports, { 3371 voiceOver: () => voiceOver 3372 }); 3373 var voiceOver = apple; 3374 3375 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/env.mjs 3376 var env_exports = {}; 3377 __export(env_exports, { 3378 jsdom: () => jsdom 3379 }); 3380 var jsdom = /jsdom|happydom/.test(lowerUserAgent); 3381 3382 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/media-query.mjs 3383 var media_query_exports = {}; 3384 __export(media_query_exports, { 3385 iOS: () => iOS 3386 }); 3387 var iOS = "@supports (-webkit-touch-callout: none)"; 3388 3389 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs 3390 var React19 = __toESM(require_react(), 1); 3391 3392 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs 3393 function isReactEvent(event) { 3394 return "nativeEvent" in event; 3395 } 3396 function isVirtualClick(event) { 3397 if (event.pointerType === "" && event.isTrusted) { 3398 return true; 3399 } 3400 if (parts_exports.os.android && event.pointerType) { 3401 return event.type === "click" && event.buttons === 1; 3402 } 3403 return event.detail === 0 && !event.pointerType; 3404 } 3405 function isMouseLikePointerType(pointerType, strict) { 3406 const values = ["mouse", "pen"]; 3407 if (!strict) { 3408 values.push("", void 0); 3409 } 3410 return values.includes(pointerType); 3411 } 3412 function isClickLikeEvent(event) { 3413 const type = event.type; 3414 return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; 3415 } 3416 3417 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/shadowDom.mjs 3418 function activeElement(doc) { 3419 let element = doc.activeElement; 3420 while (element?.shadowRoot?.activeElement != null) { 3421 element = element.shadowRoot.activeElement; 3422 } 3423 return element; 3424 } 3425 function contains(parent, child) { 3426 if (!parent || !child) { 3427 return false; 3428 } 3429 const rootNode = child.getRootNode?.(); 3430 if (parent.contains(child)) { 3431 return true; 3432 } 3433 if (rootNode && isShadowRoot(rootNode)) { 3434 let next = child; 3435 while (next) { 3436 if (parent === next) { 3437 return true; 3438 } 3439 next = next.parentNode || next.host; 3440 } 3441 } 3442 return false; 3443 } 3444 function closest(node, selector) { 3445 let current = node; 3446 while (current) { 3447 if (isElement(current) && current.matches(selector)) { 3448 return current; 3449 } 3450 current = current.assignedSlot ?? current.parentNode ?? (isShadowRoot(current) ? current.host : null); 3451 } 3452 return null; 3453 } 3454 function getTarget(event) { 3455 if ("composedPath" in event) { 3456 return event.composedPath()[0] ?? event.target; 3457 } 3458 return event.target; 3459 } 3460 3461 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs 3462 var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; 3463 var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; 3464 3465 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs 3466 var open2 = "data-open"; 3467 var closed2 = "data-closed"; 3468 var anchorHidden = "data-anchor-hidden"; 3469 3470 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs 3471 var CommonTriggerDataAttributes_exports = {}; 3472 __export(CommonTriggerDataAttributes_exports, { 3473 popupOpen: () => popupOpen, 3474 pressed: () => pressed 3475 }); 3476 var popupOpen = "data-popup-open"; 3477 var pressed = "data-pressed"; 3478 3479 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popupStateMapping.mjs 3480 var TRIGGER_HOOK = { 3481 [popupOpen]: "" 3482 }; 3483 var PRESSABLE_TRIGGER_HOOK = { 3484 [popupOpen]: "", 3485 [pressed]: "" 3486 }; 3487 var POPUP_OPEN_HOOK = { 3488 [open2]: "" 3489 }; 3490 var POPUP_CLOSED_HOOK = { 3491 [closed2]: "" 3492 }; 3493 var ANCHOR_HIDDEN_HOOK = { 3494 [anchorHidden]: "" 3495 }; 3496 var triggerOpenStateMapping2 = { 3497 open(value) { 3498 if (value) { 3499 return TRIGGER_HOOK; 3500 } 3501 return null; 3502 } 3503 }; 3504 var popupStateMapping = { 3505 open(value) { 3506 if (value) { 3507 return POPUP_OPEN_HOOK; 3508 } 3509 return POPUP_CLOSED_HOOK; 3510 }, 3511 anchorHidden(value) { 3512 if (value) { 3513 return ANCHOR_HIDDEN_HOOK; 3514 } 3515 return null; 3516 } 3517 }; 3518 var popupTransitionStateMapping = { 3519 ...popupStateMapping, 3520 ...transitionStatusMapping 3521 }; 3522 3523 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs 3524 var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen; 3525 var triggerDisabled = "data-trigger-disabled"; 3526 3527 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs 3528 function isTargetInsideEnabledTrigger(target, triggerElements) { 3529 if (!isElement(target)) { 3530 return false; 3531 } 3532 const targetElement = target; 3533 if (triggerElements.hasElement(targetElement)) { 3534 return !targetElement.hasAttribute(triggerDisabled); 3535 } 3536 for (const [, trigger] of triggerElements.entries()) { 3537 if (contains(trigger, targetElement)) { 3538 return !trigger.hasAttribute(triggerDisabled); 3539 } 3540 } 3541 return false; 3542 } 3543 function isEventTargetWithin(event, node) { 3544 if (node == null) { 3545 return false; 3546 } 3547 if ("composedPath" in event) { 3548 return event.composedPath().includes(node); 3549 } 3550 const eventAgain = event; 3551 return eventAgain.target != null && node.contains(eventAgain.target); 3552 } 3553 function isRootElement(element) { 3554 return element.matches("html,body"); 3555 } 3556 function isTypeableElement(element) { 3557 return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); 3558 } 3559 function isInteractiveElement(element) { 3560 return closest(element, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),$TYPEABLE_SELECTOR}`) != null; 3561 } 3562 function matchesFocusVisible(element) { 3563 if (!element || parts_exports.env.jsdom) { 3564 return true; 3565 } 3566 try { 3567 return element.matches(":focus-visible"); 3568 } catch (_e) { 3569 return true; 3570 } 3571 } 3572 3573 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs 3574 function resolveValue(value, pointerType) { 3575 if (pointerType != null && !isMouseLikePointerType(pointerType)) { 3576 return 0; 3577 } 3578 if (typeof value === "function") { 3579 return value(); 3580 } 3581 return value; 3582 } 3583 function getDelay(value, prop, pointerType) { 3584 const result = resolveValue(value, pointerType); 3585 if (typeof result === "number") { 3586 return result; 3587 } 3588 return result?.[prop]; 3589 } 3590 function getRestMs(value) { 3591 if (typeof value === "function") { 3592 return value(); 3593 } 3594 return value; 3595 } 3596 function isClickLikeOpenEvent(openEventType, interactedInside) { 3597 return interactedInside || openEventType === "click" || openEventType === "mousedown"; 3598 } 3599 function isHoverOpenEvent(openEventType) { 3600 return openEventType?.includes("mouse") && openEventType !== "mousedown"; 3601 } 3602 3603 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs 3604 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); 3605 var FloatingDelayGroupContext = /* @__PURE__ */ React19.createContext({ 3606 hasProvider: false, 3607 timeoutMs: 0, 3608 delayRef: { 3609 current: 0 3610 }, 3611 initialDelayRef: { 3612 current: 0 3613 }, 3614 timeout: new Timeout(), 3615 currentIdRef: { 3616 current: null 3617 }, 3618 currentContextRef: { 3619 current: null 3620 } 3621 }); 3622 if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext"; 3623 function resetDelayRef(delayRef, initialDelayRef) { 3624 delayRef.current = initialDelayRef.current; 3625 } 3626 function FloatingDelayGroup(props) { 3627 const { 3628 children, 3629 delay, 3630 timeoutMs = 0 3631 } = props; 3632 const delayRef = React19.useRef(delay); 3633 const initialDelayRef = React19.useRef(delay); 3634 const currentIdRef = React19.useRef(null); 3635 const currentContextRef = React19.useRef(null); 3636 const timeout = useTimeout(); 3637 useIsoLayoutEffect(() => { 3638 initialDelayRef.current = delay; 3639 if (!currentIdRef.current) { 3640 delayRef.current = delay; 3641 return; 3642 } 3643 delayRef.current = { 3644 open: getDelay(delayRef.current, "open"), 3645 close: getDelay(delay, "close") 3646 }; 3647 }, [delay, currentIdRef, delayRef, initialDelayRef]); 3648 return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(FloatingDelayGroupContext.Provider, { 3649 value: React19.useMemo(() => ({ 3650 hasProvider: true, 3651 delayRef, 3652 initialDelayRef, 3653 currentIdRef, 3654 timeoutMs, 3655 currentContextRef, 3656 timeout 3657 }), [timeoutMs, timeout]), 3658 children 3659 }); 3660 } 3661 function useDelayGroup(store3, options = { 3662 open: false 3663 }) { 3664 const { 3665 open: open3 3666 } = options; 3667 const floatingId = store3.useState("floatingId"); 3668 const groupContext = React19.useContext(FloatingDelayGroupContext); 3669 const { 3670 currentIdRef, 3671 delayRef, 3672 timeoutMs, 3673 initialDelayRef, 3674 currentContextRef, 3675 hasProvider, 3676 timeout 3677 } = groupContext; 3678 const [isInstantPhase, setIsInstantPhase] = React19.useState(false); 3679 const openRef = React19.useRef(open3); 3680 useIsoLayoutEffect(() => { 3681 openRef.current = open3; 3682 }, [open3]); 3683 useIsoLayoutEffect(() => { 3684 function unset() { 3685 currentContextRef.current?.setIsInstantPhase(false); 3686 currentIdRef.current = null; 3687 currentContextRef.current = null; 3688 delayRef.current = initialDelayRef.current; 3689 timeout.clear(); 3690 } 3691 if (!currentIdRef.current) { 3692 return void 0; 3693 } 3694 if (!open3 && currentIdRef.current === floatingId) { 3695 setIsInstantPhase(false); 3696 if (timeoutMs) { 3697 const closingId = floatingId; 3698 timeout.start(timeoutMs, () => { 3699 if (store3.select("open") || currentIdRef.current && currentIdRef.current !== closingId) { 3700 return; 3701 } 3702 unset(); 3703 }); 3704 return () => { 3705 if (openRef.current || currentIdRef.current !== closingId) { 3706 timeout.clear(); 3707 } 3708 }; 3709 } 3710 unset(); 3711 } 3712 return void 0; 3713 }, [open3, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store3]); 3714 useIsoLayoutEffect(() => { 3715 if (!open3) { 3716 return; 3717 } 3718 const prevContext = currentContextRef.current; 3719 const prevId = currentIdRef.current; 3720 timeout.clear(); 3721 currentContextRef.current = { 3722 onOpenChange: store3.setOpen, 3723 setIsInstantPhase 3724 }; 3725 currentIdRef.current = floatingId; 3726 delayRef.current = { 3727 open: 0, 3728 close: getDelay(initialDelayRef.current, "close") 3729 }; 3730 if (prevId !== null && prevId !== floatingId) { 3731 setIsInstantPhase(true); 3732 prevContext?.setIsInstantPhase(true); 3733 prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none)); 3734 } else { 3735 setIsInstantPhase(false); 3736 prevContext?.setIsInstantPhase(false); 3737 } 3738 }, [open3, floatingId, store3, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); 3739 useIsoLayoutEffect(() => { 3740 return () => { 3741 if (currentIdRef.current === floatingId) { 3742 currentContextRef.current = null; 3743 if (!openRef.current) { 3744 return; 3745 } 3746 currentIdRef.current = null; 3747 resetDelayRef(delayRef, initialDelayRef); 3748 timeout.clear(); 3749 } 3750 }; 3751 }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]); 3752 return React19.useMemo(() => ({ 3753 activeIdRef: currentIdRef, 3754 hasProvider, 3755 delayRef, 3756 isInstantPhase 3757 }), [currentIdRef, hasProvider, delayRef, isInstantPhase]); 3758 } 3759 3760 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/mergeCleanups.mjs 3761 function mergeCleanups(...cleanups) { 3762 return () => { 3763 for (let i = 0; i < cleanups.length; i += 1) { 3764 const cleanup = cleanups[i]; 3765 if (cleanup) { 3766 cleanup(); 3767 } 3768 } 3769 }; 3770 } 3771 3772 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FocusGuard.mjs 3773 var React20 = __toESM(require_react(), 1); 3774 3775 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/visuallyHidden.mjs 3776 var visuallyHiddenBase = { 3777 clipPath: "inset(50%)", 3778 overflow: "hidden", 3779 whiteSpace: "nowrap", 3780 border: 0, 3781 padding: 0, 3782 width: 1, 3783 height: 1, 3784 margin: -1 3785 }; 3786 var visuallyHidden = { 3787 ...visuallyHiddenBase, 3788 position: "fixed", 3789 margin: 0, 3790 top: 0, 3791 left: 0 3792 }; 3793 var visuallyHiddenInput = { 3794 ...visuallyHiddenBase, 3795 position: "absolute" 3796 }; 3797 3798 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FocusGuard.mjs 3799 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); 3800 var FocusGuard = /* @__PURE__ */ React20.forwardRef(function FocusGuard2(props, ref) { 3801 const [role, setRole] = React20.useState(); 3802 useIsoLayoutEffect(() => { 3803 if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) { 3804 setRole("button"); 3805 } 3806 }, []); 3807 const restProps = { 3808 tabIndex: 0, 3809 // Role is only for VoiceOver 3810 role 3811 }; 3812 return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)("span", { 3813 ...props, 3814 ref, 3815 style: visuallyHidden, 3816 "aria-hidden": role ? void 0 : true, 3817 ...restProps, 3818 "data-base-ui-focus-guard": "" 3819 }); 3820 }); 3821 if (true) FocusGuard.displayName = "FocusGuard"; 3822 3823 // node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 3824 var min = Math.min; 3825 var max = Math.max; 3826 var round = Math.round; 3827 var floor = Math.floor; 3828 var createCoords = (v) => ({ 3829 x: v, 3830 y: v 3831 }); 3832 var oppositeSideMap = { 3833 left: "right", 3834 right: "left", 3835 bottom: "top", 3836 top: "bottom" 3837 }; 3838 function clamp(start, value, end) { 3839 return max(start, min(value, end)); 3840 } 3841 function evaluate(value, param) { 3842 return typeof value === "function" ? value(param) : value; 3843 } 3844 function getSide(placement) { 3845 return placement.split("-")[0]; 3846 } 3847 function getAlignment(placement) { 3848 return placement.split("-")[1]; 3849 } 3850 function getOppositeAxis(axis) { 3851 return axis === "x" ? "y" : "x"; 3852 } 3853 function getAxisLength(axis) { 3854 return axis === "y" ? "height" : "width"; 3855 } 3856 function getSideAxis(placement) { 3857 const firstChar = placement[0]; 3858 return firstChar === "t" || firstChar === "b" ? "y" : "x"; 3859 } 3860 function getAlignmentAxis(placement) { 3861 return getOppositeAxis(getSideAxis(placement)); 3862 } 3863 function getAlignmentSides(placement, rects, rtl) { 3864 if (rtl === void 0) { 3865 rtl = false; 3866 } 3867 const alignment = getAlignment(placement); 3868 const alignmentAxis = getAlignmentAxis(placement); 3869 const length = getAxisLength(alignmentAxis); 3870 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 3871 if (rects.reference[length] > rects.floating[length]) { 3872 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 3873 } 3874 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 3875 } 3876 function getExpandedPlacements(placement) { 3877 const oppositePlacement = getOppositePlacement(placement); 3878 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 3879 } 3880 function getOppositeAlignmentPlacement(placement) { 3881 return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start"); 3882 } 3883 var lrPlacement = ["left", "right"]; 3884 var rlPlacement = ["right", "left"]; 3885 var tbPlacement = ["top", "bottom"]; 3886 var btPlacement = ["bottom", "top"]; 3887 function getSideList(side, isStart, rtl) { 3888 switch (side) { 3889 case "top": 3890 case "bottom": 3891 if (rtl) return isStart ? rlPlacement : lrPlacement; 3892 return isStart ? lrPlacement : rlPlacement; 3893 case "left": 3894 case "right": 3895 return isStart ? tbPlacement : btPlacement; 3896 default: 3897 return []; 3898 } 3899 } 3900 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 3901 const alignment = getAlignment(placement); 3902 let list = getSideList(getSide(placement), direction === "start", rtl); 3903 if (alignment) { 3904 list = list.map((side) => side + "-" + alignment); 3905 if (flipAlignment) { 3906 list = list.concat(list.map(getOppositeAlignmentPlacement)); 3907 } 3908 } 3909 return list; 3910 } 3911 function getOppositePlacement(placement) { 3912 const side = getSide(placement); 3913 return oppositeSideMap[side] + placement.slice(side.length); 3914 } 3915 function expandPaddingObject(padding) { 3916 var _padding$top, _padding$right, _padding$bottom, _padding$left; 3917 return { 3918 top: (_padding$top = padding.top) != null ? _padding$top : 0, 3919 right: (_padding$right = padding.right) != null ? _padding$right : 0, 3920 bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0, 3921 left: (_padding$left = padding.left) != null ? _padding$left : 0 3922 }; 3923 } 3924 function getPaddingObject(padding) { 3925 return typeof padding !== "number" ? expandPaddingObject(padding) : { 3926 top: padding, 3927 right: padding, 3928 bottom: padding, 3929 left: padding 3930 }; 3931 } 3932 function rectToClientRect(rect) { 3933 const { 3934 x, 3935 y, 3936 width, 3937 height 3938 } = rect; 3939 return { 3940 width, 3941 height, 3942 top: y, 3943 left: x, 3944 right: x + width, 3945 bottom: y + height, 3946 x, 3947 y 3948 }; 3949 } 3950 3951 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs 3952 function isHiddenByStyles(styles) { 3953 return styles.visibility === "hidden" || styles.visibility === "collapse"; 3954 } 3955 function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { 3956 if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { 3957 return false; 3958 } 3959 if (typeof element.checkVisibility === "function") { 3960 return element.checkVisibility(); 3961 } 3962 return styles.display !== "none" && styles.display !== "contents"; 3963 } 3964 3965 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs 3966 var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]'; 3967 function getParentElement(element) { 3968 const assignedSlot = element.assignedSlot; 3969 if (assignedSlot) { 3970 return assignedSlot; 3971 } 3972 if (element.parentElement) { 3973 return element.parentElement; 3974 } 3975 const rootNode = element.getRootNode(); 3976 return isShadowRoot(rootNode) ? rootNode.host : null; 3977 } 3978 function getDetailsSummary(details) { 3979 for (const child of Array.from(details.children)) { 3980 if (getNodeName(child) === "summary") { 3981 return child; 3982 } 3983 } 3984 return null; 3985 } 3986 function isWithinOpenDetailsSummary(element, details) { 3987 const summary = getDetailsSummary(details); 3988 return !!summary && (element === summary || contains(summary, element)); 3989 } 3990 function isFocusableCandidate(element) { 3991 const nodeName = element ? getNodeName(element) : ""; 3992 return element != null && element.matches(CANDIDATE_SELECTOR) && (nodeName !== "summary" || element.parentElement != null && getNodeName(element.parentElement) === "details" && getDetailsSummary(element.parentElement) === element) && (nodeName !== "details" || getDetailsSummary(element) == null) && (nodeName !== "input" || element.type !== "hidden"); 3993 } 3994 function isFocusableElement(element) { 3995 if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) { 3996 return false; 3997 } 3998 for (let current = element; current; current = getParentElement(current)) { 3999 const isAncestor = current !== element; 4000 const isSlot = getNodeName(current) === "slot"; 4001 if (current.hasAttribute("inert")) { 4002 return false; 4003 } 4004 if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) { 4005 return false; 4006 } 4007 } 4008 return true; 4009 } 4010 function isVisibleInTabbableTree(element, isAncestor) { 4011 const styles = getComputedStyle2(element); 4012 if (!isAncestor) { 4013 return isElementVisible(element, styles); 4014 } 4015 return styles.display !== "none"; 4016 } 4017 function getTabIndex(element) { 4018 const tabIndex = element.tabIndex; 4019 if (tabIndex < 0) { 4020 const nodeName = getNodeName(element); 4021 if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) { 4022 return 0; 4023 } 4024 } 4025 return tabIndex; 4026 } 4027 function getNamedRadioInput(element) { 4028 if (getNodeName(element) !== "input") { 4029 return null; 4030 } 4031 const input = element; 4032 return input.type === "radio" && input.name !== "" ? input : null; 4033 } 4034 function isTabbableRadio(element, candidates) { 4035 const input = getNamedRadioInput(element); 4036 if (!input) { 4037 return true; 4038 } 4039 const checkedRadio = candidates.find((candidate) => { 4040 const radio = getNamedRadioInput(candidate); 4041 return radio?.name === input.name && radio.form === input.form && radio.checked; 4042 }); 4043 if (checkedRadio) { 4044 return checkedRadio === input; 4045 } 4046 return candidates.find((candidate) => { 4047 const radio = getNamedRadioInput(candidate); 4048 return radio?.name === input.name && radio.form === input.form; 4049 }) === input; 4050 } 4051 function getComposedChildren(container) { 4052 if (isHTMLElement(container) && getNodeName(container) === "slot") { 4053 const assignedElements = container.assignedElements({ 4054 flatten: true 4055 }); 4056 if (assignedElements.length > 0) { 4057 return assignedElements; 4058 } 4059 } 4060 if (isHTMLElement(container) && container.shadowRoot) { 4061 return Array.from(container.shadowRoot.children); 4062 } 4063 return Array.from(container.children); 4064 } 4065 function appendCandidates(container, list) { 4066 getComposedChildren(container).forEach((child) => { 4067 if (isFocusableCandidate(child)) { 4068 list.push(child); 4069 } 4070 appendCandidates(child, list); 4071 }); 4072 } 4073 function appendMatchingElements(container, selector, list) { 4074 getComposedChildren(container).forEach((child) => { 4075 if (isHTMLElement(child) && child.matches(selector)) { 4076 list.push(child); 4077 } 4078 appendMatchingElements(child, selector, list); 4079 }); 4080 } 4081 function focusable(container) { 4082 const candidates = []; 4083 appendCandidates(container, candidates); 4084 return candidates.filter(isFocusableElement); 4085 } 4086 function tabbable(container) { 4087 const candidates = focusable(container); 4088 return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates)); 4089 } 4090 function getTabbableIn(container, dir) { 4091 const list = tabbable(container); 4092 const len = list.length; 4093 if (len === 0) { 4094 return void 0; 4095 } 4096 const active = activeElement(ownerDocument(container)); 4097 const index2 = list.indexOf(active); 4098 const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; 4099 return list[nextIndex]; 4100 } 4101 function getNextTabbable(referenceElement) { 4102 return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement; 4103 } 4104 function getPreviousTabbable(referenceElement) { 4105 return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement; 4106 } 4107 function isOutsideEvent(event, container) { 4108 const containerElement = container || event.currentTarget; 4109 const relatedTarget = event.relatedTarget; 4110 return !relatedTarget || !contains(containerElement, relatedTarget); 4111 } 4112 function disableFocusInside(container) { 4113 const tabbableElements = tabbable(container); 4114 tabbableElements.forEach((element) => { 4115 element.dataset.tabindex = element.getAttribute("tabindex") || ""; 4116 element.setAttribute("tabindex", "-1"); 4117 }); 4118 } 4119 function enableFocusInside(container) { 4120 const elements = []; 4121 appendMatchingElements(container, "[data-tabindex]", elements); 4122 elements.forEach((element) => { 4123 const tabindex = element.dataset.tabindex; 4124 delete element.dataset.tabindex; 4125 if (tabindex) { 4126 element.setAttribute("tabindex", tabindex); 4127 } else { 4128 element.removeAttribute("tabindex"); 4129 } 4130 }); 4131 } 4132 4133 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs 4134 function getNodeChildren(nodes, id, onlyOpenChildren = true) { 4135 const directChildren = nodes.filter((node) => node.parentId === id); 4136 return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); 4137 } 4138 4139 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs 4140 function createAttribute(name2) { 4141 return `data-base-ui-$name2}`; 4142 } 4143 4144 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs 4145 var React21 = __toESM(require_react(), 1); 4146 var ReactDOM2 = __toESM(require_react_dom(), 1); 4147 4148 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/constants.mjs 4149 var DISABLED_TRANSITIONS_STYLE = { 4150 style: { 4151 transition: "none" 4152 } 4153 }; 4154 var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; 4155 var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; 4156 var BASE_UI_SWIPE_IGNORE_SELECTOR = `[$BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; 4157 var LEGACY_SWIPE_IGNORE_SELECTOR = `[$LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; 4158 var POPUP_COLLISION_AVOIDANCE = { 4159 fallbackAxisSide: "end" 4160 }; 4161 var ownerVisuallyHidden = { 4162 clipPath: "inset(50%)", 4163 position: "fixed", 4164 top: 0, 4165 left: 0 4166 }; 4167 4168 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs 4169 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); 4170 var PortalContext = /* @__PURE__ */ React21.createContext(null); 4171 if (true) PortalContext.displayName = "PortalContext"; 4172 var usePortalContext = () => React21.useContext(PortalContext); 4173 var attr = createAttribute("portal"); 4174 function useFloatingPortalNode(props = {}) { 4175 const { 4176 ref, 4177 container: containerProp, 4178 componentProps = EMPTY_OBJECT, 4179 elementProps 4180 } = props; 4181 const uniqueId = useId(); 4182 const portalContext = usePortalContext(); 4183 const parentPortalNode = portalContext?.portalNode; 4184 const [containerElement, setContainerElement] = React21.useState(null); 4185 const [portalNode, setPortalNode] = React21.useState(null); 4186 const setPortalNodeRef = useStableCallback((node) => { 4187 if (node !== null) { 4188 setPortalNode(node); 4189 } 4190 }); 4191 const containerRef = React21.useRef(null); 4192 useIsoLayoutEffect(() => { 4193 if (containerProp === null) { 4194 if (containerRef.current) { 4195 containerRef.current = null; 4196 setPortalNode(null); 4197 setContainerElement(null); 4198 } 4199 return; 4200 } 4201 const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body; 4202 if (resolvedContainer == null) { 4203 if (containerRef.current) { 4204 containerRef.current = null; 4205 setPortalNode(null); 4206 setContainerElement(null); 4207 } 4208 return; 4209 } 4210 if (containerRef.current !== resolvedContainer) { 4211 containerRef.current = resolvedContainer; 4212 setPortalNode(null); 4213 setContainerElement(resolvedContainer); 4214 } 4215 }, [containerProp, parentPortalNode]); 4216 const portalElement = useRenderElement("div", componentProps, { 4217 ref: [ref, setPortalNodeRef], 4218 props: [{ 4219 id: uniqueId, 4220 [attr]: "" 4221 }, elementProps] 4222 }); 4223 const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; 4224 return { 4225 node: portalNode, 4226 // `id` and `render` props can override or remove the generated ID. Use the exact 4227 // rendered value so `aria-owns` never points at an ID absent from the DOM. 4228 nodeId: /* @__PURE__ */ React21.isValidElement(portalElement) ? portalElement.props.id : void 0, 4229 subtree: portalSubtree 4230 }; 4231 } 4232 var FloatingPortal = /* @__PURE__ */ React21.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { 4233 const { 4234 render, 4235 className, 4236 style, 4237 children, 4238 container, 4239 portalOwnerRole, 4240 ...elementProps 4241 } = componentProps; 4242 const { 4243 node: portalNode, 4244 nodeId: portalNodeId, 4245 subtree: portalSubtree 4246 } = useFloatingPortalNode({ 4247 container, 4248 ref: forwardedRef, 4249 componentProps, 4250 elementProps 4251 }); 4252 const beforeOutsideRef = React21.useRef(null); 4253 const afterOutsideRef = React21.useRef(null); 4254 const beforeInsideRef = React21.useRef(null); 4255 const afterInsideRef = React21.useRef(null); 4256 const [focusManagerState, setFocusManagerState] = React21.useState(null); 4257 const focusInsideDisabledRef = React21.useRef(false); 4258 const modal = focusManagerState?.modal; 4259 const open3 = focusManagerState?.open; 4260 const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; 4261 React21.useEffect(() => { 4262 if (!portalNode || modal) { 4263 return void 0; 4264 } 4265 function onFocus(event) { 4266 if (portalNode && event.relatedTarget && isOutsideEvent(event)) { 4267 if (event.type === "focusin") { 4268 if (focusInsideDisabledRef.current) { 4269 enableFocusInside(portalNode); 4270 focusInsideDisabledRef.current = false; 4271 } 4272 } else { 4273 disableFocusInside(portalNode); 4274 focusInsideDisabledRef.current = true; 4275 } 4276 } 4277 } 4278 return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); 4279 }, [portalNode, modal]); 4280 useIsoLayoutEffect(() => { 4281 if (!portalNode || open3 !== true || !focusInsideDisabledRef.current) { 4282 return; 4283 } 4284 enableFocusInside(portalNode); 4285 focusInsideDisabledRef.current = false; 4286 }, [open3, portalNode]); 4287 const portalContextValue = React21.useMemo(() => ({ 4288 beforeOutsideRef, 4289 afterOutsideRef, 4290 beforeInsideRef, 4291 afterInsideRef, 4292 portalNode, 4293 setFocusManagerState 4294 }), [portalNode]); 4295 return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(React21.Fragment, { 4296 children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(PortalContext.Provider, { 4297 value: portalContextValue, 4298 children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FocusGuard, { 4299 "data-type": "outside", 4300 ref: beforeOutsideRef, 4301 onFocus: (event) => { 4302 if (isOutsideEvent(event, portalNode)) { 4303 beforeInsideRef.current?.focus(); 4304 } else { 4305 const domReference = focusManagerState ? focusManagerState.domReference : null; 4306 const prevTabbable = getPreviousTabbable(domReference); 4307 prevTabbable?.focus(); 4308 } 4309 } 4310 }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)("span", { 4311 role: portalOwnerRole, 4312 "aria-owns": portalNodeId, 4313 style: ownerVisuallyHidden 4314 }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(FocusGuard, { 4315 "data-type": "outside", 4316 ref: afterOutsideRef, 4317 onFocus: (event) => { 4318 if (isOutsideEvent(event, portalNode)) { 4319 afterInsideRef.current?.focus(); 4320 } else { 4321 const domReference = focusManagerState ? focusManagerState.domReference : null; 4322 const nextTabbable = getNextTabbable(domReference); 4323 nextTabbable?.focus(); 4324 if (focusManagerState?.closeOnFocusOut) { 4325 focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent)); 4326 } 4327 } 4328 } 4329 })] 4330 })] 4331 }); 4332 }); 4333 if (true) FloatingPortal.displayName = "FloatingPortal"; 4334 4335 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs 4336 var React22 = __toESM(require_react(), 1); 4337 4338 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs 4339 function createEventEmitter() { 4340 const map = /* @__PURE__ */ new Map(); 4341 return { 4342 emit(event, data) { 4343 map.get(event)?.forEach((listener) => listener(data)); 4344 }, 4345 on(event, listener) { 4346 if (!map.has(event)) { 4347 map.set(event, /* @__PURE__ */ new Set()); 4348 } 4349 map.get(event).add(listener); 4350 }, 4351 off(event, listener) { 4352 map.get(event)?.delete(listener); 4353 } 4354 }; 4355 } 4356 4357 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs 4358 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); 4359 var FloatingNodeContext = /* @__PURE__ */ React22.createContext(null); 4360 if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; 4361 var FloatingTreeContext = /* @__PURE__ */ React22.createContext(null); 4362 if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; 4363 var useFloatingParentNodeId = () => React22.useContext(FloatingNodeContext)?.id || null; 4364 var useFloatingTree = (externalTree) => { 4365 const contextTree = React22.useContext(FloatingTreeContext); 4366 return externalTree ?? contextTree; 4367 }; 4368 4369 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs 4370 var React23 = __toESM(require_react(), 1); 4371 function createVirtualElement(domElement, data) { 4372 let offsetX = null; 4373 let offsetY = null; 4374 let isAutoUpdateEvent = false; 4375 return { 4376 contextElement: domElement || void 0, 4377 getBoundingClientRect() { 4378 const domRect = domElement?.getBoundingClientRect() || { 4379 width: 0, 4380 height: 0, 4381 x: 0, 4382 y: 0 4383 }; 4384 const isXAxis = data.axis === "x" || data.axis === "both"; 4385 const isYAxis = data.axis === "y" || data.axis === "both"; 4386 const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch"; 4387 const width = data.axis === "y" ? domRect.width : 0; 4388 const height = data.axis === "x" ? domRect.height : 0; 4389 let x = domRect.x; 4390 let y = domRect.y; 4391 if (offsetX == null && data.x && isXAxis) { 4392 offsetX = domRect.x - data.x; 4393 } 4394 if (offsetY == null && data.y && isYAxis) { 4395 offsetY = domRect.y - data.y; 4396 } 4397 x -= offsetX || 0; 4398 y -= offsetY || 0; 4399 if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { 4400 x = isXAxis && data.x != null ? data.x : x; 4401 y = isYAxis && data.y != null ? data.y : y; 4402 } 4403 isAutoUpdateEvent = true; 4404 return { 4405 width, 4406 height, 4407 x, 4408 y, 4409 top: y, 4410 right: x + width, 4411 bottom: y + height, 4412 left: x 4413 }; 4414 } 4415 }; 4416 } 4417 function isMouseBasedEvent(event) { 4418 return event != null && event.clientX != null; 4419 } 4420 function useClientPoint(store3, props = {}) { 4421 const { 4422 enabled = true, 4423 axis = "both" 4424 } = props; 4425 const open3 = store3.useState("open"); 4426 const floating = store3.useState("floatingElement"); 4427 const domReference = store3.useState("domReferenceElement"); 4428 const dataRef = store3.context.dataRef; 4429 const initialRef = React23.useRef(false); 4430 const cleanupListenerRef = React23.useRef(null); 4431 const [pointerType, setPointerType] = React23.useState(); 4432 const [reactive, setReactive] = React23.useState([]); 4433 const resetReference = useStableCallback((reference2) => { 4434 store3.set("positionReference", reference2); 4435 }); 4436 const setReference = useStableCallback((newX, newY, referenceElement) => { 4437 if (initialRef.current) { 4438 return; 4439 } 4440 if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) { 4441 return; 4442 } 4443 store3.set("positionReference", createVirtualElement(referenceElement ?? domReference, { 4444 x: newX, 4445 y: newY, 4446 axis, 4447 dataRef, 4448 pointerType 4449 })); 4450 }); 4451 const handleReferenceEnterOrMove = useStableCallback((event) => { 4452 if (!open3) { 4453 setReference(event.clientX, event.clientY, event.currentTarget); 4454 } else if (!cleanupListenerRef.current) { 4455 setReference(event.clientX, event.clientY, event.currentTarget); 4456 setReactive([]); 4457 } 4458 }); 4459 const openCheck = isMouseLikePointerType(pointerType) ? floating : open3; 4460 React23.useEffect(() => { 4461 if (!enabled) { 4462 resetReference(domReference); 4463 return void 0; 4464 } 4465 if (!openCheck) { 4466 return void 0; 4467 } 4468 function cleanupListener() { 4469 cleanupListenerRef.current?.(); 4470 cleanupListenerRef.current = null; 4471 } 4472 const win = getWindow(floating); 4473 function handleMouseMove(event) { 4474 const target = getTarget(event); 4475 if (!contains(floating, target)) { 4476 setReference(event.clientX, event.clientY); 4477 } else { 4478 cleanupListener(); 4479 } 4480 } 4481 if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) { 4482 cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove); 4483 } else { 4484 resetReference(domReference); 4485 } 4486 return cleanupListener; 4487 }, [openCheck, enabled, floating, dataRef, domReference, store3, setReference, resetReference, reactive]); 4488 React23.useEffect(() => () => { 4489 store3.set("positionReference", null); 4490 }, [store3]); 4491 React23.useEffect(() => { 4492 if (enabled && !floating) { 4493 initialRef.current = false; 4494 } 4495 }, [enabled, floating]); 4496 React23.useEffect(() => { 4497 if (!enabled && open3) { 4498 initialRef.current = true; 4499 } 4500 }, [enabled, open3]); 4501 const reference = React23.useMemo(() => { 4502 function setPointerTypeRef(event) { 4503 setPointerType(event.pointerType); 4504 } 4505 return { 4506 onPointerDown: setPointerTypeRef, 4507 onPointerEnter: setPointerTypeRef, 4508 onMouseMove: handleReferenceEnterOrMove, 4509 onMouseEnter: handleReferenceEnterOrMove 4510 }; 4511 }, [handleReferenceEnterOrMove]); 4512 return React23.useMemo(() => enabled ? { 4513 reference, 4514 trigger: reference 4515 } : {}, [enabled, reference]); 4516 } 4517 4518 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs 4519 var React24 = __toESM(require_react(), 1); 4520 function alwaysFalse() { 4521 return false; 4522 } 4523 function normalizeProp(normalizable) { 4524 return { 4525 escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false, 4526 outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true 4527 }; 4528 } 4529 function useDismiss(store3, props = {}) { 4530 const { 4531 enabled = true, 4532 escapeKey: escapeKey2 = true, 4533 outsidePress: outsidePressProp = true, 4534 outsidePressEvent = "sloppy", 4535 referencePress = alwaysFalse, 4536 bubbles, 4537 externalTree 4538 } = props; 4539 const open3 = store3.useState("open"); 4540 const floatingElement = store3.useState("floatingElement"); 4541 const { 4542 dataRef, 4543 events 4544 } = store3.context; 4545 const tree = useFloatingTree(externalTree); 4546 const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); 4547 const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; 4548 const outsidePressEnabled = outsidePress2 !== false; 4549 const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent); 4550 const { 4551 escapeKey: escapeKeyBubbles, 4552 outsidePress: outsidePressBubbles 4553 } = normalizeProp(bubbles); 4554 const pressStartedInsideRef = React24.useRef(false); 4555 const pressStartPreventedRef = React24.useRef(false); 4556 const suppressNextOutsideClickRef = React24.useRef(false); 4557 const sawPressWhileOpenRef = React24.useRef(false); 4558 const isComposingRef = React24.useRef(false); 4559 const currentPointerTypeRef = React24.useRef(""); 4560 const touchStateRef = React24.useRef(null); 4561 const cancelDismissOnEndTimeout = useTimeout(); 4562 const clearInsideReactTreeTimeout = useTimeout(); 4563 const compositionTimeout = useTimeout(); 4564 const clearInsideReactTree = useStableCallback(() => { 4565 clearInsideReactTreeTimeout.clear(); 4566 dataRef.current.insideReactTree = false; 4567 }); 4568 const hasBlockingChild = useStableCallback((bubbleKey) => { 4569 const nodeId = dataRef.current.floatingContext?.nodeId; 4570 const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []; 4571 return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]); 4572 }); 4573 const isEventWithinOwnElements = useStableCallback((event) => { 4574 return isEventTargetWithin(event, store3.select("floatingElement")) || isEventTargetWithin(event, store3.select("domReferenceElement")); 4575 }); 4576 const closeOnReferencePress = useStableCallback((event) => { 4577 if (!referencePress()) { 4578 return; 4579 } 4580 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); 4581 }); 4582 const closeOnEscapeKeyDown = useStableCallback((event) => { 4583 if (!open3 || !enabled || !escapeKey2 || event.key !== "Escape") { 4584 return; 4585 } 4586 const native = isReactEvent(event) ? event.nativeEvent : event; 4587 if (isComposingRef.current || native.isComposing) { 4588 return; 4589 } 4590 if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) { 4591 return; 4592 } 4593 const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native); 4594 store3.setOpen(false, eventDetails); 4595 if (!eventDetails.isCanceled) { 4596 event.preventDefault(); 4597 } 4598 if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) { 4599 event.stopPropagation(); 4600 } 4601 }); 4602 const markInsideReactTree = useStableCallback(() => { 4603 dataRef.current.insideReactTree = true; 4604 clearInsideReactTreeTimeout.start(0, clearInsideReactTree); 4605 }); 4606 const markPressStartedInsideReactTree = useStableCallback((event) => { 4607 if (!open3 || !enabled || event.button !== 0) { 4608 return; 4609 } 4610 const target = getTarget(event.nativeEvent); 4611 if (!contains(store3.select("floatingElement"), target)) { 4612 return; 4613 } 4614 if (!pressStartedInsideRef.current) { 4615 pressStartedInsideRef.current = true; 4616 pressStartPreventedRef.current = false; 4617 } 4618 }); 4619 const markInsidePressStartPrevented = useStableCallback((event) => { 4620 if (!open3 || !enabled) { 4621 return; 4622 } 4623 if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { 4624 return; 4625 } 4626 if (pressStartedInsideRef.current) { 4627 pressStartPreventedRef.current = true; 4628 } 4629 }); 4630 React24.useEffect(() => { 4631 function handleOpenChange(details) { 4632 if (!details.open) { 4633 sawPressWhileOpenRef.current = false; 4634 } 4635 } 4636 events.on("openchange", handleOpenChange); 4637 return () => { 4638 events.off("openchange", handleOpenChange); 4639 }; 4640 }, [events]); 4641 React24.useEffect(() => clearInsideReactTree, [clearInsideReactTree]); 4642 React24.useEffect(() => { 4643 if (!open3 || !enabled) { 4644 if (!open3) { 4645 sawPressWhileOpenRef.current = false; 4646 isComposingRef.current = false; 4647 currentPointerTypeRef.current = ""; 4648 touchStateRef.current = null; 4649 } 4650 return clearInsideReactTree; 4651 } 4652 dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; 4653 dataRef.current.__outsidePressBubbles = outsidePressBubbles; 4654 const preventedPressSuppressionTimeout = new Timeout(); 4655 const doc = ownerDocument(floatingElement); 4656 function handleCompositionStart() { 4657 compositionTimeout.clear(); 4658 isComposingRef.current = true; 4659 } 4660 function handleCompositionEnd() { 4661 isComposingRef.current = true; 4662 compositionTimeout.start( 4663 // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. 4664 // Only apply to WebKit for the test to remain 0ms. 4665 parts_exports.engine.webkit ? 5 : 0, 4666 () => { 4667 isComposingRef.current = false; 4668 } 4669 ); 4670 } 4671 function suppressImmediateOutsideClickAfterPreventedStart() { 4672 suppressNextOutsideClickRef.current = true; 4673 preventedPressSuppressionTimeout.start(0, () => { 4674 suppressNextOutsideClickRef.current = false; 4675 }); 4676 } 4677 function resetPressStartState() { 4678 pressStartedInsideRef.current = false; 4679 pressStartPreventedRef.current = false; 4680 } 4681 function getOutsidePressEvent() { 4682 const type = currentPointerTypeRef.current; 4683 const computedType = type === "pen" || !type ? "mouse" : type; 4684 const outsidePressEventValue = getOutsidePressEventProp(); 4685 const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue; 4686 if (typeof resolved === "string") { 4687 return resolved; 4688 } 4689 return resolved[computedType]; 4690 } 4691 function shouldIgnoreEvent(event) { 4692 const computedOutsidePressEvent = getOutsidePressEvent(); 4693 return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click"; 4694 } 4695 function isEventWithinFloatingTree(event) { 4696 const nodeId = dataRef.current.floatingContext?.nodeId; 4697 const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating)); 4698 return isEventWithinOwnElements(event) || targetIsInsideChildren; 4699 } 4700 function closeOnPressOutside(event) { 4701 if (shouldIgnoreEvent(event)) { 4702 if (event.type !== "click" && !isEventWithinOwnElements(event)) { 4703 preventedPressSuppressionTimeout.clear(); 4704 suppressNextOutsideClickRef.current = false; 4705 } 4706 clearInsideReactTree(); 4707 return; 4708 } 4709 if (dataRef.current.insideReactTree) { 4710 clearInsideReactTree(); 4711 return; 4712 } 4713 const target = getTarget(event); 4714 const inertSelector = `[$createAttribute("inert")}]`; 4715 const targetRoot = isElement(target) ? target.getRootNode() : null; 4716 const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store3.select("floatingElement"))).querySelectorAll(inertSelector)); 4717 const triggers = store3.context.triggerElements; 4718 if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) { 4719 return; 4720 } 4721 let targetRootAncestor = isElement(target) ? target : null; 4722 while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { 4723 const nextParent = getParentNode(targetRootAncestor); 4724 if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { 4725 break; 4726 } 4727 targetRootAncestor = nextParent; 4728 } 4729 if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). 4730 !contains(target, store3.select("floatingElement")) && // If the target root element contains none of the markers, then the 4731 // element was injected after the floating element rendered. 4732 markers.every((marker) => !contains(targetRootAncestor, marker))) { 4733 return; 4734 } 4735 if (isHTMLElement(target) && !("touches" in event)) { 4736 const lastTraversableNode = isLastTraversableNode(target); 4737 const style = getComputedStyle2(target); 4738 const scrollRe = /auto|scroll/; 4739 const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); 4740 const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); 4741 const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; 4742 const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; 4743 const isRTL6 = style.direction === "rtl"; 4744 const pressedVerticalScrollbar = canScrollY && (isRTL6 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); 4745 const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; 4746 if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { 4747 return; 4748 } 4749 } 4750 if (isEventWithinFloatingTree(event)) { 4751 return; 4752 } 4753 if (getOutsidePressEvent() === "intentional") { 4754 if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) { 4755 return; 4756 } 4757 if (suppressNextOutsideClickRef.current) { 4758 preventedPressSuppressionTimeout.clear(); 4759 suppressNextOutsideClickRef.current = false; 4760 return; 4761 } 4762 } 4763 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 4764 return; 4765 } 4766 if (hasBlockingChild("__outsidePressBubbles")) { 4767 return; 4768 } 4769 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event)); 4770 clearInsideReactTree(); 4771 } 4772 function handlePointerDown(event) { 4773 if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store3.select("open") || !enabled || isEventWithinOwnElements(event)) { 4774 return; 4775 } 4776 closeOnPressOutside(event); 4777 } 4778 function handleTouchStart(event) { 4779 if (getOutsidePressEvent() !== "sloppy" || !store3.select("open") || !enabled || isEventWithinOwnElements(event)) { 4780 return; 4781 } 4782 const touch = event.touches[0]; 4783 if (touch) { 4784 touchStateRef.current = { 4785 startTime: Date.now(), 4786 startX: touch.clientX, 4787 startY: touch.clientY, 4788 dismissOnTouchEnd: false, 4789 dismissOnMouseDown: true 4790 }; 4791 cancelDismissOnEndTimeout.start(1e3, () => { 4792 if (touchStateRef.current) { 4793 touchStateRef.current.dismissOnTouchEnd = false; 4794 touchStateRef.current.dismissOnMouseDown = false; 4795 } 4796 }); 4797 } 4798 } 4799 function addTargetEventListenerOnce(event, listener) { 4800 const target = getTarget(event); 4801 if (!target) { 4802 return; 4803 } 4804 const unsubscribe2 = addEventListener(target, event.type, () => { 4805 listener(event); 4806 unsubscribe2(); 4807 }); 4808 } 4809 function handleTouchStartCapture(event) { 4810 currentPointerTypeRef.current = "touch"; 4811 addTargetEventListenerOnce(event, handleTouchStart); 4812 } 4813 function closeOnPressOutsideCapture(event) { 4814 cancelDismissOnEndTimeout.clear(); 4815 if (event.type === "pointerdown") { 4816 if (event.button === 0) { 4817 sawPressWhileOpenRef.current = true; 4818 } 4819 currentPointerTypeRef.current = event.pointerType; 4820 } 4821 if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { 4822 return; 4823 } 4824 addTargetEventListenerOnce(event, (targetEvent) => { 4825 if (targetEvent.type === "pointerdown") { 4826 handlePointerDown(targetEvent); 4827 } else { 4828 closeOnPressOutside(targetEvent); 4829 } 4830 }); 4831 } 4832 function handlePressEndCapture(event) { 4833 if (event.type === "pointercancel") { 4834 sawPressWhileOpenRef.current = false; 4835 } 4836 if (!pressStartedInsideRef.current) { 4837 return; 4838 } 4839 const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; 4840 resetPressStartState(); 4841 if (getOutsidePressEvent() !== "intentional") { 4842 return; 4843 } 4844 if (event.type === "pointercancel") { 4845 if (pressStartedInsideDefaultPrevented) { 4846 suppressImmediateOutsideClickAfterPreventedStart(); 4847 } 4848 return; 4849 } 4850 if (isEventWithinFloatingTree(event)) { 4851 return; 4852 } 4853 if (pressStartedInsideDefaultPrevented) { 4854 suppressImmediateOutsideClickAfterPreventedStart(); 4855 return; 4856 } 4857 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 4858 return; 4859 } 4860 preventedPressSuppressionTimeout.clear(); 4861 suppressNextOutsideClickRef.current = true; 4862 clearInsideReactTree(); 4863 } 4864 function handleTouchMove(event) { 4865 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 4866 return; 4867 } 4868 const touch = event.touches[0]; 4869 if (!touch) { 4870 return; 4871 } 4872 const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX); 4873 const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY); 4874 const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); 4875 if (distance > 5) { 4876 touchStateRef.current.dismissOnTouchEnd = true; 4877 } 4878 if (distance > 10) { 4879 closeOnPressOutside(event); 4880 cancelDismissOnEndTimeout.clear(); 4881 touchStateRef.current = null; 4882 } 4883 } 4884 function handleTouchMoveCapture(event) { 4885 addTargetEventListenerOnce(event, handleTouchMove); 4886 } 4887 function handleTouchEnd(event) { 4888 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 4889 return; 4890 } 4891 if (touchStateRef.current.dismissOnTouchEnd) { 4892 closeOnPressOutside(event); 4893 } 4894 cancelDismissOnEndTimeout.clear(); 4895 touchStateRef.current = null; 4896 } 4897 function handleTouchEndCapture(event) { 4898 addTargetEventListenerOnce(event, handleTouchEnd); 4899 } 4900 const unsubscribe = mergeCleanups(escapeKey2 && mergeCleanups(addEventListener(doc, "keydown", closeOnEscapeKeyDown), addEventListener(doc, "compositionstart", handleCompositionStart), addEventListener(doc, "compositionend", handleCompositionEnd)), outsidePressEnabled && mergeCleanups(addEventListener(doc, "click", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerdown", closeOnPressOutsideCapture, true), addEventListener(doc, "pointerup", handlePressEndCapture, true), addEventListener(doc, "pointercancel", handlePressEndCapture, true), addEventListener(doc, "mousedown", closeOnPressOutsideCapture, true), addEventListener(doc, "mouseup", handlePressEndCapture, true), addEventListener(doc, "touchstart", handleTouchStartCapture, { 4901 capture: true, 4902 passive: true 4903 }), addEventListener(doc, "touchmove", handleTouchMoveCapture, { 4904 capture: true, 4905 passive: true 4906 }), addEventListener(doc, "touchend", handleTouchEndCapture, { 4907 capture: true, 4908 passive: true 4909 }))); 4910 return () => { 4911 unsubscribe(); 4912 preventedPressSuppressionTimeout.clear(); 4913 resetPressStartState(); 4914 suppressNextOutsideClickRef.current = false; 4915 }; 4916 }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open3, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store3, cancelDismissOnEndTimeout, compositionTimeout]); 4917 const reference = React24.useMemo(() => ({ 4918 onKeyDown: closeOnEscapeKeyDown, 4919 onPointerDown: closeOnReferencePress, 4920 onClick: closeOnReferencePress 4921 }), [closeOnEscapeKeyDown, closeOnReferencePress]); 4922 const floating = React24.useMemo(() => ({ 4923 onKeyDown: closeOnEscapeKeyDown, 4924 // `onMouseDown` may be blocked if `event.preventDefault()` is called in 4925 // `onPointerDown`, such as with <NumberField.ScrubArea>. 4926 // See https://github.com/mui/base-ui/pull/3379 4927 onPointerDown: markInsidePressStartPrevented, 4928 onMouseDown: markInsidePressStartPrevented, 4929 onClickCapture: markInsideReactTree, 4930 onMouseDownCapture(event) { 4931 markInsideReactTree(); 4932 markPressStartedInsideReactTree(event); 4933 }, 4934 onPointerDownCapture(event) { 4935 markInsideReactTree(); 4936 markPressStartedInsideReactTree(event); 4937 }, 4938 onMouseUpCapture: markInsideReactTree, 4939 onTouchEndCapture: markInsideReactTree, 4940 onTouchMoveCapture: markInsideReactTree 4941 }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); 4942 return React24.useMemo(() => enabled ? { 4943 reference, 4944 floating, 4945 trigger: reference 4946 } : {}, [enabled, reference, floating]); 4947 } 4948 4949 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupHandle.mjs 4950 var BasePopupHandle = class { 4951 /** 4952 * Stores of every root currently using this handle, in attach order. A handle is meant to be used 4953 * by a single mounted root, but roots can transiently overlap (e.g. during an animated route 4954 * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of 4955 * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first. 4956 */ 4957 attachedStores = []; 4958 /** 4959 * Store of the root that currently controls the handle: the most recently attached one still 4960 * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`. 4961 */ 4962 attachedStoreValue = null; 4963 /** 4964 * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer. 4965 */ 4966 storeListeners = /* @__PURE__ */ new Set(); 4967 /** 4968 * Creates a handle backed by the store used while no root is attached. 4969 * 4970 * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached, 4971 * so they can render and register without a mounted root. Triggers register into whichever store 4972 * `store` currently resolves to, so while detached they live in this store's trigger map and 4973 * migrate themselves to the root's store (and back) as it attaches/detaches. 4974 * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces 4975 * `MenuHandle.open()` in warning text. 4976 * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is 4977 * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to, 4978 * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning. 4979 */ 4980 constructor(fallbackStore, componentName, throwOnMissingTrigger = true) { 4981 this.fallbackStore = fallbackStore; 4982 this.componentName = componentName; 4983 this.throwOnMissingTrigger = throwOnMissingTrigger; 4984 } 4985 get attachedStore() { 4986 return this.attachedStoreValue; 4987 } 4988 /** 4989 * Store that detached triggers read from: the attached root's store, or an inert fallback store 4990 * used while no root is attached. 4991 * @internal 4992 */ 4993 get store() { 4994 return this.attachedStoreValue ?? this.fallbackStore; 4995 } 4996 /** 4997 * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on 4998 * the handle during render because a handle can be shared by concurrent server-rendered requests. 4999 * @internal 5000 */ 5001 get serverStore() { 5002 return this.fallbackStore; 5003 } 5004 /** 5005 * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind 5006 * when a root attaches or detaches. Returns a function that removes the listener. 5007 * @internal 5008 */ 5009 subscribeStore(listener) { 5010 this.storeListeners.add(listener); 5011 return () => { 5012 this.storeListeners.delete(listener); 5013 }; 5014 } 5015 /** 5016 * Points the handle at a root's store and notifies subscribers so detached triggers re-render and 5017 * re-register into it (their registration effect migrates them when the store pointer changes). 5018 * Returns a cleanup function that detaches the store again. 5019 * @internal 5020 */ 5021 attachStore(newStore) { 5022 this.attachedStores.push(newStore); 5023 this.setActiveStore(newStore); 5024 if (true) { 5025 if (this.attachedStores.length > 1) { 5026 const dev = this; 5027 (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => { 5028 if (this.attachedStores.length > 1) { 5029 console.warn("Base UI: A handle is attached to more than one mounted root at the same time. The most recently mounted root takes over and the previous one stops being controlled by the handle. A handle should be used by a single root that stays mounted for the lifetime of the handle."); 5030 } 5031 }); 5032 } 5033 } 5034 return () => { 5035 const index2 = this.attachedStores.lastIndexOf(newStore); 5036 if (index2 !== -1) { 5037 this.attachedStores.splice(index2, 1); 5038 } 5039 this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null); 5040 }; 5041 } 5042 /** 5043 * Sets the store that currently controls the handle and notifies subscribers when it changes, so 5044 * detached triggers re-render and migrate their registration to the new store. 5045 */ 5046 setActiveStore(store3) { 5047 if (this.attachedStoreValue !== store3) { 5048 this.attachedStoreValue = store3; 5049 this.storeListeners.forEach((listener) => { 5050 listener(); 5051 }); 5052 } 5053 } 5054 /** 5055 * Opens the attached root's store and associates it with the trigger with the given id, or a 5056 * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public 5057 * `open()` method, which only narrows the parameter type. 5058 * 5059 * When a trigger id is given but no matching trigger is registered, anchored popups throw (see 5060 * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead. 5061 * 5062 * This method should only be called in an event handler or an effect (not during rendering). 5063 * 5064 * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open 5065 * without associating any trigger. 5066 */ 5067 openByTrigger(triggerId) { 5068 const attachedStore = this.attachedStore; 5069 if (attachedStore === null) { 5070 if (true) { 5071 console.warn(`Base UI: $this.componentName}Handle.open() was called while no root using this handle is mounted. The call was ignored; mount a root with this handle before opening it imperatively.`); 5072 } 5073 return; 5074 } 5075 let triggerElement; 5076 if (triggerId) { 5077 for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) { 5078 triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId); 5079 } 5080 triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId); 5081 } 5082 if (triggerId && !triggerElement) { 5083 if (this.throwOnMissingTrigger) { 5084 throw new Error(true ? `Base UI: $this.componentName}Handle.open() was called with the trigger id "$triggerId}", but no matching trigger is registered with this handle. An anchored popup cannot open without a trigger to anchor to. Pass the id of a mounted $this.componentName}.Trigger that has this handle set on its "handle" prop.` : formatErrorMessage_default(99, this.componentName, triggerId, this.componentName)); 5085 } 5086 if (true) { 5087 console.warn(`Base UI: $this.componentName}Handle.open: No trigger found with id "$triggerId}". The popup will open, but the trigger will not be associated with it.`); 5088 } 5089 } 5090 attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); 5091 } 5092 /** 5093 * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning) 5094 * while no root is attached. Shared by every concrete handle's public `close()` method. 5095 * 5096 * This method should only be called in an event handler or an effect (not during rendering). 5097 */ 5098 closePopup() { 5099 const attachedStore = this.attachedStore; 5100 if (attachedStore === null) { 5101 if (true) { 5102 console.warn(`Base UI: $this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`); 5103 } 5104 return; 5105 } 5106 attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); 5107 } 5108 }; 5109 5110 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs 5111 var React26 = __toESM(require_react(), 1); 5112 var ReactDOM3 = __toESM(require_react_dom(), 1); 5113 5114 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs 5115 function useSyncedFloatingRootContext(options) { 5116 const { 5117 popupStore, 5118 treatPopupAsFloatingElement = false, 5119 floatingRootContext: store3, 5120 floatingId, 5121 nested, 5122 onOpenChange 5123 } = options; 5124 const open3 = popupStore.useState("open"); 5125 const referenceElement = popupStore.useState("activeTriggerElement"); 5126 const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); 5127 const handleOpenChange = onOpenChange; 5128 popupStore.useSyncedValue("floatingId", floatingId); 5129 useIsoLayoutEffect(() => { 5130 const valuesToSync = { 5131 open: open3, 5132 floatingId, 5133 referenceElement, 5134 floatingElement 5135 }; 5136 if (isElement(referenceElement)) { 5137 valuesToSync.domReferenceElement = referenceElement; 5138 } 5139 if (store3.state.positionReference === store3.state.referenceElement) { 5140 valuesToSync.positionReference = referenceElement; 5141 } 5142 store3.update(valuesToSync); 5143 }, [open3, floatingId, referenceElement, floatingElement, store3]); 5144 store3.context.onOpenChange = handleOpenChange; 5145 store3.context.nested = nested; 5146 return store3; 5147 } 5148 5149 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs 5150 var React25 = __toESM(require_react(), 1); 5151 function useUnmountAfterClose(parameters) { 5152 const { 5153 open: open3, 5154 ref, 5155 preventUnmountOnClose, 5156 setPreventUnmountOnClose: setPreventUnmountOnCloseParam, 5157 onUnmount, 5158 animateInitialOpen 5159 } = parameters; 5160 const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam); 5161 const { 5162 mounted, 5163 setMounted, 5164 transitionStatus 5165 } = useTransitionStatus(open3, false, false, animateInitialOpen); 5166 const preventUnmountingOnClose = open3 ? false : preventUnmountOnClose; 5167 useIsoLayoutEffect(() => { 5168 if (open3) { 5169 setPreventUnmountOnClose(false); 5170 } 5171 }, [open3, setPreventUnmountOnClose]); 5172 const mountedRef = React25.useRef(mounted); 5173 const pendingUnmountRef = React25.useRef(false); 5174 const rerender = useForcedRerendering(); 5175 const unmount = () => { 5176 mountedRef.current = false; 5177 setMounted(false); 5178 onUnmount(); 5179 }; 5180 useIsoLayoutEffect(() => { 5181 mountedRef.current = mounted; 5182 if (pendingUnmountRef.current) { 5183 pendingUnmountRef.current = false; 5184 if (!open3 && mounted) { 5185 unmount(); 5186 } 5187 } 5188 }); 5189 const forceUnmount = useStableCallback(() => { 5190 if (!mountedRef.current) { 5191 return; 5192 } 5193 if (open3) { 5194 pendingUnmountRef.current = true; 5195 rerender(); 5196 return; 5197 } 5198 unmount(); 5199 }); 5200 useOpenChangeComplete({ 5201 enabled: mounted && !open3 && !preventUnmountingOnClose, 5202 open: open3, 5203 ref, 5204 onComplete() { 5205 if (!open3) { 5206 forceUnmount(); 5207 } 5208 } 5209 }); 5210 return { 5211 mounted, 5212 transitionStatus, 5213 preventUnmountingOnClose, 5214 forceUnmount 5215 }; 5216 } 5217 5218 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs 5219 var FOCUSABLE_POPUP_PROPS = { 5220 tabIndex: -1, 5221 [FOCUSABLE_ATTRIBUTE]: "" 5222 }; 5223 function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) { 5224 const floatingId = useId(); 5225 const nested = useFloatingParentNodeId() != null; 5226 const store3 = useRefWithInit(() => createStore(floatingId, nested)).current; 5227 useSyncedFloatingRootContext({ 5228 popupStore: store3, 5229 treatPopupAsFloatingElement, 5230 floatingRootContext: store3.state.floatingRootContext, 5231 floatingId, 5232 nested, 5233 onOpenChange: store3.setOpen 5234 }); 5235 return store3; 5236 } 5237 function PopupHandleAttachment({ 5238 handle, 5239 store: store3 5240 }) { 5241 useIsoLayoutEffect(() => { 5242 return handle.attachStore(store3); 5243 }, [handle, store3]); 5244 return null; 5245 } 5246 function syncTriggerCount(store3) { 5247 const triggerCount = store3.context.triggerElements.size; 5248 if (store3.select("open") && store3.state.triggerCount !== triggerCount) { 5249 store3.set("triggerCount", triggerCount); 5250 } 5251 } 5252 function useTriggerRegistration(id, store3) { 5253 const registrationRef = React26.useRef(null); 5254 return useStableCallback((element) => { 5255 const registration = registrationRef.current; 5256 if (registration !== null) { 5257 if (registration.element === element && registration.store === store3 && registration.id === id) { 5258 return; 5259 } 5260 registrationRef.current = null; 5261 const registeredStore = registration.store; 5262 if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) { 5263 registeredStore.context.triggerElements.delete(registration.id); 5264 syncTriggerCount(registeredStore); 5265 } 5266 } 5267 if (element !== null && id !== void 0) { 5268 registrationRef.current = { 5269 store: store3, 5270 id, 5271 element 5272 }; 5273 store3.context.triggerElements.add(id, element); 5274 syncTriggerCount(store3); 5275 } 5276 }); 5277 } 5278 function createPopupOpenState(state, open3, trigger, preventUnmountOnClose = false) { 5279 let preventUnmountingOnClose = state.preventUnmountingOnClose; 5280 if (open3) { 5281 preventUnmountingOnClose = false; 5282 } else if (preventUnmountOnClose) { 5283 preventUnmountingOnClose = true; 5284 } 5285 const triggerId = trigger?.id ?? null; 5286 let activeTriggerId = state.activeTriggerId; 5287 let activeTriggerElement = state.activeTriggerElement; 5288 if (triggerId || open3) { 5289 activeTriggerId = triggerId; 5290 activeTriggerElement = trigger ?? null; 5291 } 5292 return { 5293 open: open3, 5294 preventUnmountingOnClose, 5295 activeTriggerId, 5296 activeTriggerElement, 5297 // An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not 5298 // be reassociated with a lone registered trigger later on. Controlled and default opens never 5299 // pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a 5300 // controlled root may decline it and stay open, so the Root clears the flag only once the 5301 // popup is effectively closed. 5302 openedWithoutTrigger: open3 ? trigger == null : state.openedWithoutTrigger 5303 }; 5304 } 5305 function attachPreventUnmountOnClose(eventDetails) { 5306 let preventUnmountOnClose = false; 5307 eventDetails.preventUnmountOnClose = () => { 5308 preventUnmountOnClose = true; 5309 }; 5310 return () => preventUnmountOnClose; 5311 } 5312 function applyPopupOpenChange(store3, nextOpen, eventDetails, options = {}) { 5313 const reason = eventDetails.reason; 5314 const isHover = reason === reason_parts_exports.triggerHover; 5315 const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus; 5316 const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey); 5317 const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails); 5318 store3.context.onOpenChange?.(nextOpen, eventDetails); 5319 if (eventDetails.isCanceled) { 5320 return; 5321 } 5322 options.onBeforeDispatch?.(); 5323 store3.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); 5324 const changeState = () => { 5325 const popupOpenState = createPopupOpenState(store3.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); 5326 const updatedState = { 5327 ...options.extraState, 5328 ...popupOpenState 5329 }; 5330 if (isFocusOpen) { 5331 updatedState.instantType = "focus"; 5332 } else if (isDismissClose) { 5333 updatedState.instantType = "dismiss"; 5334 } else if (isHover) { 5335 updatedState.instantType = void 0; 5336 } 5337 store3.update(updatedState); 5338 }; 5339 if (isHover) { 5340 ReactDOM3.flushSync(changeState); 5341 } else { 5342 changeState(); 5343 } 5344 } 5345 function useTriggerDataForwarding(triggerId, triggerElementRef, store3, stateUpdates) { 5346 const isMountedByThisTrigger = store3.useState("isMountedByTrigger", triggerId); 5347 const baseRegisterTrigger = useTriggerRegistration(triggerId, store3); 5348 const applyTriggerData = useStableCallback((element) => { 5349 const open3 = store3.select("open"); 5350 const activeTriggerId = store3.select("activeTriggerId"); 5351 if (activeTriggerId === triggerId) { 5352 const changes = { 5353 activeTriggerElement: element, 5354 ...open3 ? stateUpdates : null 5355 }; 5356 store3.update(changes); 5357 return; 5358 } 5359 if (activeTriggerId == null && open3 && !store3.state.openedWithoutTrigger) { 5360 const changes = { 5361 activeTriggerId: triggerId ?? null, 5362 activeTriggerElement: element, 5363 ...stateUpdates 5364 }; 5365 store3.update(changes); 5366 } 5367 }); 5368 const registerTrigger = useStableCallback((element) => { 5369 baseRegisterTrigger(element); 5370 if (element) { 5371 applyTriggerData(element); 5372 } 5373 }); 5374 useIsoLayoutEffect(() => { 5375 registerTrigger(triggerElementRef.current); 5376 return () => registerTrigger(null); 5377 }, [registerTrigger, triggerElementRef, store3, triggerId]); 5378 useIsoLayoutEffect(() => { 5379 if (isMountedByThisTrigger) { 5380 const changes = { 5381 activeTriggerElement: triggerElementRef.current, 5382 ...stateUpdates 5383 }; 5384 store3.update(changes); 5385 } 5386 }, [isMountedByThisTrigger, store3, triggerElementRef, ...Object.values(stateUpdates)]); 5387 return { 5388 registerTrigger, 5389 isMountedByThisTrigger 5390 }; 5391 } 5392 function useImplicitActiveTrigger(store3, options = {}) { 5393 const { 5394 closeOnActiveTriggerUnmount = false 5395 } = options; 5396 const resolvedActiveTriggerIdRef = React26.useRef(null); 5397 const open3 = store3.useState("open"); 5398 const reactiveTriggerCount = store3.useState("triggerCount"); 5399 const activeTriggerId = store3.useState("activeTriggerId"); 5400 const reactiveActiveTriggerElement = store3.useState("activeTriggerElement"); 5401 useIsoLayoutEffect(() => { 5402 if (!open3) { 5403 resolvedActiveTriggerIdRef.current = null; 5404 if (store3.state.triggerCount !== 0) { 5405 store3.set("triggerCount", 0); 5406 } 5407 if (store3.state.openedWithoutTrigger) { 5408 store3.set("openedWithoutTrigger", false); 5409 } 5410 return; 5411 } 5412 const triggerCount = store3.context.triggerElements.size; 5413 const stateUpdates = {}; 5414 if (store3.state.triggerCount !== triggerCount) { 5415 stateUpdates.triggerCount = triggerCount; 5416 } 5417 const currentActiveTriggerId = store3.select("activeTriggerId"); 5418 let lostActiveTriggerId = null; 5419 if (currentActiveTriggerId) { 5420 const activeTriggerElement = store3.context.triggerElements.getById(currentActiveTriggerId); 5421 if (!activeTriggerElement) { 5422 for (const [triggerId, triggerElement] of store3.context.triggerElements.entries()) { 5423 if (triggerElement === store3.state.activeTriggerElement) { 5424 stateUpdates.activeTriggerId = triggerId; 5425 stateUpdates.activeTriggerElement = triggerElement; 5426 resolvedActiveTriggerIdRef.current = triggerId; 5427 break; 5428 } 5429 } 5430 if (stateUpdates.activeTriggerId === void 0) { 5431 if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) { 5432 lostActiveTriggerId = currentActiveTriggerId; 5433 } else { 5434 resolvedActiveTriggerIdRef.current = null; 5435 } 5436 } 5437 } else { 5438 resolvedActiveTriggerIdRef.current = currentActiveTriggerId; 5439 if (activeTriggerElement !== store3.state.activeTriggerElement) { 5440 stateUpdates.activeTriggerElement = activeTriggerElement; 5441 } 5442 } 5443 } else { 5444 resolvedActiveTriggerIdRef.current = null; 5445 } 5446 if (!lostActiveTriggerId && !currentActiveTriggerId && !store3.state.openedWithoutTrigger && triggerCount === 1) { 5447 const iteratorResult = store3.context.triggerElements.entries().next(); 5448 if (!iteratorResult.done) { 5449 const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; 5450 stateUpdates.activeTriggerId = implicitTriggerId; 5451 stateUpdates.activeTriggerElement = implicitTriggerElement; 5452 resolvedActiveTriggerIdRef.current = implicitTriggerId; 5453 } 5454 } 5455 if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) { 5456 store3.update(stateUpdates); 5457 } 5458 if (lostActiveTriggerId) { 5459 if (closeOnActiveTriggerUnmount) { 5460 queueMicrotask(() => { 5461 if (store3.select("open") && store3.select("activeTriggerId") === lostActiveTriggerId && !store3.context.triggerElements.getById(lostActiveTriggerId)) { 5462 const eventDetails = createChangeEventDetails(reason_parts_exports.none); 5463 store3.setOpen(false, eventDetails); 5464 if (!eventDetails.isCanceled) { 5465 store3.update({ 5466 activeTriggerId: null, 5467 activeTriggerElement: null 5468 }); 5469 } 5470 } 5471 }); 5472 } 5473 } 5474 }, [open3, store3, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]); 5475 } 5476 function useOpenStateTransitions(open3, store3, onUnmount, animateInitialOpen) { 5477 const { 5478 mounted, 5479 transitionStatus, 5480 forceUnmount 5481 } = useUnmountAfterClose({ 5482 open: open3, 5483 ref: store3.context.popupRef, 5484 preventUnmountOnClose: store3.useState("preventUnmountingOnClose"), 5485 setPreventUnmountOnClose: (preventUnmountOnClose) => store3.set("preventUnmountingOnClose", preventUnmountOnClose), 5486 animateInitialOpen, 5487 onUnmount() { 5488 store3.update({ 5489 activeTriggerId: null, 5490 activeTriggerElement: null, 5491 mounted: false, 5492 preventUnmountingOnClose: false 5493 }); 5494 onUnmount?.(); 5495 store3.context.onOpenChangeComplete?.(false); 5496 } 5497 }); 5498 useRefWithInit(() => { 5499 store3.set("mounted", mounted); 5500 return null; 5501 }); 5502 store3.useSyncedValues({ 5503 mounted, 5504 transitionStatus 5505 }); 5506 return { 5507 forceUnmount, 5508 transitionStatus 5509 }; 5510 } 5511 function usePopupInteractionProps(store3, statePart) { 5512 store3.useSyncedValues(statePart); 5513 useIsoLayoutEffect(() => () => { 5514 store3.update({ 5515 activeTriggerProps: EMPTY_OBJECT, 5516 inactiveTriggerProps: EMPTY_OBJECT, 5517 popupProps: EMPTY_OBJECT 5518 }); 5519 }, [store3]); 5520 } 5521 5522 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs 5523 var devElementIdsByMap; 5524 function getDevElementIds(map) { 5525 devElementIdsByMap ??= /* @__PURE__ */ new WeakMap(); 5526 let elementIds = devElementIdsByMap.get(map); 5527 if (!elementIds) { 5528 elementIds = /* @__PURE__ */ new WeakMap(); 5529 devElementIdsByMap.set(map, elementIds); 5530 } 5531 return elementIds; 5532 } 5533 var PopupTriggerMap = class { 5534 idMap = /* @__PURE__ */ new Map(); 5535 /** 5536 * Adds a trigger element with the given ID. 5537 * 5538 * Note: The provided element is assumed to not be registered under multiple IDs. 5539 */ 5540 add(id, element) { 5541 if (true) { 5542 const elementIds = getDevElementIds(this); 5543 const existingId = elementIds.get(element); 5544 if (existingId !== void 0 && existingId !== id) { 5545 throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); 5546 } 5547 const previousElement = this.idMap.get(id); 5548 if (previousElement !== void 0 && previousElement !== element) { 5549 elementIds.delete(previousElement); 5550 } 5551 elementIds.set(element, id); 5552 } 5553 this.idMap.set(id, element); 5554 } 5555 /** 5556 * Removes the trigger element with the given ID. 5557 */ 5558 delete(id) { 5559 if (true) { 5560 const element = this.idMap.get(id); 5561 if (element !== void 0) { 5562 devElementIdsByMap?.get(this)?.delete(element); 5563 } 5564 } 5565 this.idMap.delete(id); 5566 } 5567 /** 5568 * Whether the given element is registered as a trigger. 5569 */ 5570 hasElement(element) { 5571 for (const registered of this.idMap.values()) { 5572 if (registered === element) { 5573 return true; 5574 } 5575 } 5576 return false; 5577 } 5578 /** 5579 * Whether there is a registered trigger element matching the given predicate. 5580 */ 5581 hasMatchingElement(predicate) { 5582 for (const element of this.idMap.values()) { 5583 if (predicate(element)) { 5584 return true; 5585 } 5586 } 5587 return false; 5588 } 5589 /** 5590 * Returns the trigger element associated with the given ID, or undefined if no such element exists. 5591 */ 5592 getById(id) { 5593 return this.idMap.get(id); 5594 } 5595 /** 5596 * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element]. 5597 */ 5598 entries() { 5599 return this.idMap.entries(); 5600 } 5601 /** 5602 * Returns an iterable of all registered trigger elements. 5603 */ 5604 elements() { 5605 return this.idMap.values(); 5606 } 5607 /** 5608 * Returns the number of registered trigger elements. 5609 */ 5610 get size() { 5611 return this.idMap.size; 5612 } 5613 }; 5614 5615 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/useStore.mjs 5616 var React28 = __toESM(require_react(), 1); 5617 var import_shim = __toESM(require_shim(), 1); 5618 var import_with_selector = __toESM(require_with_selector(), 1); 5619 5620 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/fastHooks.mjs 5621 var React27 = __toESM(require_react(), 1); 5622 var hooks = []; 5623 var currentInstance = void 0; 5624 function getInstance() { 5625 return currentInstance; 5626 } 5627 function register2(hook) { 5628 hooks.push(hook); 5629 } 5630 function fastComponent(fn) { 5631 const FastComponent = (props, forwardedRef) => { 5632 const instance = useRefWithInit(createInstance).current; 5633 let result; 5634 try { 5635 currentInstance = instance; 5636 for (const hook of hooks) { 5637 hook.before(instance); 5638 } 5639 result = fn(props, forwardedRef); 5640 for (const hook of hooks) { 5641 hook.after(instance); 5642 } 5643 instance.didInitialize = true; 5644 } finally { 5645 currentInstance = void 0; 5646 } 5647 return result; 5648 }; 5649 FastComponent.displayName = fn.displayName || fn.name; 5650 return FastComponent; 5651 } 5652 function fastComponentRef(fn) { 5653 return /* @__PURE__ */ React27.forwardRef(fastComponent(fn)); 5654 } 5655 function createInstance() { 5656 return { 5657 didInitialize: false 5658 }; 5659 } 5660 5661 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/useStore.mjs 5662 var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19); 5663 var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy; 5664 function useStore(store3, selector, a1, a2, a3) { 5665 return useStoreImplementation(store3, selector, a1, a2, a3); 5666 } 5667 function useStoreR19(store3, selector, a1, a2, a3) { 5668 const getSelection = React28.useCallback(() => selector(store3.getSnapshot(), a1, a2, a3), [store3, selector, a1, a2, a3]); 5669 return (0, import_shim.useSyncExternalStore)(store3.subscribe, getSelection, getSelection); 5670 } 5671 register2({ 5672 before(instance) { 5673 instance.syncIndex = 0; 5674 if (!instance.didInitialize) { 5675 instance.syncTick = 1; 5676 instance.syncHooks = []; 5677 instance.didChangeStore = true; 5678 instance.getSnapshot = () => { 5679 let didChange2 = false; 5680 for (let i = 0; i < instance.syncHooks.length; i += 1) { 5681 const hook = instance.syncHooks[i]; 5682 const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3); 5683 if (!Object.is(hook.value, value)) { 5684 didChange2 = true; 5685 hook.value = value; 5686 } 5687 } 5688 if (didChange2) { 5689 instance.syncTick += 1; 5690 } 5691 return instance.syncTick; 5692 }; 5693 } 5694 }, 5695 after(instance) { 5696 if (instance.syncHooks.length > 0) { 5697 if (instance.didChangeStore) { 5698 instance.didChangeStore = false; 5699 instance.subscribe = (onStoreChange) => { 5700 const stores = /* @__PURE__ */ new Set(); 5701 for (const hook of instance.syncHooks) { 5702 stores.add(hook.store); 5703 } 5704 const unsubscribes = []; 5705 for (const store3 of stores) { 5706 unsubscribes.push(store3.subscribe(onStoreChange)); 5707 } 5708 return () => { 5709 for (const unsubscribe of unsubscribes) { 5710 unsubscribe(); 5711 } 5712 }; 5713 }; 5714 } 5715 (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot); 5716 } 5717 } 5718 }); 5719 function useStoreFast(store3, selector, a1, a2, a3) { 5720 const instance = getInstance(); 5721 if (!instance) { 5722 return useStoreR19(store3, selector, a1, a2, a3); 5723 } 5724 const index2 = instance.syncIndex; 5725 instance.syncIndex += 1; 5726 let hook; 5727 if (!instance.didInitialize) { 5728 hook = { 5729 store: store3, 5730 selector, 5731 a1, 5732 a2, 5733 a3, 5734 value: selector(store3.getSnapshot(), a1, a2, a3) 5735 }; 5736 instance.syncHooks.push(hook); 5737 } else { 5738 hook = instance.syncHooks[index2]; 5739 if (hook.store !== store3 || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) { 5740 if (hook.store !== store3) { 5741 instance.didChangeStore = true; 5742 } 5743 hook.store = store3; 5744 hook.selector = selector; 5745 hook.a1 = a1; 5746 hook.a2 = a2; 5747 hook.a3 = a3; 5748 hook.value = selector(store3.getSnapshot(), a1, a2, a3); 5749 } 5750 } 5751 return hook.value; 5752 } 5753 function useStoreLegacy(store3, selector, a1, a2, a3) { 5754 return (0, import_with_selector.useSyncExternalStoreWithSelector)(store3.subscribe, store3.getSnapshot, store3.getSnapshot, (state) => selector(state, a1, a2, a3)); 5755 } 5756 5757 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/Store.mjs 5758 var Store = class { 5759 /** 5760 * Creates a store with the given initial state, constructing the class it is called on. 5761 * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that 5762 * class but degrades the inferred instance type to `Store`; use `new` there instead. 5763 */ 5764 static create(state) { 5765 return new this(state); 5766 } 5767 /** 5768 * The current state of the store. 5769 * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}. 5770 * To subscribe to state changes, use the {@link useState} method. The value returned by {@link useState} is updated after the component renders (similarly to React's useState). 5771 * The values can be used directly (to avoid subscribing to the store) in effects or event handlers. 5772 * 5773 * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification. 5774 */ 5775 // Internal state to handle recursive `setState()` calls 5776 constructor(state) { 5777 this.state = state; 5778 this.listeners = /* @__PURE__ */ new Set(); 5779 this.updateTick = 0; 5780 } 5781 /** 5782 * Registers a listener that will be called whenever the store's state changes. 5783 * 5784 * @param fn The listener function to be called on state changes. 5785 * @returns A function to unsubscribe the listener. 5786 */ 5787 subscribe = (fn) => { 5788 this.listeners.add(fn); 5789 return () => { 5790 this.listeners.delete(fn); 5791 }; 5792 }; 5793 /** 5794 * Returns the current state of the store. 5795 */ 5796 getSnapshot = () => { 5797 return this.state; 5798 }; 5799 /** 5800 * Updates the entire store's state and notifies all registered listeners. 5801 * 5802 * @param newState The new state to set for the store. 5803 */ 5804 setState(newState) { 5805 if (this.state === newState) { 5806 return; 5807 } 5808 this.state = newState; 5809 this.updateTick += 1; 5810 const currentTick = this.updateTick; 5811 for (const listener of this.listeners) { 5812 if (currentTick !== this.updateTick) { 5813 return; 5814 } 5815 listener(newState); 5816 } 5817 } 5818 /** 5819 * Merges the provided changes into the current state and notifies listeners if there are changes. 5820 * Each value must match its state key. Pass an exact known subset rather than a broad 5821 * `Partial<State>`, which may contain `undefined` for required state fields. 5822 * 5823 * @param changes An object containing the changes to apply to the current state. 5824 */ 5825 update(changes) { 5826 for (const key in changes) { 5827 if (!Object.is(this.state[key], changes[key])) { 5828 this.setState({ 5829 ...this.state, 5830 ...changes 5831 }); 5832 return; 5833 } 5834 } 5835 } 5836 /** 5837 * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed. 5838 * 5839 * @param key The key in the store's state to update. 5840 * @param value The new value to set for the specified key. 5841 */ 5842 set(key, value) { 5843 if (!Object.is(this.state[key], value)) { 5844 this.setState({ 5845 ...this.state, 5846 [key]: value 5847 }); 5848 } 5849 } 5850 /** 5851 * Gives the state a new reference and updates all registered listeners. 5852 */ 5853 notifyAll() { 5854 const newState = { 5855 ...this.state 5856 }; 5857 this.setState(newState); 5858 } 5859 use(selector, a1, a2, a3) { 5860 return useStore(this, selector, a1, a2, a3); 5861 } 5862 }; 5863 5864 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/ReactStore.mjs 5865 var React29 = __toESM(require_react(), 1); 5866 var ReactStore = class extends Store { 5867 /** 5868 * Creates a new ReactStore instance. 5869 * 5870 * @param state Initial state of the store. 5871 * @param context Non-reactive context values. 5872 * @param selectors Optional selectors for use with `useState`. 5873 */ 5874 constructor(state, context = {}, selectors3) { 5875 super(state); 5876 this.context = context; 5877 this.selectors = selectors3; 5878 } 5879 /** 5880 * Non-reactive values such as refs, callbacks, etc. 5881 */ 5882 /** 5883 * Synchronizes a single external value into the store. 5884 * 5885 * Note that the while the value in `state` is updated immediately, the value returned 5886 * by `useState` is updated before the next render (similarly to React's `useState`). 5887 */ 5888 useSyncedValue(key, value) { 5889 React29.useDebugValue(key); 5890 const store3 = this; 5891 useIsoLayoutEffect(() => { 5892 if (store3.state[key] !== value) { 5893 store3.set(key, value); 5894 } 5895 }, [store3, key, value]); 5896 } 5897 /** 5898 * Synchronizes a single external value into the store and 5899 * cleans it up (sets to `undefined`) on unmount. 5900 * 5901 * Note that the while the value in `state` is updated immediately, the value returned 5902 * by `useState` is updated before the next render (similarly to React's `useState`). 5903 */ 5904 useSyncedValueWithCleanup(key, value) { 5905 const store3 = this; 5906 useIsoLayoutEffect(() => { 5907 if (store3.state[key] !== value) { 5908 store3.set(key, value); 5909 } 5910 return () => { 5911 store3.set(key, void 0); 5912 }; 5913 }, [store3, key, value]); 5914 } 5915 /** 5916 * Synchronizes multiple external values into the store. 5917 * Each value must match its state key. Pass an exact known subset rather than a broad 5918 * `Partial<State>`, which may contain `undefined` for required state fields. 5919 * 5920 * Note that the while the values in `state` are updated immediately, the values returned 5921 * by `useState` are updated before the next render (similarly to React's `useState`). 5922 * 5923 * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted. 5924 */ 5925 useSyncedValues(statePart) { 5926 const store3 = this; 5927 if (true) { 5928 React29.useDebugValue(statePart, (p) => Object.keys(p)); 5929 const keys = React29.useRef(Object.keys(statePart)).current; 5930 const nextKeys = Object.keys(statePart); 5931 if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) { 5932 console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable."); 5933 } 5934 } 5935 const dependencies = Object.values(statePart); 5936 useIsoLayoutEffect(() => { 5937 store3.update(statePart); 5938 }, [store3, ...dependencies]); 5939 } 5940 /** 5941 * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled` 5942 * is non-undefined, the store's state at `key` is updated to match `controlled`. 5943 */ 5944 useControlledProp(key, controlled) { 5945 React29.useDebugValue(key); 5946 const store3 = this; 5947 const isControlled = controlled !== void 0; 5948 useIsoLayoutEffect(() => { 5949 if (isControlled && !Object.is(store3.state[key], controlled)) { 5950 store3.setState({ 5951 ...store3.state, 5952 [key]: controlled 5953 }); 5954 } 5955 }, [store3, key, controlled, isControlled]); 5956 if (true) { 5957 const cache = this.controlledValues ??= /* @__PURE__ */ new Map(); 5958 if (!cache.has(key)) { 5959 cache.set(key, isControlled); 5960 } 5961 const previouslyControlled = cache.get(key); 5962 if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) { 5963 console.error(`A component is changing the $previouslyControlled ? "" : "un"}controlled state of $key.toString()} to be $previouslyControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`); 5964 } 5965 } 5966 } 5967 /** Gets the current value from the store using a selector with the provided key. 5968 * 5969 * @param key Key of the selector to use. 5970 */ 5971 select(key, a1, a2, a3) { 5972 const selector = this.selectors[key]; 5973 return selector(this.state, a1, a2, a3); 5974 } 5975 /** 5976 * Returns a value from the store's state using a selector function. 5977 * Used to subscribe to specific parts of the state. 5978 * This methods causes a rerender whenever the selected state changes. 5979 * 5980 * @param key Key of the selector to use. 5981 */ 5982 useState(key, a1, a2, a3) { 5983 React29.useDebugValue(key); 5984 return useStore(this, this.selectors[key], a1, a2, a3); 5985 } 5986 /** 5987 * Wraps a function with `useStableCallback` to ensure it has a stable reference 5988 * and assigns it to the context. 5989 * 5990 * @param key Key of the event callback. Must be a function in the context. 5991 * @param fn Function to assign. 5992 */ 5993 useContextCallback(key, fn) { 5994 React29.useDebugValue(key); 5995 const stableFunction = useStableCallback(fn ?? NOOP); 5996 this.context[key] = stableFunction; 5997 } 5998 /** 5999 * Returns a stable setter function for a specific key in the store's state. 6000 * It's commonly used to pass as a ref callback to React elements. 6001 * 6002 * @param key Key of the state to set. 6003 */ 6004 useStateSetter(key) { 6005 const ref = React29.useRef(void 0); 6006 if (ref.current === void 0) { 6007 ref.current = (value) => { 6008 this.set(key, value); 6009 }; 6010 } 6011 return ref.current; 6012 } 6013 /** 6014 * Observes changes derived from the store's selectors and calls the listener when the selected value changes. 6015 * 6016 * @param key Key of the selector to observe. 6017 * @param listener Listener function called when the selector result changes. 6018 */ 6019 observe(selector, listener) { 6020 let selectFn; 6021 if (typeof selector === "function") { 6022 selectFn = selector; 6023 } else { 6024 selectFn = this.selectors[selector]; 6025 } 6026 let prevValue = selectFn(this.state); 6027 listener(prevValue, prevValue, this); 6028 return this.subscribe((nextState) => { 6029 const nextValue = selectFn(nextState); 6030 if (!Object.is(prevValue, nextValue)) { 6031 const oldValue = prevValue; 6032 prevValue = nextValue; 6033 listener(nextValue, oldValue, this); 6034 } 6035 }); 6036 } 6037 }; 6038 6039 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs 6040 var selectors = { 6041 open: (state) => state.open, 6042 transitionStatus: (state) => state.transitionStatus, 6043 domReferenceElement: (state) => state.domReferenceElement, 6044 referenceElement: (state) => state.positionReference ?? state.referenceElement, 6045 floatingElement: (state) => state.floatingElement, 6046 floatingId: (state) => state.floatingId 6047 }; 6048 var FloatingRootStore = class extends ReactStore { 6049 constructor(options) { 6050 const { 6051 syncOnly, 6052 nested, 6053 onOpenChange, 6054 triggerElements, 6055 ...initialState 6056 } = options; 6057 super({ 6058 ...initialState, 6059 positionReference: initialState.referenceElement, 6060 domReferenceElement: initialState.referenceElement 6061 }, { 6062 onOpenChange, 6063 dataRef: { 6064 current: {} 6065 }, 6066 events: createEventEmitter(), 6067 nested, 6068 triggerElements 6069 }, selectors); 6070 this.syncOnly = syncOnly; 6071 } 6072 /** 6073 * Syncs the event used by hover logic to distinguish hover-open from click-like interaction. 6074 */ 6075 syncOpenEvent = (newOpen, event) => { 6076 if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing 6077 // click events to upgrade a hover-open. 6078 event != null && isClickLikeEvent(event)) { 6079 this.context.dataRef.current.openEvent = newOpen ? event : void 0; 6080 } 6081 }; 6082 /** 6083 * Runs the root-owned side effects for an open state change. 6084 */ 6085 dispatchOpenChange = (newOpen, eventDetails) => { 6086 this.syncOpenEvent(newOpen, eventDetails.event); 6087 const details = { 6088 open: newOpen, 6089 reason: eventDetails.reason, 6090 nativeEvent: eventDetails.event, 6091 nested: this.context.nested, 6092 triggerElement: eventDetails.trigger 6093 }; 6094 this.context.events.emit("openchange", details); 6095 }; 6096 /** 6097 * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments. 6098 * 6099 * @param newOpen The new open state. 6100 * @param eventDetails Details about the event that triggered the open state change. 6101 */ 6102 setOpen = (newOpen, eventDetails) => { 6103 if (this.syncOnly) { 6104 this.context.onOpenChange?.(newOpen, eventDetails); 6105 return; 6106 } 6107 this.dispatchOpenChange(newOpen, eventDetails); 6108 this.context.onOpenChange?.(newOpen, eventDetails); 6109 }; 6110 }; 6111 6112 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/store.mjs 6113 function createInitialPopupStoreState(triggerElements, floatingId, nested = false) { 6114 return { 6115 open: false, 6116 openProp: void 0, 6117 mounted: false, 6118 transitionStatus: void 0, 6119 floatingRootContext: new FloatingRootStore({ 6120 open: false, 6121 transitionStatus: void 0, 6122 floatingElement: null, 6123 referenceElement: null, 6124 triggerElements, 6125 floatingId, 6126 syncOnly: true, 6127 nested, 6128 onOpenChange: void 0 6129 }), 6130 floatingId, 6131 triggerCount: 0, 6132 preventUnmountingOnClose: false, 6133 payload: void 0, 6134 activeTriggerId: null, 6135 activeTriggerElement: null, 6136 openedWithoutTrigger: false, 6137 triggerIdProp: void 0, 6138 popupElement: null, 6139 positionerElement: null, 6140 activeTriggerProps: EMPTY_OBJECT, 6141 inactiveTriggerProps: EMPTY_OBJECT, 6142 popupProps: EMPTY_OBJECT 6143 }; 6144 } 6145 var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId; 6146 var openSelector = (state) => state.openProp ?? state.open; 6147 var popupIdSelector = (state) => { 6148 const popupId = state.popupElement?.id ?? state.floatingId; 6149 return popupId || void 0; 6150 }; 6151 function triggerOwnsOpenPopup(state, triggerId) { 6152 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId; 6153 } 6154 function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) { 6155 if (triggerOwnsOpenPopup(state, triggerId)) { 6156 return true; 6157 } 6158 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && !state.openedWithoutTrigger && state.triggerCount === 1; 6159 } 6160 var popupStoreSelectors = { 6161 open: openSelector, 6162 mounted: (state) => state.mounted, 6163 // `open` is written synchronously on an open change; `mounted`/`transitionStatus` sync in a 6164 // layout effect. Match useTransitionStatus so a retained popup does not miss its starting phase. 6165 transitionStatus: (state) => openSelector(state) && !state.mounted ? "starting" : state.transitionStatus, 6166 floatingRootContext: (state) => state.floatingRootContext, 6167 triggerCount: (state) => state.triggerCount, 6168 preventUnmountingOnClose: (state) => state.preventUnmountingOnClose, 6169 payload: (state) => state.payload, 6170 activeTriggerId: activeTriggerIdSelector, 6171 activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null, 6172 popupId: popupIdSelector, 6173 /** 6174 * Whether the trigger with the given ID was used to open the popup. 6175 */ 6176 isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId, 6177 /** 6178 * Whether the popup is open and was activated by a trigger with the given ID. 6179 */ 6180 isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId), 6181 /** 6182 * Whether the popup is mounted and was activated by a trigger with the given ID. 6183 */ 6184 isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted, 6185 triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps, 6186 /** 6187 * Popup id for the trigger that currently owns the open popup. 6188 */ 6189 triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0, 6190 popupProps: (state) => state.popupProps, 6191 popupElement: (state) => state.popupElement, 6192 positionerElement: (state) => state.positionerElement 6193 }; 6194 6195 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs 6196 var React30 = __toESM(require_react(), 1); 6197 var import_shim2 = __toESM(require_shim(), 1); 6198 function usePopupHandleStore(handle) { 6199 const subscribe = React30.useCallback((listener) => { 6200 if (handle === void 0) { 6201 return NOOP; 6202 } 6203 return handle.subscribeStore(listener); 6204 }, [handle]); 6205 const getSnapshot = React30.useCallback(() => { 6206 return handle === void 0 ? void 0 : handle.store; 6207 }, [handle]); 6208 return (0, import_shim2.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore); 6209 } 6210 6211 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs 6212 var React31 = __toESM(require_react(), 1); 6213 var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit; 6214 function useFocus(store3, props = {}) { 6215 const { 6216 enabled = true, 6217 delay 6218 } = props; 6219 const { 6220 events, 6221 dataRef 6222 } = store3.context; 6223 const blockFocusRef = React31.useRef(false); 6224 const blockedReferenceRef = React31.useRef(null); 6225 const keyboardModalityRef = React31.useRef(true); 6226 const timeout = useTimeout(); 6227 React31.useEffect(() => { 6228 const domReference = store3.select("domReferenceElement"); 6229 if (!enabled) { 6230 return void 0; 6231 } 6232 const win = getWindow(domReference); 6233 function onBlur() { 6234 const currentDomReference = store3.select("domReferenceElement"); 6235 if (!store3.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) { 6236 blockFocusRef.current = true; 6237 blockedReferenceRef.current = currentDomReference; 6238 } 6239 } 6240 function onKeyDown() { 6241 keyboardModalityRef.current = true; 6242 } 6243 function onPointerDown() { 6244 keyboardModalityRef.current = false; 6245 } 6246 return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true)); 6247 }, [store3, enabled]); 6248 React31.useEffect(() => { 6249 if (!enabled) { 6250 return void 0; 6251 } 6252 function onOpenChangeLocal(details) { 6253 if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) { 6254 const referenceElement = store3.select("domReferenceElement"); 6255 if (isElement(referenceElement)) { 6256 blockedReferenceRef.current = referenceElement; 6257 blockFocusRef.current = true; 6258 } 6259 } 6260 } 6261 events.on("openchange", onOpenChangeLocal); 6262 return () => { 6263 events.off("openchange", onOpenChangeLocal); 6264 }; 6265 }, [events, enabled, store3]); 6266 const reference = React31.useMemo(() => { 6267 function resetBlockedFocus() { 6268 blockFocusRef.current = false; 6269 blockedReferenceRef.current = null; 6270 } 6271 return { 6272 onMouseLeave() { 6273 resetBlockedFocus(); 6274 }, 6275 onFocus(event) { 6276 const focusTarget = event.currentTarget; 6277 if (blockFocusRef.current) { 6278 if (blockedReferenceRef.current === focusTarget) { 6279 return; 6280 } 6281 resetBlockedFocus(); 6282 } 6283 const target = getTarget(event.nativeEvent); 6284 if (isElement(target)) { 6285 if (isMacSafari && !event.relatedTarget) { 6286 if (!keyboardModalityRef.current && !isTypeableElement(target)) { 6287 return; 6288 } 6289 } else if (!matchesFocusVisible(target)) { 6290 return; 6291 } 6292 } 6293 const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store3.context.triggerElements); 6294 const { 6295 nativeEvent, 6296 currentTarget 6297 } = event; 6298 if (store3.select("open") && movedFromOtherEnabledTrigger || !delay) { 6299 store3.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 6300 return; 6301 } 6302 timeout.start(delay, () => { 6303 if (blockFocusRef.current) { 6304 return; 6305 } 6306 store3.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 6307 }); 6308 }, 6309 onBlur(event) { 6310 resetBlockedFocus(); 6311 const relatedTarget = event.relatedTarget; 6312 const nativeEvent = event.nativeEvent; 6313 const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside"; 6314 timeout.start(0, () => { 6315 const domReference = store3.select("domReferenceElement"); 6316 const activeEl = activeElement(ownerDocument(domReference)); 6317 if (!relatedTarget && activeEl === domReference) { 6318 return; 6319 } 6320 if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) { 6321 return; 6322 } 6323 const nextFocusedElement = relatedTarget ?? activeEl; 6324 if (isTargetInsideEnabledTrigger(nextFocusedElement, store3.context.triggerElements)) { 6325 return; 6326 } 6327 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent)); 6328 }); 6329 } 6330 }; 6331 }, [dataRef, delay, store3, timeout]); 6332 return React31.useMemo(() => enabled ? { 6333 reference, 6334 trigger: reference 6335 } : {}, [enabled, reference]); 6336 } 6337 6338 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs 6339 var React32 = __toESM(require_react(), 1); 6340 6341 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs 6342 var HoverInteraction = class _HoverInteraction { 6343 pointerType = void 0; 6344 interactedInside = false; 6345 handler = void 0; 6346 blockMouseMove = true; 6347 performedPointerEventsMutation = false; 6348 pointerEventsScopeElement = null; 6349 pointerEventsReferenceElement = null; 6350 pointerEventsFloatingElement = null; 6351 restTimeoutPending = false; 6352 openChangeTimeout = new Timeout(); 6353 restTimeout = new Timeout(); 6354 handleCloseOptions = void 0; 6355 static create() { 6356 return new _HoverInteraction(); 6357 } 6358 dispose = () => { 6359 this.openChangeTimeout.clear(); 6360 this.restTimeout.clear(); 6361 }; 6362 disposeEffect = () => { 6363 return this.dispose; 6364 }; 6365 }; 6366 var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap(); 6367 function clearSafePolygonPointerEventsMutation(instance) { 6368 if (!instance.performedPointerEventsMutation) { 6369 return; 6370 } 6371 const scopeElement = instance.pointerEventsScopeElement; 6372 if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) { 6373 instance.pointerEventsScopeElement?.style.removeProperty("pointer-events"); 6374 instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events"); 6375 instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events"); 6376 pointerEventsMutationOwnerByScopeElement.delete(scopeElement); 6377 } 6378 instance.performedPointerEventsMutation = false; 6379 instance.pointerEventsScopeElement = null; 6380 instance.pointerEventsReferenceElement = null; 6381 instance.pointerEventsFloatingElement = null; 6382 } 6383 function applySafePolygonPointerEventsMutation(instance, options) { 6384 const { 6385 scopeElement, 6386 referenceElement, 6387 floatingElement 6388 } = options; 6389 const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement); 6390 if (existingOwner && existingOwner !== instance) { 6391 clearSafePolygonPointerEventsMutation(existingOwner); 6392 } 6393 clearSafePolygonPointerEventsMutation(instance); 6394 instance.performedPointerEventsMutation = true; 6395 instance.pointerEventsScopeElement = scopeElement; 6396 instance.pointerEventsReferenceElement = referenceElement; 6397 instance.pointerEventsFloatingElement = floatingElement; 6398 pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance); 6399 scopeElement.style.pointerEvents = "none"; 6400 referenceElement.style.pointerEvents = "auto"; 6401 floatingElement.style.pointerEvents = "auto"; 6402 } 6403 function useHoverInteractionSharedState(store3) { 6404 const data = store3.context.dataRef.current; 6405 const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current; 6406 if (!data.hoverInteractionState) { 6407 data.hoverInteractionState = instance; 6408 } 6409 useOnMount(data.hoverInteractionState.disposeEffect); 6410 return data.hoverInteractionState; 6411 } 6412 6413 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs 6414 function useHoverFloatingInteraction(store3, parameters = {}) { 6415 const { 6416 enabled = true, 6417 closeDelay: closeDelayProp = 0, 6418 nodeId: nodeIdProp 6419 } = parameters; 6420 const open3 = store3.useState("open"); 6421 const floatingElement = store3.useState("floatingElement"); 6422 const domReferenceElement = store3.useState("domReferenceElement"); 6423 const { 6424 dataRef 6425 } = store3.context; 6426 const tree = useFloatingTree(); 6427 const parentId = useFloatingParentNodeId(); 6428 const instance = useHoverInteractionSharedState(store3); 6429 const childClosedTimeout = useTimeout(); 6430 const isClickLikeOpenEvent2 = useStableCallback(() => { 6431 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 6432 }); 6433 const isHoverOpen = useStableCallback(() => { 6434 return isHoverOpenEvent(dataRef.current.openEvent?.type); 6435 }); 6436 const clearPointerEvents = useStableCallback(() => { 6437 clearSafePolygonPointerEventsMutation(instance); 6438 }); 6439 useIsoLayoutEffect(() => { 6440 if (!open3) { 6441 instance.pointerType = void 0; 6442 instance.restTimeoutPending = false; 6443 instance.interactedInside = false; 6444 clearPointerEvents(); 6445 } 6446 }, [open3, instance, clearPointerEvents]); 6447 React32.useEffect(() => { 6448 return clearPointerEvents; 6449 }, [clearPointerEvents]); 6450 useIsoLayoutEffect(() => { 6451 if (!enabled) { 6452 return void 0; 6453 } 6454 if (open3 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { 6455 const ref = domReferenceElement; 6456 const floatingEl = floatingElement; 6457 const doc = ownerDocument(floatingElement); 6458 const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating; 6459 if (parentFloating) { 6460 parentFloating.style.pointerEvents = ""; 6461 } 6462 const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null; 6463 const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null; 6464 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? closest(ref, "[data-rootownerid]") ?? doc.body; 6465 applySafePolygonPointerEventsMutation(instance, { 6466 scopeElement, 6467 referenceElement: ref, 6468 floatingElement: floatingEl 6469 }); 6470 return () => { 6471 clearPointerEvents(); 6472 }; 6473 } 6474 return void 0; 6475 }, [enabled, open3, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); 6476 React32.useEffect(() => { 6477 if (!enabled) { 6478 return void 0; 6479 } 6480 function hasParentChildren() { 6481 return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0); 6482 } 6483 function closeWithDelay(event) { 6484 const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType); 6485 const close = () => { 6486 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6487 tree?.events.emit("floating.closed", event); 6488 }; 6489 if (closeDelay) { 6490 instance.openChangeTimeout.start(closeDelay, close); 6491 } else { 6492 instance.openChangeTimeout.clear(); 6493 close(); 6494 } 6495 } 6496 function handleInteractInside(event) { 6497 const target = getTarget(event); 6498 if (!isInteractiveElement(target)) { 6499 instance.interactedInside = false; 6500 return; 6501 } 6502 instance.interactedInside = closest(target, "[aria-haspopup]") != null; 6503 } 6504 function onFloatingMouseEnter() { 6505 instance.openChangeTimeout.clear(); 6506 childClosedTimeout.clear(); 6507 tree?.events.off("floating.closed", onNodeClosed); 6508 clearPointerEvents(); 6509 } 6510 function onFloatingMouseLeave(event) { 6511 if (hasParentChildren() && tree) { 6512 tree.events.on("floating.closed", onNodeClosed); 6513 return; 6514 } 6515 if (isTargetInsideEnabledTrigger(event.relatedTarget, store3.context.triggerElements)) { 6516 return; 6517 } 6518 const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp; 6519 const relatedTarget = event.relatedTarget; 6520 const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget)); 6521 if (isMovingIntoDescendantFloating) { 6522 return; 6523 } 6524 if (instance.handler) { 6525 instance.handler(event); 6526 return; 6527 } 6528 clearPointerEvents(); 6529 if (isHoverOpen() && !isClickLikeOpenEvent2()) { 6530 closeWithDelay(event); 6531 } 6532 } 6533 function onNodeClosed(event) { 6534 if (!tree || !parentId || hasParentChildren()) { 6535 return; 6536 } 6537 childClosedTimeout.start(0, () => { 6538 tree.events.off("floating.closed", onNodeClosed); 6539 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6540 tree.events.emit("floating.closed", event); 6541 }); 6542 } 6543 const floating = floatingElement; 6544 return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => { 6545 tree?.events.off("floating.closed", onNodeClosed); 6546 }); 6547 }, [enabled, floatingElement, store3, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]); 6548 } 6549 6550 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs 6551 var React33 = __toESM(require_react(), 1); 6552 var ReactDOM4 = __toESM(require_react_dom(), 1); 6553 var EMPTY_REF = { 6554 current: null 6555 }; 6556 function useHoverReferenceInteraction(store3, props = {}) { 6557 const { 6558 enabled = true, 6559 delay = 0, 6560 handleClose = null, 6561 mouseOnly = false, 6562 restMs = 0, 6563 move = true, 6564 triggerElementRef = EMPTY_REF, 6565 externalTree, 6566 isActiveTrigger = true, 6567 getHandleCloseContext, 6568 isClosing, 6569 shouldOpen: shouldOpenProp, 6570 guardStaleOpen = false 6571 } = props; 6572 const { 6573 dataRef, 6574 events 6575 } = store3.context; 6576 const tree = useFloatingTree(externalTree); 6577 const instance = useHoverInteractionSharedState(store3); 6578 const isHoverCloseActiveRef = React33.useRef(false); 6579 const handleCloseRef = useValueAsRef(handleClose); 6580 const delayRef = useValueAsRef(delay); 6581 const restMsRef = useValueAsRef(restMs); 6582 const enabledRef = useValueAsRef(enabled); 6583 const shouldOpenRef = useValueAsRef(shouldOpenProp); 6584 const isClosingRef = useValueAsRef(isClosing); 6585 const isClickLikeOpenEvent2 = useStableCallback(() => { 6586 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 6587 }); 6588 const checkShouldOpen = useStableCallback(() => { 6589 return shouldOpenRef.current?.() !== false; 6590 }); 6591 const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => { 6592 const allTriggers = store3.context.triggerElements; 6593 if (allTriggers.hasElement(currentTarget)) { 6594 return !currentDomReference || !contains(currentDomReference, currentTarget); 6595 } 6596 if (!isElement(target)) { 6597 return false; 6598 } 6599 const targetElement = target; 6600 return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement)); 6601 }); 6602 const cleanupMouseMoveHandler = useStableCallback(() => { 6603 if (!instance.handler) { 6604 return; 6605 } 6606 const doc = ownerDocument(store3.select("domReferenceElement")); 6607 doc.removeEventListener("mousemove", instance.handler); 6608 instance.handler = void 0; 6609 }); 6610 const clearPointerEvents = useStableCallback(() => { 6611 clearSafePolygonPointerEventsMutation(instance); 6612 }); 6613 if (isActiveTrigger) { 6614 instance.handleCloseOptions = handleClose?.__options; 6615 } 6616 React33.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); 6617 React33.useEffect(() => { 6618 if (!enabled) { 6619 return void 0; 6620 } 6621 function onOpenChangeLocal(details) { 6622 if (!details.open) { 6623 isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover; 6624 cleanupMouseMoveHandler(); 6625 instance.openChangeTimeout.clear(); 6626 instance.restTimeout.clear(); 6627 instance.blockMouseMove = true; 6628 instance.restTimeoutPending = false; 6629 } else { 6630 isHoverCloseActiveRef.current = false; 6631 } 6632 } 6633 events.on("openchange", onOpenChangeLocal); 6634 return () => { 6635 events.off("openchange", onOpenChangeLocal); 6636 }; 6637 }, [enabled, events, instance, cleanupMouseMoveHandler]); 6638 React33.useEffect(() => { 6639 if (!enabled) { 6640 return void 0; 6641 } 6642 function closeWithDelay(event, runElseBranch = true) { 6643 const closeDelay = getDelay(delayRef.current, "close", instance.pointerType); 6644 if (closeDelay) { 6645 instance.openChangeTimeout.start(closeDelay, () => { 6646 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6647 tree?.events.emit("floating.closed", event); 6648 }); 6649 } else if (runElseBranch) { 6650 instance.openChangeTimeout.clear(); 6651 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6652 tree?.events.emit("floating.closed", event); 6653 } 6654 } 6655 const trigger = triggerElementRef.current ?? (isActiveTrigger ? store3.select("domReferenceElement") : null); 6656 if (!isElement(trigger)) { 6657 return void 0; 6658 } 6659 function onMouseEnter(event) { 6660 instance.openChangeTimeout.clear(); 6661 instance.blockMouseMove = false; 6662 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 6663 return; 6664 } 6665 const restMsValue = getRestMs(restMsRef.current); 6666 const openDelay = getDelay(delayRef.current, "open", instance.pointerType); 6667 const eventTarget = getTarget(event); 6668 const currentTarget = event.currentTarget ?? null; 6669 const currentDomReference = store3.select("domReferenceElement"); 6670 let triggerNode = currentTarget; 6671 if (isElement(eventTarget) && !store3.context.triggerElements.hasElement(eventTarget)) { 6672 for (const triggerElement of store3.context.triggerElements.elements()) { 6673 if (contains(triggerElement, eventTarget)) { 6674 triggerNode = triggerElement; 6675 break; 6676 } 6677 } 6678 } 6679 if (isElement(currentTarget) && isElement(currentDomReference) && !store3.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) { 6680 triggerNode = currentDomReference; 6681 } 6682 const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget); 6683 const isOpen = store3.select("open"); 6684 const isInClosingTransition = isClosingRef.current?.() ?? store3.select("transitionStatus") === "ending"; 6685 const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current; 6686 const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition; 6687 const isRestOnlyDelay = restMsValue > 0 && !openDelay; 6688 const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition; 6689 const shouldOpen = !isOpen || isOverInactive; 6690 if (shouldOpenImmediately) { 6691 if (checkShouldOpen()) { 6692 store3.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6693 } 6694 return; 6695 } 6696 if (isRestOnlyDelay) { 6697 return; 6698 } 6699 if (openDelay) { 6700 instance.openChangeTimeout.start(openDelay, () => { 6701 if (shouldOpen && checkShouldOpen()) { 6702 store3.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6703 } 6704 }); 6705 } else if (shouldOpen) { 6706 if (checkShouldOpen()) { 6707 store3.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6708 } 6709 } 6710 } 6711 function onMouseLeave(event) { 6712 if (isClickLikeOpenEvent2()) { 6713 clearPointerEvents(); 6714 return; 6715 } 6716 cleanupMouseMoveHandler(); 6717 const domReferenceElement = store3.select("domReferenceElement"); 6718 const doc = ownerDocument(domReferenceElement); 6719 instance.restTimeout.clear(); 6720 instance.restTimeoutPending = false; 6721 const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.(); 6722 if (isTargetInsideEnabledTrigger(event.relatedTarget, store3.context.triggerElements)) { 6723 return; 6724 } 6725 if (handleCloseRef.current && handleCloseContextBase) { 6726 if (!store3.select("open")) { 6727 instance.openChangeTimeout.clear(); 6728 } 6729 const currentTrigger = triggerElementRef.current; 6730 instance.handler = handleCloseRef.current({ 6731 ...handleCloseContextBase, 6732 tree, 6733 x: event.clientX, 6734 y: event.clientY, 6735 onClose() { 6736 clearPointerEvents(); 6737 cleanupMouseMoveHandler(); 6738 if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store3.select("domReferenceElement")) { 6739 closeWithDelay(event, true); 6740 } 6741 } 6742 }); 6743 doc.addEventListener("mousemove", instance.handler); 6744 instance.handler(event); 6745 return; 6746 } 6747 const shouldClose = instance.pointerType === "touch" ? !contains(store3.select("floatingElement"), event.relatedTarget) : true; 6748 if (shouldClose) { 6749 closeWithDelay(event); 6750 } 6751 } 6752 function onMouseOut(event) { 6753 if (contains(trigger, event.relatedTarget)) { 6754 return; 6755 } 6756 instance.openChangeTimeout.clear(); 6757 instance.restTimeout.clear(); 6758 instance.restTimeoutPending = false; 6759 } 6760 const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0; 6761 if (move) { 6762 return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, { 6763 once: true 6764 }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); 6765 } 6766 return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); 6767 }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store3, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]); 6768 return React33.useMemo(() => { 6769 if (!enabled) { 6770 return void 0; 6771 } 6772 function setPointerRef(event) { 6773 instance.pointerType = event.pointerType; 6774 } 6775 return { 6776 onPointerDown: setPointerRef, 6777 onPointerEnter: setPointerRef, 6778 onMouseMove(event) { 6779 const { 6780 nativeEvent 6781 } = event; 6782 const trigger = event.currentTarget; 6783 const currentDomReference = store3.select("domReferenceElement"); 6784 const currentOpen = store3.select("open"); 6785 const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target); 6786 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 6787 return; 6788 } 6789 if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) { 6790 const floatingElement = store3.select("floatingElement"); 6791 if (floatingElement) { 6792 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body; 6793 applySafePolygonPointerEventsMutation(instance, { 6794 scopeElement, 6795 referenceElement: trigger, 6796 floatingElement 6797 }); 6798 } 6799 } 6800 const restMsValue = getRestMs(restMsRef.current); 6801 if (currentOpen && !isOverInactive || restMsValue === 0) { 6802 return; 6803 } 6804 if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) { 6805 return; 6806 } 6807 instance.restTimeout.clear(); 6808 function handleMouseMove() { 6809 instance.restTimeoutPending = false; 6810 if (isClickLikeOpenEvent2()) { 6811 return; 6812 } 6813 const latestOpen = store3.select("open"); 6814 if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) { 6815 store3.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger)); 6816 } 6817 } 6818 if (instance.pointerType === "touch") { 6819 ReactDOM4.flushSync(() => { 6820 handleMouseMove(); 6821 }); 6822 } else if (isOverInactive && currentOpen) { 6823 handleMouseMove(); 6824 } else { 6825 instance.restTimeoutPending = true; 6826 instance.restTimeout.start(restMsValue, handleMouseMove); 6827 } 6828 } 6829 }; 6830 }, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store3, restMsRef, checkShouldOpen]); 6831 } 6832 6833 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs 6834 var CURSOR_SPEED_THRESHOLD = 0.1; 6835 var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD; 6836 var POLYGON_BUFFER = 0.5; 6837 function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) { 6838 return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi; 6839 } 6840 function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) { 6841 let isInsideValue = false; 6842 if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) { 6843 isInsideValue = !isInsideValue; 6844 } 6845 if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) { 6846 isInsideValue = !isInsideValue; 6847 } 6848 if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) { 6849 isInsideValue = !isInsideValue; 6850 } 6851 if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) { 6852 isInsideValue = !isInsideValue; 6853 } 6854 return isInsideValue; 6855 } 6856 function isInsideRect(pointX, pointY, rect) { 6857 return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height; 6858 } 6859 function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) { 6860 const minX = Math.min(x1, x2); 6861 const maxX = Math.max(x1, x2); 6862 const minY = Math.min(y1, y2); 6863 const maxY = Math.max(y1, y2); 6864 return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY; 6865 } 6866 function safePolygon(options = {}) { 6867 const { 6868 blockPointerEvents = false 6869 } = options; 6870 const timeout = new Timeout(); 6871 const fn = ({ 6872 x, 6873 y, 6874 placement, 6875 elements, 6876 onClose, 6877 nodeId, 6878 tree 6879 }) => { 6880 const side = placement?.split("-")[0]; 6881 let hasLanded = false; 6882 let lastX = null; 6883 let lastY = null; 6884 let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0; 6885 function isCursorMovingSlowly(nextX, nextY) { 6886 const currentTime = performance.now(); 6887 const elapsedTime = currentTime - lastCursorTime; 6888 if (lastX === null || lastY === null || elapsedTime === 0) { 6889 lastX = nextX; 6890 lastY = nextY; 6891 lastCursorTime = currentTime; 6892 return false; 6893 } 6894 const deltaX = nextX - lastX; 6895 const deltaY = nextY - lastY; 6896 const distanceSquared = deltaX * deltaX + deltaY * deltaY; 6897 const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED; 6898 lastX = nextX; 6899 lastY = nextY; 6900 lastCursorTime = currentTime; 6901 return distanceSquared < thresholdSquared; 6902 } 6903 function close() { 6904 timeout.clear(); 6905 onClose(); 6906 } 6907 return function onMouseMove(event) { 6908 timeout.clear(); 6909 const domReference = elements.domReference; 6910 const floating = elements.floating; 6911 if (!domReference || !floating || side == null || x == null || y == null) { 6912 return void 0; 6913 } 6914 const { 6915 clientX, 6916 clientY 6917 } = event; 6918 const target = getTarget(event); 6919 const isLeave = event.type === "mouseleave"; 6920 const isOverFloatingEl = contains(floating, target); 6921 const isOverReferenceEl = contains(domReference, target); 6922 if (isOverFloatingEl) { 6923 hasLanded = true; 6924 if (!isLeave) { 6925 return void 0; 6926 } 6927 } 6928 if (isOverReferenceEl) { 6929 hasLanded = false; 6930 if (!isLeave) { 6931 hasLanded = true; 6932 return void 0; 6933 } 6934 } 6935 if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) { 6936 return void 0; 6937 } 6938 function hasOpenChildNode() { 6939 return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0); 6940 } 6941 function closeIfNoOpenChild() { 6942 if (!hasOpenChildNode()) { 6943 close(); 6944 } 6945 } 6946 if (hasOpenChildNode()) { 6947 return void 0; 6948 } 6949 const refRect = domReference.getBoundingClientRect(); 6950 const rect = floating.getBoundingClientRect(); 6951 const cursorLeaveFromRight = x > rect.right - rect.width / 2; 6952 const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2; 6953 const isFloatingWider = rect.width > refRect.width; 6954 const isFloatingTaller = rect.height > refRect.height; 6955 const left = (isFloatingWider ? refRect : rect).left; 6956 const right = (isFloatingWider ? refRect : rect).right; 6957 const top = (isFloatingTaller ? refRect : rect).top; 6958 const bottom = (isFloatingTaller ? refRect : rect).bottom; 6959 if (side === "top" && y >= refRect.bottom - 1 || side === "bottom" && y <= refRect.top + 1 || side === "left" && x >= refRect.right - 1 || side === "right" && x <= refRect.left + 1) { 6960 closeIfNoOpenChild(); 6961 return void 0; 6962 } 6963 let isInsideTroughRect = false; 6964 switch (side) { 6965 case "top": 6966 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1); 6967 break; 6968 case "bottom": 6969 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1); 6970 break; 6971 case "left": 6972 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top); 6973 break; 6974 case "right": 6975 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top); 6976 break; 6977 default: 6978 } 6979 if (isInsideTroughRect) { 6980 return void 0; 6981 } 6982 if (hasLanded && !isInsideRect(clientX, clientY, refRect)) { 6983 closeIfNoOpenChild(); 6984 return void 0; 6985 } 6986 if (!isLeave && isCursorMovingSlowly(clientX, clientY)) { 6987 closeIfNoOpenChild(); 6988 return void 0; 6989 } 6990 let isInsidePolygon = false; 6991 switch (side) { 6992 case "top": { 6993 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6994 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6995 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6996 const cursorPointY = y + POLYGON_BUFFER + 1; 6997 const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top; 6998 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER; 6999 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 7000 break; 7001 } 7002 case "bottom": { 7003 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 7004 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 7005 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 7006 const cursorPointY = y - POLYGON_BUFFER; 7007 const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom; 7008 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER; 7009 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 7010 break; 7011 } 7012 case "left": { 7013 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 7014 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 7015 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 7016 const cursorPointX = x + POLYGON_BUFFER + 1; 7017 const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left; 7018 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER; 7019 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY); 7020 break; 7021 } 7022 case "right": { 7023 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 7024 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 7025 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 7026 const cursorPointX = x - POLYGON_BUFFER; 7027 const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right; 7028 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER; 7029 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom); 7030 break; 7031 } 7032 default: 7033 } 7034 if (!isInsidePolygon) { 7035 closeIfNoOpenChild(); 7036 } else if (!hasLanded) { 7037 timeout.start(40, closeIfNoOpenChild); 7038 } 7039 return void 0; 7040 }; 7041 }; 7042 fn.__options = { 7043 ...options, 7044 blockPointerEvents 7045 }; 7046 return fn; 7047 } 7048 7049 // node_modules/.store/@floating-ui/core@1.8.0-3V8aS7jJHHGcsCINjP9-5A/node_modules/@floating-ui/core/dist/floating-ui.core.mjs 7050 function computeCoordsFromPlacement(_ref, placement, rtl) { 7051 let { 7052 reference, 7053 floating 7054 } = _ref; 7055 const sideAxis = getSideAxis(placement); 7056 const alignmentAxis = getAlignmentAxis(placement); 7057 const alignLength = getAxisLength(alignmentAxis); 7058 const side = getSide(placement); 7059 const isVertical = sideAxis === "y"; 7060 const commonX = reference.x + reference.width / 2 - floating.width / 2; 7061 const commonY = reference.y + reference.height / 2 - floating.height / 2; 7062 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 7063 let coords; 7064 switch (side) { 7065 case "top": 7066 coords = { 7067 x: commonX, 7068 y: reference.y - floating.height 7069 }; 7070 break; 7071 case "bottom": 7072 coords = { 7073 x: commonX, 7074 y: reference.y + reference.height 7075 }; 7076 break; 7077 case "right": 7078 coords = { 7079 x: reference.x + reference.width, 7080 y: commonY 7081 }; 7082 break; 7083 case "left": 7084 coords = { 7085 x: reference.x - floating.width, 7086 y: commonY 7087 }; 7088 break; 7089 default: 7090 coords = { 7091 x: reference.x, 7092 y: reference.y 7093 }; 7094 } 7095 const alignment = getAlignment(placement); 7096 if (alignment) { 7097 coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1); 7098 } 7099 return coords; 7100 } 7101 async function detectOverflow(state, options) { 7102 var _await$platform$isEle; 7103 if (options === void 0) { 7104 options = {}; 7105 } 7106 const { 7107 x, 7108 y, 7109 platform: platform3, 7110 rects, 7111 elements, 7112 strategy 7113 } = state; 7114 const { 7115 boundary = "clippingAncestors", 7116 rootBoundary = "viewport", 7117 elementContext = "floating", 7118 altBoundary = false, 7119 padding = 0 7120 } = evaluate(options, state); 7121 const paddingObject = getPaddingObject(padding); 7122 const altContext = elementContext === "floating" ? "reference" : "floating"; 7123 const element = elements[altBoundary ? altContext : elementContext]; 7124 const clippingClientRect = rectToClientRect(await platform3.getClippingRect({ 7125 element: ((_await$platform$isEle = await (platform3.isElement == null ? void 0 : platform3.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || await (platform3.getDocumentElement == null ? void 0 : platform3.getDocumentElement(elements.floating)), 7126 boundary, 7127 rootBoundary, 7128 strategy 7129 })); 7130 const rect = elementContext === "floating" ? { 7131 x, 7132 y, 7133 width: rects.floating.width, 7134 height: rects.floating.height 7135 } : rects.reference; 7136 const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating)); 7137 const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { 7138 x: 1, 7139 y: 1 7140 }; 7141 const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ 7142 elements, 7143 rect, 7144 offsetParent, 7145 strategy 7146 }) : rect); 7147 return { 7148 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 7149 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 7150 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 7151 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 7152 }; 7153 } 7154 var MAX_RESET_COUNT = 50; 7155 var computePosition = async (reference, floating, config) => { 7156 const { 7157 placement = "bottom", 7158 strategy = "absolute", 7159 middleware = [], 7160 platform: platform3 7161 } = config; 7162 const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : { 7163 ...platform3, 7164 detectOverflow 7165 }; 7166 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating)); 7167 let rects = await platform3.getElementRects({ 7168 reference, 7169 floating, 7170 strategy 7171 }); 7172 let { 7173 x, 7174 y 7175 } = computeCoordsFromPlacement(rects, placement, rtl); 7176 let statefulPlacement = placement; 7177 let resetCount = 0; 7178 const middlewareData = {}; 7179 for (let i = 0; i < middleware.length; i++) { 7180 const currentMiddleware = middleware[i]; 7181 if (!currentMiddleware) { 7182 continue; 7183 } 7184 const { 7185 name: name2, 7186 fn 7187 } = currentMiddleware; 7188 const { 7189 x: nextX, 7190 y: nextY, 7191 data, 7192 reset 7193 } = await fn({ 7194 x, 7195 y, 7196 initialPlacement: placement, 7197 placement: statefulPlacement, 7198 strategy, 7199 middlewareData, 7200 rects, 7201 platform: platformWithDetectOverflow, 7202 elements: { 7203 reference, 7204 floating 7205 } 7206 }); 7207 x = nextX != null ? nextX : x; 7208 y = nextY != null ? nextY : y; 7209 middlewareData[name2] = { 7210 ...middlewareData[name2], 7211 ...data 7212 }; 7213 if (reset && resetCount < MAX_RESET_COUNT) { 7214 resetCount++; 7215 if (typeof reset === "object") { 7216 if (reset.placement) { 7217 statefulPlacement = reset.placement; 7218 } 7219 if (reset.rects) { 7220 rects = reset.rects === true ? await platform3.getElementRects({ 7221 reference, 7222 floating, 7223 strategy 7224 }) : reset.rects; 7225 } 7226 ({ 7227 x, 7228 y 7229 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 7230 } 7231 i = -1; 7232 } 7233 } 7234 return { 7235 x, 7236 y, 7237 placement: statefulPlacement, 7238 strategy, 7239 middlewareData 7240 }; 7241 }; 7242 var flip = function(options) { 7243 if (options === void 0) { 7244 options = {}; 7245 } 7246 return { 7247 name: "flip", 7248 options, 7249 async fn(state) { 7250 var _middlewareData$arrow, _middlewareData$flip; 7251 const { 7252 placement, 7253 middlewareData, 7254 rects, 7255 initialPlacement, 7256 platform: platform3, 7257 elements 7258 } = state; 7259 const { 7260 mainAxis: checkMainAxis = true, 7261 crossAxis: checkCrossAxis = true, 7262 fallbackPlacements: specifiedFallbackPlacements, 7263 fallbackStrategy = "bestFit", 7264 fallbackAxisSideDirection = "none", 7265 flipAlignment = true, 7266 ...detectOverflowOptions 7267 } = evaluate(options, state); 7268 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 7269 return {}; 7270 } 7271 const side = getSide(placement); 7272 const initialSideAxis = getSideAxis(initialPlacement); 7273 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 7274 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 7275 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 7276 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 7277 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 7278 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 7279 } 7280 const placements2 = [initialPlacement, ...fallbackPlacements]; 7281 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 7282 const overflows = []; 7283 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 7284 if (checkMainAxis) { 7285 overflows.push(overflow[side]); 7286 } 7287 if (checkCrossAxis) { 7288 const sides2 = getAlignmentSides(placement, rects, rtl); 7289 overflows.push(overflow[sides2[0]], overflow[sides2[1]]); 7290 } 7291 overflowsData = [...overflowsData, { 7292 placement, 7293 overflows 7294 }]; 7295 if (!overflows.every((side2) => side2 <= 0)) { 7296 var _middlewareData$flip2, _overflowsData$filter; 7297 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 7298 const nextPlacement = placements2[nextIndex]; 7299 if (nextPlacement) { 7300 const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; 7301 if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis 7302 // overflows the main axis. 7303 overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { 7304 return { 7305 data: { 7306 index: nextIndex, 7307 overflows: overflowsData 7308 }, 7309 reset: { 7310 placement: nextPlacement 7311 } 7312 }; 7313 } 7314 } 7315 let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 7316 if (!resetPlacement) { 7317 switch (fallbackStrategy) { 7318 case "bestFit": { 7319 var _overflowsData$filter2; 7320 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => { 7321 if (hasFallbackAxisSideDirection) { 7322 const currentSideAxis = getSideAxis(d.placement); 7323 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 7324 // reading directions favoring greater width. 7325 currentSideAxis === "y"; 7326 } 7327 return true; 7328 }).map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 7329 if (placement2) { 7330 resetPlacement = placement2; 7331 } 7332 break; 7333 } 7334 case "initialPlacement": 7335 resetPlacement = initialPlacement; 7336 break; 7337 } 7338 } 7339 if (placement !== resetPlacement) { 7340 return { 7341 reset: { 7342 placement: resetPlacement 7343 } 7344 }; 7345 } 7346 } 7347 return {}; 7348 } 7349 }; 7350 }; 7351 var originSides = /* @__PURE__ */ new Set(["left", "top"]); 7352 async function convertValueToCoords(state, options) { 7353 const { 7354 placement, 7355 platform: platform3, 7356 elements 7357 } = state; 7358 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 7359 const side = getSide(placement); 7360 const alignment = getAlignment(placement); 7361 const isVertical = getSideAxis(placement) === "y"; 7362 const mainAxisMulti = originSides.has(side) ? -1 : 1; 7363 const crossAxisMulti = rtl && isVertical ? -1 : 1; 7364 const rawValue = evaluate(options, state); 7365 let { 7366 mainAxis, 7367 crossAxis, 7368 alignmentAxis 7369 } = typeof rawValue === "number" ? { 7370 mainAxis: rawValue, 7371 crossAxis: 0, 7372 alignmentAxis: null 7373 } : { 7374 mainAxis: rawValue.mainAxis || 0, 7375 crossAxis: rawValue.crossAxis || 0, 7376 alignmentAxis: rawValue.alignmentAxis 7377 }; 7378 if (alignment && typeof alignmentAxis === "number") { 7379 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 7380 } 7381 return isVertical ? { 7382 x: crossAxis * crossAxisMulti, 7383 y: mainAxis * mainAxisMulti 7384 } : { 7385 x: mainAxis * mainAxisMulti, 7386 y: crossAxis * crossAxisMulti 7387 }; 7388 } 7389 var offset = function(options) { 7390 if (options === void 0) { 7391 options = 0; 7392 } 7393 return { 7394 name: "offset", 7395 options, 7396 async fn(state) { 7397 var _middlewareData$offse, _middlewareData$arrow; 7398 const { 7399 x, 7400 y, 7401 placement, 7402 middlewareData 7403 } = state; 7404 const diffCoords = await convertValueToCoords(state, options); 7405 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 7406 return {}; 7407 } 7408 return { 7409 x: x + diffCoords.x, 7410 y: y + diffCoords.y, 7411 data: { 7412 ...diffCoords, 7413 placement 7414 } 7415 }; 7416 } 7417 }; 7418 }; 7419 var shift = function(options) { 7420 if (options === void 0) { 7421 options = {}; 7422 } 7423 return { 7424 name: "shift", 7425 options, 7426 async fn(state) { 7427 const { 7428 x, 7429 y, 7430 placement, 7431 platform: platform3 7432 } = state; 7433 const { 7434 mainAxis: checkMainAxis = true, 7435 crossAxis: checkCrossAxis = false, 7436 limiter = { 7437 fn: (_ref) => { 7438 let { 7439 x: x2, 7440 y: y2 7441 } = _ref; 7442 return { 7443 x: x2, 7444 y: y2 7445 }; 7446 } 7447 }, 7448 ...detectOverflowOptions 7449 } = evaluate(options, state); 7450 const coords = { 7451 x, 7452 y 7453 }; 7454 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 7455 const crossAxis = getSideAxis(placement); 7456 const mainAxis = getOppositeAxis(crossAxis); 7457 let mainAxisCoord = coords[mainAxis]; 7458 let crossAxisCoord = coords[crossAxis]; 7459 const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]); 7460 if (checkMainAxis) { 7461 mainAxisCoord = clampCoord(mainAxis, mainAxisCoord); 7462 } 7463 if (checkCrossAxis) { 7464 crossAxisCoord = clampCoord(crossAxis, crossAxisCoord); 7465 } 7466 const limitedCoords = limiter.fn({ 7467 ...state, 7468 [mainAxis]: mainAxisCoord, 7469 [crossAxis]: crossAxisCoord 7470 }); 7471 return { 7472 ...limitedCoords, 7473 data: { 7474 x: limitedCoords.x - x, 7475 y: limitedCoords.y - y, 7476 enabled: { 7477 [mainAxis]: checkMainAxis, 7478 [crossAxis]: checkCrossAxis 7479 } 7480 } 7481 }; 7482 } 7483 }; 7484 }; 7485 var limitShift = function(options) { 7486 if (options === void 0) { 7487 options = {}; 7488 } 7489 return { 7490 options, 7491 fn(state) { 7492 var _rawOffset$mainAxis, _rawOffset$crossAxis; 7493 const { 7494 x, 7495 y, 7496 placement, 7497 rects, 7498 middlewareData 7499 } = state; 7500 const { 7501 offset: offset4 = 0, 7502 mainAxis: checkMainAxis = true, 7503 crossAxis: checkCrossAxis = true 7504 } = evaluate(options, state); 7505 const coords = { 7506 x, 7507 y 7508 }; 7509 const crossAxis = getSideAxis(placement); 7510 const mainAxis = getOppositeAxis(crossAxis); 7511 let mainAxisCoord = coords[mainAxis]; 7512 let crossAxisCoord = coords[crossAxis]; 7513 const rawOffset = evaluate(offset4, state); 7514 const computedOffset = typeof rawOffset === "number" ? { 7515 mainAxis: rawOffset, 7516 crossAxis: 0 7517 } : { 7518 mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0, 7519 crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0 7520 }; 7521 if (checkMainAxis) { 7522 const len = mainAxis === "y" ? "height" : "width"; 7523 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 7524 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 7525 if (mainAxisCoord < limitMin) { 7526 mainAxisCoord = limitMin; 7527 } else if (mainAxisCoord > limitMax) { 7528 mainAxisCoord = limitMax; 7529 } 7530 } 7531 if (checkCrossAxis) { 7532 var _middlewareData$offse, _middlewareData$offse2; 7533 const len = mainAxis === "y" ? "width" : "height"; 7534 const isOriginSide = originSides.has(getSide(placement)); 7535 const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis); 7536 const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0); 7537 if (crossAxisCoord < limitMin) { 7538 crossAxisCoord = limitMin; 7539 } else if (crossAxisCoord > limitMax) { 7540 crossAxisCoord = limitMax; 7541 } 7542 } 7543 return { 7544 [mainAxis]: mainAxisCoord, 7545 [crossAxis]: crossAxisCoord 7546 }; 7547 } 7548 }; 7549 }; 7550 var size = function(options) { 7551 if (options === void 0) { 7552 options = {}; 7553 } 7554 return { 7555 name: "size", 7556 options, 7557 async fn(state) { 7558 const { 7559 placement, 7560 rects, 7561 platform: platform3, 7562 elements 7563 } = state; 7564 const { 7565 apply = () => { 7566 }, 7567 ...detectOverflowOptions 7568 } = evaluate(options, state); 7569 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 7570 const side = getSide(placement); 7571 const alignment = getAlignment(placement); 7572 const isYAxis = getSideAxis(placement) === "y"; 7573 const { 7574 width, 7575 height 7576 } = rects.floating; 7577 let heightSide; 7578 let widthSide; 7579 if (side === "top" || side === "bottom") { 7580 heightSide = side; 7581 widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right"; 7582 } else { 7583 widthSide = side; 7584 heightSide = alignment === "end" ? "top" : "bottom"; 7585 } 7586 const maximumClippingHeight = height - overflow.top - overflow.bottom; 7587 const maximumClippingWidth = width - overflow.left - overflow.right; 7588 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 7589 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 7590 const shiftData = state.middlewareData.shift; 7591 const noShift = !shiftData; 7592 let availableHeight2 = overflowAvailableHeight; 7593 let availableWidth2 = overflowAvailableWidth; 7594 if (shiftData != null && shiftData.enabled.x) { 7595 availableWidth2 = maximumClippingWidth; 7596 } 7597 if (shiftData != null && shiftData.enabled.y) { 7598 availableHeight2 = maximumClippingHeight; 7599 } 7600 if (noShift && !alignment) { 7601 if (isYAxis) { 7602 availableWidth2 = width - 2 * max(overflow.left, overflow.right); 7603 } else { 7604 availableHeight2 = height - 2 * max(overflow.top, overflow.bottom); 7605 } 7606 } 7607 await apply({ 7608 ...state, 7609 availableWidth: availableWidth2, 7610 availableHeight: availableHeight2 7611 }); 7612 const nextDimensions = await platform3.getDimensions(elements.floating); 7613 if (width !== nextDimensions.width || height !== nextDimensions.height) { 7614 return { 7615 reset: { 7616 rects: true 7617 } 7618 }; 7619 } 7620 return {}; 7621 } 7622 }; 7623 }; 7624 7625 // node_modules/.store/@floating-ui/dom@1.8.0-vHXcr4FgWneV0cgwFw-d7A/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 7626 function getCssDimensions(element) { 7627 const css = getComputedStyle2(element); 7628 let width = parseFloat(css.width) || 0; 7629 let height = parseFloat(css.height) || 0; 7630 const hasOffset = isHTMLElement(element); 7631 const offsetWidth = hasOffset ? element.offsetWidth : width; 7632 const offsetHeight = hasOffset ? element.offsetHeight : height; 7633 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 7634 if (shouldFallback) { 7635 width = offsetWidth; 7636 height = offsetHeight; 7637 } 7638 return { 7639 width, 7640 height, 7641 $: shouldFallback 7642 }; 7643 } 7644 function unwrapElement(element) { 7645 return !isElement(element) ? element.contextElement : element; 7646 } 7647 function getScale(element) { 7648 const domElement = unwrapElement(element); 7649 if (!isHTMLElement(domElement)) { 7650 return createCoords(1); 7651 } 7652 const rect = domElement.getBoundingClientRect(); 7653 const { 7654 width, 7655 height, 7656 $ 7657 } = getCssDimensions(domElement); 7658 let x = ($ ? round(rect.width) : rect.width) / width; 7659 let y = ($ ? round(rect.height) : rect.height) / height; 7660 if (!x || !Number.isFinite(x)) { 7661 x = 1; 7662 } 7663 if (!y || !Number.isFinite(y)) { 7664 y = 1; 7665 } 7666 return { 7667 x, 7668 y 7669 }; 7670 } 7671 var noOffsets = /* @__PURE__ */ createCoords(0); 7672 function getVisualOffsets(element) { 7673 const win = getWindow(element); 7674 if (!isWebKit() || !win.visualViewport) { 7675 return noOffsets; 7676 } 7677 return { 7678 x: win.visualViewport.offsetLeft, 7679 y: win.visualViewport.offsetTop 7680 }; 7681 } 7682 function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 7683 if (isFixed === void 0) { 7684 isFixed = false; 7685 } 7686 return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); 7687 } 7688 function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 7689 if (includeScale === void 0) { 7690 includeScale = false; 7691 } 7692 if (isFixedStrategy === void 0) { 7693 isFixedStrategy = false; 7694 } 7695 const clientRect = element.getBoundingClientRect(); 7696 const domElement = unwrapElement(element); 7697 let scale = createCoords(1); 7698 if (includeScale) { 7699 if (offsetParent) { 7700 if (isElement(offsetParent)) { 7701 scale = getScale(offsetParent); 7702 } 7703 } else { 7704 scale = getScale(element); 7705 } 7706 } 7707 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 7708 let x = (clientRect.left + visualOffsets.x) / scale.x; 7709 let y = (clientRect.top + visualOffsets.y) / scale.y; 7710 let width = clientRect.width / scale.x; 7711 let height = clientRect.height / scale.y; 7712 if (domElement && offsetParent) { 7713 const win = getWindow(domElement); 7714 const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 7715 let currentWin = win; 7716 let currentIFrame = getFrameElement(currentWin); 7717 while (currentIFrame && offsetWin !== currentWin) { 7718 const iframeScale = getScale(currentIFrame); 7719 const iframeRect = currentIFrame.getBoundingClientRect(); 7720 const css = getComputedStyle2(currentIFrame); 7721 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 7722 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 7723 x *= iframeScale.x; 7724 y *= iframeScale.y; 7725 width *= iframeScale.x; 7726 height *= iframeScale.y; 7727 x += left; 7728 y += top; 7729 currentWin = getWindow(currentIFrame); 7730 currentIFrame = getFrameElement(currentWin); 7731 } 7732 } 7733 return rectToClientRect({ 7734 width, 7735 height, 7736 x, 7737 y 7738 }); 7739 } 7740 function getWindowScrollBarX(element, rect) { 7741 const leftScroll = getNodeScroll(element).scrollLeft; 7742 if (!rect) { 7743 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 7744 } 7745 return rect.left + leftScroll; 7746 } 7747 function getHTMLOffset(documentElement, scroll) { 7748 const htmlRect = documentElement.getBoundingClientRect(); 7749 const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 7750 const y = htmlRect.top + scroll.scrollTop; 7751 return { 7752 x, 7753 y 7754 }; 7755 } 7756 function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 7757 let { 7758 elements, 7759 rect, 7760 offsetParent, 7761 strategy 7762 } = _ref; 7763 const isFixed = strategy === "fixed"; 7764 const documentElement = getDocumentElement(offsetParent); 7765 const topLayer = elements ? isTopLayer(elements.floating) : false; 7766 if (offsetParent === documentElement || topLayer && isFixed) { 7767 return rect; 7768 } 7769 let scroll = { 7770 scrollLeft: 0, 7771 scrollTop: 0 7772 }; 7773 let scale = createCoords(1); 7774 const offsets = createCoords(0); 7775 const isOffsetParentAnElement = isHTMLElement(offsetParent); 7776 if (isOffsetParentAnElement || !isFixed) { 7777 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 7778 scroll = getNodeScroll(offsetParent); 7779 } 7780 if (isOffsetParentAnElement) { 7781 const offsetRect = getBoundingClientRect(offsetParent); 7782 scale = getScale(offsetParent); 7783 offsets.x = offsetRect.x + offsetParent.clientLeft; 7784 offsets.y = offsetRect.y + offsetParent.clientTop; 7785 } 7786 } 7787 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 7788 return { 7789 width: rect.width * scale.x, 7790 height: rect.height * scale.y, 7791 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 7792 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 7793 }; 7794 } 7795 function getClientRects(element) { 7796 return element.getClientRects ? Array.from(element.getClientRects()) : []; 7797 } 7798 function getDocumentRect(html) { 7799 const scroll = getNodeScroll(html); 7800 const body = html.ownerDocument.body; 7801 const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 7802 const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 7803 let x = -scroll.scrollLeft + getWindowScrollBarX(html); 7804 const y = -scroll.scrollTop; 7805 if (getComputedStyle2(body).direction === "rtl") { 7806 x += max(html.clientWidth, body.clientWidth) - width; 7807 } 7808 return { 7809 width, 7810 height, 7811 x, 7812 y 7813 }; 7814 } 7815 var SCROLLBAR_MAX = 25; 7816 function getViewportRect(element, strategy, rootBoundary) { 7817 if (rootBoundary === void 0) { 7818 rootBoundary = "viewport"; 7819 } 7820 const isLayoutViewport = rootBoundary === "layoutViewport"; 7821 const win = getWindow(element); 7822 const html = getDocumentElement(element); 7823 const visualViewport = win.visualViewport; 7824 let width = html.clientWidth; 7825 let height = html.clientHeight; 7826 let x = 0; 7827 let y = 0; 7828 if (visualViewport) { 7829 const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed"; 7830 if (isLayoutViewport) { 7831 if (!layoutRelativeClientCoords) { 7832 x = -visualViewport.offsetLeft; 7833 y = -visualViewport.offsetTop; 7834 } 7835 } else { 7836 width = visualViewport.width; 7837 height = visualViewport.height; 7838 if (layoutRelativeClientCoords) { 7839 x = visualViewport.offsetLeft; 7840 y = visualViewport.offsetTop; 7841 } 7842 } 7843 } 7844 const windowScrollbarX = getWindowScrollBarX(html); 7845 if (windowScrollbarX <= 0) { 7846 const doc = html.ownerDocument; 7847 const body = doc.body; 7848 const bodyStyles = getComputedStyle(body); 7849 const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 7850 const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); 7851 const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth; 7852 if (gutter <= SCROLLBAR_MAX) { 7853 width -= gutter; 7854 } 7855 } 7856 return { 7857 width, 7858 height, 7859 x, 7860 y 7861 }; 7862 } 7863 function getInnerBoundingClientRect(element, strategy) { 7864 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 7865 const top = clientRect.top + element.clientTop; 7866 const left = clientRect.left + element.clientLeft; 7867 const scale = getScale(element); 7868 const width = element.clientWidth * scale.x; 7869 const height = element.clientHeight * scale.y; 7870 const x = left * scale.x; 7871 const y = top * scale.y; 7872 return { 7873 width, 7874 height, 7875 x, 7876 y 7877 }; 7878 } 7879 function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 7880 let rect; 7881 if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") { 7882 rect = getViewportRect(element, strategy, clippingAncestor); 7883 } else if (clippingAncestor === "document") { 7884 rect = getDocumentRect(getDocumentElement(element)); 7885 } else if (isElement(clippingAncestor)) { 7886 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 7887 } else { 7888 const visualOffsets = getVisualOffsets(element); 7889 rect = { 7890 x: clippingAncestor.x - visualOffsets.x, 7891 y: clippingAncestor.y - visualOffsets.y, 7892 width: clippingAncestor.width, 7893 height: clippingAncestor.height 7894 }; 7895 } 7896 return rectToClientRect(rect); 7897 } 7898 function getClippingElementAncestors(element, cache) { 7899 const cachedResult = cache.get(element); 7900 if (cachedResult) { 7901 return cachedResult; 7902 } 7903 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 7904 let lastKeptComputedStyle = null; 7905 const elementIsFixed = getComputedStyle2(element).position === "fixed"; 7906 let currentNode = elementIsFixed ? getParentNode(element) : element; 7907 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 7908 const computedStyle = getComputedStyle2(currentNode); 7909 const currentNodeIsContaining = isContainingBlock(currentNode); 7910 const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : ""; 7911 const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static"); 7912 if (shouldDropCurrentNode) { 7913 result = result.filter((ancestor) => ancestor !== currentNode); 7914 } else { 7915 lastKeptComputedStyle = computedStyle; 7916 } 7917 currentNode = getParentNode(currentNode); 7918 } 7919 cache.set(element, result); 7920 return result; 7921 } 7922 function getClippingRect(_ref) { 7923 let { 7924 element, 7925 boundary, 7926 rootBoundary, 7927 strategy 7928 } = _ref; 7929 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 7930 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 7931 const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); 7932 let top = firstRect.top; 7933 let right = firstRect.right; 7934 let bottom = firstRect.bottom; 7935 let left = firstRect.left; 7936 for (let i = 1; i < clippingAncestors.length; i++) { 7937 const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy); 7938 top = max(rect.top, top); 7939 right = min(rect.right, right); 7940 bottom = min(rect.bottom, bottom); 7941 left = max(rect.left, left); 7942 } 7943 return { 7944 width: right - left, 7945 height: bottom - top, 7946 x: left, 7947 y: top 7948 }; 7949 } 7950 function getDimensions2(element) { 7951 const { 7952 width, 7953 height 7954 } = getCssDimensions(element); 7955 return { 7956 width, 7957 height 7958 }; 7959 } 7960 function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 7961 const isOffsetParentAnElement = isHTMLElement(offsetParent); 7962 const documentElement = getDocumentElement(offsetParent); 7963 const isFixed = strategy === "fixed"; 7964 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 7965 let scroll = { 7966 scrollLeft: 0, 7967 scrollTop: 0 7968 }; 7969 const offsets = createCoords(0); 7970 if (isOffsetParentAnElement || !isFixed) { 7971 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 7972 scroll = getNodeScroll(offsetParent); 7973 } 7974 if (isOffsetParentAnElement) { 7975 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 7976 offsets.x = offsetRect.x + offsetParent.clientLeft; 7977 offsets.y = offsetRect.y + offsetParent.clientTop; 7978 } 7979 } 7980 if (!isOffsetParentAnElement && documentElement) { 7981 offsets.x = getWindowScrollBarX(documentElement); 7982 } 7983 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 7984 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 7985 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 7986 return { 7987 x, 7988 y, 7989 width: rect.width, 7990 height: rect.height 7991 }; 7992 } 7993 function isStaticPositioned(element) { 7994 return getComputedStyle2(element).position === "static"; 7995 } 7996 function getTrueOffsetParent(element, polyfill) { 7997 if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { 7998 return null; 7999 } 8000 if (polyfill) { 8001 return polyfill(element); 8002 } 8003 let rawOffsetParent = element.offsetParent; 8004 if (getDocumentElement(element) === rawOffsetParent) { 8005 rawOffsetParent = rawOffsetParent.ownerDocument.body; 8006 } 8007 return rawOffsetParent; 8008 } 8009 function getOffsetParent(element, polyfill) { 8010 const win = getWindow(element); 8011 if (isTopLayer(element)) { 8012 return win; 8013 } 8014 if (!isHTMLElement(element)) { 8015 let svgOffsetParent = getParentNode(element); 8016 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 8017 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 8018 return svgOffsetParent; 8019 } 8020 svgOffsetParent = getParentNode(svgOffsetParent); 8021 } 8022 return win; 8023 } 8024 let offsetParent = getTrueOffsetParent(element, polyfill); 8025 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 8026 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 8027 } 8028 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 8029 return win; 8030 } 8031 return offsetParent || getContainingBlock(element) || win; 8032 } 8033 var getElementRects = async function(data) { 8034 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 8035 const getDimensionsFn = this.getDimensions; 8036 const floatingDimensions = await getDimensionsFn(data.floating); 8037 return { 8038 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 8039 floating: { 8040 x: 0, 8041 y: 0, 8042 width: floatingDimensions.width, 8043 height: floatingDimensions.height 8044 } 8045 }; 8046 }; 8047 function isRTL(element) { 8048 return getComputedStyle2(element).direction === "rtl"; 8049 } 8050 var platform2 = { 8051 convertOffsetParentRelativeRectToViewportRelativeRect, 8052 getDocumentElement, 8053 getClippingRect, 8054 getOffsetParent, 8055 getElementRects, 8056 getClientRects, 8057 getDimensions: getDimensions2, 8058 getScale, 8059 isElement, 8060 isRTL 8061 }; 8062 function rectsAreEqual(a, b) { 8063 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 8064 } 8065 function observeMove(element, onMove, ancestorResize) { 8066 let io = null; 8067 let timeoutId; 8068 const root = getDocumentElement(element); 8069 function cleanup() { 8070 var _io; 8071 clearTimeout(timeoutId); 8072 (_io = io) == null || _io.disconnect(); 8073 io = null; 8074 } 8075 function refresh(skip, threshold) { 8076 if (skip === void 0) { 8077 skip = false; 8078 } 8079 if (threshold === void 0) { 8080 threshold = 1; 8081 } 8082 cleanup(); 8083 const elementRectForRootMargin = element.getBoundingClientRect(); 8084 const { 8085 left, 8086 top, 8087 width, 8088 height 8089 } = elementRectForRootMargin; 8090 if (!skip) { 8091 onMove(); 8092 } 8093 if (!width || !height) { 8094 return; 8095 } 8096 const insetTop = floor(top); 8097 const insetRight = floor(root.clientWidth - (left + width)); 8098 const insetBottom = floor(root.clientHeight - (top + height)); 8099 const insetLeft = floor(left); 8100 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 8101 const options = { 8102 rootMargin, 8103 threshold: max(0, min(1, threshold)) || 1 8104 }; 8105 let isFirstUpdate = true; 8106 function handleObserve(entries) { 8107 const ratio = entries[0].intersectionRatio; 8108 if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 8109 return refresh(); 8110 } 8111 if (ratio !== threshold) { 8112 if (!isFirstUpdate) { 8113 return refresh(); 8114 } 8115 if (!ratio) { 8116 timeoutId = setTimeout(() => { 8117 refresh(false, 1e-7); 8118 }, 1e3); 8119 } else { 8120 refresh(false, ratio); 8121 } 8122 } 8123 isFirstUpdate = false; 8124 } 8125 try { 8126 io = new IntersectionObserver(handleObserve, { 8127 ...options, 8128 // Handle <iframe>s 8129 root: root.ownerDocument 8130 }); 8131 } catch (_e) { 8132 io = new IntersectionObserver(handleObserve, options); 8133 } 8134 io.observe(element); 8135 } 8136 const win = getWindow(element); 8137 const handleResize = () => refresh(ancestorResize); 8138 win.addEventListener("resize", handleResize); 8139 refresh(true); 8140 return () => { 8141 win.removeEventListener("resize", handleResize); 8142 cleanup(); 8143 }; 8144 } 8145 function autoUpdate(reference, floating, update2, options) { 8146 if (options === void 0) { 8147 options = {}; 8148 } 8149 const { 8150 ancestorScroll = true, 8151 ancestorResize = true, 8152 elementResize = typeof ResizeObserver === "function", 8153 layoutShift = typeof IntersectionObserver === "function", 8154 animationFrame = false 8155 } = options; 8156 const referenceEl = unwrapElement(reference); 8157 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : []; 8158 ancestors.forEach((ancestor) => { 8159 ancestorScroll && ancestor.addEventListener("scroll", update2); 8160 ancestorResize && ancestor.addEventListener("resize", update2); 8161 }); 8162 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null; 8163 let reobserveFrame = -1; 8164 let resizeObserver = null; 8165 if (elementResize) { 8166 resizeObserver = new ResizeObserver((_ref) => { 8167 let [firstEntry] = _ref; 8168 if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) { 8169 resizeObserver.unobserve(floating); 8170 cancelAnimationFrame(reobserveFrame); 8171 reobserveFrame = requestAnimationFrame(() => { 8172 var _resizeObserver; 8173 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 8174 }); 8175 } 8176 update2(); 8177 }); 8178 if (referenceEl && !animationFrame) { 8179 resizeObserver.observe(referenceEl); 8180 } 8181 if (floating) { 8182 resizeObserver.observe(floating); 8183 } 8184 } 8185 let frameId; 8186 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 8187 if (animationFrame) { 8188 frameLoop(); 8189 } 8190 function frameLoop() { 8191 const nextRefRect = getBoundingClientRect(reference); 8192 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 8193 update2(); 8194 } 8195 prevRefRect = nextRefRect; 8196 frameId = requestAnimationFrame(frameLoop); 8197 } 8198 update2(); 8199 return () => { 8200 var _resizeObserver2; 8201 ancestors.forEach((ancestor) => { 8202 ancestorScroll && ancestor.removeEventListener("scroll", update2); 8203 ancestorResize && ancestor.removeEventListener("resize", update2); 8204 }); 8205 cleanupIo == null || cleanupIo(); 8206 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 8207 resizeObserver = null; 8208 if (animationFrame) { 8209 cancelAnimationFrame(frameId); 8210 } 8211 }; 8212 } 8213 var offset2 = offset; 8214 var shift2 = shift; 8215 var flip2 = flip; 8216 var size2 = size; 8217 var limitShift2 = limitShift; 8218 var computePosition2 = (reference, floating, options) => { 8219 const cache = /* @__PURE__ */ new Map(); 8220 const mergedOptions = options != null ? options : {}; 8221 const platformWithCache = { 8222 ...platform2, 8223 ...mergedOptions.platform, 8224 _c: cache 8225 }; 8226 return computePosition(reference, floating, { 8227 ...mergedOptions, 8228 platform: platformWithCache 8229 }); 8230 }; 8231 8232 // node_modules/.store/@floating-ui/react-dom@2.1.9-AxWcAwqlMfOrAFOinFKSVg/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs 8233 var React34 = __toESM(require_react(), 1); 8234 var import_react2 = __toESM(require_react(), 1); 8235 var ReactDOM5 = __toESM(require_react_dom(), 1); 8236 var isClient = typeof document !== "undefined"; 8237 var noop2 = function noop3() { 8238 }; 8239 var index = isClient ? import_react2.useLayoutEffect : noop2; 8240 function deepEqual(a, b) { 8241 if (a === b) { 8242 return true; 8243 } 8244 if (typeof a !== typeof b) { 8245 return false; 8246 } 8247 if (typeof a === "function" && a.toString() === b.toString()) { 8248 return true; 8249 } 8250 let length; 8251 let i; 8252 let keys; 8253 if (a && b && typeof a === "object") { 8254 if (Array.isArray(a)) { 8255 length = a.length; 8256 if (length !== b.length) return false; 8257 for (i = length; i-- !== 0; ) { 8258 if (!deepEqual(a[i], b[i])) { 8259 return false; 8260 } 8261 } 8262 return true; 8263 } 8264 keys = Object.keys(a); 8265 length = keys.length; 8266 if (length !== Object.keys(b).length) { 8267 return false; 8268 } 8269 for (i = length; i-- !== 0; ) { 8270 if (!{}.hasOwnProperty.call(b, keys[i])) { 8271 return false; 8272 } 8273 } 8274 for (i = length; i-- !== 0; ) { 8275 const key = keys[i]; 8276 if (key === "_owner" && a.$$typeof) { 8277 continue; 8278 } 8279 if (!deepEqual(a[key], b[key])) { 8280 return false; 8281 } 8282 } 8283 return true; 8284 } 8285 return a !== a && b !== b; 8286 } 8287 function getDPR(element) { 8288 if (typeof window === "undefined") { 8289 return 1; 8290 } 8291 const win = element.ownerDocument.defaultView || window; 8292 return win.devicePixelRatio || 1; 8293 } 8294 function roundByDPR(element, value) { 8295 const dpr = getDPR(element); 8296 return Math.round(value * dpr) / dpr; 8297 } 8298 function useLatestRef(value) { 8299 const ref = React34.useRef(value); 8300 index(() => { 8301 ref.current = value; 8302 }); 8303 return ref; 8304 } 8305 function useFloating(options) { 8306 if (options === void 0) { 8307 options = {}; 8308 } 8309 const { 8310 placement = "bottom", 8311 strategy = "absolute", 8312 middleware = [], 8313 platform: platform3, 8314 elements: { 8315 reference: externalReference, 8316 floating: externalFloating 8317 } = {}, 8318 transform = true, 8319 whileElementsMounted, 8320 open: open3 8321 } = options; 8322 const [data, setData] = React34.useState({ 8323 x: 0, 8324 y: 0, 8325 strategy, 8326 placement, 8327 middlewareData: {}, 8328 isPositioned: false 8329 }); 8330 const [latestMiddleware, setLatestMiddleware] = React34.useState(middleware); 8331 if (!deepEqual(latestMiddleware, middleware)) { 8332 setLatestMiddleware(middleware); 8333 } 8334 const [_reference, _setReference] = React34.useState(null); 8335 const [_floating, _setFloating] = React34.useState(null); 8336 const setReference = React34.useCallback((node) => { 8337 if (node !== referenceRef.current) { 8338 referenceRef.current = node; 8339 _setReference(node); 8340 } 8341 }, []); 8342 const setFloating = React34.useCallback((node) => { 8343 if (node !== floatingRef.current) { 8344 floatingRef.current = node; 8345 _setFloating(node); 8346 } 8347 }, []); 8348 const referenceEl = externalReference || _reference; 8349 const floatingEl = externalFloating || _floating; 8350 const referenceRef = React34.useRef(null); 8351 const floatingRef = React34.useRef(null); 8352 const dataRef = React34.useRef(data); 8353 const hasWhileElementsMounted = whileElementsMounted != null; 8354 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 8355 const platformRef = useLatestRef(platform3); 8356 const openRef = useLatestRef(open3); 8357 const update2 = React34.useCallback(() => { 8358 if (!referenceRef.current || !floatingRef.current) { 8359 return; 8360 } 8361 const config = { 8362 placement, 8363 strategy, 8364 middleware: latestMiddleware 8365 }; 8366 if (platformRef.current) { 8367 config.platform = platformRef.current; 8368 } 8369 computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => { 8370 const fullData = { 8371 ...data2, 8372 // The floating element's position may be recomputed while it's closed 8373 // but still mounted (such as when transitioning out). To ensure 8374 // `isPositioned` will be `false` initially on the next open, avoid 8375 // setting it to `true` when `open === false` (must be specified). 8376 isPositioned: openRef.current !== false 8377 }; 8378 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 8379 dataRef.current = fullData; 8380 ReactDOM5.flushSync(() => { 8381 setData(fullData); 8382 }); 8383 } 8384 }); 8385 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 8386 index(() => { 8387 if (open3 === false && dataRef.current.isPositioned) { 8388 dataRef.current.isPositioned = false; 8389 setData((data2) => ({ 8390 ...data2, 8391 isPositioned: false 8392 })); 8393 } 8394 }, [open3]); 8395 const isMountedRef = React34.useRef(false); 8396 index(() => { 8397 isMountedRef.current = true; 8398 return () => { 8399 isMountedRef.current = false; 8400 }; 8401 }, []); 8402 index(() => { 8403 if (referenceEl) referenceRef.current = referenceEl; 8404 if (floatingEl) floatingRef.current = floatingEl; 8405 if (referenceEl && floatingEl) { 8406 if (whileElementsMountedRef.current) { 8407 return whileElementsMountedRef.current(referenceEl, floatingEl, update2); 8408 } 8409 update2(); 8410 } 8411 }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); 8412 const refs = React34.useMemo(() => ({ 8413 reference: referenceRef, 8414 floating: floatingRef, 8415 setReference, 8416 setFloating 8417 }), [setReference, setFloating]); 8418 const elements = React34.useMemo(() => ({ 8419 reference: referenceEl, 8420 floating: floatingEl 8421 }), [referenceEl, floatingEl]); 8422 const floatingStyles = React34.useMemo(() => { 8423 const initialStyles = { 8424 position: strategy, 8425 left: 0, 8426 top: 0 8427 }; 8428 if (!elements.floating) { 8429 return initialStyles; 8430 } 8431 const x = roundByDPR(elements.floating, data.x); 8432 const y = roundByDPR(elements.floating, data.y); 8433 if (transform) { 8434 return { 8435 ...initialStyles, 8436 transform: "translate(" + x + "px, " + y + "px)", 8437 ...getDPR(elements.floating) >= 1.5 && { 8438 willChange: "transform" 8439 } 8440 }; 8441 } 8442 return { 8443 position: strategy, 8444 left: x, 8445 top: y 8446 }; 8447 }, [strategy, transform, elements.floating, data.x, data.y]); 8448 return React34.useMemo(() => ({ 8449 ...data, 8450 update: update2, 8451 refs, 8452 elements, 8453 floatingStyles 8454 }), [data, update2, refs, elements, floatingStyles]); 8455 } 8456 var offset3 = (options, deps) => { 8457 const result = offset2(options); 8458 return { 8459 name: result.name, 8460 fn: result.fn, 8461 options: [options, deps] 8462 }; 8463 }; 8464 var shift3 = (options, deps) => { 8465 const result = shift2(options); 8466 return { 8467 name: result.name, 8468 fn: result.fn, 8469 options: [options, deps] 8470 }; 8471 }; 8472 var limitShift3 = (options, deps) => { 8473 const result = limitShift2(options); 8474 return { 8475 fn: result.fn, 8476 options: [options, deps] 8477 }; 8478 }; 8479 var flip3 = (options, deps) => { 8480 const result = flip2(options); 8481 return { 8482 name: result.name, 8483 fn: result.fn, 8484 options: [options, deps] 8485 }; 8486 }; 8487 var size3 = (options, deps) => { 8488 const result = size2(options); 8489 return { 8490 name: result.name, 8491 fn: result.fn, 8492 options: [options, deps] 8493 }; 8494 }; 8495 8496 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/NullStore.mjs 8497 var NullStore = class extends ReactStore { 8498 // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding 8499 // `setState` alone would neutralize them today. They are overridden explicitly so the store stays 8500 // inert even if a future base-class change stops routing a mutator through `setState`. 8501 setState(_newState) { 8502 } 8503 update(_changes) { 8504 } 8505 set(_key, _value) { 8506 } 8507 notifyAll() { 8508 } 8509 }; 8510 8511 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/inertValue.mjs 8512 function inertValue(value) { 8513 if (isReactVersionAtLeast(19)) { 8514 return value; 8515 } 8516 return value ? "true" : void 0; 8517 } 8518 8519 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs 8520 var React35 = __toESM(require_react(), 1); 8521 var DirectionContext = /* @__PURE__ */ React35.createContext(void 0); 8522 if (true) DirectionContext.displayName = "DirectionContext"; 8523 function useDirection() { 8524 const context = React35.useContext(DirectionContext); 8525 return context?.direction ?? "ltr"; 8526 } 8527 8528 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs 8529 var React37 = __toESM(require_react(), 1); 8530 8531 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs 8532 var React36 = __toESM(require_react(), 1); 8533 function useBaseUIFloating(options) { 8534 const { 8535 nodeId, 8536 externalTree, 8537 rootContext: store3 8538 } = options; 8539 const referenceElement = store3.useState("referenceElement"); 8540 const floatingElement = store3.useState("floatingElement"); 8541 const domReferenceElement = store3.useState("domReferenceElement"); 8542 const open3 = store3.useState("open"); 8543 const floatingId = store3.useState("floatingId"); 8544 const [positionReference, setPositionReferenceRaw] = React36.useState(null); 8545 const domReferenceRef = React36.useRef(null); 8546 const tree = useFloatingTree(externalTree); 8547 const storeElements = React36.useMemo(() => ({ 8548 reference: referenceElement, 8549 floating: floatingElement, 8550 domReference: domReferenceElement 8551 }), [referenceElement, floatingElement, domReferenceElement]); 8552 const position = useFloating({ 8553 ...options, 8554 elements: { 8555 ...storeElements, 8556 ...positionReference && { 8557 reference: positionReference 8558 } 8559 } 8560 }); 8561 const setPositionReference = React36.useCallback((node) => { 8562 const computedPositionReference = isElement(node) ? { 8563 getBoundingClientRect: () => node.getBoundingClientRect(), 8564 getClientRects: () => node.getClientRects(), 8565 contextElement: node 8566 } : node; 8567 setPositionReferenceRaw(computedPositionReference); 8568 position.refs.setReference(computedPositionReference); 8569 }, [position.refs]); 8570 const refs = React36.useMemo(() => ({ 8571 ...position.refs, 8572 setPositionReference, 8573 domReference: domReferenceRef 8574 }), [position.refs, setPositionReference]); 8575 const elements = React36.useMemo(() => ({ 8576 ...position.elements, 8577 domReference: domReferenceElement 8578 }), [position.elements, domReferenceElement]); 8579 const context = React36.useMemo(() => ({ 8580 ...position, 8581 dataRef: store3.context.dataRef, 8582 open: open3, 8583 onOpenChange: store3.setOpen, 8584 events: store3.context.events, 8585 floatingId, 8586 refs, 8587 elements, 8588 nodeId, 8589 rootStore: store3 8590 }), [position, refs, elements, nodeId, store3, open3, floatingId]); 8591 useIsoLayoutEffect(() => { 8592 if (domReferenceElement) { 8593 domReferenceRef.current = domReferenceElement; 8594 } 8595 }, [domReferenceElement]); 8596 useIsoLayoutEffect(() => { 8597 store3.context.dataRef.current.floatingContext = context; 8598 const node = tree?.nodesRef.current.find((n) => n.id === nodeId); 8599 if (node) { 8600 node.context = context; 8601 } 8602 }); 8603 return React36.useMemo(() => ({ 8604 ...position, 8605 context, 8606 refs, 8607 elements, 8608 rootStore: store3 8609 }), [position, refs, elements, context, store3]); 8610 } 8611 8612 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs 8613 var baseArrow = (options) => ({ 8614 name: "arrow", 8615 options, 8616 async fn(state) { 8617 const { 8618 x, 8619 y, 8620 placement, 8621 rects, 8622 platform: platform3, 8623 elements, 8624 middlewareData 8625 } = state; 8626 const { 8627 element, 8628 padding = 0 8629 } = evaluate(options, state) || {}; 8630 if (element == null) { 8631 return {}; 8632 } 8633 const paddingObject = getPaddingObject(padding); 8634 const coords = { 8635 x, 8636 y 8637 }; 8638 const axis = getAlignmentAxis(placement); 8639 const length = getAxisLength(axis); 8640 const arrowDimensions = await platform3.getDimensions(element); 8641 const isYAxis = axis === "y"; 8642 const minProp = isYAxis ? "top" : "left"; 8643 const maxProp = isYAxis ? "bottom" : "right"; 8644 const clientProp = isYAxis ? "clientHeight" : "clientWidth"; 8645 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 8646 const startDiff = coords[axis] - rects.reference[axis]; 8647 const clientSize = elements.floating[clientProp] || rects.floating[length]; 8648 const centerToReference = endDiff / 2 - startDiff / 2; 8649 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 8650 const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding); 8651 const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding); 8652 const min2 = minPadding; 8653 const max2 = clientSize - arrowDimensions[length] - maxPadding; 8654 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 8655 const offset4 = clamp(min2, center, max2); 8656 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 8657 const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0; 8658 return { 8659 [axis]: coords[axis] + alignmentOffset, 8660 data: { 8661 [axis]: offset4, 8662 centerOffset: center - offset4 - alignmentOffset, 8663 ...shouldAddOffset && { 8664 alignmentOffset 8665 } 8666 }, 8667 reset: shouldAddOffset 8668 }; 8669 } 8670 }); 8671 var arrow4 = (options, deps) => { 8672 const { 8673 name: name2, 8674 fn 8675 } = baseArrow(options); 8676 return { 8677 name: name2, 8678 fn, 8679 options: [options, deps] 8680 }; 8681 }; 8682 8683 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/hideMiddleware.mjs 8684 var hide4 = { 8685 name: "hide", 8686 async fn(state) { 8687 const { 8688 width, 8689 height, 8690 x, 8691 y 8692 } = state.rects.reference; 8693 const anchorHidden2 = width === 0 && height === 0 && x === 0 && y === 0; 8694 const overflow = await state.platform.detectOverflow(state, { 8695 elementContext: "reference" 8696 }); 8697 const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0; 8698 return { 8699 data: { 8700 referenceHidden: referenceHidden || anchorHidden2 8701 } 8702 }; 8703 } 8704 }; 8705 8706 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs 8707 var DEFAULT_SIDES = { 8708 sideX: "left", 8709 sideY: "top" 8710 }; 8711 8712 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs 8713 var availableWidth = "--available-width"; 8714 var availableHeight = "--available-height"; 8715 var anchorWidth = "--anchor-width"; 8716 var anchorHeight = "--anchor-height"; 8717 var transformOrigin = "--transform-origin"; 8718 var positionerWidth = "--positioner-width"; 8719 var positionerHeight = "--positioner-height"; 8720 8721 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs 8722 var AVAILABLE_WIDTH_VAR = availableWidth; 8723 var AVAILABLE_HEIGHT_VAR = availableHeight; 8724 function getLogicalSide(sideParam, renderedSide, isRtl) { 8725 const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end"; 8726 const logicalRight = isRtl ? "inline-start" : "inline-end"; 8727 const logicalLeft = isRtl ? "inline-end" : "inline-start"; 8728 return { 8729 top: "top", 8730 right: isLogicalSideParam ? logicalRight : "right", 8731 bottom: "bottom", 8732 left: isLogicalSideParam ? logicalLeft : "left" 8733 }[renderedSide]; 8734 } 8735 function getOffsetData(state, sideParam, isRtl) { 8736 const { 8737 rects, 8738 placement 8739 } = state; 8740 const data = { 8741 side: getLogicalSide(sideParam, getSide(placement), isRtl), 8742 align: getAlignment(placement) || "center", 8743 anchor: { 8744 width: rects.reference.width, 8745 height: rects.reference.height 8746 }, 8747 positioner: { 8748 width: rects.floating.width, 8749 height: rects.floating.height 8750 } 8751 }; 8752 return data; 8753 } 8754 function useAnchorPositioning(params) { 8755 return useAnchorPositioningWithHook(params, useBaseUIFloating); 8756 } 8757 function useAnchorPositioningWithHook(params, useFloatingHook) { 8758 const { 8759 // Public parameters 8760 anchor, 8761 positionMethod = "absolute", 8762 side: sideParam = "bottom", 8763 sideOffset = 0, 8764 align = "center", 8765 alignOffset = 0, 8766 collisionBoundary, 8767 collisionPadding: collisionPaddingParam = 5, 8768 sticky = false, 8769 arrowPadding = 5, 8770 disableAnchorTracking = false, 8771 inline: inlineMiddleware, 8772 // Private parameters 8773 keepMounted = false, 8774 floatingRootContext, 8775 mounted, 8776 collisionAvoidance, 8777 shift: shift4, 8778 nodeId, 8779 adaptiveOrigin: adaptiveOrigin2, 8780 lazyFlip = false, 8781 externalTree 8782 } = params; 8783 const collisionAvoidanceSide = collisionAvoidance.side || "flip"; 8784 const collisionAvoidanceAlign = collisionAvoidance.align || "flip"; 8785 const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end"; 8786 const shiftCrossAxis = shift4?.crossAxis ?? false; 8787 const shiftRootBoundary = shift4?.rootBoundary; 8788 const anchorFn = typeof anchor === "function" ? anchor : void 0; 8789 const anchorFnCallback = useStableCallback(anchorFn); 8790 const anchorDep = anchorFn ? anchorFnCallback : anchor; 8791 const anchorValueRef = useValueAsRef(anchor); 8792 const mountedRef = useValueAsRef(mounted); 8793 const direction = useDirection(); 8794 const isRtl = direction === "rtl"; 8795 const [mountPlacement, setMountPlacement] = React37.useState(null); 8796 if (!mounted && mountPlacement !== null) { 8797 setMountPlacement(null); 8798 } 8799 const lockAlign = lazyFlip === "placement"; 8800 const mountSide = mountPlacement ? getSide(mountPlacement) : null; 8801 const mountAlign = mountPlacement && lockAlign ? getAlignment(mountPlacement) || "center" : null; 8802 const side = mountSide || { 8803 top: "top", 8804 right: "right", 8805 bottom: "bottom", 8806 left: "left", 8807 "inline-end": isRtl ? "left" : "right", 8808 "inline-start": isRtl ? "right" : "left" 8809 }[sideParam]; 8810 const placementAlign = mountAlign || align; 8811 const placement = placementAlign === "center" ? side : `$side}-$placementAlign}`; 8812 let collisionPadding = collisionPaddingParam; 8813 if (typeof collisionPadding === "number") { 8814 collisionPadding = { 8815 top: collisionPadding, 8816 right: collisionPadding, 8817 bottom: collisionPadding, 8818 left: collisionPadding 8819 }; 8820 } else if (collisionPadding) { 8821 collisionPadding = { 8822 top: collisionPadding.top || 0, 8823 right: collisionPadding.right || 0, 8824 bottom: collisionPadding.bottom || 0, 8825 left: collisionPadding.left || 0 8826 }; 8827 } 8828 const bias = 1; 8829 const biasTop = sideParam === "bottom" ? bias : 0; 8830 const biasBottom = sideParam === "top" ? bias : 0; 8831 const biasLeft = sideParam === "right" ? bias : 0; 8832 const biasRight = sideParam === "left" ? bias : 0; 8833 const commonCollisionProps = { 8834 boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary, 8835 padding: collisionPadding 8836 }; 8837 const arrowRef = React37.useRef(null); 8838 const sideOffsetRef = useValueAsRef(sideOffset); 8839 const alignOffsetRef = useValueAsRef(alignOffset); 8840 const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0; 8841 const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0; 8842 const middleware = []; 8843 if (inlineMiddleware) { 8844 middleware.push(inlineMiddleware); 8845 } 8846 middleware.push(offset3((state) => { 8847 const data = getOffsetData(state, sideParam, isRtl); 8848 const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current; 8849 const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current; 8850 return { 8851 mainAxis: sideAxis, 8852 crossAxis: alignAxis, 8853 alignmentAxis: alignAxis 8854 }; 8855 }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam])); 8856 const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift"; 8857 const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift"); 8858 const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({ 8859 ...commonCollisionProps, 8860 // Ensure the popup flips if it's been limited by its --available-height and it resizes. 8861 // Since the size() padding is smaller than the flip() padding, flip() will take precedence. 8862 padding: { 8863 top: collisionPadding.top + bias + biasTop, 8864 right: collisionPadding.right + bias + biasRight, 8865 bottom: collisionPadding.bottom + bias + biasBottom, 8866 left: collisionPadding.left + bias + biasLeft 8867 }, 8868 mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip", 8869 crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false, 8870 fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide 8871 }); 8872 const shiftMiddleware = shiftDisabled ? null : shift3({ 8873 ...commonCollisionProps, 8874 // Use the Layout Viewport to avoid shifting around when pinch-zooming. 8875 rootBoundary: shiftRootBoundary, 8876 mainAxis: collisionAvoidanceAlign !== "none", 8877 crossAxis: crossAxisShiftEnabled, 8878 limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => { 8879 if (!arrowRef.current) { 8880 return {}; 8881 } 8882 const { 8883 width, 8884 height 8885 } = arrowRef.current.getBoundingClientRect(); 8886 const sideAxis = getSideAxis(getSide(limitData.placement)); 8887 const arrowSize = sideAxis === "y" ? width : height; 8888 const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom; 8889 return { 8890 offset: arrowSize / 2 + offsetAmount / 2 8891 }; 8892 }) 8893 }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]); 8894 if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || placementAlign === "center") { 8895 middleware.push(shiftMiddleware, flipMiddleware); 8896 } else { 8897 middleware.push(flipMiddleware, shiftMiddleware); 8898 } 8899 middleware.push(size3({ 8900 ...commonCollisionProps, 8901 apply({ 8902 elements: { 8903 floating 8904 }, 8905 availableWidth: availableWidth2, 8906 availableHeight: availableHeight2, 8907 rects 8908 }) { 8909 if (!mountedRef.current) { 8910 return; 8911 } 8912 const floatingStyle = floating.style; 8913 floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `$availableWidth2}px`); 8914 floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `$availableHeight2}px`); 8915 const dpr = getWindow(floating).devicePixelRatio || 1; 8916 const { 8917 x: x2, 8918 y: y2, 8919 width, 8920 height 8921 } = rects.reference; 8922 const anchorWidth2 = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; 8923 const anchorHeight2 = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; 8924 floatingStyle.setProperty(anchorWidth, `$anchorWidth2}px`); 8925 floatingStyle.setProperty(anchorHeight, `$anchorHeight2}px`); 8926 } 8927 }), arrow4((state) => ({ 8928 // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set, 8929 // we'll create a fake element. 8930 element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"), 8931 // No padding for the fake arrow: it would displace aligned popups on narrow anchors. 8932 padding: arrowRef.current ? arrowPadding : 0 8933 }), [arrowPadding]), { 8934 name: "transformOrigin", 8935 fn(state) { 8936 const { 8937 elements: { 8938 floating 8939 }, 8940 middlewareData: middlewareData2, 8941 placement: renderedPlacement2, 8942 platform: platform3, 8943 rects, 8944 y: y2 8945 } = state; 8946 const renderedSide2 = getSide(renderedPlacement2); 8947 const renderedAlign2 = getAlignment(renderedPlacement2); 8948 const isVertical = getSideAxis(renderedSide2) === "y"; 8949 const arrowEl = arrowRef.current; 8950 const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; 8951 let crossOrigin; 8952 if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) { 8953 crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%"; 8954 } else { 8955 const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0; 8956 const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0; 8957 crossOrigin = `$arrowOffset + arrowSize / 2}px`; 8958 } 8959 let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + $sideOffsetValue}px)` : `${-sideOffsetValue}px`; 8960 if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) { 8961 sideOrigin = `$rects.reference.y + rects.reference.height / 2 - y2}px`; 8962 } 8963 floating.style.setProperty(transformOrigin, isVertical ? `$crossOrigin} $sideOrigin}` : `$sideOrigin} $crossOrigin}`); 8964 return {}; 8965 } 8966 }, hide4, adaptiveOrigin2); 8967 useIsoLayoutEffect(() => { 8968 if (!mounted && floatingRootContext) { 8969 floatingRootContext.update({ 8970 referenceElement: null, 8971 floatingElement: null, 8972 domReferenceElement: null, 8973 positionReference: null 8974 }); 8975 } 8976 }, [mounted, floatingRootContext]); 8977 const autoUpdateOptions = React37.useMemo(() => ({ 8978 ancestorScroll: !disableAnchorTracking, 8979 elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", 8980 layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" 8981 }), [disableAnchorTracking]); 8982 const { 8983 refs, 8984 elements, 8985 x, 8986 y, 8987 middlewareData, 8988 update: update2, 8989 placement: renderedPlacement, 8990 context, 8991 isPositioned, 8992 floatingStyles: originalFloatingStyles 8993 } = useFloatingHook({ 8994 rootContext: floatingRootContext, 8995 open: keepMounted ? mounted : void 0, 8996 placement, 8997 middleware, 8998 strategy: positionMethod, 8999 whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions), 9000 nodeId, 9001 externalTree 9002 }); 9003 const { 9004 sideX, 9005 sideY 9006 } = middlewareData.adaptiveOrigin || DEFAULT_SIDES; 9007 const resolvedPosition = isPositioned ? positionMethod : "fixed"; 9008 const floatingStyles = React37.useMemo(() => { 9009 let base; 9010 if (!isPositioned) { 9011 base = { 9012 position: resolvedPosition, 9013 top: 0, 9014 left: 0 9015 }; 9016 } else if (adaptiveOrigin2) { 9017 base = { 9018 position: resolvedPosition, 9019 [sideX]: x, 9020 [sideY]: y 9021 }; 9022 } else { 9023 base = { 9024 ...originalFloatingStyles, 9025 position: resolvedPosition 9026 }; 9027 } 9028 base[AVAILABLE_WIDTH_VAR] = "100vw"; 9029 base[AVAILABLE_HEIGHT_VAR] = "100vh"; 9030 if (!isPositioned) { 9031 base.opacity = 0; 9032 } 9033 return base; 9034 }, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]); 9035 const registeredPositionReferenceRef = React37.useRef(null); 9036 useIsoLayoutEffect(() => { 9037 if (!mounted) { 9038 return; 9039 } 9040 const anchorValue = anchorValueRef.current; 9041 const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue; 9042 const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null; 9043 const finalAnchor = unwrappedElement || null; 9044 if (finalAnchor !== registeredPositionReferenceRef.current) { 9045 refs.setPositionReference(finalAnchor); 9046 registeredPositionReferenceRef.current = finalAnchor; 9047 } 9048 }, [mounted, refs, anchorDep, anchorValueRef]); 9049 React37.useEffect(() => { 9050 if (!mounted) { 9051 return; 9052 } 9053 const anchorValue = anchorValueRef.current; 9054 if (typeof anchorValue === "function") { 9055 return; 9056 } 9057 if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) { 9058 refs.setPositionReference(anchorValue.current); 9059 registeredPositionReferenceRef.current = anchorValue.current; 9060 } 9061 }, [mounted, refs, anchorDep, anchorValueRef]); 9062 React37.useEffect(() => { 9063 if (keepMounted && mounted && elements.reference && elements.floating) { 9064 return autoUpdate(elements.reference, elements.floating, update2, autoUpdateOptions); 9065 } 9066 return void 0; 9067 }, [keepMounted, mounted, elements, update2, autoUpdateOptions]); 9068 const renderedSide = getSide(renderedPlacement); 9069 const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl); 9070 const renderedAlign = getAlignment(renderedPlacement) || "center"; 9071 const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden); 9072 useIsoLayoutEffect(() => { 9073 if (lazyFlip && mounted && isPositioned && (renderedSide !== side || lockAlign && renderedAlign !== placementAlign)) { 9074 setMountPlacement(renderedPlacement); 9075 } 9076 }, [lazyFlip, lockAlign, mounted, isPositioned, renderedPlacement, renderedSide, renderedAlign, side, placementAlign]); 9077 const arrowStyles = React37.useMemo(() => ({ 9078 position: "absolute", 9079 top: middlewareData.arrow?.y, 9080 left: middlewareData.arrow?.x 9081 }), [middlewareData.arrow]); 9082 const arrowUncentered = middlewareData.arrow?.centerOffset !== 0; 9083 return React37.useMemo(() => ({ 9084 positionerStyles: floatingStyles, 9085 arrowStyles, 9086 arrowRef, 9087 arrowUncentered, 9088 side: logicalRenderedSide, 9089 align: renderedAlign, 9090 physicalSide: renderedSide, 9091 anchorHidden: anchorHidden2, 9092 refs, 9093 context, 9094 isPositioned, 9095 update: update2 9096 }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]); 9097 } 9098 function isRef(param) { 9099 return param != null && "current" in param; 9100 } 9101 9102 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs 9103 function getDisabledMountTransitionStyles(transitionStatus) { 9104 return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT; 9105 } 9106 9107 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePositioner.mjs 9108 function usePositioner(componentProps, state, { 9109 styles, 9110 transitionStatus, 9111 props, 9112 refs, 9113 hidden, 9114 inert = false 9115 }) { 9116 const style = { 9117 ...styles 9118 }; 9119 if (inert) { 9120 style.pointerEvents = "none"; 9121 } 9122 return useRenderElement("div", componentProps, { 9123 state, 9124 ref: refs, 9125 props: [{ 9126 role: "presentation", 9127 hidden, 9128 style 9129 }, getDisabledMountTransitionStyles(transitionStatus), props], 9130 stateAttributesMapping: popupStateMapping 9131 }); 9132 } 9133 9134 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/button/Button.mjs 9135 var React38 = __toESM(require_react(), 1); 9136 var Button3 = /* @__PURE__ */ React38.forwardRef(function Button4(componentProps, forwardedRef) { 9137 const { 9138 render, 9139 className, 9140 disabled: disabled2 = false, 9141 focusableWhenDisabled = false, 9142 nativeButton = true, 9143 style, 9144 ...elementProps 9145 } = componentProps; 9146 const { 9147 getButtonProps, 9148 buttonRef 9149 } = useButton({ 9150 disabled: disabled2, 9151 focusableWhenDisabled, 9152 native: nativeButton 9153 }); 9154 const state = { 9155 disabled: disabled2 9156 }; 9157 return useRenderElement("button", componentProps, { 9158 state, 9159 ref: [forwardedRef, buttonRef], 9160 props: [elementProps, getButtonProps] 9161 }); 9162 }); 9163 if (true) Button3.displayName = "Button"; 9164 9165 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/index.parts.mjs 9166 var index_parts_exports = {}; 9167 __export(index_parts_exports, { 9168 Panel: () => CollapsiblePanel, 9169 Root: () => CollapsibleRoot, 9170 Trigger: () => CollapsibleTrigger 9171 }); 9172 9173 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/root/CollapsibleRoot.mjs 9174 var React39 = __toESM(require_react(), 1); 9175 9176 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/root/stateAttributesMapping.mjs 9177 var collapsibleStateAttributesMapping = { 9178 ...collapsibleOpenStateMapping, 9179 ...transitionStatusMapping 9180 }; 9181 9182 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/root/CollapsibleRoot.mjs 9183 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); 9184 var CollapsibleRoot = /* @__PURE__ */ React39.forwardRef(function CollapsibleRoot2(componentProps, forwardedRef) { 9185 const { 9186 render, 9187 className, 9188 defaultOpen = false, 9189 disabled: disabled2 = false, 9190 onOpenChange: onOpenChangeProp, 9191 open: open3, 9192 style, 9193 ...elementProps 9194 } = componentProps; 9195 const onOpenChange = useStableCallback(onOpenChangeProp); 9196 const collapsible = useCollapsibleRoot({ 9197 open: open3, 9198 defaultOpen, 9199 onOpenChange, 9200 disabled: disabled2 9201 }); 9202 const state = React39.useMemo(() => ({ 9203 open: collapsible.open, 9204 disabled: collapsible.disabled, 9205 transitionStatus: collapsible.transitionStatus 9206 }), [collapsible.open, collapsible.disabled, collapsible.transitionStatus]); 9207 const contextValue = React39.useMemo(() => ({ 9208 ...collapsible, 9209 onOpenChange, 9210 state 9211 }), [collapsible, onOpenChange, state]); 9212 const element = useRenderElement("div", componentProps, { 9213 state, 9214 ref: forwardedRef, 9215 props: elementProps, 9216 stateAttributesMapping: collapsibleStateAttributesMapping 9217 }); 9218 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(CollapsibleRootContext.Provider, { 9219 value: contextValue, 9220 children: element 9221 }); 9222 }); 9223 if (true) CollapsibleRoot.displayName = "CollapsibleRoot"; 9224 9225 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/trigger/CollapsibleTrigger.mjs 9226 var React40 = __toESM(require_react(), 1); 9227 var stateAttributesMapping = { 9228 ...triggerOpenStateMapping, 9229 ...transitionStatusMapping 9230 }; 9231 var CollapsibleTrigger = /* @__PURE__ */ React40.forwardRef(function CollapsibleTrigger2(componentProps, forwardedRef) { 9232 const { 9233 panelId, 9234 open: open3, 9235 handleTrigger, 9236 state, 9237 disabled: contextDisabled 9238 } = useCollapsibleRootContext(); 9239 const { 9240 className, 9241 disabled: disabled2 = contextDisabled, 9242 render, 9243 nativeButton = true, 9244 style, 9245 ...elementProps 9246 } = componentProps; 9247 const { 9248 getButtonProps, 9249 buttonRef 9250 } = useButton({ 9251 disabled: disabled2, 9252 native: nativeButton 9253 }); 9254 const element = useRenderElement("button", componentProps, { 9255 state, 9256 ref: [forwardedRef, buttonRef], 9257 props: [{ 9258 "aria-controls": open3 ? panelId : void 0, 9259 "aria-expanded": open3, 9260 onClick: handleTrigger 9261 }, elementProps, getButtonProps], 9262 stateAttributesMapping 9263 }); 9264 return element; 9265 }); 9266 if (true) CollapsibleTrigger.displayName = "CollapsibleTrigger"; 9267 9268 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanel.mjs 9269 var React41 = __toESM(require_react(), 1); 9270 9271 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanelCssVars.mjs 9272 var collapsiblePanelHeight = "--collapsible-panel-height"; 9273 var collapsiblePanelWidth = "--collapsible-panel-width"; 9274 9275 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/collapsible/panel/CollapsiblePanel.mjs 9276 var CollapsiblePanel = /* @__PURE__ */ React41.forwardRef(function CollapsiblePanel2(componentProps, forwardedRef) { 9277 const { 9278 className, 9279 hiddenUntilFound: hiddenUntilFoundProp, 9280 keepMounted: keepMountedProp, 9281 render, 9282 id: idProp, 9283 style, 9284 ...elementProps 9285 } = componentProps; 9286 if (true) { 9287 React41.useEffect(() => { 9288 if (hiddenUntilFoundProp && keepMountedProp === false) { 9289 warn("The `keepMounted={false}` prop on `Collapsible.Panel` is ignored when `hiddenUntilFound` is enabled, since the panel must remain mounted while closed."); 9290 } 9291 }, [hiddenUntilFoundProp, keepMountedProp]); 9292 } 9293 const { 9294 defaultPanelId, 9295 mounted, 9296 onOpenChange, 9297 open: open3, 9298 setMounted, 9299 setPanelIdState, 9300 setOpen, 9301 state, 9302 transitionStatus 9303 } = useCollapsibleRootContext(); 9304 const hiddenUntilFound = hiddenUntilFoundProp ?? false; 9305 const keepMounted = keepMountedProp ?? false; 9306 const registeredId = idProp || void 0; 9307 const id = registeredId ?? defaultPanelId; 9308 useIsoLayoutEffect(() => { 9309 setPanelIdState((currentId) => registeredId ?? (currentId === null ? void 0 : currentId)); 9310 return () => { 9311 setPanelIdState((currentId) => currentId === registeredId ? null : currentId); 9312 }; 9313 }, [registeredId, setPanelIdState]); 9314 const { 9315 height, 9316 props, 9317 ref, 9318 shouldPreventOpenAnimation, 9319 shouldRender, 9320 transitionStatus: panelTransitionStatus, 9321 width 9322 } = useCollapsiblePanel({ 9323 externalRef: forwardedRef, 9324 hiddenUntilFound, 9325 id, 9326 keepMounted, 9327 mounted, 9328 onOpenChange, 9329 open: open3, 9330 setMounted, 9331 setOpen, 9332 transitionStatus 9333 }); 9334 const panelState = { 9335 ...state, 9336 transitionStatus: panelTransitionStatus 9337 }; 9338 const resolvedStyle = resolveStyle(style, panelState); 9339 const element = useRenderElement("div", { 9340 ...componentProps, 9341 style: void 0 9342 }, { 9343 state: panelState, 9344 ref, 9345 props: [ 9346 props, 9347 { 9348 style: { 9349 [collapsiblePanelHeight]: height === void 0 ? "auto" : `$height}px`, 9350 [collapsiblePanelWidth]: width === void 0 ? "auto" : `$width}px` 9351 } 9352 }, 9353 elementProps, 9354 resolvedStyle ? { 9355 style: resolvedStyle 9356 } : void 0, 9357 // Resolve the public `style` prop so temporary `animationName: 'none'` 9358 // can still win after user's inline styles have been merged. 9359 shouldPreventOpenAnimation ? { 9360 style: { 9361 animationName: "none" 9362 } 9363 } : void 0 9364 ], 9365 stateAttributesMapping: collapsibleStateAttributesMapping 9366 }); 9367 if (!shouldRender) { 9368 return null; 9369 } 9370 return element; 9371 }); 9372 if (true) CollapsiblePanel.displayName = "CollapsiblePanel"; 9373 9374 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupViewport.mjs 9375 var React45 = __toESM(require_react(), 1); 9376 var ReactDOM6 = __toESM(require_react_dom(), 1); 9377 9378 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/usePreviousValue.mjs 9379 var React42 = __toESM(require_react(), 1); 9380 function usePreviousValue(value) { 9381 const [state, setState] = React42.useState({ 9382 current: value, 9383 previous: null 9384 }); 9385 if (!Object.is(value, state.current)) { 9386 setState({ 9387 current: value, 9388 previous: state.current 9389 }); 9390 } 9391 return state.previous; 9392 } 9393 9394 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs 9395 var React43 = __toESM(require_react(), 1); 9396 9397 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/getCssDimensions.mjs 9398 function getCssDimensions2(element) { 9399 const css = getComputedStyle2(element); 9400 let width = parseFloat(css.width) || 0; 9401 let height = parseFloat(css.height) || 0; 9402 const hasOffset = isHTMLElement(element); 9403 const offsetWidth = hasOffset ? element.offsetWidth : width; 9404 const offsetHeight = hasOffset ? element.offsetHeight : height; 9405 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 9406 if (shouldFallback) { 9407 width = offsetWidth; 9408 height = offsetHeight; 9409 } 9410 return { 9411 width, 9412 height 9413 }; 9414 } 9415 9416 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs 9417 var popupWidth = "--popup-width"; 9418 var popupHeight = "--popup-height"; 9419 9420 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs 9421 function usePopupAutoResize(parameters) { 9422 const { 9423 popupElement, 9424 positionerElement, 9425 content, 9426 mounted, 9427 onMeasureLayout: onMeasureLayoutParam, 9428 onMeasureLayoutComplete: onMeasureLayoutCompleteParam, 9429 side, 9430 direction 9431 } = parameters; 9432 const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true); 9433 const animationFrame = useAnimationFrame(); 9434 const committedDimensionsRef = React43.useRef(null); 9435 const onMeasureLayout = useStableCallback(onMeasureLayoutParam); 9436 const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam); 9437 const anchoringStyles = React43.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]); 9438 useIsoLayoutEffect(() => { 9439 if (!mounted) { 9440 committedDimensionsRef.current = null; 9441 return void 0; 9442 } 9443 if (!popupElement || !positionerElement) { 9444 return void 0; 9445 } 9446 const restoreAnchoringStyles = applyElementStyles(popupElement, anchoringStyles); 9447 setPopupCssSize(popupElement, "auto"); 9448 const restorePopupPosition = overrideElementStyle(popupElement, "position", "static"); 9449 const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none"); 9450 const restorePopupScale = overrideElementStyle(popupElement, "scale", "1"); 9451 const restorePositionerAvailableSize = applyElementStyles(positionerElement, { 9452 [availableWidth]: "max-content", 9453 [availableHeight]: "max-content" 9454 }); 9455 function restoreMeasurementOverrides() { 9456 restorePopupPosition(); 9457 restorePopupTransform(); 9458 restorePositionerAvailableSize(); 9459 restorePopupScale(); 9460 } 9461 onMeasureLayout?.(); 9462 if (committedDimensionsRef.current === null) { 9463 setPositionerCssSize(positionerElement, "max-content"); 9464 const dimensions = getCssDimensions2(popupElement); 9465 committedDimensionsRef.current = dimensions; 9466 setPositionerCssSize(positionerElement, dimensions); 9467 restoreMeasurementOverrides(); 9468 onMeasureLayoutComplete?.(null, dimensions); 9469 return restoreAnchoringStyles; 9470 } 9471 setPositionerCssSize(positionerElement, "max-content"); 9472 const previousDimensions = committedDimensionsRef.current; 9473 const newDimensions = getCssDimensions2(popupElement); 9474 committedDimensionsRef.current = newDimensions; 9475 setPopupCssSize(popupElement, previousDimensions); 9476 restoreMeasurementOverrides(); 9477 onMeasureLayoutComplete?.(previousDimensions, newDimensions); 9478 setPositionerCssSize(positionerElement, newDimensions); 9479 const abortController = new AbortController(); 9480 animationFrame.request(() => { 9481 setPopupCssSize(popupElement, newDimensions); 9482 runOnceAnimationsFinish(() => { 9483 popupElement.style.setProperty(popupWidth, "auto"); 9484 popupElement.style.setProperty(popupHeight, "auto"); 9485 }, abortController.signal); 9486 }); 9487 return () => { 9488 abortController.abort(); 9489 animationFrame.cancel(); 9490 restoreAnchoringStyles(); 9491 }; 9492 }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]); 9493 } 9494 function getPopupAnchoringStyles(side, direction) { 9495 const isPhysicalTop = side === "top"; 9496 const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start"); 9497 if (!isPhysicalTop && !isPhysicalLeft) { 9498 return EMPTY_OBJECT; 9499 } 9500 return { 9501 position: "absolute", 9502 [isPhysicalTop ? "bottom" : "top"]: "0", 9503 [isPhysicalLeft ? "right" : "left"]: "0" 9504 }; 9505 } 9506 function overrideElementStyle(element, property, value) { 9507 const originalValue = element.style.getPropertyValue(property); 9508 element.style.setProperty(property, value); 9509 return () => { 9510 element.style.setProperty(property, originalValue); 9511 }; 9512 } 9513 function applyElementStyles(element, styles) { 9514 const restorers = []; 9515 for (const [key, value] of Object.entries(styles)) { 9516 restorers.push(overrideElementStyle(element, key, value)); 9517 } 9518 return restorers.length ? () => { 9519 restorers.forEach((restore) => restore()); 9520 } : NOOP; 9521 } 9522 function setPopupCssSize(popupElement, size4) { 9523 const width = size4 === "auto" ? "auto" : `$size4.width}px`; 9524 const height = size4 === "auto" ? "auto" : `$size4.height}px`; 9525 popupElement.style.setProperty(popupWidth, width); 9526 popupElement.style.setProperty(popupHeight, height); 9527 } 9528 function setPositionerCssSize(positionerElement, size4) { 9529 const width = size4 === "max-content" ? "max-content" : `$size4.width}px`; 9530 const height = size4 === "max-content" ? "max-content" : `$size4.height}px`; 9531 positionerElement.style.setProperty(positionerWidth, width); 9532 positionerElement.style.setProperty(positionerHeight, height); 9533 } 9534 9535 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs 9536 var React44 = __toESM(require_react(), 1); 9537 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); 9538 var DirectionProvider = function DirectionProvider2(props) { 9539 const { 9540 direction = "ltr" 9541 } = props; 9542 const contextValue = React44.useMemo(() => ({ 9543 direction 9544 }), [direction]); 9545 return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(DirectionContext.Provider, { 9546 value: contextValue, 9547 children: props.children 9548 }); 9549 }; 9550 if (true) DirectionProvider.displayName = "DirectionProvider"; 9551 9552 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs 9553 var adaptiveOrigin = { 9554 name: "adaptiveOrigin", 9555 async fn(state) { 9556 const { 9557 x: rawX, 9558 y: rawY, 9559 rects: { 9560 floating: floatRect 9561 }, 9562 elements: { 9563 floating 9564 }, 9565 platform: platform3, 9566 strategy, 9567 placement 9568 } = state; 9569 const win = getWindow(floating); 9570 const styles = win.getComputedStyle(floating); 9571 const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== ""; 9572 if (!hasTransition) { 9573 return { 9574 x: rawX, 9575 y: rawY, 9576 data: DEFAULT_SIDES 9577 }; 9578 } 9579 const offsetParent = await platform3.getOffsetParent?.(floating); 9580 let offsetDimensions = { 9581 width: 0, 9582 height: 0 9583 }; 9584 if (strategy === "fixed" && win?.visualViewport) { 9585 offsetDimensions = { 9586 width: win.visualViewport.width, 9587 height: win.visualViewport.height 9588 }; 9589 } else if (offsetParent === win) { 9590 const doc = ownerDocument(floating); 9591 offsetDimensions = { 9592 width: doc.documentElement.clientWidth, 9593 height: doc.documentElement.clientHeight 9594 }; 9595 } else if (await platform3.isElement?.(offsetParent)) { 9596 offsetDimensions = await platform3.getDimensions(offsetParent); 9597 } 9598 const currentSide = getSide(placement); 9599 let x = rawX; 9600 let y = rawY; 9601 if (currentSide === "left") { 9602 x = offsetDimensions.width - (rawX + floatRect.width); 9603 } 9604 if (currentSide === "top") { 9605 y = offsetDimensions.height - (rawY + floatRect.height); 9606 } 9607 const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; 9608 const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; 9609 return { 9610 x, 9611 y, 9612 data: { 9613 sideX, 9614 sideY 9615 } 9616 }; 9617 } 9618 }; 9619 9620 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs 9621 var activationDirection = "data-activation-direction"; 9622 9623 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupViewport.mjs 9624 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); 9625 var popupViewportStateMapping = { 9626 activationDirection: (value) => value ? { 9627 [activationDirection]: value 9628 } : null 9629 }; 9630 function usePopupViewport(parameters) { 9631 const { 9632 store: store3, 9633 side, 9634 children 9635 } = parameters; 9636 const direction = useDirection(); 9637 const activeTrigger = store3.useState("activeTriggerElement"); 9638 const activeTriggerId = store3.useState("activeTriggerId"); 9639 const open3 = store3.useState("open"); 9640 const payload = store3.useState("payload"); 9641 const mounted = store3.useState("mounted"); 9642 const popupElement = store3.useState("popupElement"); 9643 const positionerElement = store3.useState("positionerElement"); 9644 const previousActiveTrigger = usePreviousValue(open3 ? activeTrigger : null); 9645 const currentContentKey = usePopupContentKey(activeTriggerId, payload); 9646 const capturedNodeRef = React45.useRef(null); 9647 const [previousContentNode, setPreviousContentNode] = React45.useState(null); 9648 const [newTriggerOffset, setNewTriggerOffset] = React45.useState(null); 9649 const currentContainerRef = React45.useRef(null); 9650 const previousContainerRef = React45.useRef(null); 9651 const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true); 9652 const cleanupFrame = useAnimationFrame(); 9653 const cleanupControllerRef = React45.useRef(null); 9654 const [previousContentDimensions, setPreviousContentDimensions] = React45.useState(null); 9655 const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React45.useState(false); 9656 useIsoLayoutEffect(() => { 9657 store3.set("adaptiveOrigin", adaptiveOrigin); 9658 return () => { 9659 store3.set("adaptiveOrigin", void 0); 9660 }; 9661 }, [store3]); 9662 const handleMeasureLayout = useStableCallback(() => { 9663 currentContainerRef.current?.style.setProperty("animation", "none"); 9664 currentContainerRef.current?.style.setProperty("transition", "none"); 9665 previousContainerRef.current?.style.setProperty("display", "none"); 9666 }); 9667 const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => { 9668 currentContainerRef.current?.style.removeProperty("animation"); 9669 currentContainerRef.current?.style.removeProperty("transition"); 9670 previousContainerRef.current?.style.removeProperty("display"); 9671 if (previousDimensions) { 9672 setPreviousContentDimensions(previousDimensions); 9673 } 9674 }); 9675 const armViewportCleanup = useStableCallback(() => { 9676 cleanupControllerRef.current?.abort(); 9677 const controller = new AbortController(); 9678 cleanupControllerRef.current = controller; 9679 onAnimationsFinished(() => { 9680 setPreviousContentNode(null); 9681 setPreviousContentDimensions(null); 9682 capturedNodeRef.current = null; 9683 }, controller.signal); 9684 }); 9685 const lastHandledTriggerRef = React45.useRef(null); 9686 useIsoLayoutEffect(() => { 9687 if (!open3 || !mounted) { 9688 lastHandledTriggerRef.current = null; 9689 } 9690 }, [open3, mounted]); 9691 useIsoLayoutEffect(() => { 9692 if (open3 && activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { 9693 setPreviousContentNode(capturedNodeRef.current); 9694 setShowStartingStyleAttribute(true); 9695 const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger); 9696 setNewTriggerOffset(offset4); 9697 lastHandledTriggerRef.current = activeTrigger; 9698 } 9699 }, [open3, activeTrigger, previousActiveTrigger]); 9700 useIsoLayoutEffect(() => { 9701 if (previousContentNode == null) { 9702 return; 9703 } 9704 cleanupControllerRef.current?.abort(); 9705 setShowStartingStyleAttribute(true); 9706 cleanupFrame.request(() => { 9707 ReactDOM6.flushSync(() => { 9708 setShowStartingStyleAttribute(false); 9709 }); 9710 armViewportCleanup(); 9711 }); 9712 }, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]); 9713 useIsoLayoutEffect(() => { 9714 const source = currentContainerRef.current; 9715 if (!source) { 9716 return; 9717 } 9718 const wrapper = ownerDocument(source).createElement("div"); 9719 for (const child of Array.from(source.childNodes)) { 9720 wrapper.appendChild(child.cloneNode(true)); 9721 } 9722 capturedNodeRef.current = wrapper; 9723 }); 9724 const isTransitioning = previousContentNode != null; 9725 let childrenToRender; 9726 if (!isTransitioning) { 9727 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { 9728 "data-current": true, 9729 ref: currentContainerRef, 9730 children 9731 }, currentContentKey); 9732 } else { 9733 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(React45.Fragment, { 9734 children: [/* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { 9735 "data-previous": true, 9736 inert: inertValue(true), 9737 ref: previousContainerRef, 9738 style: { 9739 ...previousContentDimensions ? { 9740 [popupWidth]: `$previousContentDimensions.width}px`, 9741 [popupHeight]: `$previousContentDimensions.height}px` 9742 } : null, 9743 position: "absolute" 9744 }, 9745 "data-ending-style": showStartingStyleAttribute ? void 0 : "" 9746 }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { 9747 "data-current": true, 9748 ref: currentContainerRef, 9749 "data-starting-style": showStartingStyleAttribute ? "" : void 0, 9750 children 9751 }, currentContentKey)] 9752 }); 9753 } 9754 useIsoLayoutEffect(() => { 9755 const container = previousContainerRef.current; 9756 if (!container || !previousContentNode) { 9757 return; 9758 } 9759 container.replaceChildren(...Array.from(previousContentNode.childNodes)); 9760 }, [previousContentNode]); 9761 usePopupAutoResize({ 9762 popupElement, 9763 positionerElement, 9764 mounted, 9765 content: payload, 9766 onMeasureLayout: handleMeasureLayout, 9767 onMeasureLayoutComplete: handleMeasureLayoutComplete, 9768 side, 9769 direction 9770 }); 9771 const state = { 9772 activationDirection: getActivationDirection(newTriggerOffset), 9773 transitioning: isTransitioning 9774 }; 9775 return { 9776 children: childrenToRender, 9777 state 9778 }; 9779 } 9780 function getActivationDirection(offset4) { 9781 if (!offset4) { 9782 return void 0; 9783 } 9784 return `$getValueWithTolerance(offset4.horizontal, 5, "right", "left")} $getValueWithTolerance(offset4.vertical, 5, "down", "up")}`; 9785 } 9786 function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) { 9787 if (value > tolerance) { 9788 return positiveLabel; 9789 } 9790 if (value < -tolerance) { 9791 return negativeLabel; 9792 } 9793 return ""; 9794 } 9795 function calculateRelativePosition(from, to) { 9796 const fromRect = from.getBoundingClientRect(); 9797 const toRect = to.getBoundingClientRect(); 9798 const fromCenter = { 9799 x: fromRect.left + fromRect.width / 2, 9800 y: fromRect.top + fromRect.height / 2 9801 }; 9802 const toCenter = { 9803 x: toRect.left + toRect.width / 2, 9804 y: toRect.top + toRect.height / 2 9805 }; 9806 return { 9807 horizontal: toCenter.x - fromCenter.x, 9808 vertical: toCenter.y - fromCenter.y 9809 }; 9810 } 9811 function usePopupContentKey(activeTriggerId, payload) { 9812 const [contentKey, setContentKey] = React45.useState(0); 9813 const previousActiveTriggerIdRef = React45.useRef(activeTriggerId); 9814 const previousPayloadRef = React45.useRef(payload); 9815 const pendingPayloadUpdateRef = React45.useRef(false); 9816 useIsoLayoutEffect(() => { 9817 const previousActiveTriggerId = previousActiveTriggerIdRef.current; 9818 const previousPayload = previousPayloadRef.current; 9819 const triggerIdChanged = activeTriggerId !== previousActiveTriggerId; 9820 const payloadChanged = payload !== previousPayload; 9821 if (triggerIdChanged) { 9822 setContentKey((value) => value + 1); 9823 pendingPayloadUpdateRef.current = !payloadChanged; 9824 } else if (pendingPayloadUpdateRef.current && payloadChanged) { 9825 setContentKey((value) => value + 1); 9826 pendingPayloadUpdateRef.current = false; 9827 } 9828 previousActiveTriggerIdRef.current = activeTriggerId; 9829 previousPayloadRef.current = payload; 9830 }, [activeTriggerId, payload]); 9831 return `$activeTriggerId ?? "current"}-$contentKey}`; 9832 } 9833 9834 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FloatingPortalLite.mjs 9835 var React46 = __toESM(require_react(), 1); 9836 var ReactDOM7 = __toESM(require_react_dom(), 1); 9837 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); 9838 var FloatingPortalLite = /* @__PURE__ */ React46.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { 9839 const { 9840 children, 9841 container, 9842 className, 9843 render, 9844 style, 9845 ...elementProps 9846 } = componentProps; 9847 const { 9848 node: portalNode, 9849 subtree: portalSubtree 9850 } = useFloatingPortalNode({ 9851 container, 9852 ref: forwardedRef, 9853 componentProps, 9854 elementProps 9855 }); 9856 if (!portalSubtree && !portalNode) { 9857 return null; 9858 } 9859 return /* @__PURE__ */ (0, import_jsx_runtime33.jsxs)(React46.Fragment, { 9860 children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM7.createPortal(children, portalNode)] 9861 }); 9862 }); 9863 if (true) FloatingPortalLite.displayName = "FloatingPortalLite"; 9864 9865 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/index.parts.mjs 9866 var index_parts_exports2 = {}; 9867 __export(index_parts_exports2, { 9868 Arrow: () => TooltipArrow, 9869 Handle: () => TooltipHandle, 9870 Popup: () => TooltipPopup, 9871 Portal: () => TooltipPortal, 9872 Positioner: () => TooltipPositioner, 9873 Provider: () => TooltipProvider, 9874 Root: () => TooltipRoot, 9875 Trigger: () => TooltipTrigger, 9876 Viewport: () => TooltipViewport, 9877 createHandle: () => createTooltipHandle 9878 }); 9879 9880 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs 9881 var React49 = __toESM(require_react(), 1); 9882 9883 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs 9884 var React47 = __toESM(require_react(), 1); 9885 var TooltipRootContext = /* @__PURE__ */ React47.createContext(void 0); 9886 if (true) TooltipRootContext.displayName = "TooltipRootContext"; 9887 function useTooltipRootContext(optional) { 9888 const context = React47.useContext(TooltipRootContext); 9889 if (context === void 0 && !optional) { 9890 throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72)); 9891 } 9892 return context; 9893 } 9894 9895 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs 9896 var React48 = __toESM(require_react(), 1); 9897 var selectors2 = { 9898 ...popupStoreSelectors, 9899 disabled: (state) => state.disabled, 9900 instantType: (state) => state.instantType, 9901 isInstantPhase: (state) => state.isInstantPhase, 9902 trackCursorAxis: (state) => state.trackCursorAxis, 9903 disableHoverablePopup: (state) => state.disableHoverablePopup, 9904 lastOpenChangeReason: (state) => state.openChangeReason, 9905 closeOnClick: (state) => state.closeOnClick, 9906 // Active and inactive trigger props are the same object, so a constant for triggers that discard 9907 // them keeps those triggers from re-rendering when the props change. 9908 appliedTriggerProps: (state, apply) => apply ? state.activeTriggerProps : void 0, 9909 closeDelay: (state) => state.closeDelay, 9910 adaptiveOrigin: (state) => state.adaptiveOrigin 9911 }; 9912 var TooltipStore = class extends ReactStore { 9913 constructor(initialState, floatingId, nested) { 9914 const triggerElements = new PopupTriggerMap(); 9915 super(createInitialState(initialState, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors2); 9916 } 9917 setOpen = (nextOpen, eventDetails) => { 9918 applyPopupOpenChange(this, nextOpen, eventDetails, { 9919 extraState: { 9920 openChangeReason: eventDetails.reason 9921 } 9922 }); 9923 }; 9924 // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change. 9925 cancelPendingOpen(event) { 9926 this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event)); 9927 } 9928 }; 9929 function createNullTooltipStore() { 9930 const triggerElements = new PopupTriggerMap(); 9931 const store3 = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors2); 9932 return Object.assign(store3, { 9933 setOpen: NOOP, 9934 cancelPendingOpen: NOOP 9935 }); 9936 } 9937 function createInitialState(initialState, triggerElements, floatingId, nested = false) { 9938 const state = { 9939 ...createInitialPopupStoreState(triggerElements, floatingId, nested), 9940 disabled: false, 9941 instantType: void 0, 9942 isInstantPhase: false, 9943 trackCursorAxis: "none", 9944 disableHoverablePopup: false, 9945 openChangeReason: null, 9946 closeOnClick: true, 9947 closeDelay: 0, 9948 adaptiveOrigin: void 0, 9949 ...initialState 9950 }; 9951 return state; 9952 } 9953 function createInitialContext(triggerElements) { 9954 return { 9955 popupRef: /* @__PURE__ */ React48.createRef(), 9956 onOpenChange: void 0, 9957 onOpenChangeComplete: void 0, 9958 triggerElements 9959 }; 9960 } 9961 9962 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs 9963 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); 9964 var TooltipRoot = fastComponent(function TooltipRoot2(props) { 9965 const { 9966 disabled: disabled2 = false, 9967 defaultOpen = false, 9968 open: openProp, 9969 disableHoverablePopup = false, 9970 trackCursorAxis = "none", 9971 actionsRef, 9972 onOpenChange, 9973 onOpenChangeComplete, 9974 handle, 9975 triggerId: triggerIdProp, 9976 defaultTriggerId: defaultTriggerIdProp = null, 9977 children 9978 } = props; 9979 const store3 = usePopupRootStore((floatingId, nested) => new TooltipStore({ 9980 open: defaultOpen, 9981 openProp, 9982 activeTriggerId: defaultTriggerIdProp, 9983 triggerIdProp 9984 }, floatingId, nested)); 9985 store3.useControlledProp("openProp", openProp); 9986 store3.useControlledProp("triggerIdProp", triggerIdProp); 9987 store3.useContextCallback("onOpenChange", onOpenChange); 9988 store3.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); 9989 const openState = store3.useState("open"); 9990 const open3 = !disabled2 && openState; 9991 const activeTriggerId = store3.useState("activeTriggerId"); 9992 const mounted = store3.useState("mounted"); 9993 const payload = store3.useState("payload"); 9994 store3.useSyncedValues({ 9995 trackCursorAxis, 9996 disableHoverablePopup, 9997 disabled: disabled2 9998 }); 9999 useImplicitActiveTrigger(store3, { 10000 closeOnActiveTriggerUnmount: true 10001 }); 10002 const { 10003 forceUnmount, 10004 transitionStatus 10005 } = useOpenStateTransitions(open3, store3); 10006 const isInstantPhase = store3.useState("isInstantPhase"); 10007 const instantType = store3.useState("instantType"); 10008 const lastOpenChangeReason = store3.useState("lastOpenChangeReason"); 10009 const previousInstantTypeRef = React49.useRef(null); 10010 useIsoLayoutEffect(() => { 10011 if (openState && disabled2) { 10012 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled)); 10013 } 10014 }, [openState, disabled2, store3]); 10015 useIsoLayoutEffect(() => { 10016 if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) { 10017 if (instantType !== "delay") { 10018 previousInstantTypeRef.current = instantType; 10019 } 10020 store3.set("instantType", "delay"); 10021 } else if (previousInstantTypeRef.current !== null) { 10022 store3.set("instantType", previousInstantTypeRef.current); 10023 previousInstantTypeRef.current = null; 10024 } 10025 }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store3]); 10026 useIsoLayoutEffect(() => { 10027 if (open3) { 10028 if (activeTriggerId == null) { 10029 store3.set("payload", void 0); 10030 } 10031 } 10032 }, [store3, activeTriggerId, open3]); 10033 React49.useImperativeHandle(actionsRef, () => ({ 10034 unmount: forceUnmount, 10035 close: () => store3.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)) 10036 }), [forceUnmount, store3]); 10037 const shouldRenderInteractions = open3 || mounted || !disabled2 && trackCursorAxis !== "none"; 10038 return /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(TooltipRootContext.Provider, { 10039 value: store3, 10040 children: [handle && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(PopupHandleAttachment, { 10041 handle, 10042 store: store3 10043 }), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(TooltipInteractions, { 10044 store: store3, 10045 disabled: disabled2, 10046 trackCursorAxis 10047 }), typeof children === "function" ? children({ 10048 payload 10049 }) : children] 10050 }); 10051 }); 10052 if (true) TooltipRoot.displayName = "TooltipRoot"; 10053 function TooltipInteractions({ 10054 store: store3, 10055 disabled: disabled2, 10056 trackCursorAxis 10057 }) { 10058 const floatingRootContext = store3.useState("floatingRootContext"); 10059 const dismiss = useDismiss(floatingRootContext, { 10060 enabled: !disabled2, 10061 referencePress: () => store3.select("closeOnClick") 10062 }); 10063 const clientPoint = useClientPoint(floatingRootContext, { 10064 enabled: !disabled2 && trackCursorAxis !== "none", 10065 axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis 10066 }); 10067 const triggerProps = React49.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]); 10068 usePopupInteractionProps(store3, { 10069 activeTriggerProps: triggerProps, 10070 inactiveTriggerProps: triggerProps, 10071 popupProps: dismiss.floating ?? EMPTY_OBJECT 10072 }); 10073 return null; 10074 } 10075 10076 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs 10077 var React51 = __toESM(require_react(), 1); 10078 10079 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs 10080 var React50 = __toESM(require_react(), 1); 10081 var TooltipProviderContext = /* @__PURE__ */ React50.createContext(void 0); 10082 if (true) TooltipProviderContext.displayName = "TooltipProviderContext"; 10083 function useTooltipProviderContext() { 10084 return React50.useContext(TooltipProviderContext); 10085 } 10086 10087 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/utils/constants.mjs 10088 var OPEN_DELAY = 600; 10089 10090 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs 10091 var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger"; 10092 function getTargetElement(event) { 10093 const target = getTarget(event); 10094 return isElement(target) ? target : null; 10095 } 10096 var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) { 10097 const { 10098 render, 10099 className, 10100 style, 10101 handle, 10102 payload, 10103 disabled: disabledProp, 10104 delay, 10105 closeOnClick = true, 10106 closeDelay, 10107 id: idProp, 10108 ...elementProps 10109 } = componentProps; 10110 const rootContext = useTooltipRootContext(true); 10111 const handleStore = usePopupHandleStore(handle); 10112 const store3 = handleStore ?? rootContext; 10113 if (!store3) { 10114 throw new Error(true ? "Base UI: <Tooltip.Trigger> must be either used within a <Tooltip.Root> component or provided with a handle." : formatErrorMessage_default(82)); 10115 } 10116 const thisTriggerId = useBaseUiId(idProp); 10117 const isTriggerActive = store3.useState("isTriggerActive", thisTriggerId); 10118 const isOpenedByThisTrigger = store3.useState("isOpenedByTrigger", thisTriggerId); 10119 const floatingRootContext = store3.useState("floatingRootContext"); 10120 const triggerElementRef = React51.useRef(null); 10121 const closeDelayWithDefault = closeDelay ?? 0; 10122 const { 10123 registerTrigger, 10124 isMountedByThisTrigger 10125 } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store3, { 10126 payload, 10127 closeOnClick, 10128 closeDelay: closeDelayWithDefault 10129 }); 10130 const providerDelay = useTooltipProviderContext(); 10131 const { 10132 activeIdRef, 10133 delayRef, 10134 isInstantPhase, 10135 hasProvider 10136 } = useDelayGroup(floatingRootContext, { 10137 open: isOpenedByThisTrigger 10138 }); 10139 const hoverInteraction = useHoverInteractionSharedState(floatingRootContext); 10140 store3.useSyncedValue("isInstantPhase", isInstantPhase); 10141 const rootDisabled = store3.useState("disabled"); 10142 const disabled2 = disabledProp ?? rootDisabled; 10143 const disabledRef = useValueAsRef(disabled2); 10144 const trackCursorAxis = store3.useState("trackCursorAxis"); 10145 const disableHoverablePopup = store3.useState("disableHoverablePopup"); 10146 const isNestedTriggerHoveredRef = React51.useRef(false); 10147 const nestedTriggerOpenTimeout = useTimeout(); 10148 const pointerTypeRef = React51.useRef(void 0); 10149 function getOpenDelay() { 10150 if (hasProvider && activeIdRef.current != null) { 10151 return 0; 10152 } 10153 return delay ?? providerDelay ?? OPEN_DELAY; 10154 } 10155 function isEnabledNestedTriggerTarget(target) { 10156 const triggerEl = triggerElementRef.current; 10157 if (!triggerEl || !target) { 10158 return false; 10159 } 10160 const nearestTrigger = closest(target, `[$TOOLTIP_TRIGGER_IDENTIFIER}]`); 10161 return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger); 10162 } 10163 function detectNestedTriggerHover(target) { 10164 const nestedTriggerHovered = isEnabledNestedTriggerTarget(target); 10165 isNestedTriggerHoveredRef.current = nestedTriggerHovered; 10166 if (nestedTriggerHovered) { 10167 hoverInteraction.openChangeTimeout.clear(); 10168 hoverInteraction.restTimeout.clear(); 10169 hoverInteraction.restTimeoutPending = false; 10170 nestedTriggerOpenTimeout.clear(); 10171 } 10172 return nestedTriggerHovered; 10173 } 10174 const hoverProps = useHoverReferenceInteraction(floatingRootContext, { 10175 enabled: !disabled2, 10176 mouseOnly: true, 10177 move: false, 10178 handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null, 10179 restMs: getOpenDelay, 10180 delay() { 10181 if (closeDelay == null && hasProvider) { 10182 return { 10183 close: getDelay(delayRef.current, "close") 10184 }; 10185 } 10186 return { 10187 close: closeDelayWithDefault 10188 }; 10189 }, 10190 triggerElementRef, 10191 isActiveTrigger: isTriggerActive, 10192 isClosing: () => store3.select("transitionStatus") === "ending", 10193 shouldOpen() { 10194 return !isNestedTriggerHoveredRef.current; 10195 } 10196 }); 10197 const focusProps = useFocus(floatingRootContext, { 10198 enabled: !disabled2 10199 }).reference; 10200 const handleNestedTriggerHover = (event) => { 10201 const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current; 10202 const target = getTargetElement(event); 10203 const nestedTriggerHovered = detectNestedTriggerHover(target); 10204 const triggerEl = triggerElementRef.current; 10205 const targetInsideTrigger = triggerEl && target && contains(triggerEl, target); 10206 if (nestedTriggerHovered && store3.select("open") && store3.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) { 10207 store3.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 10208 return; 10209 } 10210 if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store3.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences. 10211 isMouseLikePointerType(pointerTypeRef.current)) { 10212 const open3 = () => { 10213 if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store3.select("open")) { 10214 store3.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl)); 10215 } 10216 }; 10217 const openDelay = getOpenDelay(); 10218 if (openDelay === 0) { 10219 nestedTriggerOpenTimeout.clear(); 10220 open3(); 10221 } else { 10222 nestedTriggerOpenTimeout.start(openDelay, open3); 10223 } 10224 } 10225 }; 10226 const rootTriggerProps = store3.useState("appliedTriggerProps", isMountedByThisTrigger || trackCursorAxis !== "none"); 10227 const state = { 10228 open: isOpenedByThisTrigger 10229 }; 10230 const element = useRenderElement("button", componentProps, { 10231 state, 10232 ref: [forwardedRef, registerTrigger, triggerElementRef], 10233 props: [hoverProps, focusProps, rootTriggerProps, { 10234 onMouseOver(event) { 10235 handleNestedTriggerHover(event.nativeEvent); 10236 }, 10237 onFocus(event) { 10238 if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) { 10239 event.preventBaseUIHandler(); 10240 } 10241 }, 10242 onMouseLeave() { 10243 isNestedTriggerHoveredRef.current = false; 10244 nestedTriggerOpenTimeout.clear(); 10245 pointerTypeRef.current = void 0; 10246 }, 10247 onPointerEnter(event) { 10248 pointerTypeRef.current = event.pointerType; 10249 }, 10250 onPointerDown(event) { 10251 pointerTypeRef.current = event.pointerType; 10252 store3.set("closeOnClick", closeOnClick); 10253 if (closeOnClick && !store3.select("open")) { 10254 store3.cancelPendingOpen(event.nativeEvent); 10255 } 10256 }, 10257 onClick(event) { 10258 if (closeOnClick && !store3.select("open")) { 10259 store3.cancelPendingOpen(event.nativeEvent); 10260 } 10261 }, 10262 id: thisTriggerId, 10263 [triggerDisabled]: disabled2 ? "" : void 0, 10264 [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : "" 10265 }, elementProps], 10266 stateAttributesMapping: triggerOpenStateMapping2 10267 }); 10268 return element; 10269 }); 10270 if (true) TooltipTrigger.displayName = "TooltipTrigger"; 10271 10272 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs 10273 var React53 = __toESM(require_react(), 1); 10274 10275 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs 10276 var React52 = __toESM(require_react(), 1); 10277 var TooltipPortalContext = /* @__PURE__ */ React52.createContext(void 0); 10278 if (true) TooltipPortalContext.displayName = "TooltipPortalContext"; 10279 function useTooltipPortalContext() { 10280 const value = React52.useContext(TooltipPortalContext); 10281 if (value === void 0) { 10282 throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70)); 10283 } 10284 return value; 10285 } 10286 10287 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs 10288 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); 10289 var TooltipPortal = /* @__PURE__ */ React53.forwardRef(function TooltipPortal2(props, forwardedRef) { 10290 const { 10291 keepMounted = false, 10292 ...portalProps 10293 } = props; 10294 const store3 = useTooltipRootContext(); 10295 const mounted = store3.useState("mounted"); 10296 const shouldRender = mounted || keepMounted; 10297 if (!shouldRender) { 10298 return null; 10299 } 10300 return /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(TooltipPortalContext.Provider, { 10301 value: keepMounted, 10302 children: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(FloatingPortalLite, { 10303 ref: forwardedRef, 10304 ...portalProps 10305 }) 10306 }); 10307 }); 10308 if (true) TooltipPortal.displayName = "TooltipPortal"; 10309 10310 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs 10311 var React55 = __toESM(require_react(), 1); 10312 10313 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs 10314 var React54 = __toESM(require_react(), 1); 10315 var TooltipPositionerContext = /* @__PURE__ */ React54.createContext(void 0); 10316 if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext"; 10317 function useTooltipPositionerContext() { 10318 const context = React54.useContext(TooltipPositionerContext); 10319 if (context === void 0) { 10320 throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71)); 10321 } 10322 return context; 10323 } 10324 10325 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs 10326 var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); 10327 var TooltipPositioner = /* @__PURE__ */ React55.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { 10328 const { 10329 render, 10330 className, 10331 anchor, 10332 positionMethod = "absolute", 10333 side = "top", 10334 align = "center", 10335 sideOffset = 0, 10336 alignOffset = 0, 10337 collisionBoundary = "clipping-ancestors", 10338 collisionPadding = 5, 10339 arrowPadding = 5, 10340 sticky = false, 10341 disableAnchorTracking = false, 10342 collisionAvoidance = POPUP_COLLISION_AVOIDANCE, 10343 style, 10344 ...elementProps 10345 } = componentProps; 10346 const store3 = useTooltipRootContext(); 10347 const keepMounted = useTooltipPortalContext(); 10348 const open3 = store3.useState("open"); 10349 const mounted = store3.useState("mounted"); 10350 const trackCursorAxis = store3.useState("trackCursorAxis"); 10351 const disableHoverablePopup = store3.useState("disableHoverablePopup"); 10352 const floatingRootContext = store3.useState("floatingRootContext"); 10353 const instantType = store3.useState("instantType"); 10354 const transitionStatus = store3.useState("transitionStatus"); 10355 const adaptiveOrigin2 = store3.useState("adaptiveOrigin"); 10356 const positioning = useAnchorPositioning({ 10357 anchor, 10358 positionMethod, 10359 floatingRootContext, 10360 mounted, 10361 side, 10362 sideOffset, 10363 align, 10364 alignOffset, 10365 collisionBoundary, 10366 collisionPadding, 10367 sticky, 10368 arrowPadding, 10369 disableAnchorTracking, 10370 keepMounted, 10371 collisionAvoidance, 10372 adaptiveOrigin: adaptiveOrigin2 10373 }); 10374 const state = React55.useMemo(() => ({ 10375 open: open3, 10376 side: positioning.side, 10377 align: positioning.align, 10378 anchorHidden: positioning.anchorHidden, 10379 instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType 10380 }), [open3, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); 10381 const element = usePositioner(componentProps, state, { 10382 styles: positioning.positionerStyles, 10383 transitionStatus, 10384 props: elementProps, 10385 refs: [forwardedRef, store3.useStateSetter("positionerElement")], 10386 hidden: !mounted, 10387 inert: !open3 || trackCursorAxis === "both" || disableHoverablePopup 10388 }); 10389 return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(TooltipPositionerContext.Provider, { 10390 value: positioning, 10391 children: element 10392 }); 10393 }); 10394 if (true) TooltipPositioner.displayName = "TooltipPositioner"; 10395 10396 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs 10397 var React56 = __toESM(require_react(), 1); 10398 var TooltipPopup = /* @__PURE__ */ React56.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { 10399 const { 10400 render, 10401 className, 10402 style, 10403 ...elementProps 10404 } = componentProps; 10405 const store3 = useTooltipRootContext(); 10406 const { 10407 side, 10408 align 10409 } = useTooltipPositionerContext(); 10410 const open3 = store3.useState("open"); 10411 const instantType = store3.useState("instantType"); 10412 const transitionStatus = store3.useState("transitionStatus"); 10413 const popupProps = store3.useState("popupProps"); 10414 const floatingContext = store3.useState("floatingRootContext"); 10415 const disabled2 = store3.useState("disabled"); 10416 const closeDelay = store3.useState("closeDelay"); 10417 useOpenChangeComplete({ 10418 open: open3, 10419 ref: store3.context.popupRef, 10420 onComplete() { 10421 if (open3) { 10422 store3.context.onOpenChangeComplete?.(true); 10423 } 10424 } 10425 }); 10426 useHoverFloatingInteraction(floatingContext, { 10427 enabled: !disabled2, 10428 closeDelay 10429 }); 10430 const setPopupElement = store3.useStateSetter("popupElement"); 10431 const state = { 10432 open: open3, 10433 side, 10434 align, 10435 instant: instantType, 10436 transitionStatus 10437 }; 10438 const element = useRenderElement("div", componentProps, { 10439 state, 10440 ref: [forwardedRef, store3.context.popupRef, setPopupElement], 10441 props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], 10442 stateAttributesMapping: popupTransitionStateMapping 10443 }); 10444 return element; 10445 }); 10446 if (true) TooltipPopup.displayName = "TooltipPopup"; 10447 10448 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs 10449 var React57 = __toESM(require_react(), 1); 10450 var TooltipArrow = /* @__PURE__ */ React57.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { 10451 const { 10452 render, 10453 className, 10454 style, 10455 ...elementProps 10456 } = componentProps; 10457 const store3 = useTooltipRootContext(); 10458 const { 10459 arrowRef, 10460 side, 10461 align, 10462 arrowUncentered, 10463 arrowStyles 10464 } = useTooltipPositionerContext(); 10465 const open3 = store3.useState("open"); 10466 const instantType = store3.useState("instantType"); 10467 const state = { 10468 open: open3, 10469 side, 10470 align, 10471 uncentered: arrowUncentered, 10472 instant: instantType 10473 }; 10474 const element = useRenderElement("div", componentProps, { 10475 state, 10476 ref: [forwardedRef, arrowRef], 10477 props: [{ 10478 style: arrowStyles, 10479 "aria-hidden": true 10480 }, elementProps], 10481 stateAttributesMapping: popupStateMapping 10482 }); 10483 return element; 10484 }); 10485 if (true) TooltipArrow.displayName = "TooltipArrow"; 10486 10487 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs 10488 var React58 = __toESM(require_react(), 1); 10489 var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); 10490 var TooltipProvider = function TooltipProvider2(props) { 10491 const { 10492 delay, 10493 closeDelay, 10494 timeout = 400 10495 } = props; 10496 const delayValue = React58.useMemo(() => ({ 10497 open: delay, 10498 close: closeDelay 10499 }), [delay, closeDelay]); 10500 return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(TooltipProviderContext.Provider, { 10501 value: delay, 10502 children: /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(FloatingDelayGroup, { 10503 delay: delayValue, 10504 timeoutMs: timeout, 10505 children: props.children 10506 }) 10507 }); 10508 }; 10509 if (true) TooltipProvider.displayName = "TooltipProvider"; 10510 10511 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs 10512 var React59 = __toESM(require_react(), 1); 10513 var TooltipViewport = /* @__PURE__ */ React59.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { 10514 const { 10515 render, 10516 className, 10517 style, 10518 children, 10519 ...elementProps 10520 } = componentProps; 10521 const store3 = useTooltipRootContext(); 10522 const positioner = useTooltipPositionerContext(); 10523 const instantType = store3.useState("instantType"); 10524 const { 10525 children: childrenToRender, 10526 state: viewportState 10527 } = usePopupViewport({ 10528 store: store3, 10529 side: positioner.side, 10530 children 10531 }); 10532 const state = { 10533 activationDirection: viewportState.activationDirection, 10534 transitioning: viewportState.transitioning, 10535 instant: instantType 10536 }; 10537 return useRenderElement("div", componentProps, { 10538 state, 10539 ref: forwardedRef, 10540 props: [elementProps, { 10541 children: childrenToRender 10542 }], 10543 stateAttributesMapping: popupViewportStateMapping 10544 }); 10545 }); 10546 if (true) TooltipViewport.displayName = "TooltipViewport"; 10547 10548 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs 10549 var TooltipHandle = class extends BasePopupHandle { 10550 constructor() { 10551 super(createNullTooltipStore(), "Tooltip"); 10552 } 10553 /** 10554 * Opens the tooltip and associates it with the trigger with the given id. 10555 * 10556 * This method should only be called in an event handler or an effect (not during rendering). 10557 * 10558 * @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching 10559 * `Tooltip.Trigger` with this handle passed as a prop. 10560 */ 10561 open(triggerId) { 10562 this.openByTrigger(triggerId); 10563 } 10564 /** 10565 * Closes the tooltip. 10566 * 10567 * This method should only be called in an event handler or an effect (not during rendering). 10568 */ 10569 close() { 10570 this.closePopup(); 10571 } 10572 /** 10573 * Whether the tooltip is currently open. Returns `false` while no root is attached to the handle. 10574 */ 10575 get isOpen() { 10576 return this.attachedStore?.select("open") ?? false; 10577 } 10578 }; 10579 function createTooltipHandle() { 10580 return new TooltipHandle(); 10581 } 10582 10583 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/use-render/useRender.mjs 10584 function useRender(params) { 10585 return useRenderElement(params.defaultTagName ?? "div", params, params); 10586 } 10587 10588 // packages/ui/build-module/text/text.mjs 10589 var import_element14 = __toESM(require_element(), 1); 10590 var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; 10591 function getRuntime() { 10592 const globalScope = globalThis; 10593 if (globalScope.__wpStyleRuntime) { 10594 return globalScope.__wpStyleRuntime; 10595 } 10596 globalScope.__wpStyleRuntime = { 10597 documents: /* @__PURE__ */ new Map(), 10598 styles: /* @__PURE__ */ new Map(), 10599 injectedStyles: /* @__PURE__ */ new WeakMap() 10600 }; 10601 if (typeof document !== "undefined") { 10602 registerDocument(document); 10603 } 10604 return globalScope.__wpStyleRuntime; 10605 } 10606 function documentContainsStyleHash(targetDocument, hash) { 10607 if (!targetDocument.head) { 10608 return false; 10609 } 10610 for (const style of targetDocument.head.querySelectorAll( 10611 `style[$STYLE_HASH_ATTRIBUTE}]` 10612 )) { 10613 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { 10614 return true; 10615 } 10616 } 10617 return false; 10618 } 10619 function injectStyle(targetDocument, hash, css) { 10620 if (!targetDocument.head) { 10621 return; 10622 } 10623 const runtime = getRuntime(); 10624 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10625 if (!injectedStyles) { 10626 injectedStyles = /* @__PURE__ */ new Set(); 10627 runtime.injectedStyles.set(targetDocument, injectedStyles); 10628 } 10629 if (injectedStyles.has(hash)) { 10630 return; 10631 } 10632 if (documentContainsStyleHash(targetDocument, hash)) { 10633 injectedStyles.add(hash); 10634 return; 10635 } 10636 const style = targetDocument.createElement("style"); 10637 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); 10638 style.appendChild(targetDocument.createTextNode(css)); 10639 targetDocument.head.appendChild(style); 10640 injectedStyles.add(hash); 10641 } 10642 function registerDocument(targetDocument) { 10643 const runtime = getRuntime(); 10644 runtime.documents.set( 10645 targetDocument, 10646 (runtime.documents.get(targetDocument) ?? 0) + 1 10647 ); 10648 for (const [hash, css] of runtime.styles) { 10649 injectStyle(targetDocument, hash, css); 10650 } 10651 return () => { 10652 const count = runtime.documents.get(targetDocument); 10653 if (count === void 0) { 10654 return; 10655 } 10656 if (count <= 1) { 10657 runtime.documents.delete(targetDocument); 10658 return; 10659 } 10660 runtime.documents.set(targetDocument, count - 1); 10661 }; 10662 } 10663 function registerStyle(hash, css) { 10664 const runtime = getRuntime(); 10665 runtime.styles.set(hash, css); 10666 for (const targetDocument of runtime.documents.keys()) { 10667 injectStyle(targetDocument, hash, css); 10668 } 10669 } 10670 if (typeof process === "undefined" || true) { 10671 registerStyle("3167e7d116", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{text-wrap:pretty;margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-emphasis,600);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-emphasis,600);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-default,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-default,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 10672 } 10673 var style_default = { "text": "_83ed8a8da5dd50ea__text", "heading-2xl": "_14437cfb77831647__heading-2xl", "heading-xl": "_3c78b7fa9b4072dd__heading-xl", "heading-lg": "aa58f227716bcde2__heading-lg", "heading-md": "fc4da56d8dfe52c4__heading-md", "heading-sm": "a9b78c7c82e8dff7__heading-sm", "body-xl": "_305ff559e52180d5__body-xl", "body-lg": "ca1aa3fc2029e958__body-lg", "body-md": "_131101940be12424__body-md", "body-sm": "_0e8d87a42c1f75fa__body-sm" }; 10674 if (typeof process === "undefined" || true) { 10675 registerStyle("abb19c3171", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._400bf7ee0c6061a9__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}"); 10676 } 10677 var global_css_defense_default = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li", "span": "_400bf7ee0c6061a9__span" }; 10678 var Text = (0, import_element14.forwardRef)( 10679 function UnforwardedText({ variant = "body-md", render, className, ...props }, ref) { 10680 const element = useRender({ 10681 render, 10682 defaultTagName: "span", 10683 ref, 10684 props: mergeProps(props, { 10685 className: clsx_default( 10686 style_default.text, 10687 global_css_defense_default.heading, 10688 global_css_defense_default.p, 10689 style_default[variant], 10690 className 10691 ) 10692 }) 10693 }); 10694 return element; 10695 } 10696 ); 10697 10698 // packages/ui/build-module/button/button.mjs 10699 var import_a11y = __toESM(require_a11y(), 1); 10700 var import_element16 = __toESM(require_element(), 1); 10701 var import_i18n2 = __toESM(require_i18n(), 1); 10702 10703 // packages/ui/build-module/spinner/spinner.mjs 10704 var import_element15 = __toESM(require_element(), 1); 10705 var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); 10706 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; 10707 function getRuntime2() { 10708 const globalScope = globalThis; 10709 if (globalScope.__wpStyleRuntime) { 10710 return globalScope.__wpStyleRuntime; 10711 } 10712 globalScope.__wpStyleRuntime = { 10713 documents: /* @__PURE__ */ new Map(), 10714 styles: /* @__PURE__ */ new Map(), 10715 injectedStyles: /* @__PURE__ */ new WeakMap() 10716 }; 10717 if (typeof document !== "undefined") { 10718 registerDocument2(document); 10719 } 10720 return globalScope.__wpStyleRuntime; 10721 } 10722 function documentContainsStyleHash2(targetDocument, hash) { 10723 if (!targetDocument.head) { 10724 return false; 10725 } 10726 for (const style of targetDocument.head.querySelectorAll( 10727 `style[$STYLE_HASH_ATTRIBUTE2}]` 10728 )) { 10729 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { 10730 return true; 10731 } 10732 } 10733 return false; 10734 } 10735 function injectStyle2(targetDocument, hash, css) { 10736 if (!targetDocument.head) { 10737 return; 10738 } 10739 const runtime = getRuntime2(); 10740 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10741 if (!injectedStyles) { 10742 injectedStyles = /* @__PURE__ */ new Set(); 10743 runtime.injectedStyles.set(targetDocument, injectedStyles); 10744 } 10745 if (injectedStyles.has(hash)) { 10746 return; 10747 } 10748 if (documentContainsStyleHash2(targetDocument, hash)) { 10749 injectedStyles.add(hash); 10750 return; 10751 } 10752 const style = targetDocument.createElement("style"); 10753 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); 10754 style.appendChild(targetDocument.createTextNode(css)); 10755 targetDocument.head.appendChild(style); 10756 injectedStyles.add(hash); 10757 } 10758 function registerDocument2(targetDocument) { 10759 const runtime = getRuntime2(); 10760 runtime.documents.set( 10761 targetDocument, 10762 (runtime.documents.get(targetDocument) ?? 0) + 1 10763 ); 10764 for (const [hash, css] of runtime.styles) { 10765 injectStyle2(targetDocument, hash, css); 10766 } 10767 return () => { 10768 const count = runtime.documents.get(targetDocument); 10769 if (count === void 0) { 10770 return; 10771 } 10772 if (count <= 1) { 10773 runtime.documents.delete(targetDocument); 10774 return; 10775 } 10776 runtime.documents.set(targetDocument, count - 1); 10777 }; 10778 } 10779 function registerStyle2(hash, css) { 10780 const runtime = getRuntime2(); 10781 runtime.styles.set(hash, css); 10782 for (const targetDocument of runtime.documents.keys()) { 10783 injectStyle2(targetDocument, hash, css); 10784 } 10785 } 10786 if (typeof process === "undefined" || true) { 10787 registerStyle2("dbe7fd6094", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.ab4d64c07c0ba587__spinner{background-color:transparent;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:inline-block;height:var(--wpds-dimension-size-2xs,16px);opacity:1;overflow:visible;position:relative;width:var(--wpds-dimension-size-2xs,16px)}.a7654e10245bb7d2__indicator{fill:transparent;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;transform-origin:50% 50%;@media (forced-colors:active){stroke:CanvasText}animation:_02322d973909703c__spinner-spin 1.4s linear infinite both}@keyframes _02322d973909703c__spinner-spin{0%{transform:rotate(0deg)}to{transform:rotate(1turn)}}}}"); 10788 } 10789 var style_default2 = { "spinner": "ab4d64c07c0ba587__spinner", "indicator": "a7654e10245bb7d2__indicator", "spinner-spin": "_02322d973909703c__spinner-spin" }; 10790 var Spinner = (0, import_element15.forwardRef)( 10791 function UnforwardedSpinner({ className, color, style, ...props }, ref) { 10792 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 10793 "svg", 10794 { 10795 className: clsx_default(style_default2.spinner, className), 10796 style: color === void 0 ? style : { ...style, color }, 10797 viewBox: "0 0 24 24", 10798 xmlns: "http://www.w3.org/2000/svg", 10799 role: "presentation", 10800 focusable: "false", 10801 ...props, 10802 ref, 10803 children: /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 10804 "path", 10805 { 10806 className: style_default2.indicator, 10807 d: "m 12 0 a 12 12 0 0 1 0 24" 10808 } 10809 ) 10810 } 10811 ); 10812 } 10813 ); 10814 10815 // packages/ui/build-module/button/button.mjs 10816 var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); 10817 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; 10818 function getRuntime3() { 10819 const globalScope = globalThis; 10820 if (globalScope.__wpStyleRuntime) { 10821 return globalScope.__wpStyleRuntime; 10822 } 10823 globalScope.__wpStyleRuntime = { 10824 documents: /* @__PURE__ */ new Map(), 10825 styles: /* @__PURE__ */ new Map(), 10826 injectedStyles: /* @__PURE__ */ new WeakMap() 10827 }; 10828 if (typeof document !== "undefined") { 10829 registerDocument3(document); 10830 } 10831 return globalScope.__wpStyleRuntime; 10832 } 10833 function documentContainsStyleHash3(targetDocument, hash) { 10834 if (!targetDocument.head) { 10835 return false; 10836 } 10837 for (const style of targetDocument.head.querySelectorAll( 10838 `style[$STYLE_HASH_ATTRIBUTE3}]` 10839 )) { 10840 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) { 10841 return true; 10842 } 10843 } 10844 return false; 10845 } 10846 function injectStyle3(targetDocument, hash, css) { 10847 if (!targetDocument.head) { 10848 return; 10849 } 10850 const runtime = getRuntime3(); 10851 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10852 if (!injectedStyles) { 10853 injectedStyles = /* @__PURE__ */ new Set(); 10854 runtime.injectedStyles.set(targetDocument, injectedStyles); 10855 } 10856 if (injectedStyles.has(hash)) { 10857 return; 10858 } 10859 if (documentContainsStyleHash3(targetDocument, hash)) { 10860 injectedStyles.add(hash); 10861 return; 10862 } 10863 const style = targetDocument.createElement("style"); 10864 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash); 10865 style.appendChild(targetDocument.createTextNode(css)); 10866 targetDocument.head.appendChild(style); 10867 injectedStyles.add(hash); 10868 } 10869 function registerDocument3(targetDocument) { 10870 const runtime = getRuntime3(); 10871 runtime.documents.set( 10872 targetDocument, 10873 (runtime.documents.get(targetDocument) ?? 0) + 1 10874 ); 10875 for (const [hash, css] of runtime.styles) { 10876 injectStyle3(targetDocument, hash, css); 10877 } 10878 return () => { 10879 const count = runtime.documents.get(targetDocument); 10880 if (count === void 0) { 10881 return; 10882 } 10883 if (count <= 1) { 10884 runtime.documents.delete(targetDocument); 10885 return; 10886 } 10887 runtime.documents.set(targetDocument, count - 1); 10888 }; 10889 } 10890 function registerStyle3(hash, css) { 10891 const runtime = getRuntime3(); 10892 runtime.styles.set(hash, css); 10893 for (const targetDocument of runtime.documents.keys()) { 10894 injectStyle3(targetDocument, hash, css); 10895 } 10896 } 10897 if (typeof process === "undefined" || true) { 10898 registerStyle3("1052986a11", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:var(--wpds-typography-font-weight-emphasis,600);--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:var(--wpds-dimension-size-lg,40px);--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:border-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-block:0px;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:var(--wpds-dimension-size-sm,24px)}._9f6fc6553aeb36fe__icon{margin:var(--wp-ui-button-icon-margin)}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-brand-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.ad0619a3217c6a5b__is-minimal[aria-pressed=true],&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:var(--wpds-dimension-size-md,32px)}._914b42f315c0e580__is-loading:not(.abbb272e2ce49bd6__is-unstyled){color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}@media (forced-colors:active){color:ButtonFace}>:not(._1322fe375ff021a3__spinner){opacity:0}}}@layer compositions{._1322fe375ff021a3__spinner{color:var(--wp-ui-button-foreground-color);height:var(--wp-ui-button-font-size);inset:0;margin:auto;pointer-events:none;position:absolute;width:var(--wp-ui-button-font-size);>*{stroke-width:2.75}@media (prefers-reduced-motion){>*{animation:none}}@media (forced-colors:active){>*{stroke:ButtonText}}}}}'); 10899 } 10900 var style_default3 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "icon": "_9f6fc6553aeb36fe__icon", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "spinner": "_1322fe375ff021a3__spinner" }; 10901 if (typeof process === "undefined" || true) { 10902 registerStyle3("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 10903 } 10904 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 10905 if (typeof process === "undefined" || true) { 10906 registerStyle3("7c3267f794", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); 10907 } 10908 var focus_module_default = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" }; 10909 if (typeof process === "undefined" || true) { 10910 registerStyle3("abb19c3171", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._400bf7ee0c6061a9__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}"); 10911 } 10912 var global_css_defense_default2 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li", "span": "_400bf7ee0c6061a9__span" }; 10913 var Button5 = (0, import_element16.forwardRef)( 10914 function UnforwardedButton({ 10915 tone = "brand", 10916 variant = "solid", 10917 size: size4 = "default", 10918 className, 10919 focusableWhenDisabled = true, 10920 disabled: disabled2, 10921 loading, 10922 loadingAnnouncement = (0, import_i18n2.__)("Loading"), 10923 children, 10924 ...props 10925 }, ref) { 10926 const mergedClassName = clsx_default( 10927 global_css_defense_default2.button, 10928 resets_default["box-sizing"], 10929 focus_module_default["outset-ring--focus-except-active"], 10930 variant !== "unstyled" && style_default3.button, 10931 style_default3[`is-$tone}`], 10932 style_default3[`is-$variant}`], 10933 style_default3[`is-$size4}`], 10934 loading && style_default3["is-loading"], 10935 className 10936 ); 10937 (0, import_element16.useEffect)(() => { 10938 if (loading && loadingAnnouncement) { 10939 (0, import_a11y.speak)(loadingAnnouncement); 10940 } 10941 }, [loading, loadingAnnouncement]); 10942 return /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)( 10943 Button3, 10944 { 10945 ref, 10946 className: mergedClassName, 10947 focusableWhenDisabled, 10948 disabled: disabled2 ?? loading, 10949 ...props, 10950 children: [ 10951 children, 10952 loading && variant !== "unstyled" && /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(Spinner, { className: style_default3.spinner }) 10953 ] 10954 } 10955 ); 10956 } 10957 ); 10958 10959 // packages/ui/build-module/button/icon.mjs 10960 var import_element17 = __toESM(require_element(), 1); 10961 var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); 10962 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; 10963 function getRuntime4() { 10964 const globalScope = globalThis; 10965 if (globalScope.__wpStyleRuntime) { 10966 return globalScope.__wpStyleRuntime; 10967 } 10968 globalScope.__wpStyleRuntime = { 10969 documents: /* @__PURE__ */ new Map(), 10970 styles: /* @__PURE__ */ new Map(), 10971 injectedStyles: /* @__PURE__ */ new WeakMap() 10972 }; 10973 if (typeof document !== "undefined") { 10974 registerDocument4(document); 10975 } 10976 return globalScope.__wpStyleRuntime; 10977 } 10978 function documentContainsStyleHash4(targetDocument, hash) { 10979 if (!targetDocument.head) { 10980 return false; 10981 } 10982 for (const style of targetDocument.head.querySelectorAll( 10983 `style[$STYLE_HASH_ATTRIBUTE4}]` 10984 )) { 10985 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) { 10986 return true; 10987 } 10988 } 10989 return false; 10990 } 10991 function injectStyle4(targetDocument, hash, css) { 10992 if (!targetDocument.head) { 10993 return; 10994 } 10995 const runtime = getRuntime4(); 10996 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10997 if (!injectedStyles) { 10998 injectedStyles = /* @__PURE__ */ new Set(); 10999 runtime.injectedStyles.set(targetDocument, injectedStyles); 11000 } 11001 if (injectedStyles.has(hash)) { 11002 return; 11003 } 11004 if (documentContainsStyleHash4(targetDocument, hash)) { 11005 injectedStyles.add(hash); 11006 return; 11007 } 11008 const style = targetDocument.createElement("style"); 11009 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash); 11010 style.appendChild(targetDocument.createTextNode(css)); 11011 targetDocument.head.appendChild(style); 11012 injectedStyles.add(hash); 11013 } 11014 function registerDocument4(targetDocument) { 11015 const runtime = getRuntime4(); 11016 runtime.documents.set( 11017 targetDocument, 11018 (runtime.documents.get(targetDocument) ?? 0) + 1 11019 ); 11020 for (const [hash, css] of runtime.styles) { 11021 injectStyle4(targetDocument, hash, css); 11022 } 11023 return () => { 11024 const count = runtime.documents.get(targetDocument); 11025 if (count === void 0) { 11026 return; 11027 } 11028 if (count <= 1) { 11029 runtime.documents.delete(targetDocument); 11030 return; 11031 } 11032 runtime.documents.set(targetDocument, count - 1); 11033 }; 11034 } 11035 function registerStyle4(hash, css) { 11036 const runtime = getRuntime4(); 11037 runtime.styles.set(hash, css); 11038 for (const targetDocument of runtime.documents.keys()) { 11039 injectStyle4(targetDocument, hash, css); 11040 } 11041 } 11042 if (typeof process === "undefined" || true) { 11043 registerStyle4("1052986a11", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:var(--wpds-typography-font-weight-emphasis,600);--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-strong-disabled,#8d8d8d);--wp-ui-button-padding-block:var(--wpds-dimension-padding-xs,4px);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:var(--wpds-dimension-size-lg,40px);--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-icon-margin:calc((var(--wpds-dimension-size-2xs, 16px) - var(--wpds-dimension-size-sm, 24px))/2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:border-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);max-width:100%;min-height:var(--wp-ui-button-height);min-width:var(--wp-ui-button-min-width);overflow-wrap:anywhere;padding-block:var(--wp-ui-button-padding-block);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-align:center;text-decoration:none;&:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-block:0px;--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:var(--wpds-dimension-size-sm,24px)}._9f6fc6553aeb36fe__icon{margin:var(--wp-ui-button-icon-margin)}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-brand-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-brand-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-background-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-brand-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.ad0619a3217c6a5b__is-minimal[aria-pressed=true],&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-foreground-color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-foreground-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal:not([aria-pressed=true]){--wp-ui-button-background-color:var(--wpds-color-background-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-background-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-background-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:var(--wpds-dimension-size-md,32px)}._914b42f315c0e580__is-loading:not(.abbb272e2ce49bd6__is-unstyled){color:transparent;&:not([data-disabled]):is(:hover,:active,:focus){color:transparent}@media (forced-colors:active){color:ButtonFace}>:not(._1322fe375ff021a3__spinner){opacity:0}}}@layer compositions{._1322fe375ff021a3__spinner{color:var(--wp-ui-button-foreground-color);height:var(--wp-ui-button-font-size);inset:0;margin:auto;pointer-events:none;position:absolute;width:var(--wp-ui-button-font-size);>*{stroke-width:2.75}@media (prefers-reduced-motion){>*{animation:none}}@media (forced-colors:active){>*{stroke:ButtonText}}}}}'); 11044 } 11045 var style_default4 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "icon": "_9f6fc6553aeb36fe__icon", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "spinner": "_1322fe375ff021a3__spinner" }; 11046 var ButtonIcon = (0, import_element17.forwardRef)( 11047 function UnforwardedButtonIcon({ className, icon, ...props }, ref) { 11048 return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( 11049 Icon, 11050 { 11051 ref, 11052 icon, 11053 className: clsx_default(style_default4.icon, className), 11054 size: 24, 11055 ...props 11056 } 11057 ); 11058 } 11059 ); 11060 11061 // packages/ui/build-module/button/index.mjs 11062 ButtonIcon.displayName = "Button.Icon"; 11063 var Button6 = Object.assign(Button5, { 11064 /** 11065 * An icon component specifically designed to work well when rendered inside 11066 * a `Button` component. 11067 */ 11068 Icon: ButtonIcon 11069 }); 11070 11071 // packages/ui/build-module/utils/keyboard-shortcut.mjs 11072 var import_element19 = __toESM(require_element(), 1); 11073 var import_i18n3 = __toESM(require_i18n(), 1); 11074 11075 // packages/ui/build-module/visually-hidden/visually-hidden.mjs 11076 var import_element18 = __toESM(require_element(), 1); 11077 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; 11078 function getRuntime5() { 11079 const globalScope = globalThis; 11080 if (globalScope.__wpStyleRuntime) { 11081 return globalScope.__wpStyleRuntime; 11082 } 11083 globalScope.__wpStyleRuntime = { 11084 documents: /* @__PURE__ */ new Map(), 11085 styles: /* @__PURE__ */ new Map(), 11086 injectedStyles: /* @__PURE__ */ new WeakMap() 11087 }; 11088 if (typeof document !== "undefined") { 11089 registerDocument5(document); 11090 } 11091 return globalScope.__wpStyleRuntime; 11092 } 11093 function documentContainsStyleHash5(targetDocument, hash) { 11094 if (!targetDocument.head) { 11095 return false; 11096 } 11097 for (const style of targetDocument.head.querySelectorAll( 11098 `style[$STYLE_HASH_ATTRIBUTE5}]` 11099 )) { 11100 if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) { 11101 return true; 11102 } 11103 } 11104 return false; 11105 } 11106 function injectStyle5(targetDocument, hash, css) { 11107 if (!targetDocument.head) { 11108 return; 11109 } 11110 const runtime = getRuntime5(); 11111 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11112 if (!injectedStyles) { 11113 injectedStyles = /* @__PURE__ */ new Set(); 11114 runtime.injectedStyles.set(targetDocument, injectedStyles); 11115 } 11116 if (injectedStyles.has(hash)) { 11117 return; 11118 } 11119 if (documentContainsStyleHash5(targetDocument, hash)) { 11120 injectedStyles.add(hash); 11121 return; 11122 } 11123 const style = targetDocument.createElement("style"); 11124 style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash); 11125 style.appendChild(targetDocument.createTextNode(css)); 11126 targetDocument.head.appendChild(style); 11127 injectedStyles.add(hash); 11128 } 11129 function registerDocument5(targetDocument) { 11130 const runtime = getRuntime5(); 11131 runtime.documents.set( 11132 targetDocument, 11133 (runtime.documents.get(targetDocument) ?? 0) + 1 11134 ); 11135 for (const [hash, css] of runtime.styles) { 11136 injectStyle5(targetDocument, hash, css); 11137 } 11138 return () => { 11139 const count = runtime.documents.get(targetDocument); 11140 if (count === void 0) { 11141 return; 11142 } 11143 if (count <= 1) { 11144 runtime.documents.delete(targetDocument); 11145 return; 11146 } 11147 runtime.documents.set(targetDocument, count - 1); 11148 }; 11149 } 11150 function registerStyle5(hash, css) { 11151 const runtime = getRuntime5(); 11152 runtime.styles.set(hash, css); 11153 for (const targetDocument of runtime.documents.keys()) { 11154 injectStyle5(targetDocument, hash, css); 11155 } 11156 } 11157 if (typeof process === "undefined" || true) { 11158 registerStyle5("15abcab4d0", ".f37b9e2e191ebd66__visually-hidden{border:0;clip-path:inset(50%);height:1px;margin:-1px;overflow:hidden;overflow-wrap:normal;padding:0;position:absolute;width:1px;word-break:normal}"); 11159 } 11160 var style_default5 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; 11161 var VisuallyHidden = (0, import_element18.forwardRef)( 11162 function UnforwardedVisuallyHidden({ render, ...restProps }, ref) { 11163 const element = useRender({ 11164 render, 11165 ref, 11166 props: mergeProps( 11167 { className: style_default5["visually-hidden"] }, 11168 restProps, 11169 { 11170 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. 11171 "data-visually-hidden": "" 11172 } 11173 ) 11174 }); 11175 return element; 11176 } 11177 ); 11178 11179 // packages/ui/build-module/utils/keyboard-shortcut.mjs 11180 var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); 11181 function useKeyboardShortcutProps({ 11182 "aria-describedby": ariaDescribedBy, 11183 "aria-keyshortcuts": ariaKeyShortcuts, 11184 shortcut 11185 }) { 11186 const generatedDescriptionId = (0, import_element19.useId)(); 11187 const descriptionId = shortcut ? generatedDescriptionId : void 0; 11188 const describedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" "); 11189 return { 11190 descriptionId, 11191 targetProps: { 11192 "aria-describedby": describedBy || void 0, 11193 "aria-keyshortcuts": shortcut?.ariaKeyShortcut ?? ariaKeyShortcuts 11194 } 11195 }; 11196 } 11197 var KeyboardShortcutDescription = (0, import_element19.forwardRef)(function UnforwardedKeyboardShortcutDescription({ descriptionId, shortcut }, ref) { 11198 return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11199 VisuallyHidden, 11200 { 11201 id: descriptionId, 11202 "aria-hidden": "true", 11203 render: /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { ref }), 11204 children: (0, import_i18n3.sprintf)( 11205 /* translators: %s: keyboard shortcut. */ 11206 (0, import_i18n3.__)("Keyboard shortcut: %s"), 11207 shortcut.label ?? shortcut.ariaKeyShortcut 11208 ) 11209 } 11210 ); 11211 }); 11212 var KeyboardShortcutDisplay = (0, import_element19.forwardRef)(function UnforwardedKeyboardShortcutDisplay({ className, shortcut }, ref) { 11213 return /* @__PURE__ */ (0, import_jsx_runtime41.jsx)("span", { ref, "aria-hidden": "true", className, dir: "ltr", children: shortcut.displayShortcut }); 11214 }); 11215 11216 // packages/ui/build-module/utils/render-slot-with-children.mjs 11217 var import_element20 = __toESM(require_element(), 1); 11218 function renderSlotWithChildren(slot, defaultSlot, children) { 11219 return (0, import_element20.cloneElement)( 11220 slot ?? defaultSlot, 11221 { children } 11222 ); 11223 } 11224 11225 // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs 11226 var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash"; 11227 function getRuntime6() { 11228 const globalScope = globalThis; 11229 if (globalScope.__wpStyleRuntime) { 11230 return globalScope.__wpStyleRuntime; 11231 } 11232 globalScope.__wpStyleRuntime = { 11233 documents: /* @__PURE__ */ new Map(), 11234 styles: /* @__PURE__ */ new Map(), 11235 injectedStyles: /* @__PURE__ */ new WeakMap() 11236 }; 11237 if (typeof document !== "undefined") { 11238 registerDocument6(document); 11239 } 11240 return globalScope.__wpStyleRuntime; 11241 } 11242 function documentContainsStyleHash6(targetDocument, hash) { 11243 if (!targetDocument.head) { 11244 return false; 11245 } 11246 for (const style of targetDocument.head.querySelectorAll( 11247 `style[$STYLE_HASH_ATTRIBUTE6}]` 11248 )) { 11249 if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) { 11250 return true; 11251 } 11252 } 11253 return false; 11254 } 11255 function injectStyle6(targetDocument, hash, css) { 11256 if (!targetDocument.head) { 11257 return; 11258 } 11259 const runtime = getRuntime6(); 11260 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11261 if (!injectedStyles) { 11262 injectedStyles = /* @__PURE__ */ new Set(); 11263 runtime.injectedStyles.set(targetDocument, injectedStyles); 11264 } 11265 if (injectedStyles.has(hash)) { 11266 return; 11267 } 11268 if (documentContainsStyleHash6(targetDocument, hash)) { 11269 injectedStyles.add(hash); 11270 return; 11271 } 11272 const style = targetDocument.createElement("style"); 11273 style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash); 11274 style.appendChild(targetDocument.createTextNode(css)); 11275 targetDocument.head.appendChild(style); 11276 injectedStyles.add(hash); 11277 } 11278 function registerDocument6(targetDocument) { 11279 const runtime = getRuntime6(); 11280 runtime.documents.set( 11281 targetDocument, 11282 (runtime.documents.get(targetDocument) ?? 0) + 1 11283 ); 11284 for (const [hash, css] of runtime.styles) { 11285 injectStyle6(targetDocument, hash, css); 11286 } 11287 return () => { 11288 const count = runtime.documents.get(targetDocument); 11289 if (count === void 0) { 11290 return; 11291 } 11292 if (count <= 1) { 11293 runtime.documents.delete(targetDocument); 11294 return; 11295 } 11296 runtime.documents.set(targetDocument, count - 1); 11297 }; 11298 } 11299 function registerStyle6(hash, css) { 11300 const runtime = getRuntime6(); 11301 runtime.styles.set(hash, css); 11302 for (const targetDocument of runtime.documents.keys()) { 11303 injectStyle6(targetDocument, hash, css); 11304 } 11305 } 11306 if (typeof process === "undefined" || true) { 11307 registerStyle6("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}"); 11308 } 11309 var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" }; 11310 var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot"; 11311 function resolveOwnerDocument() { 11312 return typeof document === "undefined" ? null : document; 11313 } 11314 function isInWordPressEnvironment() { 11315 let topWp; 11316 try { 11317 topWp = window.top?.wp; 11318 } catch { 11319 } 11320 const wp = topWp ?? window.wp; 11321 return typeof wp?.components === "object" && wp.components !== null; 11322 } 11323 var cachedSlot = null; 11324 function ensureSlotIsAccessible(element) { 11325 element.setAttribute("aria-hidden", "false"); 11326 return element; 11327 } 11328 function createSlot(ownerDocument2) { 11329 const element = ownerDocument2.createElement("div"); 11330 element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, ""); 11331 if (wp_compat_overlay_slot_default.slot) { 11332 element.classList.add(wp_compat_overlay_slot_default.slot); 11333 } 11334 ownerDocument2.body.appendChild(element); 11335 return element; 11336 } 11337 function getWpCompatOverlaySlot() { 11338 if (typeof window === "undefined") { 11339 return void 0; 11340 } 11341 if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) { 11342 return void 0; 11343 } 11344 const ownerDocument2 = resolveOwnerDocument(); 11345 if (!ownerDocument2 || !ownerDocument2.body) { 11346 return void 0; 11347 } 11348 if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) { 11349 return ensureSlotIsAccessible(cachedSlot); 11350 } 11351 const existing = ownerDocument2.querySelector( 11352 `[$WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]` 11353 ); 11354 if (existing instanceof HTMLDivElement) { 11355 cachedSlot = ensureSlotIsAccessible(existing); 11356 return cachedSlot; 11357 } 11358 if (cachedSlot?.isConnected) { 11359 cachedSlot.remove(); 11360 } 11361 cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2)); 11362 return cachedSlot; 11363 } 11364 11365 // packages/ui/build-module/utils/direction-provider.mjs 11366 var import_i18n4 = __toESM(require_i18n(), 1); 11367 var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); 11368 function DirectionProvider3({ children }) { 11369 return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(DirectionProvider, { direction: (0, import_i18n4.isRTL)() ? "rtl" : "ltr", children }); 11370 } 11371 11372 // packages/ui/build-module/tooltip/popup.mjs 11373 var import_element23 = __toESM(require_element(), 1); 11374 11375 // packages/ui/build-module/tooltip/portal.mjs 11376 var import_element21 = __toESM(require_element(), 1); 11377 var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); 11378 var Portal = (0, import_element21.forwardRef)( 11379 function TooltipPortal3({ container, ...restProps }, ref) { 11380 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11381 index_parts_exports2.Portal, 11382 { 11383 container: container === void 0 ? getWpCompatOverlaySlot() : container, 11384 ...restProps, 11385 ref 11386 } 11387 ); 11388 } 11389 ); 11390 11391 // packages/ui/build-module/tooltip/positioner.mjs 11392 var import_element22 = __toESM(require_element(), 1); 11393 var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); 11394 var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash"; 11395 function getRuntime7() { 11396 const globalScope = globalThis; 11397 if (globalScope.__wpStyleRuntime) { 11398 return globalScope.__wpStyleRuntime; 11399 } 11400 globalScope.__wpStyleRuntime = { 11401 documents: /* @__PURE__ */ new Map(), 11402 styles: /* @__PURE__ */ new Map(), 11403 injectedStyles: /* @__PURE__ */ new WeakMap() 11404 }; 11405 if (typeof document !== "undefined") { 11406 registerDocument7(document); 11407 } 11408 return globalScope.__wpStyleRuntime; 11409 } 11410 function documentContainsStyleHash7(targetDocument, hash) { 11411 if (!targetDocument.head) { 11412 return false; 11413 } 11414 for (const style of targetDocument.head.querySelectorAll( 11415 `style[$STYLE_HASH_ATTRIBUTE7}]` 11416 )) { 11417 if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) { 11418 return true; 11419 } 11420 } 11421 return false; 11422 } 11423 function injectStyle7(targetDocument, hash, css) { 11424 if (!targetDocument.head) { 11425 return; 11426 } 11427 const runtime = getRuntime7(); 11428 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11429 if (!injectedStyles) { 11430 injectedStyles = /* @__PURE__ */ new Set(); 11431 runtime.injectedStyles.set(targetDocument, injectedStyles); 11432 } 11433 if (injectedStyles.has(hash)) { 11434 return; 11435 } 11436 if (documentContainsStyleHash7(targetDocument, hash)) { 11437 injectedStyles.add(hash); 11438 return; 11439 } 11440 const style = targetDocument.createElement("style"); 11441 style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash); 11442 style.appendChild(targetDocument.createTextNode(css)); 11443 targetDocument.head.appendChild(style); 11444 injectedStyles.add(hash); 11445 } 11446 function registerDocument7(targetDocument) { 11447 const runtime = getRuntime7(); 11448 runtime.documents.set( 11449 targetDocument, 11450 (runtime.documents.get(targetDocument) ?? 0) + 1 11451 ); 11452 for (const [hash, css] of runtime.styles) { 11453 injectStyle7(targetDocument, hash, css); 11454 } 11455 return () => { 11456 const count = runtime.documents.get(targetDocument); 11457 if (count === void 0) { 11458 return; 11459 } 11460 if (count <= 1) { 11461 runtime.documents.delete(targetDocument); 11462 return; 11463 } 11464 runtime.documents.set(targetDocument, count - 1); 11465 }; 11466 } 11467 function registerStyle7(hash, css) { 11468 const runtime = getRuntime7(); 11469 runtime.styles.set(hash, css); 11470 for (const targetDocument of runtime.documents.keys()) { 11471 injectStyle7(targetDocument, hash, css); 11472 } 11473 } 11474 if (typeof process === "undefined" || true) { 11475 registerStyle7("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 11476 } 11477 var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 11478 if (typeof process === "undefined" || true) { 11479 registerStyle7("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); 11480 } 11481 var style_default6 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 11482 var Positioner = (0, import_element22.forwardRef)( 11483 function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { 11484 return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11485 index_parts_exports2.Positioner, 11486 { 11487 ref, 11488 align, 11489 side, 11490 sideOffset, 11491 ...props, 11492 className: clsx_default( 11493 resets_default2["box-sizing"], 11494 style_default6.positioner, 11495 className 11496 ) 11497 } 11498 ); 11499 } 11500 ); 11501 11502 // packages/ui/build-module/utils/theme-provider.mjs 11503 var theme = __toESM(require_theme(), 1); 11504 11505 // packages/ui/build-module/lock-unlock.mjs 11506 var import_private_apis = __toESM(require_private_apis(), 1); 11507 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 11508 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 11509 "@wordpress/ui" 11510 ); 11511 11512 // packages/ui/build-module/utils/theme-provider.mjs 11513 function getThemeProvider() { 11514 const themePackage = theme; 11515 if (themePackage.ThemeProvider) { 11516 return themePackage.ThemeProvider; 11517 } 11518 if (!themePackage.privateApis) { 11519 throw new Error( 11520 "@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`." 11521 ); 11522 } 11523 return unlock( 11524 themePackage.privateApis 11525 ).ThemeProvider; 11526 } 11527 var ThemeProvider = getThemeProvider(); 11528 11529 // packages/ui/build-module/tooltip/popup.mjs 11530 var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); 11531 var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash"; 11532 function getRuntime8() { 11533 const globalScope = globalThis; 11534 if (globalScope.__wpStyleRuntime) { 11535 return globalScope.__wpStyleRuntime; 11536 } 11537 globalScope.__wpStyleRuntime = { 11538 documents: /* @__PURE__ */ new Map(), 11539 styles: /* @__PURE__ */ new Map(), 11540 injectedStyles: /* @__PURE__ */ new WeakMap() 11541 }; 11542 if (typeof document !== "undefined") { 11543 registerDocument8(document); 11544 } 11545 return globalScope.__wpStyleRuntime; 11546 } 11547 function documentContainsStyleHash8(targetDocument, hash) { 11548 if (!targetDocument.head) { 11549 return false; 11550 } 11551 for (const style of targetDocument.head.querySelectorAll( 11552 `style[$STYLE_HASH_ATTRIBUTE8}]` 11553 )) { 11554 if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) { 11555 return true; 11556 } 11557 } 11558 return false; 11559 } 11560 function injectStyle8(targetDocument, hash, css) { 11561 if (!targetDocument.head) { 11562 return; 11563 } 11564 const runtime = getRuntime8(); 11565 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11566 if (!injectedStyles) { 11567 injectedStyles = /* @__PURE__ */ new Set(); 11568 runtime.injectedStyles.set(targetDocument, injectedStyles); 11569 } 11570 if (injectedStyles.has(hash)) { 11571 return; 11572 } 11573 if (documentContainsStyleHash8(targetDocument, hash)) { 11574 injectedStyles.add(hash); 11575 return; 11576 } 11577 const style = targetDocument.createElement("style"); 11578 style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash); 11579 style.appendChild(targetDocument.createTextNode(css)); 11580 targetDocument.head.appendChild(style); 11581 injectedStyles.add(hash); 11582 } 11583 function registerDocument8(targetDocument) { 11584 const runtime = getRuntime8(); 11585 runtime.documents.set( 11586 targetDocument, 11587 (runtime.documents.get(targetDocument) ?? 0) + 1 11588 ); 11589 for (const [hash, css] of runtime.styles) { 11590 injectStyle8(targetDocument, hash, css); 11591 } 11592 return () => { 11593 const count = runtime.documents.get(targetDocument); 11594 if (count === void 0) { 11595 return; 11596 } 11597 if (count <= 1) { 11598 runtime.documents.delete(targetDocument); 11599 return; 11600 } 11601 runtime.documents.set(targetDocument, count - 1); 11602 }; 11603 } 11604 function registerStyle8(hash, css) { 11605 const runtime = getRuntime8(); 11606 runtime.styles.set(hash, css); 11607 for (const targetDocument of runtime.documents.keys()) { 11608 injectStyle8(targetDocument, hash, css); 11609 } 11610 } 11611 if (typeof process === "undefined" || true) { 11612 registerStyle8("19fcc06039", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{--_wp-ui-elevation-sm:0 1px 2px rgba(0,0,0,.05),0 2px 3px rgba(0,0,0,.04),0 6px 6px rgba(0,0,0,.03),0 8px 8px rgba(0,0,0,.02);background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-md,4px);box-shadow:var(--_wp-ui-elevation-sm);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-sm,12px);line-height:1.4;padding:var(--wpds-dimension-padding-xs,4px) var(--wpds-dimension-padding-sm,8px);@media (forced-colors:active){border-bottom-color:CanvasText;border-bottom-style:solid;border-bottom-width:1px;border-left-color:CanvasText;border-left-style:solid;border-left-width:1px;border-right-color:CanvasText;border-right-style:solid;border-right-width:1px;border-top-color:CanvasText;border-top-style:solid;border-top-width:1px}}}}'); 11613 } 11614 var style_default7 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 11615 var POPUP_COLOR = { background: "#1e1e1e" }; 11616 var Popup = (0, import_element23.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { 11617 const popupContent = /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( 11618 index_parts_exports2.Popup, 11619 { 11620 ref, 11621 className: clsx_default(style_default7.popup, className), 11622 ...props, 11623 children 11624 } 11625 ) }); 11626 const positionedPopup = renderSlotWithChildren( 11627 positioner, 11628 /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Positioner, {}), 11629 popupContent 11630 ); 11631 return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(Portal, {}), positionedPopup); 11632 }); 11633 11634 // packages/ui/build-module/tooltip/trigger.mjs 11635 var import_element24 = __toESM(require_element(), 1); 11636 var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); 11637 var Trigger = (0, import_element24.forwardRef)( 11638 function TooltipTrigger3(props, ref) { 11639 return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)(index_parts_exports2.Trigger, { ref, ...props }); 11640 } 11641 ); 11642 11643 // packages/ui/build-module/tooltip/root.mjs 11644 var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); 11645 function Root(props) { 11646 return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(index_parts_exports2.Root, { ...props }) }); 11647 } 11648 11649 // packages/ui/build-module/link/link.mjs 11650 var import_element25 = __toESM(require_element(), 1); 11651 var import_i18n5 = __toESM(require_i18n(), 1); 11652 var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); 11653 var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash"; 11654 function getRuntime9() { 11655 const globalScope = globalThis; 11656 if (globalScope.__wpStyleRuntime) { 11657 return globalScope.__wpStyleRuntime; 11658 } 11659 globalScope.__wpStyleRuntime = { 11660 documents: /* @__PURE__ */ new Map(), 11661 styles: /* @__PURE__ */ new Map(), 11662 injectedStyles: /* @__PURE__ */ new WeakMap() 11663 }; 11664 if (typeof document !== "undefined") { 11665 registerDocument9(document); 11666 } 11667 return globalScope.__wpStyleRuntime; 11668 } 11669 function documentContainsStyleHash9(targetDocument, hash) { 11670 if (!targetDocument.head) { 11671 return false; 11672 } 11673 for (const style of targetDocument.head.querySelectorAll( 11674 `style[$STYLE_HASH_ATTRIBUTE9}]` 11675 )) { 11676 if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) { 11677 return true; 11678 } 11679 } 11680 return false; 11681 } 11682 function injectStyle9(targetDocument, hash, css) { 11683 if (!targetDocument.head) { 11684 return; 11685 } 11686 const runtime = getRuntime9(); 11687 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11688 if (!injectedStyles) { 11689 injectedStyles = /* @__PURE__ */ new Set(); 11690 runtime.injectedStyles.set(targetDocument, injectedStyles); 11691 } 11692 if (injectedStyles.has(hash)) { 11693 return; 11694 } 11695 if (documentContainsStyleHash9(targetDocument, hash)) { 11696 injectedStyles.add(hash); 11697 return; 11698 } 11699 const style = targetDocument.createElement("style"); 11700 style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash); 11701 style.appendChild(targetDocument.createTextNode(css)); 11702 targetDocument.head.appendChild(style); 11703 injectedStyles.add(hash); 11704 } 11705 function registerDocument9(targetDocument) { 11706 const runtime = getRuntime9(); 11707 runtime.documents.set( 11708 targetDocument, 11709 (runtime.documents.get(targetDocument) ?? 0) + 1 11710 ); 11711 for (const [hash, css] of runtime.styles) { 11712 injectStyle9(targetDocument, hash, css); 11713 } 11714 return () => { 11715 const count = runtime.documents.get(targetDocument); 11716 if (count === void 0) { 11717 return; 11718 } 11719 if (count <= 1) { 11720 runtime.documents.delete(targetDocument); 11721 return; 11722 } 11723 runtime.documents.set(targetDocument, count - 1); 11724 }; 11725 } 11726 function registerStyle9(hash, css) { 11727 const runtime = getRuntime9(); 11728 runtime.styles.set(hash, css); 11729 for (const targetDocument of runtime.documents.keys()) { 11730 injectStyle9(targetDocument, hash, css); 11731 } 11732 } 11733 if (typeof process === "undefined" || true) { 11734 registerStyle9("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 11735 } 11736 var resets_default3 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 11737 if (typeof process === "undefined" || true) { 11738 registerStyle9("7c3267f794", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{.af79fb116edb0dd7__outset-ring--focus:focus,.dfcfdc28396e5d98__outset-ring--focus-visible:focus-visible,.e5cd9ee879f6403a__outset-ring--focus-within:focus-within{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within,.abc777e9713fa711__outset-ring--focus-except-active:focus{outline:none}._3c9f5ee9fc9c136d__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.abc777e9713fa711__outset-ring--focus-except-active:focus:not(:active){--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}}}"); 11739 } 11740 var focus_module_default2 = { "outset-ring--focus": "af79fb116edb0dd7__outset-ring--focus", "outset-ring--focus-visible": "dfcfdc28396e5d98__outset-ring--focus-visible", "outset-ring--focus-within": "e5cd9ee879f6403a__outset-ring--focus-within", "outset-ring--focus-except-active": "abc777e9713fa711__outset-ring--focus-except-active", "outset-ring--focus-within-except-active": "_3c9f5ee9fc9c136d__outset-ring--focus-within-except-active" }; 11741 if (typeof process === "undefined" || true) { 11742 registerStyle9("888e86d20a", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.d4250949359b05ce__link{--_gcd-a-border-radius:var(--wpds-border-radius-sm,2px);border-radius:var(--wpds-border-radius-sm,2px);text-decoration-thickness:from-font;text-underline-offset:.2em}.f037c632480d4e11__link-with-icon{text-decoration-line:none}._8dc7567f9ff415bf__link-contents{text-decoration:inherit;text-decoration-line:underline}.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-border-radius:0;--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{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:"\\2060\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2060\\2196"}}}'); 11743 } 11744 var style_default8 = { "link": "d4250949359b05ce__link", "link-with-icon": "f037c632480d4e11__link-with-icon", "link-contents": "_8dc7567f9ff415bf__link-contents", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" }; 11745 if (typeof process === "undefined" || true) { 11746 registerStyle9("abb19c3171", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._400bf7ee0c6061a9__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}"); 11747 } 11748 var global_css_defense_default3 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li", "span": "_400bf7ee0c6061a9__span" }; 11749 var Link = (0, import_element25.forwardRef)( 11750 function UnforwardedLink({ 11751 children, 11752 variant = "default", 11753 tone = "brand", 11754 openInNewTab = false, 11755 target, 11756 render, 11757 className, 11758 ...props 11759 }, ref) { 11760 const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? ""); 11761 const element = useRender({ 11762 render, 11763 defaultTagName: "a", 11764 ref, 11765 props: mergeProps(props, { 11766 className: clsx_default( 11767 global_css_defense_default3.a, 11768 resets_default3["box-sizing"], 11769 focus_module_default2["outset-ring--focus-except-active"], 11770 variant !== "unstyled" && style_default8.link, 11771 variant !== "unstyled" && shouldShowNewTabIndicator && style_default8["link-with-icon"], 11772 variant !== "unstyled" && style_default8[`is-$tone}`], 11773 variant === "unstyled" && style_default8["is-unstyled"], 11774 className 11775 ), 11776 target: target ?? (openInNewTab ? "_blank" : void 0), 11777 children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_jsx_runtime48.Fragment, { children: [ 11778 shouldShowNewTabIndicator && variant !== "unstyled" ? /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("span", { className: style_default8["link-contents"], children }) : children, 11779 shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime48.jsx)( 11780 "span", 11781 { 11782 className: style_default8["link-icon"], 11783 role: "img", 11784 "aria-label": ( 11785 /* translators: accessibility text appended to link text */ 11786 (0, import_i18n5.__)("(opens in a new tab)") 11787 ) 11788 } 11789 ) 11790 ] }) 11791 }) 11792 }); 11793 return element; 11794 } 11795 ); 11796 11797 // packages/ui/build-module/icon-button/icon-button.mjs 11798 var import_element26 = __toESM(require_element(), 1); 11799 var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); 11800 var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash"; 11801 function getRuntime10() { 11802 const globalScope = globalThis; 11803 if (globalScope.__wpStyleRuntime) { 11804 return globalScope.__wpStyleRuntime; 11805 } 11806 globalScope.__wpStyleRuntime = { 11807 documents: /* @__PURE__ */ new Map(), 11808 styles: /* @__PURE__ */ new Map(), 11809 injectedStyles: /* @__PURE__ */ new WeakMap() 11810 }; 11811 if (typeof document !== "undefined") { 11812 registerDocument10(document); 11813 } 11814 return globalScope.__wpStyleRuntime; 11815 } 11816 function documentContainsStyleHash10(targetDocument, hash) { 11817 if (!targetDocument.head) { 11818 return false; 11819 } 11820 for (const style of targetDocument.head.querySelectorAll( 11821 `style[$STYLE_HASH_ATTRIBUTE10}]` 11822 )) { 11823 if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) { 11824 return true; 11825 } 11826 } 11827 return false; 11828 } 11829 function injectStyle10(targetDocument, hash, css) { 11830 if (!targetDocument.head) { 11831 return; 11832 } 11833 const runtime = getRuntime10(); 11834 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11835 if (!injectedStyles) { 11836 injectedStyles = /* @__PURE__ */ new Set(); 11837 runtime.injectedStyles.set(targetDocument, injectedStyles); 11838 } 11839 if (injectedStyles.has(hash)) { 11840 return; 11841 } 11842 if (documentContainsStyleHash10(targetDocument, hash)) { 11843 injectedStyles.add(hash); 11844 return; 11845 } 11846 const style = targetDocument.createElement("style"); 11847 style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash); 11848 style.appendChild(targetDocument.createTextNode(css)); 11849 targetDocument.head.appendChild(style); 11850 injectedStyles.add(hash); 11851 } 11852 function registerDocument10(targetDocument) { 11853 const runtime = getRuntime10(); 11854 runtime.documents.set( 11855 targetDocument, 11856 (runtime.documents.get(targetDocument) ?? 0) + 1 11857 ); 11858 for (const [hash, css] of runtime.styles) { 11859 injectStyle10(targetDocument, hash, css); 11860 } 11861 return () => { 11862 const count = runtime.documents.get(targetDocument); 11863 if (count === void 0) { 11864 return; 11865 } 11866 if (count <= 1) { 11867 runtime.documents.delete(targetDocument); 11868 return; 11869 } 11870 runtime.documents.set(targetDocument, count - 1); 11871 }; 11872 } 11873 function registerStyle10(hash, css) { 11874 const runtime = getRuntime10(); 11875 runtime.styles.set(hash, css); 11876 for (const targetDocument of runtime.documents.keys()) { 11877 injectStyle10(targetDocument, hash, css); 11878 } 11879 } 11880 if (typeof process === "undefined" || true) { 11881 registerStyle10("c5cdafb1bc", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer compositions{._28cfdc260e755391__icon-button{--wp-ui-button-aspect-ratio:1;--wp-ui-button-padding-inline:0px;--wp-ui-button-min-width:unset}.f1c70d719989a85a__icon{margin:-1px}}}"); 11882 } 11883 var style_default9 = { "icon-button": "_28cfdc260e755391__icon-button", "icon": "f1c70d719989a85a__icon" }; 11884 var IconButton = (0, import_element26.forwardRef)( 11885 function UnforwardedIconButton({ 11886 label, 11887 className, 11888 // Prevent accidental forwarding of `children` 11889 children: _children, 11890 disabled: disabled2, 11891 focusableWhenDisabled = true, 11892 icon, 11893 size: size4, 11894 shortcut, 11895 positioner, 11896 "aria-describedby": ariaDescribedBy, 11897 "aria-keyshortcuts": ariaKeyShortcuts, 11898 ...restProps 11899 }, ref) { 11900 const classes = clsx_default(style_default9["icon-button"], className); 11901 const { descriptionId, targetProps } = useKeyboardShortcutProps({ 11902 "aria-describedby": ariaDescribedBy, 11903 "aria-keyshortcuts": ariaKeyShortcuts, 11904 shortcut 11905 }); 11906 return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Root, { children: [ 11907 /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)( 11908 Trigger, 11909 { 11910 ref, 11911 ...targetProps, 11912 disabled: disabled2 && !focusableWhenDisabled, 11913 render: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 11914 Button6, 11915 { 11916 ...restProps, 11917 size: size4, 11918 "aria-label": label, 11919 disabled: disabled2, 11920 focusableWhenDisabled 11921 } 11922 ), 11923 className: classes, 11924 children: [ 11925 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(Icon, { icon, size: 24, className: style_default9.icon }), 11926 shortcut && descriptionId && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 11927 KeyboardShortcutDescription, 11928 { 11929 descriptionId, 11930 shortcut 11931 } 11932 ) 11933 ] 11934 } 11935 ), 11936 /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(Popup, { positioner, children: [ 11937 label, 11938 shortcut && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [ 11939 " ", 11940 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(KeyboardShortcutDisplay, { shortcut }) 11941 ] }) 11942 ] }) 11943 ] }); 11944 } 11945 ); 11946 11947 // packages/ui/build-module/card/index.mjs 11948 var card_exports = {}; 11949 __export(card_exports, { 11950 Content: () => Content, 11951 FullBleed: () => FullBleed, 11952 Header: () => Header, 11953 Root: () => Root2, 11954 Title: () => Title 11955 }); 11956 11957 // packages/ui/build-module/card/root.mjs 11958 var import_element27 = __toESM(require_element(), 1); 11959 var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash"; 11960 function getRuntime11() { 11961 const globalScope = globalThis; 11962 if (globalScope.__wpStyleRuntime) { 11963 return globalScope.__wpStyleRuntime; 11964 } 11965 globalScope.__wpStyleRuntime = { 11966 documents: /* @__PURE__ */ new Map(), 11967 styles: /* @__PURE__ */ new Map(), 11968 injectedStyles: /* @__PURE__ */ new WeakMap() 11969 }; 11970 if (typeof document !== "undefined") { 11971 registerDocument11(document); 11972 } 11973 return globalScope.__wpStyleRuntime; 11974 } 11975 function documentContainsStyleHash11(targetDocument, hash) { 11976 if (!targetDocument.head) { 11977 return false; 11978 } 11979 for (const style of targetDocument.head.querySelectorAll( 11980 `style[$STYLE_HASH_ATTRIBUTE11}]` 11981 )) { 11982 if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) { 11983 return true; 11984 } 11985 } 11986 return false; 11987 } 11988 function injectStyle11(targetDocument, hash, css) { 11989 if (!targetDocument.head) { 11990 return; 11991 } 11992 const runtime = getRuntime11(); 11993 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11994 if (!injectedStyles) { 11995 injectedStyles = /* @__PURE__ */ new Set(); 11996 runtime.injectedStyles.set(targetDocument, injectedStyles); 11997 } 11998 if (injectedStyles.has(hash)) { 11999 return; 12000 } 12001 if (documentContainsStyleHash11(targetDocument, hash)) { 12002 injectedStyles.add(hash); 12003 return; 12004 } 12005 const style = targetDocument.createElement("style"); 12006 style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash); 12007 style.appendChild(targetDocument.createTextNode(css)); 12008 targetDocument.head.appendChild(style); 12009 injectedStyles.add(hash); 12010 } 12011 function registerDocument11(targetDocument) { 12012 const runtime = getRuntime11(); 12013 runtime.documents.set( 12014 targetDocument, 12015 (runtime.documents.get(targetDocument) ?? 0) + 1 12016 ); 12017 for (const [hash, css] of runtime.styles) { 12018 injectStyle11(targetDocument, hash, css); 12019 } 12020 return () => { 12021 const count = runtime.documents.get(targetDocument); 12022 if (count === void 0) { 12023 return; 12024 } 12025 if (count <= 1) { 12026 runtime.documents.delete(targetDocument); 12027 return; 12028 } 12029 runtime.documents.set(targetDocument, count - 1); 12030 }; 12031 } 12032 function registerStyle11(hash, css) { 12033 const runtime = getRuntime11(); 12034 runtime.styles.set(hash, css); 12035 for (const targetDocument of runtime.documents.keys()) { 12036 injectStyle11(targetDocument, hash, css); 12037 } 12038 } 12039 if (typeof process === "undefined" || true) { 12040 registerStyle11("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 12041 } 12042 var resets_default4 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 12043 if (typeof process === "undefined" || true) { 12044 registerStyle11("cb866dcef6", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._02872bf298eadc43__root{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);--wp-ui-card-header-content-gap:var(--wpds-dimension-gap-xl,24px);--wp-ui-card-header-content-margin:calc(var(--wp-ui-card-header-content-gap) - var(--wp-ui-card-padding));background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-lg,8px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;overflow:clip}._5dffdaf2a6e669ac__content,.bbccc92e6ba5662d__header{padding:var(--wp-ui-card-padding);&:not(:first-child):not(:last-child){padding-block-end:0}}.bbccc92e6ba5662d__header+._5dffdaf2a6e669ac__content{margin-block-start:var(--wp-ui-card-header-content-margin);padding-block-start:0}.c1fa192587e1b4a6__fullbleed{margin-inline:calc(var(--wp-ui-card-padding)*-1);width:calc(100% + var(--wp-ui-card-padding)*2)}._02872bf298eadc43__root>:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):first-child>.c1fa192587e1b4a6__fullbleed:first-child{margin-block-start:calc(var(--wp-ui-card-padding)*-1)}:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):last-child>.c1fa192587e1b4a6__fullbleed:last-child{margin-block-end:calc(var(--wp-ui-card-padding)*-1)}}}"); 12045 } 12046 var style_default10 = { "root": "_02872bf298eadc43__root", "header": "bbccc92e6ba5662d__header", "content": "_5dffdaf2a6e669ac__content", "fullbleed": "c1fa192587e1b4a6__fullbleed" }; 12047 var Root2 = (0, import_element27.forwardRef)(function Card({ render, ...restProps }, ref) { 12048 const mergedClassName = clsx_default(style_default10.root, resets_default4["box-sizing"]); 12049 const element = useRender({ 12050 defaultTagName: "div", 12051 render, 12052 ref, 12053 props: mergeProps({ className: mergedClassName }, restProps) 12054 }); 12055 return element; 12056 }); 12057 12058 // packages/ui/build-module/card/header.mjs 12059 var import_element28 = __toESM(require_element(), 1); 12060 var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash"; 12061 function getRuntime12() { 12062 const globalScope = globalThis; 12063 if (globalScope.__wpStyleRuntime) { 12064 return globalScope.__wpStyleRuntime; 12065 } 12066 globalScope.__wpStyleRuntime = { 12067 documents: /* @__PURE__ */ new Map(), 12068 styles: /* @__PURE__ */ new Map(), 12069 injectedStyles: /* @__PURE__ */ new WeakMap() 12070 }; 12071 if (typeof document !== "undefined") { 12072 registerDocument12(document); 12073 } 12074 return globalScope.__wpStyleRuntime; 12075 } 12076 function documentContainsStyleHash12(targetDocument, hash) { 12077 if (!targetDocument.head) { 12078 return false; 12079 } 12080 for (const style of targetDocument.head.querySelectorAll( 12081 `style[$STYLE_HASH_ATTRIBUTE12}]` 12082 )) { 12083 if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) { 12084 return true; 12085 } 12086 } 12087 return false; 12088 } 12089 function injectStyle12(targetDocument, hash, css) { 12090 if (!targetDocument.head) { 12091 return; 12092 } 12093 const runtime = getRuntime12(); 12094 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12095 if (!injectedStyles) { 12096 injectedStyles = /* @__PURE__ */ new Set(); 12097 runtime.injectedStyles.set(targetDocument, injectedStyles); 12098 } 12099 if (injectedStyles.has(hash)) { 12100 return; 12101 } 12102 if (documentContainsStyleHash12(targetDocument, hash)) { 12103 injectedStyles.add(hash); 12104 return; 12105 } 12106 const style = targetDocument.createElement("style"); 12107 style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash); 12108 style.appendChild(targetDocument.createTextNode(css)); 12109 targetDocument.head.appendChild(style); 12110 injectedStyles.add(hash); 12111 } 12112 function registerDocument12(targetDocument) { 12113 const runtime = getRuntime12(); 12114 runtime.documents.set( 12115 targetDocument, 12116 (runtime.documents.get(targetDocument) ?? 0) + 1 12117 ); 12118 for (const [hash, css] of runtime.styles) { 12119 injectStyle12(targetDocument, hash, css); 12120 } 12121 return () => { 12122 const count = runtime.documents.get(targetDocument); 12123 if (count === void 0) { 12124 return; 12125 } 12126 if (count <= 1) { 12127 runtime.documents.delete(targetDocument); 12128 return; 12129 } 12130 runtime.documents.set(targetDocument, count - 1); 12131 }; 12132 } 12133 function registerStyle12(hash, css) { 12134 const runtime = getRuntime12(); 12135 runtime.styles.set(hash, css); 12136 for (const targetDocument of runtime.documents.keys()) { 12137 injectStyle12(targetDocument, hash, css); 12138 } 12139 } 12140 if (typeof process === "undefined" || true) { 12141 registerStyle12("cb866dcef6", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._02872bf298eadc43__root{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);--wp-ui-card-header-content-gap:var(--wpds-dimension-gap-xl,24px);--wp-ui-card-header-content-margin:calc(var(--wp-ui-card-header-content-gap) - var(--wp-ui-card-padding));background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-lg,8px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;overflow:clip}._5dffdaf2a6e669ac__content,.bbccc92e6ba5662d__header{padding:var(--wp-ui-card-padding);&:not(:first-child):not(:last-child){padding-block-end:0}}.bbccc92e6ba5662d__header+._5dffdaf2a6e669ac__content{margin-block-start:var(--wp-ui-card-header-content-margin);padding-block-start:0}.c1fa192587e1b4a6__fullbleed{margin-inline:calc(var(--wp-ui-card-padding)*-1);width:calc(100% + var(--wp-ui-card-padding)*2)}._02872bf298eadc43__root>:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):first-child>.c1fa192587e1b4a6__fullbleed:first-child{margin-block-start:calc(var(--wp-ui-card-padding)*-1)}:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):last-child>.c1fa192587e1b4a6__fullbleed:last-child{margin-block-end:calc(var(--wp-ui-card-padding)*-1)}}}"); 12142 } 12143 var style_default11 = { "root": "_02872bf298eadc43__root", "header": "bbccc92e6ba5662d__header", "content": "_5dffdaf2a6e669ac__content", "fullbleed": "c1fa192587e1b4a6__fullbleed" }; 12144 var Header = (0, import_element28.forwardRef)( 12145 function CardHeader({ render, ...props }, ref) { 12146 const element = useRender({ 12147 defaultTagName: "div", 12148 render, 12149 ref, 12150 props: mergeProps({ className: style_default11.header }, props) 12151 }); 12152 return element; 12153 } 12154 ); 12155 12156 // packages/ui/build-module/card/content.mjs 12157 var import_element29 = __toESM(require_element(), 1); 12158 var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash"; 12159 function getRuntime13() { 12160 const globalScope = globalThis; 12161 if (globalScope.__wpStyleRuntime) { 12162 return globalScope.__wpStyleRuntime; 12163 } 12164 globalScope.__wpStyleRuntime = { 12165 documents: /* @__PURE__ */ new Map(), 12166 styles: /* @__PURE__ */ new Map(), 12167 injectedStyles: /* @__PURE__ */ new WeakMap() 12168 }; 12169 if (typeof document !== "undefined") { 12170 registerDocument13(document); 12171 } 12172 return globalScope.__wpStyleRuntime; 12173 } 12174 function documentContainsStyleHash13(targetDocument, hash) { 12175 if (!targetDocument.head) { 12176 return false; 12177 } 12178 for (const style of targetDocument.head.querySelectorAll( 12179 `style[$STYLE_HASH_ATTRIBUTE13}]` 12180 )) { 12181 if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) { 12182 return true; 12183 } 12184 } 12185 return false; 12186 } 12187 function injectStyle13(targetDocument, hash, css) { 12188 if (!targetDocument.head) { 12189 return; 12190 } 12191 const runtime = getRuntime13(); 12192 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12193 if (!injectedStyles) { 12194 injectedStyles = /* @__PURE__ */ new Set(); 12195 runtime.injectedStyles.set(targetDocument, injectedStyles); 12196 } 12197 if (injectedStyles.has(hash)) { 12198 return; 12199 } 12200 if (documentContainsStyleHash13(targetDocument, hash)) { 12201 injectedStyles.add(hash); 12202 return; 12203 } 12204 const style = targetDocument.createElement("style"); 12205 style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash); 12206 style.appendChild(targetDocument.createTextNode(css)); 12207 targetDocument.head.appendChild(style); 12208 injectedStyles.add(hash); 12209 } 12210 function registerDocument13(targetDocument) { 12211 const runtime = getRuntime13(); 12212 runtime.documents.set( 12213 targetDocument, 12214 (runtime.documents.get(targetDocument) ?? 0) + 1 12215 ); 12216 for (const [hash, css] of runtime.styles) { 12217 injectStyle13(targetDocument, hash, css); 12218 } 12219 return () => { 12220 const count = runtime.documents.get(targetDocument); 12221 if (count === void 0) { 12222 return; 12223 } 12224 if (count <= 1) { 12225 runtime.documents.delete(targetDocument); 12226 return; 12227 } 12228 runtime.documents.set(targetDocument, count - 1); 12229 }; 12230 } 12231 function registerStyle13(hash, css) { 12232 const runtime = getRuntime13(); 12233 runtime.styles.set(hash, css); 12234 for (const targetDocument of runtime.documents.keys()) { 12235 injectStyle13(targetDocument, hash, css); 12236 } 12237 } 12238 if (typeof process === "undefined" || true) { 12239 registerStyle13("cb866dcef6", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._02872bf298eadc43__root{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);--wp-ui-card-header-content-gap:var(--wpds-dimension-gap-xl,24px);--wp-ui-card-header-content-margin:calc(var(--wp-ui-card-header-content-gap) - var(--wp-ui-card-padding));background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-lg,8px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;overflow:clip}._5dffdaf2a6e669ac__content,.bbccc92e6ba5662d__header{padding:var(--wp-ui-card-padding);&:not(:first-child):not(:last-child){padding-block-end:0}}.bbccc92e6ba5662d__header+._5dffdaf2a6e669ac__content{margin-block-start:var(--wp-ui-card-header-content-margin);padding-block-start:0}.c1fa192587e1b4a6__fullbleed{margin-inline:calc(var(--wp-ui-card-padding)*-1);width:calc(100% + var(--wp-ui-card-padding)*2)}._02872bf298eadc43__root>:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):first-child>.c1fa192587e1b4a6__fullbleed:first-child{margin-block-start:calc(var(--wp-ui-card-padding)*-1)}:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):last-child>.c1fa192587e1b4a6__fullbleed:last-child{margin-block-end:calc(var(--wp-ui-card-padding)*-1)}}}"); 12240 } 12241 var style_default12 = { "root": "_02872bf298eadc43__root", "header": "bbccc92e6ba5662d__header", "content": "_5dffdaf2a6e669ac__content", "fullbleed": "c1fa192587e1b4a6__fullbleed" }; 12242 var Content = (0, import_element29.forwardRef)( 12243 function CardContent({ render, ...props }, ref) { 12244 const element = useRender({ 12245 defaultTagName: "div", 12246 render, 12247 ref, 12248 props: mergeProps({ className: style_default12.content }, props) 12249 }); 12250 return element; 12251 } 12252 ); 12253 12254 // packages/ui/build-module/card/full-bleed.mjs 12255 var import_element30 = __toESM(require_element(), 1); 12256 var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash"; 12257 function getRuntime14() { 12258 const globalScope = globalThis; 12259 if (globalScope.__wpStyleRuntime) { 12260 return globalScope.__wpStyleRuntime; 12261 } 12262 globalScope.__wpStyleRuntime = { 12263 documents: /* @__PURE__ */ new Map(), 12264 styles: /* @__PURE__ */ new Map(), 12265 injectedStyles: /* @__PURE__ */ new WeakMap() 12266 }; 12267 if (typeof document !== "undefined") { 12268 registerDocument14(document); 12269 } 12270 return globalScope.__wpStyleRuntime; 12271 } 12272 function documentContainsStyleHash14(targetDocument, hash) { 12273 if (!targetDocument.head) { 12274 return false; 12275 } 12276 for (const style of targetDocument.head.querySelectorAll( 12277 `style[$STYLE_HASH_ATTRIBUTE14}]` 12278 )) { 12279 if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) { 12280 return true; 12281 } 12282 } 12283 return false; 12284 } 12285 function injectStyle14(targetDocument, hash, css) { 12286 if (!targetDocument.head) { 12287 return; 12288 } 12289 const runtime = getRuntime14(); 12290 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12291 if (!injectedStyles) { 12292 injectedStyles = /* @__PURE__ */ new Set(); 12293 runtime.injectedStyles.set(targetDocument, injectedStyles); 12294 } 12295 if (injectedStyles.has(hash)) { 12296 return; 12297 } 12298 if (documentContainsStyleHash14(targetDocument, hash)) { 12299 injectedStyles.add(hash); 12300 return; 12301 } 12302 const style = targetDocument.createElement("style"); 12303 style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash); 12304 style.appendChild(targetDocument.createTextNode(css)); 12305 targetDocument.head.appendChild(style); 12306 injectedStyles.add(hash); 12307 } 12308 function registerDocument14(targetDocument) { 12309 const runtime = getRuntime14(); 12310 runtime.documents.set( 12311 targetDocument, 12312 (runtime.documents.get(targetDocument) ?? 0) + 1 12313 ); 12314 for (const [hash, css] of runtime.styles) { 12315 injectStyle14(targetDocument, hash, css); 12316 } 12317 return () => { 12318 const count = runtime.documents.get(targetDocument); 12319 if (count === void 0) { 12320 return; 12321 } 12322 if (count <= 1) { 12323 runtime.documents.delete(targetDocument); 12324 return; 12325 } 12326 runtime.documents.set(targetDocument, count - 1); 12327 }; 12328 } 12329 function registerStyle14(hash, css) { 12330 const runtime = getRuntime14(); 12331 runtime.styles.set(hash, css); 12332 for (const targetDocument of runtime.documents.keys()) { 12333 injectStyle14(targetDocument, hash, css); 12334 } 12335 } 12336 if (typeof process === "undefined" || true) { 12337 registerStyle14("cb866dcef6", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._02872bf298eadc43__root{--wp-ui-card-padding:var(--wpds-dimension-padding-2xl,24px);--wp-ui-card-header-content-gap:var(--wpds-dimension-gap-xl,24px);--wp-ui-card-header-content-margin:calc(var(--wp-ui-card-header-content-gap) - var(--wp-ui-card-padding));background-color:var(--wpds-color-background-surface-neutral-strong,#fff);border:1px solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);border-radius:var(--wpds-border-radius-lg,8px);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;overflow:clip}._5dffdaf2a6e669ac__content,.bbccc92e6ba5662d__header{padding:var(--wp-ui-card-padding);&:not(:first-child):not(:last-child){padding-block-end:0}}.bbccc92e6ba5662d__header+._5dffdaf2a6e669ac__content{margin-block-start:var(--wp-ui-card-header-content-margin);padding-block-start:0}.c1fa192587e1b4a6__fullbleed{margin-inline:calc(var(--wp-ui-card-padding)*-1);width:calc(100% + var(--wp-ui-card-padding)*2)}._02872bf298eadc43__root>:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):first-child>.c1fa192587e1b4a6__fullbleed:first-child{margin-block-start:calc(var(--wp-ui-card-padding)*-1)}:is(.bbccc92e6ba5662d__header,._5dffdaf2a6e669ac__content):last-child>.c1fa192587e1b4a6__fullbleed:last-child{margin-block-end:calc(var(--wp-ui-card-padding)*-1)}}}"); 12338 } 12339 var style_default13 = { "root": "_02872bf298eadc43__root", "header": "bbccc92e6ba5662d__header", "content": "_5dffdaf2a6e669ac__content", "fullbleed": "c1fa192587e1b4a6__fullbleed" }; 12340 var FullBleed = (0, import_element30.forwardRef)( 12341 function CardFullBleed({ render, ...props }, ref) { 12342 const element = useRender({ 12343 defaultTagName: "div", 12344 render, 12345 ref, 12346 props: mergeProps( 12347 { className: style_default13.fullbleed }, 12348 props 12349 ) 12350 }); 12351 return element; 12352 } 12353 ); 12354 12355 // packages/ui/build-module/card/title.mjs 12356 var import_element31 = __toESM(require_element(), 1); 12357 var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); 12358 var DEFAULT_TAG = /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", {}); 12359 var Title = (0, import_element31.forwardRef)( 12360 function CardTitle({ render = DEFAULT_TAG, children, ...props }, ref) { 12361 return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)( 12362 Text, 12363 { 12364 ref, 12365 variant: "heading-lg", 12366 render, 12367 ...props, 12368 children 12369 } 12370 ); 12371 } 12372 ); 12373 12374 // packages/ui/build-module/collapsible/panel.mjs 12375 var import_element32 = __toESM(require_element(), 1); 12376 var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); 12377 var Panel2 = (0, import_element32.forwardRef)( 12378 function CollapsiblePanel3(props, forwardedRef) { 12379 return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(index_parts_exports.Panel, { ref: forwardedRef, ...props }); 12380 } 12381 ); 12382 12383 // packages/ui/build-module/collapsible/root.mjs 12384 var import_element33 = __toESM(require_element(), 1); 12385 var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); 12386 var Root3 = (0, import_element33.forwardRef)( 12387 function CollapsibleRoot3(props, forwardedRef) { 12388 return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(index_parts_exports.Root, { ref: forwardedRef, ...props }); 12389 } 12390 ); 12391 12392 // packages/ui/build-module/collapsible/trigger.mjs 12393 var import_element34 = __toESM(require_element(), 1); 12394 var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); 12395 var Trigger2 = (0, import_element34.forwardRef)( 12396 function CollapsibleTrigger3(props, forwardedRef) { 12397 return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(index_parts_exports.Trigger, { ref: forwardedRef, ...props }); 12398 } 12399 ); 12400 12401 // packages/ui/build-module/collapsible-card/index.mjs 12402 var collapsible_card_exports = {}; 12403 __export(collapsible_card_exports, { 12404 Content: () => Content2, 12405 Header: () => Header2, 12406 HeaderDescription: () => HeaderDescription, 12407 Root: () => Root32 12408 }); 12409 12410 // packages/ui/build-module/collapsible-card/root.mjs 12411 var import_element35 = __toESM(require_element(), 1); 12412 var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); 12413 var Root32 = (0, import_element35.forwardRef)( 12414 function CollapsibleCardRoot({ render, ...restProps }, ref) { 12415 return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)( 12416 Root3, 12417 { 12418 ref, 12419 render: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Root2, { render }), 12420 ...restProps 12421 } 12422 ); 12423 } 12424 ); 12425 12426 // packages/ui/build-module/collapsible-card/header.mjs 12427 var import_compose3 = __toESM(require_compose(), 1); 12428 var import_element37 = __toESM(require_element(), 1); 12429 12430 // packages/ui/build-module/collapsible-card/context.mjs 12431 var import_element36 = __toESM(require_element(), 1); 12432 var HeaderDescriptionIdContext = (0, import_element36.createContext)(null); 12433 12434 // packages/ui/build-module/collapsible-card/header.mjs 12435 var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); 12436 var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash"; 12437 function getRuntime15() { 12438 const globalScope = globalThis; 12439 if (globalScope.__wpStyleRuntime) { 12440 return globalScope.__wpStyleRuntime; 12441 } 12442 globalScope.__wpStyleRuntime = { 12443 documents: /* @__PURE__ */ new Map(), 12444 styles: /* @__PURE__ */ new Map(), 12445 injectedStyles: /* @__PURE__ */ new WeakMap() 12446 }; 12447 if (typeof document !== "undefined") { 12448 registerDocument15(document); 12449 } 12450 return globalScope.__wpStyleRuntime; 12451 } 12452 function documentContainsStyleHash15(targetDocument, hash) { 12453 if (!targetDocument.head) { 12454 return false; 12455 } 12456 for (const style of targetDocument.head.querySelectorAll( 12457 `style[$STYLE_HASH_ATTRIBUTE15}]` 12458 )) { 12459 if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) { 12460 return true; 12461 } 12462 } 12463 return false; 12464 } 12465 function injectStyle15(targetDocument, hash, css) { 12466 if (!targetDocument.head) { 12467 return; 12468 } 12469 const runtime = getRuntime15(); 12470 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12471 if (!injectedStyles) { 12472 injectedStyles = /* @__PURE__ */ new Set(); 12473 runtime.injectedStyles.set(targetDocument, injectedStyles); 12474 } 12475 if (injectedStyles.has(hash)) { 12476 return; 12477 } 12478 if (documentContainsStyleHash15(targetDocument, hash)) { 12479 injectedStyles.add(hash); 12480 return; 12481 } 12482 const style = targetDocument.createElement("style"); 12483 style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash); 12484 style.appendChild(targetDocument.createTextNode(css)); 12485 targetDocument.head.appendChild(style); 12486 injectedStyles.add(hash); 12487 } 12488 function registerDocument15(targetDocument) { 12489 const runtime = getRuntime15(); 12490 runtime.documents.set( 12491 targetDocument, 12492 (runtime.documents.get(targetDocument) ?? 0) + 1 12493 ); 12494 for (const [hash, css] of runtime.styles) { 12495 injectStyle15(targetDocument, hash, css); 12496 } 12497 return () => { 12498 const count = runtime.documents.get(targetDocument); 12499 if (count === void 0) { 12500 return; 12501 } 12502 if (count <= 1) { 12503 runtime.documents.delete(targetDocument); 12504 return; 12505 } 12506 runtime.documents.set(targetDocument, count - 1); 12507 }; 12508 } 12509 function registerStyle15(hash, css) { 12510 const runtime = getRuntime15(); 12511 runtime.styles.set(hash, css); 12512 for (const targetDocument of runtime.documents.keys()) { 12513 injectStyle15(targetDocument, hash, css); 12514 } 12515 } 12516 if (typeof process === "undefined" || true) { 12517 registerStyle15("66b8e83c76", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._572e7c546522c522__heading-wrapper{--_gcd-heading-color:inherit;--_gcd-heading-font-size:inherit;--_gcd-heading-font-weight:inherit;--_gcd-heading-margin:0;font-family:inherit;line-height:inherit}._7ea7cf191a8d26b8__header-content{flex:1;min-width:0}._8f14576749c57845__header-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._48cdf1e0d42fc13e__header-trigger-positioner{align-self:flex-start;flex-shrink:0;margin-block-start:calc(var(--wpds-typography-line-height-sm, 20px)/2);max-height:0;overflow:visible}._77d30921d8288eaf__header-trigger-wrapper{border-radius:var(--wpds-border-radius-sm,2px);display:flex;translate:0 -50%}.c11e44555738d97f__header:focus-visible ._77d30921d8288eaf__header-trigger-wrapper{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}@media not (prefers-reduced-motion){._22a30cbbb7b656f4__header-trigger{transition:rotate .15s ease-out}}.c11e44555738d97f__header[data-panel-open] ._22a30cbbb7b656f4__header-trigger{rotate:180deg}.c11e44555738d97f__header[data-disabled] ._22a30cbbb7b656f4__header-trigger{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}._90333ddfaa28d232__content{height:var(--collapsible-panel-height);margin-block-start:var(--wp-ui-card-header-content-margin);overflow:hidden}._90333ddfaa28d232__content._20c2575829a8af9b__overflow-visible{overflow:visible}._90333ddfaa28d232__content[hidden]:not([hidden=until-found]){display:none}._90333ddfaa28d232__content[data-ending-style],._90333ddfaa28d232__content[data-starting-style]{height:0}@media not (prefers-reduced-motion){._90333ddfaa28d232__content{transition:all .15s ease-out}}}@layer compositions{.c269ffa2b76fe947__content-inner{padding-block-start:0}.c11e44555738d97f__header{align-items:stretch;display:flex;flex-direction:row;gap:var(--wpds-dimension-gap-sm,8px);outline:none}.c11e44555738d97f__header:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}}}"); 12518 } 12519 var style_module_default = { "heading-wrapper": "_572e7c546522c522__heading-wrapper", "header-content": "_7ea7cf191a8d26b8__header-content", "header-description": "_8f14576749c57845__header-description", "header-trigger-positioner": "_48cdf1e0d42fc13e__header-trigger-positioner", "header-trigger-wrapper": "_77d30921d8288eaf__header-trigger-wrapper", "header": "c11e44555738d97f__header", "header-trigger": "_22a30cbbb7b656f4__header-trigger", "content": "_90333ddfaa28d232__content", "overflow-visible": "_20c2575829a8af9b__overflow-visible", "content-inner": "c269ffa2b76fe947__content-inner" }; 12520 if (typeof process === "undefined" || true) { 12521 registerStyle15("abb19c3171", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-foreground-interactive-neutral-weak,#707070))}&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-foreground-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-foreground-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-emphasis,600));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}.c59a0ebebd71fa4a__ol{list-style:var(--_gcd-ol-list-style,none);margin:var(--_gcd-ol-margin,0);padding-block:var(--_gcd-ol-padding-block,0);padding-inline:var(--_gcd-ol-padding-inline,0)}._46b5cb0c8e24e8c9__li{margin:var(--_gcd-li-margin,0)}[role=treeitem] span._400bf7ee0c6061a9__span[aria-hidden]{display:var(--_gcd-span-display,inline);font-family:var(--_gcd-span-font-family,inherit);font-size:var(--_gcd-span-font-size,inherit);line-height:var(--_gcd-span-line-height,1);pointer-events:var(--_gcd-span-pointer-events,auto);position:var(--_gcd-span-position,static)}"); 12522 } 12523 var global_css_defense_default4 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a", "ol": "c59a0ebebd71fa4a__ol", "li": "_46b5cb0c8e24e8c9__li", "span": "_400bf7ee0c6061a9__span" }; 12524 var Header2 = (0, import_element37.forwardRef)( 12525 function CollapsibleCardHeader({ 12526 children, 12527 className, 12528 render, 12529 "aria-describedby": ariaDescribedByProp, 12530 ...restProps 12531 }, ref) { 12532 const [descriptionIds, setDescriptionIds] = (0, import_element37.useState)( 12533 [] 12534 ); 12535 const [orderedDescriptionIds, setOrderedDescriptionIds] = (0, import_element37.useState)([]); 12536 const headerContentRef = (0, import_element37.useRef)(null); 12537 const registerDescriptionId = (0, import_element37.useCallback)((id) => { 12538 setDescriptionIds((currentDescriptionIds) => { 12539 if (currentDescriptionIds.includes(id)) { 12540 return currentDescriptionIds; 12541 } 12542 return [...currentDescriptionIds, id]; 12543 }); 12544 return () => { 12545 setDescriptionIds( 12546 (currentDescriptionIds) => currentDescriptionIds.filter( 12547 (descriptionId) => descriptionId !== id 12548 ) 12549 ); 12550 }; 12551 }, []); 12552 const contextValue = (0, import_element37.useMemo)( 12553 () => ({ registerDescriptionId }), 12554 [registerDescriptionId] 12555 ); 12556 (0, import_compose3.useIsomorphicLayoutEffect)(() => { 12557 const registeredDescriptionIds = new Set(descriptionIds); 12558 const nextDescriptionIds = Array.from( 12559 headerContentRef.current?.querySelectorAll("[id]") ?? [] 12560 ).map((element) => element.id).filter((id) => registeredDescriptionIds.has(id)); 12561 setOrderedDescriptionIds((currentDescriptionIds) => { 12562 if (currentDescriptionIds.length === nextDescriptionIds.length && currentDescriptionIds.every( 12563 (id, index2) => id === nextDescriptionIds[index2] 12564 )) { 12565 return currentDescriptionIds; 12566 } 12567 return nextDescriptionIds; 12568 }); 12569 }); 12570 const ariaDescribedBy = Array.from( 12571 /* @__PURE__ */ new Set([ 12572 ...ariaDescribedByProp?.split(/\s+/).filter(Boolean) ?? [], 12573 ...orderedDescriptionIds 12574 ]) 12575 ).join(" ") || void 0; 12576 return useRender({ 12577 defaultTagName: "div", 12578 render, 12579 ref, 12580 props: mergeProps(restProps, { 12581 className: clsx_default( 12582 global_css_defense_default4.heading, 12583 style_module_default["heading-wrapper"], 12584 className 12585 ), 12586 children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(HeaderDescriptionIdContext.Provider, { value: contextValue, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)( 12587 Trigger2, 12588 { 12589 className: style_module_default.header, 12590 render: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Header, {}), 12591 nativeButton: false, 12592 "aria-describedby": ariaDescribedBy, 12593 children: [ 12594 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 12595 "div", 12596 { 12597 ref: headerContentRef, 12598 className: style_module_default["header-content"], 12599 children 12600 } 12601 ), 12602 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 12603 "div", 12604 { 12605 className: clsx_default( 12606 style_module_default["header-trigger-positioner"] 12607 ), 12608 children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 12609 "div", 12610 { 12611 className: clsx_default( 12612 style_module_default["header-trigger-wrapper"], 12613 global_css_defense_default4.div 12614 ), 12615 children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 12616 Icon, 12617 { 12618 icon: chevron_down_default, 12619 className: style_module_default["header-trigger"] 12620 } 12621 ) 12622 } 12623 ) 12624 } 12625 ) 12626 ] 12627 } 12628 ) }) 12629 }) 12630 }); 12631 } 12632 ); 12633 12634 // packages/ui/build-module/collapsible-card/header-description.mjs 12635 var import_element38 = __toESM(require_element(), 1); 12636 var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); 12637 var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash"; 12638 function getRuntime16() { 12639 const globalScope = globalThis; 12640 if (globalScope.__wpStyleRuntime) { 12641 return globalScope.__wpStyleRuntime; 12642 } 12643 globalScope.__wpStyleRuntime = { 12644 documents: /* @__PURE__ */ new Map(), 12645 styles: /* @__PURE__ */ new Map(), 12646 injectedStyles: /* @__PURE__ */ new WeakMap() 12647 }; 12648 if (typeof document !== "undefined") { 12649 registerDocument16(document); 12650 } 12651 return globalScope.__wpStyleRuntime; 12652 } 12653 function documentContainsStyleHash16(targetDocument, hash) { 12654 if (!targetDocument.head) { 12655 return false; 12656 } 12657 for (const style of targetDocument.head.querySelectorAll( 12658 `style[$STYLE_HASH_ATTRIBUTE16}]` 12659 )) { 12660 if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) { 12661 return true; 12662 } 12663 } 12664 return false; 12665 } 12666 function injectStyle16(targetDocument, hash, css) { 12667 if (!targetDocument.head) { 12668 return; 12669 } 12670 const runtime = getRuntime16(); 12671 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12672 if (!injectedStyles) { 12673 injectedStyles = /* @__PURE__ */ new Set(); 12674 runtime.injectedStyles.set(targetDocument, injectedStyles); 12675 } 12676 if (injectedStyles.has(hash)) { 12677 return; 12678 } 12679 if (documentContainsStyleHash16(targetDocument, hash)) { 12680 injectedStyles.add(hash); 12681 return; 12682 } 12683 const style = targetDocument.createElement("style"); 12684 style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash); 12685 style.appendChild(targetDocument.createTextNode(css)); 12686 targetDocument.head.appendChild(style); 12687 injectedStyles.add(hash); 12688 } 12689 function registerDocument16(targetDocument) { 12690 const runtime = getRuntime16(); 12691 runtime.documents.set( 12692 targetDocument, 12693 (runtime.documents.get(targetDocument) ?? 0) + 1 12694 ); 12695 for (const [hash, css] of runtime.styles) { 12696 injectStyle16(targetDocument, hash, css); 12697 } 12698 return () => { 12699 const count = runtime.documents.get(targetDocument); 12700 if (count === void 0) { 12701 return; 12702 } 12703 if (count <= 1) { 12704 runtime.documents.delete(targetDocument); 12705 return; 12706 } 12707 runtime.documents.set(targetDocument, count - 1); 12708 }; 12709 } 12710 function registerStyle16(hash, css) { 12711 const runtime = getRuntime16(); 12712 runtime.styles.set(hash, css); 12713 for (const targetDocument of runtime.documents.keys()) { 12714 injectStyle16(targetDocument, hash, css); 12715 } 12716 } 12717 if (typeof process === "undefined" || true) { 12718 registerStyle16("66b8e83c76", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._572e7c546522c522__heading-wrapper{--_gcd-heading-color:inherit;--_gcd-heading-font-size:inherit;--_gcd-heading-font-weight:inherit;--_gcd-heading-margin:0;font-family:inherit;line-height:inherit}._7ea7cf191a8d26b8__header-content{flex:1;min-width:0}._8f14576749c57845__header-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._48cdf1e0d42fc13e__header-trigger-positioner{align-self:flex-start;flex-shrink:0;margin-block-start:calc(var(--wpds-typography-line-height-sm, 20px)/2);max-height:0;overflow:visible}._77d30921d8288eaf__header-trigger-wrapper{border-radius:var(--wpds-border-radius-sm,2px);display:flex;translate:0 -50%}.c11e44555738d97f__header:focus-visible ._77d30921d8288eaf__header-trigger-wrapper{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}@media not (prefers-reduced-motion){._22a30cbbb7b656f4__header-trigger{transition:rotate .15s ease-out}}.c11e44555738d97f__header[data-panel-open] ._22a30cbbb7b656f4__header-trigger{rotate:180deg}.c11e44555738d97f__header[data-disabled] ._22a30cbbb7b656f4__header-trigger{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}._90333ddfaa28d232__content{height:var(--collapsible-panel-height);margin-block-start:var(--wp-ui-card-header-content-margin);overflow:hidden}._90333ddfaa28d232__content._20c2575829a8af9b__overflow-visible{overflow:visible}._90333ddfaa28d232__content[hidden]:not([hidden=until-found]){display:none}._90333ddfaa28d232__content[data-ending-style],._90333ddfaa28d232__content[data-starting-style]{height:0}@media not (prefers-reduced-motion){._90333ddfaa28d232__content{transition:all .15s ease-out}}}@layer compositions{.c269ffa2b76fe947__content-inner{padding-block-start:0}.c11e44555738d97f__header{align-items:stretch;display:flex;flex-direction:row;gap:var(--wpds-dimension-gap-sm,8px);outline:none}.c11e44555738d97f__header:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}}}"); 12719 } 12720 var style_module_default2 = { "heading-wrapper": "_572e7c546522c522__heading-wrapper", "header-content": "_7ea7cf191a8d26b8__header-content", "header-description": "_8f14576749c57845__header-description", "header-trigger-positioner": "_48cdf1e0d42fc13e__header-trigger-positioner", "header-trigger-wrapper": "_77d30921d8288eaf__header-trigger-wrapper", "header": "c11e44555738d97f__header", "header-trigger": "_22a30cbbb7b656f4__header-trigger", "content": "_90333ddfaa28d232__content", "overflow-visible": "_20c2575829a8af9b__overflow-visible", "content-inner": "c269ffa2b76fe947__content-inner" }; 12721 var DEFAULT_TAG2 = /* @__PURE__ */ (0, import_jsx_runtime56.jsx)("div", {}); 12722 var HeaderDescription = (0, import_element38.forwardRef)(function CollapsibleCardHeaderDescription({ children, className, id: idProp, render = DEFAULT_TAG2, ...restProps }, ref) { 12723 const generatedId = (0, import_element38.useId)(); 12724 const descriptionId = idProp ?? generatedId; 12725 const context = (0, import_element38.useContext)(HeaderDescriptionIdContext); 12726 if (!context) { 12727 throw new Error( 12728 "CollapsibleCard.HeaderDescription: Missing parent <CollapsibleCard.Header>. Render <CollapsibleCard.HeaderDescription> inside <CollapsibleCard.Header>." 12729 ); 12730 } 12731 (0, import_element38.useEffect)(() => { 12732 return context?.registerDescriptionId(descriptionId); 12733 }, [context, descriptionId]); 12734 return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)( 12735 Text, 12736 { 12737 ref, 12738 variant: "body-md", 12739 render, 12740 id: descriptionId, 12741 "aria-hidden": "true", 12742 className: clsx_default(style_module_default2["header-description"], className), 12743 ...restProps, 12744 children 12745 } 12746 ); 12747 }); 12748 12749 // packages/ui/build-module/collapsible-card/content.mjs 12750 var import_element39 = __toESM(require_element(), 1); 12751 var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1); 12752 var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash"; 12753 function getRuntime17() { 12754 const globalScope = globalThis; 12755 if (globalScope.__wpStyleRuntime) { 12756 return globalScope.__wpStyleRuntime; 12757 } 12758 globalScope.__wpStyleRuntime = { 12759 documents: /* @__PURE__ */ new Map(), 12760 styles: /* @__PURE__ */ new Map(), 12761 injectedStyles: /* @__PURE__ */ new WeakMap() 12762 }; 12763 if (typeof document !== "undefined") { 12764 registerDocument17(document); 12765 } 12766 return globalScope.__wpStyleRuntime; 12767 } 12768 function documentContainsStyleHash17(targetDocument, hash) { 12769 if (!targetDocument.head) { 12770 return false; 12771 } 12772 for (const style of targetDocument.head.querySelectorAll( 12773 `style[$STYLE_HASH_ATTRIBUTE17}]` 12774 )) { 12775 if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) { 12776 return true; 12777 } 12778 } 12779 return false; 12780 } 12781 function injectStyle17(targetDocument, hash, css) { 12782 if (!targetDocument.head) { 12783 return; 12784 } 12785 const runtime = getRuntime17(); 12786 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12787 if (!injectedStyles) { 12788 injectedStyles = /* @__PURE__ */ new Set(); 12789 runtime.injectedStyles.set(targetDocument, injectedStyles); 12790 } 12791 if (injectedStyles.has(hash)) { 12792 return; 12793 } 12794 if (documentContainsStyleHash17(targetDocument, hash)) { 12795 injectedStyles.add(hash); 12796 return; 12797 } 12798 const style = targetDocument.createElement("style"); 12799 style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash); 12800 style.appendChild(targetDocument.createTextNode(css)); 12801 targetDocument.head.appendChild(style); 12802 injectedStyles.add(hash); 12803 } 12804 function registerDocument17(targetDocument) { 12805 const runtime = getRuntime17(); 12806 runtime.documents.set( 12807 targetDocument, 12808 (runtime.documents.get(targetDocument) ?? 0) + 1 12809 ); 12810 for (const [hash, css] of runtime.styles) { 12811 injectStyle17(targetDocument, hash, css); 12812 } 12813 return () => { 12814 const count = runtime.documents.get(targetDocument); 12815 if (count === void 0) { 12816 return; 12817 } 12818 if (count <= 1) { 12819 runtime.documents.delete(targetDocument); 12820 return; 12821 } 12822 runtime.documents.set(targetDocument, count - 1); 12823 }; 12824 } 12825 function registerStyle17(hash, css) { 12826 const runtime = getRuntime17(); 12827 runtime.styles.set(hash, css); 12828 for (const targetDocument of runtime.documents.keys()) { 12829 injectStyle17(targetDocument, hash, css); 12830 } 12831 } 12832 if (typeof process === "undefined" || true) { 12833 registerStyle17("66b8e83c76", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._572e7c546522c522__heading-wrapper{--_gcd-heading-color:inherit;--_gcd-heading-font-size:inherit;--_gcd-heading-font-weight:inherit;--_gcd-heading-margin:0;font-family:inherit;line-height:inherit}._7ea7cf191a8d26b8__header-content{flex:1;min-width:0}._8f14576749c57845__header-description{color:var(--wpds-color-foreground-content-neutral-weak,#707070)}._48cdf1e0d42fc13e__header-trigger-positioner{align-self:flex-start;flex-shrink:0;margin-block-start:calc(var(--wpds-typography-line-height-sm, 20px)/2);max-height:0;overflow:visible}._77d30921d8288eaf__header-trigger-wrapper{border-radius:var(--wpds-border-radius-sm,2px);display:flex;translate:0 -50%}.c11e44555738d97f__header:focus-visible ._77d30921d8288eaf__header-trigger-wrapper{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--focus-color,var(--wpds-color-stroke-focus,var(--wp-admin-theme-color,#3858e9)));outline-offset:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px))}@media not (prefers-reduced-motion){._22a30cbbb7b656f4__header-trigger{transition:rotate .15s ease-out}}.c11e44555738d97f__header[data-panel-open] ._22a30cbbb7b656f4__header-trigger{rotate:180deg}.c11e44555738d97f__header[data-disabled] ._22a30cbbb7b656f4__header-trigger{color:var(--wpds-color-foreground-interactive-neutral-disabled,#8d8d8d)}._90333ddfaa28d232__content{height:var(--collapsible-panel-height);margin-block-start:var(--wp-ui-card-header-content-margin);overflow:hidden}._90333ddfaa28d232__content._20c2575829a8af9b__overflow-visible{overflow:visible}._90333ddfaa28d232__content[hidden]:not([hidden=until-found]){display:none}._90333ddfaa28d232__content[data-ending-style],._90333ddfaa28d232__content[data-starting-style]{height:0}@media not (prefers-reduced-motion){._90333ddfaa28d232__content{transition:all .15s ease-out}}}@layer compositions{.c269ffa2b76fe947__content-inner{padding-block-start:0}.c11e44555738d97f__header{align-items:stretch;display:flex;flex-direction:row;gap:var(--wpds-dimension-gap-sm,8px);outline:none}.c11e44555738d97f__header:not([data-disabled]){cursor:var(--wpds-cursor-control,pointer)}}}"); 12834 } 12835 var style_module_default3 = { "heading-wrapper": "_572e7c546522c522__heading-wrapper", "header-content": "_7ea7cf191a8d26b8__header-content", "header-description": "_8f14576749c57845__header-description", "header-trigger-positioner": "_48cdf1e0d42fc13e__header-trigger-positioner", "header-trigger-wrapper": "_77d30921d8288eaf__header-trigger-wrapper", "header": "c11e44555738d97f__header", "header-trigger": "_22a30cbbb7b656f4__header-trigger", "content": "_90333ddfaa28d232__content", "overflow-visible": "_20c2575829a8af9b__overflow-visible", "content-inner": "c269ffa2b76fe947__content-inner" }; 12836 var Content2 = (0, import_element39.forwardRef)( 12837 function CollapsibleCardContent({ className, render, children, hiddenUntilFound = true, ...restProps }, ref) { 12838 return /* @__PURE__ */ (0, import_jsx_runtime57.jsx)( 12839 Panel2, 12840 { 12841 ref, 12842 className: (state) => clsx_default( 12843 style_module_default3.content, 12844 state.open && state.transitionStatus === "idle" && style_module_default3["overflow-visible"], 12845 className 12846 ), 12847 hiddenUntilFound, 12848 ...restProps, 12849 children: /* @__PURE__ */ (0, import_jsx_runtime57.jsx)( 12850 Content, 12851 { 12852 className: style_module_default3["content-inner"], 12853 render, 12854 children 12855 } 12856 ) 12857 } 12858 ); 12859 } 12860 ); 12861 12862 // packages/ui/build-module/stack/stack.mjs 12863 var import_element40 = __toESM(require_element(), 1); 12864 var STYLE_HASH_ATTRIBUTE18 = "data-wp-hash"; 12865 function getRuntime18() { 12866 const globalScope = globalThis; 12867 if (globalScope.__wpStyleRuntime) { 12868 return globalScope.__wpStyleRuntime; 12869 } 12870 globalScope.__wpStyleRuntime = { 12871 documents: /* @__PURE__ */ new Map(), 12872 styles: /* @__PURE__ */ new Map(), 12873 injectedStyles: /* @__PURE__ */ new WeakMap() 12874 }; 12875 if (typeof document !== "undefined") { 12876 registerDocument18(document); 12877 } 12878 return globalScope.__wpStyleRuntime; 12879 } 12880 function documentContainsStyleHash18(targetDocument, hash) { 12881 if (!targetDocument.head) { 12882 return false; 12883 } 12884 for (const style of targetDocument.head.querySelectorAll( 12885 `style[$STYLE_HASH_ATTRIBUTE18}]` 12886 )) { 12887 if (style.getAttribute(STYLE_HASH_ATTRIBUTE18) === hash) { 12888 return true; 12889 } 12890 } 12891 return false; 12892 } 12893 function injectStyle18(targetDocument, hash, css) { 12894 if (!targetDocument.head) { 12895 return; 12896 } 12897 const runtime = getRuntime18(); 12898 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12899 if (!injectedStyles) { 12900 injectedStyles = /* @__PURE__ */ new Set(); 12901 runtime.injectedStyles.set(targetDocument, injectedStyles); 12902 } 12903 if (injectedStyles.has(hash)) { 12904 return; 12905 } 12906 if (documentContainsStyleHash18(targetDocument, hash)) { 12907 injectedStyles.add(hash); 12908 return; 12909 } 12910 const style = targetDocument.createElement("style"); 12911 style.setAttribute(STYLE_HASH_ATTRIBUTE18, hash); 12912 style.appendChild(targetDocument.createTextNode(css)); 12913 targetDocument.head.appendChild(style); 12914 injectedStyles.add(hash); 12915 } 12916 function registerDocument18(targetDocument) { 12917 const runtime = getRuntime18(); 12918 runtime.documents.set( 12919 targetDocument, 12920 (runtime.documents.get(targetDocument) ?? 0) + 1 12921 ); 12922 for (const [hash, css] of runtime.styles) { 12923 injectStyle18(targetDocument, hash, css); 12924 } 12925 return () => { 12926 const count = runtime.documents.get(targetDocument); 12927 if (count === void 0) { 12928 return; 12929 } 12930 if (count <= 1) { 12931 runtime.documents.delete(targetDocument); 12932 return; 12933 } 12934 runtime.documents.set(targetDocument, count - 1); 12935 }; 12936 } 12937 function registerStyle18(hash, css) { 12938 const runtime = getRuntime18(); 12939 runtime.styles.set(hash, css); 12940 for (const targetDocument of runtime.documents.keys()) { 12941 injectStyle18(targetDocument, hash, css); 12942 } 12943 } 12944 if (typeof process === "undefined" || true) { 12945 registerStyle18("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); 12946 } 12947 var style_default14 = { "stack": "_19ce0419607e1896__stack" }; 12948 var gapTokens = { 12949 xs: "var(--wpds-dimension-gap-xs, 4px)", 12950 sm: "var(--wpds-dimension-gap-sm, 8px)", 12951 md: "var(--wpds-dimension-gap-md, 12px)", 12952 lg: "var(--wpds-dimension-gap-lg, 16px)", 12953 xl: "var(--wpds-dimension-gap-xl, 24px)", 12954 "2xl": "var(--wpds-dimension-gap-2xl, 32px)", 12955 "3xl": "var(--wpds-dimension-gap-3xl, 40px)" 12956 }; 12957 var Stack = (0, import_element40.forwardRef)( 12958 function UnforwardedStack({ direction, gap, align, justify, wrap, render, ...props }, ref) { 12959 const style = { 12960 gap: gap && gapTokens[gap], 12961 alignItems: align, 12962 justifyContent: justify, 12963 flexDirection: direction, 12964 flexWrap: wrap 12965 }; 12966 const element = useRender({ 12967 render, 12968 ref, 12969 props: mergeProps(props, { 12970 style, 12971 className: style_default14.stack 12972 }) 12973 }); 12974 return element; 12975 } 12976 ); 12977 12978 // packages/ui/build-module/notice/index.mjs 12979 var notice_exports = {}; 12980 __export(notice_exports, { 12981 ActionButton: () => ActionButton, 12982 ActionLink: () => ActionLink, 12983 Actions: () => Actions, 12984 CloseIconButton: () => CloseIconButton, 12985 Description: () => Description, 12986 Root: () => Root4, 12987 Title: () => Title2 12988 }); 12989 12990 // packages/ui/build-module/notice/root.mjs 12991 var import_element41 = __toESM(require_element(), 1); 12992 var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1); 12993 var STYLE_HASH_ATTRIBUTE19 = "data-wp-hash"; 12994 function getRuntime19() { 12995 const globalScope = globalThis; 12996 if (globalScope.__wpStyleRuntime) { 12997 return globalScope.__wpStyleRuntime; 12998 } 12999 globalScope.__wpStyleRuntime = { 13000 documents: /* @__PURE__ */ new Map(), 13001 styles: /* @__PURE__ */ new Map(), 13002 injectedStyles: /* @__PURE__ */ new WeakMap() 13003 }; 13004 if (typeof document !== "undefined") { 13005 registerDocument19(document); 13006 } 13007 return globalScope.__wpStyleRuntime; 13008 } 13009 function documentContainsStyleHash19(targetDocument, hash) { 13010 if (!targetDocument.head) { 13011 return false; 13012 } 13013 for (const style of targetDocument.head.querySelectorAll( 13014 `style[$STYLE_HASH_ATTRIBUTE19}]` 13015 )) { 13016 if (style.getAttribute(STYLE_HASH_ATTRIBUTE19) === hash) { 13017 return true; 13018 } 13019 } 13020 return false; 13021 } 13022 function injectStyle19(targetDocument, hash, css) { 13023 if (!targetDocument.head) { 13024 return; 13025 } 13026 const runtime = getRuntime19(); 13027 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13028 if (!injectedStyles) { 13029 injectedStyles = /* @__PURE__ */ new Set(); 13030 runtime.injectedStyles.set(targetDocument, injectedStyles); 13031 } 13032 if (injectedStyles.has(hash)) { 13033 return; 13034 } 13035 if (documentContainsStyleHash19(targetDocument, hash)) { 13036 injectedStyles.add(hash); 13037 return; 13038 } 13039 const style = targetDocument.createElement("style"); 13040 style.setAttribute(STYLE_HASH_ATTRIBUTE19, hash); 13041 style.appendChild(targetDocument.createTextNode(css)); 13042 targetDocument.head.appendChild(style); 13043 injectedStyles.add(hash); 13044 } 13045 function registerDocument19(targetDocument) { 13046 const runtime = getRuntime19(); 13047 runtime.documents.set( 13048 targetDocument, 13049 (runtime.documents.get(targetDocument) ?? 0) + 1 13050 ); 13051 for (const [hash, css] of runtime.styles) { 13052 injectStyle19(targetDocument, hash, css); 13053 } 13054 return () => { 13055 const count = runtime.documents.get(targetDocument); 13056 if (count === void 0) { 13057 return; 13058 } 13059 if (count <= 1) { 13060 runtime.documents.delete(targetDocument); 13061 return; 13062 } 13063 runtime.documents.set(targetDocument, count - 1); 13064 }; 13065 } 13066 function registerStyle19(hash, css) { 13067 const runtime = getRuntime19(); 13068 runtime.styles.set(hash, css); 13069 for (const targetDocument of runtime.documents.keys()) { 13070 injectStyle19(targetDocument, hash, css); 13071 } 13072 } 13073 if (typeof process === "undefined" || true) { 13074 registerStyle19("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 13075 } 13076 var resets_default5 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 13077 if (typeof process === "undefined" || true) { 13078 registerStyle19("30e8b36272", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;isolation:isolate;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#936300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.b5397fb9d05389e3__title{--_gcd-heading-color:var(--wp-ui-notice-text-color);color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button,.d329e7416d368d31__action-link{mix-blend-mode:luminosity;@media (forced-colors:active){mix-blend-mode:normal}}}}"); 13079 } 13080 var style_default15 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "title": "b5397fb9d05389e3__title", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error" }; 13081 var icons = { 13082 neutral: null, 13083 info: info_default, 13084 warning: caution_default, 13085 success: published_default, 13086 error: error_default 13087 }; 13088 var Root4 = (0, import_element41.forwardRef)(function Notice({ intent = "neutral", children, icon, render, ...restProps }, ref) { 13089 const iconElement = icon === null ? null : icon ?? icons[intent]; 13090 const mergedClassName = clsx_default( 13091 style_default15.notice, 13092 style_default15[`is-$intent}`], 13093 resets_default5["box-sizing"] 13094 ); 13095 const element = useRender({ 13096 defaultTagName: "div", 13097 render, 13098 ref, 13099 props: mergeProps( 13100 { 13101 className: mergedClassName, 13102 children: /* @__PURE__ */ (0, import_jsx_runtime58.jsxs)(import_jsx_runtime58.Fragment, { children: [ 13103 children, 13104 iconElement && /* @__PURE__ */ (0, import_jsx_runtime58.jsx)( 13105 Icon, 13106 { 13107 className: style_default15.icon, 13108 icon: iconElement 13109 } 13110 ) 13111 ] }) 13112 }, 13113 restProps 13114 ) 13115 }); 13116 return element; 13117 }); 13118 13119 // packages/ui/build-module/notice/title.mjs 13120 var import_element42 = __toESM(require_element(), 1); 13121 var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1); 13122 var STYLE_HASH_ATTRIBUTE20 = "data-wp-hash"; 13123 function getRuntime20() { 13124 const globalScope = globalThis; 13125 if (globalScope.__wpStyleRuntime) { 13126 return globalScope.__wpStyleRuntime; 13127 } 13128 globalScope.__wpStyleRuntime = { 13129 documents: /* @__PURE__ */ new Map(), 13130 styles: /* @__PURE__ */ new Map(), 13131 injectedStyles: /* @__PURE__ */ new WeakMap() 13132 }; 13133 if (typeof document !== "undefined") { 13134 registerDocument20(document); 13135 } 13136 return globalScope.__wpStyleRuntime; 13137 } 13138 function documentContainsStyleHash20(targetDocument, hash) { 13139 if (!targetDocument.head) { 13140 return false; 13141 } 13142 for (const style of targetDocument.head.querySelectorAll( 13143 `style[$STYLE_HASH_ATTRIBUTE20}]` 13144 )) { 13145 if (style.getAttribute(STYLE_HASH_ATTRIBUTE20) === hash) { 13146 return true; 13147 } 13148 } 13149 return false; 13150 } 13151 function injectStyle20(targetDocument, hash, css) { 13152 if (!targetDocument.head) { 13153 return; 13154 } 13155 const runtime = getRuntime20(); 13156 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13157 if (!injectedStyles) { 13158 injectedStyles = /* @__PURE__ */ new Set(); 13159 runtime.injectedStyles.set(targetDocument, injectedStyles); 13160 } 13161 if (injectedStyles.has(hash)) { 13162 return; 13163 } 13164 if (documentContainsStyleHash20(targetDocument, hash)) { 13165 injectedStyles.add(hash); 13166 return; 13167 } 13168 const style = targetDocument.createElement("style"); 13169 style.setAttribute(STYLE_HASH_ATTRIBUTE20, hash); 13170 style.appendChild(targetDocument.createTextNode(css)); 13171 targetDocument.head.appendChild(style); 13172 injectedStyles.add(hash); 13173 } 13174 function registerDocument20(targetDocument) { 13175 const runtime = getRuntime20(); 13176 runtime.documents.set( 13177 targetDocument, 13178 (runtime.documents.get(targetDocument) ?? 0) + 1 13179 ); 13180 for (const [hash, css] of runtime.styles) { 13181 injectStyle20(targetDocument, hash, css); 13182 } 13183 return () => { 13184 const count = runtime.documents.get(targetDocument); 13185 if (count === void 0) { 13186 return; 13187 } 13188 if (count <= 1) { 13189 runtime.documents.delete(targetDocument); 13190 return; 13191 } 13192 runtime.documents.set(targetDocument, count - 1); 13193 }; 13194 } 13195 function registerStyle20(hash, css) { 13196 const runtime = getRuntime20(); 13197 runtime.styles.set(hash, css); 13198 for (const targetDocument of runtime.documents.keys()) { 13199 injectStyle20(targetDocument, hash, css); 13200 } 13201 } 13202 if (typeof process === "undefined" || true) { 13203 registerStyle20("30e8b36272", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;isolation:isolate;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#936300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.b5397fb9d05389e3__title{--_gcd-heading-color:var(--wp-ui-notice-text-color);color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button,.d329e7416d368d31__action-link{mix-blend-mode:luminosity;@media (forced-colors:active){mix-blend-mode:normal}}}}"); 13204 } 13205 var style_default16 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "title": "b5397fb9d05389e3__title", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error" }; 13206 var Title2 = (0, import_element42.forwardRef)( 13207 function NoticeTitle({ className, ...props }, ref) { 13208 return /* @__PURE__ */ (0, import_jsx_runtime59.jsx)( 13209 Text, 13210 { 13211 ref, 13212 variant: "heading-md", 13213 className: clsx_default(style_default16.title, className), 13214 ...props 13215 } 13216 ); 13217 } 13218 ); 13219 13220 // packages/ui/build-module/notice/description.mjs 13221 var import_element43 = __toESM(require_element(), 1); 13222 var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1); 13223 var STYLE_HASH_ATTRIBUTE21 = "data-wp-hash"; 13224 function getRuntime21() { 13225 const globalScope = globalThis; 13226 if (globalScope.__wpStyleRuntime) { 13227 return globalScope.__wpStyleRuntime; 13228 } 13229 globalScope.__wpStyleRuntime = { 13230 documents: /* @__PURE__ */ new Map(), 13231 styles: /* @__PURE__ */ new Map(), 13232 injectedStyles: /* @__PURE__ */ new WeakMap() 13233 }; 13234 if (typeof document !== "undefined") { 13235 registerDocument21(document); 13236 } 13237 return globalScope.__wpStyleRuntime; 13238 } 13239 function documentContainsStyleHash21(targetDocument, hash) { 13240 if (!targetDocument.head) { 13241 return false; 13242 } 13243 for (const style of targetDocument.head.querySelectorAll( 13244 `style[$STYLE_HASH_ATTRIBUTE21}]` 13245 )) { 13246 if (style.getAttribute(STYLE_HASH_ATTRIBUTE21) === hash) { 13247 return true; 13248 } 13249 } 13250 return false; 13251 } 13252 function injectStyle21(targetDocument, hash, css) { 13253 if (!targetDocument.head) { 13254 return; 13255 } 13256 const runtime = getRuntime21(); 13257 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13258 if (!injectedStyles) { 13259 injectedStyles = /* @__PURE__ */ new Set(); 13260 runtime.injectedStyles.set(targetDocument, injectedStyles); 13261 } 13262 if (injectedStyles.has(hash)) { 13263 return; 13264 } 13265 if (documentContainsStyleHash21(targetDocument, hash)) { 13266 injectedStyles.add(hash); 13267 return; 13268 } 13269 const style = targetDocument.createElement("style"); 13270 style.setAttribute(STYLE_HASH_ATTRIBUTE21, hash); 13271 style.appendChild(targetDocument.createTextNode(css)); 13272 targetDocument.head.appendChild(style); 13273 injectedStyles.add(hash); 13274 } 13275 function registerDocument21(targetDocument) { 13276 const runtime = getRuntime21(); 13277 runtime.documents.set( 13278 targetDocument, 13279 (runtime.documents.get(targetDocument) ?? 0) + 1 13280 ); 13281 for (const [hash, css] of runtime.styles) { 13282 injectStyle21(targetDocument, hash, css); 13283 } 13284 return () => { 13285 const count = runtime.documents.get(targetDocument); 13286 if (count === void 0) { 13287 return; 13288 } 13289 if (count <= 1) { 13290 runtime.documents.delete(targetDocument); 13291 return; 13292 } 13293 runtime.documents.set(targetDocument, count - 1); 13294 }; 13295 } 13296 function registerStyle21(hash, css) { 13297 const runtime = getRuntime21(); 13298 runtime.styles.set(hash, css); 13299 for (const targetDocument of runtime.documents.keys()) { 13300 injectStyle21(targetDocument, hash, css); 13301 } 13302 } 13303 if (typeof process === "undefined" || true) { 13304 registerStyle21("30e8b36272", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;isolation:isolate;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#936300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.b5397fb9d05389e3__title{--_gcd-heading-color:var(--wp-ui-notice-text-color);color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button,.d329e7416d368d31__action-link{mix-blend-mode:luminosity;@media (forced-colors:active){mix-blend-mode:normal}}}}"); 13305 } 13306 var style_default17 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "title": "b5397fb9d05389e3__title", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error" }; 13307 var Description = (0, import_element43.forwardRef)( 13308 function NoticeDescription({ className, ...props }, ref) { 13309 return /* @__PURE__ */ (0, import_jsx_runtime60.jsx)( 13310 Text, 13311 { 13312 ref, 13313 variant: "body-md", 13314 className: clsx_default(style_default17.description, className), 13315 ...props 13316 } 13317 ); 13318 } 13319 ); 13320 13321 // packages/ui/build-module/notice/actions.mjs 13322 var import_element44 = __toESM(require_element(), 1); 13323 var STYLE_HASH_ATTRIBUTE22 = "data-wp-hash"; 13324 function getRuntime22() { 13325 const globalScope = globalThis; 13326 if (globalScope.__wpStyleRuntime) { 13327 return globalScope.__wpStyleRuntime; 13328 } 13329 globalScope.__wpStyleRuntime = { 13330 documents: /* @__PURE__ */ new Map(), 13331 styles: /* @__PURE__ */ new Map(), 13332 injectedStyles: /* @__PURE__ */ new WeakMap() 13333 }; 13334 if (typeof document !== "undefined") { 13335 registerDocument22(document); 13336 } 13337 return globalScope.__wpStyleRuntime; 13338 } 13339 function documentContainsStyleHash22(targetDocument, hash) { 13340 if (!targetDocument.head) { 13341 return false; 13342 } 13343 for (const style of targetDocument.head.querySelectorAll( 13344 `style[$STYLE_HASH_ATTRIBUTE22}]` 13345 )) { 13346 if (style.getAttribute(STYLE_HASH_ATTRIBUTE22) === hash) { 13347 return true; 13348 } 13349 } 13350 return false; 13351 } 13352 function injectStyle22(targetDocument, hash, css) { 13353 if (!targetDocument.head) { 13354 return; 13355 } 13356 const runtime = getRuntime22(); 13357 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13358 if (!injectedStyles) { 13359 injectedStyles = /* @__PURE__ */ new Set(); 13360 runtime.injectedStyles.set(targetDocument, injectedStyles); 13361 } 13362 if (injectedStyles.has(hash)) { 13363 return; 13364 } 13365 if (documentContainsStyleHash22(targetDocument, hash)) { 13366 injectedStyles.add(hash); 13367 return; 13368 } 13369 const style = targetDocument.createElement("style"); 13370 style.setAttribute(STYLE_HASH_ATTRIBUTE22, hash); 13371 style.appendChild(targetDocument.createTextNode(css)); 13372 targetDocument.head.appendChild(style); 13373 injectedStyles.add(hash); 13374 } 13375 function registerDocument22(targetDocument) { 13376 const runtime = getRuntime22(); 13377 runtime.documents.set( 13378 targetDocument, 13379 (runtime.documents.get(targetDocument) ?? 0) + 1 13380 ); 13381 for (const [hash, css] of runtime.styles) { 13382 injectStyle22(targetDocument, hash, css); 13383 } 13384 return () => { 13385 const count = runtime.documents.get(targetDocument); 13386 if (count === void 0) { 13387 return; 13388 } 13389 if (count <= 1) { 13390 runtime.documents.delete(targetDocument); 13391 return; 13392 } 13393 runtime.documents.set(targetDocument, count - 1); 13394 }; 13395 } 13396 function registerStyle22(hash, css) { 13397 const runtime = getRuntime22(); 13398 runtime.styles.set(hash, css); 13399 for (const targetDocument of runtime.documents.keys()) { 13400 injectStyle22(targetDocument, hash, css); 13401 } 13402 } 13403 if (typeof process === "undefined" || true) { 13404 registerStyle22("30e8b36272", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;isolation:isolate;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#936300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.b5397fb9d05389e3__title{--_gcd-heading-color:var(--wp-ui-notice-text-color);color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button,.d329e7416d368d31__action-link{mix-blend-mode:luminosity;@media (forced-colors:active){mix-blend-mode:normal}}}}"); 13405 } 13406 var style_default18 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "title": "b5397fb9d05389e3__title", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error" }; 13407 var Actions = (0, import_element44.forwardRef)( 13408 function NoticeActions({ render, ...props }, ref) { 13409 const element = useRender({ 13410 defaultTagName: "div", 13411 render, 13412 ref, 13413 props: mergeProps( 13414 { 13415 className: style_default18.actions 13416 }, 13417 props 13418 ) 13419 }); 13420 return element; 13421 } 13422 ); 13423 13424 // packages/ui/build-module/notice/close-icon-button.mjs 13425 var import_element45 = __toESM(require_element(), 1); 13426 var import_i18n6 = __toESM(require_i18n(), 1); 13427 var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1); 13428 var STYLE_HASH_ATTRIBUTE23 = "data-wp-hash"; 13429 function getRuntime23() { 13430 const globalScope = globalThis; 13431 if (globalScope.__wpStyleRuntime) { 13432 return globalScope.__wpStyleRuntime; 13433 } 13434 globalScope.__wpStyleRuntime = { 13435 documents: /* @__PURE__ */ new Map(), 13436 styles: /* @__PURE__ */ new Map(), 13437 injectedStyles: /* @__PURE__ */ new WeakMap() 13438 }; 13439 if (typeof document !== "undefined") { 13440 registerDocument23(document); 13441 } 13442 return globalScope.__wpStyleRuntime; 13443 } 13444 function documentContainsStyleHash23(targetDocument, hash) { 13445 if (!targetDocument.head) { 13446 return false; 13447 } 13448 for (const style of targetDocument.head.querySelectorAll( 13449 `style[$STYLE_HASH_ATTRIBUTE23}]` 13450 )) { 13451 if (style.getAttribute(STYLE_HASH_ATTRIBUTE23) === hash) { 13452 return true; 13453 } 13454 } 13455 return false; 13456 } 13457 function injectStyle23(targetDocument, hash, css) { 13458 if (!targetDocument.head) { 13459 return; 13460 } 13461 const runtime = getRuntime23(); 13462 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13463 if (!injectedStyles) { 13464 injectedStyles = /* @__PURE__ */ new Set(); 13465 runtime.injectedStyles.set(targetDocument, injectedStyles); 13466 } 13467 if (injectedStyles.has(hash)) { 13468 return; 13469 } 13470 if (documentContainsStyleHash23(targetDocument, hash)) { 13471 injectedStyles.add(hash); 13472 return; 13473 } 13474 const style = targetDocument.createElement("style"); 13475 style.setAttribute(STYLE_HASH_ATTRIBUTE23, hash); 13476 style.appendChild(targetDocument.createTextNode(css)); 13477 targetDocument.head.appendChild(style); 13478 injectedStyles.add(hash); 13479 } 13480 function registerDocument23(targetDocument) { 13481 const runtime = getRuntime23(); 13482 runtime.documents.set( 13483 targetDocument, 13484 (runtime.documents.get(targetDocument) ?? 0) + 1 13485 ); 13486 for (const [hash, css] of runtime.styles) { 13487 injectStyle23(targetDocument, hash, css); 13488 } 13489 return () => { 13490 const count = runtime.documents.get(targetDocument); 13491 if (count === void 0) { 13492 return; 13493 } 13494 if (count <= 1) { 13495 runtime.documents.delete(targetDocument); 13496 return; 13497 } 13498 runtime.documents.set(targetDocument, count - 1); 13499 }; 13500 } 13501 function registerStyle23(hash, css) { 13502 const runtime = getRuntime23(); 13503 runtime.styles.set(hash, css); 13504 for (const targetDocument of runtime.documents.keys()) { 13505 injectStyle23(targetDocument, hash, css); 13506 } 13507 } 13508 if (typeof process === "undefined" || true) { 13509 registerStyle23("30e8b36272", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;isolation:isolate;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#936300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.b5397fb9d05389e3__title{--_gcd-heading-color:var(--wp-ui-notice-text-color);color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button,.d329e7416d368d31__action-link{mix-blend-mode:luminosity;@media (forced-colors:active){mix-blend-mode:normal}}}}"); 13510 } 13511 var style_default19 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "title": "b5397fb9d05389e3__title", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error" }; 13512 var CloseIconButton = (0, import_element45.forwardRef)(function NoticeCloseIconButton({ className, icon = close_small_default, label = (0, import_i18n6.__)("Dismiss"), ...props }, ref) { 13513 return /* @__PURE__ */ (0, import_jsx_runtime61.jsx)( 13514 IconButton, 13515 { 13516 ...props, 13517 ref, 13518 className: clsx_default(style_default19["close-icon"], className), 13519 variant: "minimal", 13520 size: "small", 13521 tone: "neutral", 13522 icon, 13523 label 13524 } 13525 ); 13526 }); 13527 13528 // packages/ui/build-module/notice/action-button.mjs 13529 var import_element46 = __toESM(require_element(), 1); 13530 var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1); 13531 var STYLE_HASH_ATTRIBUTE24 = "data-wp-hash"; 13532 function getRuntime24() { 13533 const globalScope = globalThis; 13534 if (globalScope.__wpStyleRuntime) { 13535 return globalScope.__wpStyleRuntime; 13536 } 13537 globalScope.__wpStyleRuntime = { 13538 documents: /* @__PURE__ */ new Map(), 13539 styles: /* @__PURE__ */ new Map(), 13540 injectedStyles: /* @__PURE__ */ new WeakMap() 13541 }; 13542 if (typeof document !== "undefined") { 13543 registerDocument24(document); 13544 } 13545 return globalScope.__wpStyleRuntime; 13546 } 13547 function documentContainsStyleHash24(targetDocument, hash) { 13548 if (!targetDocument.head) { 13549 return false; 13550 } 13551 for (const style of targetDocument.head.querySelectorAll( 13552 `style[$STYLE_HASH_ATTRIBUTE24}]` 13553 )) { 13554 if (style.getAttribute(STYLE_HASH_ATTRIBUTE24) === hash) { 13555 return true; 13556 } 13557 } 13558 return false; 13559 } 13560 function injectStyle24(targetDocument, hash, css) { 13561 if (!targetDocument.head) { 13562 return; 13563 } 13564 const runtime = getRuntime24(); 13565 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13566 if (!injectedStyles) { 13567 injectedStyles = /* @__PURE__ */ new Set(); 13568 runtime.injectedStyles.set(targetDocument, injectedStyles); 13569 } 13570 if (injectedStyles.has(hash)) { 13571 return; 13572 } 13573 if (documentContainsStyleHash24(targetDocument, hash)) { 13574 injectedStyles.add(hash); 13575 return; 13576 } 13577 const style = targetDocument.createElement("style"); 13578 style.setAttribute(STYLE_HASH_ATTRIBUTE24, hash); 13579 style.appendChild(targetDocument.createTextNode(css)); 13580 targetDocument.head.appendChild(style); 13581 injectedStyles.add(hash); 13582 } 13583 function registerDocument24(targetDocument) { 13584 const runtime = getRuntime24(); 13585 runtime.documents.set( 13586 targetDocument, 13587 (runtime.documents.get(targetDocument) ?? 0) + 1 13588 ); 13589 for (const [hash, css] of runtime.styles) { 13590 injectStyle24(targetDocument, hash, css); 13591 } 13592 return () => { 13593 const count = runtime.documents.get(targetDocument); 13594 if (count === void 0) { 13595 return; 13596 } 13597 if (count <= 1) { 13598 runtime.documents.delete(targetDocument); 13599 return; 13600 } 13601 runtime.documents.set(targetDocument, count - 1); 13602 }; 13603 } 13604 function registerStyle24(hash, css) { 13605 const runtime = getRuntime24(); 13606 runtime.styles.set(hash, css); 13607 for (const targetDocument of runtime.documents.keys()) { 13608 injectStyle24(targetDocument, hash, css); 13609 } 13610 } 13611 if (typeof process === "undefined" || true) { 13612 registerStyle24("30e8b36272", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;isolation:isolate;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#936300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.b5397fb9d05389e3__title{--_gcd-heading-color:var(--wp-ui-notice-text-color);color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button,.d329e7416d368d31__action-link{mix-blend-mode:luminosity;@media (forced-colors:active){mix-blend-mode:normal}}}}"); 13613 } 13614 var style_default20 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "title": "b5397fb9d05389e3__title", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error" }; 13615 var ActionButton = (0, import_element46.forwardRef)( 13616 function NoticeActionButton({ className, loading, loadingAnnouncement, variant, ...props }, ref) { 13617 const loadingProps = loading !== void 0 ? { loading, loadingAnnouncement: loadingAnnouncement ?? "" } : {}; 13618 return /* @__PURE__ */ (0, import_jsx_runtime62.jsx)( 13619 Button6, 13620 { 13621 ...props, 13622 ...loadingProps, 13623 ref, 13624 size: "compact", 13625 tone: "neutral", 13626 variant, 13627 className: clsx_default( 13628 style_default20["action-button"], 13629 style_default20[`is-action-button-$variant}`], 13630 className 13631 ) 13632 } 13633 ); 13634 } 13635 ); 13636 13637 // packages/ui/build-module/notice/action-link.mjs 13638 var import_element47 = __toESM(require_element(), 1); 13639 var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1); 13640 var STYLE_HASH_ATTRIBUTE25 = "data-wp-hash"; 13641 function getRuntime25() { 13642 const globalScope = globalThis; 13643 if (globalScope.__wpStyleRuntime) { 13644 return globalScope.__wpStyleRuntime; 13645 } 13646 globalScope.__wpStyleRuntime = { 13647 documents: /* @__PURE__ */ new Map(), 13648 styles: /* @__PURE__ */ new Map(), 13649 injectedStyles: /* @__PURE__ */ new WeakMap() 13650 }; 13651 if (typeof document !== "undefined") { 13652 registerDocument25(document); 13653 } 13654 return globalScope.__wpStyleRuntime; 13655 } 13656 function documentContainsStyleHash25(targetDocument, hash) { 13657 if (!targetDocument.head) { 13658 return false; 13659 } 13660 for (const style of targetDocument.head.querySelectorAll( 13661 `style[$STYLE_HASH_ATTRIBUTE25}]` 13662 )) { 13663 if (style.getAttribute(STYLE_HASH_ATTRIBUTE25) === hash) { 13664 return true; 13665 } 13666 } 13667 return false; 13668 } 13669 function injectStyle25(targetDocument, hash, css) { 13670 if (!targetDocument.head) { 13671 return; 13672 } 13673 const runtime = getRuntime25(); 13674 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13675 if (!injectedStyles) { 13676 injectedStyles = /* @__PURE__ */ new Set(); 13677 runtime.injectedStyles.set(targetDocument, injectedStyles); 13678 } 13679 if (injectedStyles.has(hash)) { 13680 return; 13681 } 13682 if (documentContainsStyleHash25(targetDocument, hash)) { 13683 injectedStyles.add(hash); 13684 return; 13685 } 13686 const style = targetDocument.createElement("style"); 13687 style.setAttribute(STYLE_HASH_ATTRIBUTE25, hash); 13688 style.appendChild(targetDocument.createTextNode(css)); 13689 targetDocument.head.appendChild(style); 13690 injectedStyles.add(hash); 13691 } 13692 function registerDocument25(targetDocument) { 13693 const runtime = getRuntime25(); 13694 runtime.documents.set( 13695 targetDocument, 13696 (runtime.documents.get(targetDocument) ?? 0) + 1 13697 ); 13698 for (const [hash, css] of runtime.styles) { 13699 injectStyle25(targetDocument, hash, css); 13700 } 13701 return () => { 13702 const count = runtime.documents.get(targetDocument); 13703 if (count === void 0) { 13704 return; 13705 } 13706 if (count <= 1) { 13707 runtime.documents.delete(targetDocument); 13708 return; 13709 } 13710 runtime.documents.set(targetDocument, count - 1); 13711 }; 13712 } 13713 function registerStyle25(hash, css) { 13714 const runtime = getRuntime25(); 13715 runtime.styles.set(hash, css); 13716 for (const targetDocument of runtime.documents.keys()) { 13717 injectStyle25(targetDocument, hash, css); 13718 } 13719 } 13720 if (typeof process === "undefined" || true) { 13721 registerStyle25("30e8b36272", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._4145abab73d17514__notice{--icon-height:var(--wpds-dimension-size-sm,24px);--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;isolation:isolate;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-background-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#adc6e2);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-background-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#e1bd7c);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-warning-weak,#936300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-background-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#92d39d);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-background-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#e0afa7);--wp-ui-notice-text-color:var(--wpds-color-foreground-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-foreground-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer compositions{.b5397fb9d05389e3__title{--_gcd-heading-color:var(--wp-ui-notice-text-color);color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button,.d329e7416d368d31__action-link{mix-blend-mode:luminosity;@media (forced-colors:active){mix-blend-mode:normal}}}}"); 13722 } 13723 var style_default21 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "title": "b5397fb9d05389e3__title", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error" }; 13724 var ActionLink = (0, import_element47.forwardRef)( 13725 function NoticeActionLink({ className, render, ...props }, ref) { 13726 return /* @__PURE__ */ (0, import_jsx_runtime63.jsx)( 13727 Text, 13728 { 13729 ref, 13730 className: clsx_default(style_default21["action-link"], className), 13731 ...props, 13732 variant: "body-md", 13733 render: /* @__PURE__ */ (0, import_jsx_runtime63.jsx)(Link, { tone: "neutral", variant: "default", render }) 13734 } 13735 ); 13736 } 13737 ); 13738 13739 // packages/admin-ui/build-module/navigable-region/index.mjs 13740 var import_element48 = __toESM(require_element(), 1); 13741 var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1); 13742 var NavigableRegion = (0, import_element48.forwardRef)( 13743 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { 13744 return /* @__PURE__ */ (0, import_jsx_runtime64.jsx)( 13745 Tag, 13746 { 13747 ref, 13748 className: clsx_default("admin-ui-navigable-region", className), 13749 "aria-label": ariaLabel, 13750 role: "region", 13751 tabIndex: "-1", 13752 ...props, 13753 children 13754 } 13755 ); 13756 } 13757 ); 13758 NavigableRegion.displayName = "NavigableRegion"; 13759 var navigable_region_default = NavigableRegion; 13760 13761 // packages/admin-ui/build-module/admin-theme-colors/index.mjs 13762 var DEFAULT_THEME_COLORS = { 13763 primary: "#3858e9", 13764 background: "#222524" 13765 }; 13766 var ADMIN_THEME_COLORS = /* @__PURE__ */ new Map([ 13767 ["modern", DEFAULT_THEME_COLORS], 13768 ["fresh", { primary: "#007cba", background: "#25292b" }], 13769 ["midnight", { primary: "#cf4339", background: "#3d4042" }], 13770 ["coffee", { primary: "#916745", background: "#5b534d" }], 13771 ["ocean", { primary: "#567958", background: "#5f787f" }], 13772 ["blue", { primary: "#437aa8", background: "#3876a8" }], 13773 ["ectoplasm", { primary: "#646c3e", background: "#4f386e" }], 13774 ["sunrise", { primary: "#ad631e", background: "#cc4541" }], 13775 ["light", { primary: "#007cba", background: "#eaeeed" }] 13776 ]); 13777 function getAdminThemeColors() { 13778 const scheme = document.body.className.match(/admin-color-([\w-]+)/)?.[1] ?? "modern"; 13779 return ADMIN_THEME_COLORS.get(scheme) ?? DEFAULT_THEME_COLORS; 13780 } 13781 13782 // packages/interface/build-module/components/interface-skeleton/index.mjs 13783 var import_element49 = __toESM(require_element(), 1); 13784 var import_components5 = __toESM(require_components(), 1); 13785 var import_i18n7 = __toESM(require_i18n(), 1); 13786 var import_compose4 = __toESM(require_compose(), 1); 13787 var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1); 13788 var ANIMATION_DURATION2 = 0.25; 13789 var commonTransition = { 13790 type: "tween", 13791 duration: ANIMATION_DURATION2, 13792 ease: [0.6, 0, 0.4, 1] 13793 }; 13794 function useHTMLClass(className) { 13795 (0, import_element49.useEffect)(() => { 13796 const element = document && document.querySelector(`html:not(.$className})`); 13797 if (!element) { 13798 return; 13799 } 13800 element.classList.toggle(className); 13801 return () => { 13802 element.classList.toggle(className); 13803 }; 13804 }, [className]); 13805 } 13806 var headerVariants = { 13807 hidden: { opacity: 1, marginTop: -60 }, 13808 visible: { opacity: 1, marginTop: 0 }, 13809 distractionFreeHover: { 13810 opacity: 1, 13811 marginTop: 0, 13812 transition: { 13813 ...commonTransition, 13814 delay: 0.2, 13815 delayChildren: 0.2 13816 } 13817 }, 13818 distractionFreeHidden: { 13819 opacity: 0, 13820 marginTop: -60 13821 }, 13822 distractionFreeDisabled: { 13823 opacity: 0, 13824 marginTop: 0, 13825 transition: { 13826 ...commonTransition, 13827 delay: 0.8, 13828 delayChildren: 0.8 13829 } 13830 } 13831 }; 13832 function InterfaceSkeleton({ 13833 isDistractionFree, 13834 footer, 13835 header, 13836 editorNotices, 13837 sidebar, 13838 secondarySidebar, 13839 content, 13840 actions, 13841 labels, 13842 className 13843 }, ref) { 13844 const isMobileViewport = (0, import_compose4.useViewportMatch)("medium", "<"); 13845 const disableMotion = (0, import_compose4.useReducedMotion)(); 13846 const defaultTransition = { 13847 type: "tween", 13848 duration: disableMotion ? 0 : ANIMATION_DURATION2, 13849 ease: [0.6, 0, 0.4, 1] 13850 }; 13851 useHTMLClass("interface-interface-skeleton__html-container"); 13852 const defaultLabels = { 13853 /* translators: accessibility text for the top bar landmark region. */ 13854 header: (0, import_i18n7._x)("Header", "header landmark area"), 13855 /* translators: accessibility text for the content landmark region. */ 13856 body: (0, import_i18n7.__)("Content"), 13857 /* translators: accessibility text for the secondary sidebar landmark region. */ 13858 secondarySidebar: (0, import_i18n7.__)("Block Library"), 13859 /* translators: accessibility text for the settings landmark region. */ 13860 sidebar: (0, import_i18n7._x)("Settings", "settings landmark area"), 13861 /* translators: accessibility text for the publish landmark region. */ 13862 actions: (0, import_i18n7.__)("Publish"), 13863 /* translators: accessibility text for the footer landmark region. */ 13864 footer: (0, import_i18n7.__)("Footer") 13865 }; 13866 const mergedLabels = { ...defaultLabels, ...labels }; 13867 return /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)( 13868 "div", 13869 { 13870 ref, 13871 className: clsx_default( 13872 className, 13873 "interface-interface-skeleton", 13874 !!footer && "has-footer" 13875 ), 13876 children: [ 13877 /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "interface-interface-skeleton__editor", children: [ 13878 /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components5.__unstableAnimatePresence, { initial: false, children: !!header && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 13879 navigable_region_default, 13880 { 13881 as: import_components5.__unstableMotion.div, 13882 className: "interface-interface-skeleton__header", 13883 ariaLabel: mergedLabels.header, 13884 initial: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden", 13885 whileHover: isDistractionFree && !isMobileViewport ? "distractionFreeHover" : "visible", 13886 animate: isDistractionFree && !isMobileViewport ? "distractionFreeDisabled" : "visible", 13887 exit: isDistractionFree && !isMobileViewport ? "distractionFreeHidden" : "hidden", 13888 variants: headerVariants, 13889 transition: defaultTransition, 13890 children: header 13891 } 13892 ) }), 13893 isDistractionFree && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)("div", { className: "interface-interface-skeleton__header", children: editorNotices }), 13894 /* @__PURE__ */ (0, import_jsx_runtime65.jsxs)("div", { className: "interface-interface-skeleton__body", children: [ 13895 /* @__PURE__ */ (0, import_jsx_runtime65.jsx)(import_components5.__unstableAnimatePresence, { initial: false, children: !!secondarySidebar && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 13896 navigable_region_default, 13897 { 13898 className: "interface-interface-skeleton__secondary-sidebar", 13899 ariaLabel: mergedLabels.secondarySidebar, 13900 as: import_components5.__unstableMotion.div, 13901 initial: "closed", 13902 animate: "open", 13903 exit: "closed", 13904 variants: { 13905 open: { width: "auto" }, 13906 closed: { width: 0 } 13907 }, 13908 transition: defaultTransition, 13909 children: /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 13910 import_components5.__unstableMotion.div, 13911 { 13912 style: { 13913 width: isMobileViewport ? "100vw" : "max-content", 13914 height: "100%" 13915 }, 13916 variants: { 13917 open: { x: 0 }, 13918 closed: { x: "-100%" } 13919 }, 13920 transition: defaultTransition, 13921 children: secondarySidebar 13922 } 13923 ) 13924 } 13925 ) }), 13926 /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 13927 navigable_region_default, 13928 { 13929 className: "interface-interface-skeleton__content", 13930 ariaLabel: mergedLabels.body, 13931 children: content 13932 } 13933 ), 13934 !!sidebar && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 13935 navigable_region_default, 13936 { 13937 className: "interface-interface-skeleton__sidebar", 13938 ariaLabel: mergedLabels.sidebar, 13939 children: sidebar 13940 } 13941 ), 13942 !!actions && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 13943 navigable_region_default, 13944 { 13945 className: "interface-interface-skeleton__actions", 13946 ariaLabel: mergedLabels.actions, 13947 children: actions 13948 } 13949 ) 13950 ] }) 13951 ] }), 13952 !!footer && /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 13953 navigable_region_default, 13954 { 13955 className: "interface-interface-skeleton__footer", 13956 ariaLabel: mergedLabels.footer, 13957 children: footer 13958 } 13959 ) 13960 ] 13961 } 13962 ); 13963 } 13964 var interface_skeleton_default = (0, import_element49.forwardRef)(InterfaceSkeleton); 13965 13966 // packages/edit-widgets/build-module/store/actions.mjs 13967 var import_widgets2 = __toESM(require_widgets(), 1); 13968 var import_core_data = __toESM(require_core_data(), 1); 13969 var import_block_editor = __toESM(require_block_editor(), 1); 13970 13971 // packages/edit-widgets/build-module/store/transformers.mjs 13972 var import_blocks = __toESM(require_blocks(), 1); 13973 var import_widgets = __toESM(require_widgets(), 1); 13974 function transformWidgetToBlock(widget) { 13975 if (widget.id_base === "block") { 13976 const parsedBlocks = (0, import_blocks.parse)(widget.instance.raw.content, { 13977 __unstableSkipAutop: true 13978 }); 13979 if (!parsedBlocks.length) { 13980 return (0, import_widgets.addWidgetIdToBlock)( 13981 (0, import_blocks.createBlock)("core/paragraph", {}, []), 13982 widget.id 13983 ); 13984 } 13985 return (0, import_widgets.addWidgetIdToBlock)(parsedBlocks[0], widget.id); 13986 } 13987 let attributes; 13988 if (widget._embedded.about[0].is_multi) { 13989 attributes = { 13990 idBase: widget.id_base, 13991 instance: widget.instance 13992 }; 13993 } else { 13994 attributes = { 13995 id: widget.id 13996 }; 13997 } 13998 return (0, import_widgets.addWidgetIdToBlock)( 13999 (0, import_blocks.createBlock)("core/legacy-widget", attributes, []), 14000 widget.id 14001 ); 14002 } 14003 function transformBlockToWidget(block, relatedWidget = {}) { 14004 let widget; 14005 const isValidLegacyWidgetBlock = block.name === "core/legacy-widget" && (block.attributes.id || block.attributes.instance); 14006 if (isValidLegacyWidgetBlock) { 14007 widget = { 14008 ...relatedWidget, 14009 id: block.attributes.id ?? relatedWidget.id, 14010 id_base: block.attributes.idBase ?? relatedWidget.id_base, 14011 instance: block.attributes.instance ?? relatedWidget.instance 14012 }; 14013 } else { 14014 widget = { 14015 ...relatedWidget, 14016 id_base: "block", 14017 instance: { 14018 raw: { 14019 content: (0, import_blocks.serialize)(block) 14020 } 14021 } 14022 }; 14023 } 14024 delete widget.rendered; 14025 delete widget.rendered_form; 14026 return widget; 14027 } 14028 14029 // packages/edit-widgets/build-module/store/utils.mjs 14030 var KIND = "root"; 14031 var WIDGET_AREA_ENTITY_TYPE = "sidebar"; 14032 var POST_TYPE = "postType"; 14033 var buildWidgetAreaPostId = (widgetAreaId) => `widget-area-$widgetAreaId}`; 14034 var buildWidgetAreasPostId = () => `widget-areas`; 14035 function buildWidgetAreasQuery() { 14036 return { 14037 per_page: -1 14038 }; 14039 } 14040 function buildWidgetsQuery() { 14041 return { 14042 per_page: -1, 14043 _embed: "about" 14044 }; 14045 } 14046 var createStubPost = (id, blocks) => ({ 14047 id, 14048 slug: id, 14049 status: "draft", 14050 type: "page", 14051 blocks, 14052 meta: { 14053 widgetAreaId: id 14054 } 14055 }); 14056 14057 // packages/edit-widgets/build-module/store/constants.mjs 14058 var STORE_NAME2 = "core/edit-widgets"; 14059 14060 // packages/edit-widgets/build-module/store/actions.mjs 14061 var persistStubPost = (id, blocks) => ({ registry }) => { 14062 const stubPost = createStubPost(id, blocks); 14063 registry.dispatch(import_core_data.store).receiveEntityRecords( 14064 KIND, 14065 POST_TYPE, 14066 stubPost, 14067 { id: stubPost.id }, 14068 false 14069 ); 14070 return stubPost; 14071 }; 14072 var saveEditedWidgetAreas = () => async ({ select, dispatch: dispatch2, registry }) => { 14073 const editedWidgetAreas = select.getEditedWidgetAreas(); 14074 if (!editedWidgetAreas?.length) { 14075 return; 14076 } 14077 try { 14078 await dispatch2.saveWidgetAreas(editedWidgetAreas); 14079 registry.dispatch(import_notices.store).createSuccessNotice((0, import_i18n8.__)("Widgets saved."), { 14080 type: "snackbar" 14081 }); 14082 } catch (e) { 14083 registry.dispatch(import_notices.store).createErrorNotice( 14084 /* translators: %s: The error message. */ 14085 (0, import_i18n8.sprintf)((0, import_i18n8.__)("There was an error. %s"), e.message), 14086 { 14087 type: "snackbar" 14088 } 14089 ); 14090 } 14091 }; 14092 var saveWidgetAreas = (widgetAreas) => async ({ dispatch: dispatch2, registry }) => { 14093 try { 14094 for (const widgetArea of widgetAreas) { 14095 await dispatch2.saveWidgetArea(widgetArea.id); 14096 } 14097 } finally { 14098 await registry.dispatch(import_core_data.store).finishResolution( 14099 "getEntityRecord", 14100 KIND, 14101 WIDGET_AREA_ENTITY_TYPE, 14102 buildWidgetAreasQuery() 14103 ); 14104 } 14105 }; 14106 var saveWidgetArea = (widgetAreaId) => async ({ dispatch: dispatch2, select, registry }) => { 14107 const widgets = select.getWidgets(); 14108 const post = registry.select(import_core_data.store).getEditedEntityRecord( 14109 KIND, 14110 POST_TYPE, 14111 buildWidgetAreaPostId(widgetAreaId) 14112 ); 14113 const areaWidgets = Object.values(widgets).filter( 14114 ({ sidebar }) => sidebar === widgetAreaId 14115 ); 14116 const usedReferenceWidgets = []; 14117 const widgetsBlocks = post.blocks.filter((block) => { 14118 const { id } = block.attributes; 14119 if (block.name === "core/legacy-widget" && id) { 14120 if (usedReferenceWidgets.includes(id)) { 14121 return false; 14122 } 14123 usedReferenceWidgets.push(id); 14124 } 14125 return true; 14126 }); 14127 const deletedWidgets = []; 14128 for (const widget of areaWidgets) { 14129 const widgetsNewArea = select.getWidgetAreaForWidgetId(widget.id); 14130 if (!widgetsNewArea) { 14131 deletedWidgets.push(widget); 14132 } 14133 } 14134 const batchMeta = []; 14135 const batchTasks = []; 14136 const sidebarWidgetsIds = []; 14137 for (let i = 0; i < widgetsBlocks.length; i++) { 14138 const block = widgetsBlocks[i]; 14139 const widgetId = (0, import_widgets2.getWidgetIdFromBlock)(block); 14140 const oldWidget = widgets[widgetId]; 14141 const widget = transformBlockToWidget(block, oldWidget); 14142 sidebarWidgetsIds.push(widgetId); 14143 if (oldWidget) { 14144 registry.dispatch(import_core_data.store).editEntityRecord( 14145 "root", 14146 "widget", 14147 widgetId, 14148 { 14149 ...widget, 14150 sidebar: widgetAreaId 14151 }, 14152 { undoIgnore: true } 14153 ); 14154 const hasEdits = registry.select(import_core_data.store).hasEditsForEntityRecord("root", "widget", widgetId); 14155 if (!hasEdits) { 14156 continue; 14157 } 14158 batchTasks.push( 14159 ({ saveEditedEntityRecord }) => saveEditedEntityRecord("root", "widget", widgetId) 14160 ); 14161 } else { 14162 batchTasks.push( 14163 ({ saveEntityRecord }) => saveEntityRecord("root", "widget", { 14164 ...widget, 14165 sidebar: widgetAreaId 14166 }) 14167 ); 14168 } 14169 batchMeta.push({ 14170 block, 14171 position: i, 14172 clientId: block.clientId 14173 }); 14174 } 14175 for (const widget of deletedWidgets) { 14176 batchTasks.push( 14177 ({ deleteEntityRecord }) => deleteEntityRecord("root", "widget", widget.id, { 14178 force: true 14179 }) 14180 ); 14181 } 14182 const records = await registry.dispatch(import_core_data.store).__experimentalBatch(batchTasks); 14183 const preservedRecords = records.filter( 14184 (record) => !record.hasOwnProperty("deleted") 14185 ); 14186 const failedWidgetNames = []; 14187 for (let i = 0; i < preservedRecords.length; i++) { 14188 const widget = preservedRecords[i]; 14189 const { block, position } = batchMeta[i]; 14190 post.blocks[position].attributes.__internalWidgetId = widget.id; 14191 const error2 = registry.select(import_core_data.store).getLastEntitySaveError("root", "widget", widget.id); 14192 if (error2) { 14193 failedWidgetNames.push(block.attributes?.name || block?.name); 14194 } 14195 if (!sidebarWidgetsIds[position]) { 14196 sidebarWidgetsIds[position] = widget.id; 14197 } 14198 } 14199 if (failedWidgetNames.length) { 14200 throw new Error( 14201 (0, import_i18n8.sprintf)( 14202 /* translators: %s: List of widget names */ 14203 (0, import_i18n8.__)("Could not save the following widgets: %s."), 14204 failedWidgetNames.join(", ") 14205 ) 14206 ); 14207 } 14208 registry.dispatch(import_core_data.store).editEntityRecord( 14209 KIND, 14210 WIDGET_AREA_ENTITY_TYPE, 14211 widgetAreaId, 14212 { 14213 widgets: sidebarWidgetsIds 14214 }, 14215 { undoIgnore: true } 14216 ); 14217 dispatch2(trySaveWidgetArea(widgetAreaId)); 14218 registry.dispatch(import_core_data.store).receiveEntityRecords(KIND, POST_TYPE, post, void 0); 14219 }; 14220 var trySaveWidgetArea = (widgetAreaId) => ({ registry }) => { 14221 registry.dispatch(import_core_data.store).saveEditedEntityRecord( 14222 KIND, 14223 WIDGET_AREA_ENTITY_TYPE, 14224 widgetAreaId, 14225 { 14226 throwOnError: true 14227 } 14228 ); 14229 }; 14230 function setWidgetIdForClientId(clientId, widgetId) { 14231 return { 14232 type: "SET_WIDGET_ID_FOR_CLIENT_ID", 14233 clientId, 14234 widgetId 14235 }; 14236 } 14237 function setWidgetAreasOpenState(widgetAreasOpenState2) { 14238 return { 14239 type: "SET_WIDGET_AREAS_OPEN_STATE", 14240 widgetAreasOpenState: widgetAreasOpenState2 14241 }; 14242 } 14243 function setIsWidgetAreaOpen(clientId, isOpen) { 14244 return { 14245 type: "SET_IS_WIDGET_AREA_OPEN", 14246 clientId, 14247 isOpen 14248 }; 14249 } 14250 function setIsInserterOpened(value) { 14251 return { 14252 type: "SET_IS_INSERTER_OPENED", 14253 value 14254 }; 14255 } 14256 function setIsListViewOpened(isOpen) { 14257 return { 14258 type: "SET_IS_LIST_VIEW_OPENED", 14259 isOpen 14260 }; 14261 } 14262 var closeGeneralSidebar = () => ({ registry }) => { 14263 registry.dispatch(store).disableComplementaryArea(STORE_NAME2); 14264 }; 14265 var moveBlockToWidgetArea = (clientId, widgetAreaId) => async ({ dispatch: dispatch2, select, registry }) => { 14266 const sourceRootClientId = registry.select(import_block_editor.store).getBlockRootClientId(clientId); 14267 const widgetAreas = registry.select(import_block_editor.store).getBlocks(); 14268 const destinationWidgetAreaBlock = widgetAreas.find( 14269 ({ attributes }) => attributes.id === widgetAreaId 14270 ); 14271 const destinationRootClientId = destinationWidgetAreaBlock.clientId; 14272 const destinationInnerBlocksClientIds = registry.select(import_block_editor.store).getBlockOrder(destinationRootClientId); 14273 const destinationIndex = destinationInnerBlocksClientIds.length; 14274 const isDestinationWidgetAreaOpen = select.getIsWidgetAreaOpen( 14275 destinationRootClientId 14276 ); 14277 if (!isDestinationWidgetAreaOpen) { 14278 dispatch2.setIsWidgetAreaOpen(destinationRootClientId, true); 14279 } 14280 registry.dispatch(import_block_editor.store).moveBlocksToPosition( 14281 [clientId], 14282 sourceRootClientId, 14283 destinationRootClientId, 14284 destinationIndex 14285 ); 14286 }; 14287 function unlockWidgetSaving(lockName) { 14288 return { 14289 type: "UNLOCK_WIDGET_SAVING", 14290 lockName 14291 }; 14292 } 14293 function lockWidgetSaving(lockName) { 14294 return { 14295 type: "LOCK_WIDGET_SAVING", 14296 lockName 14297 }; 14298 } 14299 14300 // packages/edit-widgets/build-module/store/resolvers.mjs 14301 var getWidgetAreas = () => async ({ dispatch: dispatch2, registry }) => { 14302 const query = buildWidgetAreasQuery(); 14303 const widgetAreas = await registry.resolveSelect(import_core_data2.store).getEntityRecords(KIND, WIDGET_AREA_ENTITY_TYPE, query); 14304 const widgetAreaBlocks = []; 14305 const sortedWidgetAreas = widgetAreas.sort((a, b) => { 14306 if (a.id === "wp_inactive_widgets") { 14307 return 1; 14308 } 14309 if (b.id === "wp_inactive_widgets") { 14310 return -1; 14311 } 14312 return 0; 14313 }); 14314 for (const widgetArea of sortedWidgetAreas) { 14315 widgetAreaBlocks.push( 14316 (0, import_blocks2.createBlock)("core/widget-area", { 14317 id: widgetArea.id, 14318 name: widgetArea.name 14319 }) 14320 ); 14321 if (!widgetArea.widgets.length) { 14322 dispatch2( 14323 persistStubPost( 14324 buildWidgetAreaPostId(widgetArea.id), 14325 [] 14326 ) 14327 ); 14328 } 14329 } 14330 const widgetAreasOpenState2 = {}; 14331 widgetAreaBlocks.forEach((widgetAreaBlock, index2) => { 14332 widgetAreasOpenState2[widgetAreaBlock.clientId] = index2 === 0; 14333 }); 14334 dispatch2(setWidgetAreasOpenState(widgetAreasOpenState2)); 14335 dispatch2( 14336 persistStubPost(buildWidgetAreasPostId(), widgetAreaBlocks) 14337 ); 14338 }; 14339 var getWidgets = () => async ({ dispatch: dispatch2, registry }) => { 14340 const query = buildWidgetsQuery(); 14341 const widgets = await registry.resolveSelect(import_core_data2.store).getEntityRecords("root", "widget", query); 14342 const groupedBySidebar = {}; 14343 for (const widget of widgets) { 14344 const block = transformWidgetToBlock(widget); 14345 groupedBySidebar[widget.sidebar] = groupedBySidebar[widget.sidebar] || []; 14346 groupedBySidebar[widget.sidebar].push(block); 14347 } 14348 for (const sidebarId in groupedBySidebar) { 14349 if (groupedBySidebar.hasOwnProperty(sidebarId)) { 14350 dispatch2( 14351 persistStubPost( 14352 buildWidgetAreaPostId(sidebarId), 14353 groupedBySidebar[sidebarId] 14354 ) 14355 ); 14356 } 14357 } 14358 }; 14359 14360 // packages/edit-widgets/build-module/store/selectors.mjs 14361 var selectors_exports2 = {}; 14362 __export(selectors_exports2, { 14363 __experimentalGetInsertionPoint: () => __experimentalGetInsertionPoint, 14364 canInsertBlockInWidgetArea: () => canInsertBlockInWidgetArea, 14365 getEditedWidgetAreas: () => getEditedWidgetAreas, 14366 getIsWidgetAreaOpen: () => getIsWidgetAreaOpen, 14367 getParentWidgetAreaBlock: () => getParentWidgetAreaBlock, 14368 getReferenceWidgetBlocks: () => getReferenceWidgetBlocks, 14369 getWidget: () => getWidget, 14370 getWidgetAreaForWidgetId: () => getWidgetAreaForWidgetId, 14371 getWidgetAreas: () => getWidgetAreas2, 14372 getWidgets: () => getWidgets2, 14373 isInserterOpened: () => isInserterOpened, 14374 isListViewOpened: () => isListViewOpened, 14375 isSavingWidgetAreas: () => isSavingWidgetAreas, 14376 isWidgetSavingLocked: () => isWidgetSavingLocked 14377 }); 14378 var import_data7 = __toESM(require_data(), 1); 14379 var import_widgets3 = __toESM(require_widgets(), 1); 14380 var import_core_data3 = __toESM(require_core_data(), 1); 14381 var import_block_editor2 = __toESM(require_block_editor(), 1); 14382 var EMPTY_INSERTION_POINT = { 14383 rootClientId: void 0, 14384 insertionIndex: void 0 14385 }; 14386 var getWidgets2 = (0, import_data7.createRegistrySelector)( 14387 (select) => (0, import_data7.createSelector)( 14388 () => { 14389 const widgets = select(import_core_data3.store).getEntityRecords( 14390 "root", 14391 "widget", 14392 buildWidgetsQuery() 14393 ); 14394 return ( 14395 // Key widgets by their ID. 14396 widgets?.reduce( 14397 (allWidgets, widget) => ({ 14398 ...allWidgets, 14399 [widget.id]: widget 14400 }), 14401 {} 14402 ) ?? {} 14403 ); 14404 }, 14405 () => [ 14406 select(import_core_data3.store).getEntityRecords( 14407 "root", 14408 "widget", 14409 buildWidgetsQuery() 14410 ) 14411 ] 14412 ) 14413 ); 14414 var getWidget = (0, import_data7.createRegistrySelector)( 14415 (select) => (state, id) => { 14416 const widgets = select(STORE_NAME2).getWidgets(); 14417 return widgets[id]; 14418 } 14419 ); 14420 var getWidgetAreas2 = (0, import_data7.createRegistrySelector)((select) => () => { 14421 const query = buildWidgetAreasQuery(); 14422 return select(import_core_data3.store).getEntityRecords( 14423 KIND, 14424 WIDGET_AREA_ENTITY_TYPE, 14425 query 14426 ); 14427 }); 14428 var getWidgetAreaForWidgetId = (0, import_data7.createRegistrySelector)( 14429 (select) => (state, widgetId) => { 14430 const widgetAreas = select(STORE_NAME2).getWidgetAreas(); 14431 return widgetAreas.find((widgetArea) => { 14432 const post = select(import_core_data3.store).getEditedEntityRecord( 14433 KIND, 14434 POST_TYPE, 14435 buildWidgetAreaPostId(widgetArea.id) 14436 ); 14437 const blockWidgetIds = post.blocks.map( 14438 (block) => (0, import_widgets3.getWidgetIdFromBlock)(block) 14439 ); 14440 return blockWidgetIds.includes(widgetId); 14441 }); 14442 } 14443 ); 14444 var getParentWidgetAreaBlock = (0, import_data7.createRegistrySelector)( 14445 (select) => (state, clientId) => { 14446 const { getBlock, getBlockName, getBlockParents } = select(import_block_editor2.store); 14447 const blockParents = getBlockParents(clientId); 14448 const widgetAreaClientId = blockParents.find( 14449 (parentClientId) => getBlockName(parentClientId) === "core/widget-area" 14450 ); 14451 return getBlock(widgetAreaClientId); 14452 } 14453 ); 14454 var getEditedWidgetAreas = (0, import_data7.createRegistrySelector)( 14455 (select) => (state, ids) => { 14456 let widgetAreas = select(STORE_NAME2).getWidgetAreas(); 14457 if (!widgetAreas) { 14458 return []; 14459 } 14460 if (ids) { 14461 widgetAreas = widgetAreas.filter( 14462 ({ id }) => ids.includes(id) 14463 ); 14464 } 14465 return widgetAreas.filter( 14466 ({ id }) => select(import_core_data3.store).hasEditsForEntityRecord( 14467 KIND, 14468 POST_TYPE, 14469 buildWidgetAreaPostId(id) 14470 ) 14471 ).map( 14472 ({ id }) => select(import_core_data3.store).getEditedEntityRecord( 14473 KIND, 14474 WIDGET_AREA_ENTITY_TYPE, 14475 id 14476 ) 14477 ); 14478 } 14479 ); 14480 var getReferenceWidgetBlocks = (0, import_data7.createRegistrySelector)( 14481 (select) => (state, referenceWidgetName = null) => { 14482 const results = []; 14483 const widgetAreas = select(STORE_NAME2).getWidgetAreas(); 14484 for (const _widgetArea of widgetAreas) { 14485 const post = select(import_core_data3.store).getEditedEntityRecord( 14486 KIND, 14487 POST_TYPE, 14488 buildWidgetAreaPostId(_widgetArea.id) 14489 ); 14490 for (const block of post.blocks) { 14491 if (block.name === "core/legacy-widget" && (!referenceWidgetName || block.attributes?.referenceWidgetName === referenceWidgetName)) { 14492 results.push(block); 14493 } 14494 } 14495 } 14496 return results; 14497 } 14498 ); 14499 var isSavingWidgetAreas = (0, import_data7.createRegistrySelector)((select) => () => { 14500 const widgetAreasIds = select(STORE_NAME2).getWidgetAreas()?.map(({ id }) => id); 14501 if (!widgetAreasIds) { 14502 return false; 14503 } 14504 for (const id of widgetAreasIds) { 14505 const isSaving = select(import_core_data3.store).isSavingEntityRecord( 14506 KIND, 14507 WIDGET_AREA_ENTITY_TYPE, 14508 id 14509 ); 14510 if (isSaving) { 14511 return true; 14512 } 14513 } 14514 const widgetIds = [ 14515 ...Object.keys(select(STORE_NAME2).getWidgets()), 14516 void 0 14517 // account for new widgets without an ID 14518 ]; 14519 for (const id of widgetIds) { 14520 const isSaving = select(import_core_data3.store).isSavingEntityRecord( 14521 "root", 14522 "widget", 14523 id 14524 ); 14525 if (isSaving) { 14526 return true; 14527 } 14528 } 14529 return false; 14530 }); 14531 var getIsWidgetAreaOpen = (state, clientId) => { 14532 const { widgetAreasOpenState: widgetAreasOpenState2 } = state; 14533 return !!widgetAreasOpenState2[clientId]; 14534 }; 14535 function isInserterOpened(state) { 14536 return !!state.blockInserterPanel; 14537 } 14538 function __experimentalGetInsertionPoint(state) { 14539 if (typeof state.blockInserterPanel === "boolean") { 14540 return EMPTY_INSERTION_POINT; 14541 } 14542 return state.blockInserterPanel; 14543 } 14544 var canInsertBlockInWidgetArea = (0, import_data7.createRegistrySelector)( 14545 (select) => (state, blockName) => { 14546 const widgetAreas = select(import_block_editor2.store).getBlocks(); 14547 const [firstWidgetArea] = widgetAreas; 14548 if (!firstWidgetArea) { 14549 return false; 14550 } 14551 return select(import_block_editor2.store).canInsertBlockType( 14552 blockName, 14553 firstWidgetArea.clientId 14554 ); 14555 } 14556 ); 14557 function isListViewOpened(state) { 14558 return state.listViewPanel; 14559 } 14560 function isWidgetSavingLocked(state) { 14561 return Object.keys(state.widgetSavingLock).length > 0; 14562 } 14563 14564 // packages/edit-widgets/build-module/store/private-selectors.mjs 14565 var private_selectors_exports = {}; 14566 __export(private_selectors_exports, { 14567 getInserterSidebarToggleRef: () => getInserterSidebarToggleRef, 14568 getListViewToggleRef: () => getListViewToggleRef 14569 }); 14570 function getListViewToggleRef(state) { 14571 return state.listViewToggleRef; 14572 } 14573 function getInserterSidebarToggleRef(state) { 14574 return state.inserterSidebarToggleRef; 14575 } 14576 14577 // packages/edit-widgets/build-module/lock-unlock.mjs 14578 var import_private_apis2 = __toESM(require_private_apis(), 1); 14579 var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 14580 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 14581 "@wordpress/edit-widgets" 14582 ); 14583 14584 // packages/edit-widgets/build-module/store/index.mjs 14585 var storeConfig = { 14586 reducer: reducer_default, 14587 selectors: selectors_exports2, 14588 resolvers: resolvers_exports, 14589 actions: actions_exports2 14590 }; 14591 var store2 = (0, import_data8.createReduxStore)(STORE_NAME2, storeConfig); 14592 (0, import_data8.register)(store2); 14593 import_api_fetch.default.use(function(options, next) { 14594 if (options.path?.indexOf("/wp/v2/types/widget-area") === 0) { 14595 return Promise.resolve({}); 14596 } 14597 return next(options); 14598 }); 14599 unlock2(store2).registerPrivateSelectors(private_selectors_exports); 14600 14601 // packages/edit-widgets/build-module/filters/move-to-widget-area.mjs 14602 var import_block_editor3 = __toESM(require_block_editor(), 1); 14603 var import_compose5 = __toESM(require_compose(), 1); 14604 var import_data9 = __toESM(require_data(), 1); 14605 var import_hooks = __toESM(require_hooks(), 1); 14606 var import_widgets4 = __toESM(require_widgets(), 1); 14607 var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1); 14608 var withMoveToWidgetAreaToolbarItem = (0, import_compose5.createHigherOrderComponent)( 14609 (BlockEdit) => (props) => { 14610 const { clientId, name: blockName } = props; 14611 const { widgetAreas, currentWidgetAreaId, canInsertBlockInWidgetArea: canInsertBlockInWidgetArea2 } = (0, import_data9.useSelect)( 14612 (select) => { 14613 if (blockName === "core/widget-area") { 14614 return {}; 14615 } 14616 const selectors3 = select(store2); 14617 const widgetAreaBlock = selectors3.getParentWidgetAreaBlock(clientId); 14618 return { 14619 widgetAreas: selectors3.getWidgetAreas(), 14620 currentWidgetAreaId: widgetAreaBlock?.attributes?.id, 14621 canInsertBlockInWidgetArea: selectors3.canInsertBlockInWidgetArea(blockName) 14622 }; 14623 }, 14624 [clientId, blockName] 14625 ); 14626 const { moveBlockToWidgetArea: moveBlockToWidgetArea2 } = (0, import_data9.useDispatch)(store2); 14627 const hasMultipleWidgetAreas = widgetAreas?.length > 1; 14628 const isMoveToWidgetAreaVisible = blockName !== "core/widget-area" && hasMultipleWidgetAreas && canInsertBlockInWidgetArea2; 14629 return /* @__PURE__ */ (0, import_jsx_runtime66.jsxs)(import_jsx_runtime66.Fragment, { children: [ 14630 /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(BlockEdit, { ...props }, "edit"), 14631 isMoveToWidgetAreaVisible && /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(import_block_editor3.BlockControls, { children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)( 14632 import_widgets4.MoveToWidgetArea, 14633 { 14634 widgetAreas, 14635 currentWidgetAreaId, 14636 onSelect: (widgetAreaId) => { 14637 moveBlockToWidgetArea2( 14638 props.clientId, 14639 widgetAreaId 14640 ); 14641 } 14642 } 14643 ) }) 14644 ] }); 14645 }, 14646 "withMoveToWidgetAreaToolbarItem" 14647 ); 14648 (0, import_hooks.addFilter)( 14649 "editor.BlockEdit", 14650 "core/edit-widgets/block-edit", 14651 withMoveToWidgetAreaToolbarItem 14652 ); 14653 14654 // packages/edit-widgets/build-module/filters/replace-media-upload.mjs 14655 var import_hooks2 = __toESM(require_hooks(), 1); 14656 var import_media_utils = __toESM(require_media_utils(), 1); 14657 var replaceMediaUpload = () => import_media_utils.MediaUpload; 14658 (0, import_hooks2.addFilter)( 14659 "editor.MediaUpload", 14660 "core/edit-widgets/replace-media-upload", 14661 replaceMediaUpload 14662 ); 14663 14664 // packages/edit-widgets/build-module/blocks/widget-area/index.mjs 14665 var widget_area_exports = {}; 14666 __export(widget_area_exports, { 14667 metadata: () => block_default, 14668 name: () => name, 14669 settings: () => settings 14670 }); 14671 var import_i18n9 = __toESM(require_i18n(), 1); 14672 14673 // packages/edit-widgets/build-module/blocks/widget-area/block.json 14674 var block_default = { 14675 $schema: "https://schemas.wp.org/trunk/block.json", 14676 apiVersion: 3, 14677 name: "core/widget-area", 14678 title: "Widget Area", 14679 category: "widgets", 14680 attributes: { 14681 id: { 14682 type: "string" 14683 }, 14684 name: { 14685 type: "string" 14686 } 14687 }, 14688 supports: { 14689 html: false, 14690 inserter: false, 14691 customClassName: false, 14692 reusable: false, 14693 renaming: false, 14694 visibility: false, 14695 __experimentalToolbar: false, 14696 __experimentalParentSelector: false, 14697 __experimentalDisableBlockOverlay: true 14698 }, 14699 editorStyle: "wp-block-widget-area-editor", 14700 style: "wp-block-widget-area" 14701 }; 14702 14703 // packages/edit-widgets/build-module/blocks/widget-area/edit/index.mjs 14704 var import_element52 = __toESM(require_element(), 1); 14705 var import_data10 = __toESM(require_data(), 1); 14706 var import_core_data5 = __toESM(require_core_data(), 1); 14707 var import_components6 = __toESM(require_components(), 1); 14708 var import_block_editor5 = __toESM(require_block_editor(), 1); 14709 14710 // packages/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.mjs 14711 var import_core_data4 = __toESM(require_core_data(), 1); 14712 var import_block_editor4 = __toESM(require_block_editor(), 1); 14713 var import_element51 = __toESM(require_element(), 1); 14714 14715 // packages/edit-widgets/build-module/blocks/widget-area/edit/use-is-dragging-within.mjs 14716 var import_element50 = __toESM(require_element(), 1); 14717 var useIsDraggingWithin = (elementRef) => { 14718 const [isDraggingWithin, setIsDraggingWithin] = (0, import_element50.useState)(false); 14719 (0, import_element50.useEffect)(() => { 14720 const { ownerDocument: ownerDocument2 } = elementRef.current; 14721 function handleDragStart(event) { 14722 handleDragEnter(event); 14723 } 14724 function handleDragEnd() { 14725 setIsDraggingWithin(false); 14726 } 14727 function handleDragEnter(event) { 14728 if (elementRef.current.contains(event.target)) { 14729 setIsDraggingWithin(true); 14730 } else { 14731 setIsDraggingWithin(false); 14732 } 14733 } 14734 ownerDocument2.addEventListener("dragstart", handleDragStart); 14735 ownerDocument2.addEventListener("dragend", handleDragEnd); 14736 ownerDocument2.addEventListener("dragenter", handleDragEnter); 14737 return () => { 14738 ownerDocument2.removeEventListener("dragstart", handleDragStart); 14739 ownerDocument2.removeEventListener("dragend", handleDragEnd); 14740 ownerDocument2.removeEventListener("dragenter", handleDragEnter); 14741 }; 14742 }, []); 14743 return isDraggingWithin; 14744 }; 14745 var use_is_dragging_within_default = useIsDraggingWithin; 14746 14747 // packages/edit-widgets/build-module/blocks/widget-area/edit/inner-blocks.mjs 14748 var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1); 14749 function WidgetAreaInnerBlocks({ id }) { 14750 const [blocks, onInput, onChange] = (0, import_core_data4.useEntityBlockEditor)( 14751 "root", 14752 "postType" 14753 ); 14754 const innerBlocksRef = (0, import_element51.useRef)(); 14755 const isDraggingWithinInnerBlocks = use_is_dragging_within_default(innerBlocksRef); 14756 const shouldHighlightDropZone = isDraggingWithinInnerBlocks; 14757 const innerBlocksProps = (0, import_block_editor4.useInnerBlocksProps)( 14758 { ref: innerBlocksRef }, 14759 { 14760 value: blocks, 14761 onInput, 14762 onChange, 14763 templateLock: false, 14764 renderAppender: import_block_editor4.InnerBlocks.ButtonBlockAppender 14765 } 14766 ); 14767 return /* @__PURE__ */ (0, import_jsx_runtime67.jsx)( 14768 "div", 14769 { 14770 "data-widget-area-id": id, 14771 className: clsx_default( 14772 "wp-block-widget-area__inner-blocks block-editor-inner-blocks editor-styles-wrapper", 14773 { 14774 "wp-block-widget-area__highlight-drop-zone": shouldHighlightDropZone 14775 } 14776 ), 14777 children: /* @__PURE__ */ (0, import_jsx_runtime67.jsx)("div", { ...innerBlocksProps }) 14778 } 14779 ); 14780 } 14781 14782 // packages/edit-widgets/build-module/blocks/widget-area/edit/index.mjs 14783 var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1); 14784 function WidgetAreaEdit({ 14785 clientId, 14786 attributes: { id, name: name2 } 14787 }) { 14788 const isOpen = (0, import_data10.useSelect)( 14789 (select) => select(store2).getIsWidgetAreaOpen(clientId), 14790 [clientId] 14791 ); 14792 const { setIsWidgetAreaOpen: setIsWidgetAreaOpen2 } = (0, import_data10.useDispatch)(store2); 14793 const wrapper = (0, import_element52.useRef)(); 14794 const setOpen = (0, import_element52.useCallback)( 14795 (openState) => setIsWidgetAreaOpen2(clientId, openState), 14796 [clientId] 14797 ); 14798 const isDragging = useIsDragging(wrapper); 14799 const isDraggingWithin = use_is_dragging_within_default(wrapper); 14800 const [openedWhileDragging, setOpenedWhileDragging] = (0, import_element52.useState)(false); 14801 (0, import_element52.useEffect)(() => { 14802 if (!isDragging) { 14803 setOpenedWhileDragging(false); 14804 return; 14805 } 14806 if (isDraggingWithin && !isOpen) { 14807 setOpen(true); 14808 setOpenedWhileDragging(true); 14809 } else if (!isDraggingWithin && isOpen && openedWhileDragging) { 14810 setOpen(false); 14811 } 14812 }, [isOpen, isDragging, isDraggingWithin, openedWhileDragging]); 14813 const blockProps = (0, import_block_editor5.useBlockProps)(); 14814 return /* @__PURE__ */ (0, import_jsx_runtime68.jsx)("div", { ...blockProps, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(import_components6.Panel, { ref: wrapper, children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 14815 import_components6.PanelBody, 14816 { 14817 title: name2, 14818 opened: isOpen, 14819 onToggle: () => { 14820 setIsWidgetAreaOpen2(clientId, !isOpen); 14821 }, 14822 scrollAfterOpen: !isDragging, 14823 children: ({ opened }) => ( 14824 // This is required to ensure LegacyWidget blocks are not 14825 // unmounted when the panel is collapsed. Unmounting legacy 14826 // widgets may have unintended consequences (e.g. TinyMCE 14827 // not being properly reinitialized) 14828 /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 14829 import_components6.__unstableDisclosureContent, 14830 { 14831 className: "wp-block-widget-area__panel-body-content", 14832 visible: opened, 14833 children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)( 14834 import_core_data5.EntityProvider, 14835 { 14836 kind: "root", 14837 type: "postType", 14838 id: `widget-area-$id}`, 14839 children: /* @__PURE__ */ (0, import_jsx_runtime68.jsx)(WidgetAreaInnerBlocks, { id }) 14840 } 14841 ) 14842 } 14843 ) 14844 ) 14845 } 14846 ) }) }); 14847 } 14848 var useIsDragging = (elementRef) => { 14849 const [isDragging, setIsDragging] = (0, import_element52.useState)(false); 14850 (0, import_element52.useEffect)(() => { 14851 const { ownerDocument: ownerDocument2 } = elementRef.current; 14852 function handleDragStart() { 14853 setIsDragging(true); 14854 } 14855 function handleDragEnd() { 14856 setIsDragging(false); 14857 } 14858 ownerDocument2.addEventListener("dragstart", handleDragStart); 14859 ownerDocument2.addEventListener("dragend", handleDragEnd); 14860 return () => { 14861 ownerDocument2.removeEventListener("dragstart", handleDragStart); 14862 ownerDocument2.removeEventListener("dragend", handleDragEnd); 14863 }; 14864 }, []); 14865 return isDragging; 14866 }; 14867 14868 // packages/edit-widgets/build-module/blocks/widget-area/index.mjs 14869 var { name } = block_default; 14870 var settings = { 14871 title: (0, import_i18n9.__)("Widget Area"), 14872 description: (0, import_i18n9.__)("A widget area container."), 14873 __experimentalLabel: ({ name: label }) => label, 14874 icon: layout_default, 14875 edit: WidgetAreaEdit 14876 }; 14877 14878 // packages/edit-widgets/build-module/components/layout/index.mjs 14879 var import_i18n26 = __toESM(require_i18n(), 1); 14880 var import_element70 = __toESM(require_element(), 1); 14881 var import_data32 = __toESM(require_data(), 1); 14882 var import_plugins3 = __toESM(require_plugins(), 1); 14883 var import_notices4 = __toESM(require_notices(), 1); 14884 var import_components20 = __toESM(require_components(), 1); 14885 var import_theme2 = __toESM(require_theme(), 1); 14886 14887 // packages/edit-widgets/build-module/components/error-boundary/index.mjs 14888 var import_element53 = __toESM(require_element(), 1); 14889 var import_a11y2 = __toESM(require_a11y(), 1); 14890 var import_i18n10 = __toESM(require_i18n(), 1); 14891 var import_compose6 = __toESM(require_compose(), 1); 14892 var import_hooks3 = __toESM(require_hooks(), 1); 14893 var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1); 14894 function getErrorNotice() { 14895 return { 14896 title: (0, import_i18n10.__)("The editor has crashed"), 14897 description: (0, import_i18n10.__)( 14898 "An unknown error occurred. Reload your browser to try again, or copy the error to report the problem or search." 14899 ) 14900 }; 14901 } 14902 function getErrorName(error2) { 14903 return error2 instanceof Error && error2.name || "Error"; 14904 } 14905 function getErrorMessage(error2) { 14906 if (typeof error2 === "string" && error2) { 14907 return error2; 14908 } 14909 if (typeof error2?.message === "string" && error2.message) { 14910 return error2.message; 14911 } 14912 return "An unknown error occurred."; 14913 } 14914 function getErrorSections(error2, componentStack) { 14915 const sections = [ 14916 { label: getErrorName(error2), content: getErrorMessage(error2) } 14917 ]; 14918 if (error2?.stack) { 14919 sections.push({ 14920 label: "Stack", 14921 content: error2.stack.trim(), 14922 preformatted: true 14923 }); 14924 } 14925 if (componentStack) { 14926 sections.push({ 14927 label: "Component stack", 14928 content: componentStack.trim(), 14929 preformatted: true 14930 }); 14931 } 14932 sections.push({ 14933 label: "Environment", 14934 content: `User agent: $window.navigator.userAgent}`, 14935 preformatted: true 14936 }); 14937 return sections; 14938 } 14939 function getErrorReport(error2, componentStack) { 14940 const sections = getErrorSections(error2, componentStack).map( 14941 ({ label, content, preformatted }) => `**$label}** 14942 14943 $preformatted ? `\`\`\` 14944 $content} 14945 \`\`\`` : content}` 14946 ); 14947 return ["### Error report", ...sections].join("\n\n"); 14948 } 14949 function CopyButton({ text, children, variant = "outline" }) { 14950 const ref = (0, import_compose6.useCopyToClipboard)(text); 14951 return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(notice_exports.ActionButton, { variant, ref, children }); 14952 } 14953 function ErrorReport({ error: error2, componentStack }) { 14954 return /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 14955 Stack, 14956 { 14957 className: "edit-widgets-error-boundary__report", 14958 direction: "column", 14959 gap: "md", 14960 children: getErrorSections(error2, componentStack).map( 14961 ({ label, content }) => /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(Stack, { direction: "column", gap: "xs", children: [ 14962 /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(Text, { variant: "heading-md", children: label }), 14963 /* @__PURE__ */ (0, import_jsx_runtime69.jsx)("pre", { className: "edit-widgets-error-boundary__report-section", children: content }) 14964 ] }, label) 14965 ) 14966 } 14967 ); 14968 } 14969 function ErrorDetails({ error: error2, componentStack }) { 14970 return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(collapsible_card_exports.Root, { className: "edit-widgets-error-boundary__details", children: [ 14971 /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(collapsible_card_exports.Header, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(card_exports.Title, { children: (0, import_i18n10.__)("Error details") }) }), 14972 /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(collapsible_card_exports.Content, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 14973 ErrorReport, 14974 { 14975 error: error2, 14976 componentStack 14977 } 14978 ) }) 14979 ] }); 14980 } 14981 var ErrorBoundary = class extends import_element53.Component { 14982 constructor() { 14983 super(...arguments); 14984 this.state = { 14985 error: null, 14986 componentStack: null 14987 }; 14988 } 14989 componentDidCatch(error2, errorInfo) { 14990 const { title, description } = getErrorNotice(); 14991 (0, import_a11y2.speak)(`$title}. $description}`, "assertive"); 14992 this.setState({ componentStack: errorInfo?.componentStack }); 14993 (0, import_hooks3.doAction)("editor.ErrorBoundary.errorLogged", error2, errorInfo); 14994 } 14995 static getDerivedStateFromError(error2) { 14996 return { error: error2 }; 14997 } 14998 render() { 14999 const { error: error2, componentStack } = this.state; 15000 if (!error2) { 15001 return this.props.children; 15002 } 15003 const { title, description } = getErrorNotice(); 15004 return /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)( 15005 Stack, 15006 { 15007 className: "edit-widgets-error-boundary", 15008 direction: "column", 15009 gap: "lg", 15010 children: [ 15011 /* @__PURE__ */ (0, import_jsx_runtime69.jsxs)(notice_exports.Root, { intent: "error", children: [ 15012 /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(notice_exports.Title, { children: title }), 15013 /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(notice_exports.Description, { children: description }), 15014 /* @__PURE__ */ (0, import_jsx_runtime69.jsx)(notice_exports.Actions, { children: /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 15015 CopyButton, 15016 { 15017 variant: "solid", 15018 text: () => getErrorReport(error2, componentStack), 15019 children: (0, import_i18n10.__)("Copy error") 15020 } 15021 ) }) 15022 ] }), 15023 true ? /* @__PURE__ */ (0, import_jsx_runtime69.jsx)( 15024 ErrorDetails, 15025 { 15026 error: error2, 15027 componentStack 15028 } 15029 ) : null 15030 ] 15031 } 15032 ); 15033 } 15034 }; 15035 15036 // packages/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.mjs 15037 var import_components7 = __toESM(require_components(), 1); 15038 var import_compose7 = __toESM(require_compose(), 1); 15039 var import_media_utils2 = __toESM(require_media_utils(), 1); 15040 var import_data13 = __toESM(require_data(), 1); 15041 var import_core_data8 = __toESM(require_core_data(), 1); 15042 var import_element55 = __toESM(require_element(), 1); 15043 var import_block_editor8 = __toESM(require_block_editor(), 1); 15044 var import_patterns = __toESM(require_patterns(), 1); 15045 var import_preferences4 = __toESM(require_preferences(), 1); 15046 15047 // packages/edit-widgets/build-module/components/keyboard-shortcuts/index.mjs 15048 var import_element54 = __toESM(require_element(), 1); 15049 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); 15050 var import_keycodes = __toESM(require_keycodes(), 1); 15051 var import_data11 = __toESM(require_data(), 1); 15052 var import_i18n11 = __toESM(require_i18n(), 1); 15053 var import_core_data6 = __toESM(require_core_data(), 1); 15054 var import_block_editor6 = __toESM(require_block_editor(), 1); 15055 var { usesNativeUndo } = unlock2(import_block_editor6.privateApis); 15056 function KeyboardShortcuts() { 15057 const { redo, undo } = (0, import_data11.useDispatch)(import_core_data6.store); 15058 const { saveEditedWidgetAreas: saveEditedWidgetAreas2 } = (0, import_data11.useDispatch)(store2); 15059 (0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/undo", (event) => { 15060 if (usesNativeUndo(event)) { 15061 return; 15062 } 15063 undo(); 15064 event.preventDefault(); 15065 }); 15066 (0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/redo", (event) => { 15067 if (usesNativeUndo(event)) { 15068 return; 15069 } 15070 redo(); 15071 event.preventDefault(); 15072 }); 15073 (0, import_keyboard_shortcuts.useShortcut)("core/edit-widgets/save", (event) => { 15074 event.preventDefault(); 15075 saveEditedWidgetAreas2(); 15076 }); 15077 return null; 15078 } 15079 function KeyboardShortcutsRegister() { 15080 const { registerShortcut } = (0, import_data11.useDispatch)(import_keyboard_shortcuts.store); 15081 (0, import_element54.useEffect)(() => { 15082 registerShortcut({ 15083 name: "core/edit-widgets/undo", 15084 category: "global", 15085 description: (0, import_i18n11.__)("Undo your last changes."), 15086 keyCombination: { 15087 modifier: "primary", 15088 character: "z" 15089 } 15090 }); 15091 registerShortcut({ 15092 name: "core/edit-widgets/redo", 15093 category: "global", 15094 description: (0, import_i18n11.__)("Redo your last undo."), 15095 keyCombination: { 15096 modifier: "primaryShift", 15097 character: "z" 15098 }, 15099 // Disable on Apple OS because it conflicts with the browser's 15100 // history shortcut. It's a fine alias for both Windows and Linux. 15101 // Since there's no conflict for Ctrl+Shift+Z on both Windows and 15102 // Linux, we keep it as the default for consistency. 15103 aliases: (0, import_keycodes.isAppleOS)() ? [] : [ 15104 { 15105 modifier: "primary", 15106 character: "y" 15107 } 15108 ] 15109 }); 15110 registerShortcut({ 15111 name: "core/edit-widgets/save", 15112 category: "global", 15113 description: (0, import_i18n11.__)("Save your changes."), 15114 keyCombination: { 15115 modifier: "primary", 15116 character: "s" 15117 } 15118 }); 15119 registerShortcut({ 15120 name: "core/edit-widgets/keyboard-shortcuts", 15121 category: "main", 15122 description: (0, import_i18n11.__)("Display these keyboard shortcuts."), 15123 keyCombination: { 15124 modifier: "access", 15125 character: "h" 15126 } 15127 }); 15128 registerShortcut({ 15129 name: "core/edit-widgets/next-region", 15130 category: "global", 15131 description: (0, import_i18n11.__)("Navigate to the next part of the editor."), 15132 keyCombination: { 15133 modifier: "ctrl", 15134 character: "`" 15135 }, 15136 aliases: [ 15137 { 15138 modifier: "access", 15139 character: "n" 15140 } 15141 ] 15142 }); 15143 registerShortcut({ 15144 name: "core/edit-widgets/previous-region", 15145 category: "global", 15146 description: (0, import_i18n11.__)("Navigate to the previous part of the editor."), 15147 keyCombination: { 15148 modifier: "ctrlShift", 15149 character: "`" 15150 }, 15151 aliases: [ 15152 { 15153 modifier: "access", 15154 character: "p" 15155 }, 15156 { 15157 modifier: "ctrlShift", 15158 character: "~" 15159 } 15160 ] 15161 }); 15162 }, [registerShortcut]); 15163 return null; 15164 } 15165 KeyboardShortcuts.Register = KeyboardShortcutsRegister; 15166 var keyboard_shortcuts_default = KeyboardShortcuts; 15167 15168 // packages/edit-widgets/build-module/hooks/use-last-selected-widget-area.mjs 15169 var import_data12 = __toESM(require_data(), 1); 15170 var import_block_editor7 = __toESM(require_block_editor(), 1); 15171 var import_core_data7 = __toESM(require_core_data(), 1); 15172 var useLastSelectedWidgetArea = () => (0, import_data12.useSelect)((select) => { 15173 const { getBlockSelectionEnd, getBlockName } = select(import_block_editor7.store); 15174 const selectionEndClientId = getBlockSelectionEnd(); 15175 if (getBlockName(selectionEndClientId) === "core/widget-area") { 15176 return selectionEndClientId; 15177 } 15178 const { getParentWidgetAreaBlock: getParentWidgetAreaBlock2 } = select(store2); 15179 const widgetAreaBlock = getParentWidgetAreaBlock2(selectionEndClientId); 15180 const widgetAreaBlockClientId = widgetAreaBlock?.clientId; 15181 if (widgetAreaBlockClientId) { 15182 return widgetAreaBlockClientId; 15183 } 15184 const { getEntityRecord } = select(import_core_data7.store); 15185 const widgetAreasPost = getEntityRecord( 15186 KIND, 15187 POST_TYPE, 15188 buildWidgetAreasPostId() 15189 ); 15190 return widgetAreasPost?.blocks[0]?.clientId; 15191 }, []); 15192 var use_last_selected_widget_area_default = useLastSelectedWidgetArea; 15193 15194 // packages/edit-widgets/build-module/constants.mjs 15195 var ALLOW_REUSABLE_BLOCKS = false; 15196 15197 // packages/edit-widgets/build-module/components/widget-areas-block-editor-provider/index.mjs 15198 var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1); 15199 var { ExperimentalBlockEditorProvider } = unlock2(import_block_editor8.privateApis); 15200 var { PatternsMenuItems } = unlock2(import_patterns.privateApis); 15201 var EMPTY_ARRAY2 = []; 15202 function WidgetAreasBlockEditorProvider({ 15203 blockEditorSettings, 15204 children, 15205 ...props 15206 }) { 15207 const isLargeViewport = (0, import_compose7.useViewportMatch)("medium"); 15208 const { 15209 hasUploadPermissions, 15210 reusableBlocks, 15211 isFixedToolbarActive, 15212 keepCaretInsideBlock, 15213 pageOnFront, 15214 pageForPosts 15215 } = (0, import_data13.useSelect)((select) => { 15216 const { canUser, getEntityRecord, getEntityRecords } = select(import_core_data8.store); 15217 const siteSettings = canUser("read", { 15218 kind: "root", 15219 name: "site" 15220 }) ? getEntityRecord("root", "site") : void 0; 15221 return { 15222 hasUploadPermissions: canUser("create", { 15223 kind: "postType", 15224 name: "attachment" 15225 }) ?? true, 15226 reusableBlocks: ALLOW_REUSABLE_BLOCKS ? getEntityRecords("postType", "wp_block") : EMPTY_ARRAY2, 15227 isFixedToolbarActive: !!select(import_preferences4.store).get( 15228 "core/edit-widgets", 15229 "fixedToolbar" 15230 ), 15231 keepCaretInsideBlock: !!select(import_preferences4.store).get( 15232 "core/edit-widgets", 15233 "keepCaretInsideBlock" 15234 ), 15235 pageOnFront: siteSettings?.page_on_front, 15236 pageForPosts: siteSettings?.page_for_posts 15237 }; 15238 }, []); 15239 const { setIsInserterOpened: setIsInserterOpened2 } = (0, import_data13.useDispatch)(store2); 15240 const settings2 = (0, import_element55.useMemo)(() => { 15241 let mediaUploadBlockEditor; 15242 if (hasUploadPermissions) { 15243 mediaUploadBlockEditor = ({ onError, ...argumentsObject }) => { 15244 (0, import_media_utils2.uploadMedia)({ 15245 wpAllowedMimeTypes: blockEditorSettings.allowedMimeTypes, 15246 onError: ({ message }) => onError(message), 15247 ...argumentsObject 15248 }); 15249 }; 15250 } 15251 return { 15252 ...blockEditorSettings, 15253 __experimentalReusableBlocks: reusableBlocks, 15254 hasFixedToolbar: isFixedToolbarActive || !isLargeViewport, 15255 keepCaretInsideBlock, 15256 mediaUpload: mediaUploadBlockEditor, 15257 templateLock: "all", 15258 __experimentalSetIsInserterOpened: setIsInserterOpened2, 15259 pageOnFront, 15260 pageForPosts 15261 }; 15262 }, [ 15263 hasUploadPermissions, 15264 blockEditorSettings, 15265 isFixedToolbarActive, 15266 isLargeViewport, 15267 keepCaretInsideBlock, 15268 reusableBlocks, 15269 setIsInserterOpened2, 15270 pageOnFront, 15271 pageForPosts 15272 ]); 15273 const widgetAreaId = use_last_selected_widget_area_default(); 15274 const [blocks, onInput, onChange] = (0, import_core_data8.useEntityBlockEditor)( 15275 KIND, 15276 POST_TYPE, 15277 { id: buildWidgetAreasPostId() } 15278 ); 15279 return /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)(import_components7.SlotFillProvider, { children: [ 15280 /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(keyboard_shortcuts_default.Register, {}), 15281 /* @__PURE__ */ (0, import_jsx_runtime70.jsxs)( 15282 ExperimentalBlockEditorProvider, 15283 { 15284 value: blocks, 15285 onInput, 15286 onChange, 15287 settings: settings2, 15288 useSubRegistry: false, 15289 ...props, 15290 children: [ 15291 children, 15292 /* @__PURE__ */ (0, import_jsx_runtime70.jsx)(PatternsMenuItems, { rootClientId: widgetAreaId }) 15293 ] 15294 } 15295 ) 15296 ] }); 15297 } 15298 15299 // packages/edit-widgets/build-module/components/sidebar/index.mjs 15300 var import_element57 = __toESM(require_element(), 1); 15301 var import_i18n13 = __toESM(require_i18n(), 1); 15302 var import_block_editor10 = __toESM(require_block_editor(), 1); 15303 var import_components9 = __toESM(require_components(), 1); 15304 var import_data15 = __toESM(require_data(), 1); 15305 15306 // packages/edit-widgets/build-module/components/sidebar/widget-areas.mjs 15307 var import_data14 = __toESM(require_data(), 1); 15308 var import_element56 = __toESM(require_element(), 1); 15309 var import_block_editor9 = __toESM(require_block_editor(), 1); 15310 var import_components8 = __toESM(require_components(), 1); 15311 var import_i18n12 = __toESM(require_i18n(), 1); 15312 var import_url = __toESM(require_url(), 1); 15313 var import_dom21 = __toESM(require_dom(), 1); 15314 var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1); 15315 function WidgetAreas({ selectedWidgetAreaId }) { 15316 const widgetAreas = (0, import_data14.useSelect)( 15317 (select) => select(store2).getWidgetAreas(), 15318 [] 15319 ); 15320 const selectedWidgetArea = (0, import_element56.useMemo)( 15321 () => selectedWidgetAreaId && widgetAreas?.find( 15322 (widgetArea) => widgetArea.id === selectedWidgetAreaId 15323 ), 15324 [selectedWidgetAreaId, widgetAreas] 15325 ); 15326 let description; 15327 if (!selectedWidgetArea) { 15328 description = (0, import_i18n12.__)( 15329 // eslint-disable-next-line no-restricted-syntax -- 'sidebar' is a common web design term for layouts 15330 "Widget Areas are global parts in your site\u2019s layout that can accept blocks. These vary by theme, but are typically parts like your Sidebar or Footer." 15331 ); 15332 } else if (selectedWidgetAreaId === "wp_inactive_widgets") { 15333 description = (0, import_i18n12.__)( 15334 "Blocks in this Widget Area will not be displayed in your site." 15335 ); 15336 } else { 15337 description = selectedWidgetArea.description; 15338 } 15339 return /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("div", { className: "edit-widgets-widget-areas", children: /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { className: "edit-widgets-widget-areas__top-container", children: [ 15340 /* @__PURE__ */ (0, import_jsx_runtime71.jsx)(import_block_editor9.BlockIcon, { icon: layout_default }), 15341 /* @__PURE__ */ (0, import_jsx_runtime71.jsxs)("div", { children: [ 15342 /* @__PURE__ */ (0, import_jsx_runtime71.jsx)( 15343 "p", 15344 { 15345 dangerouslySetInnerHTML: { 15346 __html: (0, import_dom21.safeHTML)(description) 15347 } 15348 } 15349 ), 15350 widgetAreas?.length === 0 && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)("p", { children: (0, import_i18n12.__)( 15351 "Your theme does not contain any Widget Areas." 15352 ) }), 15353 !selectedWidgetArea && /* @__PURE__ */ (0, import_jsx_runtime71.jsx)( 15354 import_components8.Button, 15355 { 15356 __next40pxDefaultSize: true, 15357 href: (0, import_url.addQueryArgs)("customize.php", { 15358 "autofocus[panel]": "widgets", 15359 return: window.location.pathname 15360 }), 15361 variant: "tertiary", 15362 children: (0, import_i18n12.__)("Manage with live preview") 15363 } 15364 ) 15365 ] }) 15366 ] }) }); 15367 } 15368 15369 // packages/edit-widgets/build-module/components/sidebar/index.mjs 15370 var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1); 15371 var SIDEBAR_ACTIVE_BY_DEFAULT = true; 15372 var BLOCK_INSPECTOR_IDENTIFIER = "edit-widgets/block-inspector"; 15373 var WIDGET_AREAS_IDENTIFIER = "edit-widgets/block-areas"; 15374 var { Tabs } = unlock2(import_components9.privateApis); 15375 function SidebarHeader({ selectedWidgetAreaBlock }) { 15376 return /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Tabs.TabList, { children: [ 15377 /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Tabs.Tab, { tabId: WIDGET_AREAS_IDENTIFIER, children: selectedWidgetAreaBlock ? selectedWidgetAreaBlock.attributes.name : (0, import_i18n13.__)("Widget Areas") }), 15378 /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Tabs.Tab, { tabId: BLOCK_INSPECTOR_IDENTIFIER, children: (0, import_i18n13.__)("Block") }) 15379 ] }); 15380 } 15381 function SidebarContent({ 15382 hasSelectedNonAreaBlock, 15383 currentArea, 15384 isGeneralSidebarOpen, 15385 selectedWidgetAreaBlock 15386 }) { 15387 const { enableComplementaryArea: enableComplementaryArea2 } = (0, import_data15.useDispatch)(store); 15388 (0, import_element57.useEffect)(() => { 15389 if (hasSelectedNonAreaBlock && currentArea === WIDGET_AREAS_IDENTIFIER && isGeneralSidebarOpen) { 15390 enableComplementaryArea2( 15391 "core/edit-widgets", 15392 BLOCK_INSPECTOR_IDENTIFIER 15393 ); 15394 } 15395 if (!hasSelectedNonAreaBlock && currentArea === BLOCK_INSPECTOR_IDENTIFIER && isGeneralSidebarOpen) { 15396 enableComplementaryArea2( 15397 "core/edit-widgets", 15398 WIDGET_AREAS_IDENTIFIER 15399 ); 15400 } 15401 }, [hasSelectedNonAreaBlock, enableComplementaryArea2]); 15402 const tabsContextValue = (0, import_element57.useContext)(Tabs.Context); 15403 return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( 15404 complementary_area_default, 15405 { 15406 className: "edit-widgets-sidebar", 15407 header: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(Tabs.Context.Provider, { value: tabsContextValue, children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( 15408 SidebarHeader, 15409 { 15410 selectedWidgetAreaBlock 15411 } 15412 ) }), 15413 headerClassName: "edit-widgets-sidebar__panel-tabs", 15414 title: (0, import_i18n13.__)("Settings"), 15415 closeLabel: (0, import_i18n13.__)("Close Settings"), 15416 scope: "core/edit-widgets", 15417 identifier: currentArea, 15418 icon: (0, import_i18n13.isRTL)() ? drawer_left_default : drawer_right_default, 15419 isActiveByDefault: SIDEBAR_ACTIVE_BY_DEFAULT, 15420 children: /* @__PURE__ */ (0, import_jsx_runtime72.jsxs)(Tabs.Context.Provider, { value: tabsContextValue, children: [ 15421 /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( 15422 Tabs.TabPanel, 15423 { 15424 tabId: WIDGET_AREAS_IDENTIFIER, 15425 focusable: false, 15426 children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( 15427 WidgetAreas, 15428 { 15429 selectedWidgetAreaId: selectedWidgetAreaBlock?.attributes.id 15430 } 15431 ) 15432 } 15433 ), 15434 /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( 15435 Tabs.TabPanel, 15436 { 15437 tabId: BLOCK_INSPECTOR_IDENTIFIER, 15438 focusable: false, 15439 children: hasSelectedNonAreaBlock ? /* @__PURE__ */ (0, import_jsx_runtime72.jsx)(import_block_editor10.BlockInspector, {}) : ( 15440 // Pretend that Widget Areas are part of the UI by not 15441 // showing the Block Inspector when one is selected. 15442 /* @__PURE__ */ (0, import_jsx_runtime72.jsx)("span", { className: "block-editor-block-inspector__no-blocks", children: (0, import_i18n13.__)("No block selected.") }) 15443 ) 15444 } 15445 ) 15446 ] }) 15447 } 15448 ); 15449 } 15450 function Sidebar() { 15451 const { 15452 currentArea, 15453 hasSelectedNonAreaBlock, 15454 isGeneralSidebarOpen, 15455 selectedWidgetAreaBlock 15456 } = (0, import_data15.useSelect)((select) => { 15457 const { getSelectedBlock, getBlock, getBlockParentsByBlockName } = select(import_block_editor10.store); 15458 const { getActiveComplementaryArea: getActiveComplementaryArea2 } = select(store); 15459 const selectedBlock = getSelectedBlock(); 15460 const activeArea = getActiveComplementaryArea2(store2.name); 15461 let currentSelection = activeArea; 15462 if (!currentSelection) { 15463 if (selectedBlock) { 15464 currentSelection = BLOCK_INSPECTOR_IDENTIFIER; 15465 } else { 15466 currentSelection = WIDGET_AREAS_IDENTIFIER; 15467 } 15468 } 15469 let widgetAreaBlock; 15470 if (selectedBlock) { 15471 if (selectedBlock.name === "core/widget-area") { 15472 widgetAreaBlock = selectedBlock; 15473 } else { 15474 widgetAreaBlock = getBlock( 15475 getBlockParentsByBlockName( 15476 selectedBlock.clientId, 15477 "core/widget-area" 15478 )[0] 15479 ); 15480 } 15481 } 15482 return { 15483 currentArea: currentSelection, 15484 hasSelectedNonAreaBlock: !!(selectedBlock && selectedBlock.name !== "core/widget-area"), 15485 isGeneralSidebarOpen: !!activeArea, 15486 selectedWidgetAreaBlock: widgetAreaBlock 15487 }; 15488 }, []); 15489 const { enableComplementaryArea: enableComplementaryArea2 } = (0, import_data15.useDispatch)(store); 15490 const onTabSelect = (0, import_element57.useCallback)( 15491 (newSelectedTabId) => { 15492 if (!!newSelectedTabId) { 15493 enableComplementaryArea2( 15494 store2.name, 15495 newSelectedTabId 15496 ); 15497 } 15498 }, 15499 [enableComplementaryArea2] 15500 ); 15501 return /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( 15502 Tabs, 15503 { 15504 selectedTabId: isGeneralSidebarOpen ? currentArea : null, 15505 onSelect: onTabSelect, 15506 selectOnMove: false, 15507 children: /* @__PURE__ */ (0, import_jsx_runtime72.jsx)( 15508 SidebarContent, 15509 { 15510 hasSelectedNonAreaBlock, 15511 currentArea, 15512 isGeneralSidebarOpen, 15513 selectedWidgetAreaBlock 15514 } 15515 ) 15516 } 15517 ); 15518 } 15519 15520 // packages/edit-widgets/build-module/components/layout/interface.mjs 15521 var import_compose13 = __toESM(require_compose(), 1); 15522 var import_block_editor17 = __toESM(require_block_editor(), 1); 15523 var import_element67 = __toESM(require_element(), 1); 15524 var import_data29 = __toESM(require_data(), 1); 15525 var import_i18n23 = __toESM(require_i18n(), 1); 15526 var import_preferences8 = __toESM(require_preferences(), 1); 15527 15528 // packages/edit-widgets/build-module/components/header/index.mjs 15529 var import_block_editor12 = __toESM(require_block_editor(), 1); 15530 var import_data23 = __toESM(require_data(), 1); 15531 var import_element63 = __toESM(require_element(), 1); 15532 var import_i18n21 = __toESM(require_i18n(), 1); 15533 var import_components17 = __toESM(require_components(), 1); 15534 var import_compose10 = __toESM(require_compose(), 1); 15535 var import_preferences6 = __toESM(require_preferences(), 1); 15536 15537 // packages/edit-widgets/build-module/components/header/document-tools/index.mjs 15538 var import_data18 = __toESM(require_data(), 1); 15539 var import_i18n16 = __toESM(require_i18n(), 1); 15540 var import_components12 = __toESM(require_components(), 1); 15541 var import_block_editor11 = __toESM(require_block_editor(), 1); 15542 var import_element60 = __toESM(require_element(), 1); 15543 var import_compose8 = __toESM(require_compose(), 1); 15544 15545 // packages/edit-widgets/build-module/components/header/undo-redo/undo.mjs 15546 var import_i18n14 = __toESM(require_i18n(), 1); 15547 var import_components10 = __toESM(require_components(), 1); 15548 var import_data16 = __toESM(require_data(), 1); 15549 var import_keycodes2 = __toESM(require_keycodes(), 1); 15550 var import_core_data9 = __toESM(require_core_data(), 1); 15551 var import_element58 = __toESM(require_element(), 1); 15552 var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1); 15553 function UndoButton(props, ref) { 15554 const hasUndo = (0, import_data16.useSelect)( 15555 (select) => select(import_core_data9.store).hasUndo(), 15556 [] 15557 ); 15558 const { undo } = (0, import_data16.useDispatch)(import_core_data9.store); 15559 return /* @__PURE__ */ (0, import_jsx_runtime73.jsx)( 15560 import_components10.Button, 15561 { 15562 ...props, 15563 ref, 15564 icon: !(0, import_i18n14.isRTL)() ? undo_default : redo_default, 15565 label: (0, import_i18n14.__)("Undo"), 15566 shortcut: import_keycodes2.displayShortcut.primary("z"), 15567 "aria-disabled": !hasUndo, 15568 onClick: hasUndo ? undo : void 0, 15569 size: "compact" 15570 } 15571 ); 15572 } 15573 var undo_default2 = (0, import_element58.forwardRef)(UndoButton); 15574 15575 // packages/edit-widgets/build-module/components/header/undo-redo/redo.mjs 15576 var import_i18n15 = __toESM(require_i18n(), 1); 15577 var import_components11 = __toESM(require_components(), 1); 15578 var import_data17 = __toESM(require_data(), 1); 15579 var import_keycodes3 = __toESM(require_keycodes(), 1); 15580 var import_core_data10 = __toESM(require_core_data(), 1); 15581 var import_element59 = __toESM(require_element(), 1); 15582 var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1); 15583 function RedoButton(props, ref) { 15584 const shortcut = (0, import_keycodes3.isAppleOS)() ? import_keycodes3.displayShortcut.primaryShift("z") : import_keycodes3.displayShortcut.primary("y"); 15585 const hasRedo = (0, import_data17.useSelect)( 15586 (select) => select(import_core_data10.store).hasRedo(), 15587 [] 15588 ); 15589 const { redo } = (0, import_data17.useDispatch)(import_core_data10.store); 15590 return /* @__PURE__ */ (0, import_jsx_runtime74.jsx)( 15591 import_components11.Button, 15592 { 15593 ...props, 15594 ref, 15595 icon: !(0, import_i18n15.isRTL)() ? redo_default : undo_default, 15596 label: (0, import_i18n15.__)("Redo"), 15597 shortcut, 15598 "aria-disabled": !hasRedo, 15599 onClick: hasRedo ? redo : void 0, 15600 size: "compact" 15601 } 15602 ); 15603 } 15604 var redo_default2 = (0, import_element59.forwardRef)(RedoButton); 15605 15606 // packages/edit-widgets/build-module/components/header/document-tools/index.mjs 15607 var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1); 15608 function DocumentTools() { 15609 const isMediumViewport = (0, import_compose8.useViewportMatch)("medium"); 15610 const { 15611 isInserterOpen, 15612 isListViewOpen, 15613 inserterSidebarToggleRef: inserterSidebarToggleRef2, 15614 listViewToggleRef: listViewToggleRef2 15615 } = (0, import_data18.useSelect)((select) => { 15616 const { 15617 isInserterOpened: isInserterOpened2, 15618 getInserterSidebarToggleRef: getInserterSidebarToggleRef2, 15619 isListViewOpened: isListViewOpened2, 15620 getListViewToggleRef: getListViewToggleRef2 15621 } = unlock2(select(store2)); 15622 return { 15623 isInserterOpen: isInserterOpened2(), 15624 isListViewOpen: isListViewOpened2(), 15625 inserterSidebarToggleRef: getInserterSidebarToggleRef2(), 15626 listViewToggleRef: getListViewToggleRef2() 15627 }; 15628 }, []); 15629 const { setIsInserterOpened: setIsInserterOpened2, setIsListViewOpened: setIsListViewOpened2 } = (0, import_data18.useDispatch)(store2); 15630 const toggleListView = (0, import_element60.useCallback)( 15631 () => setIsListViewOpened2(!isListViewOpen), 15632 [setIsListViewOpened2, isListViewOpen] 15633 ); 15634 const toggleInserterSidebar = (0, import_element60.useCallback)( 15635 () => setIsInserterOpened2(!isInserterOpen), 15636 [setIsInserterOpened2, isInserterOpen] 15637 ); 15638 return /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)( 15639 import_block_editor11.NavigableToolbar, 15640 { 15641 className: "edit-widgets-header-toolbar", 15642 "aria-label": (0, import_i18n16.__)("Document tools"), 15643 variant: "unstyled", 15644 children: [ 15645 /* @__PURE__ */ (0, import_jsx_runtime75.jsx)( 15646 import_components12.ToolbarItem, 15647 { 15648 ref: inserterSidebarToggleRef2, 15649 as: import_components12.Button, 15650 className: "edit-widgets-header-toolbar__inserter-toggle", 15651 variant: "primary", 15652 isPressed: isInserterOpen, 15653 onMouseDown: (event) => { 15654 event.preventDefault(); 15655 }, 15656 onClick: toggleInserterSidebar, 15657 icon: plus_default, 15658 label: (0, import_i18n16._x)( 15659 "Block Inserter", 15660 "Generic label for block inserter button" 15661 ), 15662 size: "compact" 15663 } 15664 ), 15665 isMediumViewport && /* @__PURE__ */ (0, import_jsx_runtime75.jsxs)(import_jsx_runtime75.Fragment, { children: [ 15666 /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components12.ToolbarItem, { as: undo_default2 }), 15667 /* @__PURE__ */ (0, import_jsx_runtime75.jsx)(import_components12.ToolbarItem, { as: redo_default2 }), 15668 /* @__PURE__ */ (0, import_jsx_runtime75.jsx)( 15669 import_components12.ToolbarItem, 15670 { 15671 as: import_components12.Button, 15672 className: "edit-widgets-header-toolbar__list-view-toggle", 15673 icon: list_view_default, 15674 isPressed: isListViewOpen, 15675 label: (0, import_i18n16.__)("List View"), 15676 onClick: toggleListView, 15677 ref: listViewToggleRef2, 15678 size: "compact" 15679 } 15680 ) 15681 ] }) 15682 ] 15683 } 15684 ); 15685 } 15686 var document_tools_default = DocumentTools; 15687 15688 // packages/edit-widgets/build-module/components/save-button/index.mjs 15689 var import_components13 = __toESM(require_components(), 1); 15690 var import_i18n17 = __toESM(require_i18n(), 1); 15691 var import_data19 = __toESM(require_data(), 1); 15692 var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1); 15693 function SaveButton() { 15694 const { hasEditedWidgetAreaIds, isSaving, isWidgetSaveLocked } = (0, import_data19.useSelect)( 15695 (select) => { 15696 const { 15697 getEditedWidgetAreas: getEditedWidgetAreas2, 15698 isSavingWidgetAreas: isSavingWidgetAreas2, 15699 isWidgetSavingLocked: isWidgetSavingLocked2 15700 } = select(store2); 15701 return { 15702 hasEditedWidgetAreaIds: getEditedWidgetAreas2()?.length > 0, 15703 isSaving: isSavingWidgetAreas2(), 15704 isWidgetSaveLocked: isWidgetSavingLocked2() 15705 }; 15706 }, 15707 [] 15708 ); 15709 const { saveEditedWidgetAreas: saveEditedWidgetAreas2 } = (0, import_data19.useDispatch)(store2); 15710 const isDisabled = isWidgetSaveLocked || isSaving || !hasEditedWidgetAreaIds; 15711 return /* @__PURE__ */ (0, import_jsx_runtime76.jsx)( 15712 import_components13.Button, 15713 { 15714 variant: "primary", 15715 isBusy: isSaving, 15716 "aria-disabled": isDisabled, 15717 onClick: isDisabled ? void 0 : saveEditedWidgetAreas2, 15718 size: "compact", 15719 children: isSaving ? (0, import_i18n17.__)("Saving\u2026") : (0, import_i18n17.__)("Update") 15720 } 15721 ); 15722 } 15723 var save_button_default = SaveButton; 15724 15725 // packages/edit-widgets/build-module/components/more-menu/index.mjs 15726 var import_components16 = __toESM(require_components(), 1); 15727 var import_data22 = __toESM(require_data(), 1); 15728 var import_element62 = __toESM(require_element(), 1); 15729 var import_i18n20 = __toESM(require_i18n(), 1); 15730 var import_preferences5 = __toESM(require_preferences(), 1); 15731 var import_keycodes5 = __toESM(require_keycodes(), 1); 15732 var import_keyboard_shortcuts5 = __toESM(require_keyboard_shortcuts(), 1); 15733 var import_compose9 = __toESM(require_compose(), 1); 15734 15735 // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs 15736 var import_components14 = __toESM(require_components(), 1); 15737 var import_i18n19 = __toESM(require_i18n(), 1); 15738 var import_keyboard_shortcuts4 = __toESM(require_keyboard_shortcuts(), 1); 15739 var import_data21 = __toESM(require_data(), 1); 15740 15741 // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/config.mjs 15742 var import_i18n18 = __toESM(require_i18n(), 1); 15743 var textFormattingShortcuts = [ 15744 { 15745 keyCombination: { modifier: "primary", character: "b" }, 15746 description: (0, import_i18n18.__)("Make the selected text bold.") 15747 }, 15748 { 15749 keyCombination: { modifier: "primary", character: "i" }, 15750 description: (0, import_i18n18.__)("Make the selected text italic.") 15751 }, 15752 { 15753 keyCombination: { modifier: "primary", character: "k" }, 15754 description: (0, import_i18n18.__)("Convert the selected text into a link.") 15755 }, 15756 { 15757 keyCombination: { modifier: "primaryShift", character: "k" }, 15758 description: (0, import_i18n18.__)("Remove a link.") 15759 }, 15760 { 15761 keyCombination: { character: "[[" }, 15762 description: (0, import_i18n18.__)("Insert a link to a post or page.") 15763 }, 15764 { 15765 keyCombination: { modifier: "primary", character: "u" }, 15766 description: (0, import_i18n18.__)("Underline the selected text.") 15767 }, 15768 { 15769 keyCombination: { modifier: "access", character: "d" }, 15770 description: (0, import_i18n18.__)("Strikethrough the selected text.") 15771 }, 15772 { 15773 keyCombination: { modifier: "access", character: "x" }, 15774 description: (0, import_i18n18.__)("Make the selected text inline code.") 15775 }, 15776 { 15777 keyCombination: { 15778 modifier: "access", 15779 character: "0" 15780 }, 15781 aliases: [ 15782 { 15783 modifier: "access", 15784 character: "7" 15785 } 15786 ], 15787 description: (0, import_i18n18.__)("Convert the current heading to a paragraph.") 15788 }, 15789 { 15790 keyCombination: { modifier: "access", character: "1-6" }, 15791 description: (0, import_i18n18.__)( 15792 "Convert the current paragraph or heading to a heading of level 1 to 6." 15793 ) 15794 }, 15795 { 15796 keyCombination: { modifier: "primaryShift", character: "SPACE" }, 15797 description: (0, import_i18n18.__)("Add non breaking space.") 15798 } 15799 ]; 15800 15801 // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/shortcut.mjs 15802 var import_element61 = __toESM(require_element(), 1); 15803 var import_keycodes4 = __toESM(require_keycodes(), 1); 15804 var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1); 15805 function KeyCombination({ keyCombination, forceAriaLabel }) { 15806 const shortcut = keyCombination.modifier ? import_keycodes4.displayShortcutList[keyCombination.modifier]( 15807 keyCombination.character 15808 ) : keyCombination.character; 15809 const ariaLabel = keyCombination.modifier ? import_keycodes4.shortcutAriaLabel[keyCombination.modifier]( 15810 keyCombination.character 15811 ) : keyCombination.character; 15812 const shortcuts = Array.isArray(shortcut) ? shortcut : [shortcut]; 15813 return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( 15814 "kbd", 15815 { 15816 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key-combination", 15817 "aria-label": forceAriaLabel || ariaLabel, 15818 children: shortcuts.map((character, index2) => { 15819 if (character === "+") { 15820 return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)(import_element61.Fragment, { children: character }, index2); 15821 } 15822 return /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( 15823 "kbd", 15824 { 15825 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-key", 15826 children: character 15827 }, 15828 index2 15829 ); 15830 }) 15831 } 15832 ); 15833 } 15834 function Shortcut({ description, keyCombination, aliases = [], ariaLabel }) { 15835 return /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)(import_jsx_runtime77.Fragment, { children: [ 15836 /* @__PURE__ */ (0, import_jsx_runtime77.jsx)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-description", children: description }), 15837 /* @__PURE__ */ (0, import_jsx_runtime77.jsxs)("div", { className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-term", children: [ 15838 /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( 15839 KeyCombination, 15840 { 15841 keyCombination, 15842 forceAriaLabel: ariaLabel 15843 } 15844 ), 15845 aliases.map((alias, index2) => /* @__PURE__ */ (0, import_jsx_runtime77.jsx)( 15846 KeyCombination, 15847 { 15848 keyCombination: alias, 15849 forceAriaLabel: ariaLabel 15850 }, 15851 index2 15852 )) 15853 ] }) 15854 ] }); 15855 } 15856 var shortcut_default = Shortcut; 15857 15858 // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.mjs 15859 var import_data20 = __toESM(require_data(), 1); 15860 var import_keyboard_shortcuts3 = __toESM(require_keyboard_shortcuts(), 1); 15861 var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1); 15862 function DynamicShortcut({ name: name2 }) { 15863 const { keyCombination, description, aliases } = (0, import_data20.useSelect)( 15864 (select) => { 15865 const { 15866 getShortcutKeyCombination, 15867 getShortcutDescription, 15868 getShortcutAliases 15869 } = select(import_keyboard_shortcuts3.store); 15870 return { 15871 keyCombination: getShortcutKeyCombination(name2), 15872 aliases: getShortcutAliases(name2), 15873 description: getShortcutDescription(name2) 15874 }; 15875 }, 15876 [name2] 15877 ); 15878 if (!keyCombination) { 15879 return null; 15880 } 15881 return /* @__PURE__ */ (0, import_jsx_runtime78.jsx)( 15882 shortcut_default, 15883 { 15884 keyCombination, 15885 description, 15886 aliases 15887 } 15888 ); 15889 } 15890 var dynamic_shortcut_default = DynamicShortcut; 15891 15892 // packages/edit-widgets/build-module/components/keyboard-shortcut-help-modal/index.mjs 15893 var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1); 15894 var ShortcutList = ({ shortcuts }) => ( 15895 /* 15896 * Disable reason: The `list` ARIA role is redundant but 15897 * Safari+VoiceOver won't announce the list otherwise. 15898 */ 15899 /* eslint-disable jsx-a11y/no-redundant-roles */ 15900 /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 15901 "ul", 15902 { 15903 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut-list", 15904 role: "list", 15905 children: shortcuts.map((shortcut, index2) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 15906 "li", 15907 { 15908 className: "edit-widgets-keyboard-shortcut-help-modal__shortcut", 15909 children: typeof shortcut === "string" ? /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(dynamic_shortcut_default, { name: shortcut }) : /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(shortcut_default, { ...shortcut }) 15910 }, 15911 index2 15912 )) 15913 } 15914 ) 15915 ); 15916 var ShortcutSection = ({ title, shortcuts, className }) => /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)( 15917 "section", 15918 { 15919 className: clsx_default( 15920 "edit-widgets-keyboard-shortcut-help-modal__section", 15921 className 15922 ), 15923 children: [ 15924 !!title && /* @__PURE__ */ (0, import_jsx_runtime79.jsx)("h2", { className: "edit-widgets-keyboard-shortcut-help-modal__section-title", children: title }), 15925 /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(ShortcutList, { shortcuts }) 15926 ] 15927 } 15928 ); 15929 var ShortcutCategorySection = ({ 15930 title, 15931 categoryName, 15932 additionalShortcuts = [] 15933 }) => { 15934 const categoryShortcuts = (0, import_data21.useSelect)( 15935 (select) => { 15936 return select(import_keyboard_shortcuts4.store).getCategoryShortcuts( 15937 categoryName 15938 ); 15939 }, 15940 [categoryName] 15941 ); 15942 return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 15943 ShortcutSection, 15944 { 15945 title, 15946 shortcuts: categoryShortcuts.concat(additionalShortcuts) 15947 } 15948 ); 15949 }; 15950 function KeyboardShortcutHelpModal({ 15951 isModalActive: isModalActive2, 15952 toggleModal 15953 }) { 15954 (0, import_keyboard_shortcuts4.useShortcut)("core/edit-widgets/keyboard-shortcuts", toggleModal, { 15955 bindGlobal: true 15956 }); 15957 if (!isModalActive2) { 15958 return null; 15959 } 15960 return /* @__PURE__ */ (0, import_jsx_runtime79.jsxs)( 15961 import_components14.Modal, 15962 { 15963 className: "edit-widgets-keyboard-shortcut-help-modal", 15964 title: (0, import_i18n19.__)("Keyboard shortcuts"), 15965 onRequestClose: toggleModal, 15966 children: [ 15967 /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 15968 ShortcutSection, 15969 { 15970 className: "edit-widgets-keyboard-shortcut-help-modal__main-shortcuts", 15971 shortcuts: ["core/edit-widgets/keyboard-shortcuts"] 15972 } 15973 ), 15974 /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 15975 ShortcutCategorySection, 15976 { 15977 title: (0, import_i18n19.__)("Global shortcuts"), 15978 categoryName: "global" 15979 } 15980 ), 15981 /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 15982 ShortcutCategorySection, 15983 { 15984 title: (0, import_i18n19.__)("Selection shortcuts"), 15985 categoryName: "selection" 15986 } 15987 ), 15988 /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 15989 ShortcutCategorySection, 15990 { 15991 title: (0, import_i18n19.__)("Block shortcuts"), 15992 categoryName: "block", 15993 additionalShortcuts: [ 15994 { 15995 keyCombination: { character: "/" }, 15996 description: (0, import_i18n19.__)( 15997 "Change the block type after adding a new paragraph." 15998 ), 15999 /* translators: The forward-slash character. e.g. '/'. */ 16000 ariaLabel: (0, import_i18n19.__)("Forward-slash") 16001 } 16002 ] 16003 } 16004 ), 16005 /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 16006 ShortcutSection, 16007 { 16008 title: (0, import_i18n19.__)("Text formatting"), 16009 shortcuts: textFormattingShortcuts 16010 } 16011 ), 16012 /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 16013 ShortcutCategorySection, 16014 { 16015 title: (0, import_i18n19.__)("List View shortcuts"), 16016 categoryName: "list-view" 16017 } 16018 ) 16019 ] 16020 } 16021 ); 16022 } 16023 16024 // packages/edit-widgets/build-module/components/more-menu/tools-more-menu-group.mjs 16025 var import_components15 = __toESM(require_components(), 1); 16026 var { Fill: ToolsMoreMenuGroup, Slot: Slot4 } = (0, import_components15.createSlotFill)( 16027 "EditWidgetsToolsMoreMenuGroup" 16028 ); 16029 ToolsMoreMenuGroup.Slot = Slot4; 16030 var tools_more_menu_group_default = ToolsMoreMenuGroup; 16031 16032 // packages/edit-widgets/build-module/components/more-menu/index.mjs 16033 var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1); 16034 function MoreMenu() { 16035 const [ 16036 isKeyboardShortcutsModalActive, 16037 setIsKeyboardShortcutsModalVisible 16038 ] = (0, import_element62.useState)(false); 16039 const toggleKeyboardShortcutsModal = () => setIsKeyboardShortcutsModalVisible(!isKeyboardShortcutsModalActive); 16040 (0, import_keyboard_shortcuts5.useShortcut)( 16041 "core/edit-widgets/keyboard-shortcuts", 16042 toggleKeyboardShortcutsModal 16043 ); 16044 const isLargeViewport = (0, import_compose9.useViewportMatch)("medium"); 16045 const { toggle } = (0, import_data22.useDispatch)(import_preferences5.store); 16046 return /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [ 16047 /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16048 import_components16.DropdownMenu, 16049 { 16050 icon: more_vertical_default, 16051 label: (0, import_i18n20.__)("Options"), 16052 popoverProps: { 16053 placement: "bottom-end", 16054 className: "more-menu-dropdown__content" 16055 }, 16056 toggleProps: { 16057 tooltipPosition: "bottom", 16058 size: "compact" 16059 }, 16060 children: (onClose) => /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_jsx_runtime80.Fragment, { children: [ 16061 isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(import_components16.MenuGroup, { label: (0, import_i18n20._x)("View", "noun"), children: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16062 import_preferences5.PreferenceToggleMenuItem, 16063 { 16064 scope: "core/edit-widgets", 16065 name: "fixedToolbar", 16066 label: (0, import_i18n20.__)("Top toolbar"), 16067 info: (0, import_i18n20.__)( 16068 "Access all block and document tools in a single place" 16069 ), 16070 messageActivated: (0, import_i18n20.__)( 16071 "Top toolbar activated" 16072 ), 16073 messageDeactivated: (0, import_i18n20.__)( 16074 "Top toolbar deactivated" 16075 ) 16076 } 16077 ) }), 16078 /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_components16.MenuGroup, { label: (0, import_i18n20.__)("Tools"), children: [ 16079 /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16080 import_components16.MenuItem, 16081 { 16082 onClick: () => { 16083 setIsKeyboardShortcutsModalVisible(true); 16084 }, 16085 shortcut: import_keycodes5.displayShortcut.access("h"), 16086 children: (0, import_i18n20.__)("Keyboard shortcuts") 16087 } 16088 ), 16089 /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16090 import_components16.MenuItem, 16091 { 16092 onClick: () => toggle( 16093 "core/edit-widgets", 16094 "welcomeGuide" 16095 ), 16096 "aria-haspopup": "dialog", 16097 children: (0, import_i18n20.__)("Welcome Guide") 16098 } 16099 ), 16100 /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)( 16101 import_components16.MenuItem, 16102 { 16103 role: "menuitem", 16104 icon: external_default, 16105 href: (0, import_i18n20.__)( 16106 "https://wordpress.org/documentation/article/block-based-widgets-editor/" 16107 ), 16108 target: "_blank", 16109 rel: "noopener", 16110 children: [ 16111 (0, import_i18n20.__)("Help"), 16112 /* @__PURE__ */ (0, import_jsx_runtime80.jsx)(VisuallyHidden, { 16113 render: /* @__PURE__ */ (0, import_jsx_runtime80.jsx)("span", {}), 16114 /* translators: accessibility text */ 16115 children: (0, import_i18n20.__)("(opens in a new tab)") 16116 }) 16117 ] 16118 } 16119 ), 16120 /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16121 tools_more_menu_group_default.Slot, 16122 { 16123 fillProps: { onClose } 16124 } 16125 ) 16126 ] }), 16127 /* @__PURE__ */ (0, import_jsx_runtime80.jsxs)(import_components16.MenuGroup, { label: (0, import_i18n20.__)("Preferences"), children: [ 16128 /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16129 import_preferences5.PreferenceToggleMenuItem, 16130 { 16131 scope: "core/edit-widgets", 16132 name: "keepCaretInsideBlock", 16133 label: (0, import_i18n20.__)( 16134 "Contain text cursor inside block" 16135 ), 16136 info: (0, import_i18n20.__)( 16137 "Aids screen readers by stopping text caret from leaving blocks." 16138 ), 16139 messageActivated: (0, import_i18n20.__)( 16140 "Contain text cursor inside block activated" 16141 ), 16142 messageDeactivated: (0, import_i18n20.__)( 16143 "Contain text cursor inside block deactivated" 16144 ) 16145 } 16146 ), 16147 /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16148 import_preferences5.PreferenceToggleMenuItem, 16149 { 16150 scope: "core/edit-widgets", 16151 name: "themeStyles", 16152 info: (0, import_i18n20.__)( 16153 "Make the editor look like your theme." 16154 ), 16155 label: (0, import_i18n20.__)("Use theme styles") 16156 } 16157 ), 16158 isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16159 import_preferences5.PreferenceToggleMenuItem, 16160 { 16161 scope: "core/edit-widgets", 16162 name: "showBlockBreadcrumbs", 16163 label: (0, import_i18n20.__)("Display block breadcrumbs"), 16164 info: (0, import_i18n20.__)( 16165 "Shows block breadcrumbs at the bottom of the editor." 16166 ), 16167 messageActivated: (0, import_i18n20.__)( 16168 "Display block breadcrumbs activated" 16169 ), 16170 messageDeactivated: (0, import_i18n20.__)( 16171 "Display block breadcrumbs deactivated" 16172 ) 16173 } 16174 ) 16175 ] }) 16176 ] }) 16177 } 16178 ), 16179 /* @__PURE__ */ (0, import_jsx_runtime80.jsx)( 16180 KeyboardShortcutHelpModal, 16181 { 16182 isModalActive: isKeyboardShortcutsModalActive, 16183 toggleModal: toggleKeyboardShortcutsModal 16184 } 16185 ) 16186 ] }); 16187 } 16188 16189 // packages/edit-widgets/build-module/components/header/index.mjs 16190 var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1); 16191 function Header3() { 16192 const isLargeViewport = (0, import_compose10.useViewportMatch)("medium"); 16193 const blockToolbarRef = (0, import_element63.useRef)(); 16194 const { hasFixedToolbar } = (0, import_data23.useSelect)( 16195 (select) => ({ 16196 hasFixedToolbar: !!select(import_preferences6.store).get( 16197 "core/edit-widgets", 16198 "fixedToolbar" 16199 ) 16200 }), 16201 [] 16202 ); 16203 return /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_jsx_runtime81.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "edit-widgets-header", children: [ 16204 /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "edit-widgets-header__navigable-toolbar-wrapper", children: [ 16205 isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("h1", { className: "edit-widgets-header__title", children: (0, import_i18n21.__)("Widgets") }), 16206 !isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime81.jsx)( 16207 VisuallyHidden, 16208 { 16209 className: "edit-widgets-header__title", 16210 render: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("h1", {}), 16211 children: (0, import_i18n21.__)("Widgets") 16212 } 16213 ), 16214 /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(document_tools_default, {}), 16215 hasFixedToolbar && isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)(import_jsx_runtime81.Fragment, { children: [ 16216 /* @__PURE__ */ (0, import_jsx_runtime81.jsx)("div", { className: "selected-block-tools-wrapper", children: /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(import_block_editor12.BlockToolbar, { hideDragHandle: true }) }), 16217 /* @__PURE__ */ (0, import_jsx_runtime81.jsx)( 16218 import_components17.Popover.Slot, 16219 { 16220 ref: blockToolbarRef, 16221 name: "block-toolbar" 16222 } 16223 ) 16224 ] }) 16225 ] }), 16226 /* @__PURE__ */ (0, import_jsx_runtime81.jsxs)("div", { className: "edit-widgets-header__actions", children: [ 16227 /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(pinned_items_default.Slot, { scope: "core/edit-widgets" }), 16228 /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(save_button_default, {}), 16229 /* @__PURE__ */ (0, import_jsx_runtime81.jsx)(MoreMenu, {}) 16230 ] }) 16231 ] }) }); 16232 } 16233 var header_default = Header3; 16234 16235 // packages/edit-widgets/build-module/components/widget-areas-block-editor-content/index.mjs 16236 var import_block_editor13 = __toESM(require_block_editor(), 1); 16237 var import_compose11 = __toESM(require_compose(), 1); 16238 var import_data24 = __toESM(require_data(), 1); 16239 var import_element64 = __toESM(require_element(), 1); 16240 var import_preferences7 = __toESM(require_preferences(), 1); 16241 16242 // packages/edit-widgets/build-module/components/notices/index.mjs 16243 var import_notices2 = __toESM(require_notices(), 1); 16244 var import_theme = __toESM(require_theme(), 1); 16245 var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1); 16246 function Notices() { 16247 return /* @__PURE__ */ (0, import_jsx_runtime82.jsxs)(import_theme.ThemeProvider, { cornerRadius: "none", children: [ 16248 /* @__PURE__ */ (0, import_jsx_runtime82.jsx)( 16249 import_notices2.InlineNotices, 16250 { 16251 className: "edit-widgets-notices", 16252 pinnedNoticesClassName: "edit-widgets-notices__pinned", 16253 dismissibleNoticesClassName: "edit-widgets-notices__dismissible" 16254 } 16255 ), 16256 /* @__PURE__ */ (0, import_jsx_runtime82.jsx)(import_notices2.SnackbarNotices, { className: "edit-widgets-notices__snackbar" }) 16257 ] }); 16258 } 16259 var notices_default = Notices; 16260 16261 // packages/edit-widgets/build-module/components/widget-areas-block-editor-content/index.mjs 16262 var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1); 16263 function WidgetAreasBlockEditorContent({ 16264 blockEditorSettings 16265 }) { 16266 const hasThemeStyles = (0, import_data24.useSelect)( 16267 (select) => !!select(import_preferences7.store).get( 16268 "core/edit-widgets", 16269 "themeStyles" 16270 ), 16271 [] 16272 ); 16273 const isLargeViewport = (0, import_compose11.useViewportMatch)("medium"); 16274 const contentRef = (0, import_element64.useRef)(); 16275 const styles = (0, import_element64.useMemo)(() => { 16276 return hasThemeStyles ? blockEditorSettings.styles : []; 16277 }, [blockEditorSettings, hasThemeStyles]); 16278 return /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)("div", { className: "edit-widgets-block-editor", children: [ 16279 /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(notices_default, {}), 16280 !isLargeViewport && /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_block_editor13.BlockToolbar, { hideDragHandle: true }), 16281 /* @__PURE__ */ (0, import_jsx_runtime83.jsxs)(import_block_editor13.BlockTools, { __unstableContentRef: contentRef, children: [ 16282 /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(keyboard_shortcuts_default, {}), 16283 /* @__PURE__ */ (0, import_jsx_runtime83.jsx)( 16284 import_block_editor13.__unstableEditorStyles, 16285 { 16286 styles, 16287 scope: ":where(.editor-styles-wrapper)" 16288 } 16289 ), 16290 /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_block_editor13.BlockSelectionClearer, { children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_block_editor13.WritingFlow, { ref: contentRef, children: /* @__PURE__ */ (0, import_jsx_runtime83.jsx)(import_block_editor13.BlockList, { className: "edit-widgets-main-block-list" }) }) }) 16291 ] }) 16292 ] }); 16293 } 16294 16295 // packages/edit-widgets/build-module/components/secondary-sidebar/index.mjs 16296 var import_data28 = __toESM(require_data(), 1); 16297 16298 // packages/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.mjs 16299 var import_block_editor15 = __toESM(require_block_editor(), 1); 16300 var import_compose12 = __toESM(require_compose(), 1); 16301 var import_element65 = __toESM(require_element(), 1); 16302 var import_data26 = __toESM(require_data(), 1); 16303 16304 // packages/edit-widgets/build-module/hooks/use-widget-library-insertion-point.mjs 16305 var import_data25 = __toESM(require_data(), 1); 16306 var import_block_editor14 = __toESM(require_block_editor(), 1); 16307 var import_core_data11 = __toESM(require_core_data(), 1); 16308 var useWidgetLibraryInsertionPoint = () => { 16309 const firstRootId = (0, import_data25.useSelect)((select) => { 16310 const { getEntityRecord } = select(import_core_data11.store); 16311 const widgetAreasPost = getEntityRecord( 16312 KIND, 16313 POST_TYPE, 16314 buildWidgetAreasPostId() 16315 ); 16316 return widgetAreasPost?.blocks[0]?.clientId; 16317 }, []); 16318 return (0, import_data25.useSelect)( 16319 (select) => { 16320 const { 16321 getBlockRootClientId, 16322 getBlockSelectionEnd, 16323 getBlockOrder, 16324 getBlockIndex 16325 } = select(import_block_editor14.store); 16326 const insertionPoint = select(store2).__experimentalGetInsertionPoint(); 16327 if (insertionPoint.rootClientId) { 16328 return insertionPoint; 16329 } 16330 const clientId = getBlockSelectionEnd() || firstRootId; 16331 const rootClientId = getBlockRootClientId(clientId); 16332 if (clientId && rootClientId === "") { 16333 return { 16334 rootClientId: clientId, 16335 insertionIndex: getBlockOrder(clientId).length 16336 }; 16337 } 16338 return { 16339 rootClientId, 16340 insertionIndex: getBlockIndex(clientId) + 1 16341 }; 16342 }, 16343 [firstRootId] 16344 ); 16345 }; 16346 var use_widget_library_insertion_point_default = useWidgetLibraryInsertionPoint; 16347 16348 // packages/edit-widgets/build-module/components/secondary-sidebar/inserter-sidebar.mjs 16349 var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1); 16350 function InserterSidebar() { 16351 const isMobileViewport = (0, import_compose12.useViewportMatch)("medium", "<"); 16352 const { rootClientId, insertionIndex } = use_widget_library_insertion_point_default(); 16353 const { setIsInserterOpened: setIsInserterOpened2 } = (0, import_data26.useDispatch)(store2); 16354 const closeInserter = (0, import_element65.useCallback)(() => { 16355 return setIsInserterOpened2(false); 16356 }, [setIsInserterOpened2]); 16357 const libraryRef = (0, import_element65.useRef)(); 16358 return /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "edit-widgets-layout__inserter-panel", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)("div", { className: "edit-widgets-layout__inserter-panel-content", children: /* @__PURE__ */ (0, import_jsx_runtime84.jsx)( 16359 import_block_editor15.__experimentalLibrary, 16360 { 16361 showInserterHelpPanel: true, 16362 shouldFocusBlock: isMobileViewport, 16363 rootClientId, 16364 __experimentalInsertionIndex: insertionIndex, 16365 ref: libraryRef, 16366 onClose: closeInserter 16367 } 16368 ) }) }); 16369 } 16370 16371 // packages/edit-widgets/build-module/components/secondary-sidebar/list-view-sidebar.mjs 16372 var import_block_editor16 = __toESM(require_block_editor(), 1); 16373 var import_components18 = __toESM(require_components(), 1); 16374 var import_data27 = __toESM(require_data(), 1); 16375 var import_element66 = __toESM(require_element(), 1); 16376 var import_i18n22 = __toESM(require_i18n(), 1); 16377 var import_keycodes6 = __toESM(require_keycodes(), 1); 16378 var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1); 16379 function ListViewSidebar() { 16380 const { setIsListViewOpened: setIsListViewOpened2 } = (0, import_data27.useDispatch)(store2); 16381 const { getListViewToggleRef: getListViewToggleRef2 } = unlock2((0, import_data27.useSelect)(store2)); 16382 const [dropZoneElement, setDropZoneElement] = (0, import_element66.useState)(null); 16383 const closeListView = (0, import_element66.useCallback)(() => { 16384 setIsListViewOpened2(false); 16385 getListViewToggleRef2().current?.focus(); 16386 }, [getListViewToggleRef2, setIsListViewOpened2]); 16387 const closeOnEscape = (0, import_element66.useCallback)( 16388 (event) => { 16389 if (event.keyCode === import_keycodes6.ESCAPE && !event.defaultPrevented) { 16390 event.preventDefault(); 16391 closeListView(); 16392 } 16393 }, 16394 [closeListView] 16395 ); 16396 return ( 16397 // eslint-disable-next-line jsx-a11y/no-static-element-interactions 16398 /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)( 16399 "div", 16400 { 16401 className: "edit-widgets-editor__list-view-panel", 16402 onKeyDown: closeOnEscape, 16403 children: [ 16404 /* @__PURE__ */ (0, import_jsx_runtime85.jsxs)("div", { className: "edit-widgets-editor__list-view-panel-header", children: [ 16405 /* @__PURE__ */ (0, import_jsx_runtime85.jsx)("strong", { children: (0, import_i18n22.__)("List View") }), 16406 /* @__PURE__ */ (0, import_jsx_runtime85.jsx)( 16407 import_components18.Button, 16408 { 16409 icon: close_small_default, 16410 label: (0, import_i18n22.__)("Close"), 16411 onClick: closeListView, 16412 size: "compact" 16413 } 16414 ) 16415 ] }), 16416 /* @__PURE__ */ (0, import_jsx_runtime85.jsx)( 16417 "div", 16418 { 16419 className: "edit-widgets-editor__list-view-panel-content", 16420 ref: setDropZoneElement, 16421 children: /* @__PURE__ */ (0, import_jsx_runtime85.jsx)(import_block_editor16.__experimentalListView, { dropZoneElement, focusOnMount: true }) 16422 } 16423 ) 16424 ] 16425 } 16426 ) 16427 ); 16428 } 16429 16430 // packages/edit-widgets/build-module/components/secondary-sidebar/index.mjs 16431 var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1); 16432 function SecondarySidebar() { 16433 const { isInserterOpen, isListViewOpen } = (0, import_data28.useSelect)((select) => { 16434 const { isInserterOpened: isInserterOpened2, isListViewOpened: isListViewOpened2 } = select(store2); 16435 return { 16436 isInserterOpen: isInserterOpened2(), 16437 isListViewOpen: isListViewOpened2() 16438 }; 16439 }, []); 16440 if (isInserterOpen) { 16441 return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(InserterSidebar, {}); 16442 } 16443 if (isListViewOpen) { 16444 return /* @__PURE__ */ (0, import_jsx_runtime86.jsx)(ListViewSidebar, {}); 16445 } 16446 return null; 16447 } 16448 16449 // packages/edit-widgets/build-module/components/layout/interface.mjs 16450 var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1); 16451 var interfaceLabels = { 16452 /* translators: accessibility text for the widgets screen top bar landmark region. */ 16453 header: (0, import_i18n23.__)("Widgets top bar"), 16454 /* translators: accessibility text for the widgets screen content landmark region. */ 16455 body: (0, import_i18n23.__)("Widgets and blocks"), 16456 /* translators: accessibility text for the widgets screen settings landmark region. */ 16457 sidebar: (0, import_i18n23.__)("Widgets settings"), 16458 /* translators: accessibility text for the widgets screen footer landmark region. */ 16459 footer: (0, import_i18n23.__)("Widgets footer") 16460 }; 16461 function Interface({ blockEditorSettings }) { 16462 const isMobileViewport = (0, import_compose13.useViewportMatch)("medium", "<"); 16463 const isHugeViewport = (0, import_compose13.useViewportMatch)("huge", ">="); 16464 const { setIsInserterOpened: setIsInserterOpened2, setIsListViewOpened: setIsListViewOpened2, closeGeneralSidebar: closeGeneralSidebar2 } = (0, import_data29.useDispatch)(store2); 16465 const { 16466 hasBlockBreadCrumbsEnabled, 16467 hasSidebarEnabled, 16468 isInserterOpened: isInserterOpened2, 16469 isListViewOpened: isListViewOpened2 16470 } = (0, import_data29.useSelect)( 16471 (select) => ({ 16472 hasSidebarEnabled: !!select( 16473 store 16474 ).getActiveComplementaryArea(store2.name), 16475 isInserterOpened: !!select(store2).isInserterOpened(), 16476 isListViewOpened: !!select(store2).isListViewOpened(), 16477 hasBlockBreadCrumbsEnabled: !!select(import_preferences8.store).get( 16478 "core/edit-widgets", 16479 "showBlockBreadcrumbs" 16480 ) 16481 }), 16482 [] 16483 ); 16484 (0, import_element67.useEffect)(() => { 16485 if (hasSidebarEnabled && !isHugeViewport) { 16486 setIsInserterOpened2(false); 16487 setIsListViewOpened2(false); 16488 } 16489 }, [hasSidebarEnabled, isHugeViewport]); 16490 (0, import_element67.useEffect)(() => { 16491 if ((isInserterOpened2 || isListViewOpened2) && !isHugeViewport) { 16492 closeGeneralSidebar2(); 16493 } 16494 }, [isInserterOpened2, isListViewOpened2, isHugeViewport]); 16495 const secondarySidebarLabel = isListViewOpened2 ? (0, import_i18n23.__)("List View") : (0, import_i18n23.__)("Block Library"); 16496 const hasSecondarySidebar = isListViewOpened2 || isInserterOpened2; 16497 return /* @__PURE__ */ (0, import_jsx_runtime87.jsx)( 16498 interface_skeleton_default, 16499 { 16500 labels: { 16501 ...interfaceLabels, 16502 secondarySidebar: secondarySidebarLabel 16503 }, 16504 header: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(header_default, {}), 16505 secondarySidebar: hasSecondarySidebar && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(SecondarySidebar, {}), 16506 sidebar: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(complementary_area_default.Slot, { scope: "core/edit-widgets" }), 16507 content: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)(import_jsx_runtime87.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)( 16508 WidgetAreasBlockEditorContent, 16509 { 16510 blockEditorSettings 16511 } 16512 ) }), 16513 footer: hasBlockBreadCrumbsEnabled && !isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime87.jsx)("div", { className: "edit-widgets-layout__footer", children: /* @__PURE__ */ (0, import_jsx_runtime87.jsx)( 16514 import_block_editor17.BlockBreadcrumb, 16515 { 16516 className: "edit-widgets-layout__breadcrumbs", 16517 rootLabelText: (0, import_i18n23.__)("Widgets") 16518 } 16519 ) }) 16520 } 16521 ); 16522 } 16523 var interface_default = Interface; 16524 16525 // packages/edit-widgets/build-module/components/layout/unsaved-changes-warning.mjs 16526 var import_i18n24 = __toESM(require_i18n(), 1); 16527 var import_element68 = __toESM(require_element(), 1); 16528 var import_data30 = __toESM(require_data(), 1); 16529 function UnsavedChangesWarning() { 16530 const isDirty = (0, import_data30.useSelect)((select) => { 16531 const { getEditedWidgetAreas: getEditedWidgetAreas2 } = select(store2); 16532 const editedWidgetAreas = getEditedWidgetAreas2(); 16533 return editedWidgetAreas?.length > 0; 16534 }, []); 16535 (0, import_element68.useEffect)(() => { 16536 const warnIfUnsavedChanges = (event) => { 16537 if (isDirty) { 16538 event.returnValue = (0, import_i18n24.__)( 16539 "You have unsaved changes. If you proceed, they will be lost." 16540 ); 16541 return event.returnValue; 16542 } 16543 }; 16544 window.addEventListener("beforeunload", warnIfUnsavedChanges); 16545 return () => { 16546 window.removeEventListener("beforeunload", warnIfUnsavedChanges); 16547 }; 16548 }, [isDirty]); 16549 return null; 16550 } 16551 16552 // packages/edit-widgets/build-module/components/welcome-guide/index.mjs 16553 var import_data31 = __toESM(require_data(), 1); 16554 var import_components19 = __toESM(require_components(), 1); 16555 var import_i18n25 = __toESM(require_i18n(), 1); 16556 var import_element69 = __toESM(require_element(), 1); 16557 var import_preferences9 = __toESM(require_preferences(), 1); 16558 var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1); 16559 function WelcomeGuide() { 16560 const isActive = (0, import_data31.useSelect)( 16561 (select) => !!select(import_preferences9.store).get( 16562 "core/edit-widgets", 16563 "welcomeGuide" 16564 ), 16565 [] 16566 ); 16567 const { toggle } = (0, import_data31.useDispatch)(import_preferences9.store); 16568 const widgetAreas = (0, import_data31.useSelect)( 16569 (select) => select(store2).getWidgetAreas({ per_page: -1 }), 16570 [] 16571 ); 16572 if (!isActive) { 16573 return null; 16574 } 16575 const isEntirelyBlockWidgets = widgetAreas?.every( 16576 (widgetArea) => widgetArea.id === "wp_inactive_widgets" || widgetArea.widgets.every( 16577 (widgetId) => widgetId.startsWith("block-") 16578 ) 16579 ); 16580 const numWidgetAreas = widgetAreas?.filter( 16581 (widgetArea) => widgetArea.id !== "wp_inactive_widgets" 16582 ).length ?? 0; 16583 return /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16584 import_components19.Guide, 16585 { 16586 className: "edit-widgets-welcome-guide", 16587 contentLabel: (0, import_i18n25.__)("Welcome to block Widgets"), 16588 finishButtonText: (0, import_i18n25.__)("Get started"), 16589 onFinish: () => toggle("core/edit-widgets", "welcomeGuide"), 16590 pages: [ 16591 { 16592 image: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16593 WelcomeGuideImage, 16594 { 16595 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.svg", 16596 animatedSrc: "https://s.w.org/images/block-editor/welcome-canvas.gif" 16597 } 16598 ), 16599 content: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [ 16600 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0, import_i18n25.__)("Welcome to block Widgets") }), 16601 isEntirelyBlockWidgets ? /* @__PURE__ */ (0, import_jsx_runtime88.jsx)(import_jsx_runtime88.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_i18n25.sprintf)( 16602 // Translators: %s: Number of block areas in the current theme. 16603 (0, import_i18n25._n)( 16604 "Your theme provides %s \u201Cblock\u201D area for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site.", 16605 "Your theme provides %s different \u201Cblock\u201D areas for you to add and edit content.\xA0Try adding a search bar, social icons, or other types of blocks here and see how they\u2019ll look on your site.", 16606 numWidgetAreas 16607 ), 16608 numWidgetAreas 16609 ) }) }) : /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [ 16610 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_i18n25.__)( 16611 "You can now add any block to your site\u2019s widget areas. Don\u2019t worry, all of your favorite widgets still work flawlessly." 16612 ) }), 16613 /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("p", { className: "edit-widgets-welcome-guide__text", children: [ 16614 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("strong", { children: (0, import_i18n25.__)( 16615 "Want to stick with the old widgets?" 16616 ) }), 16617 " ", 16618 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16619 import_components19.ExternalLink, 16620 { 16621 href: (0, import_i18n25.__)( 16622 "https://wordpress.org/plugins/classic-widgets/" 16623 ), 16624 children: (0, import_i18n25.__)( 16625 "Get the Classic Widgets plugin." 16626 ) 16627 } 16628 ) 16629 ] }) 16630 ] }) 16631 ] }) 16632 }, 16633 { 16634 image: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16635 WelcomeGuideImage, 16636 { 16637 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-editor.svg", 16638 animatedSrc: "https://s.w.org/images/block-editor/welcome-editor.gif" 16639 } 16640 ), 16641 content: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [ 16642 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0, import_i18n25.__)("Customize each block") }), 16643 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_i18n25.__)( 16644 "Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected." 16645 ) }) 16646 ] }) 16647 }, 16648 { 16649 image: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16650 WelcomeGuideImage, 16651 { 16652 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-library.svg", 16653 animatedSrc: "https://s.w.org/images/block-editor/welcome-library.gif" 16654 } 16655 ), 16656 content: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [ 16657 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0, import_i18n25.__)("Explore all blocks") }), 16658 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_element69.createInterpolateElement)( 16659 (0, import_i18n25.__)( 16660 "All of the blocks available to you live in the block library. You\u2019ll find it wherever you see the <InserterIconImage /> icon." 16661 ), 16662 { 16663 InserterIconImage: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16664 "img", 16665 { 16666 className: "edit-widgets-welcome-guide__inserter-icon", 16667 alt: (0, import_i18n25.__)("inserter"), 16668 src: "data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A" 16669 } 16670 ) 16671 } 16672 ) }) 16673 ] }) 16674 }, 16675 { 16676 image: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16677 WelcomeGuideImage, 16678 { 16679 nonAnimatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.svg", 16680 animatedSrc: "https://s.w.org/images/block-editor/welcome-documentation.gif" 16681 } 16682 ), 16683 content: /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)(import_jsx_runtime88.Fragment, { children: [ 16684 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("h1", { className: "edit-widgets-welcome-guide__heading", children: (0, import_i18n25.__)("Learn more") }), 16685 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("p", { className: "edit-widgets-welcome-guide__text", children: (0, import_element69.createInterpolateElement)( 16686 (0, import_i18n25.__)( 16687 "New to the block editor? Want to learn more about using it? <a>Here's a detailed guide.</a>" 16688 ), 16689 { 16690 a: /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16691 import_components19.ExternalLink, 16692 { 16693 href: (0, import_i18n25.__)( 16694 "https://wordpress.org/documentation/article/wordpress-block-editor/" 16695 ) 16696 } 16697 ) 16698 } 16699 ) }) 16700 ] }) 16701 } 16702 ] 16703 } 16704 ); 16705 } 16706 function WelcomeGuideImage({ nonAnimatedSrc, animatedSrc }) { 16707 return /* @__PURE__ */ (0, import_jsx_runtime88.jsxs)("picture", { className: "edit-widgets-welcome-guide__image", children: [ 16708 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)( 16709 "source", 16710 { 16711 srcSet: nonAnimatedSrc, 16712 media: "(prefers-reduced-motion: reduce)" 16713 } 16714 ), 16715 /* @__PURE__ */ (0, import_jsx_runtime88.jsx)("img", { src: animatedSrc, width: "312", height: "240", alt: "" }) 16716 ] }); 16717 } 16718 16719 // packages/edit-widgets/build-module/components/layout/index.mjs 16720 var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1); 16721 function Layout({ blockEditorSettings }) { 16722 const { createErrorNotice } = (0, import_data32.useDispatch)(import_notices4.store); 16723 function onPluginAreaError(name2) { 16724 createErrorNotice( 16725 (0, import_i18n26.sprintf)( 16726 /* translators: %s: plugin name */ 16727 (0, import_i18n26.__)( 16728 'The "%s" plugin has encountered an error and cannot be rendered.' 16729 ), 16730 name2 16731 ) 16732 ); 16733 } 16734 const navigateRegionsProps = (0, import_components20.__unstableUseNavigateRegions)(); 16735 const adminPrimary = (0, import_element70.useMemo)(() => getAdminThemeColors().primary, []); 16736 return /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_theme2.ThemeProvider, { isRoot: true, color: { primary: adminPrimary }, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime89.jsx)("div", { ...navigateRegionsProps, children: /* @__PURE__ */ (0, import_jsx_runtime89.jsxs)( 16737 WidgetAreasBlockEditorProvider, 16738 { 16739 blockEditorSettings, 16740 children: [ 16741 /* @__PURE__ */ (0, import_jsx_runtime89.jsx)( 16742 interface_default, 16743 { 16744 blockEditorSettings 16745 } 16746 ), 16747 /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(Sidebar, {}), 16748 /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(import_plugins3.PluginArea, { onError: onPluginAreaError }), 16749 /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(UnsavedChangesWarning, {}), 16750 /* @__PURE__ */ (0, import_jsx_runtime89.jsx)(WelcomeGuide, {}) 16751 ] 16752 } 16753 ) }) }) }); 16754 } 16755 var layout_default2 = Layout; 16756 16757 // packages/edit-widgets/build-module/index.mjs 16758 var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1); 16759 var disabledBlocks = [ 16760 "core/more", 16761 "core/freeform", 16762 "core/template-part", 16763 ...ALLOW_REUSABLE_BLOCKS ? [] : ["core/block"] 16764 ]; 16765 function initializeEditor(id, settings2) { 16766 const target = document.getElementById(id); 16767 const root = (0, import_element71.createRoot)(target); 16768 const coreBlocks = (0, import_block_library.__experimentalGetCoreBlocks)().filter((block) => { 16769 return !(disabledBlocks.includes(block.name) || block.name.startsWith("core/post") || block.name.startsWith("core/query") || block.name.startsWith("core/site") || block.name.startsWith("core/navigation") || block.name.startsWith("core/term")); 16770 }); 16771 (0, import_data33.dispatch)(import_preferences10.store).setDefaults("core/edit-widgets", { 16772 fixedToolbar: false, 16773 welcomeGuide: true, 16774 showBlockBreadcrumbs: true, 16775 themeStyles: true 16776 }); 16777 (0, import_data33.dispatch)(import_blocks3.store).reapplyBlockTypeFilters(); 16778 (0, import_block_library.registerCoreBlocks)(coreBlocks); 16779 (0, import_widgets5.registerLegacyWidgetBlock)(); 16780 if (false) { 16781 (0, import_block_library.__experimentalRegisterExperimentalCoreBlocks)({ 16782 enableFSEBlocks: ENABLE_EXPERIMENTAL_FSE_BLOCKS 16783 }); 16784 } 16785 (0, import_widgets5.registerLegacyWidgetVariations)(settings2); 16786 registerBlock(widget_area_exports); 16787 (0, import_widgets5.registerWidgetGroupBlock)(); 16788 settings2.__experimentalFetchLinkSuggestions = (search, searchOptions) => (0, import_core_data12.__experimentalFetchLinkSuggestions)(search, searchOptions, settings2); 16789 (0, import_blocks3.setFreeformContentHandlerName)("core/html"); 16790 root.render( 16791 /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(import_element71.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime90.jsx)(layout_default2, { blockEditorSettings: settings2 }) }) 16792 ); 16793 return root; 16794 } 16795 var initialize = initializeEditor; 16796 function reinitializeEditor() { 16797 (0, import_deprecated6.default)("wp.editWidgets.reinitializeEditor", { 16798 since: "6.2", 16799 version: "6.3" 16800 }); 16801 } 16802 var registerBlock = (block) => { 16803 if (!block) { 16804 return; 16805 } 16806 const { metadata, settings: settings2, name: name2 } = block; 16807 if (metadata) { 16808 (0, import_blocks3.unstable__bootstrapServerSideBlockDefinitions)({ [name2]: metadata }); 16809 } 16810 (0, import_blocks3.registerBlockType)(name2, settings2); 16811 }; 16812 return __toCommonJS(index_exports); 16813 })(); 16814 /*! Bundled license information: 16815 16816 use-sync-external-store/cjs/use-sync-external-store-shim.development.js: 16817 (** 16818 * @license React 16819 * use-sync-external-store-shim.development.js 16820 * 16821 * Copyright (c) Meta Platforms, Inc. and affiliates. 16822 * 16823 * This source code is licensed under the MIT license found in the 16824 * LICENSE file in the root directory of this source tree. 16825 *) 16826 16827 use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js: 16828 (** 16829 * @license React 16830 * use-sync-external-store-shim/with-selector.development.js 16831 * 16832 * Copyright (c) Meta Platforms, Inc. and affiliates. 16833 * 16834 * This source code is licensed under the MIT license found in the 16835 * LICENSE file in the root directory of this source tree. 16836 *) 16837 */ 16838 (window.wp ||= {}).editWidgets = wp.editWidgets; 16839 })();
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Tue Oct 27 08:20:35 2026 | Cross-referenced by PHPXref |