| [ 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/core-data 32 var require_core_data = __commonJS({ 33 "package-external:@wordpress/core-data"(exports, module) { 34 module.exports = window.wp.coreData; 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/element 46 var require_element = __commonJS({ 47 "package-external:@wordpress/element"(exports, module) { 48 module.exports = window.wp.element; 49 } 50 }); 51 52 // package-external:@wordpress/i18n 53 var require_i18n = __commonJS({ 54 "package-external:@wordpress/i18n"(exports, module) { 55 module.exports = window.wp.i18n; 56 } 57 }); 58 59 // vendor-external:react 60 var require_react = __commonJS({ 61 "vendor-external:react"(exports, module) { 62 module.exports = window.React; 63 } 64 }); 65 66 // vendor-external:react/jsx-runtime 67 var require_jsx_runtime = __commonJS({ 68 "vendor-external:react/jsx-runtime"(exports, module) { 69 module.exports = window.ReactJSXRuntime; 70 } 71 }); 72 73 // vendor-external:react-dom 74 var require_react_dom = __commonJS({ 75 "vendor-external:react-dom"(exports, module) { 76 module.exports = window.ReactDOM; 77 } 78 }); 79 80 // 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/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 === React52.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 = useState13({ 100 inst: { value, getSnapshot } 101 }); 102 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; 103 useLayoutEffect4( 104 function() { 105 inst.value = value; 106 inst.getSnapshot = getSnapshot; 107 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 108 }, 109 [subscribe, value, getSnapshot] 110 ); 111 useEffect14( 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 (error2) { 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 React52 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState13 = React52.useState, useEffect14 = React52.useEffect, useLayoutEffect4 = React52.useLayoutEffect, useDebugValue2 = React52.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 !== React52.useSyncExternalStore ? React52.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/use-sync-external-store/shim/index.js 145 var require_shim = __commonJS({ 146 "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/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js 157 var require_with_selector_development = __commonJS({ 158 "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 React52 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore2 = shim.useSyncExternalStore, useRef19 = React52.useRef, useEffect14 = React52.useEffect, useMemo19 = React52.useMemo, useDebugValue2 = React52.useDebugValue; 166 exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { 167 var instRef = useRef19(null); 168 if (null === instRef.current) { 169 var inst = { hasValue: false, value: null }; 170 instRef.current = inst; 171 } else inst = instRef.current; 172 instRef = useMemo19( 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 = useSyncExternalStore2(subscribe, instRef[0], instRef[1]); 208 useEffect14( 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/use-sync-external-store/shim/with-selector.js 224 var require_with_selector = __commonJS({ 225 "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/primitives 236 var require_primitives = __commonJS({ 237 "package-external:@wordpress/primitives"(exports, module) { 238 module.exports = window.wp.primitives; 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/notices 264 var require_notices = __commonJS({ 265 "package-external:@wordpress/notices"(exports, module) { 266 module.exports = window.wp.notices; 267 } 268 }); 269 270 // packages/user-taxonomies/build-module/utils.mjs 271 var import_core_data = __toESM(require_core_data(), 1); 272 var import_data = __toESM(require_data(), 1); 273 var import_element = __toESM(require_element(), 1); 274 var import_i18n = __toESM(require_i18n(), 1); 275 var BLANK_RECORD = { 276 slug: "", 277 status: "publish", 278 title: { raw: "" }, 279 config: { 280 labels: { singular_name: "" }, 281 object_type: [], 282 description: "", 283 public: true, 284 hierarchical: false 285 } 286 }; 287 var STRING_LABEL_KEYS = [ 288 "singular_name", 289 "menu_name", 290 "all_items", 291 "edit_item", 292 "view_item", 293 "update_item", 294 "add_new_item", 295 "new_item_name", 296 "search_items", 297 "not_found", 298 "back_to_items", 299 "parent_item", 300 "popular_items", 301 "separate_items_with_commas", 302 "parent_item_colon", 303 "add_or_remove_items", 304 "choose_from_most_used" 305 ]; 306 function deriveLabels(plural, singular) { 307 const lcPlural = plural.toLowerCase(); 308 return { 309 menu_name: plural, 310 all_items: (0, import_i18n.sprintf)( 311 /* translators: %s: Plural taxonomy label. */ 312 (0, import_i18n.__)("All %s"), 313 plural 314 ), 315 edit_item: (0, import_i18n.sprintf)( 316 /* translators: %s: Singular taxonomy label. */ 317 (0, import_i18n.__)("Edit %s"), 318 singular 319 ), 320 view_item: (0, import_i18n.sprintf)( 321 /* translators: %s: Singular taxonomy label. */ 322 (0, import_i18n.__)("View %s"), 323 singular 324 ), 325 update_item: (0, import_i18n.sprintf)( 326 /* translators: %s: Singular taxonomy label. */ 327 (0, import_i18n.__)("Update %s"), 328 singular 329 ), 330 add_new_item: (0, import_i18n.sprintf)( 331 /* translators: %s: Singular taxonomy label. */ 332 (0, import_i18n.__)("Add New %s"), 333 singular 334 ), 335 new_item_name: (0, import_i18n.sprintf)( 336 /* translators: %s: Singular taxonomy label. */ 337 (0, import_i18n.__)("New %s Name"), 338 singular 339 ), 340 search_items: (0, import_i18n.sprintf)( 341 /* translators: %s: Plural taxonomy label. */ 342 (0, import_i18n.__)("Search %s"), 343 plural 344 ), 345 not_found: (0, import_i18n.sprintf)( 346 /* translators: %s: Plural taxonomy label, lowercase. */ 347 (0, import_i18n.__)("No %s found."), 348 lcPlural 349 ), 350 back_to_items: (0, import_i18n.sprintf)( 351 /* translators: %s: Plural taxonomy label. */ 352 (0, import_i18n.__)("\u2190 Back to %s"), 353 plural 354 ), 355 parent_item: (0, import_i18n.sprintf)( 356 /* translators: %s: Singular taxonomy label. */ 357 (0, import_i18n.__)("Parent %s"), 358 singular 359 ), 360 popular_items: (0, import_i18n.sprintf)( 361 /* translators: %s: Plural taxonomy label. */ 362 (0, import_i18n.__)("Popular %s"), 363 plural 364 ), 365 separate_items_with_commas: (0, import_i18n.sprintf)( 366 /* translators: %s: Plural taxonomy label, lowercase. */ 367 (0, import_i18n.__)("Separate %s with commas"), 368 lcPlural 369 ), 370 parent_item_colon: (0, import_i18n.sprintf)( 371 /* translators: %s: Singular taxonomy label. */ 372 (0, import_i18n.__)("Parent %s:"), 373 singular 374 ), 375 add_or_remove_items: (0, import_i18n.sprintf)( 376 /* translators: %s: Plural taxonomy label, lowercase. */ 377 (0, import_i18n.__)("Add or remove %s"), 378 lcPlural 379 ), 380 choose_from_most_used: (0, import_i18n.sprintf)( 381 /* translators: %s: Plural taxonomy label, lowercase. */ 382 (0, import_i18n.__)("Choose from the most used %s"), 383 lcPlural 384 ) 385 }; 386 } 387 function toFormData(row) { 388 const config = row.config ?? {}; 389 const labels = {}; 390 for (const key of STRING_LABEL_KEYS) { 391 const value = config.labels?.[key]; 392 if (typeof value === "string") { 393 labels[key] = value; 394 } 395 } 396 return { 397 id: row.id, 398 slug: row.slug, 399 status: row.status, 400 title: { raw: row.title.raw }, 401 config: { 402 labels: { singular_name: "", ...labels }, 403 object_type: Array.isArray(row.object_type) ? row.object_type : [], 404 description: config.description ?? "", 405 public: config.public ?? true, 406 hierarchical: config.hierarchical ?? false 407 } 408 }; 409 } 410 function serializeForSave(data) { 411 const { config } = data; 412 const labels = {}; 413 for (const key of STRING_LABEL_KEYS) { 414 const value = config.labels[key]; 415 if (typeof value === "string" && value.trim() !== "") { 416 labels[key] = value.trim(); 417 } 418 } 419 labels.singular_name = config.labels.singular_name; 420 const description = config.description.trim(); 421 return { 422 ...data.id !== void 0 ? { id: data.id } : {}, 423 slug: data.slug, 424 status: data.status, 425 title: data.title.raw, 426 object_type: config.object_type, 427 config: { 428 labels, 429 public: config.public, 430 hierarchical: config.hierarchical, 431 ...description !== "" ? { description } : {} 432 } 433 }; 434 } 435 function usePublicPostTypes() { 436 const postTypes = (0, import_data.useSelect)( 437 (select) => select(import_core_data.store).getPostTypes({ per_page: -1 }), 438 [] 439 ); 440 return (0, import_element.useMemo)(() => { 441 return postTypes?.filter(({ viewable }) => viewable).sort((a, b) => { 442 if (a.slug === "post") { 443 return -1; 444 } 445 if (b.slug === "post") { 446 return 1; 447 } 448 return a.name.localeCompare(b.name); 449 }); 450 }, [postTypes]); 451 } 452 453 // packages/user-taxonomies/build-module/fields/general.mjs 454 var import_core_data2 = __toESM(require_core_data(), 1); 455 var import_data2 = __toESM(require_data(), 1); 456 var import_element28 = __toESM(require_element(), 1); 457 var import_i18n5 = __toESM(require_i18n(), 1); 458 459 // node_modules/clsx/dist/clsx.mjs 460 function r(e) { 461 var t, f, n = ""; 462 if ("string" == typeof e || "number" == typeof e) n += e; 463 else if ("object" == typeof e) if (Array.isArray(e)) { 464 var o = e.length; 465 for (t = 0; t < o; t++) e[t] && (f = r(e[t])) && (n && (n += " "), n += f); 466 } else for (f in e) e[f] && (n && (n += " "), n += f); 467 return n; 468 } 469 function clsx() { 470 for (var e, t, f = 0, n = "", o = arguments.length; f < o; f++) (e = arguments[f]) && (t = r(e)) && (n && (n += " "), n += t); 471 return n; 472 } 473 var clsx_default = clsx; 474 475 // packages/ui/build-module/badge/badge.mjs 476 var import_element10 = __toESM(require_element(), 1); 477 478 // node_modules/@base-ui/utils/esm/error.js 479 var set; 480 if (true) { 481 set = /* @__PURE__ */ new Set(); 482 } 483 function error(...messages) { 484 if (true) { 485 const messageKey = messages.join(" "); 486 if (!set.has(messageKey)) { 487 set.add(messageKey); 488 console.error(`Base UI: $messageKey}`); 489 } 490 } 491 } 492 493 // node_modules/@base-ui/utils/esm/useStableCallback.js 494 var React2 = __toESM(require_react(), 1); 495 496 // node_modules/@base-ui/utils/esm/useRefWithInit.js 497 var React = __toESM(require_react(), 1); 498 var UNINITIALIZED = {}; 499 function useRefWithInit(init, initArg) { 500 const ref = React.useRef(UNINITIALIZED); 501 if (ref.current === UNINITIALIZED) { 502 ref.current = init(initArg); 503 } 504 return ref; 505 } 506 507 // node_modules/@base-ui/utils/esm/useStableCallback.js 508 var useInsertionEffect = React2[`useInsertionEffect$Math.random().toFixed(1)}`.slice(0, -3)]; 509 var useSafeInsertionEffect = ( 510 // React 17 doesn't have useInsertionEffect. 511 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. 512 useInsertionEffect !== React2.useLayoutEffect ? useInsertionEffect : (fn) => fn() 513 ); 514 function useStableCallback(callback) { 515 const stable = useRefWithInit(createStableCallback).current; 516 stable.next = callback; 517 useSafeInsertionEffect(stable.effect); 518 return stable.trampoline; 519 } 520 function createStableCallback() { 521 const stable = { 522 next: void 0, 523 callback: assertNotCalled, 524 trampoline: (...args) => stable.callback?.(...args), 525 effect: () => { 526 stable.callback = stable.next; 527 } 528 }; 529 return stable; 530 } 531 function assertNotCalled() { 532 if (true) { 533 throw ( 534 /* minify-error-disabled */ 535 new Error("Base UI: Cannot call an event handler while rendering.") 536 ); 537 } 538 } 539 540 // node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js 541 var React3 = __toESM(require_react(), 1); 542 var noop = () => { 543 }; 544 var useIsoLayoutEffect = typeof document !== "undefined" ? React3.useLayoutEffect : noop; 545 546 // node_modules/@base-ui/utils/esm/warn.js 547 var set2; 548 if (true) { 549 set2 = /* @__PURE__ */ new Set(); 550 } 551 function warn(...messages) { 552 if (true) { 553 const messageKey = messages.join(" "); 554 if (!set2.has(messageKey)) { 555 set2.add(messageKey); 556 console.warn(`Base UI: $messageKey}`); 557 } 558 } 559 } 560 561 // node_modules/@base-ui/react/esm/internals/direction-context/DirectionContext.js 562 var React4 = __toESM(require_react(), 1); 563 var DirectionContext = /* @__PURE__ */ React4.createContext(void 0); 564 if (true) DirectionContext.displayName = "DirectionContext"; 565 function useDirection() { 566 const context = React4.useContext(DirectionContext); 567 return context?.direction ?? "ltr"; 568 } 569 570 // node_modules/@base-ui/react/esm/internals/useRenderElement.js 571 var React7 = __toESM(require_react(), 1); 572 573 // node_modules/@base-ui/utils/esm/useMergedRefs.js 574 function useMergedRefs(a, b, c, d) { 575 const forkRef = useRefWithInit(createForkRef).current; 576 if (didChange(forkRef, a, b, c, d)) { 577 update(forkRef, [a, b, c, d]); 578 } 579 return forkRef.callback; 580 } 581 function useMergedRefsN(refs) { 582 const forkRef = useRefWithInit(createForkRef).current; 583 if (didChangeN(forkRef, refs)) { 584 update(forkRef, refs); 585 } 586 return forkRef.callback; 587 } 588 function createForkRef() { 589 return { 590 callback: null, 591 cleanup: null, 592 refs: [] 593 }; 594 } 595 function didChange(forkRef, a, b, c, d) { 596 return forkRef.refs[0] !== a || forkRef.refs[1] !== b || forkRef.refs[2] !== c || forkRef.refs[3] !== d; 597 } 598 function didChangeN(forkRef, newRefs) { 599 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]); 600 } 601 function update(forkRef, refs) { 602 forkRef.refs = refs; 603 if (refs.every((ref) => ref == null)) { 604 forkRef.callback = null; 605 return; 606 } 607 forkRef.callback = (instance) => { 608 if (forkRef.cleanup) { 609 forkRef.cleanup(); 610 forkRef.cleanup = null; 611 } 612 if (instance != null) { 613 const cleanupCallbacks = Array(refs.length).fill(null); 614 for (let i = 0; i < refs.length; i += 1) { 615 const ref = refs[i]; 616 if (ref == null) { 617 continue; 618 } 619 switch (typeof ref) { 620 case "function": { 621 const refCleanup = ref(instance); 622 if (typeof refCleanup === "function") { 623 cleanupCallbacks[i] = refCleanup; 624 } 625 break; 626 } 627 case "object": { 628 ref.current = instance; 629 break; 630 } 631 default: 632 } 633 } 634 forkRef.cleanup = () => { 635 for (let i = 0; i < refs.length; i += 1) { 636 const ref = refs[i]; 637 if (ref == null) { 638 continue; 639 } 640 switch (typeof ref) { 641 case "function": { 642 const cleanupCallback = cleanupCallbacks[i]; 643 if (typeof cleanupCallback === "function") { 644 cleanupCallback(); 645 } else { 646 ref(null); 647 } 648 break; 649 } 650 case "object": { 651 ref.current = null; 652 break; 653 } 654 default: 655 } 656 } 657 }; 658 } 659 }; 660 } 661 662 // node_modules/@base-ui/utils/esm/getReactElementRef.js 663 var React6 = __toESM(require_react(), 1); 664 665 // node_modules/@base-ui/utils/esm/reactVersion.js 666 var React5 = __toESM(require_react(), 1); 667 var majorVersion = parseInt(React5.version, 10); 668 function isReactVersionAtLeast(reactVersionToCheck) { 669 return majorVersion >= reactVersionToCheck; 670 } 671 672 // node_modules/@base-ui/utils/esm/getReactElementRef.js 673 function getReactElementRef(element) { 674 if (!/* @__PURE__ */ React6.isValidElement(element)) { 675 return null; 676 } 677 const reactElement = element; 678 const propsWithRef = reactElement.props; 679 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; 680 } 681 682 // node_modules/@base-ui/utils/esm/mergeObjects.js 683 function mergeObjects(a, b) { 684 if (a && !b) { 685 return a; 686 } 687 if (!a && b) { 688 return b; 689 } 690 if (a || b) { 691 return { 692 ...a, 693 ...b 694 }; 695 } 696 return void 0; 697 } 698 699 // node_modules/@base-ui/utils/esm/empty.js 700 function NOOP() { 701 } 702 var EMPTY_ARRAY = Object.freeze([]); 703 var EMPTY_OBJECT = Object.freeze({}); 704 705 // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js 706 function getStateAttributesProps(state, customMapping) { 707 const props = {}; 708 for (const key in state) { 709 const value = state[key]; 710 if (customMapping?.hasOwnProperty(key)) { 711 const customProps = customMapping[key](value); 712 if (customProps != null) { 713 Object.assign(props, customProps); 714 } 715 continue; 716 } 717 if (value === true) { 718 props[`data-$key.toLowerCase()}`] = ""; 719 } else if (value) { 720 props[`data-$key.toLowerCase()}`] = value.toString(); 721 } 722 } 723 return props; 724 } 725 726 // node_modules/@base-ui/react/esm/utils/resolveClassName.js 727 function resolveClassName(className, state) { 728 return typeof className === "function" ? className(state) : className; 729 } 730 731 // node_modules/@base-ui/react/esm/utils/resolveStyle.js 732 function resolveStyle(style, state) { 733 return typeof style === "function" ? style(state) : style; 734 } 735 736 // node_modules/@base-ui/react/esm/merge-props/mergeProps.js 737 var EMPTY_PROPS = {}; 738 function mergeProps(a, b, c, d, e) { 739 if (!c && !d && !e && !a) { 740 return createInitialMergedProps(b); 741 } 742 let merged = createInitialMergedProps(a); 743 if (b) { 744 merged = mergeInto(merged, b); 745 } 746 if (c) { 747 merged = mergeInto(merged, c); 748 } 749 if (d) { 750 merged = mergeInto(merged, d); 751 } 752 if (e) { 753 merged = mergeInto(merged, e); 754 } 755 return merged; 756 } 757 function mergePropsN(props) { 758 if (props.length === 0) { 759 return EMPTY_PROPS; 760 } 761 if (props.length === 1) { 762 return createInitialMergedProps(props[0]); 763 } 764 let merged = createInitialMergedProps(props[0]); 765 for (let i = 1; i < props.length; i += 1) { 766 merged = mergeInto(merged, props[i]); 767 } 768 return merged; 769 } 770 function createInitialMergedProps(inputProps) { 771 if (isPropsGetter(inputProps)) { 772 return { 773 ...resolvePropsGetter(inputProps, EMPTY_PROPS) 774 }; 775 } 776 return copyInitialProps(inputProps); 777 } 778 function mergeInto(merged, inputProps) { 779 if (isPropsGetter(inputProps)) { 780 return resolvePropsGetter(inputProps, merged); 781 } 782 return mutablyMergeInto(merged, inputProps); 783 } 784 function copyInitialProps(inputProps) { 785 const copiedProps = { 786 ...inputProps 787 }; 788 for (const propName in copiedProps) { 789 const propValue = copiedProps[propName]; 790 if (isEventHandler(propName, propValue)) { 791 copiedProps[propName] = wrapEventHandler(propValue); 792 } 793 } 794 return copiedProps; 795 } 796 function mutablyMergeInto(mergedProps, externalProps) { 797 if (!externalProps) { 798 return mergedProps; 799 } 800 for (const propName in externalProps) { 801 const externalPropValue = externalProps[propName]; 802 switch (propName) { 803 case "style": { 804 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); 805 break; 806 } 807 case "className": { 808 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); 809 break; 810 } 811 default: { 812 if (isEventHandler(propName, externalPropValue)) { 813 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); 814 } else { 815 mergedProps[propName] = externalPropValue; 816 } 817 } 818 } 819 } 820 return mergedProps; 821 } 822 function isEventHandler(key, value) { 823 const code0 = key.charCodeAt(0); 824 const code1 = key.charCodeAt(1); 825 const code2 = key.charCodeAt(2); 826 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); 827 } 828 function isPropsGetter(inputProps) { 829 return typeof inputProps === "function"; 830 } 831 function resolvePropsGetter(inputProps, previousProps) { 832 if (isPropsGetter(inputProps)) { 833 return inputProps(previousProps); 834 } 835 return inputProps ?? EMPTY_PROPS; 836 } 837 function mergeEventHandlers(ourHandler, theirHandler) { 838 if (!theirHandler) { 839 return ourHandler; 840 } 841 if (!ourHandler) { 842 return wrapEventHandler(theirHandler); 843 } 844 return (...args) => { 845 const event = args[0]; 846 if (isSyntheticEvent(event)) { 847 const baseUIEvent = event; 848 makeEventPreventable(baseUIEvent); 849 const result2 = theirHandler(...args); 850 if (!baseUIEvent.baseUIHandlerPrevented) { 851 ourHandler?.(...args); 852 } 853 return result2; 854 } 855 const result = theirHandler(...args); 856 ourHandler?.(...args); 857 return result; 858 }; 859 } 860 function wrapEventHandler(handler) { 861 if (!handler) { 862 return handler; 863 } 864 return (...args) => { 865 const event = args[0]; 866 if (isSyntheticEvent(event)) { 867 makeEventPreventable(event); 868 } 869 return handler(...args); 870 }; 871 } 872 function makeEventPreventable(event) { 873 event.preventBaseUIHandler = () => { 874 event.baseUIHandlerPrevented = true; 875 }; 876 return event; 877 } 878 function mergeClassNames(ourClassName, theirClassName) { 879 if (theirClassName) { 880 if (ourClassName) { 881 return theirClassName + " " + ourClassName; 882 } 883 return theirClassName; 884 } 885 return ourClassName; 886 } 887 function isSyntheticEvent(event) { 888 return event != null && typeof event === "object" && "nativeEvent" in event; 889 } 890 891 // node_modules/@base-ui/react/esm/internals/useRenderElement.js 892 var import_react = __toESM(require_react(), 1); 893 function useRenderElement(element, componentProps, params = {}) { 894 const renderProp = componentProps.render; 895 const outProps = useRenderElementProps(componentProps, params); 896 if (params.enabled === false) { 897 return null; 898 } 899 const state = params.state ?? EMPTY_OBJECT; 900 return evaluateRenderProp(element, renderProp, outProps, state); 901 } 902 function useRenderElementProps(componentProps, params = {}) { 903 const { 904 className: classNameProp, 905 style: styleProp, 906 render: renderProp 907 } = componentProps; 908 const { 909 state = EMPTY_OBJECT, 910 ref, 911 props, 912 stateAttributesMapping: stateAttributesMapping3, 913 enabled = true 914 } = params; 915 const className = enabled ? resolveClassName(classNameProp, state) : void 0; 916 const style = enabled ? resolveStyle(styleProp, state) : void 0; 917 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping3) : EMPTY_OBJECT; 918 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; 919 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; 920 if (typeof document !== "undefined") { 921 if (!enabled) { 922 useMergedRefs(null, null); 923 } else if (Array.isArray(ref)) { 924 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); 925 } else { 926 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); 927 } 928 } 929 if (!enabled) { 930 return EMPTY_OBJECT; 931 } 932 if (className !== void 0) { 933 outProps.className = mergeClassNames(outProps.className, className); 934 } 935 if (style !== void 0) { 936 outProps.style = mergeObjects(outProps.style, style); 937 } 938 return outProps; 939 } 940 function resolveRenderFunctionProps(props) { 941 if (Array.isArray(props)) { 942 return mergePropsN(props); 943 } 944 return mergeProps(void 0, props); 945 } 946 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 947 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; 948 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; 949 function evaluateRenderProp(element, render, props, state) { 950 if (render) { 951 if (typeof render === "function") { 952 if (true) { 953 warnIfRenderPropLooksLikeComponent(render); 954 } 955 return render(props, state); 956 } 957 const mergedProps = mergeProps(props, render.props); 958 mergedProps.ref = props.ref; 959 let newElement = render; 960 if (newElement?.$$typeof === REACT_LAZY_TYPE) { 961 const children = React7.Children.toArray(render); 962 newElement = children[0]; 963 } 964 if (true) { 965 if (!/* @__PURE__ */ React7.isValidElement(newElement)) { 966 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")); 967 } 968 } 969 return /* @__PURE__ */ React7.cloneElement(newElement, mergedProps); 970 } 971 if (element) { 972 if (typeof element === "string") { 973 return renderTag(element, props); 974 } 975 } 976 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); 977 } 978 function warnIfRenderPropLooksLikeComponent(renderFn) { 979 const functionName = renderFn.name; 980 if (functionName.length === 0) { 981 return; 982 } 983 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { 984 return; 985 } 986 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { 987 return; 988 } 989 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"); 990 } 991 function renderTag(Tag, props) { 992 if (Tag === "button") { 993 return /* @__PURE__ */ (0, import_react.createElement)("button", { 994 type: "button", 995 ...props, 996 key: props.key 997 }); 998 } 999 if (Tag === "img") { 1000 return /* @__PURE__ */ (0, import_react.createElement)("img", { 1001 alt: "", 1002 ...props, 1003 key: props.key 1004 }); 1005 } 1006 return /* @__PURE__ */ React7.createElement(Tag, props); 1007 } 1008 1009 // node_modules/@base-ui/react/esm/internals/reason-parts.js 1010 var reason_parts_exports = {}; 1011 __export(reason_parts_exports, { 1012 cancelOpen: () => cancelOpen, 1013 chipRemovePress: () => chipRemovePress, 1014 clearPress: () => clearPress, 1015 closePress: () => closePress, 1016 closeWatcher: () => closeWatcher, 1017 decrementPress: () => decrementPress, 1018 disabled: () => disabled, 1019 drag: () => drag, 1020 escapeKey: () => escapeKey, 1021 focusOut: () => focusOut, 1022 imperativeAction: () => imperativeAction, 1023 incrementPress: () => incrementPress, 1024 inputBlur: () => inputBlur, 1025 inputChange: () => inputChange, 1026 inputClear: () => inputClear, 1027 inputPaste: () => inputPaste, 1028 inputPress: () => inputPress, 1029 itemPress: () => itemPress, 1030 keyboard: () => keyboard, 1031 linkPress: () => linkPress, 1032 listNavigation: () => listNavigation, 1033 none: () => none, 1034 outsidePress: () => outsidePress, 1035 pointer: () => pointer, 1036 scrub: () => scrub, 1037 siblingOpen: () => siblingOpen, 1038 swipe: () => swipe, 1039 trackPress: () => trackPress, 1040 triggerFocus: () => triggerFocus, 1041 triggerHover: () => triggerHover, 1042 triggerPress: () => triggerPress, 1043 wheel: () => wheel, 1044 windowResize: () => windowResize 1045 }); 1046 var none = "none"; 1047 var triggerPress = "trigger-press"; 1048 var triggerHover = "trigger-hover"; 1049 var triggerFocus = "trigger-focus"; 1050 var outsidePress = "outside-press"; 1051 var itemPress = "item-press"; 1052 var closePress = "close-press"; 1053 var linkPress = "link-press"; 1054 var clearPress = "clear-press"; 1055 var chipRemovePress = "chip-remove-press"; 1056 var trackPress = "track-press"; 1057 var incrementPress = "increment-press"; 1058 var decrementPress = "decrement-press"; 1059 var inputChange = "input-change"; 1060 var inputClear = "input-clear"; 1061 var inputBlur = "input-blur"; 1062 var inputPaste = "input-paste"; 1063 var inputPress = "input-press"; 1064 var focusOut = "focus-out"; 1065 var escapeKey = "escape-key"; 1066 var closeWatcher = "close-watcher"; 1067 var listNavigation = "list-navigation"; 1068 var keyboard = "keyboard"; 1069 var pointer = "pointer"; 1070 var drag = "drag"; 1071 var wheel = "wheel"; 1072 var scrub = "scrub"; 1073 var cancelOpen = "cancel-open"; 1074 var siblingOpen = "sibling-open"; 1075 var disabled = "disabled"; 1076 var imperativeAction = "imperative-action"; 1077 var swipe = "swipe"; 1078 var windowResize = "window-resize"; 1079 1080 // node_modules/@base-ui/react/esm/internals/createBaseUIEventDetails.js 1081 function createChangeEventDetails(reason, event, trigger, customProperties) { 1082 let canceled = false; 1083 let allowPropagation = false; 1084 const custom = customProperties ?? EMPTY_OBJECT; 1085 const details = { 1086 reason, 1087 event: event ?? new Event("base-ui"), 1088 cancel() { 1089 canceled = true; 1090 }, 1091 allowPropagation() { 1092 allowPropagation = true; 1093 }, 1094 get isCanceled() { 1095 return canceled; 1096 }, 1097 get isPropagationAllowed() { 1098 return allowPropagation; 1099 }, 1100 trigger, 1101 ...custom 1102 }; 1103 return details; 1104 } 1105 1106 // node_modules/@base-ui/utils/esm/useId.js 1107 var React9 = __toESM(require_react(), 1); 1108 1109 // node_modules/@base-ui/utils/esm/safeReact.js 1110 var React8 = __toESM(require_react(), 1); 1111 var SafeReact = { 1112 ...React8 1113 }; 1114 1115 // node_modules/@base-ui/utils/esm/useId.js 1116 var globalId = 0; 1117 function useGlobalId(idOverride, prefix = "mui") { 1118 const [defaultId, setDefaultId] = React9.useState(idOverride); 1119 const id = idOverride || defaultId; 1120 React9.useEffect(() => { 1121 if (defaultId == null) { 1122 globalId += 1; 1123 setDefaultId(`$prefix}-$globalId}`); 1124 } 1125 }, [defaultId, prefix]); 1126 return id; 1127 } 1128 var maybeReactUseId = SafeReact.useId; 1129 function useId(idOverride, prefix) { 1130 if (maybeReactUseId !== void 0) { 1131 const reactId = maybeReactUseId(); 1132 return idOverride ?? (prefix ? `$prefix}-$reactId}` : reactId); 1133 } 1134 return useGlobalId(idOverride, prefix); 1135 } 1136 1137 // node_modules/@base-ui/react/esm/internals/useBaseUiId.js 1138 function useBaseUiId(idOverride) { 1139 return useId(idOverride, "base-ui"); 1140 } 1141 1142 // node_modules/@base-ui/react/esm/internals/useAnimationsFinished.js 1143 var ReactDOM = __toESM(require_react_dom(), 1); 1144 1145 // node_modules/@base-ui/utils/esm/useOnMount.js 1146 var React10 = __toESM(require_react(), 1); 1147 var EMPTY = []; 1148 function useOnMount(fn) { 1149 React10.useEffect(fn, EMPTY); 1150 } 1151 1152 // node_modules/@base-ui/utils/esm/useAnimationFrame.js 1153 var EMPTY2 = null; 1154 var LAST_RAF = globalThis.requestAnimationFrame; 1155 var Scheduler = class { 1156 /* This implementation uses an array as a backing data-structure for frame callbacks. 1157 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it 1158 * never calls the native `cancelAnimationFrame` if there are no frames left. This can 1159 * be much more efficient if there is a call pattern that alterns as 1160 * "request-cancel-request-cancel-…". 1161 * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation 1162 * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ 1163 callbacks = []; 1164 callbacksCount = 0; 1165 nextId = 1; 1166 startId = 1; 1167 isScheduled = false; 1168 tick = (timestamp) => { 1169 this.isScheduled = false; 1170 const currentCallbacks = this.callbacks; 1171 const currentCallbacksCount = this.callbacksCount; 1172 this.callbacks = []; 1173 this.callbacksCount = 0; 1174 this.startId = this.nextId; 1175 if (currentCallbacksCount > 0) { 1176 for (let i = 0; i < currentCallbacks.length; i += 1) { 1177 currentCallbacks[i]?.(timestamp); 1178 } 1179 } 1180 }; 1181 request(fn) { 1182 const id = this.nextId; 1183 this.nextId += 1; 1184 this.callbacks.push(fn); 1185 this.callbacksCount += 1; 1186 const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); 1187 if (!this.isScheduled || didRAFChange) { 1188 requestAnimationFrame(this.tick); 1189 this.isScheduled = true; 1190 } 1191 return id; 1192 } 1193 cancel(id) { 1194 const index2 = id - this.startId; 1195 if (index2 < 0 || index2 >= this.callbacks.length) { 1196 return; 1197 } 1198 this.callbacks[index2] = null; 1199 this.callbacksCount -= 1; 1200 } 1201 }; 1202 var scheduler = new Scheduler(); 1203 var AnimationFrame = class _AnimationFrame { 1204 static create() { 1205 return new _AnimationFrame(); 1206 } 1207 static request(fn) { 1208 return scheduler.request(fn); 1209 } 1210 static cancel(id) { 1211 return scheduler.cancel(id); 1212 } 1213 currentId = EMPTY2; 1214 /** 1215 * Executes `fn` after `delay`, clearing any previously scheduled call. 1216 */ 1217 request(fn) { 1218 this.cancel(); 1219 this.currentId = scheduler.request(() => { 1220 this.currentId = EMPTY2; 1221 fn(); 1222 }); 1223 } 1224 cancel = () => { 1225 if (this.currentId !== EMPTY2) { 1226 scheduler.cancel(this.currentId); 1227 this.currentId = EMPTY2; 1228 } 1229 }; 1230 disposeEffect = () => { 1231 return this.cancel; 1232 }; 1233 }; 1234 function useAnimationFrame() { 1235 const timeout = useRefWithInit(AnimationFrame.create).current; 1236 useOnMount(timeout.disposeEffect); 1237 return timeout; 1238 } 1239 1240 // node_modules/@base-ui/react/esm/utils/resolveRef.js 1241 function resolveRef(maybeRef) { 1242 if (maybeRef == null) { 1243 return maybeRef; 1244 } 1245 return "current" in maybeRef ? maybeRef.current : maybeRef; 1246 } 1247 1248 // node_modules/@base-ui/react/esm/internals/stateAttributesMapping.js 1249 var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { 1250 TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; 1251 TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; 1252 return TransitionStatusDataAttributes2; 1253 })({}); 1254 var STARTING_HOOK = { 1255 [TransitionStatusDataAttributes.startingStyle]: "" 1256 }; 1257 var ENDING_HOOK = { 1258 [TransitionStatusDataAttributes.endingStyle]: "" 1259 }; 1260 var transitionStatusMapping = { 1261 transitionStatus(value) { 1262 if (value === "starting") { 1263 return STARTING_HOOK; 1264 } 1265 if (value === "ending") { 1266 return ENDING_HOOK; 1267 } 1268 return null; 1269 } 1270 }; 1271 1272 // node_modules/@base-ui/react/esm/internals/useAnimationsFinished.js 1273 function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) { 1274 const frame = useAnimationFrame(); 1275 return useStableCallback((fnToExecute, signal = null) => { 1276 frame.cancel(); 1277 const element = resolveRef(elementOrRef); 1278 if (element == null) { 1279 return; 1280 } 1281 const resolvedElement = element; 1282 const done = () => { 1283 ReactDOM.flushSync(fnToExecute); 1284 }; 1285 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { 1286 fnToExecute(); 1287 return; 1288 } 1289 function exec() { 1290 Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { 1291 if (!signal?.aborted) { 1292 done(); 1293 } 1294 }).catch(() => { 1295 if (treatAbortedAsFinished) { 1296 if (!signal?.aborted) { 1297 done(); 1298 } 1299 return; 1300 } 1301 const currentAnimations = resolvedElement.getAnimations(); 1302 if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { 1303 exec(); 1304 } 1305 }); 1306 } 1307 if (waitForStartingStyleRemoved) { 1308 const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle; 1309 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1310 frame.request(exec); 1311 return; 1312 } 1313 const attributeObserver = new MutationObserver(() => { 1314 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 1315 attributeObserver.disconnect(); 1316 exec(); 1317 } 1318 }); 1319 attributeObserver.observe(resolvedElement, { 1320 attributes: true, 1321 attributeFilter: [startingStyleAttribute] 1322 }); 1323 signal?.addEventListener("abort", () => attributeObserver.disconnect(), { 1324 once: true 1325 }); 1326 return; 1327 } 1328 frame.request(exec); 1329 }); 1330 } 1331 1332 // node_modules/@base-ui/react/esm/internals/useTransitionStatus.js 1333 var React11 = __toESM(require_react(), 1); 1334 function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { 1335 const [transitionStatus, setTransitionStatus] = React11.useState(open && enableIdleState ? "idle" : void 0); 1336 const [mounted, setMounted] = React11.useState(open); 1337 if (open && !mounted) { 1338 setMounted(true); 1339 setTransitionStatus("starting"); 1340 } 1341 if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { 1342 setTransitionStatus("ending"); 1343 } 1344 if (!open && !mounted && transitionStatus === "ending") { 1345 setTransitionStatus(void 0); 1346 } 1347 useIsoLayoutEffect(() => { 1348 if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { 1349 const frame = AnimationFrame.request(() => { 1350 setTransitionStatus("ending"); 1351 }); 1352 return () => { 1353 AnimationFrame.cancel(frame); 1354 }; 1355 } 1356 return void 0; 1357 }, [open, mounted, transitionStatus, deferEndingState]); 1358 useIsoLayoutEffect(() => { 1359 if (!open || enableIdleState) { 1360 return void 0; 1361 } 1362 const frame = AnimationFrame.request(() => { 1363 setTransitionStatus(void 0); 1364 }); 1365 return () => { 1366 AnimationFrame.cancel(frame); 1367 }; 1368 }, [enableIdleState, open]); 1369 useIsoLayoutEffect(() => { 1370 if (!open || !enableIdleState) { 1371 return void 0; 1372 } 1373 if (open && mounted && transitionStatus !== "idle") { 1374 setTransitionStatus("starting"); 1375 } 1376 const frame = AnimationFrame.request(() => { 1377 setTransitionStatus("idle"); 1378 }); 1379 return () => { 1380 AnimationFrame.cancel(frame); 1381 }; 1382 }, [enableIdleState, open, mounted, transitionStatus]); 1383 return { 1384 mounted, 1385 setMounted, 1386 transitionStatus 1387 }; 1388 } 1389 1390 // node_modules/@base-ui/react/esm/internals/use-button/useButton.js 1391 var React14 = __toESM(require_react(), 1); 1392 1393 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 1394 function hasWindow() { 1395 return typeof window !== "undefined"; 1396 } 1397 function getNodeName(node) { 1398 if (isNode(node)) { 1399 return (node.nodeName || "").toLowerCase(); 1400 } 1401 return "#document"; 1402 } 1403 function getWindow(node) { 1404 var _node$ownerDocument; 1405 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 1406 } 1407 function getDocumentElement(node) { 1408 var _ref; 1409 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 1410 } 1411 function isNode(value) { 1412 if (!hasWindow()) { 1413 return false; 1414 } 1415 return value instanceof Node || value instanceof getWindow(value).Node; 1416 } 1417 function isElement(value) { 1418 if (!hasWindow()) { 1419 return false; 1420 } 1421 return value instanceof Element || value instanceof getWindow(value).Element; 1422 } 1423 function isHTMLElement(value) { 1424 if (!hasWindow()) { 1425 return false; 1426 } 1427 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 1428 } 1429 function isShadowRoot(value) { 1430 if (!hasWindow() || typeof ShadowRoot === "undefined") { 1431 return false; 1432 } 1433 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 1434 } 1435 function isOverflowElement(element) { 1436 const { 1437 overflow, 1438 overflowX, 1439 overflowY, 1440 display 1441 } = getComputedStyle2(element); 1442 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; 1443 } 1444 function isTableElement(element) { 1445 return /^(table|td|th)$/.test(getNodeName(element)); 1446 } 1447 function isTopLayer(element) { 1448 try { 1449 if (element.matches(":popover-open")) { 1450 return true; 1451 } 1452 } catch (_e) { 1453 } 1454 try { 1455 return element.matches(":modal"); 1456 } catch (_e) { 1457 return false; 1458 } 1459 } 1460 var willChangeRe = /transform|translate|scale|rotate|perspective|filter/; 1461 var containRe = /paint|layout|strict|content/; 1462 var isNotNone = (value) => !!value && value !== "none"; 1463 var isWebKitValue; 1464 function isContainingBlock(elementOrCss) { 1465 const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; 1466 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 || ""); 1467 } 1468 function getContainingBlock(element) { 1469 let currentNode = getParentNode(element); 1470 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 1471 if (isContainingBlock(currentNode)) { 1472 return currentNode; 1473 } else if (isTopLayer(currentNode)) { 1474 return null; 1475 } 1476 currentNode = getParentNode(currentNode); 1477 } 1478 return null; 1479 } 1480 function isWebKit() { 1481 if (isWebKitValue == null) { 1482 isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); 1483 } 1484 return isWebKitValue; 1485 } 1486 function isLastTraversableNode(node) { 1487 return /^(html|body|#document)$/.test(getNodeName(node)); 1488 } 1489 function getComputedStyle2(element) { 1490 return getWindow(element).getComputedStyle(element); 1491 } 1492 function getNodeScroll(element) { 1493 if (isElement(element)) { 1494 return { 1495 scrollLeft: element.scrollLeft, 1496 scrollTop: element.scrollTop 1497 }; 1498 } 1499 return { 1500 scrollLeft: element.scrollX, 1501 scrollTop: element.scrollY 1502 }; 1503 } 1504 function getParentNode(node) { 1505 if (getNodeName(node) === "html") { 1506 return node; 1507 } 1508 const result = ( 1509 // Step into the shadow DOM of the parent of a slotted node. 1510 node.assignedSlot || // DOM Element detected. 1511 node.parentNode || // ShadowRoot detected. 1512 isShadowRoot(node) && node.host || // Fallback. 1513 getDocumentElement(node) 1514 ); 1515 return isShadowRoot(result) ? result.host : result; 1516 } 1517 function getNearestOverflowAncestor(node) { 1518 const parentNode = getParentNode(node); 1519 if (isLastTraversableNode(parentNode)) { 1520 return node.ownerDocument ? node.ownerDocument.body : node.body; 1521 } 1522 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 1523 return parentNode; 1524 } 1525 return getNearestOverflowAncestor(parentNode); 1526 } 1527 function getOverflowAncestors(node, list, traverseIframes) { 1528 var _node$ownerDocument2; 1529 if (list === void 0) { 1530 list = []; 1531 } 1532 if (traverseIframes === void 0) { 1533 traverseIframes = true; 1534 } 1535 const scrollableAncestor = getNearestOverflowAncestor(node); 1536 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 1537 const win = getWindow(scrollableAncestor); 1538 if (isBody) { 1539 const frameElement = getFrameElement(win); 1540 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 1541 } else { 1542 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 1543 } 1544 } 1545 function getFrameElement(win) { 1546 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 1547 } 1548 1549 // node_modules/@base-ui/react/esm/internals/composite/root/CompositeRootContext.js 1550 var React12 = __toESM(require_react(), 1); 1551 var CompositeRootContext = /* @__PURE__ */ React12.createContext(void 0); 1552 if (true) CompositeRootContext.displayName = "CompositeRootContext"; 1553 function useCompositeRootContext(optional = false) { 1554 const context = React12.useContext(CompositeRootContext); 1555 if (context === void 0 && !optional) { 1556 throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within <Composite.Root>." : formatErrorMessage_default(16)); 1557 } 1558 return context; 1559 } 1560 1561 // node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js 1562 var React13 = __toESM(require_react(), 1); 1563 function useFocusableWhenDisabled(parameters) { 1564 const { 1565 focusableWhenDisabled, 1566 disabled: disabled2, 1567 composite = false, 1568 tabIndex: tabIndexProp = 0, 1569 isNativeButton 1570 } = parameters; 1571 const isFocusableComposite = composite && focusableWhenDisabled !== false; 1572 const isNonFocusableComposite = composite && focusableWhenDisabled === false; 1573 const props = React13.useMemo(() => { 1574 const additionalProps = { 1575 // allow Tabbing away from focusableWhenDisabled elements 1576 onKeyDown(event) { 1577 if (disabled2 && focusableWhenDisabled && event.key !== "Tab") { 1578 event.preventDefault(); 1579 } 1580 } 1581 }; 1582 if (!composite) { 1583 additionalProps.tabIndex = tabIndexProp; 1584 if (!isNativeButton && disabled2) { 1585 additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1; 1586 } 1587 } 1588 if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) { 1589 additionalProps["aria-disabled"] = disabled2; 1590 } 1591 if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) { 1592 additionalProps.disabled = disabled2; 1593 } 1594 return additionalProps; 1595 }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]); 1596 return { 1597 props 1598 }; 1599 } 1600 1601 // node_modules/@base-ui/react/esm/internals/use-button/useButton.js 1602 function useButton(parameters = {}) { 1603 const { 1604 disabled: disabled2 = false, 1605 focusableWhenDisabled, 1606 tabIndex = 0, 1607 native: isNativeButton = true, 1608 composite: compositeProp 1609 } = parameters; 1610 const elementRef = React14.useRef(null); 1611 const compositeRootContext = useCompositeRootContext(true); 1612 const isCompositeItem = compositeProp ?? compositeRootContext !== void 0; 1613 const { 1614 props: focusableWhenDisabledProps 1615 } = useFocusableWhenDisabled({ 1616 focusableWhenDisabled, 1617 disabled: disabled2, 1618 composite: isCompositeItem, 1619 tabIndex, 1620 isNativeButton 1621 }); 1622 if (true) { 1623 React14.useEffect(() => { 1624 if (!elementRef.current) { 1625 return; 1626 } 1627 const isButtonTag = isButtonElement(elementRef.current); 1628 if (isNativeButton) { 1629 if (!isButtonTag) { 1630 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 1631 const message = "A component that acts as a button expected a native <button> because the `nativeButton` prop is true. Rendering a non-<button> removes native button semantics, which can impact forms and accessibility. Use a real <button> in the `render` prop, or set `nativeButton` to `false`."; 1632 error(`$message}$ownerStackMessage}`); 1633 } 1634 } else if (isButtonTag) { 1635 const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; 1636 const message = "A component that acts as a button expected a non-<button> because the `nativeButton` prop is false. Rendering a <button> keeps native behavior while Base UI applies non-native attributes and handlers, which can add unintended extra attributes (such as `role` or `aria-disabled`). Use a non-<button> in the `render` prop, or set `nativeButton` to `true`."; 1637 error(`$message}$ownerStackMessage}`); 1638 } 1639 }, [isNativeButton]); 1640 } 1641 const updateDisabled = React14.useCallback(() => { 1642 const element = elementRef.current; 1643 if (!isButtonElement(element)) { 1644 return; 1645 } 1646 if (isCompositeItem && disabled2 && focusableWhenDisabledProps.disabled === void 0 && element.disabled) { 1647 element.disabled = false; 1648 } 1649 }, [disabled2, focusableWhenDisabledProps.disabled, isCompositeItem]); 1650 useIsoLayoutEffect(updateDisabled, [updateDisabled]); 1651 const getButtonProps = React14.useCallback((externalProps = {}) => { 1652 const { 1653 onClick: externalOnClick, 1654 onMouseDown: externalOnMouseDown, 1655 onKeyUp: externalOnKeyUp, 1656 onKeyDown: externalOnKeyDown, 1657 onPointerDown: externalOnPointerDown, 1658 ...otherExternalProps 1659 } = externalProps; 1660 const type = isNativeButton ? "button" : void 0; 1661 return mergeProps({ 1662 type, 1663 onClick(event) { 1664 if (disabled2) { 1665 event.preventDefault(); 1666 return; 1667 } 1668 externalOnClick?.(event); 1669 }, 1670 onMouseDown(event) { 1671 if (!disabled2) { 1672 externalOnMouseDown?.(event); 1673 } 1674 }, 1675 onKeyDown(event) { 1676 if (disabled2) { 1677 return; 1678 } 1679 makeEventPreventable(event); 1680 externalOnKeyDown?.(event); 1681 if (event.baseUIHandlerPrevented) { 1682 return; 1683 } 1684 const isCurrentTarget = event.target === event.currentTarget; 1685 const currentTarget = event.currentTarget; 1686 const isButton = isButtonElement(currentTarget); 1687 const isLink = !isNativeButton && isValidLinkElement(currentTarget); 1688 const shouldClick = isCurrentTarget && (isNativeButton ? isButton : !isLink); 1689 const isEnterKey = event.key === "Enter"; 1690 const isSpaceKey = event.key === " "; 1691 const role = currentTarget.getAttribute("role"); 1692 const isTextNavigationRole = role?.startsWith("menuitem") || role === "option" || role === "gridcell"; 1693 if (isCurrentTarget && isCompositeItem && isSpaceKey) { 1694 if (event.defaultPrevented && isTextNavigationRole) { 1695 return; 1696 } 1697 event.preventDefault(); 1698 if (isLink || isNativeButton && isButton) { 1699 currentTarget.click(); 1700 event.preventBaseUIHandler(); 1701 } else if (shouldClick) { 1702 externalOnClick?.(event); 1703 event.preventBaseUIHandler(); 1704 } 1705 return; 1706 } 1707 if (shouldClick) { 1708 if (!isNativeButton && (isSpaceKey || isEnterKey)) { 1709 event.preventDefault(); 1710 } 1711 if (!isNativeButton && isEnterKey) { 1712 externalOnClick?.(event); 1713 } 1714 } 1715 }, 1716 onKeyUp(event) { 1717 if (disabled2) { 1718 return; 1719 } 1720 makeEventPreventable(event); 1721 externalOnKeyUp?.(event); 1722 if (event.target === event.currentTarget && isNativeButton && isCompositeItem && isButtonElement(event.currentTarget) && event.key === " ") { 1723 event.preventDefault(); 1724 return; 1725 } 1726 if (event.baseUIHandlerPrevented) { 1727 return; 1728 } 1729 if (event.target === event.currentTarget && !isNativeButton && !isCompositeItem && event.key === " ") { 1730 externalOnClick?.(event); 1731 } 1732 }, 1733 onPointerDown(event) { 1734 if (disabled2) { 1735 event.preventDefault(); 1736 return; 1737 } 1738 externalOnPointerDown?.(event); 1739 } 1740 }, !isNativeButton ? { 1741 role: "button" 1742 } : void 0, focusableWhenDisabledProps, otherExternalProps); 1743 }, [disabled2, focusableWhenDisabledProps, isCompositeItem, isNativeButton]); 1744 const buttonRef = useStableCallback((element) => { 1745 elementRef.current = element; 1746 updateDisabled(); 1747 }); 1748 return { 1749 getButtonProps, 1750 buttonRef 1751 }; 1752 } 1753 function isButtonElement(elem) { 1754 return isHTMLElement(elem) && elem.tagName === "BUTTON"; 1755 } 1756 function isValidLinkElement(elem) { 1757 return Boolean(elem?.tagName === "A" && elem?.href); 1758 } 1759 1760 // node_modules/@base-ui/utils/esm/detectBrowser.js 1761 var hasNavigator = typeof navigator !== "undefined"; 1762 var nav = getNavigatorData(); 1763 var platform = getPlatform(); 1764 var userAgent = getUserAgent(); 1765 var isWebKit2 = typeof CSS === "undefined" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter:none"); 1766 var isIOS = ( 1767 // iPads can claim to be MacIntel 1768 nav.platform === "MacIntel" && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform) 1769 ); 1770 var isFirefox = hasNavigator && /firefox/i.test(userAgent); 1771 var isSafari = hasNavigator && /apple/i.test(navigator.vendor); 1772 var isEdge = hasNavigator && /Edg/i.test(userAgent); 1773 var isAndroid = hasNavigator && /android/i.test(platform) || /android/i.test(userAgent); 1774 var isMac = hasNavigator && platform.toLowerCase().startsWith("mac") && !navigator.maxTouchPoints; 1775 var isJSDOM = userAgent.includes("jsdom/"); 1776 function getNavigatorData() { 1777 if (!hasNavigator) { 1778 return { 1779 platform: "", 1780 maxTouchPoints: -1 1781 }; 1782 } 1783 const uaData = navigator.userAgentData; 1784 if (uaData?.platform) { 1785 return { 1786 platform: uaData.platform, 1787 maxTouchPoints: navigator.maxTouchPoints 1788 }; 1789 } 1790 return { 1791 platform: navigator.platform ?? "", 1792 maxTouchPoints: navigator.maxTouchPoints ?? -1 1793 }; 1794 } 1795 function getUserAgent() { 1796 if (!hasNavigator) { 1797 return ""; 1798 } 1799 const uaData = navigator.userAgentData; 1800 if (uaData && Array.isArray(uaData.brands)) { 1801 return uaData.brands.map(({ 1802 brand, 1803 version: version2 1804 }) => `$brand}/$version2}`).join(" "); 1805 } 1806 return navigator.userAgent; 1807 } 1808 function getPlatform() { 1809 if (!hasNavigator) { 1810 return ""; 1811 } 1812 const uaData = navigator.userAgentData; 1813 if (uaData?.platform) { 1814 return uaData.platform; 1815 } 1816 return navigator.platform ?? ""; 1817 } 1818 1819 // node_modules/@base-ui/react/esm/floating-ui-react/utils/constants.js 1820 var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; 1821 var ACTIVE_KEY = "active"; 1822 var SELECTED_KEY = "selected"; 1823 var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; 1824 1825 // node_modules/@base-ui/react/esm/internals/shadowDom.js 1826 function activeElement(doc) { 1827 let element = doc.activeElement; 1828 while (element?.shadowRoot?.activeElement != null) { 1829 element = element.shadowRoot.activeElement; 1830 } 1831 return element; 1832 } 1833 function contains(parent, child) { 1834 if (!parent || !child) { 1835 return false; 1836 } 1837 const rootNode = child.getRootNode?.(); 1838 if (parent.contains(child)) { 1839 return true; 1840 } 1841 if (rootNode && isShadowRoot(rootNode)) { 1842 let next = child; 1843 while (next) { 1844 if (parent === next) { 1845 return true; 1846 } 1847 next = next.parentNode || next.host; 1848 } 1849 } 1850 return false; 1851 } 1852 function getTarget(event) { 1853 if ("composedPath" in event) { 1854 return event.composedPath()[0]; 1855 } 1856 return event.target; 1857 } 1858 1859 // node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js 1860 function isTargetInsideEnabledTrigger(target, triggerElements) { 1861 if (!isElement(target)) { 1862 return false; 1863 } 1864 const targetElement = target; 1865 if (triggerElements.hasElement(targetElement)) { 1866 return !targetElement.hasAttribute("data-trigger-disabled"); 1867 } 1868 for (const [, trigger] of triggerElements.entries()) { 1869 if (contains(trigger, targetElement)) { 1870 return !trigger.hasAttribute("data-trigger-disabled"); 1871 } 1872 } 1873 return false; 1874 } 1875 function isEventTargetWithin(event, node) { 1876 if (node == null) { 1877 return false; 1878 } 1879 if ("composedPath" in event) { 1880 return event.composedPath().includes(node); 1881 } 1882 const eventAgain = event; 1883 return eventAgain.target != null && node.contains(eventAgain.target); 1884 } 1885 function isRootElement(element) { 1886 return element.matches("html,body"); 1887 } 1888 function isTypeableElement(element) { 1889 return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); 1890 } 1891 function isInteractiveElement(element) { 1892 return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),$TYPEABLE_SELECTOR}`) != null; 1893 } 1894 function matchesFocusVisible(element) { 1895 if (!element || isJSDOM) { 1896 return true; 1897 } 1898 try { 1899 return element.matches(":focus-visible"); 1900 } catch (_e) { 1901 return true; 1902 } 1903 } 1904 1905 // node_modules/@base-ui/react/esm/floating-ui-react/utils/nodes.js 1906 function getNodeChildren(nodes, id, onlyOpenChildren = true) { 1907 const directChildren = nodes.filter((node) => node.parentId === id); 1908 return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); 1909 } 1910 1911 // node_modules/@base-ui/react/esm/floating-ui-react/utils/event.js 1912 function isReactEvent(event) { 1913 return "nativeEvent" in event; 1914 } 1915 function isMouseLikePointerType(pointerType, strict) { 1916 const values = ["mouse", "pen"]; 1917 if (!strict) { 1918 values.push("", void 0); 1919 } 1920 return values.includes(pointerType); 1921 } 1922 function isClickLikeEvent(event) { 1923 const type = event.type; 1924 return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; 1925 } 1926 1927 // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 1928 var sides = ["top", "right", "bottom", "left"]; 1929 var min = Math.min; 1930 var max = Math.max; 1931 var round = Math.round; 1932 var floor = Math.floor; 1933 var createCoords = (v) => ({ 1934 x: v, 1935 y: v 1936 }); 1937 var oppositeSideMap = { 1938 left: "right", 1939 right: "left", 1940 bottom: "top", 1941 top: "bottom" 1942 }; 1943 function clamp(start, value, end) { 1944 return max(start, min(value, end)); 1945 } 1946 function evaluate(value, param) { 1947 return typeof value === "function" ? value(param) : value; 1948 } 1949 function getSide(placement) { 1950 return placement.split("-")[0]; 1951 } 1952 function getAlignment(placement) { 1953 return placement.split("-")[1]; 1954 } 1955 function getOppositeAxis(axis) { 1956 return axis === "x" ? "y" : "x"; 1957 } 1958 function getAxisLength(axis) { 1959 return axis === "y" ? "height" : "width"; 1960 } 1961 function getSideAxis(placement) { 1962 const firstChar = placement[0]; 1963 return firstChar === "t" || firstChar === "b" ? "y" : "x"; 1964 } 1965 function getAlignmentAxis(placement) { 1966 return getOppositeAxis(getSideAxis(placement)); 1967 } 1968 function getAlignmentSides(placement, rects, rtl) { 1969 if (rtl === void 0) { 1970 rtl = false; 1971 } 1972 const alignment = getAlignment(placement); 1973 const alignmentAxis = getAlignmentAxis(placement); 1974 const length = getAxisLength(alignmentAxis); 1975 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 1976 if (rects.reference[length] > rects.floating[length]) { 1977 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 1978 } 1979 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 1980 } 1981 function getExpandedPlacements(placement) { 1982 const oppositePlacement = getOppositePlacement(placement); 1983 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 1984 } 1985 function getOppositeAlignmentPlacement(placement) { 1986 return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start"); 1987 } 1988 var lrPlacement = ["left", "right"]; 1989 var rlPlacement = ["right", "left"]; 1990 var tbPlacement = ["top", "bottom"]; 1991 var btPlacement = ["bottom", "top"]; 1992 function getSideList(side, isStart, rtl) { 1993 switch (side) { 1994 case "top": 1995 case "bottom": 1996 if (rtl) return isStart ? rlPlacement : lrPlacement; 1997 return isStart ? lrPlacement : rlPlacement; 1998 case "left": 1999 case "right": 2000 return isStart ? tbPlacement : btPlacement; 2001 default: 2002 return []; 2003 } 2004 } 2005 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 2006 const alignment = getAlignment(placement); 2007 let list = getSideList(getSide(placement), direction === "start", rtl); 2008 if (alignment) { 2009 list = list.map((side) => side + "-" + alignment); 2010 if (flipAlignment) { 2011 list = list.concat(list.map(getOppositeAlignmentPlacement)); 2012 } 2013 } 2014 return list; 2015 } 2016 function getOppositePlacement(placement) { 2017 const side = getSide(placement); 2018 return oppositeSideMap[side] + placement.slice(side.length); 2019 } 2020 function expandPaddingObject(padding) { 2021 return { 2022 top: 0, 2023 right: 0, 2024 bottom: 0, 2025 left: 0, 2026 ...padding 2027 }; 2028 } 2029 function getPaddingObject(padding) { 2030 return typeof padding !== "number" ? expandPaddingObject(padding) : { 2031 top: padding, 2032 right: padding, 2033 bottom: padding, 2034 left: padding 2035 }; 2036 } 2037 function rectToClientRect(rect) { 2038 const { 2039 x, 2040 y, 2041 width, 2042 height 2043 } = rect; 2044 return { 2045 width, 2046 height, 2047 top: y, 2048 left: x, 2049 right: x + width, 2050 bottom: y + height, 2051 x, 2052 y 2053 }; 2054 } 2055 2056 // node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js 2057 function isHiddenByStyles(styles) { 2058 return styles.visibility === "hidden" || styles.visibility === "collapse"; 2059 } 2060 function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { 2061 if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { 2062 return false; 2063 } 2064 if (typeof element.checkVisibility === "function") { 2065 return element.checkVisibility(); 2066 } 2067 return styles.display !== "none" && styles.display !== "contents"; 2068 } 2069 2070 // node_modules/@base-ui/utils/esm/owner.js 2071 function ownerDocument(node) { 2072 return node?.ownerDocument || document; 2073 } 2074 2075 // node_modules/@base-ui/react/esm/floating-ui-react/utils/tabbable.js 2076 var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]'; 2077 function getParentElement(element) { 2078 const assignedSlot = element.assignedSlot; 2079 if (assignedSlot) { 2080 return assignedSlot; 2081 } 2082 if (element.parentElement) { 2083 return element.parentElement; 2084 } 2085 const rootNode = element.getRootNode(); 2086 return isShadowRoot(rootNode) ? rootNode.host : null; 2087 } 2088 function getDetailsSummary(details) { 2089 for (const child of Array.from(details.children)) { 2090 if (getNodeName(child) === "summary") { 2091 return child; 2092 } 2093 } 2094 return null; 2095 } 2096 function isWithinOpenDetailsSummary(element, details) { 2097 const summary = getDetailsSummary(details); 2098 return !!summary && (element === summary || contains(summary, element)); 2099 } 2100 function isFocusableCandidate(element) { 2101 const nodeName = element ? getNodeName(element) : ""; 2102 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"); 2103 } 2104 function isFocusableElement(element) { 2105 if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) { 2106 return false; 2107 } 2108 for (let current = element; current; current = getParentElement(current)) { 2109 const isAncestor = current !== element; 2110 const isSlot = getNodeName(current) === "slot"; 2111 if (current.hasAttribute("inert")) { 2112 return false; 2113 } 2114 if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) { 2115 return false; 2116 } 2117 } 2118 return true; 2119 } 2120 function isVisibleInTabbableTree(element, isAncestor) { 2121 const styles = getComputedStyle2(element); 2122 if (!isAncestor) { 2123 return isElementVisible(element, styles); 2124 } 2125 return styles.display !== "none"; 2126 } 2127 function getTabIndex(element) { 2128 const tabIndex = element.tabIndex; 2129 if (tabIndex < 0) { 2130 const nodeName = getNodeName(element); 2131 if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) { 2132 return 0; 2133 } 2134 } 2135 return tabIndex; 2136 } 2137 function getNamedRadioInput(element) { 2138 if (getNodeName(element) !== "input") { 2139 return null; 2140 } 2141 const input = element; 2142 return input.type === "radio" && input.name !== "" ? input : null; 2143 } 2144 function isTabbableRadio(element, candidates) { 2145 const input = getNamedRadioInput(element); 2146 if (!input) { 2147 return true; 2148 } 2149 const checkedRadio = candidates.find((candidate) => { 2150 const radio = getNamedRadioInput(candidate); 2151 return radio?.name === input.name && radio.form === input.form && radio.checked; 2152 }); 2153 if (checkedRadio) { 2154 return checkedRadio === input; 2155 } 2156 return candidates.find((candidate) => { 2157 const radio = getNamedRadioInput(candidate); 2158 return radio?.name === input.name && radio.form === input.form; 2159 }) === input; 2160 } 2161 function getComposedChildren(container) { 2162 if (isHTMLElement(container) && getNodeName(container) === "slot") { 2163 const assignedElements = container.assignedElements({ 2164 flatten: true 2165 }); 2166 if (assignedElements.length > 0) { 2167 return assignedElements; 2168 } 2169 } 2170 if (isHTMLElement(container) && container.shadowRoot) { 2171 return Array.from(container.shadowRoot.children); 2172 } 2173 return Array.from(container.children); 2174 } 2175 function appendCandidates(container, list) { 2176 getComposedChildren(container).forEach((child) => { 2177 if (isFocusableCandidate(child)) { 2178 list.push(child); 2179 } 2180 appendCandidates(child, list); 2181 }); 2182 } 2183 function appendMatchingElements(container, selector, list) { 2184 getComposedChildren(container).forEach((child) => { 2185 if (isHTMLElement(child) && child.matches(selector)) { 2186 list.push(child); 2187 } 2188 appendMatchingElements(child, selector, list); 2189 }); 2190 } 2191 function focusable(container) { 2192 const candidates = []; 2193 appendCandidates(container, candidates); 2194 return candidates.filter(isFocusableElement); 2195 } 2196 function tabbable(container) { 2197 const candidates = focusable(container); 2198 return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates)); 2199 } 2200 function getTabbableIn(container, dir) { 2201 const list = tabbable(container); 2202 const len = list.length; 2203 if (len === 0) { 2204 return void 0; 2205 } 2206 const active = activeElement(ownerDocument(container)); 2207 const index2 = list.indexOf(active); 2208 const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; 2209 return list[nextIndex]; 2210 } 2211 function getNextTabbable(referenceElement) { 2212 return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement; 2213 } 2214 function getPreviousTabbable(referenceElement) { 2215 return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement; 2216 } 2217 function isOutsideEvent(event, container) { 2218 const containerElement = container || event.currentTarget; 2219 const relatedTarget = event.relatedTarget; 2220 return !relatedTarget || !contains(containerElement, relatedTarget); 2221 } 2222 function disableFocusInside(container) { 2223 const tabbableElements = tabbable(container); 2224 tabbableElements.forEach((element) => { 2225 element.dataset.tabindex = element.getAttribute("tabindex") || ""; 2226 element.setAttribute("tabindex", "-1"); 2227 }); 2228 } 2229 function enableFocusInside(container) { 2230 const elements = []; 2231 appendMatchingElements(container, "[data-tabindex]", elements); 2232 elements.forEach((element) => { 2233 const tabindex = element.dataset.tabindex; 2234 delete element.dataset.tabindex; 2235 if (tabindex) { 2236 element.setAttribute("tabindex", tabindex); 2237 } else { 2238 element.removeAttribute("tabindex"); 2239 } 2240 }); 2241 } 2242 2243 // node_modules/@base-ui/utils/esm/addEventListener.js 2244 function addEventListener(target, type, listener, options) { 2245 target.addEventListener(type, listener, options); 2246 return () => { 2247 target.removeEventListener(type, listener, options); 2248 }; 2249 } 2250 2251 // node_modules/@base-ui/react/esm/internals/useOpenChangeComplete.js 2252 var React15 = __toESM(require_react(), 1); 2253 function useOpenChangeComplete(parameters) { 2254 const { 2255 enabled = true, 2256 open, 2257 ref, 2258 onComplete: onCompleteParam 2259 } = parameters; 2260 const onComplete = useStableCallback(onCompleteParam); 2261 const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false); 2262 React15.useEffect(() => { 2263 if (!enabled) { 2264 return void 0; 2265 } 2266 const abortController = new AbortController(); 2267 runOnceAnimationsFinish(onComplete, abortController.signal); 2268 return () => { 2269 abortController.abort(); 2270 }; 2271 }, [enabled, open, onComplete, runOnceAnimationsFinish]); 2272 } 2273 2274 // node_modules/@base-ui/utils/esm/useOnFirstRender.js 2275 var React16 = __toESM(require_react(), 1); 2276 function useOnFirstRender(fn) { 2277 const ref = React16.useRef(true); 2278 if (ref.current) { 2279 ref.current = false; 2280 fn(); 2281 } 2282 } 2283 2284 // node_modules/@base-ui/utils/esm/useTimeout.js 2285 var EMPTY3 = 0; 2286 var Timeout = class _Timeout { 2287 static create() { 2288 return new _Timeout(); 2289 } 2290 currentId = EMPTY3; 2291 /** 2292 * Executes `fn` after `delay`, clearing any previously scheduled call. 2293 */ 2294 start(delay, fn) { 2295 this.clear(); 2296 this.currentId = setTimeout(() => { 2297 this.currentId = EMPTY3; 2298 fn(); 2299 }, delay); 2300 } 2301 isStarted() { 2302 return this.currentId !== EMPTY3; 2303 } 2304 clear = () => { 2305 if (this.currentId !== EMPTY3) { 2306 clearTimeout(this.currentId); 2307 this.currentId = EMPTY3; 2308 } 2309 }; 2310 disposeEffect = () => { 2311 return this.clear; 2312 }; 2313 }; 2314 function useTimeout() { 2315 const timeout = useRefWithInit(Timeout.create).current; 2316 useOnMount(timeout.disposeEffect); 2317 return timeout; 2318 } 2319 2320 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingDelayGroup.js 2321 var React17 = __toESM(require_react(), 1); 2322 2323 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverShared.js 2324 function resolveValue(value, pointerType) { 2325 if (pointerType != null && !isMouseLikePointerType(pointerType)) { 2326 return 0; 2327 } 2328 if (typeof value === "function") { 2329 return value(); 2330 } 2331 return value; 2332 } 2333 function getDelay(value, prop, pointerType) { 2334 const result = resolveValue(value, pointerType); 2335 if (typeof result === "number") { 2336 return result; 2337 } 2338 return result?.[prop]; 2339 } 2340 function getRestMs(value) { 2341 if (typeof value === "function") { 2342 return value(); 2343 } 2344 return value; 2345 } 2346 function isClickLikeOpenEvent(openEventType, interactedInside) { 2347 return interactedInside || openEventType === "click" || openEventType === "mousedown"; 2348 } 2349 2350 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingDelayGroup.js 2351 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 2352 var FloatingDelayGroupContext = /* @__PURE__ */ React17.createContext({ 2353 hasProvider: false, 2354 timeoutMs: 0, 2355 delayRef: { 2356 current: 0 2357 }, 2358 initialDelayRef: { 2359 current: 0 2360 }, 2361 timeout: new Timeout(), 2362 currentIdRef: { 2363 current: null 2364 }, 2365 currentContextRef: { 2366 current: null 2367 } 2368 }); 2369 if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext"; 2370 function FloatingDelayGroup(props) { 2371 const { 2372 children, 2373 delay, 2374 timeoutMs = 0 2375 } = props; 2376 const delayRef = React17.useRef(delay); 2377 const initialDelayRef = React17.useRef(delay); 2378 const currentIdRef = React17.useRef(null); 2379 const currentContextRef = React17.useRef(null); 2380 const timeout = useTimeout(); 2381 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, { 2382 value: React17.useMemo(() => ({ 2383 hasProvider: true, 2384 delayRef, 2385 initialDelayRef, 2386 currentIdRef, 2387 timeoutMs, 2388 currentContextRef, 2389 timeout 2390 }), [timeoutMs, timeout]), 2391 children 2392 }); 2393 } 2394 function useDelayGroup(context, options = { 2395 open: false 2396 }) { 2397 const store = "rootStore" in context ? context.rootStore : context; 2398 const floatingId = store.useState("floatingId"); 2399 const { 2400 open 2401 } = options; 2402 const groupContext = React17.useContext(FloatingDelayGroupContext); 2403 const { 2404 currentIdRef, 2405 delayRef, 2406 timeoutMs, 2407 initialDelayRef, 2408 currentContextRef, 2409 hasProvider, 2410 timeout 2411 } = groupContext; 2412 const [isInstantPhase, setIsInstantPhase] = React17.useState(false); 2413 useIsoLayoutEffect(() => { 2414 function unset() { 2415 setIsInstantPhase(false); 2416 currentContextRef.current?.setIsInstantPhase(false); 2417 currentIdRef.current = null; 2418 currentContextRef.current = null; 2419 delayRef.current = initialDelayRef.current; 2420 } 2421 if (!currentIdRef.current) { 2422 return void 0; 2423 } 2424 if (!open && currentIdRef.current === floatingId) { 2425 setIsInstantPhase(false); 2426 if (timeoutMs) { 2427 const closingId = floatingId; 2428 timeout.start(timeoutMs, () => { 2429 if (store.select("open") || currentIdRef.current && currentIdRef.current !== closingId) { 2430 return; 2431 } 2432 unset(); 2433 }); 2434 return () => { 2435 timeout.clear(); 2436 }; 2437 } 2438 unset(); 2439 } 2440 return void 0; 2441 }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]); 2442 useIsoLayoutEffect(() => { 2443 if (!open) { 2444 return; 2445 } 2446 const prevContext = currentContextRef.current; 2447 const prevId = currentIdRef.current; 2448 timeout.clear(); 2449 currentContextRef.current = { 2450 onOpenChange: store.setOpen, 2451 setIsInstantPhase 2452 }; 2453 currentIdRef.current = floatingId; 2454 delayRef.current = { 2455 open: 0, 2456 close: getDelay(initialDelayRef.current, "close") 2457 }; 2458 if (prevId !== null && prevId !== floatingId) { 2459 setIsInstantPhase(true); 2460 prevContext?.setIsInstantPhase(true); 2461 prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none)); 2462 } else { 2463 setIsInstantPhase(false); 2464 prevContext?.setIsInstantPhase(false); 2465 } 2466 }, [open, floatingId, store, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout]); 2467 useIsoLayoutEffect(() => { 2468 return () => { 2469 currentContextRef.current = null; 2470 }; 2471 }, [currentContextRef]); 2472 return React17.useMemo(() => ({ 2473 hasProvider, 2474 delayRef, 2475 isInstantPhase 2476 }), [hasProvider, delayRef, isInstantPhase]); 2477 } 2478 2479 // node_modules/@base-ui/utils/esm/mergeCleanups.js 2480 function mergeCleanups(...cleanups) { 2481 return () => { 2482 for (let i = 0; i < cleanups.length; i += 1) { 2483 const cleanup = cleanups[i]; 2484 if (cleanup) { 2485 cleanup(); 2486 } 2487 } 2488 }; 2489 } 2490 2491 // node_modules/@base-ui/utils/esm/useValueAsRef.js 2492 function useValueAsRef(value) { 2493 const latest = useRefWithInit(createLatestRef, value).current; 2494 latest.next = value; 2495 useIsoLayoutEffect(latest.effect); 2496 return latest; 2497 } 2498 function createLatestRef(value) { 2499 const latest = { 2500 current: value, 2501 next: value, 2502 effect: () => { 2503 latest.current = latest.next; 2504 } 2505 }; 2506 return latest; 2507 } 2508 2509 // node_modules/@base-ui/react/esm/utils/FocusGuard.js 2510 var React18 = __toESM(require_react(), 1); 2511 2512 // node_modules/@base-ui/utils/esm/visuallyHidden.js 2513 var visuallyHiddenBase = { 2514 clipPath: "inset(50%)", 2515 overflow: "hidden", 2516 whiteSpace: "nowrap", 2517 border: 0, 2518 padding: 0, 2519 width: 1, 2520 height: 1, 2521 margin: -1 2522 }; 2523 var visuallyHidden = { 2524 ...visuallyHiddenBase, 2525 position: "fixed", 2526 top: 0, 2527 left: 0 2528 }; 2529 var visuallyHiddenInput = { 2530 ...visuallyHiddenBase, 2531 position: "absolute" 2532 }; 2533 2534 // node_modules/@base-ui/react/esm/utils/FocusGuard.js 2535 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 2536 var FocusGuard = /* @__PURE__ */ React18.forwardRef(function FocusGuard2(props, ref) { 2537 const [role, setRole] = React18.useState(); 2538 useIsoLayoutEffect(() => { 2539 if (isSafari) { 2540 setRole("button"); 2541 } 2542 }, []); 2543 const restProps = { 2544 tabIndex: 0, 2545 // Role is only for VoiceOver 2546 role 2547 }; 2548 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { 2549 ...props, 2550 ref, 2551 style: visuallyHidden, 2552 "aria-hidden": role ? void 0 : true, 2553 ...restProps, 2554 "data-base-ui-focus-guard": "" 2555 }); 2556 }); 2557 if (true) FocusGuard.displayName = "FocusGuard"; 2558 2559 // node_modules/@base-ui/react/esm/floating-ui-react/utils/createAttribute.js 2560 function createAttribute(name) { 2561 return `data-base-ui-$name}`; 2562 } 2563 2564 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingPortal.js 2565 var React19 = __toESM(require_react(), 1); 2566 var ReactDOM2 = __toESM(require_react_dom(), 1); 2567 2568 // node_modules/@base-ui/react/esm/internals/constants.js 2569 var DISABLED_TRANSITIONS_STYLE = { 2570 style: { 2571 transition: "none" 2572 } 2573 }; 2574 var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; 2575 var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; 2576 var BASE_UI_SWIPE_IGNORE_SELECTOR = `[$BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; 2577 var LEGACY_SWIPE_IGNORE_SELECTOR = `[$LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; 2578 var POPUP_COLLISION_AVOIDANCE = { 2579 fallbackAxisSide: "end" 2580 }; 2581 var ownerVisuallyHidden = { 2582 clipPath: "inset(50%)", 2583 position: "fixed", 2584 top: 0, 2585 left: 0 2586 }; 2587 2588 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingPortal.js 2589 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); 2590 var PortalContext = /* @__PURE__ */ React19.createContext(null); 2591 if (true) PortalContext.displayName = "PortalContext"; 2592 var usePortalContext = () => React19.useContext(PortalContext); 2593 var attr = createAttribute("portal"); 2594 function useFloatingPortalNode(props = {}) { 2595 const { 2596 ref, 2597 container: containerProp, 2598 componentProps = EMPTY_OBJECT, 2599 elementProps 2600 } = props; 2601 const uniqueId = useId(); 2602 const portalContext = usePortalContext(); 2603 const parentPortalNode = portalContext?.portalNode; 2604 const [containerElement, setContainerElement] = React19.useState(null); 2605 const [portalNode, setPortalNode] = React19.useState(null); 2606 const setPortalNodeRef = useStableCallback((node) => { 2607 if (node !== null) { 2608 setPortalNode(node); 2609 } 2610 }); 2611 const containerRef = React19.useRef(null); 2612 useIsoLayoutEffect(() => { 2613 if (containerProp === null) { 2614 if (containerRef.current) { 2615 containerRef.current = null; 2616 setPortalNode(null); 2617 setContainerElement(null); 2618 } 2619 return; 2620 } 2621 if (uniqueId == null) { 2622 return; 2623 } 2624 const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body; 2625 if (resolvedContainer == null) { 2626 if (containerRef.current) { 2627 containerRef.current = null; 2628 setPortalNode(null); 2629 setContainerElement(null); 2630 } 2631 return; 2632 } 2633 if (containerRef.current !== resolvedContainer) { 2634 containerRef.current = resolvedContainer; 2635 setPortalNode(null); 2636 setContainerElement(resolvedContainer); 2637 } 2638 }, [containerProp, parentPortalNode, uniqueId]); 2639 const portalElement = useRenderElement("div", componentProps, { 2640 ref: [ref, setPortalNodeRef], 2641 props: [{ 2642 id: uniqueId, 2643 [attr]: "" 2644 }, elementProps] 2645 }); 2646 const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; 2647 return { 2648 portalNode, 2649 portalSubtree 2650 }; 2651 } 2652 var FloatingPortal = /* @__PURE__ */ React19.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { 2653 const { 2654 children, 2655 container, 2656 className, 2657 render, 2658 renderGuards, 2659 style, 2660 ...elementProps 2661 } = componentProps; 2662 const { 2663 portalNode, 2664 portalSubtree 2665 } = useFloatingPortalNode({ 2666 container, 2667 ref: forwardedRef, 2668 componentProps, 2669 elementProps 2670 }); 2671 const beforeOutsideRef = React19.useRef(null); 2672 const afterOutsideRef = React19.useRef(null); 2673 const beforeInsideRef = React19.useRef(null); 2674 const afterInsideRef = React19.useRef(null); 2675 const [focusManagerState, setFocusManagerState] = React19.useState(null); 2676 const focusInsideDisabledRef = React19.useRef(false); 2677 const modal = focusManagerState?.modal; 2678 const open = focusManagerState?.open; 2679 const shouldRenderGuards = typeof renderGuards === "boolean" ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; 2680 React19.useEffect(() => { 2681 if (!portalNode || modal) { 2682 return void 0; 2683 } 2684 function onFocus(event) { 2685 if (portalNode && event.relatedTarget && isOutsideEvent(event)) { 2686 if (event.type === "focusin") { 2687 if (focusInsideDisabledRef.current) { 2688 enableFocusInside(portalNode); 2689 focusInsideDisabledRef.current = false; 2690 } 2691 } else { 2692 disableFocusInside(portalNode); 2693 focusInsideDisabledRef.current = true; 2694 } 2695 } 2696 } 2697 return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); 2698 }, [portalNode, modal]); 2699 React19.useEffect(() => { 2700 if (!portalNode || open !== false) { 2701 return; 2702 } 2703 enableFocusInside(portalNode); 2704 focusInsideDisabledRef.current = false; 2705 }, [open, portalNode]); 2706 const portalContextValue = React19.useMemo(() => ({ 2707 beforeOutsideRef, 2708 afterOutsideRef, 2709 beforeInsideRef, 2710 afterInsideRef, 2711 portalNode, 2712 setFocusManagerState 2713 }), [portalNode]); 2714 return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React19.Fragment, { 2715 children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PortalContext.Provider, { 2716 value: portalContextValue, 2717 children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { 2718 "data-type": "outside", 2719 ref: beforeOutsideRef, 2720 onFocus: (event) => { 2721 if (isOutsideEvent(event, portalNode)) { 2722 beforeInsideRef.current?.focus(); 2723 } else { 2724 const domReference = focusManagerState ? focusManagerState.domReference : null; 2725 const prevTabbable = getPreviousTabbable(domReference); 2726 prevTabbable?.focus(); 2727 } 2728 } 2729 }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { 2730 "aria-owns": portalNode.id, 2731 style: ownerVisuallyHidden 2732 }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { 2733 "data-type": "outside", 2734 ref: afterOutsideRef, 2735 onFocus: (event) => { 2736 if (isOutsideEvent(event, portalNode)) { 2737 afterInsideRef.current?.focus(); 2738 } else { 2739 const domReference = focusManagerState ? focusManagerState.domReference : null; 2740 const nextTabbable = getNextTabbable(domReference); 2741 nextTabbable?.focus(); 2742 if (focusManagerState?.closeOnFocusOut) { 2743 focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent)); 2744 } 2745 } 2746 } 2747 })] 2748 })] 2749 }); 2750 }); 2751 if (true) FloatingPortal.displayName = "FloatingPortal"; 2752 2753 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingTree.js 2754 var React20 = __toESM(require_react(), 1); 2755 2756 // node_modules/@base-ui/react/esm/floating-ui-react/utils/createEventEmitter.js 2757 function createEventEmitter() { 2758 const map = /* @__PURE__ */ new Map(); 2759 return { 2760 emit(event, data) { 2761 map.get(event)?.forEach((listener) => listener(data)); 2762 }, 2763 on(event, listener) { 2764 if (!map.has(event)) { 2765 map.set(event, /* @__PURE__ */ new Set()); 2766 } 2767 map.get(event).add(listener); 2768 }, 2769 off(event, listener) { 2770 map.get(event)?.delete(listener); 2771 } 2772 }; 2773 } 2774 2775 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingTree.js 2776 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); 2777 var FloatingNodeContext = /* @__PURE__ */ React20.createContext(null); 2778 if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; 2779 var FloatingTreeContext = /* @__PURE__ */ React20.createContext(null); 2780 if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; 2781 var useFloatingParentNodeId = () => React20.useContext(FloatingNodeContext)?.id || null; 2782 var useFloatingTree = (externalTree) => { 2783 const contextTree = React20.useContext(FloatingTreeContext); 2784 return externalTree ?? contextTree; 2785 }; 2786 2787 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useClientPoint.js 2788 var React21 = __toESM(require_react(), 1); 2789 function createVirtualElement(domElement, data) { 2790 let offsetX = null; 2791 let offsetY = null; 2792 let isAutoUpdateEvent = false; 2793 return { 2794 contextElement: domElement || void 0, 2795 getBoundingClientRect() { 2796 const domRect = domElement?.getBoundingClientRect() || { 2797 width: 0, 2798 height: 0, 2799 x: 0, 2800 y: 0 2801 }; 2802 const isXAxis = data.axis === "x" || data.axis === "both"; 2803 const isYAxis = data.axis === "y" || data.axis === "both"; 2804 const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch"; 2805 let width = domRect.width; 2806 let height = domRect.height; 2807 let x = domRect.x; 2808 let y = domRect.y; 2809 if (offsetX == null && data.x && isXAxis) { 2810 offsetX = domRect.x - data.x; 2811 } 2812 if (offsetY == null && data.y && isYAxis) { 2813 offsetY = domRect.y - data.y; 2814 } 2815 x -= offsetX || 0; 2816 y -= offsetY || 0; 2817 width = 0; 2818 height = 0; 2819 if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { 2820 width = data.axis === "y" ? domRect.width : 0; 2821 height = data.axis === "x" ? domRect.height : 0; 2822 x = isXAxis && data.x != null ? data.x : x; 2823 y = isYAxis && data.y != null ? data.y : y; 2824 } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) { 2825 height = data.axis === "x" ? domRect.height : height; 2826 width = data.axis === "y" ? domRect.width : width; 2827 } 2828 isAutoUpdateEvent = true; 2829 return { 2830 width, 2831 height, 2832 x, 2833 y, 2834 top: y, 2835 right: x + width, 2836 bottom: y + height, 2837 left: x 2838 }; 2839 } 2840 }; 2841 } 2842 function isMouseBasedEvent(event) { 2843 return event != null && event.clientX != null; 2844 } 2845 function useClientPoint(context, props = {}) { 2846 const store = "rootStore" in context ? context.rootStore : context; 2847 const open = store.useState("open"); 2848 const floating = store.useState("floatingElement"); 2849 const domReference = store.useState("domReferenceElement"); 2850 const dataRef = store.context.dataRef; 2851 const { 2852 enabled = true, 2853 axis = "both" 2854 } = props; 2855 const initialRef = React21.useRef(false); 2856 const cleanupListenerRef = React21.useRef(null); 2857 const [pointerType, setPointerType] = React21.useState(); 2858 const [reactive, setReactive] = React21.useState([]); 2859 const setReference = useStableCallback((newX, newY, referenceElement) => { 2860 if (initialRef.current) { 2861 return; 2862 } 2863 if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) { 2864 return; 2865 } 2866 store.set("positionReference", createVirtualElement(referenceElement ?? domReference, { 2867 x: newX, 2868 y: newY, 2869 axis, 2870 dataRef, 2871 pointerType 2872 })); 2873 }); 2874 const handleReferenceEnterOrMove = useStableCallback((event) => { 2875 if (!open) { 2876 setReference(event.clientX, event.clientY, event.currentTarget); 2877 } else if (!cleanupListenerRef.current) { 2878 setReactive([]); 2879 } 2880 }); 2881 const openCheck = isMouseLikePointerType(pointerType) ? floating : open; 2882 const addListener = React21.useCallback(() => { 2883 if (!openCheck || !enabled) { 2884 return void 0; 2885 } 2886 const win = getWindow(floating); 2887 function handleMouseMove(event) { 2888 const target = getTarget(event); 2889 if (!contains(floating, target)) { 2890 setReference(event.clientX, event.clientY); 2891 } else { 2892 cleanupListenerRef.current?.(); 2893 cleanupListenerRef.current = null; 2894 } 2895 } 2896 if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) { 2897 const cleanup = () => { 2898 cleanupListenerRef.current?.(); 2899 cleanupListenerRef.current = null; 2900 }; 2901 cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove); 2902 return cleanup; 2903 } 2904 store.set("positionReference", domReference); 2905 return void 0; 2906 }, [openCheck, enabled, floating, dataRef, domReference, store, setReference]); 2907 React21.useEffect(() => { 2908 return addListener(); 2909 }, [addListener, reactive]); 2910 React21.useEffect(() => { 2911 if (enabled && !floating) { 2912 initialRef.current = false; 2913 } 2914 }, [enabled, floating]); 2915 React21.useEffect(() => { 2916 if (!enabled && open) { 2917 initialRef.current = true; 2918 } 2919 }, [enabled, open]); 2920 const reference = React21.useMemo(() => { 2921 function setPointerTypeRef(event) { 2922 setPointerType(event.pointerType); 2923 } 2924 return { 2925 onPointerDown: setPointerTypeRef, 2926 onPointerEnter: setPointerTypeRef, 2927 onMouseMove: handleReferenceEnterOrMove, 2928 onMouseEnter: handleReferenceEnterOrMove 2929 }; 2930 }, [handleReferenceEnterOrMove]); 2931 return React21.useMemo(() => enabled ? { 2932 reference, 2933 trigger: reference 2934 } : {}, [enabled, reference]); 2935 } 2936 2937 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useDismiss.js 2938 var React22 = __toESM(require_react(), 1); 2939 var bubbleHandlerKeys = { 2940 intentional: "onClick", 2941 sloppy: "onPointerDown" 2942 }; 2943 function alwaysFalse() { 2944 return false; 2945 } 2946 function normalizeProp(normalizable) { 2947 return { 2948 escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false, 2949 outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true 2950 }; 2951 } 2952 function useDismiss(context, props = {}) { 2953 const store = "rootStore" in context ? context.rootStore : context; 2954 const open = store.useState("open"); 2955 const floatingElement = store.useState("floatingElement"); 2956 const { 2957 dataRef 2958 } = store.context; 2959 const { 2960 enabled = true, 2961 escapeKey: escapeKey2 = true, 2962 outsidePress: outsidePressProp = true, 2963 outsidePressEvent = "sloppy", 2964 referencePress = alwaysFalse, 2965 referencePressEvent = "sloppy", 2966 bubbles, 2967 externalTree 2968 } = props; 2969 const tree = useFloatingTree(externalTree); 2970 const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); 2971 const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; 2972 const outsidePressEnabled = outsidePress2 !== false; 2973 const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent); 2974 const pressStartedInsideRef = React22.useRef(false); 2975 const pressStartPreventedRef = React22.useRef(false); 2976 const suppressNextOutsideClickRef = React22.useRef(false); 2977 const { 2978 escapeKey: escapeKeyBubbles, 2979 outsidePress: outsidePressBubbles 2980 } = normalizeProp(bubbles); 2981 const touchStateRef = React22.useRef(null); 2982 const cancelDismissOnEndTimeout = useTimeout(); 2983 const clearInsideReactTreeTimeout = useTimeout(); 2984 const clearInsideReactTree = useStableCallback(() => { 2985 clearInsideReactTreeTimeout.clear(); 2986 dataRef.current.insideReactTree = false; 2987 }); 2988 const isComposingRef = React22.useRef(false); 2989 const currentPointerTypeRef = React22.useRef(""); 2990 const isReferencePressEnabled = useStableCallback(referencePress); 2991 const closeOnEscapeKeyDown = useStableCallback((event) => { 2992 if (!open || !enabled || !escapeKey2 || event.key !== "Escape") { 2993 return; 2994 } 2995 if (isComposingRef.current) { 2996 return; 2997 } 2998 const nodeId = dataRef.current.floatingContext?.nodeId; 2999 const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []; 3000 if (!escapeKeyBubbles) { 3001 if (children.length > 0) { 3002 let shouldDismiss = true; 3003 children.forEach((child) => { 3004 if (child.context?.open && !child.context.dataRef.current.__escapeKeyBubbles) { 3005 shouldDismiss = false; 3006 } 3007 }); 3008 if (!shouldDismiss) { 3009 return; 3010 } 3011 } 3012 } 3013 const native = isReactEvent(event) ? event.nativeEvent : event; 3014 const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native); 3015 store.setOpen(false, eventDetails); 3016 if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) { 3017 event.stopPropagation(); 3018 } 3019 }); 3020 const markInsideReactTree = useStableCallback(() => { 3021 dataRef.current.insideReactTree = true; 3022 clearInsideReactTreeTimeout.start(0, clearInsideReactTree); 3023 }); 3024 React22.useEffect(() => { 3025 if (!open || !enabled) { 3026 return void 0; 3027 } 3028 dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; 3029 dataRef.current.__outsidePressBubbles = outsidePressBubbles; 3030 const compositionTimeout = new Timeout(); 3031 const preventedPressSuppressionTimeout = new Timeout(); 3032 function handleCompositionStart() { 3033 compositionTimeout.clear(); 3034 isComposingRef.current = true; 3035 } 3036 function handleCompositionEnd() { 3037 compositionTimeout.start( 3038 // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. 3039 // Only apply to WebKit for the test to remain 0ms. 3040 isWebKit() ? 5 : 0, 3041 () => { 3042 isComposingRef.current = false; 3043 } 3044 ); 3045 } 3046 function suppressImmediateOutsideClickAfterPreventedStart() { 3047 suppressNextOutsideClickRef.current = true; 3048 preventedPressSuppressionTimeout.start(0, () => { 3049 suppressNextOutsideClickRef.current = false; 3050 }); 3051 } 3052 function resetPressStartState() { 3053 pressStartedInsideRef.current = false; 3054 pressStartPreventedRef.current = false; 3055 } 3056 function getOutsidePressEvent() { 3057 const type = currentPointerTypeRef.current; 3058 const computedType = type === "pen" || !type ? "mouse" : type; 3059 const outsidePressEventValue = getOutsidePressEventProp(); 3060 const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue; 3061 if (typeof resolved === "string") { 3062 return resolved; 3063 } 3064 return resolved[computedType]; 3065 } 3066 function shouldIgnoreEvent(event) { 3067 const computedOutsidePressEvent = getOutsidePressEvent(); 3068 return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click"; 3069 } 3070 function isEventWithinFloatingTree(event) { 3071 const nodeId = dataRef.current.floatingContext?.nodeId; 3072 const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating)); 3073 return isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement")) || targetIsInsideChildren; 3074 } 3075 function closeOnPressOutside(event) { 3076 if (shouldIgnoreEvent(event)) { 3077 clearInsideReactTree(); 3078 return; 3079 } 3080 if (dataRef.current.insideReactTree) { 3081 clearInsideReactTree(); 3082 return; 3083 } 3084 const target = getTarget(event); 3085 const inertSelector = `[$createAttribute("inert")}]`; 3086 const targetRoot = isElement(target) ? target.getRootNode() : null; 3087 const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select("floatingElement"))).querySelectorAll(inertSelector)); 3088 const triggers = store.context.triggerElements; 3089 if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) { 3090 return; 3091 } 3092 let targetRootAncestor = isElement(target) ? target : null; 3093 while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { 3094 const nextParent = getParentNode(targetRootAncestor); 3095 if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { 3096 break; 3097 } 3098 targetRootAncestor = nextParent; 3099 } 3100 if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). 3101 !contains(target, store.select("floatingElement")) && // If the target root element contains none of the markers, then the 3102 // element was injected after the floating element rendered. 3103 markers.every((marker) => !contains(targetRootAncestor, marker))) { 3104 return; 3105 } 3106 if (isHTMLElement(target) && !("touches" in event)) { 3107 const lastTraversableNode = isLastTraversableNode(target); 3108 const style = getComputedStyle2(target); 3109 const scrollRe = /auto|scroll/; 3110 const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); 3111 const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); 3112 const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; 3113 const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; 3114 const isRTL2 = style.direction === "rtl"; 3115 const pressedVerticalScrollbar = canScrollY && (isRTL2 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); 3116 const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; 3117 if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { 3118 return; 3119 } 3120 } 3121 if (isEventWithinFloatingTree(event)) { 3122 return; 3123 } 3124 if (getOutsidePressEvent() === "intentional" && suppressNextOutsideClickRef.current) { 3125 preventedPressSuppressionTimeout.clear(); 3126 suppressNextOutsideClickRef.current = false; 3127 return; 3128 } 3129 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 3130 return; 3131 } 3132 const nodeId = dataRef.current.floatingContext?.nodeId; 3133 const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []; 3134 if (children.length > 0) { 3135 let shouldDismiss = true; 3136 children.forEach((child) => { 3137 if (child.context?.open && !child.context.dataRef.current.__outsidePressBubbles) { 3138 shouldDismiss = false; 3139 } 3140 }); 3141 if (!shouldDismiss) { 3142 return; 3143 } 3144 } 3145 store.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event)); 3146 clearInsideReactTree(); 3147 } 3148 function handlePointerDown(event) { 3149 if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store.select("open") || !enabled || isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement"))) { 3150 return; 3151 } 3152 closeOnPressOutside(event); 3153 } 3154 function handleTouchStart(event) { 3155 if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement"))) { 3156 return; 3157 } 3158 const touch = event.touches[0]; 3159 if (touch) { 3160 touchStateRef.current = { 3161 startTime: Date.now(), 3162 startX: touch.clientX, 3163 startY: touch.clientY, 3164 dismissOnTouchEnd: false, 3165 dismissOnMouseDown: true 3166 }; 3167 cancelDismissOnEndTimeout.start(1e3, () => { 3168 if (touchStateRef.current) { 3169 touchStateRef.current.dismissOnTouchEnd = false; 3170 touchStateRef.current.dismissOnMouseDown = false; 3171 } 3172 }); 3173 } 3174 } 3175 function addTargetEventListenerOnce(event, listener) { 3176 const target = getTarget(event); 3177 if (!target) { 3178 return; 3179 } 3180 const unsubscribe2 = addEventListener(target, event.type, () => { 3181 listener(event); 3182 unsubscribe2(); 3183 }); 3184 } 3185 function handleTouchStartCapture(event) { 3186 currentPointerTypeRef.current = "touch"; 3187 addTargetEventListenerOnce(event, handleTouchStart); 3188 } 3189 function closeOnPressOutsideCapture(event) { 3190 cancelDismissOnEndTimeout.clear(); 3191 if (event.type === "pointerdown") { 3192 currentPointerTypeRef.current = event.pointerType; 3193 } 3194 if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { 3195 return; 3196 } 3197 addTargetEventListenerOnce(event, (targetEvent) => { 3198 if (targetEvent.type === "pointerdown") { 3199 handlePointerDown(targetEvent); 3200 } else { 3201 closeOnPressOutside(targetEvent); 3202 } 3203 }); 3204 } 3205 function handlePressEndCapture(event) { 3206 if (!pressStartedInsideRef.current) { 3207 return; 3208 } 3209 const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; 3210 resetPressStartState(); 3211 if (getOutsidePressEvent() !== "intentional") { 3212 return; 3213 } 3214 if (event.type === "pointercancel") { 3215 if (pressStartedInsideDefaultPrevented) { 3216 suppressImmediateOutsideClickAfterPreventedStart(); 3217 } 3218 return; 3219 } 3220 if (isEventWithinFloatingTree(event)) { 3221 return; 3222 } 3223 if (pressStartedInsideDefaultPrevented) { 3224 suppressImmediateOutsideClickAfterPreventedStart(); 3225 return; 3226 } 3227 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 3228 return; 3229 } 3230 preventedPressSuppressionTimeout.clear(); 3231 suppressNextOutsideClickRef.current = true; 3232 clearInsideReactTree(); 3233 } 3234 function handleTouchMove(event) { 3235 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement"))) { 3236 return; 3237 } 3238 const touch = event.touches[0]; 3239 if (!touch) { 3240 return; 3241 } 3242 const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX); 3243 const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY); 3244 const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); 3245 if (distance > 5) { 3246 touchStateRef.current.dismissOnTouchEnd = true; 3247 } 3248 if (distance > 10) { 3249 closeOnPressOutside(event); 3250 cancelDismissOnEndTimeout.clear(); 3251 touchStateRef.current = null; 3252 } 3253 } 3254 function handleTouchMoveCapture(event) { 3255 addTargetEventListenerOnce(event, handleTouchMove); 3256 } 3257 function handleTouchEnd(event) { 3258 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement"))) { 3259 return; 3260 } 3261 if (touchStateRef.current.dismissOnTouchEnd) { 3262 closeOnPressOutside(event); 3263 } 3264 cancelDismissOnEndTimeout.clear(); 3265 touchStateRef.current = null; 3266 } 3267 function handleTouchEndCapture(event) { 3268 addTargetEventListenerOnce(event, handleTouchEnd); 3269 } 3270 const doc = ownerDocument(floatingElement); 3271 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, true), addEventListener(doc, "touchmove", handleTouchMoveCapture, true), addEventListener(doc, "touchend", handleTouchEndCapture, true))); 3272 return () => { 3273 unsubscribe(); 3274 compositionTimeout.clear(); 3275 preventedPressSuppressionTimeout.clear(); 3276 resetPressStartState(); 3277 suppressNextOutsideClickRef.current = false; 3278 }; 3279 }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, tree, store, cancelDismissOnEndTimeout]); 3280 React22.useEffect(clearInsideReactTree, [outsidePress2, clearInsideReactTree]); 3281 const reference = React22.useMemo(() => ({ 3282 onKeyDown: closeOnEscapeKeyDown, 3283 [bubbleHandlerKeys[referencePressEvent]]: (event) => { 3284 if (!isReferencePressEnabled()) { 3285 return; 3286 } 3287 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); 3288 }, 3289 ...referencePressEvent !== "intentional" && { 3290 onClick(event) { 3291 if (!isReferencePressEnabled()) { 3292 return; 3293 } 3294 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); 3295 } 3296 } 3297 }), [closeOnEscapeKeyDown, store, referencePressEvent, isReferencePressEnabled]); 3298 const markPressStartedInsideReactTree = useStableCallback((event) => { 3299 if (!open || !enabled || event.button !== 0) { 3300 return; 3301 } 3302 const target = getTarget(event.nativeEvent); 3303 if (!contains(store.select("floatingElement"), target)) { 3304 return; 3305 } 3306 if (!pressStartedInsideRef.current) { 3307 pressStartedInsideRef.current = true; 3308 pressStartPreventedRef.current = false; 3309 } 3310 }); 3311 const markInsidePressStartPrevented = useStableCallback((event) => { 3312 if (!open || !enabled) { 3313 return; 3314 } 3315 if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { 3316 return; 3317 } 3318 if (pressStartedInsideRef.current) { 3319 pressStartPreventedRef.current = true; 3320 } 3321 }); 3322 const floating = React22.useMemo(() => ({ 3323 onKeyDown: closeOnEscapeKeyDown, 3324 // `onMouseDown` may be blocked if `event.preventDefault()` is called in 3325 // `onPointerDown`, such as with <NumberField.ScrubArea>. 3326 // See https://github.com/mui/base-ui/pull/3379 3327 onPointerDown: markInsidePressStartPrevented, 3328 onMouseDown: markInsidePressStartPrevented, 3329 onClickCapture: markInsideReactTree, 3330 onMouseDownCapture(event) { 3331 markInsideReactTree(); 3332 markPressStartedInsideReactTree(event); 3333 }, 3334 onPointerDownCapture(event) { 3335 markInsideReactTree(); 3336 markPressStartedInsideReactTree(event); 3337 }, 3338 onMouseUpCapture: markInsideReactTree, 3339 onTouchEndCapture: markInsideReactTree, 3340 onTouchMoveCapture: markInsideReactTree 3341 }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); 3342 return React22.useMemo(() => enabled ? { 3343 reference, 3344 floating, 3345 trigger: reference 3346 } : {}, [enabled, reference, floating]); 3347 } 3348 3349 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloating.js 3350 var React28 = __toESM(require_react(), 1); 3351 3352 // node_modules/@floating-ui/core/dist/floating-ui.core.mjs 3353 function computeCoordsFromPlacement(_ref, placement, rtl) { 3354 let { 3355 reference, 3356 floating 3357 } = _ref; 3358 const sideAxis = getSideAxis(placement); 3359 const alignmentAxis = getAlignmentAxis(placement); 3360 const alignLength = getAxisLength(alignmentAxis); 3361 const side = getSide(placement); 3362 const isVertical = sideAxis === "y"; 3363 const commonX = reference.x + reference.width / 2 - floating.width / 2; 3364 const commonY = reference.y + reference.height / 2 - floating.height / 2; 3365 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 3366 let coords; 3367 switch (side) { 3368 case "top": 3369 coords = { 3370 x: commonX, 3371 y: reference.y - floating.height 3372 }; 3373 break; 3374 case "bottom": 3375 coords = { 3376 x: commonX, 3377 y: reference.y + reference.height 3378 }; 3379 break; 3380 case "right": 3381 coords = { 3382 x: reference.x + reference.width, 3383 y: commonY 3384 }; 3385 break; 3386 case "left": 3387 coords = { 3388 x: reference.x - floating.width, 3389 y: commonY 3390 }; 3391 break; 3392 default: 3393 coords = { 3394 x: reference.x, 3395 y: reference.y 3396 }; 3397 } 3398 switch (getAlignment(placement)) { 3399 case "start": 3400 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 3401 break; 3402 case "end": 3403 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 3404 break; 3405 } 3406 return coords; 3407 } 3408 async function detectOverflow(state, options) { 3409 var _await$platform$isEle; 3410 if (options === void 0) { 3411 options = {}; 3412 } 3413 const { 3414 x, 3415 y, 3416 platform: platform3, 3417 rects, 3418 elements, 3419 strategy 3420 } = state; 3421 const { 3422 boundary = "clippingAncestors", 3423 rootBoundary = "viewport", 3424 elementContext = "floating", 3425 altBoundary = false, 3426 padding = 0 3427 } = evaluate(options, state); 3428 const paddingObject = getPaddingObject(padding); 3429 const altContext = elementContext === "floating" ? "reference" : "floating"; 3430 const element = elements[altBoundary ? altContext : elementContext]; 3431 const clippingClientRect = rectToClientRect(await platform3.getClippingRect({ 3432 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)), 3433 boundary, 3434 rootBoundary, 3435 strategy 3436 })); 3437 const rect = elementContext === "floating" ? { 3438 x, 3439 y, 3440 width: rects.floating.width, 3441 height: rects.floating.height 3442 } : rects.reference; 3443 const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements.floating)); 3444 const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) ? await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { 3445 x: 1, 3446 y: 1 3447 } : { 3448 x: 1, 3449 y: 1 3450 }; 3451 const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ 3452 elements, 3453 rect, 3454 offsetParent, 3455 strategy 3456 }) : rect); 3457 return { 3458 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 3459 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 3460 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 3461 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 3462 }; 3463 } 3464 var MAX_RESET_COUNT = 50; 3465 var computePosition = async (reference, floating, config) => { 3466 const { 3467 placement = "bottom", 3468 strategy = "absolute", 3469 middleware = [], 3470 platform: platform3 3471 } = config; 3472 const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : { 3473 ...platform3, 3474 detectOverflow 3475 }; 3476 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating)); 3477 let rects = await platform3.getElementRects({ 3478 reference, 3479 floating, 3480 strategy 3481 }); 3482 let { 3483 x, 3484 y 3485 } = computeCoordsFromPlacement(rects, placement, rtl); 3486 let statefulPlacement = placement; 3487 let resetCount = 0; 3488 const middlewareData = {}; 3489 for (let i = 0; i < middleware.length; i++) { 3490 const currentMiddleware = middleware[i]; 3491 if (!currentMiddleware) { 3492 continue; 3493 } 3494 const { 3495 name, 3496 fn 3497 } = currentMiddleware; 3498 const { 3499 x: nextX, 3500 y: nextY, 3501 data, 3502 reset 3503 } = await fn({ 3504 x, 3505 y, 3506 initialPlacement: placement, 3507 placement: statefulPlacement, 3508 strategy, 3509 middlewareData, 3510 rects, 3511 platform: platformWithDetectOverflow, 3512 elements: { 3513 reference, 3514 floating 3515 } 3516 }); 3517 x = nextX != null ? nextX : x; 3518 y = nextY != null ? nextY : y; 3519 middlewareData[name] = { 3520 ...middlewareData[name], 3521 ...data 3522 }; 3523 if (reset && resetCount < MAX_RESET_COUNT) { 3524 resetCount++; 3525 if (typeof reset === "object") { 3526 if (reset.placement) { 3527 statefulPlacement = reset.placement; 3528 } 3529 if (reset.rects) { 3530 rects = reset.rects === true ? await platform3.getElementRects({ 3531 reference, 3532 floating, 3533 strategy 3534 }) : reset.rects; 3535 } 3536 ({ 3537 x, 3538 y 3539 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 3540 } 3541 i = -1; 3542 } 3543 } 3544 return { 3545 x, 3546 y, 3547 placement: statefulPlacement, 3548 strategy, 3549 middlewareData 3550 }; 3551 }; 3552 var flip = function(options) { 3553 if (options === void 0) { 3554 options = {}; 3555 } 3556 return { 3557 name: "flip", 3558 options, 3559 async fn(state) { 3560 var _middlewareData$arrow, _middlewareData$flip; 3561 const { 3562 placement, 3563 middlewareData, 3564 rects, 3565 initialPlacement, 3566 platform: platform3, 3567 elements 3568 } = state; 3569 const { 3570 mainAxis: checkMainAxis = true, 3571 crossAxis: checkCrossAxis = true, 3572 fallbackPlacements: specifiedFallbackPlacements, 3573 fallbackStrategy = "bestFit", 3574 fallbackAxisSideDirection = "none", 3575 flipAlignment = true, 3576 ...detectOverflowOptions 3577 } = evaluate(options, state); 3578 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 3579 return {}; 3580 } 3581 const side = getSide(placement); 3582 const initialSideAxis = getSideAxis(initialPlacement); 3583 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 3584 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 3585 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 3586 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 3587 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 3588 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 3589 } 3590 const placements2 = [initialPlacement, ...fallbackPlacements]; 3591 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3592 const overflows = []; 3593 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 3594 if (checkMainAxis) { 3595 overflows.push(overflow[side]); 3596 } 3597 if (checkCrossAxis) { 3598 const sides2 = getAlignmentSides(placement, rects, rtl); 3599 overflows.push(overflow[sides2[0]], overflow[sides2[1]]); 3600 } 3601 overflowsData = [...overflowsData, { 3602 placement, 3603 overflows 3604 }]; 3605 if (!overflows.every((side2) => side2 <= 0)) { 3606 var _middlewareData$flip2, _overflowsData$filter; 3607 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 3608 const nextPlacement = placements2[nextIndex]; 3609 if (nextPlacement) { 3610 const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; 3611 if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis 3612 // overflows the main axis. 3613 overflowsData.every((d) => getSideAxis(d.placement) === initialSideAxis ? d.overflows[0] > 0 : true)) { 3614 return { 3615 data: { 3616 index: nextIndex, 3617 overflows: overflowsData 3618 }, 3619 reset: { 3620 placement: nextPlacement 3621 } 3622 }; 3623 } 3624 } 3625 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; 3626 if (!resetPlacement) { 3627 switch (fallbackStrategy) { 3628 case "bestFit": { 3629 var _overflowsData$filter2; 3630 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d) => { 3631 if (hasFallbackAxisSideDirection) { 3632 const currentSideAxis = getSideAxis(d.placement); 3633 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 3634 // reading directions favoring greater width. 3635 currentSideAxis === "y"; 3636 } 3637 return true; 3638 }).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]; 3639 if (placement2) { 3640 resetPlacement = placement2; 3641 } 3642 break; 3643 } 3644 case "initialPlacement": 3645 resetPlacement = initialPlacement; 3646 break; 3647 } 3648 } 3649 if (placement !== resetPlacement) { 3650 return { 3651 reset: { 3652 placement: resetPlacement 3653 } 3654 }; 3655 } 3656 } 3657 return {}; 3658 } 3659 }; 3660 }; 3661 function getSideOffsets(overflow, rect) { 3662 return { 3663 top: overflow.top - rect.height, 3664 right: overflow.right - rect.width, 3665 bottom: overflow.bottom - rect.height, 3666 left: overflow.left - rect.width 3667 }; 3668 } 3669 function isAnySideFullyClipped(overflow) { 3670 return sides.some((side) => overflow[side] >= 0); 3671 } 3672 var hide = function(options) { 3673 if (options === void 0) { 3674 options = {}; 3675 } 3676 return { 3677 name: "hide", 3678 options, 3679 async fn(state) { 3680 const { 3681 rects, 3682 platform: platform3 3683 } = state; 3684 const { 3685 strategy = "referenceHidden", 3686 ...detectOverflowOptions 3687 } = evaluate(options, state); 3688 switch (strategy) { 3689 case "referenceHidden": { 3690 const overflow = await platform3.detectOverflow(state, { 3691 ...detectOverflowOptions, 3692 elementContext: "reference" 3693 }); 3694 const offsets = getSideOffsets(overflow, rects.reference); 3695 return { 3696 data: { 3697 referenceHiddenOffsets: offsets, 3698 referenceHidden: isAnySideFullyClipped(offsets) 3699 } 3700 }; 3701 } 3702 case "escaped": { 3703 const overflow = await platform3.detectOverflow(state, { 3704 ...detectOverflowOptions, 3705 altBoundary: true 3706 }); 3707 const offsets = getSideOffsets(overflow, rects.floating); 3708 return { 3709 data: { 3710 escapedOffsets: offsets, 3711 escaped: isAnySideFullyClipped(offsets) 3712 } 3713 }; 3714 } 3715 default: { 3716 return {}; 3717 } 3718 } 3719 } 3720 }; 3721 }; 3722 var originSides = /* @__PURE__ */ new Set(["left", "top"]); 3723 async function convertValueToCoords(state, options) { 3724 const { 3725 placement, 3726 platform: platform3, 3727 elements 3728 } = state; 3729 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)); 3730 const side = getSide(placement); 3731 const alignment = getAlignment(placement); 3732 const isVertical = getSideAxis(placement) === "y"; 3733 const mainAxisMulti = originSides.has(side) ? -1 : 1; 3734 const crossAxisMulti = rtl && isVertical ? -1 : 1; 3735 const rawValue = evaluate(options, state); 3736 let { 3737 mainAxis, 3738 crossAxis, 3739 alignmentAxis 3740 } = typeof rawValue === "number" ? { 3741 mainAxis: rawValue, 3742 crossAxis: 0, 3743 alignmentAxis: null 3744 } : { 3745 mainAxis: rawValue.mainAxis || 0, 3746 crossAxis: rawValue.crossAxis || 0, 3747 alignmentAxis: rawValue.alignmentAxis 3748 }; 3749 if (alignment && typeof alignmentAxis === "number") { 3750 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 3751 } 3752 return isVertical ? { 3753 x: crossAxis * crossAxisMulti, 3754 y: mainAxis * mainAxisMulti 3755 } : { 3756 x: mainAxis * mainAxisMulti, 3757 y: crossAxis * crossAxisMulti 3758 }; 3759 } 3760 var offset = function(options) { 3761 if (options === void 0) { 3762 options = 0; 3763 } 3764 return { 3765 name: "offset", 3766 options, 3767 async fn(state) { 3768 var _middlewareData$offse, _middlewareData$arrow; 3769 const { 3770 x, 3771 y, 3772 placement, 3773 middlewareData 3774 } = state; 3775 const diffCoords = await convertValueToCoords(state, options); 3776 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 3777 return {}; 3778 } 3779 return { 3780 x: x + diffCoords.x, 3781 y: y + diffCoords.y, 3782 data: { 3783 ...diffCoords, 3784 placement 3785 } 3786 }; 3787 } 3788 }; 3789 }; 3790 var shift = function(options) { 3791 if (options === void 0) { 3792 options = {}; 3793 } 3794 return { 3795 name: "shift", 3796 options, 3797 async fn(state) { 3798 const { 3799 x, 3800 y, 3801 placement, 3802 platform: platform3 3803 } = state; 3804 const { 3805 mainAxis: checkMainAxis = true, 3806 crossAxis: checkCrossAxis = false, 3807 limiter = { 3808 fn: (_ref) => { 3809 let { 3810 x: x2, 3811 y: y2 3812 } = _ref; 3813 return { 3814 x: x2, 3815 y: y2 3816 }; 3817 } 3818 }, 3819 ...detectOverflowOptions 3820 } = evaluate(options, state); 3821 const coords = { 3822 x, 3823 y 3824 }; 3825 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3826 const crossAxis = getSideAxis(getSide(placement)); 3827 const mainAxis = getOppositeAxis(crossAxis); 3828 let mainAxisCoord = coords[mainAxis]; 3829 let crossAxisCoord = coords[crossAxis]; 3830 if (checkMainAxis) { 3831 const minSide = mainAxis === "y" ? "top" : "left"; 3832 const maxSide = mainAxis === "y" ? "bottom" : "right"; 3833 const min2 = mainAxisCoord + overflow[minSide]; 3834 const max2 = mainAxisCoord - overflow[maxSide]; 3835 mainAxisCoord = clamp(min2, mainAxisCoord, max2); 3836 } 3837 if (checkCrossAxis) { 3838 const minSide = crossAxis === "y" ? "top" : "left"; 3839 const maxSide = crossAxis === "y" ? "bottom" : "right"; 3840 const min2 = crossAxisCoord + overflow[minSide]; 3841 const max2 = crossAxisCoord - overflow[maxSide]; 3842 crossAxisCoord = clamp(min2, crossAxisCoord, max2); 3843 } 3844 const limitedCoords = limiter.fn({ 3845 ...state, 3846 [mainAxis]: mainAxisCoord, 3847 [crossAxis]: crossAxisCoord 3848 }); 3849 return { 3850 ...limitedCoords, 3851 data: { 3852 x: limitedCoords.x - x, 3853 y: limitedCoords.y - y, 3854 enabled: { 3855 [mainAxis]: checkMainAxis, 3856 [crossAxis]: checkCrossAxis 3857 } 3858 } 3859 }; 3860 } 3861 }; 3862 }; 3863 var limitShift = function(options) { 3864 if (options === void 0) { 3865 options = {}; 3866 } 3867 return { 3868 options, 3869 fn(state) { 3870 const { 3871 x, 3872 y, 3873 placement, 3874 rects, 3875 middlewareData 3876 } = state; 3877 const { 3878 offset: offset4 = 0, 3879 mainAxis: checkMainAxis = true, 3880 crossAxis: checkCrossAxis = true 3881 } = evaluate(options, state); 3882 const coords = { 3883 x, 3884 y 3885 }; 3886 const crossAxis = getSideAxis(placement); 3887 const mainAxis = getOppositeAxis(crossAxis); 3888 let mainAxisCoord = coords[mainAxis]; 3889 let crossAxisCoord = coords[crossAxis]; 3890 const rawOffset = evaluate(offset4, state); 3891 const computedOffset = typeof rawOffset === "number" ? { 3892 mainAxis: rawOffset, 3893 crossAxis: 0 3894 } : { 3895 mainAxis: 0, 3896 crossAxis: 0, 3897 ...rawOffset 3898 }; 3899 if (checkMainAxis) { 3900 const len = mainAxis === "y" ? "height" : "width"; 3901 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 3902 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 3903 if (mainAxisCoord < limitMin) { 3904 mainAxisCoord = limitMin; 3905 } else if (mainAxisCoord > limitMax) { 3906 mainAxisCoord = limitMax; 3907 } 3908 } 3909 if (checkCrossAxis) { 3910 var _middlewareData$offse, _middlewareData$offse2; 3911 const len = mainAxis === "y" ? "width" : "height"; 3912 const isOriginSide = originSides.has(getSide(placement)); 3913 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); 3914 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); 3915 if (crossAxisCoord < limitMin) { 3916 crossAxisCoord = limitMin; 3917 } else if (crossAxisCoord > limitMax) { 3918 crossAxisCoord = limitMax; 3919 } 3920 } 3921 return { 3922 [mainAxis]: mainAxisCoord, 3923 [crossAxis]: crossAxisCoord 3924 }; 3925 } 3926 }; 3927 }; 3928 var size = function(options) { 3929 if (options === void 0) { 3930 options = {}; 3931 } 3932 return { 3933 name: "size", 3934 options, 3935 async fn(state) { 3936 var _state$middlewareData, _state$middlewareData2; 3937 const { 3938 placement, 3939 rects, 3940 platform: platform3, 3941 elements 3942 } = state; 3943 const { 3944 apply = () => { 3945 }, 3946 ...detectOverflowOptions 3947 } = evaluate(options, state); 3948 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3949 const side = getSide(placement); 3950 const alignment = getAlignment(placement); 3951 const isYAxis = getSideAxis(placement) === "y"; 3952 const { 3953 width, 3954 height 3955 } = rects.floating; 3956 let heightSide; 3957 let widthSide; 3958 if (side === "top" || side === "bottom") { 3959 heightSide = side; 3960 widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements.floating)) ? "start" : "end") ? "left" : "right"; 3961 } else { 3962 widthSide = side; 3963 heightSide = alignment === "end" ? "top" : "bottom"; 3964 } 3965 const maximumClippingHeight = height - overflow.top - overflow.bottom; 3966 const maximumClippingWidth = width - overflow.left - overflow.right; 3967 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 3968 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 3969 const noShift = !state.middlewareData.shift; 3970 let availableHeight = overflowAvailableHeight; 3971 let availableWidth = overflowAvailableWidth; 3972 if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { 3973 availableWidth = maximumClippingWidth; 3974 } 3975 if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { 3976 availableHeight = maximumClippingHeight; 3977 } 3978 if (noShift && !alignment) { 3979 const xMin = max(overflow.left, 0); 3980 const xMax = max(overflow.right, 0); 3981 const yMin = max(overflow.top, 0); 3982 const yMax = max(overflow.bottom, 0); 3983 if (isYAxis) { 3984 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); 3985 } else { 3986 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); 3987 } 3988 } 3989 await apply({ 3990 ...state, 3991 availableWidth, 3992 availableHeight 3993 }); 3994 const nextDimensions = await platform3.getDimensions(elements.floating); 3995 if (width !== nextDimensions.width || height !== nextDimensions.height) { 3996 return { 3997 reset: { 3998 rects: true 3999 } 4000 }; 4001 } 4002 return {}; 4003 } 4004 }; 4005 }; 4006 4007 // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 4008 function getCssDimensions(element) { 4009 const css = getComputedStyle2(element); 4010 let width = parseFloat(css.width) || 0; 4011 let height = parseFloat(css.height) || 0; 4012 const hasOffset = isHTMLElement(element); 4013 const offsetWidth = hasOffset ? element.offsetWidth : width; 4014 const offsetHeight = hasOffset ? element.offsetHeight : height; 4015 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 4016 if (shouldFallback) { 4017 width = offsetWidth; 4018 height = offsetHeight; 4019 } 4020 return { 4021 width, 4022 height, 4023 $: shouldFallback 4024 }; 4025 } 4026 function unwrapElement(element) { 4027 return !isElement(element) ? element.contextElement : element; 4028 } 4029 function getScale(element) { 4030 const domElement = unwrapElement(element); 4031 if (!isHTMLElement(domElement)) { 4032 return createCoords(1); 4033 } 4034 const rect = domElement.getBoundingClientRect(); 4035 const { 4036 width, 4037 height, 4038 $ 4039 } = getCssDimensions(domElement); 4040 let x = ($ ? round(rect.width) : rect.width) / width; 4041 let y = ($ ? round(rect.height) : rect.height) / height; 4042 if (!x || !Number.isFinite(x)) { 4043 x = 1; 4044 } 4045 if (!y || !Number.isFinite(y)) { 4046 y = 1; 4047 } 4048 return { 4049 x, 4050 y 4051 }; 4052 } 4053 var noOffsets = /* @__PURE__ */ createCoords(0); 4054 function getVisualOffsets(element) { 4055 const win = getWindow(element); 4056 if (!isWebKit() || !win.visualViewport) { 4057 return noOffsets; 4058 } 4059 return { 4060 x: win.visualViewport.offsetLeft, 4061 y: win.visualViewport.offsetTop 4062 }; 4063 } 4064 function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 4065 if (isFixed === void 0) { 4066 isFixed = false; 4067 } 4068 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { 4069 return false; 4070 } 4071 return isFixed; 4072 } 4073 function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 4074 if (includeScale === void 0) { 4075 includeScale = false; 4076 } 4077 if (isFixedStrategy === void 0) { 4078 isFixedStrategy = false; 4079 } 4080 const clientRect = element.getBoundingClientRect(); 4081 const domElement = unwrapElement(element); 4082 let scale = createCoords(1); 4083 if (includeScale) { 4084 if (offsetParent) { 4085 if (isElement(offsetParent)) { 4086 scale = getScale(offsetParent); 4087 } 4088 } else { 4089 scale = getScale(element); 4090 } 4091 } 4092 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 4093 let x = (clientRect.left + visualOffsets.x) / scale.x; 4094 let y = (clientRect.top + visualOffsets.y) / scale.y; 4095 let width = clientRect.width / scale.x; 4096 let height = clientRect.height / scale.y; 4097 if (domElement) { 4098 const win = getWindow(domElement); 4099 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 4100 let currentWin = win; 4101 let currentIFrame = getFrameElement(currentWin); 4102 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 4103 const iframeScale = getScale(currentIFrame); 4104 const iframeRect = currentIFrame.getBoundingClientRect(); 4105 const css = getComputedStyle2(currentIFrame); 4106 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 4107 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 4108 x *= iframeScale.x; 4109 y *= iframeScale.y; 4110 width *= iframeScale.x; 4111 height *= iframeScale.y; 4112 x += left; 4113 y += top; 4114 currentWin = getWindow(currentIFrame); 4115 currentIFrame = getFrameElement(currentWin); 4116 } 4117 } 4118 return rectToClientRect({ 4119 width, 4120 height, 4121 x, 4122 y 4123 }); 4124 } 4125 function getWindowScrollBarX(element, rect) { 4126 const leftScroll = getNodeScroll(element).scrollLeft; 4127 if (!rect) { 4128 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 4129 } 4130 return rect.left + leftScroll; 4131 } 4132 function getHTMLOffset(documentElement, scroll) { 4133 const htmlRect = documentElement.getBoundingClientRect(); 4134 const x = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 4135 const y = htmlRect.top + scroll.scrollTop; 4136 return { 4137 x, 4138 y 4139 }; 4140 } 4141 function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 4142 let { 4143 elements, 4144 rect, 4145 offsetParent, 4146 strategy 4147 } = _ref; 4148 const isFixed = strategy === "fixed"; 4149 const documentElement = getDocumentElement(offsetParent); 4150 const topLayer = elements ? isTopLayer(elements.floating) : false; 4151 if (offsetParent === documentElement || topLayer && isFixed) { 4152 return rect; 4153 } 4154 let scroll = { 4155 scrollLeft: 0, 4156 scrollTop: 0 4157 }; 4158 let scale = createCoords(1); 4159 const offsets = createCoords(0); 4160 const isOffsetParentAnElement = isHTMLElement(offsetParent); 4161 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 4162 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 4163 scroll = getNodeScroll(offsetParent); 4164 } 4165 if (isOffsetParentAnElement) { 4166 const offsetRect = getBoundingClientRect(offsetParent); 4167 scale = getScale(offsetParent); 4168 offsets.x = offsetRect.x + offsetParent.clientLeft; 4169 offsets.y = offsetRect.y + offsetParent.clientTop; 4170 } 4171 } 4172 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 4173 return { 4174 width: rect.width * scale.x, 4175 height: rect.height * scale.y, 4176 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 4177 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 4178 }; 4179 } 4180 function getClientRects(element) { 4181 return Array.from(element.getClientRects()); 4182 } 4183 function getDocumentRect(element) { 4184 const html = getDocumentElement(element); 4185 const scroll = getNodeScroll(element); 4186 const body = element.ownerDocument.body; 4187 const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 4188 const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 4189 let x = -scroll.scrollLeft + getWindowScrollBarX(element); 4190 const y = -scroll.scrollTop; 4191 if (getComputedStyle2(body).direction === "rtl") { 4192 x += max(html.clientWidth, body.clientWidth) - width; 4193 } 4194 return { 4195 width, 4196 height, 4197 x, 4198 y 4199 }; 4200 } 4201 var SCROLLBAR_MAX = 25; 4202 function getViewportRect(element, strategy) { 4203 const win = getWindow(element); 4204 const html = getDocumentElement(element); 4205 const visualViewport = win.visualViewport; 4206 let width = html.clientWidth; 4207 let height = html.clientHeight; 4208 let x = 0; 4209 let y = 0; 4210 if (visualViewport) { 4211 width = visualViewport.width; 4212 height = visualViewport.height; 4213 const visualViewportBased = isWebKit(); 4214 if (!visualViewportBased || visualViewportBased && strategy === "fixed") { 4215 x = visualViewport.offsetLeft; 4216 y = visualViewport.offsetTop; 4217 } 4218 } 4219 const windowScrollbarX = getWindowScrollBarX(html); 4220 if (windowScrollbarX <= 0) { 4221 const doc = html.ownerDocument; 4222 const body = doc.body; 4223 const bodyStyles = getComputedStyle(body); 4224 const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 4225 const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); 4226 if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { 4227 width -= clippingStableScrollbarWidth; 4228 } 4229 } else if (windowScrollbarX <= SCROLLBAR_MAX) { 4230 width += windowScrollbarX; 4231 } 4232 return { 4233 width, 4234 height, 4235 x, 4236 y 4237 }; 4238 } 4239 function getInnerBoundingClientRect(element, strategy) { 4240 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 4241 const top = clientRect.top + element.clientTop; 4242 const left = clientRect.left + element.clientLeft; 4243 const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); 4244 const width = element.clientWidth * scale.x; 4245 const height = element.clientHeight * scale.y; 4246 const x = left * scale.x; 4247 const y = top * scale.y; 4248 return { 4249 width, 4250 height, 4251 x, 4252 y 4253 }; 4254 } 4255 function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 4256 let rect; 4257 if (clippingAncestor === "viewport") { 4258 rect = getViewportRect(element, strategy); 4259 } else if (clippingAncestor === "document") { 4260 rect = getDocumentRect(getDocumentElement(element)); 4261 } else if (isElement(clippingAncestor)) { 4262 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 4263 } else { 4264 const visualOffsets = getVisualOffsets(element); 4265 rect = { 4266 x: clippingAncestor.x - visualOffsets.x, 4267 y: clippingAncestor.y - visualOffsets.y, 4268 width: clippingAncestor.width, 4269 height: clippingAncestor.height 4270 }; 4271 } 4272 return rectToClientRect(rect); 4273 } 4274 function hasFixedPositionAncestor(element, stopNode) { 4275 const parentNode = getParentNode(element); 4276 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 4277 return false; 4278 } 4279 return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); 4280 } 4281 function getClippingElementAncestors(element, cache) { 4282 const cachedResult = cache.get(element); 4283 if (cachedResult) { 4284 return cachedResult; 4285 } 4286 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 4287 let currentContainingBlockComputedStyle = null; 4288 const elementIsFixed = getComputedStyle2(element).position === "fixed"; 4289 let currentNode = elementIsFixed ? getParentNode(element) : element; 4290 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 4291 const computedStyle = getComputedStyle2(currentNode); 4292 const currentNodeIsContaining = isContainingBlock(currentNode); 4293 if (!currentNodeIsContaining && computedStyle.position === "fixed") { 4294 currentContainingBlockComputedStyle = null; 4295 } 4296 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 4297 if (shouldDropCurrentNode) { 4298 result = result.filter((ancestor) => ancestor !== currentNode); 4299 } else { 4300 currentContainingBlockComputedStyle = computedStyle; 4301 } 4302 currentNode = getParentNode(currentNode); 4303 } 4304 cache.set(element, result); 4305 return result; 4306 } 4307 function getClippingRect(_ref) { 4308 let { 4309 element, 4310 boundary, 4311 rootBoundary, 4312 strategy 4313 } = _ref; 4314 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 4315 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 4316 const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); 4317 let top = firstRect.top; 4318 let right = firstRect.right; 4319 let bottom = firstRect.bottom; 4320 let left = firstRect.left; 4321 for (let i = 1; i < clippingAncestors.length; i++) { 4322 const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i], strategy); 4323 top = max(rect.top, top); 4324 right = min(rect.right, right); 4325 bottom = min(rect.bottom, bottom); 4326 left = max(rect.left, left); 4327 } 4328 return { 4329 width: right - left, 4330 height: bottom - top, 4331 x: left, 4332 y: top 4333 }; 4334 } 4335 function getDimensions(element) { 4336 const { 4337 width, 4338 height 4339 } = getCssDimensions(element); 4340 return { 4341 width, 4342 height 4343 }; 4344 } 4345 function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 4346 const isOffsetParentAnElement = isHTMLElement(offsetParent); 4347 const documentElement = getDocumentElement(offsetParent); 4348 const isFixed = strategy === "fixed"; 4349 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 4350 let scroll = { 4351 scrollLeft: 0, 4352 scrollTop: 0 4353 }; 4354 const offsets = createCoords(0); 4355 function setLeftRTLScrollbarOffset() { 4356 offsets.x = getWindowScrollBarX(documentElement); 4357 } 4358 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 4359 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 4360 scroll = getNodeScroll(offsetParent); 4361 } 4362 if (isOffsetParentAnElement) { 4363 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 4364 offsets.x = offsetRect.x + offsetParent.clientLeft; 4365 offsets.y = offsetRect.y + offsetParent.clientTop; 4366 } else if (documentElement) { 4367 setLeftRTLScrollbarOffset(); 4368 } 4369 } 4370 if (isFixed && !isOffsetParentAnElement && documentElement) { 4371 setLeftRTLScrollbarOffset(); 4372 } 4373 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 4374 const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 4375 const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 4376 return { 4377 x, 4378 y, 4379 width: rect.width, 4380 height: rect.height 4381 }; 4382 } 4383 function isStaticPositioned(element) { 4384 return getComputedStyle2(element).position === "static"; 4385 } 4386 function getTrueOffsetParent(element, polyfill) { 4387 if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { 4388 return null; 4389 } 4390 if (polyfill) { 4391 return polyfill(element); 4392 } 4393 let rawOffsetParent = element.offsetParent; 4394 if (getDocumentElement(element) === rawOffsetParent) { 4395 rawOffsetParent = rawOffsetParent.ownerDocument.body; 4396 } 4397 return rawOffsetParent; 4398 } 4399 function getOffsetParent(element, polyfill) { 4400 const win = getWindow(element); 4401 if (isTopLayer(element)) { 4402 return win; 4403 } 4404 if (!isHTMLElement(element)) { 4405 let svgOffsetParent = getParentNode(element); 4406 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 4407 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 4408 return svgOffsetParent; 4409 } 4410 svgOffsetParent = getParentNode(svgOffsetParent); 4411 } 4412 return win; 4413 } 4414 let offsetParent = getTrueOffsetParent(element, polyfill); 4415 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 4416 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 4417 } 4418 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 4419 return win; 4420 } 4421 return offsetParent || getContainingBlock(element) || win; 4422 } 4423 var getElementRects = async function(data) { 4424 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 4425 const getDimensionsFn = this.getDimensions; 4426 const floatingDimensions = await getDimensionsFn(data.floating); 4427 return { 4428 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 4429 floating: { 4430 x: 0, 4431 y: 0, 4432 width: floatingDimensions.width, 4433 height: floatingDimensions.height 4434 } 4435 }; 4436 }; 4437 function isRTL(element) { 4438 return getComputedStyle2(element).direction === "rtl"; 4439 } 4440 var platform2 = { 4441 convertOffsetParentRelativeRectToViewportRelativeRect, 4442 getDocumentElement, 4443 getClippingRect, 4444 getOffsetParent, 4445 getElementRects, 4446 getClientRects, 4447 getDimensions, 4448 getScale, 4449 isElement, 4450 isRTL 4451 }; 4452 function rectsAreEqual(a, b) { 4453 return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height; 4454 } 4455 function observeMove(element, onMove) { 4456 let io = null; 4457 let timeoutId; 4458 const root = getDocumentElement(element); 4459 function cleanup() { 4460 var _io; 4461 clearTimeout(timeoutId); 4462 (_io = io) == null || _io.disconnect(); 4463 io = null; 4464 } 4465 function refresh(skip, threshold) { 4466 if (skip === void 0) { 4467 skip = false; 4468 } 4469 if (threshold === void 0) { 4470 threshold = 1; 4471 } 4472 cleanup(); 4473 const elementRectForRootMargin = element.getBoundingClientRect(); 4474 const { 4475 left, 4476 top, 4477 width, 4478 height 4479 } = elementRectForRootMargin; 4480 if (!skip) { 4481 onMove(); 4482 } 4483 if (!width || !height) { 4484 return; 4485 } 4486 const insetTop = floor(top); 4487 const insetRight = floor(root.clientWidth - (left + width)); 4488 const insetBottom = floor(root.clientHeight - (top + height)); 4489 const insetLeft = floor(left); 4490 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 4491 const options = { 4492 rootMargin, 4493 threshold: max(0, min(1, threshold)) || 1 4494 }; 4495 let isFirstUpdate = true; 4496 function handleObserve(entries) { 4497 const ratio = entries[0].intersectionRatio; 4498 if (ratio !== threshold) { 4499 if (!isFirstUpdate) { 4500 return refresh(); 4501 } 4502 if (!ratio) { 4503 timeoutId = setTimeout(() => { 4504 refresh(false, 1e-7); 4505 }, 1e3); 4506 } else { 4507 refresh(false, ratio); 4508 } 4509 } 4510 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 4511 refresh(); 4512 } 4513 isFirstUpdate = false; 4514 } 4515 try { 4516 io = new IntersectionObserver(handleObserve, { 4517 ...options, 4518 // Handle <iframe>s 4519 root: root.ownerDocument 4520 }); 4521 } catch (_e) { 4522 io = new IntersectionObserver(handleObserve, options); 4523 } 4524 io.observe(element); 4525 } 4526 refresh(true); 4527 return cleanup; 4528 } 4529 function autoUpdate(reference, floating, update2, options) { 4530 if (options === void 0) { 4531 options = {}; 4532 } 4533 const { 4534 ancestorScroll = true, 4535 ancestorResize = true, 4536 elementResize = typeof ResizeObserver === "function", 4537 layoutShift = typeof IntersectionObserver === "function", 4538 animationFrame = false 4539 } = options; 4540 const referenceEl = unwrapElement(reference); 4541 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : []; 4542 ancestors.forEach((ancestor) => { 4543 ancestorScroll && ancestor.addEventListener("scroll", update2, { 4544 passive: true 4545 }); 4546 ancestorResize && ancestor.addEventListener("resize", update2); 4547 }); 4548 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : null; 4549 let reobserveFrame = -1; 4550 let resizeObserver = null; 4551 if (elementResize) { 4552 resizeObserver = new ResizeObserver((_ref) => { 4553 let [firstEntry] = _ref; 4554 if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) { 4555 resizeObserver.unobserve(floating); 4556 cancelAnimationFrame(reobserveFrame); 4557 reobserveFrame = requestAnimationFrame(() => { 4558 var _resizeObserver; 4559 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 4560 }); 4561 } 4562 update2(); 4563 }); 4564 if (referenceEl && !animationFrame) { 4565 resizeObserver.observe(referenceEl); 4566 } 4567 if (floating) { 4568 resizeObserver.observe(floating); 4569 } 4570 } 4571 let frameId; 4572 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 4573 if (animationFrame) { 4574 frameLoop(); 4575 } 4576 function frameLoop() { 4577 const nextRefRect = getBoundingClientRect(reference); 4578 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 4579 update2(); 4580 } 4581 prevRefRect = nextRefRect; 4582 frameId = requestAnimationFrame(frameLoop); 4583 } 4584 update2(); 4585 return () => { 4586 var _resizeObserver2; 4587 ancestors.forEach((ancestor) => { 4588 ancestorScroll && ancestor.removeEventListener("scroll", update2); 4589 ancestorResize && ancestor.removeEventListener("resize", update2); 4590 }); 4591 cleanupIo == null || cleanupIo(); 4592 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 4593 resizeObserver = null; 4594 if (animationFrame) { 4595 cancelAnimationFrame(frameId); 4596 } 4597 }; 4598 } 4599 var offset2 = offset; 4600 var shift2 = shift; 4601 var flip2 = flip; 4602 var size2 = size; 4603 var hide2 = hide; 4604 var limitShift2 = limitShift; 4605 var computePosition2 = (reference, floating, options) => { 4606 const cache = /* @__PURE__ */ new Map(); 4607 const mergedOptions = { 4608 platform: platform2, 4609 ...options 4610 }; 4611 const platformWithCache = { 4612 ...mergedOptions.platform, 4613 _c: cache 4614 }; 4615 return computePosition(reference, floating, { 4616 ...mergedOptions, 4617 platform: platformWithCache 4618 }); 4619 }; 4620 4621 // node_modules/@base-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs 4622 var React23 = __toESM(require_react(), 1); 4623 var import_react2 = __toESM(require_react(), 1); 4624 var ReactDOM3 = __toESM(require_react_dom(), 1); 4625 var isClient = typeof document !== "undefined"; 4626 var noop2 = function noop3() { 4627 }; 4628 var index = isClient ? import_react2.useLayoutEffect : noop2; 4629 function deepEqual(a, b) { 4630 if (a === b) { 4631 return true; 4632 } 4633 if (typeof a !== typeof b) { 4634 return false; 4635 } 4636 if (typeof a === "function" && a.toString() === b.toString()) { 4637 return true; 4638 } 4639 let length; 4640 let i; 4641 let keys; 4642 if (a && b && typeof a === "object") { 4643 if (Array.isArray(a)) { 4644 length = a.length; 4645 if (length !== b.length) return false; 4646 for (i = length; i-- !== 0; ) { 4647 if (!deepEqual(a[i], b[i])) { 4648 return false; 4649 } 4650 } 4651 return true; 4652 } 4653 keys = Object.keys(a); 4654 length = keys.length; 4655 if (length !== Object.keys(b).length) { 4656 return false; 4657 } 4658 for (i = length; i-- !== 0; ) { 4659 if (!{}.hasOwnProperty.call(b, keys[i])) { 4660 return false; 4661 } 4662 } 4663 for (i = length; i-- !== 0; ) { 4664 const key = keys[i]; 4665 if (key === "_owner" && a.$$typeof) { 4666 continue; 4667 } 4668 if (!deepEqual(a[key], b[key])) { 4669 return false; 4670 } 4671 } 4672 return true; 4673 } 4674 return a !== a && b !== b; 4675 } 4676 function getDPR(element) { 4677 if (typeof window === "undefined") { 4678 return 1; 4679 } 4680 const win = element.ownerDocument.defaultView || window; 4681 return win.devicePixelRatio || 1; 4682 } 4683 function roundByDPR(element, value) { 4684 const dpr = getDPR(element); 4685 return Math.round(value * dpr) / dpr; 4686 } 4687 function useLatestRef(value) { 4688 const ref = React23.useRef(value); 4689 index(() => { 4690 ref.current = value; 4691 }); 4692 return ref; 4693 } 4694 function useFloating(options) { 4695 if (options === void 0) { 4696 options = {}; 4697 } 4698 const { 4699 placement = "bottom", 4700 strategy = "absolute", 4701 middleware = [], 4702 platform: platform3, 4703 elements: { 4704 reference: externalReference, 4705 floating: externalFloating 4706 } = {}, 4707 transform = true, 4708 whileElementsMounted, 4709 open 4710 } = options; 4711 const [data, setData] = React23.useState({ 4712 x: 0, 4713 y: 0, 4714 strategy, 4715 placement, 4716 middlewareData: {}, 4717 isPositioned: false 4718 }); 4719 const [latestMiddleware, setLatestMiddleware] = React23.useState(middleware); 4720 if (!deepEqual(latestMiddleware, middleware)) { 4721 setLatestMiddleware(middleware); 4722 } 4723 const [_reference, _setReference] = React23.useState(null); 4724 const [_floating, _setFloating] = React23.useState(null); 4725 const setReference = React23.useCallback((node) => { 4726 if (node !== referenceRef.current) { 4727 referenceRef.current = node; 4728 _setReference(node); 4729 } 4730 }, []); 4731 const setFloating = React23.useCallback((node) => { 4732 if (node !== floatingRef.current) { 4733 floatingRef.current = node; 4734 _setFloating(node); 4735 } 4736 }, []); 4737 const referenceEl = externalReference || _reference; 4738 const floatingEl = externalFloating || _floating; 4739 const referenceRef = React23.useRef(null); 4740 const floatingRef = React23.useRef(null); 4741 const dataRef = React23.useRef(data); 4742 const hasWhileElementsMounted = whileElementsMounted != null; 4743 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 4744 const platformRef = useLatestRef(platform3); 4745 const openRef = useLatestRef(open); 4746 const update2 = React23.useCallback(() => { 4747 if (!referenceRef.current || !floatingRef.current) { 4748 return; 4749 } 4750 const config = { 4751 placement, 4752 strategy, 4753 middleware: latestMiddleware 4754 }; 4755 if (platformRef.current) { 4756 config.platform = platformRef.current; 4757 } 4758 computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => { 4759 const fullData = { 4760 ...data2, 4761 // The floating element's position may be recomputed while it's closed 4762 // but still mounted (such as when transitioning out). To ensure 4763 // `isPositioned` will be `false` initially on the next open, avoid 4764 // setting it to `true` when `open === false` (must be specified). 4765 isPositioned: openRef.current !== false 4766 }; 4767 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 4768 dataRef.current = fullData; 4769 ReactDOM3.flushSync(() => { 4770 setData(fullData); 4771 }); 4772 } 4773 }); 4774 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 4775 index(() => { 4776 if (open === false && dataRef.current.isPositioned) { 4777 dataRef.current.isPositioned = false; 4778 setData((data2) => ({ 4779 ...data2, 4780 isPositioned: false 4781 })); 4782 } 4783 }, [open]); 4784 const isMountedRef = React23.useRef(false); 4785 index(() => { 4786 isMountedRef.current = true; 4787 return () => { 4788 isMountedRef.current = false; 4789 }; 4790 }, []); 4791 index(() => { 4792 if (referenceEl) referenceRef.current = referenceEl; 4793 if (floatingEl) floatingRef.current = floatingEl; 4794 if (referenceEl && floatingEl) { 4795 if (whileElementsMountedRef.current) { 4796 return whileElementsMountedRef.current(referenceEl, floatingEl, update2); 4797 } 4798 update2(); 4799 } 4800 }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); 4801 const refs = React23.useMemo(() => ({ 4802 reference: referenceRef, 4803 floating: floatingRef, 4804 setReference, 4805 setFloating 4806 }), [setReference, setFloating]); 4807 const elements = React23.useMemo(() => ({ 4808 reference: referenceEl, 4809 floating: floatingEl 4810 }), [referenceEl, floatingEl]); 4811 const floatingStyles = React23.useMemo(() => { 4812 const initialStyles = { 4813 position: strategy, 4814 left: 0, 4815 top: 0 4816 }; 4817 if (!elements.floating) { 4818 return initialStyles; 4819 } 4820 const x = roundByDPR(elements.floating, data.x); 4821 const y = roundByDPR(elements.floating, data.y); 4822 if (transform) { 4823 return { 4824 ...initialStyles, 4825 transform: "translate(" + x + "px, " + y + "px)", 4826 ...getDPR(elements.floating) >= 1.5 && { 4827 willChange: "transform" 4828 } 4829 }; 4830 } 4831 return { 4832 position: strategy, 4833 left: x, 4834 top: y 4835 }; 4836 }, [strategy, transform, elements.floating, data.x, data.y]); 4837 return React23.useMemo(() => ({ 4838 ...data, 4839 update: update2, 4840 refs, 4841 elements, 4842 floatingStyles 4843 }), [data, update2, refs, elements, floatingStyles]); 4844 } 4845 var offset3 = (options, deps) => { 4846 const result = offset2(options); 4847 return { 4848 name: result.name, 4849 fn: result.fn, 4850 options: [options, deps] 4851 }; 4852 }; 4853 var shift3 = (options, deps) => { 4854 const result = shift2(options); 4855 return { 4856 name: result.name, 4857 fn: result.fn, 4858 options: [options, deps] 4859 }; 4860 }; 4861 var limitShift3 = (options, deps) => { 4862 const result = limitShift2(options); 4863 return { 4864 fn: result.fn, 4865 options: [options, deps] 4866 }; 4867 }; 4868 var flip3 = (options, deps) => { 4869 const result = flip2(options); 4870 return { 4871 name: result.name, 4872 fn: result.fn, 4873 options: [options, deps] 4874 }; 4875 }; 4876 var size3 = (options, deps) => { 4877 const result = size2(options); 4878 return { 4879 name: result.name, 4880 fn: result.fn, 4881 options: [options, deps] 4882 }; 4883 }; 4884 var hide3 = (options, deps) => { 4885 const result = hide2(options); 4886 return { 4887 name: result.name, 4888 fn: result.fn, 4889 options: [options, deps] 4890 }; 4891 }; 4892 4893 // node_modules/@base-ui/utils/esm/store/createSelector.js 4894 var createSelector = (a, b, c, d, e, f, ...other) => { 4895 if (other.length > 0) { 4896 throw new Error(true ? "Unsupported number of selectors" : formatErrorMessage_default(1)); 4897 } 4898 let selector; 4899 if (a && b && c && d && e && f) { 4900 selector = (state, a1, a2, a3) => { 4901 const va = a(state, a1, a2, a3); 4902 const vb = b(state, a1, a2, a3); 4903 const vc = c(state, a1, a2, a3); 4904 const vd = d(state, a1, a2, a3); 4905 const ve = e(state, a1, a2, a3); 4906 return f(va, vb, vc, vd, ve, a1, a2, a3); 4907 }; 4908 } else if (a && b && c && d && e) { 4909 selector = (state, a1, a2, a3) => { 4910 const va = a(state, a1, a2, a3); 4911 const vb = b(state, a1, a2, a3); 4912 const vc = c(state, a1, a2, a3); 4913 const vd = d(state, a1, a2, a3); 4914 return e(va, vb, vc, vd, a1, a2, a3); 4915 }; 4916 } else if (a && b && c && d) { 4917 selector = (state, a1, a2, a3) => { 4918 const va = a(state, a1, a2, a3); 4919 const vb = b(state, a1, a2, a3); 4920 const vc = c(state, a1, a2, a3); 4921 return d(va, vb, vc, a1, a2, a3); 4922 }; 4923 } else if (a && b && c) { 4924 selector = (state, a1, a2, a3) => { 4925 const va = a(state, a1, a2, a3); 4926 const vb = b(state, a1, a2, a3); 4927 return c(va, vb, a1, a2, a3); 4928 }; 4929 } else if (a && b) { 4930 selector = (state, a1, a2, a3) => { 4931 const va = a(state, a1, a2, a3); 4932 return b(va, a1, a2, a3); 4933 }; 4934 } else if (a) { 4935 selector = a; 4936 } else { 4937 throw ( 4938 /* minify-error-disabled */ 4939 new Error("Missing arguments") 4940 ); 4941 } 4942 return selector; 4943 }; 4944 4945 // node_modules/@base-ui/utils/esm/store/useStore.js 4946 var React25 = __toESM(require_react(), 1); 4947 var import_shim = __toESM(require_shim(), 1); 4948 var import_with_selector = __toESM(require_with_selector(), 1); 4949 4950 // node_modules/@base-ui/utils/esm/fastHooks.js 4951 var React24 = __toESM(require_react(), 1); 4952 var hooks = []; 4953 var currentInstance = void 0; 4954 function getInstance() { 4955 return currentInstance; 4956 } 4957 function register(hook) { 4958 hooks.push(hook); 4959 } 4960 function fastComponent(fn) { 4961 const FastComponent = (props, forwardedRef) => { 4962 const instance = useRefWithInit(createInstance).current; 4963 let result; 4964 try { 4965 currentInstance = instance; 4966 for (const hook of hooks) { 4967 hook.before(instance); 4968 } 4969 result = fn(props, forwardedRef); 4970 for (const hook of hooks) { 4971 hook.after(instance); 4972 } 4973 instance.didInitialize = true; 4974 } finally { 4975 currentInstance = void 0; 4976 } 4977 return result; 4978 }; 4979 FastComponent.displayName = fn.displayName || fn.name; 4980 return FastComponent; 4981 } 4982 function fastComponentRef(fn) { 4983 return /* @__PURE__ */ React24.forwardRef(fastComponent(fn)); 4984 } 4985 function createInstance() { 4986 return { 4987 didInitialize: false 4988 }; 4989 } 4990 4991 // node_modules/@base-ui/utils/esm/store/useStore.js 4992 var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19); 4993 var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy; 4994 function useStore(store, selector, a1, a2, a3) { 4995 return useStoreImplementation(store, selector, a1, a2, a3); 4996 } 4997 function useStoreR19(store, selector, a1, a2, a3) { 4998 const getSelection = React25.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]); 4999 return (0, import_shim.useSyncExternalStore)(store.subscribe, getSelection, getSelection); 5000 } 5001 register({ 5002 before(instance) { 5003 instance.syncIndex = 0; 5004 if (!instance.didInitialize) { 5005 instance.syncTick = 1; 5006 instance.syncHooks = []; 5007 instance.didChangeStore = true; 5008 instance.getSnapshot = () => { 5009 let didChange2 = false; 5010 for (let i = 0; i < instance.syncHooks.length; i += 1) { 5011 const hook = instance.syncHooks[i]; 5012 const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3); 5013 if (hook.didChange || !Object.is(hook.value, value)) { 5014 didChange2 = true; 5015 hook.value = value; 5016 hook.didChange = false; 5017 } 5018 } 5019 if (didChange2) { 5020 instance.syncTick += 1; 5021 } 5022 return instance.syncTick; 5023 }; 5024 } 5025 }, 5026 after(instance) { 5027 if (instance.syncHooks.length > 0) { 5028 if (instance.didChangeStore) { 5029 instance.didChangeStore = false; 5030 instance.subscribe = (onStoreChange) => { 5031 const stores = /* @__PURE__ */ new Set(); 5032 for (const hook of instance.syncHooks) { 5033 stores.add(hook.store); 5034 } 5035 const unsubscribes = []; 5036 for (const store of stores) { 5037 unsubscribes.push(store.subscribe(onStoreChange)); 5038 } 5039 return () => { 5040 for (const unsubscribe of unsubscribes) { 5041 unsubscribe(); 5042 } 5043 }; 5044 }; 5045 } 5046 (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot); 5047 } 5048 } 5049 }); 5050 function useStoreFast(store, selector, a1, a2, a3) { 5051 const instance = getInstance(); 5052 if (!instance) { 5053 return useStoreR19(store, selector, a1, a2, a3); 5054 } 5055 const index2 = instance.syncIndex; 5056 instance.syncIndex += 1; 5057 let hook; 5058 if (!instance.didInitialize) { 5059 hook = { 5060 store, 5061 selector, 5062 a1, 5063 a2, 5064 a3, 5065 value: selector(store.getSnapshot(), a1, a2, a3), 5066 didChange: false 5067 }; 5068 instance.syncHooks.push(hook); 5069 } else { 5070 hook = instance.syncHooks[index2]; 5071 if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) { 5072 if (hook.store !== store) { 5073 instance.didChangeStore = true; 5074 } 5075 hook.store = store; 5076 hook.selector = selector; 5077 hook.a1 = a1; 5078 hook.a2 = a2; 5079 hook.a3 = a3; 5080 hook.didChange = true; 5081 } 5082 } 5083 return hook.value; 5084 } 5085 function useStoreLegacy(store, selector, a1, a2, a3) { 5086 return (0, import_with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3)); 5087 } 5088 5089 // node_modules/@base-ui/utils/esm/store/Store.js 5090 var Store = class { 5091 /** 5092 * The current state of the store. 5093 * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}. 5094 * 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). 5095 * The values can be used directly (to avoid subscribing to the store) in effects or event handlers. 5096 * 5097 * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification. 5098 */ 5099 // Internal state to handle recursive `setState()` calls 5100 constructor(state) { 5101 this.state = state; 5102 this.listeners = /* @__PURE__ */ new Set(); 5103 this.updateTick = 0; 5104 } 5105 /** 5106 * Registers a listener that will be called whenever the store's state changes. 5107 * 5108 * @param fn The listener function to be called on state changes. 5109 * @returns A function to unsubscribe the listener. 5110 */ 5111 subscribe = (fn) => { 5112 this.listeners.add(fn); 5113 return () => { 5114 this.listeners.delete(fn); 5115 }; 5116 }; 5117 /** 5118 * Returns the current state of the store. 5119 */ 5120 getSnapshot = () => { 5121 return this.state; 5122 }; 5123 /** 5124 * Updates the entire store's state and notifies all registered listeners. 5125 * 5126 * @param newState The new state to set for the store. 5127 */ 5128 setState(newState) { 5129 if (this.state === newState) { 5130 return; 5131 } 5132 this.state = newState; 5133 this.updateTick += 1; 5134 const currentTick = this.updateTick; 5135 for (const listener of this.listeners) { 5136 if (currentTick !== this.updateTick) { 5137 return; 5138 } 5139 listener(newState); 5140 } 5141 } 5142 /** 5143 * Merges the provided changes into the current state and notifies listeners if there are changes. 5144 * 5145 * @param changes An object containing the changes to apply to the current state. 5146 */ 5147 update(changes) { 5148 for (const key in changes) { 5149 if (!Object.is(this.state[key], changes[key])) { 5150 this.setState({ 5151 ...this.state, 5152 ...changes 5153 }); 5154 return; 5155 } 5156 } 5157 } 5158 /** 5159 * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed. 5160 * 5161 * @param key The key in the store's state to update. 5162 * @param value The new value to set for the specified key. 5163 */ 5164 set(key, value) { 5165 if (!Object.is(this.state[key], value)) { 5166 this.setState({ 5167 ...this.state, 5168 [key]: value 5169 }); 5170 } 5171 } 5172 /** 5173 * Gives the state a new reference and updates all registered listeners. 5174 */ 5175 notifyAll() { 5176 const newState = { 5177 ...this.state 5178 }; 5179 this.setState(newState); 5180 } 5181 use(selector, a1, a2, a3) { 5182 return useStore(this, selector, a1, a2, a3); 5183 } 5184 }; 5185 5186 // node_modules/@base-ui/utils/esm/store/ReactStore.js 5187 var React26 = __toESM(require_react(), 1); 5188 var ReactStore = class extends Store { 5189 /** 5190 * Creates a new ReactStore instance. 5191 * 5192 * @param state Initial state of the store. 5193 * @param context Non-reactive context values. 5194 * @param selectors Optional selectors for use with `useState`. 5195 */ 5196 constructor(state, context = {}, selectors3) { 5197 super(state); 5198 this.context = context; 5199 this.selectors = selectors3; 5200 } 5201 /** 5202 * Non-reactive values such as refs, callbacks, etc. 5203 */ 5204 /** 5205 * Synchronizes a single external value into the store. 5206 * 5207 * Note that the while the value in `state` is updated immediately, the value returned 5208 * by `useState` is updated before the next render (similarly to React's `useState`). 5209 */ 5210 useSyncedValue(key, value) { 5211 React26.useDebugValue(key); 5212 useIsoLayoutEffect(() => { 5213 if (this.state[key] !== value) { 5214 this.set(key, value); 5215 } 5216 }, [key, value]); 5217 } 5218 /** 5219 * Synchronizes a single external value into the store and 5220 * cleans it up (sets to `undefined`) on unmount. 5221 * 5222 * Note that the while the value in `state` is updated immediately, the value returned 5223 * by `useState` is updated before the next render (similarly to React's `useState`). 5224 */ 5225 useSyncedValueWithCleanup(key, value) { 5226 const store = this; 5227 useIsoLayoutEffect(() => { 5228 if (store.state[key] !== value) { 5229 store.set(key, value); 5230 } 5231 return () => { 5232 store.set(key, void 0); 5233 }; 5234 }, [store, key, value]); 5235 } 5236 /** 5237 * Synchronizes multiple external values into the store. 5238 * 5239 * Note that the while the values in `state` are updated immediately, the values returned 5240 * by `useState` are updated before the next render (similarly to React's `useState`). 5241 */ 5242 useSyncedValues(statePart) { 5243 const store = this; 5244 if (true) { 5245 React26.useDebugValue(statePart, (p) => Object.keys(p)); 5246 const keys = React26.useRef(Object.keys(statePart)).current; 5247 const nextKeys = Object.keys(statePart); 5248 if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) { 5249 console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable."); 5250 } 5251 } 5252 const dependencies = Object.values(statePart); 5253 useIsoLayoutEffect(() => { 5254 store.update(statePart); 5255 }, [store, ...dependencies]); 5256 } 5257 /** 5258 * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled` 5259 * is non-undefined, the store's state at `key` is updated to match `controlled`. 5260 */ 5261 useControlledProp(key, controlled) { 5262 React26.useDebugValue(key); 5263 const isControlled = controlled !== void 0; 5264 useIsoLayoutEffect(() => { 5265 if (isControlled && !Object.is(this.state[key], controlled)) { 5266 super.setState({ 5267 ...this.state, 5268 [key]: controlled 5269 }); 5270 } 5271 }, [key, controlled, isControlled]); 5272 if (true) { 5273 const cache = this.controlledValues ??= /* @__PURE__ */ new Map(); 5274 if (!cache.has(key)) { 5275 cache.set(key, isControlled); 5276 } 5277 const previouslyControlled = cache.get(key); 5278 if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) { 5279 console.error(`A component is changing the $isControlled ? "" : "un"}controlled state of $key.toString()} to be $isControlled ? "un" : ""}controlled. Elements should not switch from uncontrolled to controlled (or vice versa).`); 5280 } 5281 } 5282 } 5283 /** Gets the current value from the store using a selector with the provided key. 5284 * 5285 * @param key Key of the selector to use. 5286 */ 5287 select(key, a1, a2, a3) { 5288 const selector = this.selectors[key]; 5289 return selector(this.state, a1, a2, a3); 5290 } 5291 /** 5292 * Returns a value from the store's state using a selector function. 5293 * Used to subscribe to specific parts of the state. 5294 * This methods causes a rerender whenever the selected state changes. 5295 * 5296 * @param key Key of the selector to use. 5297 */ 5298 useState(key, a1, a2, a3) { 5299 React26.useDebugValue(key); 5300 return useStore(this, this.selectors[key], a1, a2, a3); 5301 } 5302 /** 5303 * Wraps a function with `useStableCallback` to ensure it has a stable reference 5304 * and assigns it to the context. 5305 * 5306 * @param key Key of the event callback. Must be a function in the context. 5307 * @param fn Function to assign. 5308 */ 5309 useContextCallback(key, fn) { 5310 React26.useDebugValue(key); 5311 const stableFunction = useStableCallback(fn ?? NOOP); 5312 this.context[key] = stableFunction; 5313 } 5314 /** 5315 * Returns a stable setter function for a specific key in the store's state. 5316 * It's commonly used to pass as a ref callback to React elements. 5317 * 5318 * @param key Key of the state to set. 5319 */ 5320 useStateSetter(key) { 5321 const ref = React26.useRef(void 0); 5322 if (ref.current === void 0) { 5323 ref.current = (value) => { 5324 this.set(key, value); 5325 }; 5326 } 5327 return ref.current; 5328 } 5329 /** 5330 * Observes changes derived from the store's selectors and calls the listener when the selected value changes. 5331 * 5332 * @param key Key of the selector to observe. 5333 * @param listener Listener function called when the selector result changes. 5334 */ 5335 observe(selector, listener) { 5336 let selectFn; 5337 if (typeof selector === "function") { 5338 selectFn = selector; 5339 } else { 5340 selectFn = this.selectors[selector]; 5341 } 5342 let prevValue = selectFn(this.state); 5343 listener(prevValue, prevValue, this); 5344 return this.subscribe((nextState) => { 5345 const nextValue = selectFn(nextState); 5346 if (!Object.is(prevValue, nextValue)) { 5347 const oldValue = prevValue; 5348 prevValue = nextValue; 5349 listener(nextValue, oldValue, this); 5350 } 5351 }); 5352 } 5353 }; 5354 5355 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingRootStore.js 5356 var selectors = { 5357 open: createSelector((state) => state.open), 5358 transitionStatus: createSelector((state) => state.transitionStatus), 5359 domReferenceElement: createSelector((state) => state.domReferenceElement), 5360 referenceElement: createSelector((state) => state.positionReference ?? state.referenceElement), 5361 floatingElement: createSelector((state) => state.floatingElement), 5362 floatingId: createSelector((state) => state.floatingId) 5363 }; 5364 var FloatingRootStore = class extends ReactStore { 5365 constructor(options) { 5366 const { 5367 syncOnly, 5368 nested, 5369 onOpenChange, 5370 triggerElements, 5371 ...initialState 5372 } = options; 5373 super({ 5374 ...initialState, 5375 positionReference: initialState.referenceElement, 5376 domReferenceElement: initialState.referenceElement 5377 }, { 5378 onOpenChange, 5379 dataRef: { 5380 current: {} 5381 }, 5382 events: createEventEmitter(), 5383 nested, 5384 triggerElements 5385 }, selectors); 5386 this.syncOnly = syncOnly; 5387 } 5388 /** 5389 * Syncs the event used by hover logic to distinguish hover-open from click-like interaction. 5390 */ 5391 syncOpenEvent = (newOpen, event) => { 5392 if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing 5393 // click events to upgrade a hover-open. 5394 event != null && isClickLikeEvent(event)) { 5395 this.context.dataRef.current.openEvent = newOpen ? event : void 0; 5396 } 5397 }; 5398 /** 5399 * Runs the root-owned side effects for an open state change. 5400 */ 5401 dispatchOpenChange = (newOpen, eventDetails) => { 5402 this.syncOpenEvent(newOpen, eventDetails.event); 5403 const details = { 5404 open: newOpen, 5405 reason: eventDetails.reason, 5406 nativeEvent: eventDetails.event, 5407 nested: this.context.nested, 5408 triggerElement: eventDetails.trigger 5409 }; 5410 this.context.events.emit("openchange", details); 5411 }; 5412 /** 5413 * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments. 5414 * 5415 * @param newOpen The new open state. 5416 * @param eventDetails Details about the event that triggered the open state change. 5417 */ 5418 setOpen = (newOpen, eventDetails) => { 5419 if (this.syncOnly) { 5420 this.context.onOpenChange?.(newOpen, eventDetails); 5421 return; 5422 } 5423 this.dispatchOpenChange(newOpen, eventDetails); 5424 this.context.onOpenChange?.(newOpen, eventDetails); 5425 }; 5426 }; 5427 5428 // node_modules/@base-ui/react/esm/utils/popups/popupStoreUtils.js 5429 var React27 = __toESM(require_react(), 1); 5430 function useTriggerRegistration(id, store) { 5431 const registeredElementIdRef = React27.useRef(null); 5432 const registeredElementRef = React27.useRef(null); 5433 return React27.useCallback((element) => { 5434 if (id === void 0) { 5435 return; 5436 } 5437 if (registeredElementIdRef.current !== null) { 5438 const registeredId = registeredElementIdRef.current; 5439 const registeredElement = registeredElementRef.current; 5440 const currentElement = store.context.triggerElements.getById(registeredId); 5441 if (registeredElement && currentElement === registeredElement) { 5442 store.context.triggerElements.delete(registeredId); 5443 } 5444 registeredElementIdRef.current = null; 5445 registeredElementRef.current = null; 5446 } 5447 if (element !== null) { 5448 registeredElementIdRef.current = id; 5449 registeredElementRef.current = element; 5450 store.context.triggerElements.add(id, element); 5451 } 5452 }, [store, id]); 5453 } 5454 function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) { 5455 const isMountedByThisTrigger = store.useState("isMountedByTrigger", triggerId); 5456 const baseRegisterTrigger = useTriggerRegistration(triggerId, store); 5457 const registerTrigger = useStableCallback((element) => { 5458 baseRegisterTrigger(element); 5459 if (!element || !store.select("open")) { 5460 return; 5461 } 5462 const activeTriggerId = store.select("activeTriggerId"); 5463 if (activeTriggerId === triggerId) { 5464 store.update({ 5465 activeTriggerElement: element, 5466 ...stateUpdates 5467 }); 5468 return; 5469 } 5470 if (activeTriggerId == null) { 5471 store.update({ 5472 activeTriggerId: triggerId, 5473 activeTriggerElement: element, 5474 ...stateUpdates 5475 }); 5476 } 5477 }); 5478 useIsoLayoutEffect(() => { 5479 if (isMountedByThisTrigger) { 5480 store.update({ 5481 activeTriggerElement: triggerElementRef.current, 5482 ...stateUpdates 5483 }); 5484 } 5485 }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]); 5486 return { 5487 registerTrigger, 5488 isMountedByThisTrigger 5489 }; 5490 } 5491 function useImplicitActiveTrigger(store) { 5492 const open = store.useState("open"); 5493 useIsoLayoutEffect(() => { 5494 if (open && !store.select("activeTriggerId") && store.context.triggerElements.size === 1) { 5495 const iteratorResult = store.context.triggerElements.entries().next(); 5496 if (!iteratorResult.done) { 5497 const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; 5498 store.update({ 5499 activeTriggerId: implicitTriggerId, 5500 activeTriggerElement: implicitTriggerElement 5501 }); 5502 } 5503 } 5504 }, [open, store]); 5505 } 5506 function useOpenStateTransitions(open, store, onUnmount) { 5507 const { 5508 mounted, 5509 setMounted, 5510 transitionStatus 5511 } = useTransitionStatus(open); 5512 store.useSyncedValues({ 5513 mounted, 5514 transitionStatus 5515 }); 5516 const forceUnmount = useStableCallback(() => { 5517 setMounted(false); 5518 store.update({ 5519 activeTriggerId: null, 5520 activeTriggerElement: null, 5521 mounted: false 5522 }); 5523 onUnmount?.(); 5524 store.context.onOpenChangeComplete?.(false); 5525 }); 5526 const preventUnmountingOnClose = store.useState("preventUnmountingOnClose"); 5527 useOpenChangeComplete({ 5528 enabled: !preventUnmountingOnClose, 5529 open, 5530 ref: store.context.popupRef, 5531 onComplete() { 5532 if (!open) { 5533 forceUnmount(); 5534 } 5535 } 5536 }); 5537 return { 5538 forceUnmount, 5539 transitionStatus 5540 }; 5541 } 5542 5543 // node_modules/@base-ui/react/esm/utils/popups/popupTriggerMap.js 5544 var PopupTriggerMap = class { 5545 constructor() { 5546 this.elementsSet = /* @__PURE__ */ new Set(); 5547 this.idMap = /* @__PURE__ */ new Map(); 5548 } 5549 /** 5550 * Adds a trigger element with the given ID. 5551 * 5552 * Note: The provided element is assumed to not be registered under multiple IDs. 5553 */ 5554 add(id, element) { 5555 const existingElement = this.idMap.get(id); 5556 if (existingElement === element) { 5557 return; 5558 } 5559 if (existingElement !== void 0) { 5560 this.elementsSet.delete(existingElement); 5561 } 5562 this.elementsSet.add(element); 5563 this.idMap.set(id, element); 5564 if (true) { 5565 if (this.elementsSet.size !== this.idMap.size) { 5566 throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); 5567 } 5568 } 5569 } 5570 /** 5571 * Removes the trigger element with the given ID. 5572 */ 5573 delete(id) { 5574 const element = this.idMap.get(id); 5575 if (element) { 5576 this.elementsSet.delete(element); 5577 this.idMap.delete(id); 5578 } 5579 } 5580 /** 5581 * Whether the given element is registered as a trigger. 5582 */ 5583 hasElement(element) { 5584 return this.elementsSet.has(element); 5585 } 5586 /** 5587 * Whether there is a registered trigger element matching the given predicate. 5588 */ 5589 hasMatchingElement(predicate) { 5590 for (const element of this.elementsSet) { 5591 if (predicate(element)) { 5592 return true; 5593 } 5594 } 5595 return false; 5596 } 5597 /** 5598 * Returns the trigger element associated with the given ID, or undefined if no such element exists. 5599 */ 5600 getById(id) { 5601 return this.idMap.get(id); 5602 } 5603 /** 5604 * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element]. 5605 */ 5606 entries() { 5607 return this.idMap.entries(); 5608 } 5609 /** 5610 * Returns an iterable of all registered trigger elements. 5611 */ 5612 elements() { 5613 return this.elementsSet.values(); 5614 } 5615 /** 5616 * Returns the number of registered trigger elements. 5617 */ 5618 get size() { 5619 return this.idMap.size; 5620 } 5621 }; 5622 5623 // node_modules/@base-ui/react/esm/floating-ui-react/utils/getEmptyRootContext.js 5624 function getEmptyRootContext() { 5625 return new FloatingRootStore({ 5626 open: false, 5627 transitionStatus: void 0, 5628 floatingElement: null, 5629 referenceElement: null, 5630 triggerElements: new PopupTriggerMap(), 5631 floatingId: "", 5632 syncOnly: false, 5633 nested: false, 5634 onOpenChange: void 0 5635 }); 5636 } 5637 5638 // node_modules/@base-ui/react/esm/utils/popups/store.js 5639 function createInitialPopupStoreState() { 5640 return { 5641 open: false, 5642 openProp: void 0, 5643 mounted: false, 5644 transitionStatus: void 0, 5645 floatingRootContext: getEmptyRootContext(), 5646 preventUnmountingOnClose: false, 5647 payload: void 0, 5648 activeTriggerId: null, 5649 activeTriggerElement: null, 5650 triggerIdProp: void 0, 5651 popupElement: null, 5652 positionerElement: null, 5653 activeTriggerProps: EMPTY_OBJECT, 5654 inactiveTriggerProps: EMPTY_OBJECT, 5655 popupProps: EMPTY_OBJECT 5656 }; 5657 } 5658 var activeTriggerIdSelector = createSelector((state) => state.triggerIdProp ?? state.activeTriggerId); 5659 var popupStoreSelectors = { 5660 open: createSelector((state) => state.openProp ?? state.open), 5661 mounted: createSelector((state) => state.mounted), 5662 transitionStatus: createSelector((state) => state.transitionStatus), 5663 floatingRootContext: createSelector((state) => state.floatingRootContext), 5664 preventUnmountingOnClose: createSelector((state) => state.preventUnmountingOnClose), 5665 payload: createSelector((state) => state.payload), 5666 activeTriggerId: activeTriggerIdSelector, 5667 activeTriggerElement: createSelector((state) => state.mounted ? state.activeTriggerElement : null), 5668 /** 5669 * Whether the trigger with the given ID was used to open the popup. 5670 */ 5671 isTriggerActive: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId), 5672 /** 5673 * Whether the popup is open and was activated by a trigger with the given ID. 5674 */ 5675 isOpenedByTrigger: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.open), 5676 /** 5677 * Whether the popup is mounted and was activated by a trigger with the given ID. 5678 */ 5679 isMountedByTrigger: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted), 5680 triggerProps: createSelector((state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps), 5681 popupProps: createSelector((state) => state.popupProps), 5682 popupElement: createSelector((state) => state.popupElement), 5683 positionerElement: createSelector((state) => state.positionerElement) 5684 }; 5685 5686 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloatingRootContext.js 5687 function useFloatingRootContext(options) { 5688 const { 5689 open = false, 5690 onOpenChange, 5691 elements = {} 5692 } = options; 5693 const floatingId = useId(); 5694 const nested = useFloatingParentNodeId() != null; 5695 if (true) { 5696 const optionDomReference = elements.reference; 5697 if (optionDomReference && !isElement(optionDomReference)) { 5698 console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead."); 5699 } 5700 } 5701 const store = useRefWithInit(() => new FloatingRootStore({ 5702 open, 5703 transitionStatus: void 0, 5704 onOpenChange, 5705 referenceElement: elements.reference ?? null, 5706 floatingElement: elements.floating ?? null, 5707 triggerElements: new PopupTriggerMap(), 5708 floatingId, 5709 syncOnly: false, 5710 nested 5711 })).current; 5712 useIsoLayoutEffect(() => { 5713 const valuesToSync = { 5714 open, 5715 floatingId 5716 }; 5717 if (elements.reference !== void 0) { 5718 valuesToSync.referenceElement = elements.reference; 5719 valuesToSync.domReferenceElement = isElement(elements.reference) ? elements.reference : null; 5720 } 5721 if (elements.floating !== void 0) { 5722 valuesToSync.floatingElement = elements.floating; 5723 } 5724 store.update(valuesToSync); 5725 }, [open, floatingId, elements.reference, elements.floating, store]); 5726 store.context.onOpenChange = onOpenChange; 5727 store.context.nested = nested; 5728 return store; 5729 } 5730 5731 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloating.js 5732 function useFloating2(options = {}) { 5733 const { 5734 nodeId, 5735 externalTree 5736 } = options; 5737 const internalRootStore = useFloatingRootContext(options); 5738 const rootContext = options.rootContext || internalRootStore; 5739 const rootContextElements = { 5740 reference: rootContext.useState("referenceElement"), 5741 floating: rootContext.useState("floatingElement"), 5742 domReference: rootContext.useState("domReferenceElement") 5743 }; 5744 const [positionReference, setPositionReferenceRaw] = React28.useState(null); 5745 const domReferenceRef = React28.useRef(null); 5746 const tree = useFloatingTree(externalTree); 5747 useIsoLayoutEffect(() => { 5748 if (rootContextElements.domReference) { 5749 domReferenceRef.current = rootContextElements.domReference; 5750 } 5751 }, [rootContextElements.domReference]); 5752 const position = useFloating({ 5753 ...options, 5754 elements: { 5755 ...rootContextElements, 5756 ...positionReference && { 5757 reference: positionReference 5758 } 5759 } 5760 }); 5761 const setPositionReference = React28.useCallback((node) => { 5762 const computedPositionReference = isElement(node) ? { 5763 getBoundingClientRect: () => node.getBoundingClientRect(), 5764 getClientRects: () => node.getClientRects(), 5765 contextElement: node 5766 } : node; 5767 setPositionReferenceRaw(computedPositionReference); 5768 position.refs.setReference(computedPositionReference); 5769 }, [position.refs]); 5770 const [localDomReference, setLocalDomReference] = React28.useState(void 0); 5771 const [localFloatingElement, setLocalFloatingElement] = React28.useState(null); 5772 rootContext.useSyncedValue("referenceElement", localDomReference ?? null); 5773 const localDomReferenceElement = isElement(localDomReference) ? localDomReference : null; 5774 rootContext.useSyncedValue("domReferenceElement", localDomReference === void 0 ? rootContextElements.domReference : localDomReferenceElement); 5775 rootContext.useSyncedValue("floatingElement", localFloatingElement); 5776 const setReference = React28.useCallback((node) => { 5777 if (isElement(node) || node === null) { 5778 domReferenceRef.current = node; 5779 setLocalDomReference(node); 5780 } 5781 if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to 5782 // `null` to support `positionReference` + an unstable `reference` 5783 // callback ref. 5784 node !== null && !isElement(node)) { 5785 position.refs.setReference(node); 5786 } 5787 }, [position.refs, setLocalDomReference]); 5788 const setFloating = React28.useCallback((node) => { 5789 setLocalFloatingElement(node); 5790 position.refs.setFloating(node); 5791 }, [position.refs]); 5792 const refs = React28.useMemo(() => ({ 5793 ...position.refs, 5794 setReference, 5795 setFloating, 5796 setPositionReference, 5797 domReference: domReferenceRef 5798 }), [position.refs, setReference, setFloating, setPositionReference]); 5799 const elements = React28.useMemo(() => ({ 5800 ...position.elements, 5801 domReference: rootContextElements.domReference 5802 }), [position.elements, rootContextElements.domReference]); 5803 const open = rootContext.useState("open"); 5804 const floatingId = rootContext.useState("floatingId"); 5805 const context = React28.useMemo(() => ({ 5806 ...position, 5807 dataRef: rootContext.context.dataRef, 5808 open, 5809 onOpenChange: rootContext.setOpen, 5810 events: rootContext.context.events, 5811 floatingId, 5812 refs, 5813 elements, 5814 nodeId, 5815 rootStore: rootContext 5816 }), [position, refs, elements, nodeId, rootContext, open, floatingId]); 5817 useIsoLayoutEffect(() => { 5818 rootContext.context.dataRef.current.floatingContext = context; 5819 const node = tree?.nodesRef.current.find((n) => n.id === nodeId); 5820 if (node) { 5821 node.context = context; 5822 } 5823 }); 5824 return React28.useMemo(() => ({ 5825 ...position, 5826 context, 5827 refs, 5828 elements, 5829 rootStore: rootContext 5830 }), [position, refs, elements, context, rootContext]); 5831 } 5832 5833 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js 5834 function useSyncedFloatingRootContext(options) { 5835 const { 5836 popupStore, 5837 treatPopupAsFloatingElement = false, 5838 onOpenChange 5839 } = options; 5840 const floatingId = useId(); 5841 const nested = useFloatingParentNodeId() != null; 5842 const open = popupStore.useState("open"); 5843 const referenceElement = popupStore.useState("activeTriggerElement"); 5844 const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); 5845 const triggerElements = popupStore.context.triggerElements; 5846 const store = useRefWithInit(() => new FloatingRootStore({ 5847 open, 5848 transitionStatus: void 0, 5849 referenceElement, 5850 floatingElement, 5851 triggerElements, 5852 onOpenChange, 5853 floatingId, 5854 syncOnly: true, 5855 nested 5856 })).current; 5857 useIsoLayoutEffect(() => { 5858 const valuesToSync = { 5859 open, 5860 floatingId, 5861 referenceElement, 5862 floatingElement 5863 }; 5864 if (isElement(referenceElement)) { 5865 valuesToSync.domReferenceElement = referenceElement; 5866 } 5867 if (store.state.positionReference === store.state.referenceElement) { 5868 valuesToSync.positionReference = referenceElement; 5869 } 5870 store.update(valuesToSync); 5871 }, [open, floatingId, referenceElement, floatingElement, store]); 5872 store.context.onOpenChange = onOpenChange; 5873 store.context.nested = nested; 5874 return store; 5875 } 5876 5877 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFocus.js 5878 var React29 = __toESM(require_react(), 1); 5879 var isMacSafari = isMac && isSafari; 5880 function useFocus(context, props = {}) { 5881 const store = "rootStore" in context ? context.rootStore : context; 5882 const { 5883 events, 5884 dataRef 5885 } = store.context; 5886 const { 5887 enabled = true, 5888 delay 5889 } = props; 5890 const blockFocusRef = React29.useRef(false); 5891 const blockedReferenceRef = React29.useRef(null); 5892 const timeout = useTimeout(); 5893 const keyboardModalityRef = React29.useRef(true); 5894 React29.useEffect(() => { 5895 const domReference = store.select("domReferenceElement"); 5896 if (!enabled) { 5897 return void 0; 5898 } 5899 const win = getWindow(domReference); 5900 function onBlur() { 5901 const currentDomReference = store.select("domReferenceElement"); 5902 if (!store.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) { 5903 blockFocusRef.current = true; 5904 } 5905 } 5906 function onKeyDown() { 5907 keyboardModalityRef.current = true; 5908 } 5909 function onPointerDown() { 5910 keyboardModalityRef.current = false; 5911 } 5912 return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true)); 5913 }, [store, enabled]); 5914 React29.useEffect(() => { 5915 if (!enabled) { 5916 return void 0; 5917 } 5918 function onOpenChangeLocal(details) { 5919 if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) { 5920 const referenceElement = store.select("domReferenceElement"); 5921 if (isElement(referenceElement)) { 5922 blockedReferenceRef.current = referenceElement; 5923 blockFocusRef.current = true; 5924 } 5925 } 5926 } 5927 events.on("openchange", onOpenChangeLocal); 5928 return () => { 5929 events.off("openchange", onOpenChangeLocal); 5930 }; 5931 }, [events, enabled, store]); 5932 const reference = React29.useMemo(() => ({ 5933 onMouseLeave() { 5934 blockFocusRef.current = false; 5935 blockedReferenceRef.current = null; 5936 }, 5937 onFocus(event) { 5938 const focusTarget = event.currentTarget; 5939 if (blockFocusRef.current) { 5940 if (blockedReferenceRef.current === focusTarget) { 5941 return; 5942 } 5943 blockFocusRef.current = false; 5944 blockedReferenceRef.current = null; 5945 } 5946 const target = getTarget(event.nativeEvent); 5947 if (isElement(target)) { 5948 if (isMacSafari && !event.relatedTarget) { 5949 if (!keyboardModalityRef.current && !isTypeableElement(target)) { 5950 return; 5951 } 5952 } else if (!matchesFocusVisible(target)) { 5953 return; 5954 } 5955 } 5956 const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements); 5957 const { 5958 nativeEvent, 5959 currentTarget 5960 } = event; 5961 const delayValue = typeof delay === "function" ? delay() : delay; 5962 if (store.select("open") && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === void 0) { 5963 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 5964 return; 5965 } 5966 timeout.start(delayValue, () => { 5967 if (blockFocusRef.current) { 5968 return; 5969 } 5970 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 5971 }); 5972 }, 5973 onBlur(event) { 5974 blockFocusRef.current = false; 5975 blockedReferenceRef.current = null; 5976 const relatedTarget = event.relatedTarget; 5977 const nativeEvent = event.nativeEvent; 5978 const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside"; 5979 timeout.start(0, () => { 5980 const domReference = store.select("domReferenceElement"); 5981 const activeEl = activeElement(ownerDocument(domReference)); 5982 if (!relatedTarget && activeEl === domReference) { 5983 return; 5984 } 5985 if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) { 5986 return; 5987 } 5988 const nextFocusedElement = relatedTarget ?? activeEl; 5989 if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) { 5990 return; 5991 } 5992 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent)); 5993 }); 5994 } 5995 }), [dataRef, store, timeout, delay]); 5996 return React29.useMemo(() => enabled ? { 5997 reference, 5998 trigger: reference 5999 } : {}, [enabled, reference]); 6000 } 6001 6002 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js 6003 var React30 = __toESM(require_react(), 1); 6004 6005 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js 6006 var HoverInteraction = class _HoverInteraction { 6007 constructor() { 6008 this.pointerType = void 0; 6009 this.interactedInside = false; 6010 this.handler = void 0; 6011 this.blockMouseMove = true; 6012 this.performedPointerEventsMutation = false; 6013 this.pointerEventsScopeElement = null; 6014 this.pointerEventsReferenceElement = null; 6015 this.pointerEventsFloatingElement = null; 6016 this.restTimeoutPending = false; 6017 this.openChangeTimeout = new Timeout(); 6018 this.restTimeout = new Timeout(); 6019 this.handleCloseOptions = void 0; 6020 } 6021 static create() { 6022 return new _HoverInteraction(); 6023 } 6024 dispose = () => { 6025 this.openChangeTimeout.clear(); 6026 this.restTimeout.clear(); 6027 }; 6028 disposeEffect = () => { 6029 return this.dispose; 6030 }; 6031 }; 6032 var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap(); 6033 function clearSafePolygonPointerEventsMutation(instance) { 6034 if (!instance.performedPointerEventsMutation) { 6035 return; 6036 } 6037 const scopeElement = instance.pointerEventsScopeElement; 6038 if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) { 6039 instance.pointerEventsScopeElement?.style.removeProperty("pointer-events"); 6040 instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events"); 6041 instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events"); 6042 pointerEventsMutationOwnerByScopeElement.delete(scopeElement); 6043 } 6044 instance.performedPointerEventsMutation = false; 6045 instance.pointerEventsScopeElement = null; 6046 instance.pointerEventsReferenceElement = null; 6047 instance.pointerEventsFloatingElement = null; 6048 } 6049 function applySafePolygonPointerEventsMutation(instance, options) { 6050 const { 6051 scopeElement, 6052 referenceElement, 6053 floatingElement 6054 } = options; 6055 const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement); 6056 if (existingOwner && existingOwner !== instance) { 6057 clearSafePolygonPointerEventsMutation(existingOwner); 6058 } 6059 clearSafePolygonPointerEventsMutation(instance); 6060 instance.performedPointerEventsMutation = true; 6061 instance.pointerEventsScopeElement = scopeElement; 6062 instance.pointerEventsReferenceElement = referenceElement; 6063 instance.pointerEventsFloatingElement = floatingElement; 6064 pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance); 6065 scopeElement.style.pointerEvents = "none"; 6066 referenceElement.style.pointerEvents = "auto"; 6067 floatingElement.style.pointerEvents = "auto"; 6068 } 6069 function useHoverInteractionSharedState(store) { 6070 const instance = useRefWithInit(HoverInteraction.create).current; 6071 const data = store.context.dataRef.current; 6072 if (!data.hoverInteractionState) { 6073 data.hoverInteractionState = instance; 6074 } 6075 useOnMount(data.hoverInteractionState.disposeEffect); 6076 return data.hoverInteractionState; 6077 } 6078 6079 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js 6080 function useHoverFloatingInteraction(context, parameters = {}) { 6081 const store = "rootStore" in context ? context.rootStore : context; 6082 const open = store.useState("open"); 6083 const floatingElement = store.useState("floatingElement"); 6084 const domReferenceElement = store.useState("domReferenceElement"); 6085 const { 6086 dataRef 6087 } = store.context; 6088 const { 6089 enabled = true, 6090 closeDelay: closeDelayProp = 0, 6091 nodeId: nodeIdProp 6092 } = parameters; 6093 const instance = useHoverInteractionSharedState(store); 6094 const tree = useFloatingTree(); 6095 const parentId = useFloatingParentNodeId(); 6096 const isClickLikeOpenEvent2 = useStableCallback(() => { 6097 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 6098 }); 6099 const isHoverOpen = useStableCallback(() => { 6100 const type = dataRef.current.openEvent?.type; 6101 return type?.includes("mouse") && type !== "mousedown"; 6102 }); 6103 const isRelatedTargetInsideEnabledTrigger = useStableCallback((target) => { 6104 return isTargetInsideEnabledTrigger(target, store.context.triggerElements); 6105 }); 6106 const closeWithDelay = React30.useCallback((event) => { 6107 const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType); 6108 const close = () => { 6109 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6110 tree?.events.emit("floating.closed", event); 6111 }; 6112 if (closeDelay) { 6113 instance.openChangeTimeout.start(closeDelay, close); 6114 } else { 6115 instance.openChangeTimeout.clear(); 6116 close(); 6117 } 6118 }, [closeDelayProp, store, instance, tree]); 6119 const clearPointerEvents = useStableCallback(() => { 6120 clearSafePolygonPointerEventsMutation(instance); 6121 }); 6122 const handleInteractInside = useStableCallback((event) => { 6123 const target = getTarget(event); 6124 if (!isInteractiveElement(target)) { 6125 instance.interactedInside = false; 6126 return; 6127 } 6128 instance.interactedInside = target?.closest("[aria-haspopup]") != null; 6129 }); 6130 useIsoLayoutEffect(() => { 6131 if (!open) { 6132 instance.pointerType = void 0; 6133 instance.restTimeoutPending = false; 6134 instance.interactedInside = false; 6135 clearPointerEvents(); 6136 } 6137 }, [open, instance, clearPointerEvents]); 6138 React30.useEffect(() => { 6139 return clearPointerEvents; 6140 }, [clearPointerEvents]); 6141 useIsoLayoutEffect(() => { 6142 if (!enabled) { 6143 return void 0; 6144 } 6145 if (open && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { 6146 const ref = domReferenceElement; 6147 const floatingEl = floatingElement; 6148 const doc = ownerDocument(floatingElement); 6149 const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating; 6150 if (parentFloating) { 6151 parentFloating.style.pointerEvents = ""; 6152 } 6153 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? instance.pointerEventsScopeElement ?? parentFloating ?? ref.closest("[data-rootownerid]") ?? doc.body; 6154 applySafePolygonPointerEventsMutation(instance, { 6155 scopeElement, 6156 referenceElement: ref, 6157 floatingElement: floatingEl 6158 }); 6159 return () => { 6160 clearPointerEvents(); 6161 }; 6162 } 6163 return void 0; 6164 }, [enabled, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); 6165 const childClosedTimeout = useTimeout(); 6166 React30.useEffect(() => { 6167 if (!enabled) { 6168 return void 0; 6169 } 6170 function onFloatingMouseEnter() { 6171 instance.openChangeTimeout.clear(); 6172 childClosedTimeout.clear(); 6173 tree?.events.off("floating.closed", onNodeClosed); 6174 clearPointerEvents(); 6175 } 6176 function onFloatingMouseLeave(event) { 6177 if (tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0) { 6178 tree.events.on("floating.closed", onNodeClosed); 6179 return; 6180 } 6181 if (isRelatedTargetInsideEnabledTrigger(event.relatedTarget)) { 6182 return; 6183 } 6184 const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp; 6185 const relatedTarget = event.relatedTarget; 6186 const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget)); 6187 if (isMovingIntoDescendantFloating) { 6188 return; 6189 } 6190 if (instance.handler) { 6191 instance.handler(event); 6192 return; 6193 } 6194 clearPointerEvents(); 6195 if (!isClickLikeOpenEvent2()) { 6196 closeWithDelay(event); 6197 } 6198 } 6199 function onNodeClosed(event) { 6200 if (!tree || !parentId || getNodeChildren(tree.nodesRef.current, parentId).length > 0) { 6201 return; 6202 } 6203 childClosedTimeout.start(0, () => { 6204 tree.events.off("floating.closed", onNodeClosed); 6205 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6206 tree.events.emit("floating.closed", event); 6207 }); 6208 } 6209 const floating = floatingElement; 6210 return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => { 6211 tree?.events.off("floating.closed", onNodeClosed); 6212 }); 6213 }, [enabled, floatingElement, store, dataRef, nodeIdProp, isClickLikeOpenEvent2, isRelatedTargetInsideEnabledTrigger, closeWithDelay, clearPointerEvents, handleInteractInside, instance, tree, parentId, childClosedTimeout]); 6214 } 6215 6216 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js 6217 var React31 = __toESM(require_react(), 1); 6218 var ReactDOM4 = __toESM(require_react_dom(), 1); 6219 var EMPTY_REF = { 6220 current: null 6221 }; 6222 function useHoverReferenceInteraction(context, props = {}) { 6223 const store = "rootStore" in context ? context.rootStore : context; 6224 const { 6225 dataRef, 6226 events 6227 } = store.context; 6228 const { 6229 enabled = true, 6230 delay = 0, 6231 handleClose = null, 6232 mouseOnly = false, 6233 restMs = 0, 6234 move = true, 6235 triggerElementRef = EMPTY_REF, 6236 externalTree, 6237 isActiveTrigger = true, 6238 getHandleCloseContext, 6239 isClosing 6240 } = props; 6241 const tree = useFloatingTree(externalTree); 6242 const instance = useHoverInteractionSharedState(store); 6243 const isHoverCloseActiveRef = React31.useRef(false); 6244 const handleCloseRef = useValueAsRef(handleClose); 6245 const delayRef = useValueAsRef(delay); 6246 const restMsRef = useValueAsRef(restMs); 6247 const enabledRef = useValueAsRef(enabled); 6248 const isClosingRef = useValueAsRef(isClosing); 6249 if (isActiveTrigger) { 6250 instance.handleCloseOptions = handleCloseRef.current?.__options; 6251 } 6252 const isClickLikeOpenEvent2 = useStableCallback(() => { 6253 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 6254 }); 6255 const isRelatedTargetInsideEnabledTrigger = useStableCallback((target) => { 6256 return isTargetInsideEnabledTrigger(target, store.context.triggerElements); 6257 }); 6258 const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => { 6259 const allTriggers = store.context.triggerElements; 6260 if (allTriggers.hasElement(currentTarget)) { 6261 return !currentDomReference || !contains(currentDomReference, currentTarget); 6262 } 6263 if (!isElement(target)) { 6264 return false; 6265 } 6266 const targetElement = target; 6267 return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement)); 6268 }); 6269 const closeWithDelay = useStableCallback((event, runElseBranch = true) => { 6270 const closeDelay = getDelay(delayRef.current, "close", instance.pointerType); 6271 if (closeDelay) { 6272 instance.openChangeTimeout.start(closeDelay, () => { 6273 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6274 tree?.events.emit("floating.closed", event); 6275 }); 6276 } else if (runElseBranch) { 6277 instance.openChangeTimeout.clear(); 6278 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6279 tree?.events.emit("floating.closed", event); 6280 } 6281 }); 6282 const cleanupMouseMoveHandler = useStableCallback(() => { 6283 if (!instance.handler) { 6284 return; 6285 } 6286 const doc = ownerDocument(store.select("domReferenceElement")); 6287 doc.removeEventListener("mousemove", instance.handler); 6288 instance.handler = void 0; 6289 }); 6290 const clearPointerEvents = useStableCallback(() => { 6291 clearSafePolygonPointerEventsMutation(instance); 6292 }); 6293 React31.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); 6294 React31.useEffect(() => { 6295 if (!enabled) { 6296 return void 0; 6297 } 6298 function onOpenChangeLocal(details) { 6299 if (!details.open) { 6300 isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover; 6301 cleanupMouseMoveHandler(); 6302 instance.openChangeTimeout.clear(); 6303 instance.restTimeout.clear(); 6304 instance.blockMouseMove = true; 6305 instance.restTimeoutPending = false; 6306 } else { 6307 isHoverCloseActiveRef.current = false; 6308 } 6309 } 6310 events.on("openchange", onOpenChangeLocal); 6311 return () => { 6312 events.off("openchange", onOpenChangeLocal); 6313 }; 6314 }, [enabled, events, instance, cleanupMouseMoveHandler]); 6315 React31.useEffect(() => { 6316 if (!enabled) { 6317 return void 0; 6318 } 6319 const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select("domReferenceElement") : null); 6320 if (!isElement(trigger)) { 6321 return void 0; 6322 } 6323 function onMouseEnter(event) { 6324 instance.openChangeTimeout.clear(); 6325 instance.blockMouseMove = false; 6326 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 6327 return; 6328 } 6329 const restMsValue = getRestMs(restMsRef.current); 6330 const openDelay = getDelay(delayRef.current, "open", instance.pointerType); 6331 const eventTarget = getTarget(event); 6332 const currentTarget = event.currentTarget ?? null; 6333 const currentDomReference = store.select("domReferenceElement"); 6334 let triggerNode = currentTarget; 6335 if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) { 6336 for (const triggerElement of store.context.triggerElements.elements()) { 6337 if (contains(triggerElement, eventTarget)) { 6338 triggerNode = triggerElement; 6339 break; 6340 } 6341 } 6342 } 6343 if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) { 6344 triggerNode = currentDomReference; 6345 } 6346 const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget); 6347 const isOpen = store.select("open"); 6348 const isInClosingTransition = isClosingRef.current?.() ?? store.select("transitionStatus") === "ending"; 6349 const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current; 6350 const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition; 6351 const isRestOnlyDelay = restMsValue > 0 && !openDelay; 6352 const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition; 6353 const shouldOpen = !isOpen || isOverInactive; 6354 if (shouldOpenImmediately) { 6355 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6356 return; 6357 } 6358 if (isRestOnlyDelay) { 6359 return; 6360 } 6361 if (openDelay) { 6362 instance.openChangeTimeout.start(openDelay, () => { 6363 if (shouldOpen) { 6364 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6365 } 6366 }); 6367 } else if (shouldOpen) { 6368 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6369 } 6370 } 6371 function onMouseLeave(event) { 6372 if (isClickLikeOpenEvent2()) { 6373 clearPointerEvents(); 6374 return; 6375 } 6376 cleanupMouseMoveHandler(); 6377 const domReferenceElement = store.select("domReferenceElement"); 6378 const doc = ownerDocument(domReferenceElement); 6379 instance.restTimeout.clear(); 6380 instance.restTimeoutPending = false; 6381 const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.(); 6382 const ignoreRelatedTargetTrigger = isRelatedTargetInsideEnabledTrigger(event.relatedTarget); 6383 if (ignoreRelatedTargetTrigger) { 6384 return; 6385 } 6386 if (handleCloseRef.current && handleCloseContextBase) { 6387 if (!store.select("open")) { 6388 instance.openChangeTimeout.clear(); 6389 } 6390 const currentTrigger = triggerElementRef.current; 6391 instance.handler = handleCloseRef.current({ 6392 ...handleCloseContextBase, 6393 tree, 6394 x: event.clientX, 6395 y: event.clientY, 6396 onClose() { 6397 clearPointerEvents(); 6398 cleanupMouseMoveHandler(); 6399 if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store.select("domReferenceElement")) { 6400 closeWithDelay(event, true); 6401 } 6402 } 6403 }); 6404 doc.addEventListener("mousemove", instance.handler); 6405 instance.handler(event); 6406 return; 6407 } 6408 const shouldClose = instance.pointerType === "touch" ? !contains(store.select("floatingElement"), event.relatedTarget) : true; 6409 if (shouldClose) { 6410 closeWithDelay(event); 6411 } 6412 } 6413 if (move) { 6414 return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, { 6415 once: true 6416 }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave)); 6417 } 6418 return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave)); 6419 }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, closeWithDelay, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, isRelatedTargetInsideEnabledTrigger, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef]); 6420 return React31.useMemo(() => { 6421 if (!enabled) { 6422 return void 0; 6423 } 6424 function setPointerRef(event) { 6425 instance.pointerType = event.pointerType; 6426 } 6427 return { 6428 onPointerDown: setPointerRef, 6429 onPointerEnter: setPointerRef, 6430 onMouseMove(event) { 6431 const { 6432 nativeEvent 6433 } = event; 6434 const trigger = event.currentTarget; 6435 const currentDomReference = store.select("domReferenceElement"); 6436 const currentOpen = store.select("open"); 6437 const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target); 6438 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 6439 return; 6440 } 6441 if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) { 6442 const floatingElement = store.select("floatingElement"); 6443 if (floatingElement) { 6444 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body; 6445 applySafePolygonPointerEventsMutation(instance, { 6446 scopeElement, 6447 referenceElement: trigger, 6448 floatingElement 6449 }); 6450 } 6451 } 6452 const restMsValue = getRestMs(restMsRef.current); 6453 if (currentOpen && !isOverInactive || restMsValue === 0) { 6454 return; 6455 } 6456 if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) { 6457 return; 6458 } 6459 instance.restTimeout.clear(); 6460 function handleMouseMove() { 6461 instance.restTimeoutPending = false; 6462 if (isClickLikeOpenEvent2()) { 6463 return; 6464 } 6465 const latestOpen = store.select("open"); 6466 if (!instance.blockMouseMove && (!latestOpen || isOverInactive)) { 6467 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger)); 6468 } 6469 } 6470 if (instance.pointerType === "touch") { 6471 ReactDOM4.flushSync(() => { 6472 handleMouseMove(); 6473 }); 6474 } else if (isOverInactive && currentOpen) { 6475 handleMouseMove(); 6476 } else { 6477 instance.restTimeoutPending = true; 6478 instance.restTimeout.start(restMsValue, handleMouseMove); 6479 } 6480 } 6481 }; 6482 }, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store, restMsRef]); 6483 } 6484 6485 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useInteractions.js 6486 var React32 = __toESM(require_react(), 1); 6487 function useInteractions(propsList = []) { 6488 const referenceDeps = propsList.map((key) => key?.reference); 6489 const floatingDeps = propsList.map((key) => key?.floating); 6490 const itemDeps = propsList.map((key) => key?.item); 6491 const triggerDeps = propsList.map((key) => key?.trigger); 6492 const getReferenceProps = React32.useCallback( 6493 (userProps) => mergeProps2(userProps, propsList, "reference"), 6494 // eslint-disable-next-line react-hooks/exhaustive-deps 6495 referenceDeps 6496 ); 6497 const getFloatingProps = React32.useCallback( 6498 (userProps) => mergeProps2(userProps, propsList, "floating"), 6499 // eslint-disable-next-line react-hooks/exhaustive-deps 6500 floatingDeps 6501 ); 6502 const getItemProps = React32.useCallback( 6503 (userProps) => mergeProps2(userProps, propsList, "item"), 6504 // eslint-disable-next-line react-hooks/exhaustive-deps 6505 itemDeps 6506 ); 6507 const getTriggerProps = React32.useCallback( 6508 (userProps) => mergeProps2(userProps, propsList, "trigger"), 6509 // eslint-disable-next-line react-hooks/exhaustive-deps 6510 triggerDeps 6511 ); 6512 return React32.useMemo(() => ({ 6513 getReferenceProps, 6514 getFloatingProps, 6515 getItemProps, 6516 getTriggerProps 6517 }), [getReferenceProps, getFloatingProps, getItemProps, getTriggerProps]); 6518 } 6519 function mergeProps2(userProps, propsList, elementKey) { 6520 const eventHandlers = /* @__PURE__ */ new Map(); 6521 const isItem = elementKey === "item"; 6522 const outputProps = {}; 6523 if (elementKey === "floating") { 6524 outputProps.tabIndex = -1; 6525 outputProps[FOCUSABLE_ATTRIBUTE] = ""; 6526 } 6527 for (const key in userProps) { 6528 if (isItem && userProps) { 6529 if (key === ACTIVE_KEY || key === SELECTED_KEY) { 6530 continue; 6531 } 6532 } 6533 outputProps[key] = userProps[key]; 6534 } 6535 for (let i = 0; i < propsList.length; i += 1) { 6536 let props; 6537 const propsOrGetProps = propsList[i]?.[elementKey]; 6538 if (typeof propsOrGetProps === "function") { 6539 props = userProps ? propsOrGetProps(userProps) : null; 6540 } else { 6541 props = propsOrGetProps; 6542 } 6543 if (!props) { 6544 continue; 6545 } 6546 mutablyMergeProps(outputProps, props, isItem, eventHandlers); 6547 } 6548 mutablyMergeProps(outputProps, userProps, isItem, eventHandlers); 6549 return outputProps; 6550 } 6551 function mutablyMergeProps(outputProps, props, isItem, eventHandlers) { 6552 for (const key in props) { 6553 const value = props[key]; 6554 if (isItem && (key === ACTIVE_KEY || key === SELECTED_KEY)) { 6555 continue; 6556 } 6557 if (!key.startsWith("on")) { 6558 outputProps[key] = value; 6559 } else { 6560 if (!eventHandlers.has(key)) { 6561 eventHandlers.set(key, []); 6562 } 6563 if (typeof value === "function") { 6564 eventHandlers.get(key)?.push(value); 6565 outputProps[key] = (...args) => { 6566 return eventHandlers.get(key)?.map((fn) => fn(...args)).find((val) => val !== void 0); 6567 }; 6568 } 6569 } 6570 } 6571 } 6572 6573 // node_modules/@base-ui/react/esm/floating-ui-react/safePolygon.js 6574 var CURSOR_SPEED_THRESHOLD = 0.1; 6575 var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD; 6576 var POLYGON_BUFFER = 0.5; 6577 function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) { 6578 return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi; 6579 } 6580 function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) { 6581 let isInsideValue = false; 6582 if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) { 6583 isInsideValue = !isInsideValue; 6584 } 6585 if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) { 6586 isInsideValue = !isInsideValue; 6587 } 6588 if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) { 6589 isInsideValue = !isInsideValue; 6590 } 6591 if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) { 6592 isInsideValue = !isInsideValue; 6593 } 6594 return isInsideValue; 6595 } 6596 function isInsideRect(pointX, pointY, rect) { 6597 return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height; 6598 } 6599 function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) { 6600 const minX = Math.min(x1, x2); 6601 const maxX = Math.max(x1, x2); 6602 const minY = Math.min(y1, y2); 6603 const maxY = Math.max(y1, y2); 6604 return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY; 6605 } 6606 function safePolygon(options = {}) { 6607 const { 6608 blockPointerEvents = false 6609 } = options; 6610 const timeout = new Timeout(); 6611 const fn = ({ 6612 x, 6613 y, 6614 placement, 6615 elements, 6616 onClose, 6617 nodeId, 6618 tree 6619 }) => { 6620 const side = placement?.split("-")[0]; 6621 let hasLanded = false; 6622 let lastX = null; 6623 let lastY = null; 6624 let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0; 6625 function isCursorMovingSlowly(nextX, nextY) { 6626 const currentTime = performance.now(); 6627 const elapsedTime = currentTime - lastCursorTime; 6628 if (lastX === null || lastY === null || elapsedTime === 0) { 6629 lastX = nextX; 6630 lastY = nextY; 6631 lastCursorTime = currentTime; 6632 return false; 6633 } 6634 const deltaX = nextX - lastX; 6635 const deltaY = nextY - lastY; 6636 const distanceSquared = deltaX * deltaX + deltaY * deltaY; 6637 const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED; 6638 lastX = nextX; 6639 lastY = nextY; 6640 lastCursorTime = currentTime; 6641 return distanceSquared < thresholdSquared; 6642 } 6643 function close() { 6644 timeout.clear(); 6645 onClose(); 6646 } 6647 return function onMouseMove(event) { 6648 timeout.clear(); 6649 const domReference = elements.domReference; 6650 const floating = elements.floating; 6651 if (!domReference || !floating || side == null || x == null || y == null) { 6652 return void 0; 6653 } 6654 const { 6655 clientX, 6656 clientY 6657 } = event; 6658 const target = getTarget(event); 6659 const isLeave = event.type === "mouseleave"; 6660 const isOverFloatingEl = contains(floating, target); 6661 const isOverReferenceEl = contains(domReference, target); 6662 if (isOverFloatingEl) { 6663 hasLanded = true; 6664 if (!isLeave) { 6665 return void 0; 6666 } 6667 } 6668 if (isOverReferenceEl) { 6669 hasLanded = false; 6670 if (!isLeave) { 6671 hasLanded = true; 6672 return void 0; 6673 } 6674 } 6675 if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) { 6676 return void 0; 6677 } 6678 function hasOpenChildNode() { 6679 return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0); 6680 } 6681 function closeIfNoOpenChild() { 6682 if (!hasOpenChildNode()) { 6683 close(); 6684 } 6685 } 6686 if (hasOpenChildNode()) { 6687 return void 0; 6688 } 6689 const refRect = domReference.getBoundingClientRect(); 6690 const rect = floating.getBoundingClientRect(); 6691 const cursorLeaveFromRight = x > rect.right - rect.width / 2; 6692 const cursorLeaveFromBottom = y > rect.bottom - rect.height / 2; 6693 const isFloatingWider = rect.width > refRect.width; 6694 const isFloatingTaller = rect.height > refRect.height; 6695 const left = (isFloatingWider ? refRect : rect).left; 6696 const right = (isFloatingWider ? refRect : rect).right; 6697 const top = (isFloatingTaller ? refRect : rect).top; 6698 const bottom = (isFloatingTaller ? refRect : rect).bottom; 6699 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) { 6700 closeIfNoOpenChild(); 6701 return void 0; 6702 } 6703 let isInsideTroughRect = false; 6704 switch (side) { 6705 case "top": 6706 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1); 6707 break; 6708 case "bottom": 6709 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1); 6710 break; 6711 case "left": 6712 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top); 6713 break; 6714 case "right": 6715 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top); 6716 break; 6717 default: 6718 } 6719 if (isInsideTroughRect) { 6720 return void 0; 6721 } 6722 if (hasLanded && !isInsideRect(clientX, clientY, refRect)) { 6723 closeIfNoOpenChild(); 6724 return void 0; 6725 } 6726 if (!isLeave && isCursorMovingSlowly(clientX, clientY)) { 6727 closeIfNoOpenChild(); 6728 return void 0; 6729 } 6730 let isInsidePolygon = false; 6731 switch (side) { 6732 case "top": { 6733 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6734 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6735 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6736 const cursorPointY = y + POLYGON_BUFFER + 1; 6737 const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top; 6738 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER; 6739 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 6740 break; 6741 } 6742 case "bottom": { 6743 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6744 const cursorPointOneX = isFloatingWider ? x + cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6745 const cursorPointTwoX = isFloatingWider ? x - cursorXOffset : cursorLeaveFromRight ? x + cursorXOffset : x - cursorXOffset; 6746 const cursorPointY = y - POLYGON_BUFFER; 6747 const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom; 6748 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER; 6749 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 6750 break; 6751 } 6752 case "left": { 6753 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6754 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 6755 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 6756 const cursorPointX = x + POLYGON_BUFFER + 1; 6757 const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left; 6758 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER; 6759 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY); 6760 break; 6761 } 6762 case "right": { 6763 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6764 const cursorPointOneY = isFloatingTaller ? y + cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 6765 const cursorPointTwoY = isFloatingTaller ? y - cursorYOffset : cursorLeaveFromBottom ? y + cursorYOffset : y - cursorYOffset; 6766 const cursorPointX = x - POLYGON_BUFFER; 6767 const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right; 6768 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER; 6769 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom); 6770 break; 6771 } 6772 default: 6773 } 6774 if (!isInsidePolygon) { 6775 closeIfNoOpenChild(); 6776 } else if (!hasLanded) { 6777 timeout.start(40, closeIfNoOpenChild); 6778 } 6779 return void 0; 6780 }; 6781 }; 6782 fn.__options = { 6783 ...options, 6784 blockPointerEvents 6785 }; 6786 return fn; 6787 } 6788 6789 // node_modules/@base-ui/react/esm/utils/popupStateMapping.js 6790 var CommonPopupDataAttributes = (function(CommonPopupDataAttributes2) { 6791 CommonPopupDataAttributes2["open"] = "data-open"; 6792 CommonPopupDataAttributes2["closed"] = "data-closed"; 6793 CommonPopupDataAttributes2[CommonPopupDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; 6794 CommonPopupDataAttributes2[CommonPopupDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; 6795 CommonPopupDataAttributes2["anchorHidden"] = "data-anchor-hidden"; 6796 CommonPopupDataAttributes2["side"] = "data-side"; 6797 CommonPopupDataAttributes2["align"] = "data-align"; 6798 return CommonPopupDataAttributes2; 6799 })({}); 6800 var CommonTriggerDataAttributes = /* @__PURE__ */ (function(CommonTriggerDataAttributes2) { 6801 CommonTriggerDataAttributes2["popupOpen"] = "data-popup-open"; 6802 CommonTriggerDataAttributes2["pressed"] = "data-pressed"; 6803 return CommonTriggerDataAttributes2; 6804 })({}); 6805 var TRIGGER_HOOK = { 6806 [CommonTriggerDataAttributes.popupOpen]: "" 6807 }; 6808 var PRESSABLE_TRIGGER_HOOK = { 6809 [CommonTriggerDataAttributes.popupOpen]: "", 6810 [CommonTriggerDataAttributes.pressed]: "" 6811 }; 6812 var POPUP_OPEN_HOOK = { 6813 [CommonPopupDataAttributes.open]: "" 6814 }; 6815 var POPUP_CLOSED_HOOK = { 6816 [CommonPopupDataAttributes.closed]: "" 6817 }; 6818 var ANCHOR_HIDDEN_HOOK = { 6819 [CommonPopupDataAttributes.anchorHidden]: "" 6820 }; 6821 var triggerOpenStateMapping = { 6822 open(value) { 6823 if (value) { 6824 return TRIGGER_HOOK; 6825 } 6826 return null; 6827 } 6828 }; 6829 var popupStateMapping = { 6830 open(value) { 6831 if (value) { 6832 return POPUP_OPEN_HOOK; 6833 } 6834 return POPUP_CLOSED_HOOK; 6835 }, 6836 anchorHidden(value) { 6837 if (value) { 6838 return ANCHOR_HIDDEN_HOOK; 6839 } 6840 return null; 6841 } 6842 }; 6843 6844 // node_modules/@base-ui/utils/esm/inertValue.js 6845 function inertValue(value) { 6846 if (isReactVersionAtLeast(19)) { 6847 return value; 6848 } 6849 return value ? "true" : void 0; 6850 } 6851 6852 // node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js 6853 var React33 = __toESM(require_react(), 1); 6854 6855 // node_modules/@base-ui/react/esm/floating-ui-react/middleware/arrow.js 6856 var baseArrow = (options) => ({ 6857 name: "arrow", 6858 options, 6859 async fn(state) { 6860 const { 6861 x, 6862 y, 6863 placement, 6864 rects, 6865 platform: platform3, 6866 elements, 6867 middlewareData 6868 } = state; 6869 const { 6870 element, 6871 padding = 0, 6872 offsetParent = "real" 6873 } = evaluate(options, state) || {}; 6874 if (element == null) { 6875 return {}; 6876 } 6877 const paddingObject = getPaddingObject(padding); 6878 const coords = { 6879 x, 6880 y 6881 }; 6882 const axis = getAlignmentAxis(placement); 6883 const length = getAxisLength(axis); 6884 const arrowDimensions = await platform3.getDimensions(element); 6885 const isYAxis = axis === "y"; 6886 const minProp = isYAxis ? "top" : "left"; 6887 const maxProp = isYAxis ? "bottom" : "right"; 6888 const clientProp = isYAxis ? "clientHeight" : "clientWidth"; 6889 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 6890 const startDiff = coords[axis] - rects.reference[axis]; 6891 const arrowOffsetParent = offsetParent === "real" ? await platform3.getOffsetParent?.(element) : elements.floating; 6892 let clientSize = elements.floating[clientProp] || rects.floating[length]; 6893 if (!clientSize || !await platform3.isElement?.(arrowOffsetParent)) { 6894 clientSize = elements.floating[clientProp] || rects.floating[length]; 6895 } 6896 const centerToReference = endDiff / 2 - startDiff / 2; 6897 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 6898 const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding); 6899 const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding); 6900 const min2 = minPadding; 6901 const max2 = clientSize - arrowDimensions[length] - maxPadding; 6902 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 6903 const offset4 = clamp(min2, center, max2); 6904 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 6905 const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0; 6906 return { 6907 [axis]: coords[axis] + alignmentOffset, 6908 data: { 6909 [axis]: offset4, 6910 centerOffset: center - offset4 - alignmentOffset, 6911 ...shouldAddOffset && { 6912 alignmentOffset 6913 } 6914 }, 6915 reset: shouldAddOffset 6916 }; 6917 } 6918 }); 6919 var arrow4 = (options, deps) => ({ 6920 ...baseArrow(options), 6921 options: [options, deps] 6922 }); 6923 6924 // node_modules/@base-ui/react/esm/utils/hideMiddleware.js 6925 var hide4 = { 6926 name: "hide", 6927 async fn(state) { 6928 const { 6929 width, 6930 height, 6931 x, 6932 y 6933 } = state.rects.reference; 6934 const anchorHidden = width === 0 && height === 0 && x === 0 && y === 0; 6935 const nativeHideResult = await hide3().fn(state); 6936 return { 6937 data: { 6938 referenceHidden: nativeHideResult.data?.referenceHidden || anchorHidden 6939 } 6940 }; 6941 } 6942 }; 6943 6944 // node_modules/@base-ui/react/esm/utils/adaptiveOriginMiddleware.js 6945 var DEFAULT_SIDES = { 6946 sideX: "left", 6947 sideY: "top" 6948 }; 6949 var adaptiveOrigin = { 6950 name: "adaptiveOrigin", 6951 async fn(state) { 6952 const { 6953 x: rawX, 6954 y: rawY, 6955 rects: { 6956 floating: floatRect 6957 }, 6958 elements: { 6959 floating 6960 }, 6961 platform: platform3, 6962 strategy, 6963 placement 6964 } = state; 6965 const win = getWindow(floating); 6966 const styles = win.getComputedStyle(floating); 6967 const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== ""; 6968 if (!hasTransition) { 6969 return { 6970 x: rawX, 6971 y: rawY, 6972 data: DEFAULT_SIDES 6973 }; 6974 } 6975 const offsetParent = await platform3.getOffsetParent?.(floating); 6976 let offsetDimensions = { 6977 width: 0, 6978 height: 0 6979 }; 6980 if (strategy === "fixed" && win?.visualViewport) { 6981 offsetDimensions = { 6982 width: win.visualViewport.width, 6983 height: win.visualViewport.height 6984 }; 6985 } else if (offsetParent === win) { 6986 const doc = ownerDocument(floating); 6987 offsetDimensions = { 6988 width: doc.documentElement.clientWidth, 6989 height: doc.documentElement.clientHeight 6990 }; 6991 } else if (await platform3.isElement?.(offsetParent)) { 6992 offsetDimensions = await platform3.getDimensions(offsetParent); 6993 } 6994 const currentSide = getSide(placement); 6995 let x = rawX; 6996 let y = rawY; 6997 if (currentSide === "left") { 6998 x = offsetDimensions.width - (rawX + floatRect.width); 6999 } 7000 if (currentSide === "top") { 7001 y = offsetDimensions.height - (rawY + floatRect.height); 7002 } 7003 const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; 7004 const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; 7005 return { 7006 x, 7007 y, 7008 data: { 7009 sideX, 7010 sideY 7011 } 7012 }; 7013 } 7014 }; 7015 7016 // node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js 7017 function getLogicalSide(sideParam, renderedSide, isRtl) { 7018 const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end"; 7019 const logicalRight = isRtl ? "inline-start" : "inline-end"; 7020 const logicalLeft = isRtl ? "inline-end" : "inline-start"; 7021 return { 7022 top: "top", 7023 right: isLogicalSideParam ? logicalRight : "right", 7024 bottom: "bottom", 7025 left: isLogicalSideParam ? logicalLeft : "left" 7026 }[renderedSide]; 7027 } 7028 function getOffsetData(state, sideParam, isRtl) { 7029 const { 7030 rects, 7031 placement 7032 } = state; 7033 const data = { 7034 side: getLogicalSide(sideParam, getSide(placement), isRtl), 7035 align: getAlignment(placement) || "center", 7036 anchor: { 7037 width: rects.reference.width, 7038 height: rects.reference.height 7039 }, 7040 positioner: { 7041 width: rects.floating.width, 7042 height: rects.floating.height 7043 } 7044 }; 7045 return data; 7046 } 7047 function useAnchorPositioning(params) { 7048 const { 7049 // Public parameters 7050 anchor, 7051 positionMethod = "absolute", 7052 side: sideParam = "bottom", 7053 sideOffset = 0, 7054 align = "center", 7055 alignOffset = 0, 7056 collisionBoundary, 7057 collisionPadding: collisionPaddingParam = 5, 7058 sticky = false, 7059 arrowPadding = 5, 7060 disableAnchorTracking = false, 7061 // Private parameters 7062 keepMounted = false, 7063 floatingRootContext, 7064 mounted, 7065 collisionAvoidance, 7066 shiftCrossAxis = false, 7067 nodeId, 7068 adaptiveOrigin: adaptiveOrigin2, 7069 lazyFlip = false, 7070 externalTree 7071 } = params; 7072 const [mountSide, setMountSide] = React33.useState(null); 7073 if (!mounted && mountSide !== null) { 7074 setMountSide(null); 7075 } 7076 const collisionAvoidanceSide = collisionAvoidance.side || "flip"; 7077 const collisionAvoidanceAlign = collisionAvoidance.align || "flip"; 7078 const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end"; 7079 const anchorFn = typeof anchor === "function" ? anchor : void 0; 7080 const anchorFnCallback = useStableCallback(anchorFn); 7081 const anchorDep = anchorFn ? anchorFnCallback : anchor; 7082 const anchorValueRef = useValueAsRef(anchor); 7083 const mountedRef = useValueAsRef(mounted); 7084 const direction = useDirection(); 7085 const isRtl = direction === "rtl"; 7086 const side = mountSide || { 7087 top: "top", 7088 right: "right", 7089 bottom: "bottom", 7090 left: "left", 7091 "inline-end": isRtl ? "left" : "right", 7092 "inline-start": isRtl ? "right" : "left" 7093 }[sideParam]; 7094 const placement = align === "center" ? side : `$side}-$align}`; 7095 let collisionPadding = collisionPaddingParam; 7096 const bias = 1; 7097 const biasTop = sideParam === "bottom" ? bias : 0; 7098 const biasBottom = sideParam === "top" ? bias : 0; 7099 const biasLeft = sideParam === "right" ? bias : 0; 7100 const biasRight = sideParam === "left" ? bias : 0; 7101 if (typeof collisionPadding === "number") { 7102 collisionPadding = { 7103 top: collisionPadding + biasTop, 7104 right: collisionPadding + biasRight, 7105 bottom: collisionPadding + biasBottom, 7106 left: collisionPadding + biasLeft 7107 }; 7108 } else if (collisionPadding) { 7109 collisionPadding = { 7110 top: (collisionPadding.top || 0) + biasTop, 7111 right: (collisionPadding.right || 0) + biasRight, 7112 bottom: (collisionPadding.bottom || 0) + biasBottom, 7113 left: (collisionPadding.left || 0) + biasLeft 7114 }; 7115 } 7116 const commonCollisionProps = { 7117 boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary, 7118 padding: collisionPadding 7119 }; 7120 const arrowRef = React33.useRef(null); 7121 const sideOffsetRef = useValueAsRef(sideOffset); 7122 const alignOffsetRef = useValueAsRef(alignOffset); 7123 const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0; 7124 const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0; 7125 const middleware = [offset3((state) => { 7126 const data = getOffsetData(state, sideParam, isRtl); 7127 const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current; 7128 const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current; 7129 return { 7130 mainAxis: sideAxis, 7131 crossAxis: alignAxis, 7132 alignmentAxis: alignAxis 7133 }; 7134 }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam])]; 7135 const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift"; 7136 const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift"); 7137 const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({ 7138 ...commonCollisionProps, 7139 // Ensure the popup flips if it's been limited by its --available-height and it resizes. 7140 // Since the size() padding is smaller than the flip() padding, flip() will take precedence. 7141 padding: { 7142 top: collisionPadding.top + bias, 7143 right: collisionPadding.right + bias, 7144 bottom: collisionPadding.bottom + bias, 7145 left: collisionPadding.left + bias 7146 }, 7147 mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip", 7148 crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false, 7149 fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide 7150 }); 7151 const shiftMiddleware = shiftDisabled ? null : shift3((data) => { 7152 const html = ownerDocument(data.elements.floating).documentElement; 7153 return { 7154 ...commonCollisionProps, 7155 // Use the Layout Viewport to avoid shifting around when pinch-zooming 7156 // for context menus. 7157 rootBoundary: shiftCrossAxis ? { 7158 x: 0, 7159 y: 0, 7160 width: html.clientWidth, 7161 height: html.clientHeight 7162 } : void 0, 7163 mainAxis: collisionAvoidanceAlign !== "none", 7164 crossAxis: crossAxisShiftEnabled, 7165 limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => { 7166 if (!arrowRef.current) { 7167 return {}; 7168 } 7169 const { 7170 width, 7171 height 7172 } = arrowRef.current.getBoundingClientRect(); 7173 const sideAxis = getSideAxis(getSide(limitData.placement)); 7174 const arrowSize = sideAxis === "y" ? width : height; 7175 const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom; 7176 return { 7177 offset: arrowSize / 2 + offsetAmount / 2 7178 }; 7179 }) 7180 }; 7181 }, [commonCollisionProps, sticky, shiftCrossAxis, collisionPadding, collisionAvoidanceAlign]); 7182 if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || align === "center") { 7183 middleware.push(shiftMiddleware, flipMiddleware); 7184 } else { 7185 middleware.push(flipMiddleware, shiftMiddleware); 7186 } 7187 middleware.push(size3({ 7188 ...commonCollisionProps, 7189 apply({ 7190 elements: { 7191 floating 7192 }, 7193 availableWidth, 7194 availableHeight, 7195 rects 7196 }) { 7197 if (!mountedRef.current) { 7198 return; 7199 } 7200 const floatingStyle = floating.style; 7201 floatingStyle.setProperty("--available-width", `$availableWidth}px`); 7202 floatingStyle.setProperty("--available-height", `$availableHeight}px`); 7203 const dpr = getWindow(floating).devicePixelRatio || 1; 7204 const { 7205 x: x2, 7206 y: y2, 7207 width, 7208 height 7209 } = rects.reference; 7210 const anchorWidth = (Math.round((x2 + width) * dpr) - Math.round(x2 * dpr)) / dpr; 7211 const anchorHeight = (Math.round((y2 + height) * dpr) - Math.round(y2 * dpr)) / dpr; 7212 floatingStyle.setProperty("--anchor-width", `$anchorWidth}px`); 7213 floatingStyle.setProperty("--anchor-height", `$anchorHeight}px`); 7214 } 7215 }), arrow4(() => ({ 7216 // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set, 7217 // we'll create a fake element. 7218 element: arrowRef.current || ownerDocument(arrowRef.current).createElement("div"), 7219 padding: arrowPadding, 7220 offsetParent: "floating" 7221 }), [arrowPadding]), { 7222 name: "transformOrigin", 7223 fn(state) { 7224 const { 7225 elements: elements2, 7226 middlewareData: middlewareData2, 7227 placement: renderedPlacement2, 7228 rects, 7229 y: y2 7230 } = state; 7231 const currentRenderedSide = getSide(renderedPlacement2); 7232 const currentRenderedAxis = getSideAxis(currentRenderedSide); 7233 const arrowEl = arrowRef.current; 7234 const arrowX = middlewareData2.arrow?.x || 0; 7235 const arrowY = middlewareData2.arrow?.y || 0; 7236 const arrowWidth = arrowEl?.clientWidth || 0; 7237 const arrowHeight = arrowEl?.clientHeight || 0; 7238 const transformX = arrowX + arrowWidth / 2; 7239 const transformY = arrowY + arrowHeight / 2; 7240 const shiftY = Math.abs(middlewareData2.shift?.y || 0); 7241 const halfAnchorHeight = rects.reference.height / 2; 7242 const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; 7243 const isOverlappingAnchor = shiftY > sideOffsetValue; 7244 const adjacentTransformOrigin = { 7245 top: `$transformX}px calc(100% + $sideOffsetValue}px)`, 7246 bottom: `$transformX}px ${-sideOffsetValue}px`, 7247 left: `calc(100% + $sideOffsetValue}px) $transformY}px`, 7248 right: `${-sideOffsetValue}px $transformY}px` 7249 }[currentRenderedSide]; 7250 const overlapTransformOrigin = `$transformX}px $rects.reference.y + halfAnchorHeight - y2}px`; 7251 elements2.floating.style.setProperty("--transform-origin", crossAxisShiftEnabled && currentRenderedAxis === "y" && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin); 7252 return {}; 7253 } 7254 }, hide4, adaptiveOrigin2); 7255 useIsoLayoutEffect(() => { 7256 if (!mounted && floatingRootContext) { 7257 floatingRootContext.update({ 7258 referenceElement: null, 7259 floatingElement: null, 7260 domReferenceElement: null, 7261 positionReference: null 7262 }); 7263 } 7264 }, [mounted, floatingRootContext]); 7265 const autoUpdateOptions = React33.useMemo(() => ({ 7266 elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", 7267 layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" 7268 }), [disableAnchorTracking]); 7269 const { 7270 refs, 7271 elements, 7272 x, 7273 y, 7274 middlewareData, 7275 update: update2, 7276 placement: renderedPlacement, 7277 context, 7278 isPositioned, 7279 floatingStyles: originalFloatingStyles 7280 } = useFloating2({ 7281 rootContext: floatingRootContext, 7282 open: keepMounted ? mounted : void 0, 7283 placement, 7284 middleware, 7285 strategy: positionMethod, 7286 whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions), 7287 nodeId, 7288 externalTree 7289 }); 7290 const { 7291 sideX, 7292 sideY 7293 } = middlewareData.adaptiveOrigin || DEFAULT_SIDES; 7294 const resolvedPosition = isPositioned ? positionMethod : "fixed"; 7295 const floatingStyles = React33.useMemo(() => { 7296 const base = adaptiveOrigin2 ? { 7297 position: resolvedPosition, 7298 [sideX]: x, 7299 [sideY]: y 7300 } : { 7301 position: resolvedPosition, 7302 ...originalFloatingStyles 7303 }; 7304 if (!isPositioned) { 7305 base.opacity = 0; 7306 } 7307 return base; 7308 }, [adaptiveOrigin2, resolvedPosition, sideX, x, sideY, y, originalFloatingStyles, isPositioned]); 7309 const registeredPositionReferenceRef = React33.useRef(null); 7310 useIsoLayoutEffect(() => { 7311 if (!mounted) { 7312 return; 7313 } 7314 const anchorValue = anchorValueRef.current; 7315 const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue; 7316 const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null; 7317 const finalAnchor = unwrappedElement || null; 7318 if (finalAnchor !== registeredPositionReferenceRef.current) { 7319 refs.setPositionReference(finalAnchor); 7320 registeredPositionReferenceRef.current = finalAnchor; 7321 } 7322 }, [mounted, refs, anchorDep, anchorValueRef]); 7323 React33.useEffect(() => { 7324 if (!mounted) { 7325 return; 7326 } 7327 const anchorValue = anchorValueRef.current; 7328 if (typeof anchorValue === "function") { 7329 return; 7330 } 7331 if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) { 7332 refs.setPositionReference(anchorValue.current); 7333 registeredPositionReferenceRef.current = anchorValue.current; 7334 } 7335 }, [mounted, refs, anchorDep, anchorValueRef]); 7336 React33.useEffect(() => { 7337 if (keepMounted && mounted && elements.domReference && elements.floating) { 7338 return autoUpdate(elements.domReference, elements.floating, update2, autoUpdateOptions); 7339 } 7340 return void 0; 7341 }, [keepMounted, mounted, elements, update2, autoUpdateOptions]); 7342 const renderedSide = getSide(renderedPlacement); 7343 const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl); 7344 const renderedAlign = getAlignment(renderedPlacement) || "center"; 7345 const anchorHidden = Boolean(middlewareData.hide?.referenceHidden); 7346 useIsoLayoutEffect(() => { 7347 if (lazyFlip && mounted && isPositioned) { 7348 setMountSide(renderedSide); 7349 } 7350 }, [lazyFlip, mounted, isPositioned, renderedSide]); 7351 const arrowStyles = React33.useMemo(() => ({ 7352 position: "absolute", 7353 top: middlewareData.arrow?.y, 7354 left: middlewareData.arrow?.x 7355 }), [middlewareData.arrow]); 7356 const arrowUncentered = middlewareData.arrow?.centerOffset !== 0; 7357 return React33.useMemo(() => ({ 7358 positionerStyles: floatingStyles, 7359 arrowStyles, 7360 arrowRef, 7361 arrowUncentered, 7362 side: logicalRenderedSide, 7363 align: renderedAlign, 7364 physicalSide: renderedSide, 7365 anchorHidden, 7366 refs, 7367 context, 7368 isPositioned, 7369 update: update2 7370 }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update2]); 7371 } 7372 function isRef(param) { 7373 return param != null && "current" in param; 7374 } 7375 7376 // node_modules/@base-ui/react/esm/utils/getDisabledMountTransitionStyles.js 7377 function getDisabledMountTransitionStyles(transitionStatus) { 7378 return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT; 7379 } 7380 7381 // node_modules/@base-ui/react/esm/utils/usePositioner.js 7382 function usePositioner(componentProps, state, { 7383 styles, 7384 transitionStatus, 7385 props, 7386 refs, 7387 hidden, 7388 inert = false 7389 }) { 7390 const style = { 7391 ...styles 7392 }; 7393 if (inert) { 7394 style.pointerEvents = "none"; 7395 } 7396 return useRenderElement("div", componentProps, { 7397 state, 7398 ref: refs, 7399 props: [{ 7400 role: "presentation", 7401 hidden, 7402 style 7403 }, getDisabledMountTransitionStyles(transitionStatus), props], 7404 stateAttributesMapping: popupStateMapping 7405 }); 7406 } 7407 7408 // node_modules/@base-ui/react/esm/button/Button.js 7409 var React34 = __toESM(require_react(), 1); 7410 var Button = /* @__PURE__ */ React34.forwardRef(function Button2(componentProps, forwardedRef) { 7411 const { 7412 render, 7413 className, 7414 disabled: disabled2 = false, 7415 focusableWhenDisabled = false, 7416 nativeButton = true, 7417 style, 7418 ...elementProps 7419 } = componentProps; 7420 const { 7421 getButtonProps, 7422 buttonRef 7423 } = useButton({ 7424 disabled: disabled2, 7425 focusableWhenDisabled, 7426 native: nativeButton 7427 }); 7428 const state = { 7429 disabled: disabled2 7430 }; 7431 return useRenderElement("button", componentProps, { 7432 state, 7433 ref: [forwardedRef, buttonRef], 7434 props: [elementProps, getButtonProps] 7435 }); 7436 }); 7437 if (true) Button.displayName = "Button"; 7438 7439 // node_modules/@base-ui/react/esm/utils/usePopupViewport.js 7440 var React37 = __toESM(require_react(), 1); 7441 var ReactDOM5 = __toESM(require_react_dom(), 1); 7442 7443 // node_modules/@base-ui/utils/esm/usePreviousValue.js 7444 var React35 = __toESM(require_react(), 1); 7445 function usePreviousValue(value) { 7446 const [state, setState] = React35.useState({ 7447 current: value, 7448 previous: null 7449 }); 7450 if (value !== state.current) { 7451 setState({ 7452 current: value, 7453 previous: state.current 7454 }); 7455 } 7456 return state.previous; 7457 } 7458 7459 // node_modules/@base-ui/react/esm/utils/usePopupAutoResize.js 7460 var React36 = __toESM(require_react(), 1); 7461 7462 // node_modules/@base-ui/react/esm/utils/getCssDimensions.js 7463 function getCssDimensions2(element) { 7464 const css = getComputedStyle2(element); 7465 let width = parseFloat(css.width) || 0; 7466 let height = parseFloat(css.height) || 0; 7467 const hasOffset = isHTMLElement(element); 7468 const offsetWidth = hasOffset ? element.offsetWidth : width; 7469 const offsetHeight = hasOffset ? element.offsetHeight : height; 7470 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 7471 if (shouldFallback) { 7472 width = offsetWidth; 7473 height = offsetHeight; 7474 } 7475 return { 7476 width, 7477 height 7478 }; 7479 } 7480 7481 // node_modules/@base-ui/react/esm/utils/usePopupAutoResize.js 7482 var DEFAULT_ENABLED = () => true; 7483 function usePopupAutoResize(parameters) { 7484 const { 7485 popupElement, 7486 positionerElement, 7487 content, 7488 mounted, 7489 enabled = DEFAULT_ENABLED, 7490 onMeasureLayout: onMeasureLayoutParam, 7491 onMeasureLayoutComplete: onMeasureLayoutCompleteParam, 7492 side, 7493 direction 7494 } = parameters; 7495 const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true, false); 7496 const animationFrame = useAnimationFrame(); 7497 const committedDimensionsRef = React36.useRef(null); 7498 const liveDimensionsRef = React36.useRef(null); 7499 const isInitialRenderRef = React36.useRef(true); 7500 const restoreAnchoringStylesRef = React36.useRef(NOOP); 7501 const onMeasureLayout = useStableCallback(onMeasureLayoutParam); 7502 const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam); 7503 const anchoringStyles = React36.useMemo(() => { 7504 let isOriginSide = side === "top"; 7505 let isPhysicalLeft = side === "left"; 7506 if (direction === "rtl") { 7507 isOriginSide = isOriginSide || side === "inline-end"; 7508 isPhysicalLeft = isPhysicalLeft || side === "inline-end"; 7509 } else { 7510 isOriginSide = isOriginSide || side === "inline-start"; 7511 isPhysicalLeft = isPhysicalLeft || side === "inline-start"; 7512 } 7513 return isOriginSide ? { 7514 position: "absolute", 7515 [side === "top" ? "bottom" : "top"]: "0", 7516 [isPhysicalLeft ? "right" : "left"]: "0" 7517 } : EMPTY_OBJECT; 7518 }, [side, direction]); 7519 useIsoLayoutEffect(() => { 7520 if (!mounted || !enabled() || typeof ResizeObserver !== "function") { 7521 restoreAnchoringStylesRef.current = NOOP; 7522 isInitialRenderRef.current = true; 7523 committedDimensionsRef.current = null; 7524 liveDimensionsRef.current = null; 7525 return void 0; 7526 } 7527 if (!popupElement || !positionerElement) { 7528 return void 0; 7529 } 7530 restoreAnchoringStylesRef.current = applyElementStyles(popupElement, anchoringStyles); 7531 const observer = new ResizeObserver((entries) => { 7532 const entry = entries[0]; 7533 if (entry) { 7534 liveDimensionsRef.current = { 7535 width: Math.ceil(entry.borderBoxSize[0].inlineSize), 7536 height: Math.ceil(entry.borderBoxSize[0].blockSize) 7537 }; 7538 } 7539 }); 7540 observer.observe(popupElement); 7541 setPopupCssSize(popupElement, "auto"); 7542 const restorePopupPosition = overrideElementStyle(popupElement, "position", "static"); 7543 const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none"); 7544 const restorePopupScale = overrideElementStyle(popupElement, "scale", "1"); 7545 const restorePositionerAvailableSize = applyElementStyles(positionerElement, { 7546 "--available-width": "max-content", 7547 "--available-height": "max-content" 7548 }); 7549 function restoreMeasurementOverrides() { 7550 restorePopupPosition(); 7551 restorePopupTransform(); 7552 restorePositionerAvailableSize(); 7553 } 7554 function restoreMeasurementOverridesIncludingScale() { 7555 restoreMeasurementOverrides(); 7556 restorePopupScale(); 7557 } 7558 onMeasureLayout?.(); 7559 if (isInitialRenderRef.current || committedDimensionsRef.current === null) { 7560 setPositionerCssSize(positionerElement, "max-content"); 7561 const dimensions = getCssDimensions2(popupElement); 7562 committedDimensionsRef.current = dimensions; 7563 setPositionerCssSize(positionerElement, dimensions); 7564 restoreMeasurementOverridesIncludingScale(); 7565 onMeasureLayoutComplete?.(null, dimensions); 7566 isInitialRenderRef.current = false; 7567 return () => { 7568 observer.disconnect(); 7569 restoreAnchoringStylesRef.current(); 7570 restoreAnchoringStylesRef.current = NOOP; 7571 }; 7572 } 7573 setPopupCssSize(popupElement, "auto"); 7574 setPositionerCssSize(positionerElement, "max-content"); 7575 const previousDimensions = committedDimensionsRef.current ?? liveDimensionsRef.current; 7576 const newDimensions = getCssDimensions2(popupElement); 7577 committedDimensionsRef.current = newDimensions; 7578 if (!previousDimensions) { 7579 setPositionerCssSize(positionerElement, newDimensions); 7580 restoreMeasurementOverridesIncludingScale(); 7581 onMeasureLayoutComplete?.(null, newDimensions); 7582 return () => { 7583 observer.disconnect(); 7584 animationFrame.cancel(); 7585 restoreAnchoringStylesRef.current(); 7586 restoreAnchoringStylesRef.current = NOOP; 7587 }; 7588 } 7589 setPopupCssSize(popupElement, previousDimensions); 7590 restoreMeasurementOverridesIncludingScale(); 7591 onMeasureLayoutComplete?.(previousDimensions, newDimensions); 7592 setPositionerCssSize(positionerElement, newDimensions); 7593 const abortController = new AbortController(); 7594 animationFrame.request(() => { 7595 setPopupCssSize(popupElement, newDimensions); 7596 runOnceAnimationsFinish(() => { 7597 popupElement.style.setProperty("--popup-width", "auto"); 7598 popupElement.style.setProperty("--popup-height", "auto"); 7599 }, abortController.signal); 7600 }); 7601 return () => { 7602 observer.disconnect(); 7603 abortController.abort(); 7604 animationFrame.cancel(); 7605 restoreAnchoringStylesRef.current(); 7606 restoreAnchoringStylesRef.current = NOOP; 7607 }; 7608 }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, enabled, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]); 7609 } 7610 function overrideElementStyle(element, property, value) { 7611 const originalValue = element.style.getPropertyValue(property); 7612 element.style.setProperty(property, value); 7613 return () => { 7614 element.style.setProperty(property, originalValue); 7615 }; 7616 } 7617 function applyElementStyles(element, styles) { 7618 const restorers = []; 7619 for (const [key, value] of Object.entries(styles)) { 7620 restorers.push(overrideElementStyle(element, key, value)); 7621 } 7622 return restorers.length ? () => { 7623 restorers.forEach((restore) => restore()); 7624 } : NOOP; 7625 } 7626 function setPopupCssSize(popupElement, size4) { 7627 const width = size4 === "auto" ? "auto" : `$size4.width}px`; 7628 const height = size4 === "auto" ? "auto" : `$size4.height}px`; 7629 popupElement.style.setProperty("--popup-width", width); 7630 popupElement.style.setProperty("--popup-height", height); 7631 } 7632 function setPositionerCssSize(positionerElement, size4) { 7633 const width = size4 === "max-content" ? "max-content" : `$size4.width}px`; 7634 const height = size4 === "max-content" ? "max-content" : `$size4.height}px`; 7635 positionerElement.style.setProperty("--positioner-width", width); 7636 positionerElement.style.setProperty("--positioner-height", height); 7637 } 7638 7639 // node_modules/@base-ui/react/esm/utils/usePopupViewport.js 7640 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); 7641 function usePopupViewport(parameters) { 7642 const { 7643 store, 7644 side, 7645 cssVars, 7646 children 7647 } = parameters; 7648 const direction = useDirection(); 7649 const activeTrigger = store.useState("activeTriggerElement"); 7650 const activeTriggerId = store.useState("activeTriggerId"); 7651 const open = store.useState("open"); 7652 const payload = store.useState("payload"); 7653 const mounted = store.useState("mounted"); 7654 const popupElement = store.useState("popupElement"); 7655 const positionerElement = store.useState("positionerElement"); 7656 const previousActiveTrigger = usePreviousValue(open ? activeTrigger : null); 7657 const currentContentKey = usePopupContentKey(activeTriggerId, payload); 7658 const capturedNodeRef = React37.useRef(null); 7659 const [previousContentNode, setPreviousContentNode] = React37.useState(null); 7660 const [newTriggerOffset, setNewTriggerOffset] = React37.useState(null); 7661 const currentContainerRef = React37.useRef(null); 7662 const previousContainerRef = React37.useRef(null); 7663 const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true, false); 7664 const cleanupFrame = useAnimationFrame(); 7665 const [previousContentDimensions, setPreviousContentDimensions] = React37.useState(null); 7666 const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React37.useState(false); 7667 useIsoLayoutEffect(() => { 7668 store.set("hasViewport", true); 7669 return () => { 7670 store.set("hasViewport", false); 7671 }; 7672 }, [store]); 7673 const handleMeasureLayout = useStableCallback(() => { 7674 currentContainerRef.current?.style.setProperty("animation", "none"); 7675 currentContainerRef.current?.style.setProperty("transition", "none"); 7676 previousContainerRef.current?.style.setProperty("display", "none"); 7677 }); 7678 const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => { 7679 currentContainerRef.current?.style.removeProperty("animation"); 7680 currentContainerRef.current?.style.removeProperty("transition"); 7681 previousContainerRef.current?.style.removeProperty("display"); 7682 if (previousDimensions) { 7683 setPreviousContentDimensions(previousDimensions); 7684 } 7685 }); 7686 const lastHandledTriggerRef = React37.useRef(null); 7687 useIsoLayoutEffect(() => { 7688 if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { 7689 setPreviousContentNode(capturedNodeRef.current); 7690 setShowStartingStyleAttribute(true); 7691 const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger); 7692 setNewTriggerOffset(offset4); 7693 cleanupFrame.request(() => { 7694 ReactDOM5.flushSync(() => { 7695 setShowStartingStyleAttribute(false); 7696 }); 7697 onAnimationsFinished(() => { 7698 setPreviousContentNode(null); 7699 setPreviousContentDimensions(null); 7700 capturedNodeRef.current = null; 7701 }); 7702 }); 7703 lastHandledTriggerRef.current = activeTrigger; 7704 } 7705 }, [activeTrigger, previousActiveTrigger, previousContentNode, onAnimationsFinished, cleanupFrame]); 7706 useIsoLayoutEffect(() => { 7707 const source = currentContainerRef.current; 7708 if (!source) { 7709 return; 7710 } 7711 const wrapper = ownerDocument(source).createElement("div"); 7712 for (const child of Array.from(source.childNodes)) { 7713 wrapper.appendChild(child.cloneNode(true)); 7714 } 7715 capturedNodeRef.current = wrapper; 7716 }); 7717 const isTransitioning = previousContentNode != null; 7718 let childrenToRender; 7719 if (!isTransitioning) { 7720 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { 7721 "data-current": true, 7722 ref: currentContainerRef, 7723 children 7724 }, currentContentKey); 7725 } else { 7726 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(React37.Fragment, { 7727 children: [/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { 7728 "data-previous": true, 7729 inert: inertValue(true), 7730 ref: previousContainerRef, 7731 style: { 7732 ...previousContentDimensions ? { 7733 [cssVars.popupWidth]: `$previousContentDimensions.width}px`, 7734 [cssVars.popupHeight]: `$previousContentDimensions.height}px` 7735 } : null, 7736 position: "absolute" 7737 }, 7738 "data-ending-style": showStartingStyleAttribute ? void 0 : "" 7739 }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { 7740 "data-current": true, 7741 ref: currentContainerRef, 7742 "data-starting-style": showStartingStyleAttribute ? "" : void 0, 7743 children 7744 }, currentContentKey)] 7745 }); 7746 } 7747 useIsoLayoutEffect(() => { 7748 const container = previousContainerRef.current; 7749 if (!container || !previousContentNode) { 7750 return; 7751 } 7752 container.replaceChildren(...Array.from(previousContentNode.childNodes)); 7753 }, [previousContentNode]); 7754 usePopupAutoResize({ 7755 popupElement, 7756 positionerElement, 7757 mounted, 7758 content: payload, 7759 onMeasureLayout: handleMeasureLayout, 7760 onMeasureLayoutComplete: handleMeasureLayoutComplete, 7761 side, 7762 direction 7763 }); 7764 const state = { 7765 activationDirection: getActivationDirection(newTriggerOffset), 7766 transitioning: isTransitioning 7767 }; 7768 return { 7769 children: childrenToRender, 7770 state 7771 }; 7772 } 7773 function getActivationDirection(offset4) { 7774 if (!offset4) { 7775 return void 0; 7776 } 7777 return `$getValueWithTolerance(offset4.horizontal, 5, "right", "left")} $getValueWithTolerance(offset4.vertical, 5, "down", "up")}`; 7778 } 7779 function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) { 7780 if (value > tolerance) { 7781 return positiveLabel; 7782 } 7783 if (value < -tolerance) { 7784 return negativeLabel; 7785 } 7786 return ""; 7787 } 7788 function calculateRelativePosition(from, to) { 7789 const fromRect = from.getBoundingClientRect(); 7790 const toRect = to.getBoundingClientRect(); 7791 const fromCenter = { 7792 x: fromRect.left + fromRect.width / 2, 7793 y: fromRect.top + fromRect.height / 2 7794 }; 7795 const toCenter = { 7796 x: toRect.left + toRect.width / 2, 7797 y: toRect.top + toRect.height / 2 7798 }; 7799 return { 7800 horizontal: toCenter.x - fromCenter.x, 7801 vertical: toCenter.y - fromCenter.y 7802 }; 7803 } 7804 function usePopupContentKey(activeTriggerId, payload) { 7805 const [contentKey, setContentKey] = React37.useState(0); 7806 const previousActiveTriggerIdRef = React37.useRef(activeTriggerId); 7807 const previousPayloadRef = React37.useRef(payload); 7808 const pendingPayloadUpdateRef = React37.useRef(false); 7809 useIsoLayoutEffect(() => { 7810 const previousActiveTriggerId = previousActiveTriggerIdRef.current; 7811 const previousPayload = previousPayloadRef.current; 7812 const triggerIdChanged = activeTriggerId !== previousActiveTriggerId; 7813 const payloadChanged = payload !== previousPayload; 7814 if (triggerIdChanged) { 7815 setContentKey((value) => value + 1); 7816 pendingPayloadUpdateRef.current = !payloadChanged; 7817 } else if (pendingPayloadUpdateRef.current && payloadChanged) { 7818 setContentKey((value) => value + 1); 7819 pendingPayloadUpdateRef.current = false; 7820 } 7821 previousActiveTriggerIdRef.current = activeTriggerId; 7822 previousPayloadRef.current = payload; 7823 }, [activeTriggerId, payload]); 7824 return `$activeTriggerId ?? "current"}-$contentKey}`; 7825 } 7826 7827 // node_modules/@base-ui/react/esm/utils/FloatingPortalLite.js 7828 var React38 = __toESM(require_react(), 1); 7829 var ReactDOM6 = __toESM(require_react_dom(), 1); 7830 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); 7831 var FloatingPortalLite = /* @__PURE__ */ React38.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { 7832 const { 7833 children, 7834 container, 7835 className, 7836 render, 7837 style, 7838 ...elementProps 7839 } = componentProps; 7840 const { 7841 portalNode, 7842 portalSubtree 7843 } = useFloatingPortalNode({ 7844 container, 7845 ref: forwardedRef, 7846 componentProps, 7847 elementProps 7848 }); 7849 if (!portalSubtree && !portalNode) { 7850 return null; 7851 } 7852 return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(React38.Fragment, { 7853 children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM6.createPortal(children, portalNode)] 7854 }); 7855 }); 7856 if (true) FloatingPortalLite.displayName = "FloatingPortalLite"; 7857 7858 // node_modules/@base-ui/react/esm/tooltip/index.parts.js 7859 var index_parts_exports = {}; 7860 __export(index_parts_exports, { 7861 Arrow: () => TooltipArrow, 7862 Handle: () => TooltipHandle, 7863 Popup: () => TooltipPopup, 7864 Portal: () => TooltipPortal, 7865 Positioner: () => TooltipPositioner, 7866 Provider: () => TooltipProvider, 7867 Root: () => TooltipRoot, 7868 Trigger: () => TooltipTrigger, 7869 Viewport: () => TooltipViewport, 7870 createHandle: () => createTooltipHandle 7871 }); 7872 7873 // node_modules/@base-ui/react/esm/tooltip/root/TooltipRoot.js 7874 var React41 = __toESM(require_react(), 1); 7875 7876 // node_modules/@base-ui/react/esm/tooltip/root/TooltipRootContext.js 7877 var React39 = __toESM(require_react(), 1); 7878 var TooltipRootContext = /* @__PURE__ */ React39.createContext(void 0); 7879 if (true) TooltipRootContext.displayName = "TooltipRootContext"; 7880 function useTooltipRootContext(optional) { 7881 const context = React39.useContext(TooltipRootContext); 7882 if (context === void 0 && !optional) { 7883 throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72)); 7884 } 7885 return context; 7886 } 7887 7888 // node_modules/@base-ui/react/esm/tooltip/store/TooltipStore.js 7889 var React40 = __toESM(require_react(), 1); 7890 var ReactDOM7 = __toESM(require_react_dom(), 1); 7891 var selectors2 = { 7892 ...popupStoreSelectors, 7893 disabled: createSelector((state) => state.disabled), 7894 instantType: createSelector((state) => state.instantType), 7895 isInstantPhase: createSelector((state) => state.isInstantPhase), 7896 trackCursorAxis: createSelector((state) => state.trackCursorAxis), 7897 disableHoverablePopup: createSelector((state) => state.disableHoverablePopup), 7898 lastOpenChangeReason: createSelector((state) => state.openChangeReason), 7899 closeOnClick: createSelector((state) => state.closeOnClick), 7900 closeDelay: createSelector((state) => state.closeDelay), 7901 hasViewport: createSelector((state) => state.hasViewport) 7902 }; 7903 var TooltipStore = class _TooltipStore extends ReactStore { 7904 constructor(initialState) { 7905 super({ 7906 ...createInitialState(), 7907 ...initialState 7908 }, { 7909 popupRef: /* @__PURE__ */ React40.createRef(), 7910 onOpenChange: void 0, 7911 onOpenChangeComplete: void 0, 7912 triggerElements: new PopupTriggerMap() 7913 }, selectors2); 7914 } 7915 setOpen = (nextOpen, eventDetails) => { 7916 const reason = eventDetails.reason; 7917 const isHover = reason === reason_parts_exports.triggerHover; 7918 const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus; 7919 const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey); 7920 eventDetails.preventUnmountOnClose = () => { 7921 this.set("preventUnmountingOnClose", true); 7922 }; 7923 this.context.onOpenChange?.(nextOpen, eventDetails); 7924 if (eventDetails.isCanceled) { 7925 return; 7926 } 7927 this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); 7928 const changeState = () => { 7929 const updatedState = { 7930 open: nextOpen, 7931 openChangeReason: reason 7932 }; 7933 if (isFocusOpen) { 7934 updatedState.instantType = "focus"; 7935 } else if (isDismissClose) { 7936 updatedState.instantType = "dismiss"; 7937 } else if (reason === reason_parts_exports.triggerHover) { 7938 updatedState.instantType = void 0; 7939 } 7940 const newTriggerId = eventDetails.trigger?.id ?? null; 7941 if (newTriggerId || nextOpen) { 7942 updatedState.activeTriggerId = newTriggerId; 7943 updatedState.activeTriggerElement = eventDetails.trigger ?? null; 7944 } 7945 this.update(updatedState); 7946 }; 7947 if (isHover) { 7948 ReactDOM7.flushSync(changeState); 7949 } else { 7950 changeState(); 7951 } 7952 }; 7953 static useStore(externalStore, initialState) { 7954 const internalStore = useRefWithInit(() => { 7955 return new _TooltipStore(initialState); 7956 }).current; 7957 const store = externalStore ?? internalStore; 7958 const floatingRootContext = useSyncedFloatingRootContext({ 7959 popupStore: store, 7960 onOpenChange: store.setOpen 7961 }); 7962 store.state.floatingRootContext = floatingRootContext; 7963 return store; 7964 } 7965 }; 7966 function createInitialState() { 7967 return { 7968 ...createInitialPopupStoreState(), 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 hasViewport: false 7978 }; 7979 } 7980 7981 // node_modules/@base-ui/react/esm/tooltip/root/TooltipRoot.js 7982 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); 7983 var TooltipRoot = fastComponent(function TooltipRoot2(props) { 7984 const { 7985 disabled: disabled2 = false, 7986 defaultOpen = false, 7987 open: openProp, 7988 disableHoverablePopup = false, 7989 trackCursorAxis = "none", 7990 actionsRef, 7991 onOpenChange, 7992 onOpenChangeComplete, 7993 handle, 7994 triggerId: triggerIdProp, 7995 defaultTriggerId: defaultTriggerIdProp = null, 7996 children 7997 } = props; 7998 const store = TooltipStore.useStore(handle?.store, { 7999 open: defaultOpen, 8000 openProp, 8001 activeTriggerId: defaultTriggerIdProp, 8002 triggerIdProp 8003 }); 8004 useOnFirstRender(() => { 8005 if (openProp === void 0 && store.state.open === false && defaultOpen === true) { 8006 store.update({ 8007 open: true, 8008 activeTriggerId: defaultTriggerIdProp 8009 }); 8010 } 8011 }); 8012 store.useControlledProp("openProp", openProp); 8013 store.useControlledProp("triggerIdProp", triggerIdProp); 8014 store.useContextCallback("onOpenChange", onOpenChange); 8015 store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); 8016 const openState = store.useState("open"); 8017 const open = !disabled2 && openState; 8018 const activeTriggerId = store.useState("activeTriggerId"); 8019 const payload = store.useState("payload"); 8020 store.useSyncedValues({ 8021 trackCursorAxis, 8022 disableHoverablePopup 8023 }); 8024 useIsoLayoutEffect(() => { 8025 if (openState && disabled2) { 8026 store.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled)); 8027 } 8028 }, [openState, disabled2, store]); 8029 store.useSyncedValue("disabled", disabled2); 8030 useImplicitActiveTrigger(store); 8031 const { 8032 forceUnmount, 8033 transitionStatus 8034 } = useOpenStateTransitions(open, store); 8035 const floatingRootContext = store.select("floatingRootContext"); 8036 const isInstantPhase = store.useState("isInstantPhase"); 8037 const instantType = store.useState("instantType"); 8038 const lastOpenChangeReason = store.useState("lastOpenChangeReason"); 8039 const previousInstantTypeRef = React41.useRef(null); 8040 useIsoLayoutEffect(() => { 8041 if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) { 8042 if (instantType !== "delay") { 8043 previousInstantTypeRef.current = instantType; 8044 } 8045 store.set("instantType", "delay"); 8046 } else if (previousInstantTypeRef.current !== null) { 8047 store.set("instantType", previousInstantTypeRef.current); 8048 previousInstantTypeRef.current = null; 8049 } 8050 }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]); 8051 useIsoLayoutEffect(() => { 8052 if (open) { 8053 if (activeTriggerId == null) { 8054 store.set("payload", void 0); 8055 } 8056 } 8057 }, [store, activeTriggerId, open]); 8058 const handleImperativeClose = React41.useCallback(() => { 8059 store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); 8060 }, [store]); 8061 React41.useImperativeHandle(actionsRef, () => ({ 8062 unmount: forceUnmount, 8063 close: handleImperativeClose 8064 }), [forceUnmount, handleImperativeClose]); 8065 const dismiss = useDismiss(floatingRootContext, { 8066 enabled: !disabled2, 8067 referencePress: () => store.select("closeOnClick") 8068 }); 8069 const clientPoint = useClientPoint(floatingRootContext, { 8070 enabled: !disabled2 && trackCursorAxis !== "none", 8071 axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis 8072 }); 8073 const { 8074 getReferenceProps, 8075 getFloatingProps, 8076 getTriggerProps 8077 } = useInteractions([dismiss, clientPoint]); 8078 const activeTriggerProps = React41.useMemo(() => getReferenceProps(), [getReferenceProps]); 8079 const inactiveTriggerProps = React41.useMemo(() => getTriggerProps(), [getTriggerProps]); 8080 const popupProps = React41.useMemo(() => getFloatingProps(), [getFloatingProps]); 8081 store.useSyncedValues({ 8082 activeTriggerProps, 8083 inactiveTriggerProps, 8084 popupProps 8085 }); 8086 return /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipRootContext.Provider, { 8087 value: store, 8088 children: typeof children === "function" ? children({ 8089 payload 8090 }) : children 8091 }); 8092 }); 8093 if (true) TooltipRoot.displayName = "TooltipRoot"; 8094 8095 // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTrigger.js 8096 var React43 = __toESM(require_react(), 1); 8097 8098 // node_modules/@base-ui/react/esm/tooltip/provider/TooltipProviderContext.js 8099 var React42 = __toESM(require_react(), 1); 8100 var TooltipProviderContext = /* @__PURE__ */ React42.createContext(void 0); 8101 if (true) TooltipProviderContext.displayName = "TooltipProviderContext"; 8102 function useTooltipProviderContext() { 8103 return React42.useContext(TooltipProviderContext); 8104 } 8105 8106 // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTriggerDataAttributes.js 8107 var TooltipTriggerDataAttributes = (function(TooltipTriggerDataAttributes2) { 8108 TooltipTriggerDataAttributes2[TooltipTriggerDataAttributes2["popupOpen"] = CommonTriggerDataAttributes.popupOpen] = "popupOpen"; 8109 TooltipTriggerDataAttributes2["triggerDisabled"] = "data-trigger-disabled"; 8110 return TooltipTriggerDataAttributes2; 8111 })({}); 8112 8113 // node_modules/@base-ui/react/esm/tooltip/utils/constants.js 8114 var OPEN_DELAY = 600; 8115 8116 // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTrigger.js 8117 var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) { 8118 const { 8119 className, 8120 render, 8121 handle, 8122 payload, 8123 disabled: disabledProp, 8124 delay, 8125 closeOnClick = true, 8126 closeDelay, 8127 id: idProp, 8128 style, 8129 ...elementProps 8130 } = componentProps; 8131 const rootContext = useTooltipRootContext(true); 8132 const store = handle?.store ?? rootContext; 8133 if (!store) { 8134 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)); 8135 } 8136 const thisTriggerId = useBaseUiId(idProp); 8137 const isTriggerActive = store.useState("isTriggerActive", thisTriggerId); 8138 const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId); 8139 const floatingRootContext = store.useState("floatingRootContext"); 8140 const triggerElementRef = React43.useRef(null); 8141 const delayWithDefault = delay ?? OPEN_DELAY; 8142 const closeDelayWithDefault = closeDelay ?? 0; 8143 const { 8144 registerTrigger, 8145 isMountedByThisTrigger 8146 } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, { 8147 payload, 8148 closeOnClick, 8149 closeDelay: closeDelayWithDefault 8150 }); 8151 const providerContext = useTooltipProviderContext(); 8152 const { 8153 delayRef, 8154 isInstantPhase, 8155 hasProvider 8156 } = useDelayGroup(floatingRootContext, { 8157 open: isOpenedByThisTrigger 8158 }); 8159 store.useSyncedValue("isInstantPhase", isInstantPhase); 8160 const rootDisabled = store.useState("disabled"); 8161 const disabled2 = disabledProp ?? rootDisabled; 8162 const trackCursorAxis = store.useState("trackCursorAxis"); 8163 const disableHoverablePopup = store.useState("disableHoverablePopup"); 8164 const hoverProps = useHoverReferenceInteraction(floatingRootContext, { 8165 enabled: !disabled2, 8166 mouseOnly: true, 8167 move: false, 8168 handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null, 8169 restMs() { 8170 const providerDelay = providerContext?.delay; 8171 const groupOpenValue = typeof delayRef.current === "object" ? delayRef.current.open : void 0; 8172 let computedRestMs = delayWithDefault; 8173 if (hasProvider) { 8174 if (groupOpenValue !== 0) { 8175 computedRestMs = delay ?? providerDelay ?? delayWithDefault; 8176 } else { 8177 computedRestMs = 0; 8178 } 8179 } 8180 return computedRestMs; 8181 }, 8182 delay() { 8183 const closeValue = typeof delayRef.current === "object" ? delayRef.current.close : void 0; 8184 let computedCloseDelay = closeDelayWithDefault; 8185 if (closeDelay == null && hasProvider) { 8186 computedCloseDelay = closeValue; 8187 } 8188 return { 8189 close: computedCloseDelay 8190 }; 8191 }, 8192 triggerElementRef, 8193 isActiveTrigger: isTriggerActive, 8194 isClosing: () => store.select("transitionStatus") === "ending" 8195 }); 8196 const focusProps = useFocus(floatingRootContext, { 8197 enabled: !disabled2 8198 }).reference; 8199 const state = { 8200 open: isOpenedByThisTrigger 8201 }; 8202 const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger); 8203 const element = useRenderElement("button", componentProps, { 8204 state, 8205 ref: [forwardedRef, registerTrigger, triggerElementRef], 8206 props: [hoverProps, focusProps, rootTriggerProps, { 8207 onPointerDown() { 8208 store.set("closeOnClick", closeOnClick); 8209 }, 8210 id: thisTriggerId, 8211 [TooltipTriggerDataAttributes.triggerDisabled]: disabled2 ? "" : void 0 8212 }, elementProps], 8213 stateAttributesMapping: triggerOpenStateMapping 8214 }); 8215 return element; 8216 }); 8217 if (true) TooltipTrigger.displayName = "TooltipTrigger"; 8218 8219 // node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortal.js 8220 var React45 = __toESM(require_react(), 1); 8221 8222 // node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortalContext.js 8223 var React44 = __toESM(require_react(), 1); 8224 var TooltipPortalContext = /* @__PURE__ */ React44.createContext(void 0); 8225 if (true) TooltipPortalContext.displayName = "TooltipPortalContext"; 8226 function useTooltipPortalContext() { 8227 const value = React44.useContext(TooltipPortalContext); 8228 if (value === void 0) { 8229 throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70)); 8230 } 8231 return value; 8232 } 8233 8234 // node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortal.js 8235 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); 8236 var TooltipPortal = /* @__PURE__ */ React45.forwardRef(function TooltipPortal2(props, forwardedRef) { 8237 const { 8238 keepMounted = false, 8239 ...portalProps 8240 } = props; 8241 const store = useTooltipRootContext(); 8242 const mounted = store.useState("mounted"); 8243 const shouldRender = mounted || keepMounted; 8244 if (!shouldRender) { 8245 return null; 8246 } 8247 return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPortalContext.Provider, { 8248 value: keepMounted, 8249 children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FloatingPortalLite, { 8250 ref: forwardedRef, 8251 ...portalProps 8252 }) 8253 }); 8254 }); 8255 if (true) TooltipPortal.displayName = "TooltipPortal"; 8256 8257 // node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositioner.js 8258 var React47 = __toESM(require_react(), 1); 8259 8260 // node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositionerContext.js 8261 var React46 = __toESM(require_react(), 1); 8262 var TooltipPositionerContext = /* @__PURE__ */ React46.createContext(void 0); 8263 if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext"; 8264 function useTooltipPositionerContext() { 8265 const context = React46.useContext(TooltipPositionerContext); 8266 if (context === void 0) { 8267 throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71)); 8268 } 8269 return context; 8270 } 8271 8272 // node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositioner.js 8273 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); 8274 var TooltipPositioner = /* @__PURE__ */ React47.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { 8275 const { 8276 render, 8277 className, 8278 anchor, 8279 positionMethod = "absolute", 8280 side = "top", 8281 align = "center", 8282 sideOffset = 0, 8283 alignOffset = 0, 8284 collisionBoundary = "clipping-ancestors", 8285 collisionPadding = 5, 8286 arrowPadding = 5, 8287 sticky = false, 8288 disableAnchorTracking = false, 8289 collisionAvoidance = POPUP_COLLISION_AVOIDANCE, 8290 style, 8291 ...elementProps 8292 } = componentProps; 8293 const store = useTooltipRootContext(); 8294 const keepMounted = useTooltipPortalContext(); 8295 const open = store.useState("open"); 8296 const mounted = store.useState("mounted"); 8297 const trackCursorAxis = store.useState("trackCursorAxis"); 8298 const disableHoverablePopup = store.useState("disableHoverablePopup"); 8299 const floatingRootContext = store.useState("floatingRootContext"); 8300 const instantType = store.useState("instantType"); 8301 const transitionStatus = store.useState("transitionStatus"); 8302 const hasViewport = store.useState("hasViewport"); 8303 const positioning = useAnchorPositioning({ 8304 anchor, 8305 positionMethod, 8306 floatingRootContext, 8307 mounted, 8308 side, 8309 sideOffset, 8310 align, 8311 alignOffset, 8312 collisionBoundary, 8313 collisionPadding, 8314 sticky, 8315 arrowPadding, 8316 disableAnchorTracking, 8317 keepMounted, 8318 collisionAvoidance, 8319 adaptiveOrigin: hasViewport ? adaptiveOrigin : void 0 8320 }); 8321 const state = React47.useMemo(() => ({ 8322 open, 8323 side: positioning.side, 8324 align: positioning.align, 8325 anchorHidden: positioning.anchorHidden, 8326 instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType 8327 }), [open, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); 8328 const element = usePositioner(componentProps, state, { 8329 styles: positioning.positionerStyles, 8330 transitionStatus, 8331 props: elementProps, 8332 refs: [forwardedRef, store.useStateSetter("positionerElement")], 8333 hidden: !mounted, 8334 inert: !open || trackCursorAxis === "both" || disableHoverablePopup 8335 }); 8336 return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipPositionerContext.Provider, { 8337 value: positioning, 8338 children: element 8339 }); 8340 }); 8341 if (true) TooltipPositioner.displayName = "TooltipPositioner"; 8342 8343 // node_modules/@base-ui/react/esm/tooltip/popup/TooltipPopup.js 8344 var React48 = __toESM(require_react(), 1); 8345 var stateAttributesMapping = { 8346 ...popupStateMapping, 8347 ...transitionStatusMapping 8348 }; 8349 var TooltipPopup = /* @__PURE__ */ React48.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { 8350 const { 8351 className, 8352 render, 8353 style, 8354 ...elementProps 8355 } = componentProps; 8356 const store = useTooltipRootContext(); 8357 const { 8358 side, 8359 align 8360 } = useTooltipPositionerContext(); 8361 const open = store.useState("open"); 8362 const instantType = store.useState("instantType"); 8363 const transitionStatus = store.useState("transitionStatus"); 8364 const popupProps = store.useState("popupProps"); 8365 const floatingContext = store.useState("floatingRootContext"); 8366 useOpenChangeComplete({ 8367 open, 8368 ref: store.context.popupRef, 8369 onComplete() { 8370 if (open) { 8371 store.context.onOpenChangeComplete?.(true); 8372 } 8373 } 8374 }); 8375 const disabled2 = store.useState("disabled"); 8376 const closeDelay = store.useState("closeDelay"); 8377 useHoverFloatingInteraction(floatingContext, { 8378 enabled: !disabled2, 8379 closeDelay 8380 }); 8381 const state = { 8382 open, 8383 side, 8384 align, 8385 instant: instantType, 8386 transitionStatus 8387 }; 8388 const element = useRenderElement("div", componentProps, { 8389 state, 8390 ref: [forwardedRef, store.context.popupRef, store.useStateSetter("popupElement")], 8391 props: [popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], 8392 stateAttributesMapping 8393 }); 8394 return element; 8395 }); 8396 if (true) TooltipPopup.displayName = "TooltipPopup"; 8397 8398 // node_modules/@base-ui/react/esm/tooltip/arrow/TooltipArrow.js 8399 var React49 = __toESM(require_react(), 1); 8400 var TooltipArrow = /* @__PURE__ */ React49.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { 8401 const { 8402 className, 8403 render, 8404 style, 8405 ...elementProps 8406 } = componentProps; 8407 const store = useTooltipRootContext(); 8408 const open = store.useState("open"); 8409 const instantType = store.useState("instantType"); 8410 const { 8411 arrowRef, 8412 side, 8413 align, 8414 arrowUncentered, 8415 arrowStyles 8416 } = useTooltipPositionerContext(); 8417 const state = { 8418 open, 8419 side, 8420 align, 8421 uncentered: arrowUncentered, 8422 instant: instantType 8423 }; 8424 const element = useRenderElement("div", componentProps, { 8425 state, 8426 ref: [forwardedRef, arrowRef], 8427 props: [{ 8428 style: arrowStyles, 8429 "aria-hidden": true 8430 }, elementProps], 8431 stateAttributesMapping: popupStateMapping 8432 }); 8433 return element; 8434 }); 8435 if (true) TooltipArrow.displayName = "TooltipArrow"; 8436 8437 // node_modules/@base-ui/react/esm/tooltip/provider/TooltipProvider.js 8438 var React50 = __toESM(require_react(), 1); 8439 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); 8440 var TooltipProvider = function TooltipProvider2(props) { 8441 const { 8442 delay, 8443 closeDelay, 8444 timeout = 400 8445 } = props; 8446 const contextValue = React50.useMemo(() => ({ 8447 delay, 8448 closeDelay 8449 }), [delay, closeDelay]); 8450 const delayValue = React50.useMemo(() => ({ 8451 open: delay, 8452 close: closeDelay 8453 }), [delay, closeDelay]); 8454 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipProviderContext.Provider, { 8455 value: contextValue, 8456 children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FloatingDelayGroup, { 8457 delay: delayValue, 8458 timeoutMs: timeout, 8459 children: props.children 8460 }) 8461 }); 8462 }; 8463 if (true) TooltipProvider.displayName = "TooltipProvider"; 8464 8465 // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewport.js 8466 var React51 = __toESM(require_react(), 1); 8467 8468 // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewportCssVars.js 8469 var TooltipViewportCssVars = /* @__PURE__ */ (function(TooltipViewportCssVars2) { 8470 TooltipViewportCssVars2["popupWidth"] = "--popup-width"; 8471 TooltipViewportCssVars2["popupHeight"] = "--popup-height"; 8472 return TooltipViewportCssVars2; 8473 })({}); 8474 8475 // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewport.js 8476 var stateAttributesMapping2 = { 8477 activationDirection: (value) => value ? { 8478 "data-activation-direction": value 8479 } : null 8480 }; 8481 var TooltipViewport = /* @__PURE__ */ React51.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { 8482 const { 8483 render, 8484 className, 8485 style, 8486 children, 8487 ...elementProps 8488 } = componentProps; 8489 const store = useTooltipRootContext(); 8490 const positioner = useTooltipPositionerContext(); 8491 const instantType = store.useState("instantType"); 8492 const { 8493 children: childrenToRender, 8494 state: viewportState 8495 } = usePopupViewport({ 8496 store, 8497 side: positioner.side, 8498 cssVars: TooltipViewportCssVars, 8499 children 8500 }); 8501 const state = { 8502 activationDirection: viewportState.activationDirection, 8503 transitioning: viewportState.transitioning, 8504 instant: instantType 8505 }; 8506 return useRenderElement("div", componentProps, { 8507 state, 8508 ref: forwardedRef, 8509 props: [elementProps, { 8510 children: childrenToRender 8511 }], 8512 stateAttributesMapping: stateAttributesMapping2 8513 }); 8514 }); 8515 if (true) TooltipViewport.displayName = "TooltipViewport"; 8516 8517 // node_modules/@base-ui/react/esm/tooltip/store/TooltipHandle.js 8518 var TooltipHandle = class { 8519 /** 8520 * Internal store holding the tooltip state. 8521 * @internal 8522 */ 8523 constructor() { 8524 this.store = new TooltipStore(); 8525 } 8526 /** 8527 * Opens the tooltip and associates it with the trigger with the given ID. 8528 * The trigger must be a Tooltip.Trigger component with this handle passed as a prop. 8529 * 8530 * This method should only be called in an event handler or an effect (not during rendering). 8531 * 8532 * @param triggerId ID of the trigger to associate with the tooltip. 8533 */ 8534 open(triggerId) { 8535 const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : void 0; 8536 if (triggerId && !triggerElement) { 8537 throw new Error(true ? `Base UI: TooltipHandle.open: No trigger found with id "$triggerId}".` : formatErrorMessage_default(81, triggerId)); 8538 } 8539 this.store.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); 8540 } 8541 /** 8542 * Closes the tooltip. 8543 */ 8544 close() { 8545 this.store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, void 0)); 8546 } 8547 /** 8548 * Indicates whether the tooltip is currently open. 8549 */ 8550 get isOpen() { 8551 return this.store.state.open; 8552 } 8553 }; 8554 function createTooltipHandle() { 8555 return new TooltipHandle(); 8556 } 8557 8558 // node_modules/@base-ui/react/esm/use-render/useRender.js 8559 function useRender(params) { 8560 return useRenderElement(params.defaultTagName ?? "div", params, params); 8561 } 8562 8563 // packages/ui/build-module/text/text.mjs 8564 var import_element9 = __toESM(require_element(), 1); 8565 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='4130d64bea']")) { 8566 const style = document.createElement("style"); 8567 style.setAttribute("data-wp-hash", "4130d64bea"); 8568 style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);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-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);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);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-medium,499);line-height:var(--wpds-typography-line-height-sm,20px)}.fc4da56d8dfe52c4__heading-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);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-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_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-regular,400)}.ca1aa3fc2029e958__body-lg{--_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-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-regular,400)}._0e8d87a42c1f75fa__body-sm{--_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)}}')); 8569 document.head.appendChild(style); 8570 } 8571 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" }; 8572 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='1fb29d3a3c']")) { 8573 const style = document.createElement("style"); 8574 style.setAttribute("data-wp-hash", "1fb29d3a3c"); 8575 style.appendChild(document.createTextNode("._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,#0000);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 #0000);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,#0000);border-color:var(--_gcd-input-border-color-disabled,#0000);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid #0000)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid #0000);transition:var(--_gcd-a-transition,none)}")); 8576 document.head.appendChild(style); 8577 } 8578 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" }; 8579 var Text = (0, import_element9.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) { 8580 const element = useRender({ 8581 render, 8582 defaultTagName: "span", 8583 ref, 8584 props: mergeProps(props, { 8585 className: clsx_default( 8586 style_default.text, 8587 global_css_defense_default.heading, 8588 global_css_defense_default.p, 8589 style_default[variant], 8590 className 8591 ) 8592 }) 8593 }); 8594 return element; 8595 }); 8596 8597 // packages/ui/build-module/badge/badge.mjs 8598 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); 8599 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='d6a685e1aa']")) { 8600 const style = document.createElement("style"); 8601 style.setAttribute("data-wp-hash", "d6a685e1aa"); 8602 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._96e6251aad1a6136__badge{border-radius:var(--wpds-border-radius-lg,8px);padding-block:var(--wpds-dimension-padding-xs,4px);padding-inline:var(--wpds-dimension-padding-sm,8px)}._99f7158cb520f750__is-high-intent{background-color:var(--wpds-color-bg-surface-error,#f6e6e3);color:var(--wpds-color-fg-content-error,#470000)}.c20ebef2365bc8b7__is-medium-intent{background-color:var(--wpds-color-bg-surface-warning,#fde6be);color:var(--wpds-color-fg-content-warning,#2e1900)}._365e1626c6202e52__is-low-intent{background-color:var(--wpds-color-bg-surface-caution,#fee995);color:var(--wpds-color-fg-content-caution,#281d00)}._33f8198127ddf4ef__is-stable-intent{background-color:var(--wpds-color-bg-surface-success,#c6f7cd);color:var(--wpds-color-fg-content-success,#002900)}._04c1aca8fc449412__is-informational-intent{background-color:var(--wpds-color-bg-surface-info,#deebfa);color:var(--wpds-color-fg-content-info,#001b4f)}._90726e69d495ec19__is-draft-intent{background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);color:var(--wpds-color-fg-content-neutral,#1e1e1e)}._898f4a544993bd39__is-none-intent{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral,#dbdbdb);color:var(--wpds-color-fg-content-neutral,#1e1e1e);padding-block:calc(var(--wpds-dimension-padding-xs, 4px) - var(--wpds-border-width-xs, 1px));padding-inline:calc(var(--wpds-dimension-padding-sm, 8px) - var(--wpds-border-width-xs, 1px))}}")); 8603 document.head.appendChild(style); 8604 } 8605 var style_default2 = { "badge": "_96e6251aad1a6136__badge", "is-high-intent": "_99f7158cb520f750__is-high-intent", "is-medium-intent": "c20ebef2365bc8b7__is-medium-intent", "is-low-intent": "_365e1626c6202e52__is-low-intent", "is-stable-intent": "_33f8198127ddf4ef__is-stable-intent", "is-informational-intent": "_04c1aca8fc449412__is-informational-intent", "is-draft-intent": "_90726e69d495ec19__is-draft-intent", "is-none-intent": "_898f4a544993bd39__is-none-intent" }; 8606 var Badge = (0, import_element10.forwardRef)(function Badge2({ intent = "none", className, ...props }, ref) { 8607 return /* @__PURE__ */ (0, import_jsx_runtime11.jsx)( 8608 Text, 8609 { 8610 ref, 8611 className: clsx_default( 8612 style_default2.badge, 8613 style_default2[`is-$intent}-intent`], 8614 className 8615 ), 8616 ...props, 8617 variant: "body-sm" 8618 } 8619 ); 8620 }); 8621 8622 // packages/ui/build-module/button/button.mjs 8623 var import_element11 = __toESM(require_element(), 1); 8624 var import_i18n2 = __toESM(require_i18n(), 1); 8625 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); 8626 import { speak } from "@wordpress/a11y"; 8627 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='26d90ece4e']")) { 8628 const style = document.createElement("style"); 8629 style.setAttribute("data-wp-hash", "26d90ece4e"); 8630 style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._97b0fc33c028be1a__button,.abbb272e2ce49bd6__is-unstyled{appearance:none;padding:0}._97b0fc33c028be1a__button{--wp-ui-button-font-weight:499;--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-strong,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-strong-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 93%,#000));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand-strong,#fff);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-strong-active,#fff);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled,#8d8d8d);--wp-ui-button-padding-inline:var(--wpds-dimension-padding-md,12px);--wp-ui-button-height:40px;--wp-ui-button-aspect-ratio:auto;--wp-ui-button-font-size:var(--wpds-typography-font-size-md,13px);--wp-ui-button-min-width:calc(4ch + var(--wp-ui-button-padding-inline)*2);--wp-ui-button-border-color:var(--wp-ui-button-background-color);--wp-ui-button-border-color-active:var(--wp-ui-button-background-color-active);--wp-ui-button-border-color-disabled:var(--wp-ui-button-background-color-disabled);--_gcd-button-font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);--_gcd-button-font-size:var(--wp-ui-button-font-size);--_gcd-button-font-weight:var(--wp-ui-button-font-weight);align-items:center;aspect-ratio:var(--wp-ui-button-aspect-ratio);background-clip:padding-box;background-color:var(--wp-ui-button-background-color);border-color:var(--wp-ui-button-border-color);border-radius:var(--wpds-border-radius-sm,2px);border-style:solid;border-width:1px;color:var(--wp-ui-button-foreground-color);cursor:var(--wpds-cursor-control,pointer);display:inline-flex;font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wp-ui-button-font-size);font-weight:var(--wp-ui-button-font-weight);gap:var(--wpds-dimension-gap-sm,8px);height:var(--wp-ui-button-height);justify-content:center;line-height:var(--wpds-typography-line-height-sm,20px);min-width:var(--wp-ui-button-min-width);padding-inline:var(--wp-ui-button-padding-inline);position:relative;text-decoration:none;@media not (prefers-reduced-motion){transition:color .1s ease-out;*{transition:opacity .1s ease-out}}&[href]{cursor:pointer}[href]{color:inherit;text-decoration:inherit}&:not([data-disabled]):is(:hover,:active,:focus){background-color:var(--wp-ui-button-background-color-active);border-color:var(--wp-ui-button-border-color-active);color:var(--wp-ui-button-foreground-color-active)}&[data-disabled]:not(._914b42f315c0e580__is-loading){background-color:var(--wp-ui-button-background-color-disabled);border-color:var(--wp-ui-button-border-color-disabled);color:var(--wp-ui-button-foreground-color-disabled);@media (forced-colors:active){border-bottom-color:GrayText;border-left-color:GrayText;border-right-color:GrayText;border-top-color:GrayText;color:GrayText}}&:before{aspect-ratio:1;border:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid;border-block-end-color:#0000;border-block-start-color:var(--wp-ui-button-foreground-color);border-inline-end-color:var(--wp-ui-button-foreground-color);border-inline-start-color:#0000;border-radius:50%;box-sizing:border-box;content:"";display:block;height:var(--wp-ui-button-font-size);inset-inline-start:50%;opacity:0;pointer-events:none;position:absolute;top:50%;transform:translate(-50%,-50%);@media not (prefers-reduced-motion){transition:opacity .1s ease-out}}}._908205475f9f2a92__is-small{--wp-ui-button-padding-inline:var(--wpds-dimension-padding-sm,8px);--wp-ui-button-height:24px}.dd460c965226cc77__is-brand{&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-brand,var(--wp-admin-theme-color,#3858e9));--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-brand-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 85%,#000));--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-brand-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-brand-weak-active,color-mix(in oklch,var(--wp-admin-theme-color,#3858e9) 12%,#fff));--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000)}}.e722a8f96726aa99__is-neutral{&.b50b3358c5fb4d0b__is-solid{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong-active,#1e1e1e);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-strong-disabled,#e6e6e6);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong-active,#f0f0f0);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-strong-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline,&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e);--wp-ui-button-foreground-color-disabled:var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d)}&._62d5a778b7b258ee__is-outline{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000);--wp-ui-button-border-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d);--wp-ui-button-border-color-active:var(--wpds-color-stroke-interactive-neutral-active,#6e6e6e);--wp-ui-button-border-color-disabled:var(--wpds-color-stroke-interactive-neutral-disabled,#dbdbdb)}&.ad0619a3217c6a5b__is-minimal{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-weak,#0000);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-weak-active,#ededed);--wp-ui-button-background-color-disabled:var(--wpds-color-bg-interactive-neutral-weak-disabled,#0000)}}.abbb272e2ce49bd6__is-unstyled{background:none;border:none;min-width:unset}.cf59cf1b69629838__is-compact{--wp-ui-button-height:32px}._914b42f315c0e580__is-loading{color:#0000;&:not([data-disabled]):is(:hover,:active,:focus){color:#0000}*{opacity:0}&:before{opacity:1;transition-delay:.05s;@media not (prefers-reduced-motion){animation:_5a1d53da6f830c8d__loading-animation 1s linear infinite}}}[aria-pressed=true].ad0619a3217c6a5b__is-minimal.e722a8f96726aa99__is-neutral{--wp-ui-button-background-color:var(--wpds-color-bg-interactive-neutral-strong,#2d2d2d);--wp-ui-button-background-color-active:var(--wpds-color-bg-interactive-neutral-strong,#2d2d2d);--wp-ui-button-foreground-color:var(--wpds-color-fg-interactive-neutral-strong,#f0f0f0);--wp-ui-button-foreground-color-active:var(--wpds-color-fg-interactive-neutral-strong,#f0f0f0)}}@keyframes _5a1d53da6f830c8d__loading-animation{0%{transform:translate(-50%,-50%) rotate(0deg)}to{transform:translate(-50%,-50%) rotate(1turn)}}')); 8631 document.head.appendChild(style); 8632 } 8633 var style_default3 = { "button": "_97b0fc33c028be1a__button", "is-unstyled": "abbb272e2ce49bd6__is-unstyled", "is-loading": "_914b42f315c0e580__is-loading", "is-small": "_908205475f9f2a92__is-small", "is-brand": "dd460c965226cc77__is-brand", "is-outline": "_62d5a778b7b258ee__is-outline", "is-minimal": "ad0619a3217c6a5b__is-minimal", "is-neutral": "e722a8f96726aa99__is-neutral", "is-solid": "b50b3358c5fb4d0b__is-solid", "is-compact": "cf59cf1b69629838__is-compact", "loading-animation": "_5a1d53da6f830c8d__loading-animation" }; 8634 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='e3ae230cea']")) { 8635 const style = document.createElement("style"); 8636 style.setAttribute("data-wp-hash", "e3ae230cea"); 8637 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}")); 8638 document.head.appendChild(style); 8639 } 8640 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 8641 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='2a5ab8f3a7']")) { 8642 const style = document.createElement("style"); 8643 style.setAttribute("data-wp-hash", "2a5ab8f3a7"); 8644 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._08e8a2e44959f892__outset-ring--focus,._970d04df7376df67__outset-ring--focus-within-except-active,.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible,.cd83dfc2126a0846__outset-ring--focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active,.ecadb9e080e2dfa5__outset-ring--focus-parent-visible{@media not (prefers-reduced-motion){--_gcd-a-transition:outline 0.1s ease-out;transition:outline .1s ease-out}outline:0 solid #0000;outline-offset:1px}._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9))}}")); 8645 document.head.appendChild(style); 8646 } 8647 var focus_default = { "outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus", "outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active", "outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible", "outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within", "outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active", "outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible" }; 8648 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='1fb29d3a3c']")) { 8649 const style = document.createElement("style"); 8650 style.setAttribute("data-wp-hash", "1fb29d3a3c"); 8651 style.appendChild(document.createTextNode("._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,#0000);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 #0000);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,#0000);border-color:var(--_gcd-input-border-color-disabled,#0000);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid #0000)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid #0000);transition:var(--_gcd-a-transition,none)}")); 8652 document.head.appendChild(style); 8653 } 8654 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" }; 8655 var Button3 = (0, import_element11.forwardRef)( 8656 function Button22({ 8657 tone = "brand", 8658 variant = "solid", 8659 size: size4 = "default", 8660 className, 8661 focusableWhenDisabled = true, 8662 disabled: disabled2, 8663 loading, 8664 loadingAnnouncement = (0, import_i18n2.__)("Loading"), 8665 children, 8666 ...props 8667 }, ref) { 8668 const mergedClassName = clsx_default( 8669 global_css_defense_default2.button, 8670 resets_default["box-sizing"], 8671 focus_default["outset-ring--focus-except-active"], 8672 variant !== "unstyled" && style_default3.button, 8673 style_default3[`is-$tone}`], 8674 style_default3[`is-$variant}`], 8675 style_default3[`is-$size4}`], 8676 loading && style_default3["is-loading"], 8677 className 8678 ); 8679 (0, import_element11.useEffect)(() => { 8680 if (loading && loadingAnnouncement) { 8681 speak(loadingAnnouncement); 8682 } 8683 }, [loading, loadingAnnouncement]); 8684 return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)( 8685 Button, 8686 { 8687 ref, 8688 className: mergedClassName, 8689 focusableWhenDisabled, 8690 disabled: disabled2 ?? loading, 8691 ...props, 8692 children 8693 } 8694 ); 8695 } 8696 ); 8697 8698 // packages/ui/build-module/button/icon.mjs 8699 var import_element13 = __toESM(require_element(), 1); 8700 8701 // packages/ui/build-module/icon/icon.mjs 8702 var import_element12 = __toESM(require_element(), 1); 8703 var import_primitives = __toESM(require_primitives(), 1); 8704 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); 8705 var Icon = (0, import_element12.forwardRef)(function Icon2({ icon, size: size4 = 24, ...restProps }, ref) { 8706 return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)( 8707 import_primitives.SVG, 8708 { 8709 ref, 8710 fill: "currentColor", 8711 ...icon.props, 8712 ...restProps, 8713 width: size4, 8714 height: size4 8715 } 8716 ); 8717 }); 8718 8719 // packages/ui/build-module/button/icon.mjs 8720 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); 8721 var ButtonIcon = (0, import_element13.forwardRef)( 8722 function ButtonIcon2({ icon, ...props }, ref) { 8723 return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)( 8724 Icon, 8725 { 8726 ref, 8727 icon, 8728 viewBox: "4 4 16 16", 8729 size: 16, 8730 ...props 8731 } 8732 ); 8733 } 8734 ); 8735 8736 // packages/ui/build-module/button/index.mjs 8737 var Button4 = Object.assign(Button3, { 8738 /** 8739 * An icon component specifically designed to work well when rendered inside 8740 * a `Button` component. 8741 */ 8742 Icon: ButtonIcon 8743 }); 8744 8745 // packages/icons/build-module/library/caution.mjs 8746 var import_primitives2 = __toESM(require_primitives(), 1); 8747 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); 8748 var caution_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives2.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm-.75 12v-1.5h1.5V16h-1.5Zm0-8v5h1.5V8h-1.5Z" }) }); 8749 8750 // packages/icons/build-module/library/close-small.mjs 8751 var import_primitives3 = __toESM(require_primitives(), 1); 8752 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); 8753 var close_small_default = /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime16.jsx)(import_primitives3.Path, { d: "M12 13.06l3.712 3.713 1.061-1.06L13.061 12l3.712-3.712-1.06-1.06L12 10.938 8.288 7.227l-1.061 1.06L10.939 12l-3.712 3.712 1.06 1.061L12 13.061z" }) }); 8754 8755 // packages/icons/build-module/library/error.mjs 8756 var import_primitives4 = __toESM(require_primitives(), 1); 8757 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); 8758 var error_default = /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime17.jsx)(import_primitives4.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12.218 5.377a.25.25 0 0 0-.436 0l-7.29 12.96a.25.25 0 0 0 .218.373h14.58a.25.25 0 0 0 .218-.372l-7.29-12.96Zm-1.743-.735c.669-1.19 2.381-1.19 3.05 0l7.29 12.96a1.75 1.75 0 0 1-1.525 2.608H4.71a1.75 1.75 0 0 1-1.525-2.608l7.29-12.96ZM12.75 17.46h-1.5v-1.5h1.5v1.5Zm-1.5-3h1.5v-5h-1.5v5Z" }) }); 8759 8760 // packages/icons/build-module/library/info.mjs 8761 var import_primitives5 = __toESM(require_primitives(), 1); 8762 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); 8763 var info_default = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_primitives5.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M5.5 12a6.5 6.5 0 1 0 13 0 6.5 6.5 0 0 0-13 0ZM12 4a8 8 0 1 0 0 16 8 8 0 0 0 0-16Zm.75 4v1.5h-1.5V8h1.5Zm0 8v-5h-1.5v5h1.5Z" }) }); 8764 8765 // packages/icons/build-module/library/published.mjs 8766 var import_primitives6 = __toESM(require_primitives(), 1); 8767 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); 8768 var published_default = /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives6.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_primitives6.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 18.5a6.5 6.5 0 1 1 0-13 6.5 6.5 0 0 1 0 13ZM4 12a8 8 0 1 1 16 0 8 8 0 0 1-16 0Zm11.53-1.47-1.06-1.06L11 12.94l-1.47-1.47-1.06 1.06L11 15.06l4.53-4.53Z" }) }); 8769 8770 // packages/icons/build-module/library/trash.mjs 8771 var import_primitives7 = __toESM(require_primitives(), 1); 8772 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); 8773 var trash_default = /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives7.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_primitives7.Path, { fillRule: "evenodd", clipRule: "evenodd", d: "M12 5.5A2.25 2.25 0 0 0 9.878 7h4.244A2.251 2.251 0 0 0 12 5.5ZM12 4a3.751 3.751 0 0 0-3.675 3H5v1.5h1.27l.818 8.997a2.75 2.75 0 0 0 2.739 2.501h4.347a2.75 2.75 0 0 0 2.738-2.5L17.73 8.5H19V7h-3.325A3.751 3.751 0 0 0 12 4Zm4.224 4.5H7.776l.806 8.861a1.25 1.25 0 0 0 1.245 1.137h4.347a1.25 1.25 0 0 0 1.245-1.137l.805-8.861Z" }) }); 8774 8775 // packages/ui/build-module/utils/render-portal-with-children.mjs 8776 var import_element14 = __toESM(require_element(), 1); 8777 function renderPortalWithChildren(portal, defaultPortal, children) { 8778 const rootPortal = portal ?? defaultPortal; 8779 return (0, import_element14.cloneElement)(rootPortal, { 8780 children 8781 }); 8782 } 8783 8784 // packages/ui/build-module/lock-unlock.mjs 8785 var import_private_apis = __toESM(require_private_apis(), 1); 8786 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 8787 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 8788 "@wordpress/ui" 8789 ); 8790 8791 // packages/ui/build-module/stack/stack.mjs 8792 var import_element15 = __toESM(require_element(), 1); 8793 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='b51ff41489']")) { 8794 const style = document.createElement("style"); 8795 style.setAttribute("data-wp-hash", "b51ff41489"); 8796 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}")); 8797 document.head.appendChild(style); 8798 } 8799 var style_default4 = { "stack": "_19ce0419607e1896__stack" }; 8800 var gapTokens = { 8801 xs: "var(--wpds-dimension-gap-xs, 4px)", 8802 sm: "var(--wpds-dimension-gap-sm, 8px)", 8803 md: "var(--wpds-dimension-gap-md, 12px)", 8804 lg: "var(--wpds-dimension-gap-lg, 16px)", 8805 xl: "var(--wpds-dimension-gap-xl, 24px)", 8806 "2xl": "var(--wpds-dimension-gap-2xl, 32px)", 8807 "3xl": "var(--wpds-dimension-gap-3xl, 40px)" 8808 }; 8809 var Stack = (0, import_element15.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { 8810 const style = { 8811 gap: gap && gapTokens[gap], 8812 alignItems: align, 8813 justifyContent: justify, 8814 flexDirection: direction, 8815 flexWrap: wrap 8816 }; 8817 const element = useRender({ 8818 render, 8819 ref, 8820 props: mergeProps(props, { style, className: style_default4.stack }) 8821 }); 8822 return element; 8823 }); 8824 8825 // packages/ui/build-module/icon-button/icon-button.mjs 8826 var import_element19 = __toESM(require_element(), 1); 8827 8828 // packages/ui/build-module/tooltip/popup.mjs 8829 var import_element17 = __toESM(require_element(), 1); 8830 var import_theme = __toESM(require_theme(), 1); 8831 8832 // packages/ui/build-module/tooltip/portal.mjs 8833 var import_element16 = __toESM(require_element(), 1); 8834 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); 8835 var Portal = (0, import_element16.forwardRef)( 8836 function TooltipPortal3(props, ref) { 8837 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(index_parts_exports.Portal, { ref, ...props }); 8838 } 8839 ); 8840 8841 // packages/ui/build-module/tooltip/popup.mjs 8842 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); 8843 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='e3ae230cea']")) { 8844 const style = document.createElement("style"); 8845 style.setAttribute("data-wp-hash", "e3ae230cea"); 8846 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}")); 8847 document.head.appendChild(style); 8848 } 8849 var resets_default2 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 8850 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='8293efbb49']")) { 8851 const style = document.createElement("style"); 8852 style.setAttribute("data-wp-hash", "8293efbb49"); 8853 style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._480b748dd3510e64__positioner{z-index:var(--wp-ui-tooltip-z-index,initial)}._50096b232db7709d__popup{background-color:var(--wpds-color-bg-surface-neutral-strong,#fff);border-radius:var(--wpds-border-radius-sm,2px);box-shadow:var(--wpds-elevation-sm,0 1px 2px 0 #0000000d,0 2px 3px 0 #0000000a,0 6px 6px 0 #00000008,0 8px 8px 0 #00000005);color:var(--wpds-color-fg-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}}}')); 8854 document.head.appendChild(style); 8855 } 8856 var style_default5 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 8857 var ThemeProvider = unlock(import_theme.privateApis).ThemeProvider; 8858 var Popup = (0, import_element17.forwardRef)(function TooltipPopup3({ 8859 align = "center", 8860 portal, 8861 side = "top", 8862 sideOffset = 4, 8863 children, 8864 className, 8865 ...props 8866 }, ref) { 8867 const portalChildren = /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( 8868 index_parts_exports.Positioner, 8869 { 8870 align, 8871 side, 8872 sideOffset, 8873 className: clsx_default(resets_default2["box-sizing"], style_default5.positioner), 8874 children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(ThemeProvider, { color: { bg: "#1e1e1e" }, children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( 8875 index_parts_exports.Popup, 8876 { 8877 ref, 8878 className: clsx_default(style_default5.popup, className), 8879 ...props, 8880 children 8881 } 8882 ) }) 8883 } 8884 ); 8885 return renderPortalWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(Portal, {}), portalChildren); 8886 }); 8887 8888 // packages/ui/build-module/tooltip/trigger.mjs 8889 var import_element18 = __toESM(require_element(), 1); 8890 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); 8891 var Trigger = (0, import_element18.forwardRef)( 8892 function TooltipTrigger3(props, ref) { 8893 return /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(index_parts_exports.Trigger, { ref, ...props }); 8894 } 8895 ); 8896 8897 // packages/ui/build-module/tooltip/root.mjs 8898 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); 8899 function Root(props) { 8900 return /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(index_parts_exports.Root, { ...props }); 8901 } 8902 8903 // packages/ui/build-module/tooltip/provider.mjs 8904 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); 8905 function Provider({ ...props }) { 8906 return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(index_parts_exports.Provider, { ...props }); 8907 } 8908 8909 // packages/ui/build-module/icon-button/icon-button.mjs 8910 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); 8911 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='358a2a646a']")) { 8912 const style = document.createElement("style"); 8913 style.setAttribute("data-wp-hash", "358a2a646a"); 8914 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-compositions{._28cfdc260e755391__icon-button{--wp-ui-button-aspect-ratio:1;--wp-ui-button-padding-inline:0;--wp-ui-button-min-width:unset}.f1c70d719989a85a__icon{margin:-1px}}")); 8915 document.head.appendChild(style); 8916 } 8917 var style_default6 = { "icon-button": "_28cfdc260e755391__icon-button", "icon": "f1c70d719989a85a__icon" }; 8918 var IconButton = (0, import_element19.forwardRef)( 8919 function IconButton2({ 8920 label, 8921 className, 8922 // Prevent accidental forwarding of `children` 8923 children: _children, 8924 disabled: disabled2, 8925 focusableWhenDisabled, 8926 icon, 8927 size: size4, 8928 shortcut, 8929 ...restProps 8930 }, ref) { 8931 const classes = clsx_default(style_default6["icon-button"], className); 8932 return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Provider, { delay: 0, children: /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Root, { children: [ 8933 /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( 8934 Trigger, 8935 { 8936 ref, 8937 disabled: disabled2 && !focusableWhenDisabled, 8938 render: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( 8939 Button4, 8940 { 8941 ...restProps, 8942 size: size4, 8943 "aria-label": label, 8944 "aria-keyshortcuts": shortcut?.ariaKeyShortcut, 8945 disabled: disabled2, 8946 focusableWhenDisabled 8947 } 8948 ), 8949 className: classes, 8950 children: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( 8951 Icon, 8952 { 8953 icon, 8954 size: 24, 8955 className: style_default6.icon 8956 } 8957 ) 8958 } 8959 ), 8960 /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(Popup, { children: [ 8961 label, 8962 shortcut && /* @__PURE__ */ (0, import_jsx_runtime26.jsxs)(import_jsx_runtime26.Fragment, { children: [ 8963 " ", 8964 /* @__PURE__ */ (0, import_jsx_runtime26.jsx)("span", { "aria-hidden": "true", children: shortcut.displayShortcut }) 8965 ] }) 8966 ] }) 8967 ] }) }); 8968 } 8969 ); 8970 8971 // packages/ui/build-module/link/link.mjs 8972 var import_element20 = __toESM(require_element(), 1); 8973 var import_i18n3 = __toESM(require_i18n(), 1); 8974 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); 8975 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='e3ae230cea']")) { 8976 const style = document.createElement("style"); 8977 style.setAttribute("data-wp-hash", "e3ae230cea"); 8978 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}")); 8979 document.head.appendChild(style); 8980 } 8981 var resets_default3 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 8982 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='2a5ab8f3a7']")) { 8983 const style = document.createElement("style"); 8984 style.setAttribute("data-wp-hash", "2a5ab8f3a7"); 8985 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._08e8a2e44959f892__outset-ring--focus,._970d04df7376df67__outset-ring--focus-within-except-active,.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible,.cd83dfc2126a0846__outset-ring--focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active,.ecadb9e080e2dfa5__outset-ring--focus-parent-visible{@media not (prefers-reduced-motion){--_gcd-a-transition:outline 0.1s ease-out;transition:outline .1s ease-out}outline:0 solid #0000;outline-offset:1px}._08e8a2e44959f892__outset-ring--focus:focus,._970d04df7376df67__outset-ring--focus-within-except-active:focus-within:not(:has(:active)),.c5cb3ee4bddaa8e4__outset-ring--focus-within-visible:focus-within:has(:focus-visible),.cd83dfc2126a0846__outset-ring--focus-within:focus-within,.d0541bc9dd9dc7b6__outset-ring--focus-visible:focus-visible,.e25b2bdd7aa21721__outset-ring--focus-except-active:focus:not(:active),:focus-visible .ecadb9e080e2dfa5__outset-ring--focus-parent-visible{--_gcd-a-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));--_gcd-div-outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9));outline:var(--wpds-border-width-focus,var(--wp-admin-border-width-focus,2px)) solid var(--wpds-color-stroke-focus-brand,var(--wp-admin-theme-color,#3858e9))}}")); 8986 document.head.appendChild(style); 8987 } 8988 var focus_default2 = { "outset-ring--focus": "_08e8a2e44959f892__outset-ring--focus", "outset-ring--focus-except-active": "e25b2bdd7aa21721__outset-ring--focus-except-active", "outset-ring--focus-visible": "d0541bc9dd9dc7b6__outset-ring--focus-visible", "outset-ring--focus-within": "cd83dfc2126a0846__outset-ring--focus-within", "outset-ring--focus-within-except-active": "_970d04df7376df67__outset-ring--focus-within-except-active", "outset-ring--focus-within-visible": "c5cb3ee4bddaa8e4__outset-ring--focus-within-visible", "outset-ring--focus-parent-visible": "ecadb9e080e2dfa5__outset-ring--focus-parent-visible" }; 8989 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='3cfc19ad21']")) { 8990 const style = document.createElement("style"); 8991 style.setAttribute("data-wp-hash", "3cfc19ad21"); 8992 style.appendChild(document.createTextNode('@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{.d4250949359b05ce__link{text-decoration-thickness:from-font;text-underline-offset:.2em}.c6055659b8e2cd2c__is-brand,.c6055659b8e2cd2c__is-brand:visited{--_gcd-a-color:var(--wpds-color-fg-interactive-brand,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-fg-interactive-brand,var(--wp-admin-theme-color,#3858e9))}.c6055659b8e2cd2c__is-brand:active,.c6055659b8e2cd2c__is-brand:hover{--_gcd-a-color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9));color:var(--wpds-color-fg-interactive-brand-active,var(--wp-admin-theme-color,#3858e9))}._92e0dfcaeee15b88__is-neutral,._92e0dfcaeee15b88__is-neutral:visited{--_gcd-a-color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);color:var(--wpds-color-fg-interactive-neutral,#1e1e1e);text-decoration-color:var(--wpds-color-stroke-interactive-neutral,#8d8d8d)}._92e0dfcaeee15b88__is-neutral:active,._92e0dfcaeee15b88__is-neutral:hover{--_gcd-a-color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e);color:var(--wpds-color-fg-interactive-neutral-active,#1e1e1e)}.cf122a9bf1035d42__is-unstyled{--_gcd-a-color:inherit;color:inherit;text-decoration:none}._0cb411afac4c86c7__link-icon{display:inline-block;font-weight:var(--wpds-typography-font-weight-regular,400);margin-inline-start:var(--wpds-dimension-padding-xs,4px);text-decoration:none}._0cb411afac4c86c7__link-icon:after{content:"\\2197"}._0cb411afac4c86c7__link-icon:dir(rtl):after{content:"\\2196"}}')); 8993 document.head.appendChild(style); 8994 } 8995 var style_default7 = { "link": "d4250949359b05ce__link", "is-brand": "c6055659b8e2cd2c__is-brand", "is-neutral": "_92e0dfcaeee15b88__is-neutral", "is-unstyled": "cf122a9bf1035d42__is-unstyled", "link-icon": "_0cb411afac4c86c7__link-icon" }; 8996 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='1fb29d3a3c']")) { 8997 const style = document.createElement("style"); 8998 style.setAttribute("data-wp-hash", "1fb29d3a3c"); 8999 style.appendChild(document.createTextNode("._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,#0000);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 #0000);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,#0000);border-color:var(--_gcd-input-border-color-disabled,#0000);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid #0000)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid #0000);transition:var(--_gcd-a-transition,none)}")); 9000 document.head.appendChild(style); 9001 } 9002 var global_css_defense_default3 = { "button": "_6defc79820e382c6__button", "input": "d2cff2e5dea83bd1__input", "textarea": "_547d86373d02e108__textarea", "div": "_8c15fd0ed9f28ba4__div", "p": "_43cec3e1eec1066d__p", "heading": "e97669c6d9a38497__heading", "a": "_2c0831b0499dbd6e__a" }; 9003 var Link = (0, import_element20.forwardRef)(function Link2({ 9004 children, 9005 variant = "default", 9006 tone = "brand", 9007 openInNewTab = false, 9008 render, 9009 className, 9010 ...props 9011 }, ref) { 9012 const element = useRender({ 9013 render, 9014 defaultTagName: "a", 9015 ref, 9016 props: mergeProps(props, { 9017 className: clsx_default( 9018 global_css_defense_default3.a, 9019 resets_default3["box-sizing"], 9020 focus_default2["outset-ring--focus"], 9021 variant !== "unstyled" && style_default7.link, 9022 variant !== "unstyled" && style_default7[`is-$tone}`], 9023 variant === "unstyled" && style_default7["is-unstyled"], 9024 className 9025 ), 9026 target: openInNewTab ? "_blank" : void 0, 9027 children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [ 9028 children, 9029 openInNewTab && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)( 9030 "span", 9031 { 9032 className: style_default7["link-icon"], 9033 role: "img", 9034 "aria-label": ( 9035 /* translators: accessibility text appended to link text */ 9036 (0, import_i18n3.__)("(opens in a new tab)") 9037 ) 9038 } 9039 ) 9040 ] }) 9041 }) 9042 }); 9043 return element; 9044 }); 9045 9046 // packages/ui/build-module/notice/index.mjs 9047 var notice_exports = {}; 9048 __export(notice_exports, { 9049 ActionButton: () => ActionButton, 9050 ActionLink: () => ActionLink, 9051 Actions: () => Actions, 9052 CloseIcon: () => CloseIcon, 9053 Description: () => Description, 9054 Root: () => Root2, 9055 Title: () => Title 9056 }); 9057 9058 // packages/ui/build-module/notice/root.mjs 9059 var import_element21 = __toESM(require_element(), 1); 9060 import { speak as speak2 } from "@wordpress/a11y"; 9061 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); 9062 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='e3ae230cea']")) { 9063 const style = document.createElement("style"); 9064 style.setAttribute("data-wp-hash", "e3ae230cea"); 9065 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}")); 9066 document.head.appendChild(style); 9067 } 9068 var resets_default4 = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 9069 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='60dd1d4d42']")) { 9070 const style = document.createElement("style"); 9071 style.setAttribute("data-wp-hash", "60dd1d4d42"); 9072 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b481);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer wp-ui-compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#ededed))}}")); 9073 document.head.appendChild(style); 9074 } 9075 var style_default8 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" }; 9076 var icons = { 9077 neutral: null, 9078 info: info_default, 9079 warning: caution_default, 9080 success: published_default, 9081 error: error_default 9082 }; 9083 function getDefaultPoliteness(intent) { 9084 return intent === "error" ? "assertive" : "polite"; 9085 } 9086 function safeRenderToString(message) { 9087 if (!message) { 9088 return void 0; 9089 } 9090 if (typeof message === "string") { 9091 return message; 9092 } 9093 try { 9094 return (0, import_element21.renderToString)(message); 9095 } catch { 9096 return void 0; 9097 } 9098 } 9099 function useSpokenMessage(message, politeness) { 9100 const spokenMessage = safeRenderToString(message); 9101 (0, import_element21.useEffect)(() => { 9102 if (spokenMessage) { 9103 speak2(spokenMessage, politeness); 9104 } 9105 }, [spokenMessage, politeness]); 9106 } 9107 var Root2 = (0, import_element21.forwardRef)(function Notice({ 9108 intent = "neutral", 9109 children, 9110 icon, 9111 spokenMessage = children, 9112 politeness = getDefaultPoliteness(intent), 9113 render, 9114 ...restProps 9115 }, ref) { 9116 useSpokenMessage(spokenMessage, politeness); 9117 const iconElement = icon === null ? null : icon ?? icons[intent]; 9118 const mergedClassName = clsx_default( 9119 style_default8.notice, 9120 style_default8[`is-$intent}`], 9121 resets_default4["box-sizing"] 9122 ); 9123 const element = useRender({ 9124 defaultTagName: "div", 9125 render, 9126 ref, 9127 props: mergeProps( 9128 { 9129 className: mergedClassName, 9130 children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [ 9131 children, 9132 iconElement && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)( 9133 Icon, 9134 { 9135 className: style_default8.icon, 9136 icon: iconElement 9137 } 9138 ) 9139 ] }) 9140 }, 9141 restProps 9142 ) 9143 }); 9144 return element; 9145 }); 9146 9147 // packages/ui/build-module/notice/title.mjs 9148 var import_element22 = __toESM(require_element(), 1); 9149 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); 9150 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='60dd1d4d42']")) { 9151 const style = document.createElement("style"); 9152 style.setAttribute("data-wp-hash", "60dd1d4d42"); 9153 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b481);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer wp-ui-compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#ededed))}}")); 9154 document.head.appendChild(style); 9155 } 9156 var style_default9 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" }; 9157 var Title = (0, import_element22.forwardRef)( 9158 function NoticeTitle({ className, ...props }, ref) { 9159 return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)( 9160 Text, 9161 { 9162 ref, 9163 variant: "heading-md", 9164 className: clsx_default(style_default9.title, className), 9165 ...props 9166 } 9167 ); 9168 } 9169 ); 9170 9171 // packages/ui/build-module/notice/description.mjs 9172 var import_element23 = __toESM(require_element(), 1); 9173 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); 9174 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='60dd1d4d42']")) { 9175 const style = document.createElement("style"); 9176 style.setAttribute("data-wp-hash", "60dd1d4d42"); 9177 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b481);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer wp-ui-compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#ededed))}}")); 9178 document.head.appendChild(style); 9179 } 9180 var style_default10 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" }; 9181 var Description = (0, import_element23.forwardRef)( 9182 function NoticeDescription({ className, ...props }, ref) { 9183 return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( 9184 Text, 9185 { 9186 ref, 9187 variant: "body-md", 9188 className: clsx_default(style_default10.description, className), 9189 ...props 9190 } 9191 ); 9192 } 9193 ); 9194 9195 // packages/ui/build-module/notice/actions.mjs 9196 var import_element24 = __toESM(require_element(), 1); 9197 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='60dd1d4d42']")) { 9198 const style = document.createElement("style"); 9199 style.setAttribute("data-wp-hash", "60dd1d4d42"); 9200 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b481);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer wp-ui-compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#ededed))}}")); 9201 document.head.appendChild(style); 9202 } 9203 var style_default11 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" }; 9204 var Actions = (0, import_element24.forwardRef)( 9205 function NoticeActions({ render, ...props }, ref) { 9206 const element = useRender({ 9207 defaultTagName: "div", 9208 render, 9209 ref, 9210 props: mergeProps( 9211 { 9212 className: style_default11.actions 9213 }, 9214 props 9215 ) 9216 }); 9217 return element; 9218 } 9219 ); 9220 9221 // packages/ui/build-module/notice/close-icon.mjs 9222 var import_element25 = __toESM(require_element(), 1); 9223 var import_i18n4 = __toESM(require_i18n(), 1); 9224 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); 9225 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='60dd1d4d42']")) { 9226 const style = document.createElement("style"); 9227 style.setAttribute("data-wp-hash", "60dd1d4d42"); 9228 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b481);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer wp-ui-compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#ededed))}}")); 9229 document.head.appendChild(style); 9230 } 9231 var style_default12 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" }; 9232 var CloseIcon = (0, import_element25.forwardRef)( 9233 function NoticeCloseIcon({ className, icon = close_small_default, label = (0, import_i18n4.__)("Dismiss"), ...props }, ref) { 9234 return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( 9235 IconButton, 9236 { 9237 ...props, 9238 ref, 9239 className: clsx_default(style_default12["close-icon"], className), 9240 variant: "minimal", 9241 size: "small", 9242 tone: "neutral", 9243 icon, 9244 label 9245 } 9246 ); 9247 } 9248 ); 9249 9250 // packages/ui/build-module/notice/action-button.mjs 9251 var import_element26 = __toESM(require_element(), 1); 9252 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); 9253 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='60dd1d4d42']")) { 9254 const style = document.createElement("style"); 9255 style.setAttribute("data-wp-hash", "60dd1d4d42"); 9256 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b481);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer wp-ui-compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#ededed))}}")); 9257 document.head.appendChild(style); 9258 } 9259 var style_default13 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" }; 9260 var ActionButton = (0, import_element26.forwardRef)( 9261 function NoticeActionButton({ className, loading, loadingAnnouncement, variant, ...props }, ref) { 9262 const loadingProps = loading !== void 0 ? { loading, loadingAnnouncement: loadingAnnouncement ?? "" } : {}; 9263 return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 9264 Button4, 9265 { 9266 ...props, 9267 ...loadingProps, 9268 ref, 9269 size: "compact", 9270 tone: "neutral", 9271 variant, 9272 className: clsx_default( 9273 style_default13["action-button"], 9274 style_default13[`is-action-button-$variant}`], 9275 className 9276 ) 9277 } 9278 ); 9279 } 9280 ); 9281 9282 // packages/ui/build-module/notice/action-link.mjs 9283 var import_element27 = __toESM(require_element(), 1); 9284 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); 9285 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='60dd1d4d42']")) { 9286 const style = document.createElement("style"); 9287 style.setAttribute("data-wp-hash", "60dd1d4d42"); 9288 style.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._4145abab73d17514__notice{--icon-height:24px;--text-vertical-padding:calc((var(--icon-height) - var(--wpds-typography-line-height-sm, 20px))/2);--wp-ui-notice-background-color:var(--wpds-color-bg-surface-neutral-weak,#f4f4f4);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-neutral,#dbdbdb);--wp-ui-notice-text-color:var(--wpds-color-fg-content-neutral,#1e1e1e);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-neutral,#1e1e1e);align-items:start;background-color:var(--wp-ui-notice-background-color);border:1px solid var(--wp-ui-notice-border-color);border-radius:var(--wpds-border-radius-lg,8px);container-type:inline-size;display:grid;grid-template-columns:auto 1fr auto;padding:var(--wpds-dimension-padding-md,12px)}.d0a25570cb528528__icon{color:var(--wp-ui-notice-decorative-icon-color);grid-column:1;grid-row:1;margin-inline-end:var(--wpds-dimension-gap-xs,4px)}._1904b570a89bb815__description,.b5397fb9d05389e3__title{color:var(--wp-ui-notice-text-color);grid-column:2;padding-block:var(--text-vertical-padding)}._1904b570a89bb815__description{text-wrap:pretty}._0a1270dcdd79c031__actions{display:flex;flex-wrap:wrap;gap:var(--wpds-dimension-gap-md,12px);grid-column:2}._4145abab73d17514__notice:has(._1904b570a89bb815__description) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions{margin-block-start:var(--wpds-dimension-gap-sm,8px)}._983740ab855c4e09__action-button{flex-shrink:0}.d329e7416d368d31__action-link{flex-shrink:0;&:not(:first-child){margin-inline-start:var(--wpds-dimension-gap-xs,4px)}&:not(:last-child){margin-inline-end:var(--wpds-dimension-gap-xs,4px)}}._487e6a5c1375f7dc__close-icon{grid-column:3;grid-row:1;margin-inline-start:var(--wpds-dimension-gap-xs,4px)}._531c140826094795__is-info{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-info-weak,#f3f9ff);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-info,#9fbcdc);--wp-ui-notice-text-color:var(--wpds-color-fg-content-info,#001b4f);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-info-weak,#006bd7)}.ae2e1004697cce95__is-warning{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-warning-weak,#fff7e1);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-warning,#d0b481);--wp-ui-notice-text-color:var(--wpds-color-fg-content-warning,#2e1900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-warning-weak,#926300)}._2e614a76af494837__is-success{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-success-weak,#ebffed);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-success,#8ac894);--wp-ui-notice-text-color:var(--wpds-color-fg-content-success,#002900);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-success-weak,#008030)}.af00331ae17a0065__is-error{--wp-ui-notice-background-color:var(--wpds-color-bg-surface-error-weak,#fff6f5);--wp-ui-notice-border-color:var(--wpds-color-stroke-surface-error,#daa39b);--wp-ui-notice-text-color:var(--wpds-color-fg-content-error,#470000);--wp-ui-notice-decorative-icon-color:var(--wpds-color-fg-content-error-weak,#cc1818)}@container (max-width: 320px){._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._0a1270dcdd79c031__actions,._4145abab73d17514__notice:has(.b5397fb9d05389e3__title) ._1904b570a89bb815__description{grid-column:1/3}}}@layer wp-ui-compositions{.d329e7416d368d31__action-link{margin-block:auto}._487e6a5c1375f7dc__close-icon,._983740ab855c4e09__action-button:is(._8ddb8fb33fbf3d38__is-action-button-outline,._77bbde495a8a0af3__is-action-button-minimal){--wp-ui-button-background-color-active:color-mix(in srgb,#0000 50%,var(--wpds-color-bg-interactive-neutral-weak-active,#ededed))}}")); 9289 document.head.appendChild(style); 9290 } 9291 var style_default14 = { "notice": "_4145abab73d17514__notice", "icon": "d0a25570cb528528__icon", "title": "b5397fb9d05389e3__title", "description": "_1904b570a89bb815__description", "actions": "_0a1270dcdd79c031__actions", "action-button": "_983740ab855c4e09__action-button", "action-link": "d329e7416d368d31__action-link", "close-icon": "_487e6a5c1375f7dc__close-icon", "is-info": "_531c140826094795__is-info", "is-warning": "ae2e1004697cce95__is-warning", "is-success": "_2e614a76af494837__is-success", "is-error": "af00331ae17a0065__is-error", "is-action-button-outline": "_8ddb8fb33fbf3d38__is-action-button-outline", "is-action-button-minimal": "_77bbde495a8a0af3__is-action-button-minimal" }; 9292 var ActionLink = (0, import_element27.forwardRef)( 9293 function NoticeActionLink({ className, render, ...props }, ref) { 9294 return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)( 9295 Text, 9296 { 9297 ref, 9298 className: clsx_default(style_default14["action-link"], className), 9299 ...props, 9300 variant: "body-md", 9301 render: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(Link, { tone: "neutral", variant: "default", render }) 9302 } 9303 ); 9304 } 9305 ); 9306 9307 // packages/user-taxonomies/build-module/fields/general.mjs 9308 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); 9309 var titleField = { 9310 id: "title", 9311 label: (0, import_i18n5.__)("Title"), 9312 type: "text", 9313 enableGlobalSearch: true, 9314 getValue: ({ item }) => item.title.raw, 9315 setValue: ({ value }) => ({ title: { raw: String(value ?? "") } }), 9316 isValid: { required: true, maxLength: 200 }, 9317 filterBy: false, 9318 enableHiding: false 9319 }; 9320 var pluralLabelField = { 9321 id: "plural_name", 9322 label: (0, import_i18n5.__)("Plural label"), 9323 type: "text", 9324 getValue: ({ item }) => item.title.raw, 9325 setValue: ({ value }) => ({ title: { raw: String(value ?? "") } }), 9326 isValid: { required: true, maxLength: 200 } 9327 }; 9328 var singularLabelField = { 9329 id: "singular_name", 9330 label: (0, import_i18n5.__)("Singular label"), 9331 type: "text", 9332 getValue: ({ item }) => item.config.labels.singular_name, 9333 setValue: ({ item, value }) => ({ 9334 config: { 9335 ...item.config, 9336 labels: { 9337 ...item.config.labels, 9338 singular_name: String(value ?? "") 9339 } 9340 } 9341 }), 9342 isValid: { required: true, maxLength: 200 }, 9343 enableSorting: false 9344 }; 9345 var descriptionField = { 9346 id: "description", 9347 label: (0, import_i18n5.__)("Description"), 9348 type: "text", 9349 Edit: { control: "textarea", rows: 3 }, 9350 description: (0, import_i18n5.__)( 9351 "Optional summary of the taxonomy. Shown in admin UIs that surface taxonomy details." 9352 ), 9353 getValue: ({ item }) => item.config.description, 9354 setValue: ({ item, value }) => ({ 9355 config: { ...item.config, description: String(value ?? "") } 9356 }), 9357 isValid: { maxLength: 1e3 }, 9358 enableSorting: false 9359 }; 9360 var publicField = { 9361 id: "public", 9362 label: (0, import_i18n5.__)("Public"), 9363 type: "boolean", 9364 description: (0, import_i18n5.__)( 9365 "Whether a taxonomy is intended for use publicly either via the admin interface or by front-end users." 9366 ), 9367 getValue: ({ item }) => item.config.public, 9368 setValue: ({ item, value }) => ({ 9369 config: { ...item.config, public: !!value } 9370 }), 9371 filterBy: false, 9372 enableSorting: false 9373 }; 9374 var hierarchicalField = { 9375 id: "hierarchical", 9376 label: (0, import_i18n5.__)("Hierarchical"), 9377 type: "boolean", 9378 description: (0, import_i18n5.__)( 9379 "When on, terms behave like categories with parent-child relationships. When off, terms behave like tags." 9380 ), 9381 getValue: ({ item }) => item.config.hierarchical, 9382 setValue: ({ item, value }) => ({ 9383 config: { ...item.config, hierarchical: !!value } 9384 }), 9385 filterBy: false, 9386 enableSorting: false 9387 }; 9388 var statusField = { 9389 id: "status", 9390 label: (0, import_i18n5.__)("Status"), 9391 description: (0, import_i18n5.__)( 9392 "Active taxonomies are enabled and registered with WordPress." 9393 ), 9394 elements: [ 9395 { value: "publish", label: (0, import_i18n5.__)("Active") }, 9396 { value: "draft", label: (0, import_i18n5.__)("Inactive") } 9397 ], 9398 render: ({ item }) => { 9399 const isActive = item.status === "publish"; 9400 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(Badge, { intent: isActive ? "stable" : "draft", children: isActive ? (0, import_i18n5.__)("Active") : (0, import_i18n5.__)("Inactive") }); 9401 }, 9402 enableSorting: false 9403 }; 9404 function useSlugField(originalSlug, currentValue) { 9405 const registeredTaxonomies = (0, import_data2.useSelect)( 9406 (select) => select(import_core_data2.store).getTaxonomies(), 9407 [] 9408 ); 9409 const showRenameWarning = originalSlug !== void 0 && currentValue !== originalSlug; 9410 return (0, import_element28.useMemo)( 9411 () => ({ 9412 id: "slug", 9413 label: (0, import_i18n5.__)("Taxonomy key"), 9414 type: "text", 9415 enableGlobalSearch: true, 9416 description: /* @__PURE__ */ (0, import_jsx_runtime34.jsxs)(Stack, { direction: "column", gap: "sm", render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", {}), children: [ 9417 showRenameWarning && /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(notice_exports.Root, { intent: "warning", render: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", {}), children: /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(notice_exports.Description, { children: (0, import_i18n5.__)( 9418 "Changing the key renames the taxonomy \u2014 existing terms may become inaccessible until a migration updates the database." 9419 ) }) }), 9420 /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { children: (0, import_i18n5.__)( 9421 "Lower case letters, numbers, underscores, and dashes only. Maximum length: 32 characters." 9422 ) }) 9423 ] }), 9424 isValid: { 9425 required: true, 9426 pattern: "^[a-z0-9_\\-]{1,32}$", 9427 custom: async (value) => { 9428 const slug = value.slug; 9429 if (originalSlug !== void 0 && slug === originalSlug) { 9430 return null; 9431 } 9432 const slugTaken = (registeredTaxonomies ?? []).some( 9433 (t) => t.slug === slug 9434 ); 9435 if (slugTaken) { 9436 return (0, import_i18n5.__)("This taxonomy key is already in use."); 9437 } 9438 const drafts = await (0, import_data2.resolveSelect)( 9439 import_core_data2.store 9440 ).getEntityRecords("postType", "wp_user_taxonomy", { 9441 slug, 9442 status: "draft", 9443 _fields: "id,name", 9444 per_page: 1 9445 }); 9446 return !!drafts?.length ? (0, import_i18n5.__)("This taxonomy key is already in use.") : null; 9447 } 9448 }, 9449 filterBy: false, 9450 enableSorting: false 9451 }), 9452 [registeredTaxonomies, originalSlug, showRenameWarning] 9453 ); 9454 } 9455 function useObjectTypeField() { 9456 const publicPostTypes = usePublicPostTypes(); 9457 return (0, import_element28.useMemo)(() => { 9458 const elements = (publicPostTypes ?? []).map((pt) => ({ 9459 value: pt.slug, 9460 label: pt.name 9461 })); 9462 const labelMap = Object.fromEntries( 9463 elements.map((e) => [e.value, e.label]) 9464 ); 9465 return { 9466 id: "object_type", 9467 label: (0, import_i18n5.__)("Post types"), 9468 type: "array", 9469 description: (0, import_i18n5.__)( 9470 "One or more post types with which the taxonomy should be associated." 9471 ), 9472 elements, 9473 enableSorting: false, 9474 getValue: ({ item }) => item.config.object_type, 9475 setValue: ({ item, value }) => ({ 9476 config: { 9477 ...item.config, 9478 object_type: Array.isArray(value) ? value : [] 9479 } 9480 }), 9481 render: ({ item }) => { 9482 const slugs = item.config.object_type; 9483 if (!slugs || slugs.length === 0) { 9484 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)("span", { "aria-hidden": "true", children: "\u2014" }); 9485 } 9486 return /* @__PURE__ */ (0, import_jsx_runtime34.jsx)(import_jsx_runtime34.Fragment, { children: slugs.map((s) => labelMap[s] ?? s).join(", ") }); 9487 }, 9488 isValid: { required: true }, 9489 filterBy: { operators: ["isAny"] } 9490 }; 9491 }, [publicPostTypes]); 9492 } 9493 var defaultForm = { 9494 layout: { type: "regular" }, 9495 fields: [ 9496 "plural_name", 9497 "singular_name", 9498 "slug", 9499 "object_type", 9500 "public", 9501 "hierarchical", 9502 "status" 9503 ] 9504 }; 9505 var generalForm = { 9506 layout: { type: "regular" }, 9507 fields: [ 9508 "plural_name", 9509 "singular_name", 9510 "slug", 9511 "description", 9512 "object_type", 9513 "public", 9514 "hierarchical", 9515 "status" 9516 ] 9517 }; 9518 9519 // packages/user-taxonomies/build-module/fields/labels.mjs 9520 var import_components = __toESM(require_components(), 1); 9521 var import_i18n6 = __toESM(require_i18n(), 1); 9522 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); 9523 function labelField(id, label, options = {}) { 9524 const field = { 9525 id, 9526 label, 9527 type: "text", 9528 placeholder: options.placeholder, 9529 description: options.description, 9530 getValue: ({ item }) => item.config.labels[id] ?? "", 9531 setValue: ({ item, value }) => ({ 9532 config: { 9533 ...item.config, 9534 labels: { 9535 ...item.config.labels, 9536 [id]: String(value ?? "") 9537 } 9538 } 9539 }), 9540 isValid: { maxLength: 200 }, 9541 enableSorting: false 9542 }; 9543 if (options.isVisible) { 9544 field.isVisible = options.isVisible; 9545 } 9546 return field; 9547 } 9548 var menuNameField = labelField("menu_name", (0, import_i18n6.__)("Menu name"), { 9549 placeholder: (0, import_i18n6.__)("Categories"), 9550 description: (0, import_i18n6.__)("Defaults to the plural label.") 9551 }); 9552 var allItemsField = labelField("all_items", (0, import_i18n6.__)("All items"), { 9553 placeholder: (0, import_i18n6.__)("All Categories") 9554 }); 9555 var editItemField = labelField("edit_item", (0, import_i18n6.__)("Edit item"), { 9556 placeholder: (0, import_i18n6.__)("Edit Category") 9557 }); 9558 var viewItemField = labelField("view_item", (0, import_i18n6.__)("View item"), { 9559 placeholder: (0, import_i18n6.__)("View Category") 9560 }); 9561 var updateItemField = labelField("update_item", (0, import_i18n6.__)("Update item"), { 9562 placeholder: (0, import_i18n6.__)("Update Category") 9563 }); 9564 var addNewItemLabelField = labelField( 9565 "add_new_item", 9566 (0, import_i18n6.__)("Add new item"), 9567 { 9568 placeholder: (0, import_i18n6.__)("Add New Category") 9569 } 9570 ); 9571 var newItemNameField = labelField( 9572 "new_item_name", 9573 (0, import_i18n6.__)("New item name"), 9574 { 9575 placeholder: (0, import_i18n6.__)("New Category Name") 9576 } 9577 ); 9578 var searchItemsField = labelField( 9579 "search_items", 9580 (0, import_i18n6.__)("Search items"), 9581 { 9582 placeholder: (0, import_i18n6.__)("Search Categories") 9583 } 9584 ); 9585 var notFoundField = labelField("not_found", (0, import_i18n6.__)("Not found"), { 9586 placeholder: (0, import_i18n6.__)("No categories found."), 9587 description: (0, import_i18n6.__)( 9588 "The text displayed when no terms are available in the term meta box and tag cloud." 9589 ) 9590 }); 9591 var backToItemsField = labelField( 9592 "back_to_items", 9593 (0, import_i18n6.__)("Back to items"), 9594 { 9595 placeholder: (0, import_i18n6.__)("\u2190 Back to Categories"), 9596 description: (0, import_i18n6.__)("Label displayed after a term has been updated.") 9597 } 9598 ); 9599 var parentItemField = labelField("parent_item", (0, import_i18n6.__)("Parent item"), { 9600 placeholder: (0, import_i18n6.__)("Parent Category"), 9601 description: (0, import_i18n6.__)("Not used on non-hierarchical taxonomies."), 9602 isVisible: (item) => item.config.hierarchical 9603 }); 9604 var popularItemsField = labelField( 9605 "popular_items", 9606 (0, import_i18n6.__)("Popular items"), 9607 { 9608 placeholder: (0, import_i18n6.__)("Popular Tags"), 9609 description: (0, import_i18n6.__)( 9610 "The popular items text. Not used on hierarchical taxonomies." 9611 ), 9612 isVisible: (item) => !item.config.hierarchical 9613 } 9614 ); 9615 var separateItemsField = labelField( 9616 "separate_items_with_commas", 9617 (0, import_i18n6.__)("Separate items with commas"), 9618 { 9619 placeholder: (0, import_i18n6.__)("Separate tags with commas"), 9620 description: (0, import_i18n6.__)( 9621 "Shown in the taxonomy meta box. Not used on hierarchical taxonomies." 9622 ), 9623 isVisible: (item) => !item.config.hierarchical 9624 } 9625 ); 9626 var parentItemColonField = labelField( 9627 "parent_item_colon", 9628 (0, import_i18n6.__)("Parent item with colon"), 9629 { 9630 placeholder: (0, import_i18n6.__)("Parent Category:"), 9631 description: (0, import_i18n6.__)("Same as Parent item, with a colon at the end."), 9632 isVisible: (item) => item.config.hierarchical 9633 } 9634 ); 9635 var addOrRemoveItemsField = labelField( 9636 "add_or_remove_items", 9637 (0, import_i18n6.__)("Add or remove items"), 9638 { 9639 placeholder: (0, import_i18n6.__)("Add or remove tags"), 9640 description: (0, import_i18n6.__)( 9641 "Shown in the meta box when JavaScript is disabled. Not used on hierarchical taxonomies." 9642 ), 9643 isVisible: (item) => !item.config.hierarchical 9644 } 9645 ); 9646 var chooseFromMostUsedField = labelField( 9647 "choose_from_most_used", 9648 (0, import_i18n6.__)("Choose from the most used"), 9649 { 9650 placeholder: (0, import_i18n6.__)("Choose from the most used tags"), 9651 description: (0, import_i18n6.__)( 9652 "Shown in the taxonomy meta box. Not used on hierarchical taxonomies." 9653 ), 9654 isVisible: (item) => !item.config.hierarchical 9655 } 9656 ); 9657 function LabelsActionsEdit({ 9658 data, 9659 onChange 9660 }) { 9661 const plural = data.title.raw.trim(); 9662 const singular = data.config.labels.singular_name.trim(); 9663 const canAutoFill = !!plural.length && !!singular.length; 9664 const hasOverrides = STRING_LABEL_KEYS.some( 9665 (key) => key !== "singular_name" && (data.config.labels[key] ?? "") !== "" 9666 ); 9667 return /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Stack, { direction: "column", gap: "md", children: [ 9668 /* @__PURE__ */ (0, import_jsx_runtime35.jsx)(Text, { variant: "body-md", className: "taxonomy-form__help-text", children: (0, import_i18n6.__)( 9669 "Override the text WordPress shows in admin lists, menus, and forms. Auto-fill replaces every label below with values derived from the current plural and singular names \u2014 including any you have already customized. Clearing removes all overrides so WordPress falls back to its defaults. If you rename the taxonomy after auto-filling, click Auto-fill again to keep them in sync." 9670 ) }), 9671 /* @__PURE__ */ (0, import_jsx_runtime35.jsxs)(Stack, { direction: "row", justify: "flex-end", gap: "sm", children: [ 9672 /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 9673 import_components.Button, 9674 { 9675 __next40pxDefaultSize: true, 9676 variant: "secondary", 9677 size: "compact", 9678 accessibleWhenDisabled: true, 9679 disabled: !canAutoFill, 9680 onClick: () => onChange({ 9681 config: { 9682 ...data.config, 9683 labels: { 9684 ...data.config.labels, 9685 ...deriveLabels(plural, singular) 9686 } 9687 } 9688 }), 9689 children: (0, import_i18n6.__)("Auto-fill labels") 9690 } 9691 ), 9692 /* @__PURE__ */ (0, import_jsx_runtime35.jsx)( 9693 import_components.Button, 9694 { 9695 __next40pxDefaultSize: true, 9696 size: "compact", 9697 icon: trash_default, 9698 isDestructive: true, 9699 label: (0, import_i18n6.__)("Clear labels"), 9700 accessibleWhenDisabled: true, 9701 disabled: !hasOverrides, 9702 onClick: () => { 9703 const cleared = { 9704 singular_name: data.config.labels.singular_name 9705 }; 9706 for (const key of STRING_LABEL_KEYS) { 9707 if (key !== "singular_name") { 9708 cleared[key] = ""; 9709 } 9710 } 9711 onChange({ 9712 config: { ...data.config, labels: cleared } 9713 }); 9714 } 9715 } 9716 ) 9717 ] }) 9718 ] }); 9719 } 9720 var labelsActionsField = { 9721 id: "__labels_actions", 9722 label: "", 9723 getValue: () => "", 9724 setValue: () => ({}), 9725 Edit: LabelsActionsEdit, 9726 enableSorting: false, 9727 filterBy: false 9728 }; 9729 var labelsForm = { 9730 layout: { type: "regular" }, 9731 // singular_name lives in the General card, so exclude it here. 9732 fields: [ 9733 { 9734 id: "__labels_actions", 9735 layout: { type: "regular", labelPosition: "none" } 9736 }, 9737 ...STRING_LABEL_KEYS.filter((key) => key !== "singular_name") 9738 ] 9739 }; 9740 9741 // packages/user-taxonomies/build-module/actions/activate.mjs 9742 var import_i18n7 = __toESM(require_i18n(), 1); 9743 9744 // packages/user-taxonomies/build-module/actions/utils.mjs 9745 var import_core_data3 = __toESM(require_core_data(), 1); 9746 var import_notices = __toESM(require_notices(), 1); 9747 function createStatusAction(config) { 9748 const isEligible = (item) => item.status !== config.targetStatus; 9749 return { 9750 id: config.id, 9751 label: config.label, 9752 supportsBulk: true, 9753 isEligible, 9754 async callback(items, { registry }) { 9755 const itemsToUpdate = items.filter(isEligible); 9756 if (itemsToUpdate.length === 0) { 9757 return; 9758 } 9759 const { saveEntityRecord } = registry.dispatch(import_core_data3.store); 9760 const { createSuccessNotice, createErrorNotice } = registry.dispatch(import_notices.store); 9761 const promiseResult = await Promise.allSettled( 9762 itemsToUpdate.map( 9763 (item) => saveEntityRecord( 9764 "postType", 9765 "wp_user_taxonomy", 9766 { id: item.id, status: config.targetStatus }, 9767 { throwOnError: true } 9768 ) 9769 ) 9770 ); 9771 if (promiseResult.every(({ status }) => status === "fulfilled")) { 9772 createSuccessNotice( 9773 itemsToUpdate.length === 1 ? config.messages.successSingle : config.messages.successMany(itemsToUpdate.length), 9774 { type: "snackbar" } 9775 ); 9776 return; 9777 } 9778 let errorMessage; 9779 if (promiseResult.length === 1) { 9780 const typedError = promiseResult[0]; 9781 if (typedError.reason?.message && typedError.reason.code !== "unknown_error") { 9782 errorMessage = typedError.reason.message; 9783 } else { 9784 errorMessage = config.messages.failSingle; 9785 } 9786 } else { 9787 const errorMessages = /* @__PURE__ */ new Set(); 9788 const failedPromises = promiseResult.filter( 9789 ({ status }) => status === "rejected" 9790 ); 9791 for (const failedPromise of failedPromises) { 9792 const typedError = failedPromise; 9793 if (typedError.reason?.message && typedError.reason.code !== "unknown_error") { 9794 errorMessages.add(typedError.reason.message); 9795 } 9796 } 9797 if (errorMessages.size === 0) { 9798 errorMessage = config.messages.failMany; 9799 } else if (errorMessages.size === 1) { 9800 errorMessage = config.messages.errorSingle( 9801 [...errorMessages][0] 9802 ); 9803 } else { 9804 errorMessage = config.messages.errorMany( 9805 [...errorMessages].join(",") 9806 ); 9807 } 9808 } 9809 createErrorNotice(errorMessage, { type: "snackbar" }); 9810 } 9811 }; 9812 } 9813 9814 // packages/user-taxonomies/build-module/actions/activate.mjs 9815 var activateAction = createStatusAction({ 9816 id: "activate", 9817 label: (0, import_i18n7.__)("Activate"), 9818 targetStatus: "publish", 9819 messages: { 9820 successSingle: (0, import_i18n7.__)("Taxonomy activated."), 9821 successMany: (count) => (0, import_i18n7.sprintf)( 9822 /* translators: %d: The number of taxonomies. */ 9823 (0, import_i18n7._n)( 9824 "%d taxonomy activated.", 9825 "%d taxonomies activated.", 9826 count 9827 ), 9828 count 9829 ), 9830 failSingle: (0, import_i18n7.__)("Failed to activate taxonomy."), 9831 failMany: (0, import_i18n7.__)("Failed to activate taxonomies."), 9832 errorSingle: (message) => (0, import_i18n7.sprintf)( 9833 /* translators: %s: an error message */ 9834 (0, import_i18n7.__)("An error occurred while activating the taxonomy: %s"), 9835 message 9836 ), 9837 errorMany: (messages) => (0, import_i18n7.sprintf)( 9838 /* translators: %s: a list of comma separated error messages */ 9839 (0, import_i18n7.__)( 9840 "Some errors occurred while activating the taxonomies: %s" 9841 ), 9842 messages 9843 ) 9844 } 9845 }); 9846 var activate_default = activateAction; 9847 9848 // packages/user-taxonomies/build-module/actions/deactivate.mjs 9849 var import_i18n8 = __toESM(require_i18n(), 1); 9850 var deactivateAction = createStatusAction({ 9851 id: "deactivate", 9852 label: (0, import_i18n8.__)("Deactivate"), 9853 targetStatus: "draft", 9854 messages: { 9855 successSingle: (0, import_i18n8.__)("Taxonomy deactivated."), 9856 successMany: (count) => (0, import_i18n8.sprintf)( 9857 /* translators: %d: The number of taxonomies. */ 9858 (0, import_i18n8._n)( 9859 "%d taxonomy deactivated.", 9860 "%d taxonomies deactivated.", 9861 count 9862 ), 9863 count 9864 ), 9865 failSingle: (0, import_i18n8.__)("Failed to deactivate taxonomy."), 9866 failMany: (0, import_i18n8.__)("Failed to deactivate taxonomies."), 9867 errorSingle: (message) => (0, import_i18n8.sprintf)( 9868 /* translators: %s: an error message */ 9869 (0, import_i18n8.__)("An error occurred while deactivating the taxonomy: %s"), 9870 message 9871 ), 9872 errorMany: (messages) => (0, import_i18n8.sprintf)( 9873 /* translators: %s: a list of comma separated error messages */ 9874 (0, import_i18n8.__)( 9875 "Some errors occurred while deactivating the taxonomies: %s" 9876 ), 9877 messages 9878 ) 9879 } 9880 }); 9881 var deactivate_default = deactivateAction; 9882 9883 // packages/user-taxonomies/build-module/actions/delete.mjs 9884 var import_components2 = __toESM(require_components(), 1); 9885 var import_core_data4 = __toESM(require_core_data(), 1); 9886 var import_data3 = __toESM(require_data(), 1); 9887 var import_element29 = __toESM(require_element(), 1); 9888 var import_i18n9 = __toESM(require_i18n(), 1); 9889 var import_notices2 = __toESM(require_notices(), 1); 9890 var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); 9891 function DeleteTaxonomyModal({ 9892 items, 9893 closeModal, 9894 onActionPerformed 9895 }) { 9896 const [isDeleting, setIsDeleting] = (0, import_element29.useState)(false); 9897 const { deleteEntityRecord } = (0, import_data3.useDispatch)(import_core_data4.store); 9898 const { createSuccessNotice, createErrorNotice } = (0, import_data3.useDispatch)(import_notices2.store); 9899 async function onDelete() { 9900 if (isDeleting) { 9901 return; 9902 } 9903 setIsDeleting(true); 9904 const itemsToDelete = items.filter((item) => item.id !== void 0); 9905 const promiseResult = await Promise.allSettled( 9906 itemsToDelete.map( 9907 (item) => deleteEntityRecord( 9908 "postType", 9909 "wp_user_taxonomy", 9910 item.id, 9911 { force: true }, 9912 { throwOnError: true } 9913 ) 9914 ) 9915 ); 9916 if (promiseResult.every(({ status }) => status === "fulfilled")) { 9917 createSuccessNotice( 9918 itemsToDelete.length === 1 ? (0, import_i18n9.sprintf)( 9919 /* translators: %s: The taxonomy's plural label. */ 9920 (0, import_i18n9.__)('"%s" taxonomy deleted.'), 9921 itemsToDelete[0].title.raw 9922 ) : (0, import_i18n9.sprintf)( 9923 /* translators: %d: The number of taxonomies. */ 9924 (0, import_i18n9._n)( 9925 "%d taxonomy deleted.", 9926 "%d taxonomies deleted.", 9927 itemsToDelete.length 9928 ), 9929 itemsToDelete.length 9930 ), 9931 { type: "snackbar" } 9932 ); 9933 } else { 9934 let errorMessage; 9935 if (promiseResult.length === 1) { 9936 const typedError = promiseResult[0]; 9937 if (typedError.reason?.message && typedError.reason.code !== "unknown_error") { 9938 errorMessage = typedError.reason.message; 9939 } else { 9940 errorMessage = (0, import_i18n9.__)("Failed to delete taxonomy."); 9941 } 9942 } else { 9943 const errorMessages = /* @__PURE__ */ new Set(); 9944 const failedPromises = promiseResult.filter( 9945 ({ status }) => status === "rejected" 9946 ); 9947 for (const failedPromise of failedPromises) { 9948 const typedError = failedPromise; 9949 if (typedError.reason?.message && typedError.reason.code !== "unknown_error") { 9950 errorMessages.add(typedError.reason.message); 9951 } 9952 } 9953 if (errorMessages.size === 0) { 9954 errorMessage = (0, import_i18n9.__)("Failed to delete taxonomies."); 9955 } else if (errorMessages.size === 1) { 9956 errorMessage = (0, import_i18n9.sprintf)( 9957 /* translators: %s: an error message */ 9958 (0, import_i18n9.__)( 9959 "An error occurred while deleting the taxonomy: %s" 9960 ), 9961 [...errorMessages][0] 9962 ); 9963 } else { 9964 errorMessage = (0, import_i18n9.sprintf)( 9965 /* translators: %s: a list of comma separated error messages */ 9966 (0, import_i18n9.__)( 9967 "Some errors occurred while deleting the taxonomies: %s" 9968 ), 9969 [...errorMessages].join(",") 9970 ); 9971 } 9972 } 9973 createErrorNotice(errorMessage, { type: "snackbar" }); 9974 } 9975 onActionPerformed?.(itemsToDelete); 9976 setIsDeleting(false); 9977 closeModal?.(); 9978 } 9979 return /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Stack, { direction: "column", gap: "md", children: [ 9980 /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(Text, { children: items.length > 1 ? (0, import_i18n9.sprintf)( 9981 /* translators: %d: number of taxonomies to delete. */ 9982 (0, import_i18n9._n)( 9983 "Are you sure you want to delete %d taxonomy?", 9984 "Are you sure you want to delete %d taxonomies?", 9985 items.length 9986 ), 9987 items.length 9988 ) : (0, import_i18n9.sprintf)( 9989 /* translators: %s: The taxonomy's plural label. */ 9990 (0, import_i18n9.__)('Are you sure you want to delete "%s"?'), 9991 items[0].title.raw 9992 ) }), 9993 /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(Stack, { direction: "row", justify: "flex-end", gap: "sm", children: [ 9994 /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 9995 import_components2.Button, 9996 { 9997 __next40pxDefaultSize: true, 9998 variant: "tertiary", 9999 onClick: closeModal, 10000 disabled: isDeleting, 10001 accessibleWhenDisabled: true, 10002 children: (0, import_i18n9.__)("Cancel") 10003 } 10004 ), 10005 /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 10006 import_components2.Button, 10007 { 10008 __next40pxDefaultSize: true, 10009 variant: "primary", 10010 isDestructive: true, 10011 isBusy: isDeleting, 10012 disabled: isDeleting, 10013 accessibleWhenDisabled: true, 10014 onClick: onDelete, 10015 children: (0, import_i18n9._x)("Delete", "verb") 10016 } 10017 ) 10018 ] }) 10019 ] }); 10020 } 10021 var deleteTaxonomyAction = { 10022 id: "delete-taxonomy", 10023 label: (0, import_i18n9._x)("Delete", "verb"), 10024 icon: trash_default, 10025 supportsBulk: true, 10026 hideModalHeader: true, 10027 modalFocusOnMount: "firstContentElement", 10028 modalSize: "small", 10029 RenderModal: DeleteTaxonomyModal 10030 }; 10031 var delete_default = deleteTaxonomyAction; 10032 export { 10033 BLANK_RECORD, 10034 activate_default as activateAction, 10035 addNewItemLabelField, 10036 addOrRemoveItemsField, 10037 allItemsField, 10038 backToItemsField, 10039 chooseFromMostUsedField, 10040 createStatusAction, 10041 deactivate_default as deactivateAction, 10042 defaultForm, 10043 delete_default as deleteTaxonomyAction, 10044 descriptionField, 10045 editItemField, 10046 generalForm, 10047 hierarchicalField, 10048 labelsActionsField, 10049 labelsForm, 10050 menuNameField, 10051 newItemNameField, 10052 notFoundField, 10053 parentItemColonField, 10054 parentItemField, 10055 pluralLabelField, 10056 popularItemsField, 10057 publicField, 10058 searchItemsField, 10059 separateItemsField, 10060 serializeForSave, 10061 singularLabelField, 10062 statusField, 10063 titleField, 10064 toFormData, 10065 updateItemField, 10066 useObjectTypeField, 10067 usePublicPostTypes, 10068 useSlugField, 10069 viewItemField 10070 }; 10071 /*! Bundled license information: 10072 10073 use-sync-external-store/cjs/use-sync-external-store-shim.development.js: 10074 (** 10075 * @license React 10076 * use-sync-external-store-shim.development.js 10077 * 10078 * Copyright (c) Meta Platforms, Inc. and affiliates. 10079 * 10080 * This source code is licensed under the MIT license found in the 10081 * LICENSE file in the root directory of this source tree. 10082 *) 10083 10084 use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js: 10085 (** 10086 * @license React 10087 * use-sync-external-store-shim/with-selector.development.js 10088 * 10089 * Copyright (c) Meta Platforms, Inc. and affiliates. 10090 * 10091 * This source code is licensed under the MIT license found in the 10092 * LICENSE file in the root directory of this source tree. 10093 *) 10094 */
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Tue Jun 30 08:20:12 2026 | Cross-referenced by PHPXref |