| [ 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 __require = /* @__PURE__ */ ((x2) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x2, { 8 get: (a2, b2) => (typeof require !== "undefined" ? require : a2)[b2] 9 }) : x2)(function(x2) { 10 if (typeof require !== "undefined") return require.apply(this, arguments); 11 throw Error('Dynamic require of "' + x2 + '" is not supported'); 12 }); 13 var __commonJS = (cb, mod) => function __require4() { 14 return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; 15 }; 16 var __export = (target, all) => { 17 for (var name2 in all) 18 __defProp(target, name2, { get: all[name2], enumerable: true }); 19 }; 20 var __copyProps = (to, from, except, desc) => { 21 if (from && typeof from === "object" || typeof from === "function") { 22 for (let key of __getOwnPropNames(from)) 23 if (!__hasOwnProp.call(to, key) && key !== except) 24 __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); 25 } 26 return to; 27 }; 28 var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( 29 // If the importer is in node compatibility mode or this is not an ESM 30 // file that has been converted to a CommonJS file using a Babel- 31 // compatible transform (i.e. "__esModule" has not been set), then set 32 // "default" to the CommonJS "module.exports" for node compatibility. 33 isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, 34 mod 35 )); 36 37 // package-external:@wordpress/i18n 38 var require_i18n = __commonJS({ 39 "package-external:@wordpress/i18n"(exports, module) { 40 module.exports = window.wp.i18n; 41 } 42 }); 43 44 // package-external:@wordpress/element 45 var require_element = __commonJS({ 46 "package-external:@wordpress/element"(exports, module) { 47 module.exports = window.wp.element; 48 } 49 }); 50 51 // vendor-external:react 52 var require_react = __commonJS({ 53 "vendor-external:react"(exports, module) { 54 module.exports = window.React; 55 } 56 }); 57 58 // vendor-external:react/jsx-runtime 59 var require_jsx_runtime = __commonJS({ 60 "vendor-external:react/jsx-runtime"(exports, module) { 61 module.exports = window.ReactJSXRuntime; 62 } 63 }); 64 65 // vendor-external:react-dom 66 var require_react_dom = __commonJS({ 67 "vendor-external:react-dom"(exports, module) { 68 module.exports = window.ReactDOM; 69 } 70 }); 71 72 // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js 73 var require_use_sync_external_store_shim_development = __commonJS({ 74 "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { 75 "use strict"; 76 (function() { 77 function is(x2, y2) { 78 return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; 79 } 80 function useSyncExternalStore$2(subscribe, getSnapshot) { 81 didWarnOld18Alpha || void 0 === React48.startTransition || (didWarnOld18Alpha = true, console.error( 82 "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." 83 )); 84 var value = getSnapshot(); 85 if (!didWarnUncachedGetSnapshot) { 86 var cachedValue = getSnapshot(); 87 objectIs(value, cachedValue) || (console.error( 88 "The result of getSnapshot should be cached to avoid an infinite loop" 89 ), didWarnUncachedGetSnapshot = true); 90 } 91 cachedValue = useState29({ 92 inst: { value, getSnapshot } 93 }); 94 var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; 95 useLayoutEffect4( 96 function() { 97 inst.value = value; 98 inst.getSnapshot = getSnapshot; 99 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 100 }, 101 [subscribe, value, getSnapshot] 102 ); 103 useEffect20( 104 function() { 105 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 106 return subscribe(function() { 107 checkIfSnapshotChanged(inst) && forceUpdate({ inst }); 108 }); 109 }, 110 [subscribe] 111 ); 112 useDebugValue2(value); 113 return value; 114 } 115 function checkIfSnapshotChanged(inst) { 116 var latestGetSnapshot = inst.getSnapshot; 117 inst = inst.value; 118 try { 119 var nextValue = latestGetSnapshot(); 120 return !objectIs(inst, nextValue); 121 } catch (error) { 122 return true; 123 } 124 } 125 function useSyncExternalStore$1(subscribe, getSnapshot) { 126 return getSnapshot(); 127 } 128 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 129 var React48 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState29 = React48.useState, useEffect20 = React48.useEffect, useLayoutEffect4 = React48.useLayoutEffect, useDebugValue2 = React48.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; 130 exports.useSyncExternalStore = void 0 !== React48.useSyncExternalStore ? React48.useSyncExternalStore : shim; 131 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 132 })(); 133 } 134 }); 135 136 // node_modules/use-sync-external-store/shim/index.js 137 var require_shim = __commonJS({ 138 "node_modules/use-sync-external-store/shim/index.js"(exports, module) { 139 "use strict"; 140 if (false) { 141 module.exports = null; 142 } else { 143 module.exports = require_use_sync_external_store_shim_development(); 144 } 145 } 146 }); 147 148 // node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js 149 var require_with_selector_development = __commonJS({ 150 "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js"(exports) { 151 "use strict"; 152 (function() { 153 function is(x2, y2) { 154 return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; 155 } 156 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); 157 var React48 = require_react(), shim = require_shim(), objectIs = "function" === typeof Object.is ? Object.is : is, useSyncExternalStore2 = shim.useSyncExternalStore, useRef23 = React48.useRef, useEffect20 = React48.useEffect, useMemo29 = React48.useMemo, useDebugValue2 = React48.useDebugValue; 158 exports.useSyncExternalStoreWithSelector = function(subscribe, getSnapshot, getServerSnapshot, selector, isEqual) { 159 var instRef = useRef23(null); 160 if (null === instRef.current) { 161 var inst = { hasValue: false, value: null }; 162 instRef.current = inst; 163 } else inst = instRef.current; 164 instRef = useMemo29( 165 function() { 166 function memoizedSelector(nextSnapshot) { 167 if (!hasMemo) { 168 hasMemo = true; 169 memoizedSnapshot = nextSnapshot; 170 nextSnapshot = selector(nextSnapshot); 171 if (void 0 !== isEqual && inst.hasValue) { 172 var currentSelection = inst.value; 173 if (isEqual(currentSelection, nextSnapshot)) 174 return memoizedSelection = currentSelection; 175 } 176 return memoizedSelection = nextSnapshot; 177 } 178 currentSelection = memoizedSelection; 179 if (objectIs(memoizedSnapshot, nextSnapshot)) 180 return currentSelection; 181 var nextSelection = selector(nextSnapshot); 182 if (void 0 !== isEqual && isEqual(currentSelection, nextSelection)) 183 return memoizedSnapshot = nextSnapshot, currentSelection; 184 memoizedSnapshot = nextSnapshot; 185 return memoizedSelection = nextSelection; 186 } 187 var hasMemo = false, memoizedSnapshot, memoizedSelection, maybeGetServerSnapshot = void 0 === getServerSnapshot ? null : getServerSnapshot; 188 return [ 189 function() { 190 return memoizedSelector(getSnapshot()); 191 }, 192 null === maybeGetServerSnapshot ? void 0 : function() { 193 return memoizedSelector(maybeGetServerSnapshot()); 194 } 195 ]; 196 }, 197 [getSnapshot, getServerSnapshot, selector, isEqual] 198 ); 199 var value = useSyncExternalStore2(subscribe, instRef[0], instRef[1]); 200 useEffect20( 201 function() { 202 inst.hasValue = true; 203 inst.value = value; 204 }, 205 [value] 206 ); 207 useDebugValue2(value); 208 return value; 209 }; 210 "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); 211 })(); 212 } 213 }); 214 215 // node_modules/use-sync-external-store/shim/with-selector.js 216 var require_with_selector = __commonJS({ 217 "node_modules/use-sync-external-store/shim/with-selector.js"(exports, module) { 218 "use strict"; 219 if (false) { 220 module.exports = null; 221 } else { 222 module.exports = require_with_selector_development(); 223 } 224 } 225 }); 226 227 // package-external:@wordpress/primitives 228 var require_primitives = __commonJS({ 229 "package-external:@wordpress/primitives"(exports, module) { 230 module.exports = window.wp.primitives; 231 } 232 }); 233 234 // package-external:@wordpress/compose 235 var require_compose = __commonJS({ 236 "package-external:@wordpress/compose"(exports, module) { 237 module.exports = window.wp.compose; 238 } 239 }); 240 241 // package-external:@wordpress/theme 242 var require_theme = __commonJS({ 243 "package-external:@wordpress/theme"(exports, module) { 244 module.exports = window.wp.theme; 245 } 246 }); 247 248 // package-external:@wordpress/private-apis 249 var require_private_apis = __commonJS({ 250 "package-external:@wordpress/private-apis"(exports, module) { 251 module.exports = window.wp.privateApis; 252 } 253 }); 254 255 // package-external:@wordpress/components 256 var require_components = __commonJS({ 257 "package-external:@wordpress/components"(exports, module) { 258 module.exports = window.wp.components; 259 } 260 }); 261 262 // package-external:@wordpress/editor 263 var require_editor = __commonJS({ 264 "package-external:@wordpress/editor"(exports, module) { 265 module.exports = window.wp.editor; 266 } 267 }); 268 269 // package-external:@wordpress/core-data 270 var require_core_data = __commonJS({ 271 "package-external:@wordpress/core-data"(exports, module) { 272 module.exports = window.wp.coreData; 273 } 274 }); 275 276 // package-external:@wordpress/data 277 var require_data = __commonJS({ 278 "package-external:@wordpress/data"(exports, module) { 279 module.exports = window.wp.data; 280 } 281 }); 282 283 // package-external:@wordpress/blocks 284 var require_blocks = __commonJS({ 285 "package-external:@wordpress/blocks"(exports, module) { 286 module.exports = window.wp.blocks; 287 } 288 }); 289 290 // package-external:@wordpress/block-editor 291 var require_block_editor = __commonJS({ 292 "package-external:@wordpress/block-editor"(exports, module) { 293 module.exports = window.wp.blockEditor; 294 } 295 }); 296 297 // package-external:@wordpress/style-engine 298 var require_style_engine = __commonJS({ 299 "package-external:@wordpress/style-engine"(exports, module) { 300 module.exports = window.wp.styleEngine; 301 } 302 }); 303 304 // node_modules/fast-deep-equal/es6/index.js 305 var require_es6 = __commonJS({ 306 "node_modules/fast-deep-equal/es6/index.js"(exports, module) { 307 "use strict"; 308 module.exports = function equal(a2, b2) { 309 if (a2 === b2) return true; 310 if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { 311 if (a2.constructor !== b2.constructor) return false; 312 var length, i2, keys; 313 if (Array.isArray(a2)) { 314 length = a2.length; 315 if (length != b2.length) return false; 316 for (i2 = length; i2-- !== 0; ) 317 if (!equal(a2[i2], b2[i2])) return false; 318 return true; 319 } 320 if (a2 instanceof Map && b2 instanceof Map) { 321 if (a2.size !== b2.size) return false; 322 for (i2 of a2.entries()) 323 if (!b2.has(i2[0])) return false; 324 for (i2 of a2.entries()) 325 if (!equal(i2[1], b2.get(i2[0]))) return false; 326 return true; 327 } 328 if (a2 instanceof Set && b2 instanceof Set) { 329 if (a2.size !== b2.size) return false; 330 for (i2 of a2.entries()) 331 if (!b2.has(i2[0])) return false; 332 return true; 333 } 334 if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { 335 length = a2.length; 336 if (length != b2.length) return false; 337 for (i2 = length; i2-- !== 0; ) 338 if (a2[i2] !== b2[i2]) return false; 339 return true; 340 } 341 if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; 342 if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); 343 if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); 344 keys = Object.keys(a2); 345 length = keys.length; 346 if (length !== Object.keys(b2).length) return false; 347 for (i2 = length; i2-- !== 0; ) 348 if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; 349 for (i2 = length; i2-- !== 0; ) { 350 var key = keys[i2]; 351 if (!equal(a2[key], b2[key])) return false; 352 } 353 return true; 354 } 355 return a2 !== a2 && b2 !== b2; 356 }; 357 } 358 }); 359 360 // node_modules/deepmerge/dist/cjs.js 361 var require_cjs = __commonJS({ 362 "node_modules/deepmerge/dist/cjs.js"(exports, module) { 363 "use strict"; 364 var isMergeableObject = function isMergeableObject2(value) { 365 return isNonNullObject(value) && !isSpecial(value); 366 }; 367 function isNonNullObject(value) { 368 return !!value && typeof value === "object"; 369 } 370 function isSpecial(value) { 371 var stringValue = Object.prototype.toString.call(value); 372 return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); 373 } 374 var canUseSymbol = typeof Symbol === "function" && Symbol.for; 375 var REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; 376 function isReactElement(value) { 377 return value.$$typeof === REACT_ELEMENT_TYPE; 378 } 379 function emptyTarget(val) { 380 return Array.isArray(val) ? [] : {}; 381 } 382 function cloneUnlessOtherwiseSpecified(value, options) { 383 return options.clone !== false && options.isMergeableObject(value) ? deepmerge2(emptyTarget(value), value, options) : value; 384 } 385 function defaultArrayMerge(target, source, options) { 386 return target.concat(source).map(function(element) { 387 return cloneUnlessOtherwiseSpecified(element, options); 388 }); 389 } 390 function getMergeFunction(key, options) { 391 if (!options.customMerge) { 392 return deepmerge2; 393 } 394 var customMerge = options.customMerge(key); 395 return typeof customMerge === "function" ? customMerge : deepmerge2; 396 } 397 function getEnumerableOwnPropertySymbols(target) { 398 return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol) { 399 return Object.propertyIsEnumerable.call(target, symbol); 400 }) : []; 401 } 402 function getKeys(target) { 403 return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); 404 } 405 function propertyIsOnObject(object, property) { 406 try { 407 return property in object; 408 } catch (_) { 409 return false; 410 } 411 } 412 function propertyIsUnsafe(target, key) { 413 return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); 414 } 415 function mergeObject(target, source, options) { 416 var destination = {}; 417 if (options.isMergeableObject(target)) { 418 getKeys(target).forEach(function(key) { 419 destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); 420 }); 421 } 422 getKeys(source).forEach(function(key) { 423 if (propertyIsUnsafe(target, key)) { 424 return; 425 } 426 if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { 427 destination[key] = getMergeFunction(key, options)(target[key], source[key], options); 428 } else { 429 destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); 430 } 431 }); 432 return destination; 433 } 434 function deepmerge2(target, source, options) { 435 options = options || {}; 436 options.arrayMerge = options.arrayMerge || defaultArrayMerge; 437 options.isMergeableObject = options.isMergeableObject || isMergeableObject; 438 options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; 439 var sourceIsArray = Array.isArray(source); 440 var targetIsArray = Array.isArray(target); 441 var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; 442 if (!sourceAndTargetTypesMatch) { 443 return cloneUnlessOtherwiseSpecified(source, options); 444 } else if (sourceIsArray) { 445 return options.arrayMerge(target, source, options); 446 } else { 447 return mergeObject(target, source, options); 448 } 449 } 450 deepmerge2.all = function deepmergeAll(array, options) { 451 if (!Array.isArray(array)) { 452 throw new Error("first argument should be an array"); 453 } 454 return array.reduce(function(prev, next) { 455 return deepmerge2(prev, next, options); 456 }, {}); 457 }; 458 var deepmerge_1 = deepmerge2; 459 module.exports = deepmerge_1; 460 } 461 }); 462 463 // package-external:@wordpress/keycodes 464 var require_keycodes = __commonJS({ 465 "package-external:@wordpress/keycodes"(exports, module) { 466 module.exports = window.wp.keycodes; 467 } 468 }); 469 470 // package-external:@wordpress/api-fetch 471 var require_api_fetch = __commonJS({ 472 "package-external:@wordpress/api-fetch"(exports, module) { 473 module.exports = window.wp.apiFetch; 474 } 475 }); 476 477 // package-external:@wordpress/date 478 var require_date = __commonJS({ 479 "package-external:@wordpress/date"(exports, module) { 480 module.exports = window.wp.date; 481 } 482 }); 483 484 // node_modules/clsx/dist/clsx.mjs 485 function r(e2) { 486 var t3, f2, n2 = ""; 487 if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; 488 else if ("object" == typeof e2) if (Array.isArray(e2)) { 489 var o3 = e2.length; 490 for (t3 = 0; t3 < o3; t3++) e2[t3] && (f2 = r(e2[t3])) && (n2 && (n2 += " "), n2 += f2); 491 } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); 492 return n2; 493 } 494 function clsx() { 495 for (var e2, t3, f2 = 0, n2 = "", o3 = arguments.length; f2 < o3; f2++) (e2 = arguments[f2]) && (t3 = r(e2)) && (n2 && (n2 += " "), n2 += t3); 496 return n2; 497 } 498 var clsx_default = clsx; 499 500 // node_modules/@base-ui/utils/esm/safeReact.js 501 var React2 = __toESM(require_react(), 1); 502 var SafeReact = { 503 ...React2 504 }; 505 506 // node_modules/@base-ui/utils/esm/useRefWithInit.js 507 var React3 = __toESM(require_react(), 1); 508 var UNINITIALIZED = {}; 509 function useRefWithInit(init, initArg) { 510 const ref = React3.useRef(UNINITIALIZED); 511 if (ref.current === UNINITIALIZED) { 512 ref.current = init(initArg); 513 } 514 return ref; 515 } 516 517 // node_modules/@base-ui/utils/esm/useStableCallback.js 518 var useInsertionEffect = SafeReact.useInsertionEffect; 519 var useSafeInsertionEffect = ( 520 // React 17 doesn't have useInsertionEffect. 521 useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. 522 useInsertionEffect !== SafeReact.useLayoutEffect ? useInsertionEffect : (fn) => fn() 523 ); 524 function useStableCallback(callback) { 525 const stable = useRefWithInit(createStableCallback).current; 526 stable.next = callback; 527 useSafeInsertionEffect(stable.effect); 528 return stable.trampoline; 529 } 530 function createStableCallback() { 531 const stable = { 532 next: void 0, 533 callback: assertNotCalled, 534 trampoline: (...args) => stable.callback?.(...args), 535 effect: () => { 536 stable.callback = stable.next; 537 } 538 }; 539 return stable; 540 } 541 function assertNotCalled() { 542 if (true) { 543 throw ( 544 /* minify-error-disabled */ 545 new Error("Base UI: Cannot call an event handler while rendering.") 546 ); 547 } 548 } 549 550 // node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js 551 var React4 = __toESM(require_react(), 1); 552 var noop = () => { 553 }; 554 var useIsoLayoutEffect = typeof document !== "undefined" ? React4.useLayoutEffect : noop; 555 556 // node_modules/@base-ui/utils/esm/warn.js 557 var set; 558 if (true) { 559 set = /* @__PURE__ */ new Set(); 560 } 561 function warn(...messages) { 562 if (true) { 563 const messageKey = messages.join(" "); 564 if (!set.has(messageKey)) { 565 set.add(messageKey); 566 console.warn(`Base UI: $messageKey}`); 567 } 568 } 569 } 570 571 // node_modules/@base-ui/react/esm/internals/direction-context/DirectionContext.js 572 var React5 = __toESM(require_react(), 1); 573 var DirectionContext = /* @__PURE__ */ React5.createContext(void 0); 574 if (true) DirectionContext.displayName = "DirectionContext"; 575 function useDirection() { 576 const context = React5.useContext(DirectionContext); 577 return context?.direction ?? "ltr"; 578 } 579 580 // node_modules/@base-ui/react/esm/internals/useRenderElement.js 581 var React8 = __toESM(require_react(), 1); 582 583 // node_modules/@base-ui/utils/esm/useMergedRefs.js 584 function useMergedRefs(a2, b2, c2, d2) { 585 const forkRef = useRefWithInit(createForkRef).current; 586 if (didChange(forkRef, a2, b2, c2, d2)) { 587 update(forkRef, [a2, b2, c2, d2]); 588 } 589 return forkRef.callback; 590 } 591 function useMergedRefsN(refs) { 592 const forkRef = useRefWithInit(createForkRef).current; 593 if (didChangeN(forkRef, refs)) { 594 update(forkRef, refs); 595 } 596 return forkRef.callback; 597 } 598 function createForkRef() { 599 return { 600 callback: null, 601 cleanup: null, 602 refs: [] 603 }; 604 } 605 function didChange(forkRef, a2, b2, c2, d2) { 606 return forkRef.refs[0] !== a2 || forkRef.refs[1] !== b2 || forkRef.refs[2] !== c2 || forkRef.refs[3] !== d2; 607 } 608 function didChangeN(forkRef, newRefs) { 609 return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index2) => ref !== newRefs[index2]); 610 } 611 function update(forkRef, refs) { 612 forkRef.refs = refs; 613 if (refs.every((ref) => ref == null)) { 614 forkRef.callback = null; 615 return; 616 } 617 forkRef.callback = (instance) => { 618 if (forkRef.cleanup) { 619 forkRef.cleanup(); 620 forkRef.cleanup = null; 621 } 622 if (instance != null) { 623 const cleanupCallbacks = Array(refs.length).fill(null); 624 for (let i2 = 0; i2 < refs.length; i2 += 1) { 625 const ref = refs[i2]; 626 if (ref == null) { 627 continue; 628 } 629 switch (typeof ref) { 630 case "function": { 631 const refCleanup = ref(instance); 632 if (typeof refCleanup === "function") { 633 cleanupCallbacks[i2] = refCleanup; 634 } 635 break; 636 } 637 case "object": { 638 ref.current = instance; 639 break; 640 } 641 default: 642 } 643 } 644 forkRef.cleanup = () => { 645 for (let i2 = 0; i2 < refs.length; i2 += 1) { 646 const ref = refs[i2]; 647 if (ref == null) { 648 continue; 649 } 650 switch (typeof ref) { 651 case "function": { 652 const cleanupCallback = cleanupCallbacks[i2]; 653 if (typeof cleanupCallback === "function") { 654 cleanupCallback(); 655 } else { 656 ref(null); 657 } 658 break; 659 } 660 case "object": { 661 ref.current = null; 662 break; 663 } 664 default: 665 } 666 } 667 }; 668 } 669 }; 670 } 671 672 // node_modules/@base-ui/utils/esm/getReactElementRef.js 673 var React7 = __toESM(require_react(), 1); 674 675 // node_modules/@base-ui/utils/esm/reactVersion.js 676 var React6 = __toESM(require_react(), 1); 677 var majorVersion = parseInt(React6.version, 10); 678 function isReactVersionAtLeast(reactVersionToCheck) { 679 return majorVersion >= reactVersionToCheck; 680 } 681 682 // node_modules/@base-ui/utils/esm/getReactElementRef.js 683 function getReactElementRef(element) { 684 if (!/* @__PURE__ */ React7.isValidElement(element)) { 685 return null; 686 } 687 const reactElement = element; 688 const propsWithRef = reactElement.props; 689 return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; 690 } 691 692 // node_modules/@base-ui/utils/esm/mergeObjects.js 693 function mergeObjects(a2, b2) { 694 if (a2 && !b2) { 695 return a2; 696 } 697 if (!a2 && b2) { 698 return b2; 699 } 700 if (a2 || b2) { 701 return { 702 ...a2, 703 ...b2 704 }; 705 } 706 return void 0; 707 } 708 709 // node_modules/@base-ui/utils/esm/empty.js 710 function NOOP() { 711 } 712 var EMPTY_ARRAY = Object.freeze([]); 713 var EMPTY_OBJECT = Object.freeze({}); 714 715 // node_modules/@base-ui/react/esm/internals/getStateAttributesProps.js 716 function getStateAttributesProps(state, customMapping) { 717 const props = {}; 718 for (const key in state) { 719 const value = state[key]; 720 if (customMapping?.hasOwnProperty(key)) { 721 const customProps = customMapping[key](value); 722 if (customProps != null) { 723 Object.assign(props, customProps); 724 } 725 continue; 726 } 727 if (value === true) { 728 props[`data-$key.toLowerCase()}`] = ""; 729 } else if (value) { 730 props[`data-$key.toLowerCase()}`] = value.toString(); 731 } 732 } 733 return props; 734 } 735 736 // node_modules/@base-ui/react/esm/utils/resolveClassName.js 737 function resolveClassName(className, state) { 738 return typeof className === "function" ? className(state) : className; 739 } 740 741 // node_modules/@base-ui/react/esm/utils/resolveStyle.js 742 function resolveStyle(style, state) { 743 return typeof style === "function" ? style(state) : style; 744 } 745 746 // node_modules/@base-ui/react/esm/merge-props/mergeProps.js 747 var EMPTY_PROPS = {}; 748 function mergeProps(a2, b2, c2, d2, e2) { 749 if (!c2 && !d2 && !e2 && !a2) { 750 return createInitialMergedProps(b2); 751 } 752 let merged = createInitialMergedProps(a2); 753 if (b2) { 754 merged = mergeInto(merged, b2); 755 } 756 if (c2) { 757 merged = mergeInto(merged, c2); 758 } 759 if (d2) { 760 merged = mergeInto(merged, d2); 761 } 762 if (e2) { 763 merged = mergeInto(merged, e2); 764 } 765 return merged; 766 } 767 function mergePropsN(props) { 768 if (props.length === 0) { 769 return EMPTY_PROPS; 770 } 771 if (props.length === 1) { 772 return createInitialMergedProps(props[0]); 773 } 774 let merged = createInitialMergedProps(props[0]); 775 for (let i2 = 1; i2 < props.length; i2 += 1) { 776 merged = mergeInto(merged, props[i2]); 777 } 778 return merged; 779 } 780 function createInitialMergedProps(inputProps) { 781 if (isPropsGetter(inputProps)) { 782 return { 783 ...resolvePropsGetter(inputProps, EMPTY_PROPS) 784 }; 785 } 786 return copyInitialProps(inputProps); 787 } 788 function mergeInto(merged, inputProps) { 789 if (isPropsGetter(inputProps)) { 790 return resolvePropsGetter(inputProps, merged); 791 } 792 return mutablyMergeInto(merged, inputProps); 793 } 794 function copyInitialProps(inputProps) { 795 const copiedProps = { 796 ...inputProps 797 }; 798 for (const propName in copiedProps) { 799 const propValue = copiedProps[propName]; 800 if (isEventHandler(propName, propValue)) { 801 copiedProps[propName] = wrapEventHandler(propValue); 802 } 803 } 804 return copiedProps; 805 } 806 function mutablyMergeInto(mergedProps, externalProps) { 807 if (!externalProps) { 808 return mergedProps; 809 } 810 for (const propName in externalProps) { 811 const externalPropValue = externalProps[propName]; 812 switch (propName) { 813 case "style": { 814 mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); 815 break; 816 } 817 case "className": { 818 mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); 819 break; 820 } 821 default: { 822 if (isEventHandler(propName, externalPropValue)) { 823 mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); 824 } else { 825 mergedProps[propName] = externalPropValue; 826 } 827 } 828 } 829 } 830 return mergedProps; 831 } 832 function isEventHandler(key, value) { 833 const code0 = key.charCodeAt(0); 834 const code1 = key.charCodeAt(1); 835 const code2 = key.charCodeAt(2); 836 return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); 837 } 838 function isPropsGetter(inputProps) { 839 return typeof inputProps === "function"; 840 } 841 function resolvePropsGetter(inputProps, previousProps) { 842 if (isPropsGetter(inputProps)) { 843 return inputProps(previousProps); 844 } 845 return inputProps ?? EMPTY_PROPS; 846 } 847 function mergeEventHandlers(ourHandler, theirHandler) { 848 if (!theirHandler) { 849 return ourHandler; 850 } 851 if (!ourHandler) { 852 return wrapEventHandler(theirHandler); 853 } 854 return (...args) => { 855 const event = args[0]; 856 if (isSyntheticEvent(event)) { 857 const baseUIEvent = event; 858 makeEventPreventable(baseUIEvent); 859 const result2 = theirHandler(...args); 860 if (!baseUIEvent.baseUIHandlerPrevented) { 861 ourHandler?.(...args); 862 } 863 return result2; 864 } 865 const result = theirHandler(...args); 866 ourHandler?.(...args); 867 return result; 868 }; 869 } 870 function wrapEventHandler(handler) { 871 if (!handler) { 872 return handler; 873 } 874 return (...args) => { 875 const event = args[0]; 876 if (isSyntheticEvent(event)) { 877 makeEventPreventable(event); 878 } 879 return handler(...args); 880 }; 881 } 882 function makeEventPreventable(event) { 883 event.preventBaseUIHandler = () => { 884 event.baseUIHandlerPrevented = true; 885 }; 886 return event; 887 } 888 function mergeClassNames(ourClassName, theirClassName) { 889 if (theirClassName) { 890 if (ourClassName) { 891 return theirClassName + " " + ourClassName; 892 } 893 return theirClassName; 894 } 895 return ourClassName; 896 } 897 function isSyntheticEvent(event) { 898 return event != null && typeof event === "object" && "nativeEvent" in event; 899 } 900 901 // node_modules/@base-ui/react/esm/internals/useRenderElement.js 902 var import_react = __toESM(require_react(), 1); 903 function useRenderElement(element, componentProps, params = {}) { 904 const renderProp = componentProps.render; 905 const outProps = useRenderElementProps(componentProps, params); 906 if (params.enabled === false) { 907 return null; 908 } 909 const state = params.state ?? EMPTY_OBJECT; 910 return evaluateRenderProp(element, renderProp, outProps, state); 911 } 912 function useRenderElementProps(componentProps, params = {}) { 913 const { 914 className: classNameProp, 915 style: styleProp, 916 render: renderProp 917 } = componentProps; 918 const { 919 state = EMPTY_OBJECT, 920 ref, 921 props, 922 stateAttributesMapping: stateAttributesMapping3, 923 enabled = true 924 } = params; 925 const className = enabled ? resolveClassName(classNameProp, state) : void 0; 926 const style = enabled ? resolveStyle(styleProp, state) : void 0; 927 const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping3) : EMPTY_OBJECT; 928 const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; 929 const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; 930 if (typeof document !== "undefined") { 931 if (!enabled) { 932 useMergedRefs(null, null); 933 } else if (Array.isArray(ref)) { 934 outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); 935 } else { 936 outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); 937 } 938 } 939 if (!enabled) { 940 return EMPTY_OBJECT; 941 } 942 if (className !== void 0) { 943 outProps.className = mergeClassNames(outProps.className, className); 944 } 945 if (style !== void 0) { 946 outProps.style = mergeObjects(outProps.style, style); 947 } 948 return outProps; 949 } 950 function resolveRenderFunctionProps(props) { 951 if (Array.isArray(props)) { 952 return mergePropsN(props); 953 } 954 return mergeProps(void 0, props); 955 } 956 var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); 957 var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; 958 var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; 959 function evaluateRenderProp(element, render, props, state) { 960 if (render) { 961 if (typeof render === "function") { 962 if (true) { 963 warnIfRenderPropLooksLikeComponent(render); 964 } 965 return render(props, state); 966 } 967 const mergedProps = mergeProps(props, render.props); 968 mergedProps.ref = props.ref; 969 let newElement = render; 970 if (newElement?.$$typeof === REACT_LAZY_TYPE) { 971 const children = React8.Children.toArray(render); 972 newElement = children[0]; 973 } 974 if (true) { 975 if (!/* @__PURE__ */ React8.isValidElement(newElement)) { 976 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")); 977 } 978 } 979 return /* @__PURE__ */ React8.cloneElement(newElement, mergedProps); 980 } 981 if (element) { 982 if (typeof element === "string") { 983 return renderTag(element, props); 984 } 985 } 986 throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); 987 } 988 function warnIfRenderPropLooksLikeComponent(renderFn) { 989 const functionName = renderFn.name; 990 if (functionName.length === 0) { 991 return; 992 } 993 if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { 994 return; 995 } 996 if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { 997 return; 998 } 999 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"); 1000 } 1001 function renderTag(Tag, props) { 1002 if (Tag === "button") { 1003 return /* @__PURE__ */ (0, import_react.createElement)("button", { 1004 type: "button", 1005 ...props, 1006 key: props.key 1007 }); 1008 } 1009 if (Tag === "img") { 1010 return /* @__PURE__ */ (0, import_react.createElement)("img", { 1011 alt: "", 1012 ...props, 1013 key: props.key 1014 }); 1015 } 1016 return /* @__PURE__ */ React8.createElement(Tag, props); 1017 } 1018 1019 // node_modules/@base-ui/react/esm/internals/reason-parts.js 1020 var reason_parts_exports = {}; 1021 __export(reason_parts_exports, { 1022 cancelOpen: () => cancelOpen, 1023 chipRemovePress: () => chipRemovePress, 1024 clearPress: () => clearPress, 1025 closePress: () => closePress, 1026 closeWatcher: () => closeWatcher, 1027 decrementPress: () => decrementPress, 1028 disabled: () => disabled, 1029 drag: () => drag, 1030 escapeKey: () => escapeKey, 1031 focusOut: () => focusOut, 1032 imperativeAction: () => imperativeAction, 1033 incrementPress: () => incrementPress, 1034 initial: () => initial, 1035 inputBlur: () => inputBlur, 1036 inputChange: () => inputChange, 1037 inputClear: () => inputClear, 1038 inputPaste: () => inputPaste, 1039 inputPress: () => inputPress, 1040 itemPress: () => itemPress, 1041 keyboard: () => keyboard, 1042 linkPress: () => linkPress, 1043 listNavigation: () => listNavigation, 1044 missing: () => missing, 1045 none: () => none, 1046 outsidePress: () => outsidePress, 1047 pointer: () => pointer, 1048 scrub: () => scrub, 1049 siblingOpen: () => siblingOpen, 1050 swipe: () => swipe, 1051 trackPress: () => trackPress, 1052 triggerFocus: () => triggerFocus, 1053 triggerHover: () => triggerHover, 1054 triggerPress: () => triggerPress, 1055 wheel: () => wheel, 1056 windowResize: () => windowResize 1057 }); 1058 var none = "none"; 1059 var triggerPress = "trigger-press"; 1060 var triggerHover = "trigger-hover"; 1061 var triggerFocus = "trigger-focus"; 1062 var outsidePress = "outside-press"; 1063 var itemPress = "item-press"; 1064 var closePress = "close-press"; 1065 var linkPress = "link-press"; 1066 var clearPress = "clear-press"; 1067 var chipRemovePress = "chip-remove-press"; 1068 var trackPress = "track-press"; 1069 var incrementPress = "increment-press"; 1070 var decrementPress = "decrement-press"; 1071 var inputChange = "input-change"; 1072 var inputClear = "input-clear"; 1073 var inputBlur = "input-blur"; 1074 var inputPaste = "input-paste"; 1075 var inputPress = "input-press"; 1076 var focusOut = "focus-out"; 1077 var escapeKey = "escape-key"; 1078 var closeWatcher = "close-watcher"; 1079 var listNavigation = "list-navigation"; 1080 var keyboard = "keyboard"; 1081 var pointer = "pointer"; 1082 var drag = "drag"; 1083 var wheel = "wheel"; 1084 var scrub = "scrub"; 1085 var cancelOpen = "cancel-open"; 1086 var siblingOpen = "sibling-open"; 1087 var disabled = "disabled"; 1088 var missing = "missing"; 1089 var initial = "initial"; 1090 var imperativeAction = "imperative-action"; 1091 var swipe = "swipe"; 1092 var windowResize = "window-resize"; 1093 1094 // node_modules/@base-ui/react/esm/internals/createBaseUIEventDetails.js 1095 function createChangeEventDetails(reason, event, trigger, customProperties) { 1096 let canceled = false; 1097 let allowPropagation = false; 1098 const custom = customProperties ?? EMPTY_OBJECT; 1099 const details = { 1100 reason, 1101 event: event ?? new Event("base-ui"), 1102 cancel() { 1103 canceled = true; 1104 }, 1105 allowPropagation() { 1106 allowPropagation = true; 1107 }, 1108 get isCanceled() { 1109 return canceled; 1110 }, 1111 get isPropagationAllowed() { 1112 return allowPropagation; 1113 }, 1114 trigger, 1115 ...custom 1116 }; 1117 return details; 1118 } 1119 1120 // node_modules/@base-ui/utils/esm/useId.js 1121 var React9 = __toESM(require_react(), 1); 1122 var globalId = 0; 1123 function useGlobalId(idOverride, prefix = "mui") { 1124 const [defaultId, setDefaultId] = React9.useState(idOverride); 1125 const id = idOverride || defaultId; 1126 React9.useEffect(() => { 1127 if (defaultId == null) { 1128 globalId += 1; 1129 setDefaultId(`$prefix}-$globalId}`); 1130 } 1131 }, [defaultId, prefix]); 1132 return id; 1133 } 1134 var maybeReactUseId = SafeReact.useId; 1135 function useId(idOverride, prefix) { 1136 if (maybeReactUseId !== void 0) { 1137 const reactId = maybeReactUseId(); 1138 return idOverride ?? (prefix ? `$prefix}-$reactId}` : reactId); 1139 } 1140 return useGlobalId(idOverride, prefix); 1141 } 1142 1143 // node_modules/@base-ui/react/esm/internals/useBaseUiId.js 1144 function useBaseUiId(idOverride) { 1145 return useId(idOverride, "base-ui"); 1146 } 1147 1148 // node_modules/@base-ui/react/esm/internals/useTransitionStatus.js 1149 var React11 = __toESM(require_react(), 1); 1150 1151 // node_modules/@base-ui/utils/esm/useOnMount.js 1152 var React10 = __toESM(require_react(), 1); 1153 var EMPTY = []; 1154 function useOnMount(fn) { 1155 React10.useEffect(fn, EMPTY); 1156 } 1157 1158 // node_modules/@base-ui/utils/esm/useAnimationFrame.js 1159 var EMPTY2 = null; 1160 var LAST_RAF = globalThis.requestAnimationFrame; 1161 var Scheduler = class { 1162 /* This implementation uses an array as a backing data-structure for frame callbacks. 1163 * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it 1164 * never calls the native `cancelAnimationFrame` if there are no frames left. This can 1165 * be much more efficient if there is a call pattern that alterns as 1166 * "request-cancel-request-cancel-…". 1167 * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation 1168 * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ 1169 callbacks = []; 1170 callbacksCount = 0; 1171 nextId = 1; 1172 startId = 1; 1173 isScheduled = false; 1174 tick = (timestamp) => { 1175 this.isScheduled = false; 1176 const currentCallbacks = this.callbacks; 1177 const currentCallbacksCount = this.callbacksCount; 1178 this.callbacks = []; 1179 this.callbacksCount = 0; 1180 this.startId = this.nextId; 1181 if (currentCallbacksCount > 0) { 1182 for (let i2 = 0; i2 < currentCallbacks.length; i2 += 1) { 1183 currentCallbacks[i2]?.(timestamp); 1184 } 1185 } 1186 }; 1187 request(fn) { 1188 const id = this.nextId; 1189 this.nextId += 1; 1190 this.callbacks.push(fn); 1191 this.callbacksCount += 1; 1192 const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); 1193 if (!this.isScheduled || didRAFChange) { 1194 requestAnimationFrame(this.tick); 1195 this.isScheduled = true; 1196 } 1197 return id; 1198 } 1199 cancel(id) { 1200 const index2 = id - this.startId; 1201 if (index2 < 0 || index2 >= this.callbacks.length) { 1202 return; 1203 } 1204 this.callbacks[index2] = null; 1205 this.callbacksCount -= 1; 1206 } 1207 }; 1208 var scheduler = new Scheduler(); 1209 var AnimationFrame = class _AnimationFrame { 1210 static create() { 1211 return new _AnimationFrame(); 1212 } 1213 static request(fn) { 1214 return scheduler.request(fn); 1215 } 1216 static cancel(id) { 1217 return scheduler.cancel(id); 1218 } 1219 currentId = EMPTY2; 1220 /** 1221 * Executes `fn` after `delay`, clearing any previously scheduled call. 1222 */ 1223 request(fn) { 1224 this.cancel(); 1225 this.currentId = scheduler.request(() => { 1226 this.currentId = EMPTY2; 1227 fn(); 1228 }); 1229 } 1230 cancel = () => { 1231 if (this.currentId !== EMPTY2) { 1232 scheduler.cancel(this.currentId); 1233 this.currentId = EMPTY2; 1234 } 1235 }; 1236 disposeEffect = () => { 1237 return this.cancel; 1238 }; 1239 }; 1240 function useAnimationFrame() { 1241 const timeout = useRefWithInit(AnimationFrame.create).current; 1242 useOnMount(timeout.disposeEffect); 1243 return timeout; 1244 } 1245 1246 // node_modules/@base-ui/react/esm/internals/useTransitionStatus.js 1247 function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { 1248 const [transitionStatus, setTransitionStatus] = React11.useState(open && enableIdleState ? "idle" : void 0); 1249 const [mounted, setMounted] = React11.useState(open); 1250 if (open && !mounted) { 1251 setMounted(true); 1252 setTransitionStatus("starting"); 1253 } 1254 if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { 1255 setTransitionStatus("ending"); 1256 } 1257 if (!open && !mounted && transitionStatus === "ending") { 1258 setTransitionStatus(void 0); 1259 } 1260 useIsoLayoutEffect(() => { 1261 if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { 1262 const frame = AnimationFrame.request(() => { 1263 setTransitionStatus("ending"); 1264 }); 1265 return () => { 1266 AnimationFrame.cancel(frame); 1267 }; 1268 } 1269 return void 0; 1270 }, [open, mounted, transitionStatus, deferEndingState]); 1271 useIsoLayoutEffect(() => { 1272 if (!open || enableIdleState) { 1273 return void 0; 1274 } 1275 const frame = AnimationFrame.request(() => { 1276 setTransitionStatus(void 0); 1277 }); 1278 return () => { 1279 AnimationFrame.cancel(frame); 1280 }; 1281 }, [enableIdleState, open]); 1282 useIsoLayoutEffect(() => { 1283 if (!open || !enableIdleState) { 1284 return void 0; 1285 } 1286 if (open && mounted && transitionStatus !== "idle") { 1287 setTransitionStatus("starting"); 1288 } 1289 const frame = AnimationFrame.request(() => { 1290 setTransitionStatus("idle"); 1291 }); 1292 return () => { 1293 AnimationFrame.cancel(frame); 1294 }; 1295 }, [enableIdleState, open, mounted, transitionStatus]); 1296 return { 1297 mounted, 1298 setMounted, 1299 transitionStatus 1300 }; 1301 } 1302 1303 // node_modules/@base-ui/react/esm/internals/stateAttributesMapping.js 1304 var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { 1305 TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; 1306 TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; 1307 return TransitionStatusDataAttributes2; 1308 })({}); 1309 var STARTING_HOOK = { 1310 [TransitionStatusDataAttributes.startingStyle]: "" 1311 }; 1312 var ENDING_HOOK = { 1313 [TransitionStatusDataAttributes.endingStyle]: "" 1314 }; 1315 var transitionStatusMapping = { 1316 transitionStatus(value) { 1317 if (value === "starting") { 1318 return STARTING_HOOK; 1319 } 1320 if (value === "ending") { 1321 return ENDING_HOOK; 1322 } 1323 return null; 1324 } 1325 }; 1326 1327 // node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs 1328 function hasWindow() { 1329 return typeof window !== "undefined"; 1330 } 1331 function getNodeName(node) { 1332 if (isNode(node)) { 1333 return (node.nodeName || "").toLowerCase(); 1334 } 1335 return "#document"; 1336 } 1337 function getWindow(node) { 1338 var _node$ownerDocument; 1339 return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; 1340 } 1341 function getDocumentElement(node) { 1342 var _ref; 1343 return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement; 1344 } 1345 function isNode(value) { 1346 if (!hasWindow()) { 1347 return false; 1348 } 1349 return value instanceof Node || value instanceof getWindow(value).Node; 1350 } 1351 function isElement(value) { 1352 if (!hasWindow()) { 1353 return false; 1354 } 1355 return value instanceof Element || value instanceof getWindow(value).Element; 1356 } 1357 function isHTMLElement(value) { 1358 if (!hasWindow()) { 1359 return false; 1360 } 1361 return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; 1362 } 1363 function isShadowRoot(value) { 1364 if (!hasWindow() || typeof ShadowRoot === "undefined") { 1365 return false; 1366 } 1367 return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot; 1368 } 1369 function isOverflowElement(element) { 1370 const { 1371 overflow, 1372 overflowX, 1373 overflowY, 1374 display 1375 } = getComputedStyle2(element); 1376 return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && display !== "inline" && display !== "contents"; 1377 } 1378 function isTableElement(element) { 1379 return /^(table|td|th)$/.test(getNodeName(element)); 1380 } 1381 function isTopLayer(element) { 1382 try { 1383 if (element.matches(":popover-open")) { 1384 return true; 1385 } 1386 } catch (_e) { 1387 } 1388 try { 1389 return element.matches(":modal"); 1390 } catch (_e) { 1391 return false; 1392 } 1393 } 1394 var willChangeRe = /transform|translate|scale|rotate|perspective|filter/; 1395 var containRe = /paint|layout|strict|content/; 1396 var isNotNone = (value) => !!value && value !== "none"; 1397 var isWebKitValue; 1398 function isContainingBlock(elementOrCss) { 1399 const css = isElement(elementOrCss) ? getComputedStyle2(elementOrCss) : elementOrCss; 1400 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 || ""); 1401 } 1402 function getContainingBlock(element) { 1403 let currentNode = getParentNode(element); 1404 while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) { 1405 if (isContainingBlock(currentNode)) { 1406 return currentNode; 1407 } else if (isTopLayer(currentNode)) { 1408 return null; 1409 } 1410 currentNode = getParentNode(currentNode); 1411 } 1412 return null; 1413 } 1414 function isWebKit() { 1415 if (isWebKitValue == null) { 1416 isWebKitValue = typeof CSS !== "undefined" && CSS.supports && CSS.supports("-webkit-backdrop-filter", "none"); 1417 } 1418 return isWebKitValue; 1419 } 1420 function isLastTraversableNode(node) { 1421 return /^(html|body|#document)$/.test(getNodeName(node)); 1422 } 1423 function getComputedStyle2(element) { 1424 return getWindow(element).getComputedStyle(element); 1425 } 1426 function getNodeScroll(element) { 1427 if (isElement(element)) { 1428 return { 1429 scrollLeft: element.scrollLeft, 1430 scrollTop: element.scrollTop 1431 }; 1432 } 1433 return { 1434 scrollLeft: element.scrollX, 1435 scrollTop: element.scrollY 1436 }; 1437 } 1438 function getParentNode(node) { 1439 if (getNodeName(node) === "html") { 1440 return node; 1441 } 1442 const result = ( 1443 // Step into the shadow DOM of the parent of a slotted node. 1444 node.assignedSlot || // DOM Element detected. 1445 node.parentNode || // ShadowRoot detected. 1446 isShadowRoot(node) && node.host || // Fallback. 1447 getDocumentElement(node) 1448 ); 1449 return isShadowRoot(result) ? result.host : result; 1450 } 1451 function getNearestOverflowAncestor(node) { 1452 const parentNode = getParentNode(node); 1453 if (isLastTraversableNode(parentNode)) { 1454 return node.ownerDocument ? node.ownerDocument.body : node.body; 1455 } 1456 if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) { 1457 return parentNode; 1458 } 1459 return getNearestOverflowAncestor(parentNode); 1460 } 1461 function getOverflowAncestors(node, list, traverseIframes) { 1462 var _node$ownerDocument2; 1463 if (list === void 0) { 1464 list = []; 1465 } 1466 if (traverseIframes === void 0) { 1467 traverseIframes = true; 1468 } 1469 const scrollableAncestor = getNearestOverflowAncestor(node); 1470 const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body); 1471 const win = getWindow(scrollableAncestor); 1472 if (isBody) { 1473 const frameElement = getFrameElement(win); 1474 return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []); 1475 } else { 1476 return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes)); 1477 } 1478 } 1479 function getFrameElement(win) { 1480 return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null; 1481 } 1482 1483 // node_modules/@base-ui/utils/esm/detectBrowser.js 1484 var hasNavigator = typeof navigator !== "undefined"; 1485 var nav = getNavigatorData(); 1486 var platform = getPlatform(); 1487 var userAgent = getUserAgent(); 1488 var isWebKit2 = typeof CSS === "undefined" || !CSS.supports ? false : CSS.supports("-webkit-backdrop-filter:none"); 1489 var isIOS = ( 1490 // iPads can claim to be MacIntel 1491 nav.platform === "MacIntel" && nav.maxTouchPoints > 1 ? true : /iP(hone|ad|od)|iOS/.test(nav.platform) 1492 ); 1493 var isFirefox = hasNavigator && /firefox/i.test(userAgent); 1494 var isSafari = hasNavigator && /apple/i.test(navigator.vendor); 1495 var isEdge = hasNavigator && /Edg/i.test(userAgent); 1496 var isAndroid = hasNavigator && /android/i.test(platform) || /android/i.test(userAgent); 1497 var isMac = hasNavigator && platform.toLowerCase().startsWith("mac") && !navigator.maxTouchPoints; 1498 var isJSDOM = userAgent.includes("jsdom/"); 1499 function getNavigatorData() { 1500 if (!hasNavigator) { 1501 return { 1502 platform: "", 1503 maxTouchPoints: -1 1504 }; 1505 } 1506 const uaData = navigator.userAgentData; 1507 if (uaData?.platform) { 1508 return { 1509 platform: uaData.platform, 1510 maxTouchPoints: navigator.maxTouchPoints 1511 }; 1512 } 1513 return { 1514 platform: navigator.platform ?? "", 1515 maxTouchPoints: navigator.maxTouchPoints ?? -1 1516 }; 1517 } 1518 function getUserAgent() { 1519 if (!hasNavigator) { 1520 return ""; 1521 } 1522 const uaData = navigator.userAgentData; 1523 if (uaData && Array.isArray(uaData.brands)) { 1524 return uaData.brands.map(({ 1525 brand, 1526 version: version2 1527 }) => `$brand}/$version2}`).join(" "); 1528 } 1529 return navigator.userAgent; 1530 } 1531 function getPlatform() { 1532 if (!hasNavigator) { 1533 return ""; 1534 } 1535 const uaData = navigator.userAgentData; 1536 if (uaData?.platform) { 1537 return uaData.platform; 1538 } 1539 return navigator.platform ?? ""; 1540 } 1541 1542 // node_modules/@base-ui/react/esm/floating-ui-react/utils/constants.js 1543 var FOCUSABLE_ATTRIBUTE = "data-base-ui-focusable"; 1544 var TYPEABLE_SELECTOR = "input:not([type='hidden']):not([disabled]),[contenteditable]:not([contenteditable='false']),textarea:not([disabled])"; 1545 1546 // node_modules/@base-ui/react/esm/internals/shadowDom.js 1547 function activeElement(doc) { 1548 let element = doc.activeElement; 1549 while (element?.shadowRoot?.activeElement != null) { 1550 element = element.shadowRoot.activeElement; 1551 } 1552 return element; 1553 } 1554 function contains(parent, child) { 1555 if (!parent || !child) { 1556 return false; 1557 } 1558 const rootNode = child.getRootNode?.(); 1559 if (parent.contains(child)) { 1560 return true; 1561 } 1562 if (rootNode && isShadowRoot(rootNode)) { 1563 let next = child; 1564 while (next) { 1565 if (parent === next) { 1566 return true; 1567 } 1568 next = next.parentNode || next.host; 1569 } 1570 } 1571 return false; 1572 } 1573 function getTarget(event) { 1574 if ("composedPath" in event) { 1575 return event.composedPath()[0]; 1576 } 1577 return event.target; 1578 } 1579 1580 // node_modules/@base-ui/react/esm/floating-ui-react/utils/element.js 1581 function isTargetInsideEnabledTrigger(target, triggerElements) { 1582 if (!isElement(target)) { 1583 return false; 1584 } 1585 const targetElement = target; 1586 if (triggerElements.hasElement(targetElement)) { 1587 return !targetElement.hasAttribute("data-trigger-disabled"); 1588 } 1589 for (const [, trigger] of triggerElements.entries()) { 1590 if (contains(trigger, targetElement)) { 1591 return !trigger.hasAttribute("data-trigger-disabled"); 1592 } 1593 } 1594 return false; 1595 } 1596 function isEventTargetWithin(event, node) { 1597 if (node == null) { 1598 return false; 1599 } 1600 if ("composedPath" in event) { 1601 return event.composedPath().includes(node); 1602 } 1603 const eventAgain = event; 1604 return eventAgain.target != null && node.contains(eventAgain.target); 1605 } 1606 function isRootElement(element) { 1607 return element.matches("html,body"); 1608 } 1609 function isTypeableElement(element) { 1610 return isHTMLElement(element) && element.matches(TYPEABLE_SELECTOR); 1611 } 1612 function isInteractiveElement(element) { 1613 return element?.closest(`button,a[href],[role="button"],select,[tabindex]:not([tabindex="-1"]),$TYPEABLE_SELECTOR}`) != null; 1614 } 1615 function matchesFocusVisible(element) { 1616 if (!element || isJSDOM) { 1617 return true; 1618 } 1619 try { 1620 return element.matches(":focus-visible"); 1621 } catch (_e) { 1622 return true; 1623 } 1624 } 1625 1626 // node_modules/@base-ui/react/esm/floating-ui-react/utils/nodes.js 1627 function getNodeChildren(nodes, id, onlyOpenChildren = true) { 1628 const directChildren = nodes.filter((node) => node.parentId === id); 1629 return directChildren.flatMap((child) => [...!onlyOpenChildren || child.context?.open ? [child] : [], ...getNodeChildren(nodes, child.id, onlyOpenChildren)]); 1630 } 1631 1632 // node_modules/@base-ui/react/esm/floating-ui-react/utils/event.js 1633 function isReactEvent(event) { 1634 return "nativeEvent" in event; 1635 } 1636 function isMouseLikePointerType(pointerType, strict) { 1637 const values = ["mouse", "pen"]; 1638 if (!strict) { 1639 values.push("", void 0); 1640 } 1641 return values.includes(pointerType); 1642 } 1643 function isClickLikeEvent(event) { 1644 const type = event.type; 1645 return type === "click" || type === "mousedown" || type === "keydown" || type === "keyup"; 1646 } 1647 1648 // node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs 1649 var sides = ["top", "right", "bottom", "left"]; 1650 var min = Math.min; 1651 var max = Math.max; 1652 var round = Math.round; 1653 var floor = Math.floor; 1654 var createCoords = (v2) => ({ 1655 x: v2, 1656 y: v2 1657 }); 1658 var oppositeSideMap = { 1659 left: "right", 1660 right: "left", 1661 bottom: "top", 1662 top: "bottom" 1663 }; 1664 function clamp(start, value, end) { 1665 return max(start, min(value, end)); 1666 } 1667 function evaluate(value, param) { 1668 return typeof value === "function" ? value(param) : value; 1669 } 1670 function getSide(placement) { 1671 return placement.split("-")[0]; 1672 } 1673 function getAlignment(placement) { 1674 return placement.split("-")[1]; 1675 } 1676 function getOppositeAxis(axis) { 1677 return axis === "x" ? "y" : "x"; 1678 } 1679 function getAxisLength(axis) { 1680 return axis === "y" ? "height" : "width"; 1681 } 1682 function getSideAxis(placement) { 1683 const firstChar = placement[0]; 1684 return firstChar === "t" || firstChar === "b" ? "y" : "x"; 1685 } 1686 function getAlignmentAxis(placement) { 1687 return getOppositeAxis(getSideAxis(placement)); 1688 } 1689 function getAlignmentSides(placement, rects, rtl) { 1690 if (rtl === void 0) { 1691 rtl = false; 1692 } 1693 const alignment = getAlignment(placement); 1694 const alignmentAxis = getAlignmentAxis(placement); 1695 const length = getAxisLength(alignmentAxis); 1696 let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top"; 1697 if (rects.reference[length] > rects.floating[length]) { 1698 mainAlignmentSide = getOppositePlacement(mainAlignmentSide); 1699 } 1700 return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)]; 1701 } 1702 function getExpandedPlacements(placement) { 1703 const oppositePlacement = getOppositePlacement(placement); 1704 return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)]; 1705 } 1706 function getOppositeAlignmentPlacement(placement) { 1707 return placement.includes("start") ? placement.replace("start", "end") : placement.replace("end", "start"); 1708 } 1709 var lrPlacement = ["left", "right"]; 1710 var rlPlacement = ["right", "left"]; 1711 var tbPlacement = ["top", "bottom"]; 1712 var btPlacement = ["bottom", "top"]; 1713 function getSideList(side, isStart, rtl) { 1714 switch (side) { 1715 case "top": 1716 case "bottom": 1717 if (rtl) return isStart ? rlPlacement : lrPlacement; 1718 return isStart ? lrPlacement : rlPlacement; 1719 case "left": 1720 case "right": 1721 return isStart ? tbPlacement : btPlacement; 1722 default: 1723 return []; 1724 } 1725 } 1726 function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) { 1727 const alignment = getAlignment(placement); 1728 let list = getSideList(getSide(placement), direction === "start", rtl); 1729 if (alignment) { 1730 list = list.map((side) => side + "-" + alignment); 1731 if (flipAlignment) { 1732 list = list.concat(list.map(getOppositeAlignmentPlacement)); 1733 } 1734 } 1735 return list; 1736 } 1737 function getOppositePlacement(placement) { 1738 const side = getSide(placement); 1739 return oppositeSideMap[side] + placement.slice(side.length); 1740 } 1741 function expandPaddingObject(padding) { 1742 return { 1743 top: 0, 1744 right: 0, 1745 bottom: 0, 1746 left: 0, 1747 ...padding 1748 }; 1749 } 1750 function getPaddingObject(padding) { 1751 return typeof padding !== "number" ? expandPaddingObject(padding) : { 1752 top: padding, 1753 right: padding, 1754 bottom: padding, 1755 left: padding 1756 }; 1757 } 1758 function rectToClientRect(rect) { 1759 const { 1760 x: x2, 1761 y: y2, 1762 width, 1763 height 1764 } = rect; 1765 return { 1766 width, 1767 height, 1768 top: y2, 1769 left: x2, 1770 right: x2 + width, 1771 bottom: y2 + height, 1772 x: x2, 1773 y: y2 1774 }; 1775 } 1776 1777 // node_modules/@base-ui/react/esm/floating-ui-react/utils/composite.js 1778 function isHiddenByStyles(styles) { 1779 return styles.visibility === "hidden" || styles.visibility === "collapse"; 1780 } 1781 function isElementVisible(element, styles = element ? getComputedStyle2(element) : null) { 1782 if (!element || !element.isConnected || !styles || isHiddenByStyles(styles)) { 1783 return false; 1784 } 1785 if (typeof element.checkVisibility === "function") { 1786 return element.checkVisibility(); 1787 } 1788 return styles.display !== "none" && styles.display !== "contents"; 1789 } 1790 1791 // node_modules/@base-ui/utils/esm/owner.js 1792 function ownerDocument(node) { 1793 return node?.ownerDocument || document; 1794 } 1795 1796 // node_modules/@base-ui/react/esm/floating-ui-react/utils/tabbable.js 1797 var CANDIDATE_SELECTOR = 'a[href],button,input,select,textarea,summary,details,iframe,object,embed,[tabindex],[contenteditable]:not([contenteditable="false"]),audio[controls],video[controls]'; 1798 function getParentElement(element) { 1799 const assignedSlot = element.assignedSlot; 1800 if (assignedSlot) { 1801 return assignedSlot; 1802 } 1803 if (element.parentElement) { 1804 return element.parentElement; 1805 } 1806 const rootNode = element.getRootNode(); 1807 return isShadowRoot(rootNode) ? rootNode.host : null; 1808 } 1809 function getDetailsSummary(details) { 1810 for (const child of Array.from(details.children)) { 1811 if (getNodeName(child) === "summary") { 1812 return child; 1813 } 1814 } 1815 return null; 1816 } 1817 function isWithinOpenDetailsSummary(element, details) { 1818 const summary = getDetailsSummary(details); 1819 return !!summary && (element === summary || contains(summary, element)); 1820 } 1821 function isFocusableCandidate(element) { 1822 const nodeName = element ? getNodeName(element) : ""; 1823 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"); 1824 } 1825 function isFocusableElement(element) { 1826 if (!isFocusableCandidate(element) || !element.isConnected || element.matches(":disabled")) { 1827 return false; 1828 } 1829 for (let current = element; current; current = getParentElement(current)) { 1830 const isAncestor = current !== element; 1831 const isSlot = getNodeName(current) === "slot"; 1832 if (current.hasAttribute("inert")) { 1833 return false; 1834 } 1835 if (isAncestor && getNodeName(current) === "details" && !current.open && !isWithinOpenDetailsSummary(element, current) || current.hasAttribute("hidden") || !isSlot && !isVisibleInTabbableTree(current, isAncestor)) { 1836 return false; 1837 } 1838 } 1839 return true; 1840 } 1841 function isVisibleInTabbableTree(element, isAncestor) { 1842 const styles = getComputedStyle2(element); 1843 if (!isAncestor) { 1844 return isElementVisible(element, styles); 1845 } 1846 return styles.display !== "none"; 1847 } 1848 function getTabIndex(element) { 1849 const tabIndex = element.tabIndex; 1850 if (tabIndex < 0) { 1851 const nodeName = getNodeName(element); 1852 if (nodeName === "details" || nodeName === "audio" || nodeName === "video" || isHTMLElement(element) && element.isContentEditable) { 1853 return 0; 1854 } 1855 } 1856 return tabIndex; 1857 } 1858 function getNamedRadioInput(element) { 1859 if (getNodeName(element) !== "input") { 1860 return null; 1861 } 1862 const input = element; 1863 return input.type === "radio" && input.name !== "" ? input : null; 1864 } 1865 function isTabbableRadio(element, candidates) { 1866 const input = getNamedRadioInput(element); 1867 if (!input) { 1868 return true; 1869 } 1870 const checkedRadio = candidates.find((candidate) => { 1871 const radio = getNamedRadioInput(candidate); 1872 return radio?.name === input.name && radio.form === input.form && radio.checked; 1873 }); 1874 if (checkedRadio) { 1875 return checkedRadio === input; 1876 } 1877 return candidates.find((candidate) => { 1878 const radio = getNamedRadioInput(candidate); 1879 return radio?.name === input.name && radio.form === input.form; 1880 }) === input; 1881 } 1882 function getComposedChildren(container) { 1883 if (isHTMLElement(container) && getNodeName(container) === "slot") { 1884 const assignedElements = container.assignedElements({ 1885 flatten: true 1886 }); 1887 if (assignedElements.length > 0) { 1888 return assignedElements; 1889 } 1890 } 1891 if (isHTMLElement(container) && container.shadowRoot) { 1892 return Array.from(container.shadowRoot.children); 1893 } 1894 return Array.from(container.children); 1895 } 1896 function appendCandidates(container, list) { 1897 getComposedChildren(container).forEach((child) => { 1898 if (isFocusableCandidate(child)) { 1899 list.push(child); 1900 } 1901 appendCandidates(child, list); 1902 }); 1903 } 1904 function appendMatchingElements(container, selector, list) { 1905 getComposedChildren(container).forEach((child) => { 1906 if (isHTMLElement(child) && child.matches(selector)) { 1907 list.push(child); 1908 } 1909 appendMatchingElements(child, selector, list); 1910 }); 1911 } 1912 function focusable(container) { 1913 const candidates = []; 1914 appendCandidates(container, candidates); 1915 return candidates.filter(isFocusableElement); 1916 } 1917 function tabbable(container) { 1918 const candidates = focusable(container); 1919 return candidates.filter((element) => getTabIndex(element) >= 0 && isTabbableRadio(element, candidates)); 1920 } 1921 function getTabbableIn(container, dir) { 1922 const list = tabbable(container); 1923 const len = list.length; 1924 if (len === 0) { 1925 return void 0; 1926 } 1927 const active = activeElement(ownerDocument(container)); 1928 const index2 = list.indexOf(active); 1929 const nextIndex = index2 === -1 ? dir === 1 ? 0 : len - 1 : index2 + dir; 1930 return list[nextIndex]; 1931 } 1932 function getNextTabbable(referenceElement) { 1933 return getTabbableIn(ownerDocument(referenceElement).body, 1) || referenceElement; 1934 } 1935 function getPreviousTabbable(referenceElement) { 1936 return getTabbableIn(ownerDocument(referenceElement).body, -1) || referenceElement; 1937 } 1938 function isOutsideEvent(event, container) { 1939 const containerElement = container || event.currentTarget; 1940 const relatedTarget = event.relatedTarget; 1941 return !relatedTarget || !contains(containerElement, relatedTarget); 1942 } 1943 function disableFocusInside(container) { 1944 const tabbableElements = tabbable(container); 1945 tabbableElements.forEach((element) => { 1946 element.dataset.tabindex = element.getAttribute("tabindex") || ""; 1947 element.setAttribute("tabindex", "-1"); 1948 }); 1949 } 1950 function enableFocusInside(container) { 1951 const elements2 = []; 1952 appendMatchingElements(container, "[data-tabindex]", elements2); 1953 elements2.forEach((element) => { 1954 const tabindex = element.dataset.tabindex; 1955 delete element.dataset.tabindex; 1956 if (tabindex) { 1957 element.setAttribute("tabindex", tabindex); 1958 } else { 1959 element.removeAttribute("tabindex"); 1960 } 1961 }); 1962 } 1963 1964 // node_modules/@base-ui/utils/esm/addEventListener.js 1965 function addEventListener(target, type, listener, options) { 1966 target.addEventListener(type, listener, options); 1967 return () => { 1968 target.removeEventListener(type, listener, options); 1969 }; 1970 } 1971 1972 // node_modules/@base-ui/utils/esm/useValueAsRef.js 1973 function useValueAsRef(value) { 1974 const latest = useRefWithInit(createLatestRef, value).current; 1975 latest.next = value; 1976 useIsoLayoutEffect(latest.effect); 1977 return latest; 1978 } 1979 function createLatestRef(value) { 1980 const latest = { 1981 current: value, 1982 next: value, 1983 effect: () => { 1984 latest.current = latest.next; 1985 } 1986 }; 1987 return latest; 1988 } 1989 1990 // node_modules/@base-ui/react/esm/internals/useOpenChangeComplete.js 1991 var React12 = __toESM(require_react(), 1); 1992 1993 // node_modules/@base-ui/react/esm/internals/useAnimationsFinished.js 1994 var ReactDOM = __toESM(require_react_dom(), 1); 1995 1996 // node_modules/@base-ui/react/esm/utils/resolveRef.js 1997 function resolveRef(maybeRef) { 1998 if (maybeRef == null) { 1999 return maybeRef; 2000 } 2001 return "current" in maybeRef ? maybeRef.current : maybeRef; 2002 } 2003 2004 // node_modules/@base-ui/react/esm/internals/useAnimationsFinished.js 2005 function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) { 2006 const frame = useAnimationFrame(); 2007 return useStableCallback((fnToExecute, signal = null) => { 2008 frame.cancel(); 2009 const element = resolveRef(elementOrRef); 2010 if (element == null) { 2011 return; 2012 } 2013 const resolvedElement = element; 2014 const done = () => { 2015 ReactDOM.flushSync(fnToExecute); 2016 }; 2017 if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { 2018 fnToExecute(); 2019 return; 2020 } 2021 function exec() { 2022 Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { 2023 if (!signal?.aborted) { 2024 done(); 2025 } 2026 }).catch(() => { 2027 if (treatAbortedAsFinished) { 2028 if (!signal?.aborted) { 2029 done(); 2030 } 2031 return; 2032 } 2033 const currentAnimations = resolvedElement.getAnimations(); 2034 if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { 2035 exec(); 2036 } 2037 }); 2038 } 2039 if (waitForStartingStyleRemoved) { 2040 const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle; 2041 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 2042 frame.request(exec); 2043 return; 2044 } 2045 const attributeObserver = new MutationObserver(() => { 2046 if (!resolvedElement.hasAttribute(startingStyleAttribute)) { 2047 attributeObserver.disconnect(); 2048 exec(); 2049 } 2050 }); 2051 attributeObserver.observe(resolvedElement, { 2052 attributes: true, 2053 attributeFilter: [startingStyleAttribute] 2054 }); 2055 signal?.addEventListener("abort", () => attributeObserver.disconnect(), { 2056 once: true 2057 }); 2058 return; 2059 } 2060 frame.request(exec); 2061 }); 2062 } 2063 2064 // node_modules/@base-ui/react/esm/internals/useOpenChangeComplete.js 2065 function useOpenChangeComplete(parameters) { 2066 const { 2067 enabled = true, 2068 open, 2069 ref, 2070 onComplete: onCompleteParam 2071 } = parameters; 2072 const onComplete = useStableCallback(onCompleteParam); 2073 const runOnceAnimationsFinish = useAnimationsFinished(ref, open, false); 2074 React12.useEffect(() => { 2075 if (!enabled) { 2076 return void 0; 2077 } 2078 const abortController = new AbortController(); 2079 runOnceAnimationsFinish(onComplete, abortController.signal); 2080 return () => { 2081 abortController.abort(); 2082 }; 2083 }, [enabled, open, onComplete, runOnceAnimationsFinish]); 2084 } 2085 2086 // node_modules/@base-ui/utils/esm/useOnFirstRender.js 2087 var React13 = __toESM(require_react(), 1); 2088 function useOnFirstRender(fn) { 2089 const ref = React13.useRef(true); 2090 if (ref.current) { 2091 ref.current = false; 2092 fn(); 2093 } 2094 } 2095 2096 // node_modules/@base-ui/utils/esm/useTimeout.js 2097 var EMPTY3 = 0; 2098 var Timeout = class _Timeout { 2099 static create() { 2100 return new _Timeout(); 2101 } 2102 currentId = EMPTY3; 2103 /** 2104 * Executes `fn` after `delay`, clearing any previously scheduled call. 2105 */ 2106 start(delay, fn) { 2107 this.clear(); 2108 this.currentId = setTimeout(() => { 2109 this.currentId = EMPTY3; 2110 fn(); 2111 }, delay); 2112 } 2113 isStarted() { 2114 return this.currentId !== EMPTY3; 2115 } 2116 clear = () => { 2117 if (this.currentId !== EMPTY3) { 2118 clearTimeout(this.currentId); 2119 this.currentId = EMPTY3; 2120 } 2121 }; 2122 disposeEffect = () => { 2123 return this.clear; 2124 }; 2125 }; 2126 function useTimeout() { 2127 const timeout = useRefWithInit(Timeout.create).current; 2128 useOnMount(timeout.disposeEffect); 2129 return timeout; 2130 } 2131 2132 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingDelayGroup.js 2133 var React14 = __toESM(require_react(), 1); 2134 2135 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverShared.js 2136 function resolveValue(value, pointerType) { 2137 if (pointerType != null && !isMouseLikePointerType(pointerType)) { 2138 return 0; 2139 } 2140 if (typeof value === "function") { 2141 return value(); 2142 } 2143 return value; 2144 } 2145 function getDelay(value, prop, pointerType) { 2146 const result = resolveValue(value, pointerType); 2147 if (typeof result === "number") { 2148 return result; 2149 } 2150 return result?.[prop]; 2151 } 2152 function getRestMs(value) { 2153 if (typeof value === "function") { 2154 return value(); 2155 } 2156 return value; 2157 } 2158 function isClickLikeOpenEvent(openEventType, interactedInside) { 2159 return interactedInside || openEventType === "click" || openEventType === "mousedown"; 2160 } 2161 function isHoverOpenEvent(openEventType) { 2162 return openEventType?.includes("mouse") && openEventType !== "mousedown"; 2163 } 2164 2165 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingDelayGroup.js 2166 var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); 2167 var FloatingDelayGroupContext = /* @__PURE__ */ React14.createContext({ 2168 hasProvider: false, 2169 timeoutMs: 0, 2170 delayRef: { 2171 current: 0 2172 }, 2173 initialDelayRef: { 2174 current: 0 2175 }, 2176 timeout: new Timeout(), 2177 currentIdRef: { 2178 current: null 2179 }, 2180 currentContextRef: { 2181 current: null 2182 } 2183 }); 2184 if (true) FloatingDelayGroupContext.displayName = "FloatingDelayGroupContext"; 2185 function FloatingDelayGroup(props) { 2186 const { 2187 children, 2188 delay, 2189 timeoutMs = 0 2190 } = props; 2191 const delayRef = React14.useRef(delay); 2192 const initialDelayRef = React14.useRef(delay); 2193 const currentIdRef = React14.useRef(null); 2194 const currentContextRef = React14.useRef(null); 2195 const timeout = useTimeout(); 2196 return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FloatingDelayGroupContext.Provider, { 2197 value: React14.useMemo(() => ({ 2198 hasProvider: true, 2199 delayRef, 2200 initialDelayRef, 2201 currentIdRef, 2202 timeoutMs, 2203 currentContextRef, 2204 timeout 2205 }), [timeoutMs, timeout]), 2206 children 2207 }); 2208 } 2209 function useDelayGroup(context, options = { 2210 open: false 2211 }) { 2212 const { 2213 open 2214 } = options; 2215 const store = "rootStore" in context ? context.rootStore : context; 2216 const floatingId = store.useState("floatingId"); 2217 const groupContext = React14.useContext(FloatingDelayGroupContext); 2218 const { 2219 currentIdRef, 2220 delayRef, 2221 timeoutMs, 2222 initialDelayRef, 2223 currentContextRef, 2224 hasProvider, 2225 timeout 2226 } = groupContext; 2227 const [isInstantPhase, setIsInstantPhase] = React14.useState(false); 2228 useIsoLayoutEffect(() => { 2229 function unset() { 2230 setIsInstantPhase(false); 2231 currentContextRef.current?.setIsInstantPhase(false); 2232 currentIdRef.current = null; 2233 currentContextRef.current = null; 2234 delayRef.current = initialDelayRef.current; 2235 } 2236 if (!currentIdRef.current) { 2237 return void 0; 2238 } 2239 if (!open && currentIdRef.current === floatingId) { 2240 setIsInstantPhase(false); 2241 if (timeoutMs) { 2242 const closingId = floatingId; 2243 timeout.start(timeoutMs, () => { 2244 if (store.select("open") || currentIdRef.current && currentIdRef.current !== closingId) { 2245 return; 2246 } 2247 unset(); 2248 }); 2249 return () => { 2250 timeout.clear(); 2251 }; 2252 } 2253 unset(); 2254 } 2255 return void 0; 2256 }, [open, floatingId, currentIdRef, delayRef, timeoutMs, initialDelayRef, currentContextRef, timeout, store]); 2257 useIsoLayoutEffect(() => { 2258 if (!open) { 2259 return; 2260 } 2261 const prevContext = currentContextRef.current; 2262 const prevId = currentIdRef.current; 2263 timeout.clear(); 2264 currentContextRef.current = { 2265 onOpenChange: store.setOpen, 2266 setIsInstantPhase 2267 }; 2268 currentIdRef.current = floatingId; 2269 delayRef.current = { 2270 open: 0, 2271 close: getDelay(initialDelayRef.current, "close") 2272 }; 2273 if (prevId !== null && prevId !== floatingId) { 2274 setIsInstantPhase(true); 2275 prevContext?.setIsInstantPhase(true); 2276 prevContext?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.none)); 2277 } else { 2278 setIsInstantPhase(false); 2279 prevContext?.setIsInstantPhase(false); 2280 } 2281 }, [open, floatingId, store, currentIdRef, delayRef, initialDelayRef, currentContextRef, timeout]); 2282 useIsoLayoutEffect(() => { 2283 return () => { 2284 currentContextRef.current = null; 2285 }; 2286 }, [currentContextRef]); 2287 return React14.useMemo(() => ({ 2288 hasProvider, 2289 delayRef, 2290 isInstantPhase 2291 }), [hasProvider, delayRef, isInstantPhase]); 2292 } 2293 2294 // node_modules/@base-ui/utils/esm/mergeCleanups.js 2295 function mergeCleanups(...cleanups) { 2296 return () => { 2297 for (let i2 = 0; i2 < cleanups.length; i2 += 1) { 2298 const cleanup = cleanups[i2]; 2299 if (cleanup) { 2300 cleanup(); 2301 } 2302 } 2303 }; 2304 } 2305 2306 // node_modules/@base-ui/react/esm/utils/FocusGuard.js 2307 var React15 = __toESM(require_react(), 1); 2308 2309 // node_modules/@base-ui/utils/esm/visuallyHidden.js 2310 var visuallyHiddenBase = { 2311 clipPath: "inset(50%)", 2312 overflow: "hidden", 2313 whiteSpace: "nowrap", 2314 border: 0, 2315 padding: 0, 2316 width: 1, 2317 height: 1, 2318 margin: -1 2319 }; 2320 var visuallyHidden = { 2321 ...visuallyHiddenBase, 2322 position: "fixed", 2323 top: 0, 2324 left: 0 2325 }; 2326 var visuallyHiddenInput = { 2327 ...visuallyHiddenBase, 2328 position: "absolute" 2329 }; 2330 2331 // node_modules/@base-ui/react/esm/utils/FocusGuard.js 2332 var import_jsx_runtime2 = __toESM(require_jsx_runtime(), 1); 2333 var FocusGuard = /* @__PURE__ */ React15.forwardRef(function FocusGuard2(props, ref) { 2334 const [role, setRole] = React15.useState(); 2335 useIsoLayoutEffect(() => { 2336 if (isSafari) { 2337 setRole("button"); 2338 } 2339 }, []); 2340 const restProps = { 2341 tabIndex: 0, 2342 // Role is only for VoiceOver 2343 role 2344 }; 2345 return /* @__PURE__ */ (0, import_jsx_runtime2.jsx)("span", { 2346 ...props, 2347 ref, 2348 style: visuallyHidden, 2349 "aria-hidden": role ? void 0 : true, 2350 ...restProps, 2351 "data-base-ui-focus-guard": "" 2352 }); 2353 }); 2354 if (true) FocusGuard.displayName = "FocusGuard"; 2355 2356 // node_modules/@base-ui/react/esm/floating-ui-react/utils/createAttribute.js 2357 function createAttribute(name2) { 2358 return `data-base-ui-$name2}`; 2359 } 2360 2361 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingPortal.js 2362 var React16 = __toESM(require_react(), 1); 2363 var ReactDOM2 = __toESM(require_react_dom(), 1); 2364 2365 // node_modules/@base-ui/react/esm/internals/constants.js 2366 var DISABLED_TRANSITIONS_STYLE = { 2367 style: { 2368 transition: "none" 2369 } 2370 }; 2371 var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; 2372 var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; 2373 var BASE_UI_SWIPE_IGNORE_SELECTOR = `[$BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; 2374 var LEGACY_SWIPE_IGNORE_SELECTOR = `[$LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; 2375 var POPUP_COLLISION_AVOIDANCE = { 2376 fallbackAxisSide: "end" 2377 }; 2378 var ownerVisuallyHidden = { 2379 clipPath: "inset(50%)", 2380 position: "fixed", 2381 top: 0, 2382 left: 0 2383 }; 2384 2385 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingPortal.js 2386 var import_jsx_runtime3 = __toESM(require_jsx_runtime(), 1); 2387 var PortalContext = /* @__PURE__ */ React16.createContext(null); 2388 if (true) PortalContext.displayName = "PortalContext"; 2389 var usePortalContext = () => React16.useContext(PortalContext); 2390 var attr = createAttribute("portal"); 2391 function useFloatingPortalNode(props = {}) { 2392 const { 2393 ref, 2394 container: containerProp, 2395 componentProps = EMPTY_OBJECT, 2396 elementProps 2397 } = props; 2398 const uniqueId = useId(); 2399 const portalContext = usePortalContext(); 2400 const parentPortalNode = portalContext?.portalNode; 2401 const [containerElement, setContainerElement] = React16.useState(null); 2402 const [portalNode, setPortalNode] = React16.useState(null); 2403 const setPortalNodeRef = useStableCallback((node) => { 2404 if (node !== null) { 2405 setPortalNode(node); 2406 } 2407 }); 2408 const containerRef = React16.useRef(null); 2409 useIsoLayoutEffect(() => { 2410 if (containerProp === null) { 2411 if (containerRef.current) { 2412 containerRef.current = null; 2413 setPortalNode(null); 2414 setContainerElement(null); 2415 } 2416 return; 2417 } 2418 if (uniqueId == null) { 2419 return; 2420 } 2421 const resolvedContainer = (containerProp && (isNode(containerProp) ? containerProp : containerProp.current)) ?? parentPortalNode ?? document.body; 2422 if (resolvedContainer == null) { 2423 if (containerRef.current) { 2424 containerRef.current = null; 2425 setPortalNode(null); 2426 setContainerElement(null); 2427 } 2428 return; 2429 } 2430 if (containerRef.current !== resolvedContainer) { 2431 containerRef.current = resolvedContainer; 2432 setPortalNode(null); 2433 setContainerElement(resolvedContainer); 2434 } 2435 }, [containerProp, parentPortalNode, uniqueId]); 2436 const portalElement = useRenderElement("div", componentProps, { 2437 ref: [ref, setPortalNodeRef], 2438 props: [{ 2439 id: uniqueId, 2440 [attr]: "" 2441 }, elementProps] 2442 }); 2443 const portalSubtree = containerElement && portalElement ? /* @__PURE__ */ ReactDOM2.createPortal(portalElement, containerElement) : null; 2444 return { 2445 portalNode, 2446 portalSubtree 2447 }; 2448 } 2449 var FloatingPortal = /* @__PURE__ */ React16.forwardRef(function FloatingPortal2(componentProps, forwardedRef) { 2450 const { 2451 render, 2452 className, 2453 style, 2454 children, 2455 container, 2456 renderGuards, 2457 ...elementProps 2458 } = componentProps; 2459 const { 2460 portalNode, 2461 portalSubtree 2462 } = useFloatingPortalNode({ 2463 container, 2464 ref: forwardedRef, 2465 componentProps, 2466 elementProps 2467 }); 2468 const beforeOutsideRef = React16.useRef(null); 2469 const afterOutsideRef = React16.useRef(null); 2470 const beforeInsideRef = React16.useRef(null); 2471 const afterInsideRef = React16.useRef(null); 2472 const [focusManagerState, setFocusManagerState] = React16.useState(null); 2473 const focusInsideDisabledRef = React16.useRef(false); 2474 const modal = focusManagerState?.modal; 2475 const open = focusManagerState?.open; 2476 const shouldRenderGuards = typeof renderGuards === "boolean" ? renderGuards : !!focusManagerState && !focusManagerState.modal && focusManagerState.open && !!portalNode; 2477 React16.useEffect(() => { 2478 if (!portalNode || modal) { 2479 return void 0; 2480 } 2481 function onFocus(event) { 2482 if (portalNode && event.relatedTarget && isOutsideEvent(event)) { 2483 if (event.type === "focusin") { 2484 if (focusInsideDisabledRef.current) { 2485 enableFocusInside(portalNode); 2486 focusInsideDisabledRef.current = false; 2487 } 2488 } else { 2489 disableFocusInside(portalNode); 2490 focusInsideDisabledRef.current = true; 2491 } 2492 } 2493 } 2494 return mergeCleanups(addEventListener(portalNode, "focusin", onFocus, true), addEventListener(portalNode, "focusout", onFocus, true)); 2495 }, [portalNode, modal]); 2496 React16.useEffect(() => { 2497 if (!portalNode || open !== false) { 2498 return; 2499 } 2500 enableFocusInside(portalNode); 2501 focusInsideDisabledRef.current = false; 2502 }, [open, portalNode]); 2503 const portalContextValue = React16.useMemo(() => ({ 2504 beforeOutsideRef, 2505 afterOutsideRef, 2506 beforeInsideRef, 2507 afterInsideRef, 2508 portalNode, 2509 setFocusManagerState 2510 }), [portalNode]); 2511 return /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(React16.Fragment, { 2512 children: [portalSubtree, /* @__PURE__ */ (0, import_jsx_runtime3.jsxs)(PortalContext.Provider, { 2513 value: portalContextValue, 2514 children: [shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { 2515 "data-type": "outside", 2516 ref: beforeOutsideRef, 2517 onFocus: (event) => { 2518 if (isOutsideEvent(event, portalNode)) { 2519 beforeInsideRef.current?.focus(); 2520 } else { 2521 const domReference = focusManagerState ? focusManagerState.domReference : null; 2522 const prevTabbable = getPreviousTabbable(domReference); 2523 prevTabbable?.focus(); 2524 } 2525 } 2526 }), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)("span", { 2527 "aria-owns": portalNode.id, 2528 style: ownerVisuallyHidden 2529 }), portalNode && /* @__PURE__ */ ReactDOM2.createPortal(children, portalNode), shouldRenderGuards && portalNode && /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(FocusGuard, { 2530 "data-type": "outside", 2531 ref: afterOutsideRef, 2532 onFocus: (event) => { 2533 if (isOutsideEvent(event, portalNode)) { 2534 afterInsideRef.current?.focus(); 2535 } else { 2536 const domReference = focusManagerState ? focusManagerState.domReference : null; 2537 const nextTabbable = getNextTabbable(domReference); 2538 nextTabbable?.focus(); 2539 if (focusManagerState?.closeOnFocusOut) { 2540 focusManagerState?.onOpenChange(false, createChangeEventDetails(reason_parts_exports.focusOut, event.nativeEvent)); 2541 } 2542 } 2543 } 2544 })] 2545 })] 2546 }); 2547 }); 2548 if (true) FloatingPortal.displayName = "FloatingPortal"; 2549 2550 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingTree.js 2551 var React17 = __toESM(require_react(), 1); 2552 2553 // node_modules/@base-ui/react/esm/floating-ui-react/utils/createEventEmitter.js 2554 function createEventEmitter() { 2555 const map = /* @__PURE__ */ new Map(); 2556 return { 2557 emit(event, data) { 2558 map.get(event)?.forEach((listener) => listener(data)); 2559 }, 2560 on(event, listener) { 2561 if (!map.has(event)) { 2562 map.set(event, /* @__PURE__ */ new Set()); 2563 } 2564 map.get(event).add(listener); 2565 }, 2566 off(event, listener) { 2567 map.get(event)?.delete(listener); 2568 } 2569 }; 2570 } 2571 2572 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingTree.js 2573 var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1); 2574 var FloatingNodeContext = /* @__PURE__ */ React17.createContext(null); 2575 if (true) FloatingNodeContext.displayName = "FloatingNodeContext"; 2576 var FloatingTreeContext = /* @__PURE__ */ React17.createContext(null); 2577 if (true) FloatingTreeContext.displayName = "FloatingTreeContext"; 2578 var useFloatingParentNodeId = () => React17.useContext(FloatingNodeContext)?.id || null; 2579 var useFloatingTree = (externalTree) => { 2580 const contextTree = React17.useContext(FloatingTreeContext); 2581 return externalTree ?? contextTree; 2582 }; 2583 2584 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useClientPoint.js 2585 var React18 = __toESM(require_react(), 1); 2586 function createVirtualElement(domElement, data) { 2587 let offsetX = null; 2588 let offsetY = null; 2589 let isAutoUpdateEvent = false; 2590 return { 2591 contextElement: domElement || void 0, 2592 getBoundingClientRect() { 2593 const domRect = domElement?.getBoundingClientRect() || { 2594 width: 0, 2595 height: 0, 2596 x: 0, 2597 y: 0 2598 }; 2599 const isXAxis = data.axis === "x" || data.axis === "both"; 2600 const isYAxis = data.axis === "y" || data.axis === "both"; 2601 const canTrackCursorOnAutoUpdate = ["mouseenter", "mousemove"].includes(data.dataRef.current.openEvent?.type || "") && data.pointerType !== "touch"; 2602 let width = domRect.width; 2603 let height = domRect.height; 2604 let x2 = domRect.x; 2605 let y2 = domRect.y; 2606 if (offsetX == null && data.x && isXAxis) { 2607 offsetX = domRect.x - data.x; 2608 } 2609 if (offsetY == null && data.y && isYAxis) { 2610 offsetY = domRect.y - data.y; 2611 } 2612 x2 -= offsetX || 0; 2613 y2 -= offsetY || 0; 2614 width = 0; 2615 height = 0; 2616 if (!isAutoUpdateEvent || canTrackCursorOnAutoUpdate) { 2617 width = data.axis === "y" ? domRect.width : 0; 2618 height = data.axis === "x" ? domRect.height : 0; 2619 x2 = isXAxis && data.x != null ? data.x : x2; 2620 y2 = isYAxis && data.y != null ? data.y : y2; 2621 } else if (isAutoUpdateEvent && !canTrackCursorOnAutoUpdate) { 2622 height = data.axis === "x" ? domRect.height : height; 2623 width = data.axis === "y" ? domRect.width : width; 2624 } 2625 isAutoUpdateEvent = true; 2626 return { 2627 width, 2628 height, 2629 x: x2, 2630 y: y2, 2631 top: y2, 2632 right: x2 + width, 2633 bottom: y2 + height, 2634 left: x2 2635 }; 2636 } 2637 }; 2638 } 2639 function isMouseBasedEvent(event) { 2640 return event != null && event.clientX != null; 2641 } 2642 function useClientPoint(context, props = {}) { 2643 const { 2644 enabled = true, 2645 axis = "both" 2646 } = props; 2647 const store = "rootStore" in context ? context.rootStore : context; 2648 const open = store.useState("open"); 2649 const floating = store.useState("floatingElement"); 2650 const domReference = store.useState("domReferenceElement"); 2651 const dataRef = store.context.dataRef; 2652 const initialRef = React18.useRef(false); 2653 const cleanupListenerRef = React18.useRef(null); 2654 const [pointerType, setPointerType] = React18.useState(); 2655 const [reactive, setReactive] = React18.useState([]); 2656 const resetReference = useStableCallback((reference2) => { 2657 store.set("positionReference", reference2); 2658 }); 2659 const setReference = useStableCallback((newX, newY, referenceElement) => { 2660 if (initialRef.current) { 2661 return; 2662 } 2663 if (dataRef.current.openEvent && !isMouseBasedEvent(dataRef.current.openEvent)) { 2664 return; 2665 } 2666 store.set("positionReference", createVirtualElement(referenceElement ?? domReference, { 2667 x: newX, 2668 y: newY, 2669 axis, 2670 dataRef, 2671 pointerType 2672 })); 2673 }); 2674 const handleReferenceEnterOrMove = useStableCallback((event) => { 2675 if (!open) { 2676 setReference(event.clientX, event.clientY, event.currentTarget); 2677 } else if (!cleanupListenerRef.current) { 2678 setReference(event.clientX, event.clientY, event.currentTarget); 2679 setReactive([]); 2680 } 2681 }); 2682 const openCheck = isMouseLikePointerType(pointerType) ? floating : open; 2683 React18.useEffect(() => { 2684 if (!enabled) { 2685 resetReference(domReference); 2686 return void 0; 2687 } 2688 if (!openCheck) { 2689 return void 0; 2690 } 2691 function cleanupListener() { 2692 cleanupListenerRef.current?.(); 2693 cleanupListenerRef.current = null; 2694 } 2695 const win = getWindow(floating); 2696 function handleMouseMove(event) { 2697 const target = getTarget(event); 2698 if (!contains(floating, target)) { 2699 setReference(event.clientX, event.clientY); 2700 } else { 2701 cleanupListener(); 2702 } 2703 } 2704 if (!dataRef.current.openEvent || isMouseBasedEvent(dataRef.current.openEvent)) { 2705 cleanupListenerRef.current = addEventListener(win, "mousemove", handleMouseMove); 2706 } else { 2707 resetReference(domReference); 2708 } 2709 return cleanupListener; 2710 }, [openCheck, enabled, floating, dataRef, domReference, store, setReference, resetReference, reactive]); 2711 React18.useEffect(() => () => { 2712 store.set("positionReference", null); 2713 }, [store]); 2714 React18.useEffect(() => { 2715 if (enabled && !floating) { 2716 initialRef.current = false; 2717 } 2718 }, [enabled, floating]); 2719 React18.useEffect(() => { 2720 if (!enabled && open) { 2721 initialRef.current = true; 2722 } 2723 }, [enabled, open]); 2724 const reference = React18.useMemo(() => { 2725 function setPointerTypeRef(event) { 2726 setPointerType(event.pointerType); 2727 } 2728 return { 2729 onPointerDown: setPointerTypeRef, 2730 onPointerEnter: setPointerTypeRef, 2731 onMouseMove: handleReferenceEnterOrMove, 2732 onMouseEnter: handleReferenceEnterOrMove 2733 }; 2734 }, [handleReferenceEnterOrMove]); 2735 return React18.useMemo(() => enabled ? { 2736 reference, 2737 trigger: reference 2738 } : {}, [enabled, reference]); 2739 } 2740 2741 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useDismiss.js 2742 var React19 = __toESM(require_react(), 1); 2743 var bubbleHandlerKeys = { 2744 intentional: "onClick", 2745 sloppy: "onPointerDown" 2746 }; 2747 function alwaysFalse() { 2748 return false; 2749 } 2750 function normalizeProp(normalizable) { 2751 return { 2752 escapeKey: typeof normalizable === "boolean" ? normalizable : normalizable?.escapeKey ?? false, 2753 outsidePress: typeof normalizable === "boolean" ? normalizable : normalizable?.outsidePress ?? true 2754 }; 2755 } 2756 function useDismiss(context, props = {}) { 2757 const { 2758 enabled = true, 2759 escapeKey: escapeKey2 = true, 2760 outsidePress: outsidePressProp = true, 2761 outsidePressEvent = "sloppy", 2762 referencePress = alwaysFalse, 2763 referencePressEvent = "sloppy", 2764 bubbles, 2765 externalTree 2766 } = props; 2767 const store = "rootStore" in context ? context.rootStore : context; 2768 const open = store.useState("open"); 2769 const floatingElement = store.useState("floatingElement"); 2770 const { 2771 dataRef 2772 } = store.context; 2773 const tree = useFloatingTree(externalTree); 2774 const outsidePressFn = useStableCallback(typeof outsidePressProp === "function" ? outsidePressProp : () => false); 2775 const outsidePress2 = typeof outsidePressProp === "function" ? outsidePressFn : outsidePressProp; 2776 const outsidePressEnabled = outsidePress2 !== false; 2777 const getOutsidePressEventProp = useStableCallback(() => outsidePressEvent); 2778 const { 2779 escapeKey: escapeKeyBubbles, 2780 outsidePress: outsidePressBubbles 2781 } = normalizeProp(bubbles); 2782 const pressStartedInsideRef = React19.useRef(false); 2783 const pressStartPreventedRef = React19.useRef(false); 2784 const suppressNextOutsideClickRef = React19.useRef(false); 2785 const isComposingRef = React19.useRef(false); 2786 const currentPointerTypeRef = React19.useRef(""); 2787 const touchStateRef = React19.useRef(null); 2788 const cancelDismissOnEndTimeout = useTimeout(); 2789 const clearInsideReactTreeTimeout = useTimeout(); 2790 const clearInsideReactTree = useStableCallback(() => { 2791 clearInsideReactTreeTimeout.clear(); 2792 dataRef.current.insideReactTree = false; 2793 }); 2794 const hasBlockingChild = useStableCallback((bubbleKey) => { 2795 const nodeId = dataRef.current.floatingContext?.nodeId; 2796 const children = tree ? getNodeChildren(tree.nodesRef.current, nodeId) : []; 2797 return children.some((child) => child.context?.open && !child.context.dataRef.current[bubbleKey]); 2798 }); 2799 const isEventWithinOwnElements = useStableCallback((event) => { 2800 return isEventTargetWithin(event, store.select("floatingElement")) || isEventTargetWithin(event, store.select("domReferenceElement")); 2801 }); 2802 const closeOnReferencePress = useStableCallback((event) => { 2803 if (!referencePress()) { 2804 return; 2805 } 2806 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent)); 2807 }); 2808 const closeOnEscapeKeyDown = useStableCallback((event) => { 2809 if (!open || !enabled || !escapeKey2 || event.key !== "Escape") { 2810 return; 2811 } 2812 if (isComposingRef.current) { 2813 return; 2814 } 2815 if (!escapeKeyBubbles && hasBlockingChild("__escapeKeyBubbles")) { 2816 return; 2817 } 2818 const native = isReactEvent(event) ? event.nativeEvent : event; 2819 const eventDetails = createChangeEventDetails(reason_parts_exports.escapeKey, native); 2820 store.setOpen(false, eventDetails); 2821 if (!eventDetails.isCanceled) { 2822 event.preventDefault(); 2823 } 2824 if (!escapeKeyBubbles && !eventDetails.isPropagationAllowed) { 2825 event.stopPropagation(); 2826 } 2827 }); 2828 const markInsideReactTree = useStableCallback(() => { 2829 dataRef.current.insideReactTree = true; 2830 clearInsideReactTreeTimeout.start(0, clearInsideReactTree); 2831 }); 2832 const markPressStartedInsideReactTree = useStableCallback((event) => { 2833 if (!open || !enabled || event.button !== 0) { 2834 return; 2835 } 2836 const target = getTarget(event.nativeEvent); 2837 if (!contains(store.select("floatingElement"), target)) { 2838 return; 2839 } 2840 if (!pressStartedInsideRef.current) { 2841 pressStartedInsideRef.current = true; 2842 pressStartPreventedRef.current = false; 2843 } 2844 }); 2845 const markInsidePressStartPrevented = useStableCallback((event) => { 2846 if (!open || !enabled) { 2847 return; 2848 } 2849 if (!(event.defaultPrevented || event.nativeEvent.defaultPrevented)) { 2850 return; 2851 } 2852 if (pressStartedInsideRef.current) { 2853 pressStartPreventedRef.current = true; 2854 } 2855 }); 2856 React19.useEffect(() => { 2857 if (!open || !enabled) { 2858 return void 0; 2859 } 2860 dataRef.current.__escapeKeyBubbles = escapeKeyBubbles; 2861 dataRef.current.__outsidePressBubbles = outsidePressBubbles; 2862 const compositionTimeout = new Timeout(); 2863 const preventedPressSuppressionTimeout = new Timeout(); 2864 function handleCompositionStart() { 2865 compositionTimeout.clear(); 2866 isComposingRef.current = true; 2867 } 2868 function handleCompositionEnd() { 2869 compositionTimeout.start( 2870 // 0ms or 1ms don't work in Safari. 5ms appears to consistently work. 2871 // Only apply to WebKit for the test to remain 0ms. 2872 isWebKit() ? 5 : 0, 2873 () => { 2874 isComposingRef.current = false; 2875 } 2876 ); 2877 } 2878 function suppressImmediateOutsideClickAfterPreventedStart() { 2879 suppressNextOutsideClickRef.current = true; 2880 preventedPressSuppressionTimeout.start(0, () => { 2881 suppressNextOutsideClickRef.current = false; 2882 }); 2883 } 2884 function resetPressStartState() { 2885 pressStartedInsideRef.current = false; 2886 pressStartPreventedRef.current = false; 2887 } 2888 function getOutsidePressEvent() { 2889 const type = currentPointerTypeRef.current; 2890 const computedType = type === "pen" || !type ? "mouse" : type; 2891 const outsidePressEventValue = getOutsidePressEventProp(); 2892 const resolved = typeof outsidePressEventValue === "function" ? outsidePressEventValue() : outsidePressEventValue; 2893 if (typeof resolved === "string") { 2894 return resolved; 2895 } 2896 return resolved[computedType]; 2897 } 2898 function shouldIgnoreEvent(event) { 2899 const computedOutsidePressEvent = getOutsidePressEvent(); 2900 return computedOutsidePressEvent === "intentional" && event.type !== "click" || computedOutsidePressEvent === "sloppy" && event.type === "click"; 2901 } 2902 function isEventWithinFloatingTree(event) { 2903 const nodeId = dataRef.current.floatingContext?.nodeId; 2904 const targetIsInsideChildren = tree && getNodeChildren(tree.nodesRef.current, nodeId).some((node) => isEventTargetWithin(event, node.context?.elements.floating)); 2905 return isEventWithinOwnElements(event) || targetIsInsideChildren; 2906 } 2907 function closeOnPressOutside(event) { 2908 if (shouldIgnoreEvent(event)) { 2909 if (event.type !== "click" && !isEventWithinOwnElements(event)) { 2910 preventedPressSuppressionTimeout.clear(); 2911 suppressNextOutsideClickRef.current = false; 2912 } 2913 clearInsideReactTree(); 2914 return; 2915 } 2916 if (dataRef.current.insideReactTree) { 2917 clearInsideReactTree(); 2918 return; 2919 } 2920 const target = getTarget(event); 2921 const inertSelector = `[$createAttribute("inert")}]`; 2922 const targetRoot = isElement(target) ? target.getRootNode() : null; 2923 const markers = Array.from((isShadowRoot(targetRoot) ? targetRoot : ownerDocument(store.select("floatingElement"))).querySelectorAll(inertSelector)); 2924 const triggers = store.context.triggerElements; 2925 if (target && (triggers.hasElement(target) || triggers.hasMatchingElement((trigger) => contains(trigger, target)))) { 2926 return; 2927 } 2928 let targetRootAncestor = isElement(target) ? target : null; 2929 while (targetRootAncestor && !isLastTraversableNode(targetRootAncestor)) { 2930 const nextParent = getParentNode(targetRootAncestor); 2931 if (isLastTraversableNode(nextParent) || !isElement(nextParent)) { 2932 break; 2933 } 2934 targetRootAncestor = nextParent; 2935 } 2936 if (markers.length && isElement(target) && !isRootElement(target) && // Clicked on a direct ancestor (e.g. FloatingOverlay). 2937 !contains(target, store.select("floatingElement")) && // If the target root element contains none of the markers, then the 2938 // element was injected after the floating element rendered. 2939 markers.every((marker) => !contains(targetRootAncestor, marker))) { 2940 return; 2941 } 2942 if (isHTMLElement(target) && !("touches" in event)) { 2943 const lastTraversableNode = isLastTraversableNode(target); 2944 const style = getComputedStyle2(target); 2945 const scrollRe = /auto|scroll/; 2946 const isScrollableX = lastTraversableNode || scrollRe.test(style.overflowX); 2947 const isScrollableY = lastTraversableNode || scrollRe.test(style.overflowY); 2948 const canScrollX = isScrollableX && target.clientWidth > 0 && target.scrollWidth > target.clientWidth; 2949 const canScrollY = isScrollableY && target.clientHeight > 0 && target.scrollHeight > target.clientHeight; 2950 const isRTL12 = style.direction === "rtl"; 2951 const pressedVerticalScrollbar = canScrollY && (isRTL12 ? event.offsetX <= target.offsetWidth - target.clientWidth : event.offsetX > target.clientWidth); 2952 const pressedHorizontalScrollbar = canScrollX && event.offsetY > target.clientHeight; 2953 if (pressedVerticalScrollbar || pressedHorizontalScrollbar) { 2954 return; 2955 } 2956 } 2957 if (isEventWithinFloatingTree(event)) { 2958 return; 2959 } 2960 if (getOutsidePressEvent() === "intentional" && suppressNextOutsideClickRef.current) { 2961 preventedPressSuppressionTimeout.clear(); 2962 suppressNextOutsideClickRef.current = false; 2963 return; 2964 } 2965 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 2966 return; 2967 } 2968 if (hasBlockingChild("__outsidePressBubbles")) { 2969 return; 2970 } 2971 store.setOpen(false, createChangeEventDetails(reason_parts_exports.outsidePress, event)); 2972 clearInsideReactTree(); 2973 } 2974 function handlePointerDown(event) { 2975 if (getOutsidePressEvent() !== "sloppy" || event.pointerType === "touch" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) { 2976 return; 2977 } 2978 closeOnPressOutside(event); 2979 } 2980 function handleTouchStart(event) { 2981 if (getOutsidePressEvent() !== "sloppy" || !store.select("open") || !enabled || isEventWithinOwnElements(event)) { 2982 return; 2983 } 2984 const touch = event.touches[0]; 2985 if (touch) { 2986 touchStateRef.current = { 2987 startTime: Date.now(), 2988 startX: touch.clientX, 2989 startY: touch.clientY, 2990 dismissOnTouchEnd: false, 2991 dismissOnMouseDown: true 2992 }; 2993 cancelDismissOnEndTimeout.start(1e3, () => { 2994 if (touchStateRef.current) { 2995 touchStateRef.current.dismissOnTouchEnd = false; 2996 touchStateRef.current.dismissOnMouseDown = false; 2997 } 2998 }); 2999 } 3000 } 3001 function addTargetEventListenerOnce(event, listener) { 3002 const target = getTarget(event); 3003 if (!target) { 3004 return; 3005 } 3006 const unsubscribe2 = addEventListener(target, event.type, () => { 3007 listener(event); 3008 unsubscribe2(); 3009 }); 3010 } 3011 function handleTouchStartCapture(event) { 3012 currentPointerTypeRef.current = "touch"; 3013 addTargetEventListenerOnce(event, handleTouchStart); 3014 } 3015 function closeOnPressOutsideCapture(event) { 3016 cancelDismissOnEndTimeout.clear(); 3017 if (event.type === "pointerdown") { 3018 currentPointerTypeRef.current = event.pointerType; 3019 } 3020 if (event.type === "mousedown" && touchStateRef.current && !touchStateRef.current.dismissOnMouseDown) { 3021 return; 3022 } 3023 addTargetEventListenerOnce(event, (targetEvent) => { 3024 if (targetEvent.type === "pointerdown") { 3025 handlePointerDown(targetEvent); 3026 } else { 3027 closeOnPressOutside(targetEvent); 3028 } 3029 }); 3030 } 3031 function handlePressEndCapture(event) { 3032 if (!pressStartedInsideRef.current) { 3033 return; 3034 } 3035 const pressStartedInsideDefaultPrevented = pressStartPreventedRef.current; 3036 resetPressStartState(); 3037 if (getOutsidePressEvent() !== "intentional") { 3038 return; 3039 } 3040 if (event.type === "pointercancel") { 3041 if (pressStartedInsideDefaultPrevented) { 3042 suppressImmediateOutsideClickAfterPreventedStart(); 3043 } 3044 return; 3045 } 3046 if (isEventWithinFloatingTree(event)) { 3047 return; 3048 } 3049 if (pressStartedInsideDefaultPrevented) { 3050 suppressImmediateOutsideClickAfterPreventedStart(); 3051 return; 3052 } 3053 if (typeof outsidePress2 === "function" && !outsidePress2(event)) { 3054 return; 3055 } 3056 preventedPressSuppressionTimeout.clear(); 3057 suppressNextOutsideClickRef.current = true; 3058 clearInsideReactTree(); 3059 } 3060 function handleTouchMove(event) { 3061 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 3062 return; 3063 } 3064 const touch = event.touches[0]; 3065 if (!touch) { 3066 return; 3067 } 3068 const deltaX = Math.abs(touch.clientX - touchStateRef.current.startX); 3069 const deltaY = Math.abs(touch.clientY - touchStateRef.current.startY); 3070 const distance = Math.sqrt(deltaX * deltaX + deltaY * deltaY); 3071 if (distance > 5) { 3072 touchStateRef.current.dismissOnTouchEnd = true; 3073 } 3074 if (distance > 10) { 3075 closeOnPressOutside(event); 3076 cancelDismissOnEndTimeout.clear(); 3077 touchStateRef.current = null; 3078 } 3079 } 3080 function handleTouchMoveCapture(event) { 3081 addTargetEventListenerOnce(event, handleTouchMove); 3082 } 3083 function handleTouchEnd(event) { 3084 if (getOutsidePressEvent() !== "sloppy" || !touchStateRef.current || isEventWithinOwnElements(event)) { 3085 return; 3086 } 3087 if (touchStateRef.current.dismissOnTouchEnd) { 3088 closeOnPressOutside(event); 3089 } 3090 cancelDismissOnEndTimeout.clear(); 3091 touchStateRef.current = null; 3092 } 3093 function handleTouchEndCapture(event) { 3094 addTargetEventListenerOnce(event, handleTouchEnd); 3095 } 3096 const doc = ownerDocument(floatingElement); 3097 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))); 3098 return () => { 3099 unsubscribe(); 3100 compositionTimeout.clear(); 3101 preventedPressSuppressionTimeout.clear(); 3102 resetPressStartState(); 3103 suppressNextOutsideClickRef.current = false; 3104 }; 3105 }, [dataRef, floatingElement, escapeKey2, outsidePressEnabled, outsidePress2, open, enabled, escapeKeyBubbles, outsidePressBubbles, closeOnEscapeKeyDown, clearInsideReactTree, getOutsidePressEventProp, hasBlockingChild, isEventWithinOwnElements, tree, store, cancelDismissOnEndTimeout]); 3106 React19.useEffect(clearInsideReactTree, [outsidePress2, clearInsideReactTree]); 3107 const reference = React19.useMemo(() => ({ 3108 onKeyDown: closeOnEscapeKeyDown, 3109 [bubbleHandlerKeys[referencePressEvent]]: closeOnReferencePress, 3110 ...referencePressEvent !== "intentional" && { 3111 onClick: closeOnReferencePress 3112 } 3113 }), [closeOnEscapeKeyDown, closeOnReferencePress, referencePressEvent]); 3114 const floating = React19.useMemo(() => ({ 3115 onKeyDown: closeOnEscapeKeyDown, 3116 // `onMouseDown` may be blocked if `event.preventDefault()` is called in 3117 // `onPointerDown`, such as with <NumberField.ScrubArea>. 3118 // See https://github.com/mui/base-ui/pull/3379 3119 onPointerDown: markInsidePressStartPrevented, 3120 onMouseDown: markInsidePressStartPrevented, 3121 onClickCapture: markInsideReactTree, 3122 onMouseDownCapture(event) { 3123 markInsideReactTree(); 3124 markPressStartedInsideReactTree(event); 3125 }, 3126 onPointerDownCapture(event) { 3127 markInsideReactTree(); 3128 markPressStartedInsideReactTree(event); 3129 }, 3130 onMouseUpCapture: markInsideReactTree, 3131 onTouchEndCapture: markInsideReactTree, 3132 onTouchMoveCapture: markInsideReactTree 3133 }), [closeOnEscapeKeyDown, markInsideReactTree, markPressStartedInsideReactTree, markInsidePressStartPrevented]); 3134 return React19.useMemo(() => enabled ? { 3135 reference, 3136 floating, 3137 trigger: reference 3138 } : {}, [enabled, reference, floating]); 3139 } 3140 3141 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloating.js 3142 var React26 = __toESM(require_react(), 1); 3143 3144 // node_modules/@floating-ui/core/dist/floating-ui.core.mjs 3145 function computeCoordsFromPlacement(_ref, placement, rtl) { 3146 let { 3147 reference, 3148 floating 3149 } = _ref; 3150 const sideAxis = getSideAxis(placement); 3151 const alignmentAxis = getAlignmentAxis(placement); 3152 const alignLength = getAxisLength(alignmentAxis); 3153 const side = getSide(placement); 3154 const isVertical = sideAxis === "y"; 3155 const commonX = reference.x + reference.width / 2 - floating.width / 2; 3156 const commonY = reference.y + reference.height / 2 - floating.height / 2; 3157 const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2; 3158 let coords; 3159 switch (side) { 3160 case "top": 3161 coords = { 3162 x: commonX, 3163 y: reference.y - floating.height 3164 }; 3165 break; 3166 case "bottom": 3167 coords = { 3168 x: commonX, 3169 y: reference.y + reference.height 3170 }; 3171 break; 3172 case "right": 3173 coords = { 3174 x: reference.x + reference.width, 3175 y: commonY 3176 }; 3177 break; 3178 case "left": 3179 coords = { 3180 x: reference.x - floating.width, 3181 y: commonY 3182 }; 3183 break; 3184 default: 3185 coords = { 3186 x: reference.x, 3187 y: reference.y 3188 }; 3189 } 3190 switch (getAlignment(placement)) { 3191 case "start": 3192 coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1); 3193 break; 3194 case "end": 3195 coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1); 3196 break; 3197 } 3198 return coords; 3199 } 3200 async function detectOverflow(state, options) { 3201 var _await$platform$isEle; 3202 if (options === void 0) { 3203 options = {}; 3204 } 3205 const { 3206 x: x2, 3207 y: y2, 3208 platform: platform3, 3209 rects, 3210 elements: elements2, 3211 strategy 3212 } = state; 3213 const { 3214 boundary = "clippingAncestors", 3215 rootBoundary = "viewport", 3216 elementContext = "floating", 3217 altBoundary = false, 3218 padding = 0 3219 } = evaluate(options, state); 3220 const paddingObject = getPaddingObject(padding); 3221 const altContext = elementContext === "floating" ? "reference" : "floating"; 3222 const element = elements2[altBoundary ? altContext : elementContext]; 3223 const clippingClientRect = rectToClientRect(await platform3.getClippingRect({ 3224 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(elements2.floating)), 3225 boundary, 3226 rootBoundary, 3227 strategy 3228 })); 3229 const rect = elementContext === "floating" ? { 3230 x: x2, 3231 y: y2, 3232 width: rects.floating.width, 3233 height: rects.floating.height 3234 } : rects.reference; 3235 const offsetParent = await (platform3.getOffsetParent == null ? void 0 : platform3.getOffsetParent(elements2.floating)); 3236 const offsetScale = await (platform3.isElement == null ? void 0 : platform3.isElement(offsetParent)) ? await (platform3.getScale == null ? void 0 : platform3.getScale(offsetParent)) || { 3237 x: 1, 3238 y: 1 3239 } : { 3240 x: 1, 3241 y: 1 3242 }; 3243 const elementClientRect = rectToClientRect(platform3.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform3.convertOffsetParentRelativeRectToViewportRelativeRect({ 3244 elements: elements2, 3245 rect, 3246 offsetParent, 3247 strategy 3248 }) : rect); 3249 return { 3250 top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y, 3251 bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y, 3252 left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x, 3253 right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x 3254 }; 3255 } 3256 var MAX_RESET_COUNT = 50; 3257 var computePosition = async (reference, floating, config) => { 3258 const { 3259 placement = "bottom", 3260 strategy = "absolute", 3261 middleware = [], 3262 platform: platform3 3263 } = config; 3264 const platformWithDetectOverflow = platform3.detectOverflow ? platform3 : { 3265 ...platform3, 3266 detectOverflow 3267 }; 3268 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(floating)); 3269 let rects = await platform3.getElementRects({ 3270 reference, 3271 floating, 3272 strategy 3273 }); 3274 let { 3275 x: x2, 3276 y: y2 3277 } = computeCoordsFromPlacement(rects, placement, rtl); 3278 let statefulPlacement = placement; 3279 let resetCount = 0; 3280 const middlewareData = {}; 3281 for (let i2 = 0; i2 < middleware.length; i2++) { 3282 const currentMiddleware = middleware[i2]; 3283 if (!currentMiddleware) { 3284 continue; 3285 } 3286 const { 3287 name: name2, 3288 fn 3289 } = currentMiddleware; 3290 const { 3291 x: nextX, 3292 y: nextY, 3293 data, 3294 reset 3295 } = await fn({ 3296 x: x2, 3297 y: y2, 3298 initialPlacement: placement, 3299 placement: statefulPlacement, 3300 strategy, 3301 middlewareData, 3302 rects, 3303 platform: platformWithDetectOverflow, 3304 elements: { 3305 reference, 3306 floating 3307 } 3308 }); 3309 x2 = nextX != null ? nextX : x2; 3310 y2 = nextY != null ? nextY : y2; 3311 middlewareData[name2] = { 3312 ...middlewareData[name2], 3313 ...data 3314 }; 3315 if (reset && resetCount < MAX_RESET_COUNT) { 3316 resetCount++; 3317 if (typeof reset === "object") { 3318 if (reset.placement) { 3319 statefulPlacement = reset.placement; 3320 } 3321 if (reset.rects) { 3322 rects = reset.rects === true ? await platform3.getElementRects({ 3323 reference, 3324 floating, 3325 strategy 3326 }) : reset.rects; 3327 } 3328 ({ 3329 x: x2, 3330 y: y2 3331 } = computeCoordsFromPlacement(rects, statefulPlacement, rtl)); 3332 } 3333 i2 = -1; 3334 } 3335 } 3336 return { 3337 x: x2, 3338 y: y2, 3339 placement: statefulPlacement, 3340 strategy, 3341 middlewareData 3342 }; 3343 }; 3344 var flip = function(options) { 3345 if (options === void 0) { 3346 options = {}; 3347 } 3348 return { 3349 name: "flip", 3350 options, 3351 async fn(state) { 3352 var _middlewareData$arrow, _middlewareData$flip; 3353 const { 3354 placement, 3355 middlewareData, 3356 rects, 3357 initialPlacement, 3358 platform: platform3, 3359 elements: elements2 3360 } = state; 3361 const { 3362 mainAxis: checkMainAxis = true, 3363 crossAxis: checkCrossAxis = true, 3364 fallbackPlacements: specifiedFallbackPlacements, 3365 fallbackStrategy = "bestFit", 3366 fallbackAxisSideDirection = "none", 3367 flipAlignment = true, 3368 ...detectOverflowOptions 3369 } = evaluate(options, state); 3370 if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 3371 return {}; 3372 } 3373 const side = getSide(placement); 3374 const initialSideAxis = getSideAxis(initialPlacement); 3375 const isBasePlacement = getSide(initialPlacement) === initialPlacement; 3376 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements2.floating)); 3377 const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement)); 3378 const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none"; 3379 if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) { 3380 fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl)); 3381 } 3382 const placements2 = [initialPlacement, ...fallbackPlacements]; 3383 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3384 const overflows = []; 3385 let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || []; 3386 if (checkMainAxis) { 3387 overflows.push(overflow[side]); 3388 } 3389 if (checkCrossAxis) { 3390 const sides2 = getAlignmentSides(placement, rects, rtl); 3391 overflows.push(overflow[sides2[0]], overflow[sides2[1]]); 3392 } 3393 overflowsData = [...overflowsData, { 3394 placement, 3395 overflows 3396 }]; 3397 if (!overflows.every((side2) => side2 <= 0)) { 3398 var _middlewareData$flip2, _overflowsData$filter; 3399 const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1; 3400 const nextPlacement = placements2[nextIndex]; 3401 if (nextPlacement) { 3402 const ignoreCrossAxisOverflow = checkCrossAxis === "alignment" ? initialSideAxis !== getSideAxis(nextPlacement) : false; 3403 if (!ignoreCrossAxisOverflow || // We leave the current main axis only if every placement on that axis 3404 // overflows the main axis. 3405 overflowsData.every((d2) => getSideAxis(d2.placement) === initialSideAxis ? d2.overflows[0] > 0 : true)) { 3406 return { 3407 data: { 3408 index: nextIndex, 3409 overflows: overflowsData 3410 }, 3411 reset: { 3412 placement: nextPlacement 3413 } 3414 }; 3415 } 3416 } 3417 let resetPlacement = (_overflowsData$filter = overflowsData.filter((d2) => d2.overflows[0] <= 0).sort((a2, b2) => a2.overflows[1] - b2.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement; 3418 if (!resetPlacement) { 3419 switch (fallbackStrategy) { 3420 case "bestFit": { 3421 var _overflowsData$filter2; 3422 const placement2 = (_overflowsData$filter2 = overflowsData.filter((d2) => { 3423 if (hasFallbackAxisSideDirection) { 3424 const currentSideAxis = getSideAxis(d2.placement); 3425 return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal 3426 // reading directions favoring greater width. 3427 currentSideAxis === "y"; 3428 } 3429 return true; 3430 }).map((d2) => [d2.placement, d2.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a2, b2) => a2[1] - b2[1])[0]) == null ? void 0 : _overflowsData$filter2[0]; 3431 if (placement2) { 3432 resetPlacement = placement2; 3433 } 3434 break; 3435 } 3436 case "initialPlacement": 3437 resetPlacement = initialPlacement; 3438 break; 3439 } 3440 } 3441 if (placement !== resetPlacement) { 3442 return { 3443 reset: { 3444 placement: resetPlacement 3445 } 3446 }; 3447 } 3448 } 3449 return {}; 3450 } 3451 }; 3452 }; 3453 function getSideOffsets(overflow, rect) { 3454 return { 3455 top: overflow.top - rect.height, 3456 right: overflow.right - rect.width, 3457 bottom: overflow.bottom - rect.height, 3458 left: overflow.left - rect.width 3459 }; 3460 } 3461 function isAnySideFullyClipped(overflow) { 3462 return sides.some((side) => overflow[side] >= 0); 3463 } 3464 var hide = function(options) { 3465 if (options === void 0) { 3466 options = {}; 3467 } 3468 return { 3469 name: "hide", 3470 options, 3471 async fn(state) { 3472 const { 3473 rects, 3474 platform: platform3 3475 } = state; 3476 const { 3477 strategy = "referenceHidden", 3478 ...detectOverflowOptions 3479 } = evaluate(options, state); 3480 switch (strategy) { 3481 case "referenceHidden": { 3482 const overflow = await platform3.detectOverflow(state, { 3483 ...detectOverflowOptions, 3484 elementContext: "reference" 3485 }); 3486 const offsets = getSideOffsets(overflow, rects.reference); 3487 return { 3488 data: { 3489 referenceHiddenOffsets: offsets, 3490 referenceHidden: isAnySideFullyClipped(offsets) 3491 } 3492 }; 3493 } 3494 case "escaped": { 3495 const overflow = await platform3.detectOverflow(state, { 3496 ...detectOverflowOptions, 3497 altBoundary: true 3498 }); 3499 const offsets = getSideOffsets(overflow, rects.floating); 3500 return { 3501 data: { 3502 escapedOffsets: offsets, 3503 escaped: isAnySideFullyClipped(offsets) 3504 } 3505 }; 3506 } 3507 default: { 3508 return {}; 3509 } 3510 } 3511 } 3512 }; 3513 }; 3514 var originSides = /* @__PURE__ */ new Set(["left", "top"]); 3515 async function convertValueToCoords(state, options) { 3516 const { 3517 placement, 3518 platform: platform3, 3519 elements: elements2 3520 } = state; 3521 const rtl = await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements2.floating)); 3522 const side = getSide(placement); 3523 const alignment = getAlignment(placement); 3524 const isVertical = getSideAxis(placement) === "y"; 3525 const mainAxisMulti = originSides.has(side) ? -1 : 1; 3526 const crossAxisMulti = rtl && isVertical ? -1 : 1; 3527 const rawValue = evaluate(options, state); 3528 let { 3529 mainAxis, 3530 crossAxis, 3531 alignmentAxis 3532 } = typeof rawValue === "number" ? { 3533 mainAxis: rawValue, 3534 crossAxis: 0, 3535 alignmentAxis: null 3536 } : { 3537 mainAxis: rawValue.mainAxis || 0, 3538 crossAxis: rawValue.crossAxis || 0, 3539 alignmentAxis: rawValue.alignmentAxis 3540 }; 3541 if (alignment && typeof alignmentAxis === "number") { 3542 crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis; 3543 } 3544 return isVertical ? { 3545 x: crossAxis * crossAxisMulti, 3546 y: mainAxis * mainAxisMulti 3547 } : { 3548 x: mainAxis * mainAxisMulti, 3549 y: crossAxis * crossAxisMulti 3550 }; 3551 } 3552 var offset = function(options) { 3553 if (options === void 0) { 3554 options = 0; 3555 } 3556 return { 3557 name: "offset", 3558 options, 3559 async fn(state) { 3560 var _middlewareData$offse, _middlewareData$arrow; 3561 const { 3562 x: x2, 3563 y: y2, 3564 placement, 3565 middlewareData 3566 } = state; 3567 const diffCoords = await convertValueToCoords(state, options); 3568 if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) { 3569 return {}; 3570 } 3571 return { 3572 x: x2 + diffCoords.x, 3573 y: y2 + diffCoords.y, 3574 data: { 3575 ...diffCoords, 3576 placement 3577 } 3578 }; 3579 } 3580 }; 3581 }; 3582 var shift = function(options) { 3583 if (options === void 0) { 3584 options = {}; 3585 } 3586 return { 3587 name: "shift", 3588 options, 3589 async fn(state) { 3590 const { 3591 x: x2, 3592 y: y2, 3593 placement, 3594 platform: platform3 3595 } = state; 3596 const { 3597 mainAxis: checkMainAxis = true, 3598 crossAxis: checkCrossAxis = false, 3599 limiter = { 3600 fn: (_ref) => { 3601 let { 3602 x: x3, 3603 y: y3 3604 } = _ref; 3605 return { 3606 x: x3, 3607 y: y3 3608 }; 3609 } 3610 }, 3611 ...detectOverflowOptions 3612 } = evaluate(options, state); 3613 const coords = { 3614 x: x2, 3615 y: y2 3616 }; 3617 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3618 const crossAxis = getSideAxis(getSide(placement)); 3619 const mainAxis = getOppositeAxis(crossAxis); 3620 let mainAxisCoord = coords[mainAxis]; 3621 let crossAxisCoord = coords[crossAxis]; 3622 if (checkMainAxis) { 3623 const minSide = mainAxis === "y" ? "top" : "left"; 3624 const maxSide = mainAxis === "y" ? "bottom" : "right"; 3625 const min2 = mainAxisCoord + overflow[minSide]; 3626 const max2 = mainAxisCoord - overflow[maxSide]; 3627 mainAxisCoord = clamp(min2, mainAxisCoord, max2); 3628 } 3629 if (checkCrossAxis) { 3630 const minSide = crossAxis === "y" ? "top" : "left"; 3631 const maxSide = crossAxis === "y" ? "bottom" : "right"; 3632 const min2 = crossAxisCoord + overflow[minSide]; 3633 const max2 = crossAxisCoord - overflow[maxSide]; 3634 crossAxisCoord = clamp(min2, crossAxisCoord, max2); 3635 } 3636 const limitedCoords = limiter.fn({ 3637 ...state, 3638 [mainAxis]: mainAxisCoord, 3639 [crossAxis]: crossAxisCoord 3640 }); 3641 return { 3642 ...limitedCoords, 3643 data: { 3644 x: limitedCoords.x - x2, 3645 y: limitedCoords.y - y2, 3646 enabled: { 3647 [mainAxis]: checkMainAxis, 3648 [crossAxis]: checkCrossAxis 3649 } 3650 } 3651 }; 3652 } 3653 }; 3654 }; 3655 var limitShift = function(options) { 3656 if (options === void 0) { 3657 options = {}; 3658 } 3659 return { 3660 options, 3661 fn(state) { 3662 const { 3663 x: x2, 3664 y: y2, 3665 placement, 3666 rects, 3667 middlewareData 3668 } = state; 3669 const { 3670 offset: offset4 = 0, 3671 mainAxis: checkMainAxis = true, 3672 crossAxis: checkCrossAxis = true 3673 } = evaluate(options, state); 3674 const coords = { 3675 x: x2, 3676 y: y2 3677 }; 3678 const crossAxis = getSideAxis(placement); 3679 const mainAxis = getOppositeAxis(crossAxis); 3680 let mainAxisCoord = coords[mainAxis]; 3681 let crossAxisCoord = coords[crossAxis]; 3682 const rawOffset = evaluate(offset4, state); 3683 const computedOffset = typeof rawOffset === "number" ? { 3684 mainAxis: rawOffset, 3685 crossAxis: 0 3686 } : { 3687 mainAxis: 0, 3688 crossAxis: 0, 3689 ...rawOffset 3690 }; 3691 if (checkMainAxis) { 3692 const len = mainAxis === "y" ? "height" : "width"; 3693 const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis; 3694 const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis; 3695 if (mainAxisCoord < limitMin) { 3696 mainAxisCoord = limitMin; 3697 } else if (mainAxisCoord > limitMax) { 3698 mainAxisCoord = limitMax; 3699 } 3700 } 3701 if (checkCrossAxis) { 3702 var _middlewareData$offse, _middlewareData$offse2; 3703 const len = mainAxis === "y" ? "width" : "height"; 3704 const isOriginSide = originSides.has(getSide(placement)); 3705 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); 3706 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); 3707 if (crossAxisCoord < limitMin) { 3708 crossAxisCoord = limitMin; 3709 } else if (crossAxisCoord > limitMax) { 3710 crossAxisCoord = limitMax; 3711 } 3712 } 3713 return { 3714 [mainAxis]: mainAxisCoord, 3715 [crossAxis]: crossAxisCoord 3716 }; 3717 } 3718 }; 3719 }; 3720 var size = function(options) { 3721 if (options === void 0) { 3722 options = {}; 3723 } 3724 return { 3725 name: "size", 3726 options, 3727 async fn(state) { 3728 var _state$middlewareData, _state$middlewareData2; 3729 const { 3730 placement, 3731 rects, 3732 platform: platform3, 3733 elements: elements2 3734 } = state; 3735 const { 3736 apply = () => { 3737 }, 3738 ...detectOverflowOptions 3739 } = evaluate(options, state); 3740 const overflow = await platform3.detectOverflow(state, detectOverflowOptions); 3741 const side = getSide(placement); 3742 const alignment = getAlignment(placement); 3743 const isYAxis = getSideAxis(placement) === "y"; 3744 const { 3745 width, 3746 height 3747 } = rects.floating; 3748 let heightSide; 3749 let widthSide; 3750 if (side === "top" || side === "bottom") { 3751 heightSide = side; 3752 widthSide = alignment === (await (platform3.isRTL == null ? void 0 : platform3.isRTL(elements2.floating)) ? "start" : "end") ? "left" : "right"; 3753 } else { 3754 widthSide = side; 3755 heightSide = alignment === "end" ? "top" : "bottom"; 3756 } 3757 const maximumClippingHeight = height - overflow.top - overflow.bottom; 3758 const maximumClippingWidth = width - overflow.left - overflow.right; 3759 const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight); 3760 const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth); 3761 const noShift = !state.middlewareData.shift; 3762 let availableHeight = overflowAvailableHeight; 3763 let availableWidth = overflowAvailableWidth; 3764 if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) { 3765 availableWidth = maximumClippingWidth; 3766 } 3767 if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) { 3768 availableHeight = maximumClippingHeight; 3769 } 3770 if (noShift && !alignment) { 3771 const xMin = max(overflow.left, 0); 3772 const xMax = max(overflow.right, 0); 3773 const yMin = max(overflow.top, 0); 3774 const yMax = max(overflow.bottom, 0); 3775 if (isYAxis) { 3776 availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right)); 3777 } else { 3778 availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom)); 3779 } 3780 } 3781 await apply({ 3782 ...state, 3783 availableWidth, 3784 availableHeight 3785 }); 3786 const nextDimensions = await platform3.getDimensions(elements2.floating); 3787 if (width !== nextDimensions.width || height !== nextDimensions.height) { 3788 return { 3789 reset: { 3790 rects: true 3791 } 3792 }; 3793 } 3794 return {}; 3795 } 3796 }; 3797 }; 3798 3799 // node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs 3800 function getCssDimensions(element) { 3801 const css = getComputedStyle2(element); 3802 let width = parseFloat(css.width) || 0; 3803 let height = parseFloat(css.height) || 0; 3804 const hasOffset = isHTMLElement(element); 3805 const offsetWidth = hasOffset ? element.offsetWidth : width; 3806 const offsetHeight = hasOffset ? element.offsetHeight : height; 3807 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 3808 if (shouldFallback) { 3809 width = offsetWidth; 3810 height = offsetHeight; 3811 } 3812 return { 3813 width, 3814 height, 3815 $: shouldFallback 3816 }; 3817 } 3818 function unwrapElement(element) { 3819 return !isElement(element) ? element.contextElement : element; 3820 } 3821 function getScale(element) { 3822 const domElement = unwrapElement(element); 3823 if (!isHTMLElement(domElement)) { 3824 return createCoords(1); 3825 } 3826 const rect = domElement.getBoundingClientRect(); 3827 const { 3828 width, 3829 height, 3830 $: $2 3831 } = getCssDimensions(domElement); 3832 let x2 = ($2 ? round(rect.width) : rect.width) / width; 3833 let y2 = ($2 ? round(rect.height) : rect.height) / height; 3834 if (!x2 || !Number.isFinite(x2)) { 3835 x2 = 1; 3836 } 3837 if (!y2 || !Number.isFinite(y2)) { 3838 y2 = 1; 3839 } 3840 return { 3841 x: x2, 3842 y: y2 3843 }; 3844 } 3845 var noOffsets = /* @__PURE__ */ createCoords(0); 3846 function getVisualOffsets(element) { 3847 const win = getWindow(element); 3848 if (!isWebKit() || !win.visualViewport) { 3849 return noOffsets; 3850 } 3851 return { 3852 x: win.visualViewport.offsetLeft, 3853 y: win.visualViewport.offsetTop 3854 }; 3855 } 3856 function shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) { 3857 if (isFixed === void 0) { 3858 isFixed = false; 3859 } 3860 if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) { 3861 return false; 3862 } 3863 return isFixed; 3864 } 3865 function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) { 3866 if (includeScale === void 0) { 3867 includeScale = false; 3868 } 3869 if (isFixedStrategy === void 0) { 3870 isFixedStrategy = false; 3871 } 3872 const clientRect = element.getBoundingClientRect(); 3873 const domElement = unwrapElement(element); 3874 let scale = createCoords(1); 3875 if (includeScale) { 3876 if (offsetParent) { 3877 if (isElement(offsetParent)) { 3878 scale = getScale(offsetParent); 3879 } 3880 } else { 3881 scale = getScale(element); 3882 } 3883 } 3884 const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0); 3885 let x2 = (clientRect.left + visualOffsets.x) / scale.x; 3886 let y2 = (clientRect.top + visualOffsets.y) / scale.y; 3887 let width = clientRect.width / scale.x; 3888 let height = clientRect.height / scale.y; 3889 if (domElement) { 3890 const win = getWindow(domElement); 3891 const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent; 3892 let currentWin = win; 3893 let currentIFrame = getFrameElement(currentWin); 3894 while (currentIFrame && offsetParent && offsetWin !== currentWin) { 3895 const iframeScale = getScale(currentIFrame); 3896 const iframeRect = currentIFrame.getBoundingClientRect(); 3897 const css = getComputedStyle2(currentIFrame); 3898 const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x; 3899 const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y; 3900 x2 *= iframeScale.x; 3901 y2 *= iframeScale.y; 3902 width *= iframeScale.x; 3903 height *= iframeScale.y; 3904 x2 += left; 3905 y2 += top; 3906 currentWin = getWindow(currentIFrame); 3907 currentIFrame = getFrameElement(currentWin); 3908 } 3909 } 3910 return rectToClientRect({ 3911 width, 3912 height, 3913 x: x2, 3914 y: y2 3915 }); 3916 } 3917 function getWindowScrollBarX(element, rect) { 3918 const leftScroll = getNodeScroll(element).scrollLeft; 3919 if (!rect) { 3920 return getBoundingClientRect(getDocumentElement(element)).left + leftScroll; 3921 } 3922 return rect.left + leftScroll; 3923 } 3924 function getHTMLOffset(documentElement, scroll) { 3925 const htmlRect = documentElement.getBoundingClientRect(); 3926 const x2 = htmlRect.left + scroll.scrollLeft - getWindowScrollBarX(documentElement, htmlRect); 3927 const y2 = htmlRect.top + scroll.scrollTop; 3928 return { 3929 x: x2, 3930 y: y2 3931 }; 3932 } 3933 function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) { 3934 let { 3935 elements: elements2, 3936 rect, 3937 offsetParent, 3938 strategy 3939 } = _ref; 3940 const isFixed = strategy === "fixed"; 3941 const documentElement = getDocumentElement(offsetParent); 3942 const topLayer = elements2 ? isTopLayer(elements2.floating) : false; 3943 if (offsetParent === documentElement || topLayer && isFixed) { 3944 return rect; 3945 } 3946 let scroll = { 3947 scrollLeft: 0, 3948 scrollTop: 0 3949 }; 3950 let scale = createCoords(1); 3951 const offsets = createCoords(0); 3952 const isOffsetParentAnElement = isHTMLElement(offsetParent); 3953 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 3954 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 3955 scroll = getNodeScroll(offsetParent); 3956 } 3957 if (isOffsetParentAnElement) { 3958 const offsetRect = getBoundingClientRect(offsetParent); 3959 scale = getScale(offsetParent); 3960 offsets.x = offsetRect.x + offsetParent.clientLeft; 3961 offsets.y = offsetRect.y + offsetParent.clientTop; 3962 } 3963 } 3964 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 3965 return { 3966 width: rect.width * scale.x, 3967 height: rect.height * scale.y, 3968 x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x, 3969 y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y 3970 }; 3971 } 3972 function getClientRects(element) { 3973 return Array.from(element.getClientRects()); 3974 } 3975 function getDocumentRect(element) { 3976 const html = getDocumentElement(element); 3977 const scroll = getNodeScroll(element); 3978 const body = element.ownerDocument.body; 3979 const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth); 3980 const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight); 3981 let x2 = -scroll.scrollLeft + getWindowScrollBarX(element); 3982 const y2 = -scroll.scrollTop; 3983 if (getComputedStyle2(body).direction === "rtl") { 3984 x2 += max(html.clientWidth, body.clientWidth) - width; 3985 } 3986 return { 3987 width, 3988 height, 3989 x: x2, 3990 y: y2 3991 }; 3992 } 3993 var SCROLLBAR_MAX = 25; 3994 function getViewportRect(element, strategy) { 3995 const win = getWindow(element); 3996 const html = getDocumentElement(element); 3997 const visualViewport = win.visualViewport; 3998 let width = html.clientWidth; 3999 let height = html.clientHeight; 4000 let x2 = 0; 4001 let y2 = 0; 4002 if (visualViewport) { 4003 width = visualViewport.width; 4004 height = visualViewport.height; 4005 const visualViewportBased = isWebKit(); 4006 if (!visualViewportBased || visualViewportBased && strategy === "fixed") { 4007 x2 = visualViewport.offsetLeft; 4008 y2 = visualViewport.offsetTop; 4009 } 4010 } 4011 const windowScrollbarX = getWindowScrollBarX(html); 4012 if (windowScrollbarX <= 0) { 4013 const doc = html.ownerDocument; 4014 const body = doc.body; 4015 const bodyStyles = getComputedStyle(body); 4016 const bodyMarginInline = doc.compatMode === "CSS1Compat" ? parseFloat(bodyStyles.marginLeft) + parseFloat(bodyStyles.marginRight) || 0 : 0; 4017 const clippingStableScrollbarWidth = Math.abs(html.clientWidth - body.clientWidth - bodyMarginInline); 4018 if (clippingStableScrollbarWidth <= SCROLLBAR_MAX) { 4019 width -= clippingStableScrollbarWidth; 4020 } 4021 } else if (windowScrollbarX <= SCROLLBAR_MAX) { 4022 width += windowScrollbarX; 4023 } 4024 return { 4025 width, 4026 height, 4027 x: x2, 4028 y: y2 4029 }; 4030 } 4031 function getInnerBoundingClientRect(element, strategy) { 4032 const clientRect = getBoundingClientRect(element, true, strategy === "fixed"); 4033 const top = clientRect.top + element.clientTop; 4034 const left = clientRect.left + element.clientLeft; 4035 const scale = isHTMLElement(element) ? getScale(element) : createCoords(1); 4036 const width = element.clientWidth * scale.x; 4037 const height = element.clientHeight * scale.y; 4038 const x2 = left * scale.x; 4039 const y2 = top * scale.y; 4040 return { 4041 width, 4042 height, 4043 x: x2, 4044 y: y2 4045 }; 4046 } 4047 function getClientRectFromClippingAncestor(element, clippingAncestor, strategy) { 4048 let rect; 4049 if (clippingAncestor === "viewport") { 4050 rect = getViewportRect(element, strategy); 4051 } else if (clippingAncestor === "document") { 4052 rect = getDocumentRect(getDocumentElement(element)); 4053 } else if (isElement(clippingAncestor)) { 4054 rect = getInnerBoundingClientRect(clippingAncestor, strategy); 4055 } else { 4056 const visualOffsets = getVisualOffsets(element); 4057 rect = { 4058 x: clippingAncestor.x - visualOffsets.x, 4059 y: clippingAncestor.y - visualOffsets.y, 4060 width: clippingAncestor.width, 4061 height: clippingAncestor.height 4062 }; 4063 } 4064 return rectToClientRect(rect); 4065 } 4066 function hasFixedPositionAncestor(element, stopNode) { 4067 const parentNode = getParentNode(element); 4068 if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) { 4069 return false; 4070 } 4071 return getComputedStyle2(parentNode).position === "fixed" || hasFixedPositionAncestor(parentNode, stopNode); 4072 } 4073 function getClippingElementAncestors(element, cache) { 4074 const cachedResult = cache.get(element); 4075 if (cachedResult) { 4076 return cachedResult; 4077 } 4078 let result = getOverflowAncestors(element, [], false).filter((el) => isElement(el) && getNodeName(el) !== "body"); 4079 let currentContainingBlockComputedStyle = null; 4080 const elementIsFixed = getComputedStyle2(element).position === "fixed"; 4081 let currentNode = elementIsFixed ? getParentNode(element) : element; 4082 while (isElement(currentNode) && !isLastTraversableNode(currentNode)) { 4083 const computedStyle = getComputedStyle2(currentNode); 4084 const currentNodeIsContaining = isContainingBlock(currentNode); 4085 if (!currentNodeIsContaining && computedStyle.position === "fixed") { 4086 currentContainingBlockComputedStyle = null; 4087 } 4088 const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === "static" && !!currentContainingBlockComputedStyle && (currentContainingBlockComputedStyle.position === "absolute" || currentContainingBlockComputedStyle.position === "fixed") || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode); 4089 if (shouldDropCurrentNode) { 4090 result = result.filter((ancestor) => ancestor !== currentNode); 4091 } else { 4092 currentContainingBlockComputedStyle = computedStyle; 4093 } 4094 currentNode = getParentNode(currentNode); 4095 } 4096 cache.set(element, result); 4097 return result; 4098 } 4099 function getClippingRect(_ref) { 4100 let { 4101 element, 4102 boundary, 4103 rootBoundary, 4104 strategy 4105 } = _ref; 4106 const elementClippingAncestors = boundary === "clippingAncestors" ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary); 4107 const clippingAncestors = [...elementClippingAncestors, rootBoundary]; 4108 const firstRect = getClientRectFromClippingAncestor(element, clippingAncestors[0], strategy); 4109 let top = firstRect.top; 4110 let right = firstRect.right; 4111 let bottom = firstRect.bottom; 4112 let left = firstRect.left; 4113 for (let i2 = 1; i2 < clippingAncestors.length; i2++) { 4114 const rect = getClientRectFromClippingAncestor(element, clippingAncestors[i2], strategy); 4115 top = max(rect.top, top); 4116 right = min(rect.right, right); 4117 bottom = min(rect.bottom, bottom); 4118 left = max(rect.left, left); 4119 } 4120 return { 4121 width: right - left, 4122 height: bottom - top, 4123 x: left, 4124 y: top 4125 }; 4126 } 4127 function getDimensions(element) { 4128 const { 4129 width, 4130 height 4131 } = getCssDimensions(element); 4132 return { 4133 width, 4134 height 4135 }; 4136 } 4137 function getRectRelativeToOffsetParent(element, offsetParent, strategy) { 4138 const isOffsetParentAnElement = isHTMLElement(offsetParent); 4139 const documentElement = getDocumentElement(offsetParent); 4140 const isFixed = strategy === "fixed"; 4141 const rect = getBoundingClientRect(element, true, isFixed, offsetParent); 4142 let scroll = { 4143 scrollLeft: 0, 4144 scrollTop: 0 4145 }; 4146 const offsets = createCoords(0); 4147 function setLeftRTLScrollbarOffset() { 4148 offsets.x = getWindowScrollBarX(documentElement); 4149 } 4150 if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) { 4151 if (getNodeName(offsetParent) !== "body" || isOverflowElement(documentElement)) { 4152 scroll = getNodeScroll(offsetParent); 4153 } 4154 if (isOffsetParentAnElement) { 4155 const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent); 4156 offsets.x = offsetRect.x + offsetParent.clientLeft; 4157 offsets.y = offsetRect.y + offsetParent.clientTop; 4158 } else if (documentElement) { 4159 setLeftRTLScrollbarOffset(); 4160 } 4161 } 4162 if (isFixed && !isOffsetParentAnElement && documentElement) { 4163 setLeftRTLScrollbarOffset(); 4164 } 4165 const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0); 4166 const x2 = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x; 4167 const y2 = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y; 4168 return { 4169 x: x2, 4170 y: y2, 4171 width: rect.width, 4172 height: rect.height 4173 }; 4174 } 4175 function isStaticPositioned(element) { 4176 return getComputedStyle2(element).position === "static"; 4177 } 4178 function getTrueOffsetParent(element, polyfill) { 4179 if (!isHTMLElement(element) || getComputedStyle2(element).position === "fixed") { 4180 return null; 4181 } 4182 if (polyfill) { 4183 return polyfill(element); 4184 } 4185 let rawOffsetParent = element.offsetParent; 4186 if (getDocumentElement(element) === rawOffsetParent) { 4187 rawOffsetParent = rawOffsetParent.ownerDocument.body; 4188 } 4189 return rawOffsetParent; 4190 } 4191 function getOffsetParent(element, polyfill) { 4192 const win = getWindow(element); 4193 if (isTopLayer(element)) { 4194 return win; 4195 } 4196 if (!isHTMLElement(element)) { 4197 let svgOffsetParent = getParentNode(element); 4198 while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) { 4199 if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) { 4200 return svgOffsetParent; 4201 } 4202 svgOffsetParent = getParentNode(svgOffsetParent); 4203 } 4204 return win; 4205 } 4206 let offsetParent = getTrueOffsetParent(element, polyfill); 4207 while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) { 4208 offsetParent = getTrueOffsetParent(offsetParent, polyfill); 4209 } 4210 if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) { 4211 return win; 4212 } 4213 return offsetParent || getContainingBlock(element) || win; 4214 } 4215 var getElementRects = async function(data) { 4216 const getOffsetParentFn = this.getOffsetParent || getOffsetParent; 4217 const getDimensionsFn = this.getDimensions; 4218 const floatingDimensions = await getDimensionsFn(data.floating); 4219 return { 4220 reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy), 4221 floating: { 4222 x: 0, 4223 y: 0, 4224 width: floatingDimensions.width, 4225 height: floatingDimensions.height 4226 } 4227 }; 4228 }; 4229 function isRTL(element) { 4230 return getComputedStyle2(element).direction === "rtl"; 4231 } 4232 var platform2 = { 4233 convertOffsetParentRelativeRectToViewportRelativeRect, 4234 getDocumentElement, 4235 getClippingRect, 4236 getOffsetParent, 4237 getElementRects, 4238 getClientRects, 4239 getDimensions, 4240 getScale, 4241 isElement, 4242 isRTL 4243 }; 4244 function rectsAreEqual(a2, b2) { 4245 return a2.x === b2.x && a2.y === b2.y && a2.width === b2.width && a2.height === b2.height; 4246 } 4247 function observeMove(element, onMove) { 4248 let io = null; 4249 let timeoutId; 4250 const root = getDocumentElement(element); 4251 function cleanup() { 4252 var _io; 4253 clearTimeout(timeoutId); 4254 (_io = io) == null || _io.disconnect(); 4255 io = null; 4256 } 4257 function refresh(skip, threshold) { 4258 if (skip === void 0) { 4259 skip = false; 4260 } 4261 if (threshold === void 0) { 4262 threshold = 1; 4263 } 4264 cleanup(); 4265 const elementRectForRootMargin = element.getBoundingClientRect(); 4266 const { 4267 left, 4268 top, 4269 width, 4270 height 4271 } = elementRectForRootMargin; 4272 if (!skip) { 4273 onMove(); 4274 } 4275 if (!width || !height) { 4276 return; 4277 } 4278 const insetTop = floor(top); 4279 const insetRight = floor(root.clientWidth - (left + width)); 4280 const insetBottom = floor(root.clientHeight - (top + height)); 4281 const insetLeft = floor(left); 4282 const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px"; 4283 const options = { 4284 rootMargin, 4285 threshold: max(0, min(1, threshold)) || 1 4286 }; 4287 let isFirstUpdate = true; 4288 function handleObserve(entries) { 4289 const ratio = entries[0].intersectionRatio; 4290 if (ratio !== threshold) { 4291 if (!isFirstUpdate) { 4292 return refresh(); 4293 } 4294 if (!ratio) { 4295 timeoutId = setTimeout(() => { 4296 refresh(false, 1e-7); 4297 }, 1e3); 4298 } else { 4299 refresh(false, ratio); 4300 } 4301 } 4302 if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) { 4303 refresh(); 4304 } 4305 isFirstUpdate = false; 4306 } 4307 try { 4308 io = new IntersectionObserver(handleObserve, { 4309 ...options, 4310 // Handle <iframe>s 4311 root: root.ownerDocument 4312 }); 4313 } catch (_e) { 4314 io = new IntersectionObserver(handleObserve, options); 4315 } 4316 io.observe(element); 4317 } 4318 refresh(true); 4319 return cleanup; 4320 } 4321 function autoUpdate(reference, floating, update2, options) { 4322 if (options === void 0) { 4323 options = {}; 4324 } 4325 const { 4326 ancestorScroll = true, 4327 ancestorResize = true, 4328 elementResize = typeof ResizeObserver === "function", 4329 layoutShift = typeof IntersectionObserver === "function", 4330 animationFrame = false 4331 } = options; 4332 const referenceEl = unwrapElement(reference); 4333 const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...floating ? getOverflowAncestors(floating) : []] : []; 4334 ancestors.forEach((ancestor) => { 4335 ancestorScroll && ancestor.addEventListener("scroll", update2, { 4336 passive: true 4337 }); 4338 ancestorResize && ancestor.addEventListener("resize", update2); 4339 }); 4340 const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update2) : null; 4341 let reobserveFrame = -1; 4342 let resizeObserver = null; 4343 if (elementResize) { 4344 resizeObserver = new ResizeObserver((_ref) => { 4345 let [firstEntry] = _ref; 4346 if (firstEntry && firstEntry.target === referenceEl && resizeObserver && floating) { 4347 resizeObserver.unobserve(floating); 4348 cancelAnimationFrame(reobserveFrame); 4349 reobserveFrame = requestAnimationFrame(() => { 4350 var _resizeObserver; 4351 (_resizeObserver = resizeObserver) == null || _resizeObserver.observe(floating); 4352 }); 4353 } 4354 update2(); 4355 }); 4356 if (referenceEl && !animationFrame) { 4357 resizeObserver.observe(referenceEl); 4358 } 4359 if (floating) { 4360 resizeObserver.observe(floating); 4361 } 4362 } 4363 let frameId; 4364 let prevRefRect = animationFrame ? getBoundingClientRect(reference) : null; 4365 if (animationFrame) { 4366 frameLoop(); 4367 } 4368 function frameLoop() { 4369 const nextRefRect = getBoundingClientRect(reference); 4370 if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) { 4371 update2(); 4372 } 4373 prevRefRect = nextRefRect; 4374 frameId = requestAnimationFrame(frameLoop); 4375 } 4376 update2(); 4377 return () => { 4378 var _resizeObserver2; 4379 ancestors.forEach((ancestor) => { 4380 ancestorScroll && ancestor.removeEventListener("scroll", update2); 4381 ancestorResize && ancestor.removeEventListener("resize", update2); 4382 }); 4383 cleanupIo == null || cleanupIo(); 4384 (_resizeObserver2 = resizeObserver) == null || _resizeObserver2.disconnect(); 4385 resizeObserver = null; 4386 if (animationFrame) { 4387 cancelAnimationFrame(frameId); 4388 } 4389 }; 4390 } 4391 var offset2 = offset; 4392 var shift2 = shift; 4393 var flip2 = flip; 4394 var size2 = size; 4395 var hide2 = hide; 4396 var limitShift2 = limitShift; 4397 var computePosition2 = (reference, floating, options) => { 4398 const cache = /* @__PURE__ */ new Map(); 4399 const mergedOptions = { 4400 platform: platform2, 4401 ...options 4402 }; 4403 const platformWithCache = { 4404 ...mergedOptions.platform, 4405 _c: cache 4406 }; 4407 return computePosition(reference, floating, { 4408 ...mergedOptions, 4409 platform: platformWithCache 4410 }); 4411 }; 4412 4413 // node_modules/@base-ui/react/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs 4414 var React20 = __toESM(require_react(), 1); 4415 var import_react2 = __toESM(require_react(), 1); 4416 var ReactDOM3 = __toESM(require_react_dom(), 1); 4417 var isClient = typeof document !== "undefined"; 4418 var noop2 = function noop3() { 4419 }; 4420 var index = isClient ? import_react2.useLayoutEffect : noop2; 4421 function deepEqual(a2, b2) { 4422 if (a2 === b2) { 4423 return true; 4424 } 4425 if (typeof a2 !== typeof b2) { 4426 return false; 4427 } 4428 if (typeof a2 === "function" && a2.toString() === b2.toString()) { 4429 return true; 4430 } 4431 let length; 4432 let i2; 4433 let keys; 4434 if (a2 && b2 && typeof a2 === "object") { 4435 if (Array.isArray(a2)) { 4436 length = a2.length; 4437 if (length !== b2.length) return false; 4438 for (i2 = length; i2-- !== 0; ) { 4439 if (!deepEqual(a2[i2], b2[i2])) { 4440 return false; 4441 } 4442 } 4443 return true; 4444 } 4445 keys = Object.keys(a2); 4446 length = keys.length; 4447 if (length !== Object.keys(b2).length) { 4448 return false; 4449 } 4450 for (i2 = length; i2-- !== 0; ) { 4451 if (!{}.hasOwnProperty.call(b2, keys[i2])) { 4452 return false; 4453 } 4454 } 4455 for (i2 = length; i2-- !== 0; ) { 4456 const key = keys[i2]; 4457 if (key === "_owner" && a2.$$typeof) { 4458 continue; 4459 } 4460 if (!deepEqual(a2[key], b2[key])) { 4461 return false; 4462 } 4463 } 4464 return true; 4465 } 4466 return a2 !== a2 && b2 !== b2; 4467 } 4468 function getDPR(element) { 4469 if (typeof window === "undefined") { 4470 return 1; 4471 } 4472 const win = element.ownerDocument.defaultView || window; 4473 return win.devicePixelRatio || 1; 4474 } 4475 function roundByDPR(element, value) { 4476 const dpr = getDPR(element); 4477 return Math.round(value * dpr) / dpr; 4478 } 4479 function useLatestRef(value) { 4480 const ref = React20.useRef(value); 4481 index(() => { 4482 ref.current = value; 4483 }); 4484 return ref; 4485 } 4486 function useFloating(options) { 4487 if (options === void 0) { 4488 options = {}; 4489 } 4490 const { 4491 placement = "bottom", 4492 strategy = "absolute", 4493 middleware = [], 4494 platform: platform3, 4495 elements: { 4496 reference: externalReference, 4497 floating: externalFloating 4498 } = {}, 4499 transform = true, 4500 whileElementsMounted, 4501 open 4502 } = options; 4503 const [data, setData] = React20.useState({ 4504 x: 0, 4505 y: 0, 4506 strategy, 4507 placement, 4508 middlewareData: {}, 4509 isPositioned: false 4510 }); 4511 const [latestMiddleware, setLatestMiddleware] = React20.useState(middleware); 4512 if (!deepEqual(latestMiddleware, middleware)) { 4513 setLatestMiddleware(middleware); 4514 } 4515 const [_reference, _setReference] = React20.useState(null); 4516 const [_floating, _setFloating] = React20.useState(null); 4517 const setReference = React20.useCallback((node) => { 4518 if (node !== referenceRef.current) { 4519 referenceRef.current = node; 4520 _setReference(node); 4521 } 4522 }, []); 4523 const setFloating = React20.useCallback((node) => { 4524 if (node !== floatingRef.current) { 4525 floatingRef.current = node; 4526 _setFloating(node); 4527 } 4528 }, []); 4529 const referenceEl = externalReference || _reference; 4530 const floatingEl = externalFloating || _floating; 4531 const referenceRef = React20.useRef(null); 4532 const floatingRef = React20.useRef(null); 4533 const dataRef = React20.useRef(data); 4534 const hasWhileElementsMounted = whileElementsMounted != null; 4535 const whileElementsMountedRef = useLatestRef(whileElementsMounted); 4536 const platformRef = useLatestRef(platform3); 4537 const openRef = useLatestRef(open); 4538 const update2 = React20.useCallback(() => { 4539 if (!referenceRef.current || !floatingRef.current) { 4540 return; 4541 } 4542 const config = { 4543 placement, 4544 strategy, 4545 middleware: latestMiddleware 4546 }; 4547 if (platformRef.current) { 4548 config.platform = platformRef.current; 4549 } 4550 computePosition2(referenceRef.current, floatingRef.current, config).then((data2) => { 4551 const fullData = { 4552 ...data2, 4553 // The floating element's position may be recomputed while it's closed 4554 // but still mounted (such as when transitioning out). To ensure 4555 // `isPositioned` will be `false` initially on the next open, avoid 4556 // setting it to `true` when `open === false` (must be specified). 4557 isPositioned: openRef.current !== false 4558 }; 4559 if (isMountedRef.current && !deepEqual(dataRef.current, fullData)) { 4560 dataRef.current = fullData; 4561 ReactDOM3.flushSync(() => { 4562 setData(fullData); 4563 }); 4564 } 4565 }); 4566 }, [latestMiddleware, placement, strategy, platformRef, openRef]); 4567 index(() => { 4568 if (open === false && dataRef.current.isPositioned) { 4569 dataRef.current.isPositioned = false; 4570 setData((data2) => ({ 4571 ...data2, 4572 isPositioned: false 4573 })); 4574 } 4575 }, [open]); 4576 const isMountedRef = React20.useRef(false); 4577 index(() => { 4578 isMountedRef.current = true; 4579 return () => { 4580 isMountedRef.current = false; 4581 }; 4582 }, []); 4583 index(() => { 4584 if (referenceEl) referenceRef.current = referenceEl; 4585 if (floatingEl) floatingRef.current = floatingEl; 4586 if (referenceEl && floatingEl) { 4587 if (whileElementsMountedRef.current) { 4588 return whileElementsMountedRef.current(referenceEl, floatingEl, update2); 4589 } 4590 update2(); 4591 } 4592 }, [referenceEl, floatingEl, update2, whileElementsMountedRef, hasWhileElementsMounted]); 4593 const refs = React20.useMemo(() => ({ 4594 reference: referenceRef, 4595 floating: floatingRef, 4596 setReference, 4597 setFloating 4598 }), [setReference, setFloating]); 4599 const elements2 = React20.useMemo(() => ({ 4600 reference: referenceEl, 4601 floating: floatingEl 4602 }), [referenceEl, floatingEl]); 4603 const floatingStyles = React20.useMemo(() => { 4604 const initialStyles = { 4605 position: strategy, 4606 left: 0, 4607 top: 0 4608 }; 4609 if (!elements2.floating) { 4610 return initialStyles; 4611 } 4612 const x2 = roundByDPR(elements2.floating, data.x); 4613 const y2 = roundByDPR(elements2.floating, data.y); 4614 if (transform) { 4615 return { 4616 ...initialStyles, 4617 transform: "translate(" + x2 + "px, " + y2 + "px)", 4618 ...getDPR(elements2.floating) >= 1.5 && { 4619 willChange: "transform" 4620 } 4621 }; 4622 } 4623 return { 4624 position: strategy, 4625 left: x2, 4626 top: y2 4627 }; 4628 }, [strategy, transform, elements2.floating, data.x, data.y]); 4629 return React20.useMemo(() => ({ 4630 ...data, 4631 update: update2, 4632 refs, 4633 elements: elements2, 4634 floatingStyles 4635 }), [data, update2, refs, elements2, floatingStyles]); 4636 } 4637 var offset3 = (options, deps) => { 4638 const result = offset2(options); 4639 return { 4640 name: result.name, 4641 fn: result.fn, 4642 options: [options, deps] 4643 }; 4644 }; 4645 var shift3 = (options, deps) => { 4646 const result = shift2(options); 4647 return { 4648 name: result.name, 4649 fn: result.fn, 4650 options: [options, deps] 4651 }; 4652 }; 4653 var limitShift3 = (options, deps) => { 4654 const result = limitShift2(options); 4655 return { 4656 fn: result.fn, 4657 options: [options, deps] 4658 }; 4659 }; 4660 var flip3 = (options, deps) => { 4661 const result = flip2(options); 4662 return { 4663 name: result.name, 4664 fn: result.fn, 4665 options: [options, deps] 4666 }; 4667 }; 4668 var size3 = (options, deps) => { 4669 const result = size2(options); 4670 return { 4671 name: result.name, 4672 fn: result.fn, 4673 options: [options, deps] 4674 }; 4675 }; 4676 var hide3 = (options, deps) => { 4677 const result = hide2(options); 4678 return { 4679 name: result.name, 4680 fn: result.fn, 4681 options: [options, deps] 4682 }; 4683 }; 4684 4685 // node_modules/@base-ui/react/esm/utils/popups/popupStoreUtils.js 4686 var React25 = __toESM(require_react(), 1); 4687 4688 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js 4689 var React24 = __toESM(require_react(), 1); 4690 4691 // node_modules/@base-ui/utils/esm/store/createSelector.js 4692 var createSelector = (a2, b2, c2, d2, e2, f2, ...other) => { 4693 if (other.length > 0) { 4694 throw new Error(true ? "Unsupported number of selectors" : formatErrorMessage_default(1)); 4695 } 4696 let selector; 4697 if (a2 && b2 && c2 && d2 && e2 && f2) { 4698 selector = (state, a1, a22, a3) => { 4699 const va = a2(state, a1, a22, a3); 4700 const vb = b2(state, a1, a22, a3); 4701 const vc = c2(state, a1, a22, a3); 4702 const vd = d2(state, a1, a22, a3); 4703 const ve = e2(state, a1, a22, a3); 4704 return f2(va, vb, vc, vd, ve, a1, a22, a3); 4705 }; 4706 } else if (a2 && b2 && c2 && d2 && e2) { 4707 selector = (state, a1, a22, a3) => { 4708 const va = a2(state, a1, a22, a3); 4709 const vb = b2(state, a1, a22, a3); 4710 const vc = c2(state, a1, a22, a3); 4711 const vd = d2(state, a1, a22, a3); 4712 return e2(va, vb, vc, vd, a1, a22, a3); 4713 }; 4714 } else if (a2 && b2 && c2 && d2) { 4715 selector = (state, a1, a22, a3) => { 4716 const va = a2(state, a1, a22, a3); 4717 const vb = b2(state, a1, a22, a3); 4718 const vc = c2(state, a1, a22, a3); 4719 return d2(va, vb, vc, a1, a22, a3); 4720 }; 4721 } else if (a2 && b2 && c2) { 4722 selector = (state, a1, a22, a3) => { 4723 const va = a2(state, a1, a22, a3); 4724 const vb = b2(state, a1, a22, a3); 4725 return c2(va, vb, a1, a22, a3); 4726 }; 4727 } else if (a2 && b2) { 4728 selector = (state, a1, a22, a3) => { 4729 const va = a2(state, a1, a22, a3); 4730 return b2(va, a1, a22, a3); 4731 }; 4732 } else if (a2) { 4733 selector = a2; 4734 } else { 4735 throw ( 4736 /* minify-error-disabled */ 4737 new Error("Missing arguments") 4738 ); 4739 } 4740 return selector; 4741 }; 4742 4743 // node_modules/@base-ui/utils/esm/store/useStore.js 4744 var React22 = __toESM(require_react(), 1); 4745 var import_shim = __toESM(require_shim(), 1); 4746 var import_with_selector = __toESM(require_with_selector(), 1); 4747 4748 // node_modules/@base-ui/utils/esm/fastHooks.js 4749 var React21 = __toESM(require_react(), 1); 4750 var hooks = []; 4751 var currentInstance = void 0; 4752 function getInstance() { 4753 return currentInstance; 4754 } 4755 function register(hook) { 4756 hooks.push(hook); 4757 } 4758 function fastComponent(fn) { 4759 const FastComponent = (props, forwardedRef) => { 4760 const instance = useRefWithInit(createInstance).current; 4761 let result; 4762 try { 4763 currentInstance = instance; 4764 for (const hook of hooks) { 4765 hook.before(instance); 4766 } 4767 result = fn(props, forwardedRef); 4768 for (const hook of hooks) { 4769 hook.after(instance); 4770 } 4771 instance.didInitialize = true; 4772 } finally { 4773 currentInstance = void 0; 4774 } 4775 return result; 4776 }; 4777 FastComponent.displayName = fn.displayName || fn.name; 4778 return FastComponent; 4779 } 4780 function fastComponentRef(fn) { 4781 return /* @__PURE__ */ React21.forwardRef(fastComponent(fn)); 4782 } 4783 function createInstance() { 4784 return { 4785 didInitialize: false 4786 }; 4787 } 4788 4789 // node_modules/@base-ui/utils/esm/store/useStore.js 4790 var canUseRawUseSyncExternalStore = isReactVersionAtLeast(19); 4791 var useStoreImplementation = canUseRawUseSyncExternalStore ? useStoreFast : useStoreLegacy; 4792 function useStore(store, selector, a1, a2, a3) { 4793 return useStoreImplementation(store, selector, a1, a2, a3); 4794 } 4795 function useStoreR19(store, selector, a1, a2, a3) { 4796 const getSelection = React22.useCallback(() => selector(store.getSnapshot(), a1, a2, a3), [store, selector, a1, a2, a3]); 4797 return (0, import_shim.useSyncExternalStore)(store.subscribe, getSelection, getSelection); 4798 } 4799 register({ 4800 before(instance) { 4801 instance.syncIndex = 0; 4802 if (!instance.didInitialize) { 4803 instance.syncTick = 1; 4804 instance.syncHooks = []; 4805 instance.didChangeStore = true; 4806 instance.getSnapshot = () => { 4807 let didChange2 = false; 4808 for (let i2 = 0; i2 < instance.syncHooks.length; i2 += 1) { 4809 const hook = instance.syncHooks[i2]; 4810 const value = hook.selector(hook.store.state, hook.a1, hook.a2, hook.a3); 4811 if (hook.didChange || !Object.is(hook.value, value)) { 4812 didChange2 = true; 4813 hook.value = value; 4814 hook.didChange = false; 4815 } 4816 } 4817 if (didChange2) { 4818 instance.syncTick += 1; 4819 } 4820 return instance.syncTick; 4821 }; 4822 } 4823 }, 4824 after(instance) { 4825 if (instance.syncHooks.length > 0) { 4826 if (instance.didChangeStore) { 4827 instance.didChangeStore = false; 4828 instance.subscribe = (onStoreChange) => { 4829 const stores = /* @__PURE__ */ new Set(); 4830 for (const hook of instance.syncHooks) { 4831 stores.add(hook.store); 4832 } 4833 const unsubscribes = []; 4834 for (const store of stores) { 4835 unsubscribes.push(store.subscribe(onStoreChange)); 4836 } 4837 return () => { 4838 for (const unsubscribe of unsubscribes) { 4839 unsubscribe(); 4840 } 4841 }; 4842 }; 4843 } 4844 (0, import_shim.useSyncExternalStore)(instance.subscribe, instance.getSnapshot, instance.getSnapshot); 4845 } 4846 } 4847 }); 4848 function useStoreFast(store, selector, a1, a2, a3) { 4849 const instance = getInstance(); 4850 if (!instance) { 4851 return useStoreR19(store, selector, a1, a2, a3); 4852 } 4853 const index2 = instance.syncIndex; 4854 instance.syncIndex += 1; 4855 let hook; 4856 if (!instance.didInitialize) { 4857 hook = { 4858 store, 4859 selector, 4860 a1, 4861 a2, 4862 a3, 4863 value: selector(store.getSnapshot(), a1, a2, a3), 4864 didChange: false 4865 }; 4866 instance.syncHooks.push(hook); 4867 } else { 4868 hook = instance.syncHooks[index2]; 4869 if (hook.store !== store || hook.selector !== selector || !Object.is(hook.a1, a1) || !Object.is(hook.a2, a2) || !Object.is(hook.a3, a3)) { 4870 if (hook.store !== store) { 4871 instance.didChangeStore = true; 4872 } 4873 hook.store = store; 4874 hook.selector = selector; 4875 hook.a1 = a1; 4876 hook.a2 = a2; 4877 hook.a3 = a3; 4878 hook.didChange = true; 4879 } 4880 } 4881 return hook.value; 4882 } 4883 function useStoreLegacy(store, selector, a1, a2, a3) { 4884 return (0, import_with_selector.useSyncExternalStoreWithSelector)(store.subscribe, store.getSnapshot, store.getSnapshot, (state) => selector(state, a1, a2, a3)); 4885 } 4886 4887 // node_modules/@base-ui/utils/esm/store/Store.js 4888 var Store = class { 4889 /** 4890 * The current state of the store. 4891 * This property is updated immediately when the state changes as a result of calling {@link setState}, {@link update}, or {@link set}. 4892 * 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). 4893 * The values can be used directly (to avoid subscribing to the store) in effects or event handlers. 4894 * 4895 * Do not modify properties in state directly. Instead, use the provided methods to ensure proper state management and listener notification. 4896 */ 4897 // Internal state to handle recursive `setState()` calls 4898 constructor(state) { 4899 this.state = state; 4900 this.listeners = /* @__PURE__ */ new Set(); 4901 this.updateTick = 0; 4902 } 4903 /** 4904 * Registers a listener that will be called whenever the store's state changes. 4905 * 4906 * @param fn The listener function to be called on state changes. 4907 * @returns A function to unsubscribe the listener. 4908 */ 4909 subscribe = (fn) => { 4910 this.listeners.add(fn); 4911 return () => { 4912 this.listeners.delete(fn); 4913 }; 4914 }; 4915 /** 4916 * Returns the current state of the store. 4917 */ 4918 getSnapshot = () => { 4919 return this.state; 4920 }; 4921 /** 4922 * Updates the entire store's state and notifies all registered listeners. 4923 * 4924 * @param newState The new state to set for the store. 4925 */ 4926 setState(newState) { 4927 if (this.state === newState) { 4928 return; 4929 } 4930 this.state = newState; 4931 this.updateTick += 1; 4932 const currentTick = this.updateTick; 4933 for (const listener of this.listeners) { 4934 if (currentTick !== this.updateTick) { 4935 return; 4936 } 4937 listener(newState); 4938 } 4939 } 4940 /** 4941 * Merges the provided changes into the current state and notifies listeners if there are changes. 4942 * 4943 * @param changes An object containing the changes to apply to the current state. 4944 */ 4945 update(changes) { 4946 for (const key in changes) { 4947 if (!Object.is(this.state[key], changes[key])) { 4948 this.setState({ 4949 ...this.state, 4950 ...changes 4951 }); 4952 return; 4953 } 4954 } 4955 } 4956 /** 4957 * Sets a specific key in the store's state to a new value and notifies listeners if the value has changed. 4958 * 4959 * @param key The key in the store's state to update. 4960 * @param value The new value to set for the specified key. 4961 */ 4962 set(key, value) { 4963 if (!Object.is(this.state[key], value)) { 4964 this.setState({ 4965 ...this.state, 4966 [key]: value 4967 }); 4968 } 4969 } 4970 /** 4971 * Gives the state a new reference and updates all registered listeners. 4972 */ 4973 notifyAll() { 4974 const newState = { 4975 ...this.state 4976 }; 4977 this.setState(newState); 4978 } 4979 use(selector, a1, a2, a3) { 4980 return useStore(this, selector, a1, a2, a3); 4981 } 4982 }; 4983 4984 // node_modules/@base-ui/utils/esm/store/ReactStore.js 4985 var React23 = __toESM(require_react(), 1); 4986 var ReactStore = class extends Store { 4987 /** 4988 * Creates a new ReactStore instance. 4989 * 4990 * @param state Initial state of the store. 4991 * @param context Non-reactive context values. 4992 * @param selectors Optional selectors for use with `useState`. 4993 */ 4994 constructor(state, context = {}, selectors3) { 4995 super(state); 4996 this.context = context; 4997 this.selectors = selectors3; 4998 } 4999 /** 5000 * Non-reactive values such as refs, callbacks, etc. 5001 */ 5002 /** 5003 * Synchronizes a single external value into the store. 5004 * 5005 * Note that the while the value in `state` is updated immediately, the value returned 5006 * by `useState` is updated before the next render (similarly to React's `useState`). 5007 */ 5008 useSyncedValue(key, value) { 5009 React23.useDebugValue(key); 5010 const store = this; 5011 useIsoLayoutEffect(() => { 5012 if (store.state[key] !== value) { 5013 store.set(key, value); 5014 } 5015 }, [store, key, value]); 5016 } 5017 /** 5018 * Synchronizes a single external value into the store and 5019 * cleans it up (sets to `undefined`) on unmount. 5020 * 5021 * Note that the while the value in `state` is updated immediately, the value returned 5022 * by `useState` is updated before the next render (similarly to React's `useState`). 5023 */ 5024 useSyncedValueWithCleanup(key, value) { 5025 const store = this; 5026 useIsoLayoutEffect(() => { 5027 if (store.state[key] !== value) { 5028 store.set(key, value); 5029 } 5030 return () => { 5031 store.set(key, void 0); 5032 }; 5033 }, [store, key, value]); 5034 } 5035 /** 5036 * Synchronizes multiple external values into the store. 5037 * 5038 * Note that the while the values in `state` are updated immediately, the values returned 5039 * by `useState` are updated before the next render (similarly to React's `useState`). 5040 */ 5041 useSyncedValues(statePart) { 5042 const store = this; 5043 if (true) { 5044 React23.useDebugValue(statePart, (p3) => Object.keys(p3)); 5045 const keys = React23.useRef(Object.keys(statePart)).current; 5046 const nextKeys = Object.keys(statePart); 5047 if (keys.length !== nextKeys.length || keys.some((key, index2) => key !== nextKeys[index2])) { 5048 console.error("ReactStore.useSyncedValues expects the same prop keys on every render. Keys should be stable."); 5049 } 5050 } 5051 const dependencies = Object.values(statePart); 5052 useIsoLayoutEffect(() => { 5053 store.update(statePart); 5054 }, [store, ...dependencies]); 5055 } 5056 /** 5057 * Registers a controllable prop pair (`controlled`, `defaultValue`) for a specific key. If `controlled` 5058 * is non-undefined, the store's state at `key` is updated to match `controlled`. 5059 */ 5060 useControlledProp(key, controlled) { 5061 React23.useDebugValue(key); 5062 const store = this; 5063 const isControlled = controlled !== void 0; 5064 useIsoLayoutEffect(() => { 5065 if (isControlled && !Object.is(store.state[key], controlled)) { 5066 store.setState({ 5067 ...store.state, 5068 [key]: controlled 5069 }); 5070 } 5071 }, [store, key, controlled, isControlled]); 5072 if (true) { 5073 const cache = this.controlledValues ??= /* @__PURE__ */ new Map(); 5074 if (!cache.has(key)) { 5075 cache.set(key, isControlled); 5076 } 5077 const previouslyControlled = cache.get(key); 5078 if (previouslyControlled !== void 0 && previouslyControlled !== isControlled) { 5079 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).`); 5080 } 5081 } 5082 } 5083 /** Gets the current value from the store using a selector with the provided key. 5084 * 5085 * @param key Key of the selector to use. 5086 */ 5087 select(key, a1, a2, a3) { 5088 const selector = this.selectors[key]; 5089 return selector(this.state, a1, a2, a3); 5090 } 5091 /** 5092 * Returns a value from the store's state using a selector function. 5093 * Used to subscribe to specific parts of the state. 5094 * This methods causes a rerender whenever the selected state changes. 5095 * 5096 * @param key Key of the selector to use. 5097 */ 5098 useState(key, a1, a2, a3) { 5099 React23.useDebugValue(key); 5100 return useStore(this, this.selectors[key], a1, a2, a3); 5101 } 5102 /** 5103 * Wraps a function with `useStableCallback` to ensure it has a stable reference 5104 * and assigns it to the context. 5105 * 5106 * @param key Key of the event callback. Must be a function in the context. 5107 * @param fn Function to assign. 5108 */ 5109 useContextCallback(key, fn) { 5110 React23.useDebugValue(key); 5111 const stableFunction = useStableCallback(fn ?? NOOP); 5112 this.context[key] = stableFunction; 5113 } 5114 /** 5115 * Returns a stable setter function for a specific key in the store's state. 5116 * It's commonly used to pass as a ref callback to React elements. 5117 * 5118 * @param key Key of the state to set. 5119 */ 5120 useStateSetter(key) { 5121 const ref = React23.useRef(void 0); 5122 if (ref.current === void 0) { 5123 ref.current = (value) => { 5124 this.set(key, value); 5125 }; 5126 } 5127 return ref.current; 5128 } 5129 /** 5130 * Observes changes derived from the store's selectors and calls the listener when the selected value changes. 5131 * 5132 * @param key Key of the selector to observe. 5133 * @param listener Listener function called when the selector result changes. 5134 */ 5135 observe(selector, listener) { 5136 let selectFn; 5137 if (typeof selector === "function") { 5138 selectFn = selector; 5139 } else { 5140 selectFn = this.selectors[selector]; 5141 } 5142 let prevValue = selectFn(this.state); 5143 listener(prevValue, prevValue, this); 5144 return this.subscribe((nextState) => { 5145 const nextValue = selectFn(nextState); 5146 if (!Object.is(prevValue, nextValue)) { 5147 const oldValue = prevValue; 5148 prevValue = nextValue; 5149 listener(nextValue, oldValue, this); 5150 } 5151 }); 5152 } 5153 }; 5154 5155 // node_modules/@base-ui/react/esm/floating-ui-react/components/FloatingRootStore.js 5156 var selectors = { 5157 open: createSelector((state) => state.open), 5158 transitionStatus: createSelector((state) => state.transitionStatus), 5159 domReferenceElement: createSelector((state) => state.domReferenceElement), 5160 referenceElement: createSelector((state) => state.positionReference ?? state.referenceElement), 5161 floatingElement: createSelector((state) => state.floatingElement), 5162 floatingId: createSelector((state) => state.floatingId) 5163 }; 5164 var FloatingRootStore = class extends ReactStore { 5165 constructor(options) { 5166 const { 5167 syncOnly, 5168 nested, 5169 onOpenChange, 5170 triggerElements, 5171 ...initialState 5172 } = options; 5173 super({ 5174 ...initialState, 5175 positionReference: initialState.referenceElement, 5176 domReferenceElement: initialState.referenceElement 5177 }, { 5178 onOpenChange, 5179 dataRef: { 5180 current: {} 5181 }, 5182 events: createEventEmitter(), 5183 nested, 5184 triggerElements 5185 }, selectors); 5186 this.syncOnly = syncOnly; 5187 } 5188 /** 5189 * Syncs the event used by hover logic to distinguish hover-open from click-like interaction. 5190 */ 5191 syncOpenEvent = (newOpen, event) => { 5192 if (!newOpen || !this.state.open || // Prevent a pending hover-open from overwriting a click-open event, while allowing 5193 // click events to upgrade a hover-open. 5194 event != null && isClickLikeEvent(event)) { 5195 this.context.dataRef.current.openEvent = newOpen ? event : void 0; 5196 } 5197 }; 5198 /** 5199 * Runs the root-owned side effects for an open state change. 5200 */ 5201 dispatchOpenChange = (newOpen, eventDetails) => { 5202 this.syncOpenEvent(newOpen, eventDetails.event); 5203 const details = { 5204 open: newOpen, 5205 reason: eventDetails.reason, 5206 nativeEvent: eventDetails.event, 5207 nested: this.context.nested, 5208 triggerElement: eventDetails.trigger 5209 }; 5210 this.context.events.emit("openchange", details); 5211 }; 5212 /** 5213 * Emits the `openchange` event through the internal event emitter and calls the `onOpenChange` handler with the provided arguments. 5214 * 5215 * @param newOpen The new open state. 5216 * @param eventDetails Details about the event that triggered the open state change. 5217 */ 5218 setOpen = (newOpen, eventDetails) => { 5219 if (this.syncOnly) { 5220 this.context.onOpenChange?.(newOpen, eventDetails); 5221 return; 5222 } 5223 this.dispatchOpenChange(newOpen, eventDetails); 5224 this.context.onOpenChange?.(newOpen, eventDetails); 5225 }; 5226 }; 5227 5228 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useSyncedFloatingRootContext.js 5229 function useSyncedFloatingRootContext(options) { 5230 const { 5231 popupStore, 5232 treatPopupAsFloatingElement = false, 5233 floatingRootContext: floatingRootContextProp, 5234 floatingId, 5235 nested, 5236 onOpenChange 5237 } = options; 5238 const open = popupStore.useState("open"); 5239 const referenceElement = popupStore.useState("activeTriggerElement"); 5240 const floatingElement = popupStore.useState(treatPopupAsFloatingElement ? "popupElement" : "positionerElement"); 5241 const triggerElements = popupStore.context.triggerElements; 5242 const handleOpenChange = onOpenChange; 5243 const internalStoreRef = React24.useRef(null); 5244 if (floatingRootContextProp === void 0 && internalStoreRef.current === null) { 5245 internalStoreRef.current = new FloatingRootStore({ 5246 open, 5247 transitionStatus: void 0, 5248 referenceElement, 5249 floatingElement, 5250 triggerElements, 5251 onOpenChange: handleOpenChange, 5252 floatingId, 5253 syncOnly: true, 5254 nested 5255 }); 5256 } 5257 const store = floatingRootContextProp ?? internalStoreRef.current; 5258 popupStore.useSyncedValue("floatingId", floatingId); 5259 useIsoLayoutEffect(() => { 5260 const valuesToSync = { 5261 open, 5262 floatingId, 5263 referenceElement, 5264 floatingElement 5265 }; 5266 if (isElement(referenceElement)) { 5267 valuesToSync.domReferenceElement = referenceElement; 5268 } 5269 if (store.state.positionReference === store.state.referenceElement) { 5270 valuesToSync.positionReference = referenceElement; 5271 } 5272 store.update(valuesToSync); 5273 }, [open, floatingId, referenceElement, floatingElement, store]); 5274 store.context.onOpenChange = handleOpenChange; 5275 store.context.nested = nested; 5276 return store; 5277 } 5278 5279 // node_modules/@base-ui/react/esm/utils/popups/popupStoreUtils.js 5280 var FOCUSABLE_POPUP_PROPS = { 5281 tabIndex: -1, 5282 [FOCUSABLE_ATTRIBUTE]: "" 5283 }; 5284 function usePopupStore(externalStore, createStore, treatPopupAsFloatingElement = false) { 5285 const floatingId = useId(); 5286 const nested = useFloatingParentNodeId() != null; 5287 const internalStoreRef = React25.useRef(null); 5288 if (externalStore === void 0 && internalStoreRef.current === null) { 5289 internalStoreRef.current = createStore(floatingId, nested); 5290 } 5291 const store = externalStore ?? internalStoreRef.current; 5292 useSyncedFloatingRootContext({ 5293 popupStore: store, 5294 treatPopupAsFloatingElement, 5295 floatingRootContext: store.state.floatingRootContext, 5296 floatingId, 5297 nested, 5298 onOpenChange: store.setOpen 5299 }); 5300 return { 5301 store, 5302 internalStore: internalStoreRef.current 5303 }; 5304 } 5305 function useTriggerRegistration(id, store) { 5306 const registeredElementIdRef = React25.useRef(null); 5307 const registeredElementRef = React25.useRef(null); 5308 return React25.useCallback((element) => { 5309 if (id === void 0) { 5310 return; 5311 } 5312 let shouldSyncTriggerCount = false; 5313 if (registeredElementIdRef.current !== null) { 5314 const registeredId = registeredElementIdRef.current; 5315 const registeredElement = registeredElementRef.current; 5316 const currentElement = store.context.triggerElements.getById(registeredId); 5317 if (registeredElement && currentElement === registeredElement) { 5318 store.context.triggerElements.delete(registeredId); 5319 shouldSyncTriggerCount = true; 5320 } 5321 registeredElementIdRef.current = null; 5322 registeredElementRef.current = null; 5323 } 5324 if (element !== null) { 5325 registeredElementIdRef.current = id; 5326 registeredElementRef.current = element; 5327 store.context.triggerElements.add(id, element); 5328 shouldSyncTriggerCount = true; 5329 } 5330 if (shouldSyncTriggerCount) { 5331 const triggerCount = store.context.triggerElements.size; 5332 if (store.select("open") && store.state.triggerCount !== triggerCount) { 5333 store.set("triggerCount", triggerCount); 5334 } 5335 } 5336 }, [store, id]); 5337 } 5338 function setOpenTriggerState(state, open, trigger) { 5339 const triggerId = trigger?.id ?? null; 5340 if (triggerId || open) { 5341 state.activeTriggerId = triggerId; 5342 state.activeTriggerElement = trigger ?? null; 5343 } 5344 } 5345 function useTriggerDataForwarding(triggerId, triggerElementRef, store, stateUpdates) { 5346 const isMountedByThisTrigger = store.useState("isMountedByTrigger", triggerId); 5347 const baseRegisterTrigger = useTriggerRegistration(triggerId, store); 5348 const registerTrigger = useStableCallback((element) => { 5349 baseRegisterTrigger(element); 5350 if (!element) { 5351 return; 5352 } 5353 const open = store.select("open"); 5354 const activeTriggerId = store.select("activeTriggerId"); 5355 if (activeTriggerId === triggerId) { 5356 store.update({ 5357 activeTriggerElement: element, 5358 ...open ? stateUpdates : null 5359 }); 5360 return; 5361 } 5362 if (activeTriggerId == null && open) { 5363 store.update({ 5364 activeTriggerId: triggerId, 5365 activeTriggerElement: element, 5366 ...stateUpdates 5367 }); 5368 } 5369 }); 5370 useIsoLayoutEffect(() => { 5371 if (isMountedByThisTrigger) { 5372 store.update({ 5373 activeTriggerElement: triggerElementRef.current, 5374 ...stateUpdates 5375 }); 5376 } 5377 }, [isMountedByThisTrigger, store, triggerElementRef, ...Object.values(stateUpdates)]); 5378 return { 5379 registerTrigger, 5380 isMountedByThisTrigger 5381 }; 5382 } 5383 function useImplicitActiveTrigger(store) { 5384 const open = store.useState("open"); 5385 const reactiveTriggerCount = store.useState("triggerCount"); 5386 useIsoLayoutEffect(() => { 5387 if (!open) { 5388 if (store.state.triggerCount !== 0) { 5389 store.set("triggerCount", 0); 5390 } 5391 return; 5392 } 5393 const triggerCount = store.context.triggerElements.size; 5394 const stateUpdates = {}; 5395 if (store.state.triggerCount !== triggerCount) { 5396 stateUpdates.triggerCount = triggerCount; 5397 } 5398 if (!store.select("activeTriggerId") && triggerCount === 1) { 5399 const iteratorResult = store.context.triggerElements.entries().next(); 5400 if (!iteratorResult.done) { 5401 const [implicitTriggerId, implicitTriggerElement] = iteratorResult.value; 5402 stateUpdates.activeTriggerId = implicitTriggerId; 5403 stateUpdates.activeTriggerElement = implicitTriggerElement; 5404 } 5405 } 5406 if (stateUpdates.triggerCount !== void 0 || stateUpdates.activeTriggerId !== void 0) { 5407 store.update(stateUpdates); 5408 } 5409 }, [open, store, reactiveTriggerCount]); 5410 } 5411 function useOpenStateTransitions(open, store, onUnmount) { 5412 const { 5413 mounted, 5414 setMounted, 5415 transitionStatus 5416 } = useTransitionStatus(open); 5417 store.useSyncedValues({ 5418 mounted, 5419 transitionStatus 5420 }); 5421 const forceUnmount = useStableCallback(() => { 5422 setMounted(false); 5423 store.update({ 5424 activeTriggerId: null, 5425 activeTriggerElement: null, 5426 mounted: false, 5427 preventUnmountingOnClose: false 5428 }); 5429 onUnmount?.(); 5430 store.context.onOpenChangeComplete?.(false); 5431 }); 5432 const preventUnmountingOnClose = store.useState("preventUnmountingOnClose"); 5433 useOpenChangeComplete({ 5434 enabled: mounted && !open && !preventUnmountingOnClose, 5435 open, 5436 ref: store.context.popupRef, 5437 onComplete() { 5438 if (!open) { 5439 forceUnmount(); 5440 } 5441 } 5442 }); 5443 return { 5444 forceUnmount, 5445 transitionStatus 5446 }; 5447 } 5448 function usePopupInteractionProps(store, statePart) { 5449 store.useSyncedValues(statePart); 5450 useIsoLayoutEffect(() => () => { 5451 store.update({ 5452 activeTriggerProps: EMPTY_OBJECT, 5453 inactiveTriggerProps: EMPTY_OBJECT, 5454 popupProps: EMPTY_OBJECT 5455 }); 5456 }, [store]); 5457 } 5458 5459 // node_modules/@base-ui/react/esm/utils/popups/popupTriggerMap.js 5460 var PopupTriggerMap = class { 5461 constructor() { 5462 this.elementsSet = /* @__PURE__ */ new Set(); 5463 this.idMap = /* @__PURE__ */ new Map(); 5464 } 5465 /** 5466 * Adds a trigger element with the given ID. 5467 * 5468 * Note: The provided element is assumed to not be registered under multiple IDs. 5469 */ 5470 add(id, element) { 5471 const existingElement = this.idMap.get(id); 5472 if (existingElement === element) { 5473 return; 5474 } 5475 if (existingElement !== void 0) { 5476 this.elementsSet.delete(existingElement); 5477 } 5478 this.elementsSet.add(element); 5479 this.idMap.set(id, element); 5480 if (true) { 5481 if (this.elementsSet.size !== this.idMap.size) { 5482 throw new Error("Base UI: A trigger element cannot be registered under multiple IDs in PopupTriggerMap."); 5483 } 5484 } 5485 } 5486 /** 5487 * Removes the trigger element with the given ID. 5488 */ 5489 delete(id) { 5490 const element = this.idMap.get(id); 5491 if (element) { 5492 this.elementsSet.delete(element); 5493 this.idMap.delete(id); 5494 } 5495 } 5496 /** 5497 * Whether the given element is registered as a trigger. 5498 */ 5499 hasElement(element) { 5500 return this.elementsSet.has(element); 5501 } 5502 /** 5503 * Whether there is a registered trigger element matching the given predicate. 5504 */ 5505 hasMatchingElement(predicate) { 5506 for (const element of this.elementsSet) { 5507 if (predicate(element)) { 5508 return true; 5509 } 5510 } 5511 return false; 5512 } 5513 /** 5514 * Returns the trigger element associated with the given ID, or undefined if no such element exists. 5515 */ 5516 getById(id) { 5517 return this.idMap.get(id); 5518 } 5519 /** 5520 * Returns an iterable of all registered trigger entries, where each entry is a tuple of [id, element]. 5521 */ 5522 entries() { 5523 return this.idMap.entries(); 5524 } 5525 /** 5526 * Returns an iterable of all registered trigger elements. 5527 */ 5528 elements() { 5529 return this.elementsSet.values(); 5530 } 5531 /** 5532 * Returns the number of registered trigger elements. 5533 */ 5534 get size() { 5535 return this.idMap.size; 5536 } 5537 }; 5538 5539 // node_modules/@base-ui/react/esm/floating-ui-react/utils/getEmptyRootContext.js 5540 function getEmptyRootContext() { 5541 return new FloatingRootStore({ 5542 open: false, 5543 transitionStatus: void 0, 5544 floatingElement: null, 5545 referenceElement: null, 5546 triggerElements: new PopupTriggerMap(), 5547 floatingId: void 0, 5548 syncOnly: false, 5549 nested: false, 5550 onOpenChange: void 0 5551 }); 5552 } 5553 5554 // node_modules/@base-ui/react/esm/utils/popups/store.js 5555 function createInitialPopupStoreState() { 5556 return { 5557 open: false, 5558 openProp: void 0, 5559 mounted: false, 5560 transitionStatus: void 0, 5561 floatingRootContext: getEmptyRootContext(), 5562 floatingId: void 0, 5563 triggerCount: 0, 5564 preventUnmountingOnClose: false, 5565 payload: void 0, 5566 activeTriggerId: null, 5567 activeTriggerElement: null, 5568 triggerIdProp: void 0, 5569 popupElement: null, 5570 positionerElement: null, 5571 activeTriggerProps: EMPTY_OBJECT, 5572 inactiveTriggerProps: EMPTY_OBJECT, 5573 popupProps: EMPTY_OBJECT 5574 }; 5575 } 5576 function createPopupFloatingRootContext(triggerElements, floatingId, nested = false) { 5577 return new FloatingRootStore({ 5578 open: false, 5579 transitionStatus: void 0, 5580 floatingElement: null, 5581 referenceElement: null, 5582 triggerElements, 5583 floatingId, 5584 syncOnly: true, 5585 nested, 5586 onOpenChange: void 0 5587 }); 5588 } 5589 var activeTriggerIdSelector = createSelector((state) => state.triggerIdProp ?? state.activeTriggerId); 5590 var openSelector = createSelector((state) => state.openProp ?? state.open); 5591 var popupIdSelector = createSelector((state) => { 5592 const popupId = state.popupElement?.id ?? state.floatingId; 5593 return popupId || void 0; 5594 }); 5595 function triggerOwnsOpenPopup(state, triggerId) { 5596 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) === triggerId; 5597 } 5598 function triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) { 5599 if (triggerOwnsOpenPopup(state, triggerId)) { 5600 return true; 5601 } 5602 return triggerId !== void 0 && openSelector(state) && activeTriggerIdSelector(state) == null && state.triggerCount === 1; 5603 } 5604 var popupStoreSelectors = { 5605 open: openSelector, 5606 mounted: createSelector((state) => state.mounted), 5607 transitionStatus: createSelector((state) => state.transitionStatus), 5608 floatingRootContext: createSelector((state) => state.floatingRootContext), 5609 triggerCount: createSelector((state) => state.triggerCount), 5610 preventUnmountingOnClose: createSelector((state) => state.preventUnmountingOnClose), 5611 payload: createSelector((state) => state.payload), 5612 activeTriggerId: activeTriggerIdSelector, 5613 activeTriggerElement: createSelector((state) => state.mounted ? state.activeTriggerElement : null), 5614 popupId: popupIdSelector, 5615 /** 5616 * Whether the trigger with the given ID was used to open the popup. 5617 */ 5618 isTriggerActive: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId), 5619 /** 5620 * Whether the popup is open and was activated by a trigger with the given ID. 5621 */ 5622 isOpenedByTrigger: createSelector((state, triggerId) => triggerOwnsOpenPopup(state, triggerId)), 5623 /** 5624 * Whether the popup is mounted and was activated by a trigger with the given ID. 5625 */ 5626 isMountedByTrigger: createSelector((state, triggerId) => triggerId !== void 0 && activeTriggerIdSelector(state) === triggerId && state.mounted), 5627 triggerProps: createSelector((state, isActive) => isActive ? state.activeTriggerProps : state.inactiveTriggerProps), 5628 /** 5629 * Popup id for the trigger that currently owns the open popup. 5630 */ 5631 triggerPopupId: createSelector((state, triggerId) => triggerOwnsOpenPopupOrIsOnlyTrigger(state, triggerId) ? popupIdSelector(state) : void 0), 5632 popupProps: createSelector((state) => state.popupProps), 5633 popupElement: createSelector((state) => state.popupElement), 5634 positionerElement: createSelector((state) => state.positionerElement) 5635 }; 5636 5637 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloatingRootContext.js 5638 function useFloatingRootContext(options) { 5639 const { 5640 open = false, 5641 onOpenChange, 5642 elements: elements2 = {} 5643 } = options; 5644 const floatingId = useId(); 5645 const nested = useFloatingParentNodeId() != null; 5646 if (true) { 5647 const optionDomReference = elements2.reference; 5648 if (optionDomReference && !isElement(optionDomReference)) { 5649 console.error("Cannot pass a virtual element to the `elements.reference` option,", "as it must be a real DOM element. Use `context.setPositionReference()`", "instead."); 5650 } 5651 } 5652 const store = useRefWithInit(() => new FloatingRootStore({ 5653 open, 5654 transitionStatus: void 0, 5655 onOpenChange, 5656 referenceElement: elements2.reference ?? null, 5657 floatingElement: elements2.floating ?? null, 5658 triggerElements: new PopupTriggerMap(), 5659 floatingId, 5660 syncOnly: false, 5661 nested 5662 })).current; 5663 useIsoLayoutEffect(() => { 5664 const valuesToSync = { 5665 open, 5666 floatingId 5667 }; 5668 if (elements2.reference !== void 0) { 5669 valuesToSync.referenceElement = elements2.reference; 5670 valuesToSync.domReferenceElement = isElement(elements2.reference) ? elements2.reference : null; 5671 } 5672 if (elements2.floating !== void 0) { 5673 valuesToSync.floatingElement = elements2.floating; 5674 } 5675 store.update(valuesToSync); 5676 }, [open, floatingId, elements2.reference, elements2.floating, store]); 5677 store.context.onOpenChange = onOpenChange; 5678 store.context.nested = nested; 5679 return store; 5680 } 5681 5682 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFloating.js 5683 function useFloating2(options = {}) { 5684 const { 5685 nodeId, 5686 externalTree 5687 } = options; 5688 const internalStore = useFloatingRootContext(options); 5689 const store = options.rootContext || internalStore; 5690 const referenceElement = store.useState("referenceElement"); 5691 const floatingElement = store.useState("floatingElement"); 5692 const domReferenceElement = store.useState("domReferenceElement"); 5693 const open = store.useState("open"); 5694 const floatingId = store.useState("floatingId"); 5695 const [positionReference, setPositionReferenceRaw] = React26.useState(null); 5696 const [localDomReference, setLocalDomReference] = React26.useState(void 0); 5697 const [localFloatingElement, setLocalFloatingElement] = React26.useState(void 0); 5698 const domReferenceRef = React26.useRef(null); 5699 const tree = useFloatingTree(externalTree); 5700 const storeElements = React26.useMemo(() => ({ 5701 reference: referenceElement, 5702 floating: floatingElement, 5703 domReference: domReferenceElement 5704 }), [referenceElement, floatingElement, domReferenceElement]); 5705 const position = useFloating({ 5706 ...options, 5707 elements: { 5708 ...storeElements, 5709 ...positionReference && { 5710 reference: positionReference 5711 } 5712 } 5713 }); 5714 const localDomReferenceElement = isElement(localDomReference) ? localDomReference : null; 5715 const syncedFloatingElement = localFloatingElement === void 0 ? store.state.floatingElement : localFloatingElement; 5716 store.useSyncedValue("referenceElement", localDomReference ?? null); 5717 store.useSyncedValue("domReferenceElement", localDomReference === void 0 ? domReferenceElement : localDomReferenceElement); 5718 store.useSyncedValue("floatingElement", syncedFloatingElement); 5719 const setPositionReference = React26.useCallback((node) => { 5720 const computedPositionReference = isElement(node) ? { 5721 getBoundingClientRect: () => node.getBoundingClientRect(), 5722 getClientRects: () => node.getClientRects(), 5723 contextElement: node 5724 } : node; 5725 setPositionReferenceRaw(computedPositionReference); 5726 position.refs.setReference(computedPositionReference); 5727 }, [position.refs]); 5728 const setReference = React26.useCallback((node) => { 5729 if (isElement(node) || node === null) { 5730 domReferenceRef.current = node; 5731 setLocalDomReference(node); 5732 } 5733 if (isElement(position.refs.reference.current) || position.refs.reference.current === null || // Don't allow setting virtual elements using the old technique back to 5734 // `null` to support `positionReference` + an unstable `reference` 5735 // callback ref. 5736 node !== null && !isElement(node)) { 5737 position.refs.setReference(node); 5738 } 5739 }, [position.refs, setLocalDomReference]); 5740 const setFloating = React26.useCallback((node) => { 5741 setLocalFloatingElement(node); 5742 position.refs.setFloating(node); 5743 }, [position.refs]); 5744 const refs = React26.useMemo(() => ({ 5745 ...position.refs, 5746 setReference, 5747 setFloating, 5748 setPositionReference, 5749 domReference: domReferenceRef 5750 }), [position.refs, setReference, setFloating, setPositionReference]); 5751 const elements2 = React26.useMemo(() => ({ 5752 ...position.elements, 5753 domReference: domReferenceElement 5754 }), [position.elements, domReferenceElement]); 5755 const context = React26.useMemo(() => ({ 5756 ...position, 5757 dataRef: store.context.dataRef, 5758 open, 5759 onOpenChange: store.setOpen, 5760 events: store.context.events, 5761 floatingId, 5762 refs, 5763 elements: elements2, 5764 nodeId, 5765 rootStore: store 5766 }), [position, refs, elements2, nodeId, store, open, floatingId]); 5767 useIsoLayoutEffect(() => { 5768 if (domReferenceElement) { 5769 domReferenceRef.current = domReferenceElement; 5770 } 5771 }, [domReferenceElement]); 5772 useIsoLayoutEffect(() => { 5773 store.context.dataRef.current.floatingContext = context; 5774 const node = tree?.nodesRef.current.find((n2) => n2.id === nodeId); 5775 if (node) { 5776 node.context = context; 5777 } 5778 }); 5779 return React26.useMemo(() => ({ 5780 ...position, 5781 context, 5782 refs, 5783 elements: elements2, 5784 rootStore: store 5785 }), [position, refs, elements2, context, store]); 5786 } 5787 5788 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useFocus.js 5789 var React27 = __toESM(require_react(), 1); 5790 var isMacSafari = isMac && isSafari; 5791 function useFocus(context, props = {}) { 5792 const { 5793 enabled = true, 5794 delay 5795 } = props; 5796 const store = "rootStore" in context ? context.rootStore : context; 5797 const { 5798 events, 5799 dataRef 5800 } = store.context; 5801 const blockFocusRef = React27.useRef(false); 5802 const blockedReferenceRef = React27.useRef(null); 5803 const keyboardModalityRef = React27.useRef(true); 5804 const timeout = useTimeout(); 5805 React27.useEffect(() => { 5806 const domReference = store.select("domReferenceElement"); 5807 if (!enabled) { 5808 return void 0; 5809 } 5810 const win = getWindow(domReference); 5811 function onBlur() { 5812 const currentDomReference = store.select("domReferenceElement"); 5813 if (!store.select("open") && isHTMLElement(currentDomReference) && currentDomReference === activeElement(ownerDocument(currentDomReference))) { 5814 blockFocusRef.current = true; 5815 } 5816 } 5817 function onKeyDown() { 5818 keyboardModalityRef.current = true; 5819 } 5820 function onPointerDown() { 5821 keyboardModalityRef.current = false; 5822 } 5823 return mergeCleanups(addEventListener(win, "blur", onBlur), isMacSafari && addEventListener(win, "keydown", onKeyDown, true), isMacSafari && addEventListener(win, "pointerdown", onPointerDown, true)); 5824 }, [store, enabled]); 5825 React27.useEffect(() => { 5826 if (!enabled) { 5827 return void 0; 5828 } 5829 function onOpenChangeLocal(details) { 5830 if (details.reason === reason_parts_exports.triggerPress || details.reason === reason_parts_exports.escapeKey) { 5831 const referenceElement = store.select("domReferenceElement"); 5832 if (isElement(referenceElement)) { 5833 blockedReferenceRef.current = referenceElement; 5834 blockFocusRef.current = true; 5835 } 5836 } 5837 } 5838 events.on("openchange", onOpenChangeLocal); 5839 return () => { 5840 events.off("openchange", onOpenChangeLocal); 5841 }; 5842 }, [events, enabled, store]); 5843 const reference = React27.useMemo(() => { 5844 function resetBlockedFocus() { 5845 blockFocusRef.current = false; 5846 blockedReferenceRef.current = null; 5847 } 5848 return { 5849 onMouseLeave() { 5850 resetBlockedFocus(); 5851 }, 5852 onFocus(event) { 5853 const focusTarget = event.currentTarget; 5854 if (blockFocusRef.current) { 5855 if (blockedReferenceRef.current === focusTarget) { 5856 return; 5857 } 5858 resetBlockedFocus(); 5859 } 5860 const target = getTarget(event.nativeEvent); 5861 if (isElement(target)) { 5862 if (isMacSafari && !event.relatedTarget) { 5863 if (!keyboardModalityRef.current && !isTypeableElement(target)) { 5864 return; 5865 } 5866 } else if (!matchesFocusVisible(target)) { 5867 return; 5868 } 5869 } 5870 const movedFromOtherEnabledTrigger = isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements); 5871 const { 5872 nativeEvent, 5873 currentTarget 5874 } = event; 5875 const delayValue = typeof delay === "function" ? delay() : delay; 5876 if (store.select("open") && movedFromOtherEnabledTrigger || delayValue === 0 || delayValue === void 0) { 5877 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 5878 return; 5879 } 5880 timeout.start(delayValue, () => { 5881 if (blockFocusRef.current) { 5882 return; 5883 } 5884 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent, currentTarget)); 5885 }); 5886 }, 5887 onBlur(event) { 5888 resetBlockedFocus(); 5889 const relatedTarget = event.relatedTarget; 5890 const nativeEvent = event.nativeEvent; 5891 const movedToFocusGuard = isElement(relatedTarget) && relatedTarget.hasAttribute(createAttribute("focus-guard")) && relatedTarget.getAttribute("data-type") === "outside"; 5892 timeout.start(0, () => { 5893 const domReference = store.select("domReferenceElement"); 5894 const activeEl = activeElement(ownerDocument(domReference)); 5895 if (!relatedTarget && activeEl === domReference) { 5896 return; 5897 } 5898 if (contains(dataRef.current.floatingContext?.refs.floating.current, activeEl) || contains(domReference, activeEl) || movedToFocusGuard) { 5899 return; 5900 } 5901 const nextFocusedElement = relatedTarget ?? activeEl; 5902 if (isTargetInsideEnabledTrigger(nextFocusedElement, store.context.triggerElements)) { 5903 return; 5904 } 5905 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerFocus, nativeEvent)); 5906 }); 5907 } 5908 }; 5909 }, [dataRef, delay, store, timeout]); 5910 return React27.useMemo(() => enabled ? { 5911 reference, 5912 trigger: reference 5913 } : {}, [enabled, reference]); 5914 } 5915 5916 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js 5917 var React28 = __toESM(require_react(), 1); 5918 5919 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverInteractionSharedState.js 5920 var HoverInteraction = class _HoverInteraction { 5921 constructor() { 5922 this.pointerType = void 0; 5923 this.interactedInside = false; 5924 this.handler = void 0; 5925 this.blockMouseMove = true; 5926 this.performedPointerEventsMutation = false; 5927 this.pointerEventsScopeElement = null; 5928 this.pointerEventsReferenceElement = null; 5929 this.pointerEventsFloatingElement = null; 5930 this.restTimeoutPending = false; 5931 this.openChangeTimeout = new Timeout(); 5932 this.restTimeout = new Timeout(); 5933 this.handleCloseOptions = void 0; 5934 } 5935 static create() { 5936 return new _HoverInteraction(); 5937 } 5938 dispose = () => { 5939 this.openChangeTimeout.clear(); 5940 this.restTimeout.clear(); 5941 }; 5942 disposeEffect = () => { 5943 return this.dispose; 5944 }; 5945 }; 5946 var pointerEventsMutationOwnerByScopeElement = /* @__PURE__ */ new WeakMap(); 5947 function clearSafePolygonPointerEventsMutation(instance) { 5948 if (!instance.performedPointerEventsMutation) { 5949 return; 5950 } 5951 const scopeElement = instance.pointerEventsScopeElement; 5952 if (scopeElement && pointerEventsMutationOwnerByScopeElement.get(scopeElement) === instance) { 5953 instance.pointerEventsScopeElement?.style.removeProperty("pointer-events"); 5954 instance.pointerEventsReferenceElement?.style.removeProperty("pointer-events"); 5955 instance.pointerEventsFloatingElement?.style.removeProperty("pointer-events"); 5956 pointerEventsMutationOwnerByScopeElement.delete(scopeElement); 5957 } 5958 instance.performedPointerEventsMutation = false; 5959 instance.pointerEventsScopeElement = null; 5960 instance.pointerEventsReferenceElement = null; 5961 instance.pointerEventsFloatingElement = null; 5962 } 5963 function applySafePolygonPointerEventsMutation(instance, options) { 5964 const { 5965 scopeElement, 5966 referenceElement, 5967 floatingElement 5968 } = options; 5969 const existingOwner = pointerEventsMutationOwnerByScopeElement.get(scopeElement); 5970 if (existingOwner && existingOwner !== instance) { 5971 clearSafePolygonPointerEventsMutation(existingOwner); 5972 } 5973 clearSafePolygonPointerEventsMutation(instance); 5974 instance.performedPointerEventsMutation = true; 5975 instance.pointerEventsScopeElement = scopeElement; 5976 instance.pointerEventsReferenceElement = referenceElement; 5977 instance.pointerEventsFloatingElement = floatingElement; 5978 pointerEventsMutationOwnerByScopeElement.set(scopeElement, instance); 5979 scopeElement.style.pointerEvents = "none"; 5980 referenceElement.style.pointerEvents = "auto"; 5981 floatingElement.style.pointerEvents = "auto"; 5982 } 5983 function useHoverInteractionSharedState(store) { 5984 const data = store.context.dataRef.current; 5985 const instance = useRefWithInit(() => data.hoverInteractionState ?? HoverInteraction.create()).current; 5986 if (!data.hoverInteractionState) { 5987 data.hoverInteractionState = instance; 5988 } 5989 useOnMount(data.hoverInteractionState.disposeEffect); 5990 return data.hoverInteractionState; 5991 } 5992 5993 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverFloatingInteraction.js 5994 function useHoverFloatingInteraction(context, parameters = {}) { 5995 const { 5996 enabled = true, 5997 closeDelay: closeDelayProp = 0, 5998 nodeId: nodeIdProp 5999 } = parameters; 6000 const store = "rootStore" in context ? context.rootStore : context; 6001 const open = store.useState("open"); 6002 const floatingElement = store.useState("floatingElement"); 6003 const domReferenceElement = store.useState("domReferenceElement"); 6004 const { 6005 dataRef 6006 } = store.context; 6007 const tree = useFloatingTree(); 6008 const parentId = useFloatingParentNodeId(); 6009 const instance = useHoverInteractionSharedState(store); 6010 const childClosedTimeout = useTimeout(); 6011 const isClickLikeOpenEvent2 = useStableCallback(() => { 6012 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 6013 }); 6014 const isHoverOpen = useStableCallback(() => { 6015 return isHoverOpenEvent(dataRef.current.openEvent?.type); 6016 }); 6017 const clearPointerEvents = useStableCallback(() => { 6018 clearSafePolygonPointerEventsMutation(instance); 6019 }); 6020 useIsoLayoutEffect(() => { 6021 if (!open) { 6022 instance.pointerType = void 0; 6023 instance.restTimeoutPending = false; 6024 instance.interactedInside = false; 6025 clearPointerEvents(); 6026 } 6027 }, [open, instance, clearPointerEvents]); 6028 React28.useEffect(() => { 6029 return clearPointerEvents; 6030 }, [clearPointerEvents]); 6031 useIsoLayoutEffect(() => { 6032 if (!enabled) { 6033 return void 0; 6034 } 6035 if (open && instance.handleCloseOptions?.blockPointerEvents && isHoverOpen() && isElement(domReferenceElement) && floatingElement) { 6036 const ref = domReferenceElement; 6037 const floatingEl = floatingElement; 6038 const doc = ownerDocument(floatingElement); 6039 const parentFloating = tree?.nodesRef.current.find((node) => node.id === parentId)?.context?.elements.floating; 6040 if (parentFloating) { 6041 parentFloating.style.pointerEvents = ""; 6042 } 6043 const cachedScopeElement = instance.pointerEventsScopeElement !== floatingEl ? instance.pointerEventsScopeElement : null; 6044 const parentScopeElement = parentFloating !== floatingEl ? parentFloating : null; 6045 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? cachedScopeElement ?? parentScopeElement ?? ref.closest("[data-rootownerid]") ?? doc.body; 6046 applySafePolygonPointerEventsMutation(instance, { 6047 scopeElement, 6048 referenceElement: ref, 6049 floatingElement: floatingEl 6050 }); 6051 return () => { 6052 clearPointerEvents(); 6053 }; 6054 } 6055 return void 0; 6056 }, [enabled, open, domReferenceElement, floatingElement, instance, isHoverOpen, tree, parentId, clearPointerEvents]); 6057 React28.useEffect(() => { 6058 if (!enabled) { 6059 return void 0; 6060 } 6061 function hasParentChildren() { 6062 return !!(tree && parentId && getNodeChildren(tree.nodesRef.current, parentId).length > 0); 6063 } 6064 function closeWithDelay(event) { 6065 const closeDelay = getDelay(closeDelayProp, "close", instance.pointerType); 6066 const close = () => { 6067 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6068 tree?.events.emit("floating.closed", event); 6069 }; 6070 if (closeDelay) { 6071 instance.openChangeTimeout.start(closeDelay, close); 6072 } else { 6073 instance.openChangeTimeout.clear(); 6074 close(); 6075 } 6076 } 6077 function handleInteractInside(event) { 6078 const target = getTarget(event); 6079 if (!isInteractiveElement(target)) { 6080 instance.interactedInside = false; 6081 return; 6082 } 6083 instance.interactedInside = target?.closest("[aria-haspopup]") != null; 6084 } 6085 function onFloatingMouseEnter() { 6086 instance.openChangeTimeout.clear(); 6087 childClosedTimeout.clear(); 6088 tree?.events.off("floating.closed", onNodeClosed); 6089 clearPointerEvents(); 6090 } 6091 function onFloatingMouseLeave(event) { 6092 if (hasParentChildren() && tree) { 6093 tree.events.on("floating.closed", onNodeClosed); 6094 return; 6095 } 6096 if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) { 6097 return; 6098 } 6099 const currentNodeId = dataRef.current.floatingContext?.nodeId ?? nodeIdProp; 6100 const relatedTarget = event.relatedTarget; 6101 const isMovingIntoDescendantFloating = tree && currentNodeId && isElement(relatedTarget) && getNodeChildren(tree.nodesRef.current, currentNodeId, false).some((node) => contains(node.context?.elements.floating, relatedTarget)); 6102 if (isMovingIntoDescendantFloating) { 6103 return; 6104 } 6105 if (instance.handler) { 6106 instance.handler(event); 6107 return; 6108 } 6109 clearPointerEvents(); 6110 if (!isClickLikeOpenEvent2()) { 6111 closeWithDelay(event); 6112 } 6113 } 6114 function onNodeClosed(event) { 6115 if (!tree || !parentId || hasParentChildren()) { 6116 return; 6117 } 6118 childClosedTimeout.start(0, () => { 6119 tree.events.off("floating.closed", onNodeClosed); 6120 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6121 tree.events.emit("floating.closed", event); 6122 }); 6123 } 6124 const floating = floatingElement; 6125 return mergeCleanups(floating && addEventListener(floating, "mouseenter", onFloatingMouseEnter), floating && addEventListener(floating, "mouseleave", onFloatingMouseLeave), floating && addEventListener(floating, "pointerdown", handleInteractInside, true), () => { 6126 tree?.events.off("floating.closed", onNodeClosed); 6127 }); 6128 }, [enabled, floatingElement, store, dataRef, closeDelayProp, nodeIdProp, isClickLikeOpenEvent2, clearPointerEvents, instance, tree, parentId, childClosedTimeout]); 6129 } 6130 6131 // node_modules/@base-ui/react/esm/floating-ui-react/hooks/useHoverReferenceInteraction.js 6132 var React29 = __toESM(require_react(), 1); 6133 var ReactDOM4 = __toESM(require_react_dom(), 1); 6134 var EMPTY_REF = { 6135 current: null 6136 }; 6137 function useHoverReferenceInteraction(context, props = {}) { 6138 const { 6139 enabled = true, 6140 delay = 0, 6141 handleClose = null, 6142 mouseOnly = false, 6143 restMs = 0, 6144 move = true, 6145 triggerElementRef = EMPTY_REF, 6146 externalTree, 6147 isActiveTrigger = true, 6148 getHandleCloseContext, 6149 isClosing, 6150 shouldOpen: shouldOpenProp 6151 } = props; 6152 const store = "rootStore" in context ? context.rootStore : context; 6153 const { 6154 dataRef, 6155 events 6156 } = store.context; 6157 const tree = useFloatingTree(externalTree); 6158 const instance = useHoverInteractionSharedState(store); 6159 const isHoverCloseActiveRef = React29.useRef(false); 6160 const handleCloseRef = useValueAsRef(handleClose); 6161 const delayRef = useValueAsRef(delay); 6162 const restMsRef = useValueAsRef(restMs); 6163 const enabledRef = useValueAsRef(enabled); 6164 const shouldOpenRef = useValueAsRef(shouldOpenProp); 6165 const isClosingRef = useValueAsRef(isClosing); 6166 const isClickLikeOpenEvent2 = useStableCallback(() => { 6167 return isClickLikeOpenEvent(dataRef.current.openEvent?.type, instance.interactedInside); 6168 }); 6169 const checkShouldOpen = useStableCallback(() => { 6170 return shouldOpenRef.current?.() !== false; 6171 }); 6172 const isOverInactiveTrigger = useStableCallback((currentDomReference, currentTarget, target) => { 6173 const allTriggers = store.context.triggerElements; 6174 if (allTriggers.hasElement(currentTarget)) { 6175 return !currentDomReference || !contains(currentDomReference, currentTarget); 6176 } 6177 if (!isElement(target)) { 6178 return false; 6179 } 6180 const targetElement = target; 6181 return allTriggers.hasMatchingElement((trigger) => contains(trigger, targetElement)) && (!currentDomReference || !contains(currentDomReference, targetElement)); 6182 }); 6183 const cleanupMouseMoveHandler = useStableCallback(() => { 6184 if (!instance.handler) { 6185 return; 6186 } 6187 const doc = ownerDocument(store.select("domReferenceElement")); 6188 doc.removeEventListener("mousemove", instance.handler); 6189 instance.handler = void 0; 6190 }); 6191 const clearPointerEvents = useStableCallback(() => { 6192 clearSafePolygonPointerEventsMutation(instance); 6193 }); 6194 if (isActiveTrigger) { 6195 instance.handleCloseOptions = handleCloseRef.current?.__options; 6196 } 6197 React29.useEffect(() => cleanupMouseMoveHandler, [cleanupMouseMoveHandler]); 6198 React29.useEffect(() => { 6199 if (!enabled) { 6200 return void 0; 6201 } 6202 function onOpenChangeLocal(details) { 6203 if (!details.open) { 6204 isHoverCloseActiveRef.current = details.reason === reason_parts_exports.triggerHover; 6205 cleanupMouseMoveHandler(); 6206 instance.openChangeTimeout.clear(); 6207 instance.restTimeout.clear(); 6208 instance.blockMouseMove = true; 6209 instance.restTimeoutPending = false; 6210 } else { 6211 isHoverCloseActiveRef.current = false; 6212 } 6213 } 6214 events.on("openchange", onOpenChangeLocal); 6215 return () => { 6216 events.off("openchange", onOpenChangeLocal); 6217 }; 6218 }, [enabled, events, instance, cleanupMouseMoveHandler]); 6219 React29.useEffect(() => { 6220 if (!enabled) { 6221 return void 0; 6222 } 6223 function closeWithDelay(event, runElseBranch = true) { 6224 const closeDelay = getDelay(delayRef.current, "close", instance.pointerType); 6225 if (closeDelay) { 6226 instance.openChangeTimeout.start(closeDelay, () => { 6227 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6228 tree?.events.emit("floating.closed", event); 6229 }); 6230 } else if (runElseBranch) { 6231 instance.openChangeTimeout.clear(); 6232 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 6233 tree?.events.emit("floating.closed", event); 6234 } 6235 } 6236 const trigger = triggerElementRef.current ?? (isActiveTrigger ? store.select("domReferenceElement") : null); 6237 if (!isElement(trigger)) { 6238 return void 0; 6239 } 6240 function onMouseEnter(event) { 6241 instance.openChangeTimeout.clear(); 6242 instance.blockMouseMove = false; 6243 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 6244 return; 6245 } 6246 const restMsValue = getRestMs(restMsRef.current); 6247 const openDelay = getDelay(delayRef.current, "open", instance.pointerType); 6248 const eventTarget = getTarget(event); 6249 const currentTarget = event.currentTarget ?? null; 6250 const currentDomReference = store.select("domReferenceElement"); 6251 let triggerNode = currentTarget; 6252 if (isElement(eventTarget) && !store.context.triggerElements.hasElement(eventTarget)) { 6253 for (const triggerElement of store.context.triggerElements.elements()) { 6254 if (contains(triggerElement, eventTarget)) { 6255 triggerNode = triggerElement; 6256 break; 6257 } 6258 } 6259 } 6260 if (isElement(currentTarget) && isElement(currentDomReference) && !store.context.triggerElements.hasElement(currentTarget) && contains(currentTarget, currentDomReference)) { 6261 triggerNode = currentDomReference; 6262 } 6263 const isOverInactive = triggerNode == null ? false : isOverInactiveTrigger(currentDomReference, triggerNode, eventTarget); 6264 const isOpen = store.select("open"); 6265 const isInClosingTransition = isClosingRef.current?.() ?? store.select("transitionStatus") === "ending"; 6266 const isHoverCloseTransition = !isOpen && isInClosingTransition && isHoverCloseActiveRef.current; 6267 const isReenteringSameTriggerDuringCloseTransition = !isOverInactive && isElement(triggerNode) && isElement(currentDomReference) && contains(currentDomReference, triggerNode) && isHoverCloseTransition; 6268 const isRestOnlyDelay = restMsValue > 0 && !openDelay; 6269 const shouldOpenImmediately = isOverInactive && (isOpen || isHoverCloseTransition) || isReenteringSameTriggerDuringCloseTransition; 6270 const shouldOpen = !isOpen || isOverInactive; 6271 if (shouldOpenImmediately) { 6272 if (checkShouldOpen()) { 6273 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6274 } 6275 return; 6276 } 6277 if (isRestOnlyDelay) { 6278 return; 6279 } 6280 if (openDelay) { 6281 instance.openChangeTimeout.start(openDelay, () => { 6282 if (shouldOpen && checkShouldOpen()) { 6283 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6284 } 6285 }); 6286 } else if (shouldOpen) { 6287 if (checkShouldOpen()) { 6288 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerNode)); 6289 } 6290 } 6291 } 6292 function onMouseLeave(event) { 6293 if (isClickLikeOpenEvent2()) { 6294 clearPointerEvents(); 6295 return; 6296 } 6297 cleanupMouseMoveHandler(); 6298 const domReferenceElement = store.select("domReferenceElement"); 6299 const doc = ownerDocument(domReferenceElement); 6300 instance.restTimeout.clear(); 6301 instance.restTimeoutPending = false; 6302 const handleCloseContextBase = dataRef.current.floatingContext ?? getHandleCloseContext?.(); 6303 if (isTargetInsideEnabledTrigger(event.relatedTarget, store.context.triggerElements)) { 6304 return; 6305 } 6306 if (handleCloseRef.current && handleCloseContextBase) { 6307 if (!store.select("open")) { 6308 instance.openChangeTimeout.clear(); 6309 } 6310 const currentTrigger = triggerElementRef.current; 6311 instance.handler = handleCloseRef.current({ 6312 ...handleCloseContextBase, 6313 tree, 6314 x: event.clientX, 6315 y: event.clientY, 6316 onClose() { 6317 clearPointerEvents(); 6318 cleanupMouseMoveHandler(); 6319 if (enabledRef.current && !isClickLikeOpenEvent2() && currentTrigger === store.select("domReferenceElement")) { 6320 closeWithDelay(event, true); 6321 } 6322 } 6323 }); 6324 doc.addEventListener("mousemove", instance.handler); 6325 instance.handler(event); 6326 return; 6327 } 6328 const shouldClose = instance.pointerType === "touch" ? !contains(store.select("floatingElement"), event.relatedTarget) : true; 6329 if (shouldClose) { 6330 closeWithDelay(event); 6331 } 6332 } 6333 if (move) { 6334 return mergeCleanups(addEventListener(trigger, "mousemove", onMouseEnter, { 6335 once: true 6336 }), addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave)); 6337 } 6338 return mergeCleanups(addEventListener(trigger, "mouseenter", onMouseEnter), addEventListener(trigger, "mouseleave", onMouseLeave)); 6339 }, [cleanupMouseMoveHandler, clearPointerEvents, dataRef, delayRef, store, enabled, handleCloseRef, instance, isActiveTrigger, isOverInactiveTrigger, isClickLikeOpenEvent2, mouseOnly, move, restMsRef, triggerElementRef, tree, enabledRef, getHandleCloseContext, isClosingRef, checkShouldOpen]); 6340 return React29.useMemo(() => { 6341 if (!enabled) { 6342 return void 0; 6343 } 6344 function setPointerRef(event) { 6345 instance.pointerType = event.pointerType; 6346 } 6347 return { 6348 onPointerDown: setPointerRef, 6349 onPointerEnter: setPointerRef, 6350 onMouseMove(event) { 6351 const { 6352 nativeEvent 6353 } = event; 6354 const trigger = event.currentTarget; 6355 const currentDomReference = store.select("domReferenceElement"); 6356 const currentOpen = store.select("open"); 6357 const isOverInactive = isOverInactiveTrigger(currentDomReference, trigger, event.target); 6358 if (mouseOnly && !isMouseLikePointerType(instance.pointerType)) { 6359 return; 6360 } 6361 if (currentOpen && isOverInactive && instance.handleCloseOptions?.blockPointerEvents) { 6362 const floatingElement = store.select("floatingElement"); 6363 if (floatingElement) { 6364 const scopeElement = instance.handleCloseOptions?.getScope?.() ?? trigger.ownerDocument.body; 6365 applySafePolygonPointerEventsMutation(instance, { 6366 scopeElement, 6367 referenceElement: trigger, 6368 floatingElement 6369 }); 6370 } 6371 } 6372 const restMsValue = getRestMs(restMsRef.current); 6373 if (currentOpen && !isOverInactive || restMsValue === 0) { 6374 return; 6375 } 6376 if (!isOverInactive && instance.restTimeoutPending && event.movementX ** 2 + event.movementY ** 2 < 2) { 6377 return; 6378 } 6379 instance.restTimeout.clear(); 6380 function handleMouseMove() { 6381 instance.restTimeoutPending = false; 6382 if (isClickLikeOpenEvent2()) { 6383 return; 6384 } 6385 const latestOpen = store.select("open"); 6386 if (!instance.blockMouseMove && (!latestOpen || isOverInactive) && checkShouldOpen()) { 6387 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, nativeEvent, trigger)); 6388 } 6389 } 6390 if (instance.pointerType === "touch") { 6391 ReactDOM4.flushSync(() => { 6392 handleMouseMove(); 6393 }); 6394 } else if (isOverInactive && currentOpen) { 6395 handleMouseMove(); 6396 } else { 6397 instance.restTimeoutPending = true; 6398 instance.restTimeout.start(restMsValue, handleMouseMove); 6399 } 6400 } 6401 }; 6402 }, [enabled, instance, isClickLikeOpenEvent2, isOverInactiveTrigger, mouseOnly, store, restMsRef, checkShouldOpen]); 6403 } 6404 6405 // node_modules/@base-ui/react/esm/floating-ui-react/safePolygon.js 6406 var CURSOR_SPEED_THRESHOLD = 0.1; 6407 var CURSOR_SPEED_THRESHOLD_SQUARED = CURSOR_SPEED_THRESHOLD * CURSOR_SPEED_THRESHOLD; 6408 var POLYGON_BUFFER = 0.5; 6409 function hasIntersectingEdge(pointX, pointY, xi, yi, xj, yj) { 6410 return yi >= pointY !== yj >= pointY && pointX <= (xj - xi) * (pointY - yi) / (yj - yi) + xi; 6411 } 6412 function isPointInQuadrilateral(pointX, pointY, x1, y1, x2, y2, x3, y3, x4, y4) { 6413 let isInsideValue = false; 6414 if (hasIntersectingEdge(pointX, pointY, x1, y1, x2, y2)) { 6415 isInsideValue = !isInsideValue; 6416 } 6417 if (hasIntersectingEdge(pointX, pointY, x2, y2, x3, y3)) { 6418 isInsideValue = !isInsideValue; 6419 } 6420 if (hasIntersectingEdge(pointX, pointY, x3, y3, x4, y4)) { 6421 isInsideValue = !isInsideValue; 6422 } 6423 if (hasIntersectingEdge(pointX, pointY, x4, y4, x1, y1)) { 6424 isInsideValue = !isInsideValue; 6425 } 6426 return isInsideValue; 6427 } 6428 function isInsideRect(pointX, pointY, rect) { 6429 return pointX >= rect.x && pointX <= rect.x + rect.width && pointY >= rect.y && pointY <= rect.y + rect.height; 6430 } 6431 function isInsideAxisAlignedRect(pointX, pointY, x1, y1, x2, y2) { 6432 const minX = Math.min(x1, x2); 6433 const maxX = Math.max(x1, x2); 6434 const minY = Math.min(y1, y2); 6435 const maxY = Math.max(y1, y2); 6436 return pointX >= minX && pointX <= maxX && pointY >= minY && pointY <= maxY; 6437 } 6438 function safePolygon(options = {}) { 6439 const { 6440 blockPointerEvents = false 6441 } = options; 6442 const timeout = new Timeout(); 6443 const fn = ({ 6444 x: x2, 6445 y: y2, 6446 placement, 6447 elements: elements2, 6448 onClose, 6449 nodeId, 6450 tree 6451 }) => { 6452 const side = placement?.split("-")[0]; 6453 let hasLanded = false; 6454 let lastX = null; 6455 let lastY = null; 6456 let lastCursorTime = typeof performance !== "undefined" ? performance.now() : 0; 6457 function isCursorMovingSlowly(nextX, nextY) { 6458 const currentTime = performance.now(); 6459 const elapsedTime = currentTime - lastCursorTime; 6460 if (lastX === null || lastY === null || elapsedTime === 0) { 6461 lastX = nextX; 6462 lastY = nextY; 6463 lastCursorTime = currentTime; 6464 return false; 6465 } 6466 const deltaX = nextX - lastX; 6467 const deltaY = nextY - lastY; 6468 const distanceSquared = deltaX * deltaX + deltaY * deltaY; 6469 const thresholdSquared = elapsedTime * elapsedTime * CURSOR_SPEED_THRESHOLD_SQUARED; 6470 lastX = nextX; 6471 lastY = nextY; 6472 lastCursorTime = currentTime; 6473 return distanceSquared < thresholdSquared; 6474 } 6475 function close() { 6476 timeout.clear(); 6477 onClose(); 6478 } 6479 return function onMouseMove(event) { 6480 timeout.clear(); 6481 const domReference = elements2.domReference; 6482 const floating = elements2.floating; 6483 if (!domReference || !floating || side == null || x2 == null || y2 == null) { 6484 return void 0; 6485 } 6486 const { 6487 clientX, 6488 clientY 6489 } = event; 6490 const target = getTarget(event); 6491 const isLeave = event.type === "mouseleave"; 6492 const isOverFloatingEl = contains(floating, target); 6493 const isOverReferenceEl = contains(domReference, target); 6494 if (isOverFloatingEl) { 6495 hasLanded = true; 6496 if (!isLeave) { 6497 return void 0; 6498 } 6499 } 6500 if (isOverReferenceEl) { 6501 hasLanded = false; 6502 if (!isLeave) { 6503 hasLanded = true; 6504 return void 0; 6505 } 6506 } 6507 if (isLeave && isElement(event.relatedTarget) && contains(floating, event.relatedTarget)) { 6508 return void 0; 6509 } 6510 function hasOpenChildNode() { 6511 return Boolean(tree && getNodeChildren(tree.nodesRef.current, nodeId).length > 0); 6512 } 6513 function closeIfNoOpenChild() { 6514 if (!hasOpenChildNode()) { 6515 close(); 6516 } 6517 } 6518 if (hasOpenChildNode()) { 6519 return void 0; 6520 } 6521 const refRect = domReference.getBoundingClientRect(); 6522 const rect = floating.getBoundingClientRect(); 6523 const cursorLeaveFromRight = x2 > rect.right - rect.width / 2; 6524 const cursorLeaveFromBottom = y2 > rect.bottom - rect.height / 2; 6525 const isFloatingWider = rect.width > refRect.width; 6526 const isFloatingTaller = rect.height > refRect.height; 6527 const left = (isFloatingWider ? refRect : rect).left; 6528 const right = (isFloatingWider ? refRect : rect).right; 6529 const top = (isFloatingTaller ? refRect : rect).top; 6530 const bottom = (isFloatingTaller ? refRect : rect).bottom; 6531 if (side === "top" && y2 >= refRect.bottom - 1 || side === "bottom" && y2 <= refRect.top + 1 || side === "left" && x2 >= refRect.right - 1 || side === "right" && x2 <= refRect.left + 1) { 6532 closeIfNoOpenChild(); 6533 return void 0; 6534 } 6535 let isInsideTroughRect = false; 6536 switch (side) { 6537 case "top": 6538 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, refRect.top + 1, right, rect.bottom - 1); 6539 break; 6540 case "bottom": 6541 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, left, rect.top + 1, right, refRect.bottom - 1); 6542 break; 6543 case "left": 6544 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, rect.right - 1, bottom, refRect.left + 1, top); 6545 break; 6546 case "right": 6547 isInsideTroughRect = isInsideAxisAlignedRect(clientX, clientY, refRect.right - 1, bottom, rect.left + 1, top); 6548 break; 6549 default: 6550 } 6551 if (isInsideTroughRect) { 6552 return void 0; 6553 } 6554 if (hasLanded && !isInsideRect(clientX, clientY, refRect)) { 6555 closeIfNoOpenChild(); 6556 return void 0; 6557 } 6558 if (!isLeave && isCursorMovingSlowly(clientX, clientY)) { 6559 closeIfNoOpenChild(); 6560 return void 0; 6561 } 6562 let isInsidePolygon = false; 6563 switch (side) { 6564 case "top": { 6565 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6566 const cursorPointOneX = isFloatingWider ? x2 + cursorXOffset : cursorLeaveFromRight ? x2 + cursorXOffset : x2 - cursorXOffset; 6567 const cursorPointTwoX = isFloatingWider ? x2 - cursorXOffset : cursorLeaveFromRight ? x2 + cursorXOffset : x2 - cursorXOffset; 6568 const cursorPointY = y2 + POLYGON_BUFFER + 1; 6569 const commonYLeft = cursorLeaveFromRight ? rect.bottom - POLYGON_BUFFER : isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top; 6570 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.bottom - POLYGON_BUFFER : rect.top : rect.bottom - POLYGON_BUFFER; 6571 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 6572 break; 6573 } 6574 case "bottom": { 6575 const cursorXOffset = isFloatingWider ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6576 const cursorPointOneX = isFloatingWider ? x2 + cursorXOffset : cursorLeaveFromRight ? x2 + cursorXOffset : x2 - cursorXOffset; 6577 const cursorPointTwoX = isFloatingWider ? x2 - cursorXOffset : cursorLeaveFromRight ? x2 + cursorXOffset : x2 - cursorXOffset; 6578 const cursorPointY = y2 - POLYGON_BUFFER; 6579 const commonYLeft = cursorLeaveFromRight ? rect.top + POLYGON_BUFFER : isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom; 6580 const commonYRight = cursorLeaveFromRight ? isFloatingWider ? rect.top + POLYGON_BUFFER : rect.bottom : rect.top + POLYGON_BUFFER; 6581 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointOneX, cursorPointY, cursorPointTwoX, cursorPointY, rect.left, commonYLeft, rect.right, commonYRight); 6582 break; 6583 } 6584 case "left": { 6585 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6586 const cursorPointOneY = isFloatingTaller ? y2 + cursorYOffset : cursorLeaveFromBottom ? y2 + cursorYOffset : y2 - cursorYOffset; 6587 const cursorPointTwoY = isFloatingTaller ? y2 - cursorYOffset : cursorLeaveFromBottom ? y2 + cursorYOffset : y2 - cursorYOffset; 6588 const cursorPointX = x2 + POLYGON_BUFFER + 1; 6589 const commonXTop = cursorLeaveFromBottom ? rect.right - POLYGON_BUFFER : isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left; 6590 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.right - POLYGON_BUFFER : rect.left : rect.right - POLYGON_BUFFER; 6591 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, commonXTop, rect.top, commonXBottom, rect.bottom, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY); 6592 break; 6593 } 6594 case "right": { 6595 const cursorYOffset = isFloatingTaller ? POLYGON_BUFFER / 2 : POLYGON_BUFFER * 4; 6596 const cursorPointOneY = isFloatingTaller ? y2 + cursorYOffset : cursorLeaveFromBottom ? y2 + cursorYOffset : y2 - cursorYOffset; 6597 const cursorPointTwoY = isFloatingTaller ? y2 - cursorYOffset : cursorLeaveFromBottom ? y2 + cursorYOffset : y2 - cursorYOffset; 6598 const cursorPointX = x2 - POLYGON_BUFFER; 6599 const commonXTop = cursorLeaveFromBottom ? rect.left + POLYGON_BUFFER : isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right; 6600 const commonXBottom = cursorLeaveFromBottom ? isFloatingTaller ? rect.left + POLYGON_BUFFER : rect.right : rect.left + POLYGON_BUFFER; 6601 isInsidePolygon = isPointInQuadrilateral(clientX, clientY, cursorPointX, cursorPointOneY, cursorPointX, cursorPointTwoY, commonXTop, rect.top, commonXBottom, rect.bottom); 6602 break; 6603 } 6604 default: 6605 } 6606 if (!isInsidePolygon) { 6607 closeIfNoOpenChild(); 6608 } else if (!hasLanded) { 6609 timeout.start(40, closeIfNoOpenChild); 6610 } 6611 return void 0; 6612 }; 6613 }; 6614 fn.__options = { 6615 ...options, 6616 blockPointerEvents 6617 }; 6618 return fn; 6619 } 6620 6621 // node_modules/@base-ui/react/esm/utils/popupStateMapping.js 6622 var CommonPopupDataAttributes = (function(CommonPopupDataAttributes2) { 6623 CommonPopupDataAttributes2["open"] = "data-open"; 6624 CommonPopupDataAttributes2["closed"] = "data-closed"; 6625 CommonPopupDataAttributes2[CommonPopupDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; 6626 CommonPopupDataAttributes2[CommonPopupDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; 6627 CommonPopupDataAttributes2["anchorHidden"] = "data-anchor-hidden"; 6628 CommonPopupDataAttributes2["side"] = "data-side"; 6629 CommonPopupDataAttributes2["align"] = "data-align"; 6630 return CommonPopupDataAttributes2; 6631 })({}); 6632 var CommonTriggerDataAttributes = /* @__PURE__ */ (function(CommonTriggerDataAttributes2) { 6633 CommonTriggerDataAttributes2["popupOpen"] = "data-popup-open"; 6634 CommonTriggerDataAttributes2["pressed"] = "data-pressed"; 6635 return CommonTriggerDataAttributes2; 6636 })({}); 6637 var TRIGGER_HOOK = { 6638 [CommonTriggerDataAttributes.popupOpen]: "" 6639 }; 6640 var PRESSABLE_TRIGGER_HOOK = { 6641 [CommonTriggerDataAttributes.popupOpen]: "", 6642 [CommonTriggerDataAttributes.pressed]: "" 6643 }; 6644 var POPUP_OPEN_HOOK = { 6645 [CommonPopupDataAttributes.open]: "" 6646 }; 6647 var POPUP_CLOSED_HOOK = { 6648 [CommonPopupDataAttributes.closed]: "" 6649 }; 6650 var ANCHOR_HIDDEN_HOOK = { 6651 [CommonPopupDataAttributes.anchorHidden]: "" 6652 }; 6653 var triggerOpenStateMapping = { 6654 open(value) { 6655 if (value) { 6656 return TRIGGER_HOOK; 6657 } 6658 return null; 6659 } 6660 }; 6661 var popupStateMapping = { 6662 open(value) { 6663 if (value) { 6664 return POPUP_OPEN_HOOK; 6665 } 6666 return POPUP_CLOSED_HOOK; 6667 }, 6668 anchorHidden(value) { 6669 if (value) { 6670 return ANCHOR_HIDDEN_HOOK; 6671 } 6672 return null; 6673 } 6674 }; 6675 6676 // node_modules/@base-ui/utils/esm/inertValue.js 6677 function inertValue(value) { 6678 if (isReactVersionAtLeast(19)) { 6679 return value; 6680 } 6681 return value ? "true" : void 0; 6682 } 6683 6684 // node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js 6685 var React30 = __toESM(require_react(), 1); 6686 6687 // node_modules/@base-ui/react/esm/floating-ui-react/middleware/arrow.js 6688 var baseArrow = (options) => ({ 6689 name: "arrow", 6690 options, 6691 async fn(state) { 6692 const { 6693 x: x2, 6694 y: y2, 6695 placement, 6696 rects, 6697 platform: platform3, 6698 elements: elements2, 6699 middlewareData 6700 } = state; 6701 const { 6702 element, 6703 padding = 0, 6704 offsetParent = "real" 6705 } = evaluate(options, state) || {}; 6706 if (element == null) { 6707 return {}; 6708 } 6709 const paddingObject = getPaddingObject(padding); 6710 const coords = { 6711 x: x2, 6712 y: y2 6713 }; 6714 const axis = getAlignmentAxis(placement); 6715 const length = getAxisLength(axis); 6716 const arrowDimensions = await platform3.getDimensions(element); 6717 const isYAxis = axis === "y"; 6718 const minProp = isYAxis ? "top" : "left"; 6719 const maxProp = isYAxis ? "bottom" : "right"; 6720 const clientProp = isYAxis ? "clientHeight" : "clientWidth"; 6721 const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length]; 6722 const startDiff = coords[axis] - rects.reference[axis]; 6723 const arrowOffsetParent = offsetParent === "real" ? await platform3.getOffsetParent?.(element) : elements2.floating; 6724 let clientSize = elements2.floating[clientProp] || rects.floating[length]; 6725 if (!clientSize || !await platform3.isElement?.(arrowOffsetParent)) { 6726 clientSize = elements2.floating[clientProp] || rects.floating[length]; 6727 } 6728 const centerToReference = endDiff / 2 - startDiff / 2; 6729 const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1; 6730 const minPadding = Math.min(paddingObject[minProp], largestPossiblePadding); 6731 const maxPadding = Math.min(paddingObject[maxProp], largestPossiblePadding); 6732 const min2 = minPadding; 6733 const max2 = clientSize - arrowDimensions[length] - maxPadding; 6734 const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference; 6735 const offset4 = clamp(min2, center, max2); 6736 const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset4 && rects.reference[length] / 2 - (center < min2 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0; 6737 const alignmentOffset = shouldAddOffset ? center < min2 ? center - min2 : center - max2 : 0; 6738 return { 6739 [axis]: coords[axis] + alignmentOffset, 6740 data: { 6741 [axis]: offset4, 6742 centerOffset: center - offset4 - alignmentOffset, 6743 ...shouldAddOffset && { 6744 alignmentOffset 6745 } 6746 }, 6747 reset: shouldAddOffset 6748 }; 6749 } 6750 }); 6751 var arrow4 = (options, deps) => ({ 6752 ...baseArrow(options), 6753 options: [options, deps] 6754 }); 6755 6756 // node_modules/@base-ui/react/esm/utils/hideMiddleware.js 6757 var hide4 = { 6758 name: "hide", 6759 async fn(state) { 6760 const { 6761 width, 6762 height, 6763 x: x2, 6764 y: y2 6765 } = state.rects.reference; 6766 const anchorHidden = width === 0 && height === 0 && x2 === 0 && y2 === 0; 6767 const nativeHideResult = await hide3().fn(state); 6768 return { 6769 data: { 6770 referenceHidden: nativeHideResult.data?.referenceHidden || anchorHidden 6771 } 6772 }; 6773 } 6774 }; 6775 6776 // node_modules/@base-ui/react/esm/utils/adaptiveOriginMiddleware.js 6777 var DEFAULT_SIDES = { 6778 sideX: "left", 6779 sideY: "top" 6780 }; 6781 var adaptiveOrigin = { 6782 name: "adaptiveOrigin", 6783 async fn(state) { 6784 const { 6785 x: rawX, 6786 y: rawY, 6787 rects: { 6788 floating: floatRect 6789 }, 6790 elements: { 6791 floating 6792 }, 6793 platform: platform3, 6794 strategy, 6795 placement 6796 } = state; 6797 const win = getWindow(floating); 6798 const styles = win.getComputedStyle(floating); 6799 const hasTransition = styles.transitionDuration !== "0s" && styles.transitionDuration !== ""; 6800 if (!hasTransition) { 6801 return { 6802 x: rawX, 6803 y: rawY, 6804 data: DEFAULT_SIDES 6805 }; 6806 } 6807 const offsetParent = await platform3.getOffsetParent?.(floating); 6808 let offsetDimensions = { 6809 width: 0, 6810 height: 0 6811 }; 6812 if (strategy === "fixed" && win?.visualViewport) { 6813 offsetDimensions = { 6814 width: win.visualViewport.width, 6815 height: win.visualViewport.height 6816 }; 6817 } else if (offsetParent === win) { 6818 const doc = ownerDocument(floating); 6819 offsetDimensions = { 6820 width: doc.documentElement.clientWidth, 6821 height: doc.documentElement.clientHeight 6822 }; 6823 } else if (await platform3.isElement?.(offsetParent)) { 6824 offsetDimensions = await platform3.getDimensions(offsetParent); 6825 } 6826 const currentSide = getSide(placement); 6827 let x2 = rawX; 6828 let y2 = rawY; 6829 if (currentSide === "left") { 6830 x2 = offsetDimensions.width - (rawX + floatRect.width); 6831 } 6832 if (currentSide === "top") { 6833 y2 = offsetDimensions.height - (rawY + floatRect.height); 6834 } 6835 const sideX = currentSide === "left" ? "right" : DEFAULT_SIDES.sideX; 6836 const sideY = currentSide === "top" ? "bottom" : DEFAULT_SIDES.sideY; 6837 return { 6838 x: x2, 6839 y: y2, 6840 data: { 6841 sideX, 6842 sideY 6843 } 6844 }; 6845 } 6846 }; 6847 6848 // node_modules/@base-ui/react/esm/utils/useAnchorPositioning.js 6849 function getLogicalSide(sideParam, renderedSide, isRtl) { 6850 const isLogicalSideParam = sideParam === "inline-start" || sideParam === "inline-end"; 6851 const logicalRight = isRtl ? "inline-start" : "inline-end"; 6852 const logicalLeft = isRtl ? "inline-end" : "inline-start"; 6853 return { 6854 top: "top", 6855 right: isLogicalSideParam ? logicalRight : "right", 6856 bottom: "bottom", 6857 left: isLogicalSideParam ? logicalLeft : "left" 6858 }[renderedSide]; 6859 } 6860 function getOffsetData(state, sideParam, isRtl) { 6861 const { 6862 rects, 6863 placement 6864 } = state; 6865 const data = { 6866 side: getLogicalSide(sideParam, getSide(placement), isRtl), 6867 align: getAlignment(placement) || "center", 6868 anchor: { 6869 width: rects.reference.width, 6870 height: rects.reference.height 6871 }, 6872 positioner: { 6873 width: rects.floating.width, 6874 height: rects.floating.height 6875 } 6876 }; 6877 return data; 6878 } 6879 function useAnchorPositioning(params) { 6880 const { 6881 // Public parameters 6882 anchor, 6883 positionMethod = "absolute", 6884 side: sideParam = "bottom", 6885 sideOffset = 0, 6886 align = "center", 6887 alignOffset = 0, 6888 collisionBoundary, 6889 collisionPadding: collisionPaddingParam = 5, 6890 sticky = false, 6891 arrowPadding = 5, 6892 disableAnchorTracking = false, 6893 inline: inlineMiddleware, 6894 // Private parameters 6895 keepMounted = false, 6896 floatingRootContext, 6897 mounted, 6898 collisionAvoidance, 6899 shiftCrossAxis = false, 6900 nodeId, 6901 adaptiveOrigin: adaptiveOrigin2, 6902 lazyFlip = false, 6903 externalTree 6904 } = params; 6905 const [mountSide, setMountSide] = React30.useState(null); 6906 if (!mounted && mountSide !== null) { 6907 setMountSide(null); 6908 } 6909 const collisionAvoidanceSide = collisionAvoidance.side || "flip"; 6910 const collisionAvoidanceAlign = collisionAvoidance.align || "flip"; 6911 const collisionAvoidanceFallbackAxisSide = collisionAvoidance.fallbackAxisSide || "end"; 6912 const anchorFn = typeof anchor === "function" ? anchor : void 0; 6913 const anchorFnCallback = useStableCallback(anchorFn); 6914 const anchorDep = anchorFn ? anchorFnCallback : anchor; 6915 const anchorValueRef = useValueAsRef(anchor); 6916 const mountedRef = useValueAsRef(mounted); 6917 const direction = useDirection(); 6918 const isRtl = direction === "rtl"; 6919 const side = mountSide || { 6920 top: "top", 6921 right: "right", 6922 bottom: "bottom", 6923 left: "left", 6924 "inline-end": isRtl ? "left" : "right", 6925 "inline-start": isRtl ? "right" : "left" 6926 }[sideParam]; 6927 const placement = align === "center" ? side : `$side}-$align}`; 6928 let collisionPadding = collisionPaddingParam; 6929 const bias = 1; 6930 const biasTop = sideParam === "bottom" ? bias : 0; 6931 const biasBottom = sideParam === "top" ? bias : 0; 6932 const biasLeft = sideParam === "right" ? bias : 0; 6933 const biasRight = sideParam === "left" ? bias : 0; 6934 if (typeof collisionPadding === "number") { 6935 collisionPadding = { 6936 top: collisionPadding + biasTop, 6937 right: collisionPadding + biasRight, 6938 bottom: collisionPadding + biasBottom, 6939 left: collisionPadding + biasLeft 6940 }; 6941 } else if (collisionPadding) { 6942 collisionPadding = { 6943 top: (collisionPadding.top || 0) + biasTop, 6944 right: (collisionPadding.right || 0) + biasRight, 6945 bottom: (collisionPadding.bottom || 0) + biasBottom, 6946 left: (collisionPadding.left || 0) + biasLeft 6947 }; 6948 } 6949 const commonCollisionProps = { 6950 boundary: collisionBoundary === "clipping-ancestors" ? "clippingAncestors" : collisionBoundary, 6951 padding: collisionPadding 6952 }; 6953 const arrowRef = React30.useRef(null); 6954 const sideOffsetRef = useValueAsRef(sideOffset); 6955 const alignOffsetRef = useValueAsRef(alignOffset); 6956 const sideOffsetDep = typeof sideOffset !== "function" ? sideOffset : 0; 6957 const alignOffsetDep = typeof alignOffset !== "function" ? alignOffset : 0; 6958 const middleware = []; 6959 if (inlineMiddleware) { 6960 middleware.push(inlineMiddleware); 6961 } 6962 middleware.push(offset3((state) => { 6963 const data = getOffsetData(state, sideParam, isRtl); 6964 const sideAxis = typeof sideOffsetRef.current === "function" ? sideOffsetRef.current(data) : sideOffsetRef.current; 6965 const alignAxis = typeof alignOffsetRef.current === "function" ? alignOffsetRef.current(data) : alignOffsetRef.current; 6966 return { 6967 mainAxis: sideAxis, 6968 crossAxis: alignAxis, 6969 alignmentAxis: alignAxis 6970 }; 6971 }, [sideOffsetDep, alignOffsetDep, isRtl, sideParam])); 6972 const shiftDisabled = collisionAvoidanceAlign === "none" && collisionAvoidanceSide !== "shift"; 6973 const crossAxisShiftEnabled = !shiftDisabled && (sticky || shiftCrossAxis || collisionAvoidanceSide === "shift"); 6974 const flipMiddleware = collisionAvoidanceSide === "none" ? null : flip3({ 6975 ...commonCollisionProps, 6976 // Ensure the popup flips if it's been limited by its --available-height and it resizes. 6977 // Since the size() padding is smaller than the flip() padding, flip() will take precedence. 6978 padding: { 6979 top: collisionPadding.top + bias, 6980 right: collisionPadding.right + bias, 6981 bottom: collisionPadding.bottom + bias, 6982 left: collisionPadding.left + bias 6983 }, 6984 mainAxis: !shiftCrossAxis && collisionAvoidanceSide === "flip", 6985 crossAxis: collisionAvoidanceAlign === "flip" ? "alignment" : false, 6986 fallbackAxisSideDirection: collisionAvoidanceFallbackAxisSide 6987 }); 6988 const shiftMiddleware = shiftDisabled ? null : shift3((data) => { 6989 const html = ownerDocument(data.elements.floating).documentElement; 6990 return { 6991 ...commonCollisionProps, 6992 // Use the Layout Viewport to avoid shifting around when pinch-zooming 6993 // for context menus. 6994 rootBoundary: shiftCrossAxis ? { 6995 x: 0, 6996 y: 0, 6997 width: html.clientWidth, 6998 height: html.clientHeight 6999 } : void 0, 7000 mainAxis: collisionAvoidanceAlign !== "none", 7001 crossAxis: crossAxisShiftEnabled, 7002 limiter: sticky || shiftCrossAxis ? void 0 : limitShift3((limitData) => { 7003 if (!arrowRef.current) { 7004 return {}; 7005 } 7006 const { 7007 width, 7008 height 7009 } = arrowRef.current.getBoundingClientRect(); 7010 const sideAxis = getSideAxis(getSide(limitData.placement)); 7011 const arrowSize = sideAxis === "y" ? width : height; 7012 const offsetAmount = sideAxis === "y" ? collisionPadding.left + collisionPadding.right : collisionPadding.top + collisionPadding.bottom; 7013 return { 7014 offset: arrowSize / 2 + offsetAmount / 2 7015 }; 7016 }) 7017 }; 7018 }, [commonCollisionProps, sticky, shiftCrossAxis, collisionPadding, collisionAvoidanceAlign]); 7019 if (collisionAvoidanceSide === "shift" || collisionAvoidanceAlign === "shift" || align === "center") { 7020 middleware.push(shiftMiddleware, flipMiddleware); 7021 } else { 7022 middleware.push(flipMiddleware, shiftMiddleware); 7023 } 7024 middleware.push(size3({ 7025 ...commonCollisionProps, 7026 apply({ 7027 elements: { 7028 floating 7029 }, 7030 availableWidth, 7031 availableHeight, 7032 rects 7033 }) { 7034 if (!mountedRef.current) { 7035 return; 7036 } 7037 const floatingStyle = floating.style; 7038 floatingStyle.setProperty("--available-width", `$availableWidth}px`); 7039 floatingStyle.setProperty("--available-height", `$availableHeight}px`); 7040 const dpr = getWindow(floating).devicePixelRatio || 1; 7041 const { 7042 x: x3, 7043 y: y3, 7044 width, 7045 height 7046 } = rects.reference; 7047 const anchorWidth = (Math.round((x3 + width) * dpr) - Math.round(x3 * dpr)) / dpr; 7048 const anchorHeight = (Math.round((y3 + height) * dpr) - Math.round(y3 * dpr)) / dpr; 7049 floatingStyle.setProperty("--anchor-width", `$anchorWidth}px`); 7050 floatingStyle.setProperty("--anchor-height", `$anchorHeight}px`); 7051 } 7052 }), arrow4((state) => ({ 7053 // `transform-origin` calculations rely on an element existing. If the arrow hasn't been set, 7054 // we'll create a fake element. 7055 element: arrowRef.current || ownerDocument(state.elements.floating).createElement("div"), 7056 padding: arrowPadding, 7057 offsetParent: "floating" 7058 }), [arrowPadding]), { 7059 name: "transformOrigin", 7060 fn(state) { 7061 const { 7062 elements: elements3, 7063 middlewareData: middlewareData2, 7064 placement: renderedPlacement2, 7065 rects, 7066 y: y3 7067 } = state; 7068 const currentRenderedSide = getSide(renderedPlacement2); 7069 const currentRenderedAxis = getSideAxis(currentRenderedSide); 7070 const arrowEl = arrowRef.current; 7071 const arrowX = middlewareData2.arrow?.x || 0; 7072 const arrowY = middlewareData2.arrow?.y || 0; 7073 const arrowWidth = arrowEl?.clientWidth || 0; 7074 const arrowHeight = arrowEl?.clientHeight || 0; 7075 const transformX = arrowX + arrowWidth / 2; 7076 const transformY = arrowY + arrowHeight / 2; 7077 const shiftY = Math.abs(middlewareData2.shift?.y || 0); 7078 const halfAnchorHeight = rects.reference.height / 2; 7079 const sideOffsetValue = typeof sideOffset === "function" ? sideOffset(getOffsetData(state, sideParam, isRtl)) : sideOffset; 7080 const isOverlappingAnchor = shiftY > sideOffsetValue; 7081 const adjacentTransformOrigin = { 7082 top: `$transformX}px calc(100% + $sideOffsetValue}px)`, 7083 bottom: `$transformX}px ${-sideOffsetValue}px`, 7084 left: `calc(100% + $sideOffsetValue}px) $transformY}px`, 7085 right: `${-sideOffsetValue}px $transformY}px` 7086 }[currentRenderedSide]; 7087 const overlapTransformOrigin = `$transformX}px $rects.reference.y + halfAnchorHeight - y3}px`; 7088 elements3.floating.style.setProperty("--transform-origin", crossAxisShiftEnabled && currentRenderedAxis === "y" && isOverlappingAnchor ? overlapTransformOrigin : adjacentTransformOrigin); 7089 return {}; 7090 } 7091 }, hide4, adaptiveOrigin2); 7092 useIsoLayoutEffect(() => { 7093 if (!mounted && floatingRootContext) { 7094 floatingRootContext.update({ 7095 referenceElement: null, 7096 floatingElement: null, 7097 domReferenceElement: null, 7098 positionReference: null 7099 }); 7100 } 7101 }, [mounted, floatingRootContext]); 7102 const autoUpdateOptions = React30.useMemo(() => ({ 7103 elementResize: !disableAnchorTracking && typeof ResizeObserver !== "undefined", 7104 layoutShift: !disableAnchorTracking && typeof IntersectionObserver !== "undefined" 7105 }), [disableAnchorTracking]); 7106 const { 7107 refs, 7108 elements: elements2, 7109 x: x2, 7110 y: y2, 7111 middlewareData, 7112 update: update2, 7113 placement: renderedPlacement, 7114 context, 7115 isPositioned, 7116 floatingStyles: originalFloatingStyles 7117 } = useFloating2({ 7118 rootContext: floatingRootContext, 7119 open: keepMounted ? mounted : void 0, 7120 placement, 7121 middleware, 7122 strategy: positionMethod, 7123 whileElementsMounted: keepMounted ? void 0 : (...args) => autoUpdate(...args, autoUpdateOptions), 7124 nodeId, 7125 externalTree 7126 }); 7127 const { 7128 sideX, 7129 sideY 7130 } = middlewareData.adaptiveOrigin || DEFAULT_SIDES; 7131 const resolvedPosition = isPositioned ? positionMethod : "fixed"; 7132 const floatingStyles = React30.useMemo(() => { 7133 const base = adaptiveOrigin2 ? { 7134 position: resolvedPosition, 7135 [sideX]: x2, 7136 [sideY]: y2 7137 } : { 7138 position: resolvedPosition, 7139 ...originalFloatingStyles 7140 }; 7141 if (!isPositioned) { 7142 base.opacity = 0; 7143 } 7144 return base; 7145 }, [adaptiveOrigin2, resolvedPosition, sideX, x2, sideY, y2, originalFloatingStyles, isPositioned]); 7146 const registeredPositionReferenceRef = React30.useRef(null); 7147 useIsoLayoutEffect(() => { 7148 if (!mounted) { 7149 return; 7150 } 7151 const anchorValue = anchorValueRef.current; 7152 const resolvedAnchor = typeof anchorValue === "function" ? anchorValue() : anchorValue; 7153 const unwrappedElement = (isRef(resolvedAnchor) ? resolvedAnchor.current : resolvedAnchor) || null; 7154 const finalAnchor = unwrappedElement || null; 7155 if (finalAnchor !== registeredPositionReferenceRef.current) { 7156 refs.setPositionReference(finalAnchor); 7157 registeredPositionReferenceRef.current = finalAnchor; 7158 } 7159 }, [mounted, refs, anchorDep, anchorValueRef]); 7160 React30.useEffect(() => { 7161 if (!mounted) { 7162 return; 7163 } 7164 const anchorValue = anchorValueRef.current; 7165 if (typeof anchorValue === "function") { 7166 return; 7167 } 7168 if (isRef(anchorValue) && anchorValue.current !== registeredPositionReferenceRef.current) { 7169 refs.setPositionReference(anchorValue.current); 7170 registeredPositionReferenceRef.current = anchorValue.current; 7171 } 7172 }, [mounted, refs, anchorDep, anchorValueRef]); 7173 React30.useEffect(() => { 7174 if (keepMounted && mounted && elements2.domReference && elements2.floating) { 7175 return autoUpdate(elements2.domReference, elements2.floating, update2, autoUpdateOptions); 7176 } 7177 return void 0; 7178 }, [keepMounted, mounted, elements2, update2, autoUpdateOptions]); 7179 const renderedSide = getSide(renderedPlacement); 7180 const logicalRenderedSide = getLogicalSide(sideParam, renderedSide, isRtl); 7181 const renderedAlign = getAlignment(renderedPlacement) || "center"; 7182 const anchorHidden = Boolean(middlewareData.hide?.referenceHidden); 7183 useIsoLayoutEffect(() => { 7184 if (lazyFlip && mounted && isPositioned) { 7185 setMountSide(renderedSide); 7186 } 7187 }, [lazyFlip, mounted, isPositioned, renderedSide]); 7188 const arrowStyles = React30.useMemo(() => ({ 7189 position: "absolute", 7190 top: middlewareData.arrow?.y, 7191 left: middlewareData.arrow?.x 7192 }), [middlewareData.arrow]); 7193 const arrowUncentered = middlewareData.arrow?.centerOffset !== 0; 7194 return React30.useMemo(() => ({ 7195 positionerStyles: floatingStyles, 7196 arrowStyles, 7197 arrowRef, 7198 arrowUncentered, 7199 side: logicalRenderedSide, 7200 align: renderedAlign, 7201 physicalSide: renderedSide, 7202 anchorHidden, 7203 refs, 7204 context, 7205 isPositioned, 7206 update: update2 7207 }), [floatingStyles, arrowStyles, arrowRef, arrowUncentered, logicalRenderedSide, renderedAlign, renderedSide, anchorHidden, refs, context, isPositioned, update2]); 7208 } 7209 function isRef(param) { 7210 return param != null && "current" in param; 7211 } 7212 7213 // node_modules/@base-ui/react/esm/utils/getDisabledMountTransitionStyles.js 7214 function getDisabledMountTransitionStyles(transitionStatus) { 7215 return transitionStatus === "starting" ? DISABLED_TRANSITIONS_STYLE : EMPTY_OBJECT; 7216 } 7217 7218 // node_modules/@base-ui/react/esm/utils/usePositioner.js 7219 function usePositioner(componentProps, state, { 7220 styles, 7221 transitionStatus, 7222 props, 7223 refs, 7224 hidden, 7225 inert = false 7226 }) { 7227 const style = { 7228 ...styles 7229 }; 7230 if (inert) { 7231 style.pointerEvents = "none"; 7232 } 7233 return useRenderElement("div", componentProps, { 7234 state, 7235 ref: refs, 7236 props: [{ 7237 role: "presentation", 7238 hidden, 7239 style 7240 }, getDisabledMountTransitionStyles(transitionStatus), props], 7241 stateAttributesMapping: popupStateMapping 7242 }); 7243 } 7244 7245 // node_modules/@base-ui/react/esm/utils/usePopupViewport.js 7246 var React33 = __toESM(require_react(), 1); 7247 var ReactDOM5 = __toESM(require_react_dom(), 1); 7248 7249 // node_modules/@base-ui/utils/esm/usePreviousValue.js 7250 var React31 = __toESM(require_react(), 1); 7251 function usePreviousValue(value) { 7252 const [state, setState] = React31.useState({ 7253 current: value, 7254 previous: null 7255 }); 7256 if (value !== state.current) { 7257 setState({ 7258 current: value, 7259 previous: state.current 7260 }); 7261 } 7262 return state.previous; 7263 } 7264 7265 // node_modules/@base-ui/react/esm/utils/usePopupAutoResize.js 7266 var React32 = __toESM(require_react(), 1); 7267 7268 // node_modules/@base-ui/react/esm/utils/getCssDimensions.js 7269 function getCssDimensions2(element) { 7270 const css = getComputedStyle2(element); 7271 let width = parseFloat(css.width) || 0; 7272 let height = parseFloat(css.height) || 0; 7273 const hasOffset = isHTMLElement(element); 7274 const offsetWidth = hasOffset ? element.offsetWidth : width; 7275 const offsetHeight = hasOffset ? element.offsetHeight : height; 7276 const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight; 7277 if (shouldFallback) { 7278 width = offsetWidth; 7279 height = offsetHeight; 7280 } 7281 return { 7282 width, 7283 height 7284 }; 7285 } 7286 7287 // node_modules/@base-ui/react/esm/utils/usePopupAutoResize.js 7288 var DEFAULT_ENABLED = () => true; 7289 function usePopupAutoResize(parameters) { 7290 const { 7291 popupElement, 7292 positionerElement, 7293 content, 7294 mounted, 7295 enabled = DEFAULT_ENABLED, 7296 onMeasureLayout: onMeasureLayoutParam, 7297 onMeasureLayoutComplete: onMeasureLayoutCompleteParam, 7298 side, 7299 direction 7300 } = parameters; 7301 const runOnceAnimationsFinish = useAnimationsFinished(popupElement, true, false); 7302 const animationFrame = useAnimationFrame(); 7303 const committedDimensionsRef = React32.useRef(null); 7304 const liveDimensionsRef = React32.useRef(null); 7305 const isInitialRenderRef = React32.useRef(true); 7306 const restoreAnchoringStylesRef = React32.useRef(NOOP); 7307 const onMeasureLayout = useStableCallback(onMeasureLayoutParam); 7308 const onMeasureLayoutComplete = useStableCallback(onMeasureLayoutCompleteParam); 7309 const anchoringStyles = React32.useMemo(() => { 7310 let isOriginSide = side === "top"; 7311 let isPhysicalLeft = side === "left"; 7312 if (direction === "rtl") { 7313 isOriginSide = isOriginSide || side === "inline-end"; 7314 isPhysicalLeft = isPhysicalLeft || side === "inline-end"; 7315 } else { 7316 isOriginSide = isOriginSide || side === "inline-start"; 7317 isPhysicalLeft = isPhysicalLeft || side === "inline-start"; 7318 } 7319 return isOriginSide ? { 7320 position: "absolute", 7321 [side === "top" ? "bottom" : "top"]: "0", 7322 [isPhysicalLeft ? "right" : "left"]: "0" 7323 } : EMPTY_OBJECT; 7324 }, [side, direction]); 7325 useIsoLayoutEffect(() => { 7326 if (!mounted || !enabled() || typeof ResizeObserver !== "function") { 7327 restoreAnchoringStylesRef.current = NOOP; 7328 isInitialRenderRef.current = true; 7329 committedDimensionsRef.current = null; 7330 liveDimensionsRef.current = null; 7331 return void 0; 7332 } 7333 if (!popupElement || !positionerElement) { 7334 return void 0; 7335 } 7336 restoreAnchoringStylesRef.current = applyElementStyles(popupElement, anchoringStyles); 7337 const observer = new ResizeObserver((entries) => { 7338 const entry = entries[0]; 7339 if (entry) { 7340 liveDimensionsRef.current = { 7341 width: Math.ceil(entry.borderBoxSize[0].inlineSize), 7342 height: Math.ceil(entry.borderBoxSize[0].blockSize) 7343 }; 7344 } 7345 }); 7346 observer.observe(popupElement); 7347 setPopupCssSize(popupElement, "auto"); 7348 const restorePopupPosition = overrideElementStyle(popupElement, "position", "static"); 7349 const restorePopupTransform = overrideElementStyle(popupElement, "transform", "none"); 7350 const restorePopupScale = overrideElementStyle(popupElement, "scale", "1"); 7351 const restorePositionerAvailableSize = applyElementStyles(positionerElement, { 7352 "--available-width": "max-content", 7353 "--available-height": "max-content" 7354 }); 7355 function restoreMeasurementOverrides() { 7356 restorePopupPosition(); 7357 restorePopupTransform(); 7358 restorePositionerAvailableSize(); 7359 } 7360 function restoreMeasurementOverridesIncludingScale() { 7361 restoreMeasurementOverrides(); 7362 restorePopupScale(); 7363 } 7364 onMeasureLayout?.(); 7365 if (isInitialRenderRef.current || committedDimensionsRef.current === null) { 7366 setPositionerCssSize(positionerElement, "max-content"); 7367 const dimensions = getCssDimensions2(popupElement); 7368 committedDimensionsRef.current = dimensions; 7369 setPositionerCssSize(positionerElement, dimensions); 7370 restoreMeasurementOverridesIncludingScale(); 7371 onMeasureLayoutComplete?.(null, dimensions); 7372 isInitialRenderRef.current = false; 7373 return () => { 7374 observer.disconnect(); 7375 restoreAnchoringStylesRef.current(); 7376 restoreAnchoringStylesRef.current = NOOP; 7377 }; 7378 } 7379 setPopupCssSize(popupElement, "auto"); 7380 setPositionerCssSize(positionerElement, "max-content"); 7381 const previousDimensions = committedDimensionsRef.current ?? liveDimensionsRef.current; 7382 const newDimensions = getCssDimensions2(popupElement); 7383 committedDimensionsRef.current = newDimensions; 7384 if (!previousDimensions) { 7385 setPositionerCssSize(positionerElement, newDimensions); 7386 restoreMeasurementOverridesIncludingScale(); 7387 onMeasureLayoutComplete?.(null, newDimensions); 7388 return () => { 7389 observer.disconnect(); 7390 animationFrame.cancel(); 7391 restoreAnchoringStylesRef.current(); 7392 restoreAnchoringStylesRef.current = NOOP; 7393 }; 7394 } 7395 setPopupCssSize(popupElement, previousDimensions); 7396 restoreMeasurementOverridesIncludingScale(); 7397 onMeasureLayoutComplete?.(previousDimensions, newDimensions); 7398 setPositionerCssSize(positionerElement, newDimensions); 7399 const abortController = new AbortController(); 7400 animationFrame.request(() => { 7401 setPopupCssSize(popupElement, newDimensions); 7402 runOnceAnimationsFinish(() => { 7403 popupElement.style.setProperty("--popup-width", "auto"); 7404 popupElement.style.setProperty("--popup-height", "auto"); 7405 }, abortController.signal); 7406 }); 7407 return () => { 7408 observer.disconnect(); 7409 abortController.abort(); 7410 animationFrame.cancel(); 7411 restoreAnchoringStylesRef.current(); 7412 restoreAnchoringStylesRef.current = NOOP; 7413 }; 7414 }, [content, popupElement, positionerElement, runOnceAnimationsFinish, animationFrame, enabled, mounted, onMeasureLayout, onMeasureLayoutComplete, anchoringStyles]); 7415 } 7416 function overrideElementStyle(element, property, value) { 7417 const originalValue = element.style.getPropertyValue(property); 7418 element.style.setProperty(property, value); 7419 return () => { 7420 element.style.setProperty(property, originalValue); 7421 }; 7422 } 7423 function applyElementStyles(element, styles) { 7424 const restorers = []; 7425 for (const [key, value] of Object.entries(styles)) { 7426 restorers.push(overrideElementStyle(element, key, value)); 7427 } 7428 return restorers.length ? () => { 7429 restorers.forEach((restore) => restore()); 7430 } : NOOP; 7431 } 7432 function setPopupCssSize(popupElement, size4) { 7433 const width = size4 === "auto" ? "auto" : `$size4.width}px`; 7434 const height = size4 === "auto" ? "auto" : `$size4.height}px`; 7435 popupElement.style.setProperty("--popup-width", width); 7436 popupElement.style.setProperty("--popup-height", height); 7437 } 7438 function setPositionerCssSize(positionerElement, size4) { 7439 const width = size4 === "max-content" ? "max-content" : `$size4.width}px`; 7440 const height = size4 === "max-content" ? "max-content" : `$size4.height}px`; 7441 positionerElement.style.setProperty("--positioner-width", width); 7442 positionerElement.style.setProperty("--positioner-height", height); 7443 } 7444 7445 // node_modules/@base-ui/react/esm/utils/usePopupViewport.js 7446 var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1); 7447 function usePopupViewport(parameters) { 7448 const { 7449 store, 7450 side, 7451 cssVars, 7452 children 7453 } = parameters; 7454 const direction = useDirection(); 7455 const activeTrigger = store.useState("activeTriggerElement"); 7456 const activeTriggerId = store.useState("activeTriggerId"); 7457 const open = store.useState("open"); 7458 const payload = store.useState("payload"); 7459 const mounted = store.useState("mounted"); 7460 const popupElement = store.useState("popupElement"); 7461 const positionerElement = store.useState("positionerElement"); 7462 const previousActiveTrigger = usePreviousValue(open ? activeTrigger : null); 7463 const currentContentKey = usePopupContentKey(activeTriggerId, payload); 7464 const capturedNodeRef = React33.useRef(null); 7465 const [previousContentNode, setPreviousContentNode] = React33.useState(null); 7466 const [newTriggerOffset, setNewTriggerOffset] = React33.useState(null); 7467 const currentContainerRef = React33.useRef(null); 7468 const previousContainerRef = React33.useRef(null); 7469 const onAnimationsFinished = useAnimationsFinished(currentContainerRef, true, false); 7470 const cleanupFrame = useAnimationFrame(); 7471 const [previousContentDimensions, setPreviousContentDimensions] = React33.useState(null); 7472 const [showStartingStyleAttribute, setShowStartingStyleAttribute] = React33.useState(false); 7473 useIsoLayoutEffect(() => { 7474 store.set("hasViewport", true); 7475 return () => { 7476 store.set("hasViewport", false); 7477 }; 7478 }, [store]); 7479 const handleMeasureLayout = useStableCallback(() => { 7480 currentContainerRef.current?.style.setProperty("animation", "none"); 7481 currentContainerRef.current?.style.setProperty("transition", "none"); 7482 previousContainerRef.current?.style.setProperty("display", "none"); 7483 }); 7484 const handleMeasureLayoutComplete = useStableCallback((previousDimensions) => { 7485 currentContainerRef.current?.style.removeProperty("animation"); 7486 currentContainerRef.current?.style.removeProperty("transition"); 7487 previousContainerRef.current?.style.removeProperty("display"); 7488 if (previousDimensions) { 7489 setPreviousContentDimensions(previousDimensions); 7490 } 7491 }); 7492 const lastHandledTriggerRef = React33.useRef(null); 7493 useIsoLayoutEffect(() => { 7494 if (activeTrigger && previousActiveTrigger && activeTrigger !== previousActiveTrigger && lastHandledTriggerRef.current !== activeTrigger && capturedNodeRef.current) { 7495 setPreviousContentNode(capturedNodeRef.current); 7496 setShowStartingStyleAttribute(true); 7497 const offset4 = calculateRelativePosition(previousActiveTrigger, activeTrigger); 7498 setNewTriggerOffset(offset4); 7499 cleanupFrame.request(() => { 7500 ReactDOM5.flushSync(() => { 7501 setShowStartingStyleAttribute(false); 7502 }); 7503 onAnimationsFinished(() => { 7504 setPreviousContentNode(null); 7505 setPreviousContentDimensions(null); 7506 capturedNodeRef.current = null; 7507 }); 7508 }); 7509 lastHandledTriggerRef.current = activeTrigger; 7510 } 7511 }, [activeTrigger, previousActiveTrigger, previousContentNode, onAnimationsFinished, cleanupFrame]); 7512 useIsoLayoutEffect(() => { 7513 const source = currentContainerRef.current; 7514 if (!source) { 7515 return; 7516 } 7517 const wrapper = ownerDocument(source).createElement("div"); 7518 for (const child of Array.from(source.childNodes)) { 7519 wrapper.appendChild(child.cloneNode(true)); 7520 } 7521 capturedNodeRef.current = wrapper; 7522 }); 7523 const isTransitioning = previousContentNode != null; 7524 let childrenToRender; 7525 if (!isTransitioning) { 7526 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { 7527 "data-current": true, 7528 ref: currentContainerRef, 7529 children 7530 }, currentContentKey); 7531 } else { 7532 childrenToRender = /* @__PURE__ */ (0, import_jsx_runtime5.jsxs)(React33.Fragment, { 7533 children: [/* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { 7534 "data-previous": true, 7535 inert: inertValue(true), 7536 ref: previousContainerRef, 7537 style: { 7538 ...previousContentDimensions ? { 7539 [cssVars.popupWidth]: `$previousContentDimensions.width}px`, 7540 [cssVars.popupHeight]: `$previousContentDimensions.height}px` 7541 } : null, 7542 position: "absolute" 7543 }, 7544 "data-ending-style": showStartingStyleAttribute ? void 0 : "" 7545 }, "previous"), /* @__PURE__ */ (0, import_jsx_runtime5.jsx)("div", { 7546 "data-current": true, 7547 ref: currentContainerRef, 7548 "data-starting-style": showStartingStyleAttribute ? "" : void 0, 7549 children 7550 }, currentContentKey)] 7551 }); 7552 } 7553 useIsoLayoutEffect(() => { 7554 const container = previousContainerRef.current; 7555 if (!container || !previousContentNode) { 7556 return; 7557 } 7558 container.replaceChildren(...Array.from(previousContentNode.childNodes)); 7559 }, [previousContentNode]); 7560 usePopupAutoResize({ 7561 popupElement, 7562 positionerElement, 7563 mounted, 7564 content: payload, 7565 onMeasureLayout: handleMeasureLayout, 7566 onMeasureLayoutComplete: handleMeasureLayoutComplete, 7567 side, 7568 direction 7569 }); 7570 const state = { 7571 activationDirection: getActivationDirection(newTriggerOffset), 7572 transitioning: isTransitioning 7573 }; 7574 return { 7575 children: childrenToRender, 7576 state 7577 }; 7578 } 7579 function getActivationDirection(offset4) { 7580 if (!offset4) { 7581 return void 0; 7582 } 7583 return `$getValueWithTolerance(offset4.horizontal, 5, "right", "left")} $getValueWithTolerance(offset4.vertical, 5, "down", "up")}`; 7584 } 7585 function getValueWithTolerance(value, tolerance, positiveLabel, negativeLabel) { 7586 if (value > tolerance) { 7587 return positiveLabel; 7588 } 7589 if (value < -tolerance) { 7590 return negativeLabel; 7591 } 7592 return ""; 7593 } 7594 function calculateRelativePosition(from, to) { 7595 const fromRect = from.getBoundingClientRect(); 7596 const toRect = to.getBoundingClientRect(); 7597 const fromCenter = { 7598 x: fromRect.left + fromRect.width / 2, 7599 y: fromRect.top + fromRect.height / 2 7600 }; 7601 const toCenter = { 7602 x: toRect.left + toRect.width / 2, 7603 y: toRect.top + toRect.height / 2 7604 }; 7605 return { 7606 horizontal: toCenter.x - fromCenter.x, 7607 vertical: toCenter.y - fromCenter.y 7608 }; 7609 } 7610 function usePopupContentKey(activeTriggerId, payload) { 7611 const [contentKey, setContentKey] = React33.useState(0); 7612 const previousActiveTriggerIdRef = React33.useRef(activeTriggerId); 7613 const previousPayloadRef = React33.useRef(payload); 7614 const pendingPayloadUpdateRef = React33.useRef(false); 7615 useIsoLayoutEffect(() => { 7616 const previousActiveTriggerId = previousActiveTriggerIdRef.current; 7617 const previousPayload = previousPayloadRef.current; 7618 const triggerIdChanged = activeTriggerId !== previousActiveTriggerId; 7619 const payloadChanged = payload !== previousPayload; 7620 if (triggerIdChanged) { 7621 setContentKey((value) => value + 1); 7622 pendingPayloadUpdateRef.current = !payloadChanged; 7623 } else if (pendingPayloadUpdateRef.current && payloadChanged) { 7624 setContentKey((value) => value + 1); 7625 pendingPayloadUpdateRef.current = false; 7626 } 7627 previousActiveTriggerIdRef.current = activeTriggerId; 7628 previousPayloadRef.current = payload; 7629 }, [activeTriggerId, payload]); 7630 return `$activeTriggerId ?? "current"}-$contentKey}`; 7631 } 7632 7633 // node_modules/@base-ui/react/esm/utils/FloatingPortalLite.js 7634 var React34 = __toESM(require_react(), 1); 7635 var ReactDOM6 = __toESM(require_react_dom(), 1); 7636 var import_jsx_runtime6 = __toESM(require_jsx_runtime(), 1); 7637 var FloatingPortalLite = /* @__PURE__ */ React34.forwardRef(function FloatingPortalLite2(componentProps, forwardedRef) { 7638 const { 7639 children, 7640 container, 7641 className, 7642 render, 7643 style, 7644 ...elementProps 7645 } = componentProps; 7646 const { 7647 portalNode, 7648 portalSubtree 7649 } = useFloatingPortalNode({ 7650 container, 7651 ref: forwardedRef, 7652 componentProps, 7653 elementProps 7654 }); 7655 if (!portalSubtree && !portalNode) { 7656 return null; 7657 } 7658 return /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(React34.Fragment, { 7659 children: [portalSubtree, portalNode && /* @__PURE__ */ ReactDOM6.createPortal(children, portalNode)] 7660 }); 7661 }); 7662 if (true) FloatingPortalLite.displayName = "FloatingPortalLite"; 7663 7664 // node_modules/@base-ui/react/esm/tooltip/index.parts.js 7665 var index_parts_exports = {}; 7666 __export(index_parts_exports, { 7667 Arrow: () => TooltipArrow, 7668 Handle: () => TooltipHandle, 7669 Popup: () => TooltipPopup, 7670 Portal: () => TooltipPortal, 7671 Positioner: () => TooltipPositioner, 7672 Provider: () => TooltipProvider, 7673 Root: () => TooltipRoot, 7674 Trigger: () => TooltipTrigger, 7675 Viewport: () => TooltipViewport, 7676 createHandle: () => createTooltipHandle 7677 }); 7678 7679 // node_modules/@base-ui/react/esm/tooltip/root/TooltipRoot.js 7680 var React37 = __toESM(require_react(), 1); 7681 7682 // node_modules/@base-ui/react/esm/tooltip/root/TooltipRootContext.js 7683 var React35 = __toESM(require_react(), 1); 7684 var TooltipRootContext = /* @__PURE__ */ React35.createContext(void 0); 7685 if (true) TooltipRootContext.displayName = "TooltipRootContext"; 7686 function useTooltipRootContext(optional) { 7687 const context = React35.useContext(TooltipRootContext); 7688 if (context === void 0 && !optional) { 7689 throw new Error(true ? "Base UI: TooltipRootContext is missing. Tooltip parts must be placed within <Tooltip.Root>." : formatErrorMessage_default(72)); 7690 } 7691 return context; 7692 } 7693 7694 // node_modules/@base-ui/react/esm/tooltip/store/TooltipStore.js 7695 var React36 = __toESM(require_react(), 1); 7696 var ReactDOM7 = __toESM(require_react_dom(), 1); 7697 var selectors2 = { 7698 ...popupStoreSelectors, 7699 disabled: createSelector((state) => state.disabled), 7700 instantType: createSelector((state) => state.instantType), 7701 isInstantPhase: createSelector((state) => state.isInstantPhase), 7702 trackCursorAxis: createSelector((state) => state.trackCursorAxis), 7703 disableHoverablePopup: createSelector((state) => state.disableHoverablePopup), 7704 lastOpenChangeReason: createSelector((state) => state.openChangeReason), 7705 closeOnClick: createSelector((state) => state.closeOnClick), 7706 closeDelay: createSelector((state) => state.closeDelay), 7707 hasViewport: createSelector((state) => state.hasViewport) 7708 }; 7709 var TooltipStore = class _TooltipStore extends ReactStore { 7710 constructor(initialState, floatingId, nested = false) { 7711 const triggerElements = new PopupTriggerMap(); 7712 const state = { 7713 ...createInitialState(), 7714 ...initialState 7715 }; 7716 state.floatingRootContext = createPopupFloatingRootContext(triggerElements, floatingId, nested); 7717 super(state, { 7718 popupRef: /* @__PURE__ */ React36.createRef(), 7719 onOpenChange: void 0, 7720 onOpenChangeComplete: void 0, 7721 triggerElements 7722 }, selectors2); 7723 } 7724 setOpen = (nextOpen, eventDetails) => { 7725 const reason = eventDetails.reason; 7726 const isHover = reason === reason_parts_exports.triggerHover; 7727 const isFocusOpen = nextOpen && reason === reason_parts_exports.triggerFocus; 7728 const isDismissClose = !nextOpen && (reason === reason_parts_exports.triggerPress || reason === reason_parts_exports.escapeKey); 7729 eventDetails.preventUnmountOnClose = () => { 7730 this.set("preventUnmountingOnClose", true); 7731 }; 7732 this.context.onOpenChange?.(nextOpen, eventDetails); 7733 if (eventDetails.isCanceled) { 7734 return; 7735 } 7736 this.state.floatingRootContext.dispatchOpenChange(nextOpen, eventDetails); 7737 const changeState = () => { 7738 const updatedState = { 7739 open: nextOpen, 7740 openChangeReason: reason 7741 }; 7742 if (isFocusOpen) { 7743 updatedState.instantType = "focus"; 7744 } else if (isDismissClose) { 7745 updatedState.instantType = "dismiss"; 7746 } else if (reason === reason_parts_exports.triggerHover) { 7747 updatedState.instantType = void 0; 7748 } 7749 setOpenTriggerState(updatedState, nextOpen, eventDetails.trigger); 7750 this.update(updatedState); 7751 }; 7752 if (isHover) { 7753 ReactDOM7.flushSync(changeState); 7754 } else { 7755 changeState(); 7756 } 7757 }; 7758 // Used by trigger clicks to clear a delayed hover open without reporting a public open-state change. 7759 cancelPendingOpen(event) { 7760 this.state.floatingRootContext.dispatchOpenChange(false, createChangeEventDetails(reason_parts_exports.triggerPress, event)); 7761 } 7762 static useStore(externalStore, initialState) { 7763 const store = usePopupStore(externalStore, (floatingId, nested) => new _TooltipStore(initialState, floatingId, nested)).store; 7764 return store; 7765 } 7766 }; 7767 function createInitialState() { 7768 return { 7769 ...createInitialPopupStoreState(), 7770 disabled: false, 7771 instantType: void 0, 7772 isInstantPhase: false, 7773 trackCursorAxis: "none", 7774 disableHoverablePopup: false, 7775 openChangeReason: null, 7776 closeOnClick: true, 7777 closeDelay: 0, 7778 hasViewport: false 7779 }; 7780 } 7781 7782 // node_modules/@base-ui/react/esm/tooltip/root/TooltipRoot.js 7783 var import_jsx_runtime7 = __toESM(require_jsx_runtime(), 1); 7784 var TooltipRoot = fastComponent(function TooltipRoot2(props) { 7785 const { 7786 disabled: disabled2 = false, 7787 defaultOpen = false, 7788 open: openProp, 7789 disableHoverablePopup = false, 7790 trackCursorAxis = "none", 7791 actionsRef, 7792 onOpenChange, 7793 onOpenChangeComplete, 7794 handle, 7795 triggerId: triggerIdProp, 7796 defaultTriggerId: defaultTriggerIdProp = null, 7797 children 7798 } = props; 7799 const store = TooltipStore.useStore(handle?.store, { 7800 open: defaultOpen, 7801 openProp, 7802 activeTriggerId: defaultTriggerIdProp, 7803 triggerIdProp 7804 }); 7805 useOnFirstRender(() => { 7806 if (openProp === void 0 && store.state.open === false && defaultOpen === true) { 7807 store.update({ 7808 open: true, 7809 activeTriggerId: defaultTriggerIdProp 7810 }); 7811 } 7812 }); 7813 store.useControlledProp("openProp", openProp); 7814 store.useControlledProp("triggerIdProp", triggerIdProp); 7815 store.useContextCallback("onOpenChange", onOpenChange); 7816 store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete); 7817 const openState = store.useState("open"); 7818 const open = !disabled2 && openState; 7819 const activeTriggerId = store.useState("activeTriggerId"); 7820 const mounted = store.useState("mounted"); 7821 const payload = store.useState("payload"); 7822 store.useSyncedValues({ 7823 trackCursorAxis, 7824 disableHoverablePopup 7825 }); 7826 store.useSyncedValue("disabled", disabled2); 7827 useImplicitActiveTrigger(store); 7828 const { 7829 forceUnmount, 7830 transitionStatus 7831 } = useOpenStateTransitions(open, store); 7832 const isInstantPhase = store.useState("isInstantPhase"); 7833 const instantType = store.useState("instantType"); 7834 const lastOpenChangeReason = store.useState("lastOpenChangeReason"); 7835 const previousInstantTypeRef = React37.useRef(null); 7836 useIsoLayoutEffect(() => { 7837 if (openState && disabled2) { 7838 store.setOpen(false, createChangeEventDetails(reason_parts_exports.disabled)); 7839 } 7840 }, [openState, disabled2, store]); 7841 useIsoLayoutEffect(() => { 7842 if (transitionStatus === "ending" && lastOpenChangeReason === reason_parts_exports.none || transitionStatus !== "ending" && isInstantPhase) { 7843 if (instantType !== "delay") { 7844 previousInstantTypeRef.current = instantType; 7845 } 7846 store.set("instantType", "delay"); 7847 } else if (previousInstantTypeRef.current !== null) { 7848 store.set("instantType", previousInstantTypeRef.current); 7849 previousInstantTypeRef.current = null; 7850 } 7851 }, [transitionStatus, isInstantPhase, lastOpenChangeReason, instantType, store]); 7852 useIsoLayoutEffect(() => { 7853 if (open) { 7854 if (activeTriggerId == null) { 7855 store.set("payload", void 0); 7856 } 7857 } 7858 }, [store, activeTriggerId, open]); 7859 const handleImperativeClose = React37.useCallback(() => { 7860 store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction)); 7861 }, [store]); 7862 React37.useImperativeHandle(actionsRef, () => ({ 7863 unmount: forceUnmount, 7864 close: handleImperativeClose 7865 }), [forceUnmount, handleImperativeClose]); 7866 const shouldRenderInteractions = open || mounted || !disabled2 && trackCursorAxis !== "none"; 7867 return /* @__PURE__ */ (0, import_jsx_runtime7.jsxs)(TooltipRootContext.Provider, { 7868 value: store, 7869 children: [shouldRenderInteractions && /* @__PURE__ */ (0, import_jsx_runtime7.jsx)(TooltipInteractions, { 7870 store, 7871 disabled: disabled2, 7872 trackCursorAxis 7873 }), typeof children === "function" ? children({ 7874 payload 7875 }) : children] 7876 }); 7877 }); 7878 if (true) TooltipRoot.displayName = "TooltipRoot"; 7879 function TooltipInteractions({ 7880 store, 7881 disabled: disabled2, 7882 trackCursorAxis 7883 }) { 7884 const floatingRootContext = store.useState("floatingRootContext"); 7885 const dismiss = useDismiss(floatingRootContext, { 7886 enabled: !disabled2, 7887 referencePress: () => store.select("closeOnClick") 7888 }); 7889 const clientPoint = useClientPoint(floatingRootContext, { 7890 enabled: !disabled2 && trackCursorAxis !== "none", 7891 axis: trackCursorAxis === "none" ? void 0 : trackCursorAxis 7892 }); 7893 const activeTriggerProps = React37.useMemo(() => mergeProps(clientPoint.reference, dismiss.reference), [clientPoint.reference, dismiss.reference]); 7894 const inactiveTriggerProps = React37.useMemo(() => mergeProps(clientPoint.trigger, dismiss.trigger), [clientPoint.trigger, dismiss.trigger]); 7895 const popupProps = React37.useMemo(() => mergeProps(FOCUSABLE_POPUP_PROPS, clientPoint.floating, dismiss.floating), [clientPoint.floating, dismiss.floating]); 7896 usePopupInteractionProps(store, { 7897 activeTriggerProps, 7898 inactiveTriggerProps, 7899 popupProps 7900 }); 7901 return null; 7902 } 7903 7904 // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTrigger.js 7905 var React39 = __toESM(require_react(), 1); 7906 7907 // node_modules/@base-ui/react/esm/tooltip/provider/TooltipProviderContext.js 7908 var React38 = __toESM(require_react(), 1); 7909 var TooltipProviderContext = /* @__PURE__ */ React38.createContext(void 0); 7910 if (true) TooltipProviderContext.displayName = "TooltipProviderContext"; 7911 function useTooltipProviderContext() { 7912 return React38.useContext(TooltipProviderContext); 7913 } 7914 7915 // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTriggerDataAttributes.js 7916 var TooltipTriggerDataAttributes = (function(TooltipTriggerDataAttributes2) { 7917 TooltipTriggerDataAttributes2[TooltipTriggerDataAttributes2["popupOpen"] = CommonTriggerDataAttributes.popupOpen] = "popupOpen"; 7918 TooltipTriggerDataAttributes2["triggerDisabled"] = "data-trigger-disabled"; 7919 return TooltipTriggerDataAttributes2; 7920 })({}); 7921 7922 // node_modules/@base-ui/react/esm/tooltip/utils/constants.js 7923 var OPEN_DELAY = 600; 7924 7925 // node_modules/@base-ui/react/esm/tooltip/trigger/TooltipTrigger.js 7926 var TOOLTIP_TRIGGER_IDENTIFIER = "data-base-ui-tooltip-trigger"; 7927 function getTargetElement(event) { 7928 if ("composedPath" in event) { 7929 const path = event.composedPath(); 7930 for (let i2 = 0; i2 < path.length; i2 += 1) { 7931 const element = path[i2]; 7932 if (isElement(element)) { 7933 return element; 7934 } 7935 } 7936 } 7937 const target = event.target; 7938 if (isElement(target)) { 7939 return target; 7940 } 7941 return null; 7942 } 7943 function closestEnabledTooltipTrigger(element) { 7944 let current = element; 7945 while (current) { 7946 if (current.hasAttribute(TOOLTIP_TRIGGER_IDENTIFIER)) { 7947 return current; 7948 } 7949 const parentElement = current.parentElement; 7950 if (parentElement) { 7951 current = parentElement; 7952 continue; 7953 } 7954 const root = current.getRootNode(); 7955 current = "host" in root && isElement(root.host) ? root.host : null; 7956 } 7957 return null; 7958 } 7959 var TooltipTrigger = fastComponentRef(function TooltipTrigger2(componentProps, forwardedRef) { 7960 const { 7961 render, 7962 className, 7963 style, 7964 handle, 7965 payload, 7966 disabled: disabledProp, 7967 delay, 7968 closeOnClick = true, 7969 closeDelay, 7970 id: idProp, 7971 ...elementProps 7972 } = componentProps; 7973 const rootContext = useTooltipRootContext(true); 7974 const store = handle?.store ?? rootContext; 7975 if (!store) { 7976 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)); 7977 } 7978 const thisTriggerId = useBaseUiId(idProp); 7979 const isTriggerActive = store.useState("isTriggerActive", thisTriggerId); 7980 const isOpenedByThisTrigger = store.useState("isOpenedByTrigger", thisTriggerId); 7981 const floatingRootContext = store.useState("floatingRootContext"); 7982 const triggerElementRef = React39.useRef(null); 7983 const delayWithDefault = delay ?? OPEN_DELAY; 7984 const closeDelayWithDefault = closeDelay ?? 0; 7985 const { 7986 registerTrigger, 7987 isMountedByThisTrigger 7988 } = useTriggerDataForwarding(thisTriggerId, triggerElementRef, store, { 7989 payload, 7990 closeOnClick, 7991 closeDelay: closeDelayWithDefault 7992 }); 7993 const providerContext = useTooltipProviderContext(); 7994 const { 7995 delayRef, 7996 isInstantPhase, 7997 hasProvider 7998 } = useDelayGroup(floatingRootContext, { 7999 open: isOpenedByThisTrigger 8000 }); 8001 const hoverInteraction = useHoverInteractionSharedState(floatingRootContext); 8002 store.useSyncedValue("isInstantPhase", isInstantPhase); 8003 const rootDisabled = store.useState("disabled"); 8004 const disabled2 = disabledProp ?? rootDisabled; 8005 const disabledRef = useValueAsRef(disabled2); 8006 const trackCursorAxis = store.useState("trackCursorAxis"); 8007 const disableHoverablePopup = store.useState("disableHoverablePopup"); 8008 const isNestedTriggerHoveredRef = React39.useRef(false); 8009 const nestedTriggerOpenTimeout = useTimeout(); 8010 const pointerTypeRef = React39.useRef(void 0); 8011 function getOpenDelay() { 8012 const providerDelay = providerContext?.delay; 8013 const groupOpenValue = typeof delayRef.current === "object" ? delayRef.current.open : void 0; 8014 let computedOpenDelay = delayWithDefault; 8015 if (hasProvider) { 8016 if (groupOpenValue !== 0) { 8017 computedOpenDelay = delay ?? providerDelay ?? delayWithDefault; 8018 } else { 8019 computedOpenDelay = 0; 8020 } 8021 } 8022 return computedOpenDelay; 8023 } 8024 function isEnabledNestedTriggerTarget(target) { 8025 const triggerEl = triggerElementRef.current; 8026 if (!triggerEl || !target) { 8027 return false; 8028 } 8029 const nearestTrigger = closestEnabledTooltipTrigger(target); 8030 return nearestTrigger !== null && nearestTrigger !== triggerEl && contains(triggerEl, nearestTrigger); 8031 } 8032 function detectNestedTriggerHover(target) { 8033 const nestedTriggerHovered = isEnabledNestedTriggerTarget(target); 8034 isNestedTriggerHoveredRef.current = nestedTriggerHovered; 8035 if (nestedTriggerHovered) { 8036 hoverInteraction.openChangeTimeout.clear(); 8037 hoverInteraction.restTimeout.clear(); 8038 hoverInteraction.restTimeoutPending = false; 8039 nestedTriggerOpenTimeout.clear(); 8040 } 8041 return nestedTriggerHovered; 8042 } 8043 const hoverProps = useHoverReferenceInteraction(floatingRootContext, { 8044 enabled: !disabled2, 8045 mouseOnly: true, 8046 move: false, 8047 handleClose: !disableHoverablePopup && trackCursorAxis !== "both" ? safePolygon() : null, 8048 restMs: getOpenDelay, 8049 delay() { 8050 const closeValue = typeof delayRef.current === "object" ? delayRef.current.close : void 0; 8051 let computedCloseDelay = closeDelayWithDefault; 8052 if (closeDelay == null && hasProvider) { 8053 computedCloseDelay = closeValue; 8054 } 8055 return { 8056 close: computedCloseDelay 8057 }; 8058 }, 8059 triggerElementRef, 8060 isActiveTrigger: isTriggerActive, 8061 isClosing: () => store.select("transitionStatus") === "ending", 8062 shouldOpen() { 8063 return !isNestedTriggerHoveredRef.current; 8064 } 8065 }); 8066 const focusProps = useFocus(floatingRootContext, { 8067 enabled: !disabled2 8068 }).reference; 8069 const handleNestedTriggerHover = (event) => { 8070 const wasNestedTriggerHovered = isNestedTriggerHoveredRef.current; 8071 const target = getTargetElement(event); 8072 const nestedTriggerHovered = detectNestedTriggerHover(target); 8073 const triggerEl = triggerElementRef.current; 8074 const targetInsideTrigger = triggerEl && target && contains(triggerEl, target); 8075 if (nestedTriggerHovered && store.select("open") && store.select("lastOpenChangeReason") === reason_parts_exports.triggerHover) { 8076 store.setOpen(false, createChangeEventDetails(reason_parts_exports.triggerHover, event)); 8077 return; 8078 } 8079 if (wasNestedTriggerHovered && !nestedTriggerHovered && targetInsideTrigger && !disabledRef.current && !store.select("open") && triggerEl && // Match the hover hook's non-strict mouse fallback for mouse-only event sequences. 8080 isMouseLikePointerType(pointerTypeRef.current)) { 8081 const open = () => { 8082 if (!isNestedTriggerHoveredRef.current && !disabledRef.current && !store.select("open")) { 8083 store.setOpen(true, createChangeEventDetails(reason_parts_exports.triggerHover, event, triggerEl)); 8084 } 8085 }; 8086 const openDelay = getOpenDelay(); 8087 if (openDelay === 0) { 8088 nestedTriggerOpenTimeout.clear(); 8089 open(); 8090 } else { 8091 nestedTriggerOpenTimeout.start(openDelay, open); 8092 } 8093 } 8094 }; 8095 const rootTriggerProps = store.useState("triggerProps", isMountedByThisTrigger); 8096 const shouldApplyRootTriggerProps = isMountedByThisTrigger || trackCursorAxis !== "none"; 8097 const state = { 8098 open: isOpenedByThisTrigger 8099 }; 8100 const element = useRenderElement("button", componentProps, { 8101 state, 8102 ref: [forwardedRef, registerTrigger, triggerElementRef], 8103 props: [hoverProps, focusProps, shouldApplyRootTriggerProps ? rootTriggerProps : void 0, { 8104 onMouseOver(event) { 8105 handleNestedTriggerHover(event.nativeEvent); 8106 }, 8107 onFocus(event) { 8108 if (isEnabledNestedTriggerTarget(getTargetElement(event.nativeEvent))) { 8109 event.preventBaseUIHandler(); 8110 } 8111 }, 8112 onMouseLeave() { 8113 isNestedTriggerHoveredRef.current = false; 8114 nestedTriggerOpenTimeout.clear(); 8115 pointerTypeRef.current = void 0; 8116 }, 8117 onPointerEnter(event) { 8118 pointerTypeRef.current = event.pointerType; 8119 }, 8120 onPointerDown(event) { 8121 pointerTypeRef.current = event.pointerType; 8122 store.set("closeOnClick", closeOnClick); 8123 if (closeOnClick && !store.select("open")) { 8124 store.cancelPendingOpen(event.nativeEvent); 8125 } 8126 }, 8127 onClick(event) { 8128 if (closeOnClick && !store.select("open")) { 8129 store.cancelPendingOpen(event.nativeEvent); 8130 } 8131 }, 8132 id: thisTriggerId, 8133 [TooltipTriggerDataAttributes.triggerDisabled]: disabled2 ? "" : void 0, 8134 [TOOLTIP_TRIGGER_IDENTIFIER]: disabled2 ? void 0 : "" 8135 }, elementProps], 8136 stateAttributesMapping: triggerOpenStateMapping 8137 }); 8138 return element; 8139 }); 8140 if (true) TooltipTrigger.displayName = "TooltipTrigger"; 8141 8142 // node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortal.js 8143 var React41 = __toESM(require_react(), 1); 8144 8145 // node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortalContext.js 8146 var React40 = __toESM(require_react(), 1); 8147 var TooltipPortalContext = /* @__PURE__ */ React40.createContext(void 0); 8148 if (true) TooltipPortalContext.displayName = "TooltipPortalContext"; 8149 function useTooltipPortalContext() { 8150 const value = React40.useContext(TooltipPortalContext); 8151 if (value === void 0) { 8152 throw new Error(true ? "Base UI: <Tooltip.Portal> is missing." : formatErrorMessage_default(70)); 8153 } 8154 return value; 8155 } 8156 8157 // node_modules/@base-ui/react/esm/tooltip/portal/TooltipPortal.js 8158 var import_jsx_runtime8 = __toESM(require_jsx_runtime(), 1); 8159 var TooltipPortal = /* @__PURE__ */ React41.forwardRef(function TooltipPortal2(props, forwardedRef) { 8160 const { 8161 keepMounted = false, 8162 ...portalProps 8163 } = props; 8164 const store = useTooltipRootContext(); 8165 const mounted = store.useState("mounted"); 8166 const shouldRender = mounted || keepMounted; 8167 if (!shouldRender) { 8168 return null; 8169 } 8170 return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(TooltipPortalContext.Provider, { 8171 value: keepMounted, 8172 children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(FloatingPortalLite, { 8173 ref: forwardedRef, 8174 ...portalProps 8175 }) 8176 }); 8177 }); 8178 if (true) TooltipPortal.displayName = "TooltipPortal"; 8179 8180 // node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositioner.js 8181 var React43 = __toESM(require_react(), 1); 8182 8183 // node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositionerContext.js 8184 var React42 = __toESM(require_react(), 1); 8185 var TooltipPositionerContext = /* @__PURE__ */ React42.createContext(void 0); 8186 if (true) TooltipPositionerContext.displayName = "TooltipPositionerContext"; 8187 function useTooltipPositionerContext() { 8188 const context = React42.useContext(TooltipPositionerContext); 8189 if (context === void 0) { 8190 throw new Error(true ? "Base UI: TooltipPositionerContext is missing. TooltipPositioner parts must be placed within <Tooltip.Positioner>." : formatErrorMessage_default(71)); 8191 } 8192 return context; 8193 } 8194 8195 // node_modules/@base-ui/react/esm/tooltip/positioner/TooltipPositioner.js 8196 var import_jsx_runtime9 = __toESM(require_jsx_runtime(), 1); 8197 var TooltipPositioner = /* @__PURE__ */ React43.forwardRef(function TooltipPositioner2(componentProps, forwardedRef) { 8198 const { 8199 render, 8200 className, 8201 anchor, 8202 positionMethod = "absolute", 8203 side = "top", 8204 align = "center", 8205 sideOffset = 0, 8206 alignOffset = 0, 8207 collisionBoundary = "clipping-ancestors", 8208 collisionPadding = 5, 8209 arrowPadding = 5, 8210 sticky = false, 8211 disableAnchorTracking = false, 8212 collisionAvoidance = POPUP_COLLISION_AVOIDANCE, 8213 style, 8214 ...elementProps 8215 } = componentProps; 8216 const store = useTooltipRootContext(); 8217 const keepMounted = useTooltipPortalContext(); 8218 const open = store.useState("open"); 8219 const mounted = store.useState("mounted"); 8220 const trackCursorAxis = store.useState("trackCursorAxis"); 8221 const disableHoverablePopup = store.useState("disableHoverablePopup"); 8222 const floatingRootContext = store.useState("floatingRootContext"); 8223 const instantType = store.useState("instantType"); 8224 const transitionStatus = store.useState("transitionStatus"); 8225 const hasViewport = store.useState("hasViewport"); 8226 const positioning = useAnchorPositioning({ 8227 anchor, 8228 positionMethod, 8229 floatingRootContext, 8230 mounted, 8231 side, 8232 sideOffset, 8233 align, 8234 alignOffset, 8235 collisionBoundary, 8236 collisionPadding, 8237 sticky, 8238 arrowPadding, 8239 disableAnchorTracking, 8240 keepMounted, 8241 collisionAvoidance, 8242 adaptiveOrigin: hasViewport ? adaptiveOrigin : void 0 8243 }); 8244 const state = React43.useMemo(() => ({ 8245 open, 8246 side: positioning.side, 8247 align: positioning.align, 8248 anchorHidden: positioning.anchorHidden, 8249 instant: trackCursorAxis !== "none" ? "tracking-cursor" : instantType 8250 }), [open, positioning.side, positioning.align, positioning.anchorHidden, trackCursorAxis, instantType]); 8251 const element = usePositioner(componentProps, state, { 8252 styles: positioning.positionerStyles, 8253 transitionStatus, 8254 props: elementProps, 8255 refs: [forwardedRef, store.useStateSetter("positionerElement")], 8256 hidden: !mounted, 8257 inert: !open || trackCursorAxis === "both" || disableHoverablePopup 8258 }); 8259 return /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(TooltipPositionerContext.Provider, { 8260 value: positioning, 8261 children: element 8262 }); 8263 }); 8264 if (true) TooltipPositioner.displayName = "TooltipPositioner"; 8265 8266 // node_modules/@base-ui/react/esm/tooltip/popup/TooltipPopup.js 8267 var React44 = __toESM(require_react(), 1); 8268 var stateAttributesMapping = { 8269 ...popupStateMapping, 8270 ...transitionStatusMapping 8271 }; 8272 var TooltipPopup = /* @__PURE__ */ React44.forwardRef(function TooltipPopup2(componentProps, forwardedRef) { 8273 const { 8274 render, 8275 className, 8276 style, 8277 ...elementProps 8278 } = componentProps; 8279 const store = useTooltipRootContext(); 8280 const { 8281 side, 8282 align 8283 } = useTooltipPositionerContext(); 8284 const open = store.useState("open"); 8285 const instantType = store.useState("instantType"); 8286 const transitionStatus = store.useState("transitionStatus"); 8287 const popupProps = store.useState("popupProps"); 8288 const floatingContext = store.useState("floatingRootContext"); 8289 const disabled2 = store.useState("disabled"); 8290 const closeDelay = store.useState("closeDelay"); 8291 useOpenChangeComplete({ 8292 open, 8293 ref: store.context.popupRef, 8294 onComplete() { 8295 if (open) { 8296 store.context.onOpenChangeComplete?.(true); 8297 } 8298 } 8299 }); 8300 useHoverFloatingInteraction(floatingContext, { 8301 enabled: !disabled2, 8302 closeDelay 8303 }); 8304 const setPopupElement = store.useStateSetter("popupElement"); 8305 const state = { 8306 open, 8307 side, 8308 align, 8309 instant: instantType, 8310 transitionStatus 8311 }; 8312 const element = useRenderElement("div", componentProps, { 8313 state, 8314 ref: [forwardedRef, store.context.popupRef, setPopupElement], 8315 props: [popupProps, getDisabledMountTransitionStyles(transitionStatus), elementProps], 8316 stateAttributesMapping 8317 }); 8318 return element; 8319 }); 8320 if (true) TooltipPopup.displayName = "TooltipPopup"; 8321 8322 // node_modules/@base-ui/react/esm/tooltip/arrow/TooltipArrow.js 8323 var React45 = __toESM(require_react(), 1); 8324 var TooltipArrow = /* @__PURE__ */ React45.forwardRef(function TooltipArrow2(componentProps, forwardedRef) { 8325 const { 8326 render, 8327 className, 8328 style, 8329 ...elementProps 8330 } = componentProps; 8331 const store = useTooltipRootContext(); 8332 const { 8333 arrowRef, 8334 side, 8335 align, 8336 arrowUncentered, 8337 arrowStyles 8338 } = useTooltipPositionerContext(); 8339 const open = store.useState("open"); 8340 const instantType = store.useState("instantType"); 8341 const state = { 8342 open, 8343 side, 8344 align, 8345 uncentered: arrowUncentered, 8346 instant: instantType 8347 }; 8348 const element = useRenderElement("div", componentProps, { 8349 state, 8350 ref: [forwardedRef, arrowRef], 8351 props: [{ 8352 style: arrowStyles, 8353 "aria-hidden": true 8354 }, elementProps], 8355 stateAttributesMapping: popupStateMapping 8356 }); 8357 return element; 8358 }); 8359 if (true) TooltipArrow.displayName = "TooltipArrow"; 8360 8361 // node_modules/@base-ui/react/esm/tooltip/provider/TooltipProvider.js 8362 var React46 = __toESM(require_react(), 1); 8363 var import_jsx_runtime10 = __toESM(require_jsx_runtime(), 1); 8364 var TooltipProvider = function TooltipProvider2(props) { 8365 const { 8366 delay, 8367 closeDelay, 8368 timeout = 400 8369 } = props; 8370 const contextValue = React46.useMemo(() => ({ 8371 delay, 8372 closeDelay 8373 }), [delay, closeDelay]); 8374 const delayValue = React46.useMemo(() => ({ 8375 open: delay, 8376 close: closeDelay 8377 }), [delay, closeDelay]); 8378 return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(TooltipProviderContext.Provider, { 8379 value: contextValue, 8380 children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(FloatingDelayGroup, { 8381 delay: delayValue, 8382 timeoutMs: timeout, 8383 children: props.children 8384 }) 8385 }); 8386 }; 8387 if (true) TooltipProvider.displayName = "TooltipProvider"; 8388 8389 // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewport.js 8390 var React47 = __toESM(require_react(), 1); 8391 8392 // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewportCssVars.js 8393 var TooltipViewportCssVars = /* @__PURE__ */ (function(TooltipViewportCssVars2) { 8394 TooltipViewportCssVars2["popupWidth"] = "--popup-width"; 8395 TooltipViewportCssVars2["popupHeight"] = "--popup-height"; 8396 return TooltipViewportCssVars2; 8397 })({}); 8398 8399 // node_modules/@base-ui/react/esm/tooltip/viewport/TooltipViewport.js 8400 var stateAttributesMapping2 = { 8401 activationDirection: (value) => value ? { 8402 "data-activation-direction": value 8403 } : null 8404 }; 8405 var TooltipViewport = /* @__PURE__ */ React47.forwardRef(function TooltipViewport2(componentProps, forwardedRef) { 8406 const { 8407 render, 8408 className, 8409 style, 8410 children, 8411 ...elementProps 8412 } = componentProps; 8413 const store = useTooltipRootContext(); 8414 const positioner = useTooltipPositionerContext(); 8415 const instantType = store.useState("instantType"); 8416 const { 8417 children: childrenToRender, 8418 state: viewportState 8419 } = usePopupViewport({ 8420 store, 8421 side: positioner.side, 8422 cssVars: TooltipViewportCssVars, 8423 children 8424 }); 8425 const state = { 8426 activationDirection: viewportState.activationDirection, 8427 transitioning: viewportState.transitioning, 8428 instant: instantType 8429 }; 8430 return useRenderElement("div", componentProps, { 8431 state, 8432 ref: forwardedRef, 8433 props: [elementProps, { 8434 children: childrenToRender 8435 }], 8436 stateAttributesMapping: stateAttributesMapping2 8437 }); 8438 }); 8439 if (true) TooltipViewport.displayName = "TooltipViewport"; 8440 8441 // node_modules/@base-ui/react/esm/tooltip/store/TooltipHandle.js 8442 var TooltipHandle = class { 8443 /** 8444 * Internal store holding the tooltip state. 8445 * @internal 8446 */ 8447 constructor() { 8448 this.store = new TooltipStore(); 8449 } 8450 /** 8451 * Opens the tooltip and associates it with the trigger with the given ID. 8452 * The trigger must be a Tooltip.Trigger component with this handle passed as a prop. 8453 * 8454 * This method should only be called in an event handler or an effect (not during rendering). 8455 * 8456 * @param triggerId ID of the trigger to associate with the tooltip. 8457 */ 8458 open(triggerId) { 8459 const triggerElement = triggerId ? this.store.context.triggerElements.getById(triggerId) : void 0; 8460 if (triggerId && !triggerElement) { 8461 throw new Error(true ? `Base UI: TooltipHandle.open: No trigger found with id "$triggerId}".` : formatErrorMessage_default(81, triggerId)); 8462 } 8463 this.store.setOpen(true, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, triggerElement)); 8464 } 8465 /** 8466 * Closes the tooltip. 8467 */ 8468 close() { 8469 this.store.setOpen(false, createChangeEventDetails(reason_parts_exports.imperativeAction, void 0, void 0)); 8470 } 8471 /** 8472 * Indicates whether the tooltip is currently open. 8473 */ 8474 get isOpen() { 8475 return this.store.select("open"); 8476 } 8477 }; 8478 function createTooltipHandle() { 8479 return new TooltipHandle(); 8480 } 8481 8482 // node_modules/@base-ui/react/esm/use-render/useRender.js 8483 function useRender(params) { 8484 return useRenderElement(params.defaultTagName ?? "div", params, params); 8485 } 8486 8487 // packages/ui/build-module/text/text.mjs 8488 var import_element10 = __toESM(require_element(), 1); 8489 var STYLE_HASH_ATTRIBUTE = "data-wp-hash"; 8490 function getRuntime() { 8491 const globalScope = globalThis; 8492 if (globalScope.__wpStyleRuntime) { 8493 return globalScope.__wpStyleRuntime; 8494 } 8495 globalScope.__wpStyleRuntime = { 8496 documents: /* @__PURE__ */ new Map(), 8497 styles: /* @__PURE__ */ new Map(), 8498 injectedStyles: /* @__PURE__ */ new WeakMap() 8499 }; 8500 if (typeof document !== "undefined") { 8501 registerDocument(document); 8502 } 8503 return globalScope.__wpStyleRuntime; 8504 } 8505 function documentContainsStyleHash(targetDocument, hash) { 8506 if (!targetDocument.head) { 8507 return false; 8508 } 8509 for (const style of targetDocument.head.querySelectorAll( 8510 `style[$STYLE_HASH_ATTRIBUTE}]` 8511 )) { 8512 if (style.getAttribute(STYLE_HASH_ATTRIBUTE) === hash) { 8513 return true; 8514 } 8515 } 8516 return false; 8517 } 8518 function injectStyle(targetDocument, hash, css) { 8519 if (!targetDocument.head) { 8520 return; 8521 } 8522 const runtime = getRuntime(); 8523 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8524 if (!injectedStyles) { 8525 injectedStyles = /* @__PURE__ */ new Set(); 8526 runtime.injectedStyles.set(targetDocument, injectedStyles); 8527 } 8528 if (injectedStyles.has(hash)) { 8529 return; 8530 } 8531 if (documentContainsStyleHash(targetDocument, hash)) { 8532 injectedStyles.add(hash); 8533 return; 8534 } 8535 const style = targetDocument.createElement("style"); 8536 style.setAttribute(STYLE_HASH_ATTRIBUTE, hash); 8537 style.appendChild(targetDocument.createTextNode(css)); 8538 targetDocument.head.appendChild(style); 8539 injectedStyles.add(hash); 8540 } 8541 function registerDocument(targetDocument) { 8542 const runtime = getRuntime(); 8543 runtime.documents.set( 8544 targetDocument, 8545 (runtime.documents.get(targetDocument) ?? 0) + 1 8546 ); 8547 for (const [hash, css] of runtime.styles) { 8548 injectStyle(targetDocument, hash, css); 8549 } 8550 return () => { 8551 const count = runtime.documents.get(targetDocument); 8552 if (count === void 0) { 8553 return; 8554 } 8555 if (count <= 1) { 8556 runtime.documents.delete(targetDocument); 8557 return; 8558 } 8559 runtime.documents.set(targetDocument, count - 1); 8560 }; 8561 } 8562 function registerStyle(hash, css) { 8563 const runtime = getRuntime(); 8564 runtime.styles.set(hash, css); 8565 for (const targetDocument of runtime.documents.keys()) { 8566 injectStyle(targetDocument, hash, css); 8567 } 8568 } 8569 if (typeof process === "undefined" || true) { 8570 registerStyle("0c5702ddca", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._83ed8a8da5dd50ea__text{margin:0}._14437cfb77831647__heading-2xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-2xl,32px);--_gcd-p-line-height:var(--wpds-typography-line-height-2xl,40px);font-size:var(--wpds-typography-font-size-2xl,32px);line-height:var(--wpds-typography-line-height-2xl,40px)}._14437cfb77831647__heading-2xl,._3c78b7fa9b4072dd__heading-xl{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-medium,499)}._3c78b7fa9b4072dd__heading-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-md,24px)}.aa58f227716bcde2__heading-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-lg,15px)}.aa58f227716bcde2__heading-lg,.fc4da56d8dfe52c4__heading-md{font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-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);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px)}.a9b78c7c82e8dff7__heading-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-medium,499);--_gcd-p-font-size:var(--wpds-typography-font-size-xs,11px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-family:var(--wpds-typography-font-family-heading,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-size:var(--wpds-typography-font-size-xs,11px);font-weight:var(--wpds-typography-font-weight-medium,499);line-height:var(--wpds-typography-line-height-xs,16px);text-transform:uppercase}._305ff559e52180d5__body-xl{--_gcd-heading-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-xl,20px);--_gcd-p-line-height:var(--wpds-typography-line-height-xl,32px);font-size:var(--wpds-typography-font-size-xl,20px);line-height:var(--wpds-typography-line-height-xl,32px)}._305ff559e52180d5__body-xl,.ca1aa3fc2029e958__body-lg{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}.ca1aa3fc2029e958__body-lg{--_gcd-heading-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-lg,15px);--_gcd-p-line-height:var(--wpds-typography-line-height-md,24px);font-size:var(--wpds-typography-font-size-lg,15px);line-height:var(--wpds-typography-line-height-md,24px)}._131101940be12424__body-md{--_gcd-heading-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-md,13px);--_gcd-p-line-height:var(--wpds-typography-line-height-sm,20px);font-size:var(--wpds-typography-font-size-md,13px);line-height:var(--wpds-typography-line-height-sm,20px)}._0e8d87a42c1f75fa__body-sm,._131101940be12424__body-md{font-family:var(--wpds-typography-font-family-body,-apple-system,system-ui,"Segoe UI","Roboto","Oxygen-Sans","Ubuntu","Cantarell","Helvetica Neue",sans-serif);font-weight:var(--wpds-typography-font-weight-regular,400)}._0e8d87a42c1f75fa__body-sm{--_gcd-heading-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-heading-font-weight:var(--wpds-typography-font-weight-regular,400);--_gcd-p-font-size:var(--wpds-typography-font-size-sm,12px);--_gcd-p-line-height:var(--wpds-typography-line-height-xs,16px);font-size:var(--wpds-typography-font-size-sm,12px);line-height:var(--wpds-typography-line-height-xs,16px)}}}'); 8571 } 8572 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" }; 8573 if (typeof process === "undefined" || true) { 8574 registerStyle("d5c1b736fd", "._6defc79820e382c6__button{box-sizing:var(--_gcd-button-box-sizing,border-box);font-family:var(--_gcd-button-font-family,inherit);font-size:var(--_gcd-button-font-size,inherit);font-weight:var(--_gcd-button-font-weight,inherit)}.d2cff2e5dea83bd1__input{box-sizing:var(--_gcd-input-box-sizing,border-box);font-family:var(--_gcd-input-font-family,inherit);font-size:var(--_gcd-input-font-size,inherit);font-weight:var(--_gcd-input-font-weight,inherit);margin:var(--_gcd-input-margin,0);&:is(textarea,[type=text],[type=password],[type=color],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){background-color:var(--_gcd-input-background-color,transparent);border:var(--_gcd-input-border,none);border-radius:var(--_gcd-input-border-radius,0);box-shadow:var(--_gcd-input-box-shadow,0 0 0 transparent);color:var(--_gcd-input-color,var(--wpds-color-fg-interactive-neutral,#1e1e1e));&:focus{border-color:var(--_gcd-input-border-color-focus,var(--wp-admin-theme-color));box-shadow:var(--_gcd-input-box-shadow-focus,none);outline:var(--_gcd-input-outline-focus,none)}&:disabled{background:var(--_gcd-input-background-disabled,transparent);border-color:var(--_gcd-input-border-color-disabled,transparent);box-shadow:var(--_gcd-input-box-shadow-disabled,none);color:var(--_gcd-input-color-disabled,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}&::placeholder{color:var(--_gcd-input-placeholder-color,var(--wpds-color-fg-interactive-neutral-disabled,#8d8d8d))}}&:is(textarea,[type=text],[type=password],[type=date],[type=datetime],[type=datetime-local],[type=email],[type=month],[type=number],[type=search],[type=tel],[type=time],[type=url],[type=week]){line-height:var(--_gcd-input-line-height,inherit);min-height:var(--_gcd-input-min-height,auto);padding:var(--_gcd-input-padding,0)}}._547d86373d02e108__textarea{box-sizing:var(--_gcd-textarea-box-sizing,border-box);overflow:var(--_gcd-textarea-overflow,auto);resize:var(--_gcd-textarea-resize,block)}._8c15fd0ed9f28ba4__div{outline:var(--_gcd-div-outline,0 solid transparent)}p._43cec3e1eec1066d__p{font-size:var(--_gcd-p-font-size,13px);line-height:var(--_gcd-p-line-height,1.5);margin:var(--_gcd-p-margin,0)}:is(h1,h2,h3,h4,h5,h6).e97669c6d9a38497__heading{color:var(--_gcd-heading-color,var(--wpds-color-fg-content-neutral,#1e1e1e));font-size:var(--_gcd-heading-font-size,inherit);font-weight:var(--_gcd-heading-font-weight,var(--wpds-typography-font-weight-medium,499));margin:var(--_gcd-heading-margin,0)}._2c0831b0499dbd6e__a,._2c0831b0499dbd6e__a:is(:hover,:focus,:active){border-radius:var(--_gcd-a-border-radius,0);box-shadow:var(--_gcd-a-box-shadow,none);color:var(--_gcd-a-color,inherit);outline:var(--_gcd-a-outline,0 solid transparent);transition:var(--_gcd-a-transition,none)}"); 8575 } 8576 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" }; 8577 var Text = (0, import_element10.forwardRef)(function Text2({ variant = "body-md", render, className, ...props }, ref) { 8578 const element = useRender({ 8579 render, 8580 defaultTagName: "span", 8581 ref, 8582 props: mergeProps(props, { 8583 className: clsx_default( 8584 style_default.text, 8585 global_css_defense_default.heading, 8586 global_css_defense_default.p, 8587 style_default[variant], 8588 className 8589 ) 8590 }) 8591 }); 8592 return element; 8593 }); 8594 8595 // packages/icons/build-module/icon/index.mjs 8596 var import_element11 = __toESM(require_element(), 1); 8597 var icon_default = (0, import_element11.forwardRef)( 8598 ({ icon, size: size4 = 24, ...props }, ref) => { 8599 return (0, import_element11.cloneElement)(icon, { 8600 width: size4, 8601 height: size4, 8602 ...props, 8603 ref 8604 }); 8605 } 8606 ); 8607 8608 // packages/icons/build-module/library/chevron-left.mjs 8609 var import_primitives = __toESM(require_primitives(), 1); 8610 var import_jsx_runtime11 = __toESM(require_jsx_runtime(), 1); 8611 var chevron_left_default = /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(import_primitives.Path, { d: "M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z" }) }); 8612 8613 // packages/icons/build-module/library/chevron-right.mjs 8614 var import_primitives2 = __toESM(require_primitives(), 1); 8615 var import_jsx_runtime12 = __toESM(require_jsx_runtime(), 1); 8616 var chevron_right_default = /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives2.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_primitives2.Path, { d: "M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z" }) }); 8617 8618 // packages/icons/build-module/library/more-vertical.mjs 8619 var import_primitives3 = __toESM(require_primitives(), 1); 8620 var import_jsx_runtime13 = __toESM(require_jsx_runtime(), 1); 8621 var more_vertical_default = /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives3.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(import_primitives3.Path, { d: "M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z" }) }); 8622 8623 // packages/icons/build-module/library/next.mjs 8624 var import_primitives4 = __toESM(require_primitives(), 1); 8625 var import_jsx_runtime14 = __toESM(require_jsx_runtime(), 1); 8626 var next_default = /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives4.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(import_primitives4.Path, { d: "M6.6 6L5.4 7l4.5 5-4.5 5 1.1 1 5.5-6-5.4-6zm6 0l-1.1 1 4.5 5-4.5 5 1.1 1 5.5-6-5.5-6z" }) }); 8627 8628 // packages/icons/build-module/library/previous.mjs 8629 var import_primitives5 = __toESM(require_primitives(), 1); 8630 var import_jsx_runtime15 = __toESM(require_jsx_runtime(), 1); 8631 var previous_default = /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives5.SVG, { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24", children: /* @__PURE__ */ (0, import_jsx_runtime15.jsx)(import_primitives5.Path, { d: "M11.6 7l-1.1-1L5 12l5.5 6 1.1-1L7 12l4.6-5zm6 0l-1.1-1-5.5 6 5.5 6 1.1-1-4.6-5 4.6-5z" }) }); 8632 8633 // packages/ui/build-module/utils/render-slot-with-children.mjs 8634 var import_element12 = __toESM(require_element(), 1); 8635 function renderSlotWithChildren(slot, defaultSlot, children) { 8636 return (0, import_element12.cloneElement)(slot ?? defaultSlot, { children }); 8637 } 8638 8639 // packages/ui/build-module/lock-unlock.mjs 8640 var import_private_apis = __toESM(require_private_apis(), 1); 8641 var { lock, unlock } = (0, import_private_apis.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 8642 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 8643 "@wordpress/ui" 8644 ); 8645 8646 // packages/ui/build-module/stack/stack.mjs 8647 var import_element13 = __toESM(require_element(), 1); 8648 var STYLE_HASH_ATTRIBUTE2 = "data-wp-hash"; 8649 function getRuntime2() { 8650 const globalScope = globalThis; 8651 if (globalScope.__wpStyleRuntime) { 8652 return globalScope.__wpStyleRuntime; 8653 } 8654 globalScope.__wpStyleRuntime = { 8655 documents: /* @__PURE__ */ new Map(), 8656 styles: /* @__PURE__ */ new Map(), 8657 injectedStyles: /* @__PURE__ */ new WeakMap() 8658 }; 8659 if (typeof document !== "undefined") { 8660 registerDocument2(document); 8661 } 8662 return globalScope.__wpStyleRuntime; 8663 } 8664 function documentContainsStyleHash2(targetDocument, hash) { 8665 if (!targetDocument.head) { 8666 return false; 8667 } 8668 for (const style of targetDocument.head.querySelectorAll( 8669 `style[$STYLE_HASH_ATTRIBUTE2}]` 8670 )) { 8671 if (style.getAttribute(STYLE_HASH_ATTRIBUTE2) === hash) { 8672 return true; 8673 } 8674 } 8675 return false; 8676 } 8677 function injectStyle2(targetDocument, hash, css) { 8678 if (!targetDocument.head) { 8679 return; 8680 } 8681 const runtime = getRuntime2(); 8682 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8683 if (!injectedStyles) { 8684 injectedStyles = /* @__PURE__ */ new Set(); 8685 runtime.injectedStyles.set(targetDocument, injectedStyles); 8686 } 8687 if (injectedStyles.has(hash)) { 8688 return; 8689 } 8690 if (documentContainsStyleHash2(targetDocument, hash)) { 8691 injectedStyles.add(hash); 8692 return; 8693 } 8694 const style = targetDocument.createElement("style"); 8695 style.setAttribute(STYLE_HASH_ATTRIBUTE2, hash); 8696 style.appendChild(targetDocument.createTextNode(css)); 8697 targetDocument.head.appendChild(style); 8698 injectedStyles.add(hash); 8699 } 8700 function registerDocument2(targetDocument) { 8701 const runtime = getRuntime2(); 8702 runtime.documents.set( 8703 targetDocument, 8704 (runtime.documents.get(targetDocument) ?? 0) + 1 8705 ); 8706 for (const [hash, css] of runtime.styles) { 8707 injectStyle2(targetDocument, hash, css); 8708 } 8709 return () => { 8710 const count = runtime.documents.get(targetDocument); 8711 if (count === void 0) { 8712 return; 8713 } 8714 if (count <= 1) { 8715 runtime.documents.delete(targetDocument); 8716 return; 8717 } 8718 runtime.documents.set(targetDocument, count - 1); 8719 }; 8720 } 8721 function registerStyle2(hash, css) { 8722 const runtime = getRuntime2(); 8723 runtime.styles.set(hash, css); 8724 for (const targetDocument of runtime.documents.keys()) { 8725 injectStyle2(targetDocument, hash, css); 8726 } 8727 } 8728 if (typeof process === "undefined" || true) { 8729 registerStyle2("32aba35fe1", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer components{._19ce0419607e1896__stack{display:flex}}}"); 8730 } 8731 var style_default2 = { "stack": "_19ce0419607e1896__stack" }; 8732 var gapTokens = { 8733 xs: "var(--wpds-dimension-gap-xs, 4px)", 8734 sm: "var(--wpds-dimension-gap-sm, 8px)", 8735 md: "var(--wpds-dimension-gap-md, 12px)", 8736 lg: "var(--wpds-dimension-gap-lg, 16px)", 8737 xl: "var(--wpds-dimension-gap-xl, 24px)", 8738 "2xl": "var(--wpds-dimension-gap-2xl, 32px)", 8739 "3xl": "var(--wpds-dimension-gap-3xl, 40px)" 8740 }; 8741 var Stack = (0, import_element13.forwardRef)(function Stack2({ direction, gap, align, justify, wrap, render, ...props }, ref) { 8742 const style = { 8743 gap: gap && gapTokens[gap], 8744 alignItems: align, 8745 justifyContent: justify, 8746 flexDirection: direction, 8747 flexWrap: wrap 8748 }; 8749 const element = useRender({ 8750 render, 8751 ref, 8752 props: mergeProps(props, { style, className: style_default2.stack }) 8753 }); 8754 return element; 8755 }); 8756 8757 // packages/ui/build-module/tooltip/index.mjs 8758 var tooltip_exports = {}; 8759 __export(tooltip_exports, { 8760 Popup: () => Popup, 8761 Portal: () => Portal, 8762 Positioner: () => Positioner, 8763 Provider: () => Provider, 8764 Root: () => Root, 8765 Trigger: () => Trigger 8766 }); 8767 8768 // packages/ui/build-module/tooltip/popup.mjs 8769 var import_element16 = __toESM(require_element(), 1); 8770 var import_theme = __toESM(require_theme(), 1); 8771 8772 // packages/ui/build-module/tooltip/portal.mjs 8773 var import_element14 = __toESM(require_element(), 1); 8774 8775 // packages/ui/build-module/utils/wp-compat-overlay-slot.mjs 8776 var STYLE_HASH_ATTRIBUTE3 = "data-wp-hash"; 8777 function getRuntime3() { 8778 const globalScope = globalThis; 8779 if (globalScope.__wpStyleRuntime) { 8780 return globalScope.__wpStyleRuntime; 8781 } 8782 globalScope.__wpStyleRuntime = { 8783 documents: /* @__PURE__ */ new Map(), 8784 styles: /* @__PURE__ */ new Map(), 8785 injectedStyles: /* @__PURE__ */ new WeakMap() 8786 }; 8787 if (typeof document !== "undefined") { 8788 registerDocument3(document); 8789 } 8790 return globalScope.__wpStyleRuntime; 8791 } 8792 function documentContainsStyleHash3(targetDocument, hash) { 8793 if (!targetDocument.head) { 8794 return false; 8795 } 8796 for (const style of targetDocument.head.querySelectorAll( 8797 `style[$STYLE_HASH_ATTRIBUTE3}]` 8798 )) { 8799 if (style.getAttribute(STYLE_HASH_ATTRIBUTE3) === hash) { 8800 return true; 8801 } 8802 } 8803 return false; 8804 } 8805 function injectStyle3(targetDocument, hash, css) { 8806 if (!targetDocument.head) { 8807 return; 8808 } 8809 const runtime = getRuntime3(); 8810 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8811 if (!injectedStyles) { 8812 injectedStyles = /* @__PURE__ */ new Set(); 8813 runtime.injectedStyles.set(targetDocument, injectedStyles); 8814 } 8815 if (injectedStyles.has(hash)) { 8816 return; 8817 } 8818 if (documentContainsStyleHash3(targetDocument, hash)) { 8819 injectedStyles.add(hash); 8820 return; 8821 } 8822 const style = targetDocument.createElement("style"); 8823 style.setAttribute(STYLE_HASH_ATTRIBUTE3, hash); 8824 style.appendChild(targetDocument.createTextNode(css)); 8825 targetDocument.head.appendChild(style); 8826 injectedStyles.add(hash); 8827 } 8828 function registerDocument3(targetDocument) { 8829 const runtime = getRuntime3(); 8830 runtime.documents.set( 8831 targetDocument, 8832 (runtime.documents.get(targetDocument) ?? 0) + 1 8833 ); 8834 for (const [hash, css] of runtime.styles) { 8835 injectStyle3(targetDocument, hash, css); 8836 } 8837 return () => { 8838 const count = runtime.documents.get(targetDocument); 8839 if (count === void 0) { 8840 return; 8841 } 8842 if (count <= 1) { 8843 runtime.documents.delete(targetDocument); 8844 return; 8845 } 8846 runtime.documents.set(targetDocument, count - 1); 8847 }; 8848 } 8849 function registerStyle3(hash, css) { 8850 const runtime = getRuntime3(); 8851 runtime.styles.set(hash, css); 8852 for (const targetDocument of runtime.documents.keys()) { 8853 injectStyle3(targetDocument, hash, css); 8854 } 8855 } 8856 if (typeof process === "undefined" || true) { 8857 registerStyle3("be37f31c1e", "._11fc52b637ff8a7e__slot{inset:0;isolation:isolate;pointer-events:none;position:fixed;z-index:1000000003}@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._11fc52b637ff8a7e__slot>*{pointer-events:auto}}}"); 8858 } 8859 var wp_compat_overlay_slot_default = { "slot": "_11fc52b637ff8a7e__slot" }; 8860 var WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE = "data-wp-compat-overlay-slot"; 8861 function resolveOwnerDocument() { 8862 return typeof document === "undefined" ? null : document; 8863 } 8864 function isInWordPressEnvironment() { 8865 let topWp; 8866 try { 8867 topWp = window.top?.wp; 8868 } catch { 8869 } 8870 const wp = topWp ?? window.wp; 8871 return typeof wp?.components === "object" && wp.components !== null; 8872 } 8873 var cachedSlot = null; 8874 function createSlot(ownerDocument2) { 8875 const element = ownerDocument2.createElement("div"); 8876 element.setAttribute(WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE, ""); 8877 if (wp_compat_overlay_slot_default.slot) { 8878 element.classList.add(wp_compat_overlay_slot_default.slot); 8879 } 8880 ownerDocument2.body.appendChild(element); 8881 return element; 8882 } 8883 function getWpCompatOverlaySlot() { 8884 if (typeof window === "undefined") { 8885 return void 0; 8886 } 8887 if (!isInWordPressEnvironment() && window.__wpUiCompatOverlaySlotEnabled !== true) { 8888 return void 0; 8889 } 8890 const ownerDocument2 = resolveOwnerDocument(); 8891 if (!ownerDocument2 || !ownerDocument2.body) { 8892 return void 0; 8893 } 8894 if (cachedSlot && cachedSlot.ownerDocument === ownerDocument2 && cachedSlot.isConnected) { 8895 return cachedSlot; 8896 } 8897 const existing = ownerDocument2.querySelector( 8898 `[$WP_COMPAT_OVERLAY_SLOT_ATTRIBUTE}]` 8899 ); 8900 if (existing instanceof HTMLDivElement) { 8901 cachedSlot = existing; 8902 return existing; 8903 } 8904 if (cachedSlot?.isConnected) { 8905 cachedSlot.remove(); 8906 } 8907 cachedSlot = createSlot(ownerDocument2); 8908 return cachedSlot; 8909 } 8910 8911 // packages/ui/build-module/tooltip/portal.mjs 8912 var import_jsx_runtime16 = __toESM(require_jsx_runtime(), 1); 8913 var Portal = (0, import_element14.forwardRef)( 8914 function TooltipPortal3({ container, ...restProps }, ref) { 8915 return /* @__PURE__ */ (0, import_jsx_runtime16.jsx)( 8916 index_parts_exports.Portal, 8917 { 8918 container: container ?? getWpCompatOverlaySlot(), 8919 ...restProps, 8920 ref 8921 } 8922 ); 8923 } 8924 ); 8925 8926 // packages/ui/build-module/tooltip/positioner.mjs 8927 var import_element15 = __toESM(require_element(), 1); 8928 var import_jsx_runtime17 = __toESM(require_jsx_runtime(), 1); 8929 var STYLE_HASH_ATTRIBUTE4 = "data-wp-hash"; 8930 function getRuntime4() { 8931 const globalScope = globalThis; 8932 if (globalScope.__wpStyleRuntime) { 8933 return globalScope.__wpStyleRuntime; 8934 } 8935 globalScope.__wpStyleRuntime = { 8936 documents: /* @__PURE__ */ new Map(), 8937 styles: /* @__PURE__ */ new Map(), 8938 injectedStyles: /* @__PURE__ */ new WeakMap() 8939 }; 8940 if (typeof document !== "undefined") { 8941 registerDocument4(document); 8942 } 8943 return globalScope.__wpStyleRuntime; 8944 } 8945 function documentContainsStyleHash4(targetDocument, hash) { 8946 if (!targetDocument.head) { 8947 return false; 8948 } 8949 for (const style of targetDocument.head.querySelectorAll( 8950 `style[$STYLE_HASH_ATTRIBUTE4}]` 8951 )) { 8952 if (style.getAttribute(STYLE_HASH_ATTRIBUTE4) === hash) { 8953 return true; 8954 } 8955 } 8956 return false; 8957 } 8958 function injectStyle4(targetDocument, hash, css) { 8959 if (!targetDocument.head) { 8960 return; 8961 } 8962 const runtime = getRuntime4(); 8963 let injectedStyles = runtime.injectedStyles.get(targetDocument); 8964 if (!injectedStyles) { 8965 injectedStyles = /* @__PURE__ */ new Set(); 8966 runtime.injectedStyles.set(targetDocument, injectedStyles); 8967 } 8968 if (injectedStyles.has(hash)) { 8969 return; 8970 } 8971 if (documentContainsStyleHash4(targetDocument, hash)) { 8972 injectedStyles.add(hash); 8973 return; 8974 } 8975 const style = targetDocument.createElement("style"); 8976 style.setAttribute(STYLE_HASH_ATTRIBUTE4, hash); 8977 style.appendChild(targetDocument.createTextNode(css)); 8978 targetDocument.head.appendChild(style); 8979 injectedStyles.add(hash); 8980 } 8981 function registerDocument4(targetDocument) { 8982 const runtime = getRuntime4(); 8983 runtime.documents.set( 8984 targetDocument, 8985 (runtime.documents.get(targetDocument) ?? 0) + 1 8986 ); 8987 for (const [hash, css] of runtime.styles) { 8988 injectStyle4(targetDocument, hash, css); 8989 } 8990 return () => { 8991 const count = runtime.documents.get(targetDocument); 8992 if (count === void 0) { 8993 return; 8994 } 8995 if (count <= 1) { 8996 runtime.documents.delete(targetDocument); 8997 return; 8998 } 8999 runtime.documents.set(targetDocument, count - 1); 9000 }; 9001 } 9002 function registerStyle4(hash, css) { 9003 const runtime = getRuntime4(); 9004 runtime.styles.set(hash, css); 9005 for (const targetDocument of runtime.documents.keys()) { 9006 injectStyle4(targetDocument, hash, css); 9007 } 9008 } 9009 if (typeof process === "undefined" || true) { 9010 registerStyle4("10f3806643", "@layer wp-ui{@layer utilities, components, compositions, overrides;@layer utilities{._336cd3e4e743482f__box-sizing{box-sizing:border-box;*,:after,:before{box-sizing:inherit}}}}"); 9011 } 9012 var resets_default = { "box-sizing": "_336cd3e4e743482f__box-sizing" }; 9013 if (typeof process === "undefined" || true) { 9014 registerStyle4("4811d023d1", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer 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-md,4px);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}}}}'); 9015 } 9016 var style_default3 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 9017 var Positioner = (0, import_element15.forwardRef)( 9018 function TooltipPositioner3({ align = "center", className, side = "top", sideOffset = 4, ...props }, ref) { 9019 return /* @__PURE__ */ (0, import_jsx_runtime17.jsx)( 9020 index_parts_exports.Positioner, 9021 { 9022 ref, 9023 align, 9024 side, 9025 sideOffset, 9026 ...props, 9027 className: clsx_default( 9028 resets_default["box-sizing"], 9029 style_default3.positioner, 9030 className 9031 ) 9032 } 9033 ); 9034 } 9035 ); 9036 9037 // packages/ui/build-module/tooltip/popup.mjs 9038 var import_jsx_runtime18 = __toESM(require_jsx_runtime(), 1); 9039 var STYLE_HASH_ATTRIBUTE5 = "data-wp-hash"; 9040 function getRuntime5() { 9041 const globalScope = globalThis; 9042 if (globalScope.__wpStyleRuntime) { 9043 return globalScope.__wpStyleRuntime; 9044 } 9045 globalScope.__wpStyleRuntime = { 9046 documents: /* @__PURE__ */ new Map(), 9047 styles: /* @__PURE__ */ new Map(), 9048 injectedStyles: /* @__PURE__ */ new WeakMap() 9049 }; 9050 if (typeof document !== "undefined") { 9051 registerDocument5(document); 9052 } 9053 return globalScope.__wpStyleRuntime; 9054 } 9055 function documentContainsStyleHash5(targetDocument, hash) { 9056 if (!targetDocument.head) { 9057 return false; 9058 } 9059 for (const style of targetDocument.head.querySelectorAll( 9060 `style[$STYLE_HASH_ATTRIBUTE5}]` 9061 )) { 9062 if (style.getAttribute(STYLE_HASH_ATTRIBUTE5) === hash) { 9063 return true; 9064 } 9065 } 9066 return false; 9067 } 9068 function injectStyle5(targetDocument, hash, css) { 9069 if (!targetDocument.head) { 9070 return; 9071 } 9072 const runtime = getRuntime5(); 9073 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9074 if (!injectedStyles) { 9075 injectedStyles = /* @__PURE__ */ new Set(); 9076 runtime.injectedStyles.set(targetDocument, injectedStyles); 9077 } 9078 if (injectedStyles.has(hash)) { 9079 return; 9080 } 9081 if (documentContainsStyleHash5(targetDocument, hash)) { 9082 injectedStyles.add(hash); 9083 return; 9084 } 9085 const style = targetDocument.createElement("style"); 9086 style.setAttribute(STYLE_HASH_ATTRIBUTE5, hash); 9087 style.appendChild(targetDocument.createTextNode(css)); 9088 targetDocument.head.appendChild(style); 9089 injectedStyles.add(hash); 9090 } 9091 function registerDocument5(targetDocument) { 9092 const runtime = getRuntime5(); 9093 runtime.documents.set( 9094 targetDocument, 9095 (runtime.documents.get(targetDocument) ?? 0) + 1 9096 ); 9097 for (const [hash, css] of runtime.styles) { 9098 injectStyle5(targetDocument, hash, css); 9099 } 9100 return () => { 9101 const count = runtime.documents.get(targetDocument); 9102 if (count === void 0) { 9103 return; 9104 } 9105 if (count <= 1) { 9106 runtime.documents.delete(targetDocument); 9107 return; 9108 } 9109 runtime.documents.set(targetDocument, count - 1); 9110 }; 9111 } 9112 function registerStyle5(hash, css) { 9113 const runtime = getRuntime5(); 9114 runtime.styles.set(hash, css); 9115 for (const targetDocument of runtime.documents.keys()) { 9116 injectStyle5(targetDocument, hash, css); 9117 } 9118 } 9119 if (typeof process === "undefined" || true) { 9120 registerStyle5("4811d023d1", '@layer wp-ui{@layer utilities, components, compositions, overrides;@layer 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-md,4px);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}}}}'); 9121 } 9122 var style_default4 = { "positioner": "_480b748dd3510e64__positioner", "popup": "_50096b232db7709d__popup" }; 9123 var ThemeProvider = unlock(import_theme.privateApis).ThemeProvider; 9124 var POPUP_COLOR = { background: "#1e1e1e" }; 9125 var Popup = (0, import_element16.forwardRef)(function TooltipPopup3({ portal, positioner, children, className, ...props }, ref) { 9126 const popupContent = /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(ThemeProvider, { color: POPUP_COLOR, children: /* @__PURE__ */ (0, import_jsx_runtime18.jsx)( 9127 index_parts_exports.Popup, 9128 { 9129 ref, 9130 className: clsx_default(style_default4.popup, className), 9131 ...props, 9132 children 9133 } 9134 ) }); 9135 const positionedPopup = renderSlotWithChildren( 9136 positioner, 9137 /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Positioner, {}), 9138 popupContent 9139 ); 9140 return renderSlotWithChildren(portal, /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Portal, {}), positionedPopup); 9141 }); 9142 9143 // packages/ui/build-module/tooltip/trigger.mjs 9144 var import_element17 = __toESM(require_element(), 1); 9145 var import_jsx_runtime19 = __toESM(require_jsx_runtime(), 1); 9146 var Trigger = (0, import_element17.forwardRef)( 9147 function TooltipTrigger3(props, ref) { 9148 return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(index_parts_exports.Trigger, { ref, ...props }); 9149 } 9150 ); 9151 9152 // packages/ui/build-module/tooltip/root.mjs 9153 var import_jsx_runtime20 = __toESM(require_jsx_runtime(), 1); 9154 function Root(props) { 9155 return /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(index_parts_exports.Root, { ...props }); 9156 } 9157 9158 // packages/ui/build-module/tooltip/provider.mjs 9159 var import_jsx_runtime21 = __toESM(require_jsx_runtime(), 1); 9160 function Provider({ ...props }) { 9161 return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(index_parts_exports.Provider, { ...props }); 9162 } 9163 9164 // packages/admin-ui/build-module/navigable-region/index.mjs 9165 var import_element18 = __toESM(require_element(), 1); 9166 var import_jsx_runtime22 = __toESM(require_jsx_runtime(), 1); 9167 var NavigableRegion = (0, import_element18.forwardRef)( 9168 ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { 9169 return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)( 9170 Tag, 9171 { 9172 ref, 9173 className: clsx_default("admin-ui-navigable-region", className), 9174 "aria-label": ariaLabel, 9175 role: "region", 9176 tabIndex: "-1", 9177 ...props, 9178 children 9179 } 9180 ); 9181 } 9182 ); 9183 NavigableRegion.displayName = "NavigableRegion"; 9184 var navigable_region_default = NavigableRegion; 9185 9186 // packages/admin-ui/build-module/page/sidebar-toggle-slot.mjs 9187 var import_components = __toESM(require_components(), 1); 9188 var { Fill: SidebarToggleFill, Slot: SidebarToggleSlot } = (0, import_components.createSlotFill)("SidebarToggle"); 9189 9190 // packages/admin-ui/build-module/page/header.mjs 9191 var import_jsx_runtime23 = __toESM(require_jsx_runtime(), 1); 9192 var STYLE_HASH_ATTRIBUTE6 = "data-wp-hash"; 9193 function getRuntime6() { 9194 const globalScope = globalThis; 9195 if (globalScope.__wpStyleRuntime) { 9196 return globalScope.__wpStyleRuntime; 9197 } 9198 globalScope.__wpStyleRuntime = { 9199 documents: /* @__PURE__ */ new Map(), 9200 styles: /* @__PURE__ */ new Map(), 9201 injectedStyles: /* @__PURE__ */ new WeakMap() 9202 }; 9203 if (typeof document !== "undefined") { 9204 registerDocument6(document); 9205 } 9206 return globalScope.__wpStyleRuntime; 9207 } 9208 function documentContainsStyleHash6(targetDocument, hash) { 9209 if (!targetDocument.head) { 9210 return false; 9211 } 9212 for (const style of targetDocument.head.querySelectorAll( 9213 `style[$STYLE_HASH_ATTRIBUTE6}]` 9214 )) { 9215 if (style.getAttribute(STYLE_HASH_ATTRIBUTE6) === hash) { 9216 return true; 9217 } 9218 } 9219 return false; 9220 } 9221 function injectStyle6(targetDocument, hash, css) { 9222 if (!targetDocument.head) { 9223 return; 9224 } 9225 const runtime = getRuntime6(); 9226 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9227 if (!injectedStyles) { 9228 injectedStyles = /* @__PURE__ */ new Set(); 9229 runtime.injectedStyles.set(targetDocument, injectedStyles); 9230 } 9231 if (injectedStyles.has(hash)) { 9232 return; 9233 } 9234 if (documentContainsStyleHash6(targetDocument, hash)) { 9235 injectedStyles.add(hash); 9236 return; 9237 } 9238 const style = targetDocument.createElement("style"); 9239 style.setAttribute(STYLE_HASH_ATTRIBUTE6, hash); 9240 style.appendChild(targetDocument.createTextNode(css)); 9241 targetDocument.head.appendChild(style); 9242 injectedStyles.add(hash); 9243 } 9244 function registerDocument6(targetDocument) { 9245 const runtime = getRuntime6(); 9246 runtime.documents.set( 9247 targetDocument, 9248 (runtime.documents.get(targetDocument) ?? 0) + 1 9249 ); 9250 for (const [hash, css] of runtime.styles) { 9251 injectStyle6(targetDocument, hash, css); 9252 } 9253 return () => { 9254 const count = runtime.documents.get(targetDocument); 9255 if (count === void 0) { 9256 return; 9257 } 9258 if (count <= 1) { 9259 runtime.documents.delete(targetDocument); 9260 return; 9261 } 9262 runtime.documents.set(targetDocument, count - 1); 9263 }; 9264 } 9265 function registerStyle6(hash, css) { 9266 const runtime = getRuntime6(); 9267 runtime.styles.set(hash, css); 9268 for (const targetDocument of runtime.documents.keys()) { 9269 injectStyle6(targetDocument, hash, css); 9270 } 9271 } 9272 if (typeof process === "undefined" || true) { 9273 registerStyle6("683dd16f2c", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral,#fcfcfc);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:calc(var(--wpds-dimension-base, 4px)*8)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:calc(var(--wpds-dimension-base, 4px)*6);width:calc(var(--wpds-dimension-base, 4px)*6);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-fg-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}"); 9274 } 9275 var style_default5 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" }; 9276 function Header({ 9277 headingLevel = 1, 9278 breadcrumbs, 9279 badges, 9280 visual, 9281 title, 9282 subTitle, 9283 actions, 9284 showSidebarToggle = true 9285 }) { 9286 const HeadingTag = `h$headingLevel}`; 9287 return /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Stack, { direction: "column", className: style_default5.header, children: [ 9288 /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)( 9289 Stack, 9290 { 9291 className: style_default5["header-content"], 9292 direction: "row", 9293 gap: "sm", 9294 justify: "space-between", 9295 children: [ 9296 /* @__PURE__ */ (0, import_jsx_runtime23.jsxs)(Stack, { direction: "row", gap: "sm", align: "center", justify: "start", children: [ 9297 showSidebarToggle && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( 9298 SidebarToggleSlot, 9299 { 9300 bubblesVirtually: true, 9301 className: style_default5["sidebar-toggle-slot"] 9302 } 9303 ), 9304 visual && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( 9305 "div", 9306 { 9307 className: style_default5["header-visual"], 9308 "aria-hidden": "true", 9309 children: visual 9310 } 9311 ), 9312 title && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( 9313 Text, 9314 { 9315 className: style_default5["header-title"], 9316 render: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)(HeadingTag, {}), 9317 variant: "heading-lg", 9318 children: title 9319 } 9320 ), 9321 breadcrumbs, 9322 badges 9323 ] }), 9324 actions && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( 9325 Stack, 9326 { 9327 align: "center", 9328 className: style_default5["header-actions"], 9329 direction: "row", 9330 gap: "sm", 9331 children: actions 9332 } 9333 ) 9334 ] 9335 } 9336 ), 9337 subTitle && /* @__PURE__ */ (0, import_jsx_runtime23.jsx)( 9338 Text, 9339 { 9340 render: /* @__PURE__ */ (0, import_jsx_runtime23.jsx)("p", {}), 9341 variant: "body-md", 9342 className: style_default5["header-subtitle"], 9343 children: subTitle 9344 } 9345 ) 9346 ] }); 9347 } 9348 9349 // packages/admin-ui/build-module/page/index.mjs 9350 var import_jsx_runtime24 = __toESM(require_jsx_runtime(), 1); 9351 var STYLE_HASH_ATTRIBUTE7 = "data-wp-hash"; 9352 function getRuntime7() { 9353 const globalScope = globalThis; 9354 if (globalScope.__wpStyleRuntime) { 9355 return globalScope.__wpStyleRuntime; 9356 } 9357 globalScope.__wpStyleRuntime = { 9358 documents: /* @__PURE__ */ new Map(), 9359 styles: /* @__PURE__ */ new Map(), 9360 injectedStyles: /* @__PURE__ */ new WeakMap() 9361 }; 9362 if (typeof document !== "undefined") { 9363 registerDocument7(document); 9364 } 9365 return globalScope.__wpStyleRuntime; 9366 } 9367 function documentContainsStyleHash7(targetDocument, hash) { 9368 if (!targetDocument.head) { 9369 return false; 9370 } 9371 for (const style of targetDocument.head.querySelectorAll( 9372 `style[$STYLE_HASH_ATTRIBUTE7}]` 9373 )) { 9374 if (style.getAttribute(STYLE_HASH_ATTRIBUTE7) === hash) { 9375 return true; 9376 } 9377 } 9378 return false; 9379 } 9380 function injectStyle7(targetDocument, hash, css) { 9381 if (!targetDocument.head) { 9382 return; 9383 } 9384 const runtime = getRuntime7(); 9385 let injectedStyles = runtime.injectedStyles.get(targetDocument); 9386 if (!injectedStyles) { 9387 injectedStyles = /* @__PURE__ */ new Set(); 9388 runtime.injectedStyles.set(targetDocument, injectedStyles); 9389 } 9390 if (injectedStyles.has(hash)) { 9391 return; 9392 } 9393 if (documentContainsStyleHash7(targetDocument, hash)) { 9394 injectedStyles.add(hash); 9395 return; 9396 } 9397 const style = targetDocument.createElement("style"); 9398 style.setAttribute(STYLE_HASH_ATTRIBUTE7, hash); 9399 style.appendChild(targetDocument.createTextNode(css)); 9400 targetDocument.head.appendChild(style); 9401 injectedStyles.add(hash); 9402 } 9403 function registerDocument7(targetDocument) { 9404 const runtime = getRuntime7(); 9405 runtime.documents.set( 9406 targetDocument, 9407 (runtime.documents.get(targetDocument) ?? 0) + 1 9408 ); 9409 for (const [hash, css] of runtime.styles) { 9410 injectStyle7(targetDocument, hash, css); 9411 } 9412 return () => { 9413 const count = runtime.documents.get(targetDocument); 9414 if (count === void 0) { 9415 return; 9416 } 9417 if (count <= 1) { 9418 runtime.documents.delete(targetDocument); 9419 return; 9420 } 9421 runtime.documents.set(targetDocument, count - 1); 9422 }; 9423 } 9424 function registerStyle7(hash, css) { 9425 const runtime = getRuntime7(); 9426 runtime.styles.set(hash, css); 9427 for (const targetDocument of runtime.documents.keys()) { 9428 injectStyle7(targetDocument, hash, css); 9429 } 9430 } 9431 if (typeof process === "undefined" || true) { 9432 registerStyle7("683dd16f2c", "._956b6df0898efed0__page{text-wrap:pretty;background-color:var(--wpds-color-bg-surface-neutral,#fcfcfc);color:var(--wpds-color-fg-content-neutral,#1e1e1e);display:flex;flex-flow:column;height:100%;position:relative;z-index:1}._0625b55e82a0d93d__header{background:var(--wpds-color-bg-surface-neutral-strong,#fff);border-block-end:var(--wpds-border-width-xs,1px) solid var(--wpds-color-stroke-surface-neutral-weak,#f0f0f0);inset-block-start:0;padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px);position:sticky;z-index:1}.a43c44d5ae28b2e8__header-content{min-height:calc(var(--wpds-dimension-base, 4px)*8)}.b7cb5b9daf3a3b25__header-actions{flex-shrink:0}._8113be94e7caf73c__header-title{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}._9a776c7f70996f61__header-visual{display:grid;flex-shrink:0;grid-template-columns:1fr;grid-template-rows:1fr;height:calc(var(--wpds-dimension-base, 4px)*6);width:calc(var(--wpds-dimension-base, 4px)*6);>*{grid-column:1/-1;grid-row:1/-1;max-height:100%;max-width:100%}}.d5e0920cd15d35bc__sidebar-toggle-slot:empty{display:none}._60fea2f6bf5319cd__header-subtitle{color:var(--wpds-color-fg-content-neutral-weak,#707070);padding-block-end:var(--wpds-dimension-padding-xs,4px)}.be5e57d029ec4036__content{display:flex;flex-direction:column;flex-grow:1;overflow:auto;&._128806d0b26e3a50__has-padding{padding:var(--wpds-dimension-padding-lg,16px) var(--wpds-dimension-padding-2xl,24px)}}"); 9433 } 9434 var style_default6 = { "page": "_956b6df0898efed0__page", "header": "_0625b55e82a0d93d__header", "header-content": "a43c44d5ae28b2e8__header-content", "header-actions": "b7cb5b9daf3a3b25__header-actions", "header-title": "_8113be94e7caf73c__header-title", "header-visual": "_9a776c7f70996f61__header-visual", "sidebar-toggle-slot": "d5e0920cd15d35bc__sidebar-toggle-slot", "header-subtitle": "_60fea2f6bf5319cd__header-subtitle", "content": "be5e57d029ec4036__content", "has-padding": "_128806d0b26e3a50__has-padding" }; 9435 function Page({ 9436 headingLevel, 9437 breadcrumbs, 9438 badges, 9439 visual, 9440 title, 9441 subTitle, 9442 children, 9443 className, 9444 actions, 9445 ariaLabel, 9446 hasPadding = false, 9447 showSidebarToggle = true 9448 }) { 9449 const classes = clsx_default(style_default6.page, className); 9450 const effectiveAriaLabel = ariaLabel ?? (typeof title === "string" ? title : ""); 9451 return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(navigable_region_default, { className: classes, ariaLabel: effectiveAriaLabel, children: [ 9452 (title || breadcrumbs || badges || actions || visual) && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 9453 Header, 9454 { 9455 headingLevel, 9456 breadcrumbs, 9457 badges, 9458 visual, 9459 title, 9460 subTitle, 9461 actions, 9462 showSidebarToggle 9463 } 9464 ), 9465 hasPadding ? /* @__PURE__ */ (0, import_jsx_runtime24.jsx)( 9466 "div", 9467 { 9468 className: clsx_default( 9469 style_default6.content, 9470 style_default6["has-padding"] 9471 ), 9472 children 9473 } 9474 ) : children 9475 ] }); 9476 } 9477 Page.SidebarToggleFill = SidebarToggleFill; 9478 var page_default = Page; 9479 9480 // routes/font-list/stage.tsx 9481 var import_i18n47 = __toESM(require_i18n()); 9482 var import_components61 = __toESM(require_components()); 9483 var import_editor = __toESM(require_editor()); 9484 var import_core_data12 = __toESM(require_core_data()); 9485 var import_data13 = __toESM(require_data()); 9486 var import_element51 = __toESM(require_element()); 9487 9488 // packages/global-styles-ui/build-module/global-styles-ui.mjs 9489 var import_components60 = __toESM(require_components(), 1); 9490 var import_blocks5 = __toESM(require_blocks(), 1); 9491 var import_data12 = __toESM(require_data(), 1); 9492 var import_block_editor14 = __toESM(require_block_editor(), 1); 9493 var import_element50 = __toESM(require_element(), 1); 9494 var import_compose6 = __toESM(require_compose(), 1); 9495 9496 // packages/global-styles-engine/build-module/utils/object.mjs 9497 function setImmutably(object, path, value) { 9498 path = Array.isArray(path) ? [...path] : [path]; 9499 object = Array.isArray(object) ? [...object] : { ...object }; 9500 const leaf = path.pop(); 9501 let prev = object; 9502 for (const key of path) { 9503 const lvl = prev[key]; 9504 prev = prev[key] = Array.isArray(lvl) ? [...lvl] : { ...lvl }; 9505 } 9506 prev[leaf] = value; 9507 return object; 9508 } 9509 var getValueFromObjectPath = (object, path, defaultValue) => { 9510 const arrayPath = Array.isArray(path) ? path : path.split("."); 9511 let value = object; 9512 arrayPath.forEach((fieldName) => { 9513 value = value?.[fieldName]; 9514 }); 9515 return value ?? defaultValue; 9516 }; 9517 9518 // packages/global-styles-engine/build-module/settings/get-setting.mjs 9519 var VALID_SETTINGS = [ 9520 "appearanceTools", 9521 "useRootPaddingAwareAlignments", 9522 "background.backgroundImage", 9523 "background.backgroundRepeat", 9524 "background.backgroundSize", 9525 "background.backgroundPosition", 9526 "background.gradient", 9527 "border.color", 9528 "border.radius", 9529 "border.radiusSizes", 9530 "border.style", 9531 "border.width", 9532 "shadow.presets", 9533 "shadow.defaultPresets", 9534 "color.background", 9535 "color.button", 9536 "color.caption", 9537 "color.custom", 9538 "color.customDuotone", 9539 "color.customGradient", 9540 "color.defaultDuotone", 9541 "color.defaultGradients", 9542 "color.defaultPalette", 9543 "color.duotone", 9544 "color.gradients", 9545 "color.heading", 9546 "color.link", 9547 "color.palette", 9548 "color.text", 9549 "custom", 9550 "dimensions.aspectRatio", 9551 "dimensions.height", 9552 "dimensions.minHeight", 9553 "dimensions.minWidth", 9554 "dimensions.width", 9555 "dimensions.dimensionSizes", 9556 "layout.contentSize", 9557 "layout.definitions", 9558 "layout.wideSize", 9559 "lightbox.enabled", 9560 "lightbox.allowEditing", 9561 "position.fixed", 9562 "position.sticky", 9563 "spacing.customSpacingSize", 9564 "spacing.defaultSpacingSizes", 9565 "spacing.spacingSizes", 9566 "spacing.spacingScale", 9567 "spacing.blockGap", 9568 "spacing.margin", 9569 "spacing.padding", 9570 "spacing.units", 9571 "typography.fluid", 9572 "typography.customFontSize", 9573 "typography.defaultFontSizes", 9574 "typography.dropCap", 9575 "typography.fontFamilies", 9576 "typography.fontSizes", 9577 "typography.fontStyle", 9578 "typography.fontWeight", 9579 "typography.letterSpacing", 9580 "typography.lineHeight", 9581 "typography.textAlign", 9582 "typography.textColumns", 9583 "typography.textDecoration", 9584 "typography.textIndent", 9585 "typography.textTransform", 9586 "typography.writingMode" 9587 ]; 9588 function getSetting(globalStyles, path, blockName) { 9589 const appendedBlockPath = blockName ? ".blocks." + blockName : ""; 9590 const appendedPropertyPath = path ? "." + path : ""; 9591 const contextualPath = `settings$appendedBlockPath}$appendedPropertyPath}`; 9592 const globalPath = `settings$appendedPropertyPath}`; 9593 if (path) { 9594 return getValueFromObjectPath(globalStyles, contextualPath) ?? getValueFromObjectPath(globalStyles, globalPath); 9595 } 9596 let result = {}; 9597 VALID_SETTINGS.forEach((setting) => { 9598 const value = getValueFromObjectPath( 9599 globalStyles, 9600 `settings$appendedBlockPath}.$setting}` 9601 ) ?? getValueFromObjectPath(globalStyles, `settings.$setting}`); 9602 if (value !== void 0) { 9603 result = setImmutably(result, setting.split("."), value); 9604 } 9605 }); 9606 return result; 9607 } 9608 9609 // packages/global-styles-engine/build-module/settings/set-setting.mjs 9610 function setSetting(globalStyles, path, newValue, blockName) { 9611 const appendedBlockPath = blockName ? ".blocks." + blockName : ""; 9612 const appendedPropertyPath = path ? "." + path : ""; 9613 const finalPath = `settings$appendedBlockPath}$appendedPropertyPath}`; 9614 return setImmutably( 9615 globalStyles, 9616 finalPath.split("."), 9617 newValue 9618 ); 9619 } 9620 9621 // packages/global-styles-engine/build-module/utils/common.mjs 9622 var import_style_engine = __toESM(require_style_engine(), 1); 9623 9624 // packages/global-styles-engine/build-module/utils/fluid.mjs 9625 var DEFAULT_MAXIMUM_VIEWPORT_WIDTH = "1600px"; 9626 var DEFAULT_MINIMUM_VIEWPORT_WIDTH = "320px"; 9627 var DEFAULT_SCALE_FACTOR = 1; 9628 var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN = 0.25; 9629 var DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX = 0.75; 9630 var DEFAULT_MINIMUM_FONT_SIZE_LIMIT = "14px"; 9631 function getComputedFluidTypographyValue({ 9632 minimumFontSize, 9633 maximumFontSize, 9634 fontSize, 9635 minimumViewportWidth = DEFAULT_MINIMUM_VIEWPORT_WIDTH, 9636 maximumViewportWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH, 9637 scaleFactor = DEFAULT_SCALE_FACTOR, 9638 minimumFontSizeLimit 9639 }) { 9640 minimumFontSizeLimit = !!getTypographyValueAndUnit(minimumFontSizeLimit) ? minimumFontSizeLimit : DEFAULT_MINIMUM_FONT_SIZE_LIMIT; 9641 if (fontSize) { 9642 const fontSizeParsed = getTypographyValueAndUnit(fontSize); 9643 if (!fontSizeParsed?.unit || !fontSizeParsed?.value) { 9644 return null; 9645 } 9646 const minimumFontSizeLimitParsed = getTypographyValueAndUnit( 9647 minimumFontSizeLimit, 9648 { 9649 coerceTo: fontSizeParsed.unit 9650 } 9651 ); 9652 if (!!minimumFontSizeLimitParsed?.value && !minimumFontSize && !maximumFontSize) { 9653 if (fontSizeParsed?.value <= minimumFontSizeLimitParsed?.value) { 9654 return null; 9655 } 9656 } 9657 if (!maximumFontSize) { 9658 maximumFontSize = `$fontSizeParsed.value}$fontSizeParsed.unit}`; 9659 } 9660 if (!minimumFontSize) { 9661 const fontSizeValueInPx = fontSizeParsed.unit === "px" ? fontSizeParsed.value : fontSizeParsed.value * 16; 9662 const minimumFontSizeFactor = Math.min( 9663 Math.max( 9664 1 - 0.075 * Math.log2(fontSizeValueInPx), 9665 DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MIN 9666 ), 9667 DEFAULT_MINIMUM_FONT_SIZE_FACTOR_MAX 9668 ); 9669 const calculatedMinimumFontSize = roundToPrecision( 9670 fontSizeParsed.value * minimumFontSizeFactor, 9671 3 9672 ); 9673 if (!!minimumFontSizeLimitParsed?.value && calculatedMinimumFontSize < minimumFontSizeLimitParsed?.value) { 9674 minimumFontSize = `$minimumFontSizeLimitParsed.value}$minimumFontSizeLimitParsed.unit}`; 9675 } else { 9676 minimumFontSize = `$calculatedMinimumFontSize}$fontSizeParsed.unit}`; 9677 } 9678 } 9679 } 9680 const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); 9681 const fontSizeUnit = minimumFontSizeParsed?.unit || "rem"; 9682 const maximumFontSizeParsed = getTypographyValueAndUnit(maximumFontSize, { 9683 coerceTo: fontSizeUnit 9684 }); 9685 if (!minimumFontSizeParsed || !maximumFontSizeParsed) { 9686 return null; 9687 } 9688 const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, { 9689 coerceTo: "rem" 9690 }); 9691 const maximumViewportWidthParsed = getTypographyValueAndUnit( 9692 maximumViewportWidth, 9693 { coerceTo: fontSizeUnit } 9694 ); 9695 const minimumViewportWidthParsed = getTypographyValueAndUnit( 9696 minimumViewportWidth, 9697 { coerceTo: fontSizeUnit } 9698 ); 9699 if (!maximumViewportWidthParsed || !minimumViewportWidthParsed || !minimumFontSizeRem) { 9700 return null; 9701 } 9702 const linearDenominator = maximumViewportWidthParsed.value - minimumViewportWidthParsed.value; 9703 if (!linearDenominator) { 9704 return null; 9705 } 9706 const minViewportWidthOffsetValue = roundToPrecision( 9707 minimumViewportWidthParsed.value / 100, 9708 3 9709 ); 9710 const viewportWidthOffset = roundToPrecision(minViewportWidthOffsetValue, 3) + fontSizeUnit; 9711 const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / linearDenominator); 9712 const linearFactorScaled = roundToPrecision( 9713 (linearFactor || 1) * scaleFactor, 9714 3 9715 ); 9716 const fluidTargetFontSize = `$minimumFontSizeRem.value}$minimumFontSizeRem.unit} + ((1vw - $viewportWidthOffset}) * $linearFactorScaled})`; 9717 return `clamp($minimumFontSize}, $fluidTargetFontSize}, $maximumFontSize})`; 9718 } 9719 function getTypographyValueAndUnit(rawValue, options = {}) { 9720 if (typeof rawValue !== "string" && typeof rawValue !== "number") { 9721 return null; 9722 } 9723 if (isFinite(rawValue)) { 9724 rawValue = `$rawValue}px`; 9725 } 9726 const { coerceTo, rootSizeValue, acceptableUnits } = { 9727 coerceTo: "", 9728 // Default browser font size. Later we could inject some JS to compute this `getComputedStyle( document.querySelector( "html" ) ).fontSize`. 9729 rootSizeValue: 16, 9730 acceptableUnits: ["rem", "px", "em"], 9731 ...options 9732 }; 9733 const acceptableUnitsGroup = acceptableUnits?.join("|"); 9734 const regexUnits = new RegExp( 9735 `^(\\d*\\.?\\d+)($acceptableUnitsGroup}){1,1}$` 9736 ); 9737 const matches = rawValue.toString().match(regexUnits); 9738 if (!matches || matches.length < 3) { 9739 return null; 9740 } 9741 let [, value, unit] = matches; 9742 let returnValue = parseFloat(value); 9743 if ("px" === coerceTo && ("em" === unit || "rem" === unit)) { 9744 returnValue = returnValue * rootSizeValue; 9745 unit = coerceTo; 9746 } 9747 if ("px" === unit && ("em" === coerceTo || "rem" === coerceTo)) { 9748 returnValue = returnValue / rootSizeValue; 9749 unit = coerceTo; 9750 } 9751 if (("em" === coerceTo || "rem" === coerceTo) && ("em" === unit || "rem" === unit)) { 9752 unit = coerceTo; 9753 } 9754 if (!unit) { 9755 return null; 9756 } 9757 return { 9758 value: roundToPrecision(returnValue, 3), 9759 unit 9760 }; 9761 } 9762 function roundToPrecision(value, digits = 3) { 9763 const base = Math.pow(10, digits); 9764 return Math.round(value * base) / base; 9765 } 9766 9767 // packages/global-styles-engine/build-module/utils/typography.mjs 9768 function isFluidTypographyEnabled(typographySettings) { 9769 const fluidSettings = typographySettings?.fluid; 9770 return true === fluidSettings || fluidSettings && typeof fluidSettings === "object" && Object.keys(fluidSettings).length > 0; 9771 } 9772 function getFluidTypographyOptionsFromSettings(settings) { 9773 const typographySettings = settings?.typography ?? {}; 9774 const layoutSettings = settings?.layout; 9775 const defaultMaxViewportWidth = getTypographyValueAndUnit( 9776 layoutSettings?.wideSize 9777 ) ? layoutSettings?.wideSize : null; 9778 return isFluidTypographyEnabled(typographySettings) && defaultMaxViewportWidth ? { 9779 fluid: { 9780 maxViewportWidth: defaultMaxViewportWidth, 9781 ...typeof typographySettings.fluid === "object" ? typographySettings.fluid : {} 9782 } 9783 } : { 9784 fluid: typographySettings?.fluid 9785 }; 9786 } 9787 function getTypographyFontSizeValue(preset, settings) { 9788 const { size: defaultSize } = preset; 9789 if (!defaultSize || "0" === defaultSize || false === preset?.fluid) { 9790 return defaultSize; 9791 } 9792 if (!isFluidTypographyEnabled(settings?.typography) && !isFluidTypographyEnabled(preset)) { 9793 return defaultSize; 9794 } 9795 const fluidTypographySettings = getFluidTypographyOptionsFromSettings(settings)?.fluid ?? {}; 9796 const fluidFontSizeValue = getComputedFluidTypographyValue({ 9797 minimumFontSize: typeof preset?.fluid === "boolean" ? void 0 : preset?.fluid?.min, 9798 maximumFontSize: typeof preset?.fluid === "boolean" ? void 0 : preset?.fluid?.max, 9799 fontSize: defaultSize, 9800 minimumFontSizeLimit: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.minFontSize : void 0, 9801 maximumViewportWidth: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.maxViewportWidth : void 0, 9802 minimumViewportWidth: typeof fluidTypographySettings === "object" ? fluidTypographySettings?.minViewportWidth : void 0 9803 }); 9804 if (!!fluidFontSizeValue) { 9805 return fluidFontSizeValue; 9806 } 9807 return defaultSize; 9808 } 9809 9810 // packages/global-styles-engine/build-module/utils/common.mjs 9811 var PRESET_METADATA = [ 9812 { 9813 path: ["color", "palette"], 9814 valueKey: "color", 9815 cssVarInfix: "color", 9816 classes: [ 9817 { classSuffix: "color", propertyName: "color" }, 9818 { 9819 classSuffix: "background-color", 9820 propertyName: "background-color" 9821 }, 9822 { 9823 classSuffix: "border-color", 9824 propertyName: "border-color" 9825 } 9826 ] 9827 }, 9828 { 9829 path: ["color", "gradients"], 9830 valueKey: "gradient", 9831 cssVarInfix: "gradient", 9832 classes: [ 9833 { 9834 classSuffix: "gradient-background", 9835 propertyName: "background" 9836 } 9837 ] 9838 }, 9839 { 9840 path: ["color", "duotone"], 9841 valueKey: "colors", 9842 cssVarInfix: "duotone", 9843 valueFunc: ({ slug }) => `url( '#wp-duotone-$slug}' )`, 9844 classes: [] 9845 }, 9846 { 9847 path: ["shadow", "presets"], 9848 valueKey: "shadow", 9849 cssVarInfix: "shadow", 9850 classes: [] 9851 }, 9852 { 9853 path: ["typography", "fontSizes"], 9854 valueFunc: (preset, settings) => getTypographyFontSizeValue(preset, settings), 9855 valueKey: "size", 9856 cssVarInfix: "font-size", 9857 classes: [{ classSuffix: "font-size", propertyName: "font-size" }] 9858 }, 9859 { 9860 path: ["typography", "fontFamilies"], 9861 valueKey: "fontFamily", 9862 cssVarInfix: "font-family", 9863 classes: [ 9864 { classSuffix: "font-family", propertyName: "font-family" } 9865 ] 9866 }, 9867 { 9868 path: ["spacing", "spacingSizes"], 9869 valueKey: "size", 9870 cssVarInfix: "spacing", 9871 valueFunc: ({ size: size4 }) => size4, 9872 classes: [] 9873 }, 9874 { 9875 path: ["border", "radiusSizes"], 9876 valueKey: "size", 9877 cssVarInfix: "border-radius", 9878 classes: [] 9879 }, 9880 { 9881 path: ["dimensions", "dimensionSizes"], 9882 valueKey: "size", 9883 cssVarInfix: "dimension", 9884 classes: [] 9885 } 9886 ]; 9887 function findInPresetsBy(settings, blockName, presetPath = [], presetProperty = "slug", presetValueValue) { 9888 const orderedPresetsByOrigin = [ 9889 blockName ? getValueFromObjectPath(settings, [ 9890 "blocks", 9891 blockName, 9892 ...presetPath 9893 ]) : void 0, 9894 getValueFromObjectPath(settings, presetPath) 9895 ].filter(Boolean); 9896 for (const presetByOrigin of orderedPresetsByOrigin) { 9897 if (presetByOrigin) { 9898 const origins = ["custom", "theme", "default"]; 9899 for (const origin of origins) { 9900 const presets = presetByOrigin[origin]; 9901 if (presets) { 9902 const presetObject = presets.find( 9903 (preset) => preset[presetProperty] === presetValueValue 9904 ); 9905 if (presetObject) { 9906 if (presetProperty === "slug") { 9907 return presetObject; 9908 } 9909 const highestPresetObjectWithSameSlug = findInPresetsBy( 9910 settings, 9911 blockName, 9912 presetPath, 9913 "slug", 9914 presetObject.slug 9915 ); 9916 if (highestPresetObjectWithSameSlug[presetProperty] === presetObject[presetProperty]) { 9917 return presetObject; 9918 } 9919 return void 0; 9920 } 9921 } 9922 } 9923 } 9924 } 9925 } 9926 function getValueFromPresetVariable(features, blockName, variable, [presetType, slug] = []) { 9927 const metadata = PRESET_METADATA.find( 9928 (data) => data.cssVarInfix === presetType 9929 ); 9930 if (!metadata || !features.settings) { 9931 return variable; 9932 } 9933 const presetObject = findInPresetsBy( 9934 features.settings, 9935 blockName, 9936 metadata.path, 9937 "slug", 9938 slug 9939 ); 9940 if (presetObject) { 9941 const { valueKey } = metadata; 9942 const result = presetObject[valueKey]; 9943 return getValueFromVariable(features, blockName, result); 9944 } 9945 return variable; 9946 } 9947 function getValueFromCustomVariable(features, blockName, variable, path = []) { 9948 const result = (blockName ? getValueFromObjectPath(features?.settings ?? {}, [ 9949 "blocks", 9950 blockName, 9951 "custom", 9952 ...path 9953 ]) : void 0) ?? getValueFromObjectPath(features?.settings ?? {}, [ 9954 "custom", 9955 ...path 9956 ]); 9957 if (!result) { 9958 return variable; 9959 } 9960 return getValueFromVariable(features, blockName, result); 9961 } 9962 function getValueFromVariable(features, blockName, variable) { 9963 if (!variable || typeof variable !== "string") { 9964 if (typeof variable === "object" && variable !== null && "ref" in variable && typeof variable.ref === "string") { 9965 const resolvedVariable = getValueFromObjectPath( 9966 features, 9967 variable.ref 9968 ); 9969 if (!resolvedVariable || typeof resolvedVariable === "object" && "ref" in resolvedVariable) { 9970 return resolvedVariable; 9971 } 9972 variable = resolvedVariable; 9973 } else { 9974 return variable; 9975 } 9976 } 9977 const USER_VALUE_PREFIX = "var:"; 9978 const THEME_VALUE_PREFIX = "var(--wp--"; 9979 const THEME_VALUE_SUFFIX = ")"; 9980 let parsedVar; 9981 if (variable.startsWith(USER_VALUE_PREFIX)) { 9982 parsedVar = variable.slice(USER_VALUE_PREFIX.length).split("|"); 9983 } else if (variable.startsWith(THEME_VALUE_PREFIX) && variable.endsWith(THEME_VALUE_SUFFIX)) { 9984 parsedVar = variable.slice(THEME_VALUE_PREFIX.length, -THEME_VALUE_SUFFIX.length).split("--"); 9985 } else { 9986 return variable; 9987 } 9988 const [type, ...path] = parsedVar; 9989 if (type === "preset") { 9990 return getValueFromPresetVariable( 9991 features, 9992 blockName, 9993 variable, 9994 path 9995 ); 9996 } 9997 if (type === "custom") { 9998 return getValueFromCustomVariable( 9999 features, 10000 blockName, 10001 variable, 10002 path 10003 ); 10004 } 10005 return variable; 10006 } 10007 10008 // packages/global-styles-engine/build-module/settings/get-style.mjs 10009 function getStyle(globalStyles, path, blockName, shouldDecodeEncode = true) { 10010 const appendedPath = path ? "." + path : ""; 10011 const finalPath = !blockName ? `styles$appendedPath}` : `styles.blocks.$blockName}$appendedPath}`; 10012 if (!globalStyles) { 10013 return void 0; 10014 } 10015 const rawResult = getValueFromObjectPath(globalStyles, finalPath); 10016 const result = shouldDecodeEncode ? getValueFromVariable(globalStyles, blockName, rawResult) : rawResult; 10017 return result; 10018 } 10019 10020 // packages/global-styles-engine/build-module/settings/set-style.mjs 10021 function setStyle(globalStyles, path, newValue, blockName) { 10022 const appendedPath = path ? "." + path : ""; 10023 const finalPath = !blockName ? `styles$appendedPath}` : `styles.blocks.$blockName}$appendedPath}`; 10024 return setImmutably( 10025 globalStyles, 10026 finalPath.split("."), 10027 newValue 10028 ); 10029 } 10030 10031 // packages/global-styles-engine/build-module/core/equal.mjs 10032 var import_es6 = __toESM(require_es6(), 1); 10033 function areGlobalStylesEqual(original, variation) { 10034 if (typeof original !== "object" || typeof variation !== "object") { 10035 return original === variation; 10036 } 10037 return (0, import_es6.default)(original?.styles, variation?.styles) && (0, import_es6.default)(original?.settings, variation?.settings); 10038 } 10039 10040 // packages/global-styles-engine/build-module/core/merge.mjs 10041 var import_deepmerge = __toESM(require_cjs(), 1); 10042 10043 // node_modules/is-plain-object/dist/is-plain-object.mjs 10044 function isObject(o3) { 10045 return Object.prototype.toString.call(o3) === "[object Object]"; 10046 } 10047 function isPlainObject(o3) { 10048 var ctor, prot; 10049 if (isObject(o3) === false) return false; 10050 ctor = o3.constructor; 10051 if (ctor === void 0) return true; 10052 prot = ctor.prototype; 10053 if (isObject(prot) === false) return false; 10054 if (prot.hasOwnProperty("isPrototypeOf") === false) { 10055 return false; 10056 } 10057 return true; 10058 } 10059 10060 // packages/global-styles-engine/build-module/core/merge.mjs 10061 function mergeGlobalStyles(base, user) { 10062 return (0, import_deepmerge.default)(base, user, { 10063 /* 10064 * We only pass as arrays the presets, 10065 * in which case we want the new array of values 10066 * to override the old array (no merging). 10067 */ 10068 isMergeableObject: isPlainObject, 10069 /* 10070 * Exceptions to the above rule. 10071 * Background images should be replaced, not merged, 10072 * as they themselves are specific object definitions for the style. 10073 */ 10074 customMerge: (key) => { 10075 if (key === "backgroundImage") { 10076 return (baseConfig, userConfig) => userConfig ?? baseConfig; 10077 } 10078 return void 0; 10079 } 10080 }); 10081 } 10082 10083 // node_modules/colord/index.mjs 10084 var r2 = { grad: 0.9, turn: 360, rad: 360 / (2 * Math.PI) }; 10085 var t = function(r3) { 10086 return "string" == typeof r3 ? r3.length > 0 : "number" == typeof r3; 10087 }; 10088 var n = function(r3, t3, n2) { 10089 return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = Math.pow(10, t3)), Math.round(n2 * r3) / n2 + 0; 10090 }; 10091 var e = function(r3, t3, n2) { 10092 return void 0 === t3 && (t3 = 0), void 0 === n2 && (n2 = 1), r3 > n2 ? n2 : r3 > t3 ? r3 : t3; 10093 }; 10094 var u = function(r3) { 10095 return (r3 = isFinite(r3) ? r3 % 360 : 0) > 0 ? r3 : r3 + 360; 10096 }; 10097 var a = function(r3) { 10098 return { r: e(r3.r, 0, 255), g: e(r3.g, 0, 255), b: e(r3.b, 0, 255), a: e(r3.a) }; 10099 }; 10100 var o = function(r3) { 10101 return { r: n(r3.r), g: n(r3.g), b: n(r3.b), a: n(r3.a, 3) }; 10102 }; 10103 var i = /^#([0-9a-f]{3,8})$/i; 10104 var s = function(r3) { 10105 var t3 = r3.toString(16); 10106 return t3.length < 2 ? "0" + t3 : t3; 10107 }; 10108 var h = function(r3) { 10109 var t3 = r3.r, n2 = r3.g, e2 = r3.b, u2 = r3.a, a2 = Math.max(t3, n2, e2), o3 = a2 - Math.min(t3, n2, e2), i2 = o3 ? a2 === t3 ? (n2 - e2) / o3 : a2 === n2 ? 2 + (e2 - t3) / o3 : 4 + (t3 - n2) / o3 : 0; 10110 return { h: 60 * (i2 < 0 ? i2 + 6 : i2), s: a2 ? o3 / a2 * 100 : 0, v: a2 / 255 * 100, a: u2 }; 10111 }; 10112 var b = function(r3) { 10113 var t3 = r3.h, n2 = r3.s, e2 = r3.v, u2 = r3.a; 10114 t3 = t3 / 360 * 6, n2 /= 100, e2 /= 100; 10115 var a2 = Math.floor(t3), o3 = e2 * (1 - n2), i2 = e2 * (1 - (t3 - a2) * n2), s2 = e2 * (1 - (1 - t3 + a2) * n2), h2 = a2 % 6; 10116 return { r: 255 * [e2, i2, o3, o3, s2, e2][h2], g: 255 * [s2, e2, e2, i2, o3, o3][h2], b: 255 * [o3, o3, s2, e2, e2, i2][h2], a: u2 }; 10117 }; 10118 var g = function(r3) { 10119 return { h: u(r3.h), s: e(r3.s, 0, 100), l: e(r3.l, 0, 100), a: e(r3.a) }; 10120 }; 10121 var d = function(r3) { 10122 return { h: n(r3.h), s: n(r3.s), l: n(r3.l), a: n(r3.a, 3) }; 10123 }; 10124 var f = function(r3) { 10125 return b((n2 = (t3 = r3).s, { h: t3.h, s: (n2 *= ((e2 = t3.l) < 50 ? e2 : 100 - e2) / 100) > 0 ? 2 * n2 / (e2 + n2) * 100 : 0, v: e2 + n2, a: t3.a })); 10126 var t3, n2, e2; 10127 }; 10128 var c = function(r3) { 10129 return { h: (t3 = h(r3)).h, s: (u2 = (200 - (n2 = t3.s)) * (e2 = t3.v) / 100) > 0 && u2 < 200 ? n2 * e2 / 100 / (u2 <= 100 ? u2 : 200 - u2) * 100 : 0, l: u2 / 2, a: t3.a }; 10130 var t3, n2, e2, u2; 10131 }; 10132 var l = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 10133 var p2 = /^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 10134 var v = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 10135 var m = /^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i; 10136 var y = { string: [[function(r3) { 10137 var t3 = i.exec(r3); 10138 return t3 ? (r3 = t3[1]).length <= 4 ? { r: parseInt(r3[0] + r3[0], 16), g: parseInt(r3[1] + r3[1], 16), b: parseInt(r3[2] + r3[2], 16), a: 4 === r3.length ? n(parseInt(r3[3] + r3[3], 16) / 255, 2) : 1 } : 6 === r3.length || 8 === r3.length ? { r: parseInt(r3.substr(0, 2), 16), g: parseInt(r3.substr(2, 2), 16), b: parseInt(r3.substr(4, 2), 16), a: 8 === r3.length ? n(parseInt(r3.substr(6, 2), 16) / 255, 2) : 1 } : null : null; 10139 }, "hex"], [function(r3) { 10140 var t3 = v.exec(r3) || m.exec(r3); 10141 return t3 ? t3[2] !== t3[4] || t3[4] !== t3[6] ? null : a({ r: Number(t3[1]) / (t3[2] ? 100 / 255 : 1), g: Number(t3[3]) / (t3[4] ? 100 / 255 : 1), b: Number(t3[5]) / (t3[6] ? 100 / 255 : 1), a: void 0 === t3[7] ? 1 : Number(t3[7]) / (t3[8] ? 100 : 1) }) : null; 10142 }, "rgb"], [function(t3) { 10143 var n2 = l.exec(t3) || p2.exec(t3); 10144 if (!n2) return null; 10145 var e2, u2, a2 = g({ h: (e2 = n2[1], u2 = n2[2], void 0 === u2 && (u2 = "deg"), Number(e2) * (r2[u2] || 1)), s: Number(n2[3]), l: Number(n2[4]), a: void 0 === n2[5] ? 1 : Number(n2[5]) / (n2[6] ? 100 : 1) }); 10146 return f(a2); 10147 }, "hsl"]], object: [[function(r3) { 10148 var n2 = r3.r, e2 = r3.g, u2 = r3.b, o3 = r3.a, i2 = void 0 === o3 ? 1 : o3; 10149 return t(n2) && t(e2) && t(u2) ? a({ r: Number(n2), g: Number(e2), b: Number(u2), a: Number(i2) }) : null; 10150 }, "rgb"], [function(r3) { 10151 var n2 = r3.h, e2 = r3.s, u2 = r3.l, a2 = r3.a, o3 = void 0 === a2 ? 1 : a2; 10152 if (!t(n2) || !t(e2) || !t(u2)) return null; 10153 var i2 = g({ h: Number(n2), s: Number(e2), l: Number(u2), a: Number(o3) }); 10154 return f(i2); 10155 }, "hsl"], [function(r3) { 10156 var n2 = r3.h, a2 = r3.s, o3 = r3.v, i2 = r3.a, s2 = void 0 === i2 ? 1 : i2; 10157 if (!t(n2) || !t(a2) || !t(o3)) return null; 10158 var h2 = (function(r4) { 10159 return { h: u(r4.h), s: e(r4.s, 0, 100), v: e(r4.v, 0, 100), a: e(r4.a) }; 10160 })({ h: Number(n2), s: Number(a2), v: Number(o3), a: Number(s2) }); 10161 return b(h2); 10162 }, "hsv"]] }; 10163 var N = function(r3, t3) { 10164 for (var n2 = 0; n2 < t3.length; n2++) { 10165 var e2 = t3[n2][0](r3); 10166 if (e2) return [e2, t3[n2][1]]; 10167 } 10168 return [null, void 0]; 10169 }; 10170 var x = function(r3) { 10171 return "string" == typeof r3 ? N(r3.trim(), y.string) : "object" == typeof r3 && null !== r3 ? N(r3, y.object) : [null, void 0]; 10172 }; 10173 var M = function(r3, t3) { 10174 var n2 = c(r3); 10175 return { h: n2.h, s: e(n2.s + 100 * t3, 0, 100), l: n2.l, a: n2.a }; 10176 }; 10177 var H = function(r3) { 10178 return (299 * r3.r + 587 * r3.g + 114 * r3.b) / 1e3 / 255; 10179 }; 10180 var $ = function(r3, t3) { 10181 var n2 = c(r3); 10182 return { h: n2.h, s: n2.s, l: e(n2.l + 100 * t3, 0, 100), a: n2.a }; 10183 }; 10184 var j = (function() { 10185 function r3(r4) { 10186 this.parsed = x(r4)[0], this.rgba = this.parsed || { r: 0, g: 0, b: 0, a: 1 }; 10187 } 10188 return r3.prototype.isValid = function() { 10189 return null !== this.parsed; 10190 }, r3.prototype.brightness = function() { 10191 return n(H(this.rgba), 2); 10192 }, r3.prototype.isDark = function() { 10193 return H(this.rgba) < 0.5; 10194 }, r3.prototype.isLight = function() { 10195 return H(this.rgba) >= 0.5; 10196 }, r3.prototype.toHex = function() { 10197 return r4 = o(this.rgba), t3 = r4.r, e2 = r4.g, u2 = r4.b, i2 = (a2 = r4.a) < 1 ? s(n(255 * a2)) : "", "#" + s(t3) + s(e2) + s(u2) + i2; 10198 var r4, t3, e2, u2, a2, i2; 10199 }, r3.prototype.toRgb = function() { 10200 return o(this.rgba); 10201 }, r3.prototype.toRgbString = function() { 10202 return r4 = o(this.rgba), t3 = r4.r, n2 = r4.g, e2 = r4.b, (u2 = r4.a) < 1 ? "rgba(" + t3 + ", " + n2 + ", " + e2 + ", " + u2 + ")" : "rgb(" + t3 + ", " + n2 + ", " + e2 + ")"; 10203 var r4, t3, n2, e2, u2; 10204 }, r3.prototype.toHsl = function() { 10205 return d(c(this.rgba)); 10206 }, r3.prototype.toHslString = function() { 10207 return r4 = d(c(this.rgba)), t3 = r4.h, n2 = r4.s, e2 = r4.l, (u2 = r4.a) < 1 ? "hsla(" + t3 + ", " + n2 + "%, " + e2 + "%, " + u2 + ")" : "hsl(" + t3 + ", " + n2 + "%, " + e2 + "%)"; 10208 var r4, t3, n2, e2, u2; 10209 }, r3.prototype.toHsv = function() { 10210 return r4 = h(this.rgba), { h: n(r4.h), s: n(r4.s), v: n(r4.v), a: n(r4.a, 3) }; 10211 var r4; 10212 }, r3.prototype.invert = function() { 10213 return w({ r: 255 - (r4 = this.rgba).r, g: 255 - r4.g, b: 255 - r4.b, a: r4.a }); 10214 var r4; 10215 }, r3.prototype.saturate = function(r4) { 10216 return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, r4)); 10217 }, r3.prototype.desaturate = function(r4) { 10218 return void 0 === r4 && (r4 = 0.1), w(M(this.rgba, -r4)); 10219 }, r3.prototype.grayscale = function() { 10220 return w(M(this.rgba, -1)); 10221 }, r3.prototype.lighten = function(r4) { 10222 return void 0 === r4 && (r4 = 0.1), w($(this.rgba, r4)); 10223 }, r3.prototype.darken = function(r4) { 10224 return void 0 === r4 && (r4 = 0.1), w($(this.rgba, -r4)); 10225 }, r3.prototype.rotate = function(r4) { 10226 return void 0 === r4 && (r4 = 15), this.hue(this.hue() + r4); 10227 }, r3.prototype.alpha = function(r4) { 10228 return "number" == typeof r4 ? w({ r: (t3 = this.rgba).r, g: t3.g, b: t3.b, a: r4 }) : n(this.rgba.a, 3); 10229 var t3; 10230 }, r3.prototype.hue = function(r4) { 10231 var t3 = c(this.rgba); 10232 return "number" == typeof r4 ? w({ h: r4, s: t3.s, l: t3.l, a: t3.a }) : n(t3.h); 10233 }, r3.prototype.isEqual = function(r4) { 10234 return this.toHex() === w(r4).toHex(); 10235 }, r3; 10236 })(); 10237 var w = function(r3) { 10238 return r3 instanceof j ? r3 : new j(r3); 10239 }; 10240 var S = []; 10241 var k = function(r3) { 10242 r3.forEach(function(r4) { 10243 S.indexOf(r4) < 0 && (r4(j, y), S.push(r4)); 10244 }); 10245 }; 10246 10247 // packages/global-styles-ui/build-module/provider.mjs 10248 var import_element20 = __toESM(require_element(), 1); 10249 10250 // packages/global-styles-ui/build-module/context.mjs 10251 var import_element19 = __toESM(require_element(), 1); 10252 var GlobalStylesContext = (0, import_element19.createContext)({ 10253 user: { styles: {}, settings: {} }, 10254 base: { styles: {}, settings: {} }, 10255 merged: { styles: {}, settings: {} }, 10256 onChange: () => { 10257 }, 10258 fontLibraryEnabled: false 10259 }); 10260 10261 // packages/global-styles-ui/build-module/provider.mjs 10262 var import_jsx_runtime25 = __toESM(require_jsx_runtime(), 1); 10263 function GlobalStylesProvider({ 10264 children, 10265 value, 10266 baseValue, 10267 onChange, 10268 fontLibraryEnabled 10269 }) { 10270 const merged = (0, import_element20.useMemo)(() => { 10271 return mergeGlobalStyles(baseValue, value); 10272 }, [baseValue, value]); 10273 const contextValue = (0, import_element20.useMemo)( 10274 () => ({ 10275 user: value, 10276 base: baseValue, 10277 merged, 10278 onChange, 10279 fontLibraryEnabled 10280 }), 10281 [value, baseValue, merged, onChange, fontLibraryEnabled] 10282 ); 10283 return /* @__PURE__ */ (0, import_jsx_runtime25.jsx)(GlobalStylesContext.Provider, { value: contextValue, children }); 10284 } 10285 10286 // packages/global-styles-ui/build-module/screen-root.mjs 10287 var import_components8 = __toESM(require_components(), 1); 10288 var import_i18n5 = __toESM(require_i18n(), 1); 10289 var import_data2 = __toESM(require_data(), 1); 10290 var import_core_data2 = __toESM(require_core_data(), 1); 10291 10292 // packages/global-styles-ui/build-module/icon-with-current-color.mjs 10293 var import_jsx_runtime26 = __toESM(require_jsx_runtime(), 1); 10294 function IconWithCurrentColor({ 10295 className, 10296 ...props 10297 }) { 10298 return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)( 10299 icon_default, 10300 { 10301 className: clsx_default( 10302 className, 10303 "global-styles-ui-icon-with-current-color" 10304 ), 10305 ...props 10306 } 10307 ); 10308 } 10309 10310 // packages/global-styles-ui/build-module/navigation-button.mjs 10311 var import_components2 = __toESM(require_components(), 1); 10312 var import_jsx_runtime27 = __toESM(require_jsx_runtime(), 1); 10313 function GenericNavigationButton({ 10314 icon, 10315 children, 10316 ...props 10317 }) { 10318 return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_components2.__experimentalItem, { ...props, children: [ 10319 icon && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_components2.__experimentalHStack, { justify: "flex-start", children: [ 10320 /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(IconWithCurrentColor, { icon, size: 24 }), 10321 /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components2.FlexItem, { children }) 10322 ] }), 10323 !icon && children 10324 ] }); 10325 } 10326 function NavigationButtonAsItem(props) { 10327 return /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(import_components2.Navigator.Button, { as: GenericNavigationButton, ...props }); 10328 } 10329 10330 // packages/global-styles-ui/build-module/root-menu.mjs 10331 var import_components3 = __toESM(require_components(), 1); 10332 var import_i18n3 = __toESM(require_i18n(), 1); 10333 var import_block_editor = __toESM(require_block_editor(), 1); 10334 10335 // node_modules/colord/plugins/a11y.mjs 10336 var o2 = function(o3) { 10337 var t3 = o3 / 255; 10338 return t3 < 0.04045 ? t3 / 12.92 : Math.pow((t3 + 0.055) / 1.055, 2.4); 10339 }; 10340 var t2 = function(t3) { 10341 return 0.2126 * o2(t3.r) + 0.7152 * o2(t3.g) + 0.0722 * o2(t3.b); 10342 }; 10343 function a11y_default(o3) { 10344 o3.prototype.luminance = function() { 10345 return o4 = t2(this.rgba), void 0 === (r3 = 2) && (r3 = 0), void 0 === n2 && (n2 = Math.pow(10, r3)), Math.round(n2 * o4) / n2 + 0; 10346 var o4, r3, n2; 10347 }, o3.prototype.contrast = function(r3) { 10348 void 0 === r3 && (r3 = "#FFF"); 10349 var n2, a2, i2, e2, v2, u2, d2, c2 = r3 instanceof o3 ? r3 : new o3(r3); 10350 return e2 = this.rgba, v2 = c2.toRgb(), u2 = t2(e2), d2 = t2(v2), n2 = u2 > d2 ? (u2 + 0.05) / (d2 + 0.05) : (d2 + 0.05) / (u2 + 0.05), void 0 === (a2 = 2) && (a2 = 0), void 0 === i2 && (i2 = Math.pow(10, a2)), Math.floor(i2 * n2) / i2 + 0; 10351 }, o3.prototype.isReadable = function(o4, t3) { 10352 return void 0 === o4 && (o4 = "#FFF"), void 0 === t3 && (t3 = {}), this.contrast(o4) >= (e2 = void 0 === (i2 = (r3 = t3).size) ? "normal" : i2, "AAA" === (a2 = void 0 === (n2 = r3.level) ? "AA" : n2) && "normal" === e2 ? 7 : "AA" === a2 && "large" === e2 ? 3 : 4.5); 10353 var r3, n2, a2, i2, e2; 10354 }; 10355 } 10356 10357 // packages/global-styles-ui/build-module/hooks.mjs 10358 var import_element21 = __toESM(require_element(), 1); 10359 var import_data = __toESM(require_data(), 1); 10360 var import_core_data = __toESM(require_core_data(), 1); 10361 var import_i18n2 = __toESM(require_i18n(), 1); 10362 10363 // packages/global-styles-ui/build-module/utils.mjs 10364 var import_i18n = __toESM(require_i18n(), 1); 10365 var VALID_ELEMENT_STATES = { 10366 link: [ 10367 { value: ":link", label: (0, import_i18n.__)("Link") }, 10368 { value: ":any-link", label: (0, import_i18n.__)("Any Link") }, 10369 { value: ":visited", label: (0, import_i18n.__)("Visited") }, 10370 { value: ":hover", label: (0, import_i18n.__)("Hover") }, 10371 { value: ":focus", label: (0, import_i18n.__)("Focus") }, 10372 { value: ":focus-visible", label: (0, import_i18n.__)("Focus-visible") }, 10373 { value: ":active", label: (0, import_i18n.__)("Active") } 10374 ], 10375 button: [ 10376 { value: ":link", label: (0, import_i18n.__)("Link") }, 10377 { value: ":any-link", label: (0, import_i18n.__)("Any Link") }, 10378 { value: ":visited", label: (0, import_i18n.__)("Visited") }, 10379 { value: ":hover", label: (0, import_i18n.__)("Hover") }, 10380 { value: ":focus", label: (0, import_i18n.__)("Focus") }, 10381 { value: ":focus-visible", label: (0, import_i18n.__)("Focus-visible") }, 10382 { value: ":active", label: (0, import_i18n.__)("Active") } 10383 ] 10384 }; 10385 var VALID_BLOCK_STATES = { 10386 "core/button": [ 10387 { value: ":hover", label: (0, import_i18n.__)("Hover") }, 10388 { value: ":focus", label: (0, import_i18n.__)("Focus") }, 10389 { value: ":focus-visible", label: (0, import_i18n.__)("Focus-visible") }, 10390 { value: ":active", label: (0, import_i18n.__)("Active") } 10391 ] 10392 }; 10393 var RESPONSIVE_STATES = [ 10394 { value: "tablet", label: (0, import_i18n.__)("Tablet") }, 10395 { value: "mobile", label: (0, import_i18n.__)("Mobile") } 10396 ]; 10397 function removePropertiesFromObject(object, properties) { 10398 if (!properties?.length) { 10399 return object; 10400 } 10401 if (typeof object !== "object" || !object || !Object.keys(object).length) { 10402 return object; 10403 } 10404 for (const key in object) { 10405 if (properties.includes(key)) { 10406 delete object[key]; 10407 } else if (typeof object[key] === "object") { 10408 removePropertiesFromObject(object[key], properties); 10409 } 10410 } 10411 return object; 10412 } 10413 var filterObjectByProperties = (object, properties) => { 10414 if (!object || !properties?.length) { 10415 return {}; 10416 } 10417 const newObject = {}; 10418 Object.keys(object).forEach((key) => { 10419 if (properties.includes(key)) { 10420 newObject[key] = object[key]; 10421 } else if (typeof object[key] === "object") { 10422 const newFilter = filterObjectByProperties( 10423 object[key], 10424 properties 10425 ); 10426 if (Object.keys(newFilter).length) { 10427 newObject[key] = newFilter; 10428 } 10429 } 10430 }); 10431 return newObject; 10432 }; 10433 function isVariationWithProperties(variation, properties) { 10434 const variationWithProperties = filterObjectByProperties( 10435 structuredClone(variation), 10436 properties 10437 ); 10438 return areGlobalStylesEqual(variationWithProperties, variation); 10439 } 10440 function getFontFamilyFromSetting(fontFamilies, setting) { 10441 if (!Array.isArray(fontFamilies) || !setting) { 10442 return null; 10443 } 10444 const fontFamilyVariable = setting.replace("var(", "").replace(")", ""); 10445 const fontFamilySlug = fontFamilyVariable?.split("--").slice(-1)[0]; 10446 return fontFamilies.find( 10447 (fontFamily) => fontFamily.slug === fontFamilySlug 10448 ); 10449 } 10450 function getFontFamilies(themeJson) { 10451 const themeFontFamilies = themeJson?.settings?.typography?.fontFamilies?.theme; 10452 const customFontFamilies = themeJson?.settings?.typography?.fontFamilies?.custom; 10453 let fontFamilies = []; 10454 if (themeFontFamilies && customFontFamilies) { 10455 fontFamilies = [...themeFontFamilies, ...customFontFamilies]; 10456 } else if (themeFontFamilies) { 10457 fontFamilies = themeFontFamilies; 10458 } else if (customFontFamilies) { 10459 fontFamilies = customFontFamilies; 10460 } 10461 const bodyFontFamilySetting = themeJson?.styles?.typography?.fontFamily; 10462 const bodyFontFamily = getFontFamilyFromSetting( 10463 fontFamilies, 10464 bodyFontFamilySetting 10465 ); 10466 const headingFontFamilySetting = themeJson?.styles?.elements?.heading?.typography?.fontFamily; 10467 let headingFontFamily; 10468 if (!headingFontFamilySetting) { 10469 headingFontFamily = bodyFontFamily; 10470 } else { 10471 headingFontFamily = getFontFamilyFromSetting( 10472 fontFamilies, 10473 themeJson?.styles?.elements?.heading?.typography?.fontFamily 10474 ); 10475 } 10476 return [bodyFontFamily, headingFontFamily]; 10477 } 10478 10479 // packages/global-styles-ui/build-module/hooks.mjs 10480 k([a11y_default]); 10481 function useStyle(path, blockName, readFrom = "merged", shouldDecodeEncode = true, state) { 10482 const { user, base, merged, onChange } = (0, import_element21.useContext)(GlobalStylesContext); 10483 const statePathParts = state?.split(".").filter(Boolean) ?? []; 10484 const pseudoSelectorState = statePathParts.find( 10485 (value) => value.startsWith(":") 10486 ); 10487 const statePathWithoutPseudo = statePathParts.filter((value) => !value.startsWith(":")).join("."); 10488 const stylePath = [path, statePathWithoutPseudo].filter(Boolean).join("."); 10489 let sourceValue = merged; 10490 if (readFrom === "base") { 10491 sourceValue = base; 10492 } else if (readFrom === "user") { 10493 sourceValue = user; 10494 } 10495 const styleValue = (0, import_element21.useMemo)(() => { 10496 const rawValue = getStyle( 10497 sourceValue, 10498 stylePath, 10499 blockName, 10500 shouldDecodeEncode 10501 ); 10502 if (pseudoSelectorState) { 10503 return rawValue?.[pseudoSelectorState] ?? {}; 10504 } 10505 return rawValue; 10506 }, [ 10507 sourceValue, 10508 stylePath, 10509 blockName, 10510 shouldDecodeEncode, 10511 pseudoSelectorState 10512 ]); 10513 const setStyleValue = (0, import_element21.useCallback)( 10514 (newValue) => { 10515 let valueToSet = newValue; 10516 if (pseudoSelectorState) { 10517 const fullCurrentValue = getStyle( 10518 user, 10519 stylePath, 10520 blockName, 10521 false 10522 ); 10523 valueToSet = { 10524 ...fullCurrentValue, 10525 [pseudoSelectorState]: newValue 10526 }; 10527 } 10528 const newGlobalStyles = setStyle( 10529 user, 10530 stylePath, 10531 valueToSet, 10532 blockName 10533 ); 10534 onChange(newGlobalStyles); 10535 }, 10536 [user, onChange, stylePath, blockName, pseudoSelectorState] 10537 ); 10538 return [styleValue, setStyleValue]; 10539 } 10540 function useSetting(path, blockName, readFrom = "merged") { 10541 const { user, base, merged, onChange } = (0, import_element21.useContext)(GlobalStylesContext); 10542 let sourceValue = merged; 10543 if (readFrom === "base") { 10544 sourceValue = base; 10545 } else if (readFrom === "user") { 10546 sourceValue = user; 10547 } 10548 const settingValue = (0, import_element21.useMemo)( 10549 () => getSetting(sourceValue, path, blockName), 10550 [sourceValue, path, blockName] 10551 ); 10552 const setSettingValue = (0, import_element21.useCallback)( 10553 (newValue) => { 10554 const newGlobalStyles = setSetting( 10555 user, 10556 path, 10557 newValue, 10558 blockName 10559 ); 10560 onChange(newGlobalStyles); 10561 }, 10562 [user, onChange, path, blockName] 10563 ); 10564 return [settingValue, setSettingValue]; 10565 } 10566 var EMPTY_ARRAY2 = []; 10567 function hasThemeVariation({ 10568 title, 10569 settings, 10570 styles 10571 }) { 10572 return title === (0, import_i18n2.__)("Default") || Object.keys(settings || {}).length > 0 || Object.keys(styles || {}).length > 0; 10573 } 10574 function useCurrentMergeThemeStyleVariationsWithUserConfig(properties = []) { 10575 const { variationsFromTheme } = (0, import_data.useSelect)((select) => { 10576 const _variationsFromTheme = select( 10577 import_core_data.store 10578 ).__experimentalGetCurrentThemeGlobalStylesVariations?.(); 10579 return { 10580 variationsFromTheme: _variationsFromTheme || EMPTY_ARRAY2 10581 }; 10582 }, []); 10583 const { user: userVariation } = (0, import_element21.useContext)(GlobalStylesContext); 10584 return (0, import_element21.useMemo)(() => { 10585 const clonedUserVariation = structuredClone(userVariation); 10586 const userVariationWithoutProperties = removePropertiesFromObject( 10587 clonedUserVariation, 10588 properties 10589 ); 10590 userVariationWithoutProperties.title = (0, import_i18n2.__)("Default"); 10591 const variationsWithPropertiesAndBase = variationsFromTheme.filter((variation) => { 10592 return isVariationWithProperties(variation, properties); 10593 }).map((variation) => { 10594 return mergeGlobalStyles( 10595 userVariationWithoutProperties, 10596 variation 10597 ); 10598 }); 10599 const variationsByProperties = [ 10600 userVariationWithoutProperties, 10601 ...variationsWithPropertiesAndBase 10602 ]; 10603 return variationsByProperties?.length ? variationsByProperties.filter(hasThemeVariation) : []; 10604 }, [properties, userVariation, variationsFromTheme]); 10605 } 10606 10607 // packages/global-styles-ui/build-module/lock-unlock.mjs 10608 var import_private_apis2 = __toESM(require_private_apis(), 1); 10609 var { lock: lock2, unlock: unlock2 } = (0, import_private_apis2.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 10610 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 10611 "@wordpress/global-styles-ui" 10612 ); 10613 10614 // packages/global-styles-ui/build-module/root-menu.mjs 10615 var import_jsx_runtime28 = __toESM(require_jsx_runtime(), 1); 10616 var { 10617 useHasDimensionsPanel, 10618 useHasTypographyPanel, 10619 useHasColorPanel, 10620 useSettingsForBlockElement, 10621 useHasBackgroundPanel 10622 } = unlock2(import_block_editor.privateApis); 10623 10624 // packages/global-styles-ui/build-module/preview-styles.mjs 10625 var import_components7 = __toESM(require_components(), 1); 10626 10627 // packages/global-styles-ui/build-module/preview-hooks.mjs 10628 function useStylesPreviewColors() { 10629 const [textColor = "black"] = useStyle("color.text"); 10630 const [backgroundColor = "white"] = useStyle("color.background"); 10631 const [headingColor = textColor] = useStyle( 10632 "elements.h1.color.text" 10633 ); 10634 const [linkColor = headingColor] = useStyle( 10635 "elements.link.color.text" 10636 ); 10637 const [buttonBackgroundColor = linkColor] = useStyle( 10638 "elements.button.color.background" 10639 ); 10640 const [coreColors] = useSetting("color.palette.core") || []; 10641 const [themeColors] = useSetting("color.palette.theme") || []; 10642 const [customColors] = useSetting("color.palette.custom") || []; 10643 const paletteColors = (themeColors ?? []).concat(customColors ?? []).concat(coreColors ?? []); 10644 const textColorObject = paletteColors.filter( 10645 ({ color }) => color === textColor 10646 ); 10647 const buttonBackgroundColorObject = paletteColors.filter( 10648 ({ color }) => color === buttonBackgroundColor 10649 ); 10650 const highlightedColors = textColorObject.concat(buttonBackgroundColorObject).concat(paletteColors).filter( 10651 // we exclude these background color because it is already visible in the preview. 10652 ({ color }) => color !== backgroundColor 10653 ).slice(0, 2); 10654 return { 10655 paletteColors, 10656 highlightedColors 10657 }; 10658 } 10659 10660 // packages/global-styles-ui/build-module/typography-example.mjs 10661 var import_element22 = __toESM(require_element(), 1); 10662 var import_components4 = __toESM(require_components(), 1); 10663 var import_i18n4 = __toESM(require_i18n(), 1); 10664 10665 // packages/global-styles-ui/build-module/font-library/utils/preview-styles.mjs 10666 function findNearest(input, numbers) { 10667 if (numbers.length === 0) { 10668 return null; 10669 } 10670 numbers.sort((a2, b2) => Math.abs(input - a2) - Math.abs(input - b2)); 10671 return numbers[0]; 10672 } 10673 function extractFontWeights(fontFaces) { 10674 const result = []; 10675 fontFaces.forEach((face) => { 10676 const weights = String(face.fontWeight).split(" "); 10677 if (weights.length === 2) { 10678 const start = parseInt(weights[0]); 10679 const end = parseInt(weights[1]); 10680 for (let i2 = start; i2 <= end; i2 += 100) { 10681 result.push(i2); 10682 } 10683 } else if (weights.length === 1) { 10684 result.push(parseInt(weights[0])); 10685 } 10686 }); 10687 return result; 10688 } 10689 function formatFontFamily(input) { 10690 const regex = /^(?!generic\([ a-zA-Z\-]+\)$)(?!^[a-zA-Z\-]+$).+/; 10691 const output = input.trim(); 10692 const formatItem = (item) => { 10693 item = item.trim(); 10694 if (item.match(regex)) { 10695 item = item.replace(/^["']|["']$/g, ""); 10696 return `"$item}"`; 10697 } 10698 return item; 10699 }; 10700 if (output.includes(",")) { 10701 return output.split(",").map(formatItem).filter((item) => item !== "").join(", "); 10702 } 10703 return formatItem(output); 10704 } 10705 function formatFontFaceName(input) { 10706 if (!input) { 10707 return ""; 10708 } 10709 let output = input.trim(); 10710 if (output.includes(",")) { 10711 output = (output.split(",").find((item) => item.trim() !== "") ?? "").trim(); 10712 } 10713 output = output.replace(/^["']|["']$/g, ""); 10714 if (window.navigator.userAgent.toLowerCase().includes("firefox")) { 10715 output = `"$output}"`; 10716 } 10717 return output; 10718 } 10719 function getFamilyPreviewStyle(family) { 10720 const style = { 10721 fontFamily: formatFontFamily(family.fontFamily) 10722 }; 10723 if (!("fontFace" in family) || !Array.isArray(family.fontFace)) { 10724 style.fontWeight = "400"; 10725 style.fontStyle = "normal"; 10726 return style; 10727 } 10728 if (family.fontFace) { 10729 const normalFaces = family.fontFace.filter( 10730 (face) => face?.fontStyle && face.fontStyle.toLowerCase() === "normal" 10731 ); 10732 if (normalFaces.length > 0) { 10733 style.fontStyle = "normal"; 10734 const normalWeights = extractFontWeights(normalFaces); 10735 const nearestWeight = findNearest(400, normalWeights); 10736 style.fontWeight = String(nearestWeight) || "400"; 10737 } else { 10738 style.fontStyle = family.fontFace.length && family.fontFace[0].fontStyle || "normal"; 10739 style.fontWeight = family.fontFace.length && String(family.fontFace[0].fontWeight) || "400"; 10740 } 10741 } 10742 return style; 10743 } 10744 function getFacePreviewStyle(face) { 10745 return { 10746 fontFamily: formatFontFamily(face.fontFamily), 10747 fontStyle: face.fontStyle || "normal", 10748 fontWeight: face.fontWeight || "400" 10749 }; 10750 } 10751 10752 // packages/global-styles-ui/build-module/typography-example.mjs 10753 var import_jsx_runtime29 = __toESM(require_jsx_runtime(), 1); 10754 function PreviewTypography({ 10755 fontSize, 10756 variation 10757 }) { 10758 const { base } = (0, import_element22.useContext)(GlobalStylesContext); 10759 let config = base; 10760 if (variation) { 10761 config = { ...base, ...variation }; 10762 } 10763 const [textColor] = useStyle("color.text"); 10764 const [bodyFontFamilies, headingFontFamilies] = getFontFamilies(config); 10765 const bodyPreviewStyle = bodyFontFamilies ? getFamilyPreviewStyle(bodyFontFamilies) : {}; 10766 const headingPreviewStyle = headingFontFamilies ? getFamilyPreviewStyle(headingFontFamilies) : {}; 10767 if (textColor) { 10768 bodyPreviewStyle.color = textColor; 10769 headingPreviewStyle.color = textColor; 10770 } 10771 if (fontSize) { 10772 bodyPreviewStyle.fontSize = fontSize; 10773 headingPreviewStyle.fontSize = fontSize; 10774 } 10775 return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)( 10776 import_components4.__unstableMotion.div, 10777 { 10778 animate: { 10779 scale: 1, 10780 opacity: 1 10781 }, 10782 initial: { 10783 scale: 0.1, 10784 opacity: 0 10785 }, 10786 transition: { 10787 delay: 0.3, 10788 type: "tween" 10789 }, 10790 style: { 10791 textAlign: "center", 10792 lineHeight: 1 10793 }, 10794 children: [ 10795 /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { style: headingPreviewStyle, children: (0, import_i18n4._x)("A", "Uppercase letter A") }), 10796 /* @__PURE__ */ (0, import_jsx_runtime29.jsx)("span", { style: bodyPreviewStyle, children: (0, import_i18n4._x)("a", "Lowercase letter A") }) 10797 ] 10798 } 10799 ); 10800 } 10801 10802 // packages/global-styles-ui/build-module/highlighted-colors.mjs 10803 var import_components5 = __toESM(require_components(), 1); 10804 var import_jsx_runtime30 = __toESM(require_jsx_runtime(), 1); 10805 function HighlightedColors({ 10806 normalizedColorSwatchSize, 10807 ratio 10808 }) { 10809 const { highlightedColors } = useStylesPreviewColors(); 10810 const scaledSwatchSize = normalizedColorSwatchSize * ratio; 10811 return highlightedColors.map(({ slug, color }, index2) => /* @__PURE__ */ (0, import_jsx_runtime30.jsx)( 10812 import_components5.__unstableMotion.div, 10813 { 10814 style: { 10815 height: scaledSwatchSize, 10816 width: scaledSwatchSize, 10817 background: color, 10818 borderRadius: scaledSwatchSize / 2 10819 }, 10820 animate: { 10821 scale: 1, 10822 opacity: 1 10823 }, 10824 initial: { 10825 scale: 0.1, 10826 opacity: 0 10827 }, 10828 transition: { 10829 delay: index2 === 1 ? 0.2 : 0.1 10830 } 10831 }, 10832 `$slug}-$index2}` 10833 )); 10834 } 10835 10836 // packages/global-styles-ui/build-module/preview-wrapper.mjs 10837 var import_components6 = __toESM(require_components(), 1); 10838 var import_compose = __toESM(require_compose(), 1); 10839 var import_element23 = __toESM(require_element(), 1); 10840 var import_jsx_runtime31 = __toESM(require_jsx_runtime(), 1); 10841 var normalizedWidth = 248; 10842 var normalizedHeight = 152; 10843 var THROTTLE_OPTIONS = { 10844 leading: true, 10845 trailing: true 10846 }; 10847 function PreviewWrapper({ 10848 children, 10849 label, 10850 isFocused, 10851 withHoverView 10852 }) { 10853 const [backgroundColor = "white"] = useStyle("color.background"); 10854 const [gradientValue] = useStyle("color.gradient"); 10855 const disableMotion = (0, import_compose.useReducedMotion)(); 10856 const [isHovered, setIsHovered] = (0, import_element23.useState)(false); 10857 const [containerResizeListener, { width }] = (0, import_compose.useResizeObserver)(); 10858 const [throttledWidth, setThrottledWidthState] = (0, import_element23.useState)(width); 10859 const [ratioState, setRatioState] = (0, import_element23.useState)(); 10860 const setThrottledWidth = (0, import_compose.useThrottle)( 10861 setThrottledWidthState, 10862 250, 10863 THROTTLE_OPTIONS 10864 ); 10865 (0, import_element23.useLayoutEffect)(() => { 10866 if (width) { 10867 setThrottledWidth(width); 10868 } 10869 }, [width, setThrottledWidth]); 10870 (0, import_element23.useLayoutEffect)(() => { 10871 const newRatio = throttledWidth ? throttledWidth / normalizedWidth : 1; 10872 const ratioDiff = newRatio - (ratioState || 0); 10873 const isRatioDiffBigEnough = Math.abs(ratioDiff) > 0.1; 10874 if (isRatioDiffBigEnough || !ratioState) { 10875 setRatioState(newRatio); 10876 } 10877 }, [throttledWidth, ratioState]); 10878 const fallbackRatio = width ? width / normalizedWidth : 1; 10879 const ratio = ratioState ? ratioState : fallbackRatio; 10880 const isReady = !!width; 10881 return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(import_jsx_runtime31.Fragment, { children: [ 10882 /* @__PURE__ */ (0, import_jsx_runtime31.jsx)("div", { style: { position: "relative" }, children: containerResizeListener }), 10883 isReady && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( 10884 "div", 10885 { 10886 className: clsx_default("global-styles-ui-preview__wrapper", { 10887 "is-hoverable": withHoverView 10888 }), 10889 style: { 10890 height: normalizedHeight * ratio 10891 }, 10892 onMouseEnter: () => setIsHovered(true), 10893 onMouseLeave: () => setIsHovered(false), 10894 tabIndex: -1, 10895 children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)( 10896 import_components6.__unstableMotion.div, 10897 { 10898 style: { 10899 height: normalizedHeight * ratio, 10900 width: "100%", 10901 background: gradientValue ?? backgroundColor 10902 }, 10903 initial: "start", 10904 animate: (isHovered || isFocused) && !disableMotion && label ? "hover" : "start", 10905 children: [].concat(children).map( 10906 (child, key) => child({ ratio, key }) 10907 ) 10908 } 10909 ) 10910 } 10911 ) 10912 ] }); 10913 } 10914 var preview_wrapper_default = PreviewWrapper; 10915 10916 // packages/global-styles-ui/build-module/preview-styles.mjs 10917 var import_jsx_runtime32 = __toESM(require_jsx_runtime(), 1); 10918 var firstFrameVariants = { 10919 start: { 10920 scale: 1, 10921 opacity: 1 10922 }, 10923 hover: { 10924 scale: 0, 10925 opacity: 0 10926 } 10927 }; 10928 var midFrameVariants = { 10929 hover: { 10930 opacity: 1 10931 }, 10932 start: { 10933 opacity: 0.5 10934 } 10935 }; 10936 var secondFrameVariants = { 10937 hover: { 10938 scale: 1, 10939 opacity: 1 10940 }, 10941 start: { 10942 scale: 0, 10943 opacity: 0 10944 } 10945 }; 10946 function PreviewStyles({ 10947 label, 10948 isFocused, 10949 withHoverView, 10950 variation 10951 }) { 10952 const [fontWeight] = useStyle("typography.fontWeight"); 10953 const [fontFamily = "serif"] = useStyle( 10954 "typography.fontFamily" 10955 ); 10956 const [headingFontFamily = fontFamily] = useStyle( 10957 "elements.h1.typography.fontFamily" 10958 ); 10959 const [headingFontWeight = fontWeight] = useStyle( 10960 "elements.h1.typography.fontWeight" 10961 ); 10962 const [textColor = "black"] = useStyle("color.text"); 10963 const [headingColor = textColor] = useStyle( 10964 "elements.h1.color.text" 10965 ); 10966 const { paletteColors } = useStylesPreviewColors(); 10967 return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)( 10968 preview_wrapper_default, 10969 { 10970 label, 10971 isFocused, 10972 withHoverView, 10973 children: [ 10974 ({ ratio, key }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 10975 import_components7.__unstableMotion.div, 10976 { 10977 variants: firstFrameVariants, 10978 style: { 10979 height: "100%", 10980 overflow: "hidden" 10981 }, 10982 children: /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)( 10983 import_components7.__experimentalHStack, 10984 { 10985 spacing: 10 * ratio, 10986 justify: "center", 10987 style: { 10988 height: "100%", 10989 overflow: "hidden" 10990 }, 10991 children: [ 10992 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 10993 PreviewTypography, 10994 { 10995 fontSize: 65 * ratio, 10996 variation 10997 } 10998 ), 10999 /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_components7.__experimentalVStack, { spacing: 4 * ratio, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 11000 HighlightedColors, 11001 { 11002 normalizedColorSwatchSize: 32, 11003 ratio 11004 } 11005 ) }) 11006 ] 11007 } 11008 ) 11009 }, 11010 key 11011 ), 11012 ({ key }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 11013 import_components7.__unstableMotion.div, 11014 { 11015 variants: withHoverView ? midFrameVariants : void 0, 11016 style: { 11017 height: "100%", 11018 width: "100%", 11019 position: "absolute", 11020 top: 0, 11021 overflow: "hidden", 11022 filter: "blur(60px)", 11023 opacity: 0.1 11024 }, 11025 children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 11026 import_components7.__experimentalHStack, 11027 { 11028 spacing: 0, 11029 justify: "flex-start", 11030 style: { 11031 height: "100%", 11032 overflow: "hidden" 11033 }, 11034 children: paletteColors.slice(0, 4).map(({ color }, index2) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 11035 "div", 11036 { 11037 style: { 11038 height: "100%", 11039 background: color, 11040 flexGrow: 1 11041 } 11042 }, 11043 index2 11044 )) 11045 } 11046 ) 11047 }, 11048 key 11049 ), 11050 ({ ratio, key }) => /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 11051 import_components7.__unstableMotion.div, 11052 { 11053 variants: secondFrameVariants, 11054 style: { 11055 height: "100%", 11056 width: "100%", 11057 overflow: "hidden", 11058 position: "absolute", 11059 top: 0 11060 }, 11061 children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 11062 import_components7.__experimentalVStack, 11063 { 11064 spacing: 3 * ratio, 11065 justify: "center", 11066 style: { 11067 height: "100%", 11068 overflow: "hidden", 11069 padding: 10 * ratio, 11070 boxSizing: "border-box" 11071 }, 11072 children: label && /* @__PURE__ */ (0, import_jsx_runtime32.jsx)( 11073 "div", 11074 { 11075 style: { 11076 fontSize: 40 * ratio, 11077 fontFamily: headingFontFamily, 11078 color: headingColor, 11079 fontWeight: headingFontWeight, 11080 lineHeight: "1em", 11081 textAlign: "center" 11082 }, 11083 children: label 11084 } 11085 ) 11086 } 11087 ) 11088 }, 11089 key 11090 ) 11091 ] 11092 } 11093 ); 11094 } 11095 var preview_styles_default = PreviewStyles; 11096 11097 // packages/global-styles-ui/build-module/screen-root.mjs 11098 var import_jsx_runtime33 = __toESM(require_jsx_runtime(), 1); 11099 11100 // packages/global-styles-ui/build-module/screen-block-list.mjs 11101 var import_blocks2 = __toESM(require_blocks(), 1); 11102 var import_i18n7 = __toESM(require_i18n(), 1); 11103 var import_components11 = __toESM(require_components(), 1); 11104 var import_data4 = __toESM(require_data(), 1); 11105 var import_element24 = __toESM(require_element(), 1); 11106 var import_block_editor3 = __toESM(require_block_editor(), 1); 11107 var import_compose2 = __toESM(require_compose(), 1); 11108 import { speak } from "@wordpress/a11y"; 11109 11110 // packages/global-styles-ui/build-module/variations/variations-panel.mjs 11111 var import_blocks = __toESM(require_blocks(), 1); 11112 var import_data3 = __toESM(require_data(), 1); 11113 var import_components9 = __toESM(require_components(), 1); 11114 var import_jsx_runtime34 = __toESM(require_jsx_runtime(), 1); 11115 function getFilteredBlockStyles(blockStyles, variations) { 11116 return blockStyles?.filter( 11117 (style) => style.source === "block" || variations.includes(style.name) 11118 ) || []; 11119 } 11120 function useBlockVariations(name2) { 11121 const blockStyles = (0, import_data3.useSelect)( 11122 (select) => { 11123 const { getBlockStyles } = select(import_blocks.store); 11124 return getBlockStyles(name2); 11125 }, 11126 [name2] 11127 ); 11128 const [variations] = useStyle("variations", name2); 11129 const variationNames = Object.keys(variations ?? {}); 11130 return getFilteredBlockStyles(blockStyles, variationNames); 11131 } 11132 11133 // packages/global-styles-ui/build-module/screen-header.mjs 11134 var import_components10 = __toESM(require_components(), 1); 11135 var import_i18n6 = __toESM(require_i18n(), 1); 11136 var import_block_editor2 = __toESM(require_block_editor(), 1); 11137 var import_jsx_runtime35 = __toESM(require_jsx_runtime(), 1); 11138 var { StateControl, StateControlBadges } = unlock2(import_block_editor2.privateApis); 11139 11140 // packages/global-styles-ui/build-module/screen-block-list.mjs 11141 var import_jsx_runtime36 = __toESM(require_jsx_runtime(), 1); 11142 var { 11143 useHasDimensionsPanel: useHasDimensionsPanel2, 11144 useHasTypographyPanel: useHasTypographyPanel2, 11145 useHasBorderPanel, 11146 useSettingsForBlockElement: useSettingsForBlockElement2, 11147 useHasColorPanel: useHasColorPanel2 11148 } = unlock2(import_block_editor3.privateApis); 11149 function useSortedBlockTypes() { 11150 const blockItems = (0, import_data4.useSelect)( 11151 (select) => select(import_blocks2.store).getBlockTypes(), 11152 [] 11153 ); 11154 const groupByType = (blocks, block) => { 11155 const { core, noncore } = blocks; 11156 const type = block.name.startsWith("core/") ? core : noncore; 11157 type.push(block); 11158 return blocks; 11159 }; 11160 const { core: coreItems, noncore: nonCoreItems } = blockItems.reduce( 11161 groupByType, 11162 { core: [], noncore: [] } 11163 ); 11164 return [...coreItems, ...nonCoreItems]; 11165 } 11166 function useBlockHasGlobalStyles(blockName) { 11167 const [rawSettings] = useSetting("", blockName); 11168 const settings = useSettingsForBlockElement2(rawSettings, blockName); 11169 const hasTypographyPanel = useHasTypographyPanel2(settings); 11170 const hasColorPanel = useHasColorPanel2(settings); 11171 const hasBorderPanel = useHasBorderPanel(settings); 11172 const hasDimensionsPanel = useHasDimensionsPanel2(settings); 11173 const hasLayoutPanel = hasBorderPanel || hasDimensionsPanel; 11174 const hasVariationsPanel = !!useBlockVariations(blockName)?.length; 11175 const hasGlobalStyles = hasTypographyPanel || hasColorPanel || hasLayoutPanel || hasVariationsPanel; 11176 return hasGlobalStyles; 11177 } 11178 function BlockMenuItem({ block }) { 11179 const hasBlockMenuItem = useBlockHasGlobalStyles(block.name); 11180 if (!hasBlockMenuItem) { 11181 return null; 11182 } 11183 return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 11184 NavigationButtonAsItem, 11185 { 11186 path: "/blocks/" + encodeURIComponent(block.name), 11187 children: /* @__PURE__ */ (0, import_jsx_runtime36.jsxs)(import_components11.__experimentalHStack, { justify: "flex-start", children: [ 11188 /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_block_editor3.BlockIcon, { icon: block.icon }), 11189 /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components11.FlexItem, { children: block.title }) 11190 ] }) 11191 } 11192 ); 11193 } 11194 function BlockList({ filterValue }) { 11195 const sortedBlockTypes = useSortedBlockTypes(); 11196 const debouncedSpeak = (0, import_compose2.useDebounce)(speak, 500); 11197 const { isMatchingSearchTerm } = (0, import_data4.useSelect)(import_blocks2.store); 11198 const filteredBlockTypes = !filterValue ? sortedBlockTypes : sortedBlockTypes.filter( 11199 (blockType) => isMatchingSearchTerm(blockType, filterValue) 11200 ); 11201 const blockTypesListRef = (0, import_element24.useRef)(null); 11202 (0, import_element24.useEffect)(() => { 11203 if (!filterValue) { 11204 return; 11205 } 11206 const count = blockTypesListRef.current?.childElementCount || 0; 11207 const resultsFoundMessage = (0, import_i18n7.sprintf)( 11208 /* translators: %d: number of results. */ 11209 (0, import_i18n7._n)("%d result found.", "%d results found.", count), 11210 count 11211 ); 11212 debouncedSpeak(resultsFoundMessage, "polite"); 11213 }, [filterValue, debouncedSpeak]); 11214 return /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 11215 "div", 11216 { 11217 ref: blockTypesListRef, 11218 className: "global-styles-ui-block-types-item-list", 11219 role: "list", 11220 children: filteredBlockTypes.length === 0 ? /* @__PURE__ */ (0, import_jsx_runtime36.jsx)(import_components11.__experimentalText, { align: "center", as: "p", children: (0, import_i18n7.__)("No blocks found.") }) : filteredBlockTypes.map((block) => /* @__PURE__ */ (0, import_jsx_runtime36.jsx)( 11221 BlockMenuItem, 11222 { 11223 block 11224 }, 11225 "menu-itemblock-" + block.name 11226 )) 11227 } 11228 ); 11229 } 11230 var MemoizedBlockList = (0, import_element24.memo)(BlockList); 11231 11232 // packages/global-styles-ui/build-module/screen-block.mjs 11233 var import_blocks4 = __toESM(require_blocks(), 1); 11234 var import_block_editor5 = __toESM(require_block_editor(), 1); 11235 var import_element26 = __toESM(require_element(), 1); 11236 var import_data5 = __toESM(require_data(), 1); 11237 var import_core_data3 = __toESM(require_core_data(), 1); 11238 var import_components14 = __toESM(require_components(), 1); 11239 var import_i18n8 = __toESM(require_i18n(), 1); 11240 11241 // packages/global-styles-ui/build-module/block-preview-panel.mjs 11242 var import_block_editor4 = __toESM(require_block_editor(), 1); 11243 var import_blocks3 = __toESM(require_blocks(), 1); 11244 var import_components12 = __toESM(require_components(), 1); 11245 var import_element25 = __toESM(require_element(), 1); 11246 var import_jsx_runtime37 = __toESM(require_jsx_runtime(), 1); 11247 11248 // packages/global-styles-ui/build-module/subtitle.mjs 11249 var import_components13 = __toESM(require_components(), 1); 11250 var import_jsx_runtime38 = __toESM(require_jsx_runtime(), 1); 11251 function Subtitle({ children, level = 2 }) { 11252 return /* @__PURE__ */ (0, import_jsx_runtime38.jsx)(import_components13.__experimentalHeading, { className: "global-styles-ui-subtitle", level, children }); 11253 } 11254 11255 // packages/global-styles-ui/build-module/screen-block.mjs 11256 var import_jsx_runtime39 = __toESM(require_jsx_runtime(), 1); 11257 var { 11258 useHasDimensionsPanel: useHasDimensionsPanel3, 11259 useHasTypographyPanel: useHasTypographyPanel3, 11260 useHasBorderPanel: useHasBorderPanel2, 11261 useSettingsForBlockElement: useSettingsForBlockElement3, 11262 useHasColorPanel: useHasColorPanel3, 11263 useHasFiltersPanel, 11264 useHasImageSettingsPanel, 11265 useHasBackgroundPanel: useHasBackgroundPanel2, 11266 BackgroundPanel: StylesBackgroundPanel, 11267 BorderPanel: StylesBorderPanel, 11268 ColorPanel: StylesColorPanel, 11269 TypographyPanel: StylesTypographyPanel, 11270 DimensionsPanel: StylesDimensionsPanel, 11271 FiltersPanel: StylesFiltersPanel, 11272 ImageSettingsPanel, 11273 AdvancedPanel: StylesAdvancedPanel 11274 } = unlock2(import_block_editor5.privateApis); 11275 11276 // packages/global-styles-ui/build-module/screen-typography.mjs 11277 var import_i18n22 = __toESM(require_i18n(), 1); 11278 var import_components33 = __toESM(require_components(), 1); 11279 var import_element38 = __toESM(require_element(), 1); 11280 11281 // packages/global-styles-ui/build-module/screen-body.mjs 11282 var import_components15 = __toESM(require_components(), 1); 11283 var import_jsx_runtime40 = __toESM(require_jsx_runtime(), 1); 11284 11285 // packages/global-styles-ui/build-module/typography-elements.mjs 11286 var import_i18n9 = __toESM(require_i18n(), 1); 11287 var import_components16 = __toESM(require_components(), 1); 11288 var import_jsx_runtime41 = __toESM(require_jsx_runtime(), 1); 11289 11290 // packages/global-styles-ui/build-module/variations/variations-typography.mjs 11291 var import_components18 = __toESM(require_components(), 1); 11292 11293 // packages/global-styles-ui/build-module/preview-typography.mjs 11294 var import_components17 = __toESM(require_components(), 1); 11295 var import_jsx_runtime42 = __toESM(require_jsx_runtime(), 1); 11296 var StylesPreviewTypography = ({ 11297 variation, 11298 isFocused, 11299 withHoverView 11300 }) => { 11301 return /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11302 preview_wrapper_default, 11303 { 11304 label: variation.title, 11305 isFocused, 11306 withHoverView, 11307 children: ({ ratio, key }) => /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11308 import_components17.__experimentalHStack, 11309 { 11310 spacing: 10 * ratio, 11311 justify: "center", 11312 style: { 11313 height: "100%", 11314 overflow: "hidden" 11315 }, 11316 children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)( 11317 PreviewTypography, 11318 { 11319 variation, 11320 fontSize: 85 * ratio 11321 } 11322 ) 11323 }, 11324 key 11325 ) 11326 } 11327 ); 11328 }; 11329 var preview_typography_default = StylesPreviewTypography; 11330 11331 // packages/global-styles-ui/build-module/variations/variation.mjs 11332 var import_element27 = __toESM(require_element(), 1); 11333 var import_keycodes = __toESM(require_keycodes(), 1); 11334 var import_i18n10 = __toESM(require_i18n(), 1); 11335 var import_jsx_runtime43 = __toESM(require_jsx_runtime(), 1); 11336 function Variation({ 11337 variation, 11338 children, 11339 isPill = false, 11340 properties, 11341 showTooltip = false 11342 }) { 11343 const [isFocused, setIsFocused] = (0, import_element27.useState)(false); 11344 const { 11345 base, 11346 user, 11347 onChange: setUserConfig 11348 } = (0, import_element27.useContext)(GlobalStylesContext); 11349 const context = (0, import_element27.useMemo)(() => { 11350 let merged = mergeGlobalStyles(base, variation); 11351 if (properties) { 11352 merged = filterObjectByProperties(merged, properties); 11353 } 11354 return { 11355 user: variation, 11356 base, 11357 merged, 11358 onChange: () => { 11359 } 11360 }; 11361 }, [variation, base, properties]); 11362 const selectVariation = () => setUserConfig(variation); 11363 const selectOnEnter = (event) => { 11364 if (event.keyCode === import_keycodes.ENTER) { 11365 event.preventDefault(); 11366 selectVariation(); 11367 } 11368 }; 11369 const isActive = (0, import_element27.useMemo)( 11370 () => areGlobalStylesEqual(user, variation), 11371 [user, variation] 11372 ); 11373 let label = variation?.title; 11374 if (variation?.description) { 11375 label = (0, import_i18n10.sprintf)( 11376 /* translators: 1: variation title. 2: variation description. */ 11377 (0, import_i18n10._x)("%1$s (%2$s)", "variation label"), 11378 variation?.title, 11379 variation?.description 11380 ); 11381 } 11382 const content = /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11383 "div", 11384 { 11385 className: clsx_default("global-styles-ui-variations_item", { 11386 "is-active": isActive 11387 }), 11388 role: "button", 11389 onClick: selectVariation, 11390 onKeyDown: selectOnEnter, 11391 tabIndex: 0, 11392 "aria-label": label, 11393 "aria-current": isActive, 11394 onFocus: () => setIsFocused(true), 11395 onBlur: () => setIsFocused(false), 11396 children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)( 11397 "div", 11398 { 11399 className: clsx_default("global-styles-ui-variations_item-preview", { 11400 "is-pill": isPill 11401 }), 11402 children: children(isFocused) 11403 } 11404 ) 11405 } 11406 ); 11407 return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(GlobalStylesContext.Provider, { value: context, children: showTooltip ? /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)(tooltip_exports.Root, { children: [ 11408 /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(tooltip_exports.Trigger, { render: content }), 11409 /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(tooltip_exports.Popup, { children: variation?.title }) 11410 ] }) : content }); 11411 } 11412 11413 // packages/global-styles-ui/build-module/variations/variations-typography.mjs 11414 var import_jsx_runtime44 = __toESM(require_jsx_runtime(), 1); 11415 var propertiesToFilter = ["typography"]; 11416 function TypographyVariations({ 11417 title, 11418 gap = 2 11419 }) { 11420 const typographyVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter); 11421 if (typographyVariations?.length <= 1) { 11422 return null; 11423 } 11424 return /* @__PURE__ */ (0, import_jsx_runtime44.jsxs)(import_components18.__experimentalVStack, { spacing: 3, children: [ 11425 title && /* @__PURE__ */ (0, import_jsx_runtime44.jsx)(Subtitle, { level: 3, children: title }), 11426 /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11427 import_components18.__experimentalGrid, 11428 { 11429 columns: 3, 11430 gap, 11431 className: "global-styles-ui-style-variations-container", 11432 children: typographyVariations.map( 11433 (variation, index2) => { 11434 return /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11435 Variation, 11436 { 11437 variation, 11438 properties: propertiesToFilter, 11439 showTooltip: true, 11440 children: () => /* @__PURE__ */ (0, import_jsx_runtime44.jsx)( 11441 preview_typography_default, 11442 { 11443 variation 11444 } 11445 ) 11446 }, 11447 index2 11448 ); 11449 } 11450 ) 11451 } 11452 ) 11453 ] }); 11454 } 11455 11456 // packages/global-styles-ui/build-module/font-families.mjs 11457 var import_i18n20 = __toESM(require_i18n(), 1); 11458 var import_components31 = __toESM(require_components(), 1); 11459 var import_element37 = __toESM(require_element(), 1); 11460 11461 // packages/global-styles-ui/build-module/font-library/context.mjs 11462 var import_element28 = __toESM(require_element(), 1); 11463 var import_data6 = __toESM(require_data(), 1); 11464 var import_core_data5 = __toESM(require_core_data(), 1); 11465 var import_i18n12 = __toESM(require_i18n(), 1); 11466 11467 // packages/global-styles-ui/build-module/font-library/api.mjs 11468 var import_api_fetch = __toESM(require_api_fetch(), 1); 11469 var import_core_data4 = __toESM(require_core_data(), 1); 11470 var FONT_FAMILIES_URL = "/wp/v2/font-families"; 11471 function invalidateFontFamilyCache(registry) { 11472 const { receiveEntityRecords } = registry.dispatch(import_core_data4.store); 11473 receiveEntityRecords( 11474 "postType", 11475 "wp_font_family", 11476 [], 11477 void 0, 11478 true 11479 // invalidateCache 11480 ); 11481 } 11482 async function fetchInstallFontFamily(data, registry) { 11483 const config = { 11484 path: FONT_FAMILIES_URL, 11485 method: "POST", 11486 body: data 11487 }; 11488 const response = await (0, import_api_fetch.default)(config); 11489 invalidateFontFamilyCache(registry); 11490 return { 11491 id: response.id, 11492 ...response.font_family_settings, 11493 fontFace: [] 11494 }; 11495 } 11496 async function fetchInstallFontFace(fontFamilyId, data, registry) { 11497 const config = { 11498 path: `$FONT_FAMILIES_URL}/$fontFamilyId}/font-faces`, 11499 method: "POST", 11500 body: data 11501 }; 11502 const response = await (0, import_api_fetch.default)(config); 11503 invalidateFontFamilyCache(registry); 11504 return { 11505 id: response.id, 11506 ...response.font_face_settings 11507 }; 11508 } 11509 11510 // packages/global-styles-ui/build-module/font-library/utils/index.mjs 11511 var import_components19 = __toESM(require_components(), 1); 11512 11513 // packages/global-styles-ui/build-module/font-library/utils/constants.mjs 11514 var import_i18n11 = __toESM(require_i18n(), 1); 11515 var ALLOWED_FILE_EXTENSIONS = ["otf", "ttf", "woff", "woff2"]; 11516 var FONT_WEIGHTS = { 11517 100: (0, import_i18n11._x)("Thin", "font weight"), 11518 200: (0, import_i18n11._x)("Extra-light", "font weight"), 11519 300: (0, import_i18n11._x)("Light", "font weight"), 11520 400: (0, import_i18n11._x)("Normal", "font weight"), 11521 500: (0, import_i18n11._x)("Medium", "font weight"), 11522 600: (0, import_i18n11._x)("Semi-bold", "font weight"), 11523 700: (0, import_i18n11._x)("Bold", "font weight"), 11524 800: (0, import_i18n11._x)("Extra-bold", "font weight"), 11525 900: (0, import_i18n11._x)("Black", "font weight") 11526 }; 11527 var FONT_STYLES = { 11528 normal: (0, import_i18n11._x)("Normal", "font style"), 11529 italic: (0, import_i18n11._x)("Italic", "font style") 11530 }; 11531 11532 // packages/global-styles-ui/build-module/font-library/utils/index.mjs 11533 var { File } = window; 11534 var { kebabCase } = unlock2(import_components19.privateApis); 11535 function setUIValuesNeeded(font2, extraValues = {}) { 11536 if (!font2.name && (font2.fontFamily || font2.slug)) { 11537 font2.name = font2.fontFamily || font2.slug; 11538 } 11539 return { 11540 ...font2, 11541 ...extraValues 11542 }; 11543 } 11544 function isUrlEncoded(url) { 11545 if (typeof url !== "string") { 11546 return false; 11547 } 11548 return url !== decodeURIComponent(url); 11549 } 11550 function getFontFaceVariantName(face) { 11551 const weightName = FONT_WEIGHTS[face.fontWeight ?? ""] || face.fontWeight; 11552 const styleName = face.fontStyle === "normal" ? "" : FONT_STYLES[face.fontStyle ?? ""] || face.fontStyle; 11553 return `$weightName} $styleName}`; 11554 } 11555 function mergeFontFaces(existing = [], incoming = []) { 11556 const map = /* @__PURE__ */ new Map(); 11557 for (const face of existing) { 11558 map.set(`$face.fontWeight}$face.fontStyle}`, face); 11559 } 11560 for (const face of incoming) { 11561 map.set(`$face.fontWeight}$face.fontStyle}`, face); 11562 } 11563 return Array.from(map.values()); 11564 } 11565 function mergeFontFamilies(existing = [], incoming = []) { 11566 const map = /* @__PURE__ */ new Map(); 11567 for (const font2 of existing) { 11568 map.set(font2.slug, { ...font2 }); 11569 } 11570 for (const font2 of incoming) { 11571 if (map.has(font2.slug)) { 11572 const { fontFace: incomingFontFaces, ...restIncoming } = font2; 11573 const existingFont = map.get(font2.slug); 11574 const mergedFontFaces = mergeFontFaces( 11575 existingFont.fontFace, 11576 incomingFontFaces 11577 ); 11578 map.set(font2.slug, { 11579 ...restIncoming, 11580 fontFace: mergedFontFaces 11581 }); 11582 } else { 11583 map.set(font2.slug, { ...font2 }); 11584 } 11585 } 11586 return Array.from(map.values()); 11587 } 11588 async function loadFontFaceInBrowser(fontFace, source, addTo = "all") { 11589 let dataSource; 11590 if (typeof source === "string") { 11591 dataSource = `url($source})`; 11592 } else if (source instanceof File) { 11593 dataSource = await source.arrayBuffer(); 11594 } else { 11595 return; 11596 } 11597 const newFont = new window.FontFace( 11598 formatFontFaceName(fontFace.fontFamily), 11599 dataSource, 11600 { 11601 style: fontFace.fontStyle, 11602 weight: String(fontFace.fontWeight) 11603 } 11604 ); 11605 const loadedFace = await newFont.load(); 11606 if (addTo === "document" || addTo === "all") { 11607 document.fonts.add(loadedFace); 11608 } 11609 if (addTo === "iframe" || addTo === "all") { 11610 const iframe = document.querySelector( 11611 'iframe[name="editor-canvas"]' 11612 ); 11613 if (iframe?.contentDocument) { 11614 iframe.contentDocument.fonts.add(loadedFace); 11615 } 11616 } 11617 } 11618 function unloadFontFaceInBrowser(fontFace, removeFrom = "all") { 11619 const unloadFontFace = (fonts) => { 11620 fonts.forEach((f2) => { 11621 if (f2.family === formatFontFaceName(fontFace?.fontFamily) && f2.weight === fontFace?.fontWeight && f2.style === fontFace?.fontStyle) { 11622 fonts.delete(f2); 11623 } 11624 }); 11625 }; 11626 if (removeFrom === "document" || removeFrom === "all") { 11627 unloadFontFace(document.fonts); 11628 } 11629 if (removeFrom === "iframe" || removeFrom === "all") { 11630 const iframe = document.querySelector( 11631 'iframe[name="editor-canvas"]' 11632 ); 11633 if (iframe?.contentDocument) { 11634 unloadFontFace(iframe.contentDocument.fonts); 11635 } 11636 } 11637 } 11638 function getDisplaySrcFromFontFace(input) { 11639 if (!input) { 11640 return; 11641 } 11642 let src; 11643 if (Array.isArray(input)) { 11644 src = input[0]; 11645 } else { 11646 src = input; 11647 } 11648 if (src.startsWith("file:.")) { 11649 return; 11650 } 11651 if (!isUrlEncoded(src)) { 11652 src = encodeURI(src); 11653 } 11654 return src; 11655 } 11656 function makeFontFamilyFormData(fontFamily) { 11657 const formData = new FormData(); 11658 const { fontFace, category, ...familyWithValidParameters } = fontFamily; 11659 const fontFamilySettings = { 11660 ...familyWithValidParameters, 11661 slug: kebabCase(fontFamily.slug) 11662 }; 11663 formData.append( 11664 "font_family_settings", 11665 JSON.stringify(fontFamilySettings) 11666 ); 11667 return formData; 11668 } 11669 function makeFontFacesFormData(font2) { 11670 const fontFacesFormData = (font2?.fontFace ?? []).map( 11671 (item, faceIndex) => { 11672 const face = { ...item }; 11673 const formData = new FormData(); 11674 if (face.file) { 11675 const files = Array.isArray(face.file) ? face.file : [face.file]; 11676 const src = []; 11677 files.forEach((file, key) => { 11678 const fileId = `file-$faceIndex}-$key}`; 11679 formData.append(fileId, file, file.name); 11680 src.push(fileId); 11681 }); 11682 face.src = src.length === 1 ? src[0] : src; 11683 delete face.file; 11684 formData.append("font_face_settings", JSON.stringify(face)); 11685 } else { 11686 formData.append("font_face_settings", JSON.stringify(face)); 11687 } 11688 return formData; 11689 } 11690 ); 11691 return fontFacesFormData; 11692 } 11693 async function batchInstallFontFaces(fontFamilyId, fontFacesData, registry) { 11694 const responses = []; 11695 for (const faceData of fontFacesData) { 11696 try { 11697 const response = await fetchInstallFontFace( 11698 fontFamilyId, 11699 faceData, 11700 registry 11701 ); 11702 responses.push({ status: "fulfilled", value: response }); 11703 } catch (error) { 11704 responses.push({ status: "rejected", reason: error }); 11705 } 11706 } 11707 const results = { 11708 errors: [], 11709 successes: [] 11710 }; 11711 responses.forEach((result, index2) => { 11712 if (result.status === "fulfilled" && result.value) { 11713 const response = result.value; 11714 results.successes.push(response); 11715 } else if (result.reason) { 11716 results.errors.push({ 11717 data: fontFacesData[index2], 11718 message: result.reason.message 11719 }); 11720 } 11721 }); 11722 return results; 11723 } 11724 async function downloadFontFaceAssets(src) { 11725 src = Array.isArray(src) ? src : [src]; 11726 const files = await Promise.all( 11727 src.map(async (url) => { 11728 return fetch(new Request(url)).then((response) => { 11729 if (!response.ok) { 11730 throw new Error( 11731 `Error downloading font face asset from $url}. Server responded with status: $response.status}` 11732 ); 11733 } 11734 return response.blob(); 11735 }).then((blob) => { 11736 const filename = url.split("/").pop(); 11737 const file = new File([blob], filename, { 11738 type: blob.type 11739 }); 11740 return file; 11741 }); 11742 }) 11743 ); 11744 return files.length === 1 ? files[0] : files; 11745 } 11746 function checkFontFaceInstalled(fontFace, collection) { 11747 return -1 !== collection.findIndex((collectionFontFace) => { 11748 return collectionFontFace.fontWeight === fontFace.fontWeight && collectionFontFace.fontStyle === fontFace.fontStyle; 11749 }); 11750 } 11751 11752 // packages/global-styles-ui/build-module/font-library/utils/set-immutably.mjs 11753 function setImmutably2(object, path, value) { 11754 path = Array.isArray(path) ? [...path] : [path]; 11755 object = Array.isArray(object) ? [...object] : { ...object }; 11756 const leaf = path.pop(); 11757 let prev = object; 11758 for (const key of path) { 11759 const lvl = prev[key]; 11760 prev = prev[key] = Array.isArray(lvl) ? [...lvl] : { ...lvl }; 11761 } 11762 prev[leaf] = value; 11763 return object; 11764 } 11765 11766 // packages/global-styles-ui/build-module/font-library/utils/toggleFont.mjs 11767 function toggleFont(font2, face, initialfonts = []) { 11768 const isFontActivated = (f2) => f2.slug === font2.slug; 11769 const getActivatedFont = (fonts) => fonts.find(isFontActivated); 11770 const toggleEntireFontFamily = (activatedFont2) => { 11771 if (!activatedFont2) { 11772 return [...initialfonts, font2]; 11773 } 11774 return initialfonts.filter( 11775 (f2) => !isFontActivated(f2) 11776 ); 11777 }; 11778 const toggleFontVariant = (activatedFont2) => { 11779 const isFaceActivated = (f2) => f2.fontWeight === face.fontWeight && f2.fontStyle === face.fontStyle; 11780 if (!activatedFont2) { 11781 return [...initialfonts, { ...font2, fontFace: [face] }]; 11782 } 11783 let newFontFaces = activatedFont2.fontFace || []; 11784 if (newFontFaces.find(isFaceActivated)) { 11785 newFontFaces = newFontFaces.filter( 11786 (f2) => !isFaceActivated(f2) 11787 ); 11788 } else { 11789 newFontFaces = [...newFontFaces, face]; 11790 } 11791 if (newFontFaces.length === 0) { 11792 return initialfonts.filter( 11793 (f2) => !isFontActivated(f2) 11794 ); 11795 } 11796 return initialfonts.map( 11797 (f2) => isFontActivated(f2) ? { ...f2, fontFace: newFontFaces } : f2 11798 ); 11799 }; 11800 const activatedFont = getActivatedFont(initialfonts); 11801 if (!face) { 11802 return toggleEntireFontFamily(activatedFont); 11803 } 11804 return toggleFontVariant(activatedFont); 11805 } 11806 11807 // packages/global-styles-ui/build-module/font-library/context.mjs 11808 var import_jsx_runtime45 = __toESM(require_jsx_runtime(), 1); 11809 var FontLibraryContext = (0, import_element28.createContext)( 11810 {} 11811 ); 11812 FontLibraryContext.displayName = "FontLibraryContext"; 11813 function FontLibraryProvider({ children }) { 11814 const registry = (0, import_data6.useRegistry)(); 11815 const { saveEntityRecord, deleteEntityRecord } = (0, import_data6.useDispatch)(import_core_data5.store); 11816 const { globalStylesId } = (0, import_data6.useSelect)((select) => { 11817 const { __experimentalGetCurrentGlobalStylesId } = select(import_core_data5.store); 11818 return { globalStylesId: __experimentalGetCurrentGlobalStylesId() }; 11819 }, []); 11820 const globalStyles = (0, import_core_data5.useEntityRecord)( 11821 "root", 11822 "globalStyles", 11823 globalStylesId 11824 ); 11825 const [isInstalling, setIsInstalling] = (0, import_element28.useState)(false); 11826 const { records: libraryPosts = [], isResolving: isResolvingLibrary } = (0, import_core_data5.useEntityRecords)( 11827 "postType", 11828 "wp_font_family", 11829 { 11830 _embed: true 11831 } 11832 ); 11833 const libraryFonts = (libraryPosts || []).map((fontFamilyPost) => { 11834 return { 11835 id: fontFamilyPost.id, 11836 ...fontFamilyPost.font_family_settings || {}, 11837 fontFace: fontFamilyPost?._embedded?.font_faces?.map( 11838 (face) => face.font_face_settings 11839 ) || [] 11840 }; 11841 }) || []; 11842 const [fontFamilies, setFontFamilies] = useSetting("typography.fontFamilies"); 11843 const saveFontFamilies = async (fonts) => { 11844 if (!globalStyles.record) { 11845 return; 11846 } 11847 const updatedGlobalStyles = globalStyles.record; 11848 const finalGlobalStyles = setImmutably2( 11849 updatedGlobalStyles ?? {}, 11850 ["settings", "typography", "fontFamilies"], 11851 fonts 11852 ); 11853 await saveEntityRecord("root", "globalStyles", finalGlobalStyles); 11854 }; 11855 const [modalTabOpen, setModalTabOpen] = (0, import_element28.useState)(""); 11856 const [libraryFontSelected, setLibraryFontSelected] = (0, import_element28.useState)(void 0); 11857 const themeFonts = fontFamilies?.theme ? fontFamilies.theme.map((f2) => setUIValuesNeeded(f2, { source: "theme" })).sort((a2, b2) => a2.name.localeCompare(b2.name)) : []; 11858 const customFonts = fontFamilies?.custom ? fontFamilies.custom.map((f2) => setUIValuesNeeded(f2, { source: "custom" })).sort((a2, b2) => a2.name.localeCompare(b2.name)) : []; 11859 const baseCustomFonts = libraryFonts ? libraryFonts.map((f2) => setUIValuesNeeded(f2, { source: "custom" })).sort((a2, b2) => a2.name.localeCompare(b2.name)) : []; 11860 (0, import_element28.useEffect)(() => { 11861 if (!modalTabOpen) { 11862 setLibraryFontSelected(void 0); 11863 } 11864 }, [modalTabOpen]); 11865 const handleSetLibraryFontSelected = (font2) => { 11866 if (!font2) { 11867 setLibraryFontSelected(void 0); 11868 return; 11869 } 11870 const fonts = font2.source === "theme" ? themeFonts : baseCustomFonts; 11871 const fontSelected = fonts.find((f2) => f2.slug === font2.slug); 11872 setLibraryFontSelected({ 11873 ...fontSelected || font2, 11874 source: font2.source 11875 }); 11876 }; 11877 const [loadedFontUrls] = (0, import_element28.useState)(/* @__PURE__ */ new Set()); 11878 const getAvailableFontsOutline = (availableFontFamilies) => { 11879 const outline = availableFontFamilies.reduce( 11880 (acc, font2) => { 11881 const availableFontFaces = font2?.fontFace && font2.fontFace?.length > 0 ? font2?.fontFace.map( 11882 (face) => `$face.fontStyle ?? ""}$face.fontWeight ?? ""}` 11883 ) : ["normal400"]; 11884 acc[font2.slug] = availableFontFaces; 11885 return acc; 11886 }, 11887 {} 11888 ); 11889 return outline; 11890 }; 11891 const getActivatedFontsOutline = (source) => { 11892 switch (source) { 11893 case "theme": 11894 return getAvailableFontsOutline(themeFonts); 11895 case "custom": 11896 default: 11897 return getAvailableFontsOutline(customFonts); 11898 } 11899 }; 11900 const isFontActivated = (slug, style, weight, source) => { 11901 if (!style && !weight) { 11902 return !!getActivatedFontsOutline(source)[slug]; 11903 } 11904 return !!getActivatedFontsOutline(source)[slug]?.includes( 11905 (style ?? "") + (weight ?? "") 11906 ); 11907 }; 11908 const getFontFacesActivated = (slug, source) => { 11909 return getActivatedFontsOutline(source)[slug] || []; 11910 }; 11911 async function installFonts(fontFamiliesToInstall) { 11912 setIsInstalling(true); 11913 try { 11914 const fontFamiliesToActivate = []; 11915 let installationErrors = []; 11916 for (const fontFamilyToInstall of fontFamiliesToInstall) { 11917 let isANewFontFamily = false; 11918 const fontFamilyRecords = await (0, import_data6.resolveSelect)( 11919 import_core_data5.store 11920 ).getEntityRecords( 11921 "postType", 11922 "wp_font_family", 11923 { 11924 slug: fontFamilyToInstall.slug, 11925 per_page: 1, 11926 _embed: true 11927 } 11928 ); 11929 const fontFamilyPost = fontFamilyRecords && fontFamilyRecords.length > 0 ? fontFamilyRecords[0] : null; 11930 let installedFontFamily = fontFamilyPost ? { 11931 id: fontFamilyPost.id, 11932 ...fontFamilyPost.font_family_settings, 11933 fontFace: (fontFamilyPost?._embedded?.font_faces ?? []).map( 11934 (face) => face.font_face_settings 11935 ) || [] 11936 } : null; 11937 if (!installedFontFamily) { 11938 isANewFontFamily = true; 11939 installedFontFamily = await fetchInstallFontFamily( 11940 makeFontFamilyFormData(fontFamilyToInstall), 11941 registry 11942 ); 11943 } 11944 const alreadyInstalledFontFaces = installedFontFamily.fontFace && fontFamilyToInstall.fontFace ? installedFontFamily.fontFace.filter( 11945 (fontFaceToInstall) => fontFaceToInstall && fontFamilyToInstall.fontFace && checkFontFaceInstalled( 11946 fontFaceToInstall, 11947 fontFamilyToInstall.fontFace 11948 ) 11949 ) : []; 11950 if (installedFontFamily.fontFace && fontFamilyToInstall.fontFace) { 11951 fontFamilyToInstall.fontFace = fontFamilyToInstall.fontFace.filter( 11952 (fontFaceToInstall) => !checkFontFaceInstalled( 11953 fontFaceToInstall, 11954 installedFontFamily.fontFace 11955 ) 11956 ); 11957 } 11958 let successfullyInstalledFontFaces = []; 11959 let unsuccessfullyInstalledFontFaces = []; 11960 if (fontFamilyToInstall?.fontFace?.length ?? 0 > 0) { 11961 const response = await batchInstallFontFaces( 11962 // @ts-expect-error - Type mismatch: WpFontFamily.id can be number | string, but batchInstallFontFaces expects only string. 11963 installedFontFamily.id, 11964 makeFontFacesFormData( 11965 fontFamilyToInstall 11966 ), 11967 registry 11968 ); 11969 successfullyInstalledFontFaces = response?.successes; 11970 unsuccessfullyInstalledFontFaces = response?.errors; 11971 } 11972 if (successfullyInstalledFontFaces?.length > 0 || alreadyInstalledFontFaces?.length > 0) { 11973 installedFontFamily.fontFace = [ 11974 ...successfullyInstalledFontFaces 11975 ]; 11976 fontFamiliesToActivate.push(installedFontFamily); 11977 } 11978 if (installedFontFamily && !fontFamilyToInstall?.fontFace?.length) { 11979 fontFamiliesToActivate.push(installedFontFamily); 11980 } 11981 if (isANewFontFamily && (fontFamilyToInstall?.fontFace?.length ?? 0) > 0 && successfullyInstalledFontFaces?.length === 0) { 11982 await deleteEntityRecord( 11983 "postType", 11984 "wp_font_family", 11985 installedFontFamily.id, 11986 { force: true } 11987 ); 11988 } 11989 installationErrors = installationErrors.concat( 11990 unsuccessfullyInstalledFontFaces 11991 ); 11992 } 11993 const installationErrorMessages = installationErrors.reduce( 11994 (unique, item) => unique.includes(item.message) ? unique : [...unique, item.message], 11995 [] 11996 ); 11997 if (fontFamiliesToActivate.length > 0) { 11998 const activeFonts = activateCustomFontFamilies( 11999 // @ts-expect-error - Type mismatch: items may have id as number | string, but FontFamily.id should be string | undefined. 12000 fontFamiliesToActivate 12001 ); 12002 await saveFontFamilies(activeFonts); 12003 } 12004 if (installationErrorMessages.length > 0) { 12005 const installError = new Error((0, import_i18n12.__)("There was an error installing fonts.")); 12006 installError.installationErrors = installationErrorMessages; 12007 throw installError; 12008 } 12009 } finally { 12010 setIsInstalling(false); 12011 } 12012 } 12013 async function uninstallFontFamily(fontFamilyToUninstall) { 12014 if (!fontFamilyToUninstall?.id) { 12015 throw new Error((0, import_i18n12.__)("Font family to uninstall is not defined.")); 12016 } 12017 try { 12018 await deleteEntityRecord( 12019 "postType", 12020 "wp_font_family", 12021 fontFamilyToUninstall.id, 12022 { force: true } 12023 ); 12024 const activeFonts = deactivateFontFamily(fontFamilyToUninstall); 12025 await saveFontFamilies(activeFonts); 12026 return { deleted: true }; 12027 } catch (error) { 12028 console.error( 12029 `There was an error uninstalling the font family:`, 12030 error 12031 ); 12032 throw error; 12033 } 12034 } 12035 const deactivateFontFamily = (font2) => { 12036 const initialCustomFonts = fontFamilies?.[font2.source ?? ""] ?? []; 12037 const newCustomFonts = initialCustomFonts.filter( 12038 (f2) => f2.slug !== font2.slug 12039 ); 12040 const activeFonts = { 12041 ...fontFamilies, 12042 [font2.source ?? ""]: newCustomFonts 12043 }; 12044 setFontFamilies(activeFonts); 12045 if (font2.fontFace) { 12046 font2.fontFace.forEach((face) => { 12047 unloadFontFaceInBrowser(face, "all"); 12048 }); 12049 } 12050 return activeFonts; 12051 }; 12052 const activateCustomFontFamilies = (fontsToAdd) => { 12053 const fontsToActivate = cleanFontsForSave(fontsToAdd); 12054 const activeFonts = { 12055 ...fontFamilies, 12056 // Merge the existing custom fonts with the new fonts. 12057 custom: mergeFontFamilies(fontFamilies?.custom, fontsToActivate) 12058 }; 12059 setFontFamilies(activeFonts); 12060 loadFontsInBrowser(fontsToActivate); 12061 return activeFonts; 12062 }; 12063 const cleanFontsForSave = (fonts) => { 12064 return fonts.map(({ id: _familyDbId, fontFace, ...font2 }) => ({ 12065 ...font2, 12066 ...fontFace && fontFace.length > 0 ? { 12067 fontFace: fontFace.map( 12068 ({ id: _faceDbId, ...face }) => face 12069 ) 12070 } : {} 12071 })); 12072 }; 12073 const loadFontsInBrowser = (fonts) => { 12074 fonts.forEach((font2) => { 12075 if (font2.fontFace) { 12076 font2.fontFace.forEach((face) => { 12077 const displaySrc = getDisplaySrcFromFontFace( 12078 face?.src ?? "" 12079 ); 12080 if (displaySrc) { 12081 loadFontFaceInBrowser(face, displaySrc, "all"); 12082 } 12083 }); 12084 } 12085 }); 12086 }; 12087 const toggleActivateFont = (font2, face) => { 12088 const initialFonts = fontFamilies?.[font2.source ?? ""] ?? []; 12089 const newFonts = toggleFont(font2, face, initialFonts); 12090 setFontFamilies({ 12091 ...fontFamilies, 12092 [font2.source ?? ""]: newFonts 12093 }); 12094 const isFaceActivated = isFontActivated( 12095 font2.slug, 12096 face?.fontStyle ?? "", 12097 face?.fontWeight ?? "", 12098 font2.source ?? "custom" 12099 ); 12100 if (face && isFaceActivated) { 12101 unloadFontFaceInBrowser(face, "all"); 12102 } else { 12103 const displaySrc = getDisplaySrcFromFontFace(face?.src ?? ""); 12104 if (face && displaySrc) { 12105 loadFontFaceInBrowser(face, displaySrc, "all"); 12106 } 12107 } 12108 }; 12109 const loadFontFaceAsset = async (fontFace) => { 12110 if (!fontFace.src) { 12111 return; 12112 } 12113 const src = getDisplaySrcFromFontFace(fontFace.src); 12114 if (!src || loadedFontUrls.has(src)) { 12115 return; 12116 } 12117 loadFontFaceInBrowser(fontFace, src, "document"); 12118 loadedFontUrls.add(src); 12119 }; 12120 return /* @__PURE__ */ (0, import_jsx_runtime45.jsx)( 12121 FontLibraryContext.Provider, 12122 { 12123 value: { 12124 libraryFontSelected, 12125 handleSetLibraryFontSelected, 12126 fontFamilies: fontFamilies ?? {}, 12127 baseCustomFonts, 12128 isFontActivated, 12129 getFontFacesActivated, 12130 loadFontFaceAsset, 12131 installFonts, 12132 uninstallFontFamily, 12133 toggleActivateFont, 12134 getAvailableFontsOutline, 12135 modalTabOpen, 12136 setModalTabOpen, 12137 saveFontFamilies, 12138 isResolvingLibrary, 12139 isInstalling 12140 }, 12141 children 12142 } 12143 ); 12144 } 12145 var context_default = FontLibraryProvider; 12146 12147 // packages/global-styles-ui/build-module/font-library/modal.mjs 12148 var import_i18n18 = __toESM(require_i18n(), 1); 12149 var import_components29 = __toESM(require_components(), 1); 12150 var import_core_data8 = __toESM(require_core_data(), 1); 12151 var import_data8 = __toESM(require_data(), 1); 12152 12153 // packages/global-styles-ui/build-module/font-library/installed-fonts.mjs 12154 var import_components23 = __toESM(require_components(), 1); 12155 var import_core_data6 = __toESM(require_core_data(), 1); 12156 var import_data7 = __toESM(require_data(), 1); 12157 var import_element32 = __toESM(require_element(), 1); 12158 var import_i18n14 = __toESM(require_i18n(), 1); 12159 12160 // packages/global-styles-ui/build-module/font-library/font-card.mjs 12161 var import_i18n13 = __toESM(require_i18n(), 1); 12162 var import_element30 = __toESM(require_element(), 1); 12163 var import_components21 = __toESM(require_components(), 1); 12164 12165 // packages/global-styles-ui/build-module/font-library/font-demo.mjs 12166 var import_components20 = __toESM(require_components(), 1); 12167 var import_element29 = __toESM(require_element(), 1); 12168 var import_jsx_runtime46 = __toESM(require_jsx_runtime(), 1); 12169 function getPreviewUrl(fontFace) { 12170 if (fontFace.preview) { 12171 return fontFace.preview; 12172 } 12173 if (fontFace.src) { 12174 return Array.isArray(fontFace.src) ? fontFace.src[0] : fontFace.src; 12175 } 12176 return void 0; 12177 } 12178 function getDisplayFontFace(font2) { 12179 if ("fontStyle" in font2 && font2.fontStyle || "fontWeight" in font2 && font2.fontWeight) { 12180 return font2; 12181 } 12182 if ("fontFace" in font2 && font2.fontFace && font2.fontFace.length) { 12183 return font2.fontFace.find( 12184 (face) => face.fontStyle === "normal" && face.fontWeight === "400" 12185 ) || font2.fontFace[0]; 12186 } 12187 return { 12188 fontStyle: "normal", 12189 fontWeight: "400", 12190 fontFamily: font2.fontFamily 12191 }; 12192 } 12193 function FontDemo({ font: font2, text }) { 12194 const ref = (0, import_element29.useRef)(null); 12195 const fontFace = getDisplayFontFace(font2); 12196 const style = getFamilyPreviewStyle(font2); 12197 text = text || ("name" in font2 ? font2.name : ""); 12198 const customPreviewUrl = font2.preview; 12199 const [isIntersecting, setIsIntersecting] = (0, import_element29.useState)(false); 12200 const [isAssetLoaded, setIsAssetLoaded] = (0, import_element29.useState)(false); 12201 const { loadFontFaceAsset } = (0, import_element29.useContext)(FontLibraryContext); 12202 const previewUrl = customPreviewUrl ?? getPreviewUrl(fontFace); 12203 const isPreviewImage = previewUrl && previewUrl.match(/\.(png|jpg|jpeg|gif|svg)$/i); 12204 const faceStyles = getFacePreviewStyle(fontFace); 12205 const textDemoStyle = { 12206 fontSize: "18px", 12207 lineHeight: 1, 12208 opacity: isAssetLoaded ? "1" : "0", 12209 ...style, 12210 ...faceStyles 12211 }; 12212 (0, import_element29.useEffect)(() => { 12213 const observer = new window.IntersectionObserver(([entry]) => { 12214 setIsIntersecting(entry.isIntersecting); 12215 }, {}); 12216 if (ref.current) { 12217 observer.observe(ref.current); 12218 } 12219 return () => observer.disconnect(); 12220 }, [ref]); 12221 (0, import_element29.useEffect)(() => { 12222 const loadAsset = async () => { 12223 if (isIntersecting) { 12224 if (!isPreviewImage && fontFace.src) { 12225 await loadFontFaceAsset(fontFace); 12226 } 12227 setIsAssetLoaded(true); 12228 } 12229 }; 12230 loadAsset(); 12231 }, [fontFace, isIntersecting, loadFontFaceAsset, isPreviewImage]); 12232 return /* @__PURE__ */ (0, import_jsx_runtime46.jsx)("div", { ref, children: isPreviewImage ? /* @__PURE__ */ (0, import_jsx_runtime46.jsx)( 12233 "img", 12234 { 12235 src: previewUrl, 12236 loading: "lazy", 12237 alt: text, 12238 className: "font-library__font-variant_demo-image" 12239 } 12240 ) : /* @__PURE__ */ (0, import_jsx_runtime46.jsx)( 12241 import_components20.__experimentalText, 12242 { 12243 style: textDemoStyle, 12244 className: "font-library__font-variant_demo-text", 12245 children: text 12246 } 12247 ) }); 12248 } 12249 var font_demo_default = FontDemo; 12250 12251 // packages/global-styles-ui/build-module/font-library/font-card.mjs 12252 var import_jsx_runtime47 = __toESM(require_jsx_runtime(), 1); 12253 function FontCard({ 12254 font: font2, 12255 onClick, 12256 variantsText, 12257 navigatorPath, 12258 shouldFocus 12259 }) { 12260 const variantsCount = font2.fontFace?.length || 1; 12261 const style = { 12262 cursor: !!onClick ? "pointer" : "default" 12263 }; 12264 const navigator2 = (0, import_components21.useNavigator)(); 12265 const ref = (0, import_element30.useRef)(null); 12266 (0, import_element30.useEffect)(() => { 12267 if (shouldFocus) { 12268 ref.current?.focus(); 12269 } 12270 }, [shouldFocus]); 12271 return /* @__PURE__ */ (0, import_jsx_runtime47.jsx)( 12272 import_components21.Button, 12273 { 12274 ref, 12275 __next40pxDefaultSize: true, 12276 onClick: () => { 12277 onClick(); 12278 if (navigatorPath) { 12279 navigator2.goTo(navigatorPath); 12280 } 12281 }, 12282 style, 12283 className: "font-library__font-card", 12284 children: /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_components21.Flex, { justify: "space-between", wrap: false, children: [ 12285 /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(font_demo_default, { font: font2 }), 12286 /* @__PURE__ */ (0, import_jsx_runtime47.jsxs)(import_components21.Flex, { justify: "flex-end", children: [ 12287 /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components21.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components21.__experimentalText, { className: "font-library__font-card__count", children: variantsText || (0, import_i18n13.sprintf)( 12288 /* translators: %d: Number of font variants. */ 12289 (0, import_i18n13._n)( 12290 "%d variant", 12291 "%d variants", 12292 variantsCount 12293 ), 12294 variantsCount 12295 ) }) }), 12296 /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(import_components21.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime47.jsx)(icon_default, { icon: (0, import_i18n13.isRTL)() ? chevron_left_default : chevron_right_default }) }) 12297 ] }) 12298 ] }) 12299 } 12300 ); 12301 } 12302 var font_card_default = FontCard; 12303 12304 // packages/global-styles-ui/build-module/font-library/library-font-variant.mjs 12305 var import_element31 = __toESM(require_element(), 1); 12306 var import_components22 = __toESM(require_components(), 1); 12307 var import_jsx_runtime48 = __toESM(require_jsx_runtime(), 1); 12308 function LibraryFontVariant({ 12309 face, 12310 font: font2 12311 }) { 12312 const { isFontActivated, toggleActivateFont } = (0, import_element31.useContext)(FontLibraryContext); 12313 const isInstalled = (font2?.fontFace?.length ?? 0) > 0 ? isFontActivated( 12314 font2.slug, 12315 face.fontStyle, 12316 face.fontWeight, 12317 font2.source 12318 ) : isFontActivated(font2.slug, void 0, void 0, font2.source); 12319 const handleToggleActivation = () => { 12320 if ((font2?.fontFace?.length ?? 0) > 0) { 12321 toggleActivateFont(font2, face); 12322 return; 12323 } 12324 toggleActivateFont(font2); 12325 }; 12326 const displayName = font2.name + " " + getFontFaceVariantName(face); 12327 const checkboxId = (0, import_element31.useId)(); 12328 return /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("div", { className: "font-library__font-card", children: /* @__PURE__ */ (0, import_jsx_runtime48.jsxs)(import_components22.Flex, { justify: "flex-start", align: "center", gap: "1rem", children: [ 12329 /* @__PURE__ */ (0, import_jsx_runtime48.jsx)( 12330 import_components22.CheckboxControl, 12331 { 12332 checked: isInstalled, 12333 onChange: handleToggleActivation, 12334 id: checkboxId 12335 } 12336 ), 12337 /* @__PURE__ */ (0, import_jsx_runtime48.jsx)("label", { htmlFor: checkboxId, children: /* @__PURE__ */ (0, import_jsx_runtime48.jsx)( 12338 font_demo_default, 12339 { 12340 font: face, 12341 text: displayName, 12342 onClick: handleToggleActivation 12343 } 12344 ) }) 12345 ] }) }); 12346 } 12347 var library_font_variant_default = LibraryFontVariant; 12348 12349 // packages/global-styles-ui/build-module/font-library/utils/sort-font-faces.mjs 12350 function getNumericFontWeight(value) { 12351 switch (value) { 12352 case "normal": 12353 return 400; 12354 case "bold": 12355 return 700; 12356 case "bolder": 12357 return 500; 12358 case "lighter": 12359 return 300; 12360 default: 12361 return parseInt(value, 10); 12362 } 12363 } 12364 function sortFontFaces(faces) { 12365 return faces.sort((a2, b2) => { 12366 if (a2.fontStyle === "normal" && b2.fontStyle !== "normal") { 12367 return -1; 12368 } 12369 if (b2.fontStyle === "normal" && a2.fontStyle !== "normal") { 12370 return 1; 12371 } 12372 if (a2.fontStyle === b2.fontStyle) { 12373 return getNumericFontWeight(a2.fontWeight?.toString() ?? "normal") - getNumericFontWeight(b2.fontWeight?.toString() ?? "normal"); 12374 } 12375 if (!a2.fontStyle || !b2.fontStyle) { 12376 return !a2.fontStyle ? 1 : -1; 12377 } 12378 return a2.fontStyle.localeCompare(b2.fontStyle); 12379 }); 12380 } 12381 12382 // packages/global-styles-ui/build-module/font-library/installed-fonts.mjs 12383 var import_jsx_runtime49 = __toESM(require_jsx_runtime(), 1); 12384 function getFontFamiliesKey(fontFamilies) { 12385 if (!fontFamilies) { 12386 return ""; 12387 } 12388 const normalized = {}; 12389 for (const source of Object.keys(fontFamilies).sort()) { 12390 normalized[source] = (fontFamilies[source] ?? []).map((family) => ({ 12391 slug: family.slug, 12392 fontFace: (family.fontFace ?? []).map( 12393 (face) => `$face.fontStyle}-$face.fontWeight}` 12394 ).sort() 12395 })).sort((a2, b2) => a2.slug.localeCompare(b2.slug)); 12396 } 12397 return JSON.stringify(normalized); 12398 } 12399 function InstalledFonts() { 12400 const { 12401 baseCustomFonts, 12402 libraryFontSelected, 12403 handleSetLibraryFontSelected, 12404 uninstallFontFamily, 12405 isResolvingLibrary, 12406 isInstalling, 12407 saveFontFamilies, 12408 getFontFacesActivated 12409 } = (0, import_element32.useContext)(FontLibraryContext); 12410 const [fontFamilies, setFontFamilies] = useSetting("typography.fontFamilies"); 12411 const [lastSelectedFontSlug, setLastSelectedFontSlug] = (0, import_element32.useState)(void 0); 12412 const [isConfirmDeleteOpen, setIsConfirmDeleteOpen] = (0, import_element32.useState)(false); 12413 const [notice, setNotice] = (0, import_element32.useState)(null); 12414 const [baseFontFamilies] = useSetting("typography.fontFamilies", void 0, "base"); 12415 const globalStylesId = (0, import_data7.useSelect)((select) => { 12416 const { __experimentalGetCurrentGlobalStylesId } = select(import_core_data6.store); 12417 return __experimentalGetCurrentGlobalStylesId(); 12418 }, []); 12419 const globalStyles = (0, import_core_data6.useEntityRecord)( 12420 "root", 12421 "globalStyles", 12422 globalStylesId 12423 ); 12424 const editedFontFamilies = globalStyles?.edits?.settings?.typography?.fontFamilies; 12425 const savedFontFamilies = globalStyles?.record?.settings?.typography?.fontFamilies; 12426 const fontFamiliesHasChanges = (0, import_element32.useMemo)(() => { 12427 if (editedFontFamilies === void 0) { 12428 return false; 12429 } 12430 return getFontFamiliesKey(editedFontFamilies) !== getFontFamiliesKey(savedFontFamilies); 12431 }, [editedFontFamilies, savedFontFamilies]); 12432 const themeFonts = fontFamilies?.theme ? fontFamilies.theme.map((f2) => setUIValuesNeeded(f2, { source: "theme" })).sort((a2, b2) => a2.name.localeCompare(b2.name)) : []; 12433 const themeFontsSlugs = new Set(themeFonts.map((f2) => f2.slug)); 12434 const baseThemeFonts = baseFontFamilies?.theme ? themeFonts.concat( 12435 baseFontFamilies.theme.filter((f2) => !themeFontsSlugs.has(f2.slug)).map((f2) => setUIValuesNeeded(f2, { source: "theme" })).sort((a2, b2) => a2.name.localeCompare(b2.name)) 12436 ) : []; 12437 const customFontFamilyId = libraryFontSelected?.source === "custom" && libraryFontSelected?.id; 12438 const canUserDelete = (0, import_data7.useSelect)( 12439 (select) => { 12440 const { canUser } = select(import_core_data6.store); 12441 return customFontFamilyId && canUser("delete", { 12442 kind: "postType", 12443 name: "wp_font_family", 12444 id: customFontFamilyId 12445 }); 12446 }, 12447 [customFontFamilyId] 12448 ); 12449 const shouldDisplayDeleteButton = !!libraryFontSelected && libraryFontSelected?.source !== "theme" && canUserDelete; 12450 const handleUninstallClick = () => { 12451 setIsConfirmDeleteOpen(true); 12452 }; 12453 const handleUpdate = async () => { 12454 setNotice(null); 12455 try { 12456 await saveFontFamilies(fontFamilies); 12457 setNotice({ 12458 type: "success", 12459 message: (0, import_i18n14.__)("Font family updated successfully.") 12460 }); 12461 } catch (error) { 12462 setNotice({ 12463 type: "error", 12464 message: (0, import_i18n14.sprintf)( 12465 /* translators: %s: error message */ 12466 (0, import_i18n14.__)("There was an error updating the font family. %s"), 12467 error.message 12468 ) 12469 }); 12470 } 12471 }; 12472 const getFontFacesToDisplay = (font2) => { 12473 if (!font2) { 12474 return []; 12475 } 12476 if (!font2.fontFace || !font2.fontFace.length) { 12477 return [ 12478 { 12479 fontFamily: font2.fontFamily, 12480 fontStyle: "normal", 12481 fontWeight: "400" 12482 } 12483 ]; 12484 } 12485 return sortFontFaces(font2.fontFace); 12486 }; 12487 const getFontCardVariantsText = (font2) => { 12488 const variantsInstalled = font2?.fontFace && (font2?.fontFace?.length ?? 0) > 0 ? font2.fontFace.length : 1; 12489 const variantsActive = getFontFacesActivated( 12490 font2.slug, 12491 font2.source 12492 ).length; 12493 return (0, import_i18n14.sprintf)( 12494 /* translators: 1: Active font variants, 2: Total font variants. */ 12495 (0, import_i18n14.__)("%1$d of %2$d active"), 12496 variantsActive, 12497 variantsInstalled 12498 ); 12499 }; 12500 (0, import_element32.useEffect)(() => { 12501 handleSetLibraryFontSelected(libraryFontSelected); 12502 }, []); 12503 const activeFontsCount = libraryFontSelected ? getFontFacesActivated( 12504 libraryFontSelected.slug, 12505 libraryFontSelected.source 12506 ).length : 0; 12507 const selectedFontsCount = libraryFontSelected?.fontFace?.length ?? (libraryFontSelected?.fontFamily ? 1 : 0); 12508 const isIndeterminate = activeFontsCount > 0 && activeFontsCount !== selectedFontsCount; 12509 const isSelectAllChecked = activeFontsCount === selectedFontsCount; 12510 const toggleSelectAll = () => { 12511 if (!libraryFontSelected || !libraryFontSelected?.source) { 12512 return; 12513 } 12514 const initialFonts = fontFamilies?.[libraryFontSelected.source]?.filter( 12515 (f2) => f2.slug !== libraryFontSelected.slug 12516 ) ?? []; 12517 const newFonts = isSelectAllChecked ? initialFonts : [...initialFonts, libraryFontSelected]; 12518 setFontFamilies({ 12519 ...fontFamilies, 12520 [libraryFontSelected.source]: newFonts 12521 }); 12522 if (libraryFontSelected.fontFace) { 12523 libraryFontSelected.fontFace.forEach((face) => { 12524 if (isSelectAllChecked) { 12525 unloadFontFaceInBrowser(face, "all"); 12526 } else { 12527 const displaySrc = getDisplaySrcFromFontFace( 12528 face?.src ?? "" 12529 ); 12530 if (displaySrc) { 12531 loadFontFaceInBrowser(face, displaySrc, "all"); 12532 } 12533 } 12534 }); 12535 } 12536 }; 12537 const hasFonts = baseThemeFonts.length > 0 || baseCustomFonts.length > 0; 12538 return /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)("div", { className: "font-library__tabpanel-layout", children: [ 12539 isResolvingLibrary && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("div", { className: "font-library__loading", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.ProgressBar, {}) }), 12540 !isResolvingLibrary && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [ 12541 /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)( 12542 import_components23.Navigator, 12543 { 12544 initialPath: libraryFontSelected ? "/fontFamily" : "/", 12545 children: [ 12546 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.Navigator.Screen, { path: "/", children: /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_components23.__experimentalVStack, { spacing: "8", children: [ 12547 notice && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12548 import_components23.Notice, 12549 { 12550 status: notice.type, 12551 onRemove: () => setNotice(null), 12552 children: notice.message 12553 } 12554 ), 12555 !hasFonts && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.__experimentalText, { as: "p", children: (0, import_i18n14.__)("No fonts installed.") }), 12556 baseThemeFonts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_components23.__experimentalVStack, { children: [ 12557 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { 12558 className: "font-library__fonts-title", 12559 /* translators: Heading for a list of fonts provided by the theme. */ 12560 children: (0, import_i18n14._x)("Theme", "font source") 12561 }), 12562 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12563 "ul", 12564 { 12565 role: "list", 12566 className: "font-library__fonts-list", 12567 children: baseThemeFonts.map((font2) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12568 "li", 12569 { 12570 className: "font-library__fonts-list-item", 12571 children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12572 font_card_default, 12573 { 12574 font: font2, 12575 navigatorPath: "/fontFamily", 12576 variantsText: getFontCardVariantsText( 12577 font2 12578 ), 12579 shouldFocus: font2.slug === lastSelectedFontSlug, 12580 onClick: () => { 12581 setNotice(null); 12582 handleSetLibraryFontSelected( 12583 font2 12584 ); 12585 } 12586 } 12587 ) 12588 }, 12589 font2.slug 12590 )) 12591 } 12592 ) 12593 ] }), 12594 baseCustomFonts.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_components23.__experimentalVStack, { children: [ 12595 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)("h2", { 12596 className: "font-library__fonts-title", 12597 /* translators: Heading for a list of fonts installed by the user. */ 12598 children: (0, import_i18n14._x)("Custom", "font source") 12599 }), 12600 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12601 "ul", 12602 { 12603 role: "list", 12604 className: "font-library__fonts-list", 12605 children: baseCustomFonts.map((font2) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12606 "li", 12607 { 12608 className: "font-library__fonts-list-item", 12609 children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12610 font_card_default, 12611 { 12612 font: font2, 12613 navigatorPath: "/fontFamily", 12614 variantsText: getFontCardVariantsText( 12615 font2 12616 ), 12617 shouldFocus: font2.slug === lastSelectedFontSlug, 12618 onClick: () => { 12619 setNotice(null); 12620 handleSetLibraryFontSelected( 12621 font2 12622 ); 12623 } 12624 } 12625 ) 12626 }, 12627 font2.slug 12628 )) 12629 } 12630 ) 12631 ] }) 12632 ] }) }), 12633 /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_components23.Navigator.Screen, { path: "/fontFamily", children: [ 12634 libraryFontSelected && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12635 ConfirmDeleteDialog, 12636 { 12637 font: libraryFontSelected, 12638 isOpen: isConfirmDeleteOpen, 12639 setIsOpen: setIsConfirmDeleteOpen, 12640 setNotice, 12641 uninstallFontFamily, 12642 handleSetLibraryFontSelected 12643 } 12644 ), 12645 /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_components23.Flex, { justify: "flex-start", children: [ 12646 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12647 import_components23.Navigator.BackButton, 12648 { 12649 icon: (0, import_i18n14.isRTL)() ? chevron_right_default : chevron_left_default, 12650 size: "small", 12651 onClick: () => { 12652 setLastSelectedFontSlug( 12653 libraryFontSelected?.slug 12654 ); 12655 handleSetLibraryFontSelected( 12656 void 0 12657 ); 12658 setNotice(null); 12659 }, 12660 label: (0, import_i18n14.__)("Back") 12661 } 12662 ), 12663 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12664 import_components23.__experimentalHeading, 12665 { 12666 level: 2, 12667 size: 13, 12668 className: "global-styles-ui-header", 12669 children: libraryFontSelected?.name 12670 } 12671 ) 12672 ] }), 12673 notice && /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_jsx_runtime49.Fragment, { children: [ 12674 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.__experimentalSpacer, { margin: 1 }), 12675 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12676 import_components23.Notice, 12677 { 12678 status: notice.type, 12679 onRemove: () => setNotice(null), 12680 children: notice.message 12681 } 12682 ), 12683 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.__experimentalSpacer, { margin: 1 }) 12684 ] }), 12685 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.__experimentalSpacer, { margin: 4 }), 12686 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.__experimentalText, { children: (0, import_i18n14.__)( 12687 "Choose font variants. Keep in mind that too many variants could make your site slower." 12688 ) }), 12689 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.__experimentalSpacer, { margin: 4 }), 12690 /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_components23.__experimentalVStack, { spacing: 0, children: [ 12691 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12692 import_components23.CheckboxControl, 12693 { 12694 className: "font-library__select-all", 12695 label: (0, import_i18n14.__)("Select all"), 12696 checked: isSelectAllChecked, 12697 onChange: toggleSelectAll, 12698 indeterminate: isIndeterminate 12699 } 12700 ), 12701 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.__experimentalSpacer, { margin: 8 }), 12702 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12703 "ul", 12704 { 12705 role: "list", 12706 className: "font-library__fonts-list", 12707 children: libraryFontSelected && getFontFacesToDisplay( 12708 libraryFontSelected 12709 ).map((face, i2) => /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12710 "li", 12711 { 12712 className: "font-library__fonts-list-item", 12713 children: /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12714 library_font_variant_default, 12715 { 12716 font: libraryFontSelected, 12717 face 12718 }, 12719 `face$i2}` 12720 ) 12721 }, 12722 `face$i2}` 12723 )) 12724 } 12725 ) 12726 ] }) 12727 ] }) 12728 ] 12729 } 12730 ), 12731 /* @__PURE__ */ (0, import_jsx_runtime49.jsxs)(import_components23.__experimentalHStack, { justify: "flex-end", className: "font-library__footer", children: [ 12732 isInstalling && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)(import_components23.ProgressBar, {}), 12733 shouldDisplayDeleteButton && /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12734 import_components23.Button, 12735 { 12736 __next40pxDefaultSize: true, 12737 isDestructive: true, 12738 variant: "tertiary", 12739 onClick: handleUninstallClick, 12740 children: (0, import_i18n14.__)("Delete") 12741 } 12742 ), 12743 /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12744 import_components23.Button, 12745 { 12746 __next40pxDefaultSize: true, 12747 variant: "primary", 12748 onClick: handleUpdate, 12749 disabled: !fontFamiliesHasChanges, 12750 accessibleWhenDisabled: true, 12751 children: (0, import_i18n14.__)("Update") 12752 } 12753 ) 12754 ] }) 12755 ] }) 12756 ] }); 12757 } 12758 function ConfirmDeleteDialog({ 12759 font: font2, 12760 isOpen, 12761 setIsOpen, 12762 setNotice, 12763 uninstallFontFamily, 12764 handleSetLibraryFontSelected 12765 }) { 12766 const navigator2 = (0, import_components23.useNavigator)(); 12767 const handleConfirmUninstall = async () => { 12768 setNotice(null); 12769 setIsOpen(false); 12770 try { 12771 await uninstallFontFamily(font2); 12772 navigator2.goBack(); 12773 handleSetLibraryFontSelected(void 0); 12774 setNotice({ 12775 type: "success", 12776 message: (0, import_i18n14.__)("Font family uninstalled successfully.") 12777 }); 12778 } catch (error) { 12779 setNotice({ 12780 type: "error", 12781 message: (0, import_i18n14.__)("There was an error uninstalling the font family.") + error.message 12782 }); 12783 } 12784 }; 12785 const handleCancelUninstall = () => { 12786 setIsOpen(false); 12787 }; 12788 return /* @__PURE__ */ (0, import_jsx_runtime49.jsx)( 12789 import_components23.__experimentalConfirmDialog, 12790 { 12791 isOpen, 12792 cancelButtonText: (0, import_i18n14.__)("Cancel"), 12793 confirmButtonText: (0, import_i18n14.__)("Delete"), 12794 onCancel: handleCancelUninstall, 12795 onConfirm: handleConfirmUninstall, 12796 size: "medium", 12797 children: font2 && (0, import_i18n14.sprintf)( 12798 /* translators: %s: Name of the font. */ 12799 (0, import_i18n14.__)( 12800 'Are you sure you want to delete "%s" font and all its variants and assets?' 12801 ), 12802 font2.name 12803 ) 12804 } 12805 ); 12806 } 12807 var installed_fonts_default = InstalledFonts; 12808 12809 // packages/global-styles-ui/build-module/font-library/font-collection.mjs 12810 var import_element34 = __toESM(require_element(), 1); 12811 var import_components26 = __toESM(require_components(), 1); 12812 var import_compose3 = __toESM(require_compose(), 1); 12813 var import_i18n16 = __toESM(require_i18n(), 1); 12814 var import_core_data7 = __toESM(require_core_data(), 1); 12815 12816 // packages/global-styles-ui/build-module/font-library/utils/filter-fonts.mjs 12817 function filterFonts(fonts, filters) { 12818 const { category, search } = filters; 12819 let filteredFonts = fonts || []; 12820 if (category && category !== "all") { 12821 filteredFonts = filteredFonts.filter( 12822 (font2) => font2.categories && font2.categories.indexOf(category) !== -1 12823 ); 12824 } 12825 if (search) { 12826 filteredFonts = filteredFonts.filter( 12827 (font2) => font2.font_family_settings && font2.font_family_settings.name.toLowerCase().includes(search.toLowerCase()) 12828 ); 12829 } 12830 return filteredFonts; 12831 } 12832 12833 // packages/global-styles-ui/build-module/font-library/utils/fonts-outline.mjs 12834 function getFontsOutline(fonts) { 12835 return fonts.reduce( 12836 (acc, font2) => ({ 12837 ...acc, 12838 [font2.slug]: (font2?.fontFace || []).reduce( 12839 (faces, face) => ({ 12840 ...faces, 12841 [`$face.fontStyle}-$face.fontWeight}`]: true 12842 }), 12843 {} 12844 ) 12845 }), 12846 {} 12847 ); 12848 } 12849 function isFontFontFaceInOutline(slug, face, outline) { 12850 if (!face) { 12851 return !!outline[slug]; 12852 } 12853 return !!outline[slug]?.[`$face.fontStyle}-$face.fontWeight}`]; 12854 } 12855 12856 // packages/global-styles-ui/build-module/font-library/google-fonts-confirm-dialog.mjs 12857 var import_i18n15 = __toESM(require_i18n(), 1); 12858 var import_components24 = __toESM(require_components(), 1); 12859 var import_jsx_runtime50 = __toESM(require_jsx_runtime(), 1); 12860 function GoogleFontsConfirmDialog() { 12861 const handleConfirm = () => { 12862 window.localStorage.setItem( 12863 "wp-font-library-google-fonts-permission", 12864 "true" 12865 ); 12866 window.dispatchEvent(new Event("storage")); 12867 }; 12868 return /* @__PURE__ */ (0, import_jsx_runtime50.jsx)("div", { className: "font-library__google-fonts-confirm", children: /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components24.Card, { children: /* @__PURE__ */ (0, import_jsx_runtime50.jsxs)(import_components24.CardBody, { children: [ 12869 /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components24.__experimentalHeading, { level: 2, children: (0, import_i18n15.__)("Connect to Google Fonts") }), 12870 /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components24.__experimentalSpacer, { margin: 6 }), 12871 /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components24.__experimentalText, { as: "p", children: (0, import_i18n15.__)( 12872 "To install fonts from Google you must give permission to connect directly to Google servers. The fonts you install will be downloaded from Google and stored on your site. Your site will then use these locally-hosted fonts." 12873 ) }), 12874 /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components24.__experimentalSpacer, { margin: 3 }), 12875 /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components24.__experimentalText, { as: "p", children: (0, import_i18n15.__)( 12876 "You can alternatively upload files directly on the Upload tab." 12877 ) }), 12878 /* @__PURE__ */ (0, import_jsx_runtime50.jsx)(import_components24.__experimentalSpacer, { margin: 6 }), 12879 /* @__PURE__ */ (0, import_jsx_runtime50.jsx)( 12880 import_components24.Button, 12881 { 12882 __next40pxDefaultSize: true, 12883 variant: "primary", 12884 onClick: handleConfirm, 12885 children: (0, import_i18n15.__)("Allow access to Google Fonts") 12886 } 12887 ) 12888 ] }) }) }); 12889 } 12890 var google_fonts_confirm_dialog_default = GoogleFontsConfirmDialog; 12891 12892 // packages/global-styles-ui/build-module/font-library/collection-font-variant.mjs 12893 var import_element33 = __toESM(require_element(), 1); 12894 var import_components25 = __toESM(require_components(), 1); 12895 var import_jsx_runtime51 = __toESM(require_jsx_runtime(), 1); 12896 function CollectionFontVariant({ 12897 face, 12898 font: font2, 12899 handleToggleVariant, 12900 selected 12901 }) { 12902 const handleToggleActivation = () => { 12903 if (font2?.fontFace) { 12904 handleToggleVariant(font2, face); 12905 return; 12906 } 12907 handleToggleVariant(font2); 12908 }; 12909 const displayName = font2.name + " " + getFontFaceVariantName(face); 12910 const checkboxId = (0, import_element33.useId)(); 12911 return /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("div", { className: "font-library__font-card", children: /* @__PURE__ */ (0, import_jsx_runtime51.jsxs)(import_components25.Flex, { justify: "flex-start", align: "center", gap: "1rem", children: [ 12912 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)( 12913 import_components25.CheckboxControl, 12914 { 12915 checked: selected, 12916 onChange: handleToggleActivation, 12917 id: checkboxId 12918 } 12919 ), 12920 /* @__PURE__ */ (0, import_jsx_runtime51.jsx)("label", { htmlFor: checkboxId, children: /* @__PURE__ */ (0, import_jsx_runtime51.jsx)( 12921 font_demo_default, 12922 { 12923 font: face, 12924 text: displayName, 12925 onClick: handleToggleActivation 12926 } 12927 ) }) 12928 ] }) }); 12929 } 12930 var collection_font_variant_default = CollectionFontVariant; 12931 12932 // packages/global-styles-ui/build-module/font-library/font-collection.mjs 12933 var import_jsx_runtime52 = __toESM(require_jsx_runtime(), 1); 12934 var DEFAULT_CATEGORY = { 12935 slug: "all", 12936 name: (0, import_i18n16._x)("All", "font categories") 12937 }; 12938 var LOCAL_STORAGE_ITEM = "wp-font-library-google-fonts-permission"; 12939 var MIN_WINDOW_HEIGHT = 500; 12940 function FontCollection({ slug }) { 12941 const requiresPermission = slug === "google-fonts"; 12942 const getGoogleFontsPermissionFromStorage = () => { 12943 return window.localStorage.getItem(LOCAL_STORAGE_ITEM) === "true"; 12944 }; 12945 const [selectedFont, setSelectedFont] = (0, import_element34.useState)( 12946 null 12947 ); 12948 const [lastSelectedFontSlug, setLastSelectedFontSlug] = (0, import_element34.useState)(void 0); 12949 const [notice, setNotice] = (0, import_element34.useState)(null); 12950 const [fontsToInstall, setFontsToInstall] = (0, import_element34.useState)( 12951 [] 12952 ); 12953 const [page, setPage] = (0, import_element34.useState)(1); 12954 const [filters, setFilters] = (0, import_element34.useState)({}); 12955 const [renderConfirmDialog, setRenderConfirmDialog] = (0, import_element34.useState)( 12956 requiresPermission && !getGoogleFontsPermissionFromStorage() 12957 ); 12958 const { installFonts, isInstalling } = (0, import_element34.useContext)(FontLibraryContext); 12959 const { record: selectedCollection, isResolving: isLoading } = (0, import_core_data7.useEntityRecord)("root", "fontCollection", slug); 12960 (0, import_element34.useEffect)(() => { 12961 const handleStorage = () => { 12962 setRenderConfirmDialog( 12963 requiresPermission && !getGoogleFontsPermissionFromStorage() 12964 ); 12965 }; 12966 handleStorage(); 12967 window.addEventListener("storage", handleStorage); 12968 return () => window.removeEventListener("storage", handleStorage); 12969 }, [slug, requiresPermission]); 12970 const revokeAccess = () => { 12971 window.localStorage.setItem(LOCAL_STORAGE_ITEM, "false"); 12972 window.dispatchEvent(new Event("storage")); 12973 }; 12974 (0, import_element34.useEffect)(() => { 12975 setSelectedFont(null); 12976 }, [slug]); 12977 (0, import_element34.useEffect)(() => { 12978 setFontsToInstall([]); 12979 }, [selectedFont]); 12980 const collectionFonts = (0, import_element34.useMemo)( 12981 () => selectedCollection?.font_families ?? [], 12982 [selectedCollection] 12983 ); 12984 const collectionCategories = selectedCollection?.categories ?? []; 12985 const categories = [DEFAULT_CATEGORY, ...collectionCategories]; 12986 const fonts = (0, import_element34.useMemo)( 12987 () => filterFonts(collectionFonts, filters), 12988 [collectionFonts, filters] 12989 ); 12990 const windowHeight = Math.max(window.innerHeight, MIN_WINDOW_HEIGHT); 12991 const pageSize = Math.floor((windowHeight - 417) / 61); 12992 const totalPages = Math.ceil(fonts.length / pageSize); 12993 const itemsStart = (page - 1) * pageSize; 12994 const itemsLimit = page * pageSize; 12995 const items = fonts.slice(itemsStart, itemsLimit); 12996 const handleCategoryFilter = (category) => { 12997 setFilters({ ...filters, category }); 12998 setPage(1); 12999 }; 13000 const handleUpdateSearchInput = (value) => { 13001 setFilters({ ...filters, search: value }); 13002 setPage(1); 13003 }; 13004 const debouncedUpdateSearchInput = (0, import_compose3.debounce)(handleUpdateSearchInput, 300); 13005 const handleToggleVariant = (font2, face) => { 13006 const newFontsToInstall = toggleFont(font2, face, fontsToInstall); 13007 setFontsToInstall(newFontsToInstall); 13008 }; 13009 const fontToInstallOutline = getFontsOutline(fontsToInstall); 13010 const resetFontsToInstall = () => { 13011 setFontsToInstall([]); 13012 }; 13013 const selectFontCount = fontsToInstall.length > 0 ? fontsToInstall[0]?.fontFace?.length ?? 0 : 0; 13014 const isIndeterminate = selectFontCount > 0 && selectFontCount !== selectedFont?.fontFace?.length; 13015 const isSelectAllChecked = selectFontCount === selectedFont?.fontFace?.length; 13016 const toggleSelectAll = () => { 13017 const newFonts = []; 13018 if (!isSelectAllChecked && selectedFont) { 13019 newFonts.push(selectedFont); 13020 } 13021 setFontsToInstall(newFonts); 13022 }; 13023 const handleInstall = async () => { 13024 setNotice(null); 13025 const fontFamily = fontsToInstall[0]; 13026 try { 13027 if (fontFamily?.fontFace) { 13028 await Promise.all( 13029 fontFamily.fontFace.map(async (fontFace) => { 13030 if (fontFace.src) { 13031 fontFace.file = await downloadFontFaceAssets( 13032 fontFace.src 13033 ); 13034 } 13035 }) 13036 ); 13037 } 13038 } catch { 13039 setNotice({ 13040 type: "error", 13041 message: (0, import_i18n16.__)( 13042 "Error installing the fonts, could not be downloaded." 13043 ) 13044 }); 13045 return; 13046 } 13047 try { 13048 await installFonts([fontFamily]); 13049 setNotice({ 13050 type: "success", 13051 message: (0, import_i18n16.__)("Fonts were installed successfully.") 13052 }); 13053 } catch (error) { 13054 setNotice({ 13055 type: "error", 13056 message: error.message 13057 }); 13058 } 13059 resetFontsToInstall(); 13060 }; 13061 const getSortedFontFaces = (fontFamily) => { 13062 if (!fontFamily) { 13063 return []; 13064 } 13065 if (!fontFamily.fontFace || !fontFamily.fontFace.length) { 13066 return [ 13067 { 13068 fontFamily: fontFamily.fontFamily, 13069 fontStyle: "normal", 13070 fontWeight: "400" 13071 } 13072 ]; 13073 } 13074 return sortFontFaces(fontFamily.fontFace); 13075 }; 13076 if (renderConfirmDialog) { 13077 return /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(google_fonts_confirm_dialog_default, {}); 13078 } 13079 const showActions = slug === "google-fonts" && !renderConfirmDialog && !selectedFont; 13080 return /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)("div", { className: "font-library__tabpanel-layout", children: [ 13081 isLoading && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "font-library__loading", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.ProgressBar, {}) }), 13082 !isLoading && selectedCollection && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [ 13083 /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)( 13084 import_components26.Navigator, 13085 { 13086 initialPath: "/", 13087 className: "font-library__tabpanel-layout", 13088 children: [ 13089 /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_components26.Navigator.Screen, { path: "/", children: [ 13090 /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_components26.__experimentalHStack, { justify: "space-between", children: [ 13091 /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_components26.__experimentalVStack, { children: [ 13092 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalHeading, { level: 2, size: 13, children: selectedCollection.name }), 13093 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalText, { children: selectedCollection.description }) 13094 ] }), 13095 showActions && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13096 import_components26.DropdownMenu, 13097 { 13098 icon: more_vertical_default, 13099 label: (0, import_i18n16.__)("Actions"), 13100 popoverProps: { 13101 position: "bottom left" 13102 }, 13103 controls: [ 13104 { 13105 title: (0, import_i18n16.__)( 13106 "Revoke access to Google Fonts" 13107 ), 13108 onClick: revokeAccess 13109 } 13110 ] 13111 } 13112 ) 13113 ] }), 13114 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalSpacer, { margin: 4 }), 13115 /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_components26.__experimentalHStack, { spacing: 4, justify: "space-between", children: [ 13116 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13117 import_components26.SearchControl, 13118 { 13119 value: filters.search, 13120 placeholder: (0, import_i18n16.__)("Font name\u2026"), 13121 label: (0, import_i18n16.__)("Search"), 13122 onChange: debouncedUpdateSearchInput, 13123 hideLabelFromVision: false 13124 } 13125 ), 13126 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13127 import_components26.SelectControl, 13128 { 13129 __next40pxDefaultSize: true, 13130 label: (0, import_i18n16.__)("Category"), 13131 value: filters.category, 13132 onChange: handleCategoryFilter, 13133 children: categories && categories.map((category) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13134 "option", 13135 { 13136 value: category.slug, 13137 children: category.name 13138 }, 13139 category.slug 13140 )) 13141 } 13142 ) 13143 ] }), 13144 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalSpacer, { margin: 4 }), 13145 !!selectedCollection?.font_families?.length && !fonts.length && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalText, { children: (0, import_i18n16.__)( 13146 "No fonts found. Try with a different search term." 13147 ) }), 13148 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { className: "font-library__fonts-grid__main", children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13149 "ul", 13150 { 13151 role: "list", 13152 className: "font-library__fonts-list", 13153 children: items.map((font2) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13154 "li", 13155 { 13156 className: "font-library__fonts-list-item", 13157 children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13158 font_card_default, 13159 { 13160 font: font2.font_family_settings, 13161 navigatorPath: "/fontFamily", 13162 shouldFocus: font2.font_family_settings.slug === lastSelectedFontSlug, 13163 onClick: () => { 13164 setSelectedFont( 13165 font2.font_family_settings 13166 ); 13167 } 13168 } 13169 ) 13170 }, 13171 font2.font_family_settings.slug 13172 )) 13173 } 13174 ) }) 13175 ] }), 13176 /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_components26.Navigator.Screen, { path: "/fontFamily", children: [ 13177 /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_components26.Flex, { justify: "flex-start", children: [ 13178 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13179 import_components26.Navigator.BackButton, 13180 { 13181 icon: (0, import_i18n16.isRTL)() ? chevron_right_default : chevron_left_default, 13182 size: "small", 13183 onClick: () => { 13184 setLastSelectedFontSlug( 13185 selectedFont?.slug 13186 ); 13187 setSelectedFont(null); 13188 setNotice(null); 13189 }, 13190 label: (0, import_i18n16.__)("Back") 13191 } 13192 ), 13193 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13194 import_components26.__experimentalHeading, 13195 { 13196 level: 2, 13197 size: 13, 13198 className: "global-styles-ui-header", 13199 children: selectedFont?.name 13200 } 13201 ) 13202 ] }), 13203 notice && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_jsx_runtime52.Fragment, { children: [ 13204 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalSpacer, { margin: 1 }), 13205 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13206 import_components26.Notice, 13207 { 13208 status: notice.type, 13209 onRemove: () => setNotice(null), 13210 children: notice.message 13211 } 13212 ), 13213 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalSpacer, { margin: 1 }) 13214 ] }), 13215 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalSpacer, { margin: 4 }), 13216 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalText, { children: (0, import_i18n16.__)("Select font variants to install.") }), 13217 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalSpacer, { margin: 4 }), 13218 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13219 import_components26.CheckboxControl, 13220 { 13221 className: "font-library__select-all", 13222 label: (0, import_i18n16.__)("Select all"), 13223 checked: isSelectAllChecked, 13224 onChange: toggleSelectAll, 13225 indeterminate: isIndeterminate 13226 } 13227 ), 13228 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalVStack, { spacing: 0, children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13229 "ul", 13230 { 13231 role: "list", 13232 className: "font-library__fonts-list", 13233 children: selectedFont && getSortedFontFaces(selectedFont).map( 13234 (face, i2) => /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13235 "li", 13236 { 13237 className: "font-library__fonts-list-item", 13238 children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13239 collection_font_variant_default, 13240 { 13241 font: selectedFont, 13242 face, 13243 handleToggleVariant, 13244 selected: isFontFontFaceInOutline( 13245 selectedFont.slug, 13246 selectedFont.fontFace ? face : null, 13247 // If the font has no fontFace, we want to check if the font is in the outline 13248 fontToInstallOutline 13249 ) 13250 } 13251 ) 13252 }, 13253 `face$i2}` 13254 ) 13255 ) 13256 } 13257 ) }), 13258 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)(import_components26.__experimentalSpacer, { margin: 16 }) 13259 ] }) 13260 ] 13261 } 13262 ), 13263 selectedFont && /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13264 import_components26.Flex, 13265 { 13266 justify: "flex-end", 13267 className: "font-library__footer", 13268 children: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13269 import_components26.Button, 13270 { 13271 __next40pxDefaultSize: true, 13272 variant: "primary", 13273 onClick: handleInstall, 13274 isBusy: isInstalling, 13275 disabled: fontsToInstall.length === 0 || isInstalling, 13276 accessibleWhenDisabled: true, 13277 children: (0, import_i18n16.__)("Install") 13278 } 13279 ) 13280 } 13281 ), 13282 !selectedFont && /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)( 13283 import_components26.__experimentalHStack, 13284 { 13285 expanded: false, 13286 className: "font-library__footer", 13287 justify: "end", 13288 spacing: 6, 13289 children: [ 13290 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13291 import_components26.__experimentalHStack, 13292 { 13293 justify: "flex-start", 13294 expanded: false, 13295 spacing: 1, 13296 className: "font-library__page-selection", 13297 children: (0, import_element34.createInterpolateElement)( 13298 (0, import_i18n16.sprintf)( 13299 // translators: 1: Current page number, 2: Total number of pages. 13300 (0, import_i18n16._x)( 13301 "<div>Page</div>%1$s<div>of %2$d</div>", 13302 "paging" 13303 ), 13304 "<CurrentPage />", 13305 totalPages 13306 ), 13307 { 13308 div: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)("div", { "aria-hidden": true }), 13309 // @ts-expect-error — Tag injected via sprintf argument, not visible in format string. 13310 CurrentPage: /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13311 import_components26.SelectControl, 13312 { 13313 "aria-label": (0, import_i18n16.__)( 13314 "Current page" 13315 ), 13316 value: page.toString(), 13317 options: [ 13318 ...Array(totalPages) 13319 ].map((e2, i2) => { 13320 return { 13321 label: (i2 + 1).toString(), 13322 value: (i2 + 1).toString() 13323 }; 13324 }), 13325 onChange: (newPage) => setPage( 13326 parseInt(newPage) 13327 ), 13328 size: "small", 13329 variant: "minimal" 13330 } 13331 ) 13332 } 13333 ) 13334 } 13335 ), 13336 /* @__PURE__ */ (0, import_jsx_runtime52.jsxs)(import_components26.__experimentalHStack, { expanded: false, spacing: 1, children: [ 13337 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13338 import_components26.Button, 13339 { 13340 onClick: () => setPage(page - 1), 13341 disabled: page === 1, 13342 accessibleWhenDisabled: true, 13343 label: (0, import_i18n16.__)("Previous page"), 13344 icon: (0, import_i18n16.isRTL)() ? next_default : previous_default, 13345 showTooltip: true, 13346 size: "compact", 13347 tooltipPosition: "top" 13348 } 13349 ), 13350 /* @__PURE__ */ (0, import_jsx_runtime52.jsx)( 13351 import_components26.Button, 13352 { 13353 onClick: () => setPage(page + 1), 13354 disabled: page === totalPages, 13355 accessibleWhenDisabled: true, 13356 label: (0, import_i18n16.__)("Next page"), 13357 icon: (0, import_i18n16.isRTL)() ? previous_default : next_default, 13358 showTooltip: true, 13359 size: "compact", 13360 tooltipPosition: "top" 13361 } 13362 ) 13363 ] }) 13364 ] 13365 } 13366 ) 13367 ] }) 13368 ] }); 13369 } 13370 var font_collection_default = FontCollection; 13371 13372 // packages/global-styles-ui/build-module/font-library/upload-fonts.mjs 13373 var import_i18n17 = __toESM(require_i18n(), 1); 13374 var import_components28 = __toESM(require_components(), 1); 13375 var import_element35 = __toESM(require_element(), 1); 13376 13377 // packages/global-styles-ui/build-module/font-library/lib/unbrotli.mjs 13378 var __require2 = /* @__PURE__ */ ((x2) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x2, { 13379 get: (a2, b2) => (typeof __require !== "undefined" ? __require : a2)[b2] 13380 }) : x2)(function(x2) { 13381 if (typeof __require !== "undefined") return __require.apply(this, arguments); 13382 throw Error('Dynamic require of "' + x2 + '" is not supported'); 13383 }); 13384 var unbrotli_default = (function() { 13385 var define, module, exports; 13386 return (/* @__PURE__ */ (function() { 13387 function r3(e2, n2, t3) { 13388 function o3(i22, f2) { 13389 if (!n2[i22]) { 13390 if (!e2[i22]) { 13391 var c2 = "function" == typeof __require2 && __require2; 13392 if (!f2 && c2) return c2(i22, true); 13393 if (u2) return u2(i22, true); 13394 var a2 = new Error("Cannot find module '" + i22 + "'"); 13395 throw a2.code = "MODULE_NOT_FOUND", a2; 13396 } 13397 var p3 = n2[i22] = { exports: {} }; 13398 e2[i22][0].call( 13399 p3.exports, 13400 function(r22) { 13401 var n22 = e2[i22][1][r22]; 13402 return o3(n22 || r22); 13403 }, 13404 p3, 13405 p3.exports, 13406 r3, 13407 e2, 13408 n2, 13409 t3 13410 ); 13411 } 13412 return n2[i22].exports; 13413 } 13414 for (var u2 = "function" == typeof __require2 && __require2, i2 = 0; i2 < t3.length; i2++) 13415 o3(t3[i2]); 13416 return o3; 13417 } 13418 return r3; 13419 })())( 13420 { 13421 1: [ 13422 function(require2, module2, exports2) { 13423 var BROTLI_READ_SIZE = 4096; 13424 var BROTLI_IBUF_SIZE = 2 * BROTLI_READ_SIZE + 32; 13425 var BROTLI_IBUF_MASK = 2 * BROTLI_READ_SIZE - 1; 13426 var kBitMask = new Uint32Array([ 13427 0, 13428 1, 13429 3, 13430 7, 13431 15, 13432 31, 13433 63, 13434 127, 13435 255, 13436 511, 13437 1023, 13438 2047, 13439 4095, 13440 8191, 13441 16383, 13442 32767, 13443 65535, 13444 131071, 13445 262143, 13446 524287, 13447 1048575, 13448 2097151, 13449 4194303, 13450 8388607, 13451 16777215 13452 ]); 13453 function BrotliBitReader(input) { 13454 this.buf_ = new Uint8Array(BROTLI_IBUF_SIZE); 13455 this.input_ = input; 13456 this.reset(); 13457 } 13458 BrotliBitReader.READ_SIZE = BROTLI_READ_SIZE; 13459 BrotliBitReader.IBUF_MASK = BROTLI_IBUF_MASK; 13460 BrotliBitReader.prototype.reset = function() { 13461 this.buf_ptr_ = 0; 13462 this.val_ = 0; 13463 this.pos_ = 0; 13464 this.bit_pos_ = 0; 13465 this.bit_end_pos_ = 0; 13466 this.eos_ = 0; 13467 this.readMoreInput(); 13468 for (var i2 = 0; i2 < 4; i2++) { 13469 this.val_ |= this.buf_[this.pos_] << 8 * i2; 13470 ++this.pos_; 13471 } 13472 return this.bit_end_pos_ > 0; 13473 }; 13474 BrotliBitReader.prototype.readMoreInput = function() { 13475 if (this.bit_end_pos_ > 256) { 13476 return; 13477 } else if (this.eos_) { 13478 if (this.bit_pos_ > this.bit_end_pos_) 13479 throw new Error( 13480 "Unexpected end of input " + this.bit_pos_ + " " + this.bit_end_pos_ 13481 ); 13482 } else { 13483 var dst = this.buf_ptr_; 13484 var bytes_read = this.input_.read( 13485 this.buf_, 13486 dst, 13487 BROTLI_READ_SIZE 13488 ); 13489 if (bytes_read < 0) { 13490 throw new Error("Unexpected end of input"); 13491 } 13492 if (bytes_read < BROTLI_READ_SIZE) { 13493 this.eos_ = 1; 13494 for (var p3 = 0; p3 < 32; p3++) 13495 this.buf_[dst + bytes_read + p3] = 0; 13496 } 13497 if (dst === 0) { 13498 for (var p3 = 0; p3 < 32; p3++) 13499 this.buf_[(BROTLI_READ_SIZE << 1) + p3] = this.buf_[p3]; 13500 this.buf_ptr_ = BROTLI_READ_SIZE; 13501 } else { 13502 this.buf_ptr_ = 0; 13503 } 13504 this.bit_end_pos_ += bytes_read << 3; 13505 } 13506 }; 13507 BrotliBitReader.prototype.fillBitWindow = function() { 13508 while (this.bit_pos_ >= 8) { 13509 this.val_ >>>= 8; 13510 this.val_ |= this.buf_[this.pos_ & BROTLI_IBUF_MASK] << 24; 13511 ++this.pos_; 13512 this.bit_pos_ = this.bit_pos_ - 8 >>> 0; 13513 this.bit_end_pos_ = this.bit_end_pos_ - 8 >>> 0; 13514 } 13515 }; 13516 BrotliBitReader.prototype.readBits = function(n_bits) { 13517 if (32 - this.bit_pos_ < n_bits) { 13518 this.fillBitWindow(); 13519 } 13520 var val = this.val_ >>> this.bit_pos_ & kBitMask[n_bits]; 13521 this.bit_pos_ += n_bits; 13522 return val; 13523 }; 13524 module2.exports = BrotliBitReader; 13525 }, 13526 {} 13527 ], 13528 2: [ 13529 function(require2, module2, exports2) { 13530 var CONTEXT_LSB6 = 0; 13531 var CONTEXT_MSB6 = 1; 13532 var CONTEXT_UTF8 = 2; 13533 var CONTEXT_SIGNED = 3; 13534 exports2.lookup = new Uint8Array([ 13535 /* CONTEXT_UTF8, last byte. */ 13536 /* ASCII range. */ 13537 0, 13538 0, 13539 0, 13540 0, 13541 0, 13542 0, 13543 0, 13544 0, 13545 0, 13546 4, 13547 4, 13548 0, 13549 0, 13550 4, 13551 0, 13552 0, 13553 0, 13554 0, 13555 0, 13556 0, 13557 0, 13558 0, 13559 0, 13560 0, 13561 0, 13562 0, 13563 0, 13564 0, 13565 0, 13566 0, 13567 0, 13568 0, 13569 8, 13570 12, 13571 16, 13572 12, 13573 12, 13574 20, 13575 12, 13576 16, 13577 24, 13578 28, 13579 12, 13580 12, 13581 32, 13582 12, 13583 36, 13584 12, 13585 44, 13586 44, 13587 44, 13588 44, 13589 44, 13590 44, 13591 44, 13592 44, 13593 44, 13594 44, 13595 32, 13596 32, 13597 24, 13598 40, 13599 28, 13600 12, 13601 12, 13602 48, 13603 52, 13604 52, 13605 52, 13606 48, 13607 52, 13608 52, 13609 52, 13610 48, 13611 52, 13612 52, 13613 52, 13614 52, 13615 52, 13616 48, 13617 52, 13618 52, 13619 52, 13620 52, 13621 52, 13622 48, 13623 52, 13624 52, 13625 52, 13626 52, 13627 52, 13628 24, 13629 12, 13630 28, 13631 12, 13632 12, 13633 12, 13634 56, 13635 60, 13636 60, 13637 60, 13638 56, 13639 60, 13640 60, 13641 60, 13642 56, 13643 60, 13644 60, 13645 60, 13646 60, 13647 60, 13648 56, 13649 60, 13650 60, 13651 60, 13652 60, 13653 60, 13654 56, 13655 60, 13656 60, 13657 60, 13658 60, 13659 60, 13660 24, 13661 12, 13662 28, 13663 12, 13664 0, 13665 /* UTF8 continuation byte range. */ 13666 0, 13667 1, 13668 0, 13669 1, 13670 0, 13671 1, 13672 0, 13673 1, 13674 0, 13675 1, 13676 0, 13677 1, 13678 0, 13679 1, 13680 0, 13681 1, 13682 0, 13683 1, 13684 0, 13685 1, 13686 0, 13687 1, 13688 0, 13689 1, 13690 0, 13691 1, 13692 0, 13693 1, 13694 0, 13695 1, 13696 0, 13697 1, 13698 0, 13699 1, 13700 0, 13701 1, 13702 0, 13703 1, 13704 0, 13705 1, 13706 0, 13707 1, 13708 0, 13709 1, 13710 0, 13711 1, 13712 0, 13713 1, 13714 0, 13715 1, 13716 0, 13717 1, 13718 0, 13719 1, 13720 0, 13721 1, 13722 0, 13723 1, 13724 0, 13725 1, 13726 0, 13727 1, 13728 0, 13729 1, 13730 2, 13731 3, 13732 2, 13733 3, 13734 2, 13735 3, 13736 2, 13737 3, 13738 2, 13739 3, 13740 2, 13741 3, 13742 2, 13743 3, 13744 2, 13745 3, 13746 2, 13747 3, 13748 2, 13749 3, 13750 2, 13751 3, 13752 2, 13753 3, 13754 2, 13755 3, 13756 2, 13757 3, 13758 2, 13759 3, 13760 2, 13761 3, 13762 2, 13763 3, 13764 2, 13765 3, 13766 2, 13767 3, 13768 2, 13769 3, 13770 2, 13771 3, 13772 2, 13773 3, 13774 2, 13775 3, 13776 2, 13777 3, 13778 2, 13779 3, 13780 2, 13781 3, 13782 2, 13783 3, 13784 2, 13785 3, 13786 2, 13787 3, 13788 2, 13789 3, 13790 2, 13791 3, 13792 2, 13793 3, 13794 /* ASCII range. */ 13795 0, 13796 0, 13797 0, 13798 0, 13799 0, 13800 0, 13801 0, 13802 0, 13803 0, 13804 0, 13805 0, 13806 0, 13807 0, 13808 0, 13809 0, 13810 0, 13811 0, 13812 0, 13813 0, 13814 0, 13815 0, 13816 0, 13817 0, 13818 0, 13819 0, 13820 0, 13821 0, 13822 0, 13823 0, 13824 0, 13825 0, 13826 0, 13827 0, 13828 1, 13829 1, 13830 1, 13831 1, 13832 1, 13833 1, 13834 1, 13835 1, 13836 1, 13837 1, 13838 1, 13839 1, 13840 1, 13841 1, 13842 1, 13843 2, 13844 2, 13845 2, 13846 2, 13847 2, 13848 2, 13849 2, 13850 2, 13851 2, 13852 2, 13853 1, 13854 1, 13855 1, 13856 1, 13857 1, 13858 1, 13859 1, 13860 2, 13861 2, 13862 2, 13863 2, 13864 2, 13865 2, 13866 2, 13867 2, 13868 2, 13869 2, 13870 2, 13871 2, 13872 2, 13873 2, 13874 2, 13875 2, 13876 2, 13877 2, 13878 2, 13879 2, 13880 2, 13881 2, 13882 2, 13883 2, 13884 2, 13885 2, 13886 1, 13887 1, 13888 1, 13889 1, 13890 1, 13891 1, 13892 3, 13893 3, 13894 3, 13895 3, 13896 3, 13897 3, 13898 3, 13899 3, 13900 3, 13901 3, 13902 3, 13903 3, 13904 3, 13905 3, 13906 3, 13907 3, 13908 3, 13909 3, 13910 3, 13911 3, 13912 3, 13913 3, 13914 3, 13915 3, 13916 3, 13917 3, 13918 1, 13919 1, 13920 1, 13921 1, 13922 0, 13923 /* UTF8 continuation byte range. */ 13924 0, 13925 0, 13926 0, 13927 0, 13928 0, 13929 0, 13930 0, 13931 0, 13932 0, 13933 0, 13934 0, 13935 0, 13936 0, 13937 0, 13938 0, 13939 0, 13940 0, 13941 0, 13942 0, 13943 0, 13944 0, 13945 0, 13946 0, 13947 0, 13948 0, 13949 0, 13950 0, 13951 0, 13952 0, 13953 0, 13954 0, 13955 0, 13956 0, 13957 0, 13958 0, 13959 0, 13960 0, 13961 0, 13962 0, 13963 0, 13964 0, 13965 0, 13966 0, 13967 0, 13968 0, 13969 0, 13970 0, 13971 0, 13972 0, 13973 0, 13974 0, 13975 0, 13976 0, 13977 0, 13978 0, 13979 0, 13980 0, 13981 0, 13982 0, 13983 0, 13984 0, 13985 0, 13986 0, 13987 0, 13988 0, 13989 0, 13990 0, 13991 0, 13992 0, 13993 0, 13994 0, 13995 0, 13996 0, 13997 0, 13998 0, 13999 0, 14000 0, 14001 0, 14002 0, 14003 0, 14004 0, 14005 0, 14006 0, 14007 0, 14008 0, 14009 0, 14010 0, 14011 0, 14012 0, 14013 0, 14014 0, 14015 0, 14016 0, 14017 0, 14018 0, 14019 0, 14020 2, 14021 2, 14022 2, 14023 2, 14024 2, 14025 2, 14026 2, 14027 2, 14028 2, 14029 2, 14030 2, 14031 2, 14032 2, 14033 2, 14034 2, 14035 2, 14036 2, 14037 2, 14038 2, 14039 2, 14040 2, 14041 2, 14042 2, 14043 2, 14044 2, 14045 2, 14046 2, 14047 2, 14048 2, 14049 2, 14050 2, 14051 2, 14052 0, 14053 1, 14054 1, 14055 1, 14056 1, 14057 1, 14058 1, 14059 1, 14060 1, 14061 1, 14062 1, 14063 1, 14064 1, 14065 1, 14066 1, 14067 1, 14068 2, 14069 2, 14070 2, 14071 2, 14072 2, 14073 2, 14074 2, 14075 2, 14076 2, 14077 2, 14078 2, 14079 2, 14080 2, 14081 2, 14082 2, 14083 2, 14084 2, 14085 2, 14086 2, 14087 2, 14088 2, 14089 2, 14090 2, 14091 2, 14092 2, 14093 2, 14094 2, 14095 2, 14096 2, 14097 2, 14098 2, 14099 2, 14100 2, 14101 2, 14102 2, 14103 2, 14104 2, 14105 2, 14106 2, 14107 2, 14108 2, 14109 2, 14110 2, 14111 2, 14112 2, 14113 2, 14114 2, 14115 2, 14116 3, 14117 3, 14118 3, 14119 3, 14120 3, 14121 3, 14122 3, 14123 3, 14124 3, 14125 3, 14126 3, 14127 3, 14128 3, 14129 3, 14130 3, 14131 3, 14132 3, 14133 3, 14134 3, 14135 3, 14136 3, 14137 3, 14138 3, 14139 3, 14140 3, 14141 3, 14142 3, 14143 3, 14144 3, 14145 3, 14146 3, 14147 3, 14148 3, 14149 3, 14150 3, 14151 3, 14152 3, 14153 3, 14154 3, 14155 3, 14156 3, 14157 3, 14158 3, 14159 3, 14160 3, 14161 3, 14162 3, 14163 3, 14164 3, 14165 3, 14166 3, 14167 3, 14168 3, 14169 3, 14170 3, 14171 3, 14172 3, 14173 3, 14174 3, 14175 3, 14176 3, 14177 3, 14178 3, 14179 3, 14180 4, 14181 4, 14182 4, 14183 4, 14184 4, 14185 4, 14186 4, 14187 4, 14188 4, 14189 4, 14190 4, 14191 4, 14192 4, 14193 4, 14194 4, 14195 4, 14196 4, 14197 4, 14198 4, 14199 4, 14200 4, 14201 4, 14202 4, 14203 4, 14204 4, 14205 4, 14206 4, 14207 4, 14208 4, 14209 4, 14210 4, 14211 4, 14212 4, 14213 4, 14214 4, 14215 4, 14216 4, 14217 4, 14218 4, 14219 4, 14220 4, 14221 4, 14222 4, 14223 4, 14224 4, 14225 4, 14226 4, 14227 4, 14228 4, 14229 4, 14230 4, 14231 4, 14232 4, 14233 4, 14234 4, 14235 4, 14236 4, 14237 4, 14238 4, 14239 4, 14240 4, 14241 4, 14242 4, 14243 4, 14244 5, 14245 5, 14246 5, 14247 5, 14248 5, 14249 5, 14250 5, 14251 5, 14252 5, 14253 5, 14254 5, 14255 5, 14256 5, 14257 5, 14258 5, 14259 5, 14260 5, 14261 5, 14262 5, 14263 5, 14264 5, 14265 5, 14266 5, 14267 5, 14268 5, 14269 5, 14270 5, 14271 5, 14272 5, 14273 5, 14274 5, 14275 5, 14276 5, 14277 5, 14278 5, 14279 5, 14280 5, 14281 5, 14282 5, 14283 5, 14284 5, 14285 5, 14286 5, 14287 5, 14288 5, 14289 5, 14290 5, 14291 5, 14292 6, 14293 6, 14294 6, 14295 6, 14296 6, 14297 6, 14298 6, 14299 6, 14300 6, 14301 6, 14302 6, 14303 6, 14304 6, 14305 6, 14306 6, 14307 7, 14308 /* CONTEXT_SIGNED, last byte, same as the above values shifted by 3 bits. */ 14309 0, 14310 8, 14311 8, 14312 8, 14313 8, 14314 8, 14315 8, 14316 8, 14317 8, 14318 8, 14319 8, 14320 8, 14321 8, 14322 8, 14323 8, 14324 8, 14325 16, 14326 16, 14327 16, 14328 16, 14329 16, 14330 16, 14331 16, 14332 16, 14333 16, 14334 16, 14335 16, 14336 16, 14337 16, 14338 16, 14339 16, 14340 16, 14341 16, 14342 16, 14343 16, 14344 16, 14345 16, 14346 16, 14347 16, 14348 16, 14349 16, 14350 16, 14351 16, 14352 16, 14353 16, 14354 16, 14355 16, 14356 16, 14357 16, 14358 16, 14359 16, 14360 16, 14361 16, 14362 16, 14363 16, 14364 16, 14365 16, 14366 16, 14367 16, 14368 16, 14369 16, 14370 16, 14371 16, 14372 16, 14373 24, 14374 24, 14375 24, 14376 24, 14377 24, 14378 24, 14379 24, 14380 24, 14381 24, 14382 24, 14383 24, 14384 24, 14385 24, 14386 24, 14387 24, 14388 24, 14389 24, 14390 24, 14391 24, 14392 24, 14393 24, 14394 24, 14395 24, 14396 24, 14397 24, 14398 24, 14399 24, 14400 24, 14401 24, 14402 24, 14403 24, 14404 24, 14405 24, 14406 24, 14407 24, 14408 24, 14409 24, 14410 24, 14411 24, 14412 24, 14413 24, 14414 24, 14415 24, 14416 24, 14417 24, 14418 24, 14419 24, 14420 24, 14421 24, 14422 24, 14423 24, 14424 24, 14425 24, 14426 24, 14427 24, 14428 24, 14429 24, 14430 24, 14431 24, 14432 24, 14433 24, 14434 24, 14435 24, 14436 24, 14437 32, 14438 32, 14439 32, 14440 32, 14441 32, 14442 32, 14443 32, 14444 32, 14445 32, 14446 32, 14447 32, 14448 32, 14449 32, 14450 32, 14451 32, 14452 32, 14453 32, 14454 32, 14455 32, 14456 32, 14457 32, 14458 32, 14459 32, 14460 32, 14461 32, 14462 32, 14463 32, 14464 32, 14465 32, 14466 32, 14467 32, 14468 32, 14469 32, 14470 32, 14471 32, 14472 32, 14473 32, 14474 32, 14475 32, 14476 32, 14477 32, 14478 32, 14479 32, 14480 32, 14481 32, 14482 32, 14483 32, 14484 32, 14485 32, 14486 32, 14487 32, 14488 32, 14489 32, 14490 32, 14491 32, 14492 32, 14493 32, 14494 32, 14495 32, 14496 32, 14497 32, 14498 32, 14499 32, 14500 32, 14501 40, 14502 40, 14503 40, 14504 40, 14505 40, 14506 40, 14507 40, 14508 40, 14509 40, 14510 40, 14511 40, 14512 40, 14513 40, 14514 40, 14515 40, 14516 40, 14517 40, 14518 40, 14519 40, 14520 40, 14521 40, 14522 40, 14523 40, 14524 40, 14525 40, 14526 40, 14527 40, 14528 40, 14529 40, 14530 40, 14531 40, 14532 40, 14533 40, 14534 40, 14535 40, 14536 40, 14537 40, 14538 40, 14539 40, 14540 40, 14541 40, 14542 40, 14543 40, 14544 40, 14545 40, 14546 40, 14547 40, 14548 40, 14549 48, 14550 48, 14551 48, 14552 48, 14553 48, 14554 48, 14555 48, 14556 48, 14557 48, 14558 48, 14559 48, 14560 48, 14561 48, 14562 48, 14563 48, 14564 56, 14565 /* CONTEXT_LSB6, last byte. */ 14566 0, 14567 1, 14568 2, 14569 3, 14570 4, 14571 5, 14572 6, 14573 7, 14574 8, 14575 9, 14576 10, 14577 11, 14578 12, 14579 13, 14580 14, 14581 15, 14582 16, 14583 17, 14584 18, 14585 19, 14586 20, 14587 21, 14588 22, 14589 23, 14590 24, 14591 25, 14592 26, 14593 27, 14594 28, 14595 29, 14596 30, 14597 31, 14598 32, 14599 33, 14600 34, 14601 35, 14602 36, 14603 37, 14604 38, 14605 39, 14606 40, 14607 41, 14608 42, 14609 43, 14610 44, 14611 45, 14612 46, 14613 47, 14614 48, 14615 49, 14616 50, 14617 51, 14618 52, 14619 53, 14620 54, 14621 55, 14622 56, 14623 57, 14624 58, 14625 59, 14626 60, 14627 61, 14628 62, 14629 63, 14630 0, 14631 1, 14632 2, 14633 3, 14634 4, 14635 5, 14636 6, 14637 7, 14638 8, 14639 9, 14640 10, 14641 11, 14642 12, 14643 13, 14644 14, 14645 15, 14646 16, 14647 17, 14648 18, 14649 19, 14650 20, 14651 21, 14652 22, 14653 23, 14654 24, 14655 25, 14656 26, 14657 27, 14658 28, 14659 29, 14660 30, 14661 31, 14662 32, 14663 33, 14664 34, 14665 35, 14666 36, 14667 37, 14668 38, 14669 39, 14670 40, 14671 41, 14672 42, 14673 43, 14674 44, 14675 45, 14676 46, 14677 47, 14678 48, 14679 49, 14680 50, 14681 51, 14682 52, 14683 53, 14684 54, 14685 55, 14686 56, 14687 57, 14688 58, 14689 59, 14690 60, 14691 61, 14692 62, 14693 63, 14694 0, 14695 1, 14696 2, 14697 3, 14698 4, 14699 5, 14700 6, 14701 7, 14702 8, 14703 9, 14704 10, 14705 11, 14706 12, 14707 13, 14708 14, 14709 15, 14710 16, 14711 17, 14712 18, 14713 19, 14714 20, 14715 21, 14716 22, 14717 23, 14718 24, 14719 25, 14720 26, 14721 27, 14722 28, 14723 29, 14724 30, 14725 31, 14726 32, 14727 33, 14728 34, 14729 35, 14730 36, 14731 37, 14732 38, 14733 39, 14734 40, 14735 41, 14736 42, 14737 43, 14738 44, 14739 45, 14740 46, 14741 47, 14742 48, 14743 49, 14744 50, 14745 51, 14746 52, 14747 53, 14748 54, 14749 55, 14750 56, 14751 57, 14752 58, 14753 59, 14754 60, 14755 61, 14756 62, 14757 63, 14758 0, 14759 1, 14760 2, 14761 3, 14762 4, 14763 5, 14764 6, 14765 7, 14766 8, 14767 9, 14768 10, 14769 11, 14770 12, 14771 13, 14772 14, 14773 15, 14774 16, 14775 17, 14776 18, 14777 19, 14778 20, 14779 21, 14780 22, 14781 23, 14782 24, 14783 25, 14784 26, 14785 27, 14786 28, 14787 29, 14788 30, 14789 31, 14790 32, 14791 33, 14792 34, 14793 35, 14794 36, 14795 37, 14796 38, 14797 39, 14798 40, 14799 41, 14800 42, 14801 43, 14802 44, 14803 45, 14804 46, 14805 47, 14806 48, 14807 49, 14808 50, 14809 51, 14810 52, 14811 53, 14812 54, 14813 55, 14814 56, 14815 57, 14816 58, 14817 59, 14818 60, 14819 61, 14820 62, 14821 63, 14822 /* CONTEXT_MSB6, last byte. */ 14823 0, 14824 0, 14825 0, 14826 0, 14827 1, 14828 1, 14829 1, 14830 1, 14831 2, 14832 2, 14833 2, 14834 2, 14835 3, 14836 3, 14837 3, 14838 3, 14839 4, 14840 4, 14841 4, 14842 4, 14843 5, 14844 5, 14845 5, 14846 5, 14847 6, 14848 6, 14849 6, 14850 6, 14851 7, 14852 7, 14853 7, 14854 7, 14855 8, 14856 8, 14857 8, 14858 8, 14859 9, 14860 9, 14861 9, 14862 9, 14863 10, 14864 10, 14865 10, 14866 10, 14867 11, 14868 11, 14869 11, 14870 11, 14871 12, 14872 12, 14873 12, 14874 12, 14875 13, 14876 13, 14877 13, 14878 13, 14879 14, 14880 14, 14881 14, 14882 14, 14883 15, 14884 15, 14885 15, 14886 15, 14887 16, 14888 16, 14889 16, 14890 16, 14891 17, 14892 17, 14893 17, 14894 17, 14895 18, 14896 18, 14897 18, 14898 18, 14899 19, 14900 19, 14901 19, 14902 19, 14903 20, 14904 20, 14905 20, 14906 20, 14907 21, 14908 21, 14909 21, 14910 21, 14911 22, 14912 22, 14913 22, 14914 22, 14915 23, 14916 23, 14917 23, 14918 23, 14919 24, 14920 24, 14921 24, 14922 24, 14923 25, 14924 25, 14925 25, 14926 25, 14927 26, 14928 26, 14929 26, 14930 26, 14931 27, 14932 27, 14933 27, 14934 27, 14935 28, 14936 28, 14937 28, 14938 28, 14939 29, 14940 29, 14941 29, 14942 29, 14943 30, 14944 30, 14945 30, 14946 30, 14947 31, 14948 31, 14949 31, 14950 31, 14951 32, 14952 32, 14953 32, 14954 32, 14955 33, 14956 33, 14957 33, 14958 33, 14959 34, 14960 34, 14961 34, 14962 34, 14963 35, 14964 35, 14965 35, 14966 35, 14967 36, 14968 36, 14969 36, 14970 36, 14971 37, 14972 37, 14973 37, 14974 37, 14975 38, 14976 38, 14977 38, 14978 38, 14979 39, 14980 39, 14981 39, 14982 39, 14983 40, 14984 40, 14985 40, 14986 40, 14987 41, 14988 41, 14989 41, 14990 41, 14991 42, 14992 42, 14993 42, 14994 42, 14995 43, 14996 43, 14997 43, 14998 43, 14999 44, 15000 44, 15001 44, 15002 44, 15003 45, 15004 45, 15005 45, 15006 45, 15007 46, 15008 46, 15009 46, 15010 46, 15011 47, 15012 47, 15013 47, 15014 47, 15015 48, 15016 48, 15017 48, 15018 48, 15019 49, 15020 49, 15021 49, 15022 49, 15023 50, 15024 50, 15025 50, 15026 50, 15027 51, 15028 51, 15029 51, 15030 51, 15031 52, 15032 52, 15033 52, 15034 52, 15035 53, 15036 53, 15037 53, 15038 53, 15039 54, 15040 54, 15041 54, 15042 54, 15043 55, 15044 55, 15045 55, 15046 55, 15047 56, 15048 56, 15049 56, 15050 56, 15051 57, 15052 57, 15053 57, 15054 57, 15055 58, 15056 58, 15057 58, 15058 58, 15059 59, 15060 59, 15061 59, 15062 59, 15063 60, 15064 60, 15065 60, 15066 60, 15067 61, 15068 61, 15069 61, 15070 61, 15071 62, 15072 62, 15073 62, 15074 62, 15075 63, 15076 63, 15077 63, 15078 63, 15079 /* CONTEXT_{M,L}SB6, second last byte, */ 15080 0, 15081 0, 15082 0, 15083 0, 15084 0, 15085 0, 15086 0, 15087 0, 15088 0, 15089 0, 15090 0, 15091 0, 15092 0, 15093 0, 15094 0, 15095 0, 15096 0, 15097 0, 15098 0, 15099 0, 15100 0, 15101 0, 15102 0, 15103 0, 15104 0, 15105 0, 15106 0, 15107 0, 15108 0, 15109 0, 15110 0, 15111 0, 15112 0, 15113 0, 15114 0, 15115 0, 15116 0, 15117 0, 15118 0, 15119 0, 15120 0, 15121 0, 15122 0, 15123 0, 15124 0, 15125 0, 15126 0, 15127 0, 15128 0, 15129 0, 15130 0, 15131 0, 15132 0, 15133 0, 15134 0, 15135 0, 15136 0, 15137 0, 15138 0, 15139 0, 15140 0, 15141 0, 15142 0, 15143 0, 15144 0, 15145 0, 15146 0, 15147 0, 15148 0, 15149 0, 15150 0, 15151 0, 15152 0, 15153 0, 15154 0, 15155 0, 15156 0, 15157 0, 15158 0, 15159 0, 15160 0, 15161 0, 15162 0, 15163 0, 15164 0, 15165 0, 15166 0, 15167 0, 15168 0, 15169 0, 15170 0, 15171 0, 15172 0, 15173 0, 15174 0, 15175 0, 15176 0, 15177 0, 15178 0, 15179 0, 15180 0, 15181 0, 15182 0, 15183 0, 15184 0, 15185 0, 15186 0, 15187 0, 15188 0, 15189 0, 15190 0, 15191 0, 15192 0, 15193 0, 15194 0, 15195 0, 15196 0, 15197 0, 15198 0, 15199 0, 15200 0, 15201 0, 15202 0, 15203 0, 15204 0, 15205 0, 15206 0, 15207 0, 15208 0, 15209 0, 15210 0, 15211 0, 15212 0, 15213 0, 15214 0, 15215 0, 15216 0, 15217 0, 15218 0, 15219 0, 15220 0, 15221 0, 15222 0, 15223 0, 15224 0, 15225 0, 15226 0, 15227 0, 15228 0, 15229 0, 15230 0, 15231 0, 15232 0, 15233 0, 15234 0, 15235 0, 15236 0, 15237 0, 15238 0, 15239 0, 15240 0, 15241 0, 15242 0, 15243 0, 15244 0, 15245 0, 15246 0, 15247 0, 15248 0, 15249 0, 15250 0, 15251 0, 15252 0, 15253 0, 15254 0, 15255 0, 15256 0, 15257 0, 15258 0, 15259 0, 15260 0, 15261 0, 15262 0, 15263 0, 15264 0, 15265 0, 15266 0, 15267 0, 15268 0, 15269 0, 15270 0, 15271 0, 15272 0, 15273 0, 15274 0, 15275 0, 15276 0, 15277 0, 15278 0, 15279 0, 15280 0, 15281 0, 15282 0, 15283 0, 15284 0, 15285 0, 15286 0, 15287 0, 15288 0, 15289 0, 15290 0, 15291 0, 15292 0, 15293 0, 15294 0, 15295 0, 15296 0, 15297 0, 15298 0, 15299 0, 15300 0, 15301 0, 15302 0, 15303 0, 15304 0, 15305 0, 15306 0, 15307 0, 15308 0, 15309 0, 15310 0, 15311 0, 15312 0, 15313 0, 15314 0, 15315 0, 15316 0, 15317 0, 15318 0, 15319 0, 15320 0, 15321 0, 15322 0, 15323 0, 15324 0, 15325 0, 15326 0, 15327 0, 15328 0, 15329 0, 15330 0, 15331 0, 15332 0, 15333 0, 15334 0, 15335 0 15336 ]); 15337 exports2.lookupOffsets = new Uint16Array([ 15338 /* CONTEXT_LSB6 */ 15339 1024, 15340 1536, 15341 1280, 15342 1536, 15343 0, 15344 256, 15345 768, 15346 512 15347 ]); 15348 }, 15349 {} 15350 ], 15351 3: [ 15352 function(require2, module2, exports2) { 15353 var BrotliInput = require2("./streams").BrotliInput; 15354 var BrotliOutput = require2("./streams").BrotliOutput; 15355 var BrotliBitReader = require2("./bit_reader"); 15356 var BrotliDictionary = require2("./dictionary"); 15357 var HuffmanCode = require2("./huffman").HuffmanCode; 15358 var BrotliBuildHuffmanTable = require2("./huffman").BrotliBuildHuffmanTable; 15359 var Context = require2("./context"); 15360 var Prefix = require2("./prefix"); 15361 var Transform = require2("./transform"); 15362 var kDefaultCodeLength = 8; 15363 var kCodeLengthRepeatCode = 16; 15364 var kNumLiteralCodes = 256; 15365 var kNumInsertAndCopyCodes = 704; 15366 var kNumBlockLengthCodes = 26; 15367 var kLiteralContextBits = 6; 15368 var kDistanceContextBits = 2; 15369 var HUFFMAN_TABLE_BITS = 8; 15370 var HUFFMAN_TABLE_MASK = 255; 15371 var HUFFMAN_MAX_TABLE_SIZE = 1080; 15372 var CODE_LENGTH_CODES = 18; 15373 var kCodeLengthCodeOrder = new Uint8Array([ 15374 1, 15375 2, 15376 3, 15377 4, 15378 0, 15379 5, 15380 17, 15381 6, 15382 16, 15383 7, 15384 8, 15385 9, 15386 10, 15387 11, 15388 12, 15389 13, 15390 14, 15391 15 15392 ]); 15393 var NUM_DISTANCE_SHORT_CODES = 16; 15394 var kDistanceShortCodeIndexOffset = new Uint8Array([ 15395 3, 15396 2, 15397 1, 15398 0, 15399 3, 15400 3, 15401 3, 15402 3, 15403 3, 15404 3, 15405 2, 15406 2, 15407 2, 15408 2, 15409 2, 15410 2 15411 ]); 15412 var kDistanceShortCodeValueOffset = new Int8Array([ 15413 0, 15414 0, 15415 0, 15416 0, 15417 -1, 15418 1, 15419 -2, 15420 2, 15421 -3, 15422 3, 15423 -1, 15424 1, 15425 -2, 15426 2, 15427 -3, 15428 3 15429 ]); 15430 var kMaxHuffmanTableSize = new Uint16Array([ 15431 256, 15432 402, 15433 436, 15434 468, 15435 500, 15436 534, 15437 566, 15438 598, 15439 630, 15440 662, 15441 694, 15442 726, 15443 758, 15444 790, 15445 822, 15446 854, 15447 886, 15448 920, 15449 952, 15450 984, 15451 1016, 15452 1048, 15453 1080 15454 ]); 15455 function DecodeWindowBits(br) { 15456 var n2; 15457 if (br.readBits(1) === 0) { 15458 return 16; 15459 } 15460 n2 = br.readBits(3); 15461 if (n2 > 0) { 15462 return 17 + n2; 15463 } 15464 n2 = br.readBits(3); 15465 if (n2 > 0) { 15466 return 8 + n2; 15467 } 15468 return 17; 15469 } 15470 function DecodeVarLenUint8(br) { 15471 if (br.readBits(1)) { 15472 var nbits = br.readBits(3); 15473 if (nbits === 0) { 15474 return 1; 15475 } else { 15476 return br.readBits(nbits) + (1 << nbits); 15477 } 15478 } 15479 return 0; 15480 } 15481 function MetaBlockLength() { 15482 this.meta_block_length = 0; 15483 this.input_end = 0; 15484 this.is_uncompressed = 0; 15485 this.is_metadata = false; 15486 } 15487 function DecodeMetaBlockLength(br) { 15488 var out = new MetaBlockLength(); 15489 var size_nibbles; 15490 var size_bytes; 15491 var i2; 15492 out.input_end = br.readBits(1); 15493 if (out.input_end && br.readBits(1)) { 15494 return out; 15495 } 15496 size_nibbles = br.readBits(2) + 4; 15497 if (size_nibbles === 7) { 15498 out.is_metadata = true; 15499 if (br.readBits(1) !== 0) 15500 throw new Error("Invalid reserved bit"); 15501 size_bytes = br.readBits(2); 15502 if (size_bytes === 0) return out; 15503 for (i2 = 0; i2 < size_bytes; i2++) { 15504 var next_byte = br.readBits(8); 15505 if (i2 + 1 === size_bytes && size_bytes > 1 && next_byte === 0) 15506 throw new Error("Invalid size byte"); 15507 out.meta_block_length |= next_byte << i2 * 8; 15508 } 15509 } else { 15510 for (i2 = 0; i2 < size_nibbles; ++i2) { 15511 var next_nibble = br.readBits(4); 15512 if (i2 + 1 === size_nibbles && size_nibbles > 4 && next_nibble === 0) 15513 throw new Error("Invalid size nibble"); 15514 out.meta_block_length |= next_nibble << i2 * 4; 15515 } 15516 } 15517 ++out.meta_block_length; 15518 if (!out.input_end && !out.is_metadata) { 15519 out.is_uncompressed = br.readBits(1); 15520 } 15521 return out; 15522 } 15523 function ReadSymbol(table, index2, br) { 15524 var start_index = index2; 15525 var nbits; 15526 br.fillBitWindow(); 15527 index2 += br.val_ >>> br.bit_pos_ & HUFFMAN_TABLE_MASK; 15528 nbits = table[index2].bits - HUFFMAN_TABLE_BITS; 15529 if (nbits > 0) { 15530 br.bit_pos_ += HUFFMAN_TABLE_BITS; 15531 index2 += table[index2].value; 15532 index2 += br.val_ >>> br.bit_pos_ & (1 << nbits) - 1; 15533 } 15534 br.bit_pos_ += table[index2].bits; 15535 return table[index2].value; 15536 } 15537 function ReadHuffmanCodeLengths(code_length_code_lengths, num_symbols, code_lengths, br) { 15538 var symbol = 0; 15539 var prev_code_len = kDefaultCodeLength; 15540 var repeat = 0; 15541 var repeat_code_len = 0; 15542 var space = 32768; 15543 var table = []; 15544 for (var i2 = 0; i2 < 32; i2++) 15545 table.push(new HuffmanCode(0, 0)); 15546 BrotliBuildHuffmanTable( 15547 table, 15548 0, 15549 5, 15550 code_length_code_lengths, 15551 CODE_LENGTH_CODES 15552 ); 15553 while (symbol < num_symbols && space > 0) { 15554 var p3 = 0; 15555 var code_len; 15556 br.readMoreInput(); 15557 br.fillBitWindow(); 15558 p3 += br.val_ >>> br.bit_pos_ & 31; 15559 br.bit_pos_ += table[p3].bits; 15560 code_len = table[p3].value & 255; 15561 if (code_len < kCodeLengthRepeatCode) { 15562 repeat = 0; 15563 code_lengths[symbol++] = code_len; 15564 if (code_len !== 0) { 15565 prev_code_len = code_len; 15566 space -= 32768 >> code_len; 15567 } 15568 } else { 15569 var extra_bits = code_len - 14; 15570 var old_repeat; 15571 var repeat_delta; 15572 var new_len = 0; 15573 if (code_len === kCodeLengthRepeatCode) { 15574 new_len = prev_code_len; 15575 } 15576 if (repeat_code_len !== new_len) { 15577 repeat = 0; 15578 repeat_code_len = new_len; 15579 } 15580 old_repeat = repeat; 15581 if (repeat > 0) { 15582 repeat -= 2; 15583 repeat <<= extra_bits; 15584 } 15585 repeat += br.readBits(extra_bits) + 3; 15586 repeat_delta = repeat - old_repeat; 15587 if (symbol + repeat_delta > num_symbols) { 15588 throw new Error( 15589 "[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols" 15590 ); 15591 } 15592 for (var x2 = 0; x2 < repeat_delta; x2++) 15593 code_lengths[symbol + x2] = repeat_code_len; 15594 symbol += repeat_delta; 15595 if (repeat_code_len !== 0) { 15596 space -= repeat_delta << 15 - repeat_code_len; 15597 } 15598 } 15599 } 15600 if (space !== 0) { 15601 throw new Error( 15602 "[ReadHuffmanCodeLengths] space = " + space 15603 ); 15604 } 15605 for (; symbol < num_symbols; symbol++) 15606 code_lengths[symbol] = 0; 15607 } 15608 function ReadHuffmanCode(alphabet_size, tables, table, br) { 15609 var table_size = 0; 15610 var simple_code_or_skip; 15611 var code_lengths = new Uint8Array(alphabet_size); 15612 br.readMoreInput(); 15613 simple_code_or_skip = br.readBits(2); 15614 if (simple_code_or_skip === 1) { 15615 var i2; 15616 var max_bits_counter = alphabet_size - 1; 15617 var max_bits = 0; 15618 var symbols = new Int32Array(4); 15619 var num_symbols = br.readBits(2) + 1; 15620 while (max_bits_counter) { 15621 max_bits_counter >>= 1; 15622 ++max_bits; 15623 } 15624 for (i2 = 0; i2 < num_symbols; ++i2) { 15625 symbols[i2] = br.readBits(max_bits) % alphabet_size; 15626 code_lengths[symbols[i2]] = 2; 15627 } 15628 code_lengths[symbols[0]] = 1; 15629 switch (num_symbols) { 15630 case 1: 15631 break; 15632 case 3: 15633 if (symbols[0] === symbols[1] || symbols[0] === symbols[2] || symbols[1] === symbols[2]) { 15634 throw new Error( 15635 "[ReadHuffmanCode] invalid symbols" 15636 ); 15637 } 15638 break; 15639 case 2: 15640 if (symbols[0] === symbols[1]) { 15641 throw new Error( 15642 "[ReadHuffmanCode] invalid symbols" 15643 ); 15644 } 15645 code_lengths[symbols[1]] = 1; 15646 break; 15647 case 4: 15648 if (symbols[0] === symbols[1] || symbols[0] === symbols[2] || symbols[0] === symbols[3] || symbols[1] === symbols[2] || symbols[1] === symbols[3] || symbols[2] === symbols[3]) { 15649 throw new Error( 15650 "[ReadHuffmanCode] invalid symbols" 15651 ); 15652 } 15653 if (br.readBits(1)) { 15654 code_lengths[symbols[2]] = 3; 15655 code_lengths[symbols[3]] = 3; 15656 } else { 15657 code_lengths[symbols[0]] = 2; 15658 } 15659 break; 15660 } 15661 } else { 15662 var i2; 15663 var code_length_code_lengths = new Uint8Array( 15664 CODE_LENGTH_CODES 15665 ); 15666 var space = 32; 15667 var num_codes = 0; 15668 var huff = [ 15669 new HuffmanCode(2, 0), 15670 new HuffmanCode(2, 4), 15671 new HuffmanCode(2, 3), 15672 new HuffmanCode(3, 2), 15673 new HuffmanCode(2, 0), 15674 new HuffmanCode(2, 4), 15675 new HuffmanCode(2, 3), 15676 new HuffmanCode(4, 1), 15677 new HuffmanCode(2, 0), 15678 new HuffmanCode(2, 4), 15679 new HuffmanCode(2, 3), 15680 new HuffmanCode(3, 2), 15681 new HuffmanCode(2, 0), 15682 new HuffmanCode(2, 4), 15683 new HuffmanCode(2, 3), 15684 new HuffmanCode(4, 5) 15685 ]; 15686 for (i2 = simple_code_or_skip; i2 < CODE_LENGTH_CODES && space > 0; ++i2) { 15687 var code_len_idx = kCodeLengthCodeOrder[i2]; 15688 var p3 = 0; 15689 var v2; 15690 br.fillBitWindow(); 15691 p3 += br.val_ >>> br.bit_pos_ & 15; 15692 br.bit_pos_ += huff[p3].bits; 15693 v2 = huff[p3].value; 15694 code_length_code_lengths[code_len_idx] = v2; 15695 if (v2 !== 0) { 15696 space -= 32 >> v2; 15697 ++num_codes; 15698 } 15699 } 15700 if (!(num_codes === 1 || space === 0)) 15701 throw new Error( 15702 "[ReadHuffmanCode] invalid num_codes or space" 15703 ); 15704 ReadHuffmanCodeLengths( 15705 code_length_code_lengths, 15706 alphabet_size, 15707 code_lengths, 15708 br 15709 ); 15710 } 15711 table_size = BrotliBuildHuffmanTable( 15712 tables, 15713 table, 15714 HUFFMAN_TABLE_BITS, 15715 code_lengths, 15716 alphabet_size 15717 ); 15718 if (table_size === 0) { 15719 throw new Error( 15720 "[ReadHuffmanCode] BuildHuffmanTable failed: " 15721 ); 15722 } 15723 return table_size; 15724 } 15725 function ReadBlockLength(table, index2, br) { 15726 var code; 15727 var nbits; 15728 code = ReadSymbol(table, index2, br); 15729 nbits = Prefix.kBlockLengthPrefixCode[code].nbits; 15730 return Prefix.kBlockLengthPrefixCode[code].offset + br.readBits(nbits); 15731 } 15732 function TranslateShortCodes(code, ringbuffer, index2) { 15733 var val; 15734 if (code < NUM_DISTANCE_SHORT_CODES) { 15735 index2 += kDistanceShortCodeIndexOffset[code]; 15736 index2 &= 3; 15737 val = ringbuffer[index2] + kDistanceShortCodeValueOffset[code]; 15738 } else { 15739 val = code - NUM_DISTANCE_SHORT_CODES + 1; 15740 } 15741 return val; 15742 } 15743 function MoveToFront(v2, index2) { 15744 var value = v2[index2]; 15745 var i2 = index2; 15746 for (; i2; --i2) v2[i2] = v2[i2 - 1]; 15747 v2[0] = value; 15748 } 15749 function InverseMoveToFrontTransform(v2, v_len) { 15750 var mtf = new Uint8Array(256); 15751 var i2; 15752 for (i2 = 0; i2 < 256; ++i2) { 15753 mtf[i2] = i2; 15754 } 15755 for (i2 = 0; i2 < v_len; ++i2) { 15756 var index2 = v2[i2]; 15757 v2[i2] = mtf[index2]; 15758 if (index2) MoveToFront(mtf, index2); 15759 } 15760 } 15761 function HuffmanTreeGroup(alphabet_size, num_htrees) { 15762 this.alphabet_size = alphabet_size; 15763 this.num_htrees = num_htrees; 15764 this.codes = new Array( 15765 num_htrees + num_htrees * kMaxHuffmanTableSize[alphabet_size + 31 >>> 5] 15766 ); 15767 this.htrees = new Uint32Array(num_htrees); 15768 } 15769 HuffmanTreeGroup.prototype.decode = function(br) { 15770 var i2; 15771 var table_size; 15772 var next = 0; 15773 for (i2 = 0; i2 < this.num_htrees; ++i2) { 15774 this.htrees[i2] = next; 15775 table_size = ReadHuffmanCode( 15776 this.alphabet_size, 15777 this.codes, 15778 next, 15779 br 15780 ); 15781 next += table_size; 15782 } 15783 }; 15784 function DecodeContextMap(context_map_size, br) { 15785 var out = { num_htrees: null, context_map: null }; 15786 var use_rle_for_zeros; 15787 var max_run_length_prefix = 0; 15788 var table; 15789 var i2; 15790 br.readMoreInput(); 15791 var num_htrees = out.num_htrees = DecodeVarLenUint8(br) + 1; 15792 var context_map = out.context_map = new Uint8Array( 15793 context_map_size 15794 ); 15795 if (num_htrees <= 1) { 15796 return out; 15797 } 15798 use_rle_for_zeros = br.readBits(1); 15799 if (use_rle_for_zeros) { 15800 max_run_length_prefix = br.readBits(4) + 1; 15801 } 15802 table = []; 15803 for (i2 = 0; i2 < HUFFMAN_MAX_TABLE_SIZE; i2++) { 15804 table[i2] = new HuffmanCode(0, 0); 15805 } 15806 ReadHuffmanCode( 15807 num_htrees + max_run_length_prefix, 15808 table, 15809 0, 15810 br 15811 ); 15812 for (i2 = 0; i2 < context_map_size; ) { 15813 var code; 15814 br.readMoreInput(); 15815 code = ReadSymbol(table, 0, br); 15816 if (code === 0) { 15817 context_map[i2] = 0; 15818 ++i2; 15819 } else if (code <= max_run_length_prefix) { 15820 var reps = 1 + (1 << code) + br.readBits(code); 15821 while (--reps) { 15822 if (i2 >= context_map_size) { 15823 throw new Error( 15824 "[DecodeContextMap] i >= context_map_size" 15825 ); 15826 } 15827 context_map[i2] = 0; 15828 ++i2; 15829 } 15830 } else { 15831 context_map[i2] = code - max_run_length_prefix; 15832 ++i2; 15833 } 15834 } 15835 if (br.readBits(1)) { 15836 InverseMoveToFrontTransform( 15837 context_map, 15838 context_map_size 15839 ); 15840 } 15841 return out; 15842 } 15843 function DecodeBlockType(max_block_type, trees, tree_type, block_types, ringbuffers, indexes, br) { 15844 var ringbuffer = tree_type * 2; 15845 var index2 = tree_type; 15846 var type_code = ReadSymbol( 15847 trees, 15848 tree_type * HUFFMAN_MAX_TABLE_SIZE, 15849 br 15850 ); 15851 var block_type; 15852 if (type_code === 0) { 15853 block_type = ringbuffers[ringbuffer + (indexes[index2] & 1)]; 15854 } else if (type_code === 1) { 15855 block_type = ringbuffers[ringbuffer + (indexes[index2] - 1 & 1)] + 1; 15856 } else { 15857 block_type = type_code - 2; 15858 } 15859 if (block_type >= max_block_type) { 15860 block_type -= max_block_type; 15861 } 15862 block_types[tree_type] = block_type; 15863 ringbuffers[ringbuffer + (indexes[index2] & 1)] = block_type; 15864 ++indexes[index2]; 15865 } 15866 function CopyUncompressedBlockToOutput(output, len, pos, ringbuffer, ringbuffer_mask, br) { 15867 var rb_size = ringbuffer_mask + 1; 15868 var rb_pos = pos & ringbuffer_mask; 15869 var br_pos = br.pos_ & BrotliBitReader.IBUF_MASK; 15870 var nbytes; 15871 if (len < 8 || br.bit_pos_ + (len << 3) < br.bit_end_pos_) { 15872 while (len-- > 0) { 15873 br.readMoreInput(); 15874 ringbuffer[rb_pos++] = br.readBits(8); 15875 if (rb_pos === rb_size) { 15876 output.write(ringbuffer, rb_size); 15877 rb_pos = 0; 15878 } 15879 } 15880 return; 15881 } 15882 if (br.bit_end_pos_ < 32) { 15883 throw new Error( 15884 "[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32" 15885 ); 15886 } 15887 while (br.bit_pos_ < 32) { 15888 ringbuffer[rb_pos] = br.val_ >>> br.bit_pos_; 15889 br.bit_pos_ += 8; 15890 ++rb_pos; 15891 --len; 15892 } 15893 nbytes = br.bit_end_pos_ - br.bit_pos_ >> 3; 15894 if (br_pos + nbytes > BrotliBitReader.IBUF_MASK) { 15895 var tail = BrotliBitReader.IBUF_MASK + 1 - br_pos; 15896 for (var x2 = 0; x2 < tail; x2++) 15897 ringbuffer[rb_pos + x2] = br.buf_[br_pos + x2]; 15898 nbytes -= tail; 15899 rb_pos += tail; 15900 len -= tail; 15901 br_pos = 0; 15902 } 15903 for (var x2 = 0; x2 < nbytes; x2++) 15904 ringbuffer[rb_pos + x2] = br.buf_[br_pos + x2]; 15905 rb_pos += nbytes; 15906 len -= nbytes; 15907 if (rb_pos >= rb_size) { 15908 output.write(ringbuffer, rb_size); 15909 rb_pos -= rb_size; 15910 for (var x2 = 0; x2 < rb_pos; x2++) 15911 ringbuffer[x2] = ringbuffer[rb_size + x2]; 15912 } 15913 while (rb_pos + len >= rb_size) { 15914 nbytes = rb_size - rb_pos; 15915 if (br.input_.read(ringbuffer, rb_pos, nbytes) < nbytes) { 15916 throw new Error( 15917 "[CopyUncompressedBlockToOutput] not enough bytes" 15918 ); 15919 } 15920 output.write(ringbuffer, rb_size); 15921 len -= nbytes; 15922 rb_pos = 0; 15923 } 15924 if (br.input_.read(ringbuffer, rb_pos, len) < len) { 15925 throw new Error( 15926 "[CopyUncompressedBlockToOutput] not enough bytes" 15927 ); 15928 } 15929 br.reset(); 15930 } 15931 function JumpToByteBoundary(br) { 15932 var new_bit_pos = br.bit_pos_ + 7 & ~7; 15933 var pad_bits = br.readBits(new_bit_pos - br.bit_pos_); 15934 return pad_bits == 0; 15935 } 15936 function BrotliDecompressedSize(buffer) { 15937 var input = new BrotliInput(buffer); 15938 var br = new BrotliBitReader(input); 15939 DecodeWindowBits(br); 15940 var out = DecodeMetaBlockLength(br); 15941 return out.meta_block_length; 15942 } 15943 exports2.BrotliDecompressedSize = BrotliDecompressedSize; 15944 function BrotliDecompressBuffer(buffer, output_size) { 15945 var input = new BrotliInput(buffer); 15946 if (output_size == null) { 15947 output_size = BrotliDecompressedSize(buffer); 15948 } 15949 var output_buffer = new Uint8Array(output_size); 15950 var output = new BrotliOutput(output_buffer); 15951 BrotliDecompress(input, output); 15952 if (output.pos < output.buffer.length) { 15953 output.buffer = output.buffer.subarray( 15954 0, 15955 output.pos 15956 ); 15957 } 15958 return output.buffer; 15959 } 15960 exports2.BrotliDecompressBuffer = BrotliDecompressBuffer; 15961 function BrotliDecompress(input, output) { 15962 var i2; 15963 var pos = 0; 15964 var input_end = 0; 15965 var window_bits = 0; 15966 var max_backward_distance; 15967 var max_distance = 0; 15968 var ringbuffer_size; 15969 var ringbuffer_mask; 15970 var ringbuffer; 15971 var ringbuffer_end; 15972 var dist_rb = [16, 15, 11, 4]; 15973 var dist_rb_idx = 0; 15974 var prev_byte1 = 0; 15975 var prev_byte2 = 0; 15976 var hgroup = [ 15977 new HuffmanTreeGroup(0, 0), 15978 new HuffmanTreeGroup(0, 0), 15979 new HuffmanTreeGroup(0, 0) 15980 ]; 15981 var block_type_trees; 15982 var block_len_trees; 15983 var br; 15984 var kRingBufferWriteAheadSlack = 128 + BrotliBitReader.READ_SIZE; 15985 br = new BrotliBitReader(input); 15986 window_bits = DecodeWindowBits(br); 15987 max_backward_distance = (1 << window_bits) - 16; 15988 ringbuffer_size = 1 << window_bits; 15989 ringbuffer_mask = ringbuffer_size - 1; 15990 ringbuffer = new Uint8Array( 15991 ringbuffer_size + kRingBufferWriteAheadSlack + BrotliDictionary.maxDictionaryWordLength 15992 ); 15993 ringbuffer_end = ringbuffer_size; 15994 block_type_trees = []; 15995 block_len_trees = []; 15996 for (var x2 = 0; x2 < 3 * HUFFMAN_MAX_TABLE_SIZE; x2++) { 15997 block_type_trees[x2] = new HuffmanCode(0, 0); 15998 block_len_trees[x2] = new HuffmanCode(0, 0); 15999 } 16000 while (!input_end) { 16001 var meta_block_remaining_len = 0; 16002 var is_uncompressed; 16003 var block_length = [1 << 28, 1 << 28, 1 << 28]; 16004 var block_type = [0]; 16005 var num_block_types = [1, 1, 1]; 16006 var block_type_rb = [0, 1, 0, 1, 0, 1]; 16007 var block_type_rb_index = [0]; 16008 var distance_postfix_bits; 16009 var num_direct_distance_codes; 16010 var distance_postfix_mask; 16011 var num_distance_codes; 16012 var context_map = null; 16013 var context_modes = null; 16014 var num_literal_htrees; 16015 var dist_context_map = null; 16016 var num_dist_htrees; 16017 var context_offset = 0; 16018 var context_map_slice = null; 16019 var literal_htree_index = 0; 16020 var dist_context_offset = 0; 16021 var dist_context_map_slice = null; 16022 var dist_htree_index = 0; 16023 var context_lookup_offset1 = 0; 16024 var context_lookup_offset2 = 0; 16025 var context_mode; 16026 var htree_command; 16027 for (i2 = 0; i2 < 3; ++i2) { 16028 hgroup[i2].codes = null; 16029 hgroup[i2].htrees = null; 16030 } 16031 br.readMoreInput(); 16032 var _out = DecodeMetaBlockLength(br); 16033 meta_block_remaining_len = _out.meta_block_length; 16034 if (pos + meta_block_remaining_len > output.buffer.length) { 16035 var tmp = new Uint8Array( 16036 pos + meta_block_remaining_len 16037 ); 16038 tmp.set(output.buffer); 16039 output.buffer = tmp; 16040 } 16041 input_end = _out.input_end; 16042 is_uncompressed = _out.is_uncompressed; 16043 if (_out.is_metadata) { 16044 JumpToByteBoundary(br); 16045 for (; meta_block_remaining_len > 0; --meta_block_remaining_len) { 16046 br.readMoreInput(); 16047 br.readBits(8); 16048 } 16049 continue; 16050 } 16051 if (meta_block_remaining_len === 0) { 16052 continue; 16053 } 16054 if (is_uncompressed) { 16055 br.bit_pos_ = br.bit_pos_ + 7 & ~7; 16056 CopyUncompressedBlockToOutput( 16057 output, 16058 meta_block_remaining_len, 16059 pos, 16060 ringbuffer, 16061 ringbuffer_mask, 16062 br 16063 ); 16064 pos += meta_block_remaining_len; 16065 continue; 16066 } 16067 for (i2 = 0; i2 < 3; ++i2) { 16068 num_block_types[i2] = DecodeVarLenUint8(br) + 1; 16069 if (num_block_types[i2] >= 2) { 16070 ReadHuffmanCode( 16071 num_block_types[i2] + 2, 16072 block_type_trees, 16073 i2 * HUFFMAN_MAX_TABLE_SIZE, 16074 br 16075 ); 16076 ReadHuffmanCode( 16077 kNumBlockLengthCodes, 16078 block_len_trees, 16079 i2 * HUFFMAN_MAX_TABLE_SIZE, 16080 br 16081 ); 16082 block_length[i2] = ReadBlockLength( 16083 block_len_trees, 16084 i2 * HUFFMAN_MAX_TABLE_SIZE, 16085 br 16086 ); 16087 block_type_rb_index[i2] = 1; 16088 } 16089 } 16090 br.readMoreInput(); 16091 distance_postfix_bits = br.readBits(2); 16092 num_direct_distance_codes = NUM_DISTANCE_SHORT_CODES + (br.readBits(4) << distance_postfix_bits); 16093 distance_postfix_mask = (1 << distance_postfix_bits) - 1; 16094 num_distance_codes = num_direct_distance_codes + (48 << distance_postfix_bits); 16095 context_modes = new Uint8Array( 16096 num_block_types[0] 16097 ); 16098 for (i2 = 0; i2 < num_block_types[0]; ++i2) { 16099 br.readMoreInput(); 16100 context_modes[i2] = br.readBits(2) << 1; 16101 } 16102 var _o1 = DecodeContextMap( 16103 num_block_types[0] << kLiteralContextBits, 16104 br 16105 ); 16106 num_literal_htrees = _o1.num_htrees; 16107 context_map = _o1.context_map; 16108 var _o2 = DecodeContextMap( 16109 num_block_types[2] << kDistanceContextBits, 16110 br 16111 ); 16112 num_dist_htrees = _o2.num_htrees; 16113 dist_context_map = _o2.context_map; 16114 hgroup[0] = new HuffmanTreeGroup( 16115 kNumLiteralCodes, 16116 num_literal_htrees 16117 ); 16118 hgroup[1] = new HuffmanTreeGroup( 16119 kNumInsertAndCopyCodes, 16120 num_block_types[1] 16121 ); 16122 hgroup[2] = new HuffmanTreeGroup( 16123 num_distance_codes, 16124 num_dist_htrees 16125 ); 16126 for (i2 = 0; i2 < 3; ++i2) { 16127 hgroup[i2].decode(br); 16128 } 16129 context_map_slice = 0; 16130 dist_context_map_slice = 0; 16131 context_mode = context_modes[block_type[0]]; 16132 context_lookup_offset1 = Context.lookupOffsets[context_mode]; 16133 context_lookup_offset2 = Context.lookupOffsets[context_mode + 1]; 16134 htree_command = hgroup[1].htrees[0]; 16135 while (meta_block_remaining_len > 0) { 16136 var cmd_code; 16137 var range_idx; 16138 var insert_code; 16139 var copy_code; 16140 var insert_length; 16141 var copy_length; 16142 var distance_code; 16143 var distance; 16144 var context; 16145 var j2; 16146 var copy_dst; 16147 br.readMoreInput(); 16148 if (block_length[1] === 0) { 16149 DecodeBlockType( 16150 num_block_types[1], 16151 block_type_trees, 16152 1, 16153 block_type, 16154 block_type_rb, 16155 block_type_rb_index, 16156 br 16157 ); 16158 block_length[1] = ReadBlockLength( 16159 block_len_trees, 16160 HUFFMAN_MAX_TABLE_SIZE, 16161 br 16162 ); 16163 htree_command = hgroup[1].htrees[block_type[1]]; 16164 } 16165 --block_length[1]; 16166 cmd_code = ReadSymbol( 16167 hgroup[1].codes, 16168 htree_command, 16169 br 16170 ); 16171 range_idx = cmd_code >> 6; 16172 if (range_idx >= 2) { 16173 range_idx -= 2; 16174 distance_code = -1; 16175 } else { 16176 distance_code = 0; 16177 } 16178 insert_code = Prefix.kInsertRangeLut[range_idx] + (cmd_code >> 3 & 7); 16179 copy_code = Prefix.kCopyRangeLut[range_idx] + (cmd_code & 7); 16180 insert_length = Prefix.kInsertLengthPrefixCode[insert_code].offset + br.readBits( 16181 Prefix.kInsertLengthPrefixCode[insert_code].nbits 16182 ); 16183 copy_length = Prefix.kCopyLengthPrefixCode[copy_code].offset + br.readBits( 16184 Prefix.kCopyLengthPrefixCode[copy_code].nbits 16185 ); 16186 prev_byte1 = ringbuffer[pos - 1 & ringbuffer_mask]; 16187 prev_byte2 = ringbuffer[pos - 2 & ringbuffer_mask]; 16188 for (j2 = 0; j2 < insert_length; ++j2) { 16189 br.readMoreInput(); 16190 if (block_length[0] === 0) { 16191 DecodeBlockType( 16192 num_block_types[0], 16193 block_type_trees, 16194 0, 16195 block_type, 16196 block_type_rb, 16197 block_type_rb_index, 16198 br 16199 ); 16200 block_length[0] = ReadBlockLength( 16201 block_len_trees, 16202 0, 16203 br 16204 ); 16205 context_offset = block_type[0] << kLiteralContextBits; 16206 context_map_slice = context_offset; 16207 context_mode = context_modes[block_type[0]]; 16208 context_lookup_offset1 = Context.lookupOffsets[context_mode]; 16209 context_lookup_offset2 = Context.lookupOffsets[context_mode + 1]; 16210 } 16211 context = Context.lookup[context_lookup_offset1 + prev_byte1] | Context.lookup[context_lookup_offset2 + prev_byte2]; 16212 literal_htree_index = context_map[context_map_slice + context]; 16213 --block_length[0]; 16214 prev_byte2 = prev_byte1; 16215 prev_byte1 = ReadSymbol( 16216 hgroup[0].codes, 16217 hgroup[0].htrees[literal_htree_index], 16218 br 16219 ); 16220 ringbuffer[pos & ringbuffer_mask] = prev_byte1; 16221 if ((pos & ringbuffer_mask) === ringbuffer_mask) { 16222 output.write( 16223 ringbuffer, 16224 ringbuffer_size 16225 ); 16226 } 16227 ++pos; 16228 } 16229 meta_block_remaining_len -= insert_length; 16230 if (meta_block_remaining_len <= 0) break; 16231 if (distance_code < 0) { 16232 var context; 16233 br.readMoreInput(); 16234 if (block_length[2] === 0) { 16235 DecodeBlockType( 16236 num_block_types[2], 16237 block_type_trees, 16238 2, 16239 block_type, 16240 block_type_rb, 16241 block_type_rb_index, 16242 br 16243 ); 16244 block_length[2] = ReadBlockLength( 16245 block_len_trees, 16246 2 * HUFFMAN_MAX_TABLE_SIZE, 16247 br 16248 ); 16249 dist_context_offset = block_type[2] << kDistanceContextBits; 16250 dist_context_map_slice = dist_context_offset; 16251 } 16252 --block_length[2]; 16253 context = (copy_length > 4 ? 3 : copy_length - 2) & 255; 16254 dist_htree_index = dist_context_map[dist_context_map_slice + context]; 16255 distance_code = ReadSymbol( 16256 hgroup[2].codes, 16257 hgroup[2].htrees[dist_htree_index], 16258 br 16259 ); 16260 if (distance_code >= num_direct_distance_codes) { 16261 var nbits; 16262 var postfix; 16263 var offset4; 16264 distance_code -= num_direct_distance_codes; 16265 postfix = distance_code & distance_postfix_mask; 16266 distance_code >>= distance_postfix_bits; 16267 nbits = (distance_code >> 1) + 1; 16268 offset4 = (2 + (distance_code & 1) << nbits) - 4; 16269 distance_code = num_direct_distance_codes + (offset4 + br.readBits(nbits) << distance_postfix_bits) + postfix; 16270 } 16271 } 16272 distance = TranslateShortCodes( 16273 distance_code, 16274 dist_rb, 16275 dist_rb_idx 16276 ); 16277 if (distance < 0) { 16278 throw new Error( 16279 "[BrotliDecompress] invalid distance" 16280 ); 16281 } 16282 if (pos < max_backward_distance && max_distance !== max_backward_distance) { 16283 max_distance = pos; 16284 } else { 16285 max_distance = max_backward_distance; 16286 } 16287 copy_dst = pos & ringbuffer_mask; 16288 if (distance > max_distance) { 16289 if (copy_length >= BrotliDictionary.minDictionaryWordLength && copy_length <= BrotliDictionary.maxDictionaryWordLength) { 16290 var offset4 = BrotliDictionary.offsetsByLength[copy_length]; 16291 var word_id = distance - max_distance - 1; 16292 var shift4 = BrotliDictionary.sizeBitsByLength[copy_length]; 16293 var mask = (1 << shift4) - 1; 16294 var word_idx = word_id & mask; 16295 var transform_idx = word_id >> shift4; 16296 offset4 += word_idx * copy_length; 16297 if (transform_idx < Transform.kNumTransforms) { 16298 var len = Transform.transformDictionaryWord( 16299 ringbuffer, 16300 copy_dst, 16301 offset4, 16302 copy_length, 16303 transform_idx 16304 ); 16305 copy_dst += len; 16306 pos += len; 16307 meta_block_remaining_len -= len; 16308 if (copy_dst >= ringbuffer_end) { 16309 output.write( 16310 ringbuffer, 16311 ringbuffer_size 16312 ); 16313 for (var _x10 = 0; _x10 < copy_dst - ringbuffer_end; _x10++) 16314 ringbuffer[_x10] = ringbuffer[ringbuffer_end + _x10]; 16315 } 16316 } else { 16317 throw new Error( 16318 "Invalid backward reference. pos: " + pos + " distance: " + distance + " len: " + copy_length + " bytes left: " + meta_block_remaining_len 16319 ); 16320 } 16321 } else { 16322 throw new Error( 16323 "Invalid backward reference. pos: " + pos + " distance: " + distance + " len: " + copy_length + " bytes left: " + meta_block_remaining_len 16324 ); 16325 } 16326 } else { 16327 if (distance_code > 0) { 16328 dist_rb[dist_rb_idx & 3] = distance; 16329 ++dist_rb_idx; 16330 } 16331 if (copy_length > meta_block_remaining_len) { 16332 throw new Error( 16333 "Invalid backward reference. pos: " + pos + " distance: " + distance + " len: " + copy_length + " bytes left: " + meta_block_remaining_len 16334 ); 16335 } 16336 for (j2 = 0; j2 < copy_length; ++j2) { 16337 ringbuffer[pos & ringbuffer_mask] = ringbuffer[pos - distance & ringbuffer_mask]; 16338 if ((pos & ringbuffer_mask) === ringbuffer_mask) { 16339 output.write( 16340 ringbuffer, 16341 ringbuffer_size 16342 ); 16343 } 16344 ++pos; 16345 --meta_block_remaining_len; 16346 } 16347 } 16348 prev_byte1 = ringbuffer[pos - 1 & ringbuffer_mask]; 16349 prev_byte2 = ringbuffer[pos - 2 & ringbuffer_mask]; 16350 } 16351 pos &= 1073741823; 16352 } 16353 output.write(ringbuffer, pos & ringbuffer_mask); 16354 } 16355 exports2.BrotliDecompress = BrotliDecompress; 16356 BrotliDictionary.init(); 16357 }, 16358 { 16359 "./bit_reader": 1, 16360 "./context": 2, 16361 "./dictionary": 6, 16362 "./huffman": 7, 16363 "./prefix": 9, 16364 "./streams": 10, 16365 "./transform": 11 16366 } 16367 ], 16368 4: [ 16369 function(require2, module2, exports2) { 16370 var base64 = require2("base64-js"); 16371 exports2.init = function() { 16372 var BrotliDecompressBuffer = require2("./decode").BrotliDecompressBuffer; 16373 var compressed = base64.toByteArray( 16374 require2("./dictionary.bin.js") 16375 ); 16376 return BrotliDecompressBuffer(compressed); 16377 }; 16378 }, 16379 { "./decode": 3, "./dictionary.bin.js": 5, "base64-js": 8 } 16380 ], 16381 5: [ 16382 function(require2, module2, exports2) { 16383 module2.exports = "W5/fcQLn5gKf2XUbAiQ1XULX+TZz6ADToDsgqk6qVfeC0e4m6OO2wcQ1J76ZBVRV1fRkEsdu//62zQsFEZWSTCnMhcsQKlS2qOhuVYYMGCkV0fXWEoMFbESXrKEZ9wdUEsyw9g4bJlEt1Y6oVMxMRTEVbCIwZzJzboK5j8m4YH02qgXYhv1V+PM435sLVxyHJihaJREEhZGqL03txGFQLm76caGO/ovxKvzCby/3vMTtX/459f0igi7WutnKiMQ6wODSoRh/8Lx1V3Q99MvKtwB6bHdERYRY0hStJoMjNeTsNX7bn+Y7e4EQ3bf8xBc7L0BsyfFPK43dGSXpL6clYC/I328h54/VYrQ5i0648FgbGtl837svJ35L3Mot/+nPlNpWgKx1gGXQYqX6n+bbZ7wuyCHKcUok12Xjqub7NXZGzqBx0SD+uziNf87t7ve42jxSKQoW3nyxVrWIGlFShhCKxjpZZ5MeGna0+lBkk+kaN8F9qFBAFgEogyMBdcX/T1W/WnMOi/7ycWUQloEBKGeC48MkiwqJkJO+12eQiOFHMmck6q/IjWW3RZlany23TBm+cNr/84/oi5GGmGBZWrZ6j+zykVozz5fT/QH/Da6WTbZYYPynVNO7kxzuNN2kxKKWche5WveitPKAecB8YcAHz/+zXLjcLzkdDSktNIDwZE9J9X+tto43oJy65wApM3mDzYtCwX9lM+N5VR3kXYo0Z3t0TtXfgBFg7gU8oN0Dgl7fZlUbhNll+0uuohRVKjrEd8egrSndy5/Tgd2gqjA4CAVuC7ESUmL3DZoGnfhQV8uwnpi8EGvAVVsowNRxPudck7+oqAUDkwZopWqFnW1riss0t1z6iCISVKreYGNvQcXv+1L9+jbP8cd/dPUiqBso2q+7ZyFBvENCkkVr44iyPbtOoOoCecWsiuqMSML5lv+vN5MzUr+Dnh73G7Q1YnR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EpUI78X8GYIAZabx47/n8LDAAJ0nNtP1rpROprqKMBRecShca6qXuTSI3jZBLOB3Vp381B5rCGhjSvh/NSVkYp2qIdP/Bg="; 16384 }, 16385 {} 16386 ], 16387 6: [ 16388 function(require2, module2, exports2) { 16389 var data = require2("./dictionary-browser"); 16390 exports2.init = function() { 16391 exports2.dictionary = data.init(); 16392 }; 16393 exports2.offsetsByLength = new Uint32Array([ 16394 0, 16395 0, 16396 0, 16397 0, 16398 0, 16399 4096, 16400 9216, 16401 21504, 16402 35840, 16403 44032, 16404 53248, 16405 63488, 16406 74752, 16407 87040, 16408 93696, 16409 100864, 16410 104704, 16411 106752, 16412 108928, 16413 113536, 16414 115968, 16415 118528, 16416 119872, 16417 121280, 16418 122016 16419 ]); 16420 exports2.sizeBitsByLength = new Uint8Array([ 16421 0, 16422 0, 16423 0, 16424 0, 16425 10, 16426 10, 16427 11, 16428 11, 16429 10, 16430 10, 16431 10, 16432 10, 16433 10, 16434 9, 16435 9, 16436 8, 16437 7, 16438 7, 16439 8, 16440 7, 16441 7, 16442 6, 16443 6, 16444 5, 16445 5 16446 ]); 16447 exports2.minDictionaryWordLength = 4; 16448 exports2.maxDictionaryWordLength = 24; 16449 }, 16450 { "./dictionary-browser": 4 } 16451 ], 16452 7: [ 16453 function(require2, module2, exports2) { 16454 function HuffmanCode(bits, value) { 16455 this.bits = bits; 16456 this.value = value; 16457 } 16458 exports2.HuffmanCode = HuffmanCode; 16459 var MAX_LENGTH = 15; 16460 function GetNextKey(key, len) { 16461 var step = 1 << len - 1; 16462 while (key & step) { 16463 step >>= 1; 16464 } 16465 return (key & step - 1) + step; 16466 } 16467 function ReplicateValue(table, i2, step, end, code) { 16468 do { 16469 end -= step; 16470 table[i2 + end] = new HuffmanCode( 16471 code.bits, 16472 code.value 16473 ); 16474 } while (end > 0); 16475 } 16476 function NextTableBitSize(count, len, root_bits) { 16477 var left = 1 << len - root_bits; 16478 while (len < MAX_LENGTH) { 16479 left -= count[len]; 16480 if (left <= 0) break; 16481 ++len; 16482 left <<= 1; 16483 } 16484 return len - root_bits; 16485 } 16486 exports2.BrotliBuildHuffmanTable = function(root_table, table, root_bits, code_lengths, code_lengths_size) { 16487 var start_table = table; 16488 var code; 16489 var len; 16490 var symbol; 16491 var key; 16492 var step; 16493 var low; 16494 var mask; 16495 var table_bits; 16496 var table_size; 16497 var total_size; 16498 var sorted; 16499 var count = new Int32Array( 16500 MAX_LENGTH + 1 16501 ); 16502 var offset4 = new Int32Array( 16503 MAX_LENGTH + 1 16504 ); 16505 sorted = new Int32Array(code_lengths_size); 16506 for (symbol = 0; symbol < code_lengths_size; symbol++) { 16507 count[code_lengths[symbol]]++; 16508 } 16509 offset4[1] = 0; 16510 for (len = 1; len < MAX_LENGTH; len++) { 16511 offset4[len + 1] = offset4[len] + count[len]; 16512 } 16513 for (symbol = 0; symbol < code_lengths_size; symbol++) { 16514 if (code_lengths[symbol] !== 0) { 16515 sorted[offset4[code_lengths[symbol]]++] = symbol; 16516 } 16517 } 16518 table_bits = root_bits; 16519 table_size = 1 << table_bits; 16520 total_size = table_size; 16521 if (offset4[MAX_LENGTH] === 1) { 16522 for (key = 0; key < total_size; ++key) { 16523 root_table[table + key] = new HuffmanCode( 16524 0, 16525 sorted[0] & 65535 16526 ); 16527 } 16528 return total_size; 16529 } 16530 key = 0; 16531 symbol = 0; 16532 for (len = 1, step = 2; len <= root_bits; ++len, step <<= 1) { 16533 for (; count[len] > 0; --count[len]) { 16534 code = new HuffmanCode( 16535 len & 255, 16536 sorted[symbol++] & 65535 16537 ); 16538 ReplicateValue( 16539 root_table, 16540 table + key, 16541 step, 16542 table_size, 16543 code 16544 ); 16545 key = GetNextKey(key, len); 16546 } 16547 } 16548 mask = total_size - 1; 16549 low = -1; 16550 for (len = root_bits + 1, step = 2; len <= MAX_LENGTH; ++len, step <<= 1) { 16551 for (; count[len] > 0; --count[len]) { 16552 if ((key & mask) !== low) { 16553 table += table_size; 16554 table_bits = NextTableBitSize( 16555 count, 16556 len, 16557 root_bits 16558 ); 16559 table_size = 1 << table_bits; 16560 total_size += table_size; 16561 low = key & mask; 16562 root_table[start_table + low] = new HuffmanCode( 16563 table_bits + root_bits & 255, 16564 table - start_table - low & 65535 16565 ); 16566 } 16567 code = new HuffmanCode( 16568 len - root_bits & 255, 16569 sorted[symbol++] & 65535 16570 ); 16571 ReplicateValue( 16572 root_table, 16573 table + (key >> root_bits), 16574 step, 16575 table_size, 16576 code 16577 ); 16578 key = GetNextKey(key, len); 16579 } 16580 } 16581 return total_size; 16582 }; 16583 }, 16584 {} 16585 ], 16586 8: [ 16587 function(require2, module2, exports2) { 16588 "use strict"; 16589 exports2.byteLength = byteLength; 16590 exports2.toByteArray = toByteArray; 16591 exports2.fromByteArray = fromByteArray; 16592 var lookup = []; 16593 var revLookup = []; 16594 var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array; 16595 var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; 16596 for (var i2 = 0, len = code.length; i2 < len; ++i2) { 16597 lookup[i2] = code[i2]; 16598 revLookup[code.charCodeAt(i2)] = i2; 16599 } 16600 revLookup["-".charCodeAt(0)] = 62; 16601 revLookup["_".charCodeAt(0)] = 63; 16602 function getLens(b64) { 16603 var len2 = b64.length; 16604 if (len2 % 4 > 0) { 16605 throw new Error( 16606 "Invalid string. Length must be a multiple of 4" 16607 ); 16608 } 16609 var validLen = b64.indexOf("="); 16610 if (validLen === -1) validLen = len2; 16611 var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4; 16612 return [validLen, placeHoldersLen]; 16613 } 16614 function byteLength(b64) { 16615 var lens = getLens(b64); 16616 var validLen = lens[0]; 16617 var placeHoldersLen = lens[1]; 16618 return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; 16619 } 16620 function _byteLength(b64, validLen, placeHoldersLen) { 16621 return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen; 16622 } 16623 function toByteArray(b64) { 16624 var tmp; 16625 var lens = getLens(b64); 16626 var validLen = lens[0]; 16627 var placeHoldersLen = lens[1]; 16628 var arr = new Arr( 16629 _byteLength(b64, validLen, placeHoldersLen) 16630 ); 16631 var curByte = 0; 16632 var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen; 16633 for (var i22 = 0; i22 < len2; i22 += 4) { 16634 tmp = revLookup[b64.charCodeAt(i22)] << 18 | revLookup[b64.charCodeAt(i22 + 1)] << 12 | revLookup[b64.charCodeAt(i22 + 2)] << 6 | revLookup[b64.charCodeAt(i22 + 3)]; 16635 arr[curByte++] = tmp >> 16 & 255; 16636 arr[curByte++] = tmp >> 8 & 255; 16637 arr[curByte++] = tmp & 255; 16638 } 16639 if (placeHoldersLen === 2) { 16640 tmp = revLookup[b64.charCodeAt(i22)] << 2 | revLookup[b64.charCodeAt(i22 + 1)] >> 4; 16641 arr[curByte++] = tmp & 255; 16642 } 16643 if (placeHoldersLen === 1) { 16644 tmp = revLookup[b64.charCodeAt(i22)] << 10 | revLookup[b64.charCodeAt(i22 + 1)] << 4 | revLookup[b64.charCodeAt(i22 + 2)] >> 2; 16645 arr[curByte++] = tmp >> 8 & 255; 16646 arr[curByte++] = tmp & 255; 16647 } 16648 return arr; 16649 } 16650 function tripletToBase64(num) { 16651 return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63]; 16652 } 16653 function encodeChunk(uint8, start, end) { 16654 var tmp; 16655 var output = []; 16656 for (var i22 = start; i22 < end; i22 += 3) { 16657 tmp = (uint8[i22] << 16 & 16711680) + (uint8[i22 + 1] << 8 & 65280) + (uint8[i22 + 2] & 255); 16658 output.push(tripletToBase64(tmp)); 16659 } 16660 return output.join(""); 16661 } 16662 function fromByteArray(uint8) { 16663 var tmp; 16664 var len2 = uint8.length; 16665 var extraBytes = len2 % 3; 16666 var parts = []; 16667 var maxChunkLength = 16383; 16668 for (var i22 = 0, len22 = len2 - extraBytes; i22 < len22; i22 += maxChunkLength) { 16669 parts.push( 16670 encodeChunk( 16671 uint8, 16672 i22, 16673 i22 + maxChunkLength > len22 ? len22 : i22 + maxChunkLength 16674 ) 16675 ); 16676 } 16677 if (extraBytes === 1) { 16678 tmp = uint8[len2 - 1]; 16679 parts.push( 16680 lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "==" 16681 ); 16682 } else if (extraBytes === 2) { 16683 tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1]; 16684 parts.push( 16685 lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "=" 16686 ); 16687 } 16688 return parts.join(""); 16689 } 16690 }, 16691 {} 16692 ], 16693 9: [ 16694 function(require2, module2, exports2) { 16695 function PrefixCodeRange(offset4, nbits) { 16696 this.offset = offset4; 16697 this.nbits = nbits; 16698 } 16699 exports2.kBlockLengthPrefixCode = [ 16700 new PrefixCodeRange(1, 2), 16701 new PrefixCodeRange(5, 2), 16702 new PrefixCodeRange(9, 2), 16703 new PrefixCodeRange(13, 2), 16704 new PrefixCodeRange(17, 3), 16705 new PrefixCodeRange(25, 3), 16706 new PrefixCodeRange(33, 3), 16707 new PrefixCodeRange(41, 3), 16708 new PrefixCodeRange(49, 4), 16709 new PrefixCodeRange(65, 4), 16710 new PrefixCodeRange(81, 4), 16711 new PrefixCodeRange(97, 4), 16712 new PrefixCodeRange(113, 5), 16713 new PrefixCodeRange(145, 5), 16714 new PrefixCodeRange(177, 5), 16715 new PrefixCodeRange(209, 5), 16716 new PrefixCodeRange(241, 6), 16717 new PrefixCodeRange(305, 6), 16718 new PrefixCodeRange(369, 7), 16719 new PrefixCodeRange(497, 8), 16720 new PrefixCodeRange(753, 9), 16721 new PrefixCodeRange(1265, 10), 16722 new PrefixCodeRange(2289, 11), 16723 new PrefixCodeRange(4337, 12), 16724 new PrefixCodeRange(8433, 13), 16725 new PrefixCodeRange(16625, 24) 16726 ]; 16727 exports2.kInsertLengthPrefixCode = [ 16728 new PrefixCodeRange(0, 0), 16729 new PrefixCodeRange(1, 0), 16730 new PrefixCodeRange(2, 0), 16731 new PrefixCodeRange(3, 0), 16732 new PrefixCodeRange(4, 0), 16733 new PrefixCodeRange(5, 0), 16734 new PrefixCodeRange(6, 1), 16735 new PrefixCodeRange(8, 1), 16736 new PrefixCodeRange(10, 2), 16737 new PrefixCodeRange(14, 2), 16738 new PrefixCodeRange(18, 3), 16739 new PrefixCodeRange(26, 3), 16740 new PrefixCodeRange(34, 4), 16741 new PrefixCodeRange(50, 4), 16742 new PrefixCodeRange(66, 5), 16743 new PrefixCodeRange(98, 5), 16744 new PrefixCodeRange(130, 6), 16745 new PrefixCodeRange(194, 7), 16746 new PrefixCodeRange(322, 8), 16747 new PrefixCodeRange(578, 9), 16748 new PrefixCodeRange(1090, 10), 16749 new PrefixCodeRange(2114, 12), 16750 new PrefixCodeRange(6210, 14), 16751 new PrefixCodeRange(22594, 24) 16752 ]; 16753 exports2.kCopyLengthPrefixCode = [ 16754 new PrefixCodeRange(2, 0), 16755 new PrefixCodeRange(3, 0), 16756 new PrefixCodeRange(4, 0), 16757 new PrefixCodeRange(5, 0), 16758 new PrefixCodeRange(6, 0), 16759 new PrefixCodeRange(7, 0), 16760 new PrefixCodeRange(8, 0), 16761 new PrefixCodeRange(9, 0), 16762 new PrefixCodeRange(10, 1), 16763 new PrefixCodeRange(12, 1), 16764 new PrefixCodeRange(14, 2), 16765 new PrefixCodeRange(18, 2), 16766 new PrefixCodeRange(22, 3), 16767 new PrefixCodeRange(30, 3), 16768 new PrefixCodeRange(38, 4), 16769 new PrefixCodeRange(54, 4), 16770 new PrefixCodeRange(70, 5), 16771 new PrefixCodeRange(102, 5), 16772 new PrefixCodeRange(134, 6), 16773 new PrefixCodeRange(198, 7), 16774 new PrefixCodeRange(326, 8), 16775 new PrefixCodeRange(582, 9), 16776 new PrefixCodeRange(1094, 10), 16777 new PrefixCodeRange(2118, 24) 16778 ]; 16779 exports2.kInsertRangeLut = [0, 0, 8, 8, 0, 16, 8, 16, 16]; 16780 exports2.kCopyRangeLut = [0, 8, 0, 8, 16, 0, 16, 8, 16]; 16781 }, 16782 {} 16783 ], 16784 10: [ 16785 function(require2, module2, exports2) { 16786 function BrotliInput(buffer) { 16787 this.buffer = buffer; 16788 this.pos = 0; 16789 } 16790 BrotliInput.prototype.read = function(buf, i2, count) { 16791 if (this.pos + count > this.buffer.length) { 16792 count = this.buffer.length - this.pos; 16793 } 16794 for (var p3 = 0; p3 < count; p3++) 16795 buf[i2 + p3] = this.buffer[this.pos + p3]; 16796 this.pos += count; 16797 return count; 16798 }; 16799 exports2.BrotliInput = BrotliInput; 16800 function BrotliOutput(buf) { 16801 this.buffer = buf; 16802 this.pos = 0; 16803 } 16804 BrotliOutput.prototype.write = function(buf, count) { 16805 if (this.pos + count > this.buffer.length) 16806 throw new Error( 16807 "Output buffer is not large enough" 16808 ); 16809 this.buffer.set(buf.subarray(0, count), this.pos); 16810 this.pos += count; 16811 return count; 16812 }; 16813 exports2.BrotliOutput = BrotliOutput; 16814 }, 16815 {} 16816 ], 16817 11: [ 16818 function(require2, module2, exports2) { 16819 var BrotliDictionary = require2("./dictionary"); 16820 var kIdentity = 0; 16821 var kOmitLast1 = 1; 16822 var kOmitLast2 = 2; 16823 var kOmitLast3 = 3; 16824 var kOmitLast4 = 4; 16825 var kOmitLast5 = 5; 16826 var kOmitLast6 = 6; 16827 var kOmitLast7 = 7; 16828 var kOmitLast8 = 8; 16829 var kOmitLast9 = 9; 16830 var kUppercaseFirst = 10; 16831 var kUppercaseAll = 11; 16832 var kOmitFirst1 = 12; 16833 var kOmitFirst2 = 13; 16834 var kOmitFirst3 = 14; 16835 var kOmitFirst4 = 15; 16836 var kOmitFirst5 = 16; 16837 var kOmitFirst6 = 17; 16838 var kOmitFirst7 = 18; 16839 var kOmitFirst8 = 19; 16840 var kOmitFirst9 = 20; 16841 function Transform(prefix, transform, suffix) { 16842 this.prefix = new Uint8Array(prefix.length); 16843 this.transform = transform; 16844 this.suffix = new Uint8Array(suffix.length); 16845 for (var i2 = 0; i2 < prefix.length; i2++) 16846 this.prefix[i2] = prefix.charCodeAt(i2); 16847 for (var i2 = 0; i2 < suffix.length; i2++) 16848 this.suffix[i2] = suffix.charCodeAt(i2); 16849 } 16850 var kTransforms = [ 16851 new Transform("", kIdentity, ""), 16852 new Transform("", kIdentity, " "), 16853 new Transform(" ", kIdentity, " "), 16854 new Transform("", kOmitFirst1, ""), 16855 new Transform("", kUppercaseFirst, " "), 16856 new Transform("", kIdentity, " the "), 16857 new Transform(" ", kIdentity, ""), 16858 new Transform("s ", kIdentity, " "), 16859 new Transform("", kIdentity, " of "), 16860 new Transform("", kUppercaseFirst, ""), 16861 new Transform("", kIdentity, " and "), 16862 new Transform("", kOmitFirst2, ""), 16863 new Transform("", kOmitLast1, ""), 16864 new Transform(", ", kIdentity, " "), 16865 new Transform("", kIdentity, ", "), 16866 new Transform(" ", kUppercaseFirst, " "), 16867 new Transform("", kIdentity, " in "), 16868 new Transform("", kIdentity, " to "), 16869 new Transform("e ", kIdentity, " "), 16870 new Transform("", kIdentity, '"'), 16871 new Transform("", kIdentity, "."), 16872 new Transform("", kIdentity, '">'), 16873 new Transform("", kIdentity, "\n"), 16874 new Transform("", kOmitLast3, ""), 16875 new Transform("", kIdentity, "]"), 16876 new Transform("", kIdentity, " for "), 16877 new Transform("", kOmitFirst3, ""), 16878 new Transform("", kOmitLast2, ""), 16879 new Transform("", kIdentity, " a "), 16880 new Transform("", kIdentity, " that "), 16881 new Transform(" ", kUppercaseFirst, ""), 16882 new Transform("", kIdentity, ". "), 16883 new Transform(".", kIdentity, ""), 16884 new Transform(" ", kIdentity, ", "), 16885 new Transform("", kOmitFirst4, ""), 16886 new Transform("", kIdentity, " with "), 16887 new Transform("", kIdentity, "'"), 16888 new Transform("", kIdentity, " from "), 16889 new Transform("", kIdentity, " by "), 16890 new Transform("", kOmitFirst5, ""), 16891 new Transform("", kOmitFirst6, ""), 16892 new Transform(" the ", kIdentity, ""), 16893 new Transform("", kOmitLast4, ""), 16894 new Transform("", kIdentity, ". The "), 16895 new Transform("", kUppercaseAll, ""), 16896 new Transform("", kIdentity, " on "), 16897 new Transform("", kIdentity, " as "), 16898 new Transform("", kIdentity, " is "), 16899 new Transform("", kOmitLast7, ""), 16900 new Transform("", kOmitLast1, "ing "), 16901 new Transform("", kIdentity, "\n "), 16902 new Transform("", kIdentity, ":"), 16903 new Transform(" ", kIdentity, ". "), 16904 new Transform("", kIdentity, "ed "), 16905 new Transform("", kOmitFirst9, ""), 16906 new Transform("", kOmitFirst7, ""), 16907 new Transform("", kOmitLast6, ""), 16908 new Transform("", kIdentity, "("), 16909 new Transform("", kUppercaseFirst, ", "), 16910 new Transform("", kOmitLast8, ""), 16911 new Transform("", kIdentity, " at "), 16912 new Transform("", kIdentity, "ly "), 16913 new Transform(" the ", kIdentity, " of "), 16914 new Transform("", kOmitLast5, ""), 16915 new Transform("", kOmitLast9, ""), 16916 new Transform(" ", kUppercaseFirst, ", "), 16917 new Transform("", kUppercaseFirst, '"'), 16918 new Transform(".", kIdentity, "("), 16919 new Transform("", kUppercaseAll, " "), 16920 new Transform("", kUppercaseFirst, '">'), 16921 new Transform("", kIdentity, '="'), 16922 new Transform(" ", kIdentity, "."), 16923 new Transform(".com/", kIdentity, ""), 16924 new Transform(" the ", kIdentity, " of the "), 16925 new Transform("", kUppercaseFirst, "'"), 16926 new Transform("", kIdentity, ". This "), 16927 new Transform("", kIdentity, ","), 16928 new Transform(".", kIdentity, " "), 16929 new Transform("", kUppercaseFirst, "("), 16930 new Transform("", kUppercaseFirst, "."), 16931 new Transform("", kIdentity, " not "), 16932 new Transform(" ", kIdentity, '="'), 16933 new Transform("", kIdentity, "er "), 16934 new Transform(" ", kUppercaseAll, " "), 16935 new Transform("", kIdentity, "al "), 16936 new Transform(" ", kUppercaseAll, ""), 16937 new Transform("", kIdentity, "='"), 16938 new Transform("", kUppercaseAll, '"'), 16939 new Transform("", kUppercaseFirst, ". "), 16940 new Transform(" ", kIdentity, "("), 16941 new Transform("", kIdentity, "ful "), 16942 new Transform(" ", kUppercaseFirst, ". "), 16943 new Transform("", kIdentity, "ive "), 16944 new Transform("", kIdentity, "less "), 16945 new Transform("", kUppercaseAll, "'"), 16946 new Transform("", kIdentity, "est "), 16947 new Transform(" ", kUppercaseFirst, "."), 16948 new Transform("", kUppercaseAll, '">'), 16949 new Transform(" ", kIdentity, "='"), 16950 new Transform("", kUppercaseFirst, ","), 16951 new Transform("", kIdentity, "ize "), 16952 new Transform("", kUppercaseAll, "."), 16953 new Transform("\xC2\xA0", kIdentity, ""), 16954 new Transform(" ", kIdentity, ","), 16955 new Transform("", kUppercaseFirst, '="'), 16956 new Transform("", kUppercaseAll, '="'), 16957 new Transform("", kIdentity, "ous "), 16958 new Transform("", kUppercaseAll, ", "), 16959 new Transform("", kUppercaseFirst, "='"), 16960 new Transform(" ", kUppercaseFirst, ","), 16961 new Transform(" ", kUppercaseAll, '="'), 16962 new Transform(" ", kUppercaseAll, ", "), 16963 new Transform("", kUppercaseAll, ","), 16964 new Transform("", kUppercaseAll, "("), 16965 new Transform("", kUppercaseAll, ". "), 16966 new Transform(" ", kUppercaseAll, "."), 16967 new Transform("", kUppercaseAll, "='"), 16968 new Transform(" ", kUppercaseAll, ". "), 16969 new Transform(" ", kUppercaseFirst, '="'), 16970 new Transform(" ", kUppercaseAll, "='"), 16971 new Transform(" ", kUppercaseFirst, "='") 16972 ]; 16973 exports2.kTransforms = kTransforms; 16974 exports2.kNumTransforms = kTransforms.length; 16975 function ToUpperCase(p3, i2) { 16976 if (p3[i2] < 192) { 16977 if (p3[i2] >= 97 && p3[i2] <= 122) { 16978 p3[i2] ^= 32; 16979 } 16980 return 1; 16981 } 16982 if (p3[i2] < 224) { 16983 p3[i2 + 1] ^= 32; 16984 return 2; 16985 } 16986 p3[i2 + 2] ^= 5; 16987 return 3; 16988 } 16989 exports2.transformDictionaryWord = function(dst, idx, word, len, transform) { 16990 var prefix = kTransforms[transform].prefix; 16991 var suffix = kTransforms[transform].suffix; 16992 var t3 = kTransforms[transform].transform; 16993 var skip = t3 < kOmitFirst1 ? 0 : t3 - (kOmitFirst1 - 1); 16994 var i2 = 0; 16995 var start_idx = idx; 16996 var uppercase; 16997 if (skip > len) { 16998 skip = len; 16999 } 17000 var prefix_pos = 0; 17001 while (prefix_pos < prefix.length) { 17002 dst[idx++] = prefix[prefix_pos++]; 17003 } 17004 word += skip; 17005 len -= skip; 17006 if (t3 <= kOmitLast9) { 17007 len -= t3; 17008 } 17009 for (i2 = 0; i2 < len; i2++) { 17010 dst[idx++] = BrotliDictionary.dictionary[word + i2]; 17011 } 17012 uppercase = idx - len; 17013 if (t3 === kUppercaseFirst) { 17014 ToUpperCase(dst, uppercase); 17015 } else if (t3 === kUppercaseAll) { 17016 while (len > 0) { 17017 var step = ToUpperCase(dst, uppercase); 17018 uppercase += step; 17019 len -= step; 17020 } 17021 } 17022 var suffix_pos = 0; 17023 while (suffix_pos < suffix.length) { 17024 dst[idx++] = suffix[suffix_pos++]; 17025 } 17026 return idx - start_idx; 17027 }; 17028 }, 17029 { "./dictionary": 6 } 17030 ], 17031 12: [ 17032 function(require2, module2, exports2) { 17033 module2.exports = require2("./dec/decode").BrotliDecompressBuffer; 17034 }, 17035 { "./dec/decode": 3 } 17036 ] 17037 }, 17038 {}, 17039 [12] 17040 )(12); 17041 })(); 17042 17043 // packages/global-styles-ui/build-module/font-library/lib/inflate.mjs 17044 var __require3 = /* @__PURE__ */ ((x2) => typeof __require !== "undefined" ? __require : typeof Proxy !== "undefined" ? new Proxy(x2, { 17045 get: (a2, b2) => (typeof __require !== "undefined" ? __require : a2)[b2] 17046 }) : x2)(function(x2) { 17047 if (typeof __require !== "undefined") return __require.apply(this, arguments); 17048 throw Error('Dynamic require of "' + x2 + '" is not supported'); 17049 }); 17050 var inflate_default = (function() { 17051 var define, module, exports; 17052 return (/* @__PURE__ */ (function() { 17053 function r3(e2, n2, t3) { 17054 function o3(i22, f2) { 17055 if (!n2[i22]) { 17056 if (!e2[i22]) { 17057 var c2 = "function" == typeof __require3 && __require3; 17058 if (!f2 && c2) return c2(i22, true); 17059 if (u2) return u2(i22, true); 17060 var a2 = new Error("Cannot find module '" + i22 + "'"); 17061 throw a2.code = "MODULE_NOT_FOUND", a2; 17062 } 17063 var p3 = n2[i22] = { exports: {} }; 17064 e2[i22][0].call( 17065 p3.exports, 17066 function(r22) { 17067 var n22 = e2[i22][1][r22]; 17068 return o3(n22 || r22); 17069 }, 17070 p3, 17071 p3.exports, 17072 r3, 17073 e2, 17074 n2, 17075 t3 17076 ); 17077 } 17078 return n2[i22].exports; 17079 } 17080 for (var u2 = "function" == typeof __require3 && __require3, i2 = 0; i2 < t3.length; i2++) 17081 o3(t3[i2]); 17082 return o3; 17083 } 17084 return r3; 17085 })())( 17086 { 17087 1: [ 17088 function(require2, module2, exports2) { 17089 "use strict"; 17090 var TYPED_OK = typeof Uint8Array !== "undefined" && typeof Uint16Array !== "undefined" && typeof Int32Array !== "undefined"; 17091 function _has(obj, key) { 17092 return Object.prototype.hasOwnProperty.call(obj, key); 17093 } 17094 exports2.assign = function(obj) { 17095 var sources = Array.prototype.slice.call( 17096 arguments, 17097 1 17098 ); 17099 while (sources.length) { 17100 var source = sources.shift(); 17101 if (!source) { 17102 continue; 17103 } 17104 if (typeof source !== "object") { 17105 throw new TypeError( 17106 source + "must be non-object" 17107 ); 17108 } 17109 for (var p3 in source) { 17110 if (_has(source, p3)) { 17111 obj[p3] = source[p3]; 17112 } 17113 } 17114 } 17115 return obj; 17116 }; 17117 exports2.shrinkBuf = function(buf, size4) { 17118 if (buf.length === size4) { 17119 return buf; 17120 } 17121 if (buf.subarray) { 17122 return buf.subarray(0, size4); 17123 } 17124 buf.length = size4; 17125 return buf; 17126 }; 17127 var fnTyped = { 17128 arraySet: function(dest, src, src_offs, len, dest_offs) { 17129 if (src.subarray && dest.subarray) { 17130 dest.set( 17131 src.subarray(src_offs, src_offs + len), 17132 dest_offs 17133 ); 17134 return; 17135 } 17136 for (var i2 = 0; i2 < len; i2++) { 17137 dest[dest_offs + i2] = src[src_offs + i2]; 17138 } 17139 }, 17140 // Join array of chunks to single array. 17141 flattenChunks: function(chunks) { 17142 var i2, l2, len, pos, chunk, result; 17143 len = 0; 17144 for (i2 = 0, l2 = chunks.length; i2 < l2; i2++) { 17145 len += chunks[i2].length; 17146 } 17147 result = new Uint8Array(len); 17148 pos = 0; 17149 for (i2 = 0, l2 = chunks.length; i2 < l2; i2++) { 17150 chunk = chunks[i2]; 17151 result.set(chunk, pos); 17152 pos += chunk.length; 17153 } 17154 return result; 17155 } 17156 }; 17157 var fnUntyped = { 17158 arraySet: function(dest, src, src_offs, len, dest_offs) { 17159 for (var i2 = 0; i2 < len; i2++) { 17160 dest[dest_offs + i2] = src[src_offs + i2]; 17161 } 17162 }, 17163 // Join array of chunks to single array. 17164 flattenChunks: function(chunks) { 17165 return [].concat.apply([], chunks); 17166 } 17167 }; 17168 exports2.setTyped = function(on) { 17169 if (on) { 17170 exports2.Buf8 = Uint8Array; 17171 exports2.Buf16 = Uint16Array; 17172 exports2.Buf32 = Int32Array; 17173 exports2.assign(exports2, fnTyped); 17174 } else { 17175 exports2.Buf8 = Array; 17176 exports2.Buf16 = Array; 17177 exports2.Buf32 = Array; 17178 exports2.assign(exports2, fnUntyped); 17179 } 17180 }; 17181 exports2.setTyped(TYPED_OK); 17182 }, 17183 {} 17184 ], 17185 2: [ 17186 function(require2, module2, exports2) { 17187 "use strict"; 17188 var utils = require2("./common"); 17189 var STR_APPLY_OK = true; 17190 var STR_APPLY_UIA_OK = true; 17191 try { 17192 String.fromCharCode.apply(null, [0]); 17193 } catch (__43) { 17194 STR_APPLY_OK = false; 17195 } 17196 try { 17197 String.fromCharCode.apply(null, new Uint8Array(1)); 17198 } catch (__43) { 17199 STR_APPLY_UIA_OK = false; 17200 } 17201 var _utf8len = new utils.Buf8(256); 17202 for (var q = 0; q < 256; q++) { 17203 _utf8len[q] = q >= 252 ? 6 : q >= 248 ? 5 : q >= 240 ? 4 : q >= 224 ? 3 : q >= 192 ? 2 : 1; 17204 } 17205 _utf8len[254] = _utf8len[254] = 1; 17206 exports2.string2buf = function(str) { 17207 var buf, c2, c22, m_pos, i2, str_len = str.length, buf_len = 0; 17208 for (m_pos = 0; m_pos < str_len; m_pos++) { 17209 c2 = str.charCodeAt(m_pos); 17210 if ((c2 & 64512) === 55296 && m_pos + 1 < str_len) { 17211 c22 = str.charCodeAt(m_pos + 1); 17212 if ((c22 & 64512) === 56320) { 17213 c2 = 65536 + (c2 - 55296 << 10) + (c22 - 56320); 17214 m_pos++; 17215 } 17216 } 17217 buf_len += c2 < 128 ? 1 : c2 < 2048 ? 2 : c2 < 65536 ? 3 : 4; 17218 } 17219 buf = new utils.Buf8(buf_len); 17220 for (i2 = 0, m_pos = 0; i2 < buf_len; m_pos++) { 17221 c2 = str.charCodeAt(m_pos); 17222 if ((c2 & 64512) === 55296 && m_pos + 1 < str_len) { 17223 c22 = str.charCodeAt(m_pos + 1); 17224 if ((c22 & 64512) === 56320) { 17225 c2 = 65536 + (c2 - 55296 << 10) + (c22 - 56320); 17226 m_pos++; 17227 } 17228 } 17229 if (c2 < 128) { 17230 buf[i2++] = c2; 17231 } else if (c2 < 2048) { 17232 buf[i2++] = 192 | c2 >>> 6; 17233 buf[i2++] = 128 | c2 & 63; 17234 } else if (c2 < 65536) { 17235 buf[i2++] = 224 | c2 >>> 12; 17236 buf[i2++] = 128 | c2 >>> 6 & 63; 17237 buf[i2++] = 128 | c2 & 63; 17238 } else { 17239 buf[i2++] = 240 | c2 >>> 18; 17240 buf[i2++] = 128 | c2 >>> 12 & 63; 17241 buf[i2++] = 128 | c2 >>> 6 & 63; 17242 buf[i2++] = 128 | c2 & 63; 17243 } 17244 } 17245 return buf; 17246 }; 17247 function buf2binstring(buf, len) { 17248 if (len < 65534) { 17249 if (buf.subarray && STR_APPLY_UIA_OK || !buf.subarray && STR_APPLY_OK) { 17250 return String.fromCharCode.apply( 17251 null, 17252 utils.shrinkBuf(buf, len) 17253 ); 17254 } 17255 } 17256 var result = ""; 17257 for (var i2 = 0; i2 < len; i2++) { 17258 result += String.fromCharCode(buf[i2]); 17259 } 17260 return result; 17261 } 17262 exports2.buf2binstring = function(buf) { 17263 return buf2binstring(buf, buf.length); 17264 }; 17265 exports2.binstring2buf = function(str) { 17266 var buf = new utils.Buf8(str.length); 17267 for (var i2 = 0, len = buf.length; i2 < len; i2++) { 17268 buf[i2] = str.charCodeAt(i2); 17269 } 17270 return buf; 17271 }; 17272 exports2.buf2string = function(buf, max2) { 17273 var i2, out, c2, c_len; 17274 var len = max2 || buf.length; 17275 var utf16buf = new Array(len * 2); 17276 for (out = 0, i2 = 0; i2 < len; ) { 17277 c2 = buf[i2++]; 17278 if (c2 < 128) { 17279 utf16buf[out++] = c2; 17280 continue; 17281 } 17282 c_len = _utf8len[c2]; 17283 if (c_len > 4) { 17284 utf16buf[out++] = 65533; 17285 i2 += c_len - 1; 17286 continue; 17287 } 17288 c2 &= c_len === 2 ? 31 : c_len === 3 ? 15 : 7; 17289 while (c_len > 1 && i2 < len) { 17290 c2 = c2 << 6 | buf[i2++] & 63; 17291 c_len--; 17292 } 17293 if (c_len > 1) { 17294 utf16buf[out++] = 65533; 17295 continue; 17296 } 17297 if (c2 < 65536) { 17298 utf16buf[out++] = c2; 17299 } else { 17300 c2 -= 65536; 17301 utf16buf[out++] = 55296 | c2 >> 10 & 1023; 17302 utf16buf[out++] = 56320 | c2 & 1023; 17303 } 17304 } 17305 return buf2binstring(utf16buf, out); 17306 }; 17307 exports2.utf8border = function(buf, max2) { 17308 var pos; 17309 max2 = max2 || buf.length; 17310 if (max2 > buf.length) { 17311 max2 = buf.length; 17312 } 17313 pos = max2 - 1; 17314 while (pos >= 0 && (buf[pos] & 192) === 128) { 17315 pos--; 17316 } 17317 if (pos < 0) { 17318 return max2; 17319 } 17320 if (pos === 0) { 17321 return max2; 17322 } 17323 return pos + _utf8len[buf[pos]] > max2 ? pos : max2; 17324 }; 17325 }, 17326 { "./common": 1 } 17327 ], 17328 3: [ 17329 function(require2, module2, exports2) { 17330 "use strict"; 17331 function adler32(adler, buf, len, pos) { 17332 var s1 = adler & 65535 | 0, s2 = adler >>> 16 & 65535 | 0, n2 = 0; 17333 while (len !== 0) { 17334 n2 = len > 2e3 ? 2e3 : len; 17335 len -= n2; 17336 do { 17337 s1 = s1 + buf[pos++] | 0; 17338 s2 = s2 + s1 | 0; 17339 } while (--n2); 17340 s1 %= 65521; 17341 s2 %= 65521; 17342 } 17343 return s1 | s2 << 16 | 0; 17344 } 17345 module2.exports = adler32; 17346 }, 17347 {} 17348 ], 17349 4: [ 17350 function(require2, module2, exports2) { 17351 "use strict"; 17352 module2.exports = { 17353 /* Allowed flush values; see deflate() and inflate() below for details */ 17354 Z_NO_FLUSH: 0, 17355 Z_PARTIAL_FLUSH: 1, 17356 Z_SYNC_FLUSH: 2, 17357 Z_FULL_FLUSH: 3, 17358 Z_FINISH: 4, 17359 Z_BLOCK: 5, 17360 Z_TREES: 6, 17361 /* Return codes for the compression/decompression functions. Negative values 17362 * are errors, positive values are used for special but normal events. 17363 */ 17364 Z_OK: 0, 17365 Z_STREAM_END: 1, 17366 Z_NEED_DICT: 2, 17367 Z_ERRNO: -1, 17368 Z_STREAM_ERROR: -2, 17369 Z_DATA_ERROR: -3, 17370 //Z_MEM_ERROR: -4, 17371 Z_BUF_ERROR: -5, 17372 //Z_VERSION_ERROR: -6, 17373 /* compression levels */ 17374 Z_NO_COMPRESSION: 0, 17375 Z_BEST_SPEED: 1, 17376 Z_BEST_COMPRESSION: 9, 17377 Z_DEFAULT_COMPRESSION: -1, 17378 Z_FILTERED: 1, 17379 Z_HUFFMAN_ONLY: 2, 17380 Z_RLE: 3, 17381 Z_FIXED: 4, 17382 Z_DEFAULT_STRATEGY: 0, 17383 /* Possible values of the data_type field (though see inflate()) */ 17384 Z_BINARY: 0, 17385 Z_TEXT: 1, 17386 //Z_ASCII: 1, // = Z_TEXT (deprecated) 17387 Z_UNKNOWN: 2, 17388 /* The deflate compression method */ 17389 Z_DEFLATED: 8 17390 //Z_NULL: null // Use -1 or null inline, depending on var type 17391 }; 17392 }, 17393 {} 17394 ], 17395 5: [ 17396 function(require2, module2, exports2) { 17397 "use strict"; 17398 function makeTable() { 17399 var c2, table = []; 17400 for (var n2 = 0; n2 < 256; n2++) { 17401 c2 = n2; 17402 for (var k2 = 0; k2 < 8; k2++) { 17403 c2 = c2 & 1 ? 3988292384 ^ c2 >>> 1 : c2 >>> 1; 17404 } 17405 table[n2] = c2; 17406 } 17407 return table; 17408 } 17409 var crcTable = makeTable(); 17410 function crc32(crc, buf, len, pos) { 17411 var t3 = crcTable, end = pos + len; 17412 crc ^= -1; 17413 for (var i2 = pos; i2 < end; i2++) { 17414 crc = crc >>> 8 ^ t3[(crc ^ buf[i2]) & 255]; 17415 } 17416 return crc ^ -1; 17417 } 17418 module2.exports = crc32; 17419 }, 17420 {} 17421 ], 17422 6: [ 17423 function(require2, module2, exports2) { 17424 "use strict"; 17425 function GZheader() { 17426 this.text = 0; 17427 this.time = 0; 17428 this.xflags = 0; 17429 this.os = 0; 17430 this.extra = null; 17431 this.extra_len = 0; 17432 this.name = ""; 17433 this.comment = ""; 17434 this.hcrc = 0; 17435 this.done = false; 17436 } 17437 module2.exports = GZheader; 17438 }, 17439 {} 17440 ], 17441 7: [ 17442 function(require2, module2, exports2) { 17443 "use strict"; 17444 var BAD = 30; 17445 var TYPE = 12; 17446 module2.exports = function inflate_fast(strm, start) { 17447 var state; 17448 var _in; 17449 var last; 17450 var _out; 17451 var beg; 17452 var end; 17453 var dmax; 17454 var wsize; 17455 var whave; 17456 var wnext; 17457 var s_window; 17458 var hold; 17459 var bits; 17460 var lcode; 17461 var dcode; 17462 var lmask; 17463 var dmask; 17464 var here; 17465 var op; 17466 var len; 17467 var dist; 17468 var from; 17469 var from_source; 17470 var input, output; 17471 state = strm.state; 17472 _in = strm.next_in; 17473 input = strm.input; 17474 last = _in + (strm.avail_in - 5); 17475 _out = strm.next_out; 17476 output = strm.output; 17477 beg = _out - (start - strm.avail_out); 17478 end = _out + (strm.avail_out - 257); 17479 dmax = state.dmax; 17480 wsize = state.wsize; 17481 whave = state.whave; 17482 wnext = state.wnext; 17483 s_window = state.window; 17484 hold = state.hold; 17485 bits = state.bits; 17486 lcode = state.lencode; 17487 dcode = state.distcode; 17488 lmask = (1 << state.lenbits) - 1; 17489 dmask = (1 << state.distbits) - 1; 17490 top: do { 17491 if (bits < 15) { 17492 hold += input[_in++] << bits; 17493 bits += 8; 17494 hold += input[_in++] << bits; 17495 bits += 8; 17496 } 17497 here = lcode[hold & lmask]; 17498 dolen: for (; ; ) { 17499 op = here >>> 24; 17500 hold >>>= op; 17501 bits -= op; 17502 op = here >>> 16 & 255; 17503 if (op === 0) { 17504 output[_out++] = here & 65535; 17505 } else if (op & 16) { 17506 len = here & 65535; 17507 op &= 15; 17508 if (op) { 17509 if (bits < op) { 17510 hold += input[_in++] << bits; 17511 bits += 8; 17512 } 17513 len += hold & (1 << op) - 1; 17514 hold >>>= op; 17515 bits -= op; 17516 } 17517 if (bits < 15) { 17518 hold += input[_in++] << bits; 17519 bits += 8; 17520 hold += input[_in++] << bits; 17521 bits += 8; 17522 } 17523 here = dcode[hold & dmask]; 17524 dodist: for (; ; ) { 17525 op = here >>> 24; 17526 hold >>>= op; 17527 bits -= op; 17528 op = here >>> 16 & 255; 17529 if (op & 16) { 17530 dist = here & 65535; 17531 op &= 15; 17532 if (bits < op) { 17533 hold += input[_in++] << bits; 17534 bits += 8; 17535 if (bits < op) { 17536 hold += input[_in++] << bits; 17537 bits += 8; 17538 } 17539 } 17540 dist += hold & (1 << op) - 1; 17541 if (dist > dmax) { 17542 strm.msg = "invalid distance too far back"; 17543 state.mode = BAD; 17544 break top; 17545 } 17546 hold >>>= op; 17547 bits -= op; 17548 op = _out - beg; 17549 if (dist > op) { 17550 op = dist - op; 17551 if (op > whave) { 17552 if (state.sane) { 17553 strm.msg = "invalid distance too far back"; 17554 state.mode = BAD; 17555 break top; 17556 } 17557 } 17558 from = 0; 17559 from_source = s_window; 17560 if (wnext === 0) { 17561 from += wsize - op; 17562 if (op < len) { 17563 len -= op; 17564 do { 17565 output[_out++] = s_window[from++]; 17566 } while (--op); 17567 from = _out - dist; 17568 from_source = output; 17569 } 17570 } else if (wnext < op) { 17571 from += wsize + wnext - op; 17572 op -= wnext; 17573 if (op < len) { 17574 len -= op; 17575 do { 17576 output[_out++] = s_window[from++]; 17577 } while (--op); 17578 from = 0; 17579 if (wnext < len) { 17580 op = wnext; 17581 len -= op; 17582 do { 17583 output[_out++] = s_window[from++]; 17584 } while (--op); 17585 from = _out - dist; 17586 from_source = output; 17587 } 17588 } 17589 } else { 17590 from += wnext - op; 17591 if (op < len) { 17592 len -= op; 17593 do { 17594 output[_out++] = s_window[from++]; 17595 } while (--op); 17596 from = _out - dist; 17597 from_source = output; 17598 } 17599 } 17600 while (len > 2) { 17601 output[_out++] = from_source[from++]; 17602 output[_out++] = from_source[from++]; 17603 output[_out++] = from_source[from++]; 17604 len -= 3; 17605 } 17606 if (len) { 17607 output[_out++] = from_source[from++]; 17608 if (len > 1) { 17609 output[_out++] = from_source[from++]; 17610 } 17611 } 17612 } else { 17613 from = _out - dist; 17614 do { 17615 output[_out++] = output[from++]; 17616 output[_out++] = output[from++]; 17617 output[_out++] = output[from++]; 17618 len -= 3; 17619 } while (len > 2); 17620 if (len) { 17621 output[_out++] = output[from++]; 17622 if (len > 1) { 17623 output[_out++] = output[from++]; 17624 } 17625 } 17626 } 17627 } else if ((op & 64) === 0) { 17628 here = dcode[(here & 65535) + (hold & (1 << op) - 1)]; 17629 continue dodist; 17630 } else { 17631 strm.msg = "invalid distance code"; 17632 state.mode = BAD; 17633 break top; 17634 } 17635 break; 17636 } 17637 } else if ((op & 64) === 0) { 17638 here = lcode[(here & 65535) + (hold & (1 << op) - 1)]; 17639 continue dolen; 17640 } else if (op & 32) { 17641 state.mode = TYPE; 17642 break top; 17643 } else { 17644 strm.msg = "invalid literal/length code"; 17645 state.mode = BAD; 17646 break top; 17647 } 17648 break; 17649 } 17650 } while (_in < last && _out < end); 17651 len = bits >> 3; 17652 _in -= len; 17653 bits -= len << 3; 17654 hold &= (1 << bits) - 1; 17655 strm.next_in = _in; 17656 strm.next_out = _out; 17657 strm.avail_in = _in < last ? 5 + (last - _in) : 5 - (_in - last); 17658 strm.avail_out = _out < end ? 257 + (end - _out) : 257 - (_out - end); 17659 state.hold = hold; 17660 state.bits = bits; 17661 return; 17662 }; 17663 }, 17664 {} 17665 ], 17666 8: [ 17667 function(require2, module2, exports2) { 17668 "use strict"; 17669 var utils = require2("../utils/common"); 17670 var adler32 = require2("./adler32"); 17671 var crc32 = require2("./crc32"); 17672 var inflate_fast = require2("./inffast"); 17673 var inflate_table = require2("./inftrees"); 17674 var CODES = 0; 17675 var LENS = 1; 17676 var DISTS = 2; 17677 var Z_FINISH = 4; 17678 var Z_BLOCK = 5; 17679 var Z_TREES = 6; 17680 var Z_OK = 0; 17681 var Z_STREAM_END = 1; 17682 var Z_NEED_DICT = 2; 17683 var Z_STREAM_ERROR = -2; 17684 var Z_DATA_ERROR = -3; 17685 var Z_MEM_ERROR = -4; 17686 var Z_BUF_ERROR = -5; 17687 var Z_DEFLATED = 8; 17688 var HEAD = 1; 17689 var FLAGS = 2; 17690 var TIME = 3; 17691 var OS = 4; 17692 var EXLEN = 5; 17693 var EXTRA = 6; 17694 var NAME = 7; 17695 var COMMENT = 8; 17696 var HCRC = 9; 17697 var DICTID = 10; 17698 var DICT = 11; 17699 var TYPE = 12; 17700 var TYPEDO = 13; 17701 var STORED = 14; 17702 var COPY_ = 15; 17703 var COPY = 16; 17704 var TABLE = 17; 17705 var LENLENS = 18; 17706 var CODELENS = 19; 17707 var LEN_ = 20; 17708 var LEN = 21; 17709 var LENEXT = 22; 17710 var DIST = 23; 17711 var DISTEXT = 24; 17712 var MATCH = 25; 17713 var LIT = 26; 17714 var CHECK = 27; 17715 var LENGTH = 28; 17716 var DONE = 29; 17717 var BAD = 30; 17718 var MEM = 31; 17719 var SYNC = 32; 17720 var ENOUGH_LENS = 852; 17721 var ENOUGH_DISTS = 592; 17722 var MAX_WBITS = 15; 17723 var DEF_WBITS = MAX_WBITS; 17724 function zswap32(q) { 17725 return (q >>> 24 & 255) + (q >>> 8 & 65280) + ((q & 65280) << 8) + ((q & 255) << 24); 17726 } 17727 function InflateState() { 17728 this.mode = 0; 17729 this.last = false; 17730 this.wrap = 0; 17731 this.havedict = false; 17732 this.flags = 0; 17733 this.dmax = 0; 17734 this.check = 0; 17735 this.total = 0; 17736 this.head = null; 17737 this.wbits = 0; 17738 this.wsize = 0; 17739 this.whave = 0; 17740 this.wnext = 0; 17741 this.window = null; 17742 this.hold = 0; 17743 this.bits = 0; 17744 this.length = 0; 17745 this.offset = 0; 17746 this.extra = 0; 17747 this.lencode = null; 17748 this.distcode = null; 17749 this.lenbits = 0; 17750 this.distbits = 0; 17751 this.ncode = 0; 17752 this.nlen = 0; 17753 this.ndist = 0; 17754 this.have = 0; 17755 this.next = null; 17756 this.lens = new utils.Buf16( 17757 320 17758 ); 17759 this.work = new utils.Buf16( 17760 288 17761 ); 17762 this.lendyn = null; 17763 this.distdyn = null; 17764 this.sane = 0; 17765 this.back = 0; 17766 this.was = 0; 17767 } 17768 function inflateResetKeep(strm) { 17769 var state; 17770 if (!strm || !strm.state) { 17771 return Z_STREAM_ERROR; 17772 } 17773 state = strm.state; 17774 strm.total_in = strm.total_out = state.total = 0; 17775 strm.msg = ""; 17776 if (state.wrap) { 17777 strm.adler = state.wrap & 1; 17778 } 17779 state.mode = HEAD; 17780 state.last = 0; 17781 state.havedict = 0; 17782 state.dmax = 32768; 17783 state.head = null; 17784 state.hold = 0; 17785 state.bits = 0; 17786 state.lencode = state.lendyn = new utils.Buf32( 17787 ENOUGH_LENS 17788 ); 17789 state.distcode = state.distdyn = new utils.Buf32( 17790 ENOUGH_DISTS 17791 ); 17792 state.sane = 1; 17793 state.back = -1; 17794 return Z_OK; 17795 } 17796 function inflateReset(strm) { 17797 var state; 17798 if (!strm || !strm.state) { 17799 return Z_STREAM_ERROR; 17800 } 17801 state = strm.state; 17802 state.wsize = 0; 17803 state.whave = 0; 17804 state.wnext = 0; 17805 return inflateResetKeep(strm); 17806 } 17807 function inflateReset2(strm, windowBits) { 17808 var wrap; 17809 var state; 17810 if (!strm || !strm.state) { 17811 return Z_STREAM_ERROR; 17812 } 17813 state = strm.state; 17814 if (windowBits < 0) { 17815 wrap = 0; 17816 windowBits = -windowBits; 17817 } else { 17818 wrap = (windowBits >> 4) + 1; 17819 if (windowBits < 48) { 17820 windowBits &= 15; 17821 } 17822 } 17823 if (windowBits && (windowBits < 8 || windowBits > 15)) { 17824 return Z_STREAM_ERROR; 17825 } 17826 if (state.window !== null && state.wbits !== windowBits) { 17827 state.window = null; 17828 } 17829 state.wrap = wrap; 17830 state.wbits = windowBits; 17831 return inflateReset(strm); 17832 } 17833 function inflateInit2(strm, windowBits) { 17834 var ret; 17835 var state; 17836 if (!strm) { 17837 return Z_STREAM_ERROR; 17838 } 17839 state = new InflateState(); 17840 strm.state = state; 17841 state.window = null; 17842 ret = inflateReset2(strm, windowBits); 17843 if (ret !== Z_OK) { 17844 strm.state = null; 17845 } 17846 return ret; 17847 } 17848 function inflateInit(strm) { 17849 return inflateInit2(strm, DEF_WBITS); 17850 } 17851 var virgin = true; 17852 var lenfix, distfix; 17853 function fixedtables(state) { 17854 if (virgin) { 17855 var sym; 17856 lenfix = new utils.Buf32(512); 17857 distfix = new utils.Buf32(32); 17858 sym = 0; 17859 while (sym < 144) { 17860 state.lens[sym++] = 8; 17861 } 17862 while (sym < 256) { 17863 state.lens[sym++] = 9; 17864 } 17865 while (sym < 280) { 17866 state.lens[sym++] = 7; 17867 } 17868 while (sym < 288) { 17869 state.lens[sym++] = 8; 17870 } 17871 inflate_table( 17872 LENS, 17873 state.lens, 17874 0, 17875 288, 17876 lenfix, 17877 0, 17878 state.work, 17879 { bits: 9 } 17880 ); 17881 sym = 0; 17882 while (sym < 32) { 17883 state.lens[sym++] = 5; 17884 } 17885 inflate_table( 17886 DISTS, 17887 state.lens, 17888 0, 17889 32, 17890 distfix, 17891 0, 17892 state.work, 17893 { bits: 5 } 17894 ); 17895 virgin = false; 17896 } 17897 state.lencode = lenfix; 17898 state.lenbits = 9; 17899 state.distcode = distfix; 17900 state.distbits = 5; 17901 } 17902 function updatewindow(strm, src, end, copy) { 17903 var dist; 17904 var state = strm.state; 17905 if (state.window === null) { 17906 state.wsize = 1 << state.wbits; 17907 state.wnext = 0; 17908 state.whave = 0; 17909 state.window = new utils.Buf8(state.wsize); 17910 } 17911 if (copy >= state.wsize) { 17912 utils.arraySet( 17913 state.window, 17914 src, 17915 end - state.wsize, 17916 state.wsize, 17917 0 17918 ); 17919 state.wnext = 0; 17920 state.whave = state.wsize; 17921 } else { 17922 dist = state.wsize - state.wnext; 17923 if (dist > copy) { 17924 dist = copy; 17925 } 17926 utils.arraySet( 17927 state.window, 17928 src, 17929 end - copy, 17930 dist, 17931 state.wnext 17932 ); 17933 copy -= dist; 17934 if (copy) { 17935 utils.arraySet( 17936 state.window, 17937 src, 17938 end - copy, 17939 copy, 17940 0 17941 ); 17942 state.wnext = copy; 17943 state.whave = state.wsize; 17944 } else { 17945 state.wnext += dist; 17946 if (state.wnext === state.wsize) { 17947 state.wnext = 0; 17948 } 17949 if (state.whave < state.wsize) { 17950 state.whave += dist; 17951 } 17952 } 17953 } 17954 return 0; 17955 } 17956 function inflate(strm, flush) { 17957 var state; 17958 var input, output; 17959 var next; 17960 var put; 17961 var have, left; 17962 var hold; 17963 var bits; 17964 var _in, _out; 17965 var copy; 17966 var from; 17967 var from_source; 17968 var here = 0; 17969 var here_bits, here_op, here_val; 17970 var last_bits, last_op, last_val; 17971 var len; 17972 var ret; 17973 var hbuf = new utils.Buf8( 17974 4 17975 ); 17976 var opts; 17977 var n2; 17978 var order = ( 17979 /* permutation of code lengths */ 17980 [ 17981 16, 17982 17, 17983 18, 17984 0, 17985 8, 17986 7, 17987 9, 17988 6, 17989 10, 17990 5, 17991 11, 17992 4, 17993 12, 17994 3, 17995 13, 17996 2, 17997 14, 17998 1, 17999 15 18000 ] 18001 ); 18002 if (!strm || !strm.state || !strm.output || !strm.input && strm.avail_in !== 0) { 18003 return Z_STREAM_ERROR; 18004 } 18005 state = strm.state; 18006 if (state.mode === TYPE) { 18007 state.mode = TYPEDO; 18008 } 18009 put = strm.next_out; 18010 output = strm.output; 18011 left = strm.avail_out; 18012 next = strm.next_in; 18013 input = strm.input; 18014 have = strm.avail_in; 18015 hold = state.hold; 18016 bits = state.bits; 18017 _in = have; 18018 _out = left; 18019 ret = Z_OK; 18020 inf_leave: for (; ; ) { 18021 switch (state.mode) { 18022 case HEAD: 18023 if (state.wrap === 0) { 18024 state.mode = TYPEDO; 18025 break; 18026 } 18027 while (bits < 16) { 18028 if (have === 0) { 18029 break inf_leave; 18030 } 18031 have--; 18032 hold += input[next++] << bits; 18033 bits += 8; 18034 } 18035 if (state.wrap & 2 && hold === 35615) { 18036 state.check = 0; 18037 hbuf[0] = hold & 255; 18038 hbuf[1] = hold >>> 8 & 255; 18039 state.check = crc32( 18040 state.check, 18041 hbuf, 18042 2, 18043 0 18044 ); 18045 hold = 0; 18046 bits = 0; 18047 state.mode = FLAGS; 18048 break; 18049 } 18050 state.flags = 0; 18051 if (state.head) { 18052 state.head.done = false; 18053 } 18054 if (!(state.wrap & 1) || (((hold & 255) << 8) + (hold >> 8)) % 31) { 18055 strm.msg = "incorrect header check"; 18056 state.mode = BAD; 18057 break; 18058 } 18059 if ((hold & 15) !== Z_DEFLATED) { 18060 strm.msg = "unknown compression method"; 18061 state.mode = BAD; 18062 break; 18063 } 18064 hold >>>= 4; 18065 bits -= 4; 18066 len = (hold & 15) + 8; 18067 if (state.wbits === 0) { 18068 state.wbits = len; 18069 } else if (len > state.wbits) { 18070 strm.msg = "invalid window size"; 18071 state.mode = BAD; 18072 break; 18073 } 18074 state.dmax = 1 << len; 18075 strm.adler = state.check = 1; 18076 state.mode = hold & 512 ? DICTID : TYPE; 18077 hold = 0; 18078 bits = 0; 18079 break; 18080 case FLAGS: 18081 while (bits < 16) { 18082 if (have === 0) { 18083 break inf_leave; 18084 } 18085 have--; 18086 hold += input[next++] << bits; 18087 bits += 8; 18088 } 18089 state.flags = hold; 18090 if ((state.flags & 255) !== Z_DEFLATED) { 18091 strm.msg = "unknown compression method"; 18092 state.mode = BAD; 18093 break; 18094 } 18095 if (state.flags & 57344) { 18096 strm.msg = "unknown header flags set"; 18097 state.mode = BAD; 18098 break; 18099 } 18100 if (state.head) { 18101 state.head.text = hold >> 8 & 1; 18102 } 18103 if (state.flags & 512) { 18104 hbuf[0] = hold & 255; 18105 hbuf[1] = hold >>> 8 & 255; 18106 state.check = crc32( 18107 state.check, 18108 hbuf, 18109 2, 18110 0 18111 ); 18112 } 18113 hold = 0; 18114 bits = 0; 18115 state.mode = TIME; 18116 /* falls through */ 18117 case TIME: 18118 while (bits < 32) { 18119 if (have === 0) { 18120 break inf_leave; 18121 } 18122 have--; 18123 hold += input[next++] << bits; 18124 bits += 8; 18125 } 18126 if (state.head) { 18127 state.head.time = hold; 18128 } 18129 if (state.flags & 512) { 18130 hbuf[0] = hold & 255; 18131 hbuf[1] = hold >>> 8 & 255; 18132 hbuf[2] = hold >>> 16 & 255; 18133 hbuf[3] = hold >>> 24 & 255; 18134 state.check = crc32( 18135 state.check, 18136 hbuf, 18137 4, 18138 0 18139 ); 18140 } 18141 hold = 0; 18142 bits = 0; 18143 state.mode = OS; 18144 /* falls through */ 18145 case OS: 18146 while (bits < 16) { 18147 if (have === 0) { 18148 break inf_leave; 18149 } 18150 have--; 18151 hold += input[next++] << bits; 18152 bits += 8; 18153 } 18154 if (state.head) { 18155 state.head.xflags = hold & 255; 18156 state.head.os = hold >> 8; 18157 } 18158 if (state.flags & 512) { 18159 hbuf[0] = hold & 255; 18160 hbuf[1] = hold >>> 8 & 255; 18161 state.check = crc32( 18162 state.check, 18163 hbuf, 18164 2, 18165 0 18166 ); 18167 } 18168 hold = 0; 18169 bits = 0; 18170 state.mode = EXLEN; 18171 /* falls through */ 18172 case EXLEN: 18173 if (state.flags & 1024) { 18174 while (bits < 16) { 18175 if (have === 0) { 18176 break inf_leave; 18177 } 18178 have--; 18179 hold += input[next++] << bits; 18180 bits += 8; 18181 } 18182 state.length = hold; 18183 if (state.head) { 18184 state.head.extra_len = hold; 18185 } 18186 if (state.flags & 512) { 18187 hbuf[0] = hold & 255; 18188 hbuf[1] = hold >>> 8 & 255; 18189 state.check = crc32( 18190 state.check, 18191 hbuf, 18192 2, 18193 0 18194 ); 18195 } 18196 hold = 0; 18197 bits = 0; 18198 } else if (state.head) { 18199 state.head.extra = null; 18200 } 18201 state.mode = EXTRA; 18202 /* falls through */ 18203 case EXTRA: 18204 if (state.flags & 1024) { 18205 copy = state.length; 18206 if (copy > have) { 18207 copy = have; 18208 } 18209 if (copy) { 18210 if (state.head) { 18211 len = state.head.extra_len - state.length; 18212 if (!state.head.extra) { 18213 state.head.extra = new Array( 18214 state.head.extra_len 18215 ); 18216 } 18217 utils.arraySet( 18218 state.head.extra, 18219 input, 18220 next, 18221 // extra field is limited to 65536 bytes 18222 // - no need for additional size check 18223 copy, 18224 /*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/ 18225 len 18226 ); 18227 } 18228 if (state.flags & 512) { 18229 state.check = crc32( 18230 state.check, 18231 input, 18232 copy, 18233 next 18234 ); 18235 } 18236 have -= copy; 18237 next += copy; 18238 state.length -= copy; 18239 } 18240 if (state.length) { 18241 break inf_leave; 18242 } 18243 } 18244 state.length = 0; 18245 state.mode = NAME; 18246 /* falls through */ 18247 case NAME: 18248 if (state.flags & 2048) { 18249 if (have === 0) { 18250 break inf_leave; 18251 } 18252 copy = 0; 18253 do { 18254 len = input[next + copy++]; 18255 if (state.head && len && state.length < 65536) { 18256 state.head.name += String.fromCharCode(len); 18257 } 18258 } while (len && copy < have); 18259 if (state.flags & 512) { 18260 state.check = crc32( 18261 state.check, 18262 input, 18263 copy, 18264 next 18265 ); 18266 } 18267 have -= copy; 18268 next += copy; 18269 if (len) { 18270 break inf_leave; 18271 } 18272 } else if (state.head) { 18273 state.head.name = null; 18274 } 18275 state.length = 0; 18276 state.mode = COMMENT; 18277 /* falls through */ 18278 case COMMENT: 18279 if (state.flags & 4096) { 18280 if (have === 0) { 18281 break inf_leave; 18282 } 18283 copy = 0; 18284 do { 18285 len = input[next + copy++]; 18286 if (state.head && len && state.length < 65536) { 18287 state.head.comment += String.fromCharCode(len); 18288 } 18289 } while (len && copy < have); 18290 if (state.flags & 512) { 18291 state.check = crc32( 18292 state.check, 18293 input, 18294 copy, 18295 next 18296 ); 18297 } 18298 have -= copy; 18299 next += copy; 18300 if (len) { 18301 break inf_leave; 18302 } 18303 } else if (state.head) { 18304 state.head.comment = null; 18305 } 18306 state.mode = HCRC; 18307 /* falls through */ 18308 case HCRC: 18309 if (state.flags & 512) { 18310 while (bits < 16) { 18311 if (have === 0) { 18312 break inf_leave; 18313 } 18314 have--; 18315 hold += input[next++] << bits; 18316 bits += 8; 18317 } 18318 if (hold !== (state.check & 65535)) { 18319 strm.msg = "header crc mismatch"; 18320 state.mode = BAD; 18321 break; 18322 } 18323 hold = 0; 18324 bits = 0; 18325 } 18326 if (state.head) { 18327 state.head.hcrc = state.flags >> 9 & 1; 18328 state.head.done = true; 18329 } 18330 strm.adler = state.check = 0; 18331 state.mode = TYPE; 18332 break; 18333 case DICTID: 18334 while (bits < 32) { 18335 if (have === 0) { 18336 break inf_leave; 18337 } 18338 have--; 18339 hold += input[next++] << bits; 18340 bits += 8; 18341 } 18342 strm.adler = state.check = zswap32(hold); 18343 hold = 0; 18344 bits = 0; 18345 state.mode = DICT; 18346 /* falls through */ 18347 case DICT: 18348 if (state.havedict === 0) { 18349 strm.next_out = put; 18350 strm.avail_out = left; 18351 strm.next_in = next; 18352 strm.avail_in = have; 18353 state.hold = hold; 18354 state.bits = bits; 18355 return Z_NEED_DICT; 18356 } 18357 strm.adler = state.check = 1; 18358 state.mode = TYPE; 18359 /* falls through */ 18360 case TYPE: 18361 if (flush === Z_BLOCK || flush === Z_TREES) { 18362 break inf_leave; 18363 } 18364 /* falls through */ 18365 case TYPEDO: 18366 if (state.last) { 18367 hold >>>= bits & 7; 18368 bits -= bits & 7; 18369 state.mode = CHECK; 18370 break; 18371 } 18372 while (bits < 3) { 18373 if (have === 0) { 18374 break inf_leave; 18375 } 18376 have--; 18377 hold += input[next++] << bits; 18378 bits += 8; 18379 } 18380 state.last = hold & 1; 18381 hold >>>= 1; 18382 bits -= 1; 18383 switch (hold & 3) { 18384 case 0: 18385 state.mode = STORED; 18386 break; 18387 case 1: 18388 fixedtables(state); 18389 state.mode = LEN_; 18390 if (flush === Z_TREES) { 18391 hold >>>= 2; 18392 bits -= 2; 18393 break inf_leave; 18394 } 18395 break; 18396 case 2: 18397 state.mode = TABLE; 18398 break; 18399 case 3: 18400 strm.msg = "invalid block type"; 18401 state.mode = BAD; 18402 } 18403 hold >>>= 2; 18404 bits -= 2; 18405 break; 18406 case STORED: 18407 hold >>>= bits & 7; 18408 bits -= bits & 7; 18409 while (bits < 32) { 18410 if (have === 0) { 18411 break inf_leave; 18412 } 18413 have--; 18414 hold += input[next++] << bits; 18415 bits += 8; 18416 } 18417 if ((hold & 65535) !== (hold >>> 16 ^ 65535)) { 18418 strm.msg = "invalid stored block lengths"; 18419 state.mode = BAD; 18420 break; 18421 } 18422 state.length = hold & 65535; 18423 hold = 0; 18424 bits = 0; 18425 state.mode = COPY_; 18426 if (flush === Z_TREES) { 18427 break inf_leave; 18428 } 18429 /* falls through */ 18430 case COPY_: 18431 state.mode = COPY; 18432 /* falls through */ 18433 case COPY: 18434 copy = state.length; 18435 if (copy) { 18436 if (copy > have) { 18437 copy = have; 18438 } 18439 if (copy > left) { 18440 copy = left; 18441 } 18442 if (copy === 0) { 18443 break inf_leave; 18444 } 18445 utils.arraySet( 18446 output, 18447 input, 18448 next, 18449 copy, 18450 put 18451 ); 18452 have -= copy; 18453 next += copy; 18454 left -= copy; 18455 put += copy; 18456 state.length -= copy; 18457 break; 18458 } 18459 state.mode = TYPE; 18460 break; 18461 case TABLE: 18462 while (bits < 14) { 18463 if (have === 0) { 18464 break inf_leave; 18465 } 18466 have--; 18467 hold += input[next++] << bits; 18468 bits += 8; 18469 } 18470 state.nlen = (hold & 31) + 257; 18471 hold >>>= 5; 18472 bits -= 5; 18473 state.ndist = (hold & 31) + 1; 18474 hold >>>= 5; 18475 bits -= 5; 18476 state.ncode = (hold & 15) + 4; 18477 hold >>>= 4; 18478 bits -= 4; 18479 if (state.nlen > 286 || state.ndist > 30) { 18480 strm.msg = "too many length or distance symbols"; 18481 state.mode = BAD; 18482 break; 18483 } 18484 state.have = 0; 18485 state.mode = LENLENS; 18486 /* falls through */ 18487 case LENLENS: 18488 while (state.have < state.ncode) { 18489 while (bits < 3) { 18490 if (have === 0) { 18491 break inf_leave; 18492 } 18493 have--; 18494 hold += input[next++] << bits; 18495 bits += 8; 18496 } 18497 state.lens[order[state.have++]] = hold & 7; 18498 hold >>>= 3; 18499 bits -= 3; 18500 } 18501 while (state.have < 19) { 18502 state.lens[order[state.have++]] = 0; 18503 } 18504 state.lencode = state.lendyn; 18505 state.lenbits = 7; 18506 opts = { bits: state.lenbits }; 18507 ret = inflate_table( 18508 CODES, 18509 state.lens, 18510 0, 18511 19, 18512 state.lencode, 18513 0, 18514 state.work, 18515 opts 18516 ); 18517 state.lenbits = opts.bits; 18518 if (ret) { 18519 strm.msg = "invalid code lengths set"; 18520 state.mode = BAD; 18521 break; 18522 } 18523 state.have = 0; 18524 state.mode = CODELENS; 18525 /* falls through */ 18526 case CODELENS: 18527 while (state.have < state.nlen + state.ndist) { 18528 for (; ; ) { 18529 here = state.lencode[hold & (1 << state.lenbits) - 1]; 18530 here_bits = here >>> 24; 18531 here_op = here >>> 16 & 255; 18532 here_val = here & 65535; 18533 if (here_bits <= bits) { 18534 break; 18535 } 18536 if (have === 0) { 18537 break inf_leave; 18538 } 18539 have--; 18540 hold += input[next++] << bits; 18541 bits += 8; 18542 } 18543 if (here_val < 16) { 18544 hold >>>= here_bits; 18545 bits -= here_bits; 18546 state.lens[state.have++] = here_val; 18547 } else { 18548 if (here_val === 16) { 18549 n2 = here_bits + 2; 18550 while (bits < n2) { 18551 if (have === 0) { 18552 break inf_leave; 18553 } 18554 have--; 18555 hold += input[next++] << bits; 18556 bits += 8; 18557 } 18558 hold >>>= here_bits; 18559 bits -= here_bits; 18560 if (state.have === 0) { 18561 strm.msg = "invalid bit length repeat"; 18562 state.mode = BAD; 18563 break; 18564 } 18565 len = state.lens[state.have - 1]; 18566 copy = 3 + (hold & 3); 18567 hold >>>= 2; 18568 bits -= 2; 18569 } else if (here_val === 17) { 18570 n2 = here_bits + 3; 18571 while (bits < n2) { 18572 if (have === 0) { 18573 break inf_leave; 18574 } 18575 have--; 18576 hold += input[next++] << bits; 18577 bits += 8; 18578 } 18579 hold >>>= here_bits; 18580 bits -= here_bits; 18581 len = 0; 18582 copy = 3 + (hold & 7); 18583 hold >>>= 3; 18584 bits -= 3; 18585 } else { 18586 n2 = here_bits + 7; 18587 while (bits < n2) { 18588 if (have === 0) { 18589 break inf_leave; 18590 } 18591 have--; 18592 hold += input[next++] << bits; 18593 bits += 8; 18594 } 18595 hold >>>= here_bits; 18596 bits -= here_bits; 18597 len = 0; 18598 copy = 11 + (hold & 127); 18599 hold >>>= 7; 18600 bits -= 7; 18601 } 18602 if (state.have + copy > state.nlen + state.ndist) { 18603 strm.msg = "invalid bit length repeat"; 18604 state.mode = BAD; 18605 break; 18606 } 18607 while (copy--) { 18608 state.lens[state.have++] = len; 18609 } 18610 } 18611 } 18612 if (state.mode === BAD) { 18613 break; 18614 } 18615 if (state.lens[256] === 0) { 18616 strm.msg = "invalid code -- missing end-of-block"; 18617 state.mode = BAD; 18618 break; 18619 } 18620 state.lenbits = 9; 18621 opts = { bits: state.lenbits }; 18622 ret = inflate_table( 18623 LENS, 18624 state.lens, 18625 0, 18626 state.nlen, 18627 state.lencode, 18628 0, 18629 state.work, 18630 opts 18631 ); 18632 state.lenbits = opts.bits; 18633 if (ret) { 18634 strm.msg = "invalid literal/lengths set"; 18635 state.mode = BAD; 18636 break; 18637 } 18638 state.distbits = 6; 18639 state.distcode = state.distdyn; 18640 opts = { bits: state.distbits }; 18641 ret = inflate_table( 18642 DISTS, 18643 state.lens, 18644 state.nlen, 18645 state.ndist, 18646 state.distcode, 18647 0, 18648 state.work, 18649 opts 18650 ); 18651 state.distbits = opts.bits; 18652 if (ret) { 18653 strm.msg = "invalid distances set"; 18654 state.mode = BAD; 18655 break; 18656 } 18657 state.mode = LEN_; 18658 if (flush === Z_TREES) { 18659 break inf_leave; 18660 } 18661 /* falls through */ 18662 case LEN_: 18663 state.mode = LEN; 18664 /* falls through */ 18665 case LEN: 18666 if (have >= 6 && left >= 258) { 18667 strm.next_out = put; 18668 strm.avail_out = left; 18669 strm.next_in = next; 18670 strm.avail_in = have; 18671 state.hold = hold; 18672 state.bits = bits; 18673 inflate_fast(strm, _out); 18674 put = strm.next_out; 18675 output = strm.output; 18676 left = strm.avail_out; 18677 next = strm.next_in; 18678 input = strm.input; 18679 have = strm.avail_in; 18680 hold = state.hold; 18681 bits = state.bits; 18682 if (state.mode === TYPE) { 18683 state.back = -1; 18684 } 18685 break; 18686 } 18687 state.back = 0; 18688 for (; ; ) { 18689 here = state.lencode[hold & (1 << state.lenbits) - 1]; 18690 here_bits = here >>> 24; 18691 here_op = here >>> 16 & 255; 18692 here_val = here & 65535; 18693 if (here_bits <= bits) { 18694 break; 18695 } 18696 if (have === 0) { 18697 break inf_leave; 18698 } 18699 have--; 18700 hold += input[next++] << bits; 18701 bits += 8; 18702 } 18703 if (here_op && (here_op & 240) === 0) { 18704 last_bits = here_bits; 18705 last_op = here_op; 18706 last_val = here_val; 18707 for (; ; ) { 18708 here = state.lencode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; 18709 here_bits = here >>> 24; 18710 here_op = here >>> 16 & 255; 18711 here_val = here & 65535; 18712 if (last_bits + here_bits <= bits) { 18713 break; 18714 } 18715 if (have === 0) { 18716 break inf_leave; 18717 } 18718 have--; 18719 hold += input[next++] << bits; 18720 bits += 8; 18721 } 18722 hold >>>= last_bits; 18723 bits -= last_bits; 18724 state.back += last_bits; 18725 } 18726 hold >>>= here_bits; 18727 bits -= here_bits; 18728 state.back += here_bits; 18729 state.length = here_val; 18730 if (here_op === 0) { 18731 state.mode = LIT; 18732 break; 18733 } 18734 if (here_op & 32) { 18735 state.back = -1; 18736 state.mode = TYPE; 18737 break; 18738 } 18739 if (here_op & 64) { 18740 strm.msg = "invalid literal/length code"; 18741 state.mode = BAD; 18742 break; 18743 } 18744 state.extra = here_op & 15; 18745 state.mode = LENEXT; 18746 /* falls through */ 18747 case LENEXT: 18748 if (state.extra) { 18749 n2 = state.extra; 18750 while (bits < n2) { 18751 if (have === 0) { 18752 break inf_leave; 18753 } 18754 have--; 18755 hold += input[next++] << bits; 18756 bits += 8; 18757 } 18758 state.length += hold & (1 << state.extra) - 1; 18759 hold >>>= state.extra; 18760 bits -= state.extra; 18761 state.back += state.extra; 18762 } 18763 state.was = state.length; 18764 state.mode = DIST; 18765 /* falls through */ 18766 case DIST: 18767 for (; ; ) { 18768 here = state.distcode[hold & (1 << state.distbits) - 1]; 18769 here_bits = here >>> 24; 18770 here_op = here >>> 16 & 255; 18771 here_val = here & 65535; 18772 if (here_bits <= bits) { 18773 break; 18774 } 18775 if (have === 0) { 18776 break inf_leave; 18777 } 18778 have--; 18779 hold += input[next++] << bits; 18780 bits += 8; 18781 } 18782 if ((here_op & 240) === 0) { 18783 last_bits = here_bits; 18784 last_op = here_op; 18785 last_val = here_val; 18786 for (; ; ) { 18787 here = state.distcode[last_val + ((hold & (1 << last_bits + last_op) - 1) >> last_bits)]; 18788 here_bits = here >>> 24; 18789 here_op = here >>> 16 & 255; 18790 here_val = here & 65535; 18791 if (last_bits + here_bits <= bits) { 18792 break; 18793 } 18794 if (have === 0) { 18795 break inf_leave; 18796 } 18797 have--; 18798 hold += input[next++] << bits; 18799 bits += 8; 18800 } 18801 hold >>>= last_bits; 18802 bits -= last_bits; 18803 state.back += last_bits; 18804 } 18805 hold >>>= here_bits; 18806 bits -= here_bits; 18807 state.back += here_bits; 18808 if (here_op & 64) { 18809 strm.msg = "invalid distance code"; 18810 state.mode = BAD; 18811 break; 18812 } 18813 state.offset = here_val; 18814 state.extra = here_op & 15; 18815 state.mode = DISTEXT; 18816 /* falls through */ 18817 case DISTEXT: 18818 if (state.extra) { 18819 n2 = state.extra; 18820 while (bits < n2) { 18821 if (have === 0) { 18822 break inf_leave; 18823 } 18824 have--; 18825 hold += input[next++] << bits; 18826 bits += 8; 18827 } 18828 state.offset += hold & (1 << state.extra) - 1; 18829 hold >>>= state.extra; 18830 bits -= state.extra; 18831 state.back += state.extra; 18832 } 18833 if (state.offset > state.dmax) { 18834 strm.msg = "invalid distance too far back"; 18835 state.mode = BAD; 18836 break; 18837 } 18838 state.mode = MATCH; 18839 /* falls through */ 18840 case MATCH: 18841 if (left === 0) { 18842 break inf_leave; 18843 } 18844 copy = _out - left; 18845 if (state.offset > copy) { 18846 copy = state.offset - copy; 18847 if (copy > state.whave) { 18848 if (state.sane) { 18849 strm.msg = "invalid distance too far back"; 18850 state.mode = BAD; 18851 break; 18852 } 18853 } 18854 if (copy > state.wnext) { 18855 copy -= state.wnext; 18856 from = state.wsize - copy; 18857 } else { 18858 from = state.wnext - copy; 18859 } 18860 if (copy > state.length) { 18861 copy = state.length; 18862 } 18863 from_source = state.window; 18864 } else { 18865 from_source = output; 18866 from = put - state.offset; 18867 copy = state.length; 18868 } 18869 if (copy > left) { 18870 copy = left; 18871 } 18872 left -= copy; 18873 state.length -= copy; 18874 do { 18875 output[put++] = from_source[from++]; 18876 } while (--copy); 18877 if (state.length === 0) { 18878 state.mode = LEN; 18879 } 18880 break; 18881 case LIT: 18882 if (left === 0) { 18883 break inf_leave; 18884 } 18885 output[put++] = state.length; 18886 left--; 18887 state.mode = LEN; 18888 break; 18889 case CHECK: 18890 if (state.wrap) { 18891 while (bits < 32) { 18892 if (have === 0) { 18893 break inf_leave; 18894 } 18895 have--; 18896 hold |= input[next++] << bits; 18897 bits += 8; 18898 } 18899 _out -= left; 18900 strm.total_out += _out; 18901 state.total += _out; 18902 if (_out) { 18903 strm.adler = state.check = /*UPDATE(state.check, put - _out, _out);*/ 18904 state.flags ? crc32( 18905 state.check, 18906 output, 18907 _out, 18908 put - _out 18909 ) : adler32( 18910 state.check, 18911 output, 18912 _out, 18913 put - _out 18914 ); 18915 } 18916 _out = left; 18917 if ((state.flags ? hold : zswap32(hold)) !== state.check) { 18918 strm.msg = "incorrect data check"; 18919 state.mode = BAD; 18920 break; 18921 } 18922 hold = 0; 18923 bits = 0; 18924 } 18925 state.mode = LENGTH; 18926 /* falls through */ 18927 case LENGTH: 18928 if (state.wrap && state.flags) { 18929 while (bits < 32) { 18930 if (have === 0) { 18931 break inf_leave; 18932 } 18933 have--; 18934 hold += input[next++] << bits; 18935 bits += 8; 18936 } 18937 if (hold !== (state.total & 4294967295)) { 18938 strm.msg = "incorrect length check"; 18939 state.mode = BAD; 18940 break; 18941 } 18942 hold = 0; 18943 bits = 0; 18944 } 18945 state.mode = DONE; 18946 /* falls through */ 18947 case DONE: 18948 ret = Z_STREAM_END; 18949 break inf_leave; 18950 case BAD: 18951 ret = Z_DATA_ERROR; 18952 break inf_leave; 18953 case MEM: 18954 return Z_MEM_ERROR; 18955 case SYNC: 18956 /* falls through */ 18957 default: 18958 return Z_STREAM_ERROR; 18959 } 18960 } 18961 strm.next_out = put; 18962 strm.avail_out = left; 18963 strm.next_in = next; 18964 strm.avail_in = have; 18965 state.hold = hold; 18966 state.bits = bits; 18967 if (state.wsize || _out !== strm.avail_out && state.mode < BAD && (state.mode < CHECK || flush !== Z_FINISH)) { 18968 if (updatewindow( 18969 strm, 18970 strm.output, 18971 strm.next_out, 18972 _out - strm.avail_out 18973 )) { 18974 state.mode = MEM; 18975 return Z_MEM_ERROR; 18976 } 18977 } 18978 _in -= strm.avail_in; 18979 _out -= strm.avail_out; 18980 strm.total_in += _in; 18981 strm.total_out += _out; 18982 state.total += _out; 18983 if (state.wrap && _out) { 18984 strm.adler = state.check = /*UPDATE(state.check, strm.next_out - _out, _out);*/ 18985 state.flags ? crc32( 18986 state.check, 18987 output, 18988 _out, 18989 strm.next_out - _out 18990 ) : adler32( 18991 state.check, 18992 output, 18993 _out, 18994 strm.next_out - _out 18995 ); 18996 } 18997 strm.data_type = state.bits + (state.last ? 64 : 0) + (state.mode === TYPE ? 128 : 0) + (state.mode === LEN_ || state.mode === COPY_ ? 256 : 0); 18998 if ((_in === 0 && _out === 0 || flush === Z_FINISH) && ret === Z_OK) { 18999 ret = Z_BUF_ERROR; 19000 } 19001 return ret; 19002 } 19003 function inflateEnd(strm) { 19004 if (!strm || !strm.state) { 19005 return Z_STREAM_ERROR; 19006 } 19007 var state = strm.state; 19008 if (state.window) { 19009 state.window = null; 19010 } 19011 strm.state = null; 19012 return Z_OK; 19013 } 19014 function inflateGetHeader(strm, head2) { 19015 var state; 19016 if (!strm || !strm.state) { 19017 return Z_STREAM_ERROR; 19018 } 19019 state = strm.state; 19020 if ((state.wrap & 2) === 0) { 19021 return Z_STREAM_ERROR; 19022 } 19023 state.head = head2; 19024 head2.done = false; 19025 return Z_OK; 19026 } 19027 function inflateSetDictionary(strm, dictionary) { 19028 var dictLength = dictionary.length; 19029 var state; 19030 var dictid; 19031 var ret; 19032 if (!strm || !strm.state) { 19033 return Z_STREAM_ERROR; 19034 } 19035 state = strm.state; 19036 if (state.wrap !== 0 && state.mode !== DICT) { 19037 return Z_STREAM_ERROR; 19038 } 19039 if (state.mode === DICT) { 19040 dictid = 1; 19041 dictid = adler32( 19042 dictid, 19043 dictionary, 19044 dictLength, 19045 0 19046 ); 19047 if (dictid !== state.check) { 19048 return Z_DATA_ERROR; 19049 } 19050 } 19051 ret = updatewindow( 19052 strm, 19053 dictionary, 19054 dictLength, 19055 dictLength 19056 ); 19057 if (ret) { 19058 state.mode = MEM; 19059 return Z_MEM_ERROR; 19060 } 19061 state.havedict = 1; 19062 return Z_OK; 19063 } 19064 exports2.inflateReset = inflateReset; 19065 exports2.inflateReset2 = inflateReset2; 19066 exports2.inflateResetKeep = inflateResetKeep; 19067 exports2.inflateInit = inflateInit; 19068 exports2.inflateInit2 = inflateInit2; 19069 exports2.inflate = inflate; 19070 exports2.inflateEnd = inflateEnd; 19071 exports2.inflateGetHeader = inflateGetHeader; 19072 exports2.inflateSetDictionary = inflateSetDictionary; 19073 exports2.inflateInfo = "pako inflate (from Nodeca project)"; 19074 }, 19075 { 19076 "../utils/common": 1, 19077 "./adler32": 3, 19078 "./crc32": 5, 19079 "./inffast": 7, 19080 "./inftrees": 9 19081 } 19082 ], 19083 9: [ 19084 function(require2, module2, exports2) { 19085 "use strict"; 19086 var utils = require2("../utils/common"); 19087 var MAXBITS = 15; 19088 var ENOUGH_LENS = 852; 19089 var ENOUGH_DISTS = 592; 19090 var CODES = 0; 19091 var LENS = 1; 19092 var DISTS = 2; 19093 var lbase = [ 19094 /* Length codes 257..285 base */ 19095 3, 19096 4, 19097 5, 19098 6, 19099 7, 19100 8, 19101 9, 19102 10, 19103 11, 19104 13, 19105 15, 19106 17, 19107 19, 19108 23, 19109 27, 19110 31, 19111 35, 19112 43, 19113 51, 19114 59, 19115 67, 19116 83, 19117 99, 19118 115, 19119 131, 19120 163, 19121 195, 19122 227, 19123 258, 19124 0, 19125 0 19126 ]; 19127 var lext = [ 19128 /* Length codes 257..285 extra */ 19129 16, 19130 16, 19131 16, 19132 16, 19133 16, 19134 16, 19135 16, 19136 16, 19137 17, 19138 17, 19139 17, 19140 17, 19141 18, 19142 18, 19143 18, 19144 18, 19145 19, 19146 19, 19147 19, 19148 19, 19149 20, 19150 20, 19151 20, 19152 20, 19153 21, 19154 21, 19155 21, 19156 21, 19157 16, 19158 72, 19159 78 19160 ]; 19161 var dbase = [ 19162 /* Distance codes 0..29 base */ 19163 1, 19164 2, 19165 3, 19166 4, 19167 5, 19168 7, 19169 9, 19170 13, 19171 17, 19172 25, 19173 33, 19174 49, 19175 65, 19176 97, 19177 129, 19178 193, 19179 257, 19180 385, 19181 513, 19182 769, 19183 1025, 19184 1537, 19185 2049, 19186 3073, 19187 4097, 19188 6145, 19189 8193, 19190 12289, 19191 16385, 19192 24577, 19193 0, 19194 0 19195 ]; 19196 var dext = [ 19197 /* Distance codes 0..29 extra */ 19198 16, 19199 16, 19200 16, 19201 16, 19202 17, 19203 17, 19204 18, 19205 18, 19206 19, 19207 19, 19208 20, 19209 20, 19210 21, 19211 21, 19212 22, 19213 22, 19214 23, 19215 23, 19216 24, 19217 24, 19218 25, 19219 25, 19220 26, 19221 26, 19222 27, 19223 27, 19224 28, 19225 28, 19226 29, 19227 29, 19228 64, 19229 64 19230 ]; 19231 module2.exports = function inflate_table(type, lens, lens_index, codes, table, table_index, work, opts) { 19232 var bits = opts.bits; 19233 var len = 0; 19234 var sym = 0; 19235 var min2 = 0, max2 = 0; 19236 var root = 0; 19237 var curr = 0; 19238 var drop = 0; 19239 var left = 0; 19240 var used = 0; 19241 var huff = 0; 19242 var incr; 19243 var fill; 19244 var low; 19245 var mask; 19246 var next; 19247 var base = null; 19248 var base_index = 0; 19249 var end; 19250 var count = new utils.Buf16(MAXBITS + 1); 19251 var offs = new utils.Buf16(MAXBITS + 1); 19252 var extra = null; 19253 var extra_index = 0; 19254 var here_bits, here_op, here_val; 19255 for (len = 0; len <= MAXBITS; len++) { 19256 count[len] = 0; 19257 } 19258 for (sym = 0; sym < codes; sym++) { 19259 count[lens[lens_index + sym]]++; 19260 } 19261 root = bits; 19262 for (max2 = MAXBITS; max2 >= 1; max2--) { 19263 if (count[max2] !== 0) { 19264 break; 19265 } 19266 } 19267 if (root > max2) { 19268 root = max2; 19269 } 19270 if (max2 === 0) { 19271 table[table_index++] = 1 << 24 | 64 << 16 | 0; 19272 table[table_index++] = 1 << 24 | 64 << 16 | 0; 19273 opts.bits = 1; 19274 return 0; 19275 } 19276 for (min2 = 1; min2 < max2; min2++) { 19277 if (count[min2] !== 0) { 19278 break; 19279 } 19280 } 19281 if (root < min2) { 19282 root = min2; 19283 } 19284 left = 1; 19285 for (len = 1; len <= MAXBITS; len++) { 19286 left <<= 1; 19287 left -= count[len]; 19288 if (left < 0) { 19289 return -1; 19290 } 19291 } 19292 if (left > 0 && (type === CODES || max2 !== 1)) { 19293 return -1; 19294 } 19295 offs[1] = 0; 19296 for (len = 1; len < MAXBITS; len++) { 19297 offs[len + 1] = offs[len] + count[len]; 19298 } 19299 for (sym = 0; sym < codes; sym++) { 19300 if (lens[lens_index + sym] !== 0) { 19301 work[offs[lens[lens_index + sym]]++] = sym; 19302 } 19303 } 19304 if (type === CODES) { 19305 base = extra = work; 19306 end = 19; 19307 } else if (type === LENS) { 19308 base = lbase; 19309 base_index -= 257; 19310 extra = lext; 19311 extra_index -= 257; 19312 end = 256; 19313 } else { 19314 base = dbase; 19315 extra = dext; 19316 end = -1; 19317 } 19318 huff = 0; 19319 sym = 0; 19320 len = min2; 19321 next = table_index; 19322 curr = root; 19323 drop = 0; 19324 low = -1; 19325 used = 1 << root; 19326 mask = used - 1; 19327 if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { 19328 return 1; 19329 } 19330 for (; ; ) { 19331 here_bits = len - drop; 19332 if (work[sym] < end) { 19333 here_op = 0; 19334 here_val = work[sym]; 19335 } else if (work[sym] > end) { 19336 here_op = extra[extra_index + work[sym]]; 19337 here_val = base[base_index + work[sym]]; 19338 } else { 19339 here_op = 32 + 64; 19340 here_val = 0; 19341 } 19342 incr = 1 << len - drop; 19343 fill = 1 << curr; 19344 min2 = fill; 19345 do { 19346 fill -= incr; 19347 table[next + (huff >> drop) + fill] = here_bits << 24 | here_op << 16 | here_val | 0; 19348 } while (fill !== 0); 19349 incr = 1 << len - 1; 19350 while (huff & incr) { 19351 incr >>= 1; 19352 } 19353 if (incr !== 0) { 19354 huff &= incr - 1; 19355 huff += incr; 19356 } else { 19357 huff = 0; 19358 } 19359 sym++; 19360 if (--count[len] === 0) { 19361 if (len === max2) { 19362 break; 19363 } 19364 len = lens[lens_index + work[sym]]; 19365 } 19366 if (len > root && (huff & mask) !== low) { 19367 if (drop === 0) { 19368 drop = root; 19369 } 19370 next += min2; 19371 curr = len - drop; 19372 left = 1 << curr; 19373 while (curr + drop < max2) { 19374 left -= count[curr + drop]; 19375 if (left <= 0) { 19376 break; 19377 } 19378 curr++; 19379 left <<= 1; 19380 } 19381 used += 1 << curr; 19382 if (type === LENS && used > ENOUGH_LENS || type === DISTS && used > ENOUGH_DISTS) { 19383 return 1; 19384 } 19385 low = huff & mask; 19386 table[low] = root << 24 | curr << 16 | next - table_index | 0; 19387 } 19388 } 19389 if (huff !== 0) { 19390 table[next + huff] = len - drop << 24 | 64 << 16 | 0; 19391 } 19392 opts.bits = root; 19393 return 0; 19394 }; 19395 }, 19396 { "../utils/common": 1 } 19397 ], 19398 10: [ 19399 function(require2, module2, exports2) { 19400 "use strict"; 19401 module2.exports = { 19402 2: "need dictionary", 19403 1: "stream end", 19404 0: "", 19405 "-1": "file error", 19406 "-2": "stream error", 19407 "-3": "data error", 19408 "-4": "insufficient memory", 19409 "-5": "buffer error", 19410 "-6": "incompatible version" 19411 }; 19412 }, 19413 {} 19414 ], 19415 11: [ 19416 function(require2, module2, exports2) { 19417 "use strict"; 19418 function ZStream() { 19419 this.input = null; 19420 this.next_in = 0; 19421 this.avail_in = 0; 19422 this.total_in = 0; 19423 this.output = null; 19424 this.next_out = 0; 19425 this.avail_out = 0; 19426 this.total_out = 0; 19427 this.msg = ""; 19428 this.state = null; 19429 this.data_type = 2; 19430 this.adler = 0; 19431 } 19432 module2.exports = ZStream; 19433 }, 19434 {} 19435 ], 19436 "/lib/inflate.js": [ 19437 function(require2, module2, exports2) { 19438 "use strict"; 19439 var zlib_inflate = require2("./zlib/inflate"); 19440 var utils = require2("./utils/common"); 19441 var strings = require2("./utils/strings"); 19442 var c2 = require2("./zlib/constants"); 19443 var msg = require2("./zlib/messages"); 19444 var ZStream = require2("./zlib/zstream"); 19445 var GZheader = require2("./zlib/gzheader"); 19446 var toString = Object.prototype.toString; 19447 function Inflate(options) { 19448 if (!(this instanceof Inflate)) 19449 return new Inflate(options); 19450 this.options = utils.assign( 19451 { 19452 chunkSize: 16384, 19453 windowBits: 0, 19454 to: "" 19455 }, 19456 options || {} 19457 ); 19458 var opt = this.options; 19459 if (opt.raw && opt.windowBits >= 0 && opt.windowBits < 16) { 19460 opt.windowBits = -opt.windowBits; 19461 if (opt.windowBits === 0) { 19462 opt.windowBits = -15; 19463 } 19464 } 19465 if (opt.windowBits >= 0 && opt.windowBits < 16 && !(options && options.windowBits)) { 19466 opt.windowBits += 32; 19467 } 19468 if (opt.windowBits > 15 && opt.windowBits < 48) { 19469 if ((opt.windowBits & 15) === 0) { 19470 opt.windowBits |= 15; 19471 } 19472 } 19473 this.err = 0; 19474 this.msg = ""; 19475 this.ended = false; 19476 this.chunks = []; 19477 this.strm = new ZStream(); 19478 this.strm.avail_out = 0; 19479 var status = zlib_inflate.inflateInit2( 19480 this.strm, 19481 opt.windowBits 19482 ); 19483 if (status !== c2.Z_OK) { 19484 throw new Error(msg[status]); 19485 } 19486 this.header = new GZheader(); 19487 zlib_inflate.inflateGetHeader(this.strm, this.header); 19488 if (opt.dictionary) { 19489 if (typeof opt.dictionary === "string") { 19490 opt.dictionary = strings.string2buf( 19491 opt.dictionary 19492 ); 19493 } else if (toString.call(opt.dictionary) === "[object ArrayBuffer]") { 19494 opt.dictionary = new Uint8Array( 19495 opt.dictionary 19496 ); 19497 } 19498 if (opt.raw) { 19499 status = zlib_inflate.inflateSetDictionary( 19500 this.strm, 19501 opt.dictionary 19502 ); 19503 if (status !== c2.Z_OK) { 19504 throw new Error(msg[status]); 19505 } 19506 } 19507 } 19508 } 19509 Inflate.prototype.push = function(data, mode) { 19510 var strm = this.strm; 19511 var chunkSize = this.options.chunkSize; 19512 var dictionary = this.options.dictionary; 19513 var status, _mode; 19514 var next_out_utf8, tail, utf8str; 19515 var allowBufError = false; 19516 if (this.ended) { 19517 return false; 19518 } 19519 _mode = mode === ~~mode ? mode : mode === true ? c2.Z_FINISH : c2.Z_NO_FLUSH; 19520 if (typeof data === "string") { 19521 strm.input = strings.binstring2buf(data); 19522 } else if (toString.call(data) === "[object ArrayBuffer]") { 19523 strm.input = new Uint8Array(data); 19524 } else { 19525 strm.input = data; 19526 } 19527 strm.next_in = 0; 19528 strm.avail_in = strm.input.length; 19529 do { 19530 if (strm.avail_out === 0) { 19531 strm.output = new utils.Buf8(chunkSize); 19532 strm.next_out = 0; 19533 strm.avail_out = chunkSize; 19534 } 19535 status = zlib_inflate.inflate( 19536 strm, 19537 c2.Z_NO_FLUSH 19538 ); 19539 if (status === c2.Z_NEED_DICT && dictionary) { 19540 status = zlib_inflate.inflateSetDictionary( 19541 this.strm, 19542 dictionary 19543 ); 19544 } 19545 if (status === c2.Z_BUF_ERROR && allowBufError === true) { 19546 status = c2.Z_OK; 19547 allowBufError = false; 19548 } 19549 if (status !== c2.Z_STREAM_END && status !== c2.Z_OK) { 19550 this.onEnd(status); 19551 this.ended = true; 19552 return false; 19553 } 19554 if (strm.next_out) { 19555 if (strm.avail_out === 0 || status === c2.Z_STREAM_END || strm.avail_in === 0 && (_mode === c2.Z_FINISH || _mode === c2.Z_SYNC_FLUSH)) { 19556 if (this.options.to === "string") { 19557 next_out_utf8 = strings.utf8border( 19558 strm.output, 19559 strm.next_out 19560 ); 19561 tail = strm.next_out - next_out_utf8; 19562 utf8str = strings.buf2string( 19563 strm.output, 19564 next_out_utf8 19565 ); 19566 strm.next_out = tail; 19567 strm.avail_out = chunkSize - tail; 19568 if (tail) { 19569 utils.arraySet( 19570 strm.output, 19571 strm.output, 19572 next_out_utf8, 19573 tail, 19574 0 19575 ); 19576 } 19577 this.onData(utf8str); 19578 } else { 19579 this.onData( 19580 utils.shrinkBuf( 19581 strm.output, 19582 strm.next_out 19583 ) 19584 ); 19585 } 19586 } 19587 } 19588 if (strm.avail_in === 0 && strm.avail_out === 0) { 19589 allowBufError = true; 19590 } 19591 } while ((strm.avail_in > 0 || strm.avail_out === 0) && status !== c2.Z_STREAM_END); 19592 if (status === c2.Z_STREAM_END) { 19593 _mode = c2.Z_FINISH; 19594 } 19595 if (_mode === c2.Z_FINISH) { 19596 status = zlib_inflate.inflateEnd(this.strm); 19597 this.onEnd(status); 19598 this.ended = true; 19599 return status === c2.Z_OK; 19600 } 19601 if (_mode === c2.Z_SYNC_FLUSH) { 19602 this.onEnd(c2.Z_OK); 19603 strm.avail_out = 0; 19604 return true; 19605 } 19606 return true; 19607 }; 19608 Inflate.prototype.onData = function(chunk) { 19609 this.chunks.push(chunk); 19610 }; 19611 Inflate.prototype.onEnd = function(status) { 19612 if (status === c2.Z_OK) { 19613 if (this.options.to === "string") { 19614 this.result = this.chunks.join(""); 19615 } else { 19616 this.result = utils.flattenChunks( 19617 this.chunks 19618 ); 19619 } 19620 } 19621 this.chunks = []; 19622 this.err = status; 19623 this.msg = this.strm.msg; 19624 }; 19625 function inflate(input, options) { 19626 var inflator = new Inflate(options); 19627 inflator.push(input, true); 19628 if (inflator.err) { 19629 throw inflator.msg || msg[inflator.err]; 19630 } 19631 return inflator.result; 19632 } 19633 function inflateRaw(input, options) { 19634 options = options || {}; 19635 options.raw = true; 19636 return inflate(input, options); 19637 } 19638 exports2.Inflate = Inflate; 19639 exports2.inflate = inflate; 19640 exports2.inflateRaw = inflateRaw; 19641 exports2.ungzip = inflate; 19642 }, 19643 { 19644 "./utils/common": 1, 19645 "./utils/strings": 2, 19646 "./zlib/constants": 4, 19647 "./zlib/gzheader": 6, 19648 "./zlib/inflate": 8, 19649 "./zlib/messages": 10, 19650 "./zlib/zstream": 11 19651 } 19652 ] 19653 }, 19654 {}, 19655 [] 19656 )("/lib/inflate.js"); 19657 })(); 19658 19659 // packages/global-styles-ui/build-module/font-library/lib/lib-font.browser.mjs 19660 var fetchFunction = globalThis.fetch; 19661 var Event2 = class { 19662 constructor(type, detail = {}, msg) { 19663 this.type = type; 19664 this.detail = detail; 19665 this.msg = msg; 19666 Object.defineProperty(this, `__mayPropagate`, { 19667 enumerable: false, 19668 writable: true 19669 }); 19670 this.__mayPropagate = true; 19671 } 19672 preventDefault() { 19673 } 19674 stopPropagation() { 19675 this.__mayPropagate = false; 19676 } 19677 valueOf() { 19678 return this; 19679 } 19680 toString() { 19681 return this.msg ? `[$this.type} event]: $this.msg}` : `[$this.type} event]`; 19682 } 19683 }; 19684 var EventManager = class { 19685 constructor() { 19686 this.listeners = {}; 19687 } 19688 addEventListener(type, listener, useCapture) { 19689 let bin = this.listeners[type] || []; 19690 if (useCapture) bin.unshift(listener); 19691 else bin.push(listener); 19692 this.listeners[type] = bin; 19693 } 19694 removeEventListener(type, listener) { 19695 let bin = this.listeners[type] || []; 19696 let pos = bin.findIndex((e2) => e2 === listener); 19697 if (pos > -1) { 19698 bin.splice(pos, 1); 19699 this.listeners[type] = bin; 19700 } 19701 } 19702 dispatch(event) { 19703 let bin = this.listeners[event.type]; 19704 if (bin) { 19705 for (let l2 = 0, e2 = bin.length; l2 < e2; l2++) { 19706 if (!event.__mayPropagate) break; 19707 bin[l2](event); 19708 } 19709 } 19710 } 19711 }; 19712 var startDate = (/* @__PURE__ */ new Date(`1904-01-01T00:00:00+0000`)).getTime(); 19713 function asText(data) { 19714 return Array.from(data).map((v2) => String.fromCharCode(v2)).join(``); 19715 } 19716 var Parser = class { 19717 constructor(dict, dataview, name2) { 19718 this.name = (name2 || dict.tag || ``).trim(); 19719 this.length = dict.length; 19720 this.start = dict.offset; 19721 this.offset = 0; 19722 this.data = dataview; 19723 [ 19724 `getInt8`, 19725 `getUint8`, 19726 `getInt16`, 19727 `getUint16`, 19728 `getInt32`, 19729 `getUint32`, 19730 `getBigInt64`, 19731 `getBigUint64` 19732 ].forEach((name3) => { 19733 let fn = name3.replace(/get(Big)?/, "").toLowerCase(); 19734 let increment = parseInt(name3.replace(/[^\d]/g, "")) / 8; 19735 Object.defineProperty(this, fn, { 19736 get: () => this.getValue(name3, increment) 19737 }); 19738 }); 19739 } 19740 get currentPosition() { 19741 return this.start + this.offset; 19742 } 19743 set currentPosition(position) { 19744 this.start = position; 19745 this.offset = 0; 19746 } 19747 skip(n2 = 0, bits = 8) { 19748 this.offset += n2 * bits / 8; 19749 } 19750 getValue(type, increment) { 19751 let pos = this.start + this.offset; 19752 this.offset += increment; 19753 try { 19754 return this.data[type](pos); 19755 } catch (e2) { 19756 console.error(`parser`, type, increment, this); 19757 console.error(`parser`, this.start, this.offset); 19758 throw e2; 19759 } 19760 } 19761 flags(n2) { 19762 if (n2 === 8 || n2 === 16 || n2 === 32 || n2 === 64) { 19763 return this[`uint$n2}`].toString(2).padStart(n2, 0).split(``).map((v2) => v2 === "1"); 19764 } 19765 console.error( 19766 `Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long` 19767 ); 19768 console.trace(); 19769 } 19770 get tag() { 19771 const t3 = this.uint32; 19772 return asText([ 19773 t3 >> 24 & 255, 19774 t3 >> 16 & 255, 19775 t3 >> 8 & 255, 19776 t3 & 255 19777 ]); 19778 } 19779 get fixed() { 19780 let major = this.int16; 19781 let minor = Math.round(1e3 * this.uint16 / 65356); 19782 return major + minor / 1e3; 19783 } 19784 get legacyFixed() { 19785 let major = this.uint16; 19786 let minor = this.uint16.toString(16).padStart(4, 0); 19787 return parseFloat(`$major}.$minor}`); 19788 } 19789 get uint24() { 19790 return (this.uint8 << 16) + (this.uint8 << 8) + this.uint8; 19791 } 19792 get uint128() { 19793 let value = 0; 19794 for (let i2 = 0; i2 < 5; i2++) { 19795 let byte = this.uint8; 19796 value = value * 128 + (byte & 127); 19797 if (byte < 128) break; 19798 } 19799 return value; 19800 } 19801 get longdatetime() { 19802 return new Date(startDate + 1e3 * parseInt(this.int64.toString())); 19803 } 19804 get fword() { 19805 return this.int16; 19806 } 19807 get ufword() { 19808 return this.uint16; 19809 } 19810 get Offset16() { 19811 return this.uint16; 19812 } 19813 get Offset32() { 19814 return this.uint32; 19815 } 19816 get F2DOT14() { 19817 const bits = p.uint16; 19818 const integer = [0, 1, -2, -1][bits >> 14]; 19819 const fraction = bits & 16383; 19820 return integer + fraction / 16384; 19821 } 19822 verifyLength() { 19823 if (this.offset != this.length) { 19824 console.error( 19825 `unexpected parsed table size ($this.offset}) for "$this.name}" (expected $this.length})` 19826 ); 19827 } 19828 } 19829 readBytes(n2 = 0, position = 0, bits = 8, signed = false) { 19830 n2 = n2 || this.length; 19831 if (n2 === 0) return []; 19832 if (position) this.currentPosition = position; 19833 const fn = `$signed ? `` : `u`}int$bits}`, slice = []; 19834 while (n2--) slice.push(this[fn]); 19835 return slice; 19836 } 19837 }; 19838 var ParsedData = class { 19839 constructor(parser) { 19840 const pGetter = { enumerable: false, get: () => parser }; 19841 Object.defineProperty(this, `parser`, pGetter); 19842 const start = parser.currentPosition; 19843 const startGetter = { enumerable: false, get: () => start }; 19844 Object.defineProperty(this, `start`, startGetter); 19845 } 19846 load(struct) { 19847 Object.keys(struct).forEach((p22) => { 19848 let props = Object.getOwnPropertyDescriptor(struct, p22); 19849 if (props.get) { 19850 this[p22] = props.get.bind(this); 19851 } else if (props.value !== void 0) { 19852 this[p22] = props.value; 19853 } 19854 }); 19855 if (this.parser.length) { 19856 this.parser.verifyLength(); 19857 } 19858 } 19859 }; 19860 var SimpleTable = class extends ParsedData { 19861 constructor(dict, dataview, name2) { 19862 const { parser, start } = super( 19863 new Parser(dict, dataview, name2) 19864 ); 19865 const pGetter = { enumerable: false, get: () => parser }; 19866 Object.defineProperty(this, `p`, pGetter); 19867 const startGetter = { enumerable: false, get: () => start }; 19868 Object.defineProperty(this, `tableStart`, startGetter); 19869 } 19870 }; 19871 function lazy$1(object, property, getter) { 19872 let val; 19873 Object.defineProperty(object, property, { 19874 get: () => { 19875 if (val) return val; 19876 val = getter(); 19877 return val; 19878 }, 19879 enumerable: true 19880 }); 19881 } 19882 var SFNT = class extends SimpleTable { 19883 constructor(font2, dataview, createTable2) { 19884 const { p: p22 } = super({ offset: 0, length: 12 }, dataview, `sfnt`); 19885 this.version = p22.uint32; 19886 this.numTables = p22.uint16; 19887 this.searchRange = p22.uint16; 19888 this.entrySelector = p22.uint16; 19889 this.rangeShift = p22.uint16; 19890 p22.verifyLength(); 19891 this.directory = [...new Array(this.numTables)].map( 19892 (_) => new TableRecord(p22) 19893 ); 19894 this.tables = {}; 19895 this.directory.forEach((entry) => { 19896 const getter = () => createTable2( 19897 this.tables, 19898 { 19899 tag: entry.tag, 19900 offset: entry.offset, 19901 length: entry.length 19902 }, 19903 dataview 19904 ); 19905 lazy$1(this.tables, entry.tag.trim(), getter); 19906 }); 19907 } 19908 }; 19909 var TableRecord = class { 19910 constructor(p22) { 19911 this.tag = p22.tag; 19912 this.checksum = p22.uint32; 19913 this.offset = p22.uint32; 19914 this.length = p22.uint32; 19915 } 19916 }; 19917 var gzipDecode = inflate_default.inflate || void 0; 19918 var nativeGzipDecode = void 0; 19919 var WOFF$1 = class extends SimpleTable { 19920 constructor(font2, dataview, createTable2) { 19921 const { p: p22 } = super({ offset: 0, length: 44 }, dataview, `woff`); 19922 this.signature = p22.tag; 19923 this.flavor = p22.uint32; 19924 this.length = p22.uint32; 19925 this.numTables = p22.uint16; 19926 p22.uint16; 19927 this.totalSfntSize = p22.uint32; 19928 this.majorVersion = p22.uint16; 19929 this.minorVersion = p22.uint16; 19930 this.metaOffset = p22.uint32; 19931 this.metaLength = p22.uint32; 19932 this.metaOrigLength = p22.uint32; 19933 this.privOffset = p22.uint32; 19934 this.privLength = p22.uint32; 19935 p22.verifyLength(); 19936 this.directory = [...new Array(this.numTables)].map( 19937 (_) => new WoffTableDirectoryEntry(p22) 19938 ); 19939 buildWoffLazyLookups(this, dataview, createTable2); 19940 } 19941 }; 19942 var WoffTableDirectoryEntry = class { 19943 constructor(p22) { 19944 this.tag = p22.tag; 19945 this.offset = p22.uint32; 19946 this.compLength = p22.uint32; 19947 this.origLength = p22.uint32; 19948 this.origChecksum = p22.uint32; 19949 } 19950 }; 19951 function buildWoffLazyLookups(woff, dataview, createTable2) { 19952 woff.tables = {}; 19953 woff.directory.forEach((entry) => { 19954 lazy$1(woff.tables, entry.tag.trim(), () => { 19955 let offset4 = 0; 19956 let view = dataview; 19957 if (entry.compLength !== entry.origLength) { 19958 const data = dataview.buffer.slice( 19959 entry.offset, 19960 entry.offset + entry.compLength 19961 ); 19962 let unpacked; 19963 if (gzipDecode) { 19964 unpacked = gzipDecode(new Uint8Array(data)); 19965 } else if (nativeGzipDecode) { 19966 unpacked = nativeGzipDecode(new Uint8Array(data)); 19967 } else { 19968 const msg = `no brotli decoder available to decode WOFF2 font`; 19969 if (font.onerror) font.onerror(msg); 19970 throw new Error(msg); 19971 } 19972 view = new DataView(unpacked.buffer); 19973 } else { 19974 offset4 = entry.offset; 19975 } 19976 return createTable2( 19977 woff.tables, 19978 { tag: entry.tag, offset: offset4, length: entry.origLength }, 19979 view 19980 ); 19981 }); 19982 }); 19983 } 19984 var brotliDecode = unbrotli_default; 19985 var nativeBrotliDecode = void 0; 19986 var WOFF2$1 = class extends SimpleTable { 19987 constructor(font2, dataview, createTable2) { 19988 const { p: p22 } = super({ offset: 0, length: 48 }, dataview, `woff2`); 19989 this.signature = p22.tag; 19990 this.flavor = p22.uint32; 19991 this.length = p22.uint32; 19992 this.numTables = p22.uint16; 19993 p22.uint16; 19994 this.totalSfntSize = p22.uint32; 19995 this.totalCompressedSize = p22.uint32; 19996 this.majorVersion = p22.uint16; 19997 this.minorVersion = p22.uint16; 19998 this.metaOffset = p22.uint32; 19999 this.metaLength = p22.uint32; 20000 this.metaOrigLength = p22.uint32; 20001 this.privOffset = p22.uint32; 20002 this.privLength = p22.uint32; 20003 p22.verifyLength(); 20004 this.directory = [...new Array(this.numTables)].map( 20005 (_) => new Woff2TableDirectoryEntry(p22) 20006 ); 20007 let dictOffset = p22.currentPosition; 20008 this.directory[0].offset = 0; 20009 this.directory.forEach((e2, i2) => { 20010 let next = this.directory[i2 + 1]; 20011 if (next) { 20012 next.offset = e2.offset + (e2.transformLength !== void 0 ? e2.transformLength : e2.origLength); 20013 } 20014 }); 20015 let decoded; 20016 let buffer = dataview.buffer.slice(dictOffset); 20017 if (brotliDecode) { 20018 decoded = brotliDecode(new Uint8Array(buffer)); 20019 } else if (nativeBrotliDecode) { 20020 decoded = new Uint8Array(nativeBrotliDecode(buffer)); 20021 } else { 20022 const msg = `no brotli decoder available to decode WOFF2 font`; 20023 if (font2.onerror) font2.onerror(msg); 20024 throw new Error(msg); 20025 } 20026 buildWoff2LazyLookups(this, decoded, createTable2); 20027 } 20028 }; 20029 var Woff2TableDirectoryEntry = class { 20030 constructor(p22) { 20031 this.flags = p22.uint8; 20032 const tagNumber = this.tagNumber = this.flags & 63; 20033 if (tagNumber === 63) { 20034 this.tag = p22.tag; 20035 } else { 20036 this.tag = getWOFF2Tag(tagNumber); 20037 } 20038 const transformVersion = this.transformVersion = (this.flags & 192) >> 6; 20039 let hasTransforms = transformVersion !== 0; 20040 if (this.tag === `glyf` || this.tag === `loca`) { 20041 hasTransforms = this.transformVersion !== 3; 20042 } 20043 this.origLength = p22.uint128; 20044 if (hasTransforms) { 20045 this.transformLength = p22.uint128; 20046 } 20047 } 20048 }; 20049 function buildWoff2LazyLookups(woff2, decoded, createTable2) { 20050 woff2.tables = {}; 20051 woff2.directory.forEach((entry) => { 20052 lazy$1(woff2.tables, entry.tag.trim(), () => { 20053 const start = entry.offset; 20054 const end = start + (entry.transformLength ? entry.transformLength : entry.origLength); 20055 const data = new DataView(decoded.slice(start, end).buffer); 20056 try { 20057 return createTable2( 20058 woff2.tables, 20059 { tag: entry.tag, offset: 0, length: entry.origLength }, 20060 data 20061 ); 20062 } catch (e2) { 20063 console.error(e2); 20064 } 20065 }); 20066 }); 20067 } 20068 function getWOFF2Tag(flag) { 20069 return [ 20070 `cmap`, 20071 `head`, 20072 `hhea`, 20073 `hmtx`, 20074 `maxp`, 20075 `name`, 20076 `OS/2`, 20077 `post`, 20078 `cvt `, 20079 `fpgm`, 20080 `glyf`, 20081 `loca`, 20082 `prep`, 20083 `CFF `, 20084 `VORG`, 20085 `EBDT`, 20086 `EBLC`, 20087 `gasp`, 20088 `hdmx`, 20089 `kern`, 20090 `LTSH`, 20091 `PCLT`, 20092 `VDMX`, 20093 `vhea`, 20094 `vmtx`, 20095 `BASE`, 20096 `GDEF`, 20097 `GPOS`, 20098 `GSUB`, 20099 `EBSC`, 20100 `JSTF`, 20101 `MATH`, 20102 `CBDT`, 20103 `CBLC`, 20104 `COLR`, 20105 `CPAL`, 20106 `SVG `, 20107 `sbix`, 20108 `acnt`, 20109 `avar`, 20110 `bdat`, 20111 `bloc`, 20112 `bsln`, 20113 `cvar`, 20114 `fdsc`, 20115 `feat`, 20116 `fmtx`, 20117 `fvar`, 20118 `gvar`, 20119 `hsty`, 20120 `just`, 20121 `lcar`, 20122 `mort`, 20123 `morx`, 20124 `opbd`, 20125 `prop`, 20126 `trak`, 20127 `Zapf`, 20128 `Silf`, 20129 `Glat`, 20130 `Gloc`, 20131 `Feat`, 20132 `Sill` 20133 ][flag & 63]; 20134 } 20135 var tableClasses = {}; 20136 var tableClassesLoaded = false; 20137 Promise.all([ 20138 Promise.resolve().then(function() { 20139 return cmap$1; 20140 }), 20141 Promise.resolve().then(function() { 20142 return head$1; 20143 }), 20144 Promise.resolve().then(function() { 20145 return hhea$1; 20146 }), 20147 Promise.resolve().then(function() { 20148 return hmtx$1; 20149 }), 20150 Promise.resolve().then(function() { 20151 return maxp$1; 20152 }), 20153 Promise.resolve().then(function() { 20154 return name$1; 20155 }), 20156 Promise.resolve().then(function() { 20157 return OS2$1; 20158 }), 20159 Promise.resolve().then(function() { 20160 return post$1; 20161 }), 20162 Promise.resolve().then(function() { 20163 return BASE$1; 20164 }), 20165 Promise.resolve().then(function() { 20166 return GDEF$1; 20167 }), 20168 Promise.resolve().then(function() { 20169 return GSUB$1; 20170 }), 20171 Promise.resolve().then(function() { 20172 return GPOS$1; 20173 }), 20174 Promise.resolve().then(function() { 20175 return SVG$1; 20176 }), 20177 Promise.resolve().then(function() { 20178 return fvar$1; 20179 }), 20180 Promise.resolve().then(function() { 20181 return cvt$1; 20182 }), 20183 Promise.resolve().then(function() { 20184 return fpgm$1; 20185 }), 20186 Promise.resolve().then(function() { 20187 return gasp$1; 20188 }), 20189 Promise.resolve().then(function() { 20190 return glyf$1; 20191 }), 20192 Promise.resolve().then(function() { 20193 return loca$1; 20194 }), 20195 Promise.resolve().then(function() { 20196 return prep$1; 20197 }), 20198 Promise.resolve().then(function() { 20199 return CFF$1; 20200 }), 20201 Promise.resolve().then(function() { 20202 return CFF2$1; 20203 }), 20204 Promise.resolve().then(function() { 20205 return VORG$1; 20206 }), 20207 Promise.resolve().then(function() { 20208 return EBLC$1; 20209 }), 20210 Promise.resolve().then(function() { 20211 return EBDT$1; 20212 }), 20213 Promise.resolve().then(function() { 20214 return EBSC$1; 20215 }), 20216 Promise.resolve().then(function() { 20217 return CBLC$1; 20218 }), 20219 Promise.resolve().then(function() { 20220 return CBDT$1; 20221 }), 20222 Promise.resolve().then(function() { 20223 return sbix$1; 20224 }), 20225 Promise.resolve().then(function() { 20226 return COLR$1; 20227 }), 20228 Promise.resolve().then(function() { 20229 return CPAL$1; 20230 }), 20231 Promise.resolve().then(function() { 20232 return DSIG$1; 20233 }), 20234 Promise.resolve().then(function() { 20235 return hdmx$1; 20236 }), 20237 Promise.resolve().then(function() { 20238 return kern$1; 20239 }), 20240 Promise.resolve().then(function() { 20241 return LTSH$1; 20242 }), 20243 Promise.resolve().then(function() { 20244 return MERG$1; 20245 }), 20246 Promise.resolve().then(function() { 20247 return meta$1; 20248 }), 20249 Promise.resolve().then(function() { 20250 return PCLT$1; 20251 }), 20252 Promise.resolve().then(function() { 20253 return VDMX$1; 20254 }), 20255 Promise.resolve().then(function() { 20256 return vhea$1; 20257 }), 20258 Promise.resolve().then(function() { 20259 return vmtx$1; 20260 }) 20261 ]).then((data) => { 20262 data.forEach((e2) => { 20263 let name2 = Object.keys(e2)[0]; 20264 tableClasses[name2] = e2[name2]; 20265 }); 20266 tableClassesLoaded = true; 20267 }); 20268 function createTable(tables, dict, dataview) { 20269 let name2 = dict.tag.replace(/[^\w\d]/g, ``); 20270 let Type = tableClasses[name2]; 20271 if (Type) return new Type(dict, dataview, tables); 20272 console.warn( 20273 `lib-font has no definition for $name2}. The table was skipped.` 20274 ); 20275 return {}; 20276 } 20277 function loadTableClasses() { 20278 let count = 0; 20279 function checkLoaded(resolve, reject) { 20280 if (!tableClassesLoaded) { 20281 if (count > 10) { 20282 return reject(new Error(`loading took too long`)); 20283 } 20284 count++; 20285 return setTimeout(() => checkLoaded(resolve), 250); 20286 } 20287 resolve(createTable); 20288 } 20289 return new Promise((resolve, reject) => checkLoaded(resolve)); 20290 } 20291 function getFontCSSFormat(path, errorOnStyle) { 20292 let pos = path.lastIndexOf(`.`); 20293 let ext = (path.substring(pos + 1) || ``).toLowerCase(); 20294 let format = { 20295 ttf: `truetype`, 20296 otf: `opentype`, 20297 woff: `woff`, 20298 woff2: `woff2` 20299 }[ext]; 20300 if (format) return format; 20301 let msg = { 20302 eot: `The .eot format is not supported: it died in January 12, 2016, when Microsoft retired all versions of IE that didn't already support WOFF.`, 20303 svg: `The .svg format is not supported: SVG fonts (not to be confused with OpenType with embedded SVG) were so bad we took the entire fonts chapter out of the SVG specification again.`, 20304 fon: `The .fon format is not supported: this is an ancient Windows bitmap font format.`, 20305 ttc: `Based on the current CSS specification, font collections are not (yet?) supported.` 20306 }[ext]; 20307 if (!msg) msg = `$path} is not a known webfont format.`; 20308 if (errorOnStyle) { 20309 throw new Error(msg); 20310 } else { 20311 console.warn(`Could not load font: $msg}`); 20312 } 20313 } 20314 async function setupFontFace(name2, url, options = {}) { 20315 if (!globalThis.document) return; 20316 let format = getFontCSSFormat(url, options.errorOnStyle); 20317 if (!format) return; 20318 let style = document.createElement(`style`); 20319 style.className = `injected-by-Font-js`; 20320 let rules = []; 20321 if (options.styleRules) { 20322 rules = Object.entries(options.styleRules).map( 20323 ([key, value]) => `$key}: $value};` 20324 ); 20325 } 20326 style.textContent = ` 20327 @font-face { 20328 font-family: "$name2}"; 20329 $rules.join( 20330 ` 20331 ` 20332 )} 20333 src: url("$url}") format("$format}"); 20334 }`; 20335 globalThis.document.head.appendChild(style); 20336 return style; 20337 } 20338 var TTF = [0, 1, 0, 0]; 20339 var OTF = [79, 84, 84, 79]; 20340 var WOFF = [119, 79, 70, 70]; 20341 var WOFF2 = [119, 79, 70, 50]; 20342 function match(ar1, ar2) { 20343 if (ar1.length !== ar2.length) return; 20344 for (let i2 = 0; i2 < ar1.length; i2++) { 20345 if (ar1[i2] !== ar2[i2]) return; 20346 } 20347 return true; 20348 } 20349 function validFontFormat(dataview) { 20350 const LEAD_BYTES = [ 20351 dataview.getUint8(0), 20352 dataview.getUint8(1), 20353 dataview.getUint8(2), 20354 dataview.getUint8(3) 20355 ]; 20356 if (match(LEAD_BYTES, TTF) || match(LEAD_BYTES, OTF)) return `SFNT`; 20357 if (match(LEAD_BYTES, WOFF)) return `WOFF`; 20358 if (match(LEAD_BYTES, WOFF2)) return `WOFF2`; 20359 } 20360 function checkFetchResponseStatus(response) { 20361 if (!response.ok) { 20362 throw new Error( 20363 `HTTP $response.status} - $response.statusText}` 20364 ); 20365 } 20366 return response; 20367 } 20368 var Font = class extends EventManager { 20369 constructor(name2, options = {}) { 20370 super(); 20371 this.name = name2; 20372 this.options = options; 20373 this.metrics = false; 20374 } 20375 get src() { 20376 return this.__src; 20377 } 20378 set src(src) { 20379 this.__src = src; 20380 (async () => { 20381 if (globalThis.document && !this.options.skipStyleSheet) { 20382 await setupFontFace(this.name, src, this.options); 20383 } 20384 this.loadFont(src); 20385 })(); 20386 } 20387 async loadFont(url, filename) { 20388 fetch(url).then( 20389 (response) => checkFetchResponseStatus(response) && response.arrayBuffer() 20390 ).then( 20391 (buffer) => this.fromDataBuffer(buffer, filename || url) 20392 ).catch((err) => { 20393 const evt = new Event2( 20394 `error`, 20395 err, 20396 `Failed to load font at $filename || url}` 20397 ); 20398 this.dispatch(evt); 20399 if (this.onerror) this.onerror(evt); 20400 }); 20401 } 20402 async fromDataBuffer(buffer, filenameOrUrL) { 20403 this.fontData = new DataView(buffer); 20404 let type = validFontFormat(this.fontData); 20405 if (!type) { 20406 throw new Error( 20407 `$filenameOrUrL} is either an unsupported font format, or not a font at all.` 20408 ); 20409 } 20410 await this.parseBasicData(type); 20411 const evt = new Event2("load", { font: this }); 20412 this.dispatch(evt); 20413 if (this.onload) this.onload(evt); 20414 } 20415 async parseBasicData(type) { 20416 return loadTableClasses().then((createTable2) => { 20417 if (type === `SFNT`) { 20418 this.opentype = new SFNT(this, this.fontData, createTable2); 20419 } 20420 if (type === `WOFF`) { 20421 this.opentype = new WOFF$1(this, this.fontData, createTable2); 20422 } 20423 if (type === `WOFF2`) { 20424 this.opentype = new WOFF2$1(this, this.fontData, createTable2); 20425 } 20426 return this.opentype; 20427 }); 20428 } 20429 getGlyphId(char) { 20430 return this.opentype.tables.cmap.getGlyphId(char); 20431 } 20432 reverse(glyphid) { 20433 return this.opentype.tables.cmap.reverse(glyphid); 20434 } 20435 supports(char) { 20436 return this.getGlyphId(char) !== 0; 20437 } 20438 supportsVariation(variation) { 20439 return this.opentype.tables.cmap.supportsVariation(variation) !== false; 20440 } 20441 measureText(text, size4 = 16) { 20442 if (this.__unloaded) 20443 throw new Error( 20444 "Cannot measure text: font was unloaded. Please reload before calling measureText()" 20445 ); 20446 let d2 = document.createElement("div"); 20447 d2.textContent = text; 20448 d2.style.fontFamily = this.name; 20449 d2.style.fontSize = `$size4}px`; 20450 d2.style.color = `transparent`; 20451 d2.style.background = `transparent`; 20452 d2.style.top = `0`; 20453 d2.style.left = `0`; 20454 d2.style.position = `absolute`; 20455 document.body.appendChild(d2); 20456 let bbox = d2.getBoundingClientRect(); 20457 document.body.removeChild(d2); 20458 const OS22 = this.opentype.tables["OS/2"]; 20459 bbox.fontSize = size4; 20460 bbox.ascender = OS22.sTypoAscender; 20461 bbox.descender = OS22.sTypoDescender; 20462 return bbox; 20463 } 20464 unload() { 20465 if (this.styleElement.parentNode) { 20466 this.styleElement.parentNode.removeElement(this.styleElement); 20467 const evt = new Event2("unload", { font: this }); 20468 this.dispatch(evt); 20469 if (this.onunload) this.onunload(evt); 20470 } 20471 this._unloaded = true; 20472 } 20473 load() { 20474 if (this.__unloaded) { 20475 delete this.__unloaded; 20476 document.head.appendChild(this.styleElement); 20477 const evt = new Event2("load", { font: this }); 20478 this.dispatch(evt); 20479 if (this.onload) this.onload(evt); 20480 } 20481 } 20482 }; 20483 globalThis.Font = Font; 20484 var Subtable = class extends ParsedData { 20485 constructor(p22, plaformID, encodingID) { 20486 super(p22); 20487 this.plaformID = plaformID; 20488 this.encodingID = encodingID; 20489 } 20490 }; 20491 var Format0 = class extends Subtable { 20492 constructor(p22, platformID, encodingID) { 20493 super(p22, platformID, encodingID); 20494 this.format = 0; 20495 this.length = p22.uint16; 20496 this.language = p22.uint16; 20497 this.glyphIdArray = [...new Array(256)].map((_) => p22.uint8); 20498 } 20499 supports(charCode) { 20500 if (charCode.charCodeAt) { 20501 charCode = -1; 20502 console.warn( 20503 `supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.` 20504 ); 20505 } 20506 return 0 <= charCode && charCode <= 255; 20507 } 20508 reverse(glyphID) { 20509 console.warn(`reverse not implemented for cmap subtable format 0`); 20510 return {}; 20511 } 20512 getSupportedCharCodes() { 20513 return [{ start: 1, end: 256 }]; 20514 } 20515 }; 20516 var Format2 = class extends Subtable { 20517 constructor(p22, platformID, encodingID) { 20518 super(p22, platformID, encodingID); 20519 this.format = 2; 20520 this.length = p22.uint16; 20521 this.language = p22.uint16; 20522 this.subHeaderKeys = [...new Array(256)].map((_) => p22.uint16); 20523 const subHeaderCount = Math.max(...this.subHeaderKeys); 20524 const subHeaderOffset = p22.currentPosition; 20525 lazy$1(this, `subHeaders`, () => { 20526 p22.currentPosition = subHeaderOffset; 20527 return [...new Array(subHeaderCount)].map( 20528 (_) => new SubHeader(p22) 20529 ); 20530 }); 20531 const glyphIndexOffset = subHeaderOffset + subHeaderCount * 8; 20532 lazy$1(this, `glyphIndexArray`, () => { 20533 p22.currentPosition = glyphIndexOffset; 20534 return [...new Array(subHeaderCount)].map((_) => p22.uint16); 20535 }); 20536 } 20537 supports(charCode) { 20538 if (charCode.charCodeAt) { 20539 charCode = -1; 20540 console.warn( 20541 `supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented.` 20542 ); 20543 } 20544 const low = charCode && 255; 20545 const high = charCode && 65280; 20546 const subHeaderKey = this.subHeaders[high]; 20547 const subheader = this.subHeaders[subHeaderKey]; 20548 const first = subheader.firstCode; 20549 const last = first + subheader.entryCount; 20550 return first <= low && low <= last; 20551 } 20552 reverse(glyphID) { 20553 console.warn(`reverse not implemented for cmap subtable format 2`); 20554 return {}; 20555 } 20556 getSupportedCharCodes(preservePropNames = false) { 20557 if (preservePropNames) { 20558 return this.subHeaders.map((h2) => ({ 20559 firstCode: h2.firstCode, 20560 lastCode: h2.lastCode 20561 })); 20562 } 20563 return this.subHeaders.map((h2) => ({ 20564 start: h2.firstCode, 20565 end: h2.lastCode 20566 })); 20567 } 20568 }; 20569 var SubHeader = class { 20570 constructor(p22) { 20571 this.firstCode = p22.uint16; 20572 this.entryCount = p22.uint16; 20573 this.lastCode = this.first + this.entryCount; 20574 this.idDelta = p22.int16; 20575 this.idRangeOffset = p22.uint16; 20576 } 20577 }; 20578 var Format4 = class extends Subtable { 20579 constructor(p22, platformID, encodingID) { 20580 super(p22, platformID, encodingID); 20581 this.format = 4; 20582 this.length = p22.uint16; 20583 this.language = p22.uint16; 20584 this.segCountX2 = p22.uint16; 20585 this.segCount = this.segCountX2 / 2; 20586 this.searchRange = p22.uint16; 20587 this.entrySelector = p22.uint16; 20588 this.rangeShift = p22.uint16; 20589 const endCodePosition = p22.currentPosition; 20590 lazy$1( 20591 this, 20592 `endCode`, 20593 () => p22.readBytes(this.segCount, endCodePosition, 16) 20594 ); 20595 const startCodePosition = endCodePosition + 2 + this.segCountX2; 20596 lazy$1( 20597 this, 20598 `startCode`, 20599 () => p22.readBytes(this.segCount, startCodePosition, 16) 20600 ); 20601 const idDeltaPosition = startCodePosition + this.segCountX2; 20602 lazy$1( 20603 this, 20604 `idDelta`, 20605 () => p22.readBytes(this.segCount, idDeltaPosition, 16, true) 20606 ); 20607 const idRangePosition = idDeltaPosition + this.segCountX2; 20608 lazy$1( 20609 this, 20610 `idRangeOffset`, 20611 () => p22.readBytes(this.segCount, idRangePosition, 16) 20612 ); 20613 const glyphIdArrayPosition = idRangePosition + this.segCountX2; 20614 const glyphIdArrayLength = this.length - (glyphIdArrayPosition - this.tableStart); 20615 lazy$1( 20616 this, 20617 `glyphIdArray`, 20618 () => p22.readBytes(glyphIdArrayLength, glyphIdArrayPosition, 16) 20619 ); 20620 lazy$1( 20621 this, 20622 `segments`, 20623 () => this.buildSegments(idRangePosition, glyphIdArrayPosition, p22) 20624 ); 20625 } 20626 buildSegments(idRangePosition, glyphIdArrayPosition, p22) { 20627 const build = (_, i2) => { 20628 let startCode = this.startCode[i2], endCode = this.endCode[i2], idDelta = this.idDelta[i2], idRangeOffset = this.idRangeOffset[i2], idRangeOffsetPointer = idRangePosition + 2 * i2, glyphIDs = []; 20629 if (idRangeOffset === 0) { 20630 for (let i22 = startCode + idDelta, e2 = endCode + idDelta; i22 <= e2; i22++) { 20631 glyphIDs.push(i22); 20632 } 20633 } else { 20634 for (let i22 = 0, e2 = endCode - startCode; i22 <= e2; i22++) { 20635 p22.currentPosition = idRangeOffsetPointer + idRangeOffset + i22 * 2; 20636 glyphIDs.push(p22.uint16); 20637 } 20638 } 20639 return { 20640 startCode, 20641 endCode, 20642 idDelta, 20643 idRangeOffset, 20644 glyphIDs 20645 }; 20646 }; 20647 return [...new Array(this.segCount)].map(build); 20648 } 20649 reverse(glyphID) { 20650 let s2 = this.segments.find((v2) => v2.glyphIDs.includes(glyphID)); 20651 if (!s2) return {}; 20652 const code = s2.startCode + s2.glyphIDs.indexOf(glyphID); 20653 return { code, unicode: String.fromCodePoint(code) }; 20654 } 20655 getGlyphId(charCode) { 20656 if (charCode.charCodeAt) charCode = charCode.charCodeAt(0); 20657 if (55296 <= charCode && charCode <= 57343) return 0; 20658 if ((charCode & 65534) === 65534 || (charCode & 65535) === 65535) 20659 return 0; 20660 let segment = this.segments.find( 20661 (s2) => s2.startCode <= charCode && charCode <= s2.endCode 20662 ); 20663 if (!segment) return 0; 20664 return segment.glyphIDs[charCode - segment.startCode]; 20665 } 20666 supports(charCode) { 20667 return this.getGlyphId(charCode) !== 0; 20668 } 20669 getSupportedCharCodes(preservePropNames = false) { 20670 if (preservePropNames) return this.segments; 20671 return this.segments.map((v2) => ({ 20672 start: v2.startCode, 20673 end: v2.endCode 20674 })); 20675 } 20676 }; 20677 var Format6 = class extends Subtable { 20678 constructor(p22, platformID, encodingID) { 20679 super(p22, platformID, encodingID); 20680 this.format = 6; 20681 this.length = p22.uint16; 20682 this.language = p22.uint16; 20683 this.firstCode = p22.uint16; 20684 this.entryCount = p22.uint16; 20685 this.lastCode = this.firstCode + this.entryCount - 1; 20686 const getter = () => [...new Array(this.entryCount)].map((_) => p22.uint16); 20687 lazy$1(this, `glyphIdArray`, getter); 20688 } 20689 supports(charCode) { 20690 if (charCode.charCodeAt) { 20691 charCode = -1; 20692 console.warn( 20693 `supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.` 20694 ); 20695 } 20696 if (charCode < this.firstCode) return {}; 20697 if (charCode > this.firstCode + this.entryCount) return {}; 20698 const code = charCode - this.firstCode; 20699 return { code, unicode: String.fromCodePoint(code) }; 20700 } 20701 reverse(glyphID) { 20702 let pos = this.glyphIdArray.indexOf(glyphID); 20703 if (pos > -1) return this.firstCode + pos; 20704 } 20705 getSupportedCharCodes(preservePropNames = false) { 20706 if (preservePropNames) { 20707 return [{ firstCode: this.firstCode, lastCode: this.lastCode }]; 20708 } 20709 return [{ start: this.firstCode, end: this.lastCode }]; 20710 } 20711 }; 20712 var Format8 = class extends Subtable { 20713 constructor(p22, platformID, encodingID) { 20714 super(p22, platformID, encodingID); 20715 this.format = 8; 20716 p22.uint16; 20717 this.length = p22.uint32; 20718 this.language = p22.uint32; 20719 this.is32 = [...new Array(8192)].map((_) => p22.uint8); 20720 this.numGroups = p22.uint32; 20721 const getter = () => [...new Array(this.numGroups)].map( 20722 (_) => new SequentialMapGroup$1(p22) 20723 ); 20724 lazy$1(this, `groups`, getter); 20725 } 20726 supports(charCode) { 20727 if (charCode.charCodeAt) { 20728 charCode = -1; 20729 console.warn( 20730 `supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.` 20731 ); 20732 } 20733 return this.groups.findIndex( 20734 (s2) => s2.startcharCode <= charCode && charCode <= s2.endcharCode 20735 ) !== -1; 20736 } 20737 reverse(glyphID) { 20738 console.warn(`reverse not implemented for cmap subtable format 8`); 20739 return {}; 20740 } 20741 getSupportedCharCodes(preservePropNames = false) { 20742 if (preservePropNames) return this.groups; 20743 return this.groups.map((v2) => ({ 20744 start: v2.startcharCode, 20745 end: v2.endcharCode 20746 })); 20747 } 20748 }; 20749 var SequentialMapGroup$1 = class { 20750 constructor(p22) { 20751 this.startcharCode = p22.uint32; 20752 this.endcharCode = p22.uint32; 20753 this.startGlyphID = p22.uint32; 20754 } 20755 }; 20756 var Format10 = class extends Subtable { 20757 constructor(p22, platformID, encodingID) { 20758 super(p22, platformID, encodingID); 20759 this.format = 10; 20760 p22.uint16; 20761 this.length = p22.uint32; 20762 this.language = p22.uint32; 20763 this.startCharCode = p22.uint32; 20764 this.numChars = p22.uint32; 20765 this.endCharCode = this.startCharCode + this.numChars; 20766 const getter = () => [...new Array(this.numChars)].map((_) => p22.uint16); 20767 lazy$1(this, `glyphs`, getter); 20768 } 20769 supports(charCode) { 20770 if (charCode.charCodeAt) { 20771 charCode = -1; 20772 console.warn( 20773 `supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.` 20774 ); 20775 } 20776 if (charCode < this.startCharCode) return false; 20777 if (charCode > this.startCharCode + this.numChars) return false; 20778 return charCode - this.startCharCode; 20779 } 20780 reverse(glyphID) { 20781 console.warn(`reverse not implemented for cmap subtable format 10`); 20782 return {}; 20783 } 20784 getSupportedCharCodes(preservePropNames = false) { 20785 if (preservePropNames) { 20786 return [ 20787 { 20788 startCharCode: this.startCharCode, 20789 endCharCode: this.endCharCode 20790 } 20791 ]; 20792 } 20793 return [{ start: this.startCharCode, end: this.endCharCode }]; 20794 } 20795 }; 20796 var Format12 = class extends Subtable { 20797 constructor(p22, platformID, encodingID) { 20798 super(p22, platformID, encodingID); 20799 this.format = 12; 20800 p22.uint16; 20801 this.length = p22.uint32; 20802 this.language = p22.uint32; 20803 this.numGroups = p22.uint32; 20804 const getter = () => [...new Array(this.numGroups)].map( 20805 (_) => new SequentialMapGroup(p22) 20806 ); 20807 lazy$1(this, `groups`, getter); 20808 } 20809 supports(charCode) { 20810 if (charCode.charCodeAt) charCode = charCode.charCodeAt(0); 20811 if (55296 <= charCode && charCode <= 57343) return 0; 20812 if ((charCode & 65534) === 65534 || (charCode & 65535) === 65535) 20813 return 0; 20814 return this.groups.findIndex( 20815 (s2) => s2.startCharCode <= charCode && charCode <= s2.endCharCode 20816 ) !== -1; 20817 } 20818 reverse(glyphID) { 20819 for (let group of this.groups) { 20820 let start = group.startGlyphID; 20821 if (start > glyphID) continue; 20822 if (start === glyphID) return group.startCharCode; 20823 let end = start + (group.endCharCode - group.startCharCode); 20824 if (end < glyphID) continue; 20825 const code = group.startCharCode + (glyphID - start); 20826 return { code, unicode: String.fromCodePoint(code) }; 20827 } 20828 return {}; 20829 } 20830 getSupportedCharCodes(preservePropNames = false) { 20831 if (preservePropNames) return this.groups; 20832 return this.groups.map((v2) => ({ 20833 start: v2.startCharCode, 20834 end: v2.endCharCode 20835 })); 20836 } 20837 }; 20838 var SequentialMapGroup = class { 20839 constructor(p22) { 20840 this.startCharCode = p22.uint32; 20841 this.endCharCode = p22.uint32; 20842 this.startGlyphID = p22.uint32; 20843 } 20844 }; 20845 var Format13 = class extends Subtable { 20846 constructor(p22, platformID, encodingID) { 20847 super(p22, platformID, encodingID); 20848 this.format = 13; 20849 p22.uint16; 20850 this.length = p22.uint32; 20851 this.language = p22.uint32; 20852 this.numGroups = p22.uint32; 20853 const getter = [...new Array(this.numGroups)].map( 20854 (_) => new ConstantMapGroup(p22) 20855 ); 20856 lazy$1(this, `groups`, getter); 20857 } 20858 supports(charCode) { 20859 if (charCode.charCodeAt) charCode = charCode.charCodeAt(0); 20860 return this.groups.findIndex( 20861 (s2) => s2.startCharCode <= charCode && charCode <= s2.endCharCode 20862 ) !== -1; 20863 } 20864 reverse(glyphID) { 20865 console.warn(`reverse not implemented for cmap subtable format 13`); 20866 return {}; 20867 } 20868 getSupportedCharCodes(preservePropNames = false) { 20869 if (preservePropNames) return this.groups; 20870 return this.groups.map((v2) => ({ 20871 start: v2.startCharCode, 20872 end: v2.endCharCode 20873 })); 20874 } 20875 }; 20876 var ConstantMapGroup = class { 20877 constructor(p22) { 20878 this.startCharCode = p22.uint32; 20879 this.endCharCode = p22.uint32; 20880 this.glyphID = p22.uint32; 20881 } 20882 }; 20883 var Format14 = class extends Subtable { 20884 constructor(p22, platformID, encodingID) { 20885 super(p22, platformID, encodingID); 20886 this.subTableStart = p22.currentPosition; 20887 this.format = 14; 20888 this.length = p22.uint32; 20889 this.numVarSelectorRecords = p22.uint32; 20890 lazy$1( 20891 this, 20892 `varSelectors`, 20893 () => [...new Array(this.numVarSelectorRecords)].map( 20894 (_) => new VariationSelector(p22) 20895 ) 20896 ); 20897 } 20898 supports() { 20899 console.warn(`supports not implemented for cmap subtable format 14`); 20900 return 0; 20901 } 20902 getSupportedCharCodes() { 20903 console.warn( 20904 `getSupportedCharCodes not implemented for cmap subtable format 14` 20905 ); 20906 return []; 20907 } 20908 reverse(glyphID) { 20909 console.warn(`reverse not implemented for cmap subtable format 14`); 20910 return {}; 20911 } 20912 supportsVariation(variation) { 20913 let v2 = this.varSelector.find( 20914 (uvs) => uvs.varSelector === variation 20915 ); 20916 return v2 ? v2 : false; 20917 } 20918 getSupportedVariations() { 20919 return this.varSelectors.map((v2) => v2.varSelector); 20920 } 20921 }; 20922 var VariationSelector = class { 20923 constructor(p22) { 20924 this.varSelector = p22.uint24; 20925 this.defaultUVSOffset = p22.Offset32; 20926 this.nonDefaultUVSOffset = p22.Offset32; 20927 } 20928 }; 20929 function createSubTable(parser, platformID, encodingID) { 20930 const format = parser.uint16; 20931 if (format === 0) return new Format0(parser, platformID, encodingID); 20932 if (format === 2) return new Format2(parser, platformID, encodingID); 20933 if (format === 4) return new Format4(parser, platformID, encodingID); 20934 if (format === 6) return new Format6(parser, platformID, encodingID); 20935 if (format === 8) return new Format8(parser, platformID, encodingID); 20936 if (format === 10) return new Format10(parser, platformID, encodingID); 20937 if (format === 12) return new Format12(parser, platformID, encodingID); 20938 if (format === 13) return new Format13(parser, platformID, encodingID); 20939 if (format === 14) return new Format14(parser, platformID, encodingID); 20940 return {}; 20941 } 20942 var cmap = class extends SimpleTable { 20943 constructor(dict, dataview) { 20944 const { p: p22 } = super(dict, dataview); 20945 this.version = p22.uint16; 20946 this.numTables = p22.uint16; 20947 this.encodingRecords = [...new Array(this.numTables)].map( 20948 (_) => new EncodingRecord(p22, this.tableStart) 20949 ); 20950 } 20951 getSubTable(tableID) { 20952 return this.encodingRecords[tableID].table; 20953 } 20954 getSupportedEncodings() { 20955 return this.encodingRecords.map((r3) => ({ 20956 platformID: r3.platformID, 20957 encodingId: r3.encodingID 20958 })); 20959 } 20960 getSupportedCharCodes(platformID, encodingID) { 20961 const recordID = this.encodingRecords.findIndex( 20962 (r3) => r3.platformID === platformID && r3.encodingID === encodingID 20963 ); 20964 if (recordID === -1) return false; 20965 const subtable = this.getSubTable(recordID); 20966 return subtable.getSupportedCharCodes(); 20967 } 20968 reverse(glyphid) { 20969 for (let i2 = 0; i2 < this.numTables; i2++) { 20970 let code = this.getSubTable(i2).reverse(glyphid); 20971 if (code) return code; 20972 } 20973 } 20974 getGlyphId(char) { 20975 let last = 0; 20976 this.encodingRecords.some((_, tableID) => { 20977 let t3 = this.getSubTable(tableID); 20978 if (!t3.getGlyphId) return false; 20979 last = t3.getGlyphId(char); 20980 return last !== 0; 20981 }); 20982 return last; 20983 } 20984 supports(char) { 20985 return this.encodingRecords.some((_, tableID) => { 20986 const t3 = this.getSubTable(tableID); 20987 return t3.supports && t3.supports(char) !== false; 20988 }); 20989 } 20990 supportsVariation(variation) { 20991 return this.encodingRecords.some((_, tableID) => { 20992 const t3 = this.getSubTable(tableID); 20993 return t3.supportsVariation && t3.supportsVariation(variation) !== false; 20994 }); 20995 } 20996 }; 20997 var EncodingRecord = class { 20998 constructor(p22, tableStart) { 20999 const platformID = this.platformID = p22.uint16; 21000 const encodingID = this.encodingID = p22.uint16; 21001 const offset4 = this.offset = p22.Offset32; 21002 lazy$1(this, `table`, () => { 21003 p22.currentPosition = tableStart + offset4; 21004 return createSubTable(p22, platformID, encodingID); 21005 }); 21006 } 21007 }; 21008 var cmap$1 = Object.freeze({ __proto__: null, cmap }); 21009 var head = class extends SimpleTable { 21010 constructor(dict, dataview) { 21011 const { p: p22 } = super(dict, dataview); 21012 this.load({ 21013 majorVersion: p22.uint16, 21014 minorVersion: p22.uint16, 21015 fontRevision: p22.fixed, 21016 checkSumAdjustment: p22.uint32, 21017 magicNumber: p22.uint32, 21018 flags: p22.flags(16), 21019 unitsPerEm: p22.uint16, 21020 created: p22.longdatetime, 21021 modified: p22.longdatetime, 21022 xMin: p22.int16, 21023 yMin: p22.int16, 21024 xMax: p22.int16, 21025 yMax: p22.int16, 21026 macStyle: p22.flags(16), 21027 lowestRecPPEM: p22.uint16, 21028 fontDirectionHint: p22.uint16, 21029 indexToLocFormat: p22.uint16, 21030 glyphDataFormat: p22.uint16 21031 }); 21032 } 21033 }; 21034 var head$1 = Object.freeze({ __proto__: null, head }); 21035 var hhea = class extends SimpleTable { 21036 constructor(dict, dataview) { 21037 const { p: p22 } = super(dict, dataview); 21038 this.majorVersion = p22.uint16; 21039 this.minorVersion = p22.uint16; 21040 this.ascender = p22.fword; 21041 this.descender = p22.fword; 21042 this.lineGap = p22.fword; 21043 this.advanceWidthMax = p22.ufword; 21044 this.minLeftSideBearing = p22.fword; 21045 this.minRightSideBearing = p22.fword; 21046 this.xMaxExtent = p22.fword; 21047 this.caretSlopeRise = p22.int16; 21048 this.caretSlopeRun = p22.int16; 21049 this.caretOffset = p22.int16; 21050 p22.int16; 21051 p22.int16; 21052 p22.int16; 21053 p22.int16; 21054 this.metricDataFormat = p22.int16; 21055 this.numberOfHMetrics = p22.uint16; 21056 p22.verifyLength(); 21057 } 21058 }; 21059 var hhea$1 = Object.freeze({ __proto__: null, hhea }); 21060 var hmtx = class extends SimpleTable { 21061 constructor(dict, dataview, tables) { 21062 const { p: p22 } = super(dict, dataview); 21063 const numberOfHMetrics = tables.hhea.numberOfHMetrics; 21064 const numGlyphs = tables.maxp.numGlyphs; 21065 const metricsStart = p22.currentPosition; 21066 lazy$1(this, `hMetrics`, () => { 21067 p22.currentPosition = metricsStart; 21068 return [...new Array(numberOfHMetrics)].map( 21069 (_) => new LongHorMetric(p22.uint16, p22.int16) 21070 ); 21071 }); 21072 if (numberOfHMetrics < numGlyphs) { 21073 const lsbStart = metricsStart + numberOfHMetrics * 4; 21074 lazy$1(this, `leftSideBearings`, () => { 21075 p22.currentPosition = lsbStart; 21076 return [...new Array(numGlyphs - numberOfHMetrics)].map( 21077 (_) => p22.int16 21078 ); 21079 }); 21080 } 21081 } 21082 }; 21083 var LongHorMetric = class { 21084 constructor(w2, b2) { 21085 this.advanceWidth = w2; 21086 this.lsb = b2; 21087 } 21088 }; 21089 var hmtx$1 = Object.freeze({ __proto__: null, hmtx }); 21090 var maxp = class extends SimpleTable { 21091 constructor(dict, dataview) { 21092 const { p: p22 } = super(dict, dataview); 21093 this.version = p22.legacyFixed; 21094 this.numGlyphs = p22.uint16; 21095 if (this.version === 1) { 21096 this.maxPoints = p22.uint16; 21097 this.maxContours = p22.uint16; 21098 this.maxCompositePoints = p22.uint16; 21099 this.maxCompositeContours = p22.uint16; 21100 this.maxZones = p22.uint16; 21101 this.maxTwilightPoints = p22.uint16; 21102 this.maxStorage = p22.uint16; 21103 this.maxFunctionDefs = p22.uint16; 21104 this.maxInstructionDefs = p22.uint16; 21105 this.maxStackElements = p22.uint16; 21106 this.maxSizeOfInstructions = p22.uint16; 21107 this.maxComponentElements = p22.uint16; 21108 this.maxComponentDepth = p22.uint16; 21109 } 21110 p22.verifyLength(); 21111 } 21112 }; 21113 var maxp$1 = Object.freeze({ __proto__: null, maxp }); 21114 var name = class extends SimpleTable { 21115 constructor(dict, dataview) { 21116 const { p: p22 } = super(dict, dataview); 21117 this.format = p22.uint16; 21118 this.count = p22.uint16; 21119 this.stringOffset = p22.Offset16; 21120 this.nameRecords = [...new Array(this.count)].map( 21121 (_) => new NameRecord(p22, this) 21122 ); 21123 if (this.format === 1) { 21124 this.langTagCount = p22.uint16; 21125 this.langTagRecords = [...new Array(this.langTagCount)].map( 21126 (_) => new LangTagRecord(p22.uint16, p22.Offset16) 21127 ); 21128 } 21129 this.stringStart = this.tableStart + this.stringOffset; 21130 } 21131 get(nameID) { 21132 let record = this.nameRecords.find( 21133 (record2) => record2.nameID === nameID 21134 ); 21135 if (record) return record.string; 21136 } 21137 }; 21138 var LangTagRecord = class { 21139 constructor(length, offset4) { 21140 this.length = length; 21141 this.offset = offset4; 21142 } 21143 }; 21144 var NameRecord = class { 21145 constructor(p22, nameTable) { 21146 this.platformID = p22.uint16; 21147 this.encodingID = p22.uint16; 21148 this.languageID = p22.uint16; 21149 this.nameID = p22.uint16; 21150 this.length = p22.uint16; 21151 this.offset = p22.Offset16; 21152 lazy$1(this, `string`, () => { 21153 p22.currentPosition = nameTable.stringStart + this.offset; 21154 return decodeString(p22, this); 21155 }); 21156 } 21157 }; 21158 function decodeString(p22, record) { 21159 const { platformID, length } = record; 21160 if (length === 0) return ``; 21161 if (platformID === 0 || platformID === 3) { 21162 const str2 = []; 21163 for (let i2 = 0, e2 = length / 2; i2 < e2; i2++) 21164 str2[i2] = String.fromCharCode(p22.uint16); 21165 return str2.join(``); 21166 } 21167 const bytes = p22.readBytes(length); 21168 const str = []; 21169 bytes.forEach(function(b2, i2) { 21170 str[i2] = String.fromCharCode(b2); 21171 }); 21172 return str.join(``); 21173 } 21174 var name$1 = Object.freeze({ __proto__: null, name }); 21175 var OS2 = class extends SimpleTable { 21176 constructor(dict, dataview) { 21177 const { p: p22 } = super(dict, dataview); 21178 this.version = p22.uint16; 21179 this.xAvgCharWidth = p22.int16; 21180 this.usWeightClass = p22.uint16; 21181 this.usWidthClass = p22.uint16; 21182 this.fsType = p22.uint16; 21183 this.ySubscriptXSize = p22.int16; 21184 this.ySubscriptYSize = p22.int16; 21185 this.ySubscriptXOffset = p22.int16; 21186 this.ySubscriptYOffset = p22.int16; 21187 this.ySuperscriptXSize = p22.int16; 21188 this.ySuperscriptYSize = p22.int16; 21189 this.ySuperscriptXOffset = p22.int16; 21190 this.ySuperscriptYOffset = p22.int16; 21191 this.yStrikeoutSize = p22.int16; 21192 this.yStrikeoutPosition = p22.int16; 21193 this.sFamilyClass = p22.int16; 21194 this.panose = [...new Array(10)].map((_) => p22.uint8); 21195 this.ulUnicodeRange1 = p22.flags(32); 21196 this.ulUnicodeRange2 = p22.flags(32); 21197 this.ulUnicodeRange3 = p22.flags(32); 21198 this.ulUnicodeRange4 = p22.flags(32); 21199 this.achVendID = p22.tag; 21200 this.fsSelection = p22.uint16; 21201 this.usFirstCharIndex = p22.uint16; 21202 this.usLastCharIndex = p22.uint16; 21203 this.sTypoAscender = p22.int16; 21204 this.sTypoDescender = p22.int16; 21205 this.sTypoLineGap = p22.int16; 21206 this.usWinAscent = p22.uint16; 21207 this.usWinDescent = p22.uint16; 21208 if (this.version === 0) return p22.verifyLength(); 21209 this.ulCodePageRange1 = p22.flags(32); 21210 this.ulCodePageRange2 = p22.flags(32); 21211 if (this.version === 1) return p22.verifyLength(); 21212 this.sxHeight = p22.int16; 21213 this.sCapHeight = p22.int16; 21214 this.usDefaultChar = p22.uint16; 21215 this.usBreakChar = p22.uint16; 21216 this.usMaxContext = p22.uint16; 21217 if (this.version <= 4) return p22.verifyLength(); 21218 this.usLowerOpticalPointSize = p22.uint16; 21219 this.usUpperOpticalPointSize = p22.uint16; 21220 if (this.version === 5) return p22.verifyLength(); 21221 } 21222 }; 21223 var OS2$1 = Object.freeze({ __proto__: null, OS2 }); 21224 var post = class extends SimpleTable { 21225 constructor(dict, dataview) { 21226 const { p: p22 } = super(dict, dataview); 21227 this.version = p22.legacyFixed; 21228 this.italicAngle = p22.fixed; 21229 this.underlinePosition = p22.fword; 21230 this.underlineThickness = p22.fword; 21231 this.isFixedPitch = p22.uint32; 21232 this.minMemType42 = p22.uint32; 21233 this.maxMemType42 = p22.uint32; 21234 this.minMemType1 = p22.uint32; 21235 this.maxMemType1 = p22.uint32; 21236 if (this.version === 1 || this.version === 3) return p22.verifyLength(); 21237 this.numGlyphs = p22.uint16; 21238 if (this.version === 2) { 21239 this.glyphNameIndex = [...new Array(this.numGlyphs)].map( 21240 (_) => p22.uint16 21241 ); 21242 this.namesOffset = p22.currentPosition; 21243 this.glyphNameOffsets = [1]; 21244 for (let i2 = 0; i2 < this.numGlyphs; i2++) { 21245 let index2 = this.glyphNameIndex[i2]; 21246 if (index2 < macStrings.length) { 21247 this.glyphNameOffsets.push(this.glyphNameOffsets[i2]); 21248 continue; 21249 } 21250 let bytelength = p22.int8; 21251 p22.skip(bytelength); 21252 this.glyphNameOffsets.push( 21253 this.glyphNameOffsets[i2] + bytelength + 1 21254 ); 21255 } 21256 } 21257 if (this.version === 2.5) { 21258 this.offset = [...new Array(this.numGlyphs)].map( 21259 (_) => p22.int8 21260 ); 21261 } 21262 } 21263 getGlyphName(glyphid) { 21264 if (this.version !== 2) { 21265 console.warn( 21266 `post table version $this.version} does not support glyph name lookups` 21267 ); 21268 return ``; 21269 } 21270 let index2 = this.glyphNameIndex[glyphid]; 21271 if (index2 < 258) return macStrings[index2]; 21272 let offset4 = this.glyphNameOffsets[glyphid]; 21273 let next = this.glyphNameOffsets[glyphid + 1]; 21274 let len = next - offset4 - 1; 21275 if (len === 0) return `.notdef.`; 21276 this.parser.currentPosition = this.namesOffset + offset4; 21277 const data = this.parser.readBytes( 21278 len, 21279 this.namesOffset + offset4, 21280 8, 21281 true 21282 ); 21283 return data.map((b2) => String.fromCharCode(b2)).join(``); 21284 } 21285 }; 21286 var macStrings = [ 21287 `.notdef`, 21288 `.null`, 21289 `nonmarkingreturn`, 21290 `space`, 21291 `exclam`, 21292 `quotedbl`, 21293 `numbersign`, 21294 `dollar`, 21295 `percent`, 21296 `ampersand`, 21297 `quotesingle`, 21298 `parenleft`, 21299 `parenright`, 21300 `asterisk`, 21301 `plus`, 21302 `comma`, 21303 `hyphen`, 21304 `period`, 21305 `slash`, 21306 `zero`, 21307 `one`, 21308 `two`, 21309 `three`, 21310 `four`, 21311 `five`, 21312 `six`, 21313 `seven`, 21314 `eight`, 21315 `nine`, 21316 `colon`, 21317 `semicolon`, 21318 `less`, 21319 `equal`, 21320 `greater`, 21321 `question`, 21322 `at`, 21323 `A`, 21324 `B`, 21325 `C`, 21326 `D`, 21327 `E`, 21328 `F`, 21329 `G`, 21330 `H`, 21331 `I`, 21332 `J`, 21333 `K`, 21334 `L`, 21335 `M`, 21336 `N`, 21337 `O`, 21338 `P`, 21339 `Q`, 21340 `R`, 21341 `S`, 21342 `T`, 21343 `U`, 21344 `V`, 21345 `W`, 21346 `X`, 21347 `Y`, 21348 `Z`, 21349 `bracketleft`, 21350 `backslash`, 21351 `bracketright`, 21352 `asciicircum`, 21353 `underscore`, 21354 `grave`, 21355 `a`, 21356 `b`, 21357 `c`, 21358 `d`, 21359 `e`, 21360 `f`, 21361 `g`, 21362 `h`, 21363 `i`, 21364 `j`, 21365 `k`, 21366 `l`, 21367 `m`, 21368 `n`, 21369 `o`, 21370 `p`, 21371 `q`, 21372 `r`, 21373 `s`, 21374 `t`, 21375 `u`, 21376 `v`, 21377 `w`, 21378 `x`, 21379 `y`, 21380 `z`, 21381 `braceleft`, 21382 `bar`, 21383 `braceright`, 21384 `asciitilde`, 21385 `Adieresis`, 21386 `Aring`, 21387 `Ccedilla`, 21388 `Eacute`, 21389 `Ntilde`, 21390 `Odieresis`, 21391 `Udieresis`, 21392 `aacute`, 21393 `agrave`, 21394 `acircumflex`, 21395 `adieresis`, 21396 `atilde`, 21397 `aring`, 21398 `ccedilla`, 21399 `eacute`, 21400 `egrave`, 21401 `ecircumflex`, 21402 `edieresis`, 21403 `iacute`, 21404 `igrave`, 21405 `icircumflex`, 21406 `idieresis`, 21407 `ntilde`, 21408 `oacute`, 21409 `ograve`, 21410 `ocircumflex`, 21411 `odieresis`, 21412 `otilde`, 21413 `uacute`, 21414 `ugrave`, 21415 `ucircumflex`, 21416 `udieresis`, 21417 `dagger`, 21418 `degree`, 21419 `cent`, 21420 `sterling`, 21421 `section`, 21422 `bullet`, 21423 `paragraph`, 21424 `germandbls`, 21425 `registered`, 21426 `copyright`, 21427 `trademark`, 21428 `acute`, 21429 `dieresis`, 21430 `notequal`, 21431 `AE`, 21432 `Oslash`, 21433 `infinity`, 21434 `plusminus`, 21435 `lessequal`, 21436 `greaterequal`, 21437 `yen`, 21438 `mu`, 21439 `partialdiff`, 21440 `summation`, 21441 `product`, 21442 `pi`, 21443 `integral`, 21444 `ordfeminine`, 21445 `ordmasculine`, 21446 `Omega`, 21447 `ae`, 21448 `oslash`, 21449 `questiondown`, 21450 `exclamdown`, 21451 `logicalnot`, 21452 `radical`, 21453 `florin`, 21454 `approxequal`, 21455 `Delta`, 21456 `guillemotleft`, 21457 `guillemotright`, 21458 `ellipsis`, 21459 `nonbreakingspace`, 21460 `Agrave`, 21461 `Atilde`, 21462 `Otilde`, 21463 `OE`, 21464 `oe`, 21465 `endash`, 21466 `emdash`, 21467 `quotedblleft`, 21468 `quotedblright`, 21469 `quoteleft`, 21470 `quoteright`, 21471 `divide`, 21472 `lozenge`, 21473 `ydieresis`, 21474 `Ydieresis`, 21475 `fraction`, 21476 `currency`, 21477 `guilsinglleft`, 21478 `guilsinglright`, 21479 `fi`, 21480 `fl`, 21481 `daggerdbl`, 21482 `periodcentered`, 21483 `quotesinglbase`, 21484 `quotedblbase`, 21485 `perthousand`, 21486 `Acircumflex`, 21487 `Ecircumflex`, 21488 `Aacute`, 21489 `Edieresis`, 21490 `Egrave`, 21491 `Iacute`, 21492 `Icircumflex`, 21493 `Idieresis`, 21494 `Igrave`, 21495 `Oacute`, 21496 `Ocircumflex`, 21497 `apple`, 21498 `Ograve`, 21499 `Uacute`, 21500 `Ucircumflex`, 21501 `Ugrave`, 21502 `dotlessi`, 21503 `circumflex`, 21504 `tilde`, 21505 `macron`, 21506 `breve`, 21507 `dotaccent`, 21508 `ring`, 21509 `cedilla`, 21510 `hungarumlaut`, 21511 `ogonek`, 21512 `caron`, 21513 `Lslash`, 21514 `lslash`, 21515 `Scaron`, 21516 `scaron`, 21517 `Zcaron`, 21518 `zcaron`, 21519 `brokenbar`, 21520 `Eth`, 21521 `eth`, 21522 `Yacute`, 21523 `yacute`, 21524 `Thorn`, 21525 `thorn`, 21526 `minus`, 21527 `multiply`, 21528 `onesuperior`, 21529 `twosuperior`, 21530 `threesuperior`, 21531 `onehalf`, 21532 `onequarter`, 21533 `threequarters`, 21534 `franc`, 21535 `Gbreve`, 21536 `gbreve`, 21537 `Idotaccent`, 21538 `Scedilla`, 21539 `scedilla`, 21540 `Cacute`, 21541 `cacute`, 21542 `Ccaron`, 21543 `ccaron`, 21544 `dcroat` 21545 ]; 21546 var post$1 = Object.freeze({ __proto__: null, post }); 21547 var BASE = class extends SimpleTable { 21548 constructor(dict, dataview) { 21549 const { p: p22 } = super(dict, dataview); 21550 this.majorVersion = p22.uint16; 21551 this.minorVersion = p22.uint16; 21552 this.horizAxisOffset = p22.Offset16; 21553 this.vertAxisOffset = p22.Offset16; 21554 lazy$1( 21555 this, 21556 `horizAxis`, 21557 () => new AxisTable( 21558 { offset: dict.offset + this.horizAxisOffset }, 21559 dataview 21560 ) 21561 ); 21562 lazy$1( 21563 this, 21564 `vertAxis`, 21565 () => new AxisTable( 21566 { offset: dict.offset + this.vertAxisOffset }, 21567 dataview 21568 ) 21569 ); 21570 if (this.majorVersion === 1 && this.minorVersion === 1) { 21571 this.itemVarStoreOffset = p22.Offset32; 21572 lazy$1( 21573 this, 21574 `itemVarStore`, 21575 () => new AxisTable( 21576 { offset: dict.offset + this.itemVarStoreOffset }, 21577 dataview 21578 ) 21579 ); 21580 } 21581 } 21582 }; 21583 var AxisTable = class extends SimpleTable { 21584 constructor(dict, dataview) { 21585 const { p: p22 } = super(dict, dataview, `AxisTable`); 21586 this.baseTagListOffset = p22.Offset16; 21587 this.baseScriptListOffset = p22.Offset16; 21588 lazy$1( 21589 this, 21590 `baseTagList`, 21591 () => new BaseTagListTable( 21592 { offset: dict.offset + this.baseTagListOffset }, 21593 dataview 21594 ) 21595 ); 21596 lazy$1( 21597 this, 21598 `baseScriptList`, 21599 () => new BaseScriptListTable( 21600 { offset: dict.offset + this.baseScriptListOffset }, 21601 dataview 21602 ) 21603 ); 21604 } 21605 }; 21606 var BaseTagListTable = class extends SimpleTable { 21607 constructor(dict, dataview) { 21608 const { p: p22 } = super(dict, dataview, `BaseTagListTable`); 21609 this.baseTagCount = p22.uint16; 21610 this.baselineTags = [...new Array(this.baseTagCount)].map( 21611 (_) => p22.tag 21612 ); 21613 } 21614 }; 21615 var BaseScriptListTable = class extends SimpleTable { 21616 constructor(dict, dataview) { 21617 const { p: p22 } = super(dict, dataview, `BaseScriptListTable`); 21618 this.baseScriptCount = p22.uint16; 21619 const recordStart = p22.currentPosition; 21620 lazy$1(this, `baseScriptRecords`, () => { 21621 p22.currentPosition = recordStart; 21622 return [...new Array(this.baseScriptCount)].map( 21623 (_) => new BaseScriptRecord(this.start, p22) 21624 ); 21625 }); 21626 } 21627 }; 21628 var BaseScriptRecord = class { 21629 constructor(baseScriptListTableStart, p22) { 21630 this.baseScriptTag = p22.tag; 21631 this.baseScriptOffset = p22.Offset16; 21632 lazy$1(this, `baseScriptTable`, () => { 21633 p22.currentPosition = baseScriptListTableStart + this.baseScriptOffset; 21634 return new BaseScriptTable(p22); 21635 }); 21636 } 21637 }; 21638 var BaseScriptTable = class { 21639 constructor(p22) { 21640 this.start = p22.currentPosition; 21641 this.baseValuesOffset = p22.Offset16; 21642 this.defaultMinMaxOffset = p22.Offset16; 21643 this.baseLangSysCount = p22.uint16; 21644 this.baseLangSysRecords = [...new Array(this.baseLangSysCount)].map( 21645 (_) => new BaseLangSysRecord(this.start, p22) 21646 ); 21647 lazy$1(this, `baseValues`, () => { 21648 p22.currentPosition = this.start + this.baseValuesOffset; 21649 return new BaseValuesTable(p22); 21650 }); 21651 lazy$1(this, `defaultMinMax`, () => { 21652 p22.currentPosition = this.start + this.defaultMinMaxOffset; 21653 return new MinMaxTable(p22); 21654 }); 21655 } 21656 }; 21657 var BaseLangSysRecord = class { 21658 constructor(baseScriptTableStart, p22) { 21659 this.baseLangSysTag = p22.tag; 21660 this.minMaxOffset = p22.Offset16; 21661 lazy$1(this, `minMax`, () => { 21662 p22.currentPosition = baseScriptTableStart + this.minMaxOffset; 21663 return new MinMaxTable(p22); 21664 }); 21665 } 21666 }; 21667 var BaseValuesTable = class { 21668 constructor(p22) { 21669 this.parser = p22; 21670 this.start = p22.currentPosition; 21671 this.defaultBaselineIndex = p22.uint16; 21672 this.baseCoordCount = p22.uint16; 21673 this.baseCoords = [...new Array(this.baseCoordCount)].map( 21674 (_) => p22.Offset16 21675 ); 21676 } 21677 getTable(id) { 21678 this.parser.currentPosition = this.start + this.baseCoords[id]; 21679 return new BaseCoordTable(this.parser); 21680 } 21681 }; 21682 var MinMaxTable = class { 21683 constructor(p22) { 21684 this.minCoord = p22.Offset16; 21685 this.maxCoord = p22.Offset16; 21686 this.featMinMaxCount = p22.uint16; 21687 const recordStart = p22.currentPosition; 21688 lazy$1(this, `featMinMaxRecords`, () => { 21689 p22.currentPosition = recordStart; 21690 return [...new Array(this.featMinMaxCount)].map( 21691 (_) => new FeatMinMaxRecord(p22) 21692 ); 21693 }); 21694 } 21695 }; 21696 var FeatMinMaxRecord = class { 21697 constructor(p22) { 21698 this.featureTableTag = p22.tag; 21699 this.minCoord = p22.Offset16; 21700 this.maxCoord = p22.Offset16; 21701 } 21702 }; 21703 var BaseCoordTable = class { 21704 constructor(p22) { 21705 this.baseCoordFormat = p22.uint16; 21706 this.coordinate = p22.int16; 21707 if (this.baseCoordFormat === 2) { 21708 this.referenceGlyph = p22.uint16; 21709 this.baseCoordPoint = p22.uint16; 21710 } 21711 if (this.baseCoordFormat === 3) { 21712 this.deviceTable = p22.Offset16; 21713 } 21714 } 21715 }; 21716 var BASE$1 = Object.freeze({ __proto__: null, BASE }); 21717 var ClassDefinition = class { 21718 constructor(p22) { 21719 this.classFormat = p22.uint16; 21720 if (this.classFormat === 1) { 21721 this.startGlyphID = p22.uint16; 21722 this.glyphCount = p22.uint16; 21723 this.classValueArray = [...new Array(this.glyphCount)].map( 21724 (_) => p22.uint16 21725 ); 21726 } 21727 if (this.classFormat === 2) { 21728 this.classRangeCount = p22.uint16; 21729 this.classRangeRecords = [ 21730 ...new Array(this.classRangeCount) 21731 ].map((_) => new ClassRangeRecord(p22)); 21732 } 21733 } 21734 }; 21735 var ClassRangeRecord = class { 21736 constructor(p22) { 21737 this.startGlyphID = p22.uint16; 21738 this.endGlyphID = p22.uint16; 21739 this.class = p22.uint16; 21740 } 21741 }; 21742 var CoverageTable = class extends ParsedData { 21743 constructor(p22) { 21744 super(p22); 21745 this.coverageFormat = p22.uint16; 21746 if (this.coverageFormat === 1) { 21747 this.glyphCount = p22.uint16; 21748 this.glyphArray = [...new Array(this.glyphCount)].map( 21749 (_) => p22.uint16 21750 ); 21751 } 21752 if (this.coverageFormat === 2) { 21753 this.rangeCount = p22.uint16; 21754 this.rangeRecords = [...new Array(this.rangeCount)].map( 21755 (_) => new CoverageRangeRecord(p22) 21756 ); 21757 } 21758 } 21759 }; 21760 var CoverageRangeRecord = class { 21761 constructor(p22) { 21762 this.startGlyphID = p22.uint16; 21763 this.endGlyphID = p22.uint16; 21764 this.startCoverageIndex = p22.uint16; 21765 } 21766 }; 21767 var ItemVariationStoreTable = class { 21768 constructor(table, p22) { 21769 this.table = table; 21770 this.parser = p22; 21771 this.start = p22.currentPosition; 21772 this.format = p22.uint16; 21773 this.variationRegionListOffset = p22.Offset32; 21774 this.itemVariationDataCount = p22.uint16; 21775 this.itemVariationDataOffsets = [ 21776 ...new Array(this.itemVariationDataCount) 21777 ].map((_) => p22.Offset32); 21778 } 21779 }; 21780 var GDEF = class extends SimpleTable { 21781 constructor(dict, dataview) { 21782 const { p: p22 } = super(dict, dataview); 21783 this.majorVersion = p22.uint16; 21784 this.minorVersion = p22.uint16; 21785 this.glyphClassDefOffset = p22.Offset16; 21786 lazy$1(this, `glyphClassDefs`, () => { 21787 if (this.glyphClassDefOffset === 0) return void 0; 21788 p22.currentPosition = this.tableStart + this.glyphClassDefOffset; 21789 return new ClassDefinition(p22); 21790 }); 21791 this.attachListOffset = p22.Offset16; 21792 lazy$1(this, `attachList`, () => { 21793 if (this.attachListOffset === 0) return void 0; 21794 p22.currentPosition = this.tableStart + this.attachListOffset; 21795 return new AttachList(p22); 21796 }); 21797 this.ligCaretListOffset = p22.Offset16; 21798 lazy$1(this, `ligCaretList`, () => { 21799 if (this.ligCaretListOffset === 0) return void 0; 21800 p22.currentPosition = this.tableStart + this.ligCaretListOffset; 21801 return new LigCaretList(p22); 21802 }); 21803 this.markAttachClassDefOffset = p22.Offset16; 21804 lazy$1(this, `markAttachClassDef`, () => { 21805 if (this.markAttachClassDefOffset === 0) return void 0; 21806 p22.currentPosition = this.tableStart + this.markAttachClassDefOffset; 21807 return new ClassDefinition(p22); 21808 }); 21809 if (this.minorVersion >= 2) { 21810 this.markGlyphSetsDefOffset = p22.Offset16; 21811 lazy$1(this, `markGlyphSetsDef`, () => { 21812 if (this.markGlyphSetsDefOffset === 0) return void 0; 21813 p22.currentPosition = this.tableStart + this.markGlyphSetsDefOffset; 21814 return new MarkGlyphSetsTable(p22); 21815 }); 21816 } 21817 if (this.minorVersion === 3) { 21818 this.itemVarStoreOffset = p22.Offset32; 21819 lazy$1(this, `itemVarStore`, () => { 21820 if (this.itemVarStoreOffset === 0) return void 0; 21821 p22.currentPosition = this.tableStart + this.itemVarStoreOffset; 21822 return new ItemVariationStoreTable(p22); 21823 }); 21824 } 21825 } 21826 }; 21827 var AttachList = class extends ParsedData { 21828 constructor(p22) { 21829 super(p22); 21830 this.coverageOffset = p22.Offset16; 21831 this.glyphCount = p22.uint16; 21832 this.attachPointOffsets = [...new Array(this.glyphCount)].map( 21833 (_) => p22.Offset16 21834 ); 21835 } 21836 getPoint(pointID) { 21837 this.parser.currentPosition = this.start + this.attachPointOffsets[pointID]; 21838 return new AttachPoint(this.parser); 21839 } 21840 }; 21841 var AttachPoint = class { 21842 constructor(p22) { 21843 this.pointCount = p22.uint16; 21844 this.pointIndices = [...new Array(this.pointCount)].map( 21845 (_) => p22.uint16 21846 ); 21847 } 21848 }; 21849 var LigCaretList = class extends ParsedData { 21850 constructor(p22) { 21851 super(p22); 21852 this.coverageOffset = p22.Offset16; 21853 lazy$1(this, `coverage`, () => { 21854 p22.currentPosition = this.start + this.coverageOffset; 21855 return new CoverageTable(p22); 21856 }); 21857 this.ligGlyphCount = p22.uint16; 21858 this.ligGlyphOffsets = [...new Array(this.ligGlyphCount)].map( 21859 (_) => p22.Offset16 21860 ); 21861 } 21862 getLigGlyph(ligGlyphID) { 21863 this.parser.currentPosition = this.start + this.ligGlyphOffsets[ligGlyphID]; 21864 return new LigGlyph(this.parser); 21865 } 21866 }; 21867 var LigGlyph = class extends ParsedData { 21868 constructor(p22) { 21869 super(p22); 21870 this.caretCount = p22.uint16; 21871 this.caretValueOffsets = [...new Array(this.caretCount)].map( 21872 (_) => p22.Offset16 21873 ); 21874 } 21875 getCaretValue(caretID) { 21876 this.parser.currentPosition = this.start + this.caretValueOffsets[caretID]; 21877 return new CaretValue(this.parser); 21878 } 21879 }; 21880 var CaretValue = class { 21881 constructor(p22) { 21882 this.caretValueFormat = p22.uint16; 21883 if (this.caretValueFormat === 1) { 21884 this.coordinate = p22.int16; 21885 } 21886 if (this.caretValueFormat === 2) { 21887 this.caretValuePointIndex = p22.uint16; 21888 } 21889 if (this.caretValueFormat === 3) { 21890 this.coordinate = p22.int16; 21891 this.deviceOffset = p22.Offset16; 21892 } 21893 } 21894 }; 21895 var MarkGlyphSetsTable = class extends ParsedData { 21896 constructor(p22) { 21897 super(p22); 21898 this.markGlyphSetTableFormat = p22.uint16; 21899 this.markGlyphSetCount = p22.uint16; 21900 this.coverageOffsets = [...new Array(this.markGlyphSetCount)].map( 21901 (_) => p22.Offset32 21902 ); 21903 } 21904 getMarkGlyphSet(markGlyphSetID) { 21905 this.parser.currentPosition = this.start + this.coverageOffsets[markGlyphSetID]; 21906 return new CoverageTable(this.parser); 21907 } 21908 }; 21909 var GDEF$1 = Object.freeze({ __proto__: null, GDEF }); 21910 var ScriptList = class extends ParsedData { 21911 static EMPTY = { scriptCount: 0, scriptRecords: [] }; 21912 constructor(p22) { 21913 super(p22); 21914 this.scriptCount = p22.uint16; 21915 this.scriptRecords = [...new Array(this.scriptCount)].map( 21916 (_) => new ScriptRecord(p22) 21917 ); 21918 } 21919 }; 21920 var ScriptRecord = class { 21921 constructor(p22) { 21922 this.scriptTag = p22.tag; 21923 this.scriptOffset = p22.Offset16; 21924 } 21925 }; 21926 var ScriptTable = class extends ParsedData { 21927 constructor(p22) { 21928 super(p22); 21929 this.defaultLangSys = p22.Offset16; 21930 this.langSysCount = p22.uint16; 21931 this.langSysRecords = [...new Array(this.langSysCount)].map( 21932 (_) => new LangSysRecord(p22) 21933 ); 21934 } 21935 }; 21936 var LangSysRecord = class { 21937 constructor(p22) { 21938 this.langSysTag = p22.tag; 21939 this.langSysOffset = p22.Offset16; 21940 } 21941 }; 21942 var LangSysTable = class { 21943 constructor(p22) { 21944 this.lookupOrder = p22.Offset16; 21945 this.requiredFeatureIndex = p22.uint16; 21946 this.featureIndexCount = p22.uint16; 21947 this.featureIndices = [...new Array(this.featureIndexCount)].map( 21948 (_) => p22.uint16 21949 ); 21950 } 21951 }; 21952 var FeatureList = class extends ParsedData { 21953 static EMPTY = { featureCount: 0, featureRecords: [] }; 21954 constructor(p22) { 21955 super(p22); 21956 this.featureCount = p22.uint16; 21957 this.featureRecords = [...new Array(this.featureCount)].map( 21958 (_) => new FeatureRecord(p22) 21959 ); 21960 } 21961 }; 21962 var FeatureRecord = class { 21963 constructor(p22) { 21964 this.featureTag = p22.tag; 21965 this.featureOffset = p22.Offset16; 21966 } 21967 }; 21968 var FeatureTable = class extends ParsedData { 21969 constructor(p22) { 21970 super(p22); 21971 this.featureParams = p22.Offset16; 21972 this.lookupIndexCount = p22.uint16; 21973 this.lookupListIndices = [...new Array(this.lookupIndexCount)].map( 21974 (_) => p22.uint16 21975 ); 21976 } 21977 getFeatureParams() { 21978 if (this.featureParams > 0) { 21979 const p22 = this.parser; 21980 p22.currentPosition = this.start + this.featureParams; 21981 const tag = this.featureTag; 21982 if (tag === `size`) return new Size(p22); 21983 if (tag.startsWith(`cc`)) return new CharacterVariant(p22); 21984 if (tag.startsWith(`ss`)) return new StylisticSet(p22); 21985 } 21986 } 21987 }; 21988 var CharacterVariant = class { 21989 constructor(p22) { 21990 this.format = p22.uint16; 21991 this.featUiLabelNameId = p22.uint16; 21992 this.featUiTooltipTextNameId = p22.uint16; 21993 this.sampleTextNameId = p22.uint16; 21994 this.numNamedParameters = p22.uint16; 21995 this.firstParamUiLabelNameId = p22.uint16; 21996 this.charCount = p22.uint16; 21997 this.character = [...new Array(this.charCount)].map( 21998 (_) => p22.uint24 21999 ); 22000 } 22001 }; 22002 var Size = class { 22003 constructor(p22) { 22004 this.designSize = p22.uint16; 22005 this.subfamilyIdentifier = p22.uint16; 22006 this.subfamilyNameID = p22.uint16; 22007 this.smallEnd = p22.uint16; 22008 this.largeEnd = p22.uint16; 22009 } 22010 }; 22011 var StylisticSet = class { 22012 constructor(p22) { 22013 this.version = p22.uint16; 22014 this.UINameID = p22.uint16; 22015 } 22016 }; 22017 function undoCoverageOffsetParsing(instance) { 22018 instance.parser.currentPosition -= 2; 22019 delete instance.coverageOffset; 22020 delete instance.getCoverageTable; 22021 } 22022 var LookupType$1 = class extends ParsedData { 22023 constructor(p22) { 22024 super(p22); 22025 this.substFormat = p22.uint16; 22026 this.coverageOffset = p22.Offset16; 22027 } 22028 getCoverageTable() { 22029 let p22 = this.parser; 22030 p22.currentPosition = this.start + this.coverageOffset; 22031 return new CoverageTable(p22); 22032 } 22033 }; 22034 var SubstLookupRecord = class { 22035 constructor(p22) { 22036 this.glyphSequenceIndex = p22.uint16; 22037 this.lookupListIndex = p22.uint16; 22038 } 22039 }; 22040 var LookupType1$1 = class extends LookupType$1 { 22041 constructor(p22) { 22042 super(p22); 22043 this.deltaGlyphID = p22.int16; 22044 } 22045 }; 22046 var LookupType2$1 = class extends LookupType$1 { 22047 constructor(p22) { 22048 super(p22); 22049 this.sequenceCount = p22.uint16; 22050 this.sequenceOffsets = [...new Array(this.sequenceCount)].map( 22051 (_) => p22.Offset16 22052 ); 22053 } 22054 getSequence(index2) { 22055 let p22 = this.parser; 22056 p22.currentPosition = this.start + this.sequenceOffsets[index2]; 22057 return new SequenceTable(p22); 22058 } 22059 }; 22060 var SequenceTable = class { 22061 constructor(p22) { 22062 this.glyphCount = p22.uint16; 22063 this.substituteGlyphIDs = [...new Array(this.glyphCount)].map( 22064 (_) => p22.uint16 22065 ); 22066 } 22067 }; 22068 var LookupType3$1 = class extends LookupType$1 { 22069 constructor(p22) { 22070 super(p22); 22071 this.alternateSetCount = p22.uint16; 22072 this.alternateSetOffsets = [ 22073 ...new Array(this.alternateSetCount) 22074 ].map((_) => p22.Offset16); 22075 } 22076 getAlternateSet(index2) { 22077 let p22 = this.parser; 22078 p22.currentPosition = this.start + this.alternateSetOffsets[index2]; 22079 return new AlternateSetTable(p22); 22080 } 22081 }; 22082 var AlternateSetTable = class { 22083 constructor(p22) { 22084 this.glyphCount = p22.uint16; 22085 this.alternateGlyphIDs = [...new Array(this.glyphCount)].map( 22086 (_) => p22.uint16 22087 ); 22088 } 22089 }; 22090 var LookupType4$1 = class extends LookupType$1 { 22091 constructor(p22) { 22092 super(p22); 22093 this.ligatureSetCount = p22.uint16; 22094 this.ligatureSetOffsets = [...new Array(this.ligatureSetCount)].map( 22095 (_) => p22.Offset16 22096 ); 22097 } 22098 getLigatureSet(index2) { 22099 let p22 = this.parser; 22100 p22.currentPosition = this.start + this.ligatureSetOffsets[index2]; 22101 return new LigatureSetTable(p22); 22102 } 22103 }; 22104 var LigatureSetTable = class extends ParsedData { 22105 constructor(p22) { 22106 super(p22); 22107 this.ligatureCount = p22.uint16; 22108 this.ligatureOffsets = [...new Array(this.ligatureCount)].map( 22109 (_) => p22.Offset16 22110 ); 22111 } 22112 getLigature(index2) { 22113 let p22 = this.parser; 22114 p22.currentPosition = this.start + this.ligatureOffsets[index2]; 22115 return new LigatureTable(p22); 22116 } 22117 }; 22118 var LigatureTable = class { 22119 constructor(p22) { 22120 this.ligatureGlyph = p22.uint16; 22121 this.componentCount = p22.uint16; 22122 this.componentGlyphIDs = [ 22123 ...new Array(this.componentCount - 1) 22124 ].map((_) => p22.uint16); 22125 } 22126 }; 22127 var LookupType5$1 = class extends LookupType$1 { 22128 constructor(p22) { 22129 super(p22); 22130 if (this.substFormat === 1) { 22131 this.subRuleSetCount = p22.uint16; 22132 this.subRuleSetOffsets = [ 22133 ...new Array(this.subRuleSetCount) 22134 ].map((_) => p22.Offset16); 22135 } 22136 if (this.substFormat === 2) { 22137 this.classDefOffset = p22.Offset16; 22138 this.subClassSetCount = p22.uint16; 22139 this.subClassSetOffsets = [ 22140 ...new Array(this.subClassSetCount) 22141 ].map((_) => p22.Offset16); 22142 } 22143 if (this.substFormat === 3) { 22144 undoCoverageOffsetParsing(this); 22145 this.glyphCount = p22.uint16; 22146 this.substitutionCount = p22.uint16; 22147 this.coverageOffsets = [...new Array(this.glyphCount)].map( 22148 (_) => p22.Offset16 22149 ); 22150 this.substLookupRecords = [ 22151 ...new Array(this.substitutionCount) 22152 ].map((_) => new SubstLookupRecord(p22)); 22153 } 22154 } 22155 getSubRuleSet(index2) { 22156 if (this.substFormat !== 1) 22157 throw new Error( 22158 `lookup type 5.$this.substFormat} has no subrule sets.` 22159 ); 22160 let p22 = this.parser; 22161 p22.currentPosition = this.start + this.subRuleSetOffsets[index2]; 22162 return new SubRuleSetTable(p22); 22163 } 22164 getSubClassSet(index2) { 22165 if (this.substFormat !== 2) 22166 throw new Error( 22167 `lookup type 5.$this.substFormat} has no subclass sets.` 22168 ); 22169 let p22 = this.parser; 22170 p22.currentPosition = this.start + this.subClassSetOffsets[index2]; 22171 return new SubClassSetTable(p22); 22172 } 22173 getCoverageTable(index2) { 22174 if (this.substFormat !== 3 && !index2) 22175 return super.getCoverageTable(); 22176 if (!index2) 22177 throw new Error( 22178 `lookup type 5.$this.substFormat} requires an coverage table index.` 22179 ); 22180 let p22 = this.parser; 22181 p22.currentPosition = this.start + this.coverageOffsets[index2]; 22182 return new CoverageTable(p22); 22183 } 22184 }; 22185 var SubRuleSetTable = class extends ParsedData { 22186 constructor(p22) { 22187 super(p22); 22188 this.subRuleCount = p22.uint16; 22189 this.subRuleOffsets = [...new Array(this.subRuleCount)].map( 22190 (_) => p22.Offset16 22191 ); 22192 } 22193 getSubRule(index2) { 22194 let p22 = this.parser; 22195 p22.currentPosition = this.start + this.subRuleOffsets[index2]; 22196 return new SubRuleTable(p22); 22197 } 22198 }; 22199 var SubRuleTable = class { 22200 constructor(p22) { 22201 this.glyphCount = p22.uint16; 22202 this.substitutionCount = p22.uint16; 22203 this.inputSequence = [...new Array(this.glyphCount - 1)].map( 22204 (_) => p22.uint16 22205 ); 22206 this.substLookupRecords = [ 22207 ...new Array(this.substitutionCount) 22208 ].map((_) => new SubstLookupRecord(p22)); 22209 } 22210 }; 22211 var SubClassSetTable = class extends ParsedData { 22212 constructor(p22) { 22213 super(p22); 22214 this.subClassRuleCount = p22.uint16; 22215 this.subClassRuleOffsets = [ 22216 ...new Array(this.subClassRuleCount) 22217 ].map((_) => p22.Offset16); 22218 } 22219 getSubClass(index2) { 22220 let p22 = this.parser; 22221 p22.currentPosition = this.start + this.subClassRuleOffsets[index2]; 22222 return new SubClassRuleTable(p22); 22223 } 22224 }; 22225 var SubClassRuleTable = class extends SubRuleTable { 22226 constructor(p22) { 22227 super(p22); 22228 } 22229 }; 22230 var LookupType6$1 = class extends LookupType$1 { 22231 constructor(p22) { 22232 super(p22); 22233 if (this.substFormat === 1) { 22234 this.chainSubRuleSetCount = p22.uint16; 22235 this.chainSubRuleSetOffsets = [ 22236 ...new Array(this.chainSubRuleSetCount) 22237 ].map((_) => p22.Offset16); 22238 } 22239 if (this.substFormat === 2) { 22240 this.backtrackClassDefOffset = p22.Offset16; 22241 this.inputClassDefOffset = p22.Offset16; 22242 this.lookaheadClassDefOffset = p22.Offset16; 22243 this.chainSubClassSetCount = p22.uint16; 22244 this.chainSubClassSetOffsets = [ 22245 ...new Array(this.chainSubClassSetCount) 22246 ].map((_) => p22.Offset16); 22247 } 22248 if (this.substFormat === 3) { 22249 undoCoverageOffsetParsing(this); 22250 this.backtrackGlyphCount = p22.uint16; 22251 this.backtrackCoverageOffsets = [ 22252 ...new Array(this.backtrackGlyphCount) 22253 ].map((_) => p22.Offset16); 22254 this.inputGlyphCount = p22.uint16; 22255 this.inputCoverageOffsets = [ 22256 ...new Array(this.inputGlyphCount) 22257 ].map((_) => p22.Offset16); 22258 this.lookaheadGlyphCount = p22.uint16; 22259 this.lookaheadCoverageOffsets = [ 22260 ...new Array(this.lookaheadGlyphCount) 22261 ].map((_) => p22.Offset16); 22262 this.seqLookupCount = p22.uint16; 22263 this.seqLookupRecords = [ 22264 ...new Array(this.substitutionCount) 22265 ].map((_) => new SequenceLookupRecord(p22)); 22266 } 22267 } 22268 getChainSubRuleSet(index2) { 22269 if (this.substFormat !== 1) 22270 throw new Error( 22271 `lookup type 6.$this.substFormat} has no chainsubrule sets.` 22272 ); 22273 let p22 = this.parser; 22274 p22.currentPosition = this.start + this.chainSubRuleSetOffsets[index2]; 22275 return new ChainSubRuleSetTable(p22); 22276 } 22277 getChainSubClassSet(index2) { 22278 if (this.substFormat !== 2) 22279 throw new Error( 22280 `lookup type 6.$this.substFormat} has no chainsubclass sets.` 22281 ); 22282 let p22 = this.parser; 22283 p22.currentPosition = this.start + this.chainSubClassSetOffsets[index2]; 22284 return new ChainSubClassSetTable(p22); 22285 } 22286 getCoverageFromOffset(offset4) { 22287 if (this.substFormat !== 3) 22288 throw new Error( 22289 `lookup type 6.$this.substFormat} does not use contextual coverage offsets.` 22290 ); 22291 let p22 = this.parser; 22292 p22.currentPosition = this.start + offset4; 22293 return new CoverageTable(p22); 22294 } 22295 }; 22296 var ChainSubRuleSetTable = class extends ParsedData { 22297 constructor(p22) { 22298 super(p22); 22299 this.chainSubRuleCount = p22.uint16; 22300 this.chainSubRuleOffsets = [ 22301 ...new Array(this.chainSubRuleCount) 22302 ].map((_) => p22.Offset16); 22303 } 22304 getSubRule(index2) { 22305 let p22 = this.parser; 22306 p22.currentPosition = this.start + this.chainSubRuleOffsets[index2]; 22307 return new ChainSubRuleTable(p22); 22308 } 22309 }; 22310 var ChainSubRuleTable = class { 22311 constructor(p22) { 22312 this.backtrackGlyphCount = p22.uint16; 22313 this.backtrackSequence = [ 22314 ...new Array(this.backtrackGlyphCount) 22315 ].map((_) => p22.uint16); 22316 this.inputGlyphCount = p22.uint16; 22317 this.inputSequence = [...new Array(this.inputGlyphCount - 1)].map( 22318 (_) => p22.uint16 22319 ); 22320 this.lookaheadGlyphCount = p22.uint16; 22321 this.lookAheadSequence = [ 22322 ...new Array(this.lookAheadGlyphCount) 22323 ].map((_) => p22.uint16); 22324 this.substitutionCount = p22.uint16; 22325 this.substLookupRecords = [...new Array(this.SubstCount)].map( 22326 (_) => new SubstLookupRecord(p22) 22327 ); 22328 } 22329 }; 22330 var ChainSubClassSetTable = class extends ParsedData { 22331 constructor(p22) { 22332 super(p22); 22333 this.chainSubClassRuleCount = p22.uint16; 22334 this.chainSubClassRuleOffsets = [ 22335 ...new Array(this.chainSubClassRuleCount) 22336 ].map((_) => p22.Offset16); 22337 } 22338 getSubClass(index2) { 22339 let p22 = this.parser; 22340 p22.currentPosition = this.start + this.chainSubRuleOffsets[index2]; 22341 return new ChainSubClassRuleTable(p22); 22342 } 22343 }; 22344 var ChainSubClassRuleTable = class { 22345 constructor(p22) { 22346 this.backtrackGlyphCount = p22.uint16; 22347 this.backtrackSequence = [ 22348 ...new Array(this.backtrackGlyphCount) 22349 ].map((_) => p22.uint16); 22350 this.inputGlyphCount = p22.uint16; 22351 this.inputSequence = [...new Array(this.inputGlyphCount - 1)].map( 22352 (_) => p22.uint16 22353 ); 22354 this.lookaheadGlyphCount = p22.uint16; 22355 this.lookAheadSequence = [ 22356 ...new Array(this.lookAheadGlyphCount) 22357 ].map((_) => p22.uint16); 22358 this.substitutionCount = p22.uint16; 22359 this.substLookupRecords = [ 22360 ...new Array(this.substitutionCount) 22361 ].map((_) => new SequenceLookupRecord(p22)); 22362 } 22363 }; 22364 var SequenceLookupRecord = class extends ParsedData { 22365 constructor(p22) { 22366 super(p22); 22367 this.sequenceIndex = p22.uint16; 22368 this.lookupListIndex = p22.uint16; 22369 } 22370 }; 22371 var LookupType7$1 = class extends ParsedData { 22372 constructor(p22) { 22373 super(p22); 22374 this.substFormat = p22.uint16; 22375 this.extensionLookupType = p22.uint16; 22376 this.extensionOffset = p22.Offset32; 22377 } 22378 }; 22379 var LookupType8$1 = class extends LookupType$1 { 22380 constructor(p22) { 22381 super(p22); 22382 this.backtrackGlyphCount = p22.uint16; 22383 this.backtrackCoverageOffsets = [ 22384 ...new Array(this.backtrackGlyphCount) 22385 ].map((_) => p22.Offset16); 22386 this.lookaheadGlyphCount = p22.uint16; 22387 this.lookaheadCoverageOffsets = [ 22388 new Array(this.lookaheadGlyphCount) 22389 ].map((_) => p22.Offset16); 22390 this.glyphCount = p22.uint16; 22391 this.substituteGlyphIDs = [...new Array(this.glyphCount)].map( 22392 (_) => p22.uint16 22393 ); 22394 } 22395 }; 22396 var GSUBtables = { 22397 buildSubtable: function(type, p22) { 22398 const subtable = new [ 22399 void 0, 22400 LookupType1$1, 22401 LookupType2$1, 22402 LookupType3$1, 22403 LookupType4$1, 22404 LookupType5$1, 22405 LookupType6$1, 22406 LookupType7$1, 22407 LookupType8$1 22408 ][type](p22); 22409 subtable.type = type; 22410 return subtable; 22411 } 22412 }; 22413 var LookupType = class extends ParsedData { 22414 constructor(p22) { 22415 super(p22); 22416 } 22417 }; 22418 var LookupType1 = class extends LookupType { 22419 constructor(p22) { 22420 super(p22); 22421 console.log(`lookup type 1`); 22422 } 22423 }; 22424 var LookupType2 = class extends LookupType { 22425 constructor(p22) { 22426 super(p22); 22427 console.log(`lookup type 2`); 22428 } 22429 }; 22430 var LookupType3 = class extends LookupType { 22431 constructor(p22) { 22432 super(p22); 22433 console.log(`lookup type 3`); 22434 } 22435 }; 22436 var LookupType4 = class extends LookupType { 22437 constructor(p22) { 22438 super(p22); 22439 console.log(`lookup type 4`); 22440 } 22441 }; 22442 var LookupType5 = class extends LookupType { 22443 constructor(p22) { 22444 super(p22); 22445 console.log(`lookup type 5`); 22446 } 22447 }; 22448 var LookupType6 = class extends LookupType { 22449 constructor(p22) { 22450 super(p22); 22451 console.log(`lookup type 6`); 22452 } 22453 }; 22454 var LookupType7 = class extends LookupType { 22455 constructor(p22) { 22456 super(p22); 22457 console.log(`lookup type 7`); 22458 } 22459 }; 22460 var LookupType8 = class extends LookupType { 22461 constructor(p22) { 22462 super(p22); 22463 console.log(`lookup type 8`); 22464 } 22465 }; 22466 var LookupType9 = class extends LookupType { 22467 constructor(p22) { 22468 super(p22); 22469 console.log(`lookup type 9`); 22470 } 22471 }; 22472 var GPOStables = { 22473 buildSubtable: function(type, p22) { 22474 const subtable = new [ 22475 void 0, 22476 LookupType1, 22477 LookupType2, 22478 LookupType3, 22479 LookupType4, 22480 LookupType5, 22481 LookupType6, 22482 LookupType7, 22483 LookupType8, 22484 LookupType9 22485 ][type](p22); 22486 subtable.type = type; 22487 return subtable; 22488 } 22489 }; 22490 var LookupList = class extends ParsedData { 22491 static EMPTY = { lookupCount: 0, lookups: [] }; 22492 constructor(p22) { 22493 super(p22); 22494 this.lookupCount = p22.uint16; 22495 this.lookups = [...new Array(this.lookupCount)].map( 22496 (_) => p22.Offset16 22497 ); 22498 } 22499 }; 22500 var LookupTable = class extends ParsedData { 22501 constructor(p22, type) { 22502 super(p22); 22503 this.ctType = type; 22504 this.lookupType = p22.uint16; 22505 this.lookupFlag = p22.uint16; 22506 this.subTableCount = p22.uint16; 22507 this.subtableOffsets = [...new Array(this.subTableCount)].map( 22508 (_) => p22.Offset16 22509 ); 22510 this.markFilteringSet = p22.uint16; 22511 } 22512 get rightToLeft() { 22513 return this.lookupFlag & true; 22514 } 22515 get ignoreBaseGlyphs() { 22516 return this.lookupFlag & true; 22517 } 22518 get ignoreLigatures() { 22519 return this.lookupFlag & true; 22520 } 22521 get ignoreMarks() { 22522 return this.lookupFlag & true; 22523 } 22524 get useMarkFilteringSet() { 22525 return this.lookupFlag & true; 22526 } 22527 get markAttachmentType() { 22528 return this.lookupFlag & true; 22529 } 22530 getSubTable(index2) { 22531 const builder = this.ctType === `GSUB` ? GSUBtables : GPOStables; 22532 this.parser.currentPosition = this.start + this.subtableOffsets[index2]; 22533 return builder.buildSubtable(this.lookupType, this.parser); 22534 } 22535 }; 22536 var CommonLayoutTable = class extends SimpleTable { 22537 constructor(dict, dataview, name2) { 22538 const { p: p22, tableStart } = super(dict, dataview, name2); 22539 this.majorVersion = p22.uint16; 22540 this.minorVersion = p22.uint16; 22541 this.scriptListOffset = p22.Offset16; 22542 this.featureListOffset = p22.Offset16; 22543 this.lookupListOffset = p22.Offset16; 22544 if (this.majorVersion === 1 && this.minorVersion === 1) { 22545 this.featureVariationsOffset = p22.Offset32; 22546 } 22547 const no_content = !(this.scriptListOffset || this.featureListOffset || this.lookupListOffset); 22548 lazy$1(this, `scriptList`, () => { 22549 if (no_content) return ScriptList.EMPTY; 22550 p22.currentPosition = tableStart + this.scriptListOffset; 22551 return new ScriptList(p22); 22552 }); 22553 lazy$1(this, `featureList`, () => { 22554 if (no_content) return FeatureList.EMPTY; 22555 p22.currentPosition = tableStart + this.featureListOffset; 22556 return new FeatureList(p22); 22557 }); 22558 lazy$1(this, `lookupList`, () => { 22559 if (no_content) return LookupList.EMPTY; 22560 p22.currentPosition = tableStart + this.lookupListOffset; 22561 return new LookupList(p22); 22562 }); 22563 if (this.featureVariationsOffset) { 22564 lazy$1(this, `featureVariations`, () => { 22565 if (no_content) return FeatureVariations.EMPTY; 22566 p22.currentPosition = tableStart + this.featureVariationsOffset; 22567 return new FeatureVariations(p22); 22568 }); 22569 } 22570 } 22571 getSupportedScripts() { 22572 return this.scriptList.scriptRecords.map((r3) => r3.scriptTag); 22573 } 22574 getScriptTable(scriptTag) { 22575 let record = this.scriptList.scriptRecords.find( 22576 (r3) => r3.scriptTag === scriptTag 22577 ); 22578 this.parser.currentPosition = this.scriptList.start + record.scriptOffset; 22579 let table = new ScriptTable(this.parser); 22580 table.scriptTag = scriptTag; 22581 return table; 22582 } 22583 ensureScriptTable(arg) { 22584 if (typeof arg === "string") { 22585 return this.getScriptTable(arg); 22586 } 22587 return arg; 22588 } 22589 getSupportedLangSys(scriptTable) { 22590 scriptTable = this.ensureScriptTable(scriptTable); 22591 const hasDefault = scriptTable.defaultLangSys !== 0; 22592 const supported = scriptTable.langSysRecords.map( 22593 (l2) => l2.langSysTag 22594 ); 22595 if (hasDefault) supported.unshift(`dflt`); 22596 return supported; 22597 } 22598 getDefaultLangSysTable(scriptTable) { 22599 scriptTable = this.ensureScriptTable(scriptTable); 22600 let offset4 = scriptTable.defaultLangSys; 22601 if (offset4 !== 0) { 22602 this.parser.currentPosition = scriptTable.start + offset4; 22603 let table = new LangSysTable(this.parser); 22604 table.langSysTag = ``; 22605 table.defaultForScript = scriptTable.scriptTag; 22606 return table; 22607 } 22608 } 22609 getLangSysTable(scriptTable, langSysTag = `dflt`) { 22610 if (langSysTag === `dflt`) 22611 return this.getDefaultLangSysTable(scriptTable); 22612 scriptTable = this.ensureScriptTable(scriptTable); 22613 let record = scriptTable.langSysRecords.find( 22614 (l2) => l2.langSysTag === langSysTag 22615 ); 22616 this.parser.currentPosition = scriptTable.start + record.langSysOffset; 22617 let table = new LangSysTable(this.parser); 22618 table.langSysTag = langSysTag; 22619 return table; 22620 } 22621 getFeatures(langSysTable) { 22622 return langSysTable.featureIndices.map( 22623 (index2) => this.getFeature(index2) 22624 ); 22625 } 22626 getFeature(indexOrTag) { 22627 let record; 22628 if (parseInt(indexOrTag) == indexOrTag) { 22629 record = this.featureList.featureRecords[indexOrTag]; 22630 } else { 22631 record = this.featureList.featureRecords.find( 22632 (f2) => f2.featureTag === indexOrTag 22633 ); 22634 } 22635 if (!record) return; 22636 this.parser.currentPosition = this.featureList.start + record.featureOffset; 22637 let table = new FeatureTable(this.parser); 22638 table.featureTag = record.featureTag; 22639 return table; 22640 } 22641 getLookups(featureTable) { 22642 return featureTable.lookupListIndices.map( 22643 (index2) => this.getLookup(index2) 22644 ); 22645 } 22646 getLookup(lookupIndex, type) { 22647 let lookupOffset = this.lookupList.lookups[lookupIndex]; 22648 this.parser.currentPosition = this.lookupList.start + lookupOffset; 22649 return new LookupTable(this.parser, type); 22650 } 22651 }; 22652 var GSUB = class extends CommonLayoutTable { 22653 constructor(dict, dataview) { 22654 super(dict, dataview, `GSUB`); 22655 } 22656 getLookup(lookupIndex) { 22657 return super.getLookup(lookupIndex, `GSUB`); 22658 } 22659 }; 22660 var GSUB$1 = Object.freeze({ __proto__: null, GSUB }); 22661 var GPOS = class extends CommonLayoutTable { 22662 constructor(dict, dataview) { 22663 super(dict, dataview, `GPOS`); 22664 } 22665 getLookup(lookupIndex) { 22666 return super.getLookup(lookupIndex, `GPOS`); 22667 } 22668 }; 22669 var GPOS$1 = Object.freeze({ __proto__: null, GPOS }); 22670 var SVG6 = class extends SimpleTable { 22671 constructor(dict, dataview) { 22672 const { p: p22 } = super(dict, dataview); 22673 this.version = p22.uint16; 22674 this.offsetToSVGDocumentList = p22.Offset32; 22675 p22.currentPosition = this.tableStart + this.offsetToSVGDocumentList; 22676 this.documentList = new SVGDocumentList(p22); 22677 } 22678 }; 22679 var SVGDocumentList = class extends ParsedData { 22680 constructor(p22) { 22681 super(p22); 22682 this.numEntries = p22.uint16; 22683 this.documentRecords = [...new Array(this.numEntries)].map( 22684 (_) => new SVGDocumentRecord(p22) 22685 ); 22686 } 22687 getDocument(documentID) { 22688 let record = this.documentRecords[documentID]; 22689 if (!record) return ""; 22690 let offset4 = this.start + record.svgDocOffset; 22691 this.parser.currentPosition = offset4; 22692 return this.parser.readBytes(record.svgDocLength); 22693 } 22694 getDocumentForGlyph(glyphID) { 22695 let id = this.documentRecords.findIndex( 22696 (d2) => d2.startGlyphID <= glyphID && glyphID <= d2.endGlyphID 22697 ); 22698 if (id === -1) return ""; 22699 return this.getDocument(id); 22700 } 22701 }; 22702 var SVGDocumentRecord = class { 22703 constructor(p22) { 22704 this.startGlyphID = p22.uint16; 22705 this.endGlyphID = p22.uint16; 22706 this.svgDocOffset = p22.Offset32; 22707 this.svgDocLength = p22.uint32; 22708 } 22709 }; 22710 var SVG$1 = Object.freeze({ __proto__: null, SVG: SVG6 }); 22711 var fvar = class extends SimpleTable { 22712 constructor(dict, dataview) { 22713 const { p: p22 } = super(dict, dataview); 22714 this.majorVersion = p22.uint16; 22715 this.minorVersion = p22.uint16; 22716 this.axesArrayOffset = p22.Offset16; 22717 p22.uint16; 22718 this.axisCount = p22.uint16; 22719 this.axisSize = p22.uint16; 22720 this.instanceCount = p22.uint16; 22721 this.instanceSize = p22.uint16; 22722 const axisStart = this.tableStart + this.axesArrayOffset; 22723 lazy$1(this, `axes`, () => { 22724 p22.currentPosition = axisStart; 22725 return [...new Array(this.axisCount)].map( 22726 (_) => new VariationAxisRecord(p22) 22727 ); 22728 }); 22729 const instanceStart = axisStart + this.axisCount * this.axisSize; 22730 lazy$1(this, `instances`, () => { 22731 let instances = []; 22732 for (let i2 = 0; i2 < this.instanceCount; i2++) { 22733 p22.currentPosition = instanceStart + i2 * this.instanceSize; 22734 instances.push( 22735 new InstanceRecord(p22, this.axisCount, this.instanceSize) 22736 ); 22737 } 22738 return instances; 22739 }); 22740 } 22741 getSupportedAxes() { 22742 return this.axes.map((a2) => a2.tag); 22743 } 22744 getAxis(name2) { 22745 return this.axes.find((a2) => a2.tag === name2); 22746 } 22747 }; 22748 var VariationAxisRecord = class { 22749 constructor(p22) { 22750 this.tag = p22.tag; 22751 this.minValue = p22.fixed; 22752 this.defaultValue = p22.fixed; 22753 this.maxValue = p22.fixed; 22754 this.flags = p22.flags(16); 22755 this.axisNameID = p22.uint16; 22756 } 22757 }; 22758 var InstanceRecord = class { 22759 constructor(p22, axisCount, size4) { 22760 let start = p22.currentPosition; 22761 this.subfamilyNameID = p22.uint16; 22762 p22.uint16; 22763 this.coordinates = [...new Array(axisCount)].map( 22764 (_) => p22.fixed 22765 ); 22766 if (p22.currentPosition - start < size4) { 22767 this.postScriptNameID = p22.uint16; 22768 } 22769 } 22770 }; 22771 var fvar$1 = Object.freeze({ __proto__: null, fvar }); 22772 var cvt = class extends SimpleTable { 22773 constructor(dict, dataview) { 22774 const { p: p22 } = super(dict, dataview); 22775 const n2 = dict.length / 2; 22776 lazy$1( 22777 this, 22778 `items`, 22779 () => [...new Array(n2)].map((_) => p22.fword) 22780 ); 22781 } 22782 }; 22783 var cvt$1 = Object.freeze({ __proto__: null, cvt }); 22784 var fpgm = class extends SimpleTable { 22785 constructor(dict, dataview) { 22786 const { p: p22 } = super(dict, dataview); 22787 lazy$1( 22788 this, 22789 `instructions`, 22790 () => [...new Array(dict.length)].map((_) => p22.uint8) 22791 ); 22792 } 22793 }; 22794 var fpgm$1 = Object.freeze({ __proto__: null, fpgm }); 22795 var gasp = class extends SimpleTable { 22796 constructor(dict, dataview) { 22797 const { p: p22 } = super(dict, dataview); 22798 this.version = p22.uint16; 22799 this.numRanges = p22.uint16; 22800 const getter = () => [...new Array(this.numRanges)].map( 22801 (_) => new GASPRange(p22) 22802 ); 22803 lazy$1(this, `gaspRanges`, getter); 22804 } 22805 }; 22806 var GASPRange = class { 22807 constructor(p22) { 22808 this.rangeMaxPPEM = p22.uint16; 22809 this.rangeGaspBehavior = p22.uint16; 22810 } 22811 }; 22812 var gasp$1 = Object.freeze({ __proto__: null, gasp }); 22813 var glyf = class extends SimpleTable { 22814 constructor(dict, dataview) { 22815 super(dict, dataview); 22816 } 22817 getGlyphData(offset4, length) { 22818 this.parser.currentPosition = this.tableStart + offset4; 22819 return this.parser.readBytes(length); 22820 } 22821 }; 22822 var glyf$1 = Object.freeze({ __proto__: null, glyf }); 22823 var loca = class extends SimpleTable { 22824 constructor(dict, dataview, tables) { 22825 const { p: p22 } = super(dict, dataview); 22826 const n2 = tables.maxp.numGlyphs + 1; 22827 if (tables.head.indexToLocFormat === 0) { 22828 this.x2 = true; 22829 lazy$1( 22830 this, 22831 `offsets`, 22832 () => [...new Array(n2)].map((_) => p22.Offset16) 22833 ); 22834 } else { 22835 lazy$1( 22836 this, 22837 `offsets`, 22838 () => [...new Array(n2)].map((_) => p22.Offset32) 22839 ); 22840 } 22841 } 22842 getGlyphDataOffsetAndLength(glyphID) { 22843 let offset4 = this.offsets[glyphID] * this.x2 ? 2 : 1; 22844 let nextOffset = this.offsets[glyphID + 1] * this.x2 ? 2 : 1; 22845 return { offset: offset4, length: nextOffset - offset4 }; 22846 } 22847 }; 22848 var loca$1 = Object.freeze({ __proto__: null, loca }); 22849 var prep = class extends SimpleTable { 22850 constructor(dict, dataview) { 22851 const { p: p22 } = super(dict, dataview); 22852 lazy$1( 22853 this, 22854 `instructions`, 22855 () => [...new Array(dict.length)].map((_) => p22.uint8) 22856 ); 22857 } 22858 }; 22859 var prep$1 = Object.freeze({ __proto__: null, prep }); 22860 var CFF = class extends SimpleTable { 22861 constructor(dict, dataview) { 22862 const { p: p22 } = super(dict, dataview); 22863 lazy$1(this, `data`, () => p22.readBytes()); 22864 } 22865 }; 22866 var CFF$1 = Object.freeze({ __proto__: null, CFF }); 22867 var CFF2 = class extends SimpleTable { 22868 constructor(dict, dataview) { 22869 const { p: p22 } = super(dict, dataview); 22870 lazy$1(this, `data`, () => p22.readBytes()); 22871 } 22872 }; 22873 var CFF2$1 = Object.freeze({ __proto__: null, CFF2 }); 22874 var VORG = class extends SimpleTable { 22875 constructor(dict, dataview) { 22876 const { p: p22 } = super(dict, dataview); 22877 this.majorVersion = p22.uint16; 22878 this.minorVersion = p22.uint16; 22879 this.defaultVertOriginY = p22.int16; 22880 this.numVertOriginYMetrics = p22.uint16; 22881 lazy$1( 22882 this, 22883 `vertORiginYMetrics`, 22884 () => [...new Array(this.numVertOriginYMetrics)].map( 22885 (_) => new VertOriginYMetric(p22) 22886 ) 22887 ); 22888 } 22889 }; 22890 var VertOriginYMetric = class { 22891 constructor(p22) { 22892 this.glyphIndex = p22.uint16; 22893 this.vertOriginY = p22.int16; 22894 } 22895 }; 22896 var VORG$1 = Object.freeze({ __proto__: null, VORG }); 22897 var BitmapSize = class { 22898 constructor(p22) { 22899 this.indexSubTableArrayOffset = p22.Offset32; 22900 this.indexTablesSize = p22.uint32; 22901 this.numberofIndexSubTables = p22.uint32; 22902 this.colorRef = p22.uint32; 22903 this.hori = new SbitLineMetrics(p22); 22904 this.vert = new SbitLineMetrics(p22); 22905 this.startGlyphIndex = p22.uint16; 22906 this.endGlyphIndex = p22.uint16; 22907 this.ppemX = p22.uint8; 22908 this.ppemY = p22.uint8; 22909 this.bitDepth = p22.uint8; 22910 this.flags = p22.int8; 22911 } 22912 }; 22913 var BitmapScale = class { 22914 constructor(p22) { 22915 this.hori = new SbitLineMetrics(p22); 22916 this.vert = new SbitLineMetrics(p22); 22917 this.ppemX = p22.uint8; 22918 this.ppemY = p22.uint8; 22919 this.substitutePpemX = p22.uint8; 22920 this.substitutePpemY = p22.uint8; 22921 } 22922 }; 22923 var SbitLineMetrics = class { 22924 constructor(p22) { 22925 this.ascender = p22.int8; 22926 this.descender = p22.int8; 22927 this.widthMax = p22.uint8; 22928 this.caretSlopeNumerator = p22.int8; 22929 this.caretSlopeDenominator = p22.int8; 22930 this.caretOffset = p22.int8; 22931 this.minOriginSB = p22.int8; 22932 this.minAdvanceSB = p22.int8; 22933 this.maxBeforeBL = p22.int8; 22934 this.minAfterBL = p22.int8; 22935 this.pad1 = p22.int8; 22936 this.pad2 = p22.int8; 22937 } 22938 }; 22939 var EBLC = class extends SimpleTable { 22940 constructor(dict, dataview, name2) { 22941 const { p: p22 } = super(dict, dataview, name2); 22942 this.majorVersion = p22.uint16; 22943 this.minorVersion = p22.uint16; 22944 this.numSizes = p22.uint32; 22945 lazy$1( 22946 this, 22947 `bitMapSizes`, 22948 () => [...new Array(this.numSizes)].map( 22949 (_) => new BitmapSize(p22) 22950 ) 22951 ); 22952 } 22953 }; 22954 var EBLC$1 = Object.freeze({ __proto__: null, EBLC }); 22955 var EBDT = class extends SimpleTable { 22956 constructor(dict, dataview, name2) { 22957 const { p: p22 } = super(dict, dataview, name2); 22958 this.majorVersion = p22.uint16; 22959 this.minorVersion = p22.uint16; 22960 } 22961 }; 22962 var EBDT$1 = Object.freeze({ __proto__: null, EBDT }); 22963 var EBSC = class extends SimpleTable { 22964 constructor(dict, dataview) { 22965 const { p: p22 } = super(dict, dataview); 22966 this.majorVersion = p22.uint16; 22967 this.minorVersion = p22.uint16; 22968 this.numSizes = p22.uint32; 22969 lazy$1( 22970 this, 22971 `bitmapScales`, 22972 () => [...new Array(this.numSizes)].map( 22973 (_) => new BitmapScale(p22) 22974 ) 22975 ); 22976 } 22977 }; 22978 var EBSC$1 = Object.freeze({ __proto__: null, EBSC }); 22979 var CBLC = class extends EBLC { 22980 constructor(dict, dataview) { 22981 super(dict, dataview, `CBLC`); 22982 } 22983 }; 22984 var CBLC$1 = Object.freeze({ __proto__: null, CBLC }); 22985 var CBDT = class extends EBDT { 22986 constructor(dict, dataview) { 22987 super(dict, dataview, `CBDT`); 22988 } 22989 }; 22990 var CBDT$1 = Object.freeze({ __proto__: null, CBDT }); 22991 var sbix = class extends SimpleTable { 22992 constructor(dict, dataview) { 22993 const { p: p22 } = super(dict, dataview); 22994 this.version = p22.uint16; 22995 this.flags = p22.flags(16); 22996 this.numStrikes = p22.uint32; 22997 lazy$1( 22998 this, 22999 `strikeOffsets`, 23000 () => [...new Array(this.numStrikes)].map((_) => p22.Offset32) 23001 ); 23002 } 23003 }; 23004 var sbix$1 = Object.freeze({ __proto__: null, sbix }); 23005 var COLR = class extends SimpleTable { 23006 constructor(dict, dataview) { 23007 const { p: p22 } = super(dict, dataview); 23008 this.version = p22.uint16; 23009 this.numBaseGlyphRecords = p22.uint16; 23010 this.baseGlyphRecordsOffset = p22.Offset32; 23011 this.layerRecordsOffset = p22.Offset32; 23012 this.numLayerRecords = p22.uint16; 23013 } 23014 getBaseGlyphRecord(glyphID) { 23015 let start = this.tableStart + this.baseGlyphRecordsOffset; 23016 this.parser.currentPosition = start; 23017 let first = new BaseGlyphRecord(this.parser); 23018 let firstID = first.gID; 23019 let end = this.tableStart + this.layerRecordsOffset - 6; 23020 this.parser.currentPosition = end; 23021 let last = new BaseGlyphRecord(this.parser); 23022 let lastID = last.gID; 23023 if (firstID === glyphID) return first; 23024 if (lastID === glyphID) return last; 23025 while (true) { 23026 if (start === end) break; 23027 let mid = start + (end - start) / 12; 23028 this.parser.currentPosition = mid; 23029 let middle = new BaseGlyphRecord(this.parser); 23030 let midID = middle.gID; 23031 if (midID === glyphID) return middle; 23032 else if (midID > glyphID) { 23033 end = mid; 23034 } else if (midID < glyphID) { 23035 start = mid; 23036 } 23037 } 23038 return false; 23039 } 23040 getLayers(glyphID) { 23041 let record = this.getBaseGlyphRecord(glyphID); 23042 this.parser.currentPosition = this.tableStart + this.layerRecordsOffset + 4 * record.firstLayerIndex; 23043 return [...new Array(record.numLayers)].map( 23044 (_) => new LayerRecord(p) 23045 ); 23046 } 23047 }; 23048 var BaseGlyphRecord = class { 23049 constructor(p22) { 23050 this.gID = p22.uint16; 23051 this.firstLayerIndex = p22.uint16; 23052 this.numLayers = p22.uint16; 23053 } 23054 }; 23055 var LayerRecord = class { 23056 constructor(p22) { 23057 this.gID = p22.uint16; 23058 this.paletteIndex = p22.uint16; 23059 } 23060 }; 23061 var COLR$1 = Object.freeze({ __proto__: null, COLR }); 23062 var CPAL = class extends SimpleTable { 23063 constructor(dict, dataview) { 23064 const { p: p22 } = super(dict, dataview); 23065 this.version = p22.uint16; 23066 this.numPaletteEntries = p22.uint16; 23067 const numPalettes = this.numPalettes = p22.uint16; 23068 this.numColorRecords = p22.uint16; 23069 this.offsetFirstColorRecord = p22.Offset32; 23070 this.colorRecordIndices = [...new Array(this.numPalettes)].map( 23071 (_) => p22.uint16 23072 ); 23073 lazy$1(this, `colorRecords`, () => { 23074 p22.currentPosition = this.tableStart + this.offsetFirstColorRecord; 23075 return [...new Array(this.numColorRecords)].map( 23076 (_) => new ColorRecord(p22) 23077 ); 23078 }); 23079 if (this.version === 1) { 23080 this.offsetPaletteTypeArray = p22.Offset32; 23081 this.offsetPaletteLabelArray = p22.Offset32; 23082 this.offsetPaletteEntryLabelArray = p22.Offset32; 23083 lazy$1(this, `paletteTypeArray`, () => { 23084 p22.currentPosition = this.tableStart + this.offsetPaletteTypeArray; 23085 return new PaletteTypeArray(p22, numPalettes); 23086 }); 23087 lazy$1(this, `paletteLabelArray`, () => { 23088 p22.currentPosition = this.tableStart + this.offsetPaletteLabelArray; 23089 return new PaletteLabelsArray(p22, numPalettes); 23090 }); 23091 lazy$1(this, `paletteEntryLabelArray`, () => { 23092 p22.currentPosition = this.tableStart + this.offsetPaletteEntryLabelArray; 23093 return new PaletteEntryLabelArray(p22, numPalettes); 23094 }); 23095 } 23096 } 23097 }; 23098 var ColorRecord = class { 23099 constructor(p22) { 23100 this.blue = p22.uint8; 23101 this.green = p22.uint8; 23102 this.red = p22.uint8; 23103 this.alpha = p22.uint8; 23104 } 23105 }; 23106 var PaletteTypeArray = class { 23107 constructor(p22, numPalettes) { 23108 this.paletteTypes = [...new Array(numPalettes)].map( 23109 (_) => p22.uint32 23110 ); 23111 } 23112 }; 23113 var PaletteLabelsArray = class { 23114 constructor(p22, numPalettes) { 23115 this.paletteLabels = [...new Array(numPalettes)].map( 23116 (_) => p22.uint16 23117 ); 23118 } 23119 }; 23120 var PaletteEntryLabelArray = class { 23121 constructor(p22, numPalettes) { 23122 this.paletteEntryLabels = [...new Array(numPalettes)].map( 23123 (_) => p22.uint16 23124 ); 23125 } 23126 }; 23127 var CPAL$1 = Object.freeze({ __proto__: null, CPAL }); 23128 var DSIG = class extends SimpleTable { 23129 constructor(dict, dataview) { 23130 const { p: p22 } = super(dict, dataview); 23131 this.version = p22.uint32; 23132 this.numSignatures = p22.uint16; 23133 this.flags = p22.uint16; 23134 this.signatureRecords = [...new Array(this.numSignatures)].map( 23135 (_) => new SignatureRecord(p22) 23136 ); 23137 } 23138 getData(signatureID) { 23139 const record = this.signatureRecords[signatureID]; 23140 this.parser.currentPosition = this.tableStart + record.offset; 23141 return new SignatureBlockFormat1(this.parser); 23142 } 23143 }; 23144 var SignatureRecord = class { 23145 constructor(p22) { 23146 this.format = p22.uint32; 23147 this.length = p22.uint32; 23148 this.offset = p22.Offset32; 23149 } 23150 }; 23151 var SignatureBlockFormat1 = class { 23152 constructor(p22) { 23153 p22.uint16; 23154 p22.uint16; 23155 this.signatureLength = p22.uint32; 23156 this.signature = p22.readBytes(this.signatureLength); 23157 } 23158 }; 23159 var DSIG$1 = Object.freeze({ __proto__: null, DSIG }); 23160 var hdmx = class extends SimpleTable { 23161 constructor(dict, dataview, tables) { 23162 const { p: p22 } = super(dict, dataview); 23163 const numGlyphs = tables.hmtx.numGlyphs; 23164 this.version = p22.uint16; 23165 this.numRecords = p22.int16; 23166 this.sizeDeviceRecord = p22.int32; 23167 this.records = [...new Array(numRecords)].map( 23168 (_) => new DeviceRecord(p22, numGlyphs) 23169 ); 23170 } 23171 }; 23172 var DeviceRecord = class { 23173 constructor(p22, numGlyphs) { 23174 this.pixelSize = p22.uint8; 23175 this.maxWidth = p22.uint8; 23176 this.widths = p22.readBytes(numGlyphs); 23177 } 23178 }; 23179 var hdmx$1 = Object.freeze({ __proto__: null, hdmx }); 23180 var kern = class extends SimpleTable { 23181 constructor(dict, dataview) { 23182 const { p: p22 } = super(dict, dataview); 23183 this.version = p22.uint16; 23184 this.nTables = p22.uint16; 23185 lazy$1(this, `tables`, () => { 23186 let offset4 = this.tableStart + 4; 23187 const tables = []; 23188 for (let i2 = 0; i2 < this.nTables; i2++) { 23189 p22.currentPosition = offset4; 23190 let subtable = new KernSubTable(p22); 23191 tables.push(subtable); 23192 offset4 += subtable; 23193 } 23194 return tables; 23195 }); 23196 } 23197 }; 23198 var KernSubTable = class { 23199 constructor(p22) { 23200 this.version = p22.uint16; 23201 this.length = p22.uint16; 23202 this.coverage = p22.flags(8); 23203 this.format = p22.uint8; 23204 if (this.format === 0) { 23205 this.nPairs = p22.uint16; 23206 this.searchRange = p22.uint16; 23207 this.entrySelector = p22.uint16; 23208 this.rangeShift = p22.uint16; 23209 lazy$1( 23210 this, 23211 `pairs`, 23212 () => [...new Array(this.nPairs)].map((_) => new Pair(p22)) 23213 ); 23214 } 23215 if (this.format === 2) { 23216 console.warn( 23217 `Kern subtable format 2 is not supported: this parser currently only parses universal table data.` 23218 ); 23219 } 23220 } 23221 get horizontal() { 23222 return this.coverage[0]; 23223 } 23224 get minimum() { 23225 return this.coverage[1]; 23226 } 23227 get crossstream() { 23228 return this.coverage[2]; 23229 } 23230 get override() { 23231 return this.coverage[3]; 23232 } 23233 }; 23234 var Pair = class { 23235 constructor(p22) { 23236 this.left = p22.uint16; 23237 this.right = p22.uint16; 23238 this.value = p22.fword; 23239 } 23240 }; 23241 var kern$1 = Object.freeze({ __proto__: null, kern }); 23242 var LTSH = class extends SimpleTable { 23243 constructor(dict, dataview) { 23244 const { p: p22 } = super(dict, dataview); 23245 this.version = p22.uint16; 23246 this.numGlyphs = p22.uint16; 23247 this.yPels = p22.readBytes(this.numGlyphs); 23248 } 23249 }; 23250 var LTSH$1 = Object.freeze({ __proto__: null, LTSH }); 23251 var MERG = class extends SimpleTable { 23252 constructor(dict, dataview) { 23253 const { p: p22 } = super(dict, dataview); 23254 this.version = p22.uint16; 23255 this.mergeClassCount = p22.uint16; 23256 this.mergeDataOffset = p22.Offset16; 23257 this.classDefCount = p22.uint16; 23258 this.offsetToClassDefOffsets = p22.Offset16; 23259 lazy$1( 23260 this, 23261 `mergeEntryMatrix`, 23262 () => [...new Array(this.mergeClassCount)].map( 23263 (_) => p22.readBytes(this.mergeClassCount) 23264 ) 23265 ); 23266 console.warn(`Full MERG parsing is currently not supported.`); 23267 console.warn( 23268 `If you need this table parsed, please file an issue, or better yet, a PR.` 23269 ); 23270 } 23271 }; 23272 var MERG$1 = Object.freeze({ __proto__: null, MERG }); 23273 var meta = class extends SimpleTable { 23274 constructor(dict, dataview) { 23275 const { p: p22 } = super(dict, dataview); 23276 this.version = p22.uint32; 23277 this.flags = p22.uint32; 23278 p22.uint32; 23279 this.dataMapsCount = p22.uint32; 23280 this.dataMaps = [...new Array(this.dataMapsCount)].map( 23281 (_) => new DataMap(this.tableStart, p22) 23282 ); 23283 } 23284 }; 23285 var DataMap = class { 23286 constructor(tableStart, p22) { 23287 this.tableStart = tableStart; 23288 this.parser = p22; 23289 this.tag = p22.tag; 23290 this.dataOffset = p22.Offset32; 23291 this.dataLength = p22.uint32; 23292 } 23293 getData() { 23294 this.parser.currentField = this.tableStart + this.dataOffset; 23295 return this.parser.readBytes(this.dataLength); 23296 } 23297 }; 23298 var meta$1 = Object.freeze({ __proto__: null, meta }); 23299 var PCLT = class extends SimpleTable { 23300 constructor(dict, dataview) { 23301 super(dict, dataview); 23302 console.warn( 23303 `This font uses a PCLT table, which is currently not supported by this parser.` 23304 ); 23305 console.warn( 23306 `If you need this table parsed, please file an issue, or better yet, a PR.` 23307 ); 23308 } 23309 }; 23310 var PCLT$1 = Object.freeze({ __proto__: null, PCLT }); 23311 var VDMX = class extends SimpleTable { 23312 constructor(dict, dataview) { 23313 const { p: p22 } = super(dict, dataview); 23314 this.version = p22.uint16; 23315 this.numRecs = p22.uint16; 23316 this.numRatios = p22.uint16; 23317 this.ratRanges = [...new Array(this.numRatios)].map( 23318 (_) => new RatioRange(p22) 23319 ); 23320 this.offsets = [...new Array(this.numRatios)].map( 23321 (_) => p22.Offset16 23322 ); 23323 this.VDMXGroups = [...new Array(this.numRecs)].map( 23324 (_) => new VDMXGroup(p22) 23325 ); 23326 } 23327 }; 23328 var RatioRange = class { 23329 constructor(p22) { 23330 this.bCharSet = p22.uint8; 23331 this.xRatio = p22.uint8; 23332 this.yStartRatio = p22.uint8; 23333 this.yEndRatio = p22.uint8; 23334 } 23335 }; 23336 var VDMXGroup = class { 23337 constructor(p22) { 23338 this.recs = p22.uint16; 23339 this.startsz = p22.uint8; 23340 this.endsz = p22.uint8; 23341 this.records = [...new Array(this.recs)].map( 23342 (_) => new vTable(p22) 23343 ); 23344 } 23345 }; 23346 var vTable = class { 23347 constructor(p22) { 23348 this.yPelHeight = p22.uint16; 23349 this.yMax = p22.int16; 23350 this.yMin = p22.int16; 23351 } 23352 }; 23353 var VDMX$1 = Object.freeze({ __proto__: null, VDMX }); 23354 var vhea = class extends SimpleTable { 23355 constructor(dict, dataview) { 23356 const { p: p22 } = super(dict, dataview); 23357 this.version = p22.fixed; 23358 this.ascent = this.vertTypoAscender = p22.int16; 23359 this.descent = this.vertTypoDescender = p22.int16; 23360 this.lineGap = this.vertTypoLineGap = p22.int16; 23361 this.advanceHeightMax = p22.int16; 23362 this.minTopSideBearing = p22.int16; 23363 this.minBottomSideBearing = p22.int16; 23364 this.yMaxExtent = p22.int16; 23365 this.caretSlopeRise = p22.int16; 23366 this.caretSlopeRun = p22.int16; 23367 this.caretOffset = p22.int16; 23368 this.reserved = p22.int16; 23369 this.reserved = p22.int16; 23370 this.reserved = p22.int16; 23371 this.reserved = p22.int16; 23372 this.metricDataFormat = p22.int16; 23373 this.numOfLongVerMetrics = p22.uint16; 23374 p22.verifyLength(); 23375 } 23376 }; 23377 var vhea$1 = Object.freeze({ __proto__: null, vhea }); 23378 var vmtx = class extends SimpleTable { 23379 constructor(dict, dataview, tables) { 23380 super(dict, dataview); 23381 const numOfLongVerMetrics = tables.vhea.numOfLongVerMetrics; 23382 const numGlyphs = tables.maxp.numGlyphs; 23383 const metricsStart = p.currentPosition; 23384 lazy(this, `vMetrics`, () => { 23385 p.currentPosition = metricsStart; 23386 return [...new Array(numOfLongVerMetrics)].map( 23387 (_) => new LongVertMetric(p.uint16, p.int16) 23388 ); 23389 }); 23390 if (numOfLongVerMetrics < numGlyphs) { 23391 const tsbStart = metricsStart + numOfLongVerMetrics * 4; 23392 lazy(this, `topSideBearings`, () => { 23393 p.currentPosition = tsbStart; 23394 return [...new Array(numGlyphs - numOfLongVerMetrics)].map( 23395 (_) => p.int16 23396 ); 23397 }); 23398 } 23399 } 23400 }; 23401 var LongVertMetric = class { 23402 constructor(h2, b2) { 23403 this.advanceHeight = h2; 23404 this.topSideBearing = b2; 23405 } 23406 }; 23407 var vmtx$1 = Object.freeze({ __proto__: null, vmtx }); 23408 23409 // packages/global-styles-ui/build-module/font-library/utils/make-families-from-faces.mjs 23410 var import_components27 = __toESM(require_components(), 1); 23411 var { kebabCase: kebabCase2 } = unlock2(import_components27.privateApis); 23412 function makeFamiliesFromFaces(fontFaces) { 23413 const fontFamiliesObject = fontFaces.reduce( 23414 (acc, item) => { 23415 if (!acc[item.fontFamily]) { 23416 acc[item.fontFamily] = { 23417 name: item.fontFamily, 23418 fontFamily: item.fontFamily, 23419 slug: kebabCase2(item.fontFamily.toLowerCase()), 23420 fontFace: [] 23421 }; 23422 } 23423 acc[item.fontFamily].fontFace.push(item); 23424 return acc; 23425 }, 23426 {} 23427 ); 23428 return Object.values(fontFamiliesObject); 23429 } 23430 23431 // packages/global-styles-ui/build-module/font-library/upload-fonts.mjs 23432 var import_jsx_runtime53 = __toESM(require_jsx_runtime(), 1); 23433 function UploadFonts() { 23434 const { installFonts } = (0, import_element35.useContext)(FontLibraryContext); 23435 const [isUploading, setIsUploading] = (0, import_element35.useState)(false); 23436 const [notice, setNotice] = (0, import_element35.useState)(null); 23437 const handleDropZone = (files) => { 23438 handleFilesUpload(files); 23439 }; 23440 const onFilesUpload = (event) => { 23441 handleFilesUpload(event.target.files); 23442 }; 23443 const handleFilesUpload = async (files) => { 23444 if (!files) { 23445 return; 23446 } 23447 setNotice(null); 23448 setIsUploading(true); 23449 const uniqueFilenames = /* @__PURE__ */ new Set(); 23450 const selectedFiles = [...files]; 23451 let hasInvalidFiles = false; 23452 const checkFilesPromises = selectedFiles.map(async (file) => { 23453 const isFont = await isFontFile(file); 23454 if (!isFont) { 23455 hasInvalidFiles = true; 23456 return null; 23457 } 23458 if (uniqueFilenames.has(file.name)) { 23459 return null; 23460 } 23461 const fileExtension = (((file.name ?? "").split(".") ?? []).pop() ?? "").toLowerCase(); 23462 if (ALLOWED_FILE_EXTENSIONS.includes(fileExtension)) { 23463 uniqueFilenames.add(file.name); 23464 return file; 23465 } 23466 return null; 23467 }); 23468 const allowedFiles = (await Promise.all(checkFilesPromises)).filter((file) => null !== file); 23469 if (allowedFiles.length > 0) { 23470 loadFiles(allowedFiles); 23471 } else { 23472 const message = hasInvalidFiles ? (0, import_i18n17.__)("Sorry, you are not allowed to upload this file type.") : (0, import_i18n17.__)("No fonts found to install."); 23473 setNotice({ 23474 type: "error", 23475 message 23476 }); 23477 setIsUploading(false); 23478 } 23479 }; 23480 const loadFiles = async (files) => { 23481 const fontFacesLoaded = await Promise.all( 23482 files.map(async (fontFile) => { 23483 const fontFaceData = await getFontFaceMetadata(fontFile); 23484 await loadFontFaceInBrowser( 23485 fontFaceData, 23486 fontFaceData.file, 23487 "all" 23488 ); 23489 return fontFaceData; 23490 }) 23491 ); 23492 handleInstall(fontFacesLoaded); 23493 }; 23494 async function isFontFile(file) { 23495 const font2 = new Font("Uploaded Font"); 23496 try { 23497 const buffer = await readFileAsArrayBuffer(file); 23498 await font2.fromDataBuffer(buffer, "font"); 23499 return true; 23500 } catch { 23501 return false; 23502 } 23503 } 23504 async function readFileAsArrayBuffer(file) { 23505 return new Promise((resolve, reject) => { 23506 const reader = new window.FileReader(); 23507 reader.readAsArrayBuffer(file); 23508 reader.onload = () => resolve(reader.result); 23509 reader.onerror = reject; 23510 }); 23511 } 23512 const getFontFaceMetadata = async (fontFile) => { 23513 const buffer = await readFileAsArrayBuffer(fontFile); 23514 const fontObj = new Font("Uploaded Font"); 23515 fontObj.fromDataBuffer(buffer, fontFile.name); 23516 const onloadEvent = await new Promise( 23517 (resolve) => fontObj.onload = resolve 23518 ); 23519 const font2 = onloadEvent.detail.font; 23520 const { name: name2 } = font2.opentype.tables; 23521 const fontName = name2.get(16) || name2.get(1); 23522 const isItalic = name2.get(2).toLowerCase().includes("italic"); 23523 const fontWeight = font2.opentype.tables["OS/2"].usWeightClass || "normal"; 23524 const isVariable = !!font2.opentype.tables.fvar; 23525 const weightAxis = isVariable && font2.opentype.tables.fvar.axes.find( 23526 ({ tag }) => tag === "wght" 23527 ); 23528 const weightRange = weightAxis ? `$weightAxis.minValue} $weightAxis.maxValue}` : null; 23529 return { 23530 file: fontFile, 23531 fontFamily: fontName, 23532 fontStyle: isItalic ? "italic" : "normal", 23533 fontWeight: weightRange || fontWeight 23534 }; 23535 }; 23536 const handleInstall = async (fontFaces) => { 23537 const fontFamilies = makeFamiliesFromFaces(fontFaces); 23538 try { 23539 await installFonts(fontFamilies); 23540 setNotice({ 23541 type: "success", 23542 message: (0, import_i18n17.__)("Fonts were installed successfully.") 23543 }); 23544 } catch (error) { 23545 const typedError = error; 23546 setNotice({ 23547 type: "error", 23548 message: typedError.message, 23549 errors: typedError?.installationErrors 23550 }); 23551 } 23552 setIsUploading(false); 23553 }; 23554 return /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)("div", { className: "font-library__tabpanel-layout", children: [ 23555 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components28.DropZone, { onFilesDrop: handleDropZone }), 23556 /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)(import_components28.__experimentalVStack, { className: "font-library__local-fonts", justify: "start", children: [ 23557 notice && /* @__PURE__ */ (0, import_jsx_runtime53.jsxs)( 23558 import_components28.Notice, 23559 { 23560 status: notice.type, 23561 __unstableHTML: true, 23562 onRemove: () => setNotice(null), 23563 children: [ 23564 notice.message, 23565 notice.errors && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("ul", { children: notice.errors.map((error, index2) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("li", { children: error }, index2)) }) 23566 ] 23567 } 23568 ), 23569 isUploading && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components28.FlexItem, { children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)("div", { className: "font-library__upload-area", children: /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components28.ProgressBar, {}) }) }), 23570 !isUploading && /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 23571 import_components28.FormFileUpload, 23572 { 23573 accept: ALLOWED_FILE_EXTENSIONS.map( 23574 (ext) => `.$ext}` 23575 ).join(","), 23576 multiple: true, 23577 onChange: onFilesUpload, 23578 render: ({ openFileDialog }) => /* @__PURE__ */ (0, import_jsx_runtime53.jsx)( 23579 import_components28.Button, 23580 { 23581 __next40pxDefaultSize: true, 23582 className: "font-library__upload-area", 23583 onClick: openFileDialog, 23584 children: (0, import_i18n17.__)("Upload font") 23585 } 23586 ) 23587 } 23588 ), 23589 /* @__PURE__ */ (0, import_jsx_runtime53.jsx)(import_components28.__experimentalText, { className: "font-library__upload-area__text", children: (0, import_i18n17.__)( 23590 "Uploaded fonts appear in your library and can be used in your theme. Supported formats: .ttf, .otf, .woff, and .woff2." 23591 ) }) 23592 ] }) 23593 ] }); 23594 } 23595 var upload_fonts_default = UploadFonts; 23596 23597 // packages/global-styles-ui/build-module/font-library/modal.mjs 23598 var import_jsx_runtime54 = __toESM(require_jsx_runtime(), 1); 23599 var { Tabs } = unlock2(import_components29.privateApis); 23600 var DEFAULT_TAB = { 23601 id: "installed-fonts", 23602 title: (0, import_i18n18._x)("Library", "Font library") 23603 }; 23604 var UPLOAD_TAB = { 23605 id: "upload-fonts", 23606 title: (0, import_i18n18._x)("Upload", "noun") 23607 }; 23608 23609 // packages/global-styles-ui/build-module/font-family-item.mjs 23610 var import_i18n19 = __toESM(require_i18n(), 1); 23611 var import_components30 = __toESM(require_components(), 1); 23612 var import_element36 = __toESM(require_element(), 1); 23613 var import_jsx_runtime55 = __toESM(require_jsx_runtime(), 1); 23614 23615 // packages/global-styles-ui/build-module/font-families.mjs 23616 var import_jsx_runtime56 = __toESM(require_jsx_runtime(), 1); 23617 23618 // packages/global-styles-ui/build-module/font-sizes/font-sizes-count.mjs 23619 var import_i18n21 = __toESM(require_i18n(), 1); 23620 var import_components32 = __toESM(require_components(), 1); 23621 var import_jsx_runtime57 = __toESM(require_jsx_runtime(), 1); 23622 23623 // packages/global-styles-ui/build-module/screen-typography.mjs 23624 var import_jsx_runtime58 = __toESM(require_jsx_runtime(), 1); 23625 23626 // packages/global-styles-ui/build-module/screen-typography-element.mjs 23627 var import_i18n23 = __toESM(require_i18n(), 1); 23628 var import_components34 = __toESM(require_components(), 1); 23629 var import_element39 = __toESM(require_element(), 1); 23630 23631 // packages/global-styles-ui/build-module/typography-panel.mjs 23632 var import_block_editor6 = __toESM(require_block_editor(), 1); 23633 var import_jsx_runtime59 = __toESM(require_jsx_runtime(), 1); 23634 var { useSettingsForBlockElement: useSettingsForBlockElement4, TypographyPanel: StylesTypographyPanel2 } = unlock2(import_block_editor6.privateApis); 23635 23636 // packages/global-styles-ui/build-module/typography-preview.mjs 23637 var import_jsx_runtime60 = __toESM(require_jsx_runtime(), 1); 23638 23639 // packages/global-styles-ui/build-module/screen-typography-element.mjs 23640 var import_jsx_runtime61 = __toESM(require_jsx_runtime(), 1); 23641 var elements = { 23642 text: { 23643 description: (0, import_i18n23.__)("Manage the fonts used on the site."), 23644 title: (0, import_i18n23.__)("Text") 23645 }, 23646 link: { 23647 description: (0, import_i18n23.__)("Manage the fonts and typography used on the links."), 23648 title: (0, import_i18n23.__)("Links") 23649 }, 23650 heading: { 23651 description: (0, import_i18n23.__)("Manage the fonts and typography used on headings."), 23652 title: (0, import_i18n23.__)("Headings") 23653 }, 23654 caption: { 23655 description: (0, import_i18n23.__)("Manage the fonts and typography used on captions."), 23656 title: (0, import_i18n23.__)("Captions") 23657 }, 23658 button: { 23659 description: (0, import_i18n23.__)("Manage the fonts and typography used on buttons."), 23660 title: (0, import_i18n23.__)("Buttons") 23661 } 23662 }; 23663 23664 // packages/global-styles-ui/build-module/screen-colors.mjs 23665 var import_i18n25 = __toESM(require_i18n(), 1); 23666 var import_components37 = __toESM(require_components(), 1); 23667 var import_block_editor7 = __toESM(require_block_editor(), 1); 23668 23669 // packages/global-styles-ui/build-module/palette.mjs 23670 var import_components36 = __toESM(require_components(), 1); 23671 var import_i18n24 = __toESM(require_i18n(), 1); 23672 var import_element40 = __toESM(require_element(), 1); 23673 23674 // packages/global-styles-ui/build-module/color-indicator-wrapper.mjs 23675 var import_components35 = __toESM(require_components(), 1); 23676 var import_jsx_runtime62 = __toESM(require_jsx_runtime(), 1); 23677 23678 // packages/global-styles-ui/build-module/palette.mjs 23679 var import_jsx_runtime63 = __toESM(require_jsx_runtime(), 1); 23680 23681 // packages/global-styles-ui/build-module/screen-colors.mjs 23682 var import_jsx_runtime64 = __toESM(require_jsx_runtime(), 1); 23683 var { useSettingsForBlockElement: useSettingsForBlockElement5, ColorPanel: StylesColorPanel2 } = unlock2( 23684 import_block_editor7.privateApis 23685 ); 23686 23687 // packages/global-styles-ui/build-module/screen-color-palette.mjs 23688 var import_i18n28 = __toESM(require_i18n(), 1); 23689 var import_components42 = __toESM(require_components(), 1); 23690 23691 // packages/global-styles-ui/build-module/color-palette-panel.mjs 23692 var import_compose4 = __toESM(require_compose(), 1); 23693 var import_components40 = __toESM(require_components(), 1); 23694 var import_i18n26 = __toESM(require_i18n(), 1); 23695 23696 // packages/global-styles-ui/build-module/variations/variations-color.mjs 23697 var import_components39 = __toESM(require_components(), 1); 23698 23699 // packages/global-styles-ui/build-module/preview-colors.mjs 23700 var import_components38 = __toESM(require_components(), 1); 23701 23702 // packages/global-styles-ui/build-module/preset-colors.mjs 23703 var import_jsx_runtime65 = __toESM(require_jsx_runtime(), 1); 23704 function PresetColors() { 23705 const { paletteColors } = useStylesPreviewColors(); 23706 return paletteColors.slice(0, 4).map(({ slug, color }, index2) => /* @__PURE__ */ (0, import_jsx_runtime65.jsx)( 23707 "div", 23708 { 23709 style: { 23710 flexGrow: 1, 23711 height: "100%", 23712 background: color 23713 } 23714 }, 23715 `$slug}-$index2}` 23716 )); 23717 } 23718 23719 // packages/global-styles-ui/build-module/preview-colors.mjs 23720 var import_jsx_runtime66 = __toESM(require_jsx_runtime(), 1); 23721 var firstFrameVariants2 = { 23722 start: { 23723 scale: 1, 23724 opacity: 1 23725 }, 23726 hover: { 23727 scale: 0, 23728 opacity: 0 23729 } 23730 }; 23731 var StylesPreviewColors = ({ 23732 label, 23733 isFocused, 23734 withHoverView 23735 }) => { 23736 return /* @__PURE__ */ (0, import_jsx_runtime66.jsx)( 23737 preview_wrapper_default, 23738 { 23739 label, 23740 isFocused, 23741 withHoverView, 23742 children: ({ key }) => /* @__PURE__ */ (0, import_jsx_runtime66.jsx)( 23743 import_components38.__unstableMotion.div, 23744 { 23745 variants: firstFrameVariants2, 23746 style: { 23747 height: "100%", 23748 overflow: "hidden" 23749 }, 23750 children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)( 23751 import_components38.__experimentalHStack, 23752 { 23753 spacing: 0, 23754 justify: "center", 23755 style: { 23756 height: "100%", 23757 overflow: "hidden" 23758 }, 23759 children: /* @__PURE__ */ (0, import_jsx_runtime66.jsx)(PresetColors, {}) 23760 } 23761 ) 23762 }, 23763 key 23764 ) 23765 } 23766 ); 23767 }; 23768 var preview_colors_default = StylesPreviewColors; 23769 23770 // packages/global-styles-ui/build-module/variations/variations-color.mjs 23771 var import_jsx_runtime67 = __toESM(require_jsx_runtime(), 1); 23772 var propertiesToFilter2 = ["color"]; 23773 function ColorVariations({ 23774 title, 23775 gap = 2 23776 }) { 23777 const colorVariations = useCurrentMergeThemeStyleVariationsWithUserConfig(propertiesToFilter2); 23778 if (colorVariations?.length <= 1) { 23779 return null; 23780 } 23781 return /* @__PURE__ */ (0, import_jsx_runtime67.jsxs)(import_components39.__experimentalVStack, { spacing: 3, children: [ 23782 title && /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(Subtitle, { level: 3, children: title }), 23783 /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(import_components39.__experimentalGrid, { gap, children: colorVariations.map((variation, index2) => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)( 23784 Variation, 23785 { 23786 variation, 23787 isPill: true, 23788 properties: propertiesToFilter2, 23789 showTooltip: true, 23790 children: () => /* @__PURE__ */ (0, import_jsx_runtime67.jsx)(preview_colors_default, {}) 23791 }, 23792 index2 23793 )) }) 23794 ] }); 23795 } 23796 23797 // packages/global-styles-ui/build-module/color-palette-panel.mjs 23798 var import_jsx_runtime68 = __toESM(require_jsx_runtime(), 1); 23799 23800 // packages/global-styles-ui/build-module/gradients-palette-panel.mjs 23801 var import_compose5 = __toESM(require_compose(), 1); 23802 var import_components41 = __toESM(require_components(), 1); 23803 var import_i18n27 = __toESM(require_i18n(), 1); 23804 var import_jsx_runtime69 = __toESM(require_jsx_runtime(), 1); 23805 23806 // packages/global-styles-ui/build-module/screen-color-palette.mjs 23807 var import_jsx_runtime70 = __toESM(require_jsx_runtime(), 1); 23808 var { Tabs: Tabs2 } = unlock2(import_components42.privateApis); 23809 23810 // packages/global-styles-ui/build-module/screen-background.mjs 23811 var import_i18n29 = __toESM(require_i18n(), 1); 23812 var import_block_editor9 = __toESM(require_block_editor(), 1); 23813 var import_components43 = __toESM(require_components(), 1); 23814 23815 // packages/global-styles-ui/build-module/background-panel.mjs 23816 var import_block_editor8 = __toESM(require_block_editor(), 1); 23817 var import_jsx_runtime71 = __toESM(require_jsx_runtime(), 1); 23818 var { BackgroundPanel: StylesBackgroundPanel2 } = unlock2( 23819 import_block_editor8.privateApis 23820 ); 23821 23822 // packages/global-styles-ui/build-module/screen-background.mjs 23823 var import_jsx_runtime72 = __toESM(require_jsx_runtime(), 1); 23824 var { useHasBackgroundPanel: useHasBackgroundPanel3 } = unlock2(import_block_editor9.privateApis); 23825 23826 // packages/global-styles-ui/build-module/shadows-panel.mjs 23827 var import_components45 = __toESM(require_components(), 1); 23828 var import_i18n31 = __toESM(require_i18n(), 1); 23829 var import_element41 = __toESM(require_element(), 1); 23830 23831 // packages/global-styles-ui/build-module/confirm-reset-shadow-dialog.mjs 23832 var import_components44 = __toESM(require_components(), 1); 23833 var import_i18n30 = __toESM(require_i18n(), 1); 23834 var import_jsx_runtime73 = __toESM(require_jsx_runtime(), 1); 23835 23836 // packages/global-styles-ui/build-module/shadows-panel.mjs 23837 var import_jsx_runtime74 = __toESM(require_jsx_runtime(), 1); 23838 var { Menu } = unlock2(import_components45.privateApis); 23839 23840 // packages/global-styles-ui/build-module/shadows-edit-panel.mjs 23841 var import_components46 = __toESM(require_components(), 1); 23842 var import_i18n32 = __toESM(require_i18n(), 1); 23843 var import_element42 = __toESM(require_element(), 1); 23844 var import_jsx_runtime75 = __toESM(require_jsx_runtime(), 1); 23845 var { Menu: Menu2 } = unlock2(import_components46.privateApis); 23846 var customShadowMenuItems = [ 23847 { 23848 label: (0, import_i18n32.__)("Rename"), 23849 action: "rename" 23850 }, 23851 { 23852 label: (0, import_i18n32.__)("Delete"), 23853 action: "delete" 23854 } 23855 ]; 23856 var presetShadowMenuItems = [ 23857 { 23858 label: (0, import_i18n32.__)("Reset"), 23859 action: "reset" 23860 } 23861 ]; 23862 23863 // packages/global-styles-ui/build-module/screen-shadows.mjs 23864 var import_jsx_runtime76 = __toESM(require_jsx_runtime(), 1); 23865 23866 // packages/global-styles-ui/build-module/screen-layout.mjs 23867 var import_i18n33 = __toESM(require_i18n(), 1); 23868 var import_block_editor11 = __toESM(require_block_editor(), 1); 23869 23870 // packages/global-styles-ui/build-module/dimensions-panel.mjs 23871 var import_block_editor10 = __toESM(require_block_editor(), 1); 23872 var import_element43 = __toESM(require_element(), 1); 23873 var import_jsx_runtime77 = __toESM(require_jsx_runtime(), 1); 23874 var { useSettingsForBlockElement: useSettingsForBlockElement6, DimensionsPanel: StylesDimensionsPanel2 } = unlock2(import_block_editor10.privateApis); 23875 23876 // packages/global-styles-ui/build-module/screen-layout.mjs 23877 var import_jsx_runtime78 = __toESM(require_jsx_runtime(), 1); 23878 var { useHasDimensionsPanel: useHasDimensionsPanel4, useSettingsForBlockElement: useSettingsForBlockElement7 } = unlock2( 23879 import_block_editor11.privateApis 23880 ); 23881 23882 // packages/global-styles-ui/build-module/screen-style-variations.mjs 23883 var import_components49 = __toESM(require_components(), 1); 23884 var import_i18n36 = __toESM(require_i18n(), 1); 23885 23886 // packages/global-styles-ui/build-module/style-variations-content.mjs 23887 var import_i18n35 = __toESM(require_i18n(), 1); 23888 var import_components48 = __toESM(require_components(), 1); 23889 23890 // packages/global-styles-ui/build-module/style-variations-container.mjs 23891 var import_core_data9 = __toESM(require_core_data(), 1); 23892 var import_data9 = __toESM(require_data(), 1); 23893 var import_element44 = __toESM(require_element(), 1); 23894 var import_components47 = __toESM(require_components(), 1); 23895 var import_i18n34 = __toESM(require_i18n(), 1); 23896 var import_jsx_runtime79 = __toESM(require_jsx_runtime(), 1); 23897 function StyleVariationsContainer({ 23898 gap = 2 23899 }) { 23900 const { user } = (0, import_element44.useContext)(GlobalStylesContext); 23901 const userStyles = user?.styles; 23902 const variations = (0, import_data9.useSelect)((select) => { 23903 const result = select( 23904 import_core_data9.store 23905 ).__experimentalGetCurrentThemeGlobalStylesVariations(); 23906 return Array.isArray(result) ? result : void 0; 23907 }, []); 23908 const fullStyleVariations = variations?.filter( 23909 (variation) => { 23910 return !isVariationWithProperties(variation, ["color"]) && !isVariationWithProperties(variation, [ 23911 "typography", 23912 "spacing" 23913 ]); 23914 } 23915 ); 23916 const themeVariations = (0, import_element44.useMemo)(() => { 23917 const withEmptyVariation = [ 23918 { 23919 title: (0, import_i18n34.__)("Default"), 23920 settings: {}, 23921 styles: {} 23922 }, 23923 ...fullStyleVariations ?? [] 23924 ]; 23925 return [ 23926 ...withEmptyVariation.map((variation) => { 23927 const blockStyles = variation?.styles?.blocks ? { ...variation.styles.blocks } : {}; 23928 if (userStyles?.blocks) { 23929 Object.keys(userStyles.blocks).forEach((blockName) => { 23930 if (userStyles.blocks?.[blockName]?.css) { 23931 const variationBlockStyles = blockStyles[blockName] || {}; 23932 const customCSS = { 23933 css: `$blockStyles[blockName]?.css || ""} $userStyles.blocks?.[blockName]?.css?.trim() || ""}` 23934 }; 23935 blockStyles[blockName] = { 23936 ...variationBlockStyles, 23937 ...customCSS 23938 }; 23939 } 23940 }); 23941 } 23942 const css = userStyles?.css || variation.styles?.css ? { 23943 css: `$variation.styles?.css || ""} $userStyles?.css || ""}` 23944 } : {}; 23945 const blocks = Object.keys(blockStyles).length > 0 ? { blocks: blockStyles } : {}; 23946 const styles = { 23947 ...variation.styles, 23948 ...css, 23949 ...blocks 23950 }; 23951 return { 23952 ...variation, 23953 settings: variation.settings ?? {}, 23954 styles 23955 }; 23956 }) 23957 ]; 23958 }, [fullStyleVariations, userStyles?.blocks, userStyles?.css]); 23959 if (!fullStyleVariations || fullStyleVariations.length < 1) { 23960 return null; 23961 } 23962 return /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 23963 import_components47.__experimentalGrid, 23964 { 23965 columns: 2, 23966 className: "global-styles-ui-style-variations-container", 23967 gap, 23968 children: themeVariations.map( 23969 (variation, index2) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)(Variation, { variation, children: (isFocused) => /* @__PURE__ */ (0, import_jsx_runtime79.jsx)( 23970 preview_styles_default, 23971 { 23972 label: variation?.title, 23973 withHoverView: true, 23974 isFocused, 23975 variation 23976 } 23977 ) }, index2) 23978 ) 23979 } 23980 ); 23981 } 23982 var style_variations_container_default = StyleVariationsContainer; 23983 23984 // packages/global-styles-ui/build-module/style-variations-content.mjs 23985 var import_jsx_runtime80 = __toESM(require_jsx_runtime(), 1); 23986 23987 // packages/global-styles-ui/build-module/screen-style-variations.mjs 23988 var import_jsx_runtime81 = __toESM(require_jsx_runtime(), 1); 23989 23990 // packages/global-styles-ui/build-module/screen-css.mjs 23991 var import_i18n37 = __toESM(require_i18n(), 1); 23992 var import_components50 = __toESM(require_components(), 1); 23993 var import_block_editor12 = __toESM(require_block_editor(), 1); 23994 var import_jsx_runtime82 = __toESM(require_jsx_runtime(), 1); 23995 var { AdvancedPanel: StylesAdvancedPanel2 } = unlock2(import_block_editor12.privateApis); 23996 23997 // packages/global-styles-ui/build-module/screen-revisions/index.mjs 23998 var import_i18n40 = __toESM(require_i18n(), 1); 23999 var import_components53 = __toESM(require_components(), 1); 24000 var import_element46 = __toESM(require_element(), 1); 24001 24002 // packages/global-styles-ui/build-module/screen-revisions/use-global-styles-revisions.mjs 24003 var import_data10 = __toESM(require_data(), 1); 24004 var import_core_data10 = __toESM(require_core_data(), 1); 24005 var import_element45 = __toESM(require_element(), 1); 24006 24007 // packages/global-styles-ui/build-module/screen-revisions/revisions-buttons.mjs 24008 var import_i18n38 = __toESM(require_i18n(), 1); 24009 var import_components51 = __toESM(require_components(), 1); 24010 var import_date = __toESM(require_date(), 1); 24011 var import_core_data11 = __toESM(require_core_data(), 1); 24012 var import_data11 = __toESM(require_data(), 1); 24013 var import_keycodes2 = __toESM(require_keycodes(), 1); 24014 var import_jsx_runtime83 = __toESM(require_jsx_runtime(), 1); 24015 var DAY_IN_MILLISECONDS = 60 * 60 * 1e3 * 24; 24016 24017 // packages/global-styles-ui/build-module/pagination/index.mjs 24018 var import_components52 = __toESM(require_components(), 1); 24019 var import_i18n39 = __toESM(require_i18n(), 1); 24020 var import_jsx_runtime84 = __toESM(require_jsx_runtime(), 1); 24021 24022 // packages/global-styles-ui/build-module/screen-revisions/index.mjs 24023 var import_jsx_runtime85 = __toESM(require_jsx_runtime(), 1); 24024 24025 // packages/global-styles-ui/build-module/font-sizes/font-sizes.mjs 24026 var import_i18n42 = __toESM(require_i18n(), 1); 24027 var import_components55 = __toESM(require_components(), 1); 24028 var import_element47 = __toESM(require_element(), 1); 24029 24030 // packages/global-styles-ui/build-module/font-sizes/confirm-reset-font-sizes-dialog.mjs 24031 var import_components54 = __toESM(require_components(), 1); 24032 var import_i18n41 = __toESM(require_i18n(), 1); 24033 var import_jsx_runtime86 = __toESM(require_jsx_runtime(), 1); 24034 24035 // packages/global-styles-ui/build-module/font-sizes/font-sizes.mjs 24036 var import_jsx_runtime87 = __toESM(require_jsx_runtime(), 1); 24037 var { Menu: Menu3 } = unlock2(import_components55.privateApis); 24038 24039 // packages/global-styles-ui/build-module/font-sizes/font-size.mjs 24040 var import_i18n46 = __toESM(require_i18n(), 1); 24041 var import_components59 = __toESM(require_components(), 1); 24042 var import_element49 = __toESM(require_element(), 1); 24043 24044 // packages/global-styles-ui/build-module/font-sizes/font-size-preview.mjs 24045 var import_block_editor13 = __toESM(require_block_editor(), 1); 24046 var import_i18n43 = __toESM(require_i18n(), 1); 24047 var import_jsx_runtime88 = __toESM(require_jsx_runtime(), 1); 24048 24049 // packages/global-styles-ui/build-module/font-sizes/confirm-delete-font-size-dialog.mjs 24050 var import_components56 = __toESM(require_components(), 1); 24051 var import_i18n44 = __toESM(require_i18n(), 1); 24052 var import_jsx_runtime89 = __toESM(require_jsx_runtime(), 1); 24053 24054 // packages/global-styles-ui/build-module/font-sizes/rename-font-size-dialog.mjs 24055 var import_components57 = __toESM(require_components(), 1); 24056 var import_i18n45 = __toESM(require_i18n(), 1); 24057 var import_element48 = __toESM(require_element(), 1); 24058 var import_jsx_runtime90 = __toESM(require_jsx_runtime(), 1); 24059 24060 // packages/global-styles-ui/build-module/size-control/index.mjs 24061 var import_components58 = __toESM(require_components(), 1); 24062 var import_jsx_runtime91 = __toESM(require_jsx_runtime(), 1); 24063 24064 // packages/global-styles-ui/build-module/font-sizes/font-size.mjs 24065 var import_jsx_runtime92 = __toESM(require_jsx_runtime(), 1); 24066 var { Menu: Menu4 } = unlock2(import_components59.privateApis); 24067 24068 // packages/global-styles-ui/build-module/global-styles-ui.mjs 24069 var import_jsx_runtime93 = __toESM(require_jsx_runtime(), 1); 24070 24071 // packages/global-styles-ui/build-module/with-global-styles-provider.mjs 24072 var import_jsx_runtime94 = __toESM(require_jsx_runtime(), 1); 24073 function withGlobalStylesProvider(Component) { 24074 return function WrappedComponent({ 24075 value, 24076 baseValue, 24077 onChange, 24078 ...props 24079 }) { 24080 return /* @__PURE__ */ (0, import_jsx_runtime94.jsx)( 24081 GlobalStylesProvider, 24082 { 24083 value, 24084 baseValue, 24085 onChange, 24086 children: /* @__PURE__ */ (0, import_jsx_runtime94.jsx)(Component, { ...props }) 24087 } 24088 ); 24089 }; 24090 } 24091 24092 // packages/global-styles-ui/build-module/style-variations.mjs 24093 var StyleVariations = withGlobalStylesProvider(style_variations_container_default); 24094 24095 // packages/global-styles-ui/build-module/color-variations.mjs 24096 var ColorVariations2 = withGlobalStylesProvider(ColorVariations); 24097 24098 // packages/global-styles-ui/build-module/typography-variations.mjs 24099 var TypographyVariations2 = withGlobalStylesProvider(TypographyVariations); 24100 24101 // packages/global-styles-ui/build-module/font-library/font-library.mjs 24102 var import_jsx_runtime95 = __toESM(require_jsx_runtime(), 1); 24103 function FontLibrary({ 24104 value, 24105 baseValue, 24106 onChange, 24107 activeTab = "installed-fonts" 24108 }) { 24109 let content; 24110 switch (activeTab) { 24111 case "upload-fonts": 24112 content = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(upload_fonts_default, {}); 24113 break; 24114 case "installed-fonts": 24115 content = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(installed_fonts_default, {}); 24116 break; 24117 default: 24118 content = /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(font_collection_default, { slug: activeTab }); 24119 } 24120 return /* @__PURE__ */ (0, import_jsx_runtime95.jsx)( 24121 GlobalStylesProvider, 24122 { 24123 value, 24124 baseValue, 24125 onChange, 24126 children: /* @__PURE__ */ (0, import_jsx_runtime95.jsx)(context_default, { children: content }) 24127 } 24128 ); 24129 } 24130 24131 // routes/font-list/lock-unlock.ts 24132 var import_private_apis3 = __toESM(require_private_apis()); 24133 var { unlock: unlock3 } = (0, import_private_apis3.__dangerousOptInToUnstableAPIsOnlyForCoreModules)( 24134 "I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.", 24135 "@wordpress/font-list-route" 24136 ); 24137 24138 // routes/font-list/style.scss 24139 if (typeof document !== "undefined" && true && !document.head.querySelector("style[data-wp-hash='511950e422']")) { 24140 const style = document.createElement("style"); 24141 style.setAttribute("data-wp-hash", "511950e422"); 24142 style.appendChild(document.createTextNode('@media (min-width:782px){.font-library-modal.font-library-modal{width:65vw}}.font-library-modal .components-modal__header{border-bottom:none}.font-library-modal .components-modal__content{margin-bottom:90px;padding:0}.font-library-modal .font-library__subtitle{font-size:11px;font-weight:499;text-transform:uppercase}.font-library-modal__tab-panel{height:calc(100% - 50px)}.font-library__tabpanel-layout{display:flex;flex-direction:column;height:100%}.font-library__tabpanel-layout>div{flex-grow:1}.font-library__tabpanel-layout .font-library__loading{align-items:center;box-sizing:border-box;display:flex;height:100%;justify-content:center;left:0;padding-top:124px;position:absolute;top:0;width:100%}.font-library__footer,.font-library__tabpanel-layout .components-navigator-screen{padding:24px;width:100%}.font-library__footer{background-color:#fff;border-top:1px solid #ddd;bottom:0;box-sizing:border-box;flex-grow:0!important;flex-shrink:0;height:90px;position:absolute}.font-library__page-selection{font-size:11px;font-weight:499;text-transform:uppercase}@media (min-width:600px){.font-library__page-selection .font-library__page-selection-trigger{font-size:11px!important;font-weight:499}}.font-library__fonts-title{font-size:11px;font-weight:600;margin-bottom:0;margin-top:0;text-transform:uppercase}.font-library__fonts-list{list-style:none;margin-bottom:0;margin-top:0;padding:0}.font-library__fonts-list-item{margin-bottom:0}.font-library__font-card{border:1px solid #ddd;box-sizing:border-box;height:auto!important;margin-top:-1px;padding:16px;width:100%}.font-library__font-card:hover{background-color:#f0f0f0}.font-library__font-card:focus{position:relative}.font-library__font-card .font-library__font-card__name{font-weight:700}.font-library__font-card .font-library__font-card__count{color:#757575}.font-library__font-card .font-library__font-variant_demo-image{display:block;height:24px;width:auto}.font-library__font-card .font-library__font-variant_demo-text{flex-shrink:0;white-space:nowrap}@media not (prefers-reduced-motion){.font-library__font-card .font-library__font-variant_demo-text{transition:opacity .3s ease-in-out}}.font-library-modal__tablist-container{background:#fff;border-bottom:1px solid #ddd;position:sticky;top:0;z-index:1}.font-library__upload-area{align-items:center;display:flex;height:256px!important;justify-content:center;width:100%}button.font-library__upload-area{background-color:#f0f0f0}.font-library__local-fonts{margin:24px auto;width:80%}.font-library__local-fonts .font-library__upload-area__text{color:#757575}.font-library__google-fonts-confirm{align-items:center;display:flex;justify-content:center;margin-top:64px}.font-library__google-fonts-confirm p{line-height:1.4}.font-library__google-fonts-confirm h2{font-size:1.2rem;font-weight:400}.font-library__google-fonts-confirm .components-card{padding:16px;width:400px}.font-library__google-fonts-confirm .components-button{justify-content:center;width:100%}.font-library__select-all{padding:16px 16px 16px 17px}.font-library__select-all .components-checkbox-control__label{padding-left:16px}.global-styles-ui-pagination .components-button.is-tertiary{height:32px;justify-content:center;width:32px}.global-styles-ui-screen-revisions__revisions-list{flex-grow:1;list-style:none;margin:0 16px 16px}.global-styles-ui-screen-revisions__revisions-list li{margin-bottom:0}.global-styles-ui-screen-revisions__revision-item{cursor:var(--wpds-cursor-control,pointer);display:flex;flex-direction:column;position:relative}.global-styles-ui-screen-revisions__revision-item[role=option]:active,.global-styles-ui-screen-revisions__revision-item[role=option]:focus{box-shadow:0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);outline:2px solid transparent}.global-styles-ui-screen-revisions__revision-item:hover{background:rgba(var(--wp-admin-theme-color--rgb),.04)}.global-styles-ui-screen-revisions__revision-item:hover .global-styles-ui-screen-revisions__date{color:var(--wp-admin-theme-color)}.global-styles-ui-screen-revisions__revision-item:after,.global-styles-ui-screen-revisions__revision-item:before{content:"\\a";display:block;position:absolute}.global-styles-ui-screen-revisions__revision-item:before{background:#ddd;border:4px solid transparent;border-radius:50%;height:8px;left:17px;top:18px;transform:translate(-50%,-50%);width:8px;z-index:1}.global-styles-ui-screen-revisions__revision-item[aria-selected=true]{background:rgba(var(--wp-admin-theme-color--rgb),.04);border-radius:2px;color:var(--wp-admin-theme-color);outline:3px solid transparent;outline-offset:-2px}.global-styles-ui-screen-revisions__revision-item[aria-selected=true] .global-styles-ui-screen-revisions__date{color:var(--wp-admin-theme-color)}.global-styles-ui-screen-revisions__revision-item[aria-selected=true]:before{background:var(--wp-admin-theme-color)}.global-styles-ui-screen-revisions__revision-item[aria-selected=true] .global-styles-ui-screen-revisions__applied-text,.global-styles-ui-screen-revisions__revision-item[aria-selected=true] .global-styles-ui-screen-revisions__changes>li,.global-styles-ui-screen-revisions__revision-item[aria-selected=true] .global-styles-ui-screen-revisions__meta{color:#1e1e1e}.global-styles-ui-screen-revisions__revision-item:after{border:.5px solid #ddd;height:100%;left:16px;top:0;width:0}.global-styles-ui-screen-revisions__revision-item:first-child:after{top:18px}.global-styles-ui-screen-revisions__revision-item:last-child:after{height:18px}.global-styles-ui-screen-revisions__revision-item-wrapper{display:block;padding:12px 12px 4px 40px}.global-styles-ui-screen-revisions__applied-text,.global-styles-ui-screen-revisions__apply-button.is-primary{align-self:flex-start;margin:4px 12px 12px 40px}.global-styles-ui-screen-revisions__applied-text,.global-styles-ui-screen-revisions__changes,.global-styles-ui-screen-revisions__meta{color:#757575;font-size:12px}.global-styles-ui-screen-revisions__description{align-items:flex-start;display:flex;flex-direction:column;gap:8px}.global-styles-ui-screen-revisions__description .global-styles-ui-screen-revisions__date{font-size:12px;font-weight:600;text-transform:uppercase}.global-styles-ui-screen-revisions__meta{align-items:flex-start;display:flex;justify-content:start;margin-bottom:4px;text-align:left;width:100%}.global-styles-ui-screen-revisions__meta img{border-radius:100%;height:16px;margin-right:8px;width:16px}.global-styles-ui-screen-revisions__loading{margin:24px auto!important}.global-styles-ui-screen-revisions__changes{line-height:1.4;list-style:disc;margin-left:12px;text-align:left}.global-styles-ui-screen-revisions__changes li{margin-bottom:4px}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination{gap:2px;justify-content:space-between}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .edit-site-pagination__total{height:1px;left:-1000px;margin:-1px;overflow:hidden;position:absolute}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .components-text{font-size:12px;will-change:opacity}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .components-button.is-tertiary{color:#1e1e1e}.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .components-button.is-tertiary:disabled,.global-styles-ui-screen-revisions__pagination.global-styles-ui-screen-revisions__pagination .components-button.is-tertiary[aria-disabled=true]{color:#949494}.global-styles-ui-screen-revisions__footer{background:#fff;border-top:1px solid #ddd;bottom:0;box-sizing:border-box;height:56px;min-width:100%;padding:12px;position:sticky;z-index:1}.global-styles-ui-variations_item{box-sizing:border-box;cursor:var(--wpds-cursor-control,pointer)}.global-styles-ui-variations_item .global-styles-ui-variations_item-preview{border-radius:2px;outline:1px solid rgba(0,0,0,.1);outline-offset:-1px;overflow:hidden;position:relative}@media not (prefers-reduced-motion){.global-styles-ui-variations_item .global-styles-ui-variations_item-preview{transition:outline .1s linear}}.global-styles-ui-variations_item .global-styles-ui-variations_item-preview.is-pill{height:32px}.global-styles-ui-variations_item .global-styles-ui-variations_item-preview.is-pill .block-editor-iframe__scale-container{overflow:hidden}.global-styles-ui-variations_item:not(.is-active):hover .global-styles-ui-variations_item-preview{outline-color:rgba(0,0,0,.3)}.global-styles-ui-variations_item.is-active .global-styles-ui-variations_item-preview,.global-styles-ui-variations_item:focus-visible .global-styles-ui-variations_item-preview{outline-color:#1e1e1e;outline-offset:1px;outline-width:var(--wp-admin-border-width-focus)}.global-styles-ui-variations_item:focus-visible .global-styles-ui-variations_item-preview{outline-color:var(--wp-admin-theme-color)}.global-styles-ui-preview__wrapper{display:block;max-width:100%;width:100%}.global-styles-ui-preview__wrapper.is-hoverable{cursor:var(--wpds-cursor-control,pointer)}.global-styles-ui-typography-preview{align-items:center;background:#f0f0f0;border-radius:2px;display:flex;justify-content:center;margin-bottom:20px;min-height:100px;overflow:hidden}.global-styles-ui-font-size__item{line-break:anywhere;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.global-styles-ui-font-size__item-value{color:#757575}.global-styles-ui-screen-typography__indicator{align-items:center;border-radius:2px;display:flex!important;font-size:14px;height:24px;justify-content:center;width:24px}.global-styles-ui-block-types-search{margin-bottom:10px;padding:0 16px}.global-styles-ui-screen-typography__font-variants-count{color:#757575}.global-styles-ui-font-families__manage-fonts{justify-content:center}.global-styles-ui-screen .color-block-support-panel{border-top:none;padding-left:0;padding-right:0;padding-top:0;row-gap:12px}.global-styles-ui-header{line-height:1.9!important;margin-bottom:0!important}.global-styles-ui-subtitle{font-size:11px!important;font-weight:499!important;margin-bottom:0!important;text-transform:uppercase}.global-styles-ui-section-title{color:#2f2f2f;font-weight:600;line-height:1.2;margin:0;padding:16px 16px 0}.global-styles-ui-icon-with-current-color{fill:currentColor}.global-styles-ui__color-indicator-wrapper{flex-shrink:0;height:24px}.global-styles-ui__shadows-panel__options-container,.global-styles-ui__typography-panel__options-container{height:24px}.global-styles-ui__block-preview-panel{border:1px solid #ddd;border-radius:2px;overflow:hidden;position:relative;width:100%}.global-styles-ui__shadow-preview-panel{background-image:repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0),repeating-linear-gradient(45deg,#e0e0e0 25%,transparent 0,transparent 75%,#e0e0e0 0,#e0e0e0);background-position:0 0,8px 8px;background-size:16px 16px;border:1px solid #ddd;border-radius:2px;height:144px;overflow:auto}.global-styles-ui__shadow-preview-panel .global-styles-ui__shadow-preview-block{background-color:#fff;border:1px solid #ddd;border-radius:2px;height:60px;width:60%}.global-styles-ui__shadow-editor__dropdown-content{width:280px}.global-styles-ui__shadow-editor-panel{margin-bottom:4px}.global-styles-ui__shadow-editor__dropdown{position:relative;width:100%}.global-styles-ui__shadow-editor__dropdown-toggle{border-radius:inherit;height:auto;padding-bottom:8px;padding-top:8px;text-align:left;width:100%}.global-styles-ui__shadow-editor__dropdown-toggle.is-open{background:#f0f0f0;color:var(--wp-admin-theme-color)}.global-styles-ui__shadow-editor__remove-button{opacity:0;position:absolute;right:8px;top:8px}.global-styles-ui__shadow-editor__remove-button.global-styles-ui__shadow-editor__remove-button{border:none}.global-styles-ui__shadow-editor__dropdown-toggle:hover+.global-styles-ui__shadow-editor__remove-button,.global-styles-ui__shadow-editor__remove-button:focus,.global-styles-ui__shadow-editor__remove-button:hover{opacity:1}@media (hover:none){.global-styles-ui__shadow-editor__remove-button{opacity:1}}.global-styles-ui-screen-css{display:flex;flex:1 1 auto;flex-direction:column;margin:16px}.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel{flex:1 1 auto}.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input,.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input .components-base-control__field{display:flex;flex:1 1 auto;flex-direction:column}.global-styles-ui-screen-css .block-editor-global-styles-advanced-panel__custom-css-input textarea{flex:1 1 auto}.global-styles-ui-screen-css-help-link{display:inline-block;margin-top:8px}.global-styles-ui-screen-variations{border-top:1px solid #ddd;margin-top:16px}.global-styles-ui-screen-variations>*{margin:24px 16px}.global-styles-ui-sidebar__navigator-provider{height:100%}.global-styles-ui-sidebar__navigator-screen{display:flex;flex-direction:column;height:100%}.global-styles-ui-sidebar__navigator-screen .single-column{grid-column:span 1}.global-styles-ui-screen-root.global-styles-ui-screen-root,.global-styles-ui-screen-style-variations.global-styles-ui-screen-style-variations{background:unset;color:inherit}.global-styles-ui-sidebar__panel .block-editor-block-icon svg{fill:currentColor}.global-styles-ui-screen-root__active-style-tile.global-styles-ui-screen-root__active-style-tile,.global-styles-ui-screen-root__active-style-tile.global-styles-ui-screen-root__active-style-tile .global-styles-ui-screen-root__active-style-tile-preview{border-radius:2px}.global-styles-ui-screen-root__active-style-tile-preview{clip-path:border-box}.global-styles-ui-color-palette-panel,.global-styles-ui-gradient-palette-panel{padding:16px}.font-library-page__tablist{border-bottom:1px solid #f0f0f0;padding:0 24px}.font-library-page__tab-panel{flex-grow:1;max-height:calc(100% - 110px);overflow:auto}.font-library-page:has(.font-library__footer) .font-library-page__tab-panel{max-height:calc(100% - 198px)}')); 24143 document.head.appendChild(style); 24144 } 24145 24146 // routes/font-list/stage.tsx 24147 var { Tabs: Tabs3 } = unlock3(import_components61.privateApis); 24148 var { useGlobalStyles } = unlock3(import_editor.privateApis); 24149 function FontLibraryPage() { 24150 const { records: collections = [] } = (0, import_core_data12.useEntityRecords)("root", "fontCollection", { 24151 _fields: "slug,name,description" 24152 }); 24153 const [activeTab, setActiveTab] = (0, import_element51.useState)("installed-fonts"); 24154 const { base, user, setUser, isReady } = useGlobalStyles(); 24155 const canUserCreate = (0, import_data13.useSelect)((select) => { 24156 return select(import_core_data12.store).canUser("create", { 24157 kind: "postType", 24158 name: "wp_font_family" 24159 }); 24160 }, []); 24161 if (!isReady) { 24162 return null; 24163 } 24164 const tabs = [ 24165 { 24166 id: "installed-fonts", 24167 title: (0, import_i18n47._x)("Library", "Font library") 24168 } 24169 ]; 24170 if (canUserCreate) { 24171 tabs.push({ 24172 id: "upload-fonts", 24173 title: (0, import_i18n47._x)("Upload", "noun") 24174 }); 24175 tabs.push( 24176 ...(collections || []).map(({ slug, name: name2 }) => ({ 24177 id: slug, 24178 title: collections && collections.length === 1 && slug === "google-fonts" ? (0, import_i18n47.__)("Install Fonts") : name2 24179 })) 24180 ); 24181 } 24182 return /* @__PURE__ */ React.createElement(page_default, { title: (0, import_i18n47.__)("Fonts"), className: "font-library-page" }, /* @__PURE__ */ React.createElement( 24183 Tabs3, 24184 { 24185 selectedTabId: activeTab, 24186 onSelect: (tabId) => setActiveTab(tabId) 24187 }, 24188 /* @__PURE__ */ React.createElement("div", { className: "font-library-page__tablist" }, /* @__PURE__ */ React.createElement(Tabs3.TabList, null, tabs.map(({ id, title }) => /* @__PURE__ */ React.createElement(Tabs3.Tab, { key: id, tabId: id }, title)))), 24189 tabs.map(({ id }) => /* @__PURE__ */ React.createElement( 24190 Tabs3.TabPanel, 24191 { 24192 key: id, 24193 tabId: id, 24194 focusable: false, 24195 className: "font-library-page__tab-panel" 24196 }, 24197 /* @__PURE__ */ React.createElement( 24198 FontLibrary, 24199 { 24200 value: user, 24201 baseValue: base, 24202 onChange: setUser, 24203 activeTab: id 24204 } 24205 ) 24206 )) 24207 )); 24208 } 24209 function Stage() { 24210 return /* @__PURE__ */ React.createElement(FontLibraryPage, null); 24211 } 24212 var stage = Stage; 24213 export { 24214 stage 24215 }; 24216 /*! Bundled license information: 24217 24218 use-sync-external-store/cjs/use-sync-external-store-shim.development.js: 24219 (** 24220 * @license React 24221 * use-sync-external-store-shim.development.js 24222 * 24223 * Copyright (c) Meta Platforms, Inc. and affiliates. 24224 * 24225 * This source code is licensed under the MIT license found in the 24226 * LICENSE file in the root directory of this source tree. 24227 *) 24228 24229 use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.development.js: 24230 (** 24231 * @license React 24232 * use-sync-external-store-shim/with-selector.development.js 24233 * 24234 * Copyright (c) Meta Platforms, Inc. and affiliates. 24235 * 24236 * This source code is licensed under the MIT license found in the 24237 * LICENSE file in the root directory of this source tree. 24238 *) 24239 24240 is-plain-object/dist/is-plain-object.mjs: 24241 (*! 24242 * is-plain-object <https://github.com/jonschlinkert/is-plain-object> 24243 * 24244 * Copyright (c) 2014-2017, Jon Schlinkert. 24245 * Released under the MIT License. 24246 *) 24247 */
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated : Sun Jul 5 08:20:13 2026 | Cross-referenced by PHPXref |