| [ Index ] |
PHP Cross Reference of WordPress Trunk (Updated Daily) |
[Summary view] [Print] [Text view]
1 var __create = Object.create; 2 var __defProp = Object.defineProperty; 3 var __getOwnPropDesc = Object.getOwnPropertyDescriptor; 4 var __getOwnPropNames = Object.getOwnPropertyNames; 5 var __getProtoOf = Object.getPrototypeOf; 6 var __hasOwnProp = Object.prototype.hasOwnProperty; 7 var __commonJS = (cb, mod) => function __require() { 8 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 9 }; 10 var __export = (target, all) => { 11 for (var name in all) 12 __defProp(target, name, { get: all[name], enumerable: true }); 13 }; 14 var __copyProps = (to, from, except, desc) => { 15 if (from && typeof from === "object" || typeof from === "function") { 16 for (let key of __getOwnPropNames(from)) 17 if (!__hasOwnProp.call(to, key) && key !== except) 18 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 19 } 20 return to; 21 }; 22 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 23 // If the importer is in node compatibility mode or this is not an ESM 24 // file that has been converted to a CommonJS file using a Babel- 25 // compatible transform (i.e. "__esModule" has not been set), then set 26 // "default" to the CommonJS "module.exports" for node compatibility. 27 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 28 mod 29 )); 30 31 // package-external:@wordpress/element 32 var require_element = __commonJS({ 33 "package-external:@wordpress/element"(exports, module) { 34 module.exports = window.wp.element; 35 } 36 }); 37 38 // package-external:@wordpress/data 39 var require_data = __commonJS({ 40 "package-external:@wordpress/data"(exports, module) { 41 module.exports = window.wp.data; 42 } 43 }); 44 45 // package-external:@wordpress/i18n 46 var require_i18n = __commonJS({ 47 "package-external:@wordpress/i18n"(exports, module) { 48 module.exports = window.wp.i18n; 49 } 50 }); 51 52 // vendor-external:react 53 var require_react = __commonJS({ 54 "vendor-external:react"(exports, module) { 55 module.exports = window.React; 56 } 57 }); 58 59 // vendor-external:react/jsx-runtime 60 var require_jsx_runtime = __commonJS({ 61 "vendor-external:react/jsx-runtime"(exports, module) { 62 module.exports = window.ReactJSXRuntime; 63 } 64 }); 65 66 // vendor-external:react-dom 67 var require_react_dom = __commonJS({ 68 "vendor-external:react-dom"(exports, module) { 69 module.exports = window.ReactDOM; 70 } 71 }); 72 73 // package-external:@wordpress/primitives 74 var require_primitives = __commonJS({ 75 "package-external:@wordpress/primitives"(exports, module) { 76 module.exports = window.wp.primitives; 77 } 78 }); 79 80 // 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 81 var require_use_sync_external_store_shim_development = __commonJS({ 82 "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) { 83 "use strict"; 84 (function() { 85 function is(x, y) { 86 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 87 } 88 function useSyncExternalStore$2(subscribe, getSnapshot) { 89 didWarnOld18Alpha || void 0 === React49.startTransition || (didWarnOld18Alpha = true, console.error( 90 "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." 91 )); 92 var value = getSnapshot(); 93 if (!didWarnUncachedGetSnapshot) { 94 var cachedValue = getSnapshot(); 95 objectIs(value, cachedValue) || (console.error( 96 "The result of getSnapshot should be cached to avoid an infinite loop" 97 ), didWarnUncachedGetSnapshot = true); 98 } 99 cachedValue = useState19({ 100 inst: { value, getSnapshot } 101 }); 102 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; 103 useLayoutEffect3( 104 function() { 105 inst.value = value; 106 inst.getSnapshot = getSnapshot; 107 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 108 }, 109 [subscribe, value, getSnapshot] 110 ); 111 useEffect18( 112 function() { 113 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 114 return subscribe(function() { 115 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 116 }); 117 }, 118 [subscribe] 119 ); 120 useDebugValue2(value); 121 return value; 122 } 123 function checkIfSnapshotChanged(inst) { 124 var latestGetSnapshot = inst.getSnapshot; 125 inst = inst.value; 126 try { 127 var nextValue = latestGetSnapshot(); 128 return !objectIs(inst, nextValue); 129 } catch (error) { 130 return true; 131 } 132 } 133 function useSyncExternalStore$1(subscribe, getSnapshot) { 134 return getSnapshot(); 135 } 136 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 137 var React49 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState19 = React49.useState, useEffect18 = React49.useEffect, useLayoutEffect3 = React49.useLayoutEffect, useDebugValue2 = React49.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; 138 exports.useSyncExternalStore = void 0 !== React49.useSyncExternalStore ? React49.useSyncExternalStore : shim; 139 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 140 })(); 141 } 142 }); 143 144 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/index.js 145 var require_shim = __commonJS({ 146 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/index.js"(exports, module) { 147 "use strict"; 148 if (false) { 149 module.exports = null; 150 } else { 151 module.exports = require_use_sync_external_store_shim_development(); 152 } 153 } 154 }); 155 156 // 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 157 var require_with_selector_development = __commonJS({ 158 "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) { 159 "use strict"; 160 (function() { 161 function is(x, y) { 162 return x === y && (0 !== x || 1 / x === 1 / y) || x !== x && y !== y; 163 } 164 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 165 var React49 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore3 = shim.useSyncExternalStore, useRef22 = React49.useRef, useEffect18 = React49.useEffect, useMemo22 = React49.useMemo, useDebugValue2 = React49.useDebugValue; 166 exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { 167 var instRef = useRef22(null); 168 if (null === instRef.current) { 169 var inst = { hasValue: false, value: null }; 170 instRef.current = inst; 171 } else inst = instRef.current; 172 instRef = useMemo22( 173 function() { 174 function memoizedSelector(nextSnapshot) { 175 if (!hasMemo) { 176 hasMemo = true; 177 memoizedSnapshot = nextSnapshot; 178 nextSnapshot = selector(nextSnapshot); 179 if (void 0 !== isEqual && inst.hasValue) { 180 var currentSelection = inst.value; 181 if (isEqual(currentSelection, nextSnapshot)) 182 return memoizedSelection = currentSelection; 183 } 184 return memoizedSelection = nextSnapshot; 185 } 186 currentSelection = memoizedSelection; 187 if (objectIs(memoizedSnapshot, nextSnapshot)) 188 return currentSelection; 189 var nextSelection = selector(nextSnapshot); 190 if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) 191 return memoizedSnapshot = nextSnapshot, currentSelection; 192 memoizedSnapshot = nextSnapshot; 193 return memoizedSelection = nextSelection; 194 } 195 var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; 196 return [ 197 function() { 198 return memoizedSelector(getSnapshot()); 199 }, 200 null === maybeGetServerSnapshot ? void 0 : function() { 201 return memoizedSelector(maybeGetServerSnapshot()); 202 } 203 ]; 204 }, 205 [getSnapshot, getServerSnapshot, selector, isEqual] 206 ); 207 var value = useSyncExternalStore3(subscribe, instRef[0], instRef[1]); 208 useEffect18( 209 function() { 210 inst.hasValue = true; 211 inst.value = value; 212 }, 213 [value] 214 ); 215 useDebugValue2(value); 216 return value; 217 }; 218 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 219 })(); 220 } 221 }); 222 223 // node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/with-selector.js 224 var require_with_selector = __commonJS({ 225 "node_modules/.store/use-sync-external-store@1.7.0-jHNF5n8408rkWhZ5NHKclA/node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { 226 "use strict"; 227 if (false) { 228 module.exports = null; 229 } else { 230 module.exports = require_with_selector_development(); 231 } 232 } 233 }); 234 235 // package-external:@wordpress/compose 236 var require_compose = __commonJS({ 237 "package-external:@wordpress/compose"(exports, module) { 238 module.exports = window.wp.compose; 239 } 240 }); 241 242 // package-external:@wordpress/theme 243 var require_theme = __commonJS({ 244 "package-external:@wordpress/theme"(exports, module) { 245 module.exports = window.wp.theme; 246 } 247 }); 248 249 // package-external:@wordpress/private-apis 250 var require_private_apis = __commonJS({ 251 "package-external:@wordpress/private-apis"(exports, module) { 252 module.exports = window.wp.privateApis; 253 } 254 }); 255 256 // package-external:@wordpress/components 257 var require_components = __commonJS({ 258 "package-external:@wordpress/components"(exports, module) { 259 module.exports = window.wp.components; 260 } 261 }); 262 263 // package-external:@wordpress/core-data 264 var require_core_data = __commonJS({ 265 "package-external:@wordpress/core-data"(exports, module) { 266 module.exports = window.wp.coreData; 267 } 268 }); 269 270 // package-external:@wordpress/notices 271 var require_notices = __commonJS({ 272 "package-external:@wordpress/notices"(exports, module) { 273 module.exports = window.wp.notices; 274 } 275 }); 276 277 // package-external:@wordpress/editor 278 var require_editor = __commonJS({ 279 "package-external:@wordpress/editor"(exports, module) { 280 module.exports = window.wp.editor; 281 } 282 }); 283 284 // package-external:@wordpress/keycodes 285 var require_keycodes = __commonJS({ 286 "package-external:@wordpress/keycodes"(exports, module) { 287 module.exports = window.wp.keycodes; 288 } 289 }); 290 291 // package-external:@wordpress/keyboard-shortcuts 292 var require_keyboard_shortcuts = __commonJS({ 293 "package-external:@wordpress/keyboard-shortcuts"(exports, module) { 294 module.exports = window.wp.keyboardShortcuts; 295 } 296 }); 297 298 // package-external:@wordpress/dom 299 var require_dom = __commonJS({ 300 "package-external:@wordpress/dom"(exports, module) { 301 module.exports = window.wp.dom; 302 } 303 }); 304 305 // package-external:@wordpress/url 306 var require_url = __commonJS({ 307 "package-external:@wordpress/url"(exports, module) { 308 module.exports = window.wp.url; 309 } 310 }); 311 312 // package-external:@wordpress/html-entities 313 var require_html_entities = __commonJS({ 314 "package-external:@wordpress/html-entities"(exports, module) { 315 module.exports = window.wp.htmlEntities; 316 } 317 }); 318 319 // package-external:@wordpress/plugins 320 var require_plugins = __commonJS({ 321 "package-external:@wordpress/plugins"(exports, module) { 322 module.exports = window.wp.plugins; 323 } 324 }); 325 326 // packages/boot/build-module/components/app/index.mjs 327 var import_element44 = __toESM(require_element(), 1); 328 var import_data14 = __toESM(require_data(), 1); 329 330 // packages/boot/build-module/components/app/router.mjs 331 var import_i18n19 = __toESM(require_i18n(), 1); 332 var import_element42 = __toESM(require_element(), 1); 333 334 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useRenderElement.mjs 335 var React4 = __toESM(require_react(), 1); 336 337 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useRefWithInit.mjs 338 var React = __toESM(require_react(), 1); 339 var UNINITIALIZED = {}; 340 function useRefWithInit(init2, initArg) { 341 const ref = React.useRef(UNINITIALIZED); 342 if (ref.current === UNINITIALIZED) { 343 ref.current = init2(initArg); 344 } 345 return ref; 346 } 347 348 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useMergedRefs.mjs 349 function useMergedRefs(a, b, c, d) { 350 const forkRef = useRefWithInit(createForkRef).current; 351 if (didChange(forkRef, a, b, c, d)) { 352 update(forkRef, [a, b, c, d]); 353 } 354 return forkRef.callback; 355 } 356 function useMergedRefsN(refs) { 357 const forkRef = useRefWithInit(createForkRef).current; 358 if (didChangeN(forkRef, refs)) { 359 update(forkRef, refs); 360 } 361 return forkRef.callback; 362 } 363 function createForkRef() { 364 return { 365 callback: null, 366 cleanup: null, 367 refs: [] 368 }; 369 } 370 function didChange(forkRef, a, b, c, d) { 371 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; 372 } 373 function didChangeN(forkRef, newRefs) { 374 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]); 375 } 376 function update(forkRef, refs) { 377 forkRef.refs = refs; 378 if (refs.every((ref) => ref == null)) { 379 forkRef.callback = null; 380 return; 381 } 382 forkRef.callback = (instance) => { 383 if (forkRef.cleanup) { 384 forkRef.cleanup(); 385 forkRef.cleanup = null; 386 } 387 if (instance != null) { 388 const cleanupCallbacks = Array(refs.length).fill(null); 389 for (let i = 0; i < refs.length; i += 1) { 390 const ref = refs[i]; 391 if (ref == null) { 392 continue; 393 } 394 switch (typeof ref) { 395 case "function": { 396 const refCleanup = ref(instance); 397 if (typeof refCleanup === "function") { 398 cleanupCallbacks[i] = refCleanup; 399 } 400 break; 401 } 402 case "object": { 403 ref.current = instance; 404 break; 405 } 406 default: 407 } 408 } 409 forkRef.cleanup = () => { 410 for (let i = 0; i < refs.length; i += 1) { 411 const ref = refs[i]; 412 if (ref == null) { 413 continue; 414 } 415 switch (typeof ref) { 416 case "function": { 417 const cleanupCallback = cleanupCallbacks[i]; 418 if (typeof cleanupCallback === "function") { 419 cleanupCallback(); 420 } else { 421 void ref(null); 422 } 423 break; 424 } 425 case "object": { 426 ref.current = null; 427 break; 428 } 429 default: 430 } 431 } 432 }; 433 } 434 }; 435 } 436 437 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/getReactElementRef.mjs 438 var React3 = __toESM(require_react(), 1); 439 440 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/reactVersion.mjs 441 var React2 = __toESM(require_react(), 1); 442 var majorVersion = parseInt(React2.version, 10); 443 function isReactVersionAtLeast(reactVersionToCheck) { 444 return majorVersion >= reactVersionToCheck; 445 } 446 447 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/getReactElementRef.mjs 448 function getReactElementRef(element) { 449 if (!/* @__PURE__ */ React3.isValidElement(element)) { 450 return null; 451 } 452 const reactElement = element; 453 const propsWithRef = reactElement.props; 454 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; 455 } 456 457 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/mergeObjects.mjs 458 function mergeObjects(a, b) { 459 if (a && !b) { 460 return a; 461 } 462 if (!a && b) { 463 return b; 464 } 465 if (a || b) { 466 return { 467 ...a, 468 ...b 469 }; 470 } 471 return void 0; 472 } 473 474 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/createLogOnce.mjs 475 var loggedMessages; 476 if (true) { 477 loggedMessages = /* @__PURE__ */ new Set(); 478 } 479 function createLogOnce(severity, prefix) { 480 return function logOnce(...messages) { 481 if (true) { 482 const message = messages.join(" "); 483 const output = prefix ? `$prefix}: $message}` : message; 484 const key = `$severity}:$output}`; 485 if (!loggedMessages.has(key)) { 486 loggedMessages.add(key); 487 if (severity === "warn") { 488 console.warn(output); 489 } else { 490 console.error(output); 491 } 492 } 493 } 494 }; 495 } 496 497 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/warn.mjs 498 var warn = createLogOnce("warn", "Base UI"); 499 500 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/empty.mjs 501 function NOOP() { 502 } 503 var EMPTY_ARRAY = Object.freeze([]); 504 var EMPTY_OBJECT = Object.freeze({}); 505 506 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/getStateAttributesProps.mjs 507 function getStateAttributesProps(state, customMapping) { 508 const props = {}; 509 for (const key in state) { 510 const value = state[key]; 511 if (customMapping?.hasOwnProperty(key)) { 512 const customProps = customMapping[key](value); 513 if (customProps != null) { 514 Object.assign(props, customProps); 515 } 516 continue; 517 } 518 if (value === true) { 519 props[`data-$key.toLowerCase()}`] = ""; 520 } else if (value) { 521 props[`data-$key.toLowerCase()}`] = value.toString(); 522 } 523 } 524 return props; 525 } 526 527 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveClassName.mjs 528 function resolveClassName(className, state) { 529 return typeof className === "function" ? className(state) : className; 530 } 531 532 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveStyle.mjs 533 function resolveStyle(style, state) { 534 return typeof style === "function" ? style(state) : style; 535 } 536 537 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/merge-props/mergeProps.mjs 538 var EMPTY_PROPS = {}; 539 function mergeProps(a, b, c, d, e) { 540 if (!c && !d && !e && !a) { 541 return createInitialMergedProps(b); 542 } 543 let merged = createInitialMergedProps(a); 544 if (b) { 545 merged = mergeInto(merged, b); 546 } 547 if (c) { 548 merged = mergeInto(merged, c); 549 } 550 if (d) { 551 merged = mergeInto(merged, d); 552 } 553 if (e) { 554 merged = mergeInto(merged, e); 555 } 556 return merged; 557 } 558 function mergePropsN(props) { 559 if (props.length === 0) { 560 return EMPTY_PROPS; 561 } 562 if (props.length === 1) { 563 return createInitialMergedProps(props[0]); 564 } 565 let merged = createInitialMergedProps(props[0]); 566 for (let i = 1; i < props.length; i += 1) { 567 merged = mergeInto(merged, props[i]); 568 } 569 return merged; 570 } 571 function createInitialMergedProps(inputProps) { 572 if (isPropsGetter(inputProps)) { 573 return { 574 ...inputProps(EMPTY_PROPS) 575 }; 576 } 577 return copyInitialProps(inputProps); 578 } 579 function mergeInto(merged, inputProps) { 580 if (isPropsGetter(inputProps)) { 581 return inputProps(merged); 582 } 583 return mutablyMergeInto(merged, inputProps); 584 } 585 function copyInitialProps(inputProps) { 586 const copiedProps = { 587 ...inputProps 588 }; 589 for (const propName in copiedProps) { 590 const propValue = copiedProps[propName]; 591 if (isEventHandler(propName, propValue)) { 592 copiedProps[propName] = wrapEventHandler(propValue); 593 } 594 } 595 return copiedProps; 596 } 597 function mutablyMergeInto(mergedProps, externalProps) { 598 if (!externalProps) { 599 return mergedProps; 600 } 601 for (const propName in externalProps) { 602 const externalPropValue = externalProps[propName]; 603 switch (propName) { 604 case "style": { 605 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); 606 break; 607 } 608 case "className": { 609 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); 610 break; 611 } 612 default: { 613 if (isEventHandler(propName, externalPropValue)) { 614 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); 615 } else { 616 mergedProps[propName] = externalPropValue; 617 } 618 } 619 } 620 } 621 return mergedProps; 622 } 623 function isEventHandler(key, value) { 624 const code0 = key.charCodeAt(0); 625 const code1 = key.charCodeAt(1); 626 const code2 = key.charCodeAt(2); 627 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); 628 } 629 function isPropsGetter(inputProps) { 630 return typeof inputProps === "function"; 631 } 632 function mergeEventHandlers(ourHandler, theirHandler) { 633 if (!theirHandler) { 634 return ourHandler; 635 } 636 if (!ourHandler) { 637 return wrapEventHandler(theirHandler); 638 } 639 return (...args) => { 640 const event = args[0]; 641 if (isSyntheticEvent(event)) { 642 const baseUIEvent = event; 643 makeEventPreventable(baseUIEvent); 644 const result2 = theirHandler(...args); 645 if (!baseUIEvent.baseUIHandlerPrevented) { 646 ourHandler?.(...args); 647 } 648 return result2; 649 } 650 const result = theirHandler(...args); 651 ourHandler?.(...args); 652 return result; 653 }; 654 } 655 function wrapEventHandler(handler) { 656 if (!handler) { 657 return handler; 658 } 659 return (...args) => { 660 const event = args[0]; 661 if (isSyntheticEvent(event)) { 662 makeEventPreventable(event); 663 } 664 return handler(...args); 665 }; 666 } 667 function makeEventPreventable(event) { 668 event.preventBaseUIHandler = () => { 669 event.baseUIHandlerPrevented = true; 670 }; 671 return event; 672 } 673 function mergeClassNames(ourClassName, theirClassName) { 674 if (theirClassName) { 675 if (ourClassName) { 676 return theirClassName + " " + ourClassName; 677 } 678 return theirClassName; 679 } 680 return ourClassName; 681 } 682 function isSyntheticEvent(event) { 683 return event != null && typeof event === "object" && "nativeEvent" in event; 684 } 685 686 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useRenderElement.mjs 687 var import_react = __toESM(require_react(), 1); 688 function useRenderElement(element, componentProps, params = {}) { 689 let renderProp = componentProps.render; 690 if (params.enabled !== false) { 691 renderProp = unwrapLazyRenderProp(renderProp); 692 } 693 const outProps = useRenderElementProps(componentProps, params, renderProp); 694 if (params.enabled === false) { 695 return null; 696 } 697 const state = params.state ?? EMPTY_OBJECT; 698 return evaluateRenderProp(element, renderProp, outProps, state); 699 } 700 function useRenderElementProps(componentProps, params, renderProp) { 701 const { 702 className: classNameProp, 703 style: styleProp 704 } = componentProps; 705 const { 706 state = EMPTY_OBJECT, 707 ref, 708 props, 709 stateAttributesMapping, 710 enabled = true 711 } = params; 712 const className = enabled ? resolveClassName(classNameProp, state) : void 0; 713 const style = enabled ? resolveStyle(styleProp, state) : void 0; 714 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping) : EMPTY_OBJECT; 715 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; 716 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; 717 if (typeof document !== "undefined") { 718 if (!enabled) { 719 void useMergedRefs(null, null); 720 } else if (Array.isArray(ref)) { 721 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); 722 } else { 723 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); 724 } 725 } 726 if (!enabled) { 727 return EMPTY_OBJECT; 728 } 729 if (className !== void 0) { 730 outProps.className = mergeClassNames(outProps.className, className); 731 } 732 if (style !== void 0) { 733 outProps.style = mergeObjects(outProps.style, style); 734 } 735 return outProps; 736 } 737 function resolveRenderFunctionProps(props) { 738 if (Array.isArray(props)) { 739 return mergePropsN(props); 740 } 741 return mergeProps(void 0, props); 742 } 743 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 744 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; 745 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; 746 function unwrapLazyRenderProp(render) { 747 if (render?.$$typeof !== REACT_LAZY_TYPE) { 748 return render; 749 } 750 const unwrapped = React4.Children.toArray(render)[0]; 751 return /* @__PURE__ */ React4.isValidElement(unwrapped) ? unwrapped : render; 752 } 753 function evaluateRenderProp(element, render, props, state) { 754 if (render) { 755 if (typeof render === "function") { 756 if (true) { 757 warnIfRenderPropLooksLikeComponent(render); 758 } 759 return render(props, state); 760 } 761 const mergedProps = mergeProps(props, render.props); 762 mergedProps.ref = props.ref; 763 if (true) { 764 if (!/* @__PURE__ */ React4.isValidElement(render)) { 765 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")); 766 } 767 } 768 return /* @__PURE__ */ React4.cloneElement(render, mergedProps); 769 } 770 return renderTag(element, props); 771 } 772 function warnIfRenderPropLooksLikeComponent(renderFn) { 773 const functionName = renderFn.name; 774 if (functionName.length === 0) { 775 return; 776 } 777 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { 778 return; 779 } 780 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { 781 return; 782 } 783 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"); 784 } 785 function renderTag(Tag, props) { 786 if (Tag === "button") { 787 return /* @__PURE__ */ (0, import_react.createElement)("button", { 788 type: "button", 789 ...props, 790 key: props.key 791 }); 792 } 793 if (Tag === "img") { 794 return /* @__PURE__ */ (0, import_react.createElement)("img", { 795 alt: "", 796 ...props, 797 key: props.key 798 }); 799 } 800 return /* @__PURE__ */ React4.createElement(Tag, props); 801 } 802 803 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/safeReact.mjs 804 var React5 = __toESM(require_react(), 1); 805 var SafeReact = { 806 ...React5 807 }; 808 809 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useStableCallback.mjs 810 var useInsertionEffect = SafeReact.useInsertionEffect; 811 var useSafeInsertionEffect = ( 812 // React 17 doesn't have useInsertionEffect. 813 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. 814 useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() 815 ); 816 function useStableCallback(callback) { 817 const stable = useRefWithInit(createStableCallback).current; 818 stable.next = callback; 819 useSafeInsertionEffect(stable.effect); 820 return stable.trampoline; 821 } 822 function createStableCallback() { 823 const stable = { 824 next: void 0, 825 callback: assertNotCalled, 826 trampoline: (...args) => stable.callback?.(...args), 827 effect: () => { 828 stable.callback = stable.next; 829 } 830 }; 831 return stable; 832 } 833 function assertNotCalled() { 834 if (true) { 835 throw ( 836 /* minify-error-disabled */ 837 new Error("Base UI: Cannot call an event handler while rendering.") 838 ); 839 } 840 } 841 842 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useIsoLayoutEffect.mjs 843 var React6 = __toESM(require_react(), 1); 844 var noop = () => { 845 }; 846 var useIsoLayoutEffect = typeof document !== "undefined" ? React6.useLayoutEffect : noop; 847 848 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 849 var React8 = __toESM(require_react(), 1); 850 851 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 852 var ReactDOM = __toESM(require_react_dom(), 1); 853 854 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useOnMount.mjs 855 var React7 = __toESM(require_react(), 1); 856 function useOnMount(fn) { 857 React7.useEffect(fn, EMPTY_ARRAY); 858 } 859 860 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useAnimationFrame.mjs 861 var EMPTY = null; 862 var LAST_RAF = globalThis.requestAnimationFrame; 863 var Scheduler = class { 864 /* This implementation uses an array as a backing data-structure for frame callbacks. 865 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it 866 * never calls the native `cancelAnimationFrame` if there are no frames left. This can 867 * be much more efficient if there is a call pattern that alterns as 868 * "request-cancel-request-cancel-…". 869 * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation 870 * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ 871 callbacks = []; 872 callbacksCount = 0; 873 nextId = 1; 874 startId = 1; 875 isScheduled = false; 876 tick = (timestamp) => { 877 this.isScheduled = false; 878 const currentCallbacks = this.callbacks; 879 const currentCallbacksCount = this.callbacksCount; 880 this.callbacks = []; 881 this.callbacksCount = 0; 882 this.startId = this.nextId; 883 if (currentCallbacksCount > 0) { 884 for (let i = 0; i < currentCallbacks.length; i += 1) { 885 currentCallbacks[i]?.(timestamp); 886 } 887 } 888 }; 889 request(fn) { 890 const id = this.nextId; 891 this.nextId += 1; 892 this.callbacks.push(fn); 893 this.callbacksCount += 1; 894 const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); 895 if (!this.isScheduled || didRAFChange) { 896 requestAnimationFrame(this.tick); 897 this.isScheduled = true; 898 } 899 return id; 900 } 901 cancel(id) { 902 const index2 = id - this.startId; 903 if (index2 < 0 || index2 >= this.callbacks.length) { 904 return; 905 } 906 if (this.callbacks[index2] === null) { 907 return; 908 } 909 this.callbacks[index2] = null; 910 this.callbacksCount -= 1; 911 } 912 }; 913 var scheduler = new Scheduler(); 914 var AnimationFrame = class _AnimationFrame { 915 static create() { 916 return new _AnimationFrame(); 917 } 918 static request(fn) { 919 return scheduler.request(fn); 920 } 921 static cancel(id) { 922 return scheduler.cancel(id); 923 } 924 currentId = EMPTY; 925 /** 926 * Executes `fn` after `delay`, clearing any previously scheduled call. 927 */ 928 request(fn) { 929 this.cancel(); 930 this.currentId = scheduler.request(() => { 931 this.currentId = EMPTY; 932 fn(); 933 }); 934 } 935 cancel = () => { 936 if (this.currentId !== EMPTY) { 937 scheduler.cancel(this.currentId); 938 this.currentId = EMPTY; 939 } 940 }; 941 disposeEffect = () => { 942 return this.cancel; 943 }; 944 }; 945 function useAnimationFrame() { 946 const timeout = useRefWithInit(AnimationFrame.create).current; 947 useOnMount(timeout.disposeEffect); 948 return timeout; 949 } 950 951 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/resolveRef.mjs 952 function resolveRef(maybeRef) { 953 if (maybeRef == null) { 954 return maybeRef; 955 } 956 return "current" in maybeRef ? maybeRef.current : maybeRef; 957 } 958 959 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/getFiniteAnimations.mjs 960 function getFiniteAnimations(element, options) { 961 return element.getAnimations(options).filter((animation) => { 962 const timing = animation.effect?.getTiming(); 963 return timing?.duration !== Infinity && timing?.iterations !== Infinity; 964 }); 965 } 966 967 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/TransitionStatusDataAttributes.mjs 968 var startingStyle = "data-starting-style"; 969 var endingStyle = "data-ending-style"; 970 971 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnimationsFinished.mjs 972 var pendingCallbacks = null; 973 function flushBeforePaint(fn) { 974 if (!pendingCallbacks) { 975 const callbacks = []; 976 pendingCallbacks = callbacks; 977 queueMicrotask(() => { 978 pendingCallbacks = null; 979 ReactDOM.flushSync(() => { 980 for (const callback of callbacks) { 981 callback(); 982 } 983 }); 984 }); 985 } 986 pendingCallbacks.push(fn); 987 } 988 function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, batch = false) { 989 const frame = useAnimationFrame(); 990 return useStableCallback((fnToExecute, signal = null) => { 991 frame.cancel(); 992 const element = resolveRef(elementOrRef); 993 if (element == null) { 994 return; 995 } 996 const resolvedElement = element; 997 const done = () => { 998 if (!batch) { 999 ReactDOM.flushSync(fnToExecute); 1000 return; 1001 } 1002 flushBeforePaint(() => { 1003 if (!signal?.aborted) { 1004 fnToExecute(); 1005 } 1006 }); 1007 }; 1008 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { 1009 fnToExecute(); 1010 return; 1011 } 1012 function exec() { 1013 Promise.all(getFiniteAnimations(resolvedElement).map((animation) => animation.finished.then(NOOP))).then(() => { 1014 if (!signal?.aborted) { 1015 done(); 1016 } 1017 }, () => { 1018 if (signal?.aborted) { 1019 return; 1020 } 1021 const currentAnimations = getFiniteAnimations(resolvedElement); 1022 if (currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { 1023 exec(); 1024 return; 1025 } 1026 done(); 1027 }); 1028 } 1029 if (waitForStartingStyleRemoved) { 1030 const startingStyleAttribute = startingStyle; 1031 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1032 frame.request(exec); 1033 return; 1034 } 1035 const attributeObserver = new MutationObserver(() => { 1036 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1037 attributeObserver.disconnect(); 1038 exec(); 1039 } 1040 }); 1041 attributeObserver.observe(resolvedElement, { 1042 attributes: true, 1043 attributeFilter: [startingStyleAttribute] 1044 }); 1045 signal?.addEventListener("abort", () => attributeObserver.disconnect(), { 1046 once: true 1047 }); 1048 return; 1049 } 1050 frame.request(exec); 1051 }); 1052 } 1053 1054 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useOpenChangeComplete.mjs 1055 function useOpenChangeComplete(parameters) { 1056 const { 1057 enabled = true, 1058 open: open2, 1059 ref, 1060 batch = false, 1061 onComplete: onCompleteParam 1062 } = parameters; 1063 const onComplete = useStableCallback(onCompleteParam); 1064 const runOnceAnimationsFinish = useAnimationsFinished(ref, open2, batch); 1065 React8.useEffect(() => { 1066 if (!enabled) { 1067 return void 0; 1068 } 1069 const abortController = new AbortController(); 1070 runOnceAnimationsFinish(onComplete, abortController.signal); 1071 return () => { 1072 abortController.abort(); 1073 }; 1074 }, [enabled, open2, onComplete, runOnceAnimationsFinish]); 1075 } 1076 1077 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/stateAttributesMapping.mjs 1078 var STARTING_HOOK = { 1079 [startingStyle]: "" 1080 }; 1081 var ENDING_HOOK = { 1082 [endingStyle]: "" 1083 }; 1084 var transitionStatusMapping = { 1085 transitionStatus(value) { 1086 if (value === "starting") { 1087 return STARTING_HOOK; 1088 } 1089 if (value === "ending") { 1090 return ENDING_HOOK; 1091 } 1092 return null; 1093 } 1094 }; 1095 1096 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useTransitionStatus.mjs 1097 var React9 = __toESM(require_react(), 1); 1098 function useTransitionStatus(open2, enableIdleState = false, deferEndingState = false, animateInitialOpen = false) { 1099 const [transitionStatus, setTransitionStatus] = React9.useState(open2 && enableIdleState ? "idle" : void 0); 1100 const [mounted, setMounted] = React9.useState(open2 && !animateInitialOpen); 1101 if (open2 && !mounted) { 1102 setMounted(true); 1103 setTransitionStatus("starting"); 1104 } 1105 if (!open2 && mounted && transitionStatus !== "ending" && !deferEndingState) { 1106 setTransitionStatus("ending"); 1107 } 1108 if (!open2 && !mounted && transitionStatus === "ending") { 1109 setTransitionStatus(void 0); 1110 } 1111 useIsoLayoutEffect(() => { 1112 if (!open2 && mounted && transitionStatus !== "ending" && deferEndingState) { 1113 const frame = AnimationFrame.request(() => { 1114 setTransitionStatus("ending"); 1115 }); 1116 return () => { 1117 AnimationFrame.cancel(frame); 1118 }; 1119 } 1120 return void 0; 1121 }, [open2, mounted, transitionStatus, deferEndingState]); 1122 useIsoLayoutEffect(() => { 1123 if (!open2 || enableIdleState || transitionStatus === void 0) { 1124 return void 0; 1125 } 1126 const frame = AnimationFrame.request(() => { 1127 setTransitionStatus(void 0); 1128 }); 1129 return () => { 1130 AnimationFrame.cancel(frame); 1131 }; 1132 }, [enableIdleState, open2, transitionStatus]); 1133 useIsoLayoutEffect(() => { 1134 if (!open2 || !enableIdleState) { 1135 return void 0; 1136 } 1137 if (open2 && mounted && transitionStatus !== "idle") { 1138 setTransitionStatus("starting"); 1139 } 1140 const frame = AnimationFrame.request(() => { 1141 setTransitionStatus("idle"); 1142 }); 1143 return () => { 1144 AnimationFrame.cancel(frame); 1145 }; 1146 }, [enableIdleState, open2, mounted, transitionStatus]); 1147 return { 1148 mounted, 1149 setMounted, 1150 transitionStatus 1151 }; 1152 } 1153 1154 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useTimeout.mjs 1155 var EMPTY2 = 0; 1156 var Timeout = class _Timeout { 1157 static create() { 1158 return new _Timeout(); 1159 } 1160 currentId = EMPTY2; 1161 /** 1162 * Executes `fn` after `delay`, clearing any previously scheduled call. 1163 */ 1164 start(delay, fn) { 1165 this.clear(); 1166 this.currentId = setTimeout(() => { 1167 this.currentId = EMPTY2; 1168 fn(); 1169 }, delay); 1170 } 1171 isStarted() { 1172 return this.currentId !== EMPTY2; 1173 } 1174 clear = () => { 1175 if (this.currentId !== EMPTY2) { 1176 clearTimeout(this.currentId); 1177 this.currentId = EMPTY2; 1178 } 1179 }; 1180 disposeEffect = () => { 1181 return this.clear; 1182 }; 1183 }; 1184 function useTimeout() { 1185 const timeout = useRefWithInit(Timeout.create).current; 1186 useOnMount(timeout.disposeEffect); 1187 return timeout; 1188 } 1189 1190 // node_modules/.store/clsx@2.1.1-XOLP1vUL9vEGfpiXm37fAw/node_modules/clsx/dist/clsx.mjs 1191 function r(e) { 1192 var t, f, n = ""; 1193 if ("string" == typeof e || "number" == typeof e) n += e; 1194 else if ("object" == typeof e) if (Array.isArray(e)) { 1195 var o = e.length; 1196 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); 1197 } else for (f in e) e[f] && (n && (n += " "), n += f); 1198 return n; 1199 } 1200 function clsx() { 1201 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); 1202 return n; 1203 } 1204 var clsx_default = clsx; 1205 1206 // packages/ui/build-module/icon/icon.mjs 1207 var import_element = __toESM(require_element(), 1); 1208 var import_primitives = __toESM(require_primitives(), 1); 1209 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 1210 var Icon = (0, import_element.forwardRef)( 1211 function UnforwardedIcon({ icon, size: size4 = 24, style, ...restProps }, ref) { 1212 const mergedStyle = icon.props.style || style ? { ...icon.props.style, ...style } : void 0; 1213 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( 1214 import_primitives.SVG, 1215 { 1216 ref, 1217 ...icon.props, 1218 ...restProps, 1219 ...mergedStyle ? { style: mergedStyle } : {}, 1220 width: size4, 1221 height: size4 1222 } 1223 ); 1224 } 1225 ); 1226 1227 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useId.mjs 1228 var React11 = __toESM(require_react(), 1); 1229 1230 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useForcedRerendering.mjs 1231 var React10 = __toESM(require_react(), 1); 1232 function useForcedRerendering() { 1233 const [, setState] = React10.useState({}); 1234 return React10.useCallback(() => { 1235 setState({}); 1236 }, []); 1237 } 1238 1239 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useId.mjs 1240 var globalId = 0; 1241 function useGlobalId(idOverride, prefix = "mui") { 1242 const defaultId = React11.useRef(void 0); 1243 const forceRerender = useForcedRerendering(); 1244 const id = idOverride ?? defaultId.current; 1245 React11.useEffect(() => { 1246 if (defaultId.current == null) { 1247 globalId += 1; 1248 defaultId.current = `$prefix}-$globalId}`; 1249 if (idOverride == null) { 1250 forceRerender(); 1251 } 1252 } 1253 }, [idOverride, prefix, forceRerender]); 1254 return id; 1255 } 1256 var maybeReactUseId = SafeReact.useId; 1257 function useId(idOverride, prefix) { 1258 if (maybeReactUseId !== void 0) { 1259 const reactId = maybeReactUseId(); 1260 return idOverride ?? (prefix ? `$prefix}-$reactId}` : reactId); 1261 } 1262 return useGlobalId(idOverride, prefix); 1263 } 1264 1265 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useBaseUiId.mjs 1266 function useBaseUiId(idOverride) { 1267 return useId(idOverride, "base-ui"); 1268 } 1269 1270 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/createBaseUIEventDetails.mjs 1271 function createChangeEventDetails(reason, event, trigger, customProperties) { 1272 let canceled = false; 1273 let allowPropagation = false; 1274 const custom = customProperties ?? EMPTY_OBJECT; 1275 const details = { 1276 reason, 1277 event: event ?? new Event("base-ui"), 1278 cancel() { 1279 canceled = true; 1280 }, 1281 allowPropagation() { 1282 allowPropagation = true; 1283 }, 1284 get isCanceled() { 1285 return canceled; 1286 }, 1287 get isPropagationAllowed() { 1288 return allowPropagation; 1289 }, 1290 trigger, 1291 ...custom 1292 }; 1293 return details; 1294 } 1295 1296 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/reason-parts.mjs 1297 var reason_parts_exports = {}; 1298 __export(reason_parts_exports, { 1299 cancelOpen: () => cancelOpen, 1300 chipRemovePress: () => chipRemovePress, 1301 clearPress: () => clearPress, 1302 closePress: () => closePress, 1303 closeWatcher: () => closeWatcher, 1304 decrementPress: () => decrementPress, 1305 disabled: () => disabled, 1306 drag: () => drag, 1307 escapeKey: () => escapeKey, 1308 focusOut: () => focusOut, 1309 imperativeAction: () => imperativeAction, 1310 incrementPress: () => incrementPress, 1311 initial: () => initial, 1312 inputBlur: () => inputBlur, 1313 inputChange: () => inputChange, 1314 inputClear: () => inputClear, 1315 inputPaste: () => inputPaste, 1316 inputPress: () => inputPress, 1317 itemPress: () => itemPress, 1318 keyboard: () => keyboard, 1319 linkPress: () => linkPress, 1320 listNavigation: () => listNavigation, 1321 missing: () => missing, 1322 none: () => none, 1323 outsidePress: () => outsidePress, 1324 pointer: () => pointer, 1325 popupClose: () => popupClose, 1326 scrub: () => scrub, 1327 siblingOpen: () => siblingOpen, 1328 swipe: () => swipe, 1329 trackPress: () => trackPress, 1330 triggerFocus: () => triggerFocus, 1331 triggerHover: () => triggerHover, 1332 triggerPress: () => triggerPress, 1333 wheel: () => wheel, 1334 windowResize: () => windowResize 1335 }); 1336 var none = "none"; 1337 var triggerPress = "trigger-press"; 1338 var triggerHover = "trigger-hover"; 1339 var triggerFocus = "trigger-focus"; 1340 var outsidePress = "outside-press"; 1341 var itemPress = "item-press"; 1342 var closePress = "close-press"; 1343 var linkPress = "link-press"; 1344 var clearPress = "clear-press"; 1345 var chipRemovePress = "chip-remove-press"; 1346 var trackPress = "track-press"; 1347 var incrementPress = "increment-press"; 1348 var decrementPress = "decrement-press"; 1349 var inputChange = "input-change"; 1350 var inputClear = "input-clear"; 1351 var inputBlur = "input-blur"; 1352 var inputPaste = "input-paste"; 1353 var inputPress = "input-press"; 1354 var focusOut = "focus-out"; 1355 var escapeKey = "escape-key"; 1356 var closeWatcher = "close-watcher"; 1357 var listNavigation = "list-navigation"; 1358 var keyboard = "keyboard"; 1359 var pointer = "pointer"; 1360 var drag = "drag"; 1361 var wheel = "wheel"; 1362 var scrub = "scrub"; 1363 var popupClose = "popup-close"; 1364 var cancelOpen = "cancel-open"; 1365 var siblingOpen = "sibling-open"; 1366 var disabled = "disabled"; 1367 var missing = "missing"; 1368 var initial = "initial"; 1369 var imperativeAction = "imperative-action"; 1370 var swipe = "swipe"; 1371 var windowResize = "window-resize"; 1372 1373 // node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 1374 function hasWindow() { 1375 return typeof window !== "undefined"; 1376 } 1377 function getNodeName(node) { 1378 if (isNode(node)) { 1379 return (node.nodeName || "").toLowerCase(); 1380 } 1381 return "#document"; 1382 } 1383 function getWindow(node) { 1384 var _node$ownerDocument; 1385 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 1386 } 1387 function getDocumentElement(node) { 1388 var _ref; 1389 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 1390 } 1391 function isNode(value) { 1392 if (!hasWindow()) { 1393 return false; 1394 } 1395 return value instanceof Node || value instanceof getWindow(value).Node; 1396 } 1397 function isElement(value) { 1398 if (!hasWindow()) { 1399 return false; 1400 } 1401 return value instanceof Element || value instanceof getWindow(value).Element; 1402 } 1403 function isHTMLElement(value) { 1404 if (!hasWindow()) { 1405 return false; 1406 } 1407 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 1408 } 1409 function isShadowRoot(value) { 1410 if (!hasWindow() || typeof ShadowRoot === "undefined") { 1411 return false; 1412 } 1413 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 1414 } 1415 function isOverflowElement(element) { 1416 const { 1417 overflow, 1418 overflowX, 1419 overflowY, 1420 display 1421 } = getComputedStyle2(element); 1422 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; 1423 } 1424 function isTableElement(element) { 1425 return /^(table|td|th)$/.test(getNodeName(element)); 1426 } 1427 function isTopLayer(element) { 1428 try { 1429 if (element.matches(":popover-open")) { 1430 return true; 1431 } 1432 } catch (_e) { 1433 } 1434 try { 1435 return element.matches(":modal"); 1436 } catch (_e) { 1437 return false; 1438 } 1439 } 1440 var willChangeRe = /transform|translate|scale|rotate|perspective|filter/; 1441 var containRe = /paint|layout|strict|content/; 1442 var isNotNone = (value) => !!value && value !== "none"; 1443 var isWebKitValue; 1444 function isContainingBlock(elementOrCss) { 1445 const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; 1446 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 || ""); 1447 } 1448 function getContainingBlock(element) { 1449 let currentNode = getParentNode(element); 1450 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 1451 if (isContainingBlock(currentNode)) { 1452 return currentNode; 1453 } else if (isTopLayer(currentNode)) { 1454 return null; 1455 } 1456 currentNode = getParentNode(currentNode); 1457 } 1458 return null; 1459 } 1460 function isWebKit() { 1461 if (isWebKitValue == null) { 1462 isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); 1463 } 1464 return isWebKitValue; 1465 } 1466 function isLastTraversableNode(node) { 1467 return /^(html|body|#document)$/.test(getNodeName(node)); 1468 } 1469 function getComputedStyle2(element) { 1470 return getWindow(element).getComputedStyle(element); 1471 } 1472 function getNodeScroll(element) { 1473 if (isElement(element)) { 1474 return { 1475 scrollLeft: element.scrollLeft, 1476 scrollTop: element.scrollTop 1477 }; 1478 } 1479 return { 1480 scrollLeft: element.scrollX, 1481 scrollTop: element.scrollY 1482 }; 1483 } 1484 function getParentNode(node) { 1485 if (getNodeName(node) === "html") { 1486 return node; 1487 } 1488 const result = ( 1489 // Step into the shadow DOM of the parent of a slotted node. 1490 node.assignedSlot || // DOM Element detected. 1491 node.parentNode || // ShadowRoot detected. 1492 isShadowRoot(node) && node.host || // Fallback. 1493 getDocumentElement(node) 1494 ); 1495 return isShadowRoot(result) ? result.host : result; 1496 } 1497 function getNearestOverflowAncestor(node) { 1498 const parentNode = getParentNode(node); 1499 if (isLastTraversableNode(parentNode)) { 1500 return (node.ownerDocument || node).body; 1501 } 1502 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 1503 return parentNode; 1504 } 1505 return getNearestOverflowAncestor(parentNode); 1506 } 1507 function getOverflowAncestors(node, list, traverseIframes) { 1508 var _node$ownerDocument2; 1509 if (list === void 0) { 1510 list = []; 1511 } 1512 if (traverseIframes === void 0) { 1513 traverseIframes = true; 1514 } 1515 const scrollableAncestor = getNearestOverflowAncestor(node); 1516 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 1517 const win = getWindow(scrollableAncestor); 1518 if (isBody) { 1519 const frameElement = getFrameElement(win); 1520 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 1521 } else { 1522 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 1523 } 1524 } 1525 function getFrameElement(win) { 1526 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 1527 } 1528 1529 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/owner.mjs 1530 function ownerDocument(node) { 1531 return node?.ownerDocument || document; 1532 } 1533 1534 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/addEventListener.mjs 1535 function addEventListener(target, type, listener, options) { 1536 target.addEventListener(type, listener, options); 1537 return () => { 1538 target.removeEventListener(type, listener, options); 1539 }; 1540 } 1541 1542 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/useValueAsRef.mjs 1543 function useValueAsRef(value) { 1544 const latest = useRefWithInit(createLatestRef, value).current; 1545 latest.next = value; 1546 useIsoLayoutEffect(latest.effect); 1547 return latest; 1548 } 1549 function createLatestRef(value) { 1550 const latest = { 1551 current: value, 1552 next: value, 1553 effect: () => { 1554 latest.current = latest.next; 1555 } 1556 }; 1557 return latest; 1558 } 1559 1560 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/parts.mjs 1561 var parts_exports = {}; 1562 __export(parts_exports, { 1563 engine: () => engine_exports, 1564 env: () => env_exports, 1565 mediaQuery: () => media_query_exports, 1566 os: () => os_exports, 1567 screenReader: () => screen_reader_exports 1568 }); 1569 1570 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/os.mjs 1571 var os_exports = {}; 1572 __export(os_exports, { 1573 android: () => android, 1574 apple: () => apple, 1575 ios: () => ios, 1576 linux: () => linux, 1577 mac: () => mac, 1578 windows: () => windows 1579 }); 1580 1581 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/shared.mjs 1582 function readRawData() { 1583 if (typeof navigator === "undefined") { 1584 return { 1585 userAgent: "", 1586 platform: "", 1587 maxTouchPoints: 0 1588 }; 1589 } 1590 if (true) { 1591 const uaData = navigator.userAgentData; 1592 if (uaData && Array.isArray(uaData.brands)) { 1593 return { 1594 userAgent: uaData.brands.map(({ 1595 brand, 1596 version: version3 1597 }) => `$brand}/$version3}`).join(" "), 1598 platform: uaData.platform ?? navigator.platform ?? "", 1599 maxTouchPoints: navigator.maxTouchPoints ?? 0 1600 }; 1601 } 1602 } 1603 return { 1604 userAgent: navigator.userAgent, 1605 platform: navigator.platform ?? "", 1606 maxTouchPoints: navigator.maxTouchPoints ?? 0 1607 }; 1608 } 1609 var { 1610 userAgent, 1611 platform, 1612 maxTouchPoints 1613 } = readRawData(); 1614 var lowerUserAgent = userAgent.toLowerCase(); 1615 var lowerPlatform = platform.toLowerCase(); 1616 1617 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/os.mjs 1618 var ios = /^i(os$|p)/.test(lowerPlatform) || lowerPlatform === "macintel" && maxTouchPoints > 1; 1619 var ANDROID_STRING = "android"; 1620 var android = lowerPlatform === ANDROID_STRING || lowerUserAgent.includes(ANDROID_STRING); 1621 var mac = !ios && lowerPlatform.startsWith("mac"); 1622 var windows = lowerPlatform.startsWith("win"); 1623 var linux = !android && /^(linux|chrome os)/.test(lowerPlatform); 1624 var apple = mac || ios; 1625 1626 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/engine.mjs 1627 var engine_exports = {}; 1628 __export(engine_exports, { 1629 blink: () => blink, 1630 gecko: () => gecko, 1631 webkit: () => webkit 1632 }); 1633 var webkit = typeof CSS !== "undefined" && !!CSS.supports?.("-webkit-backdrop-filter:none"); 1634 var gecko = !webkit && lowerUserAgent.includes("firefox"); 1635 var blink = !webkit && lowerUserAgent.includes("chrom"); 1636 1637 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/screen-reader.mjs 1638 var screen_reader_exports = {}; 1639 __export(screen_reader_exports, { 1640 voiceOver: () => voiceOver 1641 }); 1642 var voiceOver = apple; 1643 1644 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/env.mjs 1645 var env_exports = {}; 1646 __export(env_exports, { 1647 jsdom: () => jsdom 1648 }); 1649 var jsdom = /jsdom|happydom/.test(lowerUserAgent); 1650 1651 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/platform/media-query.mjs 1652 var media_query_exports = {}; 1653 __export(media_query_exports, { 1654 iOS: () => iOS 1655 }); 1656 var iOS = "@supports (-webkit-touch-callout: none)"; 1657 1658 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs 1659 var React12 = __toESM(require_react(), 1); 1660 1661 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/event.mjs 1662 function isReactEvent(event) { 1663 return "nativeEvent" in event; 1664 } 1665 function isVirtualClick(event) { 1666 if (event.pointerType === "" && event.isTrusted) { 1667 return true; 1668 } 1669 if (parts_exports.os.android && event.pointerType) { 1670 return event.type === "click" && event.buttons === 1; 1671 } 1672 return event.detail === 0 && !event.pointerType; 1673 } 1674 function isMouseLikePointerType(pointerType, strict) { 1675 const values = ["mouse", "pen"]; 1676 if (!strict) { 1677 values.push("", void 0); 1678 } 1679 return values.includes(pointerType); 1680 } 1681 function isClickLikeEvent(event) { 1682 const type = event.type; 1683 return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; 1684 } 1685 1686 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/shadowDom.mjs 1687 function activeElement(doc) { 1688 let element = doc.activeElement; 1689 while (element?.shadowRoot?.activeElement != null) { 1690 element = element.shadowRoot.activeElement; 1691 } 1692 return element; 1693 } 1694 function contains(parent, child) { 1695 if (!parent || !child) { 1696 return false; 1697 } 1698 const rootNode = child.getRootNode?.(); 1699 if (parent.contains(child)) { 1700 return true; 1701 } 1702 if (rootNode && isShadowRoot(rootNode)) { 1703 let next = child; 1704 while (next) { 1705 if (parent === next) { 1706 return true; 1707 } 1708 next = next.parentNode || next.host; 1709 } 1710 } 1711 return false; 1712 } 1713 function closest(node, selector) { 1714 let current = node; 1715 while (current) { 1716 if (isElement(current) && current.matches(selector)) { 1717 return current; 1718 } 1719 current = current.assignedSlot ?? current.parentNode ?? (isShadowRoot(current) ? current.host : null); 1720 } 1721 return null; 1722 } 1723 function getTarget(event) { 1724 if ("composedPath" in event) { 1725 return event.composedPath()[0] ?? event.target; 1726 } 1727 return event.target; 1728 } 1729 1730 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/constants.mjs 1731 var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; 1732 var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; 1733 1734 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPopupDataAttributes.mjs 1735 var open = "data-open"; 1736 var closed = "data-closed"; 1737 var anchorHidden = "data-anchor-hidden"; 1738 1739 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonTriggerDataAttributes.mjs 1740 var CommonTriggerDataAttributes_exports = {}; 1741 __export(CommonTriggerDataAttributes_exports, { 1742 popupOpen: () => popupOpen, 1743 pressed: () => pressed 1744 }); 1745 var popupOpen = "data-popup-open"; 1746 var pressed = "data-pressed"; 1747 1748 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popupStateMapping.mjs 1749 var TRIGGER_HOOK = { 1750 [popupOpen]: "" 1751 }; 1752 var PRESSABLE_TRIGGER_HOOK = { 1753 [popupOpen]: "", 1754 [pressed]: "" 1755 }; 1756 var POPUP_OPEN_HOOK = { 1757 [open]: "" 1758 }; 1759 var POPUP_CLOSED_HOOK = { 1760 [closed]: "" 1761 }; 1762 var ANCHOR_HIDDEN_HOOK = { 1763 [anchorHidden]: "" 1764 }; 1765 var triggerOpenStateMapping = { 1766 open(value) { 1767 if (value) { 1768 return TRIGGER_HOOK; 1769 } 1770 return null; 1771 } 1772 }; 1773 var popupStateMapping = { 1774 open(value) { 1775 if (value) { 1776 return POPUP_OPEN_HOOK; 1777 } 1778 return POPUP_CLOSED_HOOK; 1779 }, 1780 anchorHidden(value) { 1781 if (value) { 1782 return ANCHOR_HIDDEN_HOOK; 1783 } 1784 return null; 1785 } 1786 }; 1787 var popupTransitionStateMapping = { 1788 ...popupStateMapping, 1789 ...transitionStatusMapping 1790 }; 1791 1792 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTriggerDataAttributes.mjs 1793 var popupOpen2 = CommonTriggerDataAttributes_exports.popupOpen; 1794 var triggerDisabled = "data-trigger-disabled"; 1795 1796 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/element.mjs 1797 function isTargetInsideEnabledTrigger(target, triggerElements) { 1798 if (!isElement(target)) { 1799 return false; 1800 } 1801 const targetElement = target; 1802 if (triggerElements.hasElement(targetElement)) { 1803 return !targetElement.hasAttribute(triggerDisabled); 1804 } 1805 for (const [, trigger] of triggerElements.entries()) { 1806 if (contains(trigger, targetElement)) { 1807 return !trigger.hasAttribute(triggerDisabled); 1808 } 1809 } 1810 return false; 1811 } 1812 function isEventTargetWithin(event, node) { 1813 if (node == null) { 1814 return false; 1815 } 1816 if ("composedPath" in event) { 1817 return event.composedPath().includes(node); 1818 } 1819 const eventAgain = event; 1820 return eventAgain.target != null && node.contains(eventAgain.target); 1821 } 1822 function isRootElement(element) { 1823 return element.matches("html,body"); 1824 } 1825 function isTypeableElement(element) { 1826 return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); 1827 } 1828 function isInteractiveElement(element) { 1829 return closest(element, `button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),$TYPEABLE_SELECTOR}`) != null; 1830 } 1831 function matchesFocusVisible(element) { 1832 if (!element || parts_exports.env.jsdom) { 1833 return true; 1834 } 1835 try { 1836 return element.matches(":focus-visible"); 1837 } catch (_e) { 1838 return true; 1839 } 1840 } 1841 1842 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverShared.mjs 1843 function resolveValue(value, pointerType) { 1844 if (pointerType != null && !isMouseLikePointerType(pointerType)) { 1845 return 0; 1846 } 1847 if (typeof value === "function") { 1848 return value(); 1849 } 1850 return value; 1851 } 1852 function getDelay(value, prop, pointerType) { 1853 const result = resolveValue(value, pointerType); 1854 if (typeof result === "number") { 1855 return result; 1856 } 1857 return result?.[prop]; 1858 } 1859 function getRestMs(value) { 1860 if (typeof value === "function") { 1861 return value(); 1862 } 1863 return value; 1864 } 1865 function isClickLikeOpenEvent(openEventType, interactedInside) { 1866 return interactedInside || openEventType === "click" || openEventType === "mousedown"; 1867 } 1868 function isHoverOpenEvent(openEventType) { 1869 return openEventType?.includes("mouse") && openEventType !== "mousedown"; 1870 } 1871 1872 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingDelayGroup.mjs 1873 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 1874 var FloatingDelayGroupContext = /* @__PURE__ */ React12.createContext({ 1875 hasProvider: false, 1876 timeoutMs: 0, 1877 delayRef: { 1878 current: 0 1879 }, 1880 initialDelayRef: { 1881 current: 0 1882 }, 1883 timeout: new Timeout(), 1884 currentIdRef: { 1885 current: null 1886 }, 1887 currentContextRef: { 1888 current: null 1889 } 1890 }); 1891 if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext"; 1892 function resetDelayRef(delayRef, initialDelayRef) { 1893 delayRef.current = initialDelayRef.current; 1894 } 1895 function FloatingDelayGroup(props) { 1896 const { 1897 children, 1898 delay, 1899 timeoutMs = 0 1900 } = props; 1901 const delayRef = React12.useRef(delay); 1902 const initialDelayRef = React12.useRef(delay); 1903 const currentIdRef = React12.useRef(null); 1904 const currentContextRef = React12.useRef(null); 1905 const timeout = useTimeout(); 1906 useIsoLayoutEffect(() => { 1907 initialDelayRef.current = delay; 1908 if (!currentIdRef.current) { 1909 delayRef.current = delay; 1910 return; 1911 } 1912 delayRef.current = { 1913 open: getDelay(delayRef.current, "open"), 1914 close: getDelay(delay, "close") 1915 }; 1916 }, [delay, currentIdRef, delayRef, initialDelayRef]); 1917 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)(FloatingDelayGroupContext.Provider, { 1918 value: React12.useMemo(() => ({ 1919 hasProvider: true, 1920 delayRef, 1921 initialDelayRef, 1922 currentIdRef, 1923 timeoutMs, 1924 currentContextRef, 1925 timeout 1926 }), [timeoutMs, timeout]), 1927 children 1928 }); 1929 } 1930 function useDelayGroup(store2, options = { 1931 open: false 1932 }) { 1933 const { 1934 open: open2 1935 } = options; 1936 const floatingId = store2.useState("floatingId"); 1937 const groupContext = React12.useContext(FloatingDelayGroupContext); 1938 const { 1939 currentIdRef, 1940 delayRef, 1941 timeoutMs, 1942 initialDelayRef, 1943 currentContextRef, 1944 hasProvider, 1945 timeout 1946 } = groupContext; 1947 const [isInstantPhase, setIsInstantPhase] = React12.useState(false); 1948 const openRef = React12.useRef(open2); 1949 useIsoLayoutEffect(() => { 1950 openRef.current = open2; 1951 }, [open2]); 1952 useIsoLayoutEffect(() => { 1953 function unset() { 1954 currentContextRef.current?.setIsInstantPhase(false); 1955 currentIdRef.current = null; 1956 currentContextRef.current = null; 1957 delayRef.current = initialDelayRef.current; 1958 timeout.clear(); 1959 } 1960 if (!currentIdRef.current) { 1961 return void 0; 1962 } 1963 if (!open2 && currentIdRef.current === floatingId) { 1964 setIsInstantPhase(false); 1965 if (timeoutMs) { 1966 const closingId = floatingId; 1967 timeout.start(timeoutMs, () => { 1968 if (store2.select("open") || currentIdRef.current && currentIdRef.current !== closingId) { 1969 return; 1970 } 1971 unset(); 1972 }); 1973 return () => { 1974 if (openRef.current || currentIdRef.current !== closingId) { 1975 timeout.clear(); 1976 } 1977 }; 1978 } 1979 unset(); 1980 } 1981 return void 0; 1982 }, [open2, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store2]); 1983 useIsoLayoutEffect(() => { 1984 if (!open2) { 1985 return; 1986 } 1987 const prevContext = currentContextRef.current; 1988 const prevId = currentIdRef.current; 1989 timeout.clear(); 1990 currentContextRef.current = { 1991 onOpenChange: store2.setOpen, 1992 setIsInstantPhase 1993 }; 1994 currentIdRef.current = floatingId; 1995 delayRef.current = { 1996 open: 0, 1997 close: getDelay(initialDelayRef.current, "close") 1998 }; 1999 if (prevId !== null && prevId !== floatingId) { 2000 setIsInstantPhase(true); 2001 prevContext?.setIsInstantPhase(true); 2002 prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none)); 2003 } else { 2004 setIsInstantPhase(false); 2005 prevContext?.setIsInstantPhase(false); 2006 } 2007 }, [open2, floatingId, store2, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); 2008 useIsoLayoutEffect(() => { 2009 return () => { 2010 if (currentIdRef.current === floatingId) { 2011 currentContextRef.current = null; 2012 if (!openRef.current) { 2013 return; 2014 } 2015 currentIdRef.current = null; 2016 resetDelayRef(delayRef, initialDelayRef); 2017 timeout.clear(); 2018 } 2019 }; 2020 }, [currentContextRef, currentIdRef, delayRef, floatingId, initialDelayRef, timeout]); 2021 return React12.useMemo(() => ({ 2022 activeIdRef: currentIdRef, 2023 hasProvider, 2024 delayRef, 2025 isInstantPhase 2026 }), [currentIdRef, hasProvider, delayRef, isInstantPhase]); 2027 } 2028 2029 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/mergeCleanups.mjs 2030 function mergeCleanups(...cleanups) { 2031 return () => { 2032 for (let i = 0; i < cleanups.length; i += 1) { 2033 const cleanup = cleanups[i]; 2034 if (cleanup) { 2035 cleanup(); 2036 } 2037 } 2038 }; 2039 } 2040 2041 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FocusGuard.mjs 2042 var React13 = __toESM(require_react(), 1); 2043 2044 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/visuallyHidden.mjs 2045 var visuallyHiddenBase = { 2046 clipPath: "inset(50%)", 2047 overflow: "hidden", 2048 whiteSpace: "nowrap", 2049 border: 0, 2050 padding: 0, 2051 width: 1, 2052 height: 1, 2053 margin: -1 2054 }; 2055 var visuallyHidden = { 2056 ...visuallyHiddenBase, 2057 position: "fixed", 2058 margin: 0, 2059 top: 0, 2060 left: 0 2061 }; 2062 var visuallyHiddenInput = { 2063 ...visuallyHiddenBase, 2064 position: "absolute" 2065 }; 2066 2067 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FocusGuard.mjs 2068 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); 2069 var FocusGuard = /* @__PURE__ */ React13.forwardRef(function FocusGuard2(props, ref) { 2070 const [role, setRole] = React13.useState(); 2071 useIsoLayoutEffect(() => { 2072 if (parts_exports.screenReader.voiceOver && parts_exports.engine.webkit) { 2073 setRole("button"); 2074 } 2075 }, []); 2076 const restProps = { 2077 tabIndex: 0, 2078 // Role is only for VoiceOver 2079 role 2080 }; 2081 return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { 2082 ...props, 2083 ref, 2084 style: visuallyHidden, 2085 "aria-hidden": role ? void 0 : true, 2086 ...restProps, 2087 "data-base-ui-focus-guard": "" 2088 }); 2089 }); 2090 if (true) FocusGuard.displayName = "FocusGuard"; 2091 2092 // node_modules/.store/@floating-ui/utils@0.2.12-gOxTzMf36nCrbeHpEew-rw/node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 2093 var min = Math.min; 2094 var max = Math.max; 2095 var round = Math.round; 2096 var floor = Math.floor; 2097 var createCoords = (v) => ({ 2098 x: v, 2099 y: v 2100 }); 2101 var oppositeSideMap = { 2102 left: "right", 2103 right: "left", 2104 bottom: "top", 2105 top: "bottom" 2106 }; 2107 function clamp(start, value, end) { 2108 return max(start, min(value, end)); 2109 } 2110 function evaluate(value, param) { 2111 return typeof value === "function" ? value(param) : value; 2112 } 2113 function getSide(placement) { 2114 return placement.split("-")[0]; 2115 } 2116 function getAlignment(placement) { 2117 return placement.split("-")[1]; 2118 } 2119 function getOppositeAxis(axis) { 2120 return axis === "x" ? "y" : "x"; 2121 } 2122 function getAxisLength(axis) { 2123 return axis === "y" ? "height" : "width"; 2124 } 2125 function getSideAxis(placement) { 2126 const firstChar = placement[0]; 2127 return firstChar === "t" || firstChar === "b" ? "y" : "x"; 2128 } 2129 function getAlignmentAxis(placement) { 2130 return getOppositeAxis(getSideAxis(placement)); 2131 } 2132 function getAlignmentSides(placement, rects, rtl) { 2133 if (rtl === void 0) { 2134 rtl = false; 2135 } 2136 const alignment = getAlignment(placement); 2137 const alignmentAxis = getAlignmentAxis(placement); 2138 const length = getAxisLength(alignmentAxis); 2139 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 2140 if (rects.reference[length] > rects.floating[length]) { 2141 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 2142 } 2143 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 2144 } 2145 function getExpandedPlacements(placement) { 2146 const oppositePlacement = getOppositePlacement(placement); 2147 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 2148 } 2149 function getOppositeAlignmentPlacement(placement) { 2150 return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start"); 2151 } 2152 var lrPlacement = ["left", "right"]; 2153 var rlPlacement = ["right", "left"]; 2154 var tbPlacement = ["top", "bottom"]; 2155 var btPlacement = ["bottom", "top"]; 2156 function getSideList(side, isStart, rtl) { 2157 switch (side) { 2158 case "top": 2159 case "bottom": 2160 if (rtl) return isStart ? rlPlacement : lrPlacement; 2161 return isStart ? lrPlacement : rlPlacement; 2162 case "left": 2163 case "right": 2164 return isStart ? tbPlacement : btPlacement; 2165 default: 2166 return []; 2167 } 2168 } 2169 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 2170 const alignment = getAlignment(placement); 2171 let list = getSideList(getSide(placement), direction === "start", rtl); 2172 if (alignment) { 2173 list = list.map((side) => side + "-" + alignment); 2174 if (flipAlignment) { 2175 list = list.concat(list.map(getOppositeAlignmentPlacement)); 2176 } 2177 } 2178 return list; 2179 } 2180 function getOppositePlacement(placement) { 2181 const side = getSide(placement); 2182 return oppositeSideMap[side] + placement.slice(side.length); 2183 } 2184 function expandPaddingObject(padding) { 2185 var _padding$top, _padding$right, _padding$bottom, _padding$left; 2186 return { 2187 top: (_padding$top = padding.top) != null ? _padding$top : 0, 2188 right: (_padding$right = padding.right) != null ? _padding$right : 0, 2189 bottom: (_padding$bottom = padding.bottom) != null ? _padding$bottom : 0, 2190 left: (_padding$left = padding.left) != null ? _padding$left : 0 2191 }; 2192 } 2193 function getPaddingObject(padding) { 2194 return typeof padding !== "number" ? expandPaddingObject(padding) : { 2195 top: padding, 2196 right: padding, 2197 bottom: padding, 2198 left: padding 2199 }; 2200 } 2201 function rectToClientRect(rect) { 2202 const { 2203 x, 2204 y, 2205 width, 2206 height 2207 } = rect; 2208 return { 2209 width, 2210 height, 2211 top: y, 2212 left: x, 2213 right: x + width, 2214 bottom: y + height, 2215 x, 2216 y 2217 }; 2218 } 2219 2220 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/composite.mjs 2221 function isHiddenByStyles(styles) { 2222 return styles.visibility === "hidden" || styles.visibility === "collapse"; 2223 } 2224 function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { 2225 if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { 2226 return false; 2227 } 2228 if (typeof element.checkVisibility === "function") { 2229 return element.checkVisibility(); 2230 } 2231 return styles.display !== "none" && styles.display !== "contents"; 2232 } 2233 2234 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/tabbable.mjs 2235 var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]'; 2236 function getParentElement(element) { 2237 const assignedSlot = element.assignedSlot; 2238 if (assignedSlot) { 2239 return assignedSlot; 2240 } 2241 if (element.parentElement) { 2242 return element.parentElement; 2243 } 2244 const rootNode = element.getRootNode(); 2245 return isShadowRoot(rootNode) ? rootNode.host : null; 2246 } 2247 function getDetailsSummary(details) { 2248 for (const child of Array.from(details.children)) { 2249 if (getNodeName(child) === "summary") { 2250 return child; 2251 } 2252 } 2253 return null; 2254 } 2255 function isWithinOpenDetailsSummary(element, details) { 2256 const summary = getDetailsSummary(details); 2257 return !!summary && (element === summary || contains(summary, element)); 2258 } 2259 function isFocusableCandidate(element) { 2260 const nodeName = element ? getNodeName(element) : ""; 2261 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"); 2262 } 2263 function isFocusableElement(element) { 2264 if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) { 2265 return false; 2266 } 2267 for (let current = element; current; current = getParentElement(current)) { 2268 const isAncestor = current !== element; 2269 const isSlot = getNodeName(current) === "slot"; 2270 if (current.hasAttribute("inert")) { 2271 return false; 2272 } 2273 if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) { 2274 return false; 2275 } 2276 } 2277 return true; 2278 } 2279 function isVisibleInTabbableTree(element, isAncestor) { 2280 const styles = getComputedStyle2(element); 2281 if (!isAncestor) { 2282 return isElementVisible(element, styles); 2283 } 2284 return styles.display !== "none"; 2285 } 2286 function getTabIndex(element) { 2287 const tabIndex = element.tabIndex; 2288 if (tabIndex < 0) { 2289 const nodeName = getNodeName(element); 2290 if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) { 2291 return 0; 2292 } 2293 } 2294 return tabIndex; 2295 } 2296 function getNamedRadioInput(element) { 2297 if (getNodeName(element) !== "input") { 2298 return null; 2299 } 2300 const input = element; 2301 return input.type === "radio" && input.name !== "" ? input : null; 2302 } 2303 function isTabbableRadio(element, candidates) { 2304 const input = getNamedRadioInput(element); 2305 if (!input) { 2306 return true; 2307 } 2308 const checkedRadio = candidates.find((candidate) => { 2309 const radio = getNamedRadioInput(candidate); 2310 return radio?.name === input.name && radio.form === input.form && radio.checked; 2311 }); 2312 if (checkedRadio) { 2313 return checkedRadio === input; 2314 } 2315 return candidates.find((candidate) => { 2316 const radio = getNamedRadioInput(candidate); 2317 return radio?.name === input.name && radio.form === input.form; 2318 }) === input; 2319 } 2320 function getComposedChildren(container) { 2321 if (isHTMLElement(container) && getNodeName(container) === "slot") { 2322 const assignedElements = container.assignedElements({ 2323 flatten: true 2324 }); 2325 if (assignedElements.length > 0) { 2326 return assignedElements; 2327 } 2328 } 2329 if (isHTMLElement(container) && container.shadowRoot) { 2330 return Array.from(container.shadowRoot.children); 2331 } 2332 return Array.from(container.children); 2333 } 2334 function appendCandidates(container, list) { 2335 getComposedChildren(container).forEach((child) => { 2336 if (isFocusableCandidate(child)) { 2337 list.push(child); 2338 } 2339 appendCandidates(child, list); 2340 }); 2341 } 2342 function appendMatchingElements(container, selector, list) { 2343 getComposedChildren(container).forEach((child) => { 2344 if (isHTMLElement(child) && child.matches(selector)) { 2345 list.push(child); 2346 } 2347 appendMatchingElements(child, selector, list); 2348 }); 2349 } 2350 function focusable(container) { 2351 const candidates = []; 2352 appendCandidates(container, candidates); 2353 return candidates.filter(isFocusableElement); 2354 } 2355 function tabbable(container) { 2356 const candidates = focusable(container); 2357 return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates)); 2358 } 2359 function getTabbableIn(container, dir) { 2360 const list = tabbable(container); 2361 const len = list.length; 2362 if (len === 0) { 2363 return void 0; 2364 } 2365 const active = activeElement(ownerDocument(container)); 2366 const index2 = list.indexOf(active); 2367 const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; 2368 return list[nextIndex]; 2369 } 2370 function getNextTabbable(referenceElement) { 2371 return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement; 2372 } 2373 function getPreviousTabbable(referenceElement) { 2374 return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement; 2375 } 2376 function isOutsideEvent(event, container) { 2377 const containerElement = container || event.currentTarget; 2378 const relatedTarget = event.relatedTarget; 2379 return !relatedTarget || !contains(containerElement, relatedTarget); 2380 } 2381 function disableFocusInside(container) { 2382 const tabbableElements = tabbable(container); 2383 tabbableElements.forEach((element) => { 2384 element.dataset.tabindex = element.getAttribute("tabindex") || ""; 2385 element.setAttribute("tabindex", "-1"); 2386 }); 2387 } 2388 function enableFocusInside(container) { 2389 const elements = []; 2390 appendMatchingElements(container, "[data-tabindex]", elements); 2391 elements.forEach((element) => { 2392 const tabindex = element.dataset.tabindex; 2393 delete element.dataset.tabindex; 2394 if (tabindex) { 2395 element.setAttribute("tabindex", tabindex); 2396 } else { 2397 element.removeAttribute("tabindex"); 2398 } 2399 }); 2400 } 2401 2402 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/nodes.mjs 2403 function getNodeChildren(nodes, id, onlyOpenChildren = true) { 2404 const directChildren = nodes.filter((node) => node.parentId === id); 2405 return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); 2406 } 2407 2408 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/createAttribute.mjs 2409 function createAttribute(name) { 2410 return `data-base-ui-$name}`; 2411 } 2412 2413 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs 2414 var React14 = __toESM(require_react(), 1); 2415 var ReactDOM2 = __toESM(require_react_dom(), 1); 2416 2417 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/constants.mjs 2418 var DISABLED_TRANSITIONS_STYLE = { 2419 style: { 2420 transition: "none" 2421 } 2422 }; 2423 var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; 2424 var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; 2425 var BASE_UI_SWIPE_IGNORE_SELECTOR = `[$BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; 2426 var LEGACY_SWIPE_IGNORE_SELECTOR = `[$LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; 2427 var POPUP_COLLISION_AVOIDANCE = { 2428 fallbackAxisSide: "end" 2429 }; 2430 var ownerVisuallyHidden = { 2431 clipPath: "inset(50%)", 2432 position: "fixed", 2433 top: 0, 2434 left: 0 2435 }; 2436 2437 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingPortal.mjs 2438 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); 2439 var PortalContext = /* @__PURE__ */ React14.createContext(null); 2440 if (true) PortalContext.displayName = "PortalContext"; 2441 var usePortalContext = () => React14.useContext(PortalContext); 2442 var attr = createAttribute("portal"); 2443 function useFloatingPortalNode(props = {}) { 2444 const { 2445 ref, 2446 container: containerProp, 2447 componentProps = EMPTY_OBJECT, 2448 elementProps 2449 } = props; 2450 const uniqueId = useId(); 2451 const portalContext = usePortalContext(); 2452 const parentPortalNode = portalContext?.portalNode; 2453 const [containerElement, setContainerElement] = React14.useState(null); 2454 const [portalNode, setPortalNode] = React14.useState(null); 2455 const setPortalNodeRef = useStableCallback((node) => { 2456 if (node !== null) { 2457 setPortalNode(node); 2458 } 2459 }); 2460 const containerRef = React14.useRef(null); 2461 useIsoLayoutEffect(() => { 2462 if (containerProp === null) { 2463 if (containerRef.current) { 2464 containerRef.current = null; 2465 setPortalNode(null); 2466 setContainerElement(null); 2467 } 2468 return; 2469 } 2470 const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body; 2471 if (resolvedContainer == null) { 2472 if (containerRef.current) { 2473 containerRef.current = null; 2474 setPortalNode(null); 2475 setContainerElement(null); 2476 } 2477 return; 2478 } 2479 if (containerRef.current !== resolvedContainer) { 2480 containerRef.current = resolvedContainer; 2481 setPortalNode(null); 2482 setContainerElement(resolvedContainer); 2483 } 2484 }, [containerProp, parentPortalNode]); 2485 const portalElement = useRenderElement("div", componentProps, { 2486 ref: [ref, setPortalNodeRef], 2487 props: [{ 2488 id: uniqueId, 2489 [attr]: "" 2490 }, elementProps] 2491 }); 2492 const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; 2493 return { 2494 node: portalNode, 2495 // `id` and `render` props can override or remove the generated ID. Use the exact 2496 // rendered value so `aria-owns` never points at an ID absent from the DOM. 2497 nodeId: /* @__PURE__ */ React14.isValidElement(portalElement) ? portalElement.props.id : void 0, 2498 subtree: portalSubtree 2499 }; 2500 } 2501 var FloatingPortal = /* @__PURE__ */ React14.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { 2502 const { 2503 render, 2504 className, 2505 style, 2506 children, 2507 container, 2508 portalOwnerRole, 2509 ...elementProps 2510 } = componentProps; 2511 const { 2512 node: portalNode, 2513 nodeId: portalNodeId, 2514 subtree: portalSubtree 2515 } = useFloatingPortalNode({ 2516 container, 2517 ref: forwardedRef, 2518 componentProps, 2519 elementProps 2520 }); 2521 const beforeOutsideRef = React14.useRef(null); 2522 const afterOutsideRef = React14.useRef(null); 2523 const beforeInsideRef = React14.useRef(null); 2524 const afterInsideRef = React14.useRef(null); 2525 const [focusManagerState, setFocusManagerState] = React14.useState(null); 2526 const focusInsideDisabledRef = React14.useRef(false); 2527 const modal = focusManagerState?.modal; 2528 const open2 = focusManagerState?.open; 2529 const shouldRenderGuards = !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; 2530 React14.useEffect(() => { 2531 if (!portalNode || modal) { 2532 return void 0; 2533 } 2534 function onFocus(event) { 2535 if (portalNode && event.relatedTarget && isOutsideEvent(event)) { 2536 if (event.type === "focusin") { 2537 if (focusInsideDisabledRef.current) { 2538 enableFocusInside(portalNode); 2539 focusInsideDisabledRef.current = false; 2540 } 2541 } else { 2542 disableFocusInside(portalNode); 2543 focusInsideDisabledRef.current = true; 2544 } 2545 } 2546 } 2547 return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); 2548 }, [portalNode, modal]); 2549 useIsoLayoutEffect(() => { 2550 if (!portalNode || open2 !== true || !focusInsideDisabledRef.current) { 2551 return; 2552 } 2553 enableFocusInside(portalNode); 2554 focusInsideDisabledRef.current = false; 2555 }, [open2, portalNode]); 2556 const portalContextValue = React14.useMemo(() => ({ 2557 beforeOutsideRef, 2558 afterOutsideRef, 2559 beforeInsideRef, 2560 afterInsideRef, 2561 portalNode, 2562 setFocusManagerState 2563 }), [portalNode]); 2564 return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(React14.Fragment, { 2565 children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)(PortalContext.Provider, { 2566 value: portalContextValue, 2567 children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FocusGuard, { 2568 "data-type": "outside", 2569 ref: beforeOutsideRef, 2570 onFocus: (event) => { 2571 if (isOutsideEvent(event, portalNode)) { 2572 beforeInsideRef.current?.focus(); 2573 } else { 2574 const domReference = focusManagerState ? focusManagerState.domReference : null; 2575 const prevTabbable = getPreviousTabbable(domReference); 2576 prevTabbable?.focus(); 2577 } 2578 } 2579 }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { 2580 role: portalOwnerRole, 2581 "aria-owns": portalNodeId, 2582 style: ownerVisuallyHidden 2583 }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(FocusGuard, { 2584 "data-type": "outside", 2585 ref: afterOutsideRef, 2586 onFocus: (event) => { 2587 if (isOutsideEvent(event, portalNode)) { 2588 afterInsideRef.current?.focus(); 2589 } else { 2590 const domReference = focusManagerState ? focusManagerState.domReference : null; 2591 const nextTabbable = getNextTabbable(domReference); 2592 nextTabbable?.focus(); 2593 if (focusManagerState?.closeOnFocusOut) { 2594 focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent)); 2595 } 2596 } 2597 } 2598 })] 2599 })] 2600 }); 2601 }); 2602 if (true) FloatingPortal.displayName = "FloatingPortal"; 2603 2604 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs 2605 var React15 = __toESM(require_react(), 1); 2606 2607 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/utils/createEventEmitter.mjs 2608 function createEventEmitter() { 2609 const map = /* @__PURE__ */ new Map(); 2610 return { 2611 emit(event, data) { 2612 map.get(event)?.forEach((listener) => listener(data)); 2613 }, 2614 on(event, listener) { 2615 if (!map.has(event)) { 2616 map.set(event, /* @__PURE__ */ new Set()); 2617 } 2618 map.get(event).add(listener); 2619 }, 2620 off(event, listener) { 2621 map.get(event)?.delete(listener); 2622 } 2623 }; 2624 } 2625 2626 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingTree.mjs 2627 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); 2628 var FloatingNodeContext = /* @__PURE__ */ React15.createContext(null); 2629 if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; 2630 var FloatingTreeContext = /* @__PURE__ */ React15.createContext(null); 2631 if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; 2632 var useFloatingParentNodeId = () => React15.useContext(FloatingNodeContext)?.id || null; 2633 var useFloatingTree = (externalTree) => { 2634 const contextTree = React15.useContext(FloatingTreeContext); 2635 return externalTree ?? contextTree; 2636 }; 2637 2638 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useClientPoint.mjs 2639 var React16 = __toESM(require_react(), 1); 2640 function createVirtualElement(domElement, data) { 2641 let offsetX = null; 2642 let offsetY = null; 2643 let isAutoUpdateEvent = false; 2644 return { 2645 contextElement: domElement || void 0, 2646 getBoundingClientRect() { 2647 const domRect = domElement?.getBoundingClientRect() || { 2648 width: 0, 2649 height: 0, 2650 x: 0, 2651 y: 0 2652 }; 2653 const isXAxis = data.axis === "x" || data.axis === "both"; 2654 const isYAxis = data.axis === "y" || data.axis === "both"; 2655 const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch"; 2656 const width = data.axis === "y" ? domRect.width : 0; 2657 const height = data.axis === "x" ? domRect.height : 0; 2658 let x = domRect.x; 2659 let y = domRect.y; 2660 if (offsetX == null && data.x && isXAxis) { 2661 offsetX = domRect.x - data.x; 2662 } 2663 if (offsetY == null && data.y && isYAxis) { 2664 offsetY = domRect.y - data.y; 2665 } 2666 x -= offsetX || 0; 2667 y -= offsetY || 0; 2668 if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { 2669 x = isXAxis && data.x != null ? data.x : x; 2670 y = isYAxis && data.y != null ? data.y : y; 2671 } 2672 isAutoUpdateEvent = true; 2673 return { 2674 width, 2675 height, 2676 x, 2677 y, 2678 top: y, 2679 right: x + width, 2680 bottom: y + height, 2681 left: x 2682 }; 2683 } 2684 }; 2685 } 2686 function isMouseBasedEvent(event) { 2687 return event != null && event.clientX != null; 2688 } 2689 function useClientPoint(store2, props = {}) { 2690 const { 2691 enabled = true, 2692 axis = "both" 2693 } = props; 2694 const open2 = store2.useState("open"); 2695 const floating = store2.useState("floatingElement"); 2696 const domReference = store2.useState("domReferenceElement"); 2697 const dataRef = store2.context.dataRef; 2698 const initialRef = React16.useRef(false); 2699 const cleanupListenerRef = React16.useRef(null); 2700 const [pointerType, setPointerType] = React16.useState(); 2701 const [reactive, setReactive] = React16.useState([]); 2702 const resetReference = useStableCallback((reference2) => { 2703 store2.set("positionReference", reference2); 2704 }); 2705 const setReference = useStableCallback((newX, newY, referenceElement) => { 2706 if (initialRef.current) { 2707 return; 2708 } 2709 if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) { 2710 return; 2711 } 2712 store2.set("positionReference", createVirtualElement(referenceElement ?? domReference, { 2713 x: newX, 2714 y: newY, 2715 axis, 2716 dataRef, 2717 pointerType 2718 })); 2719 }); 2720 const handleReferenceEnterOrMove = useStableCallback((event) => { 2721 if (!open2) { 2722 setReference(event.clientX, event.clientY, event.currentTarget); 2723 } else if (!cleanupListenerRef.current) { 2724 setReference(event.clientX, event.clientY, event.currentTarget); 2725 setReactive([]); 2726 } 2727 }); 2728 const openCheck = isMouseLikePointerType(pointerType) ? floating : open2; 2729 React16.useEffect(() => { 2730 if (!enabled) { 2731 resetReference(domReference); 2732 return void 0; 2733 } 2734 if (!openCheck) { 2735 return void 0; 2736 } 2737 function cleanupListener() { 2738 cleanupListenerRef.current?.(); 2739 cleanupListenerRef.current = null; 2740 } 2741 const win = getWindow(floating); 2742 function handleMouseMove(event) { 2743 const target = getTarget(event); 2744 if (!contains(floating, target)) { 2745 setReference(event.clientX, event.clientY); 2746 } else { 2747 cleanupListener(); 2748 } 2749 } 2750 if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) { 2751 cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove); 2752 } else { 2753 resetReference(domReference); 2754 } 2755 return cleanupListener; 2756 }, [openCheck, enabled, floating, dataRef, domReference, store2, setReference, resetReference, reactive]); 2757 React16.useEffect(() => () => { 2758 store2.set("positionReference", null); 2759 }, [store2]); 2760 React16.useEffect(() => { 2761 if (enabled && !floating) { 2762 initialRef.current = false; 2763 } 2764 }, [enabled, floating]); 2765 React16.useEffect(() => { 2766 if (!enabled && open2) { 2767 initialRef.current = true; 2768 } 2769 }, [enabled, open2]); 2770 const reference = React16.useMemo(() => { 2771 function setPointerTypeRef(event) { 2772 setPointerType(event.pointerType); 2773 } 2774 return { 2775 onPointerDown: setPointerTypeRef, 2776 onPointerEnter: setPointerTypeRef, 2777 onMouseMove: handleReferenceEnterOrMove, 2778 onMouseEnter: handleReferenceEnterOrMove 2779 }; 2780 }, [handleReferenceEnterOrMove]); 2781 return React16.useMemo(() => enabled ? { 2782 reference, 2783 trigger: reference 2784 } : {}, [enabled, reference]); 2785 } 2786 2787 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useDismiss.mjs 2788 var React17 = __toESM(require_react(), 1); 2789 function alwaysFalse() { 2790 return false; 2791 } 2792 function normalizeProp(normalizable) { 2793 return { 2794 escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false, 2795 outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true 2796 }; 2797 } 2798 function useDismiss(store2, props = {}) { 2799 const { 2800 enabled = true, 2801 escapeKey: escapeKey2 = true, 2802 outsidePress: outsidePressProp = true, 2803 outsidePressEvent = "sloppy", 2804 referencePress = alwaysFalse, 2805 bubbles, 2806 externalTree 2807 } = props; 2808 const open2 = store2.useState("open"); 2809 const floatingElement = store2.useState("floatingElement"); 2810 const { 2811 dataRef, 2812 events 2813 } = store2.context; 2814 const tree = useFloatingTree(externalTree); 2815 const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); 2816 const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; 2817 const outsidePressEnabled = outsidePress2 !== false; 2818 const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent); 2819 const { 2820 escapeKey: escapeKeyBubbles, 2821 outsidePress: outsidePressBubbles 2822 } = normalizeProp(bubbles); 2823 const pressStartedInsideRef = React17.useRef(false); 2824 const pressStartPreventedRef = React17.useRef(false); 2825 const suppressNextOutsideClickRef = React17.useRef(false); 2826 const sawPressWhileOpenRef = React17.useRef(false); 2827 const isComposingRef = React17.useRef(false); 2828 const currentPointerTypeRef = React17.useRef(""); 2829 const touchStateRef = React17.useRef(null); 2830 const cancelDismissOnEndTimeout = useTimeout(); 2831 const clearInsideReactTreeTimeout = useTimeout(); 2832 const compositionTimeout = useTimeout(); 2833 const clearInsideReactTree = useStableCallback(() => { 2834 clearInsideReactTreeTimeout.clear(); 2835 dataRef.current.insideReactTree = false; 2836 }); 2837 const hasBlockingChild = useStableCallback((bubbleKey) => { 2838 const nodeId = dataRef.current.floatingContext?.nodeId; 2839 const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []; 2840 return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]); 2841 }); 2842 const isEventWithinOwnElements = useStableCallback((event) => { 2843 return isEventTargetWithin(event, store2.select("floatingElement")) || isEventTargetWithin(event, store2.select("domReferenceElement")); 2844 }); 2845 const closeOnReferencePress = useStableCallback((event) => { 2846 if (!referencePress()) { 2847 return; 2848 } 2849 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); 2850 }); 2851 const closeOnEscapeKeyDown = useStableCallback((event) => { 2852 if (!open2 || !enabled || !escapeKey2 || event.key !== "Escape") { 2853 return; 2854 } 2855 const native = isReactEvent(event) ? event.nativeEvent : event; 2856 if (isComposingRef.current || native.isComposing) { 2857 return; 2858 } 2859 if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) { 2860 return; 2861 } 2862 const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native); 2863 store2.setOpen(false, eventDetails); 2864 if (!eventDetails.isCanceled) { 2865 event.preventDefault(); 2866 } 2867 if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) { 2868 event.stopPropagation(); 2869 } 2870 }); 2871 const markInsideReactTree = useStableCallback(() => { 2872 dataRef.current.insideReactTree = true; 2873 clearInsideReactTreeTimeout.start(0, clearInsideReactTree); 2874 }); 2875 const markPressStartedInsideReactTree = useStableCallback((event) => { 2876 if (!open2 || !enabled || event.button !== 0) { 2877 return; 2878 } 2879 const target = getTarget(event.nativeEvent); 2880 if (!contains(store2.select("floatingElement"), target)) { 2881 return; 2882 } 2883 if (!pressStartedInsideRef.current) { 2884 pressStartedInsideRef.current = true; 2885 pressStartPreventedRef.current = false; 2886 } 2887 }); 2888 const markInsidePressStartPrevented = useStableCallback((event) => { 2889 if (!open2 || !enabled) { 2890 return; 2891 } 2892 if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { 2893 return; 2894 } 2895 if (pressStartedInsideRef.current) { 2896 pressStartPreventedRef.current = true; 2897 } 2898 }); 2899 React17.useEffect(() => { 2900 function handleOpenChange(details) { 2901 if (!details.open) { 2902 sawPressWhileOpenRef.current = false; 2903 } 2904 } 2905 events.on("openchange", handleOpenChange); 2906 return () => { 2907 events.off("openchange", handleOpenChange); 2908 }; 2909 }, [events]); 2910 React17.useEffect(() => clearInsideReactTree, [clearInsideReactTree]); 2911 React17.useEffect(() => { 2912 if (!open2 || !enabled) { 2913 if (!open2) { 2914 sawPressWhileOpenRef.current = false; 2915 isComposingRef.current = false; 2916 currentPointerTypeRef.current = ""; 2917 touchStateRef.current = null; 2918 } 2919 return clearInsideReactTree; 2920 } 2921 dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; 2922 dataRef.current.__outsidePressBubbles = outsidePressBubbles; 2923 const preventedPressSuppressionTimeout = new Timeout(); 2924 const doc = ownerDocument(floatingElement); 2925 function handleCompositionStart() { 2926 compositionTimeout.clear(); 2927 isComposingRef.current = true; 2928 } 2929 function handleCompositionEnd() { 2930 isComposingRef.current = true; 2931 compositionTimeout.start( 2932 // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. 2933 // Only apply to WebKit for the test to remain 0ms. 2934 parts_exports.engine.webkit ? 5 : 0, 2935 () => { 2936 isComposingRef.current = false; 2937 } 2938 ); 2939 } 2940 function suppressImmediateOutsideClickAfterPreventedStart() { 2941 suppressNextOutsideClickRef.current = true; 2942 preventedPressSuppressionTimeout.start(0, () => { 2943 suppressNextOutsideClickRef.current = false; 2944 }); 2945 } 2946 function resetPressStartState() { 2947 pressStartedInsideRef.current = false; 2948 pressStartPreventedRef.current = false; 2949 } 2950 function getOutsidePressEvent() { 2951 const type = currentPointerTypeRef.current; 2952 const computedType = type === "pen" || !type ? "mouse" : type; 2953 const outsidePressEventValue = getOutsidePressEventProp(); 2954 const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue; 2955 if (typeof resolved === "string") { 2956 return resolved; 2957 } 2958 return resolved[computedType]; 2959 } 2960 function shouldIgnoreEvent(event) { 2961 const computedOutsidePressEvent = getOutsidePressEvent(); 2962 return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click"; 2963 } 2964 function isEventWithinFloatingTree(event) { 2965 const nodeId = dataRef.current.floatingContext?.nodeId; 2966 const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating)); 2967 return isEventWithinOwnElements(event) || targetIsInsideChildren; 2968 } 2969 function closeOnPressOutside(event) { 2970 if (shouldIgnoreEvent(event)) { 2971 if (event.type !== "click" && !isEventWithinOwnElements(event)) { 2972 preventedPressSuppressionTimeout.clear(); 2973 suppressNextOutsideClickRef.current = false; 2974 } 2975 clearInsideReactTree(); 2976 return; 2977 } 2978 if (dataRef.current.insideReactTree) { 2979 clearInsideReactTree(); 2980 return; 2981 } 2982 const target = getTarget(event); 2983 const inertSelector = `[$createAttribute("inert")}]`; 2984 const targetRoot = isElement(target) ? target.getRootNode() : null; 2985 const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store2.select("floatingElement"))).querySelectorAll(inertSelector)); 2986 const triggers = store2.context.triggerElements; 2987 if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) { 2988 return; 2989 } 2990 let targetRootAncestor = isElement(target) ? target : null; 2991 while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { 2992 const nextParent = getParentNode(targetRootAncestor); 2993 if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { 2994 break; 2995 } 2996 targetRootAncestor = nextParent; 2997 } 2998 if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). 2999 !contains(target, store2.select("floatingElement")) && // If the target root element contains none of the markers, then the 3000 // element was injected after the floating element rendered. 3001 markers.every((marker) => !contains(targetRootAncestor, marker))) { 3002 return; 3003 } 3004 if (isHTMLElement(target) && !("touches" in event)) { 3005 const lastTraversableNode = isLastTraversableNode(target); 3006 const style = getComputedStyle2(target); 3007 const scrollRe = /auto|scroll/; 3008 const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); 3009 const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); 3010 const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; 3011 const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; 3012 const isRTL7 = style.direction === "rtl"; 3013 const pressedVerticalScrollbar = canScrollY && (isRTL7 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); 3014 const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; 3015 if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { 3016 return; 3017 } 3018 } 3019 if (isEventWithinFloatingTree(event)) { 3020 return; 3021 } 3022 if (getOutsidePressEvent() === "intentional") { 3023 if (event.detail !== 0 && !isVirtualClick(event) && !sawPressWhileOpenRef.current) { 3024 return; 3025 } 3026 if (suppressNextOutsideClickRef.current) { 3027 preventedPressSuppressionTimeout.clear(); 3028 suppressNextOutsideClickRef.current = false; 3029 return; 3030 } 3031 } 3032 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 3033 return; 3034 } 3035 if (hasBlockingChild("__outsidePressBubbles")) { 3036 return; 3037 } 3038 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event)); 3039 clearInsideReactTree(); 3040 } 3041 function handlePointerDown(event) { 3042 if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store2.select("open") || !enabled || isEventWithinOwnElements(event)) { 3043 return; 3044 } 3045 closeOnPressOutside(event); 3046 } 3047 function handleTouchStart(event) { 3048 if (getOutsidePressEvent() !== "sloppy" || !store2.select("open") || !enabled || isEventWithinOwnElements(event)) { 3049 return; 3050 } 3051 const touch = event.touches[0]; 3052 if (touch) { 3053 touchStateRef.current = { 3054 startTime: Date.now(), 3055 startX: touch.clientX, 3056 startY: touch.clientY, 3057 dismissOnTouchEnd: false, 3058 dismissOnMouseDown: true 3059 }; 3060 cancelDismissOnEndTimeout.start(1e3, () => { 3061 if (touchStateRef.current) { 3062 touchStateRef.current.dismissOnTouchEnd = false; 3063 touchStateRef.current.dismissOnMouseDown = false; 3064 } 3065 }); 3066 } 3067 } 3068 function addTargetEventListenerOnce(event, listener) { 3069 const target = getTarget(event); 3070 if (!target) { 3071 return; 3072 } 3073 const unsubscribe2 = addEventListener(target, event.type, () => { 3074 listener(event); 3075 unsubscribe2(); 3076 }); 3077 } 3078 function handleTouchStartCapture(event) { 3079 currentPointerTypeRef.current = "touch"; 3080 addTargetEventListenerOnce(event, handleTouchStart); 3081 } 3082 function closeOnPressOutsideCapture(event) { 3083 cancelDismissOnEndTimeout.clear(); 3084 if (event.type === "pointerdown") { 3085 if (event.button === 0) { 3086 sawPressWhileOpenRef.current = true; 3087 } 3088 currentPointerTypeRef.current = event.pointerType; 3089 } 3090 if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { 3091 return; 3092 } 3093 addTargetEventListenerOnce(event, (targetEvent) => { 3094 if (targetEvent.type === "pointerdown") { 3095 handlePointerDown(targetEvent); 3096 } else { 3097 closeOnPressOutside(targetEvent); 3098 } 3099 }); 3100 } 3101 function handlePressEndCapture(event) { 3102 if (event.type === "pointercancel") { 3103 sawPressWhileOpenRef.current = false; 3104 } 3105 if (!pressStartedInsideRef.current) { 3106 return; 3107 } 3108 const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; 3109 resetPressStartState(); 3110 if (getOutsidePressEvent() !== "intentional") { 3111 return; 3112 } 3113 if (event.type === "pointercancel") { 3114 if (pressStartedInsideDefaultPrevented) { 3115 suppressImmediateOutsideClickAfterPreventedStart(); 3116 } 3117 return; 3118 } 3119 if (isEventWithinFloatingTree(event)) { 3120 return; 3121 } 3122 if (pressStartedInsideDefaultPrevented) { 3123 suppressImmediateOutsideClickAfterPreventedStart(); 3124 return; 3125 } 3126 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 3127 return; 3128 } 3129 preventedPressSuppressionTimeout.clear(); 3130 suppressNextOutsideClickRef.current = true; 3131 clearInsideReactTree(); 3132 } 3133 function handleTouchMove(event) { 3134 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 3135 return; 3136 } 3137 const touch = event.touches[0]; 3138 if (!touch) { 3139 return; 3140 } 3141 const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX); 3142 const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY); 3143 const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); 3144 if (distance > 5) { 3145 touchStateRef.current.dismissOnTouchEnd = true; 3146 } 3147 if (distance > 10) { 3148 closeOnPressOutside(event); 3149 cancelDismissOnEndTimeout.clear(); 3150 touchStateRef.current = null; 3151 } 3152 } 3153 function handleTouchMoveCapture(event) { 3154 addTargetEventListenerOnce(event, handleTouchMove); 3155 } 3156 function handleTouchEnd(event) { 3157 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 3158 return; 3159 } 3160 if (touchStateRef.current.dismissOnTouchEnd) { 3161 closeOnPressOutside(event); 3162 } 3163 cancelDismissOnEndTimeout.clear(); 3164 touchStateRef.current = null; 3165 } 3166 function handleTouchEndCapture(event) { 3167 addTargetEventListenerOnce(event, handleTouchEnd); 3168 } 3169 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, { 3170 capture: true, 3171 passive: true 3172 }), addEventListener(doc, "touchmove", handleTouchMoveCapture, { 3173 capture: true, 3174 passive: true 3175 }), addEventListener(doc, "touchend", handleTouchEndCapture, { 3176 capture: true, 3177 passive: true 3178 }))); 3179 return () => { 3180 unsubscribe(); 3181 preventedPressSuppressionTimeout.clear(); 3182 resetPressStartState(); 3183 suppressNextOutsideClickRef.current = false; 3184 }; 3185 }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open2, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store2, cancelDismissOnEndTimeout, compositionTimeout]); 3186 const reference = React17.useMemo(() => ({ 3187 onKeyDown: closeOnEscapeKeyDown, 3188 onPointerDown: closeOnReferencePress, 3189 onClick: closeOnReferencePress 3190 }), [closeOnEscapeKeyDown, closeOnReferencePress]); 3191 const floating = React17.useMemo(() => ({ 3192 onKeyDown: closeOnEscapeKeyDown, 3193 // `onMouseDown` may be blocked if `event.preventDefault()` is called in 3194 // `onPointerDown`, such as with <NumberField.ScrubArea>. 3195 // See https://github.com/mui/base-ui/pull/3379 3196 onPointerDown: markInsidePressStartPrevented, 3197 onMouseDown: markInsidePressStartPrevented, 3198 onClickCapture: markInsideReactTree, 3199 onMouseDownCapture(event) { 3200 markInsideReactTree(); 3201 markPressStartedInsideReactTree(event); 3202 }, 3203 onPointerDownCapture(event) { 3204 markInsideReactTree(); 3205 markPressStartedInsideReactTree(event); 3206 }, 3207 onMouseUpCapture: markInsideReactTree, 3208 onTouchEndCapture: markInsideReactTree, 3209 onTouchMoveCapture: markInsideReactTree 3210 }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); 3211 return React17.useMemo(() => enabled ? { 3212 reference, 3213 floating, 3214 trigger: reference 3215 } : {}, [enabled, reference, floating]); 3216 } 3217 3218 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupHandle.mjs 3219 var BasePopupHandle = class { 3220 /** 3221 * Stores of every root currently using this handle, in attach order. A handle is meant to be used 3222 * by a single mounted root, but roots can transiently overlap (e.g. during an animated route 3223 * transition), so this stack lets `attachStore`'s cleanup restore the previous root instead of 3224 * leaving a still-mounted root uncontrollable when a newer overlapping root detaches first. 3225 */ 3226 attachedStores = []; 3227 /** 3228 * Store of the root that currently controls the handle: the most recently attached one still 3229 * mounted, or `null` when no root is attached. Imperative methods are no-ops while this is `null`. 3230 */ 3231 attachedStoreValue = null; 3232 /** 3233 * Listeners notified when `attachedStore` changes, so detached triggers can follow the store pointer. 3234 */ 3235 storeListeners = /* @__PURE__ */ new Set(); 3236 /** 3237 * Creates a handle backed by the store used while no root is attached. 3238 * 3239 * @param fallbackStore Inert, closed store handed to detached triggers while no root is attached, 3240 * so they can render and register without a mounted root. Triggers register into whichever store 3241 * `store` currently resolves to, so while detached they live in this store's trigger map and 3242 * migrate themselves to the root's store (and back) as it attaches/detaches. 3243 * @param componentName Component name used to prefix dev warnings, e.g. `'Menu'` produces 3244 * `MenuHandle.open()` in warning text. 3245 * @param throwOnMissingTrigger Whether `open(triggerId)` throws when no trigger with that id is 3246 * registered. Anchored popups (Menu, Popover, Tooltip, PreviewCard) need a trigger to anchor to, 3247 * so they throw; Dialog is not anchored and instead opens unassociated with a dev warning. 3248 */ 3249 constructor(fallbackStore, componentName, throwOnMissingTrigger = true) { 3250 this.fallbackStore = fallbackStore; 3251 this.componentName = componentName; 3252 this.throwOnMissingTrigger = throwOnMissingTrigger; 3253 } 3254 get attachedStore() { 3255 return this.attachedStoreValue; 3256 } 3257 /** 3258 * Store that detached triggers read from: the attached root's store, or an inert fallback store 3259 * used while no root is attached. 3260 * @internal 3261 */ 3262 get store() { 3263 return this.attachedStoreValue ?? this.fallbackStore; 3264 } 3265 /** 3266 * Stable fallback store used for server rendering and hydration. Root stores cannot be recorded on 3267 * the handle during render because a handle can be shared by concurrent server-rendered requests. 3268 * @internal 3269 */ 3270 get serverStore() { 3271 return this.fallbackStore; 3272 } 3273 /** 3274 * Subscribes to changes of the attached store pointer so detached triggers re-render and re-bind 3275 * when a root attaches or detaches. Returns a function that removes the listener. 3276 * @internal 3277 */ 3278 subscribeStore(listener) { 3279 this.storeListeners.add(listener); 3280 return () => { 3281 this.storeListeners.delete(listener); 3282 }; 3283 } 3284 /** 3285 * Points the handle at a root's store and notifies subscribers so detached triggers re-render and 3286 * re-register into it (their registration effect migrates them when the store pointer changes). 3287 * Returns a cleanup function that detaches the store again. 3288 * @internal 3289 */ 3290 attachStore(newStore) { 3291 this.attachedStores.push(newStore); 3292 this.setActiveStore(newStore); 3293 if (true) { 3294 if (this.attachedStores.length > 1) { 3295 const dev = this; 3296 (dev.overlapWarningFrame ??= AnimationFrame.create()).request(() => { 3297 if (this.attachedStores.length > 1) { 3298 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."); 3299 } 3300 }); 3301 } 3302 } 3303 return () => { 3304 const index2 = this.attachedStores.lastIndexOf(newStore); 3305 if (index2 !== -1) { 3306 this.attachedStores.splice(index2, 1); 3307 } 3308 this.setActiveStore(this.attachedStores[this.attachedStores.length - 1] ?? null); 3309 }; 3310 } 3311 /** 3312 * Sets the store that currently controls the handle and notifies subscribers when it changes, so 3313 * detached triggers re-render and migrate their registration to the new store. 3314 */ 3315 setActiveStore(store2) { 3316 if (this.attachedStoreValue !== store2) { 3317 this.attachedStoreValue = store2; 3318 this.storeListeners.forEach((listener) => { 3319 listener(); 3320 }); 3321 } 3322 } 3323 /** 3324 * Opens the attached root's store and associates it with the trigger with the given id, or a 3325 * no-op (with a dev warning) while no root is attached. Shared by every concrete handle's public 3326 * `open()` method, which only narrows the parameter type. 3327 * 3328 * When a trigger id is given but no matching trigger is registered, anchored popups throw (see 3329 * `throwOnMissingTrigger`); Dialog opens unassociated with a dev warning instead. 3330 * 3331 * This method should only be called in an event handler or an effect (not during rendering). 3332 * 3333 * @param triggerId ID of the trigger to associate with the popup, or `null`/`undefined` to open 3334 * without associating any trigger. 3335 */ 3336 openByTrigger(triggerId) { 3337 const attachedStore = this.attachedStore; 3338 if (attachedStore === null) { 3339 if (true) { 3340 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.`); 3341 } 3342 return; 3343 } 3344 let triggerElement; 3345 if (triggerId) { 3346 for (let i = this.attachedStores.length - 1; i >= 0 && !triggerElement; i -= 1) { 3347 triggerElement = this.attachedStores[i].context.triggerElements.getById(triggerId); 3348 } 3349 triggerElement ??= this.fallbackStore.context.triggerElements.getById(triggerId); 3350 } 3351 if (triggerId && !triggerElement) { 3352 if (this.throwOnMissingTrigger) { 3353 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)); 3354 } 3355 if (true) { 3356 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.`); 3357 } 3358 } 3359 attachedStore.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); 3360 } 3361 /** 3362 * Closes the popup by setting the attached root's store to closed, or a no-op (with a dev warning) 3363 * while no root is attached. Shared by every concrete handle's public `close()` method. 3364 * 3365 * This method should only be called in an event handler or an effect (not during rendering). 3366 */ 3367 closePopup() { 3368 const attachedStore = this.attachedStore; 3369 if (attachedStore === null) { 3370 if (true) { 3371 console.warn(`Base UI: $this.componentName}Handle.close() was called while no root using this handle is mounted. The call was ignored.`); 3372 } 3373 return; 3374 } 3375 attachedStore.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); 3376 } 3377 }; 3378 3379 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs 3380 var React19 = __toESM(require_react(), 1); 3381 var ReactDOM3 = __toESM(require_react_dom(), 1); 3382 3383 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useSyncedFloatingRootContext.mjs 3384 function useSyncedFloatingRootContext(options) { 3385 const { 3386 popupStore, 3387 treatPopupAsFloatingElement = false, 3388 floatingRootContext: store2, 3389 floatingId, 3390 nested, 3391 onOpenChange 3392 } = options; 3393 const open2 = popupStore.useState("open"); 3394 const referenceElement = popupStore.useState("activeTriggerElement"); 3395 const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); 3396 const handleOpenChange = onOpenChange; 3397 popupStore.useSyncedValue("floatingId", floatingId); 3398 useIsoLayoutEffect(() => { 3399 const valuesToSync = { 3400 open: open2, 3401 floatingId, 3402 referenceElement, 3403 floatingElement 3404 }; 3405 if (isElement(referenceElement)) { 3406 valuesToSync.domReferenceElement = referenceElement; 3407 } 3408 if (store2.state.positionReference === store2.state.referenceElement) { 3409 valuesToSync.positionReference = referenceElement; 3410 } 3411 store2.update(valuesToSync); 3412 }, [open2, floatingId, referenceElement, floatingElement, store2]); 3413 store2.context.onOpenChange = handleOpenChange; 3414 store2.context.nested = nested; 3415 return store2; 3416 } 3417 3418 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useUnmountAfterClose.mjs 3419 var React18 = __toESM(require_react(), 1); 3420 function useUnmountAfterClose(parameters) { 3421 const { 3422 open: open2, 3423 ref, 3424 preventUnmountOnClose, 3425 setPreventUnmountOnClose: setPreventUnmountOnCloseParam, 3426 onUnmount, 3427 animateInitialOpen 3428 } = parameters; 3429 const setPreventUnmountOnClose = useStableCallback(setPreventUnmountOnCloseParam); 3430 const { 3431 mounted, 3432 setMounted, 3433 transitionStatus 3434 } = useTransitionStatus(open2, false, false, animateInitialOpen); 3435 const preventUnmountingOnClose = open2 ? false : preventUnmountOnClose; 3436 useIsoLayoutEffect(() => { 3437 if (open2) { 3438 setPreventUnmountOnClose(false); 3439 } 3440 }, [open2, setPreventUnmountOnClose]); 3441 const mountedRef = React18.useRef(mounted); 3442 const pendingUnmountRef = React18.useRef(false); 3443 const rerender = useForcedRerendering(); 3444 const unmount = () => { 3445 mountedRef.current = false; 3446 setMounted(false); 3447 onUnmount(); 3448 }; 3449 useIsoLayoutEffect(() => { 3450 mountedRef.current = mounted; 3451 if (pendingUnmountRef.current) { 3452 pendingUnmountRef.current = false; 3453 if (!open2 && mounted) { 3454 unmount(); 3455 } 3456 } 3457 }); 3458 const forceUnmount = useStableCallback(() => { 3459 if (!mountedRef.current) { 3460 return; 3461 } 3462 if (open2) { 3463 pendingUnmountRef.current = true; 3464 rerender(); 3465 return; 3466 } 3467 unmount(); 3468 }); 3469 useOpenChangeComplete({ 3470 enabled: mounted && !open2 && !preventUnmountingOnClose, 3471 open: open2, 3472 ref, 3473 onComplete() { 3474 if (!open2) { 3475 forceUnmount(); 3476 } 3477 } 3478 }); 3479 return { 3480 mounted, 3481 transitionStatus, 3482 preventUnmountingOnClose, 3483 forceUnmount 3484 }; 3485 } 3486 3487 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupStoreUtils.mjs 3488 var FOCUSABLE_POPUP_PROPS = { 3489 tabIndex: -1, 3490 [FOCUSABLE_ATTRIBUTE]: "" 3491 }; 3492 function usePopupRootStore(createStore, treatPopupAsFloatingElement = false) { 3493 const floatingId = useId(); 3494 const nested = useFloatingParentNodeId() != null; 3495 const store2 = useRefWithInit(() => createStore(floatingId, nested)).current; 3496 useSyncedFloatingRootContext({ 3497 popupStore: store2, 3498 treatPopupAsFloatingElement, 3499 floatingRootContext: store2.state.floatingRootContext, 3500 floatingId, 3501 nested, 3502 onOpenChange: store2.setOpen 3503 }); 3504 return store2; 3505 } 3506 function PopupHandleAttachment({ 3507 handle, 3508 store: store2 3509 }) { 3510 useIsoLayoutEffect(() => { 3511 return handle.attachStore(store2); 3512 }, [handle, store2]); 3513 return null; 3514 } 3515 function syncTriggerCount(store2) { 3516 const triggerCount = store2.context.triggerElements.size; 3517 if (store2.select("open") && store2.state.triggerCount !== triggerCount) { 3518 store2.set("triggerCount", triggerCount); 3519 } 3520 } 3521 function useTriggerRegistration(id, store2) { 3522 const registrationRef = React19.useRef(null); 3523 return useStableCallback((element) => { 3524 const registration = registrationRef.current; 3525 if (registration !== null) { 3526 if (registration.element === element && registration.store === store2 && registration.id === id) { 3527 return; 3528 } 3529 registrationRef.current = null; 3530 const registeredStore = registration.store; 3531 if (registeredStore.context.triggerElements.getById(registration.id) === registration.element) { 3532 registeredStore.context.triggerElements.delete(registration.id); 3533 syncTriggerCount(registeredStore); 3534 } 3535 } 3536 if (element !== null && id !== void 0) { 3537 registrationRef.current = { 3538 store: store2, 3539 id, 3540 element 3541 }; 3542 store2.context.triggerElements.add(id, element); 3543 syncTriggerCount(store2); 3544 } 3545 }); 3546 } 3547 function createPopupOpenState(state, open2, trigger, preventUnmountOnClose = false) { 3548 let preventUnmountingOnClose = state.preventUnmountingOnClose; 3549 if (open2) { 3550 preventUnmountingOnClose = false; 3551 } else if (preventUnmountOnClose) { 3552 preventUnmountingOnClose = true; 3553 } 3554 const triggerId = trigger?.id ?? null; 3555 let activeTriggerId = state.activeTriggerId; 3556 let activeTriggerElement = state.activeTriggerElement; 3557 if (triggerId || open2) { 3558 activeTriggerId = triggerId; 3559 activeTriggerElement = trigger ?? null; 3560 } 3561 return { 3562 open: open2, 3563 preventUnmountingOnClose, 3564 activeTriggerId, 3565 activeTriggerElement, 3566 // An open request without a trigger (a handle's `open(null)` or `openWithPayload()`) must not 3567 // be reassociated with a lone registered trigger later on. Controlled and default opens never 3568 // pass through here, so they keep claiming a lone trigger. A close request keeps the flag: a 3569 // controlled root may decline it and stay open, so the Root clears the flag only once the 3570 // popup is effectively closed. 3571 openedWithoutTrigger: open2 ? trigger == null : state.openedWithoutTrigger 3572 }; 3573 } 3574 function attachPreventUnmountOnClose(eventDetails) { 3575 let preventUnmountOnClose = false; 3576 eventDetails.preventUnmountOnClose = () => { 3577 preventUnmountOnClose = true; 3578 }; 3579 return () => preventUnmountOnClose; 3580 } 3581 function applyPopupOpenChange(store2, nextOpen, eventDetails, options = {}) { 3582 const reason = eventDetails.reason; 3583 const isHover = reason === reason_parts_exports.triggerHover; 3584 const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus; 3585 const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey); 3586 const shouldPreventUnmountOnClose = attachPreventUnmountOnClose(eventDetails); 3587 store2.context.onOpenChange?.(nextOpen, eventDetails); 3588 if (eventDetails.isCanceled) { 3589 return; 3590 } 3591 options.onBeforeDispatch?.(); 3592 store2.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); 3593 const changeState = () => { 3594 const popupOpenState = createPopupOpenState(store2.state, nextOpen, eventDetails.trigger, shouldPreventUnmountOnClose()); 3595 const updatedState = { 3596 ...options.extraState, 3597 ...popupOpenState 3598 }; 3599 if (isFocusOpen) { 3600 updatedState.instantType = "focus"; 3601 } else if (isDismissClose) { 3602 updatedState.instantType = "dismiss"; 3603 } else if (isHover) { 3604 updatedState.instantType = void 0; 3605 } 3606 store2.update(updatedState); 3607 }; 3608 if (isHover) { 3609 ReactDOM3.flushSync(changeState); 3610 } else { 3611 changeState(); 3612 } 3613 } 3614 function useTriggerDataForwarding(triggerId, triggerElementRef, store2, stateUpdates) { 3615 const isMountedByThisTrigger = store2.useState("isMountedByTrigger", triggerId); 3616 const baseRegisterTrigger = useTriggerRegistration(triggerId, store2); 3617 const applyTriggerData = useStableCallback((element) => { 3618 const open2 = store2.select("open"); 3619 const activeTriggerId = store2.select("activeTriggerId"); 3620 if (activeTriggerId === triggerId) { 3621 const changes = { 3622 activeTriggerElement: element, 3623 ...open2 ? stateUpdates : null 3624 }; 3625 store2.update(changes); 3626 return; 3627 } 3628 if (activeTriggerId == null && open2 && !store2.state.openedWithoutTrigger) { 3629 const changes = { 3630 activeTriggerId: triggerId ?? null, 3631 activeTriggerElement: element, 3632 ...stateUpdates 3633 }; 3634 store2.update(changes); 3635 } 3636 }); 3637 const registerTrigger = useStableCallback((element) => { 3638 baseRegisterTrigger(element); 3639 if (element) { 3640 applyTriggerData(element); 3641 } 3642 }); 3643 useIsoLayoutEffect(() => { 3644 registerTrigger(triggerElementRef.current); 3645 return () => registerTrigger(null); 3646 }, [registerTrigger, triggerElementRef, store2, triggerId]); 3647 useIsoLayoutEffect(() => { 3648 if (isMountedByThisTrigger) { 3649 const changes = { 3650 activeTriggerElement: triggerElementRef.current, 3651 ...stateUpdates 3652 }; 3653 store2.update(changes); 3654 } 3655 }, [isMountedByThisTrigger, store2, triggerElementRef, ...Object.values(stateUpdates)]); 3656 return { 3657 registerTrigger, 3658 isMountedByThisTrigger 3659 }; 3660 } 3661 function useImplicitActiveTrigger(store2, options = {}) { 3662 const { 3663 closeOnActiveTriggerUnmount = false 3664 } = options; 3665 const resolvedActiveTriggerIdRef = React19.useRef(null); 3666 const open2 = store2.useState("open"); 3667 const reactiveTriggerCount = store2.useState("triggerCount"); 3668 const activeTriggerId = store2.useState("activeTriggerId"); 3669 const reactiveActiveTriggerElement = store2.useState("activeTriggerElement"); 3670 useIsoLayoutEffect(() => { 3671 if (!open2) { 3672 resolvedActiveTriggerIdRef.current = null; 3673 if (store2.state.triggerCount !== 0) { 3674 store2.set("triggerCount", 0); 3675 } 3676 if (store2.state.openedWithoutTrigger) { 3677 store2.set("openedWithoutTrigger", false); 3678 } 3679 return; 3680 } 3681 const triggerCount = store2.context.triggerElements.size; 3682 const stateUpdates = {}; 3683 if (store2.state.triggerCount !== triggerCount) { 3684 stateUpdates.triggerCount = triggerCount; 3685 } 3686 const currentActiveTriggerId = store2.select("activeTriggerId"); 3687 let lostActiveTriggerId = null; 3688 if (currentActiveTriggerId) { 3689 const activeTriggerElement = store2.context.triggerElements.getById(currentActiveTriggerId); 3690 if (!activeTriggerElement) { 3691 for (const [triggerId, triggerElement] of store2.context.triggerElements.entries()) { 3692 if (triggerElement === store2.state.activeTriggerElement) { 3693 stateUpdates.activeTriggerId = triggerId; 3694 stateUpdates.activeTriggerElement = triggerElement; 3695 resolvedActiveTriggerIdRef.current = triggerId; 3696 break; 3697 } 3698 } 3699 if (stateUpdates.activeTriggerId === void 0) { 3700 if (resolvedActiveTriggerIdRef.current === currentActiveTriggerId) { 3701 lostActiveTriggerId = currentActiveTriggerId; 3702 } else { 3703 resolvedActiveTriggerIdRef.current = null; 3704 } 3705 } 3706 } else { 3707 resolvedActiveTriggerIdRef.current = currentActiveTriggerId; 3708 if (activeTriggerElement !== store2.state.activeTriggerElement) { 3709 stateUpdates.activeTriggerElement = activeTriggerElement; 3710 } 3711 } 3712 } else { 3713 resolvedActiveTriggerIdRef.current = null; 3714 } 3715 if (!lostActiveTriggerId && !currentActiveTriggerId && !store2.state.openedWithoutTrigger && triggerCount === 1) { 3716 const iteratorResult = store2.context.triggerElements.entries().next(); 3717 if (!iteratorResult.done) { 3718 const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; 3719 stateUpdates.activeTriggerId = implicitTriggerId; 3720 stateUpdates.activeTriggerElement = implicitTriggerElement; 3721 resolvedActiveTriggerIdRef.current = implicitTriggerId; 3722 } 3723 } 3724 if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0 || stateUpdates.activeTriggerElement !== void 0) { 3725 store2.update(stateUpdates); 3726 } 3727 if (lostActiveTriggerId) { 3728 if (closeOnActiveTriggerUnmount) { 3729 queueMicrotask(() => { 3730 if (store2.select("open") && store2.select("activeTriggerId") === lostActiveTriggerId && !store2.context.triggerElements.getById(lostActiveTriggerId)) { 3731 const eventDetails = createChangeEventDetails(reason_parts_exports.none); 3732 store2.setOpen(false, eventDetails); 3733 if (!eventDetails.isCanceled) { 3734 store2.update({ 3735 activeTriggerId: null, 3736 activeTriggerElement: null 3737 }); 3738 } 3739 } 3740 }); 3741 } 3742 } 3743 }, [open2, store2, reactiveTriggerCount, activeTriggerId, reactiveActiveTriggerElement, closeOnActiveTriggerUnmount]); 3744 } 3745 function useOpenStateTransitions(open2, store2, onUnmount, animateInitialOpen) { 3746 const { 3747 mounted, 3748 transitionStatus, 3749 forceUnmount 3750 } = useUnmountAfterClose({ 3751 open: open2, 3752 ref: store2.context.popupRef, 3753 preventUnmountOnClose: store2.useState("preventUnmountingOnClose"), 3754 setPreventUnmountOnClose: (preventUnmountOnClose) => store2.set("preventUnmountingOnClose", preventUnmountOnClose), 3755 animateInitialOpen, 3756 onUnmount() { 3757 store2.update({ 3758 activeTriggerId: null, 3759 activeTriggerElement: null, 3760 mounted: false, 3761 preventUnmountingOnClose: false 3762 }); 3763 onUnmount?.(); 3764 store2.context.onOpenChangeComplete?.(false); 3765 } 3766 }); 3767 useRefWithInit(() => { 3768 store2.set("mounted", mounted); 3769 return null; 3770 }); 3771 store2.useSyncedValues({ 3772 mounted, 3773 transitionStatus 3774 }); 3775 return { 3776 forceUnmount, 3777 transitionStatus 3778 }; 3779 } 3780 function usePopupInteractionProps(store2, statePart) { 3781 store2.useSyncedValues(statePart); 3782 useIsoLayoutEffect(() => () => { 3783 store2.update({ 3784 activeTriggerProps: EMPTY_OBJECT, 3785 inactiveTriggerProps: EMPTY_OBJECT, 3786 popupProps: EMPTY_OBJECT 3787 }); 3788 }, [store2]); 3789 } 3790 3791 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/popupTriggerMap.mjs 3792 var devElementIdsByMap; 3793 function getDevElementIds(map) { 3794 devElementIdsByMap ??= /* @__PURE__ */ new WeakMap(); 3795 let elementIds = devElementIdsByMap.get(map); 3796 if (!elementIds) { 3797 elementIds = /* @__PURE__ */ new WeakMap(); 3798 devElementIdsByMap.set(map, elementIds); 3799 } 3800 return elementIds; 3801 } 3802 var PopupTriggerMap = class { 3803 idMap = /* @__PURE__ */ new Map(); 3804 /** 3805 * Adds a trigger element with the given ID. 3806 * 3807 * Note: The provided element is assumed to not be registered under multiple IDs. 3808 */ 3809 add(id, element) { 3810 if (true) { 3811 const elementIds = getDevElementIds(this); 3812 const existingId = elementIds.get(element); 3813 if (existingId !== void 0 && existingId !== id) { 3814 throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); 3815 } 3816 const previousElement = this.idMap.get(id); 3817 if (previousElement !== void 0 && previousElement !== element) { 3818 elementIds.delete(previousElement); 3819 } 3820 elementIds.set(element, id); 3821 } 3822 this.idMap.set(id, element); 3823 } 3824 /** 3825 * Removes the trigger element with the given ID. 3826 */ 3827 delete(id) { 3828 if (true) { 3829 const element = this.idMap.get(id); 3830 if (element !== void 0) { 3831 devElementIdsByMap?.get(this)?.delete(element); 3832 } 3833 } 3834 this.idMap.delete(id); 3835 } 3836 /** 3837 * Whether the given element is registered as a trigger. 3838 */ 3839 hasElement(element) { 3840 for (const registered of this.idMap.values()) { 3841 if (registered === element) { 3842 return true; 3843 } 3844 } 3845 return false; 3846 } 3847 /** 3848 * Whether there is a registered trigger element matching the given predicate. 3849 */ 3850 hasMatchingElement(predicate) { 3851 for (const element of this.idMap.values()) { 3852 if (predicate(element)) { 3853 return true; 3854 } 3855 } 3856 return false; 3857 } 3858 /** 3859 * Returns the trigger element associated with the given ID, or undefined if no such element exists. 3860 */ 3861 getById(id) { 3862 return this.idMap.get(id); 3863 } 3864 /** 3865 * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element]. 3866 */ 3867 entries() { 3868 return this.idMap.entries(); 3869 } 3870 /** 3871 * Returns an iterable of all registered trigger elements. 3872 */ 3873 elements() { 3874 return this.idMap.values(); 3875 } 3876 /** 3877 * Returns the number of registered trigger elements. 3878 */ 3879 get size() { 3880 return this.idMap.size; 3881 } 3882 }; 3883 3884 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/useStore.mjs 3885 var React21 = __toESM(require_react(), 1); 3886 var import_shim = __toESM(require_shim(), 1); 3887 var import_with_selector = __toESM(require_with_selector(), 1); 3888 3889 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/fastHooks.mjs 3890 var React20 = __toESM(require_react(), 1); 3891 var hooks = []; 3892 var currentInstance = void 0; 3893 function getInstance() { 3894 return currentInstance; 3895 } 3896 function register(hook) { 3897 hooks.push(hook); 3898 } 3899 function fastComponent(fn) { 3900 const FastComponent = (props, forwardedRef) => { 3901 const instance = useRefWithInit(createInstance).current; 3902 let result; 3903 try { 3904 currentInstance = instance; 3905 for (const hook of hooks) { 3906 hook.before(instance); 3907 } 3908 result = fn(props, forwardedRef); 3909 for (const hook of hooks) { 3910 hook.after(instance); 3911 } 3912 instance.didInitialize = true; 3913 } finally { 3914 currentInstance = void 0; 3915 } 3916 return result; 3917 }; 3918 FastComponent.displayName = fn.displayName || fn.name; 3919 return FastComponent; 3920 } 3921 function fastComponentRef(fn) { 3922 return /* @__PURE__ */ React20.forwardRef(fastComponent(fn)); 3923 } 3924 function createInstance() { 3925 return { 3926 didInitialize: false 3927 }; 3928 } 3929 3930 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/useStore.mjs 3931 var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19); 3932 var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy; 3933 function useStore(store2, selector, a1, a2, a3) { 3934 return useStoreImplementation(store2, selector, a1, a2, a3); 3935 } 3936 function useStoreR19(store2, selector, a1, a2, a3) { 3937 const getSelection = React21.useCallback(() => selector(store2.getSnapshot(), a1, a2, a3), [store2, selector, a1, a2, a3]); 3938 return (0, import_shim.useSyncExternalStore)(store2.subscribe, getSelection, getSelection); 3939 } 3940 register({ 3941 before(instance) { 3942 instance.syncIndex = 0; 3943 if (!instance.didInitialize) { 3944 instance.syncTick = 1; 3945 instance.syncHooks = []; 3946 instance.didChangeStore = true; 3947 instance.getSnapshot = () => { 3948 let didChange2 = false; 3949 for (let i = 0; i < instance.syncHooks.length; i += 1) { 3950 const hook = instance.syncHooks[i]; 3951 const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3); 3952 if (!Object.is(hook.value, value)) { 3953 didChange2 = true; 3954 hook.value = value; 3955 } 3956 } 3957 if (didChange2) { 3958 instance.syncTick += 1; 3959 } 3960 return instance.syncTick; 3961 }; 3962 } 3963 }, 3964 after(instance) { 3965 if (instance.syncHooks.length > 0) { 3966 if (instance.didChangeStore) { 3967 instance.didChangeStore = false; 3968 instance.subscribe = (onStoreChange) => { 3969 const stores = /* @__PURE__ */ new Set(); 3970 for (const hook of instance.syncHooks) { 3971 stores.add(hook.store); 3972 } 3973 const unsubscribes = []; 3974 for (const store2 of stores) { 3975 unsubscribes.push(store2.subscribe(onStoreChange)); 3976 } 3977 return () => { 3978 for (const unsubscribe of unsubscribes) { 3979 unsubscribe(); 3980 } 3981 }; 3982 }; 3983 } 3984 (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot); 3985 } 3986 } 3987 }); 3988 function useStoreFast(store2, selector, a1, a2, a3) { 3989 const instance = getInstance(); 3990 if (!instance) { 3991 return useStoreR19(store2, selector, a1, a2, a3); 3992 } 3993 const index2 = instance.syncIndex; 3994 instance.syncIndex += 1; 3995 let hook; 3996 if (!instance.didInitialize) { 3997 hook = { 3998 store: store2, 3999 selector, 4000 a1, 4001 a2, 4002 a3, 4003 value: selector(store2.getSnapshot(), a1, a2, a3) 4004 }; 4005 instance.syncHooks.push(hook); 4006 } else { 4007 hook = instance.syncHooks[index2]; 4008 if (hook.store !== store2 || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) { 4009 if (hook.store !== store2) { 4010 instance.didChangeStore = true; 4011 } 4012 hook.store = store2; 4013 hook.selector = selector; 4014 hook.a1 = a1; 4015 hook.a2 = a2; 4016 hook.a3 = a3; 4017 hook.value = selector(store2.getSnapshot(), a1, a2, a3); 4018 } 4019 } 4020 return hook.value; 4021 } 4022 function useStoreLegacy(store2, selector, a1, a2, a3) { 4023 return (0, import_with_selector.useSyncExternalStoreWithSelector)(store2.subscribe, store2.getSnapshot, store2.getSnapshot, (state) => selector(state, a1, a2, a3)); 4024 } 4025 4026 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/Store.mjs 4027 var Store = class { 4028 /** 4029 * Creates a store with the given initial state, constructing the class it is called on. 4030 * Calling it on a generic base class (e.g. `ReactStore.create(...)`) constructs that 4031 * class but degrades the inferred instance type to `Store`; use `new` there instead. 4032 */ 4033 static create(state) { 4034 return new this(state); 4035 } 4036 /** 4037 * The current state of the store. 4038 * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}. 4039 * 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). 4040 * The values can be used directly (to avoid subscribing to the store) in effects or event handlers. 4041 * 4042 * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification. 4043 */ 4044 // Internal state to handle recursive `setState()` calls 4045 constructor(state) { 4046 this.state = state; 4047 this.listeners = /* @__PURE__ */ new Set(); 4048 this.updateTick = 0; 4049 } 4050 /** 4051 * Registers a listener that will be called whenever the store's state changes. 4052 * 4053 * @param fn The listener function to be called on state changes. 4054 * @returns A function to unsubscribe the listener. 4055 */ 4056 subscribe = (fn) => { 4057 this.listeners.add(fn); 4058 return () => { 4059 this.listeners.delete(fn); 4060 }; 4061 }; 4062 /** 4063 * Returns the current state of the store. 4064 */ 4065 getSnapshot = () => { 4066 return this.state; 4067 }; 4068 /** 4069 * Updates the entire store's state and notifies all registered listeners. 4070 * 4071 * @param newState The new state to set for the store. 4072 */ 4073 setState(newState) { 4074 if (this.state === newState) { 4075 return; 4076 } 4077 this.state = newState; 4078 this.updateTick += 1; 4079 const currentTick = this.updateTick; 4080 for (const listener of this.listeners) { 4081 if (currentTick !== this.updateTick) { 4082 return; 4083 } 4084 listener(newState); 4085 } 4086 } 4087 /** 4088 * Merges the provided changes into the current state and notifies listeners if there are changes. 4089 * Each value must match its state key. Pass an exact known subset rather than a broad 4090 * `Partial<State>`, which may contain `undefined` for required state fields. 4091 * 4092 * @param changes An object containing the changes to apply to the current state. 4093 */ 4094 update(changes) { 4095 for (const key in changes) { 4096 if (!Object.is(this.state[key], changes[key])) { 4097 this.setState({ 4098 ...this.state, 4099 ...changes 4100 }); 4101 return; 4102 } 4103 } 4104 } 4105 /** 4106 * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed. 4107 * 4108 * @param key The key in the store's state to update. 4109 * @param value The new value to set for the specified key. 4110 */ 4111 set(key, value) { 4112 if (!Object.is(this.state[key], value)) { 4113 this.setState({ 4114 ...this.state, 4115 [key]: value 4116 }); 4117 } 4118 } 4119 /** 4120 * Gives the state a new reference and updates all registered listeners. 4121 */ 4122 notifyAll() { 4123 const newState = { 4124 ...this.state 4125 }; 4126 this.setState(newState); 4127 } 4128 use(selector, a1, a2, a3) { 4129 return useStore(this, selector, a1, a2, a3); 4130 } 4131 }; 4132 4133 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/store/ReactStore.mjs 4134 var React22 = __toESM(require_react(), 1); 4135 var ReactStore = class extends Store { 4136 /** 4137 * Creates a new ReactStore instance. 4138 * 4139 * @param state Initial state of the store. 4140 * @param context Non-reactive context values. 4141 * @param selectors Optional selectors for use with `useState`. 4142 */ 4143 constructor(state, context = {}, selectors3) { 4144 super(state); 4145 this.context = context; 4146 this.selectors = selectors3; 4147 } 4148 /** 4149 * Non-reactive values such as refs, callbacks, etc. 4150 */ 4151 /** 4152 * Synchronizes a single external value into the store. 4153 * 4154 * Note that the while the value in `state` is updated immediately, the value returned 4155 * by `useState` is updated before the next render (similarly to React's `useState`). 4156 */ 4157 useSyncedValue(key, value) { 4158 React22.useDebugValue(key); 4159 const store2 = this; 4160 useIsoLayoutEffect(() => { 4161 if (store2.state[key] !== value) { 4162 store2.set(key, value); 4163 } 4164 }, [store2, key, value]); 4165 } 4166 /** 4167 * Synchronizes a single external value into the store and 4168 * cleans it up (sets to `undefined`) on unmount. 4169 * 4170 * Note that the while the value in `state` is updated immediately, the value returned 4171 * by `useState` is updated before the next render (similarly to React's `useState`). 4172 */ 4173 useSyncedValueWithCleanup(key, value) { 4174 const store2 = this; 4175 useIsoLayoutEffect(() => { 4176 if (store2.state[key] !== value) { 4177 store2.set(key, value); 4178 } 4179 return () => { 4180 store2.set(key, void 0); 4181 }; 4182 }, [store2, key, value]); 4183 } 4184 /** 4185 * Synchronizes multiple external values into the store. 4186 * Each value must match its state key. Pass an exact known subset rather than a broad 4187 * `Partial<State>`, which may contain `undefined` for required state fields. 4188 * 4189 * Note that the while the values in `state` are updated immediately, the values returned 4190 * by `useState` are updated before the next render (similarly to React's `useState`). 4191 * 4192 * @param statePart An exact subset of state fields to synchronize. Unknown keys are not accepted. 4193 */ 4194 useSyncedValues(statePart) { 4195 const store2 = this; 4196 if (true) { 4197 React22.useDebugValue(statePart, (p) => Object.keys(p)); 4198 const keys = React22.useRef(Object.keys(statePart)).current; 4199 const nextKeys = Object.keys(statePart); 4200 if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) { 4201 console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable."); 4202 } 4203 } 4204 const dependencies = Object.values(statePart); 4205 useIsoLayoutEffect(() => { 4206 store2.update(statePart); 4207 }, [store2, ...dependencies]); 4208 } 4209 /** 4210 * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled` 4211 * is non-undefined, the store's state at `key` is updated to match `controlled`. 4212 */ 4213 useControlledProp(key, controlled) { 4214 React22.useDebugValue(key); 4215 const store2 = this; 4216 const isControlled = controlled !== void 0; 4217 useIsoLayoutEffect(() => { 4218 if (isControlled && !Object.is(store2.state[key], controlled)) { 4219 store2.setState({ 4220 ...store2.state, 4221 [key]: controlled 4222 }); 4223 } 4224 }, [store2, key, controlled, isControlled]); 4225 if (true) { 4226 const cache = this.controlledValues ??= /* @__PURE__ */ new Map(); 4227 if (!cache.has(key)) { 4228 cache.set(key, isControlled); 4229 } 4230 const previouslyControlled = cache.get(key); 4231 if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) { 4232 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).`); 4233 } 4234 } 4235 } 4236 /** Gets the current value from the store using a selector with the provided key. 4237 * 4238 * @param key Key of the selector to use. 4239 */ 4240 select(key, a1, a2, a3) { 4241 const selector = this.selectors[key]; 4242 return selector(this.state, a1, a2, a3); 4243 } 4244 /** 4245 * Returns a value from the store's state using a selector function. 4246 * Used to subscribe to specific parts of the state. 4247 * This methods causes a rerender whenever the selected state changes. 4248 * 4249 * @param key Key of the selector to use. 4250 */ 4251 useState(key, a1, a2, a3) { 4252 React22.useDebugValue(key); 4253 return useStore(this, this.selectors[key], a1, a2, a3); 4254 } 4255 /** 4256 * Wraps a function with `useStableCallback` to ensure it has a stable reference 4257 * and assigns it to the context. 4258 * 4259 * @param key Key of the event callback. Must be a function in the context. 4260 * @param fn Function to assign. 4261 */ 4262 useContextCallback(key, fn) { 4263 React22.useDebugValue(key); 4264 const stableFunction = useStableCallback(fn ?? NOOP); 4265 this.context[key] = stableFunction; 4266 } 4267 /** 4268 * Returns a stable setter function for a specific key in the store's state. 4269 * It's commonly used to pass as a ref callback to React elements. 4270 * 4271 * @param key Key of the state to set. 4272 */ 4273 useStateSetter(key) { 4274 const ref = React22.useRef(void 0); 4275 if (ref.current === void 0) { 4276 ref.current = (value) => { 4277 this.set(key, value); 4278 }; 4279 } 4280 return ref.current; 4281 } 4282 /** 4283 * Observes changes derived from the store's selectors and calls the listener when the selected value changes. 4284 * 4285 * @param key Key of the selector to observe. 4286 * @param listener Listener function called when the selector result changes. 4287 */ 4288 observe(selector, listener) { 4289 let selectFn; 4290 if (typeof selector === "function") { 4291 selectFn = selector; 4292 } else { 4293 selectFn = this.selectors[selector]; 4294 } 4295 let prevValue = selectFn(this.state); 4296 listener(prevValue, prevValue, this); 4297 return this.subscribe((nextState) => { 4298 const nextValue = selectFn(nextState); 4299 if (!Object.is(prevValue, nextValue)) { 4300 const oldValue = prevValue; 4301 prevValue = nextValue; 4302 listener(nextValue, oldValue, this); 4303 } 4304 }); 4305 } 4306 }; 4307 4308 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/components/FloatingRootStore.mjs 4309 var selectors = { 4310 open: (state) => state.open, 4311 transitionStatus: (state) => state.transitionStatus, 4312 domReferenceElement: (state) => state.domReferenceElement, 4313 referenceElement: (state) => state.positionReference ?? state.referenceElement, 4314 floatingElement: (state) => state.floatingElement, 4315 floatingId: (state) => state.floatingId 4316 }; 4317 var FloatingRootStore = class extends ReactStore { 4318 constructor(options) { 4319 const { 4320 syncOnly, 4321 nested, 4322 onOpenChange, 4323 triggerElements, 4324 ...initialState2 4325 } = options; 4326 super({ 4327 ...initialState2, 4328 positionReference: initialState2.referenceElement, 4329 domReferenceElement: initialState2.referenceElement 4330 }, { 4331 onOpenChange, 4332 dataRef: { 4333 current: {} 4334 }, 4335 events: createEventEmitter(), 4336 nested, 4337 triggerElements 4338 }, selectors); 4339 this.syncOnly = syncOnly; 4340 } 4341 /** 4342 * Syncs the event used by hover logic to distinguish hover-open from click-like interaction. 4343 */ 4344 syncOpenEvent = (newOpen, event) => { 4345 if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing 4346 // click events to upgrade a hover-open. 4347 event != null && isClickLikeEvent(event)) { 4348 this.context.dataRef.current.openEvent = newOpen ? event : void 0; 4349 } 4350 }; 4351 /** 4352 * Runs the root-owned side effects for an open state change. 4353 */ 4354 dispatchOpenChange = (newOpen, eventDetails) => { 4355 this.syncOpenEvent(newOpen, eventDetails.event); 4356 const details = { 4357 open: newOpen, 4358 reason: eventDetails.reason, 4359 nativeEvent: eventDetails.event, 4360 nested: this.context.nested, 4361 triggerElement: eventDetails.trigger 4362 }; 4363 this.context.events.emit("openchange", details); 4364 }; 4365 /** 4366 * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments. 4367 * 4368 * @param newOpen The new open state. 4369 * @param eventDetails Details about the event that triggered the open state change. 4370 */ 4371 setOpen = (newOpen, eventDetails) => { 4372 if (this.syncOnly) { 4373 this.context.onOpenChange?.(newOpen, eventDetails); 4374 return; 4375 } 4376 this.dispatchOpenChange(newOpen, eventDetails); 4377 this.context.onOpenChange?.(newOpen, eventDetails); 4378 }; 4379 }; 4380 4381 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/store.mjs 4382 function createInitialPopupStoreState(triggerElements, floatingId, nested = false) { 4383 return { 4384 open: false, 4385 openProp: void 0, 4386 mounted: false, 4387 transitionStatus: void 0, 4388 floatingRootContext: new FloatingRootStore({ 4389 open: false, 4390 transitionStatus: void 0, 4391 floatingElement: null, 4392 referenceElement: null, 4393 triggerElements, 4394 floatingId, 4395 syncOnly: true, 4396 nested, 4397 onOpenChange: void 0 4398 }), 4399 floatingId, 4400 triggerCount: 0, 4401 preventUnmountingOnClose: false, 4402 payload: void 0, 4403 activeTriggerId: null, 4404 activeTriggerElement: null, 4405 openedWithoutTrigger: false, 4406 triggerIdProp: void 0, 4407 popupElement: null, 4408 positionerElement: null, 4409 activeTriggerProps: EMPTY_OBJECT, 4410 inactiveTriggerProps: EMPTY_OBJECT, 4411 popupProps: EMPTY_OBJECT 4412 }; 4413 } 4414 var activeTriggerIdSelector = (state) => state.triggerIdProp ?? state.activeTriggerId; 4415 var openSelector = (state) => state.openProp ?? state.open; 4416 var popupIdSelector = (state) => { 4417 const popupId = state.popupElement?.id ?? state.floatingId; 4418 return popupId || void 0; 4419 }; 4420 function triggerOwnsOpenPopup(state, triggerId) { 4421 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId; 4422 } 4423 function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) { 4424 if (triggerOwnsOpenPopup(state, triggerId)) { 4425 return true; 4426 } 4427 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && !state.openedWithoutTrigger && state.triggerCount === 1; 4428 } 4429 var popupStoreSelectors = { 4430 open: openSelector, 4431 mounted: (state) => state.mounted, 4432 // `open` is written synchronously on an open change; `mounted`/`transitionStatus` sync in a 4433 // layout effect. Match useTransitionStatus so a retained popup does not miss its starting phase. 4434 transitionStatus: (state) => openSelector(state) && !state.mounted ? "starting" : state.transitionStatus, 4435 floatingRootContext: (state) => state.floatingRootContext, 4436 triggerCount: (state) => state.triggerCount, 4437 preventUnmountingOnClose: (state) => state.preventUnmountingOnClose, 4438 payload: (state) => state.payload, 4439 activeTriggerId: activeTriggerIdSelector, 4440 activeTriggerElement: (state) => state.mounted ? state.activeTriggerElement : null, 4441 popupId: popupIdSelector, 4442 /** 4443 * Whether the trigger with the given ID was used to open the popup. 4444 */ 4445 isTriggerActive: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId, 4446 /** 4447 * Whether the popup is open and was activated by a trigger with the given ID. 4448 */ 4449 isOpenedByTrigger: (state, triggerId) => triggerOwnsOpenPopup(state, triggerId), 4450 /** 4451 * Whether the popup is mounted and was activated by a trigger with the given ID. 4452 */ 4453 isMountedByTrigger: (state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted, 4454 triggerProps: (state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps, 4455 /** 4456 * Popup id for the trigger that currently owns the open popup. 4457 */ 4458 triggerPopupId: (state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0, 4459 popupProps: (state) => state.popupProps, 4460 popupElement: (state) => state.popupElement, 4461 positionerElement: (state) => state.positionerElement 4462 }; 4463 4464 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/popups/usePopupHandleStore.mjs 4465 var React23 = __toESM(require_react(), 1); 4466 var import_shim2 = __toESM(require_shim(), 1); 4467 function usePopupHandleStore(handle) { 4468 const subscribe = React23.useCallback((listener) => { 4469 if (handle === void 0) { 4470 return NOOP; 4471 } 4472 return handle.subscribeStore(listener); 4473 }, [handle]); 4474 const getSnapshot = React23.useCallback(() => { 4475 return handle === void 0 ? void 0 : handle.store; 4476 }, [handle]); 4477 return (0, import_shim2.useSyncExternalStore)(subscribe, getSnapshot, () => handle?.serverStore); 4478 } 4479 4480 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useFocus.mjs 4481 var React24 = __toESM(require_react(), 1); 4482 var isMacSafari = parts_exports.os.mac && parts_exports.engine.webkit; 4483 function useFocus(store2, props = {}) { 4484 const { 4485 enabled = true, 4486 delay 4487 } = props; 4488 const { 4489 events, 4490 dataRef 4491 } = store2.context; 4492 const blockFocusRef = React24.useRef(false); 4493 const blockedReferenceRef = React24.useRef(null); 4494 const keyboardModalityRef = React24.useRef(true); 4495 const timeout = useTimeout(); 4496 React24.useEffect(() => { 4497 const domReference = store2.select("domReferenceElement"); 4498 if (!enabled) { 4499 return void 0; 4500 } 4501 const win = getWindow(domReference); 4502 function onBlur() { 4503 const currentDomReference = store2.select("domReferenceElement"); 4504 if (!store2.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) { 4505 blockFocusRef.current = true; 4506 blockedReferenceRef.current = currentDomReference; 4507 } 4508 } 4509 function onKeyDown() { 4510 keyboardModalityRef.current = true; 4511 } 4512 function onPointerDown() { 4513 keyboardModalityRef.current = false; 4514 } 4515 return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true)); 4516 }, [store2, enabled]); 4517 React24.useEffect(() => { 4518 if (!enabled) { 4519 return void 0; 4520 } 4521 function onOpenChangeLocal(details) { 4522 if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) { 4523 const referenceElement = store2.select("domReferenceElement"); 4524 if (isElement(referenceElement)) { 4525 blockedReferenceRef.current = referenceElement; 4526 blockFocusRef.current = true; 4527 } 4528 } 4529 } 4530 events.on("openchange", onOpenChangeLocal); 4531 return () => { 4532 events.off("openchange", onOpenChangeLocal); 4533 }; 4534 }, [events, enabled, store2]); 4535 const reference = React24.useMemo(() => { 4536 function resetBlockedFocus() { 4537 blockFocusRef.current = false; 4538 blockedReferenceRef.current = null; 4539 } 4540 return { 4541 onMouseLeave() { 4542 resetBlockedFocus(); 4543 }, 4544 onFocus(event) { 4545 const focusTarget = event.currentTarget; 4546 if (blockFocusRef.current) { 4547 if (blockedReferenceRef.current === focusTarget) { 4548 return; 4549 } 4550 resetBlockedFocus(); 4551 } 4552 const target = getTarget(event.nativeEvent); 4553 if (isElement(target)) { 4554 if (isMacSafari && !event.relatedTarget) { 4555 if (!keyboardModalityRef.current && !isTypeableElement(target)) { 4556 return; 4557 } 4558 } else if (!matchesFocusVisible(target)) { 4559 return; 4560 } 4561 } 4562 const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements); 4563 const { 4564 nativeEvent, 4565 currentTarget 4566 } = event; 4567 if (store2.select("open") && movedFromOtherEnabledTrigger || !delay) { 4568 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 4569 return; 4570 } 4571 timeout.start(delay, () => { 4572 if (blockFocusRef.current) { 4573 return; 4574 } 4575 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 4576 }); 4577 }, 4578 onBlur(event) { 4579 resetBlockedFocus(); 4580 const relatedTarget = event.relatedTarget; 4581 const nativeEvent = event.nativeEvent; 4582 const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside"; 4583 timeout.start(0, () => { 4584 const domReference = store2.select("domReferenceElement"); 4585 const activeEl = activeElement(ownerDocument(domReference)); 4586 if (!relatedTarget && activeEl === domReference) { 4587 return; 4588 } 4589 if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) { 4590 return; 4591 } 4592 const nextFocusedElement = relatedTarget ?? activeEl; 4593 if (isTargetInsideEnabledTrigger(nextFocusedElement, store2.context.triggerElements)) { 4594 return; 4595 } 4596 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent)); 4597 }); 4598 } 4599 }; 4600 }, [dataRef, delay, store2, timeout]); 4601 return React24.useMemo(() => enabled ? { 4602 reference, 4603 trigger: reference 4604 } : {}, [enabled, reference]); 4605 } 4606 4607 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs 4608 var React25 = __toESM(require_react(), 1); 4609 4610 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverInteractionSharedState.mjs 4611 var HoverInteraction = class _HoverInteraction { 4612 pointerType = void 0; 4613 interactedInside = false; 4614 handler = void 0; 4615 blockMouseMove = true; 4616 performedPointerEventsMutation = false; 4617 pointerEventsScopeElement = null; 4618 pointerEventsReferenceElement = null; 4619 pointerEventsFloatingElement = null; 4620 restTimeoutPending = false; 4621 openChangeTimeout = new Timeout(); 4622 restTimeout = new Timeout(); 4623 handleCloseOptions = void 0; 4624 static create() { 4625 return new _HoverInteraction(); 4626 } 4627 dispose = () => { 4628 this.openChangeTimeout.clear(); 4629 this.restTimeout.clear(); 4630 }; 4631 disposeEffect = () => { 4632 return this.dispose; 4633 }; 4634 }; 4635 var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap(); 4636 function clearSafePolygonPointerEventsMutation(instance) { 4637 if (!instance.performedPointerEventsMutation) { 4638 return; 4639 } 4640 const scopeElement = instance.pointerEventsScopeElement; 4641 if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) { 4642 instance.pointerEventsScopeElement?.style.removeProperty("pointer-events"); 4643 instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events"); 4644 instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events"); 4645 pointerEventsMutationOwnerByScopeElement.delete(scopeElement); 4646 } 4647 instance.performedPointerEventsMutation = false; 4648 instance.pointerEventsScopeElement = null; 4649 instance.pointerEventsReferenceElement = null; 4650 instance.pointerEventsFloatingElement = null; 4651 } 4652 function applySafePolygonPointerEventsMutation(instance, options) { 4653 const { 4654 scopeElement, 4655 referenceElement, 4656 floatingElement 4657 } = options; 4658 const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement); 4659 if (existingOwner && existingOwner !== instance) { 4660 clearSafePolygonPointerEventsMutation(existingOwner); 4661 } 4662 clearSafePolygonPointerEventsMutation(instance); 4663 instance.performedPointerEventsMutation = true; 4664 instance.pointerEventsScopeElement = scopeElement; 4665 instance.pointerEventsReferenceElement = referenceElement; 4666 instance.pointerEventsFloatingElement = floatingElement; 4667 pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance); 4668 scopeElement.style.pointerEvents = "none"; 4669 referenceElement.style.pointerEvents = "auto"; 4670 floatingElement.style.pointerEvents = "auto"; 4671 } 4672 function useHoverInteractionSharedState(store2) { 4673 const data = store2.context.dataRef.current; 4674 const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current; 4675 if (!data.hoverInteractionState) { 4676 data.hoverInteractionState = instance; 4677 } 4678 useOnMount(data.hoverInteractionState.disposeEffect); 4679 return data.hoverInteractionState; 4680 } 4681 4682 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverFloatingInteraction.mjs 4683 function useHoverFloatingInteraction(store2, parameters = {}) { 4684 const { 4685 enabled = true, 4686 closeDelay: closeDelayProp = 0, 4687 nodeId: nodeIdProp 4688 } = parameters; 4689 const open2 = store2.useState("open"); 4690 const floatingElement = store2.useState("floatingElement"); 4691 const domReferenceElement = store2.useState("domReferenceElement"); 4692 const { 4693 dataRef 4694 } = store2.context; 4695 const tree = useFloatingTree(); 4696 const parentId = useFloatingParentNodeId(); 4697 const instance = useHoverInteractionSharedState(store2); 4698 const childClosedTimeout = useTimeout(); 4699 const isClickLikeOpenEvent2 = useStableCallback(() => { 4700 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 4701 }); 4702 const isHoverOpen = useStableCallback(() => { 4703 return isHoverOpenEvent(dataRef.current.openEvent?.type); 4704 }); 4705 const clearPointerEvents = useStableCallback(() => { 4706 clearSafePolygonPointerEventsMutation(instance); 4707 }); 4708 useIsoLayoutEffect(() => { 4709 if (!open2) { 4710 instance.pointerType = void 0; 4711 instance.restTimeoutPending = false; 4712 instance.interactedInside = false; 4713 clearPointerEvents(); 4714 } 4715 }, [open2, instance, clearPointerEvents]); 4716 React25.useEffect(() => { 4717 return clearPointerEvents; 4718 }, [clearPointerEvents]); 4719 useIsoLayoutEffect(() => { 4720 if (!enabled) { 4721 return void 0; 4722 } 4723 if (open2 && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { 4724 const ref = domReferenceElement; 4725 const floatingEl = floatingElement; 4726 const doc = ownerDocument(floatingElement); 4727 const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating; 4728 if (parentFloating) { 4729 parentFloating.style.pointerEvents = ""; 4730 } 4731 const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null; 4732 const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null; 4733 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? closest(ref, "[data-rootownerid]") ?? doc.body; 4734 applySafePolygonPointerEventsMutation(instance, { 4735 scopeElement, 4736 referenceElement: ref, 4737 floatingElement: floatingEl 4738 }); 4739 return () => { 4740 clearPointerEvents(); 4741 }; 4742 } 4743 return void 0; 4744 }, [enabled, open2, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); 4745 React25.useEffect(() => { 4746 if (!enabled) { 4747 return void 0; 4748 } 4749 function hasParentChildren() { 4750 return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0); 4751 } 4752 function closeWithDelay(event) { 4753 const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType); 4754 const close = () => { 4755 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 4756 tree?.events.emit("floating.closed", event); 4757 }; 4758 if (closeDelay) { 4759 instance.openChangeTimeout.start(closeDelay, close); 4760 } else { 4761 instance.openChangeTimeout.clear(); 4762 close(); 4763 } 4764 } 4765 function handleInteractInside(event) { 4766 const target = getTarget(event); 4767 if (!isInteractiveElement(target)) { 4768 instance.interactedInside = false; 4769 return; 4770 } 4771 instance.interactedInside = closest(target, "[aria-haspopup]") != null; 4772 } 4773 function onFloatingMouseEnter() { 4774 instance.openChangeTimeout.clear(); 4775 childClosedTimeout.clear(); 4776 tree?.events.off("floating.closed", onNodeClosed); 4777 clearPointerEvents(); 4778 } 4779 function onFloatingMouseLeave(event) { 4780 if (hasParentChildren() && tree) { 4781 tree.events.on("floating.closed", onNodeClosed); 4782 return; 4783 } 4784 if (isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements)) { 4785 return; 4786 } 4787 const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp; 4788 const relatedTarget = event.relatedTarget; 4789 const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget)); 4790 if (isMovingIntoDescendantFloating) { 4791 return; 4792 } 4793 if (instance.handler) { 4794 instance.handler(event); 4795 return; 4796 } 4797 clearPointerEvents(); 4798 if (isHoverOpen() && !isClickLikeOpenEvent2()) { 4799 closeWithDelay(event); 4800 } 4801 } 4802 function onNodeClosed(event) { 4803 if (!tree || !parentId || hasParentChildren()) { 4804 return; 4805 } 4806 childClosedTimeout.start(0, () => { 4807 tree.events.off("floating.closed", onNodeClosed); 4808 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 4809 tree.events.emit("floating.closed", event); 4810 }); 4811 } 4812 const floating = floatingElement; 4813 return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => { 4814 tree?.events.off("floating.closed", onNodeClosed); 4815 }); 4816 }, [enabled, floatingElement, store2, dataRef, closeDelayProp, nodeIdProp, isHoverOpen, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]); 4817 } 4818 4819 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useHoverReferenceInteraction.mjs 4820 var React26 = __toESM(require_react(), 1); 4821 var ReactDOM4 = __toESM(require_react_dom(), 1); 4822 var EMPTY_REF = { 4823 current: null 4824 }; 4825 function useHoverReferenceInteraction(store2, props = {}) { 4826 const { 4827 enabled = true, 4828 delay = 0, 4829 handleClose = null, 4830 mouseOnly = false, 4831 restMs = 0, 4832 move = true, 4833 triggerElementRef = EMPTY_REF, 4834 externalTree, 4835 isActiveTrigger = true, 4836 getHandleCloseContext, 4837 isClosing, 4838 shouldOpen: shouldOpenProp, 4839 guardStaleOpen = false 4840 } = props; 4841 const { 4842 dataRef, 4843 events 4844 } = store2.context; 4845 const tree = useFloatingTree(externalTree); 4846 const instance = useHoverInteractionSharedState(store2); 4847 const isHoverCloseActiveRef = React26.useRef(false); 4848 const handleCloseRef = useValueAsRef(handleClose); 4849 const delayRef = useValueAsRef(delay); 4850 const restMsRef = useValueAsRef(restMs); 4851 const enabledRef = useValueAsRef(enabled); 4852 const shouldOpenRef = useValueAsRef(shouldOpenProp); 4853 const isClosingRef = useValueAsRef(isClosing); 4854 const isClickLikeOpenEvent2 = useStableCallback(() => { 4855 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 4856 }); 4857 const checkShouldOpen = useStableCallback(() => { 4858 return shouldOpenRef.current?.() !== false; 4859 }); 4860 const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => { 4861 const allTriggers = store2.context.triggerElements; 4862 if (allTriggers.hasElement(currentTarget)) { 4863 return !currentDomReference || !contains(currentDomReference, currentTarget); 4864 } 4865 if (!isElement(target)) { 4866 return false; 4867 } 4868 const targetElement = target; 4869 return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement)); 4870 }); 4871 const cleanupMouseMoveHandler = useStableCallback(() => { 4872 if (!instance.handler) { 4873 return; 4874 } 4875 const doc = ownerDocument(store2.select("domReferenceElement")); 4876 doc.removeEventListener("mousemove", instance.handler); 4877 instance.handler = void 0; 4878 }); 4879 const clearPointerEvents = useStableCallback(() => { 4880 clearSafePolygonPointerEventsMutation(instance); 4881 }); 4882 if (isActiveTrigger) { 4883 instance.handleCloseOptions = handleClose?.__options; 4884 } 4885 React26.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); 4886 React26.useEffect(() => { 4887 if (!enabled) { 4888 return void 0; 4889 } 4890 function onOpenChangeLocal(details) { 4891 if (!details.open) { 4892 isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover; 4893 cleanupMouseMoveHandler(); 4894 instance.openChangeTimeout.clear(); 4895 instance.restTimeout.clear(); 4896 instance.blockMouseMove = true; 4897 instance.restTimeoutPending = false; 4898 } else { 4899 isHoverCloseActiveRef.current = false; 4900 } 4901 } 4902 events.on("openchange", onOpenChangeLocal); 4903 return () => { 4904 events.off("openchange", onOpenChangeLocal); 4905 }; 4906 }, [enabled, events, instance, cleanupMouseMoveHandler]); 4907 React26.useEffect(() => { 4908 if (!enabled) { 4909 return void 0; 4910 } 4911 function closeWithDelay(event, runElseBranch = true) { 4912 const closeDelay = getDelay(delayRef.current, "close", instance.pointerType); 4913 if (closeDelay) { 4914 instance.openChangeTimeout.start(closeDelay, () => { 4915 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 4916 tree?.events.emit("floating.closed", event); 4917 }); 4918 } else if (runElseBranch) { 4919 instance.openChangeTimeout.clear(); 4920 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 4921 tree?.events.emit("floating.closed", event); 4922 } 4923 } 4924 const trigger = triggerElementRef.current ?? (isActiveTrigger ? store2.select("domReferenceElement") : null); 4925 if (!isElement(trigger)) { 4926 return void 0; 4927 } 4928 function onMouseEnter(event) { 4929 instance.openChangeTimeout.clear(); 4930 instance.blockMouseMove = false; 4931 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 4932 return; 4933 } 4934 const restMsValue = getRestMs(restMsRef.current); 4935 const openDelay = getDelay(delayRef.current, "open", instance.pointerType); 4936 const eventTarget = getTarget(event); 4937 const currentTarget = event.currentTarget ?? null; 4938 const currentDomReference = store2.select("domReferenceElement"); 4939 let triggerNode = currentTarget; 4940 if (isElement(eventTarget) && !store2.context.triggerElements.hasElement(eventTarget)) { 4941 for (const triggerElement of store2.context.triggerElements.elements()) { 4942 if (contains(triggerElement, eventTarget)) { 4943 triggerNode = triggerElement; 4944 break; 4945 } 4946 } 4947 } 4948 if (isElement(currentTarget) && isElement(currentDomReference) && !store2.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) { 4949 triggerNode = currentDomReference; 4950 } 4951 const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget); 4952 const isOpen = store2.select("open"); 4953 const isInClosingTransition = isClosingRef.current?.() ?? store2.select("transitionStatus") === "ending"; 4954 const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current; 4955 const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition; 4956 const isRestOnlyDelay = restMsValue > 0 && !openDelay; 4957 const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition; 4958 const shouldOpen = !isOpen || isOverInactive; 4959 if (shouldOpenImmediately) { 4960 if (checkShouldOpen()) { 4961 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 4962 } 4963 return; 4964 } 4965 if (isRestOnlyDelay) { 4966 return; 4967 } 4968 if (openDelay) { 4969 instance.openChangeTimeout.start(openDelay, () => { 4970 if (shouldOpen && checkShouldOpen()) { 4971 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 4972 } 4973 }); 4974 } else if (shouldOpen) { 4975 if (checkShouldOpen()) { 4976 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 4977 } 4978 } 4979 } 4980 function onMouseLeave(event) { 4981 if (isClickLikeOpenEvent2()) { 4982 clearPointerEvents(); 4983 return; 4984 } 4985 cleanupMouseMoveHandler(); 4986 const domReferenceElement = store2.select("domReferenceElement"); 4987 const doc = ownerDocument(domReferenceElement); 4988 instance.restTimeout.clear(); 4989 instance.restTimeoutPending = false; 4990 const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.(); 4991 if (isTargetInsideEnabledTrigger(event.relatedTarget, store2.context.triggerElements)) { 4992 return; 4993 } 4994 if (handleCloseRef.current && handleCloseContextBase) { 4995 if (!store2.select("open")) { 4996 instance.openChangeTimeout.clear(); 4997 } 4998 const currentTrigger = triggerElementRef.current; 4999 instance.handler = handleCloseRef.current({ 5000 ...handleCloseContextBase, 5001 tree, 5002 x: event.clientX, 5003 y: event.clientY, 5004 onClose() { 5005 clearPointerEvents(); 5006 cleanupMouseMoveHandler(); 5007 if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store2.select("domReferenceElement")) { 5008 closeWithDelay(event, true); 5009 } 5010 } 5011 }); 5012 doc.addEventListener("mousemove", instance.handler); 5013 instance.handler(event); 5014 return; 5015 } 5016 const shouldClose = instance.pointerType === "touch" ? !contains(store2.select("floatingElement"), event.relatedTarget) : true; 5017 if (shouldClose) { 5018 closeWithDelay(event); 5019 } 5020 } 5021 function onMouseOut(event) { 5022 if (contains(trigger, event.relatedTarget)) { 5023 return; 5024 } 5025 instance.openChangeTimeout.clear(); 5026 instance.restTimeout.clear(); 5027 instance.restTimeoutPending = false; 5028 } 5029 const staleOpenGuard = guardStaleOpen ? addEventListener(trigger, "mouseout", onMouseOut) : void 0; 5030 if (move) { 5031 return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, { 5032 once: true 5033 }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); 5034 } 5035 return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave), staleOpenGuard); 5036 }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store2, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen, guardStaleOpen]); 5037 return React26.useMemo(() => { 5038 if (!enabled) { 5039 return void 0; 5040 } 5041 function setPointerRef(event) { 5042 instance.pointerType = event.pointerType; 5043 } 5044 return { 5045 onPointerDown: setPointerRef, 5046 onPointerEnter: setPointerRef, 5047 onMouseMove(event) { 5048 const { 5049 nativeEvent 5050 } = event; 5051 const trigger = event.currentTarget; 5052 const currentDomReference = store2.select("domReferenceElement"); 5053 const currentOpen = store2.select("open"); 5054 const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target); 5055 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 5056 return; 5057 } 5058 if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) { 5059 const floatingElement = store2.select("floatingElement"); 5060 if (floatingElement) { 5061 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body; 5062 applySafePolygonPointerEventsMutation(instance, { 5063 scopeElement, 5064 referenceElement: trigger, 5065 floatingElement 5066 }); 5067 } 5068 } 5069 const restMsValue = getRestMs(restMsRef.current); 5070 if (currentOpen && !isOverInactive || restMsValue === 0) { 5071 return; 5072 } 5073 if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) { 5074 return; 5075 } 5076 instance.restTimeout.clear(); 5077 function handleMouseMove() { 5078 instance.restTimeoutPending = false; 5079 if (isClickLikeOpenEvent2()) { 5080 return; 5081 } 5082 const latestOpen = store2.select("open"); 5083 if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) { 5084 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger)); 5085 } 5086 } 5087 if (instance.pointerType === "touch") { 5088 ReactDOM4.flushSync(() => { 5089 handleMouseMove(); 5090 }); 5091 } else if (isOverInactive && currentOpen) { 5092 handleMouseMove(); 5093 } else { 5094 instance.restTimeoutPending = true; 5095 instance.restTimeout.start(restMsValue, handleMouseMove); 5096 } 5097 } 5098 }; 5099 }, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store2, restMsRef, checkShouldOpen]); 5100 } 5101 5102 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/safePolygon.mjs 5103 var CURSOR_SPEED_THRESHOLD = 0.1; 5104 var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD; 5105 var POLYGON_BUFFER = 0.5; 5106 function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) { 5107 return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi; 5108 } 5109 function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) { 5110 let isInsideValue = false; 5111 if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) { 5112 isInsideValue = !isInsideValue; 5113 } 5114 if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) { 5115 isInsideValue = !isInsideValue; 5116 } 5117 if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) { 5118 isInsideValue = !isInsideValue; 5119 } 5120 if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) { 5121 isInsideValue = !isInsideValue; 5122 } 5123 return isInsideValue; 5124 } 5125 function isInsideRect(pointX, pointY, rect) { 5126 return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height; 5127 } 5128 function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) { 5129 const minX = Math.min(x1, x2); 5130 const maxX = Math.max(x1, x2); 5131 const minY = Math.min(y1, y2); 5132 const maxY = Math.max(y1, y2); 5133 return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY; 5134 } 5135 function safePolygon(options = {}) { 5136 const { 5137 blockPointerEvents = false 5138 } = options; 5139 const timeout = new Timeout(); 5140 const fn = ({ 5141 x, 5142 y, 5143 placement, 5144 elements, 5145 onClose, 5146 nodeId, 5147 tree 5148 }) => { 5149 const side = placement?.split("-")[0]; 5150 let hasLanded = false; 5151 let lastX = null; 5152 let lastY = null; 5153 let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0; 5154 function isCursorMovingSlowly(nextX, nextY) { 5155 const currentTime = performance.now(); 5156 const elapsedTime = currentTime - lastCursorTime; 5157 if (lastX === null || lastY === null || elapsedTime === 0) { 5158 lastX = nextX; 5159 lastY = nextY; 5160 lastCursorTime = currentTime; 5161 return false; 5162 } 5163 const deltaX = nextX - lastX; 5164 const deltaY = nextY - lastY; 5165 const distanceSquared = deltaX * deltaX + deltaY * deltaY; 5166 const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED; 5167 lastX = nextX; 5168 lastY = nextY; 5169 lastCursorTime = currentTime; 5170 return distanceSquared < thresholdSquared; 5171 } 5172 function close() { 5173 timeout.clear(); 5174 onClose(); 5175 } 5176 return function onMouseMove(event) { 5177 timeout.clear(); 5178 const domReference = elements.domReference; 5179 const floating = elements.floating; 5180 if (!domReference || !floating || side == null || x == null || y == null) { 5181 return void 0; 5182 } 5183 const { 5184 clientX, 5185 clientY 5186 } = event; 5187 const target = getTarget(event); 5188 const isLeave = event.type === "mouseleave"; 5189 const isOverFloatingEl = contains(floating, target); 5190 const isOverReferenceEl = contains(domReference, target); 5191 if (isOverFloatingEl) { 5192 hasLanded = true; 5193 if (!isLeave) { 5194 return void 0; 5195 } 5196 } 5197 if (isOverReferenceEl) { 5198 hasLanded = false; 5199 if (!isLeave) { 5200 hasLanded = true; 5201 return void 0; 5202 } 5203 } 5204 if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) { 5205 return void 0; 5206 } 5207 function hasOpenChildNode() { 5208 return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0); 5209 } 5210 function closeIfNoOpenChild() { 5211 if (!hasOpenChildNode()) { 5212 close(); 5213 } 5214 } 5215 if (hasOpenChildNode()) { 5216 return void 0; 5217 } 5218 const refRect = domReference.getBoundingClientRect(); 5219 const rect = floating.getBoundingClientRect(); 5220 const cursorLeaveFromRight = x > rect.right - rect.width / 2; 5221 const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2; 5222 const isFloatingWider = rect.width > refRect.width; 5223 const isFloatingTaller = rect.height > refRect.height; 5224 const left = (isFloatingWider ? refRect : rect).left; 5225 const right = (isFloatingWider ? refRect : rect).right; 5226 const top = (isFloatingTaller ? refRect : rect).top; 5227 const bottom = (isFloatingTaller ? refRect : rect).bottom; 5228 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) { 5229 closeIfNoOpenChild(); 5230 return void 0; 5231 } 5232 let isInsideTroughRect = false; 5233 switch (side) { 5234 case "top": 5235 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1); 5236 break; 5237 case "bottom": 5238 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1); 5239 break; 5240 case "left": 5241 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top); 5242 break; 5243 case "right": 5244 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top); 5245 break; 5246 default: 5247 } 5248 if (isInsideTroughRect) { 5249 return void 0; 5250 } 5251 if (hasLanded && !isInsideRect(clientX, clientY, refRect)) { 5252 closeIfNoOpenChild(); 5253 return void 0; 5254 } 5255 if (!isLeave && isCursorMovingSlowly(clientX, clientY)) { 5256 closeIfNoOpenChild(); 5257 return void 0; 5258 } 5259 let isInsidePolygon = false; 5260 switch (side) { 5261 case "top": { 5262 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 5263 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 5264 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 5265 const cursorPointY = y + POLYGON_BUFFER + 1; 5266 const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top; 5267 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER; 5268 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 5269 break; 5270 } 5271 case "bottom": { 5272 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 5273 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 5274 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 5275 const cursorPointY = y - POLYGON_BUFFER; 5276 const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom; 5277 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER; 5278 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 5279 break; 5280 } 5281 case "left": { 5282 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 5283 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 5284 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 5285 const cursorPointX = x + POLYGON_BUFFER + 1; 5286 const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left; 5287 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER; 5288 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY); 5289 break; 5290 } 5291 case "right": { 5292 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 5293 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 5294 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 5295 const cursorPointX = x - POLYGON_BUFFER; 5296 const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right; 5297 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER; 5298 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom); 5299 break; 5300 } 5301 default: 5302 } 5303 if (!isInsidePolygon) { 5304 closeIfNoOpenChild(); 5305 } else if (!hasLanded) { 5306 timeout.start(40, closeIfNoOpenChild); 5307 } 5308 return void 0; 5309 }; 5310 }; 5311 fn.__options = { 5312 ...options, 5313 blockPointerEvents 5314 }; 5315 return fn; 5316 } 5317 5318 // node_modules/.store/@floating-ui/core@1.8.0-3V8aS7jJHHGcsCINjP9-5A/node_modules/@floating-ui/core/dist/floating-ui.core.mjs 5319 function computeCoordsFromPlacement(_ref, placement, rtl) { 5320 let { 5321 reference, 5322 floating 5323 } = _ref; 5324 const sideAxis = getSideAxis(placement); 5325 const alignmentAxis = getAlignmentAxis(placement); 5326 const alignLength = getAxisLength(alignmentAxis); 5327 const side = getSide(placement); 5328 const isVertical = sideAxis === "y"; 5329 const commonX = reference.x + reference.width / 2 - floating.width / 2; 5330 const commonY = reference.y + reference.height / 2 - floating.height / 2; 5331 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 5332 let coords; 5333 switch (side) { 5334 case "top": 5335 coords = { 5336 x: commonX, 5337 y: reference.y - floating.height 5338 }; 5339 break; 5340 case "bottom": 5341 coords = { 5342 x: commonX, 5343 y: reference.y + reference.height 5344 }; 5345 break; 5346 case "right": 5347 coords = { 5348 x: reference.x + reference.width, 5349 y: commonY 5350 }; 5351 break; 5352 case "left": 5353 coords = { 5354 x: reference.x - floating.width, 5355 y: commonY 5356 }; 5357 break; 5358 default: 5359 coords = { 5360 x: reference.x, 5361 y: reference.y 5362 }; 5363 } 5364 const alignment = getAlignment(placement); 5365 if (alignment) { 5366 coords[alignmentAxis] += commonAlign * (alignment === "end" ? 1 : -1) * (rtl && isVertical ? -1 : 1); 5367 } 5368 return coords; 5369 } 5370 async function detectOverflow(state, options) { 5371 var _await$platform$isEle; 5372 if (options === void 0) { 5373 options = {}; 5374 } 5375 const { 5376 x, 5377 y, 5378 platform: platform3, 5379 rects, 5380 elements, 5381 strategy 5382 } = state; 5383 const { 5384 boundary = "clippingAncestors", 5385 rootBoundary = "viewport", 5386 elementContext = "floating", 5387 altBoundary = false, 5388 padding = 0 5389 } = evaluate(options, state); 5390 const paddingObject = getPaddingObject(padding); 5391 const altContext = elementContext === "floating" ? "reference" : "floating"; 5392 const element = elements[altBoundary ? altContext : elementContext]; 5393 const clippingClientRect = rectToClientRect(await platform3.getClippingRect({ 5394 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)), 5395 boundary, 5396 rootBoundary, 5397 strategy 5398 })); 5399 const rect = elementContext === "floating" ? { 5400 x, 5401 y, 5402 width: rects.floating.width, 5403 height: rects.floating.height 5404 } : rects.reference; 5405 const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating)); 5406 const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) && await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { 5407 x: 1, 5408 y: 1 5409 }; 5410 const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ 5411 elements, 5412 rect, 5413 offsetParent, 5414 strategy 5415 }) : rect); 5416 return { 5417 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 5418 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 5419 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 5420 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 5421 }; 5422 } 5423 var MAX_RESET_COUNT = 50; 5424 var computePosition = async (reference, floating, config) => { 5425 const { 5426 placement = "bottom", 5427 strategy = "absolute", 5428 middleware = [], 5429 platform: platform3 5430 } = config; 5431 const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : { 5432 ...platform3, 5433 detectOverflow 5434 }; 5435 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating)); 5436 let rects = await platform3.getElementRects({ 5437 reference, 5438 floating, 5439 strategy 5440 }); 5441 let { 5442 x, 5443 y 5444 } = computeCoordsFromPlacement(rects, placement, rtl); 5445 let statefulPlacement = placement; 5446 let resetCount = 0; 5447 const middlewareData = {}; 5448 for (let i = 0; i < middleware.length; i++) { 5449 const currentMiddleware = middleware[i]; 5450 if (!currentMiddleware) { 5451 continue; 5452 } 5453 const { 5454 name, 5455 fn 5456 } = currentMiddleware; 5457 const { 5458 x: nextX, 5459 y: nextY, 5460 data, 5461 reset 5462 } = await fn({ 5463 x, 5464 y, 5465 initialPlacement: placement, 5466 placement: statefulPlacement, 5467 strategy, 5468 middlewareData, 5469 rects, 5470 platform: platformWithDetectOverflow, 5471 elements: { 5472 reference, 5473 floating 5474 } 5475 }); 5476 x = nextX != null ? nextX : x; 5477 y = nextY != null ? nextY : y; 5478 middlewareData[name] = { 5479 ...middlewareData[name], 5480 ...data 5481 }; 5482 if (reset && resetCount < MAX_RESET_COUNT) { 5483 resetCount++; 5484 if (typeof reset === "object") { 5485 if (reset.placement) { 5486 statefulPlacement = reset.placement; 5487 } 5488 if (reset.rects) { 5489 rects = reset.rects === true ? await platform3.getElementRects({ 5490 reference, 5491 floating, 5492 strategy 5493 }) : reset.rects; 5494 } 5495 ({ 5496 x, 5497 y 5498 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 5499 } 5500 i = -1; 5501 } 5502 } 5503 return { 5504 x, 5505 y, 5506 placement: statefulPlacement, 5507 strategy, 5508 middlewareData 5509 }; 5510 }; 5511 var flip = function(options) { 5512 if (options === void 0) { 5513 options = {}; 5514 } 5515 return { 5516 name: "flip", 5517 options, 5518 async fn(state) { 5519 var _middlewareData$arrow, _middlewareData$flip; 5520 const { 5521 placement, 5522 middlewareData, 5523 rects, 5524 initialPlacement, 5525 platform: platform3, 5526 elements 5527 } = state; 5528 const { 5529 mainAxis: checkMainAxis = true, 5530 crossAxis: checkCrossAxis = true, 5531 fallbackPlacements: specifiedFallbackPlacements, 5532 fallbackStrategy = "bestFit", 5533 fallbackAxisSideDirection = "none", 5534 flipAlignment = true, 5535 ...detectOverflowOptions 5536 } = evaluate(options, state); 5537 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 5538 return {}; 5539 } 5540 const side = getSide(placement); 5541 const initialSideAxis = getSideAxis(initialPlacement); 5542 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 5543 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 5544 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 5545 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 5546 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 5547 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 5548 } 5549 const placements2 = [initialPlacement, ...fallbackPlacements]; 5550 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 5551 const overflows = []; 5552 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 5553 if (checkMainAxis) { 5554 overflows.push(overflow[side]); 5555 } 5556 if (checkCrossAxis) { 5557 const sides2 = getAlignmentSides(placement, rects, rtl); 5558 overflows.push(overflow[sides2[0]], overflow[sides2[1]]); 5559 } 5560 overflowsData = [...overflowsData, { 5561 placement, 5562 overflows 5563 }]; 5564 if (!overflows.every((side2) => side2 <= 0)) { 5565 var _middlewareData$flip2, _overflowsData$filter; 5566 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 5567 const nextPlacement = placements2[nextIndex]; 5568 if (nextPlacement) { 5569 const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; 5570 if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis 5571 // overflows the main axis. 5572 overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { 5573 return { 5574 data: { 5575 index: nextIndex, 5576 overflows: overflowsData 5577 }, 5578 reset: { 5579 placement: nextPlacement 5580 } 5581 }; 5582 } 5583 } 5584 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; 5585 if (!resetPlacement) { 5586 switch (fallbackStrategy) { 5587 case "bestFit": { 5588 var _overflowsData$filter2; 5589 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => { 5590 if (hasFallbackAxisSideDirection) { 5591 const currentSideAxis = getSideAxis(d.placement); 5592 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 5593 // reading directions favoring greater width. 5594 currentSideAxis === "y"; 5595 } 5596 return true; 5597 }).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]; 5598 if (placement2) { 5599 resetPlacement = placement2; 5600 } 5601 break; 5602 } 5603 case "initialPlacement": 5604 resetPlacement = initialPlacement; 5605 break; 5606 } 5607 } 5608 if (placement !== resetPlacement) { 5609 return { 5610 reset: { 5611 placement: resetPlacement 5612 } 5613 }; 5614 } 5615 } 5616 return {}; 5617 } 5618 }; 5619 }; 5620 var originSides = /* @__PURE__ */ new Set(["left", "top"]); 5621 async function convertValueToCoords(state, options) { 5622 const { 5623 placement, 5624 platform: platform3, 5625 elements 5626 } = state; 5627 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 5628 const side = getSide(placement); 5629 const alignment = getAlignment(placement); 5630 const isVertical = getSideAxis(placement) === "y"; 5631 const mainAxisMulti = originSides.has(side) ? -1 : 1; 5632 const crossAxisMulti = rtl && isVertical ? -1 : 1; 5633 const rawValue = evaluate(options, state); 5634 let { 5635 mainAxis, 5636 crossAxis, 5637 alignmentAxis 5638 } = typeof rawValue === "number" ? { 5639 mainAxis: rawValue, 5640 crossAxis: 0, 5641 alignmentAxis: null 5642 } : { 5643 mainAxis: rawValue.mainAxis || 0, 5644 crossAxis: rawValue.crossAxis || 0, 5645 alignmentAxis: rawValue.alignmentAxis 5646 }; 5647 if (alignment && typeof alignmentAxis === "number") { 5648 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 5649 } 5650 return isVertical ? { 5651 x: crossAxis * crossAxisMulti, 5652 y: mainAxis * mainAxisMulti 5653 } : { 5654 x: mainAxis * mainAxisMulti, 5655 y: crossAxis * crossAxisMulti 5656 }; 5657 } 5658 var offset = function(options) { 5659 if (options === void 0) { 5660 options = 0; 5661 } 5662 return { 5663 name: "offset", 5664 options, 5665 async fn(state) { 5666 var _middlewareData$offse, _middlewareData$arrow; 5667 const { 5668 x, 5669 y, 5670 placement, 5671 middlewareData 5672 } = state; 5673 const diffCoords = await convertValueToCoords(state, options); 5674 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 5675 return {}; 5676 } 5677 return { 5678 x: x + diffCoords.x, 5679 y: y + diffCoords.y, 5680 data: { 5681 ...diffCoords, 5682 placement 5683 } 5684 }; 5685 } 5686 }; 5687 }; 5688 var shift = function(options) { 5689 if (options === void 0) { 5690 options = {}; 5691 } 5692 return { 5693 name: "shift", 5694 options, 5695 async fn(state) { 5696 const { 5697 x, 5698 y, 5699 placement, 5700 platform: platform3 5701 } = state; 5702 const { 5703 mainAxis: checkMainAxis = true, 5704 crossAxis: checkCrossAxis = false, 5705 limiter = { 5706 fn: (_ref) => { 5707 let { 5708 x: x2, 5709 y: y2 5710 } = _ref; 5711 return { 5712 x: x2, 5713 y: y2 5714 }; 5715 } 5716 }, 5717 ...detectOverflowOptions 5718 } = evaluate(options, state); 5719 const coords = { 5720 x, 5721 y 5722 }; 5723 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 5724 const crossAxis = getSideAxis(placement); 5725 const mainAxis = getOppositeAxis(crossAxis); 5726 let mainAxisCoord = coords[mainAxis]; 5727 let crossAxisCoord = coords[crossAxis]; 5728 const clampCoord = (axis, coord) => clamp(coord + overflow[axis === "y" ? "top" : "left"], coord, coord - overflow[axis === "y" ? "bottom" : "right"]); 5729 if (checkMainAxis) { 5730 mainAxisCoord = clampCoord(mainAxis, mainAxisCoord); 5731 } 5732 if (checkCrossAxis) { 5733 crossAxisCoord = clampCoord(crossAxis, crossAxisCoord); 5734 } 5735 const limitedCoords = limiter.fn({ 5736 ...state, 5737 [mainAxis]: mainAxisCoord, 5738 [crossAxis]: crossAxisCoord 5739 }); 5740 return { 5741 ...limitedCoords, 5742 data: { 5743 x: limitedCoords.x - x, 5744 y: limitedCoords.y - y, 5745 enabled: { 5746 [mainAxis]: checkMainAxis, 5747 [crossAxis]: checkCrossAxis 5748 } 5749 } 5750 }; 5751 } 5752 }; 5753 }; 5754 var limitShift = function(options) { 5755 if (options === void 0) { 5756 options = {}; 5757 } 5758 return { 5759 options, 5760 fn(state) { 5761 var _rawOffset$mainAxis, _rawOffset$crossAxis; 5762 const { 5763 x, 5764 y, 5765 placement, 5766 rects, 5767 middlewareData 5768 } = state; 5769 const { 5770 offset: offset4 = 0, 5771 mainAxis: checkMainAxis = true, 5772 crossAxis: checkCrossAxis = true 5773 } = evaluate(options, state); 5774 const coords = { 5775 x, 5776 y 5777 }; 5778 const crossAxis = getSideAxis(placement); 5779 const mainAxis = getOppositeAxis(crossAxis); 5780 let mainAxisCoord = coords[mainAxis]; 5781 let crossAxisCoord = coords[crossAxis]; 5782 const rawOffset = evaluate(offset4, state); 5783 const computedOffset = typeof rawOffset === "number" ? { 5784 mainAxis: rawOffset, 5785 crossAxis: 0 5786 } : { 5787 mainAxis: (_rawOffset$mainAxis = rawOffset.mainAxis) != null ? _rawOffset$mainAxis : 0, 5788 crossAxis: (_rawOffset$crossAxis = rawOffset.crossAxis) != null ? _rawOffset$crossAxis : 0 5789 }; 5790 if (checkMainAxis) { 5791 const len = mainAxis === "y" ? "height" : "width"; 5792 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 5793 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 5794 if (mainAxisCoord < limitMin) { 5795 mainAxisCoord = limitMin; 5796 } else if (mainAxisCoord > limitMax) { 5797 mainAxisCoord = limitMax; 5798 } 5799 } 5800 if (checkCrossAxis) { 5801 var _middlewareData$offse, _middlewareData$offse2; 5802 const len = mainAxis === "y" ? "width" : "height"; 5803 const isOriginSide = originSides.has(getSide(placement)); 5804 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); 5805 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); 5806 if (crossAxisCoord < limitMin) { 5807 crossAxisCoord = limitMin; 5808 } else if (crossAxisCoord > limitMax) { 5809 crossAxisCoord = limitMax; 5810 } 5811 } 5812 return { 5813 [mainAxis]: mainAxisCoord, 5814 [crossAxis]: crossAxisCoord 5815 }; 5816 } 5817 }; 5818 }; 5819 var size = function(options) { 5820 if (options === void 0) { 5821 options = {}; 5822 } 5823 return { 5824 name: "size", 5825 options, 5826 async fn(state) { 5827 const { 5828 placement, 5829 rects, 5830 platform: platform3, 5831 elements 5832 } = state; 5833 const { 5834 apply = () => { 5835 }, 5836 ...detectOverflowOptions 5837 } = evaluate(options, state); 5838 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 5839 const side = getSide(placement); 5840 const alignment = getAlignment(placement); 5841 const isYAxis = getSideAxis(placement) === "y"; 5842 const { 5843 width, 5844 height 5845 } = rects.floating; 5846 let heightSide; 5847 let widthSide; 5848 if (side === "top" || side === "bottom") { 5849 heightSide = side; 5850 widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right"; 5851 } else { 5852 widthSide = side; 5853 heightSide = alignment === "end" ? "top" : "bottom"; 5854 } 5855 const maximumClippingHeight = height - overflow.top - overflow.bottom; 5856 const maximumClippingWidth = width - overflow.left - overflow.right; 5857 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 5858 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 5859 const shiftData = state.middlewareData.shift; 5860 const noShift = !shiftData; 5861 let availableHeight2 = overflowAvailableHeight; 5862 let availableWidth2 = overflowAvailableWidth; 5863 if (shiftData != null && shiftData.enabled.x) { 5864 availableWidth2 = maximumClippingWidth; 5865 } 5866 if (shiftData != null && shiftData.enabled.y) { 5867 availableHeight2 = maximumClippingHeight; 5868 } 5869 if (noShift && !alignment) { 5870 if (isYAxis) { 5871 availableWidth2 = width - 2 * max(overflow.left, overflow.right); 5872 } else { 5873 availableHeight2 = height - 2 * max(overflow.top, overflow.bottom); 5874 } 5875 } 5876 await apply({ 5877 ...state, 5878 availableWidth: availableWidth2, 5879 availableHeight: availableHeight2 5880 }); 5881 const nextDimensions = await platform3.getDimensions(elements.floating); 5882 if (width !== nextDimensions.width || height !== nextDimensions.height) { 5883 return { 5884 reset: { 5885 rects: true 5886 } 5887 }; 5888 } 5889 return {}; 5890 } 5891 }; 5892 }; 5893 5894 // node_modules/.store/@floating-ui/dom@1.8.0-vHXcr4FgWneV0cgwFw-d7A/node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 5895 function getCssDimensions(element) { 5896 const css = getComputedStyle2(element); 5897 let width = parseFloat(css.width) || 0; 5898 let height = parseFloat(css.height) || 0; 5899 const hasOffset = isHTMLElement(element); 5900 const offsetWidth = hasOffset ? element.offsetWidth : width; 5901 const offsetHeight = hasOffset ? element.offsetHeight : height; 5902 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 5903 if (shouldFallback) { 5904 width = offsetWidth; 5905 height = offsetHeight; 5906 } 5907 return { 5908 width, 5909 height, 5910 $: shouldFallback 5911 }; 5912 } 5913 function unwrapElement(element) { 5914 return !isElement(element) ? element.contextElement : element; 5915 } 5916 function getScale(element) { 5917 const domElement = unwrapElement(element); 5918 if (!isHTMLElement(domElement)) { 5919 return createCoords(1); 5920 } 5921 const rect = domElement.getBoundingClientRect(); 5922 const { 5923 width, 5924 height, 5925 $ 5926 } = getCssDimensions(domElement); 5927 let x = ($ ? round(rect.width) : rect.width) / width; 5928 let y = ($ ? round(rect.height) : rect.height) / height; 5929 if (!x || !Number.isFinite(x)) { 5930 x = 1; 5931 } 5932 if (!y || !Number.isFinite(y)) { 5933 y = 1; 5934 } 5935 return { 5936 x, 5937 y 5938 }; 5939 } 5940 var noOffsets = /* @__PURE__ */ createCoords(0); 5941 function getVisualOffsets(element) { 5942 const win = getWindow(element); 5943 if (!isWebKit() || !win.visualViewport) { 5944 return noOffsets; 5945 } 5946 return { 5947 x: win.visualViewport.offsetLeft, 5948 y: win.visualViewport.offsetTop 5949 }; 5950 } 5951 function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 5952 if (isFixed === void 0) { 5953 isFixed = false; 5954 } 5955 return !!floatingOffsetParent && isFixed && floatingOffsetParent === getWindow(element); 5956 } 5957 function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 5958 if (includeScale === void 0) { 5959 includeScale = false; 5960 } 5961 if (isFixedStrategy === void 0) { 5962 isFixedStrategy = false; 5963 } 5964 const clientRect = element.getBoundingClientRect(); 5965 const domElement = unwrapElement(element); 5966 let scale = createCoords(1); 5967 if (includeScale) { 5968 if (offsetParent) { 5969 if (isElement(offsetParent)) { 5970 scale = getScale(offsetParent); 5971 } 5972 } else { 5973 scale = getScale(element); 5974 } 5975 } 5976 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 5977 let x = (clientRect.left + visualOffsets.x) / scale.x; 5978 let y = (clientRect.top + visualOffsets.y) / scale.y; 5979 let width = clientRect.width / scale.x; 5980 let height = clientRect.height / scale.y; 5981 if (domElement && offsetParent) { 5982 const win = getWindow(domElement); 5983 const offsetWin = isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 5984 let currentWin = win; 5985 let currentIFrame = getFrameElement(currentWin); 5986 while (currentIFrame && offsetWin !== currentWin) { 5987 const iframeScale = getScale(currentIFrame); 5988 const iframeRect = currentIFrame.getBoundingClientRect(); 5989 const css = getComputedStyle2(currentIFrame); 5990 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 5991 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 5992 x *= iframeScale.x; 5993 y *= iframeScale.y; 5994 width *= iframeScale.x; 5995 height *= iframeScale.y; 5996 x += left; 5997 y += top; 5998 currentWin = getWindow(currentIFrame); 5999 currentIFrame = getFrameElement(currentWin); 6000 } 6001 } 6002 return rectToClientRect({ 6003 width, 6004 height, 6005 x, 6006 y 6007 }); 6008 } 6009 function getWindowScrollBarX(element, rect) { 6010 const leftScroll = getNodeScroll(element).scrollLeft; 6011 if (!rect) { 6012 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 6013 } 6014 return rect.left + leftScroll; 6015 } 6016 function getHTMLOffset(documentElement, scroll) { 6017 const htmlRect = documentElement.getBoundingClientRect(); 6018 const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 6019 const y = htmlRect.top + scroll.scrollTop; 6020 return { 6021 x, 6022 y 6023 }; 6024 } 6025 function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 6026 let { 6027 elements, 6028 rect, 6029 offsetParent, 6030 strategy 6031 } = _ref; 6032 const isFixed = strategy === "fixed"; 6033 const documentElement = getDocumentElement(offsetParent); 6034 const topLayer = elements ? isTopLayer(elements.floating) : false; 6035 if (offsetParent === documentElement || topLayer && isFixed) { 6036 return rect; 6037 } 6038 let scroll = { 6039 scrollLeft: 0, 6040 scrollTop: 0 6041 }; 6042 let scale = createCoords(1); 6043 const offsets = createCoords(0); 6044 const isOffsetParentAnElement = isHTMLElement(offsetParent); 6045 if (isOffsetParentAnElement || !isFixed) { 6046 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 6047 scroll = getNodeScroll(offsetParent); 6048 } 6049 if (isOffsetParentAnElement) { 6050 const offsetRect = getBoundingClientRect(offsetParent); 6051 scale = getScale(offsetParent); 6052 offsets.x = offsetRect.x + offsetParent.clientLeft; 6053 offsets.y = offsetRect.y + offsetParent.clientTop; 6054 } 6055 } 6056 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 6057 return { 6058 width: rect.width * scale.x, 6059 height: rect.height * scale.y, 6060 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 6061 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 6062 }; 6063 } 6064 function getClientRects(element) { 6065 return element.getClientRects ? Array.from(element.getClientRects()) : []; 6066 } 6067 function getDocumentRect(html) { 6068 const scroll = getNodeScroll(html); 6069 const body = html.ownerDocument.body; 6070 const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 6071 const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 6072 let x = -scroll.scrollLeft + getWindowScrollBarX(html); 6073 const y = -scroll.scrollTop; 6074 if (getComputedStyle2(body).direction === "rtl") { 6075 x += max(html.clientWidth, body.clientWidth) - width; 6076 } 6077 return { 6078 width, 6079 height, 6080 x, 6081 y 6082 }; 6083 } 6084 var SCROLLBAR_MAX = 25; 6085 function getViewportRect(element, strategy, rootBoundary) { 6086 if (rootBoundary === void 0) { 6087 rootBoundary = "viewport"; 6088 } 6089 const isLayoutViewport = rootBoundary === "layoutViewport"; 6090 const win = getWindow(element); 6091 const html = getDocumentElement(element); 6092 const visualViewport = win.visualViewport; 6093 let width = html.clientWidth; 6094 let height = html.clientHeight; 6095 let x = 0; 6096 let y = 0; 6097 if (visualViewport) { 6098 const layoutRelativeClientCoords = !isWebKit() || strategy === "fixed"; 6099 if (isLayoutViewport) { 6100 if (!layoutRelativeClientCoords) { 6101 x = -visualViewport.offsetLeft; 6102 y = -visualViewport.offsetTop; 6103 } 6104 } else { 6105 width = visualViewport.width; 6106 height = visualViewport.height; 6107 if (layoutRelativeClientCoords) { 6108 x = visualViewport.offsetLeft; 6109 y = visualViewport.offsetTop; 6110 } 6111 } 6112 } 6113 const windowScrollbarX = getWindowScrollBarX(html); 6114 if (windowScrollbarX <= 0) { 6115 const doc = html.ownerDocument; 6116 const body = doc.body; 6117 const bodyStyles = getComputedStyle(body); 6118 const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 6119 const reservedWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); 6120 const gutter = getComputedStyle(html).scrollbarGutter === "stable both-edges" ? reservedWidth / 2 : reservedWidth; 6121 if (gutter <= SCROLLBAR_MAX) { 6122 width -= gutter; 6123 } 6124 } 6125 return { 6126 width, 6127 height, 6128 x, 6129 y 6130 }; 6131 } 6132 function getInnerBoundingClientRect(element, strategy) { 6133 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 6134 const top = clientRect.top + element.clientTop; 6135 const left = clientRect.left + element.clientLeft; 6136 const scale = getScale(element); 6137 const width = element.clientWidth * scale.x; 6138 const height = element.clientHeight * scale.y; 6139 const x = left * scale.x; 6140 const y = top * scale.y; 6141 return { 6142 width, 6143 height, 6144 x, 6145 y 6146 }; 6147 } 6148 function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 6149 let rect; 6150 if (clippingAncestor === "viewport" || clippingAncestor === "layoutViewport") { 6151 rect = getViewportRect(element, strategy, clippingAncestor); 6152 } else if (clippingAncestor === "document") { 6153 rect = getDocumentRect(getDocumentElement(element)); 6154 } else if (isElement(clippingAncestor)) { 6155 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 6156 } else { 6157 const visualOffsets = getVisualOffsets(element); 6158 rect = { 6159 x: clippingAncestor.x - visualOffsets.x, 6160 y: clippingAncestor.y - visualOffsets.y, 6161 width: clippingAncestor.width, 6162 height: clippingAncestor.height 6163 }; 6164 } 6165 return rectToClientRect(rect); 6166 } 6167 function getClippingElementAncestors(element, cache) { 6168 const cachedResult = cache.get(element); 6169 if (cachedResult) { 6170 return cachedResult; 6171 } 6172 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 6173 let lastKeptComputedStyle = null; 6174 const elementIsFixed = getComputedStyle2(element).position === "fixed"; 6175 let currentNode = elementIsFixed ? getParentNode(element) : element; 6176 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 6177 const computedStyle = getComputedStyle2(currentNode); 6178 const currentNodeIsContaining = isContainingBlock(currentNode); 6179 const lastPosition = lastKeptComputedStyle ? lastKeptComputedStyle.position : elementIsFixed ? "fixed" : ""; 6180 const shouldDropCurrentNode = !currentNodeIsContaining && (lastPosition === "fixed" || lastPosition === "absolute" && computedStyle.position === "static"); 6181 if (shouldDropCurrentNode) { 6182 result = result.filter((ancestor) => ancestor !== currentNode); 6183 } else { 6184 lastKeptComputedStyle = computedStyle; 6185 } 6186 currentNode = getParentNode(currentNode); 6187 } 6188 cache.set(element, result); 6189 return result; 6190 } 6191 function getClippingRect(_ref) { 6192 let { 6193 element, 6194 boundary, 6195 rootBoundary, 6196 strategy 6197 } = _ref; 6198 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 6199 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 6200 const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); 6201 let top = firstRect.top; 6202 let right = firstRect.right; 6203 let bottom = firstRect.bottom; 6204 let left = firstRect.left; 6205 for (let i = 1; i < clippingAncestors.length; i++) { 6206 const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy); 6207 top = max(rect.top, top); 6208 right = min(rect.right, right); 6209 bottom = min(rect.bottom, bottom); 6210 left = max(rect.left, left); 6211 } 6212 return { 6213 width: right - left, 6214 height: bottom - top, 6215 x: left, 6216 y: top 6217 }; 6218 } 6219 function getDimensions(element) { 6220 const { 6221 width, 6222 height 6223 } = getCssDimensions(element); 6224 return { 6225 width, 6226 height 6227 }; 6228 } 6229 function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 6230 const isOffsetParentAnElement = isHTMLElement(offsetParent); 6231 const documentElement = getDocumentElement(offsetParent); 6232 const isFixed = strategy === "fixed"; 6233 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 6234 let scroll = { 6235 scrollLeft: 0, 6236 scrollTop: 0 6237 }; 6238 const offsets = createCoords(0); 6239 if (isOffsetParentAnElement || !isFixed) { 6240 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 6241 scroll = getNodeScroll(offsetParent); 6242 } 6243 if (isOffsetParentAnElement) { 6244 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 6245 offsets.x = offsetRect.x + offsetParent.clientLeft; 6246 offsets.y = offsetRect.y + offsetParent.clientTop; 6247 } 6248 } 6249 if (!isOffsetParentAnElement && documentElement) { 6250 offsets.x = getWindowScrollBarX(documentElement); 6251 } 6252 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 6253 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 6254 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 6255 return { 6256 x, 6257 y, 6258 width: rect.width, 6259 height: rect.height 6260 }; 6261 } 6262 function isStaticPositioned(element) { 6263 return getComputedStyle2(element).position === "static"; 6264 } 6265 function getTrueOffsetParent(element, polyfill) { 6266 if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { 6267 return null; 6268 } 6269 if (polyfill) { 6270 return polyfill(element); 6271 } 6272 let rawOffsetParent = element.offsetParent; 6273 if (getDocumentElement(element) === rawOffsetParent) { 6274 rawOffsetParent = rawOffsetParent.ownerDocument.body; 6275 } 6276 return rawOffsetParent; 6277 } 6278 function getOffsetParent(element, polyfill) { 6279 const win = getWindow(element); 6280 if (isTopLayer(element)) { 6281 return win; 6282 } 6283 if (!isHTMLElement(element)) { 6284 let svgOffsetParent = getParentNode(element); 6285 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 6286 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 6287 return svgOffsetParent; 6288 } 6289 svgOffsetParent = getParentNode(svgOffsetParent); 6290 } 6291 return win; 6292 } 6293 let offsetParent = getTrueOffsetParent(element, polyfill); 6294 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 6295 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 6296 } 6297 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 6298 return win; 6299 } 6300 return offsetParent || getContainingBlock(element) || win; 6301 } 6302 var getElementRects = async function(data) { 6303 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 6304 const getDimensionsFn = this.getDimensions; 6305 const floatingDimensions = await getDimensionsFn(data.floating); 6306 return { 6307 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 6308 floating: { 6309 x: 0, 6310 y: 0, 6311 width: floatingDimensions.width, 6312 height: floatingDimensions.height 6313 } 6314 }; 6315 }; 6316 function isRTL(element) { 6317 return getComputedStyle2(element).direction === "rtl"; 6318 } 6319 var platform2 = { 6320 convertOffsetParentRelativeRectToViewportRelativeRect, 6321 getDocumentElement, 6322 getClippingRect, 6323 getOffsetParent, 6324 getElementRects, 6325 getClientRects, 6326 getDimensions, 6327 getScale, 6328 isElement, 6329 isRTL 6330 }; 6331 function rectsAreEqual(a, b) { 6332 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 6333 } 6334 function observeMove(element, onMove, ancestorResize) { 6335 let io = null; 6336 let timeoutId; 6337 const root = getDocumentElement(element); 6338 function cleanup() { 6339 var _io; 6340 clearTimeout(timeoutId); 6341 (_io = io) == null || _io.disconnect(); 6342 io = null; 6343 } 6344 function refresh(skip, threshold) { 6345 if (skip === void 0) { 6346 skip = false; 6347 } 6348 if (threshold === void 0) { 6349 threshold = 1; 6350 } 6351 cleanup(); 6352 const elementRectForRootMargin = element.getBoundingClientRect(); 6353 const { 6354 left, 6355 top, 6356 width, 6357 height 6358 } = elementRectForRootMargin; 6359 if (!skip) { 6360 onMove(); 6361 } 6362 if (!width || !height) { 6363 return; 6364 } 6365 const insetTop = floor(top); 6366 const insetRight = floor(root.clientWidth - (left + width)); 6367 const insetBottom = floor(root.clientHeight - (top + height)); 6368 const insetLeft = floor(left); 6369 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 6370 const options = { 6371 rootMargin, 6372 threshold: max(0, min(1, threshold)) || 1 6373 }; 6374 let isFirstUpdate = true; 6375 function handleObserve(entries) { 6376 const ratio = entries[0].intersectionRatio; 6377 if (!rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 6378 return refresh(); 6379 } 6380 if (ratio !== threshold) { 6381 if (!isFirstUpdate) { 6382 return refresh(); 6383 } 6384 if (!ratio) { 6385 timeoutId = setTimeout(() => { 6386 refresh(false, 1e-7); 6387 }, 1e3); 6388 } else { 6389 refresh(false, ratio); 6390 } 6391 } 6392 isFirstUpdate = false; 6393 } 6394 try { 6395 io = new IntersectionObserver(handleObserve, { 6396 ...options, 6397 // Handle <iframe>s 6398 root: root.ownerDocument 6399 }); 6400 } catch (_e) { 6401 io = new IntersectionObserver(handleObserve, options); 6402 } 6403 io.observe(element); 6404 } 6405 const win = getWindow(element); 6406 const handleResize = () => refresh(ancestorResize); 6407 win.addEventListener("resize", handleResize); 6408 refresh(true); 6409 return () => { 6410 win.removeEventListener("resize", handleResize); 6411 cleanup(); 6412 }; 6413 } 6414 function autoUpdate(reference, floating, update2, options) { 6415 if (options === void 0) { 6416 options = {}; 6417 } 6418 const { 6419 ancestorScroll = true, 6420 ancestorResize = true, 6421 elementResize = typeof ResizeObserver === "function", 6422 layoutShift = typeof IntersectionObserver === "function", 6423 animationFrame = false 6424 } = options; 6425 const referenceEl = unwrapElement(reference); 6426 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : []; 6427 ancestors.forEach((ancestor) => { 6428 ancestorScroll && ancestor.addEventListener("scroll", update2); 6429 ancestorResize && ancestor.addEventListener("resize", update2); 6430 }); 6431 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2, ancestorResize) : null; 6432 let reobserveFrame = -1; 6433 let resizeObserver = null; 6434 if (elementResize) { 6435 resizeObserver = new ResizeObserver((_ref) => { 6436 let [firstEntry] = _ref; 6437 if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) { 6438 resizeObserver.unobserve(floating); 6439 cancelAnimationFrame(reobserveFrame); 6440 reobserveFrame = requestAnimationFrame(() => { 6441 var _resizeObserver; 6442 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 6443 }); 6444 } 6445 update2(); 6446 }); 6447 if (referenceEl && !animationFrame) { 6448 resizeObserver.observe(referenceEl); 6449 } 6450 if (floating) { 6451 resizeObserver.observe(floating); 6452 } 6453 } 6454 let frameId; 6455 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 6456 if (animationFrame) { 6457 frameLoop(); 6458 } 6459 function frameLoop() { 6460 const nextRefRect = getBoundingClientRect(reference); 6461 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 6462 update2(); 6463 } 6464 prevRefRect = nextRefRect; 6465 frameId = requestAnimationFrame(frameLoop); 6466 } 6467 update2(); 6468 return () => { 6469 var _resizeObserver2; 6470 ancestors.forEach((ancestor) => { 6471 ancestorScroll && ancestor.removeEventListener("scroll", update2); 6472 ancestorResize && ancestor.removeEventListener("resize", update2); 6473 }); 6474 cleanupIo == null || cleanupIo(); 6475 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 6476 resizeObserver = null; 6477 if (animationFrame) { 6478 cancelAnimationFrame(frameId); 6479 } 6480 }; 6481 } 6482 var offset2 = offset; 6483 var shift2 = shift; 6484 var flip2 = flip; 6485 var size2 = size; 6486 var limitShift2 = limitShift; 6487 var computePosition2 = (reference, floating, options) => { 6488 const cache = /* @__PURE__ */ new Map(); 6489 const mergedOptions = options != null ? options : {}; 6490 const platformWithCache = { 6491 ...platform2, 6492 ...mergedOptions.platform, 6493 _c: cache 6494 }; 6495 return computePosition(reference, floating, { 6496 ...mergedOptions, 6497 platform: platformWithCache 6498 }); 6499 }; 6500 6501 // node_modules/.store/@floating-ui/react-dom@2.1.9-AxWcAwqlMfOrAFOinFKSVg/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs 6502 var React27 = __toESM(require_react(), 1); 6503 var import_react2 = __toESM(require_react(), 1); 6504 var ReactDOM5 = __toESM(require_react_dom(), 1); 6505 var isClient = typeof document !== "undefined"; 6506 var noop2 = function noop3() { 6507 }; 6508 var index = isClient ? import_react2.useLayoutEffect : noop2; 6509 function deepEqual(a, b) { 6510 if (a === b) { 6511 return true; 6512 } 6513 if (typeof a !== typeof b) { 6514 return false; 6515 } 6516 if (typeof a === "function" && a.toString() === b.toString()) { 6517 return true; 6518 } 6519 let length; 6520 let i; 6521 let keys; 6522 if (a && b && typeof a === "object") { 6523 if (Array.isArray(a)) { 6524 length = a.length; 6525 if (length !== b.length) return false; 6526 for (i = length; i-- !== 0; ) { 6527 if (!deepEqual(a[i], b[i])) { 6528 return false; 6529 } 6530 } 6531 return true; 6532 } 6533 keys = Object.keys(a); 6534 length = keys.length; 6535 if (length !== Object.keys(b).length) { 6536 return false; 6537 } 6538 for (i = length; i-- !== 0; ) { 6539 if (!{}.hasOwnProperty.call(b, keys[i])) { 6540 return false; 6541 } 6542 } 6543 for (i = length; i-- !== 0; ) { 6544 const key = keys[i]; 6545 if (key === "_owner" && a.$$typeof) { 6546 continue; 6547 } 6548 if (!deepEqual(a[key], b[key])) { 6549 return false; 6550 } 6551 } 6552 return true; 6553 } 6554 return a !== a && b !== b; 6555 } 6556 function getDPR(element) { 6557 if (typeof window === "undefined") { 6558 return 1; 6559 } 6560 const win = element.ownerDocument.defaultView || window; 6561 return win.devicePixelRatio || 1; 6562 } 6563 function roundByDPR(element, value) { 6564 const dpr = getDPR(element); 6565 return Math.round(value * dpr) / dpr; 6566 } 6567 function useLatestRef(value) { 6568 const ref = React27.useRef(value); 6569 index(() => { 6570 ref.current = value; 6571 }); 6572 return ref; 6573 } 6574 function useFloating(options) { 6575 if (options === void 0) { 6576 options = {}; 6577 } 6578 const { 6579 placement = "bottom", 6580 strategy = "absolute", 6581 middleware = [], 6582 platform: platform3, 6583 elements: { 6584 reference: externalReference, 6585 floating: externalFloating 6586 } = {}, 6587 transform = true, 6588 whileElementsMounted, 6589 open: open2 6590 } = options; 6591 const [data, setData] = React27.useState({ 6592 x: 0, 6593 y: 0, 6594 strategy, 6595 placement, 6596 middlewareData: {}, 6597 isPositioned: false 6598 }); 6599 const [latestMiddleware, setLatestMiddleware] = React27.useState(middleware); 6600 if (!deepEqual(latestMiddleware, middleware)) { 6601 setLatestMiddleware(middleware); 6602 } 6603 const [_reference, _setReference] = React27.useState(null); 6604 const [_floating, _setFloating] = React27.useState(null); 6605 const setReference = React27.useCallback((node) => { 6606 if (node !== referenceRef.current) { 6607 referenceRef.current = node; 6608 _setReference(node); 6609 } 6610 }, []); 6611 const setFloating = React27.useCallback((node) => { 6612 if (node !== floatingRef.current) { 6613 floatingRef.current = node; 6614 _setFloating(node); 6615 } 6616 }, []); 6617 const referenceEl = externalReference || _reference; 6618 const floatingEl = externalFloating || _floating; 6619 const referenceRef = React27.useRef(null); 6620 const floatingRef = React27.useRef(null); 6621 const dataRef = React27.useRef(data); 6622 const hasWhileElementsMounted = whileElementsMounted != null; 6623 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 6624 const platformRef = useLatestRef(platform3); 6625 const openRef = useLatestRef(open2); 6626 const update2 = React27.useCallback(() => { 6627 if (!referenceRef.current || !floatingRef.current) { 6628 return; 6629 } 6630 const config = { 6631 placement, 6632 strategy, 6633 middleware: latestMiddleware 6634 }; 6635 if (platformRef.current) { 6636 config.platform = platformRef.current; 6637 } 6638 computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => { 6639 const fullData = { 6640 ...data2, 6641 // The floating element's position may be recomputed while it's closed 6642 // but still mounted (such as when transitioning out). To ensure 6643 // `isPositioned` will be `false` initially on the next open, avoid 6644 // setting it to `true` when `open === false` (must be specified). 6645 isPositioned: openRef.current !== false 6646 }; 6647 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 6648 dataRef.current = fullData; 6649 ReactDOM5.flushSync(() => { 6650 setData(fullData); 6651 }); 6652 } 6653 }); 6654 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 6655 index(() => { 6656 if (open2 === false && dataRef.current.isPositioned) { 6657 dataRef.current.isPositioned = false; 6658 setData((data2) => ({ 6659 ...data2, 6660 isPositioned: false 6661 })); 6662 } 6663 }, [open2]); 6664 const isMountedRef = React27.useRef(false); 6665 index(() => { 6666 isMountedRef.current = true; 6667 return () => { 6668 isMountedRef.current = false; 6669 }; 6670 }, []); 6671 index(() => { 6672 if (referenceEl) referenceRef.current = referenceEl; 6673 if (floatingEl) floatingRef.current = floatingEl; 6674 if (referenceEl && floatingEl) { 6675 if (whileElementsMountedRef.current) { 6676 return whileElementsMountedRef.current(referenceEl, floatingEl, update2); 6677 } 6678 update2(); 6679 } 6680 }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); 6681 const refs = React27.useMemo(() => ({ 6682 reference: referenceRef, 6683 floating: floatingRef, 6684 setReference, 6685 setFloating 6686 }), [setReference, setFloating]); 6687 const elements = React27.useMemo(() => ({ 6688 reference: referenceEl, 6689 floating: floatingEl 6690 }), [referenceEl, floatingEl]); 6691 const floatingStyles = React27.useMemo(() => { 6692 const initialStyles = { 6693 position: strategy, 6694 left: 0, 6695 top: 0 6696 }; 6697 if (!elements.floating) { 6698 return initialStyles; 6699 } 6700 const x = roundByDPR(elements.floating, data.x); 6701 const y = roundByDPR(elements.floating, data.y); 6702 if (transform) { 6703 return { 6704 ...initialStyles, 6705 transform: "translate(" + x + "px, " + y + "px)", 6706 ...getDPR(elements.floating) >= 1.5 && { 6707 willChange: "transform" 6708 } 6709 }; 6710 } 6711 return { 6712 position: strategy, 6713 left: x, 6714 top: y 6715 }; 6716 }, [strategy, transform, elements.floating, data.x, data.y]); 6717 return React27.useMemo(() => ({ 6718 ...data, 6719 update: update2, 6720 refs, 6721 elements, 6722 floatingStyles 6723 }), [data, update2, refs, elements, floatingStyles]); 6724 } 6725 var offset3 = (options, deps) => { 6726 const result = offset2(options); 6727 return { 6728 name: result.name, 6729 fn: result.fn, 6730 options: [options, deps] 6731 }; 6732 }; 6733 var shift3 = (options, deps) => { 6734 const result = shift2(options); 6735 return { 6736 name: result.name, 6737 fn: result.fn, 6738 options: [options, deps] 6739 }; 6740 }; 6741 var limitShift3 = (options, deps) => { 6742 const result = limitShift2(options); 6743 return { 6744 fn: result.fn, 6745 options: [options, deps] 6746 }; 6747 }; 6748 var flip3 = (options, deps) => { 6749 const result = flip2(options); 6750 return { 6751 name: result.name, 6752 fn: result.fn, 6753 options: [options, deps] 6754 }; 6755 }; 6756 var size3 = (options, deps) => { 6757 const result = size2(options); 6758 return { 6759 name: result.name, 6760 fn: result.fn, 6761 options: [options, deps] 6762 }; 6763 }; 6764 6765 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/NullStore.mjs 6766 var NullStore = class extends ReactStore { 6767 // `update`/`set`/`notifyAll` funnel through `setState` in the base `Store`, so overriding 6768 // `setState` alone would neutralize them today. They are overridden explicitly so the store stays 6769 // inert even if a future base-class change stops routing a mutator through `setState`. 6770 setState(_newState) { 6771 } 6772 update(_changes) { 6773 } 6774 set(_key, _value) { 6775 } 6776 notifyAll() { 6777 } 6778 }; 6779 6780 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/inertValue.mjs 6781 function inertValue(value) { 6782 if (isReactVersionAtLeast(19)) { 6783 return value; 6784 } 6785 return value ? "true" : void 0; 6786 } 6787 6788 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/direction-context/DirectionContext.mjs 6789 var React28 = __toESM(require_react(), 1); 6790 var DirectionContext = /* @__PURE__ */ React28.createContext(void 0); 6791 if (true) DirectionContext.displayName = "DirectionContext"; 6792 function useDirection() { 6793 const context = React28.useContext(DirectionContext); 6794 return context?.direction ?? "ltr"; 6795 } 6796 6797 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs 6798 var React30 = __toESM(require_react(), 1); 6799 6800 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/hooks/useFloating.mjs 6801 var React29 = __toESM(require_react(), 1); 6802 function useBaseUIFloating(options) { 6803 const { 6804 nodeId, 6805 externalTree, 6806 rootContext: store2 6807 } = options; 6808 const referenceElement = store2.useState("referenceElement"); 6809 const floatingElement = store2.useState("floatingElement"); 6810 const domReferenceElement = store2.useState("domReferenceElement"); 6811 const open2 = store2.useState("open"); 6812 const floatingId = store2.useState("floatingId"); 6813 const [positionReference, setPositionReferenceRaw] = React29.useState(null); 6814 const domReferenceRef = React29.useRef(null); 6815 const tree = useFloatingTree(externalTree); 6816 const storeElements = React29.useMemo(() => ({ 6817 reference: referenceElement, 6818 floating: floatingElement, 6819 domReference: domReferenceElement 6820 }), [referenceElement, floatingElement, domReferenceElement]); 6821 const position = useFloating({ 6822 ...options, 6823 elements: { 6824 ...storeElements, 6825 ...positionReference && { 6826 reference: positionReference 6827 } 6828 } 6829 }); 6830 const setPositionReference = React29.useCallback((node) => { 6831 const computedPositionReference = isElement(node) ? { 6832 getBoundingClientRect: () => node.getBoundingClientRect(), 6833 getClientRects: () => node.getClientRects(), 6834 contextElement: node 6835 } : node; 6836 setPositionReferenceRaw(computedPositionReference); 6837 position.refs.setReference(computedPositionReference); 6838 }, [position.refs]); 6839 const refs = React29.useMemo(() => ({ 6840 ...position.refs, 6841 setPositionReference, 6842 domReference: domReferenceRef 6843 }), [position.refs, setPositionReference]); 6844 const elements = React29.useMemo(() => ({ 6845 ...position.elements, 6846 domReference: domReferenceElement 6847 }), [position.elements, domReferenceElement]); 6848 const context = React29.useMemo(() => ({ 6849 ...position, 6850 dataRef: store2.context.dataRef, 6851 open: open2, 6852 onOpenChange: store2.setOpen, 6853 events: store2.context.events, 6854 floatingId, 6855 refs, 6856 elements, 6857 nodeId, 6858 rootStore: store2 6859 }), [position, refs, elements, nodeId, store2, open2, floatingId]); 6860 useIsoLayoutEffect(() => { 6861 if (domReferenceElement) { 6862 domReferenceRef.current = domReferenceElement; 6863 } 6864 }, [domReferenceElement]); 6865 useIsoLayoutEffect(() => { 6866 store2.context.dataRef.current.floatingContext = context; 6867 const node = tree?.nodesRef.current.find((n) => n.id === nodeId); 6868 if (node) { 6869 node.context = context; 6870 } 6871 }); 6872 return React29.useMemo(() => ({ 6873 ...position, 6874 context, 6875 refs, 6876 elements, 6877 rootStore: store2 6878 }), [position, refs, elements, context, store2]); 6879 } 6880 6881 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/floating-ui-react/middleware/arrow.mjs 6882 var baseArrow = (options) => ({ 6883 name: "arrow", 6884 options, 6885 async fn(state) { 6886 const { 6887 x, 6888 y, 6889 placement, 6890 rects, 6891 platform: platform3, 6892 elements, 6893 middlewareData 6894 } = state; 6895 const { 6896 element, 6897 padding = 0 6898 } = evaluate(options, state) || {}; 6899 if (element == null) { 6900 return {}; 6901 } 6902 const paddingObject = getPaddingObject(padding); 6903 const coords = { 6904 x, 6905 y 6906 }; 6907 const axis = getAlignmentAxis(placement); 6908 const length = getAxisLength(axis); 6909 const arrowDimensions = await platform3.getDimensions(element); 6910 const isYAxis = axis === "y"; 6911 const minProp = isYAxis ? "top" : "left"; 6912 const maxProp = isYAxis ? "bottom" : "right"; 6913 const clientProp = isYAxis ? "clientHeight" : "clientWidth"; 6914 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 6915 const startDiff = coords[axis] - rects.reference[axis]; 6916 const clientSize = elements.floating[clientProp] || rects.floating[length]; 6917 const centerToReference = endDiff / 2 - startDiff / 2; 6918 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 6919 const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding); 6920 const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding); 6921 const min2 = minPadding; 6922 const max2 = clientSize - arrowDimensions[length] - maxPadding; 6923 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 6924 const offset4 = clamp(min2, center, max2); 6925 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 6926 const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0; 6927 return { 6928 [axis]: coords[axis] + alignmentOffset, 6929 data: { 6930 [axis]: offset4, 6931 centerOffset: center - offset4 - alignmentOffset, 6932 ...shouldAddOffset && { 6933 alignmentOffset 6934 } 6935 }, 6936 reset: shouldAddOffset 6937 }; 6938 } 6939 }); 6940 var arrow4 = (options, deps) => { 6941 const { 6942 name, 6943 fn 6944 } = baseArrow(options); 6945 return { 6946 name, 6947 fn, 6948 options: [options, deps] 6949 }; 6950 }; 6951 6952 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/hideMiddleware.mjs 6953 var hide4 = { 6954 name: "hide", 6955 async fn(state) { 6956 const { 6957 width, 6958 height, 6959 x, 6960 y 6961 } = state.rects.reference; 6962 const anchorHidden2 = width === 0 && height === 0 && x === 0 && y === 0; 6963 const overflow = await state.platform.detectOverflow(state, { 6964 elementContext: "reference" 6965 }); 6966 const referenceHidden = overflow.top - height >= 0 || overflow.right - width >= 0 || overflow.bottom - height >= 0 || overflow.left - width >= 0; 6967 return { 6968 data: { 6969 referenceHidden: referenceHidden || anchorHidden2 6970 } 6971 }; 6972 } 6973 }; 6974 6975 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/adaptiveOriginConstants.mjs 6976 var DEFAULT_SIDES = { 6977 sideX: "left", 6978 sideY: "top" 6979 }; 6980 6981 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPositionerCssVars.mjs 6982 var availableWidth = "--available-width"; 6983 var availableHeight = "--available-height"; 6984 var anchorWidth = "--anchor-width"; 6985 var anchorHeight = "--anchor-height"; 6986 var transformOrigin = "--transform-origin"; 6987 var positionerWidth = "--positioner-width"; 6988 var positionerHeight = "--positioner-height"; 6989 6990 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/useAnchorPositioning.mjs 6991 var AVAILABLE_WIDTH_VAR = availableWidth; 6992 var AVAILABLE_HEIGHT_VAR = availableHeight; 6993 function getLogicalSide(sideParam, renderedSide, isRtl) { 6994 const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end"; 6995 const logicalRight = isRtl ? "inline-start" : "inline-end"; 6996 const logicalLeft = isRtl ? "inline-end" : "inline-start"; 6997 return { 6998 top: "top", 6999 right: isLogicalSideParam ? logicalRight : "right", 7000 bottom: "bottom", 7001 left: isLogicalSideParam ? logicalLeft : "left" 7002 }[renderedSide]; 7003 } 7004 function getOffsetData(state, sideParam, isRtl) { 7005 const { 7006 rects, 7007 placement 7008 } = state; 7009 const data = { 7010 side: getLogicalSide(sideParam, getSide(placement), isRtl), 7011 align: getAlignment(placement) || "center", 7012 anchor: { 7013 width: rects.reference.width, 7014 height: rects.reference.height 7015 }, 7016 positioner: { 7017 width: rects.floating.width, 7018 height: rects.floating.height 7019 } 7020 }; 7021 return data; 7022 } 7023 function useAnchorPositioning(params) { 7024 return useAnchorPositioningWithHook(params, useBaseUIFloating); 7025 } 7026 function useAnchorPositioningWithHook(params, useFloatingHook) { 7027 const { 7028 // Public parameters 7029 anchor, 7030 positionMethod = "absolute", 7031 side: sideParam = "bottom", 7032 sideOffset = 0, 7033 align = "center", 7034 alignOffset = 0, 7035 collisionBoundary, 7036 collisionPadding: collisionPaddingParam = 5, 7037 sticky = false, 7038 arrowPadding = 5, 7039 disableAnchorTracking = false, 7040 inline: inlineMiddleware, 7041 // Private parameters 7042 keepMounted = false, 7043 floatingRootContext, 7044 mounted, 7045 collisionAvoidance, 7046 shift: shift4, 7047 nodeId, 7048 adaptiveOrigin: adaptiveOrigin2, 7049 lazyFlip = false, 7050 externalTree 7051 } = params; 7052 const collisionAvoidanceSide = collisionAvoidance.side || "flip"; 7053 const collisionAvoidanceAlign = collisionAvoidance.align || "flip"; 7054 const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end"; 7055 const shiftCrossAxis = shift4?.crossAxis ?? false; 7056 const shiftRootBoundary = shift4?.rootBoundary; 7057 const anchorFn = typeof anchor === "function" ? anchor : void 0; 7058 const anchorFnCallback = useStableCallback(anchorFn); 7059 const anchorDep = anchorFn ? anchorFnCallback : anchor; 7060 const anchorValueRef = useValueAsRef(anchor); 7061 const mountedRef = useValueAsRef(mounted); 7062 const direction = useDirection(); 7063 const isRtl = direction === "rtl"; 7064 const [mountPlacement, setMountPlacement] = React30.useState(null); 7065 if (!mounted && mountPlacement !== null) { 7066 setMountPlacement(null); 7067 } 7068 const lockAlign = lazyFlip === "placement"; 7069 const mountSide = mountPlacement ? getSide(mountPlacement) : null; 7070 const mountAlign = mountPlacement && lockAlign ? getAlignment(mountPlacement) || "center" : null; 7071 const side = mountSide || { 7072 top: "top", 7073 right: "right", 7074 bottom: "bottom", 7075 left: "left", 7076 "inline-end": isRtl ? "left" : "right", 7077 "inline-start": isRtl ? "right" : "left" 7078 }[sideParam]; 7079 const placementAlign = mountAlign || align; 7080 const placement = placementAlign === "center" ? side : `$side}-$placementAlign}`; 7081 let collisionPadding = collisionPaddingParam; 7082 if (typeof collisionPadding === "number") { 7083 collisionPadding = { 7084 top: collisionPadding, 7085 right: collisionPadding, 7086 bottom: collisionPadding, 7087 left: collisionPadding 7088 }; 7089 } else if (collisionPadding) { 7090 collisionPadding = { 7091 top: collisionPadding.top || 0, 7092 right: collisionPadding.right || 0, 7093 bottom: collisionPadding.bottom || 0, 7094 left: collisionPadding.left || 0 7095 }; 7096 } 7097 const bias = 1; 7098 const biasTop = sideParam === "bottom" ? bias : 0; 7099 const biasBottom = sideParam === "top" ? bias : 0; 7100 const biasLeft = sideParam === "right" ? bias : 0; 7101 const biasRight = sideParam === "left" ? bias : 0; 7102 const commonCollisionProps = { 7103 boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary, 7104 padding: collisionPadding 7105 }; 7106 const arrowRef = React30.useRef(null); 7107 const sideOffsetRef = useValueAsRef(sideOffset); 7108 const alignOffsetRef = useValueAsRef(alignOffset); 7109 const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0; 7110 const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0; 7111 const middleware = []; 7112 if (inlineMiddleware) { 7113 middleware.push(inlineMiddleware); 7114 } 7115 middleware.push(offset3((state) => { 7116 const data = getOffsetData(state, sideParam, isRtl); 7117 const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current; 7118 const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current; 7119 return { 7120 mainAxis: sideAxis, 7121 crossAxis: alignAxis, 7122 alignmentAxis: alignAxis 7123 }; 7124 }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam])); 7125 const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift"; 7126 const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift"); 7127 const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({ 7128 ...commonCollisionProps, 7129 // Ensure the popup flips if it's been limited by its --available-height and it resizes. 7130 // Since the size() padding is smaller than the flip() padding, flip() will take precedence. 7131 padding: { 7132 top: collisionPadding.top + bias + biasTop, 7133 right: collisionPadding.right + bias + biasRight, 7134 bottom: collisionPadding.bottom + bias + biasBottom, 7135 left: collisionPadding.left + bias + biasLeft 7136 }, 7137 mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip", 7138 crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false, 7139 fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide 7140 }); 7141 const shiftMiddleware = shiftDisabled ? null : shift3({ 7142 ...commonCollisionProps, 7143 // Use the Layout Viewport to avoid shifting around when pinch-zooming. 7144 rootBoundary: shiftRootBoundary, 7145 mainAxis: collisionAvoidanceAlign !== "none", 7146 crossAxis: crossAxisShiftEnabled, 7147 limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => { 7148 if (!arrowRef.current) { 7149 return {}; 7150 } 7151 const { 7152 width, 7153 height 7154 } = arrowRef.current.getBoundingClientRect(); 7155 const sideAxis = getSideAxis(getSide(limitData.placement)); 7156 const arrowSize = sideAxis === "y" ? width : height; 7157 const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom; 7158 return { 7159 offset: arrowSize / 2 + offsetAmount / 2 7160 }; 7161 }) 7162 }, [commonCollisionProps, sticky, shiftCrossAxis, shiftRootBoundary, collisionPadding, collisionAvoidanceAlign]); 7163 if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || placementAlign === "center") { 7164 middleware.push(shiftMiddleware, flipMiddleware); 7165 } else { 7166 middleware.push(flipMiddleware, shiftMiddleware); 7167 } 7168 middleware.push(size3({ 7169 ...commonCollisionProps, 7170 apply({ 7171 elements: { 7172 floating 7173 }, 7174 availableWidth: availableWidth2, 7175 availableHeight: availableHeight2, 7176 rects 7177 }) { 7178 if (!mountedRef.current) { 7179 return; 7180 } 7181 const floatingStyle = floating.style; 7182 floatingStyle.setProperty(AVAILABLE_WIDTH_VAR, `$availableWidth2}px`); 7183 floatingStyle.setProperty(AVAILABLE_HEIGHT_VAR, `$availableHeight2}px`); 7184 const dpr = getWindow(floating).devicePixelRatio || 1; 7185 const { 7186 x: x2, 7187 y: y2, 7188 width, 7189 height 7190 } = rects.reference; 7191 const anchorWidth2 = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; 7192 const anchorHeight2 = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; 7193 floatingStyle.setProperty(anchorWidth, `$anchorWidth2}px`); 7194 floatingStyle.setProperty(anchorHeight, `$anchorHeight2}px`); 7195 } 7196 }), arrow4((state) => ({ 7197 // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set, 7198 // we'll create a fake element. 7199 element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"), 7200 // No padding for the fake arrow: it would displace aligned popups on narrow anchors. 7201 padding: arrowRef.current ? arrowPadding : 0 7202 }), [arrowPadding]), { 7203 name: "transformOrigin", 7204 fn(state) { 7205 const { 7206 elements: { 7207 floating 7208 }, 7209 middlewareData: middlewareData2, 7210 placement: renderedPlacement2, 7211 platform: platform3, 7212 rects, 7213 y: y2 7214 } = state; 7215 const renderedSide2 = getSide(renderedPlacement2); 7216 const renderedAlign2 = getAlignment(renderedPlacement2); 7217 const isVertical = getSideAxis(renderedSide2) === "y"; 7218 const arrowEl = arrowRef.current; 7219 const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; 7220 let crossOrigin; 7221 if (!arrowEl && renderedAlign2 && Math.abs(isVertical ? middlewareData2.shift?.x || 0 : middlewareData2.shift?.y || 0) <= 1) { 7222 crossOrigin = renderedAlign2 === "start" === (isVertical && platform3.isRTL?.(floating) === true) ? "100%" : "0%"; 7223 } else { 7224 const arrowOffset = isVertical ? middlewareData2.arrow?.x || 0 : middlewareData2.arrow?.y || 0; 7225 const arrowSize = isVertical ? arrowEl?.clientWidth || 0 : arrowEl?.clientHeight || 0; 7226 crossOrigin = `$arrowOffset + arrowSize / 2}px`; 7227 } 7228 let sideOrigin = renderedSide2 === "top" || renderedSide2 === "left" ? `calc(100% + $sideOffsetValue}px)` : `${-sideOffsetValue}px`; 7229 if (crossAxisShiftEnabled && isVertical && Math.abs(middlewareData2.shift?.y || 0) > sideOffsetValue) { 7230 sideOrigin = `$rects.reference.y + rects.reference.height / 2 - y2}px`; 7231 } 7232 floating.style.setProperty(transformOrigin, isVertical ? `$crossOrigin} $sideOrigin}` : `$sideOrigin} $crossOrigin}`); 7233 return {}; 7234 } 7235 }, hide4, adaptiveOrigin2); 7236 useIsoLayoutEffect(() => { 7237 if (!mounted && floatingRootContext) { 7238 floatingRootContext.update({ 7239 referenceElement: null, 7240 floatingElement: null, 7241 domReferenceElement: null, 7242 positionReference: null 7243 }); 7244 } 7245 }, [mounted, floatingRootContext]); 7246 const autoUpdateOptions = React30.useMemo(() => ({ 7247 ancestorScroll: !disableAnchorTracking, 7248 elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", 7249 layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" 7250 }), [disableAnchorTracking]); 7251 const { 7252 refs, 7253 elements, 7254 x, 7255 y, 7256 middlewareData, 7257 update: update2, 7258 placement: renderedPlacement, 7259 context, 7260 isPositioned, 7261 floatingStyles: originalFloatingStyles 7262 } = useFloatingHook({ 7263 rootContext: floatingRootContext, 7264 open: keepMounted ? mounted : void 0, 7265 placement, 7266 middleware, 7267 strategy: positionMethod, 7268 whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions), 7269 nodeId, 7270 externalTree 7271 }); 7272 const { 7273 sideX, 7274 sideY 7275 } = middlewareData.adaptiveOrigin || DEFAULT_SIDES; 7276 const resolvedPosition = isPositioned ? positionMethod : "fixed"; 7277 const floatingStyles = React30.useMemo(() => { 7278 let base; 7279 if (!isPositioned) { 7280 base = { 7281 position: resolvedPosition, 7282 top: 0, 7283 left: 0 7284 }; 7285 } else if (adaptiveOrigin2) { 7286 base = { 7287 position: resolvedPosition, 7288 [sideX]: x, 7289 [sideY]: y 7290 }; 7291 } else { 7292 base = { 7293 ...originalFloatingStyles, 7294 position: resolvedPosition 7295 }; 7296 } 7297 base[AVAILABLE_WIDTH_VAR] = "100vw"; 7298 base[AVAILABLE_HEIGHT_VAR] = "100vh"; 7299 if (!isPositioned) { 7300 base.opacity = 0; 7301 } 7302 return base; 7303 }, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]); 7304 const registeredPositionReferenceRef = React30.useRef(null); 7305 useIsoLayoutEffect(() => { 7306 if (!mounted) { 7307 return; 7308 } 7309 const anchorValue = anchorValueRef.current; 7310 const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue; 7311 const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null; 7312 const finalAnchor = unwrappedElement || null; 7313 if (finalAnchor !== registeredPositionReferenceRef.current) { 7314 refs.setPositionReference(finalAnchor); 7315 registeredPositionReferenceRef.current = finalAnchor; 7316 } 7317 }, [mounted, refs, anchorDep, anchorValueRef]); 7318 React30.useEffect(() => { 7319 if (!mounted) { 7320 return; 7321 } 7322 const anchorValue = anchorValueRef.current; 7323 if (typeof anchorValue === "function") { 7324 return; 7325 } 7326 if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) { 7327 refs.setPositionReference(anchorValue.current); 7328 registeredPositionReferenceRef.current = anchorValue.current; 7329 } 7330 }, [mounted, refs, anchorDep, anchorValueRef]); 7331 React30.useEffect(() => { 7332 if (keepMounted && mounted && elements.reference && elements.floating) { 7333 return autoUpdate(elements.reference, elements.floating, update2, autoUpdateOptions); 7334 } 7335 return void 0; 7336 }, [keepMounted, mounted, elements, update2, autoUpdateOptions]); 7337 const renderedSide = getSide(renderedPlacement); 7338 const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl); 7339 const renderedAlign = getAlignment(renderedPlacement) || "center"; 7340 const anchorHidden2 = Boolean(middlewareData.hide?.referenceHidden); 7341 useIsoLayoutEffect(() => { 7342 if (lazyFlip && mounted && isPositioned && (renderedSide !== side || lockAlign && renderedAlign !== placementAlign)) { 7343 setMountPlacement(renderedPlacement); 7344 } 7345 }, [lazyFlip, lockAlign, mounted, isPositioned, renderedPlacement, renderedSide, renderedAlign, side, placementAlign]); 7346 const arrowStyles = React30.useMemo(() => ({ 7347 position: "absolute", 7348 top: middlewareData.arrow?.y, 7349 left: middlewareData.arrow?.x 7350 }), [middlewareData.arrow]); 7351 const arrowUncentered = middlewareData.arrow?.centerOffset !== 0; 7352 return React30.useMemo(() => ({ 7353 positionerStyles: floatingStyles, 7354 arrowStyles, 7355 arrowRef, 7356 arrowUncentered, 7357 side: logicalRenderedSide, 7358 align: renderedAlign, 7359 physicalSide: renderedSide, 7360 anchorHidden: anchorHidden2, 7361 refs, 7362 context, 7363 isPositioned, 7364 update: update2 7365 }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden2, refs, context, isPositioned, update2]); 7366 } 7367 function isRef(param) { 7368 return param != null && "current" in param; 7369 } 7370 7371 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/internals/getDisabledMountTransitionStyles.mjs 7372 function getDisabledMountTransitionStyles(transitionStatus) { 7373 return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT; 7374 } 7375 7376 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePositioner.mjs 7377 function usePositioner(componentProps, state, { 7378 styles, 7379 transitionStatus, 7380 props, 7381 refs, 7382 hidden, 7383 inert = false 7384 }) { 7385 const style = { 7386 ...styles 7387 }; 7388 if (inert) { 7389 style.pointerEvents = "none"; 7390 } 7391 return useRenderElement("div", componentProps, { 7392 state, 7393 ref: refs, 7394 props: [{ 7395 role: "presentation", 7396 hidden, 7397 style 7398 }, getDisabledMountTransitionStyles(transitionStatus), props], 7399 stateAttributesMapping: popupStateMapping 7400 }); 7401 } 7402 7403 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupViewport.mjs 7404 var React34 = __toESM(require_react(), 1); 7405 var ReactDOM6 = __toESM(require_react_dom(), 1); 7406 7407 // node_modules/.store/@base-ui/utils@0.5.0--7My7Lubseca8je9LSEweA/node_modules/@base-ui/utils/usePreviousValue.mjs 7408 var React31 = __toESM(require_react(), 1); 7409 function usePreviousValue(value) { 7410 const [state, setState] = React31.useState({ 7411 current: value, 7412 previous: null 7413 }); 7414 if (!Object.is(value, state.current)) { 7415 setState({ 7416 current: value, 7417 previous: state.current 7418 }); 7419 } 7420 return state.previous; 7421 } 7422 7423 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs 7424 var React32 = __toESM(require_react(), 1); 7425 7426 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/getCssDimensions.mjs 7427 function getCssDimensions2(element) { 7428 const css = getComputedStyle2(element); 7429 let width = parseFloat(css.width) || 0; 7430 let height = parseFloat(css.height) || 0; 7431 const hasOffset = isHTMLElement(element); 7432 const offsetWidth = hasOffset ? element.offsetWidth : width; 7433 const offsetHeight = hasOffset ? element.offsetHeight : height; 7434 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 7435 if (shouldFallback) { 7436 width = offsetWidth; 7437 height = offsetHeight; 7438 } 7439 return { 7440 width, 7441 height 7442 }; 7443 } 7444 7445 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonPopupCssVars.mjs 7446 var popupWidth = "--popup-width"; 7447 var popupHeight = "--popup-height"; 7448 7449 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupAutoResize.mjs 7450 function usePopupAutoResize(parameters) { 7451 const { 7452 popupElement, 7453 positionerElement, 7454 content, 7455 mounted, 7456 onMeasureLayout: onMeasureLayoutParam, 7457 onMeasureLayoutComplete: onMeasureLayoutCompleteParam, 7458 side, 7459 direction 7460 } = parameters; 7461 const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true); 7462 const animationFrame = useAnimationFrame(); 7463 const committedDimensionsRef = React32.useRef(null); 7464 const onMeasureLayout = useStableCallback(onMeasureLayoutParam); 7465 const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam); 7466 const anchoringStyles = React32.useMemo(() => getPopupAnchoringStyles(side, direction), [side, direction]); 7467 useIsoLayoutEffect(() => { 7468 if (!mounted) { 7469 committedDimensionsRef.current = null; 7470 return void 0; 7471 } 7472 if (!popupElement || !positionerElement) { 7473 return void 0; 7474 } 7475 const restoreAnchoringStyles = applyElementStyles(popupElement, anchoringStyles); 7476 setPopupCssSize(popupElement, "auto"); 7477 const restorePopupPosition = overrideElementStyle(popupElement, "position", "static"); 7478 const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none"); 7479 const restorePopupScale = overrideElementStyle(popupElement, "scale", "1"); 7480 const restorePositionerAvailableSize = applyElementStyles(positionerElement, { 7481 [availableWidth]: "max-content", 7482 [availableHeight]: "max-content" 7483 }); 7484 function restoreMeasurementOverrides() { 7485 restorePopupPosition(); 7486 restorePopupTransform(); 7487 restorePositionerAvailableSize(); 7488 restorePopupScale(); 7489 } 7490 onMeasureLayout?.(); 7491 if (committedDimensionsRef.current === null) { 7492 setPositionerCssSize(positionerElement, "max-content"); 7493 const dimensions = getCssDimensions2(popupElement); 7494 committedDimensionsRef.current = dimensions; 7495 setPositionerCssSize(positionerElement, dimensions); 7496 restoreMeasurementOverrides(); 7497 onMeasureLayoutComplete?.(null, dimensions); 7498 return restoreAnchoringStyles; 7499 } 7500 setPositionerCssSize(positionerElement, "max-content"); 7501 const previousDimensions = committedDimensionsRef.current; 7502 const newDimensions = getCssDimensions2(popupElement); 7503 committedDimensionsRef.current = newDimensions; 7504 setPopupCssSize(popupElement, previousDimensions); 7505 restoreMeasurementOverrides(); 7506 onMeasureLayoutComplete?.(previousDimensions, newDimensions); 7507 setPositionerCssSize(positionerElement, newDimensions); 7508 const abortController = new AbortController(); 7509 animationFrame.request(() => { 7510 setPopupCssSize(popupElement, newDimensions); 7511 runOnceAnimationsFinish(() => { 7512 popupElement.style.setProperty(popupWidth, "auto"); 7513 popupElement.style.setProperty(popupHeight, "auto"); 7514 }, abortController.signal); 7515 }); 7516 return () => { 7517 abortController.abort(); 7518 animationFrame.cancel(); 7519 restoreAnchoringStyles(); 7520 }; 7521 }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]); 7522 } 7523 function getPopupAnchoringStyles(side, direction) { 7524 const isPhysicalTop = side === "top"; 7525 const isPhysicalLeft = side === "left" || side === (direction === "rtl" ? "inline-end" : "inline-start"); 7526 if (!isPhysicalTop && !isPhysicalLeft) { 7527 return EMPTY_OBJECT; 7528 } 7529 return { 7530 position: "absolute", 7531 [isPhysicalTop ? "bottom" : "top"]: "0", 7532 [isPhysicalLeft ? "right" : "left"]: "0" 7533 }; 7534 } 7535 function overrideElementStyle(element, property, value) { 7536 const originalValue = element.style.getPropertyValue(property); 7537 element.style.setProperty(property, value); 7538 return () => { 7539 element.style.setProperty(property, originalValue); 7540 }; 7541 } 7542 function applyElementStyles(element, styles) { 7543 const restorers = []; 7544 for (const [key, value] of Object.entries(styles)) { 7545 restorers.push(overrideElementStyle(element, key, value)); 7546 } 7547 return restorers.length ? () => { 7548 restorers.forEach((restore) => restore()); 7549 } : NOOP; 7550 } 7551 function setPopupCssSize(popupElement, size4) { 7552 const width = size4 === "auto" ? "auto" : `$size4.width}px`; 7553 const height = size4 === "auto" ? "auto" : `$size4.height}px`; 7554 popupElement.style.setProperty(popupWidth, width); 7555 popupElement.style.setProperty(popupHeight, height); 7556 } 7557 function setPositionerCssSize(positionerElement, size4) { 7558 const width = size4 === "max-content" ? "max-content" : `$size4.width}px`; 7559 const height = size4 === "max-content" ? "max-content" : `$size4.height}px`; 7560 positionerElement.style.setProperty(positionerWidth, width); 7561 positionerElement.style.setProperty(positionerHeight, height); 7562 } 7563 7564 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/direction-provider/DirectionProvider.mjs 7565 var React33 = __toESM(require_react(), 1); 7566 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); 7567 var DirectionProvider = function DirectionProvider2(props) { 7568 const { 7569 direction = "ltr" 7570 } = props; 7571 const contextValue = React33.useMemo(() => ({ 7572 direction 7573 }), [direction]); 7574 return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(DirectionContext.Provider, { 7575 value: contextValue, 7576 children: props.children 7577 }); 7578 }; 7579 if (true) DirectionProvider.displayName = "DirectionProvider"; 7580 7581 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/adaptiveOriginMiddleware.mjs 7582 var adaptiveOrigin = { 7583 name: "adaptiveOrigin", 7584 async fn(state) { 7585 const { 7586 x: rawX, 7587 y: rawY, 7588 rects: { 7589 floating: floatRect 7590 }, 7591 elements: { 7592 floating 7593 }, 7594 platform: platform3, 7595 strategy, 7596 placement 7597 } = state; 7598 const win = getWindow(floating); 7599 const styles = win.getComputedStyle(floating); 7600 const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== ""; 7601 if (!hasTransition) { 7602 return { 7603 x: rawX, 7604 y: rawY, 7605 data: DEFAULT_SIDES 7606 }; 7607 } 7608 const offsetParent = await platform3.getOffsetParent?.(floating); 7609 let offsetDimensions = { 7610 width: 0, 7611 height: 0 7612 }; 7613 if (strategy === "fixed" && win?.visualViewport) { 7614 offsetDimensions = { 7615 width: win.visualViewport.width, 7616 height: win.visualViewport.height 7617 }; 7618 } else if (offsetParent === win) { 7619 const doc = ownerDocument(floating); 7620 offsetDimensions = { 7621 width: doc.documentElement.clientWidth, 7622 height: doc.documentElement.clientHeight 7623 }; 7624 } else if (await platform3.isElement?.(offsetParent)) { 7625 offsetDimensions = await platform3.getDimensions(offsetParent); 7626 } 7627 const currentSide = getSide(placement); 7628 let x = rawX; 7629 let y = rawY; 7630 if (currentSide === "left") { 7631 x = offsetDimensions.width - (rawX + floatRect.width); 7632 } 7633 if (currentSide === "top") { 7634 y = offsetDimensions.height - (rawY + floatRect.height); 7635 } 7636 const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; 7637 const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; 7638 return { 7639 x, 7640 y, 7641 data: { 7642 sideX, 7643 sideY 7644 } 7645 }; 7646 } 7647 }; 7648 7649 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/CommonViewportDataAttributes.mjs 7650 var activationDirection = "data-activation-direction"; 7651 7652 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/usePopupViewport.mjs 7653 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); 7654 var popupViewportStateMapping = { 7655 activationDirection: (value) => value ? { 7656 [activationDirection]: value 7657 } : null 7658 }; 7659 function usePopupViewport(parameters) { 7660 const { 7661 store: store2, 7662 side, 7663 children 7664 } = parameters; 7665 const direction = useDirection(); 7666 const activeTrigger = store2.useState("activeTriggerElement"); 7667 const activeTriggerId = store2.useState("activeTriggerId"); 7668 const open2 = store2.useState("open"); 7669 const payload = store2.useState("payload"); 7670 const mounted = store2.useState("mounted"); 7671 const popupElement = store2.useState("popupElement"); 7672 const positionerElement = store2.useState("positionerElement"); 7673 const previousActiveTrigger = usePreviousValue(open2 ? activeTrigger : null); 7674 const currentContentKey = usePopupContentKey(activeTriggerId, payload); 7675 const capturedNodeRef = React34.useRef(null); 7676 const [previousContentNode, setPreviousContentNode] = React34.useState(null); 7677 const [newTriggerOffset, setNewTriggerOffset] = React34.useState(null); 7678 const currentContainerRef = React34.useRef(null); 7679 const previousContainerRef = React34.useRef(null); 7680 const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true); 7681 const cleanupFrame = useAnimationFrame(); 7682 const cleanupControllerRef = React34.useRef(null); 7683 const [previousContentDimensions, setPreviousContentDimensions] = React34.useState(null); 7684 const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React34.useState(false); 7685 useIsoLayoutEffect(() => { 7686 store2.set("adaptiveOrigin", adaptiveOrigin); 7687 return () => { 7688 store2.set("adaptiveOrigin", void 0); 7689 }; 7690 }, [store2]); 7691 const handleMeasureLayout = useStableCallback(() => { 7692 currentContainerRef.current?.style.setProperty("animation", "none"); 7693 currentContainerRef.current?.style.setProperty("transition", "none"); 7694 previousContainerRef.current?.style.setProperty("display", "none"); 7695 }); 7696 const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => { 7697 currentContainerRef.current?.style.removeProperty("animation"); 7698 currentContainerRef.current?.style.removeProperty("transition"); 7699 previousContainerRef.current?.style.removeProperty("display"); 7700 if (previousDimensions) { 7701 setPreviousContentDimensions(previousDimensions); 7702 } 7703 }); 7704 const armViewportCleanup = useStableCallback(() => { 7705 cleanupControllerRef.current?.abort(); 7706 const controller = new AbortController(); 7707 cleanupControllerRef.current = controller; 7708 onAnimationsFinished(() => { 7709 setPreviousContentNode(null); 7710 setPreviousContentDimensions(null); 7711 capturedNodeRef.current = null; 7712 }, controller.signal); 7713 }); 7714 const lastHandledTriggerRef = React34.useRef(null); 7715 useIsoLayoutEffect(() => { 7716 if (!open2 || !mounted) { 7717 lastHandledTriggerRef.current = null; 7718 } 7719 }, [open2, mounted]); 7720 useIsoLayoutEffect(() => { 7721 if (open2 && activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { 7722 setPreviousContentNode(capturedNodeRef.current); 7723 setShowStartingStyleAttribute(true); 7724 const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger); 7725 setNewTriggerOffset(offset4); 7726 lastHandledTriggerRef.current = activeTrigger; 7727 } 7728 }, [open2, activeTrigger, previousActiveTrigger]); 7729 useIsoLayoutEffect(() => { 7730 if (previousContentNode == null) { 7731 return; 7732 } 7733 cleanupControllerRef.current?.abort(); 7734 setShowStartingStyleAttribute(true); 7735 cleanupFrame.request(() => { 7736 ReactDOM6.flushSync(() => { 7737 setShowStartingStyleAttribute(false); 7738 }); 7739 armViewportCleanup(); 7740 }); 7741 }, [currentContentKey, previousContentNode, armViewportCleanup, cleanupFrame]); 7742 useIsoLayoutEffect(() => { 7743 const source = currentContainerRef.current; 7744 if (!source) { 7745 return; 7746 } 7747 const wrapper = ownerDocument(source).createElement("div"); 7748 for (const child of Array.from(source.childNodes)) { 7749 wrapper.appendChild(child.cloneNode(true)); 7750 } 7751 capturedNodeRef.current = wrapper; 7752 }); 7753 const isTransitioning = previousContentNode != null; 7754 let childrenToRender; 7755 if (!isTransitioning) { 7756 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { 7757 "data-current": true, 7758 ref: currentContainerRef, 7759 children 7760 }, currentContentKey); 7761 } else { 7762 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(React34.Fragment, { 7763 children: [/* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { 7764 "data-previous": true, 7765 inert: inertValue(true), 7766 ref: previousContainerRef, 7767 style: { 7768 ...previousContentDimensions ? { 7769 [popupWidth]: `$previousContentDimensions.width}px`, 7770 [popupHeight]: `$previousContentDimensions.height}px` 7771 } : null, 7772 position: "absolute" 7773 }, 7774 "data-ending-style": showStartingStyleAttribute ? void 0 : "" 7775 }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime7.jsx)("div", { 7776 "data-current": true, 7777 ref: currentContainerRef, 7778 "data-starting-style": showStartingStyleAttribute ? "" : void 0, 7779 children 7780 }, currentContentKey)] 7781 }); 7782 } 7783 useIsoLayoutEffect(() => { 7784 const container = previousContainerRef.current; 7785 if (!container || !previousContentNode) { 7786 return; 7787 } 7788 container.replaceChildren(...Array.from(previousContentNode.childNodes)); 7789 }, [previousContentNode]); 7790 usePopupAutoResize({ 7791 popupElement, 7792 positionerElement, 7793 mounted, 7794 content: payload, 7795 onMeasureLayout: handleMeasureLayout, 7796 onMeasureLayoutComplete: handleMeasureLayoutComplete, 7797 side, 7798 direction 7799 }); 7800 const state = { 7801 activationDirection: getActivationDirection(newTriggerOffset), 7802 transitioning: isTransitioning 7803 }; 7804 return { 7805 children: childrenToRender, 7806 state 7807 }; 7808 } 7809 function getActivationDirection(offset4) { 7810 if (!offset4) { 7811 return void 0; 7812 } 7813 return `$getValueWithTolerance(offset4.horizontal, 5, "right", "left")} $getValueWithTolerance(offset4.vertical, 5, "down", "up")}`; 7814 } 7815 function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) { 7816 if (value > tolerance) { 7817 return positiveLabel; 7818 } 7819 if (value < -tolerance) { 7820 return negativeLabel; 7821 } 7822 return ""; 7823 } 7824 function calculateRelativePosition(from, to) { 7825 const fromRect = from.getBoundingClientRect(); 7826 const toRect = to.getBoundingClientRect(); 7827 const fromCenter = { 7828 x: fromRect.left + fromRect.width / 2, 7829 y: fromRect.top + fromRect.height / 2 7830 }; 7831 const toCenter = { 7832 x: toRect.left + toRect.width / 2, 7833 y: toRect.top + toRect.height / 2 7834 }; 7835 return { 7836 horizontal: toCenter.x - fromCenter.x, 7837 vertical: toCenter.y - fromCenter.y 7838 }; 7839 } 7840 function usePopupContentKey(activeTriggerId, payload) { 7841 const [contentKey, setContentKey] = React34.useState(0); 7842 const previousActiveTriggerIdRef = React34.useRef(activeTriggerId); 7843 const previousPayloadRef = React34.useRef(payload); 7844 const pendingPayloadUpdateRef = React34.useRef(false); 7845 useIsoLayoutEffect(() => { 7846 const previousActiveTriggerId = previousActiveTriggerIdRef.current; 7847 const previousPayload = previousPayloadRef.current; 7848 const triggerIdChanged = activeTriggerId !== previousActiveTriggerId; 7849 const payloadChanged = payload !== previousPayload; 7850 if (triggerIdChanged) { 7851 setContentKey((value) => value + 1); 7852 pendingPayloadUpdateRef.current = !payloadChanged; 7853 } else if (pendingPayloadUpdateRef.current && payloadChanged) { 7854 setContentKey((value) => value + 1); 7855 pendingPayloadUpdateRef.current = false; 7856 } 7857 previousActiveTriggerIdRef.current = activeTriggerId; 7858 previousPayloadRef.current = payload; 7859 }, [activeTriggerId, payload]); 7860 return `$activeTriggerId ?? "current"}-$contentKey}`; 7861 } 7862 7863 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/utils/FloatingPortalLite.mjs 7864 var React35 = __toESM(require_react(), 1); 7865 var ReactDOM7 = __toESM(require_react_dom(), 1); 7866 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); 7867 var FloatingPortalLite = /* @__PURE__ */ React35.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { 7868 const { 7869 children, 7870 container, 7871 className, 7872 render, 7873 style, 7874 ...elementProps 7875 } = componentProps; 7876 const { 7877 node: portalNode, 7878 subtree: portalSubtree 7879 } = useFloatingPortalNode({ 7880 container, 7881 ref: forwardedRef, 7882 componentProps, 7883 elementProps 7884 }); 7885 if (!portalSubtree && !portalNode) { 7886 return null; 7887 } 7888 return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(React35.Fragment, { 7889 children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM7.createPortal(children, portalNode)] 7890 }); 7891 }); 7892 if (true) FloatingPortalLite.displayName = "FloatingPortalLite"; 7893 7894 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/index.parts.mjs 7895 var index_parts_exports = {}; 7896 __export(index_parts_exports, { 7897 Arrow: () => TooltipArrow, 7898 Handle: () => TooltipHandle, 7899 Popup: () => TooltipPopup, 7900 Portal: () => TooltipPortal, 7901 Positioner: () => TooltipPositioner, 7902 Provider: () => TooltipProvider, 7903 Root: () => TooltipRoot, 7904 Trigger: () => TooltipTrigger, 7905 Viewport: () => TooltipViewport, 7906 createHandle: () => createTooltipHandle 7907 }); 7908 7909 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs 7910 var React38 = __toESM(require_react(), 1); 7911 7912 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRootContext.mjs 7913 var React36 = __toESM(require_react(), 1); 7914 var TooltipRootContext = /* @__PURE__ */ React36.createContext(void 0); 7915 if (true) TooltipRootContext.displayName = "TooltipRootContext"; 7916 function useTooltipRootContext(optional) { 7917 const context = React36.useContext(TooltipRootContext); 7918 if (context === void 0 && !optional) { 7919 throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72)); 7920 } 7921 return context; 7922 } 7923 7924 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/store/TooltipStore.mjs 7925 var React37 = __toESM(require_react(), 1); 7926 var selectors2 = { 7927 ...popupStoreSelectors, 7928 disabled: (state) => state.disabled, 7929 instantType: (state) => state.instantType, 7930 isInstantPhase: (state) => state.isInstantPhase, 7931 trackCursorAxis: (state) => state.trackCursorAxis, 7932 disableHoverablePopup: (state) => state.disableHoverablePopup, 7933 lastOpenChangeReason: (state) => state.openChangeReason, 7934 closeOnClick: (state) => state.closeOnClick, 7935 // Active and inactive trigger props are the same object, so a constant for triggers that discard 7936 // them keeps those triggers from re-rendering when the props change. 7937 appliedTriggerProps: (state, apply) => apply ? state.activeTriggerProps : void 0, 7938 closeDelay: (state) => state.closeDelay, 7939 adaptiveOrigin: (state) => state.adaptiveOrigin 7940 }; 7941 var TooltipStore = class extends ReactStore { 7942 constructor(initialState2, floatingId, nested) { 7943 const triggerElements = new PopupTriggerMap(); 7944 super(createInitialState(initialState2, triggerElements, floatingId, nested), createInitialContext(triggerElements), selectors2); 7945 } 7946 setOpen = (nextOpen, eventDetails) => { 7947 applyPopupOpenChange(this, nextOpen, eventDetails, { 7948 extraState: { 7949 openChangeReason: eventDetails.reason 7950 } 7951 }); 7952 }; 7953 // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change. 7954 cancelPendingOpen(event) { 7955 this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event)); 7956 } 7957 }; 7958 function createNullTooltipStore() { 7959 const triggerElements = new PopupTriggerMap(); 7960 const store2 = new NullStore(Object.freeze(createInitialState(void 0, triggerElements)), Object.freeze(createInitialContext(triggerElements)), selectors2); 7961 return Object.assign(store2, { 7962 setOpen: NOOP, 7963 cancelPendingOpen: NOOP 7964 }); 7965 } 7966 function createInitialState(initialState2, triggerElements, floatingId, nested = false) { 7967 const state = { 7968 ...createInitialPopupStoreState(triggerElements, floatingId, nested), 7969 disabled: false, 7970 instantType: void 0, 7971 isInstantPhase: false, 7972 trackCursorAxis: "none", 7973 disableHoverablePopup: false, 7974 openChangeReason: null, 7975 closeOnClick: true, 7976 closeDelay: 0, 7977 adaptiveOrigin: void 0, 7978 ...initialState2 7979 }; 7980 return state; 7981 } 7982 function createInitialContext(triggerElements) { 7983 return { 7984 popupRef: /* @__PURE__ */ React37.createRef(), 7985 onOpenChange: void 0, 7986 onOpenChangeComplete: void 0, 7987 triggerElements 7988 }; 7989 } 7990 7991 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/root/TooltipRoot.mjs 7992 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); 7993 var TooltipRoot = fastComponent(function TooltipRoot2(props) { 7994 const { 7995 disabled: disabled2 = false, 7996 defaultOpen = false, 7997 open: openProp, 7998 disableHoverablePopup = false, 7999 trackCursorAxis = "none", 8000 actionsRef, 8001 onOpenChange, 8002 onOpenChangeComplete, 8003 handle, 8004 triggerId: triggerIdProp, 8005 defaultTriggerId: defaultTriggerIdProp = null, 8006 children 8007 } = props; 8008 const store2 = usePopupRootStore((floatingId, nested) => new TooltipStore({ 8009 open: defaultOpen, 8010 openProp, 8011 activeTriggerId: defaultTriggerIdProp, 8012 triggerIdProp 8013 }, floatingId, nested)); 8014 store2.useControlledProp("openProp", openProp); 8015 store2.useControlledProp("triggerIdProp", triggerIdProp); 8016 store2.useContextCallback("onOpenChange", onOpenChange); 8017 store2.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); 8018 const openState = store2.useState("open"); 8019 const open2 = !disabled2 && openState; 8020 const activeTriggerId = store2.useState("activeTriggerId"); 8021 const mounted = store2.useState("mounted"); 8022 const payload = store2.useState("payload"); 8023 store2.useSyncedValues({ 8024 trackCursorAxis, 8025 disableHoverablePopup, 8026 disabled: disabled2 8027 }); 8028 useImplicitActiveTrigger(store2, { 8029 closeOnActiveTriggerUnmount: true 8030 }); 8031 const { 8032 forceUnmount, 8033 transitionStatus 8034 } = useOpenStateTransitions(open2, store2); 8035 const isInstantPhase = store2.useState("isInstantPhase"); 8036 const instantType = store2.useState("instantType"); 8037 const lastOpenChangeReason = store2.useState("lastOpenChangeReason"); 8038 const previousInstantTypeRef = React38.useRef(null); 8039 useIsoLayoutEffect(() => { 8040 if (openState && disabled2) { 8041 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled)); 8042 } 8043 }, [openState, disabled2, store2]); 8044 useIsoLayoutEffect(() => { 8045 if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) { 8046 if (instantType !== "delay") { 8047 previousInstantTypeRef.current = instantType; 8048 } 8049 store2.set("instantType", "delay"); 8050 } else if (previousInstantTypeRef.current !== null) { 8051 store2.set("instantType", previousInstantTypeRef.current); 8052 previousInstantTypeRef.current = null; 8053 } 8054 }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store2]); 8055 useIsoLayoutEffect(() => { 8056 if (open2) { 8057 if (activeTriggerId == null) { 8058 store2.set("payload", void 0); 8059 } 8060 } 8061 }, [store2, activeTriggerId, open2]); 8062 React38.useImperativeHandle(actionsRef, () => ({ 8063 unmount: forceUnmount, 8064 close: () => store2.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)) 8065 }), [forceUnmount, store2]); 8066 const shouldRenderInteractions = open2 || mounted || !disabled2 && trackCursorAxis !== "none"; 8067 return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(TooltipRootContext.Provider, { 8068 value: store2, 8069 children: [handle && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(PopupHandleAttachment, { 8070 handle, 8071 store: store2 8072 }), shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipInteractions, { 8073 store: store2, 8074 disabled: disabled2, 8075 trackCursorAxis 8076 }), typeof children === "function" ? children({ 8077 payload 8078 }) : children] 8079 }); 8080 }); 8081 if (true) TooltipRoot.displayName = "TooltipRoot"; 8082 function TooltipInteractions({ 8083 store: store2, 8084 disabled: disabled2, 8085 trackCursorAxis 8086 }) { 8087 const floatingRootContext = store2.useState("floatingRootContext"); 8088 const dismiss = useDismiss(floatingRootContext, { 8089 enabled: !disabled2, 8090 referencePress: () => store2.select("closeOnClick") 8091 }); 8092 const clientPoint = useClientPoint(floatingRootContext, { 8093 enabled: !disabled2 && trackCursorAxis !== "none", 8094 axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis 8095 }); 8096 const triggerProps = React38.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]); 8097 usePopupInteractionProps(store2, { 8098 activeTriggerProps: triggerProps, 8099 inactiveTriggerProps: triggerProps, 8100 popupProps: dismiss.floating ?? EMPTY_OBJECT 8101 }); 8102 return null; 8103 } 8104 8105 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs 8106 var React40 = __toESM(require_react(), 1); 8107 8108 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/provider/TooltipProviderContext.mjs 8109 var React39 = __toESM(require_react(), 1); 8110 var TooltipProviderContext = /* @__PURE__ */ React39.createContext(void 0); 8111 if (true) TooltipProviderContext.displayName = "TooltipProviderContext"; 8112 function useTooltipProviderContext() { 8113 return React39.useContext(TooltipProviderContext); 8114 } 8115 8116 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/utils/constants.mjs 8117 var OPEN_DELAY = 600; 8118 8119 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/trigger/TooltipTrigger.mjs 8120 var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger"; 8121 function getTargetElement(event) { 8122 const target = getTarget(event); 8123 return isElement(target) ? target : null; 8124 } 8125 var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) { 8126 const { 8127 render, 8128 className, 8129 style, 8130 handle, 8131 payload, 8132 disabled: disabledProp, 8133 delay, 8134 closeOnClick = true, 8135 closeDelay, 8136 id: idProp, 8137 ...elementProps 8138 } = componentProps; 8139 const rootContext = useTooltipRootContext(true); 8140 const handleStore = usePopupHandleStore(handle); 8141 const store2 = handleStore ?? rootContext; 8142 if (!store2) { 8143 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)); 8144 } 8145 const thisTriggerId = useBaseUiId(idProp); 8146 const isTriggerActive = store2.useState("isTriggerActive", thisTriggerId); 8147 const isOpenedByThisTrigger = store2.useState("isOpenedByTrigger", thisTriggerId); 8148 const floatingRootContext = store2.useState("floatingRootContext"); 8149 const triggerElementRef = React40.useRef(null); 8150 const closeDelayWithDefault = closeDelay ?? 0; 8151 const { 8152 registerTrigger, 8153 isMountedByThisTrigger 8154 } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store2, { 8155 payload, 8156 closeOnClick, 8157 closeDelay: closeDelayWithDefault 8158 }); 8159 const providerDelay = useTooltipProviderContext(); 8160 const { 8161 activeIdRef, 8162 delayRef, 8163 isInstantPhase, 8164 hasProvider 8165 } = useDelayGroup(floatingRootContext, { 8166 open: isOpenedByThisTrigger 8167 }); 8168 const hoverInteraction = useHoverInteractionSharedState(floatingRootContext); 8169 store2.useSyncedValue("isInstantPhase", isInstantPhase); 8170 const rootDisabled = store2.useState("disabled"); 8171 const disabled2 = disabledProp ?? rootDisabled; 8172 const disabledRef = useValueAsRef(disabled2); 8173 const trackCursorAxis = store2.useState("trackCursorAxis"); 8174 const disableHoverablePopup = store2.useState("disableHoverablePopup"); 8175 const isNestedTriggerHoveredRef = React40.useRef(false); 8176 const nestedTriggerOpenTimeout = useTimeout(); 8177 const pointerTypeRef = React40.useRef(void 0); 8178 function getOpenDelay() { 8179 if (hasProvider && activeIdRef.current != null) { 8180 return 0; 8181 } 8182 return delay ?? providerDelay ?? OPEN_DELAY; 8183 } 8184 function isEnabledNestedTriggerTarget(target) { 8185 const triggerEl = triggerElementRef.current; 8186 if (!triggerEl || !target) { 8187 return false; 8188 } 8189 const nearestTrigger = closest(target, `[$TOOLTIP_TRIGGER_IDENTIFIER}]`); 8190 return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger); 8191 } 8192 function detectNestedTriggerHover(target) { 8193 const nestedTriggerHovered = isEnabledNestedTriggerTarget(target); 8194 isNestedTriggerHoveredRef.current = nestedTriggerHovered; 8195 if (nestedTriggerHovered) { 8196 hoverInteraction.openChangeTimeout.clear(); 8197 hoverInteraction.restTimeout.clear(); 8198 hoverInteraction.restTimeoutPending = false; 8199 nestedTriggerOpenTimeout.clear(); 8200 } 8201 return nestedTriggerHovered; 8202 } 8203 const hoverProps = useHoverReferenceInteraction(floatingRootContext, { 8204 enabled: !disabled2, 8205 mouseOnly: true, 8206 move: false, 8207 handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null, 8208 restMs: getOpenDelay, 8209 delay() { 8210 if (closeDelay == null && hasProvider) { 8211 return { 8212 close: getDelay(delayRef.current, "close") 8213 }; 8214 } 8215 return { 8216 close: closeDelayWithDefault 8217 }; 8218 }, 8219 triggerElementRef, 8220 isActiveTrigger: isTriggerActive, 8221 isClosing: () => store2.select("transitionStatus") === "ending", 8222 shouldOpen() { 8223 return !isNestedTriggerHoveredRef.current; 8224 } 8225 }); 8226 const focusProps = useFocus(floatingRootContext, { 8227 enabled: !disabled2 8228 }).reference; 8229 const handleNestedTriggerHover = (event) => { 8230 const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current; 8231 const target = getTargetElement(event); 8232 const nestedTriggerHovered = detectNestedTriggerHover(target); 8233 const triggerEl = triggerElementRef.current; 8234 const targetInsideTrigger = triggerEl && target && contains(triggerEl, target); 8235 if (nestedTriggerHovered && store2.select("open") && store2.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) { 8236 store2.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 8237 return; 8238 } 8239 if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store2.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences. 8240 isMouseLikePointerType(pointerTypeRef.current)) { 8241 const open2 = () => { 8242 if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store2.select("open")) { 8243 store2.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl)); 8244 } 8245 }; 8246 const openDelay = getOpenDelay(); 8247 if (openDelay === 0) { 8248 nestedTriggerOpenTimeout.clear(); 8249 open2(); 8250 } else { 8251 nestedTriggerOpenTimeout.start(openDelay, open2); 8252 } 8253 } 8254 }; 8255 const rootTriggerProps = store2.useState("appliedTriggerProps", isMountedByThisTrigger || trackCursorAxis !== "none"); 8256 const state = { 8257 open: isOpenedByThisTrigger 8258 }; 8259 const element = useRenderElement("button", componentProps, { 8260 state, 8261 ref: [forwardedRef, registerTrigger, triggerElementRef], 8262 props: [hoverProps, focusProps, rootTriggerProps, { 8263 onMouseOver(event) { 8264 handleNestedTriggerHover(event.nativeEvent); 8265 }, 8266 onFocus(event) { 8267 if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) { 8268 event.preventBaseUIHandler(); 8269 } 8270 }, 8271 onMouseLeave() { 8272 isNestedTriggerHoveredRef.current = false; 8273 nestedTriggerOpenTimeout.clear(); 8274 pointerTypeRef.current = void 0; 8275 }, 8276 onPointerEnter(event) { 8277 pointerTypeRef.current = event.pointerType; 8278 }, 8279 onPointerDown(event) { 8280 pointerTypeRef.current = event.pointerType; 8281 store2.set("closeOnClick", closeOnClick); 8282 if (closeOnClick && !store2.select("open")) { 8283 store2.cancelPendingOpen(event.nativeEvent); 8284 } 8285 }, 8286 onClick(event) { 8287 if (closeOnClick && !store2.select("open")) { 8288 store2.cancelPendingOpen(event.nativeEvent); 8289 } 8290 }, 8291 id: thisTriggerId, 8292 [triggerDisabled]: disabled2 ? "" : void 0, 8293 [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : "" 8294 }, elementProps], 8295 stateAttributesMapping: triggerOpenStateMapping 8296 }); 8297 return element; 8298 }); 8299 if (true) TooltipTrigger.displayName = "TooltipTrigger"; 8300 8301 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs 8302 var React42 = __toESM(require_react(), 1); 8303 8304 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortalContext.mjs 8305 var React41 = __toESM(require_react(), 1); 8306 var TooltipPortalContext = /* @__PURE__ */ React41.createContext(void 0); 8307 if (true) TooltipPortalContext.displayName = "TooltipPortalContext"; 8308 function useTooltipPortalContext() { 8309 const value = React41.useContext(TooltipPortalContext); 8310 if (value === void 0) { 8311 throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70)); 8312 } 8313 return value; 8314 } 8315 8316 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/portal/TooltipPortal.mjs 8317 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); 8318 var TooltipPortal = /* @__PURE__ */ React42.forwardRef(function TooltipPortal2(props, forwardedRef) { 8319 const { 8320 keepMounted = false, 8321 ...portalProps 8322 } = props; 8323 const store2 = useTooltipRootContext(); 8324 const mounted = store2.useState("mounted"); 8325 const shouldRender = mounted || keepMounted; 8326 if (!shouldRender) { 8327 return null; 8328 } 8329 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipPortalContext.Provider, { 8330 value: keepMounted, 8331 children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FloatingPortalLite, { 8332 ref: forwardedRef, 8333 ...portalProps 8334 }) 8335 }); 8336 }); 8337 if (true) TooltipPortal.displayName = "TooltipPortal"; 8338 8339 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs 8340 var React44 = __toESM(require_react(), 1); 8341 8342 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositionerContext.mjs 8343 var React43 = __toESM(require_react(), 1); 8344 var TooltipPositionerContext = /* @__PURE__ */ React43.createContext(void 0); 8345 if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext"; 8346 function useTooltipPositionerContext() { 8347 const context = React43.useContext(TooltipPositionerContext); 8348 if (context === void 0) { 8349 throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71)); 8350 } 8351 return context; 8352 } 8353 8354 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/positioner/TooltipPositioner.mjs 8355 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); 8356 var TooltipPositioner = /* @__PURE__ */ React44.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { 8357 const { 8358 render, 8359 className, 8360 anchor, 8361 positionMethod = "absolute", 8362 side = "top", 8363 align = "center", 8364 sideOffset = 0, 8365 alignOffset = 0, 8366 collisionBoundary = "clipping-ancestors", 8367 collisionPadding = 5, 8368 arrowPadding = 5, 8369 sticky = false, 8370 disableAnchorTracking = false, 8371 collisionAvoidance = POPUP_COLLISION_AVOIDANCE, 8372 style, 8373 ...elementProps 8374 } = componentProps; 8375 const store2 = useTooltipRootContext(); 8376 const keepMounted = useTooltipPortalContext(); 8377 const open2 = store2.useState("open"); 8378 const mounted = store2.useState("mounted"); 8379 const trackCursorAxis = store2.useState("trackCursorAxis"); 8380 const disableHoverablePopup = store2.useState("disableHoverablePopup"); 8381 const floatingRootContext = store2.useState("floatingRootContext"); 8382 const instantType = store2.useState("instantType"); 8383 const transitionStatus = store2.useState("transitionStatus"); 8384 const adaptiveOrigin2 = store2.useState("adaptiveOrigin"); 8385 const positioning = useAnchorPositioning({ 8386 anchor, 8387 positionMethod, 8388 floatingRootContext, 8389 mounted, 8390 side, 8391 sideOffset, 8392 align, 8393 alignOffset, 8394 collisionBoundary, 8395 collisionPadding, 8396 sticky, 8397 arrowPadding, 8398 disableAnchorTracking, 8399 keepMounted, 8400 collisionAvoidance, 8401 adaptiveOrigin: adaptiveOrigin2 8402 }); 8403 const state = React44.useMemo(() => ({ 8404 open: open2, 8405 side: positioning.side, 8406 align: positioning.align, 8407 anchorHidden: positioning.anchorHidden, 8408 instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType 8409 }), [open2, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); 8410 const element = usePositioner(componentProps, state, { 8411 styles: positioning.positionerStyles, 8412 transitionStatus, 8413 props: elementProps, 8414 refs: [forwardedRef, store2.useStateSetter("positionerElement")], 8415 hidden: !mounted, 8416 inert: !open2 || trackCursorAxis === "both" || disableHoverablePopup 8417 }); 8418 return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(TooltipPositionerContext.Provider, { 8419 value: positioning, 8420 children: element 8421 }); 8422 }); 8423 if (true) TooltipPositioner.displayName = "TooltipPositioner"; 8424 8425 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/popup/TooltipPopup.mjs 8426 var React45 = __toESM(require_react(), 1); 8427 var TooltipPopup = /* @__PURE__ */ React45.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { 8428 const { 8429 render, 8430 className, 8431 style, 8432 ...elementProps 8433 } = componentProps; 8434 const store2 = useTooltipRootContext(); 8435 const { 8436 side, 8437 align 8438 } = useTooltipPositionerContext(); 8439 const open2 = store2.useState("open"); 8440 const instantType = store2.useState("instantType"); 8441 const transitionStatus = store2.useState("transitionStatus"); 8442 const popupProps = store2.useState("popupProps"); 8443 const floatingContext = store2.useState("floatingRootContext"); 8444 const disabled2 = store2.useState("disabled"); 8445 const closeDelay = store2.useState("closeDelay"); 8446 useOpenChangeComplete({ 8447 open: open2, 8448 ref: store2.context.popupRef, 8449 onComplete() { 8450 if (open2) { 8451 store2.context.onOpenChangeComplete?.(true); 8452 } 8453 } 8454 }); 8455 useHoverFloatingInteraction(floatingContext, { 8456 enabled: !disabled2, 8457 closeDelay 8458 }); 8459 const setPopupElement = store2.useStateSetter("popupElement"); 8460 const state = { 8461 open: open2, 8462 side, 8463 align, 8464 instant: instantType, 8465 transitionStatus 8466 }; 8467 const element = useRenderElement("div", componentProps, { 8468 state, 8469 ref: [forwardedRef, store2.context.popupRef, setPopupElement], 8470 props: [FOCUSABLE_POPUP_PROPS, popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], 8471 stateAttributesMapping: popupTransitionStateMapping 8472 }); 8473 return element; 8474 }); 8475 if (true) TooltipPopup.displayName = "TooltipPopup"; 8476 8477 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/arrow/TooltipArrow.mjs 8478 var React46 = __toESM(require_react(), 1); 8479 var TooltipArrow = /* @__PURE__ */ React46.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { 8480 const { 8481 render, 8482 className, 8483 style, 8484 ...elementProps 8485 } = componentProps; 8486 const store2 = useTooltipRootContext(); 8487 const { 8488 arrowRef, 8489 side, 8490 align, 8491 arrowUncentered, 8492 arrowStyles 8493 } = useTooltipPositionerContext(); 8494 const open2 = store2.useState("open"); 8495 const instantType = store2.useState("instantType"); 8496 const state = { 8497 open: open2, 8498 side, 8499 align, 8500 uncentered: arrowUncentered, 8501 instant: instantType 8502 }; 8503 const element = useRenderElement("div", componentProps, { 8504 state, 8505 ref: [forwardedRef, arrowRef], 8506 props: [{ 8507 style: arrowStyles, 8508 "aria-hidden": true 8509 }, elementProps], 8510 stateAttributesMapping: popupStateMapping 8511 }); 8512 return element; 8513 }); 8514 if (true) TooltipArrow.displayName = "TooltipArrow"; 8515 8516 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/provider/TooltipProvider.mjs 8517 var React47 = __toESM(require_react(), 1); 8518 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); 8519 var TooltipProvider = function TooltipProvider2(props) { 8520 const { 8521 delay, 8522 closeDelay, 8523 timeout = 400 8524 } = props; 8525 const delayValue = React47.useMemo(() => ({ 8526 open: delay, 8527 close: closeDelay 8528 }), [delay, closeDelay]); 8529 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(TooltipProviderContext.Provider, { 8530 value: delay, 8531 children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(FloatingDelayGroup, { 8532 delay: delayValue, 8533 timeoutMs: timeout, 8534 children: props.children 8535 }) 8536 }); 8537 }; 8538 if (true) TooltipProvider.displayName = "TooltipProvider"; 8539 8540 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/viewport/TooltipViewport.mjs 8541 var React48 = __toESM(require_react(), 1); 8542 var TooltipViewport = /* @__PURE__ */ React48.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { 8543 const { 8544 render, 8545 className, 8546 style, 8547 children, 8548 ...elementProps 8549 } = componentProps; 8550 const store2 = useTooltipRootContext(); 8551 const positioner = useTooltipPositionerContext(); 8552 const instantType = store2.useState("instantType"); 8553 const { 8554 children: childrenToRender, 8555 state: viewportState 8556 } = usePopupViewport({ 8557 store: store2, 8558 side: positioner.side, 8559 children 8560 }); 8561 const state = { 8562 activationDirection: viewportState.activationDirection, 8563 transitioning: viewportState.transitioning, 8564 instant: instantType 8565 }; 8566 return useRenderElement("div", componentProps, { 8567 state, 8568 ref: forwardedRef, 8569 props: [elementProps, { 8570 children: childrenToRender 8571 }], 8572 stateAttributesMapping: popupViewportStateMapping 8573 }); 8574 }); 8575 if (true) TooltipViewport.displayName = "TooltipViewport"; 8576 8577 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/tooltip/store/TooltipHandle.mjs 8578 var TooltipHandle = class extends BasePopupHandle { 8579 constructor() { 8580 super(createNullTooltipStore(), "Tooltip"); 8581 } 8582 /** 8583 * Opens the tooltip and associates it with the trigger with the given id. 8584 * 8585 * This method should only be called in an event handler or an effect (not during rendering). 8586 * 8587 * @param triggerId ID of the trigger to associate with the tooltip. The trigger must be a matching 8588 * `Tooltip.Trigger` with this handle passed as a prop. 8589 */ 8590 open(triggerId) { 8591 this.openByTrigger(triggerId); 8592 } 8593 /** 8594 * Closes the tooltip. 8595 * 8596 * This method should only be called in an event handler or an effect (not during rendering). 8597 */ 8598 close() { 8599 this.closePopup(); 8600 } 8601 /** 8602 * Whether the tooltip is currently open. Returns `false` while no root is attached to the handle. 8603 */ 8604 get isOpen() { 8605 return this.attachedStore?.select("open") ?? false; 8606 } 8607 }; 8608 function createTooltipHandle() { 8609 return new TooltipHandle(); 8610 } 8611 8612 // node_modules/.store/@base-ui/react@1.9.0-uHNeM94OdjIeOtpyYGvL0A/node_modules/@base-ui/react/use-render/useRender.mjs 8613 function useRender(params) { 8614 return useRenderElement(params.defaultTagName ?? "div", params, params); 8615 } 8616 8617 // packages/ui/build-module/text/text.mjs 8618 var import_element11 = __toESM(require_element(), 1); 8619 var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; 8620 function getRuntime() { 8621 const globalScope = globalThis; 8622 if (globalScope.__wpStyleRuntime) { 8623 return globalScope.__wpStyleRuntime; 8624 } 8625 globalScope.__wpStyleRuntime = { 8626 documents: /* @__PURE__ */ new Map(), 8627 styles: /* @__PURE__ */ new Map(), 8628 injectedStyles: /* @__PURE__ */ new WeakMap() 8629 }; 8630 if (typeof document !== "undefined") { 8631 registerDocument(document); 8632 } 8633 return globalScope.__wpStyleRuntime; 8634 } 8635 function documentContainsStyleHash(targetDocument, hash) { 8636 if (!targetDocument.head) { 8637 return false; 8638 } 8639 for (const style of targetDocument.head.querySelectorAll( 8640 `style[$STYLE_HASH_ATTRIBUTE}]` 8641 )) { 8642 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { 8643 return true; 8644 } 8645 } 8646 return false; 8647 } 8648 function injectStyle(targetDocument, hash, css) { 8649 if (!targetDocument.head) { 8650 return; 8651 } 8652 const runtime = getRuntime(); 8653 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8654 if (!injectedStyles) { 8655 injectedStyles = /* @__PURE__ */ new Set(); 8656 runtime.injectedStyles.set(targetDocument, injectedStyles); 8657 } 8658 if (injectedStyles.has(hash)) { 8659 return; 8660 } 8661 if (documentContainsStyleHash(targetDocument, hash)) { 8662 injectedStyles.add(hash); 8663 return; 8664 } 8665 const style = targetDocument.createElement("style"); 8666 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); 8667 style.appendChild(targetDocument.createTextNode(css)); 8668 targetDocument.head.appendChild(style); 8669 injectedStyles.add(hash); 8670 } 8671 function registerDocument(targetDocument) { 8672 const runtime = getRuntime(); 8673 runtime.documents.set( 8674 targetDocument, 8675 (runtime.documents.get(targetDocument) ?? 0) + 1 8676 ); 8677 for (const [hash, css] of runtime.styles) { 8678 injectStyle(targetDocument, hash, css); 8679 } 8680 return () => { 8681 const count = runtime.documents.get(targetDocument); 8682 if (count === void 0) { 8683 return; 8684 } 8685 if (count <= 1) { 8686 runtime.documents.delete(targetDocument); 8687 return; 8688 } 8689 runtime.documents.set(targetDocument, count - 1); 8690 }; 8691 } 8692 function registerStyle(hash, css) { 8693 const runtime = getRuntime(); 8694 runtime.styles.set(hash, css); 8695 for (const targetDocument of runtime.documents.keys()) { 8696 injectStyle(targetDocument, hash, css); 8697 } 8698 } 8699 if (typeof process === "undefined" || true) { 8700 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)}}}'); 8701 } 8702 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" }; 8703 if (typeof process === "undefined" || true) { 8704 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)}"); 8705 } 8706 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" }; 8707 var Text = (0, import_element11.forwardRef)( 8708 function UnforwardedText({ variant = "body-md", render, className, ...props }, ref) { 8709 const element = useRender({ 8710 render, 8711 defaultTagName: "span", 8712 ref, 8713 props: mergeProps(props, { 8714 className: clsx_default( 8715 style_default.text, 8716 global_css_defense_default.heading, 8717 global_css_defense_default.p, 8718 style_default[variant], 8719 className 8720 ) 8721 }) 8722 }); 8723 return element; 8724 } 8725 ); 8726 8727 // packages/icons/build-module/library/caution.mjs 8728 var import_primitives2 = __toESM(require_primitives(), 1); 8729 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); 8730 var caution_default = /* @__PURE__ */ (0, import_jsx_runtime13.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_runtime13.jsx)(import_primitives2.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" }) }); 8731 8732 // packages/icons/build-module/library/check.mjs 8733 var import_primitives3 = __toESM(require_primitives(), 1); 8734 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); 8735 var check_default = /* @__PURE__ */ (0, import_jsx_runtime14.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_runtime14.jsx)(import_primitives3.Path, { d: "M7 12L10 15L17 8" }) }); 8736 8737 // packages/icons/build-module/library/chevron-down-small.mjs 8738 var import_primitives4 = __toESM(require_primitives(), 1); 8739 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); 8740 var chevron_down_small_default = /* @__PURE__ */ (0, import_jsx_runtime15.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_runtime15.jsx)(import_primitives4.Path, { d: "M8.5 10.5L12 13.5L15.5 10.5" }) }); 8741 8742 // packages/icons/build-module/library/chevron-left-small.mjs 8743 var import_primitives5 = __toESM(require_primitives(), 1); 8744 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); 8745 var chevron_left_small_default = /* @__PURE__ */ (0, import_jsx_runtime16.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_runtime16.jsx)(import_primitives5.Path, { d: "M13.5 8.5L10.5 12L13.5 15.5" }) }); 8746 8747 // packages/icons/build-module/library/chevron-left.mjs 8748 var import_primitives6 = __toESM(require_primitives(), 1); 8749 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); 8750 var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime17.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_runtime17.jsx)(import_primitives6.Path, { d: "M14 6.5L9 12L14 17.5" }) }); 8751 8752 // packages/icons/build-module/library/chevron-right-small.mjs 8753 var import_primitives7 = __toESM(require_primitives(), 1); 8754 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); 8755 var chevron_right_small_default = /* @__PURE__ */ (0, import_jsx_runtime18.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_runtime18.jsx)(import_primitives7.Path, { d: "M10.5 8.5L13.5 12L10.5 15.5" }) }); 8756 8757 // packages/icons/build-module/library/chevron-right.mjs 8758 var import_primitives8 = __toESM(require_primitives(), 1); 8759 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); 8760 var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime19.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_runtime19.jsx)(import_primitives8.Path, { d: "M10 6.5L15 12L10 17.5" }) }); 8761 8762 // packages/icons/build-module/library/menu.mjs 8763 var import_primitives9 = __toESM(require_primitives(), 1); 8764 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); 8765 var menu_default = /* @__PURE__ */ (0, import_jsx_runtime20.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_runtime20.jsx)(import_primitives9.Path, { d: "M5 12H19M5 18.25H19M5 5.75H19" }) }); 8766 8767 // packages/ui/build-module/utils/keyboard-shortcut.mjs 8768 var import_element13 = __toESM(require_element(), 1); 8769 var import_i18n = __toESM(require_i18n(), 1); 8770 8771 // packages/ui/build-module/visually-hidden/visually-hidden.mjs 8772 var import_element12 = __toESM(require_element(), 1); 8773 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; 8774 function getRuntime2() { 8775 const globalScope = globalThis; 8776 if (globalScope.__wpStyleRuntime) { 8777 return globalScope.__wpStyleRuntime; 8778 } 8779 globalScope.__wpStyleRuntime = { 8780 documents: /* @__PURE__ */ new Map(), 8781 styles: /* @__PURE__ */ new Map(), 8782 injectedStyles: /* @__PURE__ */ new WeakMap() 8783 }; 8784 if (typeof document !== "undefined") { 8785 registerDocument2(document); 8786 } 8787 return globalScope.__wpStyleRuntime; 8788 } 8789 function documentContainsStyleHash2(targetDocument, hash) { 8790 if (!targetDocument.head) { 8791 return false; 8792 } 8793 for (const style of targetDocument.head.querySelectorAll( 8794 `style[$STYLE_HASH_ATTRIBUTE2}]` 8795 )) { 8796 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { 8797 return true; 8798 } 8799 } 8800 return false; 8801 } 8802 function injectStyle2(targetDocument, hash, css) { 8803 if (!targetDocument.head) { 8804 return; 8805 } 8806 const runtime = getRuntime2(); 8807 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8808 if (!injectedStyles) { 8809 injectedStyles = /* @__PURE__ */ new Set(); 8810 runtime.injectedStyles.set(targetDocument, injectedStyles); 8811 } 8812 if (injectedStyles.has(hash)) { 8813 return; 8814 } 8815 if (documentContainsStyleHash2(targetDocument, hash)) { 8816 injectedStyles.add(hash); 8817 return; 8818 } 8819 const style = targetDocument.createElement("style"); 8820 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); 8821 style.appendChild(targetDocument.createTextNode(css)); 8822 targetDocument.head.appendChild(style); 8823 injectedStyles.add(hash); 8824 } 8825 function registerDocument2(targetDocument) { 8826 const runtime = getRuntime2(); 8827 runtime.documents.set( 8828 targetDocument, 8829 (runtime.documents.get(targetDocument) ?? 0) + 1 8830 ); 8831 for (const [hash, css] of runtime.styles) { 8832 injectStyle2(targetDocument, hash, css); 8833 } 8834 return () => { 8835 const count = runtime.documents.get(targetDocument); 8836 if (count === void 0) { 8837 return; 8838 } 8839 if (count <= 1) { 8840 runtime.documents.delete(targetDocument); 8841 return; 8842 } 8843 runtime.documents.set(targetDocument, count - 1); 8844 }; 8845 } 8846 function registerStyle2(hash, css) { 8847 const runtime = getRuntime2(); 8848 runtime.styles.set(hash, css); 8849 for (const targetDocument of runtime.documents.keys()) { 8850 injectStyle2(targetDocument, hash, css); 8851 } 8852 } 8853 if (typeof process === "undefined" || true) { 8854 registerStyle2("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}"); 8855 } 8856 var style_default2 = { "visually-hidden": "f37b9e2e191ebd66__visually-hidden" }; 8857 var VisuallyHidden = (0, import_element12.forwardRef)( 8858 function UnforwardedVisuallyHidden({ render, ...restProps }, ref) { 8859 const element = useRender({ 8860 render, 8861 ref, 8862 props: mergeProps( 8863 { className: style_default2["visually-hidden"] }, 8864 restProps, 8865 { 8866 // @ts-expect-error Arbitrary data-* attributes aren't indexable on the typed div props. Kept hardcoded so consumers can't change or remove it. 8867 "data-visually-hidden": "" 8868 } 8869 ) 8870 }); 8871 return element; 8872 } 8873 ); 8874 8875 // packages/ui/build-module/utils/keyboard-shortcut.mjs 8876 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); 8877 function useKeyboardShortcutProps({ 8878 "aria-describedby": ariaDescribedBy, 8879 "aria-keyshortcuts": ariaKeyShortcuts, 8880 shortcut 8881 }) { 8882 const generatedDescriptionId = (0, import_element13.useId)(); 8883 const descriptionId = shortcut ? generatedDescriptionId : void 0; 8884 const describedBy = [ariaDescribedBy, descriptionId].filter(Boolean).join(" "); 8885 return { 8886 descriptionId, 8887 targetProps: { 8888 "aria-describedby": describedBy || void 0, 8889 "aria-keyshortcuts": shortcut?.ariaKeyShortcut ?? ariaKeyShortcuts 8890 } 8891 }; 8892 } 8893 var KeyboardShortcutDescription = (0, import_element13.forwardRef)(function UnforwardedKeyboardShortcutDescription({ descriptionId, shortcut }, ref) { 8894 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)( 8895 VisuallyHidden, 8896 { 8897 id: descriptionId, 8898 "aria-hidden": "true", 8899 render: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ref }), 8900 children: (0, import_i18n.sprintf)( 8901 /* translators: %s: keyboard shortcut. */ 8902 (0, import_i18n.__)("Keyboard shortcut: %s"), 8903 shortcut.label ?? shortcut.ariaKeyShortcut 8904 ) 8905 } 8906 ); 8907 }); 8908 var KeyboardShortcutDisplay = (0, import_element13.forwardRef)(function UnforwardedKeyboardShortcutDisplay({ className, shortcut }, ref) { 8909 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)("span", { ref, "aria-hidden": "true", className, dir: "ltr", children: shortcut.displayShortcut }); 8910 }); 8911 8912 // packages/ui/build-module/utils/render-slot-with-children.mjs 8913 var import_element14 = __toESM(require_element(), 1); 8914 function renderSlotWithChildren(slot, defaultSlot, children) { 8915 return (0, import_element14.cloneElement)( 8916 slot ?? defaultSlot, 8917 { children } 8918 ); 8919 } 8920 8921 // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs 8922 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; 8923 function getRuntime3() { 8924 const globalScope = globalThis; 8925 if (globalScope.__wpStyleRuntime) { 8926 return globalScope.__wpStyleRuntime; 8927 } 8928 globalScope.__wpStyleRuntime = { 8929 documents: /* @__PURE__ */ new Map(), 8930 styles: /* @__PURE__ */ new Map(), 8931 injectedStyles: /* @__PURE__ */ new WeakMap() 8932 }; 8933 if (typeof document !== "undefined") { 8934 registerDocument3(document); 8935 } 8936 return globalScope.__wpStyleRuntime; 8937 } 8938 function documentContainsStyleHash3(targetDocument, hash) { 8939 if (!targetDocument.head) { 8940 return false; 8941 } 8942 for (const style of targetDocument.head.querySelectorAll( 8943 `style[$STYLE_HASH_ATTRIBUTE3}]` 8944 )) { 8945 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) { 8946 return true; 8947 } 8948 } 8949 return false; 8950 } 8951 function injectStyle3(targetDocument, hash, css) { 8952 if (!targetDocument.head) { 8953 return; 8954 } 8955 const runtime = getRuntime3(); 8956 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8957 if (!injectedStyles) { 8958 injectedStyles = /* @__PURE__ */ new Set(); 8959 runtime.injectedStyles.set(targetDocument, injectedStyles); 8960 } 8961 if (injectedStyles.has(hash)) { 8962 return; 8963 } 8964 if (documentContainsStyleHash3(targetDocument, hash)) { 8965 injectedStyles.add(hash); 8966 return; 8967 } 8968 const style = targetDocument.createElement("style"); 8969 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash); 8970 style.appendChild(targetDocument.createTextNode(css)); 8971 targetDocument.head.appendChild(style); 8972 injectedStyles.add(hash); 8973 } 8974 function registerDocument3(targetDocument) { 8975 const runtime = getRuntime3(); 8976 runtime.documents.set( 8977 targetDocument, 8978 (runtime.documents.get(targetDocument) ?? 0) + 1 8979 ); 8980 for (const [hash, css] of runtime.styles) { 8981 injectStyle3(targetDocument, hash, css); 8982 } 8983 return () => { 8984 const count = runtime.documents.get(targetDocument); 8985 if (count === void 0) { 8986 return; 8987 } 8988 if (count <= 1) { 8989 runtime.documents.delete(targetDocument); 8990 return; 8991 } 8992 runtime.documents.set(targetDocument, count - 1); 8993 }; 8994 } 8995 function registerStyle3(hash, css) { 8996 const runtime = getRuntime3(); 8997 runtime.styles.set(hash, css); 8998 for (const targetDocument of runtime.documents.keys()) { 8999 injectStyle3(targetDocument, hash, css); 9000 } 9001 } 9002 if (typeof process === "undefined" || true) { 9003 registerStyle3("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}}}"); 9004 } 9005 var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" }; 9006 var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot"; 9007 function resolveOwnerDocument() { 9008 return typeof document === "undefined" ? null : document; 9009 } 9010 function isInWordPressEnvironment() { 9011 let topWp; 9012 try { 9013 topWp = window.top?.wp; 9014 } catch { 9015 } 9016 const wp = topWp ?? window.wp; 9017 return typeof wp?.components === "object" && wp.components !== null; 9018 } 9019 var cachedSlot = null; 9020 function ensureSlotIsAccessible(element) { 9021 element.setAttribute("aria-hidden", "false"); 9022 return element; 9023 } 9024 function createSlot(ownerDocument2) { 9025 const element = ownerDocument2.createElement("div"); 9026 element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, ""); 9027 if (wp_compat_overlay_slot_default.slot) { 9028 element.classList.add(wp_compat_overlay_slot_default.slot); 9029 } 9030 ownerDocument2.body.appendChild(element); 9031 return element; 9032 } 9033 function getWpCompatOverlaySlot() { 9034 if (typeof window === "undefined") { 9035 return void 0; 9036 } 9037 if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) { 9038 return void 0; 9039 } 9040 const ownerDocument2 = resolveOwnerDocument(); 9041 if (!ownerDocument2 || !ownerDocument2.body) { 9042 return void 0; 9043 } 9044 if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) { 9045 return ensureSlotIsAccessible(cachedSlot); 9046 } 9047 const existing = ownerDocument2.querySelector( 9048 `[$WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]` 9049 ); 9050 if (existing instanceof HTMLDivElement) { 9051 cachedSlot = ensureSlotIsAccessible(existing); 9052 return cachedSlot; 9053 } 9054 if (cachedSlot?.isConnected) { 9055 cachedSlot.remove(); 9056 } 9057 cachedSlot = ensureSlotIsAccessible(createSlot(ownerDocument2)); 9058 return cachedSlot; 9059 } 9060 9061 // packages/ui/build-module/utils/direction-provider.mjs 9062 var import_i18n2 = __toESM(require_i18n(), 1); 9063 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); 9064 function DirectionProvider3({ children }) { 9065 return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(DirectionProvider, { direction: (0, import_i18n2.isRTL)() ? "rtl" : "ltr", children }); 9066 } 9067 9068 // packages/ui/build-module/tooltip/index.mjs 9069 var tooltip_exports = {}; 9070 __export(tooltip_exports, { 9071 Popup: () => Popup, 9072 Portal: () => Portal, 9073 Positioner: () => Positioner, 9074 Provider: () => Provider, 9075 Root: () => Root, 9076 Trigger: () => Trigger 9077 }); 9078 9079 // packages/ui/build-module/tooltip/popup.mjs 9080 var import_element17 = __toESM(require_element(), 1); 9081 9082 // packages/ui/build-module/tooltip/portal.mjs 9083 var import_element15 = __toESM(require_element(), 1); 9084 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); 9085 var Portal = (0, import_element15.forwardRef)( 9086 function TooltipPortal3({ container, ...restProps }, ref) { 9087 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( 9088 index_parts_exports.Portal, 9089 { 9090 container: container === void 0 ? getWpCompatOverlaySlot() : container, 9091 ...restProps, 9092 ref 9093 } 9094 ); 9095 } 9096 ); 9097 9098 // packages/ui/build-module/tooltip/positioner.mjs 9099 var import_element16 = __toESM(require_element(), 1); 9100 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); 9101 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; 9102 function getRuntime4() { 9103 const globalScope = globalThis; 9104 if (globalScope.__wpStyleRuntime) { 9105 return globalScope.__wpStyleRuntime; 9106 } 9107 globalScope.__wpStyleRuntime = { 9108 documents: /* @__PURE__ */ new Map(), 9109 styles: /* @__PURE__ */ new Map(), 9110 injectedStyles: /* @__PURE__ */ new WeakMap() 9111 }; 9112 if (typeof document !== "undefined") { 9113 registerDocument4(document); 9114 } 9115 return globalScope.__wpStyleRuntime; 9116 } 9117 function documentContainsStyleHash4(targetDocument, hash) { 9118 if (!targetDocument.head) { 9119 return false; 9120 } 9121 for (const style of targetDocument.head.querySelectorAll( 9122 `style[$STYLE_HASH_ATTRIBUTE4}]` 9123 )) { 9124 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) { 9125 return true; 9126 } 9127 } 9128 return false; 9129 } 9130 function injectStyle4(targetDocument, hash, css) { 9131 if (!targetDocument.head) { 9132 return; 9133 } 9134 const runtime = getRuntime4(); 9135 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9136 if (!injectedStyles) { 9137 injectedStyles = /* @__PURE__ */ new Set(); 9138 runtime.injectedStyles.set(targetDocument, injectedStyles); 9139 } 9140 if (injectedStyles.has(hash)) { 9141 return; 9142 } 9143 if (documentContainsStyleHash4(targetDocument, hash)) { 9144 injectedStyles.add(hash); 9145 return; 9146 } 9147 const style = targetDocument.createElement("style"); 9148 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash); 9149 style.appendChild(targetDocument.createTextNode(css)); 9150 targetDocument.head.appendChild(style); 9151 injectedStyles.add(hash); 9152 } 9153 function registerDocument4(targetDocument) { 9154 const runtime = getRuntime4(); 9155 runtime.documents.set( 9156 targetDocument, 9157 (runtime.documents.get(targetDocument) ?? 0) + 1 9158 ); 9159 for (const [hash, css] of runtime.styles) { 9160 injectStyle4(targetDocument, hash, css); 9161 } 9162 return () => { 9163 const count = runtime.documents.get(targetDocument); 9164 if (count === void 0) { 9165 return; 9166 } 9167 if (count <= 1) { 9168 runtime.documents.delete(targetDocument); 9169 return; 9170 } 9171 runtime.documents.set(targetDocument, count - 1); 9172 }; 9173 } 9174 function registerStyle4(hash, css) { 9175 const runtime = getRuntime4(); 9176 runtime.styles.set(hash, css); 9177 for (const targetDocument of runtime.documents.keys()) { 9178 injectStyle4(targetDocument, hash, css); 9179 } 9180 } 9181 if (typeof process === "undefined" || true) { 9182 registerStyle4("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 9183 } 9184 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 9185 if (typeof process === "undefined" || true) { 9186 registerStyle4("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}}}}'); 9187 } 9188 var style_default3 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 9189 var Positioner = (0, import_element16.forwardRef)( 9190 function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { 9191 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 9192 index_parts_exports.Positioner, 9193 { 9194 ref, 9195 align, 9196 side, 9197 sideOffset, 9198 ...props, 9199 className: clsx_default( 9200 resets_default["box-sizing"], 9201 style_default3.positioner, 9202 className 9203 ) 9204 } 9205 ); 9206 } 9207 ); 9208 9209 // packages/ui/build-module/utils/theme-provider.mjs 9210 var theme = __toESM(require_theme(), 1); 9211 9212 // packages/ui/build-module/lock-unlock.mjs 9213 var import_private_apis = __toESM(require_private_apis(), 1); 9214 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 9215 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 9216 "@wordpress/ui" 9217 ); 9218 9219 // packages/ui/build-module/utils/theme-provider.mjs 9220 function getThemeProvider() { 9221 const themePackage = theme; 9222 if (themePackage.ThemeProvider) { 9223 return themePackage.ThemeProvider; 9224 } 9225 if (!themePackage.privateApis) { 9226 throw new Error( 9227 "@wordpress/ui: @wordpress/theme must expose `ThemeProvider` or `privateApis.ThemeProvider`." 9228 ); 9229 } 9230 return unlock( 9231 themePackage.privateApis 9232 ).ThemeProvider; 9233 } 9234 var ThemeProvider = getThemeProvider(); 9235 9236 // packages/ui/build-module/tooltip/popup.mjs 9237 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); 9238 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; 9239 function getRuntime5() { 9240 const globalScope = globalThis; 9241 if (globalScope.__wpStyleRuntime) { 9242 return globalScope.__wpStyleRuntime; 9243 } 9244 globalScope.__wpStyleRuntime = { 9245 documents: /* @__PURE__ */ new Map(), 9246 styles: /* @__PURE__ */ new Map(), 9247 injectedStyles: /* @__PURE__ */ new WeakMap() 9248 }; 9249 if (typeof document !== "undefined") { 9250 registerDocument5(document); 9251 } 9252 return globalScope.__wpStyleRuntime; 9253 } 9254 function documentContainsStyleHash5(targetDocument, hash) { 9255 if (!targetDocument.head) { 9256 return false; 9257 } 9258 for (const style of targetDocument.head.querySelectorAll( 9259 `style[$STYLE_HASH_ATTRIBUTE5}]` 9260 )) { 9261 if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) { 9262 return true; 9263 } 9264 } 9265 return false; 9266 } 9267 function injectStyle5(targetDocument, hash, css) { 9268 if (!targetDocument.head) { 9269 return; 9270 } 9271 const runtime = getRuntime5(); 9272 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9273 if (!injectedStyles) { 9274 injectedStyles = /* @__PURE__ */ new Set(); 9275 runtime.injectedStyles.set(targetDocument, injectedStyles); 9276 } 9277 if (injectedStyles.has(hash)) { 9278 return; 9279 } 9280 if (documentContainsStyleHash5(targetDocument, hash)) { 9281 injectedStyles.add(hash); 9282 return; 9283 } 9284 const style = targetDocument.createElement("style"); 9285 style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash); 9286 style.appendChild(targetDocument.createTextNode(css)); 9287 targetDocument.head.appendChild(style); 9288 injectedStyles.add(hash); 9289 } 9290 function registerDocument5(targetDocument) { 9291 const runtime = getRuntime5(); 9292 runtime.documents.set( 9293 targetDocument, 9294 (runtime.documents.get(targetDocument) ?? 0) + 1 9295 ); 9296 for (const [hash, css] of runtime.styles) { 9297 injectStyle5(targetDocument, hash, css); 9298 } 9299 return () => { 9300 const count = runtime.documents.get(targetDocument); 9301 if (count === void 0) { 9302 return; 9303 } 9304 if (count <= 1) { 9305 runtime.documents.delete(targetDocument); 9306 return; 9307 } 9308 runtime.documents.set(targetDocument, count - 1); 9309 }; 9310 } 9311 function registerStyle5(hash, css) { 9312 const runtime = getRuntime5(); 9313 runtime.styles.set(hash, css); 9314 for (const targetDocument of runtime.documents.keys()) { 9315 injectStyle5(targetDocument, hash, css); 9316 } 9317 } 9318 if (typeof process === "undefined" || true) { 9319 registerStyle5("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}}}}'); 9320 } 9321 var style_default4 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 9322 var POPUP_COLOR = { background: "#1e1e1e" }; 9323 var Popup = (0, import_element17.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { 9324 const popupContent = /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime25.jsx)( 9325 index_parts_exports.Popup, 9326 { 9327 ref, 9328 className: clsx_default(style_default4.popup, className), 9329 ...props, 9330 children 9331 } 9332 ) }); 9333 const positionedPopup = renderSlotWithChildren( 9334 positioner, 9335 /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Positioner, {}), 9336 popupContent 9337 ); 9338 return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(Portal, {}), positionedPopup); 9339 }); 9340 9341 // packages/ui/build-module/tooltip/trigger.mjs 9342 var import_element18 = __toESM(require_element(), 1); 9343 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); 9344 var Trigger = (0, import_element18.forwardRef)( 9345 function TooltipTrigger3(props, ref) { 9346 return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(index_parts_exports.Trigger, { ref, ...props }); 9347 } 9348 ); 9349 9350 // packages/ui/build-module/tooltip/root.mjs 9351 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); 9352 function Root(props) { 9353 return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(DirectionProvider3, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(index_parts_exports.Root, { ...props }) }); 9354 } 9355 9356 // packages/ui/build-module/tooltip/provider.mjs 9357 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); 9358 function Provider({ ...props }) { 9359 return /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(index_parts_exports.Provider, { ...props }); 9360 } 9361 9362 // packages/ui/build-module/link/link.mjs 9363 var import_element19 = __toESM(require_element(), 1); 9364 var import_i18n3 = __toESM(require_i18n(), 1); 9365 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); 9366 var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash"; 9367 function getRuntime6() { 9368 const globalScope = globalThis; 9369 if (globalScope.__wpStyleRuntime) { 9370 return globalScope.__wpStyleRuntime; 9371 } 9372 globalScope.__wpStyleRuntime = { 9373 documents: /* @__PURE__ */ new Map(), 9374 styles: /* @__PURE__ */ new Map(), 9375 injectedStyles: /* @__PURE__ */ new WeakMap() 9376 }; 9377 if (typeof document !== "undefined") { 9378 registerDocument6(document); 9379 } 9380 return globalScope.__wpStyleRuntime; 9381 } 9382 function documentContainsStyleHash6(targetDocument, hash) { 9383 if (!targetDocument.head) { 9384 return false; 9385 } 9386 for (const style of targetDocument.head.querySelectorAll( 9387 `style[$STYLE_HASH_ATTRIBUTE6}]` 9388 )) { 9389 if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) { 9390 return true; 9391 } 9392 } 9393 return false; 9394 } 9395 function injectStyle6(targetDocument, hash, css) { 9396 if (!targetDocument.head) { 9397 return; 9398 } 9399 const runtime = getRuntime6(); 9400 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9401 if (!injectedStyles) { 9402 injectedStyles = /* @__PURE__ */ new Set(); 9403 runtime.injectedStyles.set(targetDocument, injectedStyles); 9404 } 9405 if (injectedStyles.has(hash)) { 9406 return; 9407 } 9408 if (documentContainsStyleHash6(targetDocument, hash)) { 9409 injectedStyles.add(hash); 9410 return; 9411 } 9412 const style = targetDocument.createElement("style"); 9413 style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash); 9414 style.appendChild(targetDocument.createTextNode(css)); 9415 targetDocument.head.appendChild(style); 9416 injectedStyles.add(hash); 9417 } 9418 function registerDocument6(targetDocument) { 9419 const runtime = getRuntime6(); 9420 runtime.documents.set( 9421 targetDocument, 9422 (runtime.documents.get(targetDocument) ?? 0) + 1 9423 ); 9424 for (const [hash, css] of runtime.styles) { 9425 injectStyle6(targetDocument, hash, css); 9426 } 9427 return () => { 9428 const count = runtime.documents.get(targetDocument); 9429 if (count === void 0) { 9430 return; 9431 } 9432 if (count <= 1) { 9433 runtime.documents.delete(targetDocument); 9434 return; 9435 } 9436 runtime.documents.set(targetDocument, count - 1); 9437 }; 9438 } 9439 function registerStyle6(hash, css) { 9440 const runtime = getRuntime6(); 9441 runtime.styles.set(hash, css); 9442 for (const targetDocument of runtime.documents.keys()) { 9443 injectStyle6(targetDocument, hash, css); 9444 } 9445 } 9446 if (typeof process === "undefined" || true) { 9447 registerStyle6("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 9448 } 9449 var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 9450 if (typeof process === "undefined" || true) { 9451 registerStyle6("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))}}}"); 9452 } 9453 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" }; 9454 if (typeof process === "undefined" || true) { 9455 registerStyle6("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"}}}'); 9456 } 9457 var style_default5 = { "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" }; 9458 if (typeof process === "undefined" || true) { 9459 registerStyle6("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)}"); 9460 } 9461 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" }; 9462 var Link = (0, import_element19.forwardRef)( 9463 function UnforwardedLink({ 9464 children, 9465 variant = "default", 9466 tone = "brand", 9467 openInNewTab = false, 9468 target, 9469 render, 9470 className, 9471 ...props 9472 }, ref) { 9473 const shouldShowNewTabIndicator = openInNewTab || /^_blank$/i.test(target ?? ""); 9474 const element = useRender({ 9475 render, 9476 defaultTagName: "a", 9477 ref, 9478 props: mergeProps(props, { 9479 className: clsx_default( 9480 global_css_defense_default2.a, 9481 resets_default2["box-sizing"], 9482 focus_module_default["outset-ring--focus-except-active"], 9483 variant !== "unstyled" && style_default5.link, 9484 variant !== "unstyled" && shouldShowNewTabIndicator && style_default5["link-with-icon"], 9485 variant !== "unstyled" && style_default5[`is-$tone}`], 9486 variant === "unstyled" && style_default5["is-unstyled"], 9487 className 9488 ), 9489 target: target ?? (openInNewTab ? "_blank" : void 0), 9490 children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [ 9491 shouldShowNewTabIndicator && variant !== "unstyled" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { className: style_default5["link-contents"], children }) : children, 9492 shouldShowNewTabIndicator && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( 9493 "span", 9494 { 9495 className: style_default5["link-icon"], 9496 role: "img", 9497 "aria-label": ( 9498 /* translators: accessibility text appended to link text */ 9499 (0, import_i18n3.__)("(opens in a new tab)") 9500 ) 9501 } 9502 ) 9503 ] }) 9504 }) 9505 }); 9506 return element; 9507 } 9508 ); 9509 9510 // packages/react-inert-value/build-module/index.mjs 9511 var import_react6 = __toESM(require_react(), 1); 9512 var majorVersion2 = parseInt(import_react6.version, 10); 9513 function inertValue2(value) { 9514 if (majorVersion2 >= 19) { 9515 return value; 9516 } 9517 return value ? "true" : void 0; 9518 } 9519 9520 // packages/ui/build-module/stack/stack.mjs 9521 var import_element20 = __toESM(require_element(), 1); 9522 var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash"; 9523 function getRuntime7() { 9524 const globalScope = globalThis; 9525 if (globalScope.__wpStyleRuntime) { 9526 return globalScope.__wpStyleRuntime; 9527 } 9528 globalScope.__wpStyleRuntime = { 9529 documents: /* @__PURE__ */ new Map(), 9530 styles: /* @__PURE__ */ new Map(), 9531 injectedStyles: /* @__PURE__ */ new WeakMap() 9532 }; 9533 if (typeof document !== "undefined") { 9534 registerDocument7(document); 9535 } 9536 return globalScope.__wpStyleRuntime; 9537 } 9538 function documentContainsStyleHash7(targetDocument, hash) { 9539 if (!targetDocument.head) { 9540 return false; 9541 } 9542 for (const style of targetDocument.head.querySelectorAll( 9543 `style[$STYLE_HASH_ATTRIBUTE7}]` 9544 )) { 9545 if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) { 9546 return true; 9547 } 9548 } 9549 return false; 9550 } 9551 function injectStyle7(targetDocument, hash, css) { 9552 if (!targetDocument.head) { 9553 return; 9554 } 9555 const runtime = getRuntime7(); 9556 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9557 if (!injectedStyles) { 9558 injectedStyles = /* @__PURE__ */ new Set(); 9559 runtime.injectedStyles.set(targetDocument, injectedStyles); 9560 } 9561 if (injectedStyles.has(hash)) { 9562 return; 9563 } 9564 if (documentContainsStyleHash7(targetDocument, hash)) { 9565 injectedStyles.add(hash); 9566 return; 9567 } 9568 const style = targetDocument.createElement("style"); 9569 style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash); 9570 style.appendChild(targetDocument.createTextNode(css)); 9571 targetDocument.head.appendChild(style); 9572 injectedStyles.add(hash); 9573 } 9574 function registerDocument7(targetDocument) { 9575 const runtime = getRuntime7(); 9576 runtime.documents.set( 9577 targetDocument, 9578 (runtime.documents.get(targetDocument) ?? 0) + 1 9579 ); 9580 for (const [hash, css] of runtime.styles) { 9581 injectStyle7(targetDocument, hash, css); 9582 } 9583 return () => { 9584 const count = runtime.documents.get(targetDocument); 9585 if (count === void 0) { 9586 return; 9587 } 9588 if (count <= 1) { 9589 runtime.documents.delete(targetDocument); 9590 return; 9591 } 9592 runtime.documents.set(targetDocument, count - 1); 9593 }; 9594 } 9595 function registerStyle7(hash, css) { 9596 const runtime = getRuntime7(); 9597 runtime.styles.set(hash, css); 9598 for (const targetDocument of runtime.documents.keys()) { 9599 injectStyle7(targetDocument, hash, css); 9600 } 9601 } 9602 if (typeof process === "undefined" || true) { 9603 registerStyle7("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); 9604 } 9605 var style_default6 = { "stack": "_19ce0419607e1896__stack" }; 9606 var gapTokens = { 9607 xs: "var(--wpds-dimension-gap-xs, 4px)", 9608 sm: "var(--wpds-dimension-gap-sm, 8px)", 9609 md: "var(--wpds-dimension-gap-md, 12px)", 9610 lg: "var(--wpds-dimension-gap-lg, 16px)", 9611 xl: "var(--wpds-dimension-gap-xl, 24px)", 9612 "2xl": "var(--wpds-dimension-gap-2xl, 32px)", 9613 "3xl": "var(--wpds-dimension-gap-3xl, 40px)" 9614 }; 9615 var Stack = (0, import_element20.forwardRef)( 9616 function UnforwardedStack({ direction, gap, align, justify, wrap, render, ...props }, ref) { 9617 const style = { 9618 gap: gap && gapTokens[gap], 9619 alignItems: align, 9620 justifyContent: justify, 9621 flexDirection: direction, 9622 flexWrap: wrap 9623 }; 9624 const element = useRender({ 9625 render, 9626 ref, 9627 props: mergeProps(props, { 9628 style, 9629 className: style_default6.stack 9630 }) 9631 }); 9632 return element; 9633 } 9634 ); 9635 9636 // packages/ui/build-module/empty-state/index.mjs 9637 var empty_state_exports = {}; 9638 __export(empty_state_exports, { 9639 Actions: () => Actions, 9640 Description: () => Description, 9641 Icon: () => Icon2, 9642 Root: () => Root2, 9643 Title: () => Title, 9644 Visual: () => Visual 9645 }); 9646 9647 // packages/ui/build-module/empty-state/root.mjs 9648 var import_element21 = __toESM(require_element(), 1); 9649 var STYLE_HASH_ATTRIBUTE8 = "data-wp-hash"; 9650 function getRuntime8() { 9651 const globalScope = globalThis; 9652 if (globalScope.__wpStyleRuntime) { 9653 return globalScope.__wpStyleRuntime; 9654 } 9655 globalScope.__wpStyleRuntime = { 9656 documents: /* @__PURE__ */ new Map(), 9657 styles: /* @__PURE__ */ new Map(), 9658 injectedStyles: /* @__PURE__ */ new WeakMap() 9659 }; 9660 if (typeof document !== "undefined") { 9661 registerDocument8(document); 9662 } 9663 return globalScope.__wpStyleRuntime; 9664 } 9665 function documentContainsStyleHash8(targetDocument, hash) { 9666 if (!targetDocument.head) { 9667 return false; 9668 } 9669 for (const style of targetDocument.head.querySelectorAll( 9670 `style[$STYLE_HASH_ATTRIBUTE8}]` 9671 )) { 9672 if (style.getAttribute(STYLE_HASH_ATTRIBUTE8) === hash) { 9673 return true; 9674 } 9675 } 9676 return false; 9677 } 9678 function injectStyle8(targetDocument, hash, css) { 9679 if (!targetDocument.head) { 9680 return; 9681 } 9682 const runtime = getRuntime8(); 9683 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9684 if (!injectedStyles) { 9685 injectedStyles = /* @__PURE__ */ new Set(); 9686 runtime.injectedStyles.set(targetDocument, injectedStyles); 9687 } 9688 if (injectedStyles.has(hash)) { 9689 return; 9690 } 9691 if (documentContainsStyleHash8(targetDocument, hash)) { 9692 injectedStyles.add(hash); 9693 return; 9694 } 9695 const style = targetDocument.createElement("style"); 9696 style.setAttribute(STYLE_HASH_ATTRIBUTE8, hash); 9697 style.appendChild(targetDocument.createTextNode(css)); 9698 targetDocument.head.appendChild(style); 9699 injectedStyles.add(hash); 9700 } 9701 function registerDocument8(targetDocument) { 9702 const runtime = getRuntime8(); 9703 runtime.documents.set( 9704 targetDocument, 9705 (runtime.documents.get(targetDocument) ?? 0) + 1 9706 ); 9707 for (const [hash, css] of runtime.styles) { 9708 injectStyle8(targetDocument, hash, css); 9709 } 9710 return () => { 9711 const count = runtime.documents.get(targetDocument); 9712 if (count === void 0) { 9713 return; 9714 } 9715 if (count <= 1) { 9716 runtime.documents.delete(targetDocument); 9717 return; 9718 } 9719 runtime.documents.set(targetDocument, count - 1); 9720 }; 9721 } 9722 function registerStyle8(hash, css) { 9723 const runtime = getRuntime8(); 9724 runtime.styles.set(hash, css); 9725 for (const targetDocument of runtime.documents.keys()) { 9726 injectStyle8(targetDocument, hash, css); 9727 } 9728 } 9729 if (typeof process === "undefined" || true) { 9730 registerStyle8("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 9731 } 9732 var style_default7 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 9733 var Root2 = (0, import_element21.forwardRef)( 9734 function EmptyStateRoot({ render, ...props }, ref) { 9735 const className = clsx_default(style_default7.root); 9736 const element = useRender({ 9737 defaultTagName: "div", 9738 render, 9739 ref, 9740 props: mergeProps({ className }, props) 9741 }); 9742 return element; 9743 } 9744 ); 9745 9746 // packages/ui/build-module/empty-state/visual.mjs 9747 var import_element22 = __toESM(require_element(), 1); 9748 var STYLE_HASH_ATTRIBUTE9 = "data-wp-hash"; 9749 function getRuntime9() { 9750 const globalScope = globalThis; 9751 if (globalScope.__wpStyleRuntime) { 9752 return globalScope.__wpStyleRuntime; 9753 } 9754 globalScope.__wpStyleRuntime = { 9755 documents: /* @__PURE__ */ new Map(), 9756 styles: /* @__PURE__ */ new Map(), 9757 injectedStyles: /* @__PURE__ */ new WeakMap() 9758 }; 9759 if (typeof document !== "undefined") { 9760 registerDocument9(document); 9761 } 9762 return globalScope.__wpStyleRuntime; 9763 } 9764 function documentContainsStyleHash9(targetDocument, hash) { 9765 if (!targetDocument.head) { 9766 return false; 9767 } 9768 for (const style of targetDocument.head.querySelectorAll( 9769 `style[$STYLE_HASH_ATTRIBUTE9}]` 9770 )) { 9771 if (style.getAttribute(STYLE_HASH_ATTRIBUTE9) === hash) { 9772 return true; 9773 } 9774 } 9775 return false; 9776 } 9777 function injectStyle9(targetDocument, hash, css) { 9778 if (!targetDocument.head) { 9779 return; 9780 } 9781 const runtime = getRuntime9(); 9782 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9783 if (!injectedStyles) { 9784 injectedStyles = /* @__PURE__ */ new Set(); 9785 runtime.injectedStyles.set(targetDocument, injectedStyles); 9786 } 9787 if (injectedStyles.has(hash)) { 9788 return; 9789 } 9790 if (documentContainsStyleHash9(targetDocument, hash)) { 9791 injectedStyles.add(hash); 9792 return; 9793 } 9794 const style = targetDocument.createElement("style"); 9795 style.setAttribute(STYLE_HASH_ATTRIBUTE9, hash); 9796 style.appendChild(targetDocument.createTextNode(css)); 9797 targetDocument.head.appendChild(style); 9798 injectedStyles.add(hash); 9799 } 9800 function registerDocument9(targetDocument) { 9801 const runtime = getRuntime9(); 9802 runtime.documents.set( 9803 targetDocument, 9804 (runtime.documents.get(targetDocument) ?? 0) + 1 9805 ); 9806 for (const [hash, css] of runtime.styles) { 9807 injectStyle9(targetDocument, hash, css); 9808 } 9809 return () => { 9810 const count = runtime.documents.get(targetDocument); 9811 if (count === void 0) { 9812 return; 9813 } 9814 if (count <= 1) { 9815 runtime.documents.delete(targetDocument); 9816 return; 9817 } 9818 runtime.documents.set(targetDocument, count - 1); 9819 }; 9820 } 9821 function registerStyle9(hash, css) { 9822 const runtime = getRuntime9(); 9823 runtime.styles.set(hash, css); 9824 for (const targetDocument of runtime.documents.keys()) { 9825 injectStyle9(targetDocument, hash, css); 9826 } 9827 } 9828 if (typeof process === "undefined" || true) { 9829 registerStyle9("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 9830 } 9831 var style_default8 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 9832 var Visual = (0, import_element22.forwardRef)( 9833 function EmptyStateVisual({ render, ...props }, ref) { 9834 const className = clsx_default(style_default8.visual); 9835 const element = useRender({ 9836 defaultTagName: "div", 9837 render, 9838 ref, 9839 props: mergeProps({ className }, props) 9840 }); 9841 return element; 9842 } 9843 ); 9844 9845 // packages/ui/build-module/empty-state/icon.mjs 9846 var import_element23 = __toESM(require_element(), 1); 9847 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); 9848 var STYLE_HASH_ATTRIBUTE10 = "data-wp-hash"; 9849 function getRuntime10() { 9850 const globalScope = globalThis; 9851 if (globalScope.__wpStyleRuntime) { 9852 return globalScope.__wpStyleRuntime; 9853 } 9854 globalScope.__wpStyleRuntime = { 9855 documents: /* @__PURE__ */ new Map(), 9856 styles: /* @__PURE__ */ new Map(), 9857 injectedStyles: /* @__PURE__ */ new WeakMap() 9858 }; 9859 if (typeof document !== "undefined") { 9860 registerDocument10(document); 9861 } 9862 return globalScope.__wpStyleRuntime; 9863 } 9864 function documentContainsStyleHash10(targetDocument, hash) { 9865 if (!targetDocument.head) { 9866 return false; 9867 } 9868 for (const style of targetDocument.head.querySelectorAll( 9869 `style[$STYLE_HASH_ATTRIBUTE10}]` 9870 )) { 9871 if (style.getAttribute(STYLE_HASH_ATTRIBUTE10) === hash) { 9872 return true; 9873 } 9874 } 9875 return false; 9876 } 9877 function injectStyle10(targetDocument, hash, css) { 9878 if (!targetDocument.head) { 9879 return; 9880 } 9881 const runtime = getRuntime10(); 9882 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9883 if (!injectedStyles) { 9884 injectedStyles = /* @__PURE__ */ new Set(); 9885 runtime.injectedStyles.set(targetDocument, injectedStyles); 9886 } 9887 if (injectedStyles.has(hash)) { 9888 return; 9889 } 9890 if (documentContainsStyleHash10(targetDocument, hash)) { 9891 injectedStyles.add(hash); 9892 return; 9893 } 9894 const style = targetDocument.createElement("style"); 9895 style.setAttribute(STYLE_HASH_ATTRIBUTE10, hash); 9896 style.appendChild(targetDocument.createTextNode(css)); 9897 targetDocument.head.appendChild(style); 9898 injectedStyles.add(hash); 9899 } 9900 function registerDocument10(targetDocument) { 9901 const runtime = getRuntime10(); 9902 runtime.documents.set( 9903 targetDocument, 9904 (runtime.documents.get(targetDocument) ?? 0) + 1 9905 ); 9906 for (const [hash, css] of runtime.styles) { 9907 injectStyle10(targetDocument, hash, css); 9908 } 9909 return () => { 9910 const count = runtime.documents.get(targetDocument); 9911 if (count === void 0) { 9912 return; 9913 } 9914 if (count <= 1) { 9915 runtime.documents.delete(targetDocument); 9916 return; 9917 } 9918 runtime.documents.set(targetDocument, count - 1); 9919 }; 9920 } 9921 function registerStyle10(hash, css) { 9922 const runtime = getRuntime10(); 9923 runtime.styles.set(hash, css); 9924 for (const targetDocument of runtime.documents.keys()) { 9925 injectStyle10(targetDocument, hash, css); 9926 } 9927 } 9928 if (typeof process === "undefined" || true) { 9929 registerStyle10("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 9930 } 9931 var style_default9 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 9932 var Icon2 = (0, import_element23.forwardRef)( 9933 function EmptyStateIcon({ icon, className, ...restProps }, ref) { 9934 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( 9935 Visual, 9936 { 9937 ref, 9938 className: clsx_default(style_default9.icon, className), 9939 ...restProps, 9940 children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Icon, { icon }) 9941 } 9942 ); 9943 } 9944 ); 9945 9946 // packages/ui/build-module/empty-state/title.mjs 9947 var import_element24 = __toESM(require_element(), 1); 9948 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); 9949 var STYLE_HASH_ATTRIBUTE11 = "data-wp-hash"; 9950 function getRuntime11() { 9951 const globalScope = globalThis; 9952 if (globalScope.__wpStyleRuntime) { 9953 return globalScope.__wpStyleRuntime; 9954 } 9955 globalScope.__wpStyleRuntime = { 9956 documents: /* @__PURE__ */ new Map(), 9957 styles: /* @__PURE__ */ new Map(), 9958 injectedStyles: /* @__PURE__ */ new WeakMap() 9959 }; 9960 if (typeof document !== "undefined") { 9961 registerDocument11(document); 9962 } 9963 return globalScope.__wpStyleRuntime; 9964 } 9965 function documentContainsStyleHash11(targetDocument, hash) { 9966 if (!targetDocument.head) { 9967 return false; 9968 } 9969 for (const style of targetDocument.head.querySelectorAll( 9970 `style[$STYLE_HASH_ATTRIBUTE11}]` 9971 )) { 9972 if (style.getAttribute(STYLE_HASH_ATTRIBUTE11) === hash) { 9973 return true; 9974 } 9975 } 9976 return false; 9977 } 9978 function injectStyle11(targetDocument, hash, css) { 9979 if (!targetDocument.head) { 9980 return; 9981 } 9982 const runtime = getRuntime11(); 9983 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9984 if (!injectedStyles) { 9985 injectedStyles = /* @__PURE__ */ new Set(); 9986 runtime.injectedStyles.set(targetDocument, injectedStyles); 9987 } 9988 if (injectedStyles.has(hash)) { 9989 return; 9990 } 9991 if (documentContainsStyleHash11(targetDocument, hash)) { 9992 injectedStyles.add(hash); 9993 return; 9994 } 9995 const style = targetDocument.createElement("style"); 9996 style.setAttribute(STYLE_HASH_ATTRIBUTE11, hash); 9997 style.appendChild(targetDocument.createTextNode(css)); 9998 targetDocument.head.appendChild(style); 9999 injectedStyles.add(hash); 10000 } 10001 function registerDocument11(targetDocument) { 10002 const runtime = getRuntime11(); 10003 runtime.documents.set( 10004 targetDocument, 10005 (runtime.documents.get(targetDocument) ?? 0) + 1 10006 ); 10007 for (const [hash, css] of runtime.styles) { 10008 injectStyle11(targetDocument, hash, css); 10009 } 10010 return () => { 10011 const count = runtime.documents.get(targetDocument); 10012 if (count === void 0) { 10013 return; 10014 } 10015 if (count <= 1) { 10016 runtime.documents.delete(targetDocument); 10017 return; 10018 } 10019 runtime.documents.set(targetDocument, count - 1); 10020 }; 10021 } 10022 function registerStyle11(hash, css) { 10023 const runtime = getRuntime11(); 10024 runtime.styles.set(hash, css); 10025 for (const targetDocument of runtime.documents.keys()) { 10026 injectStyle11(targetDocument, hash, css); 10027 } 10028 } 10029 if (typeof process === "undefined" || true) { 10030 registerStyle11("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 10031 } 10032 var style_default10 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 10033 var DEFAULT_TAG = /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("h2", {}); 10034 var Title = (0, import_element24.forwardRef)( 10035 function EmptyStateTitle({ render = DEFAULT_TAG, className, children, ...props }, ref) { 10036 return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( 10037 Text, 10038 { 10039 ref, 10040 variant: "heading-lg", 10041 render, 10042 className: clsx_default(style_default10.title, className), 10043 ...props, 10044 children 10045 } 10046 ); 10047 } 10048 ); 10049 10050 // packages/ui/build-module/empty-state/description.mjs 10051 var import_element25 = __toESM(require_element(), 1); 10052 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); 10053 var STYLE_HASH_ATTRIBUTE12 = "data-wp-hash"; 10054 function getRuntime12() { 10055 const globalScope = globalThis; 10056 if (globalScope.__wpStyleRuntime) { 10057 return globalScope.__wpStyleRuntime; 10058 } 10059 globalScope.__wpStyleRuntime = { 10060 documents: /* @__PURE__ */ new Map(), 10061 styles: /* @__PURE__ */ new Map(), 10062 injectedStyles: /* @__PURE__ */ new WeakMap() 10063 }; 10064 if (typeof document !== "undefined") { 10065 registerDocument12(document); 10066 } 10067 return globalScope.__wpStyleRuntime; 10068 } 10069 function documentContainsStyleHash12(targetDocument, hash) { 10070 if (!targetDocument.head) { 10071 return false; 10072 } 10073 for (const style of targetDocument.head.querySelectorAll( 10074 `style[$STYLE_HASH_ATTRIBUTE12}]` 10075 )) { 10076 if (style.getAttribute(STYLE_HASH_ATTRIBUTE12) === hash) { 10077 return true; 10078 } 10079 } 10080 return false; 10081 } 10082 function injectStyle12(targetDocument, hash, css) { 10083 if (!targetDocument.head) { 10084 return; 10085 } 10086 const runtime = getRuntime12(); 10087 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10088 if (!injectedStyles) { 10089 injectedStyles = /* @__PURE__ */ new Set(); 10090 runtime.injectedStyles.set(targetDocument, injectedStyles); 10091 } 10092 if (injectedStyles.has(hash)) { 10093 return; 10094 } 10095 if (documentContainsStyleHash12(targetDocument, hash)) { 10096 injectedStyles.add(hash); 10097 return; 10098 } 10099 const style = targetDocument.createElement("style"); 10100 style.setAttribute(STYLE_HASH_ATTRIBUTE12, hash); 10101 style.appendChild(targetDocument.createTextNode(css)); 10102 targetDocument.head.appendChild(style); 10103 injectedStyles.add(hash); 10104 } 10105 function registerDocument12(targetDocument) { 10106 const runtime = getRuntime12(); 10107 runtime.documents.set( 10108 targetDocument, 10109 (runtime.documents.get(targetDocument) ?? 0) + 1 10110 ); 10111 for (const [hash, css] of runtime.styles) { 10112 injectStyle12(targetDocument, hash, css); 10113 } 10114 return () => { 10115 const count = runtime.documents.get(targetDocument); 10116 if (count === void 0) { 10117 return; 10118 } 10119 if (count <= 1) { 10120 runtime.documents.delete(targetDocument); 10121 return; 10122 } 10123 runtime.documents.set(targetDocument, count - 1); 10124 }; 10125 } 10126 function registerStyle12(hash, css) { 10127 const runtime = getRuntime12(); 10128 runtime.styles.set(hash, css); 10129 for (const targetDocument of runtime.documents.keys()) { 10130 injectStyle12(targetDocument, hash, css); 10131 } 10132 } 10133 if (typeof process === "undefined" || true) { 10134 registerStyle12("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 10135 } 10136 var style_default11 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 10137 var DEFAULT_TAG2 = /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("p", {}); 10138 var Description = (0, import_element25.forwardRef)(function EmptyStateDescription({ render = DEFAULT_TAG2, className, children, ...props }, ref) { 10139 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 10140 Text, 10141 { 10142 ref, 10143 variant: "body-md", 10144 render, 10145 className: clsx_default(style_default11.description, className), 10146 ...props, 10147 children 10148 } 10149 ); 10150 }); 10151 10152 // packages/ui/build-module/empty-state/actions.mjs 10153 var import_element26 = __toESM(require_element(), 1); 10154 var STYLE_HASH_ATTRIBUTE13 = "data-wp-hash"; 10155 function getRuntime13() { 10156 const globalScope = globalThis; 10157 if (globalScope.__wpStyleRuntime) { 10158 return globalScope.__wpStyleRuntime; 10159 } 10160 globalScope.__wpStyleRuntime = { 10161 documents: /* @__PURE__ */ new Map(), 10162 styles: /* @__PURE__ */ new Map(), 10163 injectedStyles: /* @__PURE__ */ new WeakMap() 10164 }; 10165 if (typeof document !== "undefined") { 10166 registerDocument13(document); 10167 } 10168 return globalScope.__wpStyleRuntime; 10169 } 10170 function documentContainsStyleHash13(targetDocument, hash) { 10171 if (!targetDocument.head) { 10172 return false; 10173 } 10174 for (const style of targetDocument.head.querySelectorAll( 10175 `style[$STYLE_HASH_ATTRIBUTE13}]` 10176 )) { 10177 if (style.getAttribute(STYLE_HASH_ATTRIBUTE13) === hash) { 10178 return true; 10179 } 10180 } 10181 return false; 10182 } 10183 function injectStyle13(targetDocument, hash, css) { 10184 if (!targetDocument.head) { 10185 return; 10186 } 10187 const runtime = getRuntime13(); 10188 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10189 if (!injectedStyles) { 10190 injectedStyles = /* @__PURE__ */ new Set(); 10191 runtime.injectedStyles.set(targetDocument, injectedStyles); 10192 } 10193 if (injectedStyles.has(hash)) { 10194 return; 10195 } 10196 if (documentContainsStyleHash13(targetDocument, hash)) { 10197 injectedStyles.add(hash); 10198 return; 10199 } 10200 const style = targetDocument.createElement("style"); 10201 style.setAttribute(STYLE_HASH_ATTRIBUTE13, hash); 10202 style.appendChild(targetDocument.createTextNode(css)); 10203 targetDocument.head.appendChild(style); 10204 injectedStyles.add(hash); 10205 } 10206 function registerDocument13(targetDocument) { 10207 const runtime = getRuntime13(); 10208 runtime.documents.set( 10209 targetDocument, 10210 (runtime.documents.get(targetDocument) ?? 0) + 1 10211 ); 10212 for (const [hash, css] of runtime.styles) { 10213 injectStyle13(targetDocument, hash, css); 10214 } 10215 return () => { 10216 const count = runtime.documents.get(targetDocument); 10217 if (count === void 0) { 10218 return; 10219 } 10220 if (count <= 1) { 10221 runtime.documents.delete(targetDocument); 10222 return; 10223 } 10224 runtime.documents.set(targetDocument, count - 1); 10225 }; 10226 } 10227 function registerStyle13(hash, css) { 10228 const runtime = getRuntime13(); 10229 runtime.styles.set(hash, css); 10230 for (const targetDocument of runtime.documents.keys()) { 10231 injectStyle13(targetDocument, hash, css); 10232 } 10233 } 10234 if (typeof process === "undefined" || true) { 10235 registerStyle13("d29c51197e", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{.a23e08e65c8e62e5__root{text-wrap:balance;align-items:center;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:column;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);gap:var(--wpds-dimension-gap-xs,4px);max-width:var(--wpds-dimension-surface-width-sm,320px);text-align:center}._01303b3680eaa216__visual{align-items:center;color:var(--wpds-color-foreground-content-neutral-weak,#707070);display:flex;justify-content:center;line-height:1;margin-block-end:var(--wpds-dimension-gap-xs,4px)}._58c8e351db225608__icon{background-color:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:50%;padding:var(--wpds-dimension-padding-xs,4px)}.b8b96f70820333a1__title{margin:0}._70f1dd22bad55b18__description{color:var(--wpds-color-foreground-content-neutral-weak,#707070);margin:0}._89ac025fd8e2bc52__actions{align-items:center;display:flex;flex-direction:column;gap:var(--wpds-dimension-gap-xs,4px);margin-block-start:var(--wpds-dimension-gap-md,12px);@media (min-width:480px){flex-direction:row;justify-content:center}}}@layer compositions{._70f1dd22bad55b18__description,.b8b96f70820333a1__title{text-wrap:balance}}}'); 10236 } 10237 var style_default12 = { "root": "a23e08e65c8e62e5__root", "visual": "_01303b3680eaa216__visual", "icon": "_58c8e351db225608__icon", "title": "b8b96f70820333a1__title", "description": "_70f1dd22bad55b18__description", "actions": "_89ac025fd8e2bc52__actions" }; 10238 var Actions = (0, import_element26.forwardRef)( 10239 function EmptyStateActions({ render, ...props }, ref) { 10240 const className = clsx_default(style_default12.actions); 10241 const element = useRender({ 10242 defaultTagName: "div", 10243 render, 10244 ref, 10245 props: mergeProps({ className }, props) 10246 }); 10247 return element; 10248 } 10249 ); 10250 10251 // packages/admin-ui/build-module/navigable-region/index.mjs 10252 var import_element27 = __toESM(require_element(), 1); 10253 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); 10254 var NavigableRegion = (0, import_element27.forwardRef)( 10255 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { 10256 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( 10257 Tag, 10258 { 10259 ref, 10260 className: clsx_default("admin-ui-navigable-region", className), 10261 "aria-label": ariaLabel, 10262 role: "region", 10263 tabIndex: "-1", 10264 ...props, 10265 children 10266 } 10267 ); 10268 } 10269 ); 10270 NavigableRegion.displayName = "NavigableRegion"; 10271 var navigable_region_default = NavigableRegion; 10272 10273 // packages/admin-ui/build-module/navigation/index.mjs 10274 var import_i18n4 = __toESM(require_i18n(), 1); 10275 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); 10276 var STYLE_HASH_ATTRIBUTE14 = "data-wp-hash"; 10277 function getRuntime14() { 10278 const globalScope = globalThis; 10279 if (globalScope.__wpStyleRuntime) { 10280 return globalScope.__wpStyleRuntime; 10281 } 10282 globalScope.__wpStyleRuntime = { 10283 documents: /* @__PURE__ */ new Map(), 10284 styles: /* @__PURE__ */ new Map(), 10285 injectedStyles: /* @__PURE__ */ new WeakMap() 10286 }; 10287 if (typeof document !== "undefined") { 10288 registerDocument14(document); 10289 } 10290 return globalScope.__wpStyleRuntime; 10291 } 10292 function documentContainsStyleHash14(targetDocument, hash) { 10293 if (!targetDocument.head) { 10294 return false; 10295 } 10296 for (const style of targetDocument.head.querySelectorAll( 10297 `style[$STYLE_HASH_ATTRIBUTE14}]` 10298 )) { 10299 if (style.getAttribute(STYLE_HASH_ATTRIBUTE14) === hash) { 10300 return true; 10301 } 10302 } 10303 return false; 10304 } 10305 function injectStyle14(targetDocument, hash, css) { 10306 if (!targetDocument.head) { 10307 return; 10308 } 10309 const runtime = getRuntime14(); 10310 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10311 if (!injectedStyles) { 10312 injectedStyles = /* @__PURE__ */ new Set(); 10313 runtime.injectedStyles.set(targetDocument, injectedStyles); 10314 } 10315 if (injectedStyles.has(hash)) { 10316 return; 10317 } 10318 if (documentContainsStyleHash14(targetDocument, hash)) { 10319 injectedStyles.add(hash); 10320 return; 10321 } 10322 const style = targetDocument.createElement("style"); 10323 style.setAttribute(STYLE_HASH_ATTRIBUTE14, hash); 10324 style.appendChild(targetDocument.createTextNode(css)); 10325 targetDocument.head.appendChild(style); 10326 injectedStyles.add(hash); 10327 } 10328 function registerDocument14(targetDocument) { 10329 const runtime = getRuntime14(); 10330 runtime.documents.set( 10331 targetDocument, 10332 (runtime.documents.get(targetDocument) ?? 0) + 1 10333 ); 10334 for (const [hash, css] of runtime.styles) { 10335 injectStyle14(targetDocument, hash, css); 10336 } 10337 return () => { 10338 const count = runtime.documents.get(targetDocument); 10339 if (count === void 0) { 10340 return; 10341 } 10342 if (count <= 1) { 10343 runtime.documents.delete(targetDocument); 10344 return; 10345 } 10346 runtime.documents.set(targetDocument, count - 1); 10347 }; 10348 } 10349 function registerStyle14(hash, css) { 10350 const runtime = getRuntime14(); 10351 runtime.styles.set(hash, css); 10352 for (const targetDocument of runtime.documents.keys()) { 10353 injectStyle14(targetDocument, hash, css); 10354 } 10355 } 10356 if (typeof process === "undefined" || true) { 10357 registerStyle14("72ef022400", ".bfb5a2dd8cceebd3__list{--focus-ring-size:calc(var(--wpds-border-width-focus, var(--wp-admin-border-width-focus, 2px))*2);list-style:none;margin:calc(var(--focus-ring-size)*-1);overflow-x:auto;padding:var(--focus-ring-size);scroll-padding:var(--focus-ring-size)}.a4759b4cb2c8bd92__li{flex-shrink:0}._07da506d3f2d9afe__item{align-items:center;color:var(--wpds-color-foreground-interactive-neutral-weak,#707070);display:flex;font-weight:var(--wpds-typography-font-weight-default,400);min-block-size:44px;min-inline-size:44px;text-decoration:none}._07da506d3f2d9afe__item:hover,._07da506d3f2d9afe__item[aria-current=page]{color:var(--wpds-color-foreground-interactive-neutral-weak-active,#1e1e1e)}._07da506d3f2d9afe__item[aria-current=page]{font-weight:var(--wpds-typography-font-weight-emphasis,600)}"); 10358 } 10359 var style_default13 = { "list": "bfb5a2dd8cceebd3__list", "li": "a4759b4cb2c8bd92__li", "item": "_07da506d3f2d9afe__item" }; 10360 var Navigation = ({ 10361 items, 10362 currentHref, 10363 ariaLabel = (0, import_i18n4.__)("Sections"), 10364 linkComponent, 10365 className 10366 }) => { 10367 if (!items.length) { 10368 return null; 10369 } 10370 const LinkComponent = linkComponent ?? "a"; 10371 if (true) { 10372 const invalidItem = items.find( 10373 (item) => typeof item.href !== "string" 10374 ); 10375 if (invalidItem) { 10376 throw new Error( 10377 `Navigation: item "$invalidItem.label}" is missing an \`href\` prop.` 10378 ); 10379 } 10380 const duplicate = items.find( 10381 (item, index2) => items.findIndex((other) => other.href === item.href) !== index2 10382 ); 10383 if (duplicate) { 10384 throw new Error( 10385 `Navigation: duplicate \`href\` "$duplicate.href}". Each item must have a unique \`href\` so a single item receives \`aria-current="page"\`.` 10386 ); 10387 } 10388 } 10389 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("nav", { "aria-label": ariaLabel, className, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( 10390 Stack, 10391 { 10392 render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("ul", { role: "list" }), 10393 direction: "row", 10394 align: "center", 10395 gap: "md", 10396 className: style_default13.list, 10397 children: items.map((item) => /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("li", { className: style_default13.li, children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( 10398 Text, 10399 { 10400 variant: "body-md", 10401 className: style_default13.item, 10402 render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)( 10403 Link, 10404 { 10405 variant: "unstyled", 10406 "aria-current": item.href === currentHref ? "page" : void 0, 10407 render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(LinkComponent, { href: item.href }) 10408 } 10409 ), 10410 children: item.label 10411 } 10412 ) }, item.href)) 10413 } 10414 ) }); 10415 }; 10416 var navigation_default = Navigation; 10417 10418 // packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs 10419 var import_components = __toESM(require_components(), 1); 10420 var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle"); 10421 10422 // packages/admin-ui/build-module/page/header.mjs 10423 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); 10424 var STYLE_HASH_ATTRIBUTE15 = "data-wp-hash"; 10425 function getRuntime15() { 10426 const globalScope = globalThis; 10427 if (globalScope.__wpStyleRuntime) { 10428 return globalScope.__wpStyleRuntime; 10429 } 10430 globalScope.__wpStyleRuntime = { 10431 documents: /* @__PURE__ */ new Map(), 10432 styles: /* @__PURE__ */ new Map(), 10433 injectedStyles: /* @__PURE__ */ new WeakMap() 10434 }; 10435 if (typeof document !== "undefined") { 10436 registerDocument15(document); 10437 } 10438 return globalScope.__wpStyleRuntime; 10439 } 10440 function documentContainsStyleHash15(targetDocument, hash) { 10441 if (!targetDocument.head) { 10442 return false; 10443 } 10444 for (const style of targetDocument.head.querySelectorAll( 10445 `style[$STYLE_HASH_ATTRIBUTE15}]` 10446 )) { 10447 if (style.getAttribute(STYLE_HASH_ATTRIBUTE15) === hash) { 10448 return true; 10449 } 10450 } 10451 return false; 10452 } 10453 function injectStyle15(targetDocument, hash, css) { 10454 if (!targetDocument.head) { 10455 return; 10456 } 10457 const runtime = getRuntime15(); 10458 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10459 if (!injectedStyles) { 10460 injectedStyles = /* @__PURE__ */ new Set(); 10461 runtime.injectedStyles.set(targetDocument, injectedStyles); 10462 } 10463 if (injectedStyles.has(hash)) { 10464 return; 10465 } 10466 if (documentContainsStyleHash15(targetDocument, hash)) { 10467 injectedStyles.add(hash); 10468 return; 10469 } 10470 const style = targetDocument.createElement("style"); 10471 style.setAttribute(STYLE_HASH_ATTRIBUTE15, hash); 10472 style.appendChild(targetDocument.createTextNode(css)); 10473 targetDocument.head.appendChild(style); 10474 injectedStyles.add(hash); 10475 } 10476 function registerDocument15(targetDocument) { 10477 const runtime = getRuntime15(); 10478 runtime.documents.set( 10479 targetDocument, 10480 (runtime.documents.get(targetDocument) ?? 0) + 1 10481 ); 10482 for (const [hash, css] of runtime.styles) { 10483 injectStyle15(targetDocument, hash, css); 10484 } 10485 return () => { 10486 const count = runtime.documents.get(targetDocument); 10487 if (count === void 0) { 10488 return; 10489 } 10490 if (count <= 1) { 10491 runtime.documents.delete(targetDocument); 10492 return; 10493 } 10494 runtime.documents.set(targetDocument, count - 1); 10495 }; 10496 } 10497 function registerStyle15(hash, css) { 10498 const runtime = getRuntime15(); 10499 runtime.styles.set(hash, css); 10500 for (const targetDocument of runtime.documents.keys()) { 10501 injectStyle15(targetDocument, hash, css); 10502 } 10503 } 10504 if (typeof process === "undefined" || true) { 10505 registerStyle15("1f3750277d", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-background-surface-neutral,#fcfcfc);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:var(--wpds-dimension-size-md,32px)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8bcd33103b451f30__header-lockup{min-width:0}._8113be94e7caf73c__header-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-foreground-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation,._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation ._60fea2f6bf5319cd__header-subtitle{padding-block-end:0}._673c99dcbfb58211__header-navigation{margin-block-start:var(--wpds-dimension-gap-md,12px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}"); 10506 } 10507 var style_default14 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-lockup": "_8bcd33103b451f30__header-lockup", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "has-navigation": "_4b0f17e503d11619__has-navigation", "header-navigation": "_673c99dcbfb58211__header-navigation", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" }; 10508 function Header({ 10509 headingLevel = 1, 10510 breadcrumbs, 10511 badges, 10512 visual, 10513 title, 10514 subTitle, 10515 actions, 10516 navigation, 10517 components, 10518 showSidebarToggle = true 10519 }) { 10520 const HeadingTag = `h$headingLevel}`; 10521 const hasNavigation = !!navigation?.items?.length; 10522 return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)( 10523 Stack, 10524 { 10525 direction: "column", 10526 className: clsx_default( 10527 style_default14.header, 10528 hasNavigation && style_default14["has-navigation"] 10529 ), 10530 children: [ 10531 /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)( 10532 Stack, 10533 { 10534 className: style_default14["header-content"], 10535 direction: "row", 10536 gap: "sm", 10537 justify: "space-between", 10538 children: [ 10539 /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)( 10540 Stack, 10541 { 10542 direction: "row", 10543 gap: "sm", 10544 align: "center", 10545 justify: "start", 10546 className: style_default14["header-lockup"], 10547 children: [ 10548 showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10549 SidebarToggleSlot, 10550 { 10551 bubblesVirtually: true, 10552 className: style_default14["sidebar-toggle-slot"] 10553 } 10554 ), 10555 visual && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10556 "div", 10557 { 10558 className: style_default14["header-visual"], 10559 "aria-hidden": "true", 10560 children: visual 10561 } 10562 ), 10563 title && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10564 Text, 10565 { 10566 className: style_default14["header-title"], 10567 render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(HeadingTag, {}), 10568 variant: "heading-lg", 10569 children: title 10570 } 10571 ), 10572 breadcrumbs, 10573 badges 10574 ] 10575 } 10576 ), 10577 actions && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10578 Stack, 10579 { 10580 align: "center", 10581 className: style_default14["header-actions"], 10582 direction: "row", 10583 gap: "sm", 10584 children: actions 10585 } 10586 ) 10587 ] 10588 } 10589 ), 10590 subTitle && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10591 Text, 10592 { 10593 render: /* @__PURE__ */ (0, import_jsx_runtime35.jsx)("p", {}), 10594 variant: "body-md", 10595 className: style_default14["header-subtitle"], 10596 children: subTitle 10597 } 10598 ), 10599 hasNavigation && /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 10600 navigation_default, 10601 { 10602 ...navigation, 10603 linkComponent: components?.link, 10604 className: style_default14["header-navigation"] 10605 } 10606 ) 10607 ] 10608 } 10609 ); 10610 } 10611 10612 // packages/admin-ui/build-module/page/index.mjs 10613 var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); 10614 var STYLE_HASH_ATTRIBUTE16 = "data-wp-hash"; 10615 function getRuntime16() { 10616 const globalScope = globalThis; 10617 if (globalScope.__wpStyleRuntime) { 10618 return globalScope.__wpStyleRuntime; 10619 } 10620 globalScope.__wpStyleRuntime = { 10621 documents: /* @__PURE__ */ new Map(), 10622 styles: /* @__PURE__ */ new Map(), 10623 injectedStyles: /* @__PURE__ */ new WeakMap() 10624 }; 10625 if (typeof document !== "undefined") { 10626 registerDocument16(document); 10627 } 10628 return globalScope.__wpStyleRuntime; 10629 } 10630 function documentContainsStyleHash16(targetDocument, hash) { 10631 if (!targetDocument.head) { 10632 return false; 10633 } 10634 for (const style of targetDocument.head.querySelectorAll( 10635 `style[$STYLE_HASH_ATTRIBUTE16}]` 10636 )) { 10637 if (style.getAttribute(STYLE_HASH_ATTRIBUTE16) === hash) { 10638 return true; 10639 } 10640 } 10641 return false; 10642 } 10643 function injectStyle16(targetDocument, hash, css) { 10644 if (!targetDocument.head) { 10645 return; 10646 } 10647 const runtime = getRuntime16(); 10648 let injectedStyles = runtime.injectedStyles.get(targetDocument); 10649 if (!injectedStyles) { 10650 injectedStyles = /* @__PURE__ */ new Set(); 10651 runtime.injectedStyles.set(targetDocument, injectedStyles); 10652 } 10653 if (injectedStyles.has(hash)) { 10654 return; 10655 } 10656 if (documentContainsStyleHash16(targetDocument, hash)) { 10657 injectedStyles.add(hash); 10658 return; 10659 } 10660 const style = targetDocument.createElement("style"); 10661 style.setAttribute(STYLE_HASH_ATTRIBUTE16, hash); 10662 style.appendChild(targetDocument.createTextNode(css)); 10663 targetDocument.head.appendChild(style); 10664 injectedStyles.add(hash); 10665 } 10666 function registerDocument16(targetDocument) { 10667 const runtime = getRuntime16(); 10668 runtime.documents.set( 10669 targetDocument, 10670 (runtime.documents.get(targetDocument) ?? 0) + 1 10671 ); 10672 for (const [hash, css] of runtime.styles) { 10673 injectStyle16(targetDocument, hash, css); 10674 } 10675 return () => { 10676 const count = runtime.documents.get(targetDocument); 10677 if (count === void 0) { 10678 return; 10679 } 10680 if (count <= 1) { 10681 runtime.documents.delete(targetDocument); 10682 return; 10683 } 10684 runtime.documents.set(targetDocument, count - 1); 10685 }; 10686 } 10687 function registerStyle16(hash, css) { 10688 const runtime = getRuntime16(); 10689 runtime.styles.set(hash, css); 10690 for (const targetDocument of runtime.documents.keys()) { 10691 injectStyle16(targetDocument, hash, css); 10692 } 10693 } 10694 if (typeof process === "undefined" || true) { 10695 registerStyle16("1f3750277d", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-background-surface-neutral,#fcfcfc);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-background-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:var(--wpds-dimension-size-md,32px)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8bcd33103b451f30__header-lockup{min-width:0}._8113be94e7caf73c__header-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:var(--wpds-dimension-size-sm,24px);width:var(--wpds-dimension-size-sm,24px);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-foreground-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation,._0625b55e82a0d93d__header._4b0f17e503d11619__has-navigation ._60fea2f6bf5319cd__header-subtitle{padding-block-end:0}._673c99dcbfb58211__header-navigation{margin-block-start:var(--wpds-dimension-gap-md,12px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}"); 10696 } 10697 var style_default15 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-lockup": "_8bcd33103b451f30__header-lockup", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "has-navigation": "_4b0f17e503d11619__has-navigation", "header-navigation": "_673c99dcbfb58211__header-navigation", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" }; 10698 function Page({ 10699 headingLevel, 10700 breadcrumbs, 10701 badges, 10702 visual, 10703 title, 10704 subTitle, 10705 children, 10706 className, 10707 actions, 10708 navigation, 10709 components, 10710 ariaLabel, 10711 hasPadding = false, 10712 showSidebarToggle = true 10713 }) { 10714 const classes = clsx_default(style_default15.page, className); 10715 const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : ""); 10716 return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [ 10717 (title || breadcrumbs || badges || actions || visual || !!navigation?.items?.length) && /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 10718 Header, 10719 { 10720 headingLevel, 10721 breadcrumbs, 10722 badges, 10723 visual, 10724 title, 10725 subTitle, 10726 actions, 10727 navigation, 10728 components, 10729 showSidebarToggle 10730 } 10731 ), 10732 hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 10733 "div", 10734 { 10735 className: clsx_default( 10736 style_default15.content, 10737 style_default15["has-padding"] 10738 ), 10739 children 10740 } 10741 ) : children 10742 ] }); 10743 } 10744 Page.SidebarToggleFill = SidebarToggleFill; 10745 var page_default = Page; 10746 10747 // packages/admin-ui/build-module/admin-theme-colors/index.mjs 10748 var DEFAULT_THEME_COLORS = { 10749 primary: "#3858e9", 10750 background: "#222524" 10751 }; 10752 var ADMIN_THEME_COLORS = /* @__PURE__ */ new Map([ 10753 ["modern", DEFAULT_THEME_COLORS], 10754 ["fresh", { primary: "#007cba", background: "#25292b" }], 10755 ["midnight", { primary: "#cf4339", background: "#3d4042" }], 10756 ["coffee", { primary: "#916745", background: "#5b534d" }], 10757 ["ocean", { primary: "#567958", background: "#5f787f" }], 10758 ["blue", { primary: "#437aa8", background: "#3876a8" }], 10759 ["ectoplasm", { primary: "#646c3e", background: "#4f386e" }], 10760 ["sunrise", { primary: "#ad631e", background: "#cc4541" }], 10761 ["light", { primary: "#007cba", background: "#eaeeed" }] 10762 ]); 10763 function getAdminThemeColors() { 10764 const scheme = document.body.className.match(/admin-color-([\w-]+)/)?.[1] ?? "modern"; 10765 return ADMIN_THEME_COLORS.get(scheme) ?? DEFAULT_THEME_COLORS; 10766 } 10767 10768 // packages/boot/build-module/components/app/router.mjs 10769 var import_data13 = __toESM(require_data(), 1); 10770 var import_core_data7 = __toESM(require_core_data(), 1); 10771 import { 10772 privateApis as routePrivateApis6 10773 } from "@wordpress/route"; 10774 10775 // packages/boot/build-module/components/root/index.mjs 10776 var import_notices3 = __toESM(require_notices(), 1); 10777 var import_compose5 = __toESM(require_compose(), 1); 10778 var import_components14 = __toESM(require_components(), 1); 10779 import { privateApis as routePrivateApis5 } from "@wordpress/route"; 10780 var import_element41 = __toESM(require_element(), 1); 10781 var import_i18n18 = __toESM(require_i18n(), 1); 10782 var import_editor5 = __toESM(require_editor(), 1); 10783 var import_theme = __toESM(require_theme(), 1); 10784 10785 // packages/boot/build-module/components/sidebar/index.mjs 10786 var import_components9 = __toESM(require_components(), 1); 10787 var import_data7 = __toESM(require_data(), 1); 10788 var import_i18n9 = __toESM(require_i18n(), 1); 10789 10790 // packages/boot/build-module/components/navigation/index.mjs 10791 var import_element31 = __toESM(require_element(), 1); 10792 var import_data4 = __toESM(require_data(), 1); 10793 10794 // packages/boot/build-module/store/index.mjs 10795 var import_data = __toESM(require_data(), 1); 10796 10797 // packages/boot/build-module/store/reducer.mjs 10798 var initialState = { 10799 menuItems: {}, 10800 routes: [], 10801 dashboardLink: void 0, 10802 entityLinks: {} 10803 }; 10804 function reducer(state = initialState, action) { 10805 switch (action.type) { 10806 case "REGISTER_MENU_ITEM": 10807 return { 10808 ...state, 10809 menuItems: { 10810 ...state.menuItems, 10811 [action.id]: action.menuItem 10812 } 10813 }; 10814 case "UPDATE_MENU_ITEM": 10815 if (!state.menuItems[action.id]) { 10816 return state; 10817 } 10818 return { 10819 ...state, 10820 menuItems: { 10821 ...state.menuItems, 10822 [action.id]: { 10823 ...state.menuItems[action.id], 10824 ...action.updates 10825 } 10826 } 10827 }; 10828 case "REGISTER_ROUTE": 10829 return { 10830 ...state, 10831 routes: [...state.routes, action.route] 10832 }; 10833 case "REGISTER_ENTITY_LINKS": 10834 return { 10835 ...state, 10836 entityLinks: { 10837 ...state.entityLinks, 10838 [action.postType]: { 10839 ...state.entityLinks[action.postType], 10840 ...action.links 10841 } 10842 } 10843 }; 10844 case "SET_DASHBOARD_LINK": 10845 return { 10846 ...state, 10847 dashboardLink: action.dashboardLink 10848 }; 10849 } 10850 return state; 10851 } 10852 10853 // packages/boot/build-module/store/actions.mjs 10854 var actions_exports = {}; 10855 __export(actions_exports, { 10856 registerEntityLinks: () => registerEntityLinks, 10857 registerMenuItem: () => registerMenuItem, 10858 registerRoute: () => registerRoute, 10859 setDashboardLink: () => setDashboardLink, 10860 updateMenuItem: () => updateMenuItem 10861 }); 10862 function registerMenuItem(id, menuItem) { 10863 return { 10864 type: "REGISTER_MENU_ITEM", 10865 id, 10866 menuItem 10867 }; 10868 } 10869 function updateMenuItem(id, updates) { 10870 return { 10871 type: "UPDATE_MENU_ITEM", 10872 id, 10873 updates 10874 }; 10875 } 10876 function registerRoute(route) { 10877 return { 10878 type: "REGISTER_ROUTE", 10879 route 10880 }; 10881 } 10882 function registerEntityLinks(postType, links) { 10883 return { 10884 type: "REGISTER_ENTITY_LINKS", 10885 postType, 10886 links 10887 }; 10888 } 10889 function setDashboardLink(dashboardLink) { 10890 return { 10891 type: "SET_DASHBOARD_LINK", 10892 dashboardLink 10893 }; 10894 } 10895 10896 // packages/boot/build-module/store/selectors.mjs 10897 var selectors_exports = {}; 10898 __export(selectors_exports, { 10899 getDashboardLink: () => getDashboardLink, 10900 getEntityLink: () => getEntityLink, 10901 getMenuItems: () => getMenuItems, 10902 getRoutes: () => getRoutes 10903 }); 10904 function getMenuItems(state) { 10905 return Object.values(state.menuItems); 10906 } 10907 function getRoutes(state) { 10908 return state.routes; 10909 } 10910 function getDashboardLink(state) { 10911 return state.dashboardLink; 10912 } 10913 function getEntityLink(state, postType, postId) { 10914 const links = state.entityLinks[postType] ?? state.entityLinks.default; 10915 const path = postId === void 0 ? links?.list : links?.edit; 10916 if (!path) { 10917 return void 0; 10918 } 10919 return path.replace("{type}", encodeURIComponent(postType)).replace("{id}", encodeURIComponent(postId ?? "")); 10920 } 10921 10922 // packages/boot/build-module/store/index.mjs 10923 var STORE_NAME = "wordpress/boot"; 10924 var store = (0, import_data.createReduxStore)(STORE_NAME, { 10925 reducer, 10926 actions: actions_exports, 10927 selectors: selectors_exports 10928 }); 10929 (0, import_data.register)(store); 10930 10931 // packages/boot/build-module/components/navigation/navigation-item/index.mjs 10932 var import_components4 = __toESM(require_components(), 1); 10933 10934 // packages/boot/build-module/components/navigation/router-link-item.mjs 10935 var import_element28 = __toESM(require_element(), 1); 10936 var import_components2 = __toESM(require_components(), 1); 10937 import { privateApis as routePrivateApis } from "@wordpress/route"; 10938 10939 // packages/boot/build-module/lock-unlock.mjs 10940 var import_private_apis2 = __toESM(require_private_apis(), 1); 10941 var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 10942 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 10943 "@wordpress/boot" 10944 ); 10945 10946 // packages/boot/build-module/components/navigation/router-link-item.mjs 10947 var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); 10948 var { createLink } = unlock2(routePrivateApis); 10949 function AnchorOnlyItem(props, forwardedRef) { 10950 return /* @__PURE__ */ (0, import_jsx_runtime37.jsx)(import_components2.__experimentalItem, { as: "a", ref: forwardedRef, ...props }); 10951 } 10952 var RouterLinkItem = createLink((0, import_element28.forwardRef)(AnchorOnlyItem)); 10953 var router_link_item_default = RouterLinkItem; 10954 10955 // packages/boot/build-module/components/navigation/items.mjs 10956 var import_element29 = __toESM(require_element(), 1); 10957 var import_components3 = __toESM(require_components(), 1); 10958 var import_primitives10 = __toESM(require_primitives(), 1); 10959 var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); 10960 function isSvg(element) { 10961 return (0, import_element29.isValidElement)(element) && (element.type === import_primitives10.SVG || element.type === "svg"); 10962 } 10963 function wrapIcon(icon, shouldShowPlaceholder = true) { 10964 if (isSvg(icon)) { 10965 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components3.Icon, { icon }); 10966 } 10967 if (typeof icon === "string" && icon.startsWith("dashicons-")) { 10968 const iconKey = icon.replace( 10969 /^dashicons-/, 10970 "" 10971 ); 10972 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 10973 import_components3.Dashicon, 10974 { 10975 style: { padding: "2px" }, 10976 icon: iconKey, 10977 "aria-hidden": "true" 10978 } 10979 ); 10980 } 10981 if (typeof icon === "string" && icon.startsWith("data:")) { 10982 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 10983 "img", 10984 { 10985 src: icon, 10986 alt: "", 10987 "aria-hidden": "true", 10988 style: { 10989 width: "20px", 10990 height: "20px", 10991 display: "block", 10992 padding: "2px" 10993 } 10994 } 10995 ); 10996 } 10997 if (icon) { 10998 return icon; 10999 } 11000 if (shouldShowPlaceholder) { 11001 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)( 11002 "div", 11003 { 11004 style: { width: "24px", height: "24px" }, 11005 "aria-hidden": "true" 11006 } 11007 ); 11008 } 11009 return null; 11010 } 11011 11012 // packages/boot/build-module/components/navigation/navigation-item/index.mjs 11013 var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); 11014 var STYLE_HASH_ATTRIBUTE17 = "data-wp-hash"; 11015 function getRuntime17() { 11016 const globalScope = globalThis; 11017 if (globalScope.__wpStyleRuntime) { 11018 return globalScope.__wpStyleRuntime; 11019 } 11020 globalScope.__wpStyleRuntime = { 11021 documents: /* @__PURE__ */ new Map(), 11022 styles: /* @__PURE__ */ new Map(), 11023 injectedStyles: /* @__PURE__ */ new WeakMap() 11024 }; 11025 if (typeof document !== "undefined") { 11026 registerDocument17(document); 11027 } 11028 return globalScope.__wpStyleRuntime; 11029 } 11030 function documentContainsStyleHash17(targetDocument, hash) { 11031 if (!targetDocument.head) { 11032 return false; 11033 } 11034 for (const style of targetDocument.head.querySelectorAll( 11035 `style[$STYLE_HASH_ATTRIBUTE17}]` 11036 )) { 11037 if (style.getAttribute(STYLE_HASH_ATTRIBUTE17) === hash) { 11038 return true; 11039 } 11040 } 11041 return false; 11042 } 11043 function injectStyle17(targetDocument, hash, css) { 11044 if (!targetDocument.head) { 11045 return; 11046 } 11047 const runtime = getRuntime17(); 11048 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11049 if (!injectedStyles) { 11050 injectedStyles = /* @__PURE__ */ new Set(); 11051 runtime.injectedStyles.set(targetDocument, injectedStyles); 11052 } 11053 if (injectedStyles.has(hash)) { 11054 return; 11055 } 11056 if (documentContainsStyleHash17(targetDocument, hash)) { 11057 injectedStyles.add(hash); 11058 return; 11059 } 11060 const style = targetDocument.createElement("style"); 11061 style.setAttribute(STYLE_HASH_ATTRIBUTE17, hash); 11062 style.appendChild(targetDocument.createTextNode(css)); 11063 targetDocument.head.appendChild(style); 11064 injectedStyles.add(hash); 11065 } 11066 function registerDocument17(targetDocument) { 11067 const runtime = getRuntime17(); 11068 runtime.documents.set( 11069 targetDocument, 11070 (runtime.documents.get(targetDocument) ?? 0) + 1 11071 ); 11072 for (const [hash, css] of runtime.styles) { 11073 injectStyle17(targetDocument, hash, css); 11074 } 11075 return () => { 11076 const count = runtime.documents.get(targetDocument); 11077 if (count === void 0) { 11078 return; 11079 } 11080 if (count <= 1) { 11081 runtime.documents.delete(targetDocument); 11082 return; 11083 } 11084 runtime.documents.set(targetDocument, count - 1); 11085 }; 11086 } 11087 function registerStyle17(hash, css) { 11088 const runtime = getRuntime17(); 11089 runtime.styles.set(hash, css); 11090 for (const targetDocument of runtime.documents.keys()) { 11091 injectStyle17(targetDocument, hash, css); 11092 } 11093 } 11094 if (typeof process === "undefined" || true) { 11095 registerStyle17("74796ab776", ".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}"); 11096 } 11097 var style_module_default = { "item": "d5331ded354c389a__item", "is-compact": "_44ce5374f19a05f7__is-compact" }; 11098 function NavigationItem({ 11099 className, 11100 icon, 11101 shouldShowPlaceholder = true, 11102 children, 11103 to 11104 }) { 11105 const isExternal = !String( 11106 new URL(to, window.location.origin) 11107 ).startsWith(window.location.origin); 11108 const content = /* @__PURE__ */ (0, import_jsx_runtime39.jsxs)(import_components4.__experimentalHStack, { justify: "flex-start", spacing: 2, style: { flexGrow: "1" }, children: [ 11109 wrapIcon(icon, shouldShowPlaceholder), 11110 /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(import_components4.FlexBlock, { children }) 11111 ] }); 11112 if (isExternal) { 11113 return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)( 11114 import_components4.__experimentalItem, 11115 { 11116 as: "a", 11117 href: to, 11118 className: clsx_default(style_module_default.item, className), 11119 children: content 11120 } 11121 ); 11122 } 11123 return /* @__PURE__ */ (0, import_jsx_runtime39.jsx)(router_link_item_default, { to, className: clsx_default(style_module_default.item, className), children: content }); 11124 } 11125 11126 // packages/boot/build-module/components/navigation/drilldown-item/index.mjs 11127 var import_components5 = __toESM(require_components(), 1); 11128 var import_i18n5 = __toESM(require_i18n(), 1); 11129 var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); 11130 var STYLE_HASH_ATTRIBUTE18 = "data-wp-hash"; 11131 function getRuntime18() { 11132 const globalScope = globalThis; 11133 if (globalScope.__wpStyleRuntime) { 11134 return globalScope.__wpStyleRuntime; 11135 } 11136 globalScope.__wpStyleRuntime = { 11137 documents: /* @__PURE__ */ new Map(), 11138 styles: /* @__PURE__ */ new Map(), 11139 injectedStyles: /* @__PURE__ */ new WeakMap() 11140 }; 11141 if (typeof document !== "undefined") { 11142 registerDocument18(document); 11143 } 11144 return globalScope.__wpStyleRuntime; 11145 } 11146 function documentContainsStyleHash18(targetDocument, hash) { 11147 if (!targetDocument.head) { 11148 return false; 11149 } 11150 for (const style of targetDocument.head.querySelectorAll( 11151 `style[$STYLE_HASH_ATTRIBUTE18}]` 11152 )) { 11153 if (style.getAttribute(STYLE_HASH_ATTRIBUTE18) === hash) { 11154 return true; 11155 } 11156 } 11157 return false; 11158 } 11159 function injectStyle18(targetDocument, hash, css) { 11160 if (!targetDocument.head) { 11161 return; 11162 } 11163 const runtime = getRuntime18(); 11164 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11165 if (!injectedStyles) { 11166 injectedStyles = /* @__PURE__ */ new Set(); 11167 runtime.injectedStyles.set(targetDocument, injectedStyles); 11168 } 11169 if (injectedStyles.has(hash)) { 11170 return; 11171 } 11172 if (documentContainsStyleHash18(targetDocument, hash)) { 11173 injectedStyles.add(hash); 11174 return; 11175 } 11176 const style = targetDocument.createElement("style"); 11177 style.setAttribute(STYLE_HASH_ATTRIBUTE18, hash); 11178 style.appendChild(targetDocument.createTextNode(css)); 11179 targetDocument.head.appendChild(style); 11180 injectedStyles.add(hash); 11181 } 11182 function registerDocument18(targetDocument) { 11183 const runtime = getRuntime18(); 11184 runtime.documents.set( 11185 targetDocument, 11186 (runtime.documents.get(targetDocument) ?? 0) + 1 11187 ); 11188 for (const [hash, css] of runtime.styles) { 11189 injectStyle18(targetDocument, hash, css); 11190 } 11191 return () => { 11192 const count = runtime.documents.get(targetDocument); 11193 if (count === void 0) { 11194 return; 11195 } 11196 if (count <= 1) { 11197 runtime.documents.delete(targetDocument); 11198 return; 11199 } 11200 runtime.documents.set(targetDocument, count - 1); 11201 }; 11202 } 11203 function registerStyle18(hash, css) { 11204 const runtime = getRuntime18(); 11205 runtime.styles.set(hash, css); 11206 for (const targetDocument of runtime.documents.keys()) { 11207 injectStyle18(targetDocument, hash, css); 11208 } 11209 } 11210 if (typeof process === "undefined" || true) { 11211 registerStyle18("74796ab776", ".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}"); 11212 } 11213 var style_module_default2 = { "item": "d5331ded354c389a__item", "is-compact": "_44ce5374f19a05f7__is-compact" }; 11214 function DrilldownItem({ 11215 className, 11216 id, 11217 icon, 11218 shouldShowPlaceholder = true, 11219 children, 11220 onNavigate 11221 }) { 11222 const handleClick = (e) => { 11223 e.preventDefault(); 11224 onNavigate({ id, direction: "forward" }); 11225 }; 11226 return /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( 11227 import_components5.__experimentalItem, 11228 { 11229 className: clsx_default(style_module_default2.item, className), 11230 onClick: handleClick, 11231 children: /* @__PURE__ */ (0, import_jsx_runtime40.jsxs)( 11232 import_components5.__experimentalHStack, 11233 { 11234 justify: "flex-start", 11235 spacing: 2, 11236 style: { flexGrow: "1" }, 11237 children: [ 11238 wrapIcon(icon, shouldShowPlaceholder), 11239 /* @__PURE__ */ (0, import_jsx_runtime40.jsx)(import_components5.FlexBlock, { children }), 11240 /* @__PURE__ */ (0, import_jsx_runtime40.jsx)( 11241 import_components5.Icon, 11242 { 11243 icon: (0, import_i18n5.isRTL)() ? chevron_left_small_default : chevron_right_small_default 11244 } 11245 ) 11246 ] 11247 } 11248 ) 11249 } 11250 ); 11251 } 11252 11253 // packages/boot/build-module/components/navigation/dropdown-item/index.mjs 11254 var import_components6 = __toESM(require_components(), 1); 11255 var import_compose = __toESM(require_compose(), 1); 11256 var import_data2 = __toESM(require_data(), 1); 11257 var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); 11258 var STYLE_HASH_ATTRIBUTE19 = "data-wp-hash"; 11259 function getRuntime19() { 11260 const globalScope = globalThis; 11261 if (globalScope.__wpStyleRuntime) { 11262 return globalScope.__wpStyleRuntime; 11263 } 11264 globalScope.__wpStyleRuntime = { 11265 documents: /* @__PURE__ */ new Map(), 11266 styles: /* @__PURE__ */ new Map(), 11267 injectedStyles: /* @__PURE__ */ new WeakMap() 11268 }; 11269 if (typeof document !== "undefined") { 11270 registerDocument19(document); 11271 } 11272 return globalScope.__wpStyleRuntime; 11273 } 11274 function documentContainsStyleHash19(targetDocument, hash) { 11275 if (!targetDocument.head) { 11276 return false; 11277 } 11278 for (const style of targetDocument.head.querySelectorAll( 11279 `style[$STYLE_HASH_ATTRIBUTE19}]` 11280 )) { 11281 if (style.getAttribute(STYLE_HASH_ATTRIBUTE19) === hash) { 11282 return true; 11283 } 11284 } 11285 return false; 11286 } 11287 function injectStyle19(targetDocument, hash, css) { 11288 if (!targetDocument.head) { 11289 return; 11290 } 11291 const runtime = getRuntime19(); 11292 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11293 if (!injectedStyles) { 11294 injectedStyles = /* @__PURE__ */ new Set(); 11295 runtime.injectedStyles.set(targetDocument, injectedStyles); 11296 } 11297 if (injectedStyles.has(hash)) { 11298 return; 11299 } 11300 if (documentContainsStyleHash19(targetDocument, hash)) { 11301 injectedStyles.add(hash); 11302 return; 11303 } 11304 const style = targetDocument.createElement("style"); 11305 style.setAttribute(STYLE_HASH_ATTRIBUTE19, hash); 11306 style.appendChild(targetDocument.createTextNode(css)); 11307 targetDocument.head.appendChild(style); 11308 injectedStyles.add(hash); 11309 } 11310 function registerDocument19(targetDocument) { 11311 const runtime = getRuntime19(); 11312 runtime.documents.set( 11313 targetDocument, 11314 (runtime.documents.get(targetDocument) ?? 0) + 1 11315 ); 11316 for (const [hash, css] of runtime.styles) { 11317 injectStyle19(targetDocument, hash, css); 11318 } 11319 return () => { 11320 const count = runtime.documents.get(targetDocument); 11321 if (count === void 0) { 11322 return; 11323 } 11324 if (count <= 1) { 11325 runtime.documents.delete(targetDocument); 11326 return; 11327 } 11328 runtime.documents.set(targetDocument, count - 1); 11329 }; 11330 } 11331 function registerStyle19(hash, css) { 11332 const runtime = getRuntime19(); 11333 runtime.styles.set(hash, css); 11334 for (const targetDocument of runtime.documents.keys()) { 11335 injectStyle19(targetDocument, hash, css); 11336 } 11337 } 11338 if (typeof process === "undefined" || true) { 11339 registerStyle19("74796ab776", ".d5331ded354c389a__item.d5331ded354c389a__item{align-items:center;border:none;border-radius:var(--wpds-border-radius-sm,2px);color:var(--wpds-color-foreground-interactive-neutral,#1e1e1e);display:flex;font-family:-apple-system,system-ui,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif;font-size:13px;font-weight:var(--wpds-typography-font-weight-default,400);line-height:20px;margin-block-end:4px;margin-inline:12px;min-height:32px;padding-block:0;padding-inline:4px;width:calc(100% - 24px)}.d5331ded354c389a__item.d5331ded354c389a__item:focus,.d5331ded354c389a__item.d5331ded354c389a__item:hover,.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=true]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000))}.d5331ded354c389a__item.d5331ded354c389a__item svg:last-child{padding:4px}.d5331ded354c389a__item.d5331ded354c389a__item[aria-current=page],.d5331ded354c389a__item.d5331ded354c389a__item[data-status=active]{color:var(--wpds-color-foreground-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 52%,#000));font-weight:var(--wpds-typography-font-weight-emphasis,600)}.d5331ded354c389a__item.d5331ded354c389a__item:focus-visible{transform:translateZ(0)}.d5331ded354c389a__item._44ce5374f19a05f7__is-compact{min-height:24px}"); 11340 } 11341 var style_module_default3 = { "item": "d5331ded354c389a__item", "is-compact": "_44ce5374f19a05f7__is-compact" }; 11342 if (typeof process === "undefined" || true) { 11343 registerStyle19("1a6b086e6c", "._093b894bfb82e8de__dropdown{display:block}._5954dba25ac6e16f__dropdown-children{display:flex;flex-direction:column;margin-block-end:2px;margin-block-start:-2px;margin-inline-start:30px;overflow:hidden;padding:2px}._9a14116ec9dae0e2__chevron.a9ebdaa3f36d6986__is-up{transform:rotate(180deg)}"); 11344 } 11345 var style_module_default22 = { "dropdown": "_093b894bfb82e8de__dropdown", "dropdown-children": "_5954dba25ac6e16f__dropdown-children", "chevron": "_9a14116ec9dae0e2__chevron", "is-up": "a9ebdaa3f36d6986__is-up" }; 11346 var ANIMATION_DURATION = 0.2; 11347 function DropdownItem({ 11348 className, 11349 id, 11350 icon, 11351 children, 11352 isExpanded, 11353 onToggle 11354 }) { 11355 const menuItems = (0, import_data2.useSelect)( 11356 (select) => ( 11357 // @ts-expect-error Store types are not available when selecting by store name. 11358 select(STORE_NAME).getMenuItems() 11359 ), 11360 [] 11361 ); 11362 const items = menuItems.filter((item) => item.parent === id); 11363 const disableMotion = (0, import_compose.useReducedMotion)(); 11364 return /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)("div", { className: style_module_default22.dropdown, children: [ 11365 /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11366 import_components6.__experimentalItem, 11367 { 11368 className: clsx_default(style_module_default3.item, className), 11369 onClick: (e) => { 11370 e.preventDefault(); 11371 e.stopPropagation(); 11372 onToggle(); 11373 }, 11374 onMouseDown: (e) => e.preventDefault(), 11375 children: /* @__PURE__ */ (0, import_jsx_runtime41.jsxs)( 11376 import_components6.__experimentalHStack, 11377 { 11378 justify: "flex-start", 11379 spacing: 2, 11380 style: { flexGrow: "1" }, 11381 children: [ 11382 wrapIcon(icon, false), 11383 /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components6.FlexBlock, { children }), 11384 /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11385 import_components6.Icon, 11386 { 11387 icon: chevron_down_small_default, 11388 className: clsx_default(style_module_default22.chevron, { 11389 [style_module_default22["is-up"]]: isExpanded 11390 }) 11391 } 11392 ) 11393 ] 11394 } 11395 ) 11396 } 11397 ), 11398 /* @__PURE__ */ (0, import_jsx_runtime41.jsx)(import_components6.__unstableAnimatePresence, { initial: false, children: isExpanded && /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11399 import_components6.__unstableMotion.div, 11400 { 11401 initial: { height: 0 }, 11402 animate: { height: "auto" }, 11403 exit: { height: 0 }, 11404 transition: { 11405 type: "tween", 11406 duration: disableMotion ? 0 : ANIMATION_DURATION, 11407 ease: "easeOut" 11408 }, 11409 className: style_module_default22["dropdown-children"], 11410 children: items.map((item, index2) => /* @__PURE__ */ (0, import_jsx_runtime41.jsx)( 11411 NavigationItem, 11412 { 11413 className: style_module_default3["is-compact"], 11414 to: item.to, 11415 shouldShowPlaceholder: false, 11416 children: item.label 11417 }, 11418 index2 11419 )) 11420 } 11421 ) }) 11422 ] }); 11423 } 11424 11425 // packages/boot/build-module/components/navigation/navigation-screen/index.mjs 11426 var import_components7 = __toESM(require_components(), 1); 11427 var import_i18n6 = __toESM(require_i18n(), 1); 11428 var import_compose2 = __toESM(require_compose(), 1); 11429 var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); 11430 var STYLE_HASH_ATTRIBUTE20 = "data-wp-hash"; 11431 function getRuntime20() { 11432 const globalScope = globalThis; 11433 if (globalScope.__wpStyleRuntime) { 11434 return globalScope.__wpStyleRuntime; 11435 } 11436 globalScope.__wpStyleRuntime = { 11437 documents: /* @__PURE__ */ new Map(), 11438 styles: /* @__PURE__ */ new Map(), 11439 injectedStyles: /* @__PURE__ */ new WeakMap() 11440 }; 11441 if (typeof document !== "undefined") { 11442 registerDocument20(document); 11443 } 11444 return globalScope.__wpStyleRuntime; 11445 } 11446 function documentContainsStyleHash20(targetDocument, hash) { 11447 if (!targetDocument.head) { 11448 return false; 11449 } 11450 for (const style of targetDocument.head.querySelectorAll( 11451 `style[$STYLE_HASH_ATTRIBUTE20}]` 11452 )) { 11453 if (style.getAttribute(STYLE_HASH_ATTRIBUTE20) === hash) { 11454 return true; 11455 } 11456 } 11457 return false; 11458 } 11459 function injectStyle20(targetDocument, hash, css) { 11460 if (!targetDocument.head) { 11461 return; 11462 } 11463 const runtime = getRuntime20(); 11464 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11465 if (!injectedStyles) { 11466 injectedStyles = /* @__PURE__ */ new Set(); 11467 runtime.injectedStyles.set(targetDocument, injectedStyles); 11468 } 11469 if (injectedStyles.has(hash)) { 11470 return; 11471 } 11472 if (documentContainsStyleHash20(targetDocument, hash)) { 11473 injectedStyles.add(hash); 11474 return; 11475 } 11476 const style = targetDocument.createElement("style"); 11477 style.setAttribute(STYLE_HASH_ATTRIBUTE20, hash); 11478 style.appendChild(targetDocument.createTextNode(css)); 11479 targetDocument.head.appendChild(style); 11480 injectedStyles.add(hash); 11481 } 11482 function registerDocument20(targetDocument) { 11483 const runtime = getRuntime20(); 11484 runtime.documents.set( 11485 targetDocument, 11486 (runtime.documents.get(targetDocument) ?? 0) + 1 11487 ); 11488 for (const [hash, css] of runtime.styles) { 11489 injectStyle20(targetDocument, hash, css); 11490 } 11491 return () => { 11492 const count = runtime.documents.get(targetDocument); 11493 if (count === void 0) { 11494 return; 11495 } 11496 if (count <= 1) { 11497 runtime.documents.delete(targetDocument); 11498 return; 11499 } 11500 runtime.documents.set(targetDocument, count - 1); 11501 }; 11502 } 11503 function registerStyle20(hash, css) { 11504 const runtime = getRuntime20(); 11505 runtime.styles.set(hash, css); 11506 for (const targetDocument of runtime.documents.keys()) { 11507 injectStyle20(targetDocument, hash, css); 11508 } 11509 } 11510 if (typeof process === "undefined" || true) { 11511 registerStyle20("9bfc8fef50", ".c93eb5f7b870f29c__screen{padding-block-end:4px}.c93eb5f7b870f29c__screen .components-text{color:var(--wpds-color-foreground-content-neutral,#1e1e1e)}.bee113ef4a391bcd__title-icon{padding-block-end:8px;padding-block-start:12px;padding-inline-end:16px;padding-inline-start:16px;position:sticky;top:0}._2f6050d2407c9dee__title{flex-grow:1;overflow-wrap:break-word}._2f6050d2407c9dee__title._2f6050d2407c9dee__title,._2f6050d2407c9dee__title._2f6050d2407c9dee__title ._2f6050d2407c9dee__title{color:var(--wpds-color-foreground-content-neutral,#1e1e1e);line-height:32px}.e78f7a9cf7e91164__actions{display:flex;flex-shrink:0}"); 11512 } 11513 var style_module_default4 = { "screen": "c93eb5f7b870f29c__screen", "title-icon": "bee113ef4a391bcd__title-icon", "title": "_2f6050d2407c9dee__title", "actions": "e78f7a9cf7e91164__actions" }; 11514 var ANIMATION_DURATION2 = 0.3; 11515 var slideVariants = { 11516 initial: (direction) => ({ 11517 x: direction === "forward" ? 100 : -100, 11518 opacity: 0 11519 }), 11520 animate: { 11521 x: 0, 11522 opacity: 1 11523 }, 11524 exit: (direction) => ({ 11525 x: direction === "forward" ? 100 : -100, 11526 opacity: 0 11527 }) 11528 }; 11529 function NavigationScreen({ 11530 isRoot, 11531 title, 11532 actions, 11533 content, 11534 description, 11535 animationDirection, 11536 backMenuItem, 11537 backButtonRef, 11538 navigationKey, 11539 onNavigate 11540 }) { 11541 const icon = (0, import_i18n6.isRTL)() ? chevron_right_default : chevron_left_default; 11542 const disableMotion = (0, import_compose2.useReducedMotion)(); 11543 const handleBackClick = (e) => { 11544 e.preventDefault(); 11545 onNavigate({ id: backMenuItem, direction: "backward" }); 11546 }; 11547 return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11548 "div", 11549 { 11550 className: style_module_default4.screen, 11551 style: { 11552 overflow: "hidden", 11553 position: "relative", 11554 display: "grid", 11555 gridTemplateColumns: "1fr", 11556 gridTemplateRows: "1fr" 11557 }, 11558 children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(import_components7.__unstableAnimatePresence, { initial: false, children: /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)( 11559 import_components7.__unstableMotion.div, 11560 { 11561 custom: animationDirection, 11562 variants: slideVariants, 11563 initial: "initial", 11564 animate: "animate", 11565 exit: "exit", 11566 transition: { 11567 type: "tween", 11568 duration: disableMotion ? 0 : ANIMATION_DURATION2, 11569 ease: [0.33, 0, 0, 1] 11570 }, 11571 style: { 11572 width: "100%", 11573 gridColumn: "1", 11574 gridRow: "1" 11575 }, 11576 children: [ 11577 /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(import_components7.__experimentalHStack, { spacing: 2, className: style_module_default4["title-icon"], children: [ 11578 !isRoot && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11579 import_components7.Button, 11580 { 11581 ref: backButtonRef, 11582 icon, 11583 onClick: handleBackClick, 11584 label: (0, import_i18n6.__)("Back"), 11585 size: "small", 11586 variant: "tertiary" 11587 } 11588 ), 11589 /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11590 import_components7.__experimentalHeading, 11591 { 11592 className: style_module_default4.title, 11593 level: 1, 11594 size: "15px", 11595 children: title 11596 } 11597 ), 11598 actions && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { className: style_module_default4.actions, children: actions }) 11599 ] }), 11600 description && /* @__PURE__ */ (0, import_jsx_runtime42.jsx)("div", { children: description }), 11601 content 11602 ] 11603 }, 11604 navigationKey 11605 ) }) 11606 } 11607 ); 11608 } 11609 11610 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs 11611 var import_element30 = __toESM(require_element(), 1); 11612 var import_data3 = __toESM(require_data(), 1); 11613 import { privateApis as routePrivateApis2 } from "@wordpress/route"; 11614 11615 // packages/boot/build-module/components/navigation/path-matching.mjs 11616 var isValidParentPath = (currentPath, menuPath) => { 11617 if (!menuPath || menuPath === currentPath) { 11618 return false; 11619 } 11620 const normalizePath = (path) => { 11621 const normalized = path.startsWith("/") ? path : "/" + path; 11622 return normalized.endsWith("/") && normalized.length > 1 ? normalized.slice(0, -1) : normalized; 11623 }; 11624 const normalizedCurrent = normalizePath(currentPath); 11625 const normalizedMenu = normalizePath(menuPath); 11626 return normalizedCurrent.startsWith(normalizedMenu) && (normalizedCurrent[normalizedMenu.length] === "/" || normalizedMenu === "/"); 11627 }; 11628 var findClosestMenuItem = (currentPath, menuItems) => { 11629 const exactMatch = menuItems.find((item) => item.to === currentPath); 11630 if (exactMatch) { 11631 return exactMatch; 11632 } 11633 let bestMatch = null; 11634 let bestPathLength = 0; 11635 for (const item of menuItems) { 11636 if (!item.to) { 11637 continue; 11638 } 11639 if (isValidParentPath(currentPath, item.to)) { 11640 if (item.to.length > bestPathLength) { 11641 bestMatch = item; 11642 bestPathLength = item.to.length; 11643 } 11644 } 11645 } 11646 return bestMatch; 11647 }; 11648 var findDrilldownParent = (id, menuItems) => { 11649 if (!id) { 11650 return void 0; 11651 } 11652 const currentItem = menuItems.find((item) => item.id === id); 11653 if (!currentItem) { 11654 return void 0; 11655 } 11656 if (currentItem.parent) { 11657 const parentItem = menuItems.find( 11658 (item) => item.id === currentItem.parent 11659 ); 11660 if (parentItem?.parent_type === "drilldown") { 11661 return parentItem.id; 11662 } 11663 if (parentItem) { 11664 return findDrilldownParent(parentItem.id, menuItems); 11665 } 11666 } 11667 return void 0; 11668 }; 11669 var findDropdownParent = (id, menuItems) => { 11670 if (!id) { 11671 return void 0; 11672 } 11673 const currentItem = menuItems.find((item) => item.id === id); 11674 if (!currentItem) { 11675 return void 0; 11676 } 11677 if (currentItem.parent) { 11678 const parentItem = menuItems.find( 11679 (item) => item.id === currentItem.parent 11680 ); 11681 if (parentItem?.parent_type === "dropdown") { 11682 return parentItem.id; 11683 } 11684 } 11685 return void 0; 11686 }; 11687 11688 // packages/boot/build-module/components/navigation/use-sidebar-parent.mjs 11689 var { useRouter, useMatches } = unlock2(routePrivateApis2); 11690 function useSidebarParent() { 11691 const matches = useMatches(); 11692 const router = useRouter(); 11693 const menuItems = (0, import_data3.useSelect)( 11694 (select) => ( 11695 // @ts-expect-error Store types are not available when selecting by store name. 11696 select(STORE_NAME).getMenuItems() 11697 ), 11698 [] 11699 ); 11700 const currentPath = matches[matches.length - 1].pathname.slice( 11701 router.options.basepath?.length ?? 0 11702 ); 11703 const currentMenuItem = findClosestMenuItem(currentPath, menuItems); 11704 const [parentId, setParentId] = (0, import_element30.useState)( 11705 findDrilldownParent(currentMenuItem?.id, menuItems) 11706 ); 11707 const [parentDropdownId, setParentDropdownId] = (0, import_element30.useState)(findDropdownParent(currentMenuItem?.id, menuItems)); 11708 (0, import_element30.useEffect)(() => { 11709 const matchedMenuItem = findClosestMenuItem(currentPath, menuItems); 11710 const updatedParentId = findDrilldownParent( 11711 matchedMenuItem?.id, 11712 menuItems 11713 ); 11714 const updatedDropdownParent = findDropdownParent( 11715 matchedMenuItem?.id, 11716 menuItems 11717 ); 11718 setParentId(updatedParentId); 11719 setParentDropdownId(updatedDropdownParent); 11720 }, [currentPath, menuItems]); 11721 return [ 11722 parentId, 11723 setParentId, 11724 parentDropdownId, 11725 setParentDropdownId 11726 ]; 11727 } 11728 11729 // packages/boot/build-module/components/navigation/index.mjs 11730 var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); 11731 function Navigation2() { 11732 const backButtonRef = (0, import_element31.useRef)(null); 11733 const [animationDirection, setAnimationDirection] = (0, import_element31.useState)(null); 11734 const [parentId, setParentId, parentDropdownId, setParentDropdownId] = useSidebarParent(); 11735 const menuItems = (0, import_data4.useSelect)( 11736 (select) => ( 11737 // @ts-expect-error Store types are not available when selecting by store name. 11738 select(STORE_NAME).getMenuItems() 11739 ), 11740 [] 11741 ); 11742 const parent = (0, import_element31.useMemo)( 11743 () => menuItems.find((item) => item.id === parentId), 11744 [menuItems, parentId] 11745 ); 11746 const navigationKey = parent ? `drilldown-$parent.id}` : "root"; 11747 const handleNavigate = ({ 11748 id, 11749 direction 11750 }) => { 11751 setAnimationDirection(direction); 11752 setParentId(id); 11753 }; 11754 const handleDropdownToggle = (dropdownId) => { 11755 setParentDropdownId( 11756 parentDropdownId === dropdownId ? void 0 : dropdownId 11757 ); 11758 }; 11759 const items = (0, import_element31.useMemo)( 11760 () => menuItems.filter((item) => item.parent === parentId), 11761 [menuItems, parentId] 11762 ); 11763 const hasRealIcons = items.some((item) => !!item.icon); 11764 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11765 NavigationScreen, 11766 { 11767 isRoot: !parent, 11768 title: parent ? parent.label : "", 11769 backMenuItem: parent?.parent, 11770 backButtonRef, 11771 animationDirection: animationDirection || void 0, 11772 navigationKey, 11773 onNavigate: handleNavigate, 11774 content: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { role: "list", children: items.map((item) => { 11775 if (item.parent_type === "dropdown") { 11776 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11777 DropdownItem, 11778 { 11779 id: item.id, 11780 icon: item.icon, 11781 shouldShowPlaceholder: hasRealIcons, 11782 isExpanded: parentDropdownId === item.id, 11783 onToggle: () => handleDropdownToggle(item.id), 11784 children: item.label 11785 }, 11786 item.id 11787 ); 11788 } 11789 if (item.parent_type === "drilldown") { 11790 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11791 DrilldownItem, 11792 { 11793 id: item.id, 11794 icon: item.icon, 11795 shouldShowPlaceholder: hasRealIcons, 11796 onNavigate: handleNavigate, 11797 children: item.label 11798 }, 11799 item.id 11800 ); 11801 } 11802 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11803 NavigationItem, 11804 { 11805 to: item.to, 11806 icon: item.icon, 11807 shouldShowPlaceholder: hasRealIcons, 11808 children: item.label 11809 }, 11810 item.id 11811 ); 11812 }) }) 11813 } 11814 ); 11815 } 11816 var navigation_default2 = Navigation2; 11817 11818 // packages/boot/build-module/components/save-button/index.mjs 11819 var import_element33 = __toESM(require_element(), 1); 11820 var import_data6 = __toESM(require_data(), 1); 11821 var import_i18n8 = __toESM(require_i18n(), 1); 11822 var import_core_data2 = __toESM(require_core_data(), 1); 11823 var import_keycodes = __toESM(require_keycodes(), 1); 11824 var import_editor2 = __toESM(require_editor(), 1); 11825 var import_components8 = __toESM(require_components(), 1); 11826 11827 // packages/boot/build-module/components/save-panel/use-save-shortcut.mjs 11828 var import_element32 = __toESM(require_element(), 1); 11829 var import_keyboard_shortcuts = __toESM(require_keyboard_shortcuts(), 1); 11830 var import_i18n7 = __toESM(require_i18n(), 1); 11831 var import_data5 = __toESM(require_data(), 1); 11832 var import_core_data = __toESM(require_core_data(), 1); 11833 var import_editor = __toESM(require_editor(), 1); 11834 var shortcutName = "core/boot/save"; 11835 function useSaveShortcut({ 11836 openSavePanel 11837 }) { 11838 const { __experimentalGetDirtyEntityRecords, isSavingEntityRecord } = (0, import_data5.useSelect)(import_core_data.store); 11839 const { hasNonPostEntityChanges, isPostSavingLocked } = (0, import_data5.useSelect)(import_editor.store); 11840 const { savePost } = (0, import_data5.useDispatch)(import_editor.store); 11841 const { registerShortcut, unregisterShortcut } = (0, import_data5.useDispatch)( 11842 import_keyboard_shortcuts.store 11843 ); 11844 (0, import_element32.useEffect)(() => { 11845 registerShortcut({ 11846 name: shortcutName, 11847 category: "global", 11848 description: (0, import_i18n7.__)("Save your changes."), 11849 keyCombination: { 11850 modifier: "primary", 11851 character: "s" 11852 } 11853 }); 11854 return () => { 11855 unregisterShortcut(shortcutName); 11856 }; 11857 }, [registerShortcut, unregisterShortcut]); 11858 (0, import_keyboard_shortcuts.useShortcut)(shortcutName, (event) => { 11859 event.preventDefault(); 11860 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); 11861 const hasDirtyEntities = !!dirtyEntityRecords.length; 11862 const isSaving = dirtyEntityRecords.some( 11863 (record) => isSavingEntityRecord(record.kind, record.name, record.key) 11864 ); 11865 if (!hasDirtyEntities || isSaving) { 11866 return; 11867 } 11868 if (hasNonPostEntityChanges()) { 11869 openSavePanel(); 11870 } else if (!isPostSavingLocked()) { 11871 savePost(); 11872 } 11873 }); 11874 } 11875 11876 // packages/boot/build-module/components/save-button/index.mjs 11877 var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); 11878 var STYLE_HASH_ATTRIBUTE21 = "data-wp-hash"; 11879 function getRuntime21() { 11880 const globalScope = globalThis; 11881 if (globalScope.__wpStyleRuntime) { 11882 return globalScope.__wpStyleRuntime; 11883 } 11884 globalScope.__wpStyleRuntime = { 11885 documents: /* @__PURE__ */ new Map(), 11886 styles: /* @__PURE__ */ new Map(), 11887 injectedStyles: /* @__PURE__ */ new WeakMap() 11888 }; 11889 if (typeof document !== "undefined") { 11890 registerDocument21(document); 11891 } 11892 return globalScope.__wpStyleRuntime; 11893 } 11894 function documentContainsStyleHash21(targetDocument, hash) { 11895 if (!targetDocument.head) { 11896 return false; 11897 } 11898 for (const style of targetDocument.head.querySelectorAll( 11899 `style[$STYLE_HASH_ATTRIBUTE21}]` 11900 )) { 11901 if (style.getAttribute(STYLE_HASH_ATTRIBUTE21) === hash) { 11902 return true; 11903 } 11904 } 11905 return false; 11906 } 11907 function injectStyle21(targetDocument, hash, css) { 11908 if (!targetDocument.head) { 11909 return; 11910 } 11911 const runtime = getRuntime21(); 11912 let injectedStyles = runtime.injectedStyles.get(targetDocument); 11913 if (!injectedStyles) { 11914 injectedStyles = /* @__PURE__ */ new Set(); 11915 runtime.injectedStyles.set(targetDocument, injectedStyles); 11916 } 11917 if (injectedStyles.has(hash)) { 11918 return; 11919 } 11920 if (documentContainsStyleHash21(targetDocument, hash)) { 11921 injectedStyles.add(hash); 11922 return; 11923 } 11924 const style = targetDocument.createElement("style"); 11925 style.setAttribute(STYLE_HASH_ATTRIBUTE21, hash); 11926 style.appendChild(targetDocument.createTextNode(css)); 11927 targetDocument.head.appendChild(style); 11928 injectedStyles.add(hash); 11929 } 11930 function registerDocument21(targetDocument) { 11931 const runtime = getRuntime21(); 11932 runtime.documents.set( 11933 targetDocument, 11934 (runtime.documents.get(targetDocument) ?? 0) + 1 11935 ); 11936 for (const [hash, css] of runtime.styles) { 11937 injectStyle21(targetDocument, hash, css); 11938 } 11939 return () => { 11940 const count = runtime.documents.get(targetDocument); 11941 if (count === void 0) { 11942 return; 11943 } 11944 if (count <= 1) { 11945 runtime.documents.delete(targetDocument); 11946 return; 11947 } 11948 runtime.documents.set(targetDocument, count - 1); 11949 }; 11950 } 11951 function registerStyle21(hash, css) { 11952 const runtime = getRuntime21(); 11953 runtime.styles.set(hash, css); 11954 for (const targetDocument of runtime.documents.keys()) { 11955 injectStyle21(targetDocument, hash, css); 11956 } 11957 } 11958 if (typeof process === "undefined" || true) { 11959 registerStyle21("1c6bdcf0b8", "._9c7a13851fe5f446__save-button{width:100%}._266ea24d4569bd10__shortcut:not(:first-child){margin-inline-start:8px}"); 11960 } 11961 var style_module_default5 = { "save-button": "_9c7a13851fe5f446__save-button", "shortcut": "_266ea24d4569bd10__shortcut" }; 11962 function SaveButton() { 11963 const [isSaveViewOpen, setIsSaveViewOpened] = (0, import_element33.useState)(false); 11964 const { isSaving, dirtyEntityRecordsCount } = (0, import_data6.useSelect)((select) => { 11965 const { isSavingEntityRecord, __experimentalGetDirtyEntityRecords } = select(import_core_data2.store); 11966 const dirtyEntityRecords = __experimentalGetDirtyEntityRecords(); 11967 return { 11968 isSaving: dirtyEntityRecords.some( 11969 (record) => isSavingEntityRecord(record.kind, record.name, record.key) 11970 ), 11971 dirtyEntityRecordsCount: dirtyEntityRecords.length 11972 }; 11973 }, []); 11974 const [showSavedState, setShowSavedState] = (0, import_element33.useState)(false); 11975 (0, import_element33.useEffect)(() => { 11976 if (isSaving) { 11977 setShowSavedState(true); 11978 } 11979 }, [isSaving]); 11980 const hasChanges = dirtyEntityRecordsCount > 0; 11981 (0, import_element33.useEffect)(() => { 11982 if (!isSaving && hasChanges) { 11983 setShowSavedState(false); 11984 } 11985 }, [isSaving, hasChanges]); 11986 function hideSavedState() { 11987 if (showSavedState) { 11988 setShowSavedState(false); 11989 } 11990 } 11991 const shouldShowButton = hasChanges || showSavedState; 11992 useSaveShortcut({ openSavePanel: () => setIsSaveViewOpened(true) }); 11993 const shortcut = { 11994 displayShortcut: import_keycodes.displayShortcut.primary("s"), 11995 ariaKeyShortcut: import_keycodes.ariaKeyShortcut.primary("s"), 11996 label: import_keycodes.shortcutAriaLabel.primary("s") 11997 }; 11998 const { descriptionId, targetProps } = useKeyboardShortcutProps({ 11999 shortcut 12000 }); 12001 if (!shouldShowButton) { 12002 return null; 12003 } 12004 const isInSavedState = showSavedState && !hasChanges; 12005 const disabled2 = isSaving || isInSavedState; 12006 const getLabel = () => { 12007 if (isInSavedState) { 12008 return (0, import_i18n8.__)("Saved"); 12009 } 12010 return (0, import_i18n8.sprintf)( 12011 // translators: %d: number of unsaved changes (number). 12012 (0, import_i18n8._n)( 12013 "Review %d change…", 12014 "Review %d changes…", 12015 dirtyEntityRecordsCount 12016 ), 12017 dirtyEntityRecordsCount 12018 ); 12019 }; 12020 const label = getLabel(); 12021 return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_jsx_runtime44.Fragment, { children: [ 12022 /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(tooltip_exports.Root, { children: [ 12023 /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)( 12024 tooltip_exports.Trigger, 12025 { 12026 ...targetProps, 12027 render: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 12028 import_components8.Button, 12029 { 12030 variant: "primary", 12031 size: "compact", 12032 onClick: () => setIsSaveViewOpened(true), 12033 onBlur: hideSavedState, 12034 disabled: disabled2, 12035 accessibleWhenDisabled: true, 12036 isBusy: isSaving, 12037 className: style_module_default5["save-button"], 12038 icon: isInSavedState ? check_default : void 0 12039 } 12040 ), 12041 children: [ 12042 label, 12043 descriptionId && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 12044 KeyboardShortcutDescription, 12045 { 12046 descriptionId, 12047 shortcut 12048 } 12049 ) 12050 ] 12051 } 12052 ), 12053 /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(tooltip_exports.Popup, { children: [ 12054 hasChanges && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)("span", { children: label }), 12055 /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 12056 KeyboardShortcutDisplay, 12057 { 12058 className: style_module_default5.shortcut, 12059 shortcut 12060 } 12061 ) 12062 ] }) 12063 ] }), 12064 isSaveViewOpen && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 12065 import_components8.Modal, 12066 { 12067 title: (0, import_i18n8.__)("Review changes"), 12068 onRequestClose: () => setIsSaveViewOpened(false), 12069 size: "small", 12070 children: /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 12071 import_editor2.EntitiesSavedStates, 12072 { 12073 close: () => setIsSaveViewOpened(false), 12074 variant: "inline" 12075 } 12076 ) 12077 } 12078 ) 12079 ] }); 12080 } 12081 12082 // packages/boot/build-module/components/sidebar/index.mjs 12083 var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); 12084 var STYLE_HASH_ATTRIBUTE22 = "data-wp-hash"; 12085 function getRuntime22() { 12086 const globalScope = globalThis; 12087 if (globalScope.__wpStyleRuntime) { 12088 return globalScope.__wpStyleRuntime; 12089 } 12090 globalScope.__wpStyleRuntime = { 12091 documents: /* @__PURE__ */ new Map(), 12092 styles: /* @__PURE__ */ new Map(), 12093 injectedStyles: /* @__PURE__ */ new WeakMap() 12094 }; 12095 if (typeof document !== "undefined") { 12096 registerDocument22(document); 12097 } 12098 return globalScope.__wpStyleRuntime; 12099 } 12100 function documentContainsStyleHash22(targetDocument, hash) { 12101 if (!targetDocument.head) { 12102 return false; 12103 } 12104 for (const style of targetDocument.head.querySelectorAll( 12105 `style[$STYLE_HASH_ATTRIBUTE22}]` 12106 )) { 12107 if (style.getAttribute(STYLE_HASH_ATTRIBUTE22) === hash) { 12108 return true; 12109 } 12110 } 12111 return false; 12112 } 12113 function injectStyle22(targetDocument, hash, css) { 12114 if (!targetDocument.head) { 12115 return; 12116 } 12117 const runtime = getRuntime22(); 12118 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12119 if (!injectedStyles) { 12120 injectedStyles = /* @__PURE__ */ new Set(); 12121 runtime.injectedStyles.set(targetDocument, injectedStyles); 12122 } 12123 if (injectedStyles.has(hash)) { 12124 return; 12125 } 12126 if (documentContainsStyleHash22(targetDocument, hash)) { 12127 injectedStyles.add(hash); 12128 return; 12129 } 12130 const style = targetDocument.createElement("style"); 12131 style.setAttribute(STYLE_HASH_ATTRIBUTE22, hash); 12132 style.appendChild(targetDocument.createTextNode(css)); 12133 targetDocument.head.appendChild(style); 12134 injectedStyles.add(hash); 12135 } 12136 function registerDocument22(targetDocument) { 12137 const runtime = getRuntime22(); 12138 runtime.documents.set( 12139 targetDocument, 12140 (runtime.documents.get(targetDocument) ?? 0) + 1 12141 ); 12142 for (const [hash, css] of runtime.styles) { 12143 injectStyle22(targetDocument, hash, css); 12144 } 12145 return () => { 12146 const count = runtime.documents.get(targetDocument); 12147 if (count === void 0) { 12148 return; 12149 } 12150 if (count <= 1) { 12151 runtime.documents.delete(targetDocument); 12152 return; 12153 } 12154 runtime.documents.set(targetDocument, count - 1); 12155 }; 12156 } 12157 function registerStyle22(hash, css) { 12158 const runtime = getRuntime22(); 12159 runtime.styles.set(hash, css); 12160 for (const targetDocument of runtime.documents.keys()) { 12161 injectStyle22(targetDocument, hash, css); 12162 } 12163 } 12164 if (typeof process === "undefined" || true) { 12165 registerStyle22("2f8ba86269", "._52f77809bed01e5e__scrollable{display:flex;flex-direction:column;height:100%;overflow:auto;position:relative}._6d2e23af506664fb__content{contain:content;flex-grow:1;position:relative}.c95a8ac9c6876d6e__footer{padding-block-end:8px;padding-block-start:16px;padding-inline-end:8px;padding-inline-start:16px}._28ec24681975e557__back-button{margin-block-end:8px;margin-block-start:16px;margin-inline-end:12px;margin-inline-start:12px}"); 12166 } 12167 var style_module_default6 = { "scrollable": "_52f77809bed01e5e__scrollable", "content": "_6d2e23af506664fb__content", "footer": "c95a8ac9c6876d6e__footer", "back-button": "_28ec24681975e557__back-button" }; 12168 function DashboardBackButton() { 12169 const dashboardLink = (0, import_data7.useSelect)( 12170 (select) => select(store).getDashboardLink(), 12171 [] 12172 ); 12173 return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( 12174 import_components9.Button, 12175 { 12176 __next40pxDefaultSize: true, 12177 className: style_module_default6["back-button"], 12178 href: dashboardLink || "/", 12179 icon: (0, import_i18n9.isRTL)() ? chevron_right_default : chevron_left_default, 12180 label: (0, import_i18n9.__)("Go to the Dashboard"), 12181 children: (0, import_i18n9.__)("Dashboard") 12182 } 12183 ); 12184 } 12185 function Sidebar() { 12186 return /* @__PURE__ */ (0, import_jsx_runtime45.jsxs)("div", { className: style_module_default6.scrollable, children: [ 12187 /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(DashboardBackButton, {}), 12188 /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: style_module_default6.content, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(navigation_default2, {}) }), 12189 /* @__PURE__ */ (0, import_jsx_runtime45.jsx)("div", { className: style_module_default6.footer, children: /* @__PURE__ */ (0, import_jsx_runtime45.jsx)(SaveButton, {}) }) 12190 ] }); 12191 } 12192 12193 // packages/boot/build-module/components/save-panel/index.mjs 12194 var import_element34 = __toESM(require_element(), 1); 12195 var import_components10 = __toESM(require_components(), 1); 12196 var import_editor3 = __toESM(require_editor(), 1); 12197 var import_i18n10 = __toESM(require_i18n(), 1); 12198 var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); 12199 var STYLE_HASH_ATTRIBUTE23 = "data-wp-hash"; 12200 function getRuntime23() { 12201 const globalScope = globalThis; 12202 if (globalScope.__wpStyleRuntime) { 12203 return globalScope.__wpStyleRuntime; 12204 } 12205 globalScope.__wpStyleRuntime = { 12206 documents: /* @__PURE__ */ new Map(), 12207 styles: /* @__PURE__ */ new Map(), 12208 injectedStyles: /* @__PURE__ */ new WeakMap() 12209 }; 12210 if (typeof document !== "undefined") { 12211 registerDocument23(document); 12212 } 12213 return globalScope.__wpStyleRuntime; 12214 } 12215 function documentContainsStyleHash23(targetDocument, hash) { 12216 if (!targetDocument.head) { 12217 return false; 12218 } 12219 for (const style of targetDocument.head.querySelectorAll( 12220 `style[$STYLE_HASH_ATTRIBUTE23}]` 12221 )) { 12222 if (style.getAttribute(STYLE_HASH_ATTRIBUTE23) === hash) { 12223 return true; 12224 } 12225 } 12226 return false; 12227 } 12228 function injectStyle23(targetDocument, hash, css) { 12229 if (!targetDocument.head) { 12230 return; 12231 } 12232 const runtime = getRuntime23(); 12233 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12234 if (!injectedStyles) { 12235 injectedStyles = /* @__PURE__ */ new Set(); 12236 runtime.injectedStyles.set(targetDocument, injectedStyles); 12237 } 12238 if (injectedStyles.has(hash)) { 12239 return; 12240 } 12241 if (documentContainsStyleHash23(targetDocument, hash)) { 12242 injectedStyles.add(hash); 12243 return; 12244 } 12245 const style = targetDocument.createElement("style"); 12246 style.setAttribute(STYLE_HASH_ATTRIBUTE23, hash); 12247 style.appendChild(targetDocument.createTextNode(css)); 12248 targetDocument.head.appendChild(style); 12249 injectedStyles.add(hash); 12250 } 12251 function registerDocument23(targetDocument) { 12252 const runtime = getRuntime23(); 12253 runtime.documents.set( 12254 targetDocument, 12255 (runtime.documents.get(targetDocument) ?? 0) + 1 12256 ); 12257 for (const [hash, css] of runtime.styles) { 12258 injectStyle23(targetDocument, hash, css); 12259 } 12260 return () => { 12261 const count = runtime.documents.get(targetDocument); 12262 if (count === void 0) { 12263 return; 12264 } 12265 if (count <= 1) { 12266 runtime.documents.delete(targetDocument); 12267 return; 12268 } 12269 runtime.documents.set(targetDocument, count - 1); 12270 }; 12271 } 12272 function registerStyle23(hash, css) { 12273 const runtime = getRuntime23(); 12274 runtime.styles.set(hash, css); 12275 for (const targetDocument of runtime.documents.keys()) { 12276 injectStyle23(targetDocument, hash, css); 12277 } 12278 } 12279 if (typeof process === "undefined" || true) { 12280 registerStyle23("df1a59bc40", "@media (min-width:600px){._77efcb9ca06f5774__modal{width:600px}}"); 12281 } 12282 var style_module_default7 = { "modal": "_77efcb9ca06f5774__modal" }; 12283 function SavePanel() { 12284 const [isOpen, setIsOpen] = (0, import_element34.useState)(false); 12285 useSaveShortcut({ 12286 openSavePanel: () => setIsOpen(true) 12287 }); 12288 if (!isOpen) { 12289 return false; 12290 } 12291 return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)( 12292 import_components10.Modal, 12293 { 12294 className: style_module_default7.modal, 12295 onRequestClose: () => setIsOpen(false), 12296 title: (0, import_i18n10.__)("Review changes"), 12297 size: "small", 12298 children: /* @__PURE__ */ (0, import_jsx_runtime46.jsx)( 12299 import_editor3.EntitiesSavedStates, 12300 { 12301 close: () => setIsOpen(false), 12302 variant: "inline" 12303 } 12304 ) 12305 } 12306 ); 12307 } 12308 12309 // packages/boot/build-module/components/canvas-renderer/index.mjs 12310 var import_element37 = __toESM(require_element(), 1); 12311 12312 // packages/boot/build-module/components/canvas/index.mjs 12313 var import_element36 = __toESM(require_element(), 1); 12314 var import_components12 = __toESM(require_components(), 1); 12315 var import_i18n14 = __toESM(require_i18n(), 1); 12316 import { useNavigate as useNavigate2, useSearch as useSearch2 } from "@wordpress/route"; 12317 var import_data10 = __toESM(require_data(), 1); 12318 var import_core_data5 = __toESM(require_core_data(), 1); 12319 12320 // packages/boot/build-module/components/canvas/back-button.mjs 12321 var import_components11 = __toESM(require_components(), 1); 12322 var import_i18n11 = __toESM(require_i18n(), 1); 12323 var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); 12324 function BootBackButton({ length }) { 12325 const handleBack = () => { 12326 window.history.back(); 12327 }; 12328 if (length > 1) { 12329 return null; 12330 } 12331 return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)( 12332 import_components11.Button, 12333 { 12334 size: "compact", 12335 onClick: handleBack, 12336 label: (0, import_i18n11.__)("Back"), 12337 icon: (0, import_i18n11.isRTL)() ? chevron_right_default : chevron_left_default 12338 } 12339 ); 12340 } 12341 12342 // packages/boot/build-module/components/canvas/site-preview.mjs 12343 var import_i18n12 = __toESM(require_i18n(), 1); 12344 var import_data8 = __toESM(require_data(), 1); 12345 var import_core_data3 = __toESM(require_core_data(), 1); 12346 var import_dom20 = __toESM(require_dom(), 1); 12347 var import_url = __toESM(require_url(), 1); 12348 var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); 12349 function SitePreview() { 12350 const siteUrl = (0, import_data8.useSelect)((select) => { 12351 const siteData = select(import_core_data3.store).getEntityRecord( 12352 "root", 12353 "__unstableBase" 12354 ); 12355 return siteData?.home; 12356 }, []); 12357 if (typeof siteUrl !== "string" || !siteUrl) { 12358 return null; 12359 } 12360 return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)( 12361 "iframe", 12362 { 12363 src: (0, import_url.addQueryArgs)(siteUrl, { 12364 // Parameter for hiding the admin bar. 12365 wp_site_preview: 1 12366 }), 12367 title: (0, import_i18n12.__)("Site Preview"), 12368 style: { 12369 display: "block", 12370 width: "100%", 12371 height: "100%", 12372 backgroundColor: "#fff" 12373 }, 12374 onLoad: (event) => { 12375 const iframeDocument = event.target.contentDocument; 12376 if (!iframeDocument) { 12377 return; 12378 } 12379 import_dom20.focus.focusable.find(iframeDocument.documentElement).forEach((element) => { 12380 element.style.pointerEvents = "none"; 12381 element.tabIndex = -1; 12382 element.setAttribute("aria-hidden", "true"); 12383 }); 12384 } 12385 } 12386 ); 12387 } 12388 12389 // packages/boot/build-module/components/canvas/use-navigate-to-entity-record.mjs 12390 var import_element35 = __toESM(require_element(), 1); 12391 var import_data9 = __toESM(require_data(), 1); 12392 var import_core_data4 = __toESM(require_core_data(), 1); 12393 var import_editor4 = __toESM(require_editor(), 1); 12394 var import_notices = __toESM(require_notices(), 1); 12395 var import_html_entities = __toESM(require_html_entities(), 1); 12396 var import_i18n13 = __toESM(require_i18n(), 1); 12397 import { 12398 useNavigate, 12399 useSearch, 12400 privateApis as routePrivateApis3 12401 } from "@wordpress/route"; 12402 12403 // packages/boot/build-module/components/canvas/viewport.mjs 12404 var DEFAULT_DEVICE_TYPE = "Desktop"; 12405 var VALID_VIEWPORTS = ["desktop", "tablet", "mobile"]; 12406 function isValidViewport(viewport) { 12407 return !!viewport && VALID_VIEWPORTS.includes(viewport.toLowerCase()); 12408 } 12409 function getDeviceType(viewport) { 12410 if (!isValidViewport(viewport)) { 12411 return DEFAULT_DEVICE_TYPE; 12412 } 12413 const value = viewport.toLowerCase(); 12414 return value.charAt(0).toUpperCase() + value.slice(1); 12415 } 12416 12417 // packages/boot/build-module/components/canvas/use-navigate-to-entity-record.mjs 12418 var { useCanGoBack, useRouter: useRouter2 } = unlock2(routePrivateApis3); 12419 function useNavigateToEntityRecord() { 12420 const navigate = useNavigate(); 12421 const search = useSearch({ strict: false }); 12422 const registry = (0, import_data9.useRegistry)(); 12423 const getEntityLink2 = (0, import_data9.useSelect)( 12424 (select) => select(store).getEntityLink, 12425 [] 12426 ); 12427 const router = useRouter2(); 12428 const canGoBack = useCanGoBack(); 12429 const onNavigateToEntityRecord = (0, import_element35.useCallback)( 12430 (params) => { 12431 const currentPostType = registry.select(import_editor4.store).getCurrentPostType(); 12432 const currentPostId = registry.select(import_editor4.store).getCurrentPostId(); 12433 const edits = registry.select(import_core_data4.store).getEntityRecordEdits( 12434 "postType", 12435 currentPostType, 12436 currentPostId 12437 ); 12438 const selectedBlock = edits?.selection?.selectionStart?.clientId; 12439 if (selectedBlock) { 12440 navigate({ 12441 search: (previous) => ({ 12442 ...previous, 12443 selectedBlock 12444 }), 12445 replace: true 12446 }); 12447 } 12448 const requestedViewport = params.viewport?.toLowerCase(); 12449 const hasRequestedViewport = isValidViewport(requestedViewport); 12450 const to = getEntityLink2(params.postType, params.postId); 12451 if (to) { 12452 navigate({ 12453 to, 12454 search: () => ({ 12455 focusMode: true, 12456 ...hasRequestedViewport ? { viewport: requestedViewport } : {} 12457 }) 12458 }); 12459 } 12460 }, 12461 [navigate, registry, getEntityLink2] 12462 ); 12463 const isFocusMode = !!search.focusMode; 12464 const onNavigateToPreviousEntityRecord = (0, import_element35.useMemo)( 12465 () => isFocusMode && canGoBack ? () => router.history.back() : void 0, 12466 [isFocusMode, canGoBack, router] 12467 ); 12468 return { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord }; 12469 } 12470 function useActionPerformed(postType) { 12471 const navigate = useNavigate(); 12472 const { createSuccessNotice } = (0, import_data9.useDispatch)(import_notices.store); 12473 const getEntityLink2 = (0, import_data9.useSelect)( 12474 (select) => select(store).getEntityLink, 12475 [] 12476 ); 12477 return (0, import_element35.useCallback)( 12478 (actionId, items) => { 12479 switch (actionId) { 12480 case "move-to-trash": 12481 case "permanently-delete": 12482 case "delete-post": { 12483 const to = postType && getEntityLink2(postType); 12484 if (to) { 12485 navigate({ to, search: () => ({}) }); 12486 } 12487 break; 12488 } 12489 case "duplicate-post": { 12490 const newItem = items[0]; 12491 const to = getEntityLink2(newItem.type, newItem.id); 12492 if (!to) { 12493 break; 12494 } 12495 const title = typeof newItem.title === "string" ? newItem.title : newItem.title?.rendered; 12496 createSuccessNotice( 12497 (0, import_i18n13.sprintf)( 12498 // translators: %s: Title of the created post, e.g: "Hello world". 12499 (0, import_i18n13.__)('"%s" successfully created.'), 12500 (0, import_html_entities.decodeEntities)(title ?? "") || (0, import_i18n13.__)("(no title)") 12501 ), 12502 { 12503 type: "snackbar", 12504 id: "duplicate-post-action", 12505 actions: [ 12506 { 12507 label: (0, import_i18n13.__)("Edit"), 12508 onClick: () => navigate({ to }) 12509 } 12510 ] 12511 } 12512 ); 12513 break; 12514 } 12515 } 12516 }, 12517 [navigate, createSuccessNotice, getEntityLink2, postType] 12518 ); 12519 } 12520 12521 // packages/boot/build-module/components/canvas/index.mjs 12522 var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); 12523 function Canvas({ canvas }) { 12524 const [Editor, setEditor] = (0, import_element36.useState)(null); 12525 const navigate = useNavigate2(); 12526 const { onNavigateToEntityRecord, onNavigateToPreviousEntityRecord } = useNavigateToEntityRecord(); 12527 const onActionPerformed = useActionPerformed(canvas.postType); 12528 const viewport = useSearch2({ 12529 strict: false, 12530 select: (search) => search.viewport 12531 }); 12532 const hasEntity = !!(canvas.postType && canvas.postId); 12533 const isBlockTheme = (0, import_data10.useSelect)( 12534 (select) => select(import_core_data5.store).getCurrentTheme()?.is_block_theme, 12535 [] 12536 ); 12537 const { editLink, isTrashed } = (0, import_data10.useSelect)( 12538 (select) => { 12539 if (!canvas.postType || !canvas.postId) { 12540 return { editLink: void 0, isTrashed: false }; 12541 } 12542 const record = select(import_core_data5.store).getEntityRecord( 12543 "postType", 12544 canvas.postType, 12545 canvas.postId 12546 ); 12547 return { 12548 editLink: select(store).getEntityLink( 12549 canvas.postType, 12550 canvas.postId 12551 ), 12552 isTrashed: record?.status === "trash" 12553 }; 12554 }, 12555 [canvas.postType, canvas.postId] 12556 ); 12557 const settings = (0, import_element36.useMemo)( 12558 () => ({ 12559 isPreviewMode: canvas.isPreview, 12560 styles: canvas.isPreview ? [{ css: "body{min-height:100vh;}" }] : [], 12561 onNavigateToEntityRecord, 12562 onNavigateToPreviousEntityRecord 12563 }), 12564 [ 12565 canvas.isPreview, 12566 onNavigateToEntityRecord, 12567 onNavigateToPreviousEntityRecord 12568 ] 12569 ); 12570 (0, import_element36.useEffect)(() => { 12571 import("@wordpress/lazy-editor").then((module) => { 12572 setEditor(() => module.Editor); 12573 }).catch((error) => { 12574 console.error("Failed to load lazy editor:", error); 12575 }); 12576 }, []); 12577 if (!hasEntity && isBlockTheme === false) { 12578 return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(SitePreview, {}); 12579 } 12580 if (!Editor || !hasEntity && isBlockTheme === void 0) { 12581 return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12582 "div", 12583 { 12584 style: { 12585 display: "flex", 12586 justifyContent: "center", 12587 alignItems: "center", 12588 height: "100%", 12589 padding: "2rem" 12590 }, 12591 children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components12.Spinner, {}) 12592 } 12593 ); 12594 } 12595 const backButton = !canvas.isPreview ? ({ length }) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(BootBackButton, { length }) : void 0; 12596 return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { style: { height: "100%", position: "relative" }, children: [ 12597 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12598 "div", 12599 { 12600 style: { height: "100%" }, 12601 inert: inertValue2(canvas.isPreview), 12602 children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12603 Editor, 12604 { 12605 postType: canvas.postType, 12606 postId: canvas.postId, 12607 renderingMode: canvas.renderingMode, 12608 settings, 12609 backButton, 12610 onActionPerformed, 12611 initialViewport: getDeviceType(viewport) 12612 } 12613 ) 12614 } 12615 ), 12616 canvas.isPreview && editLink && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12617 "div", 12618 { 12619 onClick: isTrashed ? void 0 : () => navigate({ to: editLink }), 12620 onKeyDown: (e) => { 12621 if (isTrashed) { 12622 return; 12623 } 12624 if (e.key === "Enter" || e.key === " ") { 12625 e.preventDefault(); 12626 navigate({ to: editLink }); 12627 } 12628 }, 12629 style: { 12630 position: "absolute", 12631 inset: 0, 12632 cursor: isTrashed ? "default" : "pointer", 12633 zIndex: 1 12634 }, 12635 role: "button", 12636 tabIndex: 0, 12637 "aria-disabled": isTrashed, 12638 "aria-label": (0, import_i18n14.__)("Edit") 12639 } 12640 ) 12641 ] }); 12642 } 12643 12644 // packages/boot/build-module/components/canvas-renderer/index.mjs 12645 var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); 12646 function CanvasRenderer({ 12647 canvas, 12648 routeContentModule 12649 }) { 12650 const [CustomCanvas, setCustomCanvas] = (0, import_element37.useState)(null); 12651 (0, import_element37.useEffect)(() => { 12652 if (canvas === null && routeContentModule) { 12653 import(routeContentModule).then((module) => { 12654 setCustomCanvas(() => module.canvas); 12655 }).catch((error) => { 12656 console.error("Failed to load custom canvas:", error); 12657 }); 12658 } else { 12659 setCustomCanvas(null); 12660 } 12661 }, [canvas, routeContentModule]); 12662 if (canvas === void 0) { 12663 return null; 12664 } 12665 if (canvas === null) { 12666 if (!CustomCanvas) { 12667 return null; 12668 } 12669 return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(CustomCanvas, {}); 12670 } 12671 return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(Canvas, { canvas }); 12672 } 12673 12674 // packages/boot/build-module/components/error-boundary/index.mjs 12675 var import_element38 = __toESM(require_element(), 1); 12676 var import_i18n15 = __toESM(require_i18n(), 1); 12677 var import_components13 = __toESM(require_components(), 1); 12678 var import_compose3 = __toESM(require_compose(), 1); 12679 var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); 12680 var STYLE_HASH_ATTRIBUTE24 = "data-wp-hash"; 12681 function getRuntime24() { 12682 const globalScope = globalThis; 12683 if (globalScope.__wpStyleRuntime) { 12684 return globalScope.__wpStyleRuntime; 12685 } 12686 globalScope.__wpStyleRuntime = { 12687 documents: /* @__PURE__ */ new Map(), 12688 styles: /* @__PURE__ */ new Map(), 12689 injectedStyles: /* @__PURE__ */ new WeakMap() 12690 }; 12691 if (typeof document !== "undefined") { 12692 registerDocument24(document); 12693 } 12694 return globalScope.__wpStyleRuntime; 12695 } 12696 function documentContainsStyleHash24(targetDocument, hash) { 12697 if (!targetDocument.head) { 12698 return false; 12699 } 12700 for (const style of targetDocument.head.querySelectorAll( 12701 `style[$STYLE_HASH_ATTRIBUTE24}]` 12702 )) { 12703 if (style.getAttribute(STYLE_HASH_ATTRIBUTE24) === hash) { 12704 return true; 12705 } 12706 } 12707 return false; 12708 } 12709 function injectStyle24(targetDocument, hash, css) { 12710 if (!targetDocument.head) { 12711 return; 12712 } 12713 const runtime = getRuntime24(); 12714 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12715 if (!injectedStyles) { 12716 injectedStyles = /* @__PURE__ */ new Set(); 12717 runtime.injectedStyles.set(targetDocument, injectedStyles); 12718 } 12719 if (injectedStyles.has(hash)) { 12720 return; 12721 } 12722 if (documentContainsStyleHash24(targetDocument, hash)) { 12723 injectedStyles.add(hash); 12724 return; 12725 } 12726 const style = targetDocument.createElement("style"); 12727 style.setAttribute(STYLE_HASH_ATTRIBUTE24, hash); 12728 style.appendChild(targetDocument.createTextNode(css)); 12729 targetDocument.head.appendChild(style); 12730 injectedStyles.add(hash); 12731 } 12732 function registerDocument24(targetDocument) { 12733 const runtime = getRuntime24(); 12734 runtime.documents.set( 12735 targetDocument, 12736 (runtime.documents.get(targetDocument) ?? 0) + 1 12737 ); 12738 for (const [hash, css] of runtime.styles) { 12739 injectStyle24(targetDocument, hash, css); 12740 } 12741 return () => { 12742 const count = runtime.documents.get(targetDocument); 12743 if (count === void 0) { 12744 return; 12745 } 12746 if (count <= 1) { 12747 runtime.documents.delete(targetDocument); 12748 return; 12749 } 12750 runtime.documents.set(targetDocument, count - 1); 12751 }; 12752 } 12753 function registerStyle24(hash, css) { 12754 const runtime = getRuntime24(); 12755 runtime.styles.set(hash, css); 12756 for (const targetDocument of runtime.documents.keys()) { 12757 injectStyle24(targetDocument, hash, css); 12758 } 12759 } 12760 if (typeof process === "undefined" || true) { 12761 registerStyle24("4780fe0b1b", "._4d71ad18128c9cb8__error-boundary{align-items:center;box-sizing:border-box;display:flex;justify-content:center;min-height:100%;padding:16px}"); 12762 } 12763 var style_module_default8 = { "error-boundary": "_4d71ad18128c9cb8__error-boundary" }; 12764 function CopyErrorButton({ error }) { 12765 const ref = (0, import_compose3.useCopyToClipboard)(() => error.stack ?? String(error)); 12766 return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(import_components13.Button, { __next40pxDefaultSize: true, variant: "secondary", ref, children: (0, import_i18n15.__)("Copy error") }); 12767 } 12768 var ErrorBoundary = class extends import_element38.Component { 12769 constructor(props) { 12770 super(props); 12771 this.state = { error: null }; 12772 } 12773 static getDerivedStateFromError(error) { 12774 return { error }; 12775 } 12776 render() { 12777 const { error } = this.state; 12778 if (!error) { 12779 return this.props.children; 12780 } 12781 return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: style_module_default8["error-boundary"], children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(empty_state_exports.Root, { children: [ 12782 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(empty_state_exports.Icon, { icon: caution_default }), 12783 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(empty_state_exports.Title, { children: (0, import_i18n15.__)("Something went wrong") }), 12784 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(empty_state_exports.Description, { children: (0, import_i18n15.__)( 12785 "This part of the screen could not be displayed. Reloading the page may help." 12786 ) }), 12787 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(empty_state_exports.Actions, { children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)(CopyErrorButton, { error }) }) 12788 ] }) }); 12789 } 12790 }; 12791 12792 // packages/boot/build-module/components/plugin-area/index.mjs 12793 var import_data11 = __toESM(require_data(), 1); 12794 var import_i18n16 = __toESM(require_i18n(), 1); 12795 var import_notices2 = __toESM(require_notices(), 1); 12796 var import_plugins = __toESM(require_plugins(), 1); 12797 var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); 12798 function PluginArea() { 12799 const { createErrorNotice } = (0, import_data11.useDispatch)(import_notices2.store); 12800 return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 12801 import_plugins.PluginArea, 12802 { 12803 onError: (name) => { 12804 createErrorNotice( 12805 (0, import_i18n16.sprintf)( 12806 /* translators: %s: plugin name */ 12807 (0, import_i18n16.__)( 12808 'The "%s" plugin has encountered an error and cannot be rendered.' 12809 ), 12810 name 12811 ) 12812 ); 12813 } 12814 } 12815 ); 12816 } 12817 12818 // packages/boot/build-module/components/app/use-route-title.mjs 12819 var import_element39 = __toESM(require_element(), 1); 12820 var import_data12 = __toESM(require_data(), 1); 12821 var import_core_data6 = __toESM(require_core_data(), 1); 12822 var import_i18n17 = __toESM(require_i18n(), 1); 12823 var import_html_entities2 = __toESM(require_html_entities(), 1); 12824 import { speak } from "@wordpress/a11y"; 12825 import { privateApis as routePrivateApis4 } from "@wordpress/route"; 12826 var { useLocation, useMatches: useMatches2 } = unlock2(routePrivateApis4); 12827 function useRouteTitle() { 12828 const location = useLocation(); 12829 const matches = useMatches2(); 12830 const currentMatch = matches[matches.length - 1]; 12831 const routeTitle = currentMatch?.loaderData?.title; 12832 const siteTitle = (0, import_data12.useSelect)( 12833 (select) => select(import_core_data6.store).getEntityRecord( 12834 "root", 12835 "__unstableBase" 12836 )?.name, 12837 [] 12838 ); 12839 const isInitialLocationRef = (0, import_element39.useRef)(true); 12840 (0, import_element39.useEffect)(() => { 12841 isInitialLocationRef.current = false; 12842 }, [location]); 12843 (0, import_element39.useEffect)(() => { 12844 if (isInitialLocationRef.current) { 12845 return; 12846 } 12847 if (routeTitle && typeof routeTitle === "string" && siteTitle && typeof siteTitle === "string") { 12848 const decodedRouteTitle = (0, import_html_entities2.decodeEntities)(routeTitle); 12849 const decodedSiteTitle = (0, import_html_entities2.decodeEntities)(siteTitle); 12850 const formattedTitle = (0, import_i18n17.sprintf)( 12851 /* translators: Admin document title. 1: Admin screen name, 2: Site name. */ 12852 (0, import_i18n17.__)("%1$s ‹ %2$s — WordPress"), 12853 decodedRouteTitle, 12854 decodedSiteTitle 12855 ); 12856 document.title = formattedTitle; 12857 if (decodedRouteTitle) { 12858 speak(decodedRouteTitle, "assertive"); 12859 } 12860 } 12861 }, [routeTitle, siteTitle, location]); 12862 } 12863 12864 // packages/boot/build-module/components/root/use-sync-body-background.mjs 12865 var import_element40 = __toESM(require_element(), 1); 12866 var import_compose4 = __toESM(require_compose(), 1); 12867 function useSyncBodyBackground() { 12868 const layoutRef = (0, import_element40.useRef)(null); 12869 (0, import_compose4.useIsomorphicLayoutEffect)(() => { 12870 if (!layoutRef.current) { 12871 return; 12872 } 12873 const body = layoutRef.current.ownerDocument.body; 12874 const bg = getComputedStyle(layoutRef.current).backgroundColor; 12875 if (!bg) { 12876 return; 12877 } 12878 const previousBackground = body.style.background; 12879 body.style.background = bg; 12880 return () => { 12881 body.style.background = previousBackground; 12882 }; 12883 }, []); 12884 return layoutRef; 12885 } 12886 12887 // packages/boot/build-module/components/root/index.mjs 12888 var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); 12889 var STYLE_HASH_ATTRIBUTE25 = "data-wp-hash"; 12890 function getRuntime25() { 12891 const globalScope = globalThis; 12892 if (globalScope.__wpStyleRuntime) { 12893 return globalScope.__wpStyleRuntime; 12894 } 12895 globalScope.__wpStyleRuntime = { 12896 documents: /* @__PURE__ */ new Map(), 12897 styles: /* @__PURE__ */ new Map(), 12898 injectedStyles: /* @__PURE__ */ new WeakMap() 12899 }; 12900 if (typeof document !== "undefined") { 12901 registerDocument25(document); 12902 } 12903 return globalScope.__wpStyleRuntime; 12904 } 12905 function documentContainsStyleHash25(targetDocument, hash) { 12906 if (!targetDocument.head) { 12907 return false; 12908 } 12909 for (const style of targetDocument.head.querySelectorAll( 12910 `style[$STYLE_HASH_ATTRIBUTE25}]` 12911 )) { 12912 if (style.getAttribute(STYLE_HASH_ATTRIBUTE25) === hash) { 12913 return true; 12914 } 12915 } 12916 return false; 12917 } 12918 function injectStyle25(targetDocument, hash, css) { 12919 if (!targetDocument.head) { 12920 return; 12921 } 12922 const runtime = getRuntime25(); 12923 let injectedStyles = runtime.injectedStyles.get(targetDocument); 12924 if (!injectedStyles) { 12925 injectedStyles = /* @__PURE__ */ new Set(); 12926 runtime.injectedStyles.set(targetDocument, injectedStyles); 12927 } 12928 if (injectedStyles.has(hash)) { 12929 return; 12930 } 12931 if (documentContainsStyleHash25(targetDocument, hash)) { 12932 injectedStyles.add(hash); 12933 return; 12934 } 12935 const style = targetDocument.createElement("style"); 12936 style.setAttribute(STYLE_HASH_ATTRIBUTE25, hash); 12937 style.appendChild(targetDocument.createTextNode(css)); 12938 targetDocument.head.appendChild(style); 12939 injectedStyles.add(hash); 12940 } 12941 function registerDocument25(targetDocument) { 12942 const runtime = getRuntime25(); 12943 runtime.documents.set( 12944 targetDocument, 12945 (runtime.documents.get(targetDocument) ?? 0) + 1 12946 ); 12947 for (const [hash, css] of runtime.styles) { 12948 injectStyle25(targetDocument, hash, css); 12949 } 12950 return () => { 12951 const count = runtime.documents.get(targetDocument); 12952 if (count === void 0) { 12953 return; 12954 } 12955 if (count <= 1) { 12956 runtime.documents.delete(targetDocument); 12957 return; 12958 } 12959 runtime.documents.set(targetDocument, count - 1); 12960 }; 12961 } 12962 function registerStyle25(hash, css) { 12963 const runtime = getRuntime25(); 12964 runtime.styles.set(hash, css); 12965 for (const targetDocument of runtime.documents.keys()) { 12966 injectStyle25(targetDocument, hash, css); 12967 } 12968 } 12969 if (typeof process === "undefined" || true) { 12970 registerStyle25("b215aa5eaa", ".c8317e9ebb034cfa__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){.c8317e9ebb034cfa__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.c8317e9ebb034cfa__layout{min-height:calc(100vh - 32px)}body:has(.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas) .c8317e9ebb034cfa__layout{min-height:100vh}}:where(.c8317e9ebb034cfa__layout) img{height:auto;max-width:100%}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar ._94ac6b8f274ce2f6__components-snackbar,.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar .components-snackbar{margin-inline:auto}.bfc3fedf39b1cf71__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}.bb4f70cd030be0a3__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.bb4f70cd030be0a3__sidebar._27e6d590dc5963c9__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._0eb5d3a3e94d6273__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._26789cb167e9f578__layout-single-page ._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:46px}._0eb5d3a3e94d6273__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.fb03501e629fd04e__canvas.fa94dab2ab1e36f3__has-mobile-drawer{padding-top:65px;position:relative}.a03baddce3ef2026__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.a03baddce3ef2026__surfaces{margin:8px}._26789cb167e9f578__layout-single-page .a03baddce3ef2026__surfaces{margin-top:0;margin-inline-start:0}}._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:auto}}.d12c9efe707e6cb3__stage{z-index:2}@media (min-width:782px){.d12c9efe707e6cb3__stage{z-index:auto}}._7ffe3a3db6f69647__inspector{z-index:3}@media (min-width:782px){._7ffe3a3db6f69647__inspector{z-index:auto}}.fb03501e629fd04e__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.fb03501e629fd04e__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:auto}._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.f7fe42ef8c67e96f__has-canvas .d12c9efe707e6cb3__stage{max-width:400px}}.fb03501e629fd04e__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .a03baddce3ef2026__surfaces{gap:0;margin:0}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas ._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .d12c9efe707e6cb3__stage{display:none}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:46px}@media (min-width:782px){._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:32px}}@media (max-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage,.fb03501e629fd04e__canvas:not(.fa94dab2ab1e36f3__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.fb03501e629fd04e__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.fb03501e629fd04e__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.d12c9efe707e6cb3__stage{view-transition-name:boot--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.d12c9efe707e6cb3__stage{view-transition-name:boot-safari--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot-safari--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.c8317e9ebb034cfa__layout) *{view-transition-name:none!important}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(root),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.c8317e9ebb034cfa__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-header),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ef68027ea03aa34b__zoomOut;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_0752ac81dff4c432__zoomIn;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_3a2e4dc465681136__slideFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_86a367ac26a1b61e__slideToRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_462399c0e9d64199__slideHeaderFromTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8b272f30d43c9f38__slideHeaderToTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_69ed6a71d53a2e0c__slideSidebarFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:bf0697a36b00caad__slideSidebarToRight;will-change:transform}@keyframes ef68027ea03aa34b__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _0752ac81dff4c432__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _3a2e4dc465681136__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _86a367ac26a1b61e__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _462399c0e9d64199__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8b272f30d43c9f38__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _69ed6a71d53a2e0c__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes bf0697a36b00caad__slideSidebarToRight{to{transform:translateX(100%)}}"); 12971 } 12972 var style_module_default9 = { "layout": "c8317e9ebb034cfa__layout", "has-full-canvas": "e97bb2807a9c4687__has-full-canvas", "notices-snackbar": "b8f8c6cf9ae266bf__notices-snackbar", "components-snackbar": "_94ac6b8f274ce2f6__components-snackbar", "sidebar-backdrop": "bfc3fedf39b1cf71__sidebar-backdrop", "sidebar": "bb4f70cd030be0a3__sidebar", "is-mobile": "_27e6d590dc5963c9__is-mobile", "mobile-sidebar-drawer": "_0eb5d3a3e94d6273__mobile-sidebar-drawer", "layout-single-page": "_26789cb167e9f578__layout-single-page", "canvas": "fb03501e629fd04e__canvas", "has-mobile-drawer": "fa94dab2ab1e36f3__has-mobile-drawer", "surfaces": "a03baddce3ef2026__surfaces", "stage": "d12c9efe707e6cb3__stage", "inspector": "_7ffe3a3db6f69647__inspector", "has-canvas": "f7fe42ef8c67e96f__has-canvas", "zoomOut": "ef68027ea03aa34b__zoomOut", "zoomIn": "_0752ac81dff4c432__zoomIn", "slideFromRight": "_3a2e4dc465681136__slideFromRight", "slideToRight": "_86a367ac26a1b61e__slideToRight", "slideHeaderFromTop": "_462399c0e9d64199__slideHeaderFromTop", "slideHeaderToTop": "_8b272f30d43c9f38__slideHeaderToTop", "slideSidebarFromRight": "_69ed6a71d53a2e0c__slideSidebarFromRight", "slideSidebarToRight": "bf0697a36b00caad__slideSidebarToRight" }; 12973 var { useLocation: useLocation2, useMatches: useMatches3, Outlet } = unlock2(routePrivateApis5); 12974 function Root3() { 12975 const matches = useMatches3(); 12976 const location = useLocation2(); 12977 const currentMatch = matches[matches.length - 1]; 12978 const canvas = currentMatch?.loaderData?.canvas; 12979 const routeContentModule = currentMatch?.loaderData?.routeContentModule; 12980 const isFullScreen = canvas && !canvas.isPreview; 12981 useRouteTitle(); 12982 const isMobileViewport = (0, import_compose5.useViewportMatch)("medium", "<"); 12983 const [isMobileSidebarOpen, setIsMobileSidebarOpen] = (0, import_element41.useState)(false); 12984 const disableMotion = (0, import_compose5.useReducedMotion)(); 12985 (0, import_element41.useEffect)(() => { 12986 setIsMobileSidebarOpen(false); 12987 }, [location.pathname, isMobileViewport]); 12988 const themeColors = (0, import_element41.useMemo)(getAdminThemeColors, []); 12989 const layoutRef = useSyncBodyBackground(); 12990 return /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components14.SlotFillProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(tooltip_exports.Provider, { children: [ 12991 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(PluginArea, {}), 12992 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 12993 import_theme.ThemeProvider, 12994 { 12995 isRoot: true, 12996 color: { ...themeColors, background: "#f8f8f8" }, 12997 children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_theme.ThemeProvider, { color: themeColors, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)( 12998 "div", 12999 { 13000 ref: layoutRef, 13001 className: clsx_default(style_module_default9.layout, { 13002 [style_module_default9["has-canvas"]]: !!canvas || canvas === null, 13003 [style_module_default9["has-full-canvas"]]: isFullScreen 13004 }), 13005 children: [ 13006 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_editor5.UnsavedChangesWarning, {}), 13007 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(SavePanel, {}), 13008 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 13009 import_notices3.SnackbarNotices, 13010 { 13011 className: style_module_default9["notices-snackbar"] 13012 } 13013 ), 13014 isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(page_default.SidebarToggleFill, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 13015 import_components14.Button, 13016 { 13017 icon: menu_default, 13018 onClick: () => setIsMobileSidebarOpen(true), 13019 label: (0, import_i18n18.__)("Open navigation panel"), 13020 size: "compact" 13021 } 13022 ) }), 13023 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components14.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 13024 import_components14.__unstableMotion.div, 13025 { 13026 initial: { opacity: 0 }, 13027 animate: { opacity: 1 }, 13028 exit: { opacity: 0 }, 13029 transition: { 13030 type: "tween", 13031 duration: disableMotion ? 0 : 0.2, 13032 ease: "easeOut" 13033 }, 13034 className: style_module_default9["sidebar-backdrop"], 13035 onClick: () => setIsMobileSidebarOpen(false), 13036 onKeyDown: (event) => { 13037 if (event.key === "Escape") { 13038 setIsMobileSidebarOpen( 13039 false 13040 ); 13041 } 13042 }, 13043 role: "button", 13044 tabIndex: -1, 13045 "aria-label": (0, import_i18n18.__)( 13046 "Close navigation panel" 13047 ) 13048 } 13049 ) }), 13050 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components14.__unstableAnimatePresence, { children: isMobileViewport && isMobileSidebarOpen && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 13051 import_components14.__unstableMotion.div, 13052 { 13053 initial: { x: "-100%" }, 13054 animate: { x: 0 }, 13055 exit: { x: "-100%" }, 13056 transition: { 13057 type: "tween", 13058 duration: disableMotion ? 0 : 0.2, 13059 ease: "easeOut" 13060 }, 13061 className: clsx_default( 13062 style_module_default9.sidebar, 13063 style_module_default9["is-mobile"] 13064 ), 13065 children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Sidebar, {}) 13066 } 13067 ) }), 13068 !isMobileViewport && !isFullScreen && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: style_module_default9.sidebar, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Sidebar, {}) }), 13069 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: style_module_default9.surfaces, children: /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)( 13070 import_theme.ThemeProvider, 13071 { 13072 color: { 13073 ...themeColors, 13074 // Reset to the default background color. 13075 background: "#fcfcfc" 13076 }, 13077 children: [ 13078 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(Outlet, {}), 13079 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)( 13080 "div", 13081 { 13082 className: clsx_default(style_module_default9.canvas, { 13083 [style_module_default9["has-mobile-drawer"]]: canvas?.isPreview && isMobileViewport 13084 }), 13085 children: [ 13086 canvas?.isPreview && isMobileViewport && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 13087 "div", 13088 { 13089 className: style_module_default9["mobile-sidebar-drawer"], 13090 children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 13091 import_components14.Button, 13092 { 13093 icon: menu_default, 13094 onClick: () => setIsMobileSidebarOpen( 13095 true 13096 ), 13097 label: (0, import_i18n18.__)( 13098 "Open navigation panel" 13099 ), 13100 size: "compact" 13101 } 13102 ) 13103 } 13104 ), 13105 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 13106 CanvasRenderer, 13107 { 13108 canvas, 13109 routeContentModule 13110 } 13111 ) }) 13112 ] 13113 } 13114 ) 13115 ] 13116 } 13117 ) }) 13118 ] 13119 } 13120 ) }) 13121 } 13122 ) 13123 ] }) }); 13124 } 13125 13126 // packages/boot/build-module/components/app/router.mjs 13127 var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); 13128 var STYLE_HASH_ATTRIBUTE26 = "data-wp-hash"; 13129 function getRuntime26() { 13130 const globalScope = globalThis; 13131 if (globalScope.__wpStyleRuntime) { 13132 return globalScope.__wpStyleRuntime; 13133 } 13134 globalScope.__wpStyleRuntime = { 13135 documents: /* @__PURE__ */ new Map(), 13136 styles: /* @__PURE__ */ new Map(), 13137 injectedStyles: /* @__PURE__ */ new WeakMap() 13138 }; 13139 if (typeof document !== "undefined") { 13140 registerDocument26(document); 13141 } 13142 return globalScope.__wpStyleRuntime; 13143 } 13144 function documentContainsStyleHash26(targetDocument, hash) { 13145 if (!targetDocument.head) { 13146 return false; 13147 } 13148 for (const style of targetDocument.head.querySelectorAll( 13149 `style[$STYLE_HASH_ATTRIBUTE26}]` 13150 )) { 13151 if (style.getAttribute(STYLE_HASH_ATTRIBUTE26) === hash) { 13152 return true; 13153 } 13154 } 13155 return false; 13156 } 13157 function injectStyle26(targetDocument, hash, css) { 13158 if (!targetDocument.head) { 13159 return; 13160 } 13161 const runtime = getRuntime26(); 13162 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13163 if (!injectedStyles) { 13164 injectedStyles = /* @__PURE__ */ new Set(); 13165 runtime.injectedStyles.set(targetDocument, injectedStyles); 13166 } 13167 if (injectedStyles.has(hash)) { 13168 return; 13169 } 13170 if (documentContainsStyleHash26(targetDocument, hash)) { 13171 injectedStyles.add(hash); 13172 return; 13173 } 13174 const style = targetDocument.createElement("style"); 13175 style.setAttribute(STYLE_HASH_ATTRIBUTE26, hash); 13176 style.appendChild(targetDocument.createTextNode(css)); 13177 targetDocument.head.appendChild(style); 13178 injectedStyles.add(hash); 13179 } 13180 function registerDocument26(targetDocument) { 13181 const runtime = getRuntime26(); 13182 runtime.documents.set( 13183 targetDocument, 13184 (runtime.documents.get(targetDocument) ?? 0) + 1 13185 ); 13186 for (const [hash, css] of runtime.styles) { 13187 injectStyle26(targetDocument, hash, css); 13188 } 13189 return () => { 13190 const count = runtime.documents.get(targetDocument); 13191 if (count === void 0) { 13192 return; 13193 } 13194 if (count <= 1) { 13195 runtime.documents.delete(targetDocument); 13196 return; 13197 } 13198 runtime.documents.set(targetDocument, count - 1); 13199 }; 13200 } 13201 function registerStyle26(hash, css) { 13202 const runtime = getRuntime26(); 13203 runtime.styles.set(hash, css); 13204 for (const targetDocument of runtime.documents.keys()) { 13205 injectStyle26(targetDocument, hash, css); 13206 } 13207 } 13208 if (typeof process === "undefined" || true) { 13209 registerStyle26("b215aa5eaa", ".c8317e9ebb034cfa__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){.c8317e9ebb034cfa__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.c8317e9ebb034cfa__layout{min-height:calc(100vh - 32px)}body:has(.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas) .c8317e9ebb034cfa__layout{min-height:100vh}}:where(.c8317e9ebb034cfa__layout) img{height:auto;max-width:100%}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar ._94ac6b8f274ce2f6__components-snackbar,.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar .components-snackbar{margin-inline:auto}.bfc3fedf39b1cf71__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}.bb4f70cd030be0a3__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.bb4f70cd030be0a3__sidebar._27e6d590dc5963c9__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._0eb5d3a3e94d6273__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._26789cb167e9f578__layout-single-page ._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:46px}._0eb5d3a3e94d6273__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.fb03501e629fd04e__canvas.fa94dab2ab1e36f3__has-mobile-drawer{padding-top:65px;position:relative}.a03baddce3ef2026__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.a03baddce3ef2026__surfaces{margin:8px}._26789cb167e9f578__layout-single-page .a03baddce3ef2026__surfaces{margin-top:0;margin-inline-start:0}}._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:auto}}.d12c9efe707e6cb3__stage{z-index:2}@media (min-width:782px){.d12c9efe707e6cb3__stage{z-index:auto}}._7ffe3a3db6f69647__inspector{z-index:3}@media (min-width:782px){._7ffe3a3db6f69647__inspector{z-index:auto}}.fb03501e629fd04e__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.fb03501e629fd04e__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:auto}._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.f7fe42ef8c67e96f__has-canvas .d12c9efe707e6cb3__stage{max-width:400px}}.fb03501e629fd04e__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .a03baddce3ef2026__surfaces{gap:0;margin:0}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas ._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .d12c9efe707e6cb3__stage{display:none}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:46px}@media (min-width:782px){._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:32px}}@media (max-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage,.fb03501e629fd04e__canvas:not(.fa94dab2ab1e36f3__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.fb03501e629fd04e__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.fb03501e629fd04e__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.d12c9efe707e6cb3__stage{view-transition-name:boot--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.d12c9efe707e6cb3__stage{view-transition-name:boot-safari--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot-safari--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.c8317e9ebb034cfa__layout) *{view-transition-name:none!important}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(root),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.c8317e9ebb034cfa__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-header),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ef68027ea03aa34b__zoomOut;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_0752ac81dff4c432__zoomIn;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_3a2e4dc465681136__slideFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_86a367ac26a1b61e__slideToRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_462399c0e9d64199__slideHeaderFromTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8b272f30d43c9f38__slideHeaderToTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_69ed6a71d53a2e0c__slideSidebarFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:bf0697a36b00caad__slideSidebarToRight;will-change:transform}@keyframes ef68027ea03aa34b__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _0752ac81dff4c432__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _3a2e4dc465681136__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _86a367ac26a1b61e__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _462399c0e9d64199__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8b272f30d43c9f38__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _69ed6a71d53a2e0c__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes bf0697a36b00caad__slideSidebarToRight{to{transform:translateX(100%)}}"); 13210 } 13211 var style_module_default10 = { "layout": "c8317e9ebb034cfa__layout", "has-full-canvas": "e97bb2807a9c4687__has-full-canvas", "notices-snackbar": "b8f8c6cf9ae266bf__notices-snackbar", "components-snackbar": "_94ac6b8f274ce2f6__components-snackbar", "sidebar-backdrop": "bfc3fedf39b1cf71__sidebar-backdrop", "sidebar": "bb4f70cd030be0a3__sidebar", "is-mobile": "_27e6d590dc5963c9__is-mobile", "mobile-sidebar-drawer": "_0eb5d3a3e94d6273__mobile-sidebar-drawer", "layout-single-page": "_26789cb167e9f578__layout-single-page", "canvas": "fb03501e629fd04e__canvas", "has-mobile-drawer": "fa94dab2ab1e36f3__has-mobile-drawer", "surfaces": "a03baddce3ef2026__surfaces", "stage": "d12c9efe707e6cb3__stage", "inspector": "_7ffe3a3db6f69647__inspector", "has-canvas": "f7fe42ef8c67e96f__has-canvas", "zoomOut": "ef68027ea03aa34b__zoomOut", "zoomIn": "_0752ac81dff4c432__zoomIn", "slideFromRight": "_3a2e4dc465681136__slideFromRight", "slideToRight": "_86a367ac26a1b61e__slideToRight", "slideHeaderFromTop": "_462399c0e9d64199__slideHeaderFromTop", "slideHeaderToTop": "_8b272f30d43c9f38__slideHeaderToTop", "slideSidebarFromRight": "_69ed6a71d53a2e0c__slideSidebarFromRight", "slideSidebarToRight": "bf0697a36b00caad__slideSidebarToRight" }; 13212 var { 13213 createLazyRoute, 13214 createRouter, 13215 createRootRoute, 13216 createRoute, 13217 RouterProvider, 13218 createBrowserHistory, 13219 parseHref, 13220 useLoaderData 13221 } = unlock2(routePrivateApis6); 13222 function NotFoundComponent() { 13223 return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: style_module_default10.stage, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(page_default, { title: (0, import_i18n19.__)("Route not found"), hasPadding: true, children: (0, import_i18n19.__)("The page you're looking for does not exist") }) }); 13224 } 13225 function createRouteFromDefinition(route, parentRoute) { 13226 let tanstackRoute = createRoute({ 13227 getParentRoute: () => parentRoute, 13228 path: route.path, 13229 beforeLoad: async (opts) => { 13230 if (route.route_module) { 13231 const module = await import(route.route_module); 13232 const routeConfig = module.route || {}; 13233 if (routeConfig.beforeLoad) { 13234 return routeConfig.beforeLoad({ 13235 params: opts.params || {}, 13236 search: opts.search || {} 13237 }); 13238 } 13239 } 13240 }, 13241 loader: async (opts) => { 13242 let routeConfig = {}; 13243 if (route.route_module) { 13244 const module = await import(route.route_module); 13245 routeConfig = module.route || {}; 13246 } 13247 const context = { 13248 params: opts.params || {}, 13249 search: opts.deps || {} 13250 }; 13251 const [, loaderData, canvasData, titleData] = await Promise.all([ 13252 (0, import_data13.resolveSelect)(import_core_data7.store).getEntityRecord( 13253 "root", 13254 "__unstableBase" 13255 ), 13256 routeConfig.loader ? routeConfig.loader(context) : Promise.resolve(void 0), 13257 routeConfig.canvas ? routeConfig.canvas(context) : Promise.resolve(void 0), 13258 routeConfig.title ? routeConfig.title(context) : Promise.resolve(void 0) 13259 ]); 13260 let inspector = true; 13261 if (routeConfig.inspector) { 13262 inspector = await routeConfig.inspector(context); 13263 } 13264 let stage = true; 13265 if (routeConfig.stage) { 13266 stage = await routeConfig.stage(context); 13267 } 13268 return { 13269 ...loaderData, 13270 canvas: canvasData, 13271 inspector, 13272 stage, 13273 title: titleData, 13274 routeContentModule: route.content_module 13275 }; 13276 }, 13277 loaderDeps: (opts) => opts.search 13278 }); 13279 tanstackRoute = tanstackRoute.lazy(async () => { 13280 const module = route.content_module ? await import(route.content_module) : {}; 13281 const Stage = module.stage; 13282 const Inspector = module.inspector; 13283 return createLazyRoute(route.path)({ 13284 component: function RouteComponent() { 13285 const { inspector: showInspector, stage: showStage } = useLoaderData({ from: route.path }) ?? {}; 13286 return /* @__PURE__ */ (0, import_jsx_runtime54.jsxs)(import_jsx_runtime54.Fragment, { children: [ 13287 Stage && showStage && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: style_module_default10.stage, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Stage, {}) }) }), 13288 Inspector && showInspector && /* @__PURE__ */ (0, import_jsx_runtime54.jsx)("div", { className: style_module_default10.inspector, children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(ErrorBoundary, { children: /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(Inspector, {}) }) }) 13289 ] }); 13290 } 13291 }); 13292 }); 13293 return tanstackRoute; 13294 } 13295 function createRouteTree(routes, rootComponent = Root3) { 13296 const rootRoute = createRootRoute({ 13297 component: rootComponent, 13298 context: () => ({}) 13299 }); 13300 const dynamicRoutes = routes.map( 13301 (route) => createRouteFromDefinition(route, rootRoute) 13302 ); 13303 return rootRoute.addChildren(dynamicRoutes); 13304 } 13305 function createPathHistory() { 13306 return createBrowserHistory({ 13307 parseLocation: () => { 13308 const url = new URL(window.location.href); 13309 const path = url.searchParams.get("p") || "/"; 13310 const pathHref = `$path}$url.hash}`; 13311 return parseHref(pathHref, window.history.state); 13312 }, 13313 createHref: (href) => { 13314 const searchParams = new URLSearchParams(window.location.search); 13315 searchParams.set("p", href); 13316 return `$window.location.pathname}?$searchParams}`; 13317 } 13318 }); 13319 } 13320 function Router({ 13321 routes, 13322 rootComponent = Root3 13323 }) { 13324 const router = (0, import_element42.useMemo)(() => { 13325 const history = createPathHistory(); 13326 const routeTree = createRouteTree(routes, rootComponent); 13327 return createRouter({ 13328 history, 13329 routeTree, 13330 defaultPreload: "intent", 13331 defaultNotFoundComponent: NotFoundComponent, 13332 defaultViewTransition: { 13333 types: ({ 13334 fromLocation 13335 }) => { 13336 if (!fromLocation) { 13337 return false; 13338 } 13339 return ["navigate"]; 13340 } 13341 } 13342 }); 13343 }, [routes, rootComponent]); 13344 return /* @__PURE__ */ (0, import_jsx_runtime54.jsx)(RouterProvider, { router }); 13345 } 13346 13347 // packages/boot/build-module/components/root/single-page.mjs 13348 var import_notices4 = __toESM(require_notices(), 1); 13349 var import_components15 = __toESM(require_components(), 1); 13350 var import_element43 = __toESM(require_element(), 1); 13351 import { privateApis as routePrivateApis7 } from "@wordpress/route"; 13352 var import_theme2 = __toESM(require_theme(), 1); 13353 var import_editor6 = __toESM(require_editor(), 1); 13354 var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); 13355 var STYLE_HASH_ATTRIBUTE27 = "data-wp-hash"; 13356 function getRuntime27() { 13357 const globalScope = globalThis; 13358 if (globalScope.__wpStyleRuntime) { 13359 return globalScope.__wpStyleRuntime; 13360 } 13361 globalScope.__wpStyleRuntime = { 13362 documents: /* @__PURE__ */ new Map(), 13363 styles: /* @__PURE__ */ new Map(), 13364 injectedStyles: /* @__PURE__ */ new WeakMap() 13365 }; 13366 if (typeof document !== "undefined") { 13367 registerDocument27(document); 13368 } 13369 return globalScope.__wpStyleRuntime; 13370 } 13371 function documentContainsStyleHash27(targetDocument, hash) { 13372 if (!targetDocument.head) { 13373 return false; 13374 } 13375 for (const style of targetDocument.head.querySelectorAll( 13376 `style[$STYLE_HASH_ATTRIBUTE27}]` 13377 )) { 13378 if (style.getAttribute(STYLE_HASH_ATTRIBUTE27) === hash) { 13379 return true; 13380 } 13381 } 13382 return false; 13383 } 13384 function injectStyle27(targetDocument, hash, css) { 13385 if (!targetDocument.head) { 13386 return; 13387 } 13388 const runtime = getRuntime27(); 13389 let injectedStyles = runtime.injectedStyles.get(targetDocument); 13390 if (!injectedStyles) { 13391 injectedStyles = /* @__PURE__ */ new Set(); 13392 runtime.injectedStyles.set(targetDocument, injectedStyles); 13393 } 13394 if (injectedStyles.has(hash)) { 13395 return; 13396 } 13397 if (documentContainsStyleHash27(targetDocument, hash)) { 13398 injectedStyles.add(hash); 13399 return; 13400 } 13401 const style = targetDocument.createElement("style"); 13402 style.setAttribute(STYLE_HASH_ATTRIBUTE27, hash); 13403 style.appendChild(targetDocument.createTextNode(css)); 13404 targetDocument.head.appendChild(style); 13405 injectedStyles.add(hash); 13406 } 13407 function registerDocument27(targetDocument) { 13408 const runtime = getRuntime27(); 13409 runtime.documents.set( 13410 targetDocument, 13411 (runtime.documents.get(targetDocument) ?? 0) + 1 13412 ); 13413 for (const [hash, css] of runtime.styles) { 13414 injectStyle27(targetDocument, hash, css); 13415 } 13416 return () => { 13417 const count = runtime.documents.get(targetDocument); 13418 if (count === void 0) { 13419 return; 13420 } 13421 if (count <= 1) { 13422 runtime.documents.delete(targetDocument); 13423 return; 13424 } 13425 runtime.documents.set(targetDocument, count - 1); 13426 }; 13427 } 13428 function registerStyle27(hash, css) { 13429 const runtime = getRuntime27(); 13430 runtime.styles.set(hash, css); 13431 for (const targetDocument of runtime.documents.keys()) { 13432 injectStyle27(targetDocument, hash, css); 13433 } 13434 } 13435 if (typeof process === "undefined" || true) { 13436 registerStyle27("b215aa5eaa", ".c8317e9ebb034cfa__layout{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);display:flex;flex-direction:row;height:100%;isolation:isolate;width:100%}@media (min-width:600px){.c8317e9ebb034cfa__layout{bottom:0;inset-inline-end:0;inset-inline-start:0;min-height:calc(100vh - 46px);position:absolute;top:0}}@media (min-width:782px){.c8317e9ebb034cfa__layout{min-height:calc(100vh - 32px)}body:has(.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas) .c8317e9ebb034cfa__layout{min-height:100vh}}:where(.c8317e9ebb034cfa__layout) img{height:auto;max-width:100%}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar{bottom:var(--wpds-dimension-size-md,32px);box-sizing:border-box;display:flex;flex-direction:column;left:0;padding-inline:16px;pointer-events:none;position:fixed;right:0}.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar ._94ac6b8f274ce2f6__components-snackbar,.c8317e9ebb034cfa__layout .b8f8c6cf9ae266bf__notices-snackbar .components-snackbar{margin-inline:auto}.bfc3fedf39b1cf71__sidebar-backdrop{background-color:rgba(0,0,0,.5);bottom:0;cursor:var(--wpds-cursor-control,pointer);inset-inline-end:0;inset-inline-start:0;position:fixed;top:0;z-index:100002}.bb4f70cd030be0a3__sidebar{flex-shrink:0;height:100%;overflow:hidden;position:relative;width:240px}.bb4f70cd030be0a3__sidebar._27e6d590dc5963c9__is-mobile{background:var(--wpds-color-background-surface-neutral-weak,#f4f4f4);bottom:0;box-shadow:2px 0 8px rgba(0,0,0,.2);inset-inline-start:0;max-width:85vw;position:fixed;top:0;width:300px;z-index:100003}._0eb5d3a3e94d6273__mobile-sidebar-drawer{inset-inline-end:0;inset-inline-start:0;position:fixed;top:0}._26789cb167e9f578__layout-single-page ._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:46px}._0eb5d3a3e94d6273__mobile-sidebar-drawer{align-items:center;background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-bottom:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);display:flex;justify-content:flex-start;padding:16px;z-index:3}.fb03501e629fd04e__canvas.fa94dab2ab1e36f3__has-mobile-drawer{padding-top:65px;position:relative}.a03baddce3ef2026__surfaces{display:flex;flex-grow:1;gap:8px;margin:0}@media (min-width:782px){.a03baddce3ef2026__surfaces{margin:8px}._26789cb167e9f578__layout-single-page .a03baddce3ef2026__surfaces{margin-top:0;margin-inline-start:0}}._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border-radius:0;bottom:0;color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:calc(100vh - 46px);top:46px}@media (min-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage{border-radius:var(--wpds-border-radius-xl,12px);height:auto;margin:0;position:static;width:auto}._26789cb167e9f578__layout-single-page ._7ffe3a3db6f69647__inspector,._26789cb167e9f578__layout-single-page .d12c9efe707e6cb3__stage{height:auto}}.d12c9efe707e6cb3__stage{z-index:2}@media (min-width:782px){.d12c9efe707e6cb3__stage{z-index:auto}}._7ffe3a3db6f69647__inspector{z-index:3}@media (min-width:782px){._7ffe3a3db6f69647__inspector{z-index:auto}}.fb03501e629fd04e__canvas{background:var(--wpds-color-background-surface-neutral,#fcfcfc);border:1px solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);border-radius:0;bottom:0;box-shadow:0 1px 3px rgba(0,0,0,.1);color:var(--wpds-color-foreground-content-neutral,#1e1e1e);flex:1;height:100vh;inset-inline-end:0;inset-inline-start:0;margin:0;overflow-y:auto;position:relative;position:fixed;top:0;width:100vw;z-index:1}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:calc(100vh - 46px);top:46px}@media (min-width:782px){.fb03501e629fd04e__canvas{border-radius:var(--wpds-border-radius-xl,12px);height:auto;position:static;width:auto;z-index:auto}._26789cb167e9f578__layout-single-page .fb03501e629fd04e__canvas{height:auto}._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.f7fe42ef8c67e96f__has-canvas .d12c9efe707e6cb3__stage{max-width:400px}}.fb03501e629fd04e__canvas .interface-interface-skeleton{height:100%;inset-inline-start:0!important;position:relative;top:0!important}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .a03baddce3ef2026__surfaces{gap:0;margin:0}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas ._7ffe3a3db6f69647__inspector,.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .d12c9efe707e6cb3__stage{display:none}.c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{border:none;border-radius:0;bottom:0;box-shadow:none;inset-inline-end:0;inset-inline-start:0;margin:0;max-width:none;overflow:hidden;position:fixed;top:var(--wp-admin--admin-bar--height,0)}._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:46px}@media (min-width:782px){._26789cb167e9f578__layout-single-page .c8317e9ebb034cfa__layout.e97bb2807a9c4687__has-full-canvas .fb03501e629fd04e__canvas{top:32px}}@media (max-width:782px){._7ffe3a3db6f69647__inspector,.d12c9efe707e6cb3__stage,.fb03501e629fd04e__canvas:not(.fa94dab2ab1e36f3__has-mobile-drawer){height:calc(100vh - var(--wp-admin--admin-bar--height, 0px));top:var(--wp-admin--admin-bar--height,0)}._0eb5d3a3e94d6273__mobile-sidebar-drawer{top:var(--wp-admin--admin-bar--height,0)}}@media not (prefers-reduced-motion:reduce){.fb03501e629fd04e__canvas .interface-interface-skeleton__header{view-transition-name:boot--canvas-header}.fb03501e629fd04e__canvas .interface-interface-skeleton__sidebar{view-transition-name:boot--canvas-sidebar}.d12c9efe707e6cb3__stage{view-transition-name:boot--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot--canvas}@supports (-webkit-hyphens:none) and (not (-moz-appearance:none)){.d12c9efe707e6cb3__stage{view-transition-name:boot-safari--stage}._7ffe3a3db6f69647__inspector{view-transition-name:boot-safari--inspector}.fb03501e629fd04e__canvas{view-transition-name:boot-safari--canvas}}}@media (max-width:782px){:root:has(.c8317e9ebb034cfa__layout) *{view-transition-name:none!important}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(root),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(root){animation-duration:.25s}@media not (prefers-reduced-motion:reduce){:root:has(.c8317e9ebb034cfa__layout) .components-popover:first-of-type{view-transition-name:boot--components-popover}}:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-header),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot--canvas-sidebar),:root:has(.c8317e9ebb034cfa__layout)::view-transition-group(boot-safari--canvas){z-index:1}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage){width:auto}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage){background:#fff;border-radius:var(--wpds-border-radius-xl,12px);height:100%;object-fit:none;object-position:left top;overflow:hidden;width:100%}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas),:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas){object-position:center top}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--stage):only-child{animation-name:ef68027ea03aa34b__zoomOut;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--stage):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--inspector):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--stage):only-child{animation-name:_0752ac81dff4c432__zoomIn;will-change:transform,opacity}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot-safari--canvas):only-child{animation-name:_3a2e4dc465681136__slideFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas):only-child,:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot-safari--canvas):only-child{animation-name:_86a367ac26a1b61e__slideToRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-header):only-child{animation-name:_462399c0e9d64199__slideHeaderFromTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-header):only-child{animation-name:_8b272f30d43c9f38__slideHeaderToTop;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-new(boot--canvas-sidebar):only-child{animation-name:_69ed6a71d53a2e0c__slideSidebarFromRight;will-change:transform}:root:has(.c8317e9ebb034cfa__layout)::view-transition-old(boot--canvas-sidebar):only-child{animation-name:bf0697a36b00caad__slideSidebarToRight;will-change:transform}@keyframes ef68027ea03aa34b__zoomOut{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.9)}}@keyframes _0752ac81dff4c432__zoomIn{0%{opacity:0;transform:scale(.95)}to{opacity:1;transform:scale(1)}}@keyframes _3a2e4dc465681136__slideFromRight{0%{transform:translateX(100vw)}to{transform:translateX(0)}}@keyframes _86a367ac26a1b61e__slideToRight{0%{transform:translateX(0)}to{transform:translateX(100vw)}}@keyframes _462399c0e9d64199__slideHeaderFromTop{0%{transform:translateY(-100%)}}@keyframes _8b272f30d43c9f38__slideHeaderToTop{to{transform:translateY(-100%)}}@keyframes _69ed6a71d53a2e0c__slideSidebarFromRight{0%{transform:translateX(100%)}}@keyframes bf0697a36b00caad__slideSidebarToRight{to{transform:translateX(100%)}}"); 13437 } 13438 var style_module_default11 = { "layout": "c8317e9ebb034cfa__layout", "has-full-canvas": "e97bb2807a9c4687__has-full-canvas", "notices-snackbar": "b8f8c6cf9ae266bf__notices-snackbar", "components-snackbar": "_94ac6b8f274ce2f6__components-snackbar", "sidebar-backdrop": "bfc3fedf39b1cf71__sidebar-backdrop", "sidebar": "bb4f70cd030be0a3__sidebar", "is-mobile": "_27e6d590dc5963c9__is-mobile", "mobile-sidebar-drawer": "_0eb5d3a3e94d6273__mobile-sidebar-drawer", "layout-single-page": "_26789cb167e9f578__layout-single-page", "canvas": "fb03501e629fd04e__canvas", "has-mobile-drawer": "fa94dab2ab1e36f3__has-mobile-drawer", "surfaces": "a03baddce3ef2026__surfaces", "stage": "d12c9efe707e6cb3__stage", "inspector": "_7ffe3a3db6f69647__inspector", "has-canvas": "f7fe42ef8c67e96f__has-canvas", "zoomOut": "ef68027ea03aa34b__zoomOut", "zoomIn": "_0752ac81dff4c432__zoomIn", "slideFromRight": "_3a2e4dc465681136__slideFromRight", "slideToRight": "_86a367ac26a1b61e__slideToRight", "slideHeaderFromTop": "_462399c0e9d64199__slideHeaderFromTop", "slideHeaderToTop": "_8b272f30d43c9f38__slideHeaderToTop", "slideSidebarFromRight": "_69ed6a71d53a2e0c__slideSidebarFromRight", "slideSidebarToRight": "bf0697a36b00caad__slideSidebarToRight" }; 13439 var { useMatches: useMatches4, Outlet: Outlet2 } = unlock2(routePrivateApis7); 13440 function RootSinglePage() { 13441 const matches = useMatches4(); 13442 const currentMatch = matches[matches.length - 1]; 13443 const canvas = currentMatch?.loaderData?.canvas; 13444 const routeContentModule = currentMatch?.loaderData?.routeContentModule; 13445 const isFullScreen = canvas && !canvas.isPreview; 13446 useRouteTitle(); 13447 const themeColors = (0, import_element43.useMemo)(getAdminThemeColors, []); 13448 const layoutRef = useSyncBodyBackground(); 13449 return /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)(import_components15.SlotFillProvider, { children: [ 13450 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(PluginArea, {}), 13451 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 13452 import_theme2.ThemeProvider, 13453 { 13454 isRoot: true, 13455 color: { ...themeColors, background: "#f8f8f8" }, 13456 children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_theme2.ThemeProvider, { color: themeColors, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)( 13457 "div", 13458 { 13459 ref: layoutRef, 13460 className: clsx_default( 13461 style_module_default11.layout, 13462 style_module_default11["layout-single-page"], 13463 { 13464 [style_module_default11["has-canvas"]]: !!canvas || canvas === null, 13465 [style_module_default11["has-full-canvas"]]: isFullScreen 13466 } 13467 ), 13468 children: [ 13469 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(import_editor6.UnsavedChangesWarning, {}), 13470 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(SavePanel, {}), 13471 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 13472 import_notices4.SnackbarNotices, 13473 { 13474 className: style_module_default11["notices-snackbar"] 13475 } 13476 ), 13477 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: style_module_default11.surfaces, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsxs)( 13478 import_theme2.ThemeProvider, 13479 { 13480 color: { 13481 ...themeColors, 13482 // Reset to the default background color. 13483 background: "#fcfcfc" 13484 }, 13485 children: [ 13486 /* @__PURE__ */ (0, import_jsx_runtime55.jsx)(Outlet2, {}), 13487 (canvas || canvas === null) && /* @__PURE__ */ (0, import_jsx_runtime55.jsx)("div", { className: style_module_default11.canvas, children: /* @__PURE__ */ (0, import_jsx_runtime55.jsx)( 13488 CanvasRenderer, 13489 { 13490 canvas, 13491 routeContentModule 13492 } 13493 ) }) 13494 ] 13495 } 13496 ) }) 13497 ] 13498 } 13499 ) }) 13500 } 13501 ) 13502 ] }); 13503 } 13504 13505 // packages/boot/build-module/components/app/index.mjs 13506 var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); 13507 function App({ rootComponent }) { 13508 const routes = (0, import_data14.useSelect)((select) => select(store).getRoutes(), []); 13509 return /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(Router, { routes, rootComponent }); 13510 } 13511 async function runInitModules(initModules) { 13512 for (const moduleId of initModules ?? []) { 13513 const module = await import(moduleId); 13514 await module.init(); 13515 } 13516 } 13517 async function init({ 13518 mountId, 13519 menuItems, 13520 routes, 13521 initModules, 13522 dashboardLink 13523 }) { 13524 (menuItems ?? []).forEach((menuItem) => { 13525 (0, import_data14.dispatch)(store).registerMenuItem(menuItem.id, menuItem); 13526 }); 13527 (routes ?? []).forEach((route) => { 13528 (0, import_data14.dispatch)(store).registerRoute(route); 13529 }); 13530 if (dashboardLink) { 13531 (0, import_data14.dispatch)(store).setDashboardLink(dashboardLink); 13532 } 13533 await runInitModules(initModules); 13534 const rootElement = document.getElementById(mountId); 13535 if (rootElement) { 13536 const root = (0, import_element44.createRoot)(rootElement); 13537 root.render( 13538 /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_element44.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(App, {}) }) 13539 ); 13540 } 13541 } 13542 async function initSinglePage({ 13543 mountId, 13544 routes, 13545 initModules 13546 }) { 13547 (routes ?? []).forEach((route) => { 13548 (0, import_data14.dispatch)(store).registerRoute(route); 13549 }); 13550 await runInitModules(initModules); 13551 const rootElement = document.getElementById(mountId); 13552 if (rootElement) { 13553 const root = (0, import_element44.createRoot)(rootElement); 13554 root.render( 13555 /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(import_element44.StrictMode, { children: /* @__PURE__ */ (0, import_jsx_runtime56.jsx)(App, { rootComponent: RootSinglePage }) }) 13556 ); 13557 } 13558 } 13559 export { 13560 init, 13561 initSinglePage, 13562 store 13563 }; 13564 /*! Bundled license information: 13565 13566 use-sync-external-store/cjs/use-sync-external-store-shim.development.js: 13567 (** 13568 * @license React 13569 * use-sync-external-store-shim.development.js 13570 * 13571 * Copyright (c) Meta Platforms, Inc. and affiliates. 13572 * 13573 * This source code is licensed under the MIT license found in the 13574 * LICENSE file in the root directory of this source tree. 13575 *) 13576 13577 use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js: 13578 (** 13579 * @license React 13580 * use-sync-external-store-shim/with-selector.development.js 13581 * 13582 * Copyright (c) Meta Platforms, Inc. and affiliates. 13583 * 13584 * This source code is licensed under the MIT license found in the 13585 * LICENSE file in the root directory of this source tree. 13586 *) 13587 */
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Tue Nov 3 08:20:36 2026 | Cross-referenced by PHPXref |