diff --git a/package.json b/package.json index 4d0b8110e0a9f..79b19ba56a70c 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "url": "https://develop.svn.wordpress.org/trunk" }, "gutenberg": { - "sha": "e2970ba736edb99e08fb369d4fb0c378189468ee", + "sha": "9408691b57517e8f65d6f2aedfee105ab32c9632", "ghcrRepo": "WordPress/gutenberg/gutenberg-wp-develop-build" }, "engines": { diff --git a/src/wp-includes/assets/script-loader-packages.php b/src/wp-includes/assets/script-loader-packages.php index 10af74b63ce36..a91ae40c9006a 100644 --- a/src/wp-includes/assets/script-loader-packages.php +++ b/src/wp-includes/assets/script-loader-packages.php @@ -4,7 +4,7 @@ 'wp-dom-ready', 'wp-i18n' ), - 'version' => 'af934e5259bc51b8718e' + 'version' => '483af07a6016f640f456' ), 'annotations.js' => array( 'dependencies' => array( @@ -13,14 +13,14 @@ 'wp-i18n', 'wp-rich-text' ), - 'version' => '4b07d06c67c3b5ea590c' + 'version' => 'a97786de6f13be9c6637' ), 'api-fetch.js' => array( 'dependencies' => array( 'wp-i18n', 'wp-url' ), - 'version' => 'd7efe4dc1468d36c39b8' + 'version' => 'b76aeca1c88ecc790e48' ), 'autop.js' => array( 'dependencies' => array( @@ -61,7 +61,7 @@ 'wp-primitives', 'wp-url' ), - 'version' => '23207f52d0d266f6e1c4' + 'version' => '9170d925439ce315b76e' ), 'block-editor.js' => array( 'dependencies' => array( @@ -69,7 +69,6 @@ 'react-dom', 'react-jsx-runtime', 'wp-a11y', - 'wp-api-fetch', 'wp-blob', 'wp-block-serialization-default-parser', 'wp-blocks', @@ -100,7 +99,7 @@ 'wp-url', 'wp-warning' ), - 'version' => '2300d40abe29e438beda' + 'version' => '16b3af93a787b1379042' ), 'block-library.js' => array( 'dependencies' => array( @@ -142,7 +141,7 @@ 'import' => 'dynamic' ) ), - 'version' => '67d1a681ec0100a25d78' + 'version' => '166f13e705d1803deff1' ), 'block-serialization-default-parser.js' => array( 'dependencies' => array( @@ -175,7 +174,7 @@ 'wp-shortcode', 'wp-warning' ), - 'version' => 'ef38e42500165bfda301' + 'version' => '6ed3c03f430c8984d1e1' ), 'commands.js' => array( 'dependencies' => array( @@ -187,10 +186,11 @@ 'wp-element', 'wp-i18n', 'wp-keyboard-shortcuts', + 'wp-preferences', 'wp-primitives', 'wp-private-apis' ), - 'version' => 'e3d8bba53f4ffea4fcd2' + 'version' => '8b8663311faa33540c1b' ), 'components.js' => array( 'dependencies' => array( @@ -214,7 +214,7 @@ 'wp-rich-text', 'wp-warning' ), - 'version' => '2cbe9a66c53c614d7d6f' + 'version' => '97a7ddd1e1d999da982b' ), 'compose.js' => array( 'dependencies' => array( @@ -228,7 +228,7 @@ 'wp-priority-queue', 'wp-undo-manager' ), - 'version' => 'edb5a8c0b5bf71686403' + 'version' => '2b5a9d090a41c1120be7' ), 'core-commands.js' => array( 'dependencies' => array( @@ -266,7 +266,7 @@ 'wp-url', 'wp-warning' ), - 'version' => '4d15c0f82a9fb01a04ed' + 'version' => 'aa03be2be186820bbdd7' ), 'customize-widgets.js' => array( 'dependencies' => array( @@ -304,7 +304,7 @@ 'wp-private-apis', 'wp-redux-routine' ), - 'version' => 'dc7feb6ad8da53887680' + 'version' => '180953b1a59424bb6718' ), 'data-controls.js' => array( 'dependencies' => array( @@ -319,7 +319,7 @@ 'moment', 'wp-deprecated' ), - 'version' => 'c9f8e7dd3232716f34e9' + 'version' => '2faaf49020b2074de156' ), 'deprecated.js' => array( 'dependencies' => array( @@ -331,7 +331,7 @@ 'dependencies' => array( 'wp-deprecated' ), - 'version' => '66a6cf58e0c4cd128af0' + 'version' => '1acdd4ebd6969685a9d3' ), 'dom-ready.js' => array( 'dependencies' => array( @@ -381,7 +381,7 @@ 'import' => 'static' ) ), - 'version' => 'f84d20a8526b3463e9ff' + 'version' => '8f05f7e71e7a45e99ae5' ), 'edit-site.js' => array( 'dependencies' => array( @@ -409,6 +409,7 @@ 'wp-i18n', 'wp-keyboard-shortcuts', 'wp-keycodes', + 'wp-media-utils', 'wp-notices', 'wp-patterns', 'wp-plugins', @@ -420,7 +421,8 @@ 'wp-theme', 'wp-url', 'wp-warning', - 'wp-widgets' + 'wp-widgets', + 'wp-wordcount' ), 'module_dependencies' => array( array( @@ -428,7 +430,7 @@ 'import' => 'static' ) ), - 'version' => 'd36eb0c37b644e4cd4c8' + 'version' => 'a886b2b87319828b24e3' ), 'edit-widgets.js' => array( 'dependencies' => array( @@ -469,7 +471,7 @@ 'import' => 'static' ) ), - 'version' => '899c5ac5dcb94e19d378' + 'version' => 'd45dfe7a91d82507fb71' ), 'editor.js' => array( 'dependencies' => array( @@ -519,7 +521,7 @@ 'import' => 'static' ) ), - 'version' => '63782008412a6163c9f0' + 'version' => '823ed6e13dfb89c3f89d' ), 'element.js' => array( 'dependencies' => array( @@ -527,7 +529,7 @@ 'react-dom', 'wp-escape-html' ), - 'version' => '15ba804677f72a8db97b' + 'version' => '204b9776501c644953b6' ), 'escape-html.js' => array( 'dependencies' => array( @@ -575,7 +577,7 @@ 'dependencies' => array( 'wp-hooks' ), - 'version' => '781d11515ad3d91786ec' + 'version' => '125448662852c5e18937' ), 'is-shallow-equal.js' => array( 'dependencies' => array( @@ -608,7 +610,7 @@ 'wp-element', 'wp-i18n' ), - 'version' => '2e35ebd5dbaccb5a90c5' + 'version' => 'a44da9be02cdfef6e44d' ), 'media-utils.js' => array( 'dependencies' => array( @@ -628,13 +630,14 @@ 'wp-i18n', 'wp-keycodes', 'wp-notices', + 'wp-preferences', 'wp-primitives', 'wp-private-apis', 'wp-theme', 'wp-url', 'wp-warning' ), - 'version' => '85f1375ab5f23cd5d13c' + 'version' => '9750aae5171fb20e5c17' ), 'notices.js' => array( 'dependencies' => array( @@ -642,7 +645,7 @@ 'wp-components', 'wp-data' ), - 'version' => '218d0173a31ae7269246' + 'version' => '9182f940c250945fb2d4' ), 'nux.js' => array( 'dependencies' => array( @@ -675,7 +678,7 @@ 'wp-private-apis', 'wp-url' ), - 'version' => '4b640c092eb654d2bd78' + 'version' => '71e91fc63676088fcd47' ), 'plugins.js' => array( 'dependencies' => array( @@ -728,7 +731,7 @@ 'dependencies' => array( ), - 'version' => '835912f0086b9e59aed4' + 'version' => 'd33c33dda9790dfcae63' ), 'react-i18n.js' => array( 'dependencies' => array( @@ -758,7 +761,7 @@ 'wp-primitives', 'wp-url' ), - 'version' => 'c72d27a8ac4e33cb74d6' + 'version' => '21d86e46535b79d9afda' ), 'rich-text.js' => array( 'dependencies' => array( @@ -773,7 +776,7 @@ 'wp-keycodes', 'wp-private-apis' ), - 'version' => '16449e6108f48327f368' + 'version' => '1b3e411a54ef29d2bf7a' ), 'router.js' => array( 'dependencies' => array( @@ -809,7 +812,7 @@ 'dependencies' => array( ), - 'version' => 'faa37ce61b7ec8394b2a' + 'version' => 'c9d9033f75b117821889' ), 'sync.js' => array( 'dependencies' => array( @@ -817,7 +820,7 @@ 'wp-hooks', 'wp-private-apis' ), - 'version' => '8186bfbc15b827d261f5' + 'version' => '5ff90a11bbb5def86790' ), 'theme.js' => array( 'dependencies' => array( @@ -825,7 +828,7 @@ 'wp-element', 'wp-private-apis' ), - 'version' => 'e22ce547a4420507b323' + 'version' => 'abeb8783107aed891810' ), 'token-list.js' => array( 'dependencies' => array( @@ -853,21 +856,21 @@ 'module_dependencies' => array( ), - 'version' => 'd359c2cccf866d7082d2' + 'version' => 'e03397e1062511119cc5' ), 'url.js' => array( 'dependencies' => array( ), - 'version' => 'bb0f766c3d2efe497871' + 'version' => '9dd5f16a5ce37bf4ba2c' ), 'viewport.js' => array( 'dependencies' => array( - 'react-jsx-runtime', 'wp-compose', - 'wp-data' + 'wp-data', + 'wp-element' ), - 'version' => '8614025b8075d220d78f' + 'version' => '97845df4d1a7269c5c2b' ), 'warning.js' => array( 'dependencies' => array( diff --git a/src/wp-includes/assets/script-modules-packages.php b/src/wp-includes/assets/script-modules-packages.php index 534ce123add0f..72b36c121592d 100644 --- a/src/wp-includes/assets/script-modules-packages.php +++ b/src/wp-includes/assets/script-modules-packages.php @@ -34,7 +34,7 @@ 'import' => 'static' ) ), - 'version' => '2af01b43d30739c3fb8d' + 'version' => 'f77b871ece5a791f449e' ), 'block-library/file/view.js' => array( 'dependencies' => array( @@ -46,7 +46,7 @@ 'import' => 'static' ) ), - 'version' => '7d4d261d10dca47ebecb' + 'version' => 'a9114a756e418400594c' ), 'block-library/form/view.js' => array( 'dependencies' => array( @@ -88,7 +88,7 @@ 'import' => 'static' ) ), - 'version' => '99f747d731f80246db11' + 'version' => '1ecf748f10b95c76b349' ), 'block-library/query/view.js' => array( 'dependencies' => array( @@ -166,7 +166,7 @@ 'import' => 'static' ) ), - 'version' => '42d3f09bba14cce3054d' + 'version' => '570068c474110f2ff13f' ), 'connectors/index.js' => array( 'dependencies' => array( @@ -205,7 +205,7 @@ 'import' => 'static' ) ), - 'version' => 'e57f44d1a9f69e75d2d9' + 'version' => '1a0581e64b050d2d1474' ), 'interactivity/index.js' => array( 'dependencies' => array( @@ -273,7 +273,7 @@ 'wp-private-apis', 'wp-style-engine' ), - 'version' => '30ab62f45bfe9f971ea0' + 'version' => 'fe96a6ab10a4550153ab' ), 'route/index.js' => array( 'dependencies' => array( @@ -282,7 +282,7 @@ 'react-jsx-runtime', 'wp-private-apis' ), - 'version' => 'c5843b6c5e84b352f43b' + 'version' => '48a77bfa70722b4254e4' ), 'workflow/index.js' => array( 'dependencies' => array( @@ -303,6 +303,6 @@ 'import' => 'static' ) ), - 'version' => '13556bc597bbf2a8d620' + 'version' => '8d5b553b2fcab74a6606' ) ); \ No newline at end of file diff --git a/src/wp-includes/blocks/accordion-item.php b/src/wp-includes/blocks/accordion-item.php index a16a1426e346d..8530b34de12d8 100644 --- a/src/wp-includes/blocks/accordion-item.php +++ b/src/wp-includes/blocks/accordion-item.php @@ -39,7 +39,6 @@ function block_core_accordion_item_render( array $attributes, string $content ): if ( $p->next_tag( array( 'class_name' => 'wp-block-accordion-heading__toggle' ) ) ) { $p->set_attribute( 'data-wp-on--click', 'actions.toggle' ); - $p->set_attribute( 'data-wp-on--keydown', 'actions.handleKeyDown' ); $p->set_attribute( 'id', $unique_id ); $p->set_attribute( 'aria-controls', $unique_id . '-panel' ); $p->set_attribute( 'data-wp-bind--aria-expanded', 'state.isOpen' ); diff --git a/src/wp-includes/blocks/blocks-json.php b/src/wp-includes/blocks/blocks-json.php index e905b113502ac..12fb2a78b077a 100644 --- a/src/wp-includes/blocks/blocks-json.php +++ b/src/wp-includes/blocks/blocks-json.php @@ -759,9 +759,6 @@ ), 'gradient' => array( 'type' => 'string' - ), - 'width' => array( - 'type' => 'number' ) ), 'supports' => array( @@ -777,6 +774,15 @@ 'text' => true ) ), + 'dimensions' => array( + 'width' => true, + '__experimentalSkipSerialization' => array( + 'width' + ), + '__experimentalDefaultControls' => array( + 'width' => true + ) + ), 'typography' => array( '__experimentalSkipSerialization' => array( 'fontSize', @@ -851,6 +857,10 @@ 'root' => '.wp-block-button .wp-block-button__link', 'typography' => array( 'writingMode' => '.wp-block-button' + ), + 'dimensions' => array( + 'root' => '.wp-block-button', + 'width' => '.wp-block-button' ) ) ), @@ -2865,8 +2875,10 @@ 'background' => array( 'backgroundImage' => true, 'backgroundSize' => true, + 'gradient' => true, '__experimentalDefaultControls' => array( - 'backgroundImage' => true + 'backgroundImage' => true, + 'gradient' => true ) ), 'color' => array( @@ -3711,6 +3723,7 @@ ), 'supports' => array( 'anchor' => true, + 'html' => false, 'className' => false, 'splitting' => true, '__experimentalBorder' => array( @@ -4378,6 +4391,11 @@ 'clientNavigation' => true ) ), + 'selectors' => array( + 'states' => array( + '@current' => '.wp-block-navigation .current-menu-item' + ) + ), 'editorStyle' => 'wp-block-navigation-link-editor', 'style' => 'wp-block-navigation-link' ), @@ -5348,9 +5366,6 @@ 'type' => 'string', 'role' => 'content' ), - 'textAlign' => array( - 'type' => 'string' - ), 'format' => array( 'type' => 'string' ), @@ -5387,6 +5402,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, @@ -5423,9 +5439,6 @@ 'description' => 'Display the excerpt.', 'textdomain' => 'default', 'attributes' => array( - 'textAlign' => array( - 'type' => 'string' - ), 'moreText' => array( 'type' => 'string', 'role' => 'content' @@ -5466,6 +5479,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, 'textColumns' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, @@ -5624,9 +5638,6 @@ 'description' => 'Displays the next or previous post link that is adjacent to the current post.', 'textdomain' => 'default', 'attributes' => array( - 'textAlign' => array( - 'type' => 'string' - ), 'type' => array( 'type' => 'string', 'default' => 'next' @@ -5665,6 +5676,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, @@ -5922,9 +5934,6 @@ 'queryId' ), 'attributes' => array( - 'textAlign' => array( - 'type' => 'string' - ), 'level' => array( 'type' => 'number', 'default' => 2 @@ -5947,6 +5956,9 @@ 'type' => 'string', 'default' => '_self', 'role' => 'content' + ), + 'placeholder' => array( + 'type' => 'string' ) ), 'example' => array( @@ -5975,6 +5987,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalFontWeight' => true, '__experimentalFontStyle' => true, @@ -6523,9 +6536,6 @@ 'type' => array( 'type' => 'string' ), - 'textAlign' => array( - 'type' => 'string' - ), 'level' => array( 'type' => 'number', 'default' => 1 @@ -6571,6 +6581,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalFontStyle' => true, '__experimentalFontWeight' => true, @@ -6984,10 +6995,6 @@ 'default' => array( ) - ), - 'isSearchFieldHidden' => array( - 'type' => 'boolean', - 'default' => false ) ), 'supports' => array( @@ -7038,7 +7045,11 @@ 'html' => false ), 'editorStyle' => 'wp-block-search-editor', - 'style' => 'wp-block-search' + 'style' => 'wp-block-search', + 'selectors' => array( + 'color' => '.wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input', + 'border' => '.wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper' + ) ), 'separator' => array( '$schema' => 'https://schemas.wp.org/trunk/block.json', @@ -7224,9 +7235,6 @@ ), 'textdomain' => 'default', 'attributes' => array( - 'textAlign' => array( - 'type' => 'string' - ), 'level' => array( 'type' => 'number', 'default' => 0 @@ -7247,7 +7255,11 @@ 'example' => array( 'viewportWidth' => 350, 'attributes' => array( - 'textAlign' => 'center' + 'style' => array( + 'typography' => array( + 'textAlign' => 'center' + ) + ) ) ), 'supports' => array( @@ -7276,6 +7288,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, @@ -7325,9 +7338,6 @@ 6 ) ), - 'textAlign' => array( - 'type' => 'string' - ), 'isLink' => array( 'type' => 'boolean', 'default' => true, @@ -7369,6 +7379,7 @@ 'typography' => array( 'fontSize' => true, 'lineHeight' => true, + 'textAlign' => true, '__experimentalFontFamily' => true, '__experimentalTextTransform' => true, '__experimentalTextDecoration' => true, diff --git a/src/wp-includes/blocks/button.php b/src/wp-includes/blocks/button.php index 0d03440b1cb0f..8a7b43a2df315 100644 --- a/src/wp-includes/blocks/button.php +++ b/src/wp-includes/blocks/button.php @@ -60,6 +60,74 @@ function render_block_core_button( $attributes, $content ) { return ''; } + $width = $attributes['style']['dimensions']['width'] ?? null; + + if ( $width ) { + // Resolve preset references to their actual values. + $resolved_width = $width; + $is_preset = str_starts_with( $width, 'var:preset|dimension|' ); + + if ( $is_preset ) { + $slug = substr( $width, strlen( 'var:preset|dimension|' ) ); + $dimension_presets = wp_get_global_settings( + array( 'dimensions', 'dimensionSizes' ), + array( 'block_name' => 'core/button' ) + ); + + // Search origins in priority order: custom > theme > default. + if ( is_array( $dimension_presets ) ) { + foreach ( array( 'custom', 'theme', 'default' ) as $origin ) { + if ( empty( $dimension_presets[ $origin ] ) || ! is_array( $dimension_presets[ $origin ] ) ) { + continue; + } + foreach ( $dimension_presets[ $origin ] as $preset ) { + if ( isset( $preset['slug'] ) && $preset['slug'] === $slug ) { + $resolved_width = $preset['size'] ?? $width; + break 2; + } + } + } + } + } + + $is_percentage = str_ends_with( $resolved_width, '%' ); + + $processor = new WP_HTML_Tag_Processor( $content ); + // Target the outer wrapper div. + if ( $processor->next_tag( array( 'class_name' => 'wp-block-button' ) ) ) { + $processor->add_class( 'has-custom-width' ); + $existing_style = $processor->get_attribute( 'style' ); + $existing_style = is_string( $existing_style ) ? $existing_style : ''; + + if ( $is_percentage ) { + $numeric_width = (float) $resolved_width; + $processor->add_class( 'wp-block-button__width' ); + + // Maintain legacy class for the standard percentage widths. + $legacy_widths = array( + '25%' => 'wp-block-button__width-25', + '50%' => 'wp-block-button__width-50', + '75%' => 'wp-block-button__width-75', + '100%' => 'wp-block-button__width-100', + ); + if ( isset( $legacy_widths[ $resolved_width ] ) ) { + $processor->add_class( $legacy_widths[ $resolved_width ] ); + } + + $width_style = "--wp--block-button--width: $numeric_width;"; + $processor->set_attribute( 'style', $width_style . ( $existing_style ? ' ' . $existing_style : '' ) ); + } else { + $css_value = $is_preset + ? 'var(--wp--preset--dimension--' . _wp_to_kebab_case( $slug ) . ')' + : $width; + $width_style = "width: $css_value;"; + $processor->set_attribute( 'style', $width_style . ( $existing_style ? ' ' . $existing_style : '' ) ); + } + + $content = $processor->get_updated_html(); + } + } + return $content; } diff --git a/src/wp-includes/blocks/button/block.json b/src/wp-includes/blocks/button/block.json index 50ba4cda9c688..2e23a64c8f559 100644 --- a/src/wp-includes/blocks/button/block.json +++ b/src/wp-includes/blocks/button/block.json @@ -63,9 +63,6 @@ }, "gradient": { "type": "string" - }, - "width": { - "type": "number" } }, "supports": { @@ -81,6 +78,13 @@ "text": true } }, + "dimensions": { + "width": true, + "__experimentalSkipSerialization": [ "width" ], + "__experimentalDefaultControls": { + "width": true + } + }, "typography": { "__experimentalSkipSerialization": [ "fontSize", @@ -145,6 +149,10 @@ "root": ".wp-block-button .wp-block-button__link", "typography": { "writingMode": ".wp-block-button" + }, + "dimensions": { + "root": ".wp-block-button", + "width": ".wp-block-button" } } } diff --git a/src/wp-includes/blocks/cover.php b/src/wp-includes/blocks/cover.php index 8da5db23ddc3f..16533acacd764 100644 --- a/src/wp-includes/blocks/cover.php +++ b/src/wp-includes/blocks/cover.php @@ -39,13 +39,13 @@ function render_block_core_cover( $attributes, $content ) { $lower_src = strtolower( $iframe_src ); $provider = null; - if ( strpos( $lower_src, 'youtube.com' ) !== false || strpos( $lower_src, 'youtu.be' ) !== false ) { + if ( str_contains( $lower_src, 'youtube.com' ) || str_contains( $lower_src, 'youtu.be' ) ) { $provider = 'youtube'; - } elseif ( strpos( $lower_src, 'vimeo.com' ) !== false ) { + } elseif ( str_contains( $lower_src, 'vimeo.com' ) ) { $provider = 'vimeo'; - } elseif ( strpos( $lower_src, 'videopress.com' ) !== false ) { + } elseif ( str_contains( $lower_src, 'videopress.com' ) ) { $provider = 'videopress'; - } elseif ( strpos( $lower_src, 'wordpress.tv' ) !== false ) { + } elseif ( str_contains( $lower_src, 'wordpress.tv' ) ) { $provider = 'wordpress-tv'; } diff --git a/src/wp-includes/blocks/group/block.json b/src/wp-includes/blocks/group/block.json index e83fb60d31fc7..39792cec51295 100644 --- a/src/wp-includes/blocks/group/block.json +++ b/src/wp-includes/blocks/group/block.json @@ -28,8 +28,10 @@ "background": { "backgroundImage": true, "backgroundSize": true, + "gradient": true, "__experimentalDefaultControls": { - "backgroundImage": true + "backgroundImage": true, + "gradient": true } }, "color": { diff --git a/src/wp-includes/blocks/home-link.php b/src/wp-includes/blocks/home-link.php index d61aa0bc235e2..7ae02ed266f0b 100644 --- a/src/wp-includes/blocks/home-link.php +++ b/src/wp-includes/blocks/home-link.php @@ -5,6 +5,8 @@ * @package WordPress */ +require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php'; + /** * Build an array with CSS classes and inline styles defining the colors * which will be applied to the home link markup in the front-end. @@ -59,36 +61,6 @@ function block_core_home_link_build_css_colors( $context ) { return $colors; } -/** - * Build an array with CSS classes and inline styles defining the font sizes - * which will be applied to the home link markup in the front-end. - * - * @since 6.0.0 - * - * @param array $context Home link block context. - * @return array Font size CSS classes and inline styles. - */ -function block_core_home_link_build_css_font_sizes( $context ) { - // CSS classes. - $font_sizes = array( - 'css_classes' => array(), - 'inline_styles' => '', - ); - - $has_named_font_size = array_key_exists( 'fontSize', $context ); - $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); - - if ( $has_named_font_size ) { - // Add the font size class. - $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); - } elseif ( $has_custom_font_size ) { - // Add the custom font size inline style. - $font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] ); - } - - return $font_sizes; -} - /** * Builds an array with classes and style for the li wrapper * @@ -98,12 +70,21 @@ function block_core_home_link_build_css_font_sizes( $context ) { * @return string The li wrapper attributes. */ function block_core_home_link_build_li_wrapper_attributes( $context ) { - $colors = block_core_home_link_build_css_colors( $context ); - $font_sizes = block_core_home_link_build_css_font_sizes( $context ); - $classes = array_merge( + $colors = block_core_home_link_build_css_colors( $context ); + // The build system prefixes this function with "gutenberg_" to avoid + // collisions with the core version. Until this function is backported to + // core, we need to guard it's use and only call the prefixed name in + // the plugin. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $context ); + } else { + $font_sizes = block_core_shared_navigation_build_css_font_sizes( $context ); + } + $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'] ); + $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); $classes[] = 'wp-block-navigation-item'; diff --git a/src/wp-includes/blocks/icon.php b/src/wp-includes/blocks/icon.php index e09319cffea3b..1b7a27a147698 100644 --- a/src/wp-includes/blocks/icon.php +++ b/src/wp-includes/blocks/icon.php @@ -10,9 +10,7 @@ * * @since 7.0.0 * - * @param array $attributes The block attributes. - * @param string $content The block content. - * @param WP_Block $block The block instance. + * @param array $attributes The block attributes. * * @return string Returns the Icon. */ diff --git a/src/wp-includes/blocks/image.php b/src/wp-includes/blocks/image.php index 02b60f91c030a..22b0ecc2aea33 100644 --- a/src/wp-includes/blocks/image.php +++ b/src/wp-includes/blocks/image.php @@ -205,8 +205,8 @@ function block_core_image_render_lightbox( $block_content, $block, $block_instan array( 'defaultAriaLabel' => __( 'Enlarged image' ), 'closeButtonText' => esc_html__( 'Close' ), - 'prevButtonText' => esc_html__( 'Previous' ), - 'nextButtonText' => esc_html__( 'Next' ), + 'prevButtonText' => esc_html_x( 'Previous', 'previous image in lightbox' ), + 'nextButtonText' => esc_html_x( 'Next', 'next image in lightbox' ), ) ); @@ -323,8 +323,8 @@ class="lightbox-trigger" function block_core_image_print_lightbox_overlay() { $dialog_label = esc_attr__( 'Enlarged images' ); $close_button_text = esc_attr__( 'Close' ); - $prev_button_text = esc_attr__( 'Previous' ); - $next_button_text = esc_attr__( 'Next' ); + $prev_button_text = esc_attr_x( 'Previous', 'previous image in lightbox' ); + $next_button_text = esc_attr_x( 'Next', 'next image in lightbox' ); $close_button_icon = ''; $prev_button_icon = ''; $next_button_icon = ''; diff --git a/src/wp-includes/blocks/list-item/block.json b/src/wp-includes/blocks/list-item/block.json index 1cdba86f19b2e..cdefd6c232bf3 100644 --- a/src/wp-includes/blocks/list-item/block.json +++ b/src/wp-includes/blocks/list-item/block.json @@ -21,6 +21,7 @@ }, "supports": { "anchor": true, + "html": false, "className": false, "splitting": true, "__experimentalBorder": { diff --git a/src/wp-includes/blocks/loginout.php b/src/wp-includes/blocks/loginout.php index f83d8be424ece..a9e05f8630bfe 100644 --- a/src/wp-includes/blocks/loginout.php +++ b/src/wp-includes/blocks/loginout.php @@ -38,6 +38,19 @@ function render_block_core_loginout( $attributes ) { // Get the form. $contents = wp_login_form( array( 'echo' => false ) ); + + if ( wp_is_block_theme() ) { + $processor = new WP_HTML_Tag_Processor( $contents ); + + while ( $processor->next_tag( 'input' ) ) { + if ( 'submit' === $processor->get_attribute( 'type' ) && 'wp-submit' === $processor->get_attribute( 'name' ) ) { + $processor->add_class( 'wp-block-button__link' ); + $processor->add_class( wp_theme_get_element_class_name( 'button' ) ); + $contents = $processor->get_updated_html(); + break; + } + } + } } $wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) ); diff --git a/src/wp-includes/blocks/navigation-link.php b/src/wp-includes/blocks/navigation-link.php index 0888d7b5acebd..f92a2ff344e50 100644 --- a/src/wp-includes/blocks/navigation-link.php +++ b/src/wp-includes/blocks/navigation-link.php @@ -5,14 +5,9 @@ * @package WordPress */ -// Path differs between source and build: './shared/' in source, './navigation-link/shared/' in build. -if ( file_exists( __DIR__ . '/shared/item-should-render.php' ) ) { - require_once __DIR__ . '/shared/item-should-render.php'; - require_once __DIR__ . '/shared/render-submenu-icon.php'; -} else { - require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; - require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; -} +require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; +require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; +require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php'; /** * Build an array with CSS classes and inline styles defining the colors @@ -86,43 +81,6 @@ function block_core_navigation_link_build_css_colors( $context, $attributes, $is return $colors; } -/** - * Build an array with CSS classes and inline styles defining the font sizes - * which will be applied to the navigation markup in the front-end. - * - * @since 5.9.0 - * - * @param array $context Navigation block context. - * @return array Font size CSS classes and inline styles. - */ -function block_core_navigation_link_build_css_font_sizes( $context ) { - // CSS classes. - $font_sizes = array( - 'css_classes' => array(), - 'inline_styles' => '', - ); - - $has_named_font_size = array_key_exists( 'fontSize', $context ); - $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); - - if ( $has_named_font_size ) { - // Add the font size class. - $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); - } elseif ( $has_custom_font_size ) { - // Add the custom font size inline style. - $font_sizes['inline_styles'] = sprintf( - 'font-size: %s;', - wp_get_typography_font_size_value( - array( - 'size' => $context['style']['typography']['fontSize'], - ) - ) - ); - } - - return $font_sizes; -} - /** * Decodes a url if it's encoded, returning the same url if not. * @@ -180,7 +138,15 @@ function render_block_core_navigation_link( $attributes, $content, $block ) { return ''; } - $font_sizes = block_core_navigation_link_build_css_font_sizes( $block->context ); + // The build system prefixes this function with "gutenberg_" to avoid + // collisions with the core version. Until this function is backported to + // core, we need to guard its use and only call the prefixed name in + // the plugin. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $block->context ); + } else { + $font_sizes = block_core_shared_navigation_build_css_font_sizes( $block->context ); + } $classes = array_merge( $font_sizes['css_classes'] ); @@ -262,7 +228,13 @@ function render_block_core_navigation_link( $attributes, $content, $block ) { if ( isset( $block->context['showSubmenuIcon'] ) && $block->context['showSubmenuIcon'] && $has_submenu ) { // The submenu icon can be hidden by a CSS rule on the Navigation Block. - $html .= ''; + $html .= ''; } if ( $has_submenu ) { @@ -485,4 +457,4 @@ function register_block_core_navigation_link() { * Creates all variations for post types / taxonomies dynamically (= each time when variations are requested). * Do not use variation_callback, to also account for unregistering post types/taxonomies later on. */ -add_action( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 ); +add_filter( 'get_block_type_variations', 'block_core_navigation_link_filter_variations', 10, 2 ); diff --git a/src/wp-includes/blocks/navigation-link/block.json b/src/wp-includes/blocks/navigation-link/block.json index 997275574f1ac..0735461d0b29a 100644 --- a/src/wp-includes/blocks/navigation-link/block.json +++ b/src/wp-includes/blocks/navigation-link/block.json @@ -85,6 +85,11 @@ "clientNavigation": true } }, + "selectors": { + "states": { + "@current": ".wp-block-navigation .current-menu-item" + } + }, "editorStyle": "wp-block-navigation-link-editor", "style": "wp-block-navigation-link" } diff --git a/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php b/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php new file mode 100644 index 0000000000000..38fd82d12dac8 --- /dev/null +++ b/src/wp-includes/blocks/navigation-link/shared/build-css-font-sizes.php @@ -0,0 +1,43 @@ + array(), + 'inline_styles' => '', + ); + + $has_named_font_size = array_key_exists( 'fontSize', $context ); + $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); + + if ( $has_named_font_size ) { + // Add the font size class. + $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); + } elseif ( $has_custom_font_size ) { + // Add the custom font size inline style. + $font_sizes['inline_styles'] = sprintf( + 'font-size: %s;', + wp_get_typography_font_size_value( + array( + 'size' => $context['style']['typography']['fontSize'], + ) + ) + ); + } + + return $font_sizes; +} diff --git a/src/wp-includes/blocks/navigation-submenu.php b/src/wp-includes/blocks/navigation-submenu.php index 9138b5a5e08da..2677988707836 100644 --- a/src/wp-includes/blocks/navigation-submenu.php +++ b/src/wp-includes/blocks/navigation-submenu.php @@ -5,6 +5,10 @@ * @package WordPress */ +require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; +require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; +require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php'; + /** * Returns the submenu visibility value with backward compatibility * for the deprecated openSubmenusOnClick attribute. @@ -46,52 +50,6 @@ function block_core_navigation_submenu_get_submenu_visibility( $context ) { return $submenu_visibility ?? 'hover'; } -// Path differs between source and build: '../navigation-link/shared/' in source, './navigation-link/shared/' in build. -if ( file_exists( __DIR__ . '/../navigation-link/shared/item-should-render.php' ) ) { - require_once __DIR__ . '/../navigation-link/shared/item-should-render.php'; - require_once __DIR__ . '/../navigation-link/shared/render-submenu-icon.php'; -} else { - require_once __DIR__ . '/navigation-link/shared/item-should-render.php'; - require_once __DIR__ . '/navigation-link/shared/render-submenu-icon.php'; -} - -/** - * Build an array with CSS classes and inline styles defining the font sizes - * which will be applied to the navigation markup in the front-end. - * - * @since 5.9.0 - * - * @param array $context Navigation block context. - * @return array Font size CSS classes and inline styles. - */ -function block_core_navigation_submenu_build_css_font_sizes( $context ) { - // CSS classes. - $font_sizes = array( - 'css_classes' => array(), - 'inline_styles' => '', - ); - - $has_named_font_size = array_key_exists( 'fontSize', $context ); - $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); - - if ( $has_named_font_size ) { - // Add the font size class. - $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); - } elseif ( $has_custom_font_size ) { - // Add the custom font size inline style. - $font_sizes['inline_styles'] = sprintf( - 'font-size: %s;', - wp_get_typography_font_size_value( - array( - 'size' => $context['style']['typography']['fontSize'], - ) - ) - ); - } - - return $font_sizes; -} - /** * Renders the `core/navigation-submenu` block. * @@ -116,7 +74,15 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { return ''; } - $font_sizes = block_core_navigation_submenu_build_css_font_sizes( $block->context ); + // The build system prefixes this function with "gutenberg_" to avoid + // collisions with the core version. Until this function is backported to + // core, we need to guard its use and only call the prefixed name in + // the plugin. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $block->context ); + } else { + $font_sizes = block_core_shared_navigation_build_css_font_sizes( $block->context ); + } $style_attribute = $font_sizes['inline_styles']; // Render inner blocks first to check if any menu items will actually display. @@ -240,7 +206,13 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) { if ( $show_submenu_indicators && $has_submenu ) { // The submenu icon is rendered in a button here // so that there's a clickable element to open the submenu. - $html .= ''; + $html .= ''; } } else { $html .= ''; if ( $has_submenu ) { - $html .= ''; + $html .= ''; } } diff --git a/src/wp-includes/blocks/navigation.php b/src/wp-includes/blocks/navigation.php index 7863f80a9bdc4..8602373837009 100644 --- a/src/wp-includes/blocks/navigation.php +++ b/src/wp-includes/blocks/navigation.php @@ -1344,17 +1344,6 @@ function block_core_navigation_build_css_font_sizes( $attributes ) { return $font_sizes; } -/** - * Returns the top-level submenu SVG chevron icon. - * - * @since 5.9.0 - * - * @return string - */ -function block_core_navigation_render_submenu_icon() { - return ''; -} - /** * Filter out empty "null" blocks from the block list. * 'parse_blocks' includes a null block with '\n\n' as the content when diff --git a/src/wp-includes/blocks/page-list.php b/src/wp-includes/blocks/page-list.php index 27e63f250a811..685f79331784b 100644 --- a/src/wp-includes/blocks/page-list.php +++ b/src/wp-includes/blocks/page-list.php @@ -5,6 +5,8 @@ * @package WordPress */ +require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php'; + /** * Returns the submenu visibility value with backward compatibility * for the deprecated openSubmenusOnClick attribute. @@ -123,50 +125,12 @@ function block_core_page_list_build_css_colors( $attributes, $context ) { return $colors; } - -/** - * Build an array with CSS classes and inline styles defining the font sizes - * which will be applied to the pages markup in the front-end when it is a descendant of navigation. - * - * @since 5.8.0 - * - * @param array $context Navigation block context. - * @return array Font size CSS classes and inline styles. - */ -function block_core_page_list_build_css_font_sizes( $context ) { - // CSS classes. - $font_sizes = array( - 'css_classes' => array(), - 'inline_styles' => '', - ); - - $has_named_font_size = array_key_exists( 'fontSize', $context ); - $has_custom_font_size = isset( $context['style']['typography']['fontSize'] ); - - if ( $has_named_font_size ) { - // Add the font size class. - $font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] ); - } elseif ( $has_custom_font_size ) { - // Add the custom font size inline style. - $font_sizes['inline_styles'] = sprintf( - 'font-size: %s;', - wp_get_typography_font_size_value( - array( - 'size' => $context['style']['typography']['fontSize'], - ) - ) - ); - } - - return $font_sizes; -} - /** * Outputs Page list markup from an array of pages with nested children. * * @since 5.8.0 * - * @param boolean $open_submenus_on_click Whether to open submenus on click instead of hover. + * @param string $submenu_visibility The submenu visibility mode: 'hover', 'click', or 'always'. * @param boolean $show_submenu_icons Whether to show submenu indicator icons. * @param boolean $is_navigation_child If block is a child of Navigation block. * @param array $nested_pages The array of nested pages. @@ -342,12 +306,21 @@ function render_block_core_page_list( $attributes, $content, $block ) { } } - $colors = block_core_page_list_build_css_colors( $attributes, $block->context ); - $font_sizes = block_core_page_list_build_css_font_sizes( $block->context ); - $classes = array_merge( + $colors = block_core_page_list_build_css_colors( $attributes, $block->context ); + // The build system prefixes this function with "gutenberg_" to avoid + // collisions with the core version. Until this function is backported to + // core, we need to guard its use and only call the prefixed name in + // the plugin. + if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) { + $font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $block->context ); + } else { + $font_sizes = block_core_shared_navigation_build_css_font_sizes( $block->context ); + } + $classes = array_merge( $colors['css_classes'], $font_sizes['css_classes'] ); + $style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] ); $css_classes = trim( implode( ' ', $classes ) ); diff --git a/src/wp-includes/blocks/post-date/block.json b/src/wp-includes/blocks/post-date/block.json index 7952e36af3661..75eb1eda38d8f 100644 --- a/src/wp-includes/blocks/post-date/block.json +++ b/src/wp-includes/blocks/post-date/block.json @@ -11,9 +11,6 @@ "type": "string", "role": "content" }, - "textAlign": { - "type": "string" - }, "format": { "type": "string" }, @@ -46,6 +43,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, diff --git a/src/wp-includes/blocks/post-excerpt/block.json b/src/wp-includes/blocks/post-excerpt/block.json index 99f6d5dcc99ed..17678a35c2950 100644 --- a/src/wp-includes/blocks/post-excerpt/block.json +++ b/src/wp-includes/blocks/post-excerpt/block.json @@ -7,9 +7,6 @@ "description": "Display the excerpt.", "textdomain": "default", "attributes": { - "textAlign": { - "type": "string" - }, "moreText": { "type": "string", "role": "content" @@ -46,6 +43,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "textColumns": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, diff --git a/src/wp-includes/blocks/post-featured-image.php b/src/wp-includes/blocks/post-featured-image.php index e9fc60f7038f5..56cf9a66e4e03 100644 --- a/src/wp-includes/blocks/post-featured-image.php +++ b/src/wp-includes/blocks/post-featured-image.php @@ -166,10 +166,8 @@ function get_block_core_post_featured_image_overlay_element_markup( $attributes } // Apply overlay and gradient classes. - if ( $has_dim_background ) { - $class_names[] = 'has-background-dim'; - $class_names[] = "has-background-dim-{$attributes['dimRatio']}"; - } + $class_names[] = 'has-background-dim'; + $class_names[] = "has-background-dim-{$attributes['dimRatio']}"; if ( $has_solid_overlay ) { $class_names[] = "has-{$attributes['overlayColor']}-background-color"; diff --git a/src/wp-includes/blocks/post-navigation-link/block.json b/src/wp-includes/blocks/post-navigation-link/block.json index 6d51d619637c9..83cf63af7841b 100644 --- a/src/wp-includes/blocks/post-navigation-link/block.json +++ b/src/wp-includes/blocks/post-navigation-link/block.json @@ -7,9 +7,6 @@ "description": "Displays the next or previous post link that is adjacent to the current post.", "textdomain": "default", "attributes": { - "textAlign": { - "type": "string" - }, "type": { "type": "string", "default": "next" @@ -46,6 +43,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, diff --git a/src/wp-includes/blocks/post-title/block.json b/src/wp-includes/blocks/post-title/block.json index 1fb7efcf82db5..d1ded484486bd 100644 --- a/src/wp-includes/blocks/post-title/block.json +++ b/src/wp-includes/blocks/post-title/block.json @@ -8,9 +8,6 @@ "textdomain": "default", "usesContext": [ "postId", "postType", "queryId" ], "attributes": { - "textAlign": { - "type": "string" - }, "level": { "type": "number", "default": 2 @@ -33,6 +30,9 @@ "type": "string", "default": "_self", "role": "content" + }, + "placeholder": { + "type": "string" } }, "example": { @@ -58,6 +58,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalFontWeight": true, "__experimentalFontStyle": true, diff --git a/src/wp-includes/blocks/query-title.php b/src/wp-includes/blocks/query-title.php index d26a3d08ae42a..845a4bdc05aa7 100644 --- a/src/wp-includes/blocks/query-title.php +++ b/src/wp-includes/blocks/query-title.php @@ -13,7 +13,7 @@ * @since 5.8.0 * * @param array $attributes Block attributes. - * @param array $_content Block content. + * @param array $content Block content. * @param object $block Block instance. * * @return string Returns the query title based on the queried object. diff --git a/src/wp-includes/blocks/query-title/block.json b/src/wp-includes/blocks/query-title/block.json index 41e9e3fd29b62..786a46fe5cb1b 100644 --- a/src/wp-includes/blocks/query-title/block.json +++ b/src/wp-includes/blocks/query-title/block.json @@ -10,9 +10,6 @@ "type": { "type": "string" }, - "textAlign": { - "type": "string" - }, "level": { "type": "number", "default": 1 @@ -53,6 +50,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalFontStyle": true, "__experimentalFontWeight": true, diff --git a/src/wp-includes/blocks/search.php b/src/wp-includes/blocks/search.php index 7073d6ce8ab3f..07c051b8f6eb9 100644 --- a/src/wp-includes/blocks/search.php +++ b/src/wp-includes/blocks/search.php @@ -69,10 +69,13 @@ function render_block_core_search( $attributes ) { if ( ! empty( $typography_classes ) ) { $input_classes[] = $typography_classes; } + if ( ! $show_button && ! empty( $color_classes ) ) { + $input_classes[] = $color_classes; + } if ( $input->next_tag() ) { $input->add_class( implode( ' ', $input_classes ) ); $input->set_attribute( 'id', $input_id ); - $input->set_attribute( 'value', get_search_query() ); + $input->set_attribute( 'value', get_search_query( false ) ); $input->set_attribute( 'placeholder', $attributes['placeholder'] ); // If it's interactive, enqueue the script module and add the directives. @@ -430,20 +433,37 @@ function styles_for_block_core_search( $attributes ) { } } + $use_input_for_colors = ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition']; + // Add color styles. $has_text_color = ! empty( $attributes['style']['color']['text'] ); if ( $has_text_color ) { - $button_styles[] = sprintf( 'color: %s;', $attributes['style']['color']['text'] ); + $text_color_style = sprintf( 'color: %s;', $attributes['style']['color']['text'] ); + if ( $use_input_for_colors ) { + $input_styles[] = $text_color_style; + } else { + $button_styles[] = $text_color_style; + } } $has_background_color = ! empty( $attributes['style']['color']['background'] ); if ( $has_background_color ) { - $button_styles[] = sprintf( 'background-color: %s;', $attributes['style']['color']['background'] ); + $background_color_style = sprintf( 'background-color: %s;', $attributes['style']['color']['background'] ); + if ( $use_input_for_colors ) { + $input_styles[] = $background_color_style; + } else { + $button_styles[] = $background_color_style; + } } $has_custom_gradient = ! empty( $attributes['style']['color']['gradient'] ); if ( $has_custom_gradient ) { - $button_styles[] = sprintf( 'background: %s;', $attributes['style']['color']['gradient'] ); + $custom_gradient_style = sprintf( 'background: %s;', $attributes['style']['color']['gradient'] ); + if ( $use_input_for_colors ) { + $input_styles[] = $custom_gradient_style; + } else { + $button_styles[] = $custom_gradient_style; + } } // Get typography styles to be shared across inner elements. diff --git a/src/wp-includes/blocks/search/block.json b/src/wp-includes/blocks/search/block.json index a6146d4404041..be9c0e3cdc2d5 100644 --- a/src/wp-includes/blocks/search/block.json +++ b/src/wp-includes/blocks/search/block.json @@ -42,10 +42,6 @@ "query": { "type": "object", "default": {} - }, - "isSearchFieldHidden": { - "type": "boolean", - "default": false } }, "supports": { @@ -92,5 +88,9 @@ "html": false }, "editorStyle": "wp-block-search-editor", - "style": "wp-block-search" + "style": "wp-block-search", + "selectors": { + "color": ".wp-block-search .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input", + "border": ".wp-block-search.wp-block-search__button-outside .wp-block-search__input, .wp-block-search.wp-block-search__button-outside .wp-block-search__button, .wp-block-search.wp-block-search__no-button .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__input, .wp-block-search.wp-block-search__button-only .wp-block-search__button, .wp-block-search.wp-block-search__button-inside .wp-block-search__inside-wrapper" + } } diff --git a/src/wp-includes/blocks/site-tagline/block.json b/src/wp-includes/blocks/site-tagline/block.json index 756b2dcb8183a..1b2764d0cfa9a 100644 --- a/src/wp-includes/blocks/site-tagline/block.json +++ b/src/wp-includes/blocks/site-tagline/block.json @@ -8,9 +8,6 @@ "keywords": [ "description" ], "textdomain": "default", "attributes": { - "textAlign": { - "type": "string" - }, "level": { "type": "number", "default": 0 @@ -23,7 +20,11 @@ "example": { "viewportWidth": 350, "attributes": { - "textAlign": "center" + "style": { + "typography": { + "textAlign": "center" + } + } } }, "supports": { @@ -49,6 +50,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, diff --git a/src/wp-includes/blocks/site-title/block.json b/src/wp-includes/blocks/site-title/block.json index ac6a3c10e086a..0631de6560ba4 100644 --- a/src/wp-includes/blocks/site-title/block.json +++ b/src/wp-includes/blocks/site-title/block.json @@ -15,9 +15,6 @@ "type": "array", "default": [ 0, 1, 2, 3, 4, 5, 6 ] }, - "textAlign": { - "type": "string" - }, "isLink": { "type": "boolean", "default": true, @@ -56,6 +53,7 @@ "typography": { "fontSize": true, "lineHeight": true, + "textAlign": true, "__experimentalFontFamily": true, "__experimentalTextTransform": true, "__experimentalTextDecoration": true, diff --git a/src/wp-includes/build/constants.php b/src/wp-includes/build/constants.php index 37c81b5ccc21b..01b67a55a9851 100644 --- a/src/wp-includes/build/constants.php +++ b/src/wp-includes/build/constants.php @@ -9,6 +9,6 @@ */ return array( - 'version' => '22.6.0-rc.1', + 'version' => '22.9.0', 'build_url' => includes_url( 'build/' ), ); diff --git a/src/wp-includes/build/pages.php b/src/wp-includes/build/pages.php index 14ca6a08fbbc1..b8084ed2032f9 100644 --- a/src/wp-includes/build/pages.php +++ b/src/wp-includes/build/pages.php @@ -10,3 +10,5 @@ require_once __DIR__ . '/pages/font-library/page-wp-admin.php'; require_once __DIR__ . '/pages/options-connectors/page.php'; require_once __DIR__ . '/pages/options-connectors/page-wp-admin.php'; +require_once __DIR__ . '/pages/guidelines/page.php'; +require_once __DIR__ . '/pages/guidelines/page-wp-admin.php'; diff --git a/src/wp-includes/build/pages/guidelines/loader.js b/src/wp-includes/build/pages/guidelines/loader.js new file mode 100644 index 0000000000000..9f7e5db19d51d --- /dev/null +++ b/src/wp-includes/build/pages/guidelines/loader.js @@ -0,0 +1 @@ +// Empty module loader for page dependencies diff --git a/src/wp-includes/build/pages/guidelines/page-wp-admin.php b/src/wp-includes/build/pages/guidelines/page-wp-admin.php new file mode 100644 index 0000000000000..e044389e5f8ad --- /dev/null +++ b/src/wp-includes/build/pages/guidelines/page-wp-admin.php @@ -0,0 +1,279 @@ + $path ); + if ( ! empty( $content_module ) ) { + $route['content_module'] = $content_module; + } + if ( ! empty( $route_module ) ) { + $route['route_module'] = $route_module; + } + + $wp_guidelines_wp_admin_routes[] = $route; +} + +/** + * Register a menu item for the guidelines-wp-admin page. + * Note: Menu items are registered but not displayed in single-page mode. + * + * @param string $id Menu item ID. + * @param string $label Display label. + * @param string $to Route path to navigate to. + * @param string $parent_id Optional. Parent menu item ID. + */ +function wp_register_guidelines_wp_admin_menu_item( $id, $label, $to, $parent_id = '' ) { + global $wp_guidelines_wp_admin_menu_items; + + $menu_item = array( + 'id' => $id, + 'label' => $label, + 'to' => $to, + ); + + if ( ! empty( $parent_id ) ) { + $menu_item['parent'] = $parent_id; + } + + $wp_guidelines_wp_admin_menu_items[] = $menu_item; +} + +/** + * Get all registered routes for the guidelines-wp-admin page. + * + * @return array Array of route objects. + */ +function wp_get_guidelines_wp_admin_routes() { + global $wp_guidelines_wp_admin_routes; + return $wp_guidelines_wp_admin_routes ?? array(); +} + +/** + * Get all registered menu items for the guidelines-wp-admin page. + * + * @return array Array of menu item objects. + */ +function wp_get_guidelines_wp_admin_menu_items() { + global $wp_guidelines_wp_admin_menu_items; + return $wp_guidelines_wp_admin_menu_items ?? array(); +} + +/** + * Preload REST API data for the guidelines-wp-admin page. + * Automatically called during page rendering. + */ +function wp_guidelines_wp_admin_preload_data() { + // Define paths to preload - same for all pages + // Please also change packages/core-data/src/entities.js when changing this. + $preload_paths = array( + '/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,image_output_formats,jpeg_interlaced,png_interlaced,gif_interlaced,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', + array( '/wp/v2/settings', 'OPTIONS' ), + ); + + // Use rest_preload_api_request to gather the preloaded data + $preload_data = array_reduce( + $preload_paths, + 'rest_preload_api_request', + array() + ); + + // Register the preloading middleware with wp-api-fetch + wp_add_inline_script( + 'wp-api-fetch', + sprintf( + 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', + wp_json_encode( $preload_data ) + ), + 'after' + ); +} + +/** + * Enqueue scripts and styles for the guidelines-wp-admin page. + * Hooked to admin_enqueue_scripts. + * + * @param string $hook_suffix The current admin page. + */ +function wp_guidelines_wp_admin_enqueue_scripts( $hook_suffix ) { + // Check all possible ways this page can be accessed: + // 1. Menu page via admin.php?page=guidelines-wp-admin (plugin) + // 2. Direct file via guidelines.php (Core) - screen ID will be 'guidelines' + $current_screen = get_current_screen(); + $is_our_page = ( + ( isset( $_GET['page'] ) && 'guidelines-wp-admin' === $_GET['page'] ) || // phpcs:ignore WordPress.Security.NonceVerification.Recommended + ( $current_screen && 'guidelines' === $current_screen->id ) + ); + + if ( ! $is_our_page ) { + return; + } + + // Load build constants + $build_constants = require __DIR__ . '/../../constants.php'; + + // Fire init action for extensions to register routes and menu items + do_action( 'guidelines-wp-admin_init' ); + + // Preload REST API data + wp_guidelines_wp_admin_preload_data(); + + // Get all registered routes + $routes = wp_get_guidelines_wp_admin_routes(); + + // Get boot module asset file for dependencies + $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; + if ( file_exists( $asset_file ) ) { + $asset = require $asset_file; + + // This script serves two purposes: + // 1. It ensures all the globals that are made available to the modules are loaded. + // 2. It initializes the boot module as an inline script. + wp_register_script( 'guidelines-wp-admin-prerequisites', '', $asset['dependencies'], $asset['version'], true ); + + // Add inline script to initialize the app using initSinglePage (no menuItems) + wp_add_inline_script( + 'guidelines-wp-admin-prerequisites', + sprintf( + 'import("@wordpress/boot").then(mod => mod.initSinglePage({mountId: "%s", routes: %s}));', + 'guidelines-wp-admin-app', + wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ) + ) + ); + + // Register prerequisites style by filtering script dependencies to find registered styles + $style_dependencies = array_filter( + $asset['dependencies'], + function ( $handle ) { + return wp_style_is( $handle, 'registered' ); + } + ); + wp_register_style( 'guidelines-wp-admin-prerequisites', false, $style_dependencies, $asset['version'] ); + + // Build dependencies for guidelines-wp-admin module + $boot_dependencies = array( + array( + 'import' => 'static', + 'id' => '@wordpress/boot', + ), + ); + + // Add all registered routes as dependencies + foreach ( $routes as $route ) { + if ( isset( $route['route_module'] ) ) { + $boot_dependencies[] = array( + 'import' => 'static', + 'id' => $route['route_module'], + ); + } + if ( isset( $route['content_module'] ) ) { + $boot_dependencies[] = array( + 'import' => 'dynamic', + 'id' => $route['content_module'], + ); + } + } + + // Dummy script module to ensure dependencies are loaded + wp_register_script_module( + 'guidelines-wp-admin', + $build_constants['build_url'] . 'pages/guidelines/loader.js', + $boot_dependencies + ); + + // Enqueue the boot scripts and styles + wp_enqueue_script( 'guidelines-wp-admin-prerequisites' ); + wp_enqueue_script_module( 'guidelines-wp-admin' ); + wp_enqueue_style( 'guidelines-wp-admin-prerequisites' ); + } +} + +/** + * Render the guidelines-wp-admin page. + * Call this function from add_menu_page or add_submenu_page. + * This renders within the normal WordPress admin interface. + */ +function wp_guidelines_wp_admin_render_page() { + ?> + +
+ $path ); + if ( ! empty( $content_module ) ) { + $route['content_module'] = $content_module; + } + if ( ! empty( $route_module ) ) { + $route['route_module'] = $route_module; + } + + $wp_guidelines_routes[] = $route; +} + +/** + * Register a menu item for the guidelines page. + * + * @param string $id Menu item ID. + * @param string $label Display label. + * @param string $to Route path to navigate to. + * @param string $parent_id Optional. Parent menu item ID. + * @param string $parent_type Optional. Parent type: 'drilldown' or 'dropdown'. + */ +function wp_register_guidelines_menu_item( $id, $label, $to, $parent_id = '', $parent_type = '' ) { + global $wp_guidelines_menu_items; + + $menu_item = array( + 'id' => $id, + 'label' => $label, + 'to' => $to, + ); + + if ( ! empty( $parent_id ) ) { + $menu_item['parent'] = $parent_id; + } + + if ( ! empty( $parent_type ) && in_array( $parent_type, array( 'drilldown', 'dropdown' ), true ) ) { + $menu_item['parent_type'] = $parent_type; + } + + $wp_guidelines_menu_items[] = $menu_item; +} + +/** + * Get all registered routes for the guidelines page. + * + * @return array Array of route objects. + */ +function wp_get_guidelines_routes() { + global $wp_guidelines_routes; + return $wp_guidelines_routes ?? array(); +} + +/** + * Get all registered menu items for the guidelines page. + * + * @return array Array of menu item objects. + */ +function wp_get_guidelines_menu_items() { + global $wp_guidelines_menu_items; + return $wp_guidelines_menu_items ?? array(); +} + +/** + * Preload REST API data for the guidelines page. + * Automatically called during page rendering. + */ +function wp_guidelines_preload_data() { + // Define paths to preload - same for all pages + // Please also change packages/core-data/src/entities.js when changing this. + $preload_paths = array( + '/?_fields=description,gmt_offset,home,image_sizes,image_size_threshold,image_output_formats,jpeg_interlaced,png_interlaced,gif_interlaced,name,site_icon,site_icon_url,site_logo,timezone_string,url,page_for_posts,page_on_front,show_on_front', + array( '/wp/v2/settings', 'OPTIONS' ), + ); + + // Use rest_preload_api_request to gather the preloaded data + $preload_data = array_reduce( + $preload_paths, + 'rest_preload_api_request', + array() + ); + + // Register the preloading middleware with wp-api-fetch + wp_add_inline_script( + 'wp-api-fetch', + sprintf( + 'wp.apiFetch.use( wp.apiFetch.createPreloadingMiddleware( %s ) );', + wp_json_encode( $preload_data ) + ), + 'after' + ); +} + +/** + * Render the guidelines page. + * Call this function from add_menu_page or add_submenu_page. + */ +function wp_guidelines_render_page() { + // Load build constants + $build_constants = require __DIR__ . '/../../constants.php'; + + // Set current screen + set_current_screen(); + + // Remove unwanted deprecated handler + remove_action( 'admin_head', 'wp_admin_bar_header' ); + + // Remove unwanted scripts and styles that were enqueued during `admin_init` + foreach ( wp_scripts()->queue as $script ) { + wp_dequeue_script( $script ); + } + foreach ( wp_styles()->queue as $style ) { + wp_dequeue_style( $style ); + } + + // Fire init action for extensions to register routes and menu items + do_action( 'guidelines_init' ); + + // Enqueue command palette assets for boot-based pages + if ( function_exists( 'wp_enqueue_command_palette_assets' ) ) { + wp_enqueue_command_palette_assets(); + } + + // Preload REST API data + wp_guidelines_preload_data(); + + // Get all registered routes and menu items + $menu_items = wp_get_guidelines_menu_items(); + $routes = wp_get_guidelines_routes(); + + // Get boot module asset file for dependencies + $asset_file = ABSPATH . WPINC . '/js/dist/script-modules/boot/index.min.asset.php'; + if ( file_exists( $asset_file ) ) { + $asset = require $asset_file; + + // This script serves two purposes: + // 1. It ensures all the globals that are made available to the modules are loaded. + // 2. It initializes the boot module as an inline script. + wp_register_script( 'guidelines-prerequisites', '', $asset['dependencies'], $asset['version'], true ); + + // Add inline script to initialize the app + $init_modules = []; + wp_add_inline_script( + 'guidelines-prerequisites', + sprintf( + 'import("@wordpress/boot").then(mod => mod.init({mountId: "%s", menuItems: %s, routes: %s, initModules: %s, dashboardLink: "%s"}));', + 'guidelines-app', + wp_json_encode( $menu_items, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), + wp_json_encode( $routes, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), + wp_json_encode( $init_modules, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ), + esc_url( admin_url( '/' ) ) + ) + ); + + // Register prerequisites style by filtering script dependencies to find registered styles + $style_dependencies = array_filter( + $asset['dependencies'], + function ( $handle ) { + return wp_style_is( $handle, 'registered' ); + } + ); + wp_register_style( 'guidelines-prerequisites', false, $style_dependencies, $asset['version'] ); + + // Build dependencies for guidelines module + $boot_dependencies = array( + array( + 'import' => 'static', + 'id' => '@wordpress/boot', + ), + ); + + // Add init modules as static dependencies + // No init modules configured + + // Add all registered routes as dependencies + foreach ( $routes as $route ) { + if ( isset( $route['route_module'] ) ) { + $boot_dependencies[] = array( + 'import' => 'static', + 'id' => $route['route_module'], + ); + } + if ( isset( $route['content_module'] ) ) { + $boot_dependencies[] = array( + 'import' => 'dynamic', + 'id' => $route['content_module'], + ); + } + } + + // Dummy script module to ensure dependencies are loaded + wp_register_script_module( + 'guidelines', + $build_constants['build_url'] . 'pages/guidelines/loader.js', + $boot_dependencies + ); + + // Enqueue the boot scripts and styles + wp_enqueue_script( 'guidelines-prerequisites' ); + wp_enqueue_script_module( 'guidelines' ); + wp_enqueue_style( 'guidelines-prerequisites' ); + } + + // Output the HTML + ?> + + > + + + +=rt){N.write(P,rt),st-=rt;for(var Ft=0;Ft=rt;){if(lt=rt-st,dt.input_.read(P,st,lt) O.buffer.length){var lr=new Uint8Array(P+Mt);lr.set(O.buffer),O.buffer=lr}if(D=Me.input_end,Co=Me.is_uncompressed,Me.is_metadata){for(xe(pt);Mt>0;--Mt)pt.readMoreInput(),pt.readBits(8);continue}if(Mt!==0){if(Co){pt.bit_pos_=pt.bit_pos_+7&-8,At(O,Mt,P,q,lt,pt),P+=Mt;continue}for(B=0;B<3;++B)ge[B]=K(pt)+1,ge[B]>=2&&(et(ge[B]+2,Qt,B*H,pt),et(b,ee,B*H,pt),Ce[B]=ct(ee,B*H,pt),M[B]=1);for(pt.readMoreInput(),i=pt.readBits(2),U=W+(pt.readBits(4)<0;){var Nt,se,ie,Or,Ss,le,ye,Ge,Zr,Tr,Xr;for(pt.readMoreInput(),Ce[1]===0&&(St(ge[1],Qt,1,Ae,w,M,pt),Ce[1]=ct(ee,H,pt),Yt=Dt[1].htrees[Ae[1]]),--Ce[1],Nt=S(Dt[1].codes,Yt,pt),se=Nt>>6,se>=2?(se-=2,ye=-1):ye=0,ie=h.kInsertRangeLut[se]+(Nt>>3&7),Or=h.kCopyRangeLut[se]+(Nt&7),Ss=h.kInsertLengthPrefixCode[ie].offset+pt.readBits(h.kInsertLengthPrefixCode[ie].nbits),le=h.kCopyLengthPrefixCode[Or].offset+pt.readBits(h.kCopyLengthPrefixCode[Or].nbits),te=q[P-1<],Jt=q[P-2<],Tr=0;Tr 4?3:le-2)&255,It=F[ir+Zr],ye=S(Dt[2].codes,Dt[2].htrees[It],pt),ye>=U){var xs,Qn,Kr;ye-=U,Qn=ye&Pt,ye>>=i,xs=(ye>>1)+1,Kr=(2+(ye&1)< st)if(le>=f.minDictionaryWordLength&&le<=f.maxDictionaryWordLength){var Kr=f.offsetsByLength[le],$n=Ge-st-1,ta=f.sizeBitsByLength[le],qu=(1< >ta;if(Kr+=Zu*le,ea =Ft){O.write(q,wt);for(var Fo=0;Fo 0&&(Kt[he&3]=Ge,++he),le>Mt)throw new Error("Invalid backward reference. pos: "+P+" distance: "+Ge+" len: "+le+" bytes left: "+Mt);for(Tr=0;Tr >=1;return(d&h-1)+h}function f(d,g,h,v,_){do v-=h,d[g+v]=new n(_.bits,_.value);while(v>0)}function c(d,g,h){for(var v=1< 0;--y[x])k=new n(x&255,W[b++]&65535),f(d,g+T,Y,$,k),T=m(T,x);for(V=bt-1,I=-1,x=h+1,Y=2;x<=l;++x,Y<<=1)for(;y[x]>0;--y[x])(T&V)!==I&&(g+=$,H=c(y,x,h),$=1< >h),Y,$,k),T=m(T,x);return bt}},{}],8:[function(o,s,a){"use strict";a.byteLength=h,a.toByteArray=_,a.fromByteArray=x;for(var n=[],l=[],m=typeof Uint8Array<"u"?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,d=f.length;c 0)throw new Error("Invalid string. Length must be a multiple of 4");var Y=b.indexOf("=");Y===-1&&(Y=T);var I=Y===T?0:4-Y%4;return[Y,I]}function h(b){var T=g(b),Y=T[0],I=T[1];return(Y+I)*3/4-I}function v(b,T,Y){return(T+Y)*3/4-Y}function _(b){for(var T,Y=g(b),I=Y[0],V=Y[1],H=new m(v(b,I,V)),$=0,bt=V>0?I-4:I,W=0;W >16&255,H[$++]=T>>8&255,H[$++]=T&255;return V===2&&(T=l[b.charCodeAt(W)]<<2|l[b.charCodeAt(W+1)]>>4,H[$++]=T&255),V===1&&(T=l[b.charCodeAt(W)]<<10|l[b.charCodeAt(W+1)]<<4|l[b.charCodeAt(W+2)]>>2,H[$++]=T>>8&255,H[$++]=T&255),H}function A(b){return n[b>>18&63]+n[b>>12&63]+n[b>>6&63]+n[b&63]}function k(b,T,Y){for(var I,V=[],H=T;H bt?bt:$+H));return I===1?(T=b[Y-1],V.push(n[T>>2]+n[T<<4&63]+"==")):I===2&&(T=(b[Y-2]<<8)+b[Y-1],V.push(n[T>>10]+n[T>>4&63]+n[T<<2&63]+"=")),V.join("")}},{}],9:[function(o,s,a){function n(l,m){this.offset=l,this.nbits=m}a.kBlockLengthPrefixCode=[new n(1,2),new n(5,2),new n(9,2),new n(13,2),new n(17,3),new n(25,3),new n(33,3),new n(41,3),new n(49,4),new n(65,4),new n(81,4),new n(97,4),new n(113,5),new n(145,5),new n(177,5),new n(209,5),new n(241,6),new n(305,6),new n(369,7),new n(497,8),new n(753,9),new n(1265,10),new n(2289,11),new n(4337,12),new n(8433,13),new n(16625,24)],a.kInsertLengthPrefixCode=[new n(0,0),new n(1,0),new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,1),new n(8,1),new n(10,2),new n(14,2),new n(18,3),new n(26,3),new n(34,4),new n(50,4),new n(66,5),new n(98,5),new n(130,6),new n(194,7),new n(322,8),new n(578,9),new n(1090,10),new n(2114,12),new n(6210,14),new n(22594,24)],a.kCopyLengthPrefixCode=[new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,0),new n(7,0),new n(8,0),new n(9,0),new n(10,1),new n(12,1),new n(14,2),new n(18,2),new n(22,3),new n(30,3),new n(38,4),new n(54,4),new n(70,5),new n(102,5),new n(134,6),new n(198,7),new n(326,8),new n(582,9),new n(1094,10),new n(2118,24)],a.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],a.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},{}],10:[function(o,s,a){function n(m){this.buffer=m,this.pos=0}n.prototype.read=function(m,f,c){this.pos+c>this.buffer.length&&(c=this.buffer.length-this.pos);for(var d=0;d this.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(m.subarray(0,f),this.pos),this.pos+=f,f},a.BrotliOutput=l},{}],11:[function(o,s,a){var n=o("./dictionary"),l=0,m=1,f=2,c=3,d=4,g=5,h=6,v=7,_=8,A=9,k=10,x=11,b=12,T=13,Y=14,I=15,V=16,H=17,$=18,bt=19,W=20;function y(ot,K,gt){this.prefix=new Uint8Array(ot.length),this.transform=K,this.suffix=new Uint8Array(gt.length);for(var R=0;R '),new y("",l,` -`),new y("",c,""),new y("",l,"]"),new y("",l," for "),new y("",Y,""),new y("",f,""),new y("",l," a "),new y("",l," that "),new y(" ",k,""),new y("",l,". "),new y(".",l,""),new y(" ",l,", "),new y("",I,""),new y("",l," with "),new y("",l,"'"),new y("",l," from "),new y("",l," by "),new y("",V,""),new y("",H,""),new y(" the ",l,""),new y("",d,""),new y("",l,". The "),new y("",x,""),new y("",l," on "),new y("",l," as "),new y("",l," is "),new y("",v,""),new y("",m,"ing "),new y("",l,` - `),new y("",l,":"),new y(" ",l,". "),new y("",l,"ed "),new y("",W,""),new y("",$,""),new y("",h,""),new y("",l,"("),new y("",k,", "),new y("",_,""),new y("",l," at "),new y("",l,"ly "),new y(" the ",l," of "),new y("",g,""),new y("",A,""),new y(" ",k,", "),new y("",k,'"'),new y(".",l,"("),new y("",x," "),new y("",k,'">'),new y("",l,'="'),new y(" ",l,"."),new y(".com/",l,""),new y(" the ",l," of the "),new y("",k,"'"),new y("",l,". This "),new y("",l,","),new y(".",l," "),new y("",k,"("),new y("",k,"."),new y("",l," not "),new y(" ",l,'="'),new y("",l,"er "),new y(" ",x," "),new y("",l,"al "),new y(" ",x,""),new y("",l,"='"),new y("",x,'"'),new y("",k,". "),new y(" ",l,"("),new y("",l,"ful "),new y(" ",k,". "),new y("",l,"ive "),new y("",l,"less "),new y("",x,"'"),new y("",l,"est "),new y(" ",k,"."),new y("",x,'">'),new y(" ",l,"='"),new y("",k,","),new y("",l,"ize "),new y("",x,"."),new y("\xC2\xA0",l,""),new y(" ",l,","),new y("",k,'="'),new y("",x,'="'),new y("",l,"ous "),new y("",x,", "),new y("",k,"='"),new y(" ",k,","),new y(" ",x,'="'),new y(" ",x,", "),new y("",x,","),new y("",x,"("),new y("",x,". "),new y(" ",x,"."),new y("",x,"='"),new y(" ",x,". "),new y(" ",k,'="'),new y(" ",x,"='"),new y(" ",k,"='")];a.kTransforms=L,a.kNumTransforms=L.length;function it(ot,K){return ot[K]<192?(ot[K]>=97&&ot[K]<=122&&(ot[K]^=32),1):ot[K]<224?(ot[K+1]^=32,2):(ot[K+2]^=5,3)}a.transformDictionaryWord=function(ot,K,gt,R,S){var E=L[S].prefix,et=L[S].suffix,ct=L[S].transform,at=ctR&&(at=R);for(var J=0;J 0;){var St=it(ot,Ot);Ot+=St,R-=St}for(var At=0;At typeof ue<"u"?ue:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof ue<"u"?ue:e)[r]}):t)(function(t){if(typeof ue<"u")return ue.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Rl=(function(){var t,e,r;return(function(){function o(s,a,n){function l(c,d){if(!a[c]){if(!s[c]){var g=typeof os=="function"&&os;if(!d&&g)return g(c,!0);if(m)return m(c,!0);var h=new Error("Cannot find module '"+c+"'");throw h.code="MODULE_NOT_FOUND",h}var v=a[c]={exports:{}};s[c][0].call(v.exports,function(_){var A=s[c][1][_];return l(A||_)},v,v.exports,o,s,a,n)}return a[c].exports}for(var m=typeof os=="function"&&os,f=0;f =252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;f[254]=f[254]=1,a.string2buf=function(g){var h,v,_,A,k,x=g.length,b=0;for(A=0;A >>6,h[k++]=128|v&63):v<65536?(h[k++]=224|v>>>12,h[k++]=128|v>>>6&63,h[k++]=128|v&63):(h[k++]=240|v>>>18,h[k++]=128|v>>>12&63,h[k++]=128|v>>>6&63,h[k++]=128|v&63);return h};function d(g,h){if(h<65534&&(g.subarray&&m||!g.subarray&&l))return String.fromCharCode.apply(null,n.shrinkBuf(g,h));for(var v="",_=0;_ 4){b[_++]=65533,v+=k-1;continue}for(A&=k===2?31:k===3?15:7;k>1&&v 1){b[_++]=65533;continue}A<65536?b[_++]=A:(A-=65536,b[_++]=55296|A>>10&1023,b[_++]=56320|A&1023)}return d(b,_)},a.utf8border=function(g,h){var v;for(h=h||g.length,h>g.length&&(h=g.length),v=h-1;v>=0&&(g[v]&192)===128;)v--;return v<0||v===0?h:v+f[g[v]]>h?v:h}},{"./common":1}],3:[function(o,s,a){"use strict";function n(l,m,f,c){for(var d=l&65535|0,g=l>>>16&65535|0,h=0;f!==0;){h=f>2e3?2e3:f,f-=h;do d=d+m[c++]|0,g=g+d|0;while(--h);d%=65521,g%=65521}return d|g<<16|0}s.exports=n},{}],4:[function(o,s,a){"use strict";s.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(o,s,a){"use strict";function n(){for(var f,c=[],d=0;d<256;d++){f=d;for(var g=0;g<8;g++)f=f&1?3988292384^f>>>1:f>>>1;c[d]=f}return c}var l=n();function m(f,c,d,g){var h=l,v=g+d;f^=-1;for(var _=g;_ >>8^h[(f^c[_])&255];return f^-1}s.exports=m},{}],6:[function(o,s,a){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}s.exports=n},{}],7:[function(o,s,a){"use strict";var n=30,l=12;s.exports=function(f,c){var d,g,h,v,_,A,k,x,b,T,Y,I,V,H,$,bt,W,y,L,it,ot,K,gt,R,S;d=f.state,g=f.next_in,R=f.input,h=g+(f.avail_in-5),v=f.next_out,S=f.output,_=v-(c-f.avail_out),A=v+(f.avail_out-257),k=d.dmax,x=d.wsize,b=d.whave,T=d.wnext,Y=d.window,I=d.hold,V=d.bits,H=d.lencode,$=d.distcode,bt=(1< >>24,I>>>=L,V-=L,L=y>>>16&255,L===0)S[v++]=y&65535;else if(L&16){it=y&65535,L&=15,L&&(V >>=L,V-=L),V<15&&(I+=R[g++]< >>24,I>>>=L,V-=L,L=y>>>16&255,L&16){if(ot=y&65535,L&=15,V k){f.msg="invalid distance too far back",d.mode=n;break t}if(I>>>=L,V-=L,L=v-_,ot>L){if(L=ot-L,L>b&&d.sane){f.msg="invalid distance too far back",d.mode=n;break t}if(K=0,gt=Y,T===0){if(K+=x-L,L 2;)S[v++]=gt[K++],S[v++]=gt[K++],S[v++]=gt[K++],it-=3;it&&(S[v++]=gt[K++],it>1&&(S[v++]=gt[K++]))}else{K=v-ot;do S[v++]=S[K++],S[v++]=S[K++],S[v++]=S[K++],it-=3;while(it>2);it&&(S[v++]=S[K++],it>1&&(S[v++]=S[K++]))}}else if((L&64)===0){y=$[(y&65535)+(I&(1< >3,g-=it,V-=it<<3,I&=(1< >>24&255)+(w>>>8&65280)+((w&65280)<<8)+((w&255)<<24)}function Kt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function he(w){var M;return!w||!w.state?T:(M=w.state,w.total_in=w.total_out=M.total=0,w.msg="",M.wrap&&(w.adler=M.wrap&1),M.mode=$,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new n.Buf32(st),M.distcode=M.distdyn=new n.Buf32(wt),M.sane=1,M.back=-1,k)}function te(w){var M;return!w||!w.state?T:(M=w.state,M.wsize=0,M.whave=0,M.wnext=0,he(w))}function Jt(w,M){var i,U;return!w||!w.state||(U=w.state,M<0?(i=0,M=-M):(i=(M>>4)+1,M<48&&(M&=15)),M&&(M<8||M>15))?T:(U.window!==null&&U.wbits!==M&&(U.window=null),U.wrap=i,U.wbits=M,te(w))}function Dt(w,M){var i,U;return w?(U=new Kt,w.state=U,U.window=null,i=Jt(w,M),i!==k&&(w.state=null),i):T}function Qt(w){return Dt(w,q)}var ee=!0,pt,qr;function kr(w){if(ee){var M;for(pt=new n.Buf32(512),qr=new n.Buf32(32),M=0;M<144;)w.lens[M++]=8;for(;M<256;)w.lens[M++]=9;for(;M<280;)w.lens[M++]=7;for(;M<288;)w.lens[M++]=8;for(c(g,w.lens,0,288,pt,0,w.work,{bits:9}),M=0;M<32;)w.lens[M++]=5;c(h,w.lens,0,32,qr,0,w.work,{bits:5}),ee=!1}w.lencode=pt,w.lenbits=9,w.distcode=qr,w.distbits=5}function Mt(w,M,i,U){var Pt,G=w.state;return G.window===null&&(G.wsize=1< =G.wsize?(n.arraySet(G.window,M,i-G.wsize,G.wsize,0),G.wnext=0,G.whave=G.wsize):(Pt=G.wsize-G.wnext,Pt>U&&(Pt=U),n.arraySet(G.window,M,i-U,Pt,G.wnext),U-=Pt,U?(n.arraySet(G.window,M,i-U,U,0),G.wnext=U,G.whave=G.wsize):(G.wnext+=Pt,G.wnext===G.wsize&&(G.wnext=0),G.whave >>8&255,i.check=m(i.check,Nt,2,0),F=0,C=0,i.mode=bt;break}if(i.flags=0,i.head&&(i.head.done=!1),!(i.wrap&1)||(((F&255)<<8)+(F>>8))%31){w.msg="incorrect header check",i.mode=D;break}if((F&15)!==H){w.msg="unknown compression method",i.mode=D;break}if(F>>>=4,C-=4,Lt=(F&15)+8,i.wbits===0)i.wbits=Lt;else if(Lt>i.wbits){w.msg="invalid window size",i.mode=D;break}i.dmax=1< >8&1),i.flags&512&&(Nt[0]=F&255,Nt[1]=F>>>8&255,i.check=m(i.check,Nt,2,0)),F=0,C=0,i.mode=W;case W:for(;C<32;){if(j===0)break t;j--,F+=U[G++]< >>8&255,Nt[2]=F>>>16&255,Nt[3]=F>>>24&255,i.check=m(i.check,Nt,4,0)),F=0,C=0,i.mode=y;case y:for(;C<16;){if(j===0)break t;j--,F+=U[G++]< >8),i.flags&512&&(Nt[0]=F&255,Nt[1]=F>>>8&255,i.check=m(i.check,Nt,2,0)),F=0,C=0,i.mode=L;case L:if(i.flags&1024){for(;C<16;){if(j===0)break t;j--,F+=U[G++]< >>8&255,i.check=m(i.check,Nt,2,0)),F=0,C=0}else i.head&&(i.head.extra=null);i.mode=it;case it:if(i.flags&1024&&(Q=i.length,Q>j&&(Q=j),Q&&(i.head&&(Lt=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,U,G,Q,Lt)),i.flags&512&&(i.check=m(i.check,U,Q,G)),j-=Q,G+=Q,i.length-=Q),i.length))break t;i.length=0,i.mode=ot;case ot:if(i.flags&2048){if(j===0)break t;Q=0;do Lt=U[G+Q++],i.head&&Lt&&i.length<65536&&(i.head.name+=String.fromCharCode(Lt));while(Lt&&Q >9&1,i.head.done=!0),w.adler=i.check=0,i.mode=E;break;case R:for(;C<32;){if(j===0)break t;j--,F+=U[G++]< >>=C&7,C-=C&7,i.mode=O;break}for(;C<3;){if(j===0)break t;j--,F+=U[G++]< >>=1,C-=1,F&3){case 0:i.mode=ct;break;case 1:if(kr(i),i.mode=St,M===A){F>>>=2,C-=2;break t}break;case 2:i.mode=Wt;break;case 3:w.msg="invalid block type",i.mode=D}F>>>=2,C-=2;break;case ct:for(F>>>=C&7,C-=C&7;C<32;){if(j===0)break t;j--,F+=U[G++]< >>16^65535)){w.msg="invalid stored block lengths",i.mode=D;break}if(i.length=F&65535,F=0,C=0,i.mode=at,M===A)break t;case at:i.mode=Ct;case Ct:if(Q=i.length,Q){if(Q>j&&(Q=j),Q>Vt&&(Q=Vt),Q===0)break t;n.arraySet(Pt,U,G,Q,re),j-=Q,G+=Q,Vt-=Q,re+=Q,i.length-=Q;break}i.mode=E;break;case Wt:for(;C<14;){if(j===0)break t;j--,F+=U[G++]< >>=5,C-=5,i.ndist=(F&31)+1,F>>>=5,C-=5,i.ncode=(F&15)+4,F>>>=4,C-=4,i.nlen>286||i.ndist>30){w.msg="too many length or distance symbols",i.mode=D;break}i.have=0,i.mode=Ot;case Ot:for(;i.have >>=3,C-=3}for(;i.have<19;)i.lens[Or[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,se={bits:i.lenbits},oe=c(d,i.lens,0,19,i.lencode,0,i.work,se),i.lenbits=se.bits,oe){w.msg="invalid code lengths set",i.mode=D;break}i.have=0,i.mode=J;case J:for(;i.have >>24,Gt=It>>>16&255,jt=It&65535,!(xt<=C);){if(j===0)break t;j--,F+=U[G++]< >>=xt,C-=xt,i.lens[i.have++]=jt;else{if(jt===16){for(ie=xt+2;C >>=xt,C-=xt,i.have===0){w.msg="invalid bit length repeat",i.mode=D;break}Lt=i.lens[i.have-1],Q=3+(F&3),F>>>=2,C-=2}else if(jt===17){for(ie=xt+3;C >>=xt,C-=xt,Lt=0,Q=3+(F&7),F>>>=3,C-=3}else{for(ie=xt+7;C >>=xt,C-=xt,Lt=0,Q=11+(F&127),F>>>=7,C-=7}if(i.have+Q>i.nlen+i.ndist){w.msg="invalid bit length repeat",i.mode=D;break}for(;Q--;)i.lens[i.have++]=Lt}}if(i.mode===D)break;if(i.lens[256]===0){w.msg="invalid code -- missing end-of-block",i.mode=D;break}if(i.lenbits=9,se={bits:i.lenbits},oe=c(g,i.lens,0,i.nlen,i.lencode,0,i.work,se),i.lenbits=se.bits,oe){w.msg="invalid literal/lengths set",i.mode=D;break}if(i.distbits=6,i.distcode=i.distdyn,se={bits:i.distbits},oe=c(h,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,se),i.distbits=se.bits,oe){w.msg="invalid distances set",i.mode=D;break}if(i.mode=St,M===A)break t;case St:i.mode=At;case At:if(j>=6&&Vt>=258){w.next_out=re,w.avail_out=Vt,w.next_in=G,w.avail_in=j,i.hold=F,i.bits=C,f(w,Tt),re=w.next_out,Pt=w.output,Vt=w.avail_out,G=w.next_in,U=w.input,j=w.avail_in,F=i.hold,C=i.bits,i.mode===E&&(i.back=-1);break}for(i.back=0;It=i.lencode[F&(1< >>24,Gt=It>>>16&255,jt=It&65535,!(xt<=C);){if(j===0)break t;j--,F+=U[G++]< >Yt)],xt=It>>>24,Gt=It>>>16&255,jt=It&65535,!(Yt+xt<=C);){if(j===0)break t;j--,F+=U[G++]< >>=Yt,C-=Yt,i.back+=Yt}if(F>>>=xt,C-=xt,i.back+=xt,i.length=jt,Gt===0){i.mode=N;break}if(Gt&32){i.back=-1,i.mode=E;break}if(Gt&64){w.msg="invalid literal/length code",i.mode=D;break}i.extra=Gt&15,i.mode=xe;case xe:if(i.extra){for(ie=i.extra;C >>=i.extra,C-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=zt;case zt:for(;It=i.distcode[F&(1< >>24,Gt=It>>>16&255,jt=It&65535,!(xt<=C);){if(j===0)break t;j--,F+=U[G++]< >Yt)],xt=It>>>24,Gt=It>>>16&255,jt=It&65535,!(Yt+xt<=C);){if(j===0)break t;j--,F+=U[G++]< >>=Yt,C-=Yt,i.back+=Yt}if(F>>>=xt,C-=xt,i.back+=xt,Gt&64){w.msg="invalid distance code",i.mode=D;break}i.offset=jt,i.extra=Gt&15,i.mode=sr;case sr:if(i.extra){for(ie=i.extra;C >>=i.extra,C-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){w.msg="invalid distance too far back",i.mode=D;break}i.mode=Xe;case Xe:if(Vt===0)break t;if(Q=Tt-Vt,i.offset>Q){if(Q=i.offset-Q,Q>i.whave&&i.sane){w.msg="invalid distance too far back",i.mode=D;break}Q>i.wnext?(Q-=i.wnext,ar=i.wsize-Q):ar=i.wnext-Q,Q>i.length&&(Q=i.length),ir=i.window}else ir=Pt,ar=re-i.offset,Q=i.length;Q>Vt&&(Q=Vt),Vt-=Q,i.length-=Q;do Pt[re++]=ir[ar++];while(--Q);i.length===0&&(i.mode=At);break;case N:if(Vt===0)break t;Pt[re++]=i.length,Vt--,i.mode=At;break;case O:if(i.wrap){for(;C<32;){if(j===0)break t;j--,F|=U[G++]< =1&&At[it]===0;it--);if(ot>it&&(ot=it),it===0)return I[V++]=1<<24|64<<16|0,I[V++]=1<<24|64<<16|0,$.bits=1,0;for(L=1;L 0&&(x===c||it!==1))return-1;for(xe[1]=0,W=1;W m||x===g&&S>f)return 1;for(;;){Xe=W-gt,H[y] St?(N=zt[sr+H[y]],O=Ot[J+H[y]]):(N=96,O=0),et=1< >gt)+ct]=Xe<<24|N<<16|O|0;while(ct!==0);for(et=1< >=1;if(et!==0?(E&=et-1,E+=et):E=0,y++,--At[W]===0){if(W===it)break;W=b[T+H[y]]}if(W>ot&&(E&Ct)!==at){for(gt===0&&(gt=ot),Wt+=L,K=W-gt,R=1< m||x===g&&S>f)return 1;at=E&Ct,I[at]=ot<<24|K<<16|Wt-V|0}}return E!==0&&(I[Wt+E]=W-gt<<24|64<<16|0),$.bits=ot,0}},{"../utils/common":1}],10:[function(o,s,a){"use strict";s.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(o,s,a){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}s.exports=n},{}],"/lib/inflate.js":[function(o,s,a){"use strict";var n=o("./zlib/inflate"),l=o("./utils/common"),m=o("./utils/strings"),f=o("./zlib/constants"),c=o("./zlib/messages"),d=o("./zlib/zstream"),g=o("./zlib/gzheader"),h=Object.prototype.toString;function v(k){if(!(this instanceof v))return new v(k);this.options=l.assign({chunkSize:16384,windowBits:0,to:""},k||{});var x=this.options;x.raw&&x.windowBits>=0&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),x.windowBits>=0&&x.windowBits<16&&!(k&&k.windowBits)&&(x.windowBits+=32),x.windowBits>15&&x.windowBits<48&&(x.windowBits&15)===0&&(x.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var b=n.inflateInit2(this.strm,x.windowBits);if(b!==f.Z_OK)throw new Error(c[b]);if(this.header=new g,n.inflateGetHeader(this.strm,this.header),x.dictionary&&(typeof x.dictionary=="string"?x.dictionary=m.string2buf(x.dictionary):h.call(x.dictionary)==="[object ArrayBuffer]"&&(x.dictionary=new Uint8Array(x.dictionary)),x.raw&&(b=n.inflateSetDictionary(this.strm,x.dictionary),b!==f.Z_OK)))throw new Error(c[b])}v.prototype.push=function(k,x){var b=this.strm,T=this.options.chunkSize,Y=this.options.dictionary,I,V,H,$,bt,W=!1;if(this.ended)return!1;V=x===~~x?x:x===!0?f.Z_FINISH:f.Z_NO_FLUSH,typeof k=="string"?b.input=m.binstring2buf(k):h.call(k)==="[object ArrayBuffer]"?b.input=new Uint8Array(k):b.input=k,b.next_in=0,b.avail_in=b.input.length;do{if(b.avail_out===0&&(b.output=new l.Buf8(T),b.next_out=0,b.avail_out=T),I=n.inflate(b,f.Z_NO_FLUSH),I===f.Z_NEED_DICT&&Y&&(I=n.inflateSetDictionary(this.strm,Y)),I===f.Z_BUF_ERROR&&W===!0&&(I=f.Z_OK,W=!1),I!==f.Z_STREAM_END&&I!==f.Z_OK)return this.onEnd(I),this.ended=!0,!1;b.next_out&&(b.avail_out===0||I===f.Z_STREAM_END||b.avail_in===0&&(V===f.Z_FINISH||V===f.Z_SYNC_FLUSH))&&(this.options.to==="string"?(H=m.utf8border(b.output,b.next_out),$=b.next_out-H,bt=m.buf2string(b.output,H),b.next_out=$,b.avail_out=T-$,$&&l.arraySet(b.output,b.output,H,$,0),this.onData(bt)):this.onData(l.shrinkBuf(b.output,b.next_out))),b.avail_in===0&&b.avail_out===0&&(W=!0)}while((b.avail_in>0||b.avail_out===0)&&I!==f.Z_STREAM_END);return I===f.Z_STREAM_END&&(V=f.Z_FINISH),V===f.Z_FINISH?(I=n.inflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===f.Z_OK):(V===f.Z_SYNC_FLUSH&&(this.onEnd(f.Z_OK),b.avail_out=0),!0)},v.prototype.onData=function(k){this.chunks.push(k)},v.prototype.onEnd=function(k){k===f.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=k,this.msg=this.strm.msg};function _(k,x){var b=new v(x);if(b.push(k,!0),b.err)throw b.msg||c[b.err];return b.result}function A(k,x){return x=x||{},x.raw=!0,_(k,x)}a.Inflate=v,a.inflate=_,a.inflateRaw=A,a.ungzip=_},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")})();var nw=globalThis.fetch,ss=class{constructor(t,e={},r){this.type=t,this.detail=e,this.msg=r,Object.defineProperty(this,"__mayPropagate",{enumerable:!1,writable:!0}),this.__mayPropagate=!0}preventDefault(){}stopPropagation(){this.__mayPropagate=!1}valueOf(){return this}toString(){return this.msg?`[${this.type} event]: ${this.msg}`:`[${this.type} event]`}},Kc=class{constructor(){this.listeners={}}addEventListener(t,e,r){let o=this.listeners[t]||[];r?o.unshift(e):o.push(e),this.listeners[t]=o}removeEventListener(t,e){let r=this.listeners[t]||[],o=r.findIndex(s=>s===e);o>-1&&(r.splice(o,1),this.listeners[t]=r)}dispatch(t){let e=this.listeners[t.type];if(e)for(let r=0,o=e.length;r String.fromCharCode(e)).join("")}var $c=class{constructor(t,e,r){this.name=(r||t.tag||"").trim(),this.length=t.length,this.start=t.offset,this.offset=0,this.data=e,["getInt8","getUint8","getInt16","getUint16","getInt32","getUint32","getBigInt64","getBigUint64"].forEach(o=>{let s=o.replace(/get(Big)?/,"").toLowerCase(),a=parseInt(o.replace(/[^\d]/g,""))/8;Object.defineProperty(this,s,{get:()=>this.getValue(o,a)})})}get currentPosition(){return this.start+this.offset}set currentPosition(t){this.start=t,this.offset=0}skip(t=0,e=8){this.offset+=t*e/8}getValue(t,e){let r=this.start+this.offset;this.offset+=e;try{return this.data[t](r)}catch(o){throw console.error("parser",t,e,this),console.error("parser",this.start,this.offset),o}}flags(t){if(t===8||t===16||t===32||t===64)return this[`uint${t}`].toString(2).padStart(t,0).split("").map(e=>e==="1");console.error("Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long"),console.trace()}get tag(){let t=this.uint32;return Qc([t>>24&255,t>>16&255,t>>8&255,t&255])}get fixed(){let t=this.int16,e=Math.round(1e3*this.uint16/65356);return t+e/1e3}get legacyFixed(){let t=this.uint16,e=this.uint16.toString(16).padStart(4,0);return parseFloat(`${t}.${e}`)}get uint24(){return(this.uint8<<16)+(this.uint8<<8)+this.uint8}get uint128(){let t=0;for(let e=0;e<5;e++){let r=this.uint8;if(t=t*128+(r&127),r<128)break}return t}get longdatetime(){return new Date(Jc+1e3*parseInt(this.int64.toString()))}get fword(){return this.int16}get ufword(){return this.uint16}get Offset16(){return this.uint16}get Offset32(){return this.uint32}get F2DOT14(){let t=p.uint16,e=[0,1,-2,-1][t>>14],r=t&16383;return e+r/16384}verifyLength(){this.offset!=this.length&&console.error(`unexpected parsed table size (${this.offset}) for "${this.name}" (expected ${this.length})`)}readBytes(t=0,e=0,r=8,o=!1){if(t=t||this.length,t===0)return[];e&&(this.currentPosition=e);let s=`${o?"":"u"}int${r}`,a=[];for(;t--;)a.push(this[s]);return a}},Bt=class{constructor(t){Object.defineProperty(this,"parser",{enumerable:!1,get:()=>t});let r=t.currentPosition;Object.defineProperty(this,"start",{enumerable:!1,get:()=>r})}load(t){Object.keys(t).forEach(e=>{let r=Object.getOwnPropertyDescriptor(t,e);r.get?this[e]=r.get.bind(this):r.value!==void 0&&(this[e]=r.value)}),this.parser.length&&this.parser.verifyLength()}},mt=class extends Bt{constructor(t,e,r){let{parser:o,start:s}=super(new $c(t,e,r));Object.defineProperty(this,"p",{enumerable:!1,get:()=>o}),Object.defineProperty(this,"tableStart",{enumerable:!1,get:()=>s})}};function Z(t,e,r){let o;Object.defineProperty(t,e,{get:()=>o||(o=r(),o),enumerable:!0})}var td=class extends mt{constructor(t,e,r){let{p:o}=super({offset:0,length:12},e,"sfnt");this.version=o.uint32,this.numTables=o.uint16,this.searchRange=o.uint16,this.entrySelector=o.uint16,this.rangeShift=o.uint16,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(s=>new ed(o)),this.tables={},this.directory.forEach(s=>{let a=()=>r(this.tables,{tag:s.tag,offset:s.offset,length:s.length},e);Z(this.tables,s.tag.trim(),a)})}},ed=class{constructor(t){this.tag=t.tag,this.checksum=t.uint32,this.offset=t.uint32,this.length=t.uint32}},El=Rl.inflate||void 0,Il=void 0,rd=class extends mt{constructor(t,e,r){let{p:o}=super({offset:0,length:44},e,"woff");this.signature=o.tag,this.flavor=o.uint32,this.length=o.uint32,this.numTables=o.uint16,o.uint16,this.totalSfntSize=o.uint32,this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.metaOffset=o.uint32,this.metaLength=o.uint32,this.metaOrigLength=o.uint32,this.privOffset=o.uint32,this.privLength=o.uint32,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(s=>new od(o)),sd(this,e,r)}},od=class{constructor(t){this.tag=t.tag,this.offset=t.uint32,this.compLength=t.uint32,this.origLength=t.uint32,this.origChecksum=t.uint32}};function sd(t,e,r){t.tables={},t.directory.forEach(o=>{Z(t.tables,o.tag.trim(),()=>{let s=0,a=e;if(o.compLength!==o.origLength){let n=e.buffer.slice(o.offset,o.offset+o.compLength),l;if(El)l=El(new Uint8Array(n));else if(Il)l=Il(new Uint8Array(n));else{let m="no brotli decoder available to decode WOFF2 font";throw font.onerror&&font.onerror(m),new Error(m)}a=new DataView(l.buffer)}else s=o.offset;return r(t.tables,{tag:o.tag,offset:s,length:o.origLength},a)})})}var Ll=Al,Bl=void 0,nd=class extends mt{constructor(t,e,r){let{p:o}=super({offset:0,length:48},e,"woff2");this.signature=o.tag,this.flavor=o.uint32,this.length=o.uint32,this.numTables=o.uint16,o.uint16,this.totalSfntSize=o.uint32,this.totalCompressedSize=o.uint32,this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.metaOffset=o.uint32,this.metaLength=o.uint32,this.metaOrigLength=o.uint32,this.privOffset=o.uint32,this.privLength=o.uint32,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(l=>new ad(o));let s=o.currentPosition;this.directory[0].offset=0,this.directory.forEach((l,m)=>{let f=this.directory[m+1];f&&(f.offset=l.offset+(l.transformLength!==void 0?l.transformLength:l.origLength))});let a,n=e.buffer.slice(s);if(Ll)a=Ll(new Uint8Array(n));else if(Bl)a=new Uint8Array(Bl(n));else{let l="no brotli decoder available to decode WOFF2 font";throw t.onerror&&t.onerror(l),new Error(l)}id(this,a,r)}},ad=class{constructor(t){this.flags=t.uint8;let e=this.tagNumber=this.flags&63;e===63?this.tag=t.tag:this.tag=ld(e);let o=(this.transformVersion=(this.flags&192)>>6)!==0;(this.tag==="glyf"||this.tag==="loca")&&(o=this.transformVersion!==3),this.origLength=t.uint128,o&&(this.transformLength=t.uint128)}};function id(t,e,r){t.tables={},t.directory.forEach(o=>{Z(t.tables,o.tag.trim(),()=>{let s=o.offset,a=s+(o.transformLength?o.transformLength:o.origLength),n=new DataView(e.slice(s,a).buffer);try{return r(t.tables,{tag:o.tag,offset:0,length:o.origLength},n)}catch(l){console.error(l)}})})}function ld(t){return["cmap","head","hhea","hmtx","maxp","name","OS/2","post","cvt ","fpgm","glyf","loca","prep","CFF ","VORG","EBDT","EBLC","gasp","hdmx","kern","LTSH","PCLT","VDMX","vhea","vmtx","BASE","GDEF","GPOS","GSUB","EBSC","JSTF","MATH","CBDT","CBLC","COLR","CPAL","SVG ","sbix","acnt","avar","bdat","bloc","bsln","cvar","fdsc","feat","fmtx","fvar","gvar","hsty","just","lcar","mort","morx","opbd","prop","trak","Zapf","Silf","Glat","Gloc","Feat","Sill"][t&63]}var jl={},Ul=!1;Promise.all([Promise.resolve().then(function(){return Dd}),Promise.resolve().then(function(){return Nd}),Promise.resolve().then(function(){return Md}),Promise.resolve().then(function(){return Ud}),Promise.resolve().then(function(){return Wd}),Promise.resolve().then(function(){return Kd}),Promise.resolve().then(function(){return Qd}),Promise.resolve().then(function(){return tm}),Promise.resolve().then(function(){return fm}),Promise.resolve().then(function(){return Sm}),Promise.resolve().then(function(){return lp}),Promise.resolve().then(function(){return fp}),Promise.resolve().then(function(){return pp}),Promise.resolve().then(function(){return vp}),Promise.resolve().then(function(){return wp}),Promise.resolve().then(function(){return xp}),Promise.resolve().then(function(){return kp}),Promise.resolve().then(function(){return Tp}),Promise.resolve().then(function(){return Pp}),Promise.resolve().then(function(){return Rp}),Promise.resolve().then(function(){return Ip}),Promise.resolve().then(function(){return Bp}),Promise.resolve().then(function(){return Np}),Promise.resolve().then(function(){return Gp}),Promise.resolve().then(function(){return jp}),Promise.resolve().then(function(){return Hp}),Promise.resolve().then(function(){return Yp}),Promise.resolve().then(function(){return Zp}),Promise.resolve().then(function(){return Kp}),Promise.resolve().then(function(){return $p}),Promise.resolve().then(function(){return nh}),Promise.resolve().then(function(){return uh}),Promise.resolve().then(function(){return dh}),Promise.resolve().then(function(){return gh}),Promise.resolve().then(function(){return vh}),Promise.resolve().then(function(){return wh}),Promise.resolve().then(function(){return Ch}),Promise.resolve().then(function(){return kh}),Promise.resolve().then(function(){return Ah}),Promise.resolve().then(function(){return Eh}),Promise.resolve().then(function(){return Bh})]).then(t=>{t.forEach(e=>{let r=Object.keys(e)[0];jl[r]=e[r]}),Ul=!0});function ud(t,e,r){let o=e.tag.replace(/[^\w\d]/g,""),s=jl[o];return s?new s(e,r,t):(console.warn(`lib-font has no definition for ${o}. The table was skipped.`),{})}function fd(){let t=0;function e(r,o){if(!Ul)return t>10?o(new Error("loading took too long")):(t++,setTimeout(()=>e(r),250));r(ud)}return new Promise((r,o)=>e(r))}function cd(t,e){let r=t.lastIndexOf("."),o=(t.substring(r+1)||"").toLowerCase(),s={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"}[o];if(s)return s;let a={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.",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.",fon:"The .fon format is not supported: this is an ancient Windows bitmap font format.",ttc:"Based on the current CSS specification, font collections are not (yet?) supported."}[o];if(a||(a=`${t} is not a known webfont format.`),e)throw new Error(a);console.warn(`Could not load font: ${a}`)}async function dd(t,e,r={}){if(!globalThis.document)return;let o=cd(e,r.errorOnStyle);if(!o)return;let s=document.createElement("style");s.className="injected-by-Font-js";let a=[];return r.styleRules&&(a=Object.entries(r.styleRules).map(([n,l])=>`${n}: ${l};`)),s.textContent=` +var rf=Object.create;var sa=Object.defineProperty;var of=Object.getOwnPropertyDescriptor;var sf=Object.getOwnPropertyNames;var nf=Object.getPrototypeOf,af=Object.prototype.hasOwnProperty;var ce=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var lf=(t,e,r,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of sf(e))!af.call(t,s)&&s!==r&&sa(t,s,{get:()=>e[s],enumerable:!(o=of(e,s))||o.enumerable});return t};var u=(t,e,r)=>(r=t!=null?rf(nf(t)):{},lf(e||!t||!t.__esModule?sa(r,"default",{value:t,enumerable:!0}):r,t));var it=Ht((ly,na)=>{na.exports=window.wp.i18n});var X=Ht((uy,aa)=>{aa.exports=window.wp.components});var z=Ht((fy,ia)=>{ia.exports=window.ReactJSXRuntime});var vt=Ht((dy,ua)=>{ua.exports=window.wp.element});var Ar=Ht((hy,pa)=>{pa.exports=window.React});var Er=Ht((Yy,Ba)=>{Ba.exports=window.wp.primitives});var zs=Ht((lv,Va)=>{Va.exports=window.wp.privateApis});var mr=Ht((mv,Na)=>{Na.exports=window.wp.compose});var Wa=Ht((kv,Ha)=>{Ha.exports=window.wp.editor});var we=Ht((Ov,Ya)=>{Ya.exports=window.wp.coreData});var de=Ht((Tv,qa)=>{qa.exports=window.wp.data});var Ir=Ht((_v,Za)=>{Za.exports=window.wp.blocks});var ae=Ht((Pv,Xa)=>{Xa.exports=window.wp.blockEditor});var Ja=Ht((Bv,Ka)=>{Ka.exports=window.wp.styleEngine});var ri=Ht((qv,ei)=>{"use strict";ei.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var o,s,a;if(Array.isArray(e)){if(o=e.length,o!=r.length)return!1;for(s=o;s--!==0;)if(!t(e[s],r[s]))return!1;return!0}if(e instanceof Map&&r instanceof Map){if(e.size!==r.size)return!1;for(s of e.entries())if(!r.has(s[0]))return!1;for(s of e.entries())if(!t(s[1],r.get(s[0])))return!1;return!0}if(e instanceof Set&&r instanceof Set){if(e.size!==r.size)return!1;for(s of e.entries())if(!r.has(s[0]))return!1;return!0}if(ArrayBuffer.isView(e)&&ArrayBuffer.isView(r)){if(o=e.length,o!=r.length)return!1;for(s=o;s--!==0;)if(e[s]!==r[s])return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(a=Object.keys(e),o=a.length,o!==Object.keys(r).length)return!1;for(s=o;s--!==0;)if(!Object.prototype.hasOwnProperty.call(r,a[s]))return!1;for(s=o;s--!==0;){var n=a[s];if(!t(e[n],r[n]))return!1}return!0}return e!==e&&r!==r}});var ai=Ht((Xv,ni)=>{"use strict";var Mf=function(e){return Gf(e)&&!jf(e)};function Gf(t){return!!t&&typeof t=="object"}function jf(t){var e=Object.prototype.toString.call(t);return e==="[object RegExp]"||e==="[object Date]"||Wf(t)}var Uf=typeof Symbol=="function"&&Symbol.for,Hf=Uf?Symbol.for("react.element"):60103;function Wf(t){return t.$$typeof===Hf}function Yf(t){return Array.isArray(t)?[]:{}}function io(t,e){return e.clone!==!1&&e.isMergeableObject(t)?Br(Yf(t),t,e):t}function qf(t,e,r){return t.concat(e).map(function(o){return io(o,r)})}function Zf(t,e){if(!e.customMerge)return Br;var r=e.customMerge(t);return typeof r=="function"?r:Br}function Xf(t){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(t).filter(function(e){return Object.propertyIsEnumerable.call(t,e)}):[]}function oi(t){return Object.keys(t).concat(Xf(t))}function si(t,e){try{return e in t}catch{return!1}}function Kf(t,e){return si(t,e)&&!(Object.hasOwnProperty.call(t,e)&&Object.propertyIsEnumerable.call(t,e))}function Jf(t,e,r){var o={};return r.isMergeableObject(t)&&oi(t).forEach(function(s){o[s]=io(t[s],r)}),oi(e).forEach(function(s){Kf(t,s)||(si(t,s)&&r.isMergeableObject(e[s])?o[s]=Zf(s,r)(t[s],e[s],r):o[s]=io(e[s],r))}),o}function Br(t,e,r){r=r||{},r.arrayMerge=r.arrayMerge||qf,r.isMergeableObject=r.isMergeableObject||Mf,r.cloneUnlessOtherwiseSpecified=io;var o=Array.isArray(e),s=Array.isArray(t),a=o===s;return a?o?r.arrayMerge(t,e,r):Jf(t,e,r):io(e,r)}Br.all=function(e,r){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(o,s){return Br(o,s,r)},{})};var Qf=Br;ni.exports=Qf});var pn=Ht((ub,ol)=>{ol.exports=window.wp.keycodes});var ll=Ht((wb,il)=>{il.exports=window.wp.apiFetch});var Bu=Ht((UF,Lu)=>{Lu.exports=window.wp.date});function la(t){var e,r,o="";if(typeof t=="string"||typeof t=="number")o+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e (0,ca.jsx)(o,{ref:a,className:be("admin-ui-navigable-region",e),"aria-label":r,role:"region",tabIndex:"-1",...s,children:t}));da.displayName="NavigableRegion";var ma=da;var ga=u(Ar(),1),ha={};function Os(t,e){let r=ga.useRef(ha);return r.current===ha&&(r.current=t(e)),r}function ff(t,e){return function(o,...s){let a=new URL(t);return a.searchParams.set("code",o.toString()),s.forEach(n=>a.searchParams.append("args[]",n)),`${e} error #${o}; visit ${a} for the full message.`}}var cf=ff("https://base-ui.com/production-error","Base UI"),ya=cf;var fr=u(Ar(),1);function Ts(t,e,r,o){let s=Os(ba).current;return df(s,t,e,r,o)&&wa(s,[t,e,r,o]),s.callback}function va(t){let e=Os(ba).current;return mf(e,t)&&wa(e,t),e.callback}function ba(){return{callback:null,cleanup:null,refs:[]}}function df(t,e,r,o,s){return t.refs[0]!==e||t.refs[1]!==r||t.refs[2]!==o||t.refs[3]!==s}function mf(t,e){return t.refs.length!==e.length||t.refs.some((r,o)=>r!==e[o])}function wa(t,e){if(t.refs=e,e.every(r=>r==null)){t.callback=null;return}t.callback=r=>{if(t.cleanup&&(t.cleanup(),t.cleanup=null),r!=null){let o=Array(e.length).fill(null);for(let s=0;s{for(let s=0;s =t}function _s(t){if(!Ca.isValidElement(t))return null;let e=t,r=e.props;return(xa(19)?r?.ref:e.ref)??null}function to(t,e){if(t&&!e)return t;if(!t&&e)return e;if(t||e)return{...t,...e}}function Fa(t,e){let r={};for(let o in t){let s=t[o];if(e?.hasOwnProperty(o)){let a=e[o](s);a!=null&&Object.assign(r,a);continue}s===!0?r[`data-${o.toLowerCase()}`]="":s&&(r[`data-${o.toLowerCase()}`]=s.toString())}return r}function ka(t,e){return typeof t=="function"?t(e):t}function Oa(t,e){return typeof t=="function"?t(e):t}var Ps={};function ro(t,e,r,o,s){if(!r&&!o&&!s&&!t)return To(e);let a=To(t);return e&&(a=eo(a,e)),r&&(a=eo(a,r)),o&&(a=eo(a,o)),s&&(a=eo(a,s)),a}function Ta(t){if(t.length===0)return Ps;if(t.length===1)return To(t[0]);let e=To(t[0]);for(let r=1;r =65&&s<=90&&(typeof e=="function"||typeof e>"u")}function As(t){return typeof t=="function"}function Pa(t,e){return As(t)?t(e):t??Ps}function yf(t,e){return e?t?r=>{if(Ra(r)){let s=r;Ea(s);let a=e(s);return s.baseUIHandlerPrevented||t?.(s),a}let o=e(r);return t?.(r),o}:Aa(e):t}function Aa(t){return t&&(e=>(Ra(e)&&Ea(e),t(e)))}function Ea(t){return t.preventBaseUIHandler=()=>{t.baseUIHandlerPrevented=!0},t}function Es(t,e){return e?t?e+" "+t:e:t}function Ra(t){return t!=null&&typeof t=="object"&&"nativeEvent"in t}var vf=Object.freeze([]),ur=Object.freeze({});var bf="data-base-ui-swipe-ignore",wf="data-swipe-ignore",Ay=`[${bf}]`,Ey=`[${wf}]`;var Rs=u(Ar(),1);function Ia(t,e,r={}){let o=e.render,s=Sf(e,r);if(r.enabled===!1)return null;let a=r.state??ur;return Ff(t,o,s,a)}function Sf(t,e={}){let{className:r,style:o,render:s}=t,{state:a=ur,ref:n,props:l,stateAttributesMapping:h,enabled:f=!0}=e,c=f?ka(r,a):void 0,d=f?Oa(o,a):void 0,m=f?Fa(a,h):ur,g=f&&l?xf(l):void 0,y=f?to(m,g)??{}:ur;return typeof document<"u"&&(f?Array.isArray(n)?y.ref=va([y.ref,_s(s),...n]):y.ref=Ts(y.ref,_s(s),n):Ts(null,null)),f?(c!==void 0&&(y.className=Es(y.className,c)),d!==void 0&&(y.style=to(y.style,d)),y):ur}function xf(t){return Array.isArray(t)?Ta(t):ro(void 0,t)}var Cf=Symbol.for("react.lazy");function Ff(t,e,r,o){if(e){if(typeof e=="function")return e(r,o);let s=ro(r,e.props);s.ref=r.ref;let a=e;return a?.$$typeof===Cf&&(a=fr.Children.toArray(e)[0]),fr.cloneElement(a,s)}if(t&&typeof t=="string")return kf(t,r);throw new Error(ya(8))}function kf(t,e){return t==="button"?(0,Rs.createElement)("button",{type:"button",...e,key:e.key}):t==="img"?(0,Rs.createElement)("img",{alt:"",...e,key:e.key}):fr.createElement(t,e)}function La(t){return Ia(t.defaultTagName??"div",t,t)}var _o=u(vt(),1),oo=(0,_o.forwardRef)(({icon:t,size:e=24,...r},o)=>(0,_o.cloneElement)(t,{width:e,height:e,...r,ref:o}));var Po=u(Er(),1),Is=u(z(),1),cr=(0,Is.jsx)(Po.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Is.jsx)(Po.Path,{d:"M14.6 7l-1.2-1L8 12l5.4 6 1.2-1-4.6-5z"})});var Ao=u(Er(),1),Ls=u(z(),1),dr=(0,Ls.jsx)(Ao.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ls.jsx)(Ao.Path,{d:"M10.6 6L9.4 7l4.6 5-4.6 5 1.2 1 5.4-6z"})});var Eo=u(Er(),1),Bs=u(z(),1),Vs=(0,Bs.jsx)(Eo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Bs.jsx)(Eo.Path,{d:"M13 19h-2v-2h2v2zm0-6h-2v-2h2v2zm0-6h-2V5h2v2z"})});var Ro=u(Er(),1),Ds=u(z(),1),Io=(0,Ds.jsx)(Ro.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ds.jsx)(Ro.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"})});var Lo=u(Er(),1),Ns=u(z(),1),Bo=(0,Ns.jsx)(Lo.SVG,{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:(0,Ns.jsx)(Lo.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"})});var Da=u(vt(),1);if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='b51ff41489']")){let t=document.createElement("style");t.setAttribute("data-wp-hash","b51ff41489"),t.appendChild(document.createTextNode("@layer wp-ui-utilities, wp-ui-components, wp-ui-compositions, wp-ui-overrides;@layer wp-ui-components{._19ce0419607e1896__stack{display:flex}}")),document.head.appendChild(t)}var Of={stack:"_19ce0419607e1896__stack"},Tf={xs:"var(--wpds-dimension-gap-xs, 4px)",sm:"var(--wpds-dimension-gap-sm, 8px)",md:"var(--wpds-dimension-gap-md, 12px)",lg:"var(--wpds-dimension-gap-lg, 16px)",xl:"var(--wpds-dimension-gap-xl, 24px)","2xl":"var(--wpds-dimension-gap-2xl, 32px)","3xl":"var(--wpds-dimension-gap-3xl, 40px)"},Rr=(0,Da.forwardRef)(function({direction:e,gap:r,align:o,justify:s,wrap:a,render:n,...l},h){let f={gap:r&&Tf[r],alignItems:o,justifyContent:s,flexDirection:e,flexWrap:a};return La({render:n,ref:h,props:ro(l,{style:f,className:Of.stack})})});var za=u(X(),1),{Fill:Ma,Slot:Ga}=(0,za.createSlotFill)("SidebarToggle");var Re=u(z(),1);function ja({headingLevel:t=2,breadcrumbs:e,badges:r,title:o,subTitle:s,actions:a,showSidebarToggle:n=!0}){let l=`h${t}`;return(0,Re.jsxs)(Rr,{direction:"column",className:"admin-ui-page__header",render:(0,Re.jsx)("header",{}),children:[(0,Re.jsxs)(Rr,{direction:"row",justify:"space-between",gap:"sm",children:[(0,Re.jsxs)(Rr,{direction:"row",gap:"sm",align:"center",justify:"start",children:[n&&(0,Re.jsx)(Ga,{bubblesVirtually:!0,className:"admin-ui-page__sidebar-toggle-slot"}),o&&(0,Re.jsx)(l,{className:"admin-ui-page__header-title",children:o}),e,r]}),(0,Re.jsx)(Rr,{direction:"row",gap:"sm",style:{width:"auto",flexShrink:0},className:"admin-ui-page__header-actions",align:"center",children:a})]}),s&&(0,Re.jsx)("p",{className:"admin-ui-page__header-subtitle",children:s})]})}var so=u(z(),1);function Ua({headingLevel:t,breadcrumbs:e,badges:r,title:o,subTitle:s,children:a,className:n,actions:l,ariaLabel:h,hasPadding:f=!1,showSidebarToggle:c=!0}){let d=be("admin-ui-page",n);return(0,so.jsxs)(ma,{className:d,ariaLabel:h??(typeof o=="string"?o:""),children:[(o||e||r||l)&&(0,so.jsx)(ja,{headingLevel:t,breadcrumbs:e,badges:r,title:o,subTitle:s,actions:l,showSidebarToggle:c}),f?(0,so.jsx)("div",{className:"admin-ui-page__content has-padding",children:a}):a]})}Ua.SidebarToggleFill=Ma;var Ms=Ua;var Xr=u(it()),Ku=u(X()),Ju=u(Wa()),xs=u(we()),Qu=u(de()),$u=u(vt());var qu=u(X(),1),Zu=u(Ir(),1),Jg=u(de(),1),Qg=u(ae(),1),Xn=u(vt(),1),$g=u(mr(),1);function Lr(t,e,r){e=Array.isArray(e)?[...e]:[e],t=Array.isArray(t)?[...t]:{...t};let o=e.pop(),s=t;for(let a of e){let n=s[a];s=s[a]=Array.isArray(n)?[...n]:{...n}}return s[o]=r,t}var Se=(t,e,r)=>{let o=Array.isArray(e)?e:e.split("."),s=t;return o.forEach(a=>{s=s?.[a]}),s??r};var _f=["appearanceTools","useRootPaddingAwareAlignments","background.backgroundImage","background.backgroundRepeat","background.backgroundSize","background.backgroundPosition","background.gradient","border.color","border.radius","border.radiusSizes","border.style","border.width","shadow.presets","shadow.defaultPresets","color.background","color.button","color.caption","color.custom","color.customDuotone","color.customGradient","color.defaultDuotone","color.defaultGradients","color.defaultPalette","color.duotone","color.gradients","color.heading","color.link","color.palette","color.text","custom","dimensions.aspectRatio","dimensions.height","dimensions.minHeight","dimensions.width","dimensions.dimensionSizes","layout.contentSize","layout.definitions","layout.wideSize","lightbox.enabled","lightbox.allowEditing","position.fixed","position.sticky","spacing.customSpacingSize","spacing.defaultSpacingSizes","spacing.spacingSizes","spacing.spacingScale","spacing.blockGap","spacing.margin","spacing.padding","spacing.units","typography.fluid","typography.customFontSize","typography.defaultFontSizes","typography.dropCap","typography.fontFamilies","typography.fontSizes","typography.fontStyle","typography.fontWeight","typography.letterSpacing","typography.lineHeight","typography.textAlign","typography.textColumns","typography.textDecoration","typography.textIndent","typography.textTransform","typography.writingMode"];function Gs(t,e,r){let o=r?".blocks."+r:"",s=e?"."+e:"",a=`settings${o}${s}`,n=`settings${s}`;if(e)return Se(t,a)??Se(t,n);let l={};return _f.forEach(h=>{let f=Se(t,`settings${o}.${h}`)??Se(t,`settings.${h}`);f!==void 0&&(l=Lr(l,h.split("."),f))}),l}function js(t,e,r,o){let s=o?".blocks."+o:"",a=e?"."+e:"",n=`settings${s}${a}`;return Lr(t,n.split("."),r)}var Vf=u(Ja(),1);var Pf="1600px",Af="320px",Ef=1,Rf=.25,If=.75,Lf="14px";function Qa({minimumFontSize:t,maximumFontSize:e,fontSize:r,minimumViewportWidth:o=Af,maximumViewportWidth:s=Pf,scaleFactor:a=Ef,minimumFontSizeLimit:n}){if(n=Ie(n)?n:Lf,r){let b=Ie(r);if(!b?.unit||!b?.value)return null;let T=Ie(n,{coerceTo:b.unit});if(T?.value&&!t&&!e&&b?.value<=T?.value)return null;if(e||(e=`${b.value}${b.unit}`),!t){let Y=b.unit==="px"?b.value:b.value*16,I=Math.min(Math.max(1-.075*Math.log2(Y),Rf),If),D=no(b.value*I,3);T?.value&&D 0}function Bf(t){let e=t?.typography??{},r=t?.layout,o=Ie(r?.wideSize)?r?.wideSize:null;return Us(e)&&o?{fluid:{maxViewportWidth:o,...typeof e.fluid=="object"?e.fluid:{}}}:{fluid:e?.fluid}}function $a(t,e){let{size:r}=t;if(!r||r==="0"||t?.fluid===!1||!Us(e?.typography)&&!Us(t))return r;let o=Bf(e)?.fluid??{},s=Qa({minimumFontSize:typeof t?.fluid=="boolean"?void 0:t?.fluid?.min,maximumFontSize:typeof t?.fluid=="boolean"?void 0:t?.fluid?.max,fontSize:r,minimumFontSizeLimit:typeof o=="object"?o?.minFontSize:void 0,maximumViewportWidth:typeof o=="object"?o?.maxViewportWidth:void 0,minimumViewportWidth:typeof o=="object"?o?.minViewportWidth:void 0});return s||r}var Df=[{path:["color","palette"],valueKey:"color",cssVarInfix:"color",classes:[{classSuffix:"color",propertyName:"color"},{classSuffix:"background-color",propertyName:"background-color"},{classSuffix:"border-color",propertyName:"border-color"}]},{path:["color","gradients"],valueKey:"gradient",cssVarInfix:"gradient",classes:[{classSuffix:"gradient-background",propertyName:"background"}]},{path:["color","duotone"],valueKey:"colors",cssVarInfix:"duotone",valueFunc:({slug:t})=>`url( '#wp-duotone-${t}' )`,classes:[]},{path:["shadow","presets"],valueKey:"shadow",cssVarInfix:"shadow",classes:[]},{path:["typography","fontSizes"],valueFunc:(t,e)=>$a(t,e),valueKey:"size",cssVarInfix:"font-size",classes:[{classSuffix:"font-size",propertyName:"font-size"}]},{path:["typography","fontFamilies"],valueKey:"fontFamily",cssVarInfix:"font-family",classes:[{classSuffix:"font-family",propertyName:"font-family"}]},{path:["spacing","spacingSizes"],valueKey:"size",cssVarInfix:"spacing",valueFunc:({size:t})=>t,classes:[]},{path:["border","radiusSizes"],valueKey:"size",cssVarInfix:"border-radius",classes:[]},{path:["dimensions","dimensionSizes"],valueKey:"size",cssVarInfix:"dimension",classes:[]}];function ti(t,e,r=[],o="slug",s){let a=[e?Se(t,["blocks",e,...r]):void 0,Se(t,r)].filter(Boolean);for(let n of a)if(n){let l=["custom","theme","default"];for(let h of l){let f=n[h];if(f){let c=f.find(d=>d[o]===s);if(c)return o==="slug"||ti(t,e,r,"slug",c.slug)[o]===c[o]?c:void 0}}}}function Nf(t,e,r,[o,s]=[]){let a=Df.find(l=>l.cssVarInfix===o);if(!a||!t.settings)return r;let n=ti(t.settings,e,a.path,"slug",s);if(n){let{valueKey:l}=a,h=n[l];return Vo(t,e,h)}return r}function zf(t,e,r,o=[]){let s=(e?Se(t?.settings??{},["blocks",e,"custom",...o]):void 0)??Se(t?.settings??{},["custom",...o]);return s?Vo(t,e,s):r}function Vo(t,e,r){if(!r||typeof r!="string")if(typeof r=="object"&&r!==null&&"ref"in r&&typeof r.ref=="string"){let f=Se(t,r.ref);if(!f||typeof f=="object"&&"ref"in f)return f;r=f}else return r;let o="var:",s="var(--wp--",a=")",n;if(r.startsWith(o))n=r.slice(o.length).split("|");else if(r.startsWith(s)&&r.endsWith(a))n=r.slice(s.length,-a.length).split("--");else return r;let[l,...h]=n;return l==="preset"?Nf(t,e,r,h):l==="custom"?zf(t,e,r,h):r}function Do(t,e,r,o=!0){let s=e?"."+e:"",a=r?`styles.blocks.${r}${s}`:`styles${s}`;if(!t)return;let n=Se(t,a);return o?Vo(t,r,n):n}function Hs(t,e,r,o){let s=e?"."+e:"",a=o?`styles.blocks.${o}${s}`:`styles${s}`;return Lr(t,a.split("."),r)}var Ws=u(ri(),1);function ao(t,e){return typeof t!="object"||typeof e!="object"?t===e:(0,Ws.default)(t?.styles,e?.styles)&&(0,Ws.default)(t?.settings,e?.settings)}var ui=u(ai(),1);function ii(t){return Object.prototype.toString.call(t)==="[object Object]"}function li(t){var e,r;return ii(t)===!1?!1:(e=t.constructor,e===void 0?!0:(r=e.prototype,!(ii(r)===!1||r.hasOwnProperty("isPrototypeOf")===!1)))}function pr(t,e){return(0,ui.default)(t,e,{isMergeableObject:li,customMerge:r=>{if(r==="backgroundImage")return(o,s)=>s??o}})}var $f={grad:.9,turn:360,rad:360/(2*Math.PI)},Ue=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},Zt=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=Math.pow(10,e)),Math.round(r*t)/r+0},ke=function(t,e,r){return e===void 0&&(e=0),r===void 0&&(r=1),t>r?r:t>e?t:e},yi=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},fi=function(t){return{r:ke(t.r,0,255),g:ke(t.g,0,255),b:ke(t.b,0,255),a:ke(t.a)}},Ys=function(t){return{r:Zt(t.r),g:Zt(t.g),b:Zt(t.b),a:Zt(t.a,3)}},tc=/^#([0-9a-f]{3,8})$/i,No=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},vi=function(t){var e=t.r,r=t.g,o=t.b,s=t.a,a=Math.max(e,r,o),n=a-Math.min(e,r,o),l=n?a===e?(r-o)/n:a===r?2+(o-e)/n:4+(e-r)/n:0;return{h:60*(l<0?l+6:l),s:a?n/a*100:0,v:a/255*100,a:s}},bi=function(t){var e=t.h,r=t.s,o=t.v,s=t.a;e=e/360*6,r/=100,o/=100;var a=Math.floor(e),n=o*(1-r),l=o*(1-(e-a)*r),h=o*(1-(1-e+a)*r),f=a%6;return{r:255*[o,l,n,n,h,o][f],g:255*[h,o,o,l,n,n][f],b:255*[n,n,h,o,o,l][f],a:s}},ci=function(t){return{h:yi(t.h),s:ke(t.s,0,100),l:ke(t.l,0,100),a:ke(t.a)}},di=function(t){return{h:Zt(t.h),s:Zt(t.s),l:Zt(t.l),a:Zt(t.a,3)}},mi=function(t){return bi((r=(e=t).s,{h:e.h,s:(r*=((o=e.l)<50?o:100-o)/100)>0?2*r/(o+r)*100:0,v:o+r,a:e.a}));var e,r,o},lo=function(t){return{h:(e=vi(t)).h,s:(s=(200-(r=e.s))*(o=e.v)/100)>0&&s<200?r*o/100/(s<=100?s:200-s)*100:0,l:s/2,a:e.a};var e,r,o,s},ec=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,rc=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,oc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,sc=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Xs={string:[[function(t){var e=tc.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?Zt(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?Zt(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=oc.exec(t)||sc.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:fi({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=ec.exec(t)||rc.exec(t);if(!e)return null;var r,o,s=ci({h:(r=e[1],o=e[2],o===void 0&&(o="deg"),Number(r)*($f[o]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return mi(s)},"hsl"]],object:[[function(t){var e=t.r,r=t.g,o=t.b,s=t.a,a=s===void 0?1:s;return Ue(e)&&Ue(r)&&Ue(o)?fi({r:Number(e),g:Number(r),b:Number(o),a:Number(a)}):null},"rgb"],[function(t){var e=t.h,r=t.s,o=t.l,s=t.a,a=s===void 0?1:s;if(!Ue(e)||!Ue(r)||!Ue(o))return null;var n=ci({h:Number(e),s:Number(r),l:Number(o),a:Number(a)});return mi(n)},"hsl"],[function(t){var e=t.h,r=t.s,o=t.v,s=t.a,a=s===void 0?1:s;if(!Ue(e)||!Ue(r)||!Ue(o))return null;var n=(function(l){return{h:yi(l.h),s:ke(l.s,0,100),v:ke(l.v,0,100),a:ke(l.a)}})({h:Number(e),s:Number(r),v:Number(o),a:Number(a)});return bi(n)},"hsv"]]},pi=function(t,e){for(var r=0;r =.5},t.prototype.toHex=function(){return e=Ys(this.rgba),r=e.r,o=e.g,s=e.b,n=(a=e.a)<1?No(Zt(255*a)):"","#"+No(r)+No(o)+No(s)+n;var e,r,o,s,a,n},t.prototype.toRgb=function(){return Ys(this.rgba)},t.prototype.toRgbString=function(){return e=Ys(this.rgba),r=e.r,o=e.g,s=e.b,(a=e.a)<1?"rgba("+r+", "+o+", "+s+", "+a+")":"rgb("+r+", "+o+", "+s+")";var e,r,o,s,a},t.prototype.toHsl=function(){return di(lo(this.rgba))},t.prototype.toHslString=function(){return e=di(lo(this.rgba)),r=e.h,o=e.s,s=e.l,(a=e.a)<1?"hsla("+r+", "+o+"%, "+s+"%, "+a+")":"hsl("+r+", "+o+"%, "+s+"%)";var e,r,o,s,a},t.prototype.toHsv=function(){return e=vi(this.rgba),{h:Zt(e.h),s:Zt(e.s),v:Zt(e.v),a:Zt(e.a,3)};var e},t.prototype.invert=function(){return Le({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),Le(qs(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),Le(qs(this.rgba,-e))},t.prototype.grayscale=function(){return Le(qs(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),Le(hi(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),Le(hi(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?Le({r:(r=this.rgba).r,g:r.g,b:r.b,a:e}):Zt(this.rgba.a,3);var r},t.prototype.hue=function(e){var r=lo(this.rgba);return typeof e=="number"?Le({h:e,s:r.s,l:r.l,a:r.a}):Zt(r.h)},t.prototype.isEqual=function(e){return this.toHex()===Le(e).toHex()},t})(),Le=function(t){return t instanceof Ks?t:new Ks(t)},gi=[],wi=function(t){t.forEach(function(e){gi.indexOf(e)<0&&(e(Ks,Xs),gi.push(e))})};var Js=u(vt(),1);var Si=u(vt(),1),Kt=(0,Si.createContext)({user:{styles:{},settings:{}},base:{styles:{},settings:{}},merged:{styles:{},settings:{}},onChange:()=>{},fontLibraryEnabled:!1});var xi=u(z(),1);function uo({children:t,value:e,baseValue:r,onChange:o,fontLibraryEnabled:s}){let a=(0,Js.useMemo)(()=>pr(r,e),[r,e]),n=(0,Js.useMemo)(()=>({user:e,base:r,merged:a,onChange:o,fontLibraryEnabled:s}),[e,r,a,o,s]);return(0,xi.jsx)(Kt.Provider,{value:n,children:t})}var He=u(X(),1),Gi=u(it(),1);var bc=u(de(),1),wc=u(we(),1);var Ci=u(z(),1);function Qs({className:t,...e}){return(0,Ci.jsx)(oo,{className:be(t,"global-styles-ui-icon-with-current-color"),...e})}var Je=u(X(),1);var hr=u(z(),1);function ac({icon:t,children:e,...r}){return(0,hr.jsxs)(Je.__experimentalItem,{...r,children:[t&&(0,hr.jsxs)(Je.__experimentalHStack,{justify:"flex-start",children:[(0,hr.jsx)(Qs,{icon:t,size:24}),(0,hr.jsx)(Je.FlexItem,{children:e})]}),!t&&e]})}function Be(t){return(0,hr.jsx)(Je.Navigator.Button,{as:ac,...t})}var uc=u(X(),1);var fc=u(it(),1),Ai=u(ae(),1);var $s=function(t){var e=t/255;return e<.04045?e/12.92:Math.pow((e+.055)/1.055,2.4)},tn=function(t){return .2126*$s(t.r)+.7152*$s(t.g)+.0722*$s(t.b)};function Fi(t){t.prototype.luminance=function(){return e=tn(this.rgba),(r=2)===void 0&&(r=0),o===void 0&&(o=Math.pow(10,r)),Math.round(o*e)/o+0;var e,r,o},t.prototype.contrast=function(e){e===void 0&&(e="#FFF");var r,o,s,a,n,l,h,f=e instanceof t?e:new t(e);return a=this.rgba,n=f.toRgb(),l=tn(a),h=tn(n),r=l>h?(l+.05)/(h+.05):(h+.05)/(l+.05),(o=2)===void 0&&(o=0),s===void 0&&(s=Math.pow(10,o)),Math.floor(s*r)/s+0},t.prototype.isReadable=function(e,r){return e===void 0&&(e="#FFF"),r===void 0&&(r={}),this.contrast(e)>=(l=(n=(o=r).size)===void 0?"normal":n,(a=(s=o.level)===void 0?"AA":s)==="AAA"&&l==="normal"?7:a==="AA"&&l==="large"?3:4.5);var o,s,a,n,l}}var Ae=u(vt(),1),Ti=u(de(),1),_i=u(we(),1),rn=u(it(),1);var Wt=u(it(),1),v1={link:[{value:":link",label:(0,Wt.__)("Link")},{value:":any-link",label:(0,Wt.__)("Any Link")},{value:":visited",label:(0,Wt.__)("Visited")},{value:":hover",label:(0,Wt.__)("Hover")},{value:":focus",label:(0,Wt.__)("Focus")},{value:":focus-visible",label:(0,Wt.__)("Focus-visible")},{value:":active",label:(0,Wt.__)("Active")}],button:[{value:":link",label:(0,Wt.__)("Link")},{value:":any-link",label:(0,Wt.__)("Any Link")},{value:":visited",label:(0,Wt.__)("Visited")},{value:":hover",label:(0,Wt.__)("Hover")},{value:":focus",label:(0,Wt.__)("Focus")},{value:":focus-visible",label:(0,Wt.__)("Focus-visible")},{value:":active",label:(0,Wt.__)("Active")}]},b1={"core/button":[{value:":hover",label:(0,Wt.__)("Hover")},{value:":focus",label:(0,Wt.__)("Focus")},{value:":focus-visible",label:(0,Wt.__)("Focus-visible")},{value:":active",label:(0,Wt.__)("Active")}]};function en(t,e){if(!e?.length||typeof t!="object"||!t||!Object.keys(t).length)return t;for(let r in t)e.includes(r)?delete t[r]:typeof t[r]=="object"&&en(t[r],e);return t}var zo=(t,e)=>{if(!t||!e?.length)return{};let r={};return Object.keys(t).forEach(o=>{if(e.includes(o))r[o]=t[o];else if(typeof t[o]=="object"){let s=zo(t[o],e);Object.keys(s).length&&(r[o]=s)}}),r};function fo(t,e){let r=zo(structuredClone(t),e);return ao(r,t)}function ki(t,e){if(!Array.isArray(t)||!e)return null;let o=e.replace("var(","").replace(")","")?.split("--").slice(-1)[0];return t.find(s=>s.slug===o)}function Oi(t){let e=t?.settings?.typography?.fontFamilies?.theme,r=t?.settings?.typography?.fontFamilies?.custom,o=[];e&&r?o=[...e,...r]:e?o=e:r&&(o=r);let s=t?.styles?.typography?.fontFamily,a=ki(o,s),n=t?.styles?.elements?.heading?.typography?.fontFamily,l;return n?l=ki(o,t?.styles?.elements?.heading?.typography?.fontFamily):l=a,[a,l]}wi([Fi]);function kt(t,e,r="merged",o=!0,s){let{user:a,base:n,merged:l,onChange:h}=(0,Ae.useContext)(Kt),f=l;r==="base"?f=n:r==="user"&&(f=a);let c=(0,Ae.useMemo)(()=>{let m=Do(f,t,e,o);return s?m?.[s]??{}:m},[f,t,e,o,s]),d=(0,Ae.useCallback)(m=>{let g=m;s&&(g={...Do(a,t,e,!1),[s]:m});let y=Hs(a,t,g,e);h(y)},[a,h,t,e,s]);return[c,d]}function _t(t,e,r="merged"){let{user:o,base:s,merged:a,onChange:n}=(0,Ae.useContext)(Kt),l=a;r==="base"?l=s:r==="user"&&(l=o);let h=(0,Ae.useMemo)(()=>Gs(l,t,e),[l,t,e]),f=(0,Ae.useCallback)(c=>{let d=js(o,t,c,e);n(d)},[o,n,t,e]);return[h,f]}var ic=[];function lc({title:t,settings:e,styles:r}){return t===(0,rn.__)("Default")||Object.keys(e||{}).length>0||Object.keys(r||{}).length>0}function Mo(t=[]){let{variationsFromTheme:e}=(0,Ti.useSelect)(o=>({variationsFromTheme:o(_i.store).__experimentalGetCurrentThemeGlobalStylesVariations?.()||ic}),[]),{user:r}=(0,Ae.useContext)(Kt);return(0,Ae.useMemo)(()=>{let o=structuredClone(r),s=en(o,t);s.title=(0,rn.__)("Default");let a=e.filter(l=>fo(l,t)).map(l=>pr(s,l)),n=[s,...a];return n?.length?n.filter(lc):[]},[t,r,e])}var Pi=u(zs(),1),{lock:T1,unlock:yt}=(0,Pi.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/global-styles-ui");var on=u(z(),1),{useHasDimensionsPanel:R1,useHasTypographyPanel:I1,useHasColorPanel:L1,useSettingsForBlockElement:B1,useHasBackgroundPanel:V1}=yt(Ai.privateApis);var Ve=u(X(),1);function Vr(){let[t="black"]=kt("color.text"),[e="white"]=kt("color.background"),[r=t]=kt("elements.h1.color.text"),[o=r]=kt("elements.link.color.text"),[s=o]=kt("elements.button.color.background"),[a]=_t("color.palette.core")||[],[n]=_t("color.palette.theme")||[],[l]=_t("color.palette.custom")||[],h=(n??[]).concat(l??[]).concat(a??[]),f=h.filter(({color:m})=>m===t),c=h.filter(({color:m})=>m===s),d=f.concat(c).concat(h).filter(({color:m})=>m!==e).slice(0,2);return{paletteColors:h,highlightedColors:d}}var Ii=u(vt(),1),Li=u(X(),1),nn=u(it(),1);function cc(t,e){return e.length===0?null:(e.sort((r,o)=>Math.abs(t-r)-Math.abs(t-o)),e[0])}function dc(t){let e=[];return t.forEach(r=>{let o=String(r.fontWeight).split(" ");if(o.length===2){let s=parseInt(o[0]),a=parseInt(o[1]);for(let n=s;n<=a;n+=100)e.push(n)}else o.length===1&&e.push(parseInt(o[0]))}),e}function Ei(t){let e=/^(?!generic\([ a-zA-Z\-]+\)$)(?!^[a-zA-Z\-]+$).+/,r=t.trim(),o=s=>(s=s.trim(),s.match(e)?(s=s.replace(/^["']|["']$/g,""),`"${s}"`):s);return r.includes(",")?r.split(",").map(o).filter(s=>s!=="").join(", "):o(r)}function sn(t){if(!t)return"";let e=t.trim();return e.includes(",")&&(e=(e.split(",").find(r=>r.trim()!=="")??"").trim()),e=e.replace(/^["']|["']$/g,""),window.navigator.userAgent.toLowerCase().includes("firefox")&&(e=`"${e}"`),e}function Dr(t){let e={fontFamily:Ei(t.fontFamily)};if(!("fontFace"in t)||!Array.isArray(t.fontFace))return e.fontWeight="400",e.fontStyle="normal",e;if(t.fontFace){let r=t.fontFace.filter(o=>o?.fontStyle&&o.fontStyle.toLowerCase()==="normal");if(r.length>0){e.fontStyle="normal";let o=dc(r),s=cc(400,o);e.fontWeight=String(s)||"400"}else e.fontStyle=t.fontFace.length&&t.fontFace[0].fontStyle||"normal",e.fontWeight=t.fontFace.length&&String(t.fontFace[0].fontWeight)||"400"}return e}function Ri(t){return{fontFamily:Ei(t.fontFamily),fontStyle:t.fontStyle||"normal",fontWeight:t.fontWeight||"400"}}var co=u(z(),1);function Go({fontSize:t,variation:e}){let{base:r}=(0,Ii.useContext)(Kt),o=r;e&&(o={...r,...e});let[s]=kt("color.text"),[a,n]=Oi(o),l=a?Dr(a):{},h=n?Dr(n):{};return s&&(l.color=s,h.color=s),t&&(l.fontSize=t,h.fontSize=t),(0,co.jsxs)(Li.__unstableMotion.div,{animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:.3,type:"tween"},style:{textAlign:"center",lineHeight:1},children:[(0,co.jsx)("span",{style:h,children:(0,nn._x)("A","Uppercase letter A")}),(0,co.jsx)("span",{style:l,children:(0,nn._x)("a","Lowercase letter A")})]})}var Bi=u(X(),1);var Vi=u(z(),1);function Di({normalizedColorSwatchSize:t,ratio:e}){let{highlightedColors:r}=Vr(),o=t*e;return r.map(({slug:s,color:a},n)=>(0,Vi.jsx)(Bi.__unstableMotion.div,{style:{height:o,width:o,background:a,borderRadius:o/2},animate:{scale:1,opacity:1},initial:{scale:.1,opacity:0},transition:{delay:n===1?.2:.1}},`${s}-${n}`))}var Mi=u(X(),1),Nr=u(mr(),1),gr=u(vt(),1);var Qe=u(z(),1),Ni=248,zi=152,mc={leading:!0,trailing:!0};function pc({children:t,label:e,isFocused:r,withHoverView:o}){let[s="white"]=kt("color.background"),[a]=kt("color.gradient"),n=(0,Nr.useReducedMotion)(),[l,h]=(0,gr.useState)(!1),[f,{width:c}]=(0,Nr.useResizeObserver)(),[d,m]=(0,gr.useState)(c),[g,y]=(0,gr.useState)(),_=(0,Nr.useThrottle)(m,250,mc);(0,gr.useLayoutEffect)(()=>{c&&_(c)},[c,_]),(0,gr.useLayoutEffect)(()=>{let b=d?d/Ni:1,T=b-(g||0);(Math.abs(T)>.1||!g)&&y(b)},[d,g]);let A=c?c/Ni:1,k=g||A;return(0,Qe.jsxs)(Qe.Fragment,{children:[(0,Qe.jsx)("div",{style:{position:"relative"},children:f}),!!c&&(0,Qe.jsx)("div",{className:"global-styles-ui-preview__wrapper",style:{height:zi*k},onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),tabIndex:-1,children:(0,Qe.jsx)(Mi.__unstableMotion.div,{style:{height:zi*k,width:"100%",background:a??s,cursor:o?"pointer":void 0},initial:"start",animate:(l||r)&&!n&&e?"hover":"start",children:[].concat(t).map((b,T)=>b({ratio:k,key:T}))})})]})}var zr=pc;var me=u(z(),1),hc={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},gc={hover:{opacity:1},start:{opacity:.5}},yc={hover:{scale:1,opacity:1},start:{scale:0,opacity:0}};function vc({label:t,isFocused:e,withHoverView:r,variation:o}){let[s]=kt("typography.fontWeight"),[a="serif"]=kt("typography.fontFamily"),[n=a]=kt("elements.h1.typography.fontFamily"),[l=s]=kt("elements.h1.typography.fontWeight"),[h="black"]=kt("color.text"),[f=h]=kt("elements.h1.color.text"),{paletteColors:c}=Vr();return(0,me.jsxs)(zr,{label:t,isFocused:e,withHoverView:r,children:[({ratio:d,key:m})=>(0,me.jsx)(Ve.__unstableMotion.div,{variants:hc,style:{height:"100%",overflow:"hidden"},children:(0,me.jsxs)(Ve.__experimentalHStack,{spacing:10*d,justify:"center",style:{height:"100%",overflow:"hidden"},children:[(0,me.jsx)(Go,{fontSize:65*d,variation:o}),(0,me.jsx)(Ve.__experimentalVStack,{spacing:4*d,children:(0,me.jsx)(Di,{normalizedColorSwatchSize:32,ratio:d})})]})},m),({key:d})=>(0,me.jsx)(Ve.__unstableMotion.div,{variants:r?gc:void 0,style:{height:"100%",width:"100%",position:"absolute",top:0,overflow:"hidden",filter:"blur(60px)",opacity:.1},children:(0,me.jsx)(Ve.__experimentalHStack,{spacing:0,justify:"flex-start",style:{height:"100%",overflow:"hidden"},children:c.slice(0,4).map(({color:m},g)=>(0,me.jsx)("div",{style:{height:"100%",background:m,flexGrow:1}},g))})},d),({ratio:d,key:m})=>(0,me.jsx)(Ve.__unstableMotion.div,{variants:yc,style:{height:"100%",width:"100%",overflow:"hidden",position:"absolute",top:0},children:(0,me.jsx)(Ve.__experimentalVStack,{spacing:3*d,justify:"center",style:{height:"100%",overflow:"hidden",padding:10*d,boxSizing:"border-box"},children:t&&(0,me.jsx)("div",{style:{fontSize:40*d,fontFamily:n,color:f,fontWeight:l,lineHeight:"1em",textAlign:"center"},children:t})})},m)]})}var an=vc;var ji=u(z(),1);var un=u(Ir(),1),Mr=u(it(),1),vr=u(X(),1),fn=u(de(),1),$e=u(vt(),1),jo=u(ae(),1),Zi=u(mr(),1);import{speak as Fc}from"@wordpress/a11y";var Ui=u(Ir(),1),Hi=u(de(),1),Sc=u(X(),1);var xc=u(z(),1);function Cc(t,e){return t?.filter(r=>r.source==="block"||e.includes(r.name))||[]}function ln(t){let e=(0,Hi.useSelect)(s=>{let{getBlockStyles:a}=s(Ui.store);return a(t)},[t]),[r]=kt("variations",t),o=Object.keys(r??{});return Cc(e,o)}var yr=u(X(),1),Wi=u(it(),1);var Yi=u(ae(),1);var qi=u(z(),1),{StateControl:d0}=yt(Yi.privateApis);var De=u(z(),1),{useHasDimensionsPanel:kc,useHasTypographyPanel:Oc,useHasBorderPanel:Tc,useSettingsForBlockElement:_c,useHasColorPanel:Pc}=yt(jo.privateApis);function Ac(){let t=(0,fn.useSelect)(s=>s(un.store).getBlockTypes(),[]),e=(s,a)=>{let{core:n,noncore:l}=s;return(a.name.startsWith("core/")?n:l).push(a),s},{core:r,noncore:o}=t.reduce(e,{core:[],noncore:[]});return[...r,...o]}function Ec(t){let[e]=_t("",t),r=_c(e,t),o=Oc(r),s=Pc(r),a=Tc(r),n=kc(r),l=a||n,h=!!ln(t)?.length;return o||s||l||h}function Rc({block:t}){return Ec(t.name)?(0,De.jsx)(Be,{path:"/blocks/"+encodeURIComponent(t.name),children:(0,De.jsxs)(vr.__experimentalHStack,{justify:"flex-start",children:[(0,De.jsx)(jo.BlockIcon,{icon:t.icon}),(0,De.jsx)(vr.FlexItem,{children:t.title})]})}):null}function Ic({filterValue:t}){let e=Ac(),r=(0,Zi.useDebounce)(Fc,500),{isMatchingSearchTerm:o}=(0,fn.useSelect)(un.store),s=t?e.filter(n=>o(n,t)):e,a=(0,$e.useRef)(null);return(0,$e.useEffect)(()=>{if(!t)return;let n=a.current?.childElementCount||0,l=(0,Mr.sprintf)((0,Mr._n)("%d result found.","%d results found.",n),n);r(l,"polite")},[t,r]),(0,De.jsx)("div",{ref:a,className:"global-styles-ui-block-types-item-list",role:"list",children:s.length===0?(0,De.jsx)(vr.__experimentalText,{align:"center",as:"p",children:(0,Mr.__)("No blocks found.")}):s.map(n=>(0,De.jsx)(Rc,{block:n},"menu-itemblock-"+n.name))})}var w0=(0,$e.memo)(Ic);var Nc=u(Ir(),1),Qi=u(ae(),1),cn=u(vt(),1),zc=u(de(),1),Mc=u(we(),1),dn=u(X(),1),$i=u(it(),1);var Lc=u(ae(),1),Xi=u(Ir(),1),Bc=u(X(),1),Vc=u(vt(),1);var Dc=u(z(),1);var Ki=u(X(),1),Ji=u(z(),1);function xe({children:t,level:e=2}){return(0,Ji.jsx)(Ki.__experimentalHeading,{className:"global-styles-ui-subtitle",level:e,children:t})}var mn=u(z(),1);var{useHasDimensionsPanel:D0,useHasTypographyPanel:N0,useHasBorderPanel:z0,useSettingsForBlockElement:M0,useHasColorPanel:G0,useHasFiltersPanel:j0,useHasImageSettingsPanel:U0,useHasBackgroundPanel:H0,BackgroundPanel:W0,BorderPanel:Y0,ColorPanel:q0,TypographyPanel:Z0,DimensionsPanel:X0,FiltersPanel:K0,ImageSettingsPanel:J0,AdvancedPanel:Q0}=yt(Qi.privateApis);var $h=u(it(),1),tg=u(X(),1),eg=u(vt(),1);var Gc=u(X(),1);var jc=u(z(),1);var Uc=u(it(),1),Uo=u(X(),1);var tl=u(z(),1);var Yo=u(X(),1);var el=u(X(),1);var Ho=u(z(),1),Hc=({variation:t,isFocused:e,withHoverView:r})=>(0,Ho.jsx)(zr,{label:t.title,isFocused:e,withHoverView:r,children:({ratio:o,key:s})=>(0,Ho.jsx)(el.__experimentalHStack,{spacing:10*o,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,Ho.jsx)(Go,{variation:t,fontSize:85*o})},s)}),rl=Hc;var sl=u(X(),1),br=u(vt(),1),nl=u(pn(),1),Wo=u(it(),1);var mo=u(z(),1);function Gr({variation:t,children:e,isPill:r=!1,properties:o,showTooltip:s=!1}){let[a,n]=(0,br.useState)(!1),{base:l,user:h,onChange:f}=(0,br.useContext)(Kt),c=(0,br.useMemo)(()=>{let A=pr(l,t);return o&&(A=zo(A,o)),{user:t,base:l,merged:A,onChange:()=>{}}},[t,l,o]),d=()=>f(t),m=A=>{A.keyCode===nl.ENTER&&(A.preventDefault(),d())},g=(0,br.useMemo)(()=>ao(h,t),[h,t]),y=t?.title;t?.description&&(y=(0,Wo.sprintf)((0,Wo._x)("%1$s (%2$s)","variation label"),t?.title,t?.description));let _=(0,mo.jsx)("div",{className:be("global-styles-ui-variations_item",{"is-active":g}),role:"button",onClick:d,onKeyDown:m,tabIndex:0,"aria-label":y,"aria-current":g,onFocus:()=>n(!0),onBlur:()=>n(!1),children:(0,mo.jsx)("div",{className:be("global-styles-ui-variations_item-preview",{"is-pill":r}),children:e(a)})});return(0,mo.jsx)(Kt.Provider,{value:c,children:s?(0,mo.jsx)(sl.Tooltip,{text:t?.title,children:_}):_})}var wr=u(z(),1),al=["typography"];function qo({title:t,gap:e=2}){let r=Mo(al);return r?.length<=1?null:(0,wr.jsxs)(Yo.__experimentalVStack,{spacing:3,children:[t&&(0,wr.jsx)(xe,{level:3,children:t}),(0,wr.jsx)(Yo.__experimentalGrid,{columns:3,gap:e,className:"global-styles-ui-style-variations-container",children:r.map((o,s)=>(0,wr.jsx)(Gr,{variation:o,properties:al,showTooltip:!0,children:()=>(0,wr.jsx)(rl,{variation:o})},s))})]})}var Jh=u(it(),1),wo=u(X(),1);var Qh=u(vt(),1);var We=u(vt(),1),or=u(de(),1),rr=u(we(),1),vn=u(it(),1);var hn=u(ll(),1),ul=u(we(),1),fl="/wp/v2/font-families";function cl(t){let{receiveEntityRecords:e}=t.dispatch(ul.store);e("postType","wp_font_family",[],void 0,!0)}async function dl(t,e){let o=await(0,hn.default)({path:fl,method:"POST",body:t});return cl(e),{id:o.id,...o.font_family_settings,fontFace:[]}}async function ml(t,e,r){let o={path:`${fl}/${t}/font-faces`,method:"POST",body:e},s=await(0,hn.default)(o);return cl(r),{id:s.id,...s.font_face_settings}}var gl=u(X(),1);var Oe=u(it(),1),gn=["otf","ttf","woff","woff2"],pl={100:(0,Oe._x)("Thin","font weight"),200:(0,Oe._x)("Extra-light","font weight"),300:(0,Oe._x)("Light","font weight"),400:(0,Oe._x)("Normal","font weight"),500:(0,Oe._x)("Medium","font weight"),600:(0,Oe._x)("Semi-bold","font weight"),700:(0,Oe._x)("Bold","font weight"),800:(0,Oe._x)("Extra-bold","font weight"),900:(0,Oe._x)("Black","font weight")},hl={normal:(0,Oe._x)("Normal","font style"),italic:(0,Oe._x)("Italic","font style")};var{File:yl}=window,{kebabCase:Wc}=yt(gl.privateApis);function tr(t,e={}){return!t.name&&(t.fontFamily||t.slug)&&(t.name=t.fontFamily||t.slug),{...t,...e}}function Yc(t){return typeof t!="string"?!1:t!==decodeURIComponent(t)}function Zo(t){let e=pl[t.fontWeight??""]||t.fontWeight,r=t.fontStyle==="normal"?"":hl[t.fontStyle??""]||t.fontStyle;return`${e} ${r}`}function qc(t=[],e=[]){let r=new Map;for(let o of t)r.set(`${o.fontWeight}${o.fontStyle}`,o);for(let o of e)r.set(`${o.fontWeight}${o.fontStyle}`,o);return Array.from(r.values())}function vl(t=[],e=[]){let r=new Map;for(let o of t)r.set(o.slug,{...o});for(let o of e)if(r.has(o.slug)){let{fontFace:s,...a}=o,n=r.get(o.slug),l=qc(n.fontFace,s);r.set(o.slug,{...a,fontFace:l})}else r.set(o.slug,{...o});return Array.from(r.values())}async function er(t,e,r="all"){let o;if(typeof e=="string")o=`url(${e})`;else if(e instanceof yl)o=await e.arrayBuffer();else return;let a=await new window.FontFace(sn(t.fontFamily),o,{style:t.fontStyle,weight:String(t.fontWeight)}).load();if((r==="document"||r==="all")&&document.fonts.add(a),r==="iframe"||r==="all"){let n=document.querySelector('iframe[name="editor-canvas"]');n?.contentDocument&&n.contentDocument.fonts.add(a)}}function po(t,e="all"){let r=o=>{o.forEach(s=>{s.family===sn(t?.fontFamily)&&s.weight===t?.fontWeight&&s.style===t?.fontStyle&&o.delete(s)})};if((e==="document"||e==="all")&&r(document.fonts),e==="iframe"||e==="all"){let o=document.querySelector('iframe[name="editor-canvas"]');o?.contentDocument&&r(o.contentDocument.fonts)}}function jr(t){if(!t)return;let e;if(Array.isArray(t)?e=t[0]:e=t,!e.startsWith("file:."))return Yc(e)||(e=encodeURI(e)),e}function bl(t){let e=new FormData,{fontFace:r,category:o,...s}=t,a={...s,slug:Wc(t.slug)};return e.append("font_family_settings",JSON.stringify(a)),e}function wl(t){return(t?.fontFace??[]).map((r,o)=>{let s={...r},a=new FormData;if(s.file){let n=Array.isArray(s.file)?s.file:[s.file],l=[];n.forEach((h,f)=>{let c=`file-${o}-${f}`;a.append(c,h,h.name),l.push(c)}),s.src=l.length===1?l[0]:l,delete s.file,a.append("font_face_settings",JSON.stringify(s))}else a.append("font_face_settings",JSON.stringify(s));return a})}async function Sl(t,e,r){let o=[];for(let a of e)try{let n=await ml(t,a,r);o.push({status:"fulfilled",value:n})}catch(n){o.push({status:"rejected",reason:n})}let s={errors:[],successes:[]};return o.forEach((a,n)=>{if(a.status==="fulfilled"&&a.value){let l=a.value;s.successes.push(l)}else a.reason&&s.errors.push({data:e[n],message:a.reason.message})}),s}async function xl(t){t=Array.isArray(t)?t:[t];let e=await Promise.all(t.map(async r=>fetch(new Request(r)).then(o=>{if(!o.ok)throw new Error(`Error downloading font face asset from ${r}. Server responded with status: ${o.status}`);return o.blob()}).then(o=>{let s=r.split("/").pop();return new yl([o],s,{type:o.type})})));return e.length===1?e[0]:e}function yn(t,e){return e.findIndex(r=>r.fontWeight===t.fontWeight&&r.fontStyle===t.fontStyle)!==-1}function Cl(t,e,r){e=Array.isArray(e)?[...e]:[e],t=Array.isArray(t)?[...t]:{...t};let o=e.pop(),s=t;for(let a of e){let n=s[a];s=s[a]=Array.isArray(n)?[...n]:{...n}}return s[o]=r,t}function Xo(t,e,r=[]){let o=h=>h.slug===t.slug,s=h=>h.find(o),a=h=>h?r.filter(f=>!o(f)):[...r,t],n=h=>{let f=d=>d.fontWeight===e.fontWeight&&d.fontStyle===e.fontStyle;if(!h)return[...r,{...t,fontFace:[e]}];let c=h.fontFace||[];return c.find(f)?c=c.filter(d=>!f(d)):c=[...c,e],c.length===0?r.filter(d=>!o(d)):r.map(d=>o(d)?{...d,fontFace:c}:d)},l=s(r);return e?n(l):a(l)}var Fl=u(z(),1),ie=(0,We.createContext)({});ie.displayName="FontLibraryContext";function Zc({children:t}){let e=(0,or.useRegistry)(),{saveEntityRecord:r,deleteEntityRecord:o}=(0,or.useDispatch)(rr.store),{globalStylesId:s}=(0,or.useSelect)(S=>{let{__experimentalGetCurrentGlobalStylesId:R}=S(rr.store);return{globalStylesId:R()}},[]),a=(0,rr.useEntityRecord)("root","globalStyles",s),[n,l]=(0,We.useState)(!1),{records:h=[],isResolving:f}=(0,rr.useEntityRecords)("postType","wp_font_family",{_embed:!0}),c=(h||[]).map(S=>({id:S.id,...S.font_family_settings||{},fontFace:S?._embedded?.font_faces?.map(R=>R.font_face_settings)||[]}))||[],[d,m]=_t("typography.fontFamilies"),g=async S=>{if(!a.record)return;let R=a.record,et=Cl(R??{},["settings","typography","fontFamilies"],S);await r("root","globalStyles",et)},[y,_]=(0,We.useState)(""),[A,k]=(0,We.useState)(void 0),x=d?.theme?d.theme.map(S=>tr(S,{source:"theme"})).sort((S,R)=>S.name.localeCompare(R.name)):[],b=d?.custom?d.custom.map(S=>tr(S,{source:"custom"})).sort((S,R)=>S.name.localeCompare(R.name)):[],T=c?c.map(S=>tr(S,{source:"custom"})).sort((S,R)=>S.name.localeCompare(R.name)):[];(0,We.useEffect)(()=>{y||k(void 0)},[y]);let Y=S=>{if(!S){k(void 0);return}let et=(S.source==="theme"?x:T).find(ct=>ct.slug===S.slug);k({...et||S,source:S.source})},[I]=(0,We.useState)(new Set),D=S=>S.reduce((et,ct)=>{let at=ct?.fontFace&&ct.fontFace?.length>0?ct?.fontFace.map(Ct=>`${Ct.fontStyle??""}${Ct.fontWeight??""}`):["normal400"];return et[ct.slug]=at,et},{}),H=S=>D(S==="theme"?x:b),$=(S,R,et,ct)=>!R&&!et?!!H(ct)[S]:!!H(ct)[S]?.includes((R??"")+(et??"")),bt=(S,R)=>H(R)[S]||[];async function W(S){l(!0);try{let R=[],et=[];for(let at of S){let Ct=!1,Yt=await(0,or.resolveSelect)(rr.store).getEntityRecords("postType","wp_font_family",{slug:at.slug,per_page:1,_embed:!0}),Ot=Yt&&Yt.length>0?Yt[0]:null,J=Ot?{id:Ot.id,...Ot.font_family_settings,fontFace:(Ot?._embedded?.font_faces??[]).map(zt=>zt.font_face_settings)||[]}:null;J||(Ct=!0,J=await dl(bl(at),e));let xt=J.fontFace&&at.fontFace?J.fontFace.filter(zt=>zt&&at.fontFace&&yn(zt,at.fontFace)):[];J.fontFace&&at.fontFace&&(at.fontFace=at.fontFace.filter(zt=>!yn(zt,J.fontFace)));let At=[],Ce=[];if(at?.fontFace?.length??!1){let zt=await Sl(J.id,wl(at),e);At=zt?.successes,Ce=zt?.errors}(At?.length>0||xt?.length>0)&&(J.fontFace=[...At],R.push(J)),J&&!at?.fontFace?.length&&R.push(J),Ct&&(at?.fontFace?.length??0)>0&&At?.length===0&&await o("postType","wp_font_family",J.id,{force:!0}),et=et.concat(Ce)}let ct=et.reduce((at,Ct)=>at.includes(Ct.message)?at:[...at,Ct.message],[]);if(R.length>0){let at=lt(R);await g(at)}if(ct.length>0){let at=new Error((0,vn.__)("There was an error installing fonts."));throw at.installationErrors=ct,at}}finally{l(!1)}}async function v(S){if(!S?.id)throw new Error((0,vn.__)("Font family to uninstall is not defined."));try{await o("postType","wp_font_family",S.id,{force:!0});let R=L(S);return await g(R),{deleted:!0}}catch(R){throw console.error("There was an error uninstalling the font family:",R),R}}let L=S=>{let et=(d?.[S.source??""]??[]).filter(at=>at.slug!==S.slug),ct={...d,[S.source??""]:et};return m(ct),S.fontFace&&S.fontFace.forEach(at=>{po(at,"all")}),ct},lt=S=>{let R=ot(S),et={...d,custom:vl(d?.custom,R)};return m(et),K(R),et},ot=S=>S.map(({id:R,fontFace:et,...ct})=>({...ct,...et&&et.length>0?{fontFace:et.map(({id:at,...Ct})=>Ct)}:{}})),K=S=>{S.forEach(R=>{R.fontFace&&R.fontFace.forEach(et=>{let ct=jr(et?.src??"");ct&&er(et,ct,"all")})})},gt=(S,R)=>{let et=d?.[S.source??""]??[],ct=Xo(S,R,et);m({...d,[S.source??""]:ct});let at=$(S.slug,R?.fontStyle??"",R?.fontWeight??"",S.source??"custom");if(R&&at)po(R,"all");else{let Ct=jr(R?.src??"");R&&Ct&&er(R,Ct,"all")}},E=async S=>{if(!S.src)return;let R=jr(S.src);!R||I.has(R)||(er(S,R,"document"),I.add(R))};return(0,Fl.jsx)(ie.Provider,{value:{libraryFontSelected:A,handleSetLibraryFontSelected:Y,fontFamilies:d??{},baseCustomFonts:T,isFontActivated:$,getFontFacesActivated:bt,loadFontFaceAsset:E,installFonts:W,uninstallFontFamily:v,toggleActivateFont:gt,getAvailableFontsOutline:D,modalTabOpen:y,setModalTabOpen:_,saveFontFamilies:g,isResolvingLibrary:f,isInstalling:n},children:t})}var Ko=Zc;var cs=u(it(),1),Cn=u(X(),1),au=u(we(),1),Xh=u(de(),1);var ht=u(X(),1),go=u(we(),1),bn=u(de(),1),xr=u(vt(),1),Rt=u(it(),1);var Hr=u(it(),1),Te=u(X(),1);var kl=u(X(),1),Ne=u(vt(),1);var Jo=u(z(),1);function Xc(t){if(t.preview)return t.preview;if(t.src)return Array.isArray(t.src)?t.src[0]:t.src}function Kc(t){return"fontStyle"in t&&t.fontStyle||"fontWeight"in t&&t.fontWeight?t:"fontFace"in t&&t.fontFace&&t.fontFace.length?t.fontFace.find(e=>e.fontStyle==="normal"&&e.fontWeight==="400")||t.fontFace[0]:{fontStyle:"normal",fontWeight:"400",fontFamily:t.fontFamily}}function Jc({font:t,text:e}){let r=(0,Ne.useRef)(null),o=Kc(t),s=Dr(t);e=e||("name"in t?t.name:"");let a=t.preview,[n,l]=(0,Ne.useState)(!1),[h,f]=(0,Ne.useState)(!1),{loadFontFaceAsset:c}=(0,Ne.useContext)(ie),d=a??Xc(o),m=d&&d.match(/\.(png|jpg|jpeg|gif|svg)$/i),g=Ri(o),y={fontSize:"18px",lineHeight:1,opacity:h?"1":"0",...s,...g};return(0,Ne.useEffect)(()=>{let _=new window.IntersectionObserver(([A])=>{l(A.isIntersecting)},{});return r.current&&_.observe(r.current),()=>_.disconnect()},[r]),(0,Ne.useEffect)(()=>{(async()=>n&&(!m&&o.src&&await c(o),f(!0)))()},[o,n,c,m]),(0,Jo.jsx)("div",{ref:r,children:m?(0,Jo.jsx)("img",{src:d,loading:"lazy",alt:e,className:"font-library__font-variant_demo-image"}):(0,Jo.jsx)(kl.__experimentalText,{style:y,className:"font-library__font-variant_demo-text",children:e})})}var Ur=Jc;var ze=u(z(),1);function Qc({font:t,onClick:e,variantsText:r,navigatorPath:o}){let s=t.fontFace?.length||1,a={cursor:e?"pointer":"default"},n=(0,Te.useNavigator)();return(0,ze.jsx)(Te.Button,{__next40pxDefaultSize:!0,onClick:()=>{e(),o&&n.goTo(o)},style:a,className:"font-library__font-card",children:(0,ze.jsxs)(Te.Flex,{justify:"space-between",wrap:!1,children:[(0,ze.jsx)(Ur,{font:t}),(0,ze.jsxs)(Te.Flex,{justify:"flex-end",children:[(0,ze.jsx)(Te.FlexItem,{children:(0,ze.jsx)(Te.__experimentalText,{className:"font-library__font-card__count",children:r||(0,Hr.sprintf)((0,Hr._n)("%d variant","%d variants",s),s)})}),(0,ze.jsx)(Te.FlexItem,{children:(0,ze.jsx)(oo,{icon:(0,Hr.isRTL)()?cr:dr})})]})]})})}var ho=Qc;var Qo=u(vt(),1),$o=u(X(),1);var Sr=u(z(),1);function $c({face:t,font:e}){let{isFontActivated:r,toggleActivateFont:o}=(0,Qo.useContext)(ie),s=(e?.fontFace?.length??0)>0?r(e.slug,t.fontStyle,t.fontWeight,e.source):r(e.slug,void 0,void 0,e.source),a=()=>{if((e?.fontFace?.length??0)>0){o(e,t);return}o(e)},n=e.name+" "+Zo(t),l=(0,Qo.useId)();return(0,Sr.jsx)("div",{className:"font-library__font-card",children:(0,Sr.jsxs)($o.Flex,{justify:"flex-start",align:"center",gap:"1rem",children:[(0,Sr.jsx)($o.CheckboxControl,{checked:s,onChange:a,id:l}),(0,Sr.jsx)("label",{htmlFor:l,children:(0,Sr.jsx)(Ur,{font:t,text:n,onClick:a})})]})})}var Ol=$c;function Tl(t){switch(t){case"normal":return 400;case"bold":return 700;case"bolder":return 500;case"lighter":return 300;default:return parseInt(t,10)}}function ts(t){return t.sort((e,r)=>e.fontStyle==="normal"&&r.fontStyle!=="normal"?-1:r.fontStyle==="normal"&&e.fontStyle!=="normal"?1:e.fontStyle===r.fontStyle?Tl(e.fontWeight?.toString()??"normal")-Tl(r.fontWeight?.toString()??"normal"):!e.fontStyle||!r.fontStyle?e.fontStyle?-1:1:e.fontStyle.localeCompare(r.fontStyle))}var ft=u(z(),1);function td(){let{baseCustomFonts:t,libraryFontSelected:e,handleSetLibraryFontSelected:r,uninstallFontFamily:o,isResolvingLibrary:s,isInstalling:a,saveFontFamilies:n,getFontFacesActivated:l}=(0,xr.useContext)(ie),[h,f]=_t("typography.fontFamilies"),[c,d]=(0,xr.useState)(!1),[m,g]=(0,xr.useState)(null),[y]=_t("typography.fontFamilies",void 0,"base"),_=(0,bn.useSelect)(E=>{let{__experimentalGetCurrentGlobalStylesId:S}=E(go.store);return S()},[]),k=!!(0,go.useEntityRecord)("root","globalStyles",_)?.edits?.settings?.typography?.fontFamilies,x=h?.theme?h.theme.map(E=>tr(E,{source:"theme"})).sort((E,S)=>E.name.localeCompare(S.name)):[],b=new Set(x.map(E=>E.slug)),T=y?.theme?x.concat(y.theme.filter(E=>!b.has(E.slug)).map(E=>tr(E,{source:"theme"})).sort((E,S)=>E.name.localeCompare(S.name))):[],Y=e?.source==="custom"&&e?.id,I=(0,bn.useSelect)(E=>{let{canUser:S}=E(go.store);return Y&&S("delete",{kind:"postType",name:"wp_font_family",id:Y})},[Y]),D=!!e&&e?.source!=="theme"&&I,H=()=>{d(!0)},$=async()=>{g(null);try{await n(h),g({type:"success",message:(0,Rt.__)("Font family updated successfully.")})}catch(E){g({type:"error",message:(0,Rt.sprintf)((0,Rt.__)("There was an error updating the font family. %s"),E.message)})}},bt=E=>E?!E.fontFace||!E.fontFace.length?[{fontFamily:E.fontFamily,fontStyle:"normal",fontWeight:"400"}]:ts(E.fontFace):[],W=E=>{let S=E?.fontFace&&(E?.fontFace?.length??0)>0?E.fontFace.length:1,R=l(E.slug,E.source).length;return(0,Rt.sprintf)((0,Rt.__)("%1$d/%2$d variants active"),R,S)};(0,xr.useEffect)(()=>{r(e)},[]);let v=e?l(e.slug,e.source).length:0,L=e?.fontFace?.length??(e?.fontFamily?1:0),lt=v>0&&v!==L,ot=v===L,K=()=>{if(!e||!e?.source)return;let E=h?.[e.source]?.filter(R=>R.slug!==e.slug)??[],S=ot?E:[...E,e];f({...h,[e.source]:S}),e.fontFace&&e.fontFace.forEach(R=>{if(ot)po(R,"all");else{let et=jr(R?.src??"");et&&er(R,et,"all")}})},gt=T.length>0||t.length>0;return(0,ft.jsxs)("div",{className:"font-library__tabpanel-layout",children:[s&&(0,ft.jsx)("div",{className:"font-library__loading",children:(0,ft.jsx)(ht.ProgressBar,{})}),!s&&(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsxs)(ht.Navigator,{initialPath:e?"/fontFamily":"/",children:[(0,ft.jsx)(ht.Navigator.Screen,{path:"/",children:(0,ft.jsxs)(ht.__experimentalVStack,{spacing:"8",children:[m&&(0,ft.jsx)(ht.Notice,{status:m.type,onRemove:()=>g(null),children:m.message}),!gt&&(0,ft.jsx)(ht.__experimentalText,{as:"p",children:(0,Rt.__)("No fonts installed.")}),T.length>0&&(0,ft.jsxs)(ht.__experimentalVStack,{children:[(0,ft.jsx)("h2",{className:"font-library__fonts-title",children:(0,Rt._x)("Theme","font source")}),(0,ft.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:T.map(E=>(0,ft.jsx)("li",{className:"font-library__fonts-list-item",children:(0,ft.jsx)(ho,{font:E,navigatorPath:"/fontFamily",variantsText:W(E),onClick:()=>{g(null),r(E)}})},E.slug))})]}),t.length>0&&(0,ft.jsxs)(ht.__experimentalVStack,{children:[(0,ft.jsx)("h2",{className:"font-library__fonts-title",children:(0,Rt._x)("Custom","font source")}),(0,ft.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:t.map(E=>(0,ft.jsx)("li",{className:"font-library__fonts-list-item",children:(0,ft.jsx)(ho,{font:E,navigatorPath:"/fontFamily",variantsText:W(E),onClick:()=>{g(null),r(E)}})},E.slug))})]})]})}),(0,ft.jsxs)(ht.Navigator.Screen,{path:"/fontFamily",children:[e&&(0,ft.jsx)(ed,{font:e,isOpen:c,setIsOpen:d,setNotice:g,uninstallFontFamily:o,handleSetLibraryFontSelected:r}),(0,ft.jsxs)(ht.Flex,{justify:"flex-start",children:[(0,ft.jsx)(ht.Navigator.BackButton,{icon:(0,Rt.isRTL)()?dr:cr,size:"small",onClick:()=>{r(void 0),g(null)},label:(0,Rt.__)("Back")}),(0,ft.jsx)(ht.__experimentalHeading,{level:2,size:13,className:"global-styles-ui-header",children:e?.name})]}),m&&(0,ft.jsxs)(ft.Fragment,{children:[(0,ft.jsx)(ht.__experimentalSpacer,{margin:1}),(0,ft.jsx)(ht.Notice,{status:m.type,onRemove:()=>g(null),children:m.message}),(0,ft.jsx)(ht.__experimentalSpacer,{margin:1})]}),(0,ft.jsx)(ht.__experimentalSpacer,{margin:4}),(0,ft.jsx)(ht.__experimentalText,{children:(0,Rt.__)("Choose font variants. Keep in mind that too many variants could make your site slower.")}),(0,ft.jsx)(ht.__experimentalSpacer,{margin:4}),(0,ft.jsxs)(ht.__experimentalVStack,{spacing:0,children:[(0,ft.jsx)(ht.CheckboxControl,{className:"font-library__select-all",label:(0,Rt.__)("Select all"),checked:ot,onChange:K,indeterminate:lt}),(0,ft.jsx)(ht.__experimentalSpacer,{margin:8}),(0,ft.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:e&&bt(e).map((E,S)=>(0,ft.jsx)("li",{className:"font-library__fonts-list-item",children:(0,ft.jsx)(Ol,{font:e,face:E},`face${S}`)},`face${S}`))})]})]})]}),(0,ft.jsxs)(ht.__experimentalHStack,{justify:"flex-end",className:"font-library__footer",children:[a&&(0,ft.jsx)(ht.ProgressBar,{}),D&&(0,ft.jsx)(ht.Button,{__next40pxDefaultSize:!0,isDestructive:!0,variant:"tertiary",onClick:H,children:(0,Rt.__)("Delete")}),(0,ft.jsx)(ht.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:$,disabled:!k,accessibleWhenDisabled:!0,children:(0,Rt.__)("Update")})]})]})]})}function ed({font:t,isOpen:e,setIsOpen:r,setNotice:o,uninstallFontFamily:s,handleSetLibraryFontSelected:a}){let n=(0,ht.useNavigator)(),l=async()=>{o(null),r(!1);try{await s(t),n.goBack(),a(void 0),o({type:"success",message:(0,Rt.__)("Font family uninstalled successfully.")})}catch(f){o({type:"error",message:(0,Rt.__)("There was an error uninstalling the font family.")+f.message})}},h=()=>{r(!1)};return(0,ft.jsx)(ht.__experimentalConfirmDialog,{isOpen:e,cancelButtonText:(0,Rt.__)("Cancel"),confirmButtonText:(0,Rt.__)("Delete"),onCancel:h,onConfirm:l,size:"medium",children:t&&(0,Rt.sprintf)((0,Rt.__)('Are you sure you want to delete "%s" font and all its variants and assets?'),t.name)})}var es=td;var Xt=u(vt(),1),nt=u(X(),1),Bl=u(mr(),1),Et=u(it(),1);var Vl=u(we(),1);function _l(t,e){let{category:r,search:o}=e,s=t||[];return r&&r!=="all"&&(s=s.filter(a=>a.categories&&a.categories.indexOf(r)!==-1)),o&&(s=s.filter(a=>a.font_family_settings&&a.font_family_settings.name.toLowerCase().includes(o.toLowerCase()))),s}function Pl(t){return t.reduce((e,r)=>({...e,[r.slug]:(r?.fontFace||[]).reduce((o,s)=>({...o,[`${s.fontStyle}-${s.fontWeight}`]:!0}),{})}),{})}function Al(t,e,r){return e?!!r[t]?.[`${e.fontStyle}-${e.fontWeight}`]:!!r[t]}var yo=u(it(),1),le=u(X(),1),_e=u(z(),1);function rd(){let t=()=>{window.localStorage.setItem("wp-font-library-google-fonts-permission","true"),window.dispatchEvent(new Event("storage"))};return(0,_e.jsx)("div",{className:"font-library__google-fonts-confirm",children:(0,_e.jsx)(le.Card,{children:(0,_e.jsxs)(le.CardBody,{children:[(0,_e.jsx)(le.__experimentalHeading,{level:2,children:(0,yo.__)("Connect to Google Fonts")}),(0,_e.jsx)(le.__experimentalSpacer,{margin:6}),(0,_e.jsx)(le.__experimentalText,{as:"p",children:(0,yo.__)("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.")}),(0,_e.jsx)(le.__experimentalSpacer,{margin:3}),(0,_e.jsx)(le.__experimentalText,{as:"p",children:(0,yo.__)("You can alternatively upload files directly on the Upload tab.")}),(0,_e.jsx)(le.__experimentalSpacer,{margin:6}),(0,_e.jsx)(le.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:t,children:(0,yo.__)("Allow access to Google Fonts")})]})})})}var El=rd;var Rl=u(vt(),1),rs=u(X(),1);var Cr=u(z(),1);function od({face:t,font:e,handleToggleVariant:r,selected:o}){let s=()=>{if(e?.fontFace){r(e,t);return}r(e)},a=e.name+" "+Zo(t),n=(0,Rl.useId)();return(0,Cr.jsx)("div",{className:"font-library__font-card",children:(0,Cr.jsxs)(rs.Flex,{justify:"flex-start",align:"center",gap:"1rem",children:[(0,Cr.jsx)(rs.CheckboxControl,{checked:o,onChange:s,id:n}),(0,Cr.jsx)("label",{htmlFor:n,children:(0,Cr.jsx)(Ur,{font:t,text:a,onClick:s})})]})})}var Il=od;var tt=u(z(),1),sd={slug:"all",name:(0,Et._x)("All","font categories")},Ll="wp-font-library-google-fonts-permission",nd=500;function ad({slug:t}){let e=t==="google-fonts",r=()=>window.localStorage.getItem(Ll)==="true",[o,s]=(0,Xt.useState)(null),[a,n]=(0,Xt.useState)(null),[l,h]=(0,Xt.useState)([]),[f,c]=(0,Xt.useState)(1),[d,m]=(0,Xt.useState)({}),[g,y]=(0,Xt.useState)(e&&!r()),{installFonts:_,isInstalling:A}=(0,Xt.useContext)(ie),{record:k,isResolving:x}=(0,Vl.useEntityRecord)("root","fontCollection",t);(0,Xt.useEffect)(()=>{let J=()=>{y(e&&!r())};return J(),window.addEventListener("storage",J),()=>window.removeEventListener("storage",J)},[t,e]);let b=()=>{window.localStorage.setItem(Ll,"false"),window.dispatchEvent(new Event("storage"))};(0,Xt.useEffect)(()=>{s(null)},[t]),(0,Xt.useEffect)(()=>{h([])},[o]);let T=(0,Xt.useMemo)(()=>k?.font_families??[],[k]),Y=k?.categories??[],I=[sd,...Y],D=(0,Xt.useMemo)(()=>_l(T,d),[T,d]),H=Math.max(window.innerHeight,nd),$=Math.floor((H-417)/61),bt=Math.ceil(D.length/$),W=(f-1)*$,v=f*$,L=D.slice(W,v),lt=J=>{m({...d,category:J}),c(1)},K=(0,Bl.debounce)(J=>{m({...d,search:J}),c(1)},300),gt=(J,xt)=>{let At=Xo(J,xt,l);h(At)},E=Pl(l),S=()=>{h([])},R=l.length>0?l[0]?.fontFace?.length??0:0,et=R>0&&R!==o?.fontFace?.length,ct=R===o?.fontFace?.length,at=()=>{let J=[];!ct&&o&&J.push(o),h(J)},Ct=async()=>{n(null);let J=l[0];try{J?.fontFace&&await Promise.all(J.fontFace.map(async xt=>{xt.src&&(xt.file=await xl(xt.src))}))}catch{n({type:"error",message:(0,Et.__)("Error installing the fonts, could not be downloaded.")});return}try{await _([J]),n({type:"success",message:(0,Et.__)("Fonts were installed successfully.")})}catch(xt){n({type:"error",message:xt.message})}S()},Yt=J=>J?!J.fontFace||!J.fontFace.length?[{fontFamily:J.fontFamily,fontStyle:"normal",fontWeight:"400"}]:ts(J.fontFace):[];if(g)return(0,tt.jsx)(El,{});let Ot=()=>t!=="google-fonts"||g||o?null:(0,tt.jsx)(nt.DropdownMenu,{icon:Vs,label:(0,Et.__)("Actions"),popoverProps:{position:"bottom left"},controls:[{title:(0,Et.__)("Revoke access to Google Fonts"),onClick:b}]});return(0,tt.jsxs)("div",{className:"font-library__tabpanel-layout",children:[x&&(0,tt.jsx)("div",{className:"font-library__loading",children:(0,tt.jsx)(nt.ProgressBar,{})}),!x&&k&&(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsxs)(nt.Navigator,{initialPath:"/",className:"font-library__tabpanel-layout",children:[(0,tt.jsxs)(nt.Navigator.Screen,{path:"/",children:[(0,tt.jsxs)(nt.__experimentalHStack,{justify:"space-between",children:[(0,tt.jsxs)(nt.__experimentalVStack,{children:[(0,tt.jsx)(nt.__experimentalHeading,{level:2,size:13,children:k.name}),(0,tt.jsx)(nt.__experimentalText,{children:k.description})]}),(0,tt.jsx)(Ot,{})]}),(0,tt.jsx)(nt.__experimentalSpacer,{margin:4}),(0,tt.jsxs)(nt.__experimentalHStack,{spacing:4,justify:"space-between",children:[(0,tt.jsx)(nt.SearchControl,{value:d.search,placeholder:(0,Et.__)("Font name\u2026"),label:(0,Et.__)("Search"),onChange:K,hideLabelFromVision:!1}),(0,tt.jsx)(nt.SelectControl,{__next40pxDefaultSize:!0,label:(0,Et.__)("Category"),value:d.category,onChange:lt,children:I&&I.map(J=>(0,tt.jsx)("option",{value:J.slug,children:J.name},J.slug))})]}),(0,tt.jsx)(nt.__experimentalSpacer,{margin:4}),!!k?.font_families?.length&&!D.length&&(0,tt.jsx)(nt.__experimentalText,{children:(0,Et.__)("No fonts found. Try with a different search term.")}),(0,tt.jsx)("div",{className:"font-library__fonts-grid__main",children:(0,tt.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:L.map(J=>(0,tt.jsx)("li",{className:"font-library__fonts-list-item",children:(0,tt.jsx)(ho,{font:J.font_family_settings,navigatorPath:"/fontFamily",onClick:()=>{s(J.font_family_settings)}})},J.font_family_settings.slug))})})]}),(0,tt.jsxs)(nt.Navigator.Screen,{path:"/fontFamily",children:[(0,tt.jsxs)(nt.Flex,{justify:"flex-start",children:[(0,tt.jsx)(nt.Navigator.BackButton,{icon:(0,Et.isRTL)()?dr:cr,size:"small",onClick:()=>{s(null),n(null)},label:(0,Et.__)("Back")}),(0,tt.jsx)(nt.__experimentalHeading,{level:2,size:13,className:"global-styles-ui-header",children:o?.name})]}),a&&(0,tt.jsxs)(tt.Fragment,{children:[(0,tt.jsx)(nt.__experimentalSpacer,{margin:1}),(0,tt.jsx)(nt.Notice,{status:a.type,onRemove:()=>n(null),children:a.message}),(0,tt.jsx)(nt.__experimentalSpacer,{margin:1})]}),(0,tt.jsx)(nt.__experimentalSpacer,{margin:4}),(0,tt.jsx)(nt.__experimentalText,{children:(0,Et.__)("Select font variants to install.")}),(0,tt.jsx)(nt.__experimentalSpacer,{margin:4}),(0,tt.jsx)(nt.CheckboxControl,{className:"font-library__select-all",label:(0,Et.__)("Select all"),checked:ct,onChange:at,indeterminate:et}),(0,tt.jsx)(nt.__experimentalVStack,{spacing:0,children:(0,tt.jsx)("ul",{role:"list",className:"font-library__fonts-list",children:o&&Yt(o).map((J,xt)=>(0,tt.jsx)("li",{className:"font-library__fonts-list-item",children:(0,tt.jsx)(Il,{font:o,face:J,handleToggleVariant:gt,selected:Al(o.slug,o.fontFace?J:null,E)})},`face${xt}`))})}),(0,tt.jsx)(nt.__experimentalSpacer,{margin:16})]})]}),o&&(0,tt.jsx)(nt.Flex,{justify:"flex-end",className:"font-library__footer",children:(0,tt.jsx)(nt.Button,{__next40pxDefaultSize:!0,variant:"primary",onClick:Ct,isBusy:A,disabled:l.length===0||A,accessibleWhenDisabled:!0,children:(0,Et.__)("Install")})}),!o&&(0,tt.jsxs)(nt.__experimentalHStack,{expanded:!1,className:"font-library__footer",justify:"end",spacing:6,children:[(0,tt.jsx)(nt.__experimentalHStack,{justify:"flex-start",expanded:!1,spacing:1,className:"font-library__page-selection",children:(0,Xt.createInterpolateElement)((0,Et.sprintf)((0,Et._x)(" Page%1$sof %2$d","paging"),"",bt),{div:(0,tt.jsx)("div",{"aria-hidden":!0}),CurrentPage:(0,tt.jsx)(nt.SelectControl,{"aria-label":(0,Et.__)("Current page"),value:f.toString(),options:[...Array(bt)].map((J,xt)=>({label:(xt+1).toString(),value:(xt+1).toString()})),onChange:J=>c(parseInt(J)),size:"small",variant:"minimal"})})}),(0,tt.jsxs)(nt.__experimentalHStack,{expanded:!1,spacing:1,children:[(0,tt.jsx)(nt.Button,{onClick:()=>c(f-1),disabled:f===1,accessibleWhenDisabled:!0,label:(0,Et.__)("Previous page"),icon:(0,Et.isRTL)()?Io:Bo,showTooltip:!0,size:"compact",tooltipPosition:"top"}),(0,tt.jsx)(nt.Button,{onClick:()=>c(f+1),disabled:f===bt,accessibleWhenDisabled:!0,label:(0,Et.__)("Next page"),icon:(0,Et.isRTL)()?Bo:Io,showTooltip:!0,size:"compact",tooltipPosition:"top"})]})]})]})]})}var os=ad;var Wr=u(it(),1),te=u(X(),1),bo=u(vt(),1);var ss=(t=>typeof ce<"u"?ce:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof ce<"u"?ce:e)[r]}):t)(function(t){if(typeof ce<"u")return ce.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Dl=(function(){var t,e,r;return(function(){function o(s,a,n){function l(c,d){if(!a[c]){if(!s[c]){var m=typeof ss=="function"&&ss;if(!d&&m)return m(c,!0);if(h)return h(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var y=a[c]={exports:{}};s[c][0].call(y.exports,function(_){var A=s[c][1][_];return l(A||_)},y,y.exports,o,s,a,n)}return a[c].exports}for(var h=typeof ss=="function"&&ss,f=0;f 0},c.prototype.readMoreInput=function(){if(!(this.bit_end_pos_>256))if(this.eos_){if(this.bit_pos_>this.bit_end_pos_)throw new Error("Unexpected end of input "+this.bit_pos_+" "+this.bit_end_pos_)}else{var d=this.buf_ptr_,m=this.input_.read(this.buf_,d,n);if(m<0)throw new Error("Unexpected end of input");if(m =8;)this.val_>>>=8,this.val_|=this.buf_[this.pos_&h]<<24,++this.pos_,this.bit_pos_=this.bit_pos_-8>>>0,this.bit_end_pos_=this.bit_end_pos_-8>>>0},c.prototype.readBits=function(d){32-this.bit_pos_ >>this.bit_pos_&f[d];return this.bit_pos_+=d,m},s.exports=c},{}],2:[function(o,s,a){var n=0,l=1,h=2,f=3;a.lookup=new Uint8Array([0,0,0,0,0,0,0,0,0,4,4,0,0,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,8,12,16,12,12,20,12,16,24,28,12,12,32,12,36,12,44,44,44,44,44,44,44,44,44,44,32,32,24,40,28,12,12,48,52,52,52,48,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,48,52,52,52,52,52,24,12,28,12,12,12,56,60,60,60,56,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,56,60,60,60,60,60,24,12,28,12,0,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,0,1,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,2,3,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,1,1,1,1,1,1,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,7,0,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,16,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,32,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,40,48,48,48,48,48,48,48,48,48,48,48,48,48,48,48,56,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,11,11,11,11,12,12,12,12,13,13,13,13,14,14,14,14,15,15,15,15,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,22,22,22,22,23,23,23,23,24,24,24,24,25,25,25,25,26,26,26,26,27,27,27,27,28,28,28,28,29,29,29,29,30,30,30,30,31,31,31,31,32,32,32,32,33,33,33,33,34,34,34,34,35,35,35,35,36,36,36,36,37,37,37,37,38,38,38,38,39,39,39,39,40,40,40,40,41,41,41,41,42,42,42,42,43,43,43,43,44,44,44,44,45,45,45,45,46,46,46,46,47,47,47,47,48,48,48,48,49,49,49,49,50,50,50,50,51,51,51,51,52,52,52,52,53,53,53,53,54,54,54,54,55,55,55,55,56,56,56,56,57,57,57,57,58,58,58,58,59,59,59,59,60,60,60,60,61,61,61,61,62,62,62,62,63,63,63,63,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]),a.lookupOffsets=new Uint16Array([1024,1536,1280,1536,0,256,768,512])},{}],3:[function(o,s,a){var n=o("./streams").BrotliInput,l=o("./streams").BrotliOutput,h=o("./bit_reader"),f=o("./dictionary"),c=o("./huffman").HuffmanCode,d=o("./huffman").BrotliBuildHuffmanTable,m=o("./context"),g=o("./prefix"),y=o("./transform"),_=8,A=16,k=256,x=704,b=26,T=6,Y=2,I=8,D=255,H=1080,$=18,bt=new Uint8Array([1,2,3,4,0,5,17,6,16,7,8,9,10,11,12,13,14,15]),W=16,v=new Uint8Array([3,2,1,0,3,3,3,3,3,3,2,2,2,2,2,2]),L=new Int8Array([0,0,0,0,-1,1,-2,2,-3,3,-1,1,-2,2,-3,3]),lt=new Uint16Array([256,402,436,468,500,534,566,598,630,662,694,726,758,790,822,854,886,920,952,984,1016,1048,1080]);function ot(N){var O;return N.readBits(1)===0?16:(O=N.readBits(3),O>0?17+O:(O=N.readBits(3),O>0?8+O:17))}function K(N){if(N.readBits(1)){var O=N.readBits(3);return O===0?1:N.readBits(O)+(1< 1&&dt===0)throw new Error("Invalid size byte");O.meta_block_length|=dt< 4&&rt===0)throw new Error("Invalid size nibble");O.meta_block_length|=rt< >>B.bit_pos_&D,V=N[O].bits-I,V>0&&(B.bit_pos_+=I,O+=N[O].value,O+=B.val_>>>B.bit_pos_&(1< 0;){var Ft=0,Jt;if(P.readMoreInput(),P.fillBitWindow(),Ft+=P.val_>>>P.bit_pos_&31,P.bit_pos_+=ut[Ft].bits,Jt=ut[Ft].value&255,Jt>Jt);else{var ge=Jt-14,ee,Qt,Vt=0;if(Jt===A&&(Vt=dt),st!==Vt&&(rt=0,st=Vt),ee=rt,rt>0&&(rt-=2,rt<<=ge),rt+=P.readBits(ge)+3,Qt=rt-ee,V+Qt>O)throw new Error("[ReadHuffmanCodeLengths] symbol + repeat_delta > num_symbols");for(var $t=0;$t 0;++st){var Vt=bt[st],$t=0,re;P.fillBitWindow(),$t+=P.val_>>>P.bit_pos_&15,P.bit_pos_+=Qt[$t].bits,re=Qt[$t].value,Jt[Vt]=re,re!==0&&(ge-=32>>re,++ee)}if(!(ee===1||ge===0))throw new Error("[ReadHuffmanCode] invalid num_codes or space");R(Jt,N,rt,P)}if(V=d(O,B,I,rt,N),V===0)throw new Error("[ReadHuffmanCode] BuildHuffmanTable failed: ");return V}function ct(N,O,B){var P,V;return P=S(N,O,B),V=g.kBlockLengthPrefixCode[P].nbits,g.kBlockLengthPrefixCode[P].offset+B.readBits(V)}function at(N,O,B){var P;return N >>5]),this.htrees=new Uint32Array(O)}Ot.prototype.decode=function(N){var O,B,P=0;for(O=0;O =N)throw new Error("[DecodeContextMap] i >= context_map_size");wt[rt]=0,++rt}else wt[rt]=ut-V,++rt}return O.readBits(1)&&Yt(wt,N),B}function xt(N,O,B,P,V,dt,rt){var st=B*2,wt=B,ut=S(O,B*H,rt),q;ut===0?q=V[st+(dt[wt]&1)]:ut===1?q=V[st+(dt[wt]-1&1)]+1:q=ut-2,q>=N&&(q-=N),P[B]=q,V[st+(dt[wt]&1)]=q,++dt[wt]}function At(N,O,B,P,V,dt){var rt=V+1,st=B&V,wt=dt.pos_&h.IBUF_MASK,ut;if(O<8||dt.bit_pos_+(O<<3) 0;)dt.readMoreInput(),P[st++]=dt.readBits(8),st===rt&&(N.write(P,rt),st=0);return}if(dt.bit_end_pos_<32)throw new Error("[CopyUncompressedBlockToOutput] br.bit_end_pos_ < 32");for(;dt.bit_pos_<32;)P[st]=dt.val_>>>dt.bit_pos_,dt.bit_pos_+=8,++st,--O;if(ut=dt.bit_end_pos_-dt.bit_pos_>>3,wt+ut>h.IBUF_MASK){for(var q=h.IBUF_MASK+1-wt,Ft=0;Ft =rt){N.write(P,rt),st-=rt;for(var Ft=0;Ft=rt;){if(ut=rt-st,dt.input_.read(P,st,ut) O.buffer.length){var lr=new Uint8Array(P+Mt);lr.set(O.buffer),O.buffer=lr}if(V=Ge.input_end,ko=Ge.is_uncompressed,Ge.is_metadata){for(Ce(pt);Mt>0;--Mt)pt.readMoreInput(),pt.readBits(8);continue}if(Mt!==0){if(ko){pt.bit_pos_=pt.bit_pos_+7&-8,At(O,Mt,P,q,ut,pt),P+=Mt;continue}for(B=0;B<3;++B)ye[B]=K(pt)+1,ye[B]>=2&&(et(ye[B]+2,$t,B*H,pt),et(b,re,B*H,pt),Fe[B]=ct(re,B*H,pt),M[B]=1);for(pt.readMoreInput(),i=pt.readBits(2),U=W+(pt.readBits(4)<0;){var Nt,ne,ue,_r,Cs,fe,ve,je,Jr,Pr,Qr;for(pt.readMoreInput(),Fe[1]===0&&(xt(ye[1],$t,1,Ee,w,M,pt),Fe[1]=ct(re,H,pt),qt=Vt[1].htrees[Ee[1]]),--Fe[1],Nt=S(Vt[1].codes,qt,pt),ne=Nt>>6,ne>=2?(ne-=2,ve=-1):ve=0,ue=g.kInsertRangeLut[ne]+(Nt>>3&7),_r=g.kCopyRangeLut[ne]+(Nt&7),Cs=g.kInsertLengthPrefixCode[ue].offset+pt.readBits(g.kInsertLengthPrefixCode[ue].nbits),fe=g.kCopyLengthPrefixCode[_r].offset+pt.readBits(g.kCopyLengthPrefixCode[_r].nbits),ee=q[P-1&ut],Qt=q[P-2&ut],Pr=0;Pr 4?3:fe-2)&255,It=F[ir+Jr],ve=S(Vt[2].codes,Vt[2].htrees[It],pt),ve>=U){var Fs,ta,$r;ve-=U,ta=ve&Pt,ve>>=i,Fs=(ve>>1)+1,$r=(2+(ve&1)< st)if(fe>=f.minDictionaryWordLength&&fe<=f.maxDictionaryWordLength){var $r=f.offsetsByLength[fe],ea=je-st-1,ra=f.sizeBitsByLength[fe],tf=(1< >ra;if($r+=ef*fe,oa =Ft){O.write(q,wt);for(var Oo=0;Oo 0&&(Jt[ge&3]=je,++ge),fe>Mt)throw new Error("Invalid backward reference. pos: "+P+" distance: "+je+" len: "+fe+" bytes left: "+Mt);for(Pr=0;Pr >=1;return(d&g-1)+g}function f(d,m,g,y,_){do y-=g,d[m+y]=new n(_.bits,_.value);while(y>0)}function c(d,m,g){for(var y=1< 0;--v[x])k=new n(x&255,W[b++]&65535),f(d,m+T,Y,$,k),T=h(T,x);for(D=bt-1,I=-1,x=g+1,Y=2;x<=l;++x,Y<<=1)for(;v[x]>0;--v[x])(T&D)!==I&&(m+=$,H=c(v,x,g),$=1< >g),Y,$,k),T=h(T,x);return bt}},{}],8:[function(o,s,a){"use strict";a.byteLength=g,a.toByteArray=_,a.fromByteArray=x;for(var n=[],l=[],h=typeof Uint8Array<"u"?Uint8Array:Array,f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",c=0,d=f.length;c 0)throw new Error("Invalid string. Length must be a multiple of 4");var Y=b.indexOf("=");Y===-1&&(Y=T);var I=Y===T?0:4-Y%4;return[Y,I]}function g(b){var T=m(b),Y=T[0],I=T[1];return(Y+I)*3/4-I}function y(b,T,Y){return(T+Y)*3/4-Y}function _(b){for(var T,Y=m(b),I=Y[0],D=Y[1],H=new h(y(b,I,D)),$=0,bt=D>0?I-4:I,W=0;W >16&255,H[$++]=T>>8&255,H[$++]=T&255;return D===2&&(T=l[b.charCodeAt(W)]<<2|l[b.charCodeAt(W+1)]>>4,H[$++]=T&255),D===1&&(T=l[b.charCodeAt(W)]<<10|l[b.charCodeAt(W+1)]<<4|l[b.charCodeAt(W+2)]>>2,H[$++]=T>>8&255,H[$++]=T&255),H}function A(b){return n[b>>18&63]+n[b>>12&63]+n[b>>6&63]+n[b&63]}function k(b,T,Y){for(var I,D=[],H=T;H bt?bt:$+H));return I===1?(T=b[Y-1],D.push(n[T>>2]+n[T<<4&63]+"==")):I===2&&(T=(b[Y-2]<<8)+b[Y-1],D.push(n[T>>10]+n[T>>4&63]+n[T<<2&63]+"=")),D.join("")}},{}],9:[function(o,s,a){function n(l,h){this.offset=l,this.nbits=h}a.kBlockLengthPrefixCode=[new n(1,2),new n(5,2),new n(9,2),new n(13,2),new n(17,3),new n(25,3),new n(33,3),new n(41,3),new n(49,4),new n(65,4),new n(81,4),new n(97,4),new n(113,5),new n(145,5),new n(177,5),new n(209,5),new n(241,6),new n(305,6),new n(369,7),new n(497,8),new n(753,9),new n(1265,10),new n(2289,11),new n(4337,12),new n(8433,13),new n(16625,24)],a.kInsertLengthPrefixCode=[new n(0,0),new n(1,0),new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,1),new n(8,1),new n(10,2),new n(14,2),new n(18,3),new n(26,3),new n(34,4),new n(50,4),new n(66,5),new n(98,5),new n(130,6),new n(194,7),new n(322,8),new n(578,9),new n(1090,10),new n(2114,12),new n(6210,14),new n(22594,24)],a.kCopyLengthPrefixCode=[new n(2,0),new n(3,0),new n(4,0),new n(5,0),new n(6,0),new n(7,0),new n(8,0),new n(9,0),new n(10,1),new n(12,1),new n(14,2),new n(18,2),new n(22,3),new n(30,3),new n(38,4),new n(54,4),new n(70,5),new n(102,5),new n(134,6),new n(198,7),new n(326,8),new n(582,9),new n(1094,10),new n(2118,24)],a.kInsertRangeLut=[0,0,8,8,0,16,8,16,16],a.kCopyRangeLut=[0,8,0,8,16,0,16,8,16]},{}],10:[function(o,s,a){function n(h){this.buffer=h,this.pos=0}n.prototype.read=function(h,f,c){this.pos+c>this.buffer.length&&(c=this.buffer.length-this.pos);for(var d=0;d this.buffer.length)throw new Error("Output buffer is not large enough");return this.buffer.set(h.subarray(0,f),this.pos),this.pos+=f,f},a.BrotliOutput=l},{}],11:[function(o,s,a){var n=o("./dictionary"),l=0,h=1,f=2,c=3,d=4,m=5,g=6,y=7,_=8,A=9,k=10,x=11,b=12,T=13,Y=14,I=15,D=16,H=17,$=18,bt=19,W=20;function v(ot,K,gt){this.prefix=new Uint8Array(ot.length),this.transform=K,this.suffix=new Uint8Array(gt.length);for(var E=0;E '),new v("",l,` +`),new v("",c,""),new v("",l,"]"),new v("",l," for "),new v("",Y,""),new v("",f,""),new v("",l," a "),new v("",l," that "),new v(" ",k,""),new v("",l,". "),new v(".",l,""),new v(" ",l,", "),new v("",I,""),new v("",l," with "),new v("",l,"'"),new v("",l," from "),new v("",l," by "),new v("",D,""),new v("",H,""),new v(" the ",l,""),new v("",d,""),new v("",l,". The "),new v("",x,""),new v("",l," on "),new v("",l," as "),new v("",l," is "),new v("",y,""),new v("",h,"ing "),new v("",l,` + `),new v("",l,":"),new v(" ",l,". "),new v("",l,"ed "),new v("",W,""),new v("",$,""),new v("",g,""),new v("",l,"("),new v("",k,", "),new v("",_,""),new v("",l," at "),new v("",l,"ly "),new v(" the ",l," of "),new v("",m,""),new v("",A,""),new v(" ",k,", "),new v("",k,'"'),new v(".",l,"("),new v("",x," "),new v("",k,'">'),new v("",l,'="'),new v(" ",l,"."),new v(".com/",l,""),new v(" the ",l," of the "),new v("",k,"'"),new v("",l,". This "),new v("",l,","),new v(".",l," "),new v("",k,"("),new v("",k,"."),new v("",l," not "),new v(" ",l,'="'),new v("",l,"er "),new v(" ",x," "),new v("",l,"al "),new v(" ",x,""),new v("",l,"='"),new v("",x,'"'),new v("",k,". "),new v(" ",l,"("),new v("",l,"ful "),new v(" ",k,". "),new v("",l,"ive "),new v("",l,"less "),new v("",x,"'"),new v("",l,"est "),new v(" ",k,"."),new v("",x,'">'),new v(" ",l,"='"),new v("",k,","),new v("",l,"ize "),new v("",x,"."),new v("\xC2\xA0",l,""),new v(" ",l,","),new v("",k,'="'),new v("",x,'="'),new v("",l,"ous "),new v("",x,", "),new v("",k,"='"),new v(" ",k,","),new v(" ",x,'="'),new v(" ",x,", "),new v("",x,","),new v("",x,"("),new v("",x,". "),new v(" ",x,"."),new v("",x,"='"),new v(" ",x,". "),new v(" ",k,'="'),new v(" ",x,"='"),new v(" ",k,"='")];a.kTransforms=L,a.kNumTransforms=L.length;function lt(ot,K){return ot[K]<192?(ot[K]>=97&&ot[K]<=122&&(ot[K]^=32),1):ot[K]<224?(ot[K+1]^=32,2):(ot[K+2]^=5,3)}a.transformDictionaryWord=function(ot,K,gt,E,S){var R=L[S].prefix,et=L[S].suffix,ct=L[S].transform,at=ctE&&(at=E);for(var J=0;J 0;){var xt=lt(ot,Ot);Ot+=xt,E-=xt}for(var At=0;At typeof ce<"u"?ce:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof ce<"u"?ce:e)[r]}):t)(function(t){if(typeof ce<"u")return ce.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')}),Nl=(function(){var t,e,r;return(function(){function o(s,a,n){function l(c,d){if(!a[c]){if(!s[c]){var m=typeof ns=="function"&&ns;if(!d&&m)return m(c,!0);if(h)return h(c,!0);var g=new Error("Cannot find module '"+c+"'");throw g.code="MODULE_NOT_FOUND",g}var y=a[c]={exports:{}};s[c][0].call(y.exports,function(_){var A=s[c][1][_];return l(A||_)},y,y.exports,o,s,a,n)}return a[c].exports}for(var h=typeof ns=="function"&&ns,f=0;f =252?6:c>=248?5:c>=240?4:c>=224?3:c>=192?2:1;f[254]=f[254]=1,a.string2buf=function(m){var g,y,_,A,k,x=m.length,b=0;for(A=0;A >>6,g[k++]=128|y&63):y<65536?(g[k++]=224|y>>>12,g[k++]=128|y>>>6&63,g[k++]=128|y&63):(g[k++]=240|y>>>18,g[k++]=128|y>>>12&63,g[k++]=128|y>>>6&63,g[k++]=128|y&63);return g};function d(m,g){if(g<65534&&(m.subarray&&h||!m.subarray&&l))return String.fromCharCode.apply(null,n.shrinkBuf(m,g));for(var y="",_=0;_ 4){b[_++]=65533,y+=k-1;continue}for(A&=k===2?31:k===3?15:7;k>1&&y 1){b[_++]=65533;continue}A<65536?b[_++]=A:(A-=65536,b[_++]=55296|A>>10&1023,b[_++]=56320|A&1023)}return d(b,_)},a.utf8border=function(m,g){var y;for(g=g||m.length,g>m.length&&(g=m.length),y=g-1;y>=0&&(m[y]&192)===128;)y--;return y<0||y===0?g:y+f[m[y]]>g?y:g}},{"./common":1}],3:[function(o,s,a){"use strict";function n(l,h,f,c){for(var d=l&65535|0,m=l>>>16&65535|0,g=0;f!==0;){g=f>2e3?2e3:f,f-=g;do d=d+h[c++]|0,m=m+d|0;while(--g);d%=65521,m%=65521}return d|m<<16|0}s.exports=n},{}],4:[function(o,s,a){"use strict";s.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],5:[function(o,s,a){"use strict";function n(){for(var f,c=[],d=0;d<256;d++){f=d;for(var m=0;m<8;m++)f=f&1?3988292384^f>>>1:f>>>1;c[d]=f}return c}var l=n();function h(f,c,d,m){var g=l,y=m+d;f^=-1;for(var _=m;_ >>8^g[(f^c[_])&255];return f^-1}s.exports=h},{}],6:[function(o,s,a){"use strict";function n(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}s.exports=n},{}],7:[function(o,s,a){"use strict";var n=30,l=12;s.exports=function(f,c){var d,m,g,y,_,A,k,x,b,T,Y,I,D,H,$,bt,W,v,L,lt,ot,K,gt,E,S;d=f.state,m=f.next_in,E=f.input,g=m+(f.avail_in-5),y=f.next_out,S=f.output,_=y-(c-f.avail_out),A=y+(f.avail_out-257),k=d.dmax,x=d.wsize,b=d.whave,T=d.wnext,Y=d.window,I=d.hold,D=d.bits,H=d.lencode,$=d.distcode,bt=(1< >>24,I>>>=L,D-=L,L=v>>>16&255,L===0)S[y++]=v&65535;else if(L&16){lt=v&65535,L&=15,L&&(D >>=L,D-=L),D<15&&(I+=E[m++]< >>24,I>>>=L,D-=L,L=v>>>16&255,L&16){if(ot=v&65535,L&=15,D k){f.msg="invalid distance too far back",d.mode=n;break t}if(I>>>=L,D-=L,L=y-_,ot>L){if(L=ot-L,L>b&&d.sane){f.msg="invalid distance too far back",d.mode=n;break t}if(K=0,gt=Y,T===0){if(K+=x-L,L 2;)S[y++]=gt[K++],S[y++]=gt[K++],S[y++]=gt[K++],lt-=3;lt&&(S[y++]=gt[K++],lt>1&&(S[y++]=gt[K++]))}else{K=y-ot;do S[y++]=S[K++],S[y++]=S[K++],S[y++]=S[K++],lt-=3;while(lt>2);lt&&(S[y++]=S[K++],lt>1&&(S[y++]=S[K++]))}}else if((L&64)===0){v=$[(v&65535)+(I&(1< >3,m-=lt,D-=lt<<3,I&=(1< >>24&255)+(w>>>8&65280)+((w&65280)<<8)+((w&255)<<24)}function Jt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function ge(w){var M;return!w||!w.state?T:(M=w.state,w.total_in=w.total_out=M.total=0,w.msg="",M.wrap&&(w.adler=M.wrap&1),M.mode=$,M.last=0,M.havedict=0,M.dmax=32768,M.head=null,M.hold=0,M.bits=0,M.lencode=M.lendyn=new n.Buf32(st),M.distcode=M.distdyn=new n.Buf32(wt),M.sane=1,M.back=-1,k)}function ee(w){var M;return!w||!w.state?T:(M=w.state,M.wsize=0,M.whave=0,M.wnext=0,ge(w))}function Qt(w,M){var i,U;return!w||!w.state||(U=w.state,M<0?(i=0,M=-M):(i=(M>>4)+1,M<48&&(M&=15)),M&&(M<8||M>15))?T:(U.window!==null&&U.wbits!==M&&(U.window=null),U.wrap=i,U.wbits=M,ee(w))}function Vt(w,M){var i,U;return w?(U=new Jt,w.state=U,U.window=null,i=Qt(w,M),i!==k&&(w.state=null),i):T}function $t(w){return Vt(w,q)}var re=!0,pt,Kr;function Tr(w){if(re){var M;for(pt=new n.Buf32(512),Kr=new n.Buf32(32),M=0;M<144;)w.lens[M++]=8;for(;M<256;)w.lens[M++]=9;for(;M<280;)w.lens[M++]=7;for(;M<288;)w.lens[M++]=8;for(c(m,w.lens,0,288,pt,0,w.work,{bits:9}),M=0;M<32;)w.lens[M++]=5;c(g,w.lens,0,32,Kr,0,w.work,{bits:5}),re=!1}w.lencode=pt,w.lenbits=9,w.distcode=Kr,w.distbits=5}function Mt(w,M,i,U){var Pt,G=w.state;return G.window===null&&(G.wsize=1< =G.wsize?(n.arraySet(G.window,M,i-G.wsize,G.wsize,0),G.wnext=0,G.whave=G.wsize):(Pt=G.wsize-G.wnext,Pt>U&&(Pt=U),n.arraySet(G.window,M,i-U,Pt,G.wnext),U-=Pt,U?(n.arraySet(G.window,M,i-U,U,0),G.wnext=U,G.whave=G.wsize):(G.wnext+=Pt,G.wnext===G.wsize&&(G.wnext=0),G.whave >>8&255,i.check=h(i.check,Nt,2,0),F=0,C=0,i.mode=bt;break}if(i.flags=0,i.head&&(i.head.done=!1),!(i.wrap&1)||(((F&255)<<8)+(F>>8))%31){w.msg="incorrect header check",i.mode=V;break}if((F&15)!==H){w.msg="unknown compression method",i.mode=V;break}if(F>>>=4,C-=4,Lt=(F&15)+8,i.wbits===0)i.wbits=Lt;else if(Lt>i.wbits){w.msg="invalid window size",i.mode=V;break}i.dmax=1< >8&1),i.flags&512&&(Nt[0]=F&255,Nt[1]=F>>>8&255,i.check=h(i.check,Nt,2,0)),F=0,C=0,i.mode=W;case W:for(;C<32;){if(j===0)break t;j--,F+=U[G++]< >>8&255,Nt[2]=F>>>16&255,Nt[3]=F>>>24&255,i.check=h(i.check,Nt,4,0)),F=0,C=0,i.mode=v;case v:for(;C<16;){if(j===0)break t;j--,F+=U[G++]< >8),i.flags&512&&(Nt[0]=F&255,Nt[1]=F>>>8&255,i.check=h(i.check,Nt,2,0)),F=0,C=0,i.mode=L;case L:if(i.flags&1024){for(;C<16;){if(j===0)break t;j--,F+=U[G++]< >>8&255,i.check=h(i.check,Nt,2,0)),F=0,C=0}else i.head&&(i.head.extra=null);i.mode=lt;case lt:if(i.flags&1024&&(Q=i.length,Q>j&&(Q=j),Q&&(i.head&&(Lt=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Array(i.head.extra_len)),n.arraySet(i.head.extra,U,G,Q,Lt)),i.flags&512&&(i.check=h(i.check,U,Q,G)),j-=Q,G+=Q,i.length-=Q),i.length))break t;i.length=0,i.mode=ot;case ot:if(i.flags&2048){if(j===0)break t;Q=0;do Lt=U[G+Q++],i.head&&Lt&&i.length<65536&&(i.head.name+=String.fromCharCode(Lt));while(Lt&&Q >9&1,i.head.done=!0),w.adler=i.check=0,i.mode=R;break;case E:for(;C<32;){if(j===0)break t;j--,F+=U[G++]< >>=C&7,C-=C&7,i.mode=O;break}for(;C<3;){if(j===0)break t;j--,F+=U[G++]< >>=1,C-=1,F&3){case 0:i.mode=ct;break;case 1:if(Tr(i),i.mode=xt,M===A){F>>>=2,C-=2;break t}break;case 2:i.mode=Yt;break;case 3:w.msg="invalid block type",i.mode=V}F>>>=2,C-=2;break;case ct:for(F>>>=C&7,C-=C&7;C<32;){if(j===0)break t;j--,F+=U[G++]< >>16^65535)){w.msg="invalid stored block lengths",i.mode=V;break}if(i.length=F&65535,F=0,C=0,i.mode=at,M===A)break t;case at:i.mode=Ct;case Ct:if(Q=i.length,Q){if(Q>j&&(Q=j),Q>Dt&&(Q=Dt),Q===0)break t;n.arraySet(Pt,U,G,Q,oe),j-=Q,G+=Q,Dt-=Q,oe+=Q,i.length-=Q;break}i.mode=R;break;case Yt:for(;C<14;){if(j===0)break t;j--,F+=U[G++]< >>=5,C-=5,i.ndist=(F&31)+1,F>>>=5,C-=5,i.ncode=(F&15)+4,F>>>=4,C-=4,i.nlen>286||i.ndist>30){w.msg="too many length or distance symbols",i.mode=V;break}i.have=0,i.mode=Ot;case Ot:for(;i.have >>=3,C-=3}for(;i.have<19;)i.lens[_r[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,ne={bits:i.lenbits},se=c(d,i.lens,0,19,i.lencode,0,i.work,ne),i.lenbits=ne.bits,se){w.msg="invalid code lengths set",i.mode=V;break}i.have=0,i.mode=J;case J:for(;i.have >>24,Gt=It>>>16&255,jt=It&65535,!(St<=C);){if(j===0)break t;j--,F+=U[G++]< >>=St,C-=St,i.lens[i.have++]=jt;else{if(jt===16){for(ue=St+2;C >>=St,C-=St,i.have===0){w.msg="invalid bit length repeat",i.mode=V;break}Lt=i.lens[i.have-1],Q=3+(F&3),F>>>=2,C-=2}else if(jt===17){for(ue=St+3;C >>=St,C-=St,Lt=0,Q=3+(F&7),F>>>=3,C-=3}else{for(ue=St+7;C >>=St,C-=St,Lt=0,Q=11+(F&127),F>>>=7,C-=7}if(i.have+Q>i.nlen+i.ndist){w.msg="invalid bit length repeat",i.mode=V;break}for(;Q--;)i.lens[i.have++]=Lt}}if(i.mode===V)break;if(i.lens[256]===0){w.msg="invalid code -- missing end-of-block",i.mode=V;break}if(i.lenbits=9,ne={bits:i.lenbits},se=c(m,i.lens,0,i.nlen,i.lencode,0,i.work,ne),i.lenbits=ne.bits,se){w.msg="invalid literal/lengths set",i.mode=V;break}if(i.distbits=6,i.distcode=i.distdyn,ne={bits:i.distbits},se=c(g,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,ne),i.distbits=ne.bits,se){w.msg="invalid distances set",i.mode=V;break}if(i.mode=xt,M===A)break t;case xt:i.mode=At;case At:if(j>=6&&Dt>=258){w.next_out=oe,w.avail_out=Dt,w.next_in=G,w.avail_in=j,i.hold=F,i.bits=C,f(w,Tt),oe=w.next_out,Pt=w.output,Dt=w.avail_out,G=w.next_in,U=w.input,j=w.avail_in,F=i.hold,C=i.bits,i.mode===R&&(i.back=-1);break}for(i.back=0;It=i.lencode[F&(1< >>24,Gt=It>>>16&255,jt=It&65535,!(St<=C);){if(j===0)break t;j--,F+=U[G++]< >qt)],St=It>>>24,Gt=It>>>16&255,jt=It&65535,!(qt+St<=C);){if(j===0)break t;j--,F+=U[G++]< >>=qt,C-=qt,i.back+=qt}if(F>>>=St,C-=St,i.back+=St,i.length=jt,Gt===0){i.mode=N;break}if(Gt&32){i.back=-1,i.mode=R;break}if(Gt&64){w.msg="invalid literal/length code",i.mode=V;break}i.extra=Gt&15,i.mode=Ce;case Ce:if(i.extra){for(ue=i.extra;C >>=i.extra,C-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=zt;case zt:for(;It=i.distcode[F&(1< >>24,Gt=It>>>16&255,jt=It&65535,!(St<=C);){if(j===0)break t;j--,F+=U[G++]< >qt)],St=It>>>24,Gt=It>>>16&255,jt=It&65535,!(qt+St<=C);){if(j===0)break t;j--,F+=U[G++]< >>=qt,C-=qt,i.back+=qt}if(F>>>=St,C-=St,i.back+=St,Gt&64){w.msg="invalid distance code",i.mode=V;break}i.offset=jt,i.extra=Gt&15,i.mode=sr;case sr:if(i.extra){for(ue=i.extra;C >>=i.extra,C-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){w.msg="invalid distance too far back",i.mode=V;break}i.mode=Ke;case Ke:if(Dt===0)break t;if(Q=Tt-Dt,i.offset>Q){if(Q=i.offset-Q,Q>i.whave&&i.sane){w.msg="invalid distance too far back",i.mode=V;break}Q>i.wnext?(Q-=i.wnext,ar=i.wsize-Q):ar=i.wnext-Q,Q>i.length&&(Q=i.length),ir=i.window}else ir=Pt,ar=oe-i.offset,Q=i.length;Q>Dt&&(Q=Dt),Dt-=Q,i.length-=Q;do Pt[oe++]=ir[ar++];while(--Q);i.length===0&&(i.mode=At);break;case N:if(Dt===0)break t;Pt[oe++]=i.length,Dt--,i.mode=At;break;case O:if(i.wrap){for(;C<32;){if(j===0)break t;j--,F|=U[G++]< =1&&At[lt]===0;lt--);if(ot>lt&&(ot=lt),lt===0)return I[D++]=1<<24|64<<16|0,I[D++]=1<<24|64<<16|0,$.bits=1,0;for(L=1;L 0&&(x===c||lt!==1))return-1;for(Ce[1]=0,W=1;W h||x===m&&S>f)return 1;for(;;){Ke=W-gt,H[v] xt?(N=zt[sr+H[v]],O=Ot[J+H[v]]):(N=96,O=0),et=1< >gt)+ct]=Ke<<24|N<<16|O|0;while(ct!==0);for(et=1< >=1;if(et!==0?(R&=et-1,R+=et):R=0,v++,--At[W]===0){if(W===lt)break;W=b[T+H[v]]}if(W>ot&&(R&Ct)!==at){for(gt===0&&(gt=ot),Yt+=L,K=W-gt,E=1< h||x===m&&S>f)return 1;at=R&Ct,I[at]=ot<<24|K<<16|Yt-D|0}}return R!==0&&(I[Yt+R]=W-gt<<24|64<<16|0),$.bits=ot,0}},{"../utils/common":1}],10:[function(o,s,a){"use strict";s.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],11:[function(o,s,a){"use strict";function n(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}s.exports=n},{}],"/lib/inflate.js":[function(o,s,a){"use strict";var n=o("./zlib/inflate"),l=o("./utils/common"),h=o("./utils/strings"),f=o("./zlib/constants"),c=o("./zlib/messages"),d=o("./zlib/zstream"),m=o("./zlib/gzheader"),g=Object.prototype.toString;function y(k){if(!(this instanceof y))return new y(k);this.options=l.assign({chunkSize:16384,windowBits:0,to:""},k||{});var x=this.options;x.raw&&x.windowBits>=0&&x.windowBits<16&&(x.windowBits=-x.windowBits,x.windowBits===0&&(x.windowBits=-15)),x.windowBits>=0&&x.windowBits<16&&!(k&&k.windowBits)&&(x.windowBits+=32),x.windowBits>15&&x.windowBits<48&&(x.windowBits&15)===0&&(x.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new d,this.strm.avail_out=0;var b=n.inflateInit2(this.strm,x.windowBits);if(b!==f.Z_OK)throw new Error(c[b]);if(this.header=new m,n.inflateGetHeader(this.strm,this.header),x.dictionary&&(typeof x.dictionary=="string"?x.dictionary=h.string2buf(x.dictionary):g.call(x.dictionary)==="[object ArrayBuffer]"&&(x.dictionary=new Uint8Array(x.dictionary)),x.raw&&(b=n.inflateSetDictionary(this.strm,x.dictionary),b!==f.Z_OK)))throw new Error(c[b])}y.prototype.push=function(k,x){var b=this.strm,T=this.options.chunkSize,Y=this.options.dictionary,I,D,H,$,bt,W=!1;if(this.ended)return!1;D=x===~~x?x:x===!0?f.Z_FINISH:f.Z_NO_FLUSH,typeof k=="string"?b.input=h.binstring2buf(k):g.call(k)==="[object ArrayBuffer]"?b.input=new Uint8Array(k):b.input=k,b.next_in=0,b.avail_in=b.input.length;do{if(b.avail_out===0&&(b.output=new l.Buf8(T),b.next_out=0,b.avail_out=T),I=n.inflate(b,f.Z_NO_FLUSH),I===f.Z_NEED_DICT&&Y&&(I=n.inflateSetDictionary(this.strm,Y)),I===f.Z_BUF_ERROR&&W===!0&&(I=f.Z_OK,W=!1),I!==f.Z_STREAM_END&&I!==f.Z_OK)return this.onEnd(I),this.ended=!0,!1;b.next_out&&(b.avail_out===0||I===f.Z_STREAM_END||b.avail_in===0&&(D===f.Z_FINISH||D===f.Z_SYNC_FLUSH))&&(this.options.to==="string"?(H=h.utf8border(b.output,b.next_out),$=b.next_out-H,bt=h.buf2string(b.output,H),b.next_out=$,b.avail_out=T-$,$&&l.arraySet(b.output,b.output,H,$,0),this.onData(bt)):this.onData(l.shrinkBuf(b.output,b.next_out))),b.avail_in===0&&b.avail_out===0&&(W=!0)}while((b.avail_in>0||b.avail_out===0)&&I!==f.Z_STREAM_END);return I===f.Z_STREAM_END&&(D=f.Z_FINISH),D===f.Z_FINISH?(I=n.inflateEnd(this.strm),this.onEnd(I),this.ended=!0,I===f.Z_OK):(D===f.Z_SYNC_FLUSH&&(this.onEnd(f.Z_OK),b.avail_out=0),!0)},y.prototype.onData=function(k){this.chunks.push(k)},y.prototype.onEnd=function(k){k===f.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=l.flattenChunks(this.chunks)),this.chunks=[],this.err=k,this.msg=this.strm.msg};function _(k,x){var b=new y(x);if(b.push(k,!0),b.err)throw b.msg||c[b.err];return b.result}function A(k,x){return x=x||{},x.raw=!0,_(k,x)}a.Inflate=y,a.inflate=_,a.inflateRaw=A,a.ungzip=_},{"./utils/common":1,"./utils/strings":2,"./zlib/constants":4,"./zlib/gzheader":6,"./zlib/inflate":8,"./zlib/messages":10,"./zlib/zstream":11}]},{},[])("/lib/inflate.js")})();var Fw=globalThis.fetch,as=class{constructor(t,e={},r){this.type=t,this.detail=e,this.msg=r,Object.defineProperty(this,"__mayPropagate",{enumerable:!1,writable:!0}),this.__mayPropagate=!0}preventDefault(){}stopPropagation(){this.__mayPropagate=!1}valueOf(){return this}toString(){return this.msg?`[${this.type} event]: ${this.msg}`:`[${this.type} event]`}},id=class{constructor(){this.listeners={}}addEventListener(t,e,r){let o=this.listeners[t]||[];r?o.unshift(e):o.push(e),this.listeners[t]=o}removeEventListener(t,e){let r=this.listeners[t]||[],o=r.findIndex(s=>s===e);o>-1&&(r.splice(o,1),this.listeners[t]=r)}dispatch(t){let e=this.listeners[t.type];if(e)for(let r=0,o=e.length;r String.fromCharCode(e)).join("")}var fd=class{constructor(t,e,r){this.name=(r||t.tag||"").trim(),this.length=t.length,this.start=t.offset,this.offset=0,this.data=e,["getInt8","getUint8","getInt16","getUint16","getInt32","getUint32","getBigInt64","getBigUint64"].forEach(o=>{let s=o.replace(/get(Big)?/,"").toLowerCase(),a=parseInt(o.replace(/[^\d]/g,""))/8;Object.defineProperty(this,s,{get:()=>this.getValue(o,a)})})}get currentPosition(){return this.start+this.offset}set currentPosition(t){this.start=t,this.offset=0}skip(t=0,e=8){this.offset+=t*e/8}getValue(t,e){let r=this.start+this.offset;this.offset+=e;try{return this.data[t](r)}catch(o){throw console.error("parser",t,e,this),console.error("parser",this.start,this.offset),o}}flags(t){if(t===8||t===16||t===32||t===64)return this[`uint${t}`].toString(2).padStart(t,0).split("").map(e=>e==="1");console.error("Error parsing flags: flag types can only be 1, 2, 4, or 8 bytes long"),console.trace()}get tag(){let t=this.uint32;return ud([t>>24&255,t>>16&255,t>>8&255,t&255])}get fixed(){let t=this.int16,e=Math.round(1e3*this.uint16/65356);return t+e/1e3}get legacyFixed(){let t=this.uint16,e=this.uint16.toString(16).padStart(4,0);return parseFloat(`${t}.${e}`)}get uint24(){return(this.uint8<<16)+(this.uint8<<8)+this.uint8}get uint128(){let t=0;for(let e=0;e<5;e++){let r=this.uint8;if(t=t*128+(r&127),r<128)break}return t}get longdatetime(){return new Date(ld+1e3*parseInt(this.int64.toString()))}get fword(){return this.int16}get ufword(){return this.uint16}get Offset16(){return this.uint16}get Offset32(){return this.uint32}get F2DOT14(){let t=p.uint16,e=[0,1,-2,-1][t>>14],r=t&16383;return e+r/16384}verifyLength(){this.offset!=this.length&&console.error(`unexpected parsed table size (${this.offset}) for "${this.name}" (expected ${this.length})`)}readBytes(t=0,e=0,r=8,o=!1){if(t=t||this.length,t===0)return[];e&&(this.currentPosition=e);let s=`${o?"":"u"}int${r}`,a=[];for(;t--;)a.push(this[s]);return a}},Bt=class{constructor(t){Object.defineProperty(this,"parser",{enumerable:!1,get:()=>t});let r=t.currentPosition;Object.defineProperty(this,"start",{enumerable:!1,get:()=>r})}load(t){Object.keys(t).forEach(e=>{let r=Object.getOwnPropertyDescriptor(t,e);r.get?this[e]=r.get.bind(this):r.value!==void 0&&(this[e]=r.value)}),this.parser.length&&this.parser.verifyLength()}},mt=class extends Bt{constructor(t,e,r){let{parser:o,start:s}=super(new fd(t,e,r));Object.defineProperty(this,"p",{enumerable:!1,get:()=>o}),Object.defineProperty(this,"tableStart",{enumerable:!1,get:()=>s})}};function Z(t,e,r){let o;Object.defineProperty(t,e,{get:()=>o||(o=r(),o),enumerable:!0})}var cd=class extends mt{constructor(t,e,r){let{p:o}=super({offset:0,length:12},e,"sfnt");this.version=o.uint32,this.numTables=o.uint16,this.searchRange=o.uint16,this.entrySelector=o.uint16,this.rangeShift=o.uint16,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(s=>new dd(o)),this.tables={},this.directory.forEach(s=>{let a=()=>r(this.tables,{tag:s.tag,offset:s.offset,length:s.length},e);Z(this.tables,s.tag.trim(),a)})}},dd=class{constructor(t){this.tag=t.tag,this.checksum=t.uint32,this.offset=t.uint32,this.length=t.uint32}},zl=Nl.inflate||void 0,Ml=void 0,md=class extends mt{constructor(t,e,r){let{p:o}=super({offset:0,length:44},e,"woff");this.signature=o.tag,this.flavor=o.uint32,this.length=o.uint32,this.numTables=o.uint16,o.uint16,this.totalSfntSize=o.uint32,this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.metaOffset=o.uint32,this.metaLength=o.uint32,this.metaOrigLength=o.uint32,this.privOffset=o.uint32,this.privLength=o.uint32,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(s=>new pd(o)),hd(this,e,r)}},pd=class{constructor(t){this.tag=t.tag,this.offset=t.uint32,this.compLength=t.uint32,this.origLength=t.uint32,this.origChecksum=t.uint32}};function hd(t,e,r){t.tables={},t.directory.forEach(o=>{Z(t.tables,o.tag.trim(),()=>{let s=0,a=e;if(o.compLength!==o.origLength){let n=e.buffer.slice(o.offset,o.offset+o.compLength),l;if(zl)l=zl(new Uint8Array(n));else if(Ml)l=Ml(new Uint8Array(n));else{let h="no brotli decoder available to decode WOFF2 font";throw font.onerror&&font.onerror(h),new Error(h)}a=new DataView(l.buffer)}else s=o.offset;return r(t.tables,{tag:o.tag,offset:s,length:o.origLength},a)})})}var Gl=Dl,jl=void 0,gd=class extends mt{constructor(t,e,r){let{p:o}=super({offset:0,length:48},e,"woff2");this.signature=o.tag,this.flavor=o.uint32,this.length=o.uint32,this.numTables=o.uint16,o.uint16,this.totalSfntSize=o.uint32,this.totalCompressedSize=o.uint32,this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.metaOffset=o.uint32,this.metaLength=o.uint32,this.metaOrigLength=o.uint32,this.privOffset=o.uint32,this.privLength=o.uint32,o.verifyLength(),this.directory=[...new Array(this.numTables)].map(l=>new yd(o));let s=o.currentPosition;this.directory[0].offset=0,this.directory.forEach((l,h)=>{let f=this.directory[h+1];f&&(f.offset=l.offset+(l.transformLength!==void 0?l.transformLength:l.origLength))});let a,n=e.buffer.slice(s);if(Gl)a=Gl(new Uint8Array(n));else if(jl)a=new Uint8Array(jl(n));else{let l="no brotli decoder available to decode WOFF2 font";throw t.onerror&&t.onerror(l),new Error(l)}vd(this,a,r)}},yd=class{constructor(t){this.flags=t.uint8;let e=this.tagNumber=this.flags&63;e===63?this.tag=t.tag:this.tag=bd(e);let o=(this.transformVersion=(this.flags&192)>>6)!==0;(this.tag==="glyf"||this.tag==="loca")&&(o=this.transformVersion!==3),this.origLength=t.uint128,o&&(this.transformLength=t.uint128)}};function vd(t,e,r){t.tables={},t.directory.forEach(o=>{Z(t.tables,o.tag.trim(),()=>{let s=o.offset,a=s+(o.transformLength?o.transformLength:o.origLength),n=new DataView(e.slice(s,a).buffer);try{return r(t.tables,{tag:o.tag,offset:0,length:o.origLength},n)}catch(l){console.error(l)}})})}function bd(t){return["cmap","head","hhea","hmtx","maxp","name","OS/2","post","cvt ","fpgm","glyf","loca","prep","CFF ","VORG","EBDT","EBLC","gasp","hdmx","kern","LTSH","PCLT","VDMX","vhea","vmtx","BASE","GDEF","GPOS","GSUB","EBSC","JSTF","MATH","CBDT","CBLC","COLR","CPAL","SVG ","sbix","acnt","avar","bdat","bloc","bsln","cvar","fdsc","feat","fmtx","fvar","gvar","hsty","just","lcar","mort","morx","opbd","prop","trak","Zapf","Silf","Glat","Gloc","Feat","Sill"][t&63]}var Xl={},Kl=!1;Promise.all([Promise.resolve().then(function(){return qd}),Promise.resolve().then(function(){return Xd}),Promise.resolve().then(function(){return Jd}),Promise.resolve().then(function(){return tm}),Promise.resolve().then(function(){return rm}),Promise.resolve().then(function(){return im}),Promise.resolve().then(function(){return um}),Promise.resolve().then(function(){return cm}),Promise.resolve().then(function(){return Sm}),Promise.resolve().then(function(){return Rm}),Promise.resolve().then(function(){return bp}),Promise.resolve().then(function(){return Sp}),Promise.resolve().then(function(){return kp}),Promise.resolve().then(function(){return Pp}),Promise.resolve().then(function(){return Ep}),Promise.resolve().then(function(){return Ip}),Promise.resolve().then(function(){return Vp}),Promise.resolve().then(function(){return Np}),Promise.resolve().then(function(){return Mp}),Promise.resolve().then(function(){return jp}),Promise.resolve().then(function(){return Hp}),Promise.resolve().then(function(){return Yp}),Promise.resolve().then(function(){return Xp}),Promise.resolve().then(function(){return Qp}),Promise.resolve().then(function(){return $p}),Promise.resolve().then(function(){return eh}),Promise.resolve().then(function(){return oh}),Promise.resolve().then(function(){return nh}),Promise.resolve().then(function(){return ih}),Promise.resolve().then(function(){return fh}),Promise.resolve().then(function(){return gh}),Promise.resolve().then(function(){return wh}),Promise.resolve().then(function(){return Ch}),Promise.resolve().then(function(){return Th}),Promise.resolve().then(function(){return Ph}),Promise.resolve().then(function(){return Eh}),Promise.resolve().then(function(){return Lh}),Promise.resolve().then(function(){return Vh}),Promise.resolve().then(function(){return Gh}),Promise.resolve().then(function(){return Uh}),Promise.resolve().then(function(){return Yh})]).then(t=>{t.forEach(e=>{let r=Object.keys(e)[0];Xl[r]=e[r]}),Kl=!0});function wd(t,e,r){let o=e.tag.replace(/[^\w\d]/g,""),s=Xl[o];return s?new s(e,r,t):(console.warn(`lib-font has no definition for ${o}. The table was skipped.`),{})}function Sd(){let t=0;function e(r,o){if(!Kl)return t>10?o(new Error("loading took too long")):(t++,setTimeout(()=>e(r),250));r(wd)}return new Promise((r,o)=>e(r))}function xd(t,e){let r=t.lastIndexOf("."),o=(t.substring(r+1)||"").toLowerCase(),s={ttf:"truetype",otf:"opentype",woff:"woff",woff2:"woff2"}[o];if(s)return s;let a={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.",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.",fon:"The .fon format is not supported: this is an ancient Windows bitmap font format.",ttc:"Based on the current CSS specification, font collections are not (yet?) supported."}[o];if(a||(a=`${t} is not a known webfont format.`),e)throw new Error(a);console.warn(`Could not load font: ${a}`)}async function Cd(t,e,r={}){if(!globalThis.document)return;let o=xd(e,r.errorOnStyle);if(!o)return;let s=document.createElement("style");s.className="injected-by-Font-js";let a=[];return r.styleRules&&(a=Object.entries(r.styleRules).map(([n,l])=>`${n}: ${l};`)),s.textContent=` @font-face { font-family: "${t}"; ${a.join(` `)} src: url("${e}") format("${o}"); -}`,globalThis.document.head.appendChild(s),s}var md=[0,1,0,0],pd=[79,84,84,79],hd=[119,79,70,70],gd=[119,79,70,50];function ns(t,e){if(t.length===e.length){for(let r=0;r (globalThis.document&&!this.options.skipStyleSheet&&await dd(this.name,t,this.options),this.loadFont(t)))()}async loadFont(t,e){fetch(t).then(r=>vd(r)&&r.arrayBuffer()).then(r=>this.fromDataBuffer(r,e||t)).catch(r=>{let o=new ss("error",r,`Failed to load font at ${e||t}`);this.dispatch(o),this.onerror&&this.onerror(o)})}async fromDataBuffer(t,e){this.fontData=new DataView(t);let r=yd(this.fontData);if(!r)throw new Error(`${e} is either an unsupported font format, or not a font at all.`);await this.parseBasicData(r);let o=new ss("load",{font:this});this.dispatch(o),this.onload&&this.onload(o)}async parseBasicData(t){return fd().then(e=>(t==="SFNT"&&(this.opentype=new td(this,this.fontData,e)),t==="WOFF"&&(this.opentype=new rd(this,this.fontData,e)),t==="WOFF2"&&(this.opentype=new nd(this,this.fontData,e)),this.opentype))}getGlyphId(t){return this.opentype.tables.cmap.getGlyphId(t)}reverse(t){return this.opentype.tables.cmap.reverse(t)}supports(t){return this.getGlyphId(t)!==0}supportsVariation(t){return this.opentype.tables.cmap.supportsVariation(t)!==!1}measureText(t,e=16){if(this.__unloaded)throw new Error("Cannot measure text: font was unloaded. Please reload before calling measureText()");let r=document.createElement("div");r.textContent=t,r.style.fontFamily=this.name,r.style.fontSize=`${e}px`,r.style.color="transparent",r.style.background="transparent",r.style.top="0",r.style.left="0",r.style.position="absolute",document.body.appendChild(r);let o=r.getBoundingClientRect();document.body.removeChild(r);let s=this.opentype.tables["OS/2"];return o.fontSize=e,o.ascender=s.sTypoAscender,o.descender=s.sTypoDescender,o}unload(){if(this.styleElement.parentNode){this.styleElement.parentNode.removeElement(this.styleElement);let t=new ss("unload",{font:this});this.dispatch(t),this.onunload&&this.onunload(t)}this._unloaded=!0}load(){if(this.__unloaded){delete this.__unloaded,document.head.appendChild(this.styleElement);let t=new ss("load",{font:this});this.dispatch(t),this.onload&&this.onload(t)}}};globalThis.Font=is;var We=class extends Bt{constructor(t,e,r){super(t),this.plaformID=e,this.encodingID=r}},bd=class extends We{constructor(t,e,r){super(t,e,r),this.format=0,this.length=t.uint16,this.language=t.uint16,this.glyphIdArray=[...new Array(256)].map(o=>t.uint8)}supports(t){return t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.")),0<=t&&t<=255}reverse(t){return console.warn("reverse not implemented for cmap subtable format 0"),{}}getSupportedCharCodes(){return[{start:1,end:256}]}},wd=class extends We{constructor(t,e,r){super(t,e,r),this.format=2,this.length=t.uint16,this.language=t.uint16,this.subHeaderKeys=[...new Array(256)].map(n=>t.uint16);let o=Math.max(...this.subHeaderKeys),s=t.currentPosition;Z(this,"subHeaders",()=>(t.currentPosition=s,[...new Array(o)].map(n=>new Sd(t))));let a=s+o*8;Z(this,"glyphIndexArray",()=>(t.currentPosition=a,[...new Array(o)].map(n=>t.uint16)))}supports(t){t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented."));let e=t&&255,r=t&&65280,o=this.subHeaders[r],s=this.subHeaders[o],a=s.firstCode,n=a+s.entryCount;return a<=e&&e<=n}reverse(t){return console.warn("reverse not implemented for cmap subtable format 2"),{}}getSupportedCharCodes(t=!1){return t?this.subHeaders.map(e=>({firstCode:e.firstCode,lastCode:e.lastCode})):this.subHeaders.map(e=>({start:e.firstCode,end:e.lastCode}))}},Sd=class{constructor(t){this.firstCode=t.uint16,this.entryCount=t.uint16,this.lastCode=this.first+this.entryCount,this.idDelta=t.int16,this.idRangeOffset=t.uint16}},xd=class extends We{constructor(t,e,r){super(t,e,r),this.format=4,this.length=t.uint16,this.language=t.uint16,this.segCountX2=t.uint16,this.segCount=this.segCountX2/2,this.searchRange=t.uint16,this.entrySelector=t.uint16,this.rangeShift=t.uint16;let o=t.currentPosition;Z(this,"endCode",()=>t.readBytes(this.segCount,o,16));let s=o+2+this.segCountX2;Z(this,"startCode",()=>t.readBytes(this.segCount,s,16));let a=s+this.segCountX2;Z(this,"idDelta",()=>t.readBytes(this.segCount,a,16,!0));let n=a+this.segCountX2;Z(this,"idRangeOffset",()=>t.readBytes(this.segCount,n,16));let l=n+this.segCountX2,m=this.length-(l-this.tableStart);Z(this,"glyphIdArray",()=>t.readBytes(m,l,16)),Z(this,"segments",()=>this.buildSegments(n,l,t))}buildSegments(t,e,r){let o=(s,a)=>{let n=this.startCode[a],l=this.endCode[a],m=this.idDelta[a],f=this.idRangeOffset[a],c=t+2*a,d=[];if(f===0)for(let g=n+m,h=l+m;g<=h;g++)d.push(g);else for(let g=0,h=l-n;g<=h;g++)r.currentPosition=c+f+g*2,d.push(r.uint16);return{startCode:n,endCode:l,idDelta:m,idRangeOffset:f,glyphIDs:d}};return[...new Array(this.segCount)].map(o)}reverse(t){let e=this.segments.find(o=>o.glyphIDs.includes(t));if(!e)return{};let r=e.startCode+e.glyphIDs.indexOf(t);return{code:r,unicode:String.fromCodePoint(r)}}getGlyphId(t){if(t.charCodeAt&&(t=t.charCodeAt(0)),55296<=t&&t<=57343||(t&65534)===65534||(t&65535)===65535)return 0;let e=this.segments.find(r=>r.startCode<=t&&t<=r.endCode);return e?e.glyphIDs[t-e.startCode]:0}supports(t){return this.getGlyphId(t)!==0}getSupportedCharCodes(t=!1){return t?this.segments:this.segments.map(e=>({start:e.startCode,end:e.endCode}))}},Cd=class extends We{constructor(t,e,r){super(t,e,r),this.format=6,this.length=t.uint16,this.language=t.uint16,this.firstCode=t.uint16,this.entryCount=t.uint16,this.lastCode=this.firstCode+this.entryCount-1,Z(this,"glyphIdArray",()=>[...new Array(this.entryCount)].map(s=>t.uint16))}supports(t){if(t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.")),t this.firstCode+this.entryCount)return{};let e=t-this.firstCode;return{code:e,unicode:String.fromCodePoint(e)}}reverse(t){let e=this.glyphIdArray.indexOf(t);if(e>-1)return this.firstCode+e}getSupportedCharCodes(t=!1){return t?[{firstCode:this.firstCode,lastCode:this.lastCode}]:[{start:this.firstCode,end:this.lastCode}]}},Fd=class extends We{constructor(t,e,r){super(t,e,r),this.format=8,t.uint16,this.length=t.uint32,this.language=t.uint32,this.is32=[...new Array(8192)].map(s=>t.uint8),this.numGroups=t.uint32,Z(this,"groups",()=>[...new Array(this.numGroups)].map(s=>new kd(t)))}supports(t){return t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.")),this.groups.findIndex(e=>e.startcharCode<=t&&t<=e.endcharCode)!==-1}reverse(t){return console.warn("reverse not implemented for cmap subtable format 8"),{}}getSupportedCharCodes(t=!1){return t?this.groups:this.groups.map(e=>({start:e.startcharCode,end:e.endcharCode}))}},kd=class{constructor(t){this.startcharCode=t.uint32,this.endcharCode=t.uint32,this.startGlyphID=t.uint32}},Od=class extends We{constructor(t,e,r){super(t,e,r),this.format=10,t.uint16,this.length=t.uint32,this.language=t.uint32,this.startCharCode=t.uint32,this.numChars=t.uint32,this.endCharCode=this.startCharCode+this.numChars,Z(this,"glyphs",()=>[...new Array(this.numChars)].map(s=>t.uint16))}supports(t){return t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.")),t this.startCharCode+this.numChars?!1:t-this.startCharCode}reverse(t){return console.warn("reverse not implemented for cmap subtable format 10"),{}}getSupportedCharCodes(t=!1){return t?[{startCharCode:this.startCharCode,endCharCode:this.endCharCode}]:[{start:this.startCharCode,end:this.endCharCode}]}},Td=class extends We{constructor(t,e,r){super(t,e,r),this.format=12,t.uint16,this.length=t.uint32,this.language=t.uint32,this.numGroups=t.uint32,Z(this,"groups",()=>[...new Array(this.numGroups)].map(s=>new _d(t)))}supports(t){return t.charCodeAt&&(t=t.charCodeAt(0)),55296<=t&&t<=57343||(t&65534)===65534||(t&65535)===65535?0:this.groups.findIndex(e=>e.startCharCode<=t&&t<=e.endCharCode)!==-1}reverse(t){for(let e of this.groups){let r=e.startGlyphID;if(r>t)continue;if(r===t)return e.startCharCode;if(r+(e.endCharCode-e.startCharCode) ({start:e.startCharCode,end:e.endCharCode}))}},_d=class{constructor(t){this.startCharCode=t.uint32,this.endCharCode=t.uint32,this.startGlyphID=t.uint32}},Pd=class extends We{constructor(t,e,r){super(t,e,r),this.format=13,t.uint16,this.length=t.uint32,this.language=t.uint32,this.numGroups=t.uint32;let o=[...new Array(this.numGroups)].map(s=>new Ad(t));Z(this,"groups",o)}supports(t){return t.charCodeAt&&(t=t.charCodeAt(0)),this.groups.findIndex(e=>e.startCharCode<=t&&t<=e.endCharCode)!==-1}reverse(t){return console.warn("reverse not implemented for cmap subtable format 13"),{}}getSupportedCharCodes(t=!1){return t?this.groups:this.groups.map(e=>({start:e.startCharCode,end:e.endCharCode}))}},Ad=class{constructor(t){this.startCharCode=t.uint32,this.endCharCode=t.uint32,this.glyphID=t.uint32}},Rd=class extends We{constructor(t,e,r){super(t,e,r),this.subTableStart=t.currentPosition,this.format=14,this.length=t.uint32,this.numVarSelectorRecords=t.uint32,Z(this,"varSelectors",()=>[...new Array(this.numVarSelectorRecords)].map(o=>new Ed(t)))}supports(){return console.warn("supports not implemented for cmap subtable format 14"),0}getSupportedCharCodes(){return console.warn("getSupportedCharCodes not implemented for cmap subtable format 14"),[]}reverse(t){return console.warn("reverse not implemented for cmap subtable format 14"),{}}supportsVariation(t){let e=this.varSelector.find(r=>r.varSelector===t);return e||!1}getSupportedVariations(){return this.varSelectors.map(t=>t.varSelector)}},Ed=class{constructor(t){this.varSelector=t.uint24,this.defaultUVSOffset=t.Offset32,this.nonDefaultUVSOffset=t.Offset32}};function Id(t,e,r){let o=t.uint16;return o===0?new bd(t,e,r):o===2?new wd(t,e,r):o===4?new xd(t,e,r):o===6?new Cd(t,e,r):o===8?new Fd(t,e,r):o===10?new Od(t,e,r):o===12?new Td(t,e,r):o===13?new Pd(t,e,r):o===14?new Rd(t,e,r):{}}var Ld=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numTables=r.uint16,this.encodingRecords=[...new Array(this.numTables)].map(o=>new Bd(r,this.tableStart))}getSubTable(t){return this.encodingRecords[t].table}getSupportedEncodings(){return this.encodingRecords.map(t=>({platformID:t.platformID,encodingId:t.encodingID}))}getSupportedCharCodes(t,e){let r=this.encodingRecords.findIndex(s=>s.platformID===t&&s.encodingID===e);return r===-1?!1:this.getSubTable(r).getSupportedCharCodes()}reverse(t){for(let e=0;e {let s=this.getSubTable(o);return s.getGlyphId?(e=s.getGlyphId(t),e!==0):!1}),e}supports(t){return this.encodingRecords.some((e,r)=>{let o=this.getSubTable(r);return o.supports&&o.supports(t)!==!1})}supportsVariation(t){return this.encodingRecords.some((e,r)=>{let o=this.getSubTable(r);return o.supportsVariation&&o.supportsVariation(t)!==!1})}},Bd=class{constructor(t,e){let r=this.platformID=t.uint16,o=this.encodingID=t.uint16,s=this.offset=t.Offset32;Z(this,"table",()=>(t.currentPosition=e+s,Id(t,r,o)))}},Dd=Object.freeze({__proto__:null,cmap:Ld}),Vd=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.load({majorVersion:r.uint16,minorVersion:r.uint16,fontRevision:r.fixed,checkSumAdjustment:r.uint32,magicNumber:r.uint32,flags:r.flags(16),unitsPerEm:r.uint16,created:r.longdatetime,modified:r.longdatetime,xMin:r.int16,yMin:r.int16,xMax:r.int16,yMax:r.int16,macStyle:r.flags(16),lowestRecPPEM:r.uint16,fontDirectionHint:r.uint16,indexToLocFormat:r.uint16,glyphDataFormat:r.uint16})}},Nd=Object.freeze({__proto__:null,head:Vd}),zd=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.ascender=r.fword,this.descender=r.fword,this.lineGap=r.fword,this.advanceWidthMax=r.ufword,this.minLeftSideBearing=r.fword,this.minRightSideBearing=r.fword,this.xMaxExtent=r.fword,this.caretSlopeRise=r.int16,this.caretSlopeRun=r.int16,this.caretOffset=r.int16,r.int16,r.int16,r.int16,r.int16,this.metricDataFormat=r.int16,this.numberOfHMetrics=r.uint16,r.verifyLength()}},Md=Object.freeze({__proto__:null,hhea:zd}),Gd=class extends mt{constructor(t,e,r){let{p:o}=super(t,e),s=r.hhea.numberOfHMetrics,a=r.maxp.numGlyphs,n=o.currentPosition;if(Z(this,"hMetrics",()=>(o.currentPosition=n,[...new Array(s)].map(l=>new jd(o.uint16,o.int16)))),s(o.currentPosition=l,[...new Array(a-s)].map(m=>o.int16)))}}},jd=class{constructor(t,e){this.advanceWidth=t,this.lsb=e}},Ud=Object.freeze({__proto__:null,hmtx:Gd}),Hd=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.legacyFixed,this.numGlyphs=r.uint16,this.version===1&&(this.maxPoints=r.uint16,this.maxContours=r.uint16,this.maxCompositePoints=r.uint16,this.maxCompositeContours=r.uint16,this.maxZones=r.uint16,this.maxTwilightPoints=r.uint16,this.maxStorage=r.uint16,this.maxFunctionDefs=r.uint16,this.maxInstructionDefs=r.uint16,this.maxStackElements=r.uint16,this.maxSizeOfInstructions=r.uint16,this.maxComponentElements=r.uint16,this.maxComponentDepth=r.uint16),r.verifyLength()}},Wd=Object.freeze({__proto__:null,maxp:Hd}),Yd=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.format=r.uint16,this.count=r.uint16,this.stringOffset=r.Offset16,this.nameRecords=[...new Array(this.count)].map(o=>new Zd(r,this)),this.format===1&&(this.langTagCount=r.uint16,this.langTagRecords=[...new Array(this.langTagCount)].map(o=>new qd(r.uint16,r.Offset16))),this.stringStart=this.tableStart+this.stringOffset}get(t){let e=this.nameRecords.find(r=>r.nameID===t);if(e)return e.string}},qd=class{constructor(t,e){this.length=t,this.offset=e}},Zd=class{constructor(t,e){this.platformID=t.uint16,this.encodingID=t.uint16,this.languageID=t.uint16,this.nameID=t.uint16,this.length=t.uint16,this.offset=t.Offset16,Z(this,"string",()=>(t.currentPosition=e.stringStart+this.offset,Xd(t,this)))}};function Xd(t,e){let{platformID:r,length:o}=e;if(o===0)return"";if(r===0||r===3){let n=[];for(let l=0,m=o/2;l r.uint8),this.ulUnicodeRange1=r.flags(32),this.ulUnicodeRange2=r.flags(32),this.ulUnicodeRange3=r.flags(32),this.ulUnicodeRange4=r.flags(32),this.achVendID=r.tag,this.fsSelection=r.uint16,this.usFirstCharIndex=r.uint16,this.usLastCharIndex=r.uint16,this.sTypoAscender=r.int16,this.sTypoDescender=r.int16,this.sTypoLineGap=r.int16,this.usWinAscent=r.uint16,this.usWinDescent=r.uint16,this.version===0||(this.ulCodePageRange1=r.flags(32),this.ulCodePageRange2=r.flags(32),this.version===1)||(this.sxHeight=r.int16,this.sCapHeight=r.int16,this.usDefaultChar=r.uint16,this.usBreakChar=r.uint16,this.usMaxContext=r.uint16,this.version<=4)||(this.usLowerOpticalPointSize=r.uint16,this.usUpperOpticalPointSize=r.uint16,this.version===5))return r.verifyLength()}},Qd=Object.freeze({__proto__:null,OS2:Jd}),$d=class extends mt{constructor(t,e){let{p:r}=super(t,e);if(this.version=r.legacyFixed,this.italicAngle=r.fixed,this.underlinePosition=r.fword,this.underlineThickness=r.fword,this.isFixedPitch=r.uint32,this.minMemType42=r.uint32,this.maxMemType42=r.uint32,this.minMemType1=r.uint32,this.maxMemType1=r.uint32,this.version===1||this.version===3)return r.verifyLength();if(this.numGlyphs=r.uint16,this.version===2){this.glyphNameIndex=[...new Array(this.numGlyphs)].map(o=>r.uint16),this.namesOffset=r.currentPosition,this.glyphNameOffsets=[1];for(let o=0;o r.int8))}getGlyphName(t){if(this.version!==2)return console.warn(`post table version ${this.version} does not support glyph name lookups`),"";let e=this.glyphNameIndex[t];if(e<258)return Dl[e];let r=this.glyphNameOffsets[t],s=this.glyphNameOffsets[t+1]-r-1;return s===0?".notdef.":(this.parser.currentPosition=this.namesOffset+r,this.parser.readBytes(s,this.namesOffset+r,8,!0).map(n=>String.fromCharCode(n)).join(""))}},Dl=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"],tm=Object.freeze({__proto__:null,post:$d}),em=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.horizAxisOffset=r.Offset16,this.vertAxisOffset=r.Offset16,Z(this,"horizAxis",()=>new vn({offset:t.offset+this.horizAxisOffset},e)),Z(this,"vertAxis",()=>new vn({offset:t.offset+this.vertAxisOffset},e)),this.majorVersion===1&&this.minorVersion===1&&(this.itemVarStoreOffset=r.Offset32,Z(this,"itemVarStore",()=>new vn({offset:t.offset+this.itemVarStoreOffset},e)))}},vn=class extends mt{constructor(t,e){let{p:r}=super(t,e,"AxisTable");this.baseTagListOffset=r.Offset16,this.baseScriptListOffset=r.Offset16,Z(this,"baseTagList",()=>new rm({offset:t.offset+this.baseTagListOffset},e)),Z(this,"baseScriptList",()=>new om({offset:t.offset+this.baseScriptListOffset},e))}},rm=class extends mt{constructor(t,e){let{p:r}=super(t,e,"BaseTagListTable");this.baseTagCount=r.uint16,this.baselineTags=[...new Array(this.baseTagCount)].map(o=>r.tag)}},om=class extends mt{constructor(t,e){let{p:r}=super(t,e,"BaseScriptListTable");this.baseScriptCount=r.uint16;let o=r.currentPosition;Z(this,"baseScriptRecords",()=>(r.currentPosition=o,[...new Array(this.baseScriptCount)].map(s=>new sm(this.start,r))))}},sm=class{constructor(t,e){this.baseScriptTag=e.tag,this.baseScriptOffset=e.Offset16,Z(this,"baseScriptTable",()=>(e.currentPosition=t+this.baseScriptOffset,new nm(e)))}},nm=class{constructor(t){this.start=t.currentPosition,this.baseValuesOffset=t.Offset16,this.defaultMinMaxOffset=t.Offset16,this.baseLangSysCount=t.uint16,this.baseLangSysRecords=[...new Array(this.baseLangSysCount)].map(e=>new am(this.start,t)),Z(this,"baseValues",()=>(t.currentPosition=this.start+this.baseValuesOffset,new im(t))),Z(this,"defaultMinMax",()=>(t.currentPosition=this.start+this.defaultMinMaxOffset,new Hl(t)))}},am=class{constructor(t,e){this.baseLangSysTag=e.tag,this.minMaxOffset=e.Offset16,Z(this,"minMax",()=>(e.currentPosition=t+this.minMaxOffset,new Hl(e)))}},im=class{constructor(t){this.parser=t,this.start=t.currentPosition,this.defaultBaselineIndex=t.uint16,this.baseCoordCount=t.uint16,this.baseCoords=[...new Array(this.baseCoordCount)].map(e=>t.Offset16)}getTable(t){return this.parser.currentPosition=this.start+this.baseCoords[t],new um(this.parser)}},Hl=class{constructor(t){this.minCoord=t.Offset16,this.maxCoord=t.Offset16,this.featMinMaxCount=t.uint16;let e=t.currentPosition;Z(this,"featMinMaxRecords",()=>(t.currentPosition=e,[...new Array(this.featMinMaxCount)].map(r=>new lm(t))))}},lm=class{constructor(t){this.featureTableTag=t.tag,this.minCoord=t.Offset16,this.maxCoord=t.Offset16}},um=class{constructor(t){this.baseCoordFormat=t.uint16,this.coordinate=t.int16,this.baseCoordFormat===2&&(this.referenceGlyph=t.uint16,this.baseCoordPoint=t.uint16),this.baseCoordFormat===3&&(this.deviceTable=t.Offset16)}},fm=Object.freeze({__proto__:null,BASE:em}),Vl=class{constructor(t){this.classFormat=t.uint16,this.classFormat===1&&(this.startGlyphID=t.uint16,this.glyphCount=t.uint16,this.classValueArray=[...new Array(this.glyphCount)].map(e=>t.uint16)),this.classFormat===2&&(this.classRangeCount=t.uint16,this.classRangeRecords=[...new Array(this.classRangeCount)].map(e=>new cm(t)))}},cm=class{constructor(t){this.startGlyphID=t.uint16,this.endGlyphID=t.uint16,this.class=t.uint16}},ho=class extends Bt{constructor(t){super(t),this.coverageFormat=t.uint16,this.coverageFormat===1&&(this.glyphCount=t.uint16,this.glyphArray=[...new Array(this.glyphCount)].map(e=>t.uint16)),this.coverageFormat===2&&(this.rangeCount=t.uint16,this.rangeRecords=[...new Array(this.rangeCount)].map(e=>new dm(t)))}},dm=class{constructor(t){this.startGlyphID=t.uint16,this.endGlyphID=t.uint16,this.startCoverageIndex=t.uint16}},mm=class{constructor(t,e){this.table=t,this.parser=e,this.start=e.currentPosition,this.format=e.uint16,this.variationRegionListOffset=e.Offset32,this.itemVariationDataCount=e.uint16,this.itemVariationDataOffsets=[...new Array(this.itemVariationDataCount)].map(r=>e.Offset32)}},pm=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.glyphClassDefOffset=r.Offset16,Z(this,"glyphClassDefs",()=>{if(this.glyphClassDefOffset!==0)return r.currentPosition=this.tableStart+this.glyphClassDefOffset,new Vl(r)}),this.attachListOffset=r.Offset16,Z(this,"attachList",()=>{if(this.attachListOffset!==0)return r.currentPosition=this.tableStart+this.attachListOffset,new hm(r)}),this.ligCaretListOffset=r.Offset16,Z(this,"ligCaretList",()=>{if(this.ligCaretListOffset!==0)return r.currentPosition=this.tableStart+this.ligCaretListOffset,new ym(r)}),this.markAttachClassDefOffset=r.Offset16,Z(this,"markAttachClassDef",()=>{if(this.markAttachClassDefOffset!==0)return r.currentPosition=this.tableStart+this.markAttachClassDefOffset,new Vl(r)}),this.minorVersion>=2&&(this.markGlyphSetsDefOffset=r.Offset16,Z(this,"markGlyphSetsDef",()=>{if(this.markGlyphSetsDefOffset!==0)return r.currentPosition=this.tableStart+this.markGlyphSetsDefOffset,new wm(r)})),this.minorVersion===3&&(this.itemVarStoreOffset=r.Offset32,Z(this,"itemVarStore",()=>{if(this.itemVarStoreOffset!==0)return r.currentPosition=this.tableStart+this.itemVarStoreOffset,new mm(r)}))}},hm=class extends Bt{constructor(t){super(t),this.coverageOffset=t.Offset16,this.glyphCount=t.uint16,this.attachPointOffsets=[...new Array(this.glyphCount)].map(e=>t.Offset16)}getPoint(t){return this.parser.currentPosition=this.start+this.attachPointOffsets[t],new gm(this.parser)}},gm=class{constructor(t){this.pointCount=t.uint16,this.pointIndices=[...new Array(this.pointCount)].map(e=>t.uint16)}},ym=class extends Bt{constructor(t){super(t),this.coverageOffset=t.Offset16,Z(this,"coverage",()=>(t.currentPosition=this.start+this.coverageOffset,new ho(t))),this.ligGlyphCount=t.uint16,this.ligGlyphOffsets=[...new Array(this.ligGlyphCount)].map(e=>t.Offset16)}getLigGlyph(t){return this.parser.currentPosition=this.start+this.ligGlyphOffsets[t],new vm(this.parser)}},vm=class extends Bt{constructor(t){super(t),this.caretCount=t.uint16,this.caretValueOffsets=[...new Array(this.caretCount)].map(e=>t.Offset16)}getCaretValue(t){return this.parser.currentPosition=this.start+this.caretValueOffsets[t],new bm(this.parser)}},bm=class{constructor(t){this.caretValueFormat=t.uint16,this.caretValueFormat===1&&(this.coordinate=t.int16),this.caretValueFormat===2&&(this.caretValuePointIndex=t.uint16),this.caretValueFormat===3&&(this.coordinate=t.int16,this.deviceOffset=t.Offset16)}},wm=class extends Bt{constructor(t){super(t),this.markGlyphSetTableFormat=t.uint16,this.markGlyphSetCount=t.uint16,this.coverageOffsets=[...new Array(this.markGlyphSetCount)].map(e=>t.Offset32)}getMarkGlyphSet(t){return this.parser.currentPosition=this.start+this.coverageOffsets[t],new ho(this.parser)}},Sm=Object.freeze({__proto__:null,GDEF:pm}),Nl=class extends Bt{static EMPTY={scriptCount:0,scriptRecords:[]};constructor(t){super(t),this.scriptCount=t.uint16,this.scriptRecords=[...new Array(this.scriptCount)].map(e=>new xm(t))}},xm=class{constructor(t){this.scriptTag=t.tag,this.scriptOffset=t.Offset16}},Cm=class extends Bt{constructor(t){super(t),this.defaultLangSys=t.Offset16,this.langSysCount=t.uint16,this.langSysRecords=[...new Array(this.langSysCount)].map(e=>new Fm(t))}},Fm=class{constructor(t){this.langSysTag=t.tag,this.langSysOffset=t.Offset16}},zl=class{constructor(t){this.lookupOrder=t.Offset16,this.requiredFeatureIndex=t.uint16,this.featureIndexCount=t.uint16,this.featureIndices=[...new Array(this.featureIndexCount)].map(e=>t.uint16)}},Ml=class extends Bt{static EMPTY={featureCount:0,featureRecords:[]};constructor(t){super(t),this.featureCount=t.uint16,this.featureRecords=[...new Array(this.featureCount)].map(e=>new km(t))}},km=class{constructor(t){this.featureTag=t.tag,this.featureOffset=t.Offset16}},Om=class extends Bt{constructor(t){super(t),this.featureParams=t.Offset16,this.lookupIndexCount=t.uint16,this.lookupListIndices=[...new Array(this.lookupIndexCount)].map(e=>t.uint16)}getFeatureParams(){if(this.featureParams>0){let t=this.parser;t.currentPosition=this.start+this.featureParams;let e=this.featureTag;if(e==="size")return new _m(t);if(e.startsWith("cc"))return new Tm(t);if(e.startsWith("ss"))return new Pm(t)}}},Tm=class{constructor(t){this.format=t.uint16,this.featUiLabelNameId=t.uint16,this.featUiTooltipTextNameId=t.uint16,this.sampleTextNameId=t.uint16,this.numNamedParameters=t.uint16,this.firstParamUiLabelNameId=t.uint16,this.charCount=t.uint16,this.character=[...new Array(this.charCount)].map(e=>t.uint24)}},_m=class{constructor(t){this.designSize=t.uint16,this.subfamilyIdentifier=t.uint16,this.subfamilyNameID=t.uint16,this.smallEnd=t.uint16,this.largeEnd=t.uint16}},Pm=class{constructor(t){this.version=t.uint16,this.UINameID=t.uint16}};function Wl(t){t.parser.currentPosition-=2,delete t.coverageOffset,delete t.getCoverageTable}var xr=class extends Bt{constructor(t){super(t),this.substFormat=t.uint16,this.coverageOffset=t.Offset16}getCoverageTable(){let t=this.parser;return t.currentPosition=this.start+this.coverageOffset,new ho(t)}},wn=class{constructor(t){this.glyphSequenceIndex=t.uint16,this.lookupListIndex=t.uint16}},Am=class extends xr{constructor(t){super(t),this.deltaGlyphID=t.int16}},Rm=class extends xr{constructor(t){super(t),this.sequenceCount=t.uint16,this.sequenceOffsets=[...new Array(this.sequenceCount)].map(e=>t.Offset16)}getSequence(t){let e=this.parser;return e.currentPosition=this.start+this.sequenceOffsets[t],new Em(e)}},Em=class{constructor(t){this.glyphCount=t.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map(e=>t.uint16)}},Im=class extends xr{constructor(t){super(t),this.alternateSetCount=t.uint16,this.alternateSetOffsets=[...new Array(this.alternateSetCount)].map(e=>t.Offset16)}getAlternateSet(t){let e=this.parser;return e.currentPosition=this.start+this.alternateSetOffsets[t],new Lm(e)}},Lm=class{constructor(t){this.glyphCount=t.uint16,this.alternateGlyphIDs=[...new Array(this.glyphCount)].map(e=>t.uint16)}},Bm=class extends xr{constructor(t){super(t),this.ligatureSetCount=t.uint16,this.ligatureSetOffsets=[...new Array(this.ligatureSetCount)].map(e=>t.Offset16)}getLigatureSet(t){let e=this.parser;return e.currentPosition=this.start+this.ligatureSetOffsets[t],new Dm(e)}},Dm=class extends Bt{constructor(t){super(t),this.ligatureCount=t.uint16,this.ligatureOffsets=[...new Array(this.ligatureCount)].map(e=>t.Offset16)}getLigature(t){let e=this.parser;return e.currentPosition=this.start+this.ligatureOffsets[t],new Vm(e)}},Vm=class{constructor(t){this.ligatureGlyph=t.uint16,this.componentCount=t.uint16,this.componentGlyphIDs=[...new Array(this.componentCount-1)].map(e=>t.uint16)}},Nm=class extends xr{constructor(t){super(t),this.substFormat===1&&(this.subRuleSetCount=t.uint16,this.subRuleSetOffsets=[...new Array(this.subRuleSetCount)].map(e=>t.Offset16)),this.substFormat===2&&(this.classDefOffset=t.Offset16,this.subClassSetCount=t.uint16,this.subClassSetOffsets=[...new Array(this.subClassSetCount)].map(e=>t.Offset16)),this.substFormat===3&&(Wl(this),this.glyphCount=t.uint16,this.substitutionCount=t.uint16,this.coverageOffsets=[...new Array(this.glyphCount)].map(e=>t.Offset16),this.substLookupRecords=[...new Array(this.substitutionCount)].map(e=>new wn(t)))}getSubRuleSet(t){if(this.substFormat!==1)throw new Error(`lookup type 5.${this.substFormat} has no subrule sets.`);let e=this.parser;return e.currentPosition=this.start+this.subRuleSetOffsets[t],new zm(e)}getSubClassSet(t){if(this.substFormat!==2)throw new Error(`lookup type 5.${this.substFormat} has no subclass sets.`);let e=this.parser;return e.currentPosition=this.start+this.subClassSetOffsets[t],new Mm(e)}getCoverageTable(t){if(this.substFormat!==3&&!t)return super.getCoverageTable();if(!t)throw new Error(`lookup type 5.${this.substFormat} requires an coverage table index.`);let e=this.parser;return e.currentPosition=this.start+this.coverageOffsets[t],new ho(e)}},zm=class extends Bt{constructor(t){super(t),this.subRuleCount=t.uint16,this.subRuleOffsets=[...new Array(this.subRuleCount)].map(e=>t.Offset16)}getSubRule(t){let e=this.parser;return e.currentPosition=this.start+this.subRuleOffsets[t],new Yl(e)}},Yl=class{constructor(t){this.glyphCount=t.uint16,this.substitutionCount=t.uint16,this.inputSequence=[...new Array(this.glyphCount-1)].map(e=>t.uint16),this.substLookupRecords=[...new Array(this.substitutionCount)].map(e=>new wn(t))}},Mm=class extends Bt{constructor(t){super(t),this.subClassRuleCount=t.uint16,this.subClassRuleOffsets=[...new Array(this.subClassRuleCount)].map(e=>t.Offset16)}getSubClass(t){let e=this.parser;return e.currentPosition=this.start+this.subClassRuleOffsets[t],new Gm(e)}},Gm=class extends Yl{constructor(t){super(t)}},jm=class extends xr{constructor(t){super(t),this.substFormat===1&&(this.chainSubRuleSetCount=t.uint16,this.chainSubRuleSetOffsets=[...new Array(this.chainSubRuleSetCount)].map(e=>t.Offset16)),this.substFormat===2&&(this.backtrackClassDefOffset=t.Offset16,this.inputClassDefOffset=t.Offset16,this.lookaheadClassDefOffset=t.Offset16,this.chainSubClassSetCount=t.uint16,this.chainSubClassSetOffsets=[...new Array(this.chainSubClassSetCount)].map(e=>t.Offset16)),this.substFormat===3&&(Wl(this),this.backtrackGlyphCount=t.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map(e=>t.Offset16),this.inputGlyphCount=t.uint16,this.inputCoverageOffsets=[...new Array(this.inputGlyphCount)].map(e=>t.Offset16),this.lookaheadGlyphCount=t.uint16,this.lookaheadCoverageOffsets=[...new Array(this.lookaheadGlyphCount)].map(e=>t.Offset16),this.seqLookupCount=t.uint16,this.seqLookupRecords=[...new Array(this.substitutionCount)].map(e=>new ql(t)))}getChainSubRuleSet(t){if(this.substFormat!==1)throw new Error(`lookup type 6.${this.substFormat} has no chainsubrule sets.`);let e=this.parser;return e.currentPosition=this.start+this.chainSubRuleSetOffsets[t],new Um(e)}getChainSubClassSet(t){if(this.substFormat!==2)throw new Error(`lookup type 6.${this.substFormat} has no chainsubclass sets.`);let e=this.parser;return e.currentPosition=this.start+this.chainSubClassSetOffsets[t],new Wm(e)}getCoverageFromOffset(t){if(this.substFormat!==3)throw new Error(`lookup type 6.${this.substFormat} does not use contextual coverage offsets.`);let e=this.parser;return e.currentPosition=this.start+t,new ho(e)}},Um=class extends Bt{constructor(t){super(t),this.chainSubRuleCount=t.uint16,this.chainSubRuleOffsets=[...new Array(this.chainSubRuleCount)].map(e=>t.Offset16)}getSubRule(t){let e=this.parser;return e.currentPosition=this.start+this.chainSubRuleOffsets[t],new Hm(e)}},Hm=class{constructor(t){this.backtrackGlyphCount=t.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map(e=>t.uint16),this.inputGlyphCount=t.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map(e=>t.uint16),this.lookaheadGlyphCount=t.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map(e=>t.uint16),this.substitutionCount=t.uint16,this.substLookupRecords=[...new Array(this.SubstCount)].map(e=>new wn(t))}},Wm=class extends Bt{constructor(t){super(t),this.chainSubClassRuleCount=t.uint16,this.chainSubClassRuleOffsets=[...new Array(this.chainSubClassRuleCount)].map(e=>t.Offset16)}getSubClass(t){let e=this.parser;return e.currentPosition=this.start+this.chainSubRuleOffsets[t],new Ym(e)}},Ym=class{constructor(t){this.backtrackGlyphCount=t.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map(e=>t.uint16),this.inputGlyphCount=t.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map(e=>t.uint16),this.lookaheadGlyphCount=t.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map(e=>t.uint16),this.substitutionCount=t.uint16,this.substLookupRecords=[...new Array(this.substitutionCount)].map(e=>new ql(t))}},ql=class extends Bt{constructor(t){super(t),this.sequenceIndex=t.uint16,this.lookupListIndex=t.uint16}},qm=class extends Bt{constructor(t){super(t),this.substFormat=t.uint16,this.extensionLookupType=t.uint16,this.extensionOffset=t.Offset32}},Zm=class extends xr{constructor(t){super(t),this.backtrackGlyphCount=t.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map(e=>t.Offset16),this.lookaheadGlyphCount=t.uint16,this.lookaheadCoverageOffsets=[new Array(this.lookaheadGlyphCount)].map(e=>t.Offset16),this.glyphCount=t.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map(e=>t.uint16)}},Xm={buildSubtable:function(t,e){let r=new[void 0,Am,Rm,Im,Bm,Nm,jm,qm,Zm][t](e);return r.type=t,r}},Ye=class extends Bt{constructor(t){super(t)}},Km=class extends Ye{constructor(t){super(t),console.log("lookup type 1")}},Jm=class extends Ye{constructor(t){super(t),console.log("lookup type 2")}},Qm=class extends Ye{constructor(t){super(t),console.log("lookup type 3")}},$m=class extends Ye{constructor(t){super(t),console.log("lookup type 4")}},tp=class extends Ye{constructor(t){super(t),console.log("lookup type 5")}},ep=class extends Ye{constructor(t){super(t),console.log("lookup type 6")}},rp=class extends Ye{constructor(t){super(t),console.log("lookup type 7")}},op=class extends Ye{constructor(t){super(t),console.log("lookup type 8")}},sp=class extends Ye{constructor(t){super(t),console.log("lookup type 9")}},np={buildSubtable:function(t,e){let r=new[void 0,Km,Jm,Qm,$m,tp,ep,rp,op,sp][t](e);return r.type=t,r}},Gl=class extends Bt{static EMPTY={lookupCount:0,lookups:[]};constructor(t){super(t),this.lookupCount=t.uint16,this.lookups=[...new Array(this.lookupCount)].map(e=>t.Offset16)}},ap=class extends Bt{constructor(t,e){super(t),this.ctType=e,this.lookupType=t.uint16,this.lookupFlag=t.uint16,this.subTableCount=t.uint16,this.subtableOffsets=[...new Array(this.subTableCount)].map(r=>t.Offset16),this.markFilteringSet=t.uint16}get rightToLeft(){return this.lookupFlag&!0}get ignoreBaseGlyphs(){return this.lookupFlag&!0}get ignoreLigatures(){return this.lookupFlag&!0}get ignoreMarks(){return this.lookupFlag&!0}get useMarkFilteringSet(){return this.lookupFlag&!0}get markAttachmentType(){return this.lookupFlag&!0}getSubTable(t){let e=this.ctType==="GSUB"?Xm:np;return this.parser.currentPosition=this.start+this.subtableOffsets[t],e.buildSubtable(this.lookupType,this.parser)}},Zl=class extends mt{constructor(t,e,r){let{p:o,tableStart:s}=super(t,e,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.scriptListOffset=o.Offset16,this.featureListOffset=o.Offset16,this.lookupListOffset=o.Offset16,this.majorVersion===1&&this.minorVersion===1&&(this.featureVariationsOffset=o.Offset32);let a=!(this.scriptListOffset||this.featureListOffset||this.lookupListOffset);Z(this,"scriptList",()=>a?Nl.EMPTY:(o.currentPosition=s+this.scriptListOffset,new Nl(o))),Z(this,"featureList",()=>a?Ml.EMPTY:(o.currentPosition=s+this.featureListOffset,new Ml(o))),Z(this,"lookupList",()=>a?Gl.EMPTY:(o.currentPosition=s+this.lookupListOffset,new Gl(o))),this.featureVariationsOffset&&Z(this,"featureVariations",()=>a?FeatureVariations.EMPTY:(o.currentPosition=s+this.featureVariationsOffset,new FeatureVariations(o)))}getSupportedScripts(){return this.scriptList.scriptRecords.map(t=>t.scriptTag)}getScriptTable(t){let e=this.scriptList.scriptRecords.find(o=>o.scriptTag===t);this.parser.currentPosition=this.scriptList.start+e.scriptOffset;let r=new Cm(this.parser);return r.scriptTag=t,r}ensureScriptTable(t){return typeof t=="string"?this.getScriptTable(t):t}getSupportedLangSys(t){t=this.ensureScriptTable(t);let e=t.defaultLangSys!==0,r=t.langSysRecords.map(o=>o.langSysTag);return e&&r.unshift("dflt"),r}getDefaultLangSysTable(t){t=this.ensureScriptTable(t);let e=t.defaultLangSys;if(e!==0){this.parser.currentPosition=t.start+e;let r=new zl(this.parser);return r.langSysTag="",r.defaultForScript=t.scriptTag,r}}getLangSysTable(t,e="dflt"){if(e==="dflt")return this.getDefaultLangSysTable(t);t=this.ensureScriptTable(t);let r=t.langSysRecords.find(s=>s.langSysTag===e);this.parser.currentPosition=t.start+r.langSysOffset;let o=new zl(this.parser);return o.langSysTag=e,o}getFeatures(t){return t.featureIndices.map(e=>this.getFeature(e))}getFeature(t){let e;if(parseInt(t)==t?e=this.featureList.featureRecords[t]:e=this.featureList.featureRecords.find(o=>o.featureTag===t),!e)return;this.parser.currentPosition=this.featureList.start+e.featureOffset;let r=new Om(this.parser);return r.featureTag=e.featureTag,r}getLookups(t){return t.lookupListIndices.map(e=>this.getLookup(e))}getLookup(t,e){let r=this.lookupList.lookups[t];return this.parser.currentPosition=this.lookupList.start+r,new ap(this.parser,e)}},ip=class extends Zl{constructor(t,e){super(t,e,"GSUB")}getLookup(t){return super.getLookup(t,"GSUB")}},lp=Object.freeze({__proto__:null,GSUB:ip}),up=class extends Zl{constructor(t,e){super(t,e,"GPOS")}getLookup(t){return super.getLookup(t,"GPOS")}},fp=Object.freeze({__proto__:null,GPOS:up}),cp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.offsetToSVGDocumentList=r.Offset32,r.currentPosition=this.tableStart+this.offsetToSVGDocumentList,this.documentList=new dp(r)}},dp=class extends Bt{constructor(t){super(t),this.numEntries=t.uint16,this.documentRecords=[...new Array(this.numEntries)].map(e=>new mp(t))}getDocument(t){let e=this.documentRecords[t];if(!e)return"";let r=this.start+e.svgDocOffset;return this.parser.currentPosition=r,this.parser.readBytes(e.svgDocLength)}getDocumentForGlyph(t){let e=this.documentRecords.findIndex(r=>r.startGlyphID<=t&&t<=r.endGlyphID);return e===-1?"":this.getDocument(e)}},mp=class{constructor(t){this.startGlyphID=t.uint16,this.endGlyphID=t.uint16,this.svgDocOffset=t.Offset32,this.svgDocLength=t.uint32}},pp=Object.freeze({__proto__:null,SVG:cp}),hp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.axesArrayOffset=r.Offset16,r.uint16,this.axisCount=r.uint16,this.axisSize=r.uint16,this.instanceCount=r.uint16,this.instanceSize=r.uint16;let o=this.tableStart+this.axesArrayOffset;Z(this,"axes",()=>(r.currentPosition=o,[...new Array(this.axisCount)].map(a=>new gp(r))));let s=o+this.axisCount*this.axisSize;Z(this,"instances",()=>{let a=[];for(let n=0;n t.tag)}getAxis(t){return this.axes.find(e=>e.tag===t)}},gp=class{constructor(t){this.tag=t.tag,this.minValue=t.fixed,this.defaultValue=t.fixed,this.maxValue=t.fixed,this.flags=t.flags(16),this.axisNameID=t.uint16}},yp=class{constructor(t,e,r){let o=t.currentPosition;this.subfamilyNameID=t.uint16,t.uint16,this.coordinates=[...new Array(e)].map(s=>t.fixed),t.currentPosition-o [...new Array(o)].map(s=>r.fword))}},wp=Object.freeze({__proto__:null,cvt:bp}),Sp=class extends mt{constructor(t,e){let{p:r}=super(t,e);Z(this,"instructions",()=>[...new Array(t.length)].map(o=>r.uint8))}},xp=Object.freeze({__proto__:null,fpgm:Sp}),Cp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numRanges=r.uint16,Z(this,"gaspRanges",()=>[...new Array(this.numRanges)].map(s=>new Fp(r)))}},Fp=class{constructor(t){this.rangeMaxPPEM=t.uint16,this.rangeGaspBehavior=t.uint16}},kp=Object.freeze({__proto__:null,gasp:Cp}),Op=class extends mt{constructor(t,e){super(t,e)}getGlyphData(t,e){return this.parser.currentPosition=this.tableStart+t,this.parser.readBytes(e)}},Tp=Object.freeze({__proto__:null,glyf:Op}),_p=class extends mt{constructor(t,e,r){let{p:o}=super(t,e),s=r.maxp.numGlyphs+1;r.head.indexToLocFormat===0?(this.x2=!0,Z(this,"offsets",()=>[...new Array(s)].map(a=>o.Offset16))):Z(this,"offsets",()=>[...new Array(s)].map(a=>o.Offset32))}getGlyphDataOffsetAndLength(t){let e=this.offsets[t]*this.x2?2:1,r=this.offsets[t+1]*this.x2?2:1;return{offset:e,length:r-e}}},Pp=Object.freeze({__proto__:null,loca:_p}),Ap=class extends mt{constructor(t,e){let{p:r}=super(t,e);Z(this,"instructions",()=>[...new Array(t.length)].map(o=>r.uint8))}},Rp=Object.freeze({__proto__:null,prep:Ap}),Ep=class extends mt{constructor(t,e){let{p:r}=super(t,e);Z(this,"data",()=>r.readBytes())}},Ip=Object.freeze({__proto__:null,CFF:Ep}),Lp=class extends mt{constructor(t,e){let{p:r}=super(t,e);Z(this,"data",()=>r.readBytes())}},Bp=Object.freeze({__proto__:null,CFF2:Lp}),Dp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.defaultVertOriginY=r.int16,this.numVertOriginYMetrics=r.uint16,Z(this,"vertORiginYMetrics",()=>[...new Array(this.numVertOriginYMetrics)].map(o=>new Vp(r)))}},Vp=class{constructor(t){this.glyphIndex=t.uint16,this.vertOriginY=t.int16}},Np=Object.freeze({__proto__:null,VORG:Dp}),zp=class{constructor(t){this.indexSubTableArrayOffset=t.Offset32,this.indexTablesSize=t.uint32,this.numberofIndexSubTables=t.uint32,this.colorRef=t.uint32,this.hori=new as(t),this.vert=new as(t),this.startGlyphIndex=t.uint16,this.endGlyphIndex=t.uint16,this.ppemX=t.uint8,this.ppemY=t.uint8,this.bitDepth=t.uint8,this.flags=t.int8}},Mp=class{constructor(t){this.hori=new as(t),this.vert=new as(t),this.ppemX=t.uint8,this.ppemY=t.uint8,this.substitutePpemX=t.uint8,this.substitutePpemY=t.uint8}},as=class{constructor(t){this.ascender=t.int8,this.descender=t.int8,this.widthMax=t.uint8,this.caretSlopeNumerator=t.int8,this.caretSlopeDenominator=t.int8,this.caretOffset=t.int8,this.minOriginSB=t.int8,this.minAdvanceSB=t.int8,this.maxBeforeBL=t.int8,this.minAfterBL=t.int8,this.pad1=t.int8,this.pad2=t.int8}},Xl=class extends mt{constructor(t,e,r){let{p:o}=super(t,e,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.numSizes=o.uint32,Z(this,"bitMapSizes",()=>[...new Array(this.numSizes)].map(s=>new zp(o)))}},Gp=Object.freeze({__proto__:null,EBLC:Xl}),Kl=class extends mt{constructor(t,e,r){let{p:o}=super(t,e,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16}},jp=Object.freeze({__proto__:null,EBDT:Kl}),Up=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.numSizes=r.uint32,Z(this,"bitmapScales",()=>[...new Array(this.numSizes)].map(o=>new Mp(r)))}},Hp=Object.freeze({__proto__:null,EBSC:Up}),Wp=class extends Xl{constructor(t,e){super(t,e,"CBLC")}},Yp=Object.freeze({__proto__:null,CBLC:Wp}),qp=class extends Kl{constructor(t,e){super(t,e,"CBDT")}},Zp=Object.freeze({__proto__:null,CBDT:qp}),Xp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.flags=r.flags(16),this.numStrikes=r.uint32,Z(this,"strikeOffsets",()=>[...new Array(this.numStrikes)].map(o=>r.Offset32))}},Kp=Object.freeze({__proto__:null,sbix:Xp}),Jp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numBaseGlyphRecords=r.uint16,this.baseGlyphRecordsOffset=r.Offset32,this.layerRecordsOffset=r.Offset32,this.numLayerRecords=r.uint16}getBaseGlyphRecord(t){let e=this.tableStart+this.baseGlyphRecordsOffset;this.parser.currentPosition=e;let r=new bn(this.parser),o=r.gID,s=this.tableStart+this.layerRecordsOffset-6;this.parser.currentPosition=s;let a=new bn(this.parser),n=a.gID;if(o===t)return r;if(n===t)return a;for(;e!==s;){let l=e+(s-e)/12;this.parser.currentPosition=l;let m=new bn(this.parser),f=m.gID;if(f===t)return m;f>t?s=l:f new Qp(p))}},bn=class{constructor(t){this.gID=t.uint16,this.firstLayerIndex=t.uint16,this.numLayers=t.uint16}},Qp=class{constructor(t){this.gID=t.uint16,this.paletteIndex=t.uint16}},$p=Object.freeze({__proto__:null,COLR:Jp}),th=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numPaletteEntries=r.uint16;let o=this.numPalettes=r.uint16;this.numColorRecords=r.uint16,this.offsetFirstColorRecord=r.Offset32,this.colorRecordIndices=[...new Array(this.numPalettes)].map(s=>r.uint16),Z(this,"colorRecords",()=>(r.currentPosition=this.tableStart+this.offsetFirstColorRecord,[...new Array(this.numColorRecords)].map(s=>new eh(r)))),this.version===1&&(this.offsetPaletteTypeArray=r.Offset32,this.offsetPaletteLabelArray=r.Offset32,this.offsetPaletteEntryLabelArray=r.Offset32,Z(this,"paletteTypeArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteTypeArray,new rh(r,o))),Z(this,"paletteLabelArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteLabelArray,new oh(r,o))),Z(this,"paletteEntryLabelArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteEntryLabelArray,new sh(r,o))))}},eh=class{constructor(t){this.blue=t.uint8,this.green=t.uint8,this.red=t.uint8,this.alpha=t.uint8}},rh=class{constructor(t,e){this.paletteTypes=[...new Array(e)].map(r=>t.uint32)}},oh=class{constructor(t,e){this.paletteLabels=[...new Array(e)].map(r=>t.uint16)}},sh=class{constructor(t,e){this.paletteEntryLabels=[...new Array(e)].map(r=>t.uint16)}},nh=Object.freeze({__proto__:null,CPAL:th}),ah=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint32,this.numSignatures=r.uint16,this.flags=r.uint16,this.signatureRecords=[...new Array(this.numSignatures)].map(o=>new ih(r))}getData(t){let e=this.signatureRecords[t];return this.parser.currentPosition=this.tableStart+e.offset,new lh(this.parser)}},ih=class{constructor(t){this.format=t.uint32,this.length=t.uint32,this.offset=t.Offset32}},lh=class{constructor(t){t.uint16,t.uint16,this.signatureLength=t.uint32,this.signature=t.readBytes(this.signatureLength)}},uh=Object.freeze({__proto__:null,DSIG:ah}),fh=class extends mt{constructor(t,e,r){let{p:o}=super(t,e),s=r.hmtx.numGlyphs;this.version=o.uint16,this.numRecords=o.int16,this.sizeDeviceRecord=o.int32,this.records=[...new Array(numRecords)].map(a=>new ch(o,s))}},ch=class{constructor(t,e){this.pixelSize=t.uint8,this.maxWidth=t.uint8,this.widths=t.readBytes(e)}},dh=Object.freeze({__proto__:null,hdmx:fh}),mh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.nTables=r.uint16,Z(this,"tables",()=>{let o=this.tableStart+4,s=[];for(let a=0;a [...new Array(this.nPairs)].map(e=>new hh(t)))),this.format===2&&console.warn("Kern subtable format 2 is not supported: this parser currently only parses universal table data.")}get horizontal(){return this.coverage[0]}get minimum(){return this.coverage[1]}get crossstream(){return this.coverage[2]}get override(){return this.coverage[3]}},hh=class{constructor(t){this.left=t.uint16,this.right=t.uint16,this.value=t.fword}},gh=Object.freeze({__proto__:null,kern:mh}),yh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numGlyphs=r.uint16,this.yPels=r.readBytes(this.numGlyphs)}},vh=Object.freeze({__proto__:null,LTSH:yh}),bh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.mergeClassCount=r.uint16,this.mergeDataOffset=r.Offset16,this.classDefCount=r.uint16,this.offsetToClassDefOffsets=r.Offset16,Z(this,"mergeEntryMatrix",()=>[...new Array(this.mergeClassCount)].map(o=>r.readBytes(this.mergeClassCount))),console.warn("Full MERG parsing is currently not supported."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}},wh=Object.freeze({__proto__:null,MERG:bh}),Sh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint32,this.flags=r.uint32,r.uint32,this.dataMapsCount=r.uint32,this.dataMaps=[...new Array(this.dataMapsCount)].map(o=>new xh(this.tableStart,r))}},xh=class{constructor(t,e){this.tableStart=t,this.parser=e,this.tag=e.tag,this.dataOffset=e.Offset32,this.dataLength=e.uint32}getData(){return this.parser.currentField=this.tableStart+this.dataOffset,this.parser.readBytes(this.dataLength)}},Ch=Object.freeze({__proto__:null,meta:Sh}),Fh=class extends mt{constructor(t,e){super(t,e),console.warn("This font uses a PCLT table, which is currently not supported by this parser."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}},kh=Object.freeze({__proto__:null,PCLT:Fh}),Oh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numRecs=r.uint16,this.numRatios=r.uint16,this.ratRanges=[...new Array(this.numRatios)].map(o=>new Th(r)),this.offsets=[...new Array(this.numRatios)].map(o=>r.Offset16),this.VDMXGroups=[...new Array(this.numRecs)].map(o=>new _h(r))}},Th=class{constructor(t){this.bCharSet=t.uint8,this.xRatio=t.uint8,this.yStartRatio=t.uint8,this.yEndRatio=t.uint8}},_h=class{constructor(t){this.recs=t.uint16,this.startsz=t.uint8,this.endsz=t.uint8,this.records=[...new Array(this.recs)].map(e=>new Ph(t))}},Ph=class{constructor(t){this.yPelHeight=t.uint16,this.yMax=t.int16,this.yMin=t.int16}},Ah=Object.freeze({__proto__:null,VDMX:Oh}),Rh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.fixed,this.ascent=this.vertTypoAscender=r.int16,this.descent=this.vertTypoDescender=r.int16,this.lineGap=this.vertTypoLineGap=r.int16,this.advanceHeightMax=r.int16,this.minTopSideBearing=r.int16,this.minBottomSideBearing=r.int16,this.yMaxExtent=r.int16,this.caretSlopeRise=r.int16,this.caretSlopeRun=r.int16,this.caretOffset=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.metricDataFormat=r.int16,this.numOfLongVerMetrics=r.uint16,r.verifyLength()}},Eh=Object.freeze({__proto__:null,vhea:Rh}),Ih=class extends mt{constructor(t,e,r){super(t,e);let o=r.vhea.numOfLongVerMetrics,s=r.maxp.numGlyphs,a=p.currentPosition;if(lazy(this,"vMetrics",()=>(p.currentPosition=a,[...new Array(o)].map(n=>new Lh(p.uint16,p.int16)))),o (p.currentPosition=n,[...new Array(s-o)].map(l=>p.int16)))}}},Lh=class{constructor(t,e){this.advanceHeight=t,this.topSideBearing=e}},Bh=Object.freeze({__proto__:null,vmtx:Ih});var Jl=u(X(),1);var{kebabCase:Dh}=vt(Jl.privateApis);function Ql(t){let e=t.reduce((r,o)=>(r[o.fontFamily]||(r[o.fontFamily]={name:o.fontFamily,fontFamily:o.fontFamily,slug:Dh(o.fontFamily.toLowerCase()),fontFace:[]}),r[o.fontFamily].fontFace.push(o),r),{});return Object.values(e)}var pe=u(z(),1);function Vh(){let{installFonts:t}=(0,go.useContext)(ne),[e,r]=(0,go.useState)(!1),[o,s]=(0,go.useState)(null),a=h=>{l(h)},n=h=>{l(h.target.files)},l=async h=>{if(!h)return;s(null),r(!0);let v=new Set,_=[...h],A=!1,k=_.map(async b=>{if(!await f(b))return A=!0,null;if(v.has(b.name))return null;let Y=(((b.name??"").split(".")??[]).pop()??"").toLowerCase();return pn.includes(Y)?(v.add(b.name),b):null}),x=(await Promise.all(k)).filter(b=>b!==null);if(x.length>0)m(x);else{let b=A?(0,Ur.__)("Sorry, you are not allowed to upload this file type."):(0,Ur.__)("No fonts found to install.");s({type:"error",message:b}),r(!1)}},m=async h=>{let v=await Promise.all(h.map(async _=>{let A=await d(_);return await er(A,A.file,"all"),A}));g(v)};async function f(h){let v=new is("Uploaded Font");try{let _=await c(h);return await v.fromDataBuffer(_,"font"),!0}catch{return!1}}async function c(h){return new Promise((v,_)=>{let A=new window.FileReader;A.readAsArrayBuffer(h),A.onload=()=>v(A.result),A.onerror=_})}let d=async h=>{let v=await c(h),_=new is("Uploaded Font");_.fromDataBuffer(v,h.name);let k=(await new Promise($=>_.onload=$)).detail.font,{name:x}=k.opentype.tables,b=x.get(16)||x.get(1),T=x.get(2).toLowerCase().includes("italic"),Y=k.opentype.tables["OS/2"].usWeightClass||"normal",V=!!k.opentype.tables.fvar&&k.opentype.tables.fvar.axes.find(({tag:$})=>$==="wght"),H=V?`${V.minValue} ${V.maxValue}`:null;return{file:h,fontFamily:b,fontStyle:T?"italic":"normal",fontWeight:H||Y}},g=async h=>{let v=Ql(h);try{await t(v),s({type:"success",message:(0,Ur.__)("Fonts were installed successfully.")})}catch(_){let A=_;s({type:"error",message:A.message,errors:A?.installationErrors})}r(!1)};return(0,pe.jsxs)("div",{className:"font-library__tabpanel-layout",children:[(0,pe.jsx)($t.DropZone,{onFilesDrop:a}),(0,pe.jsxs)($t.__experimentalVStack,{className:"font-library__local-fonts",justify:"start",children:[o&&(0,pe.jsxs)($t.Notice,{status:o.type,__unstableHTML:!0,onRemove:()=>s(null),children:[o.message,o.errors&&(0,pe.jsx)("ul",{children:o.errors.map((h,v)=>(0,pe.jsx)("li",{children:h},v))})]}),e&&(0,pe.jsx)($t.FlexItem,{children:(0,pe.jsx)("div",{className:"font-library__upload-area",children:(0,pe.jsx)($t.ProgressBar,{})})}),!e&&(0,pe.jsx)($t.FormFileUpload,{accept:pn.map(h=>`.${h}`).join(","),multiple:!0,onChange:n,render:({openFileDialog:h})=>(0,pe.jsx)($t.Button,{__next40pxDefaultSize:!0,className:"font-library__upload-area",onClick:h,children:(0,Ur.__)("Upload font")})}),(0,pe.jsx)($t.__experimentalText,{className:"font-library__upload-area__text",children:(0,Ur.__)("Uploaded fonts appear in your library and can be used in your theme. Supported formats: .ttf, .otf, .woff, and .woff2.")})]})]})}var ls=Vh;var tu=u(z(),1),{Tabs:x2}=vt(Sn.privateApis),C2={id:"installed-fonts",title:(0,us._x)("Library","Font library")},F2={id:"upload-fonts",title:(0,us._x)("Upload","noun")};var eu=u(ut(),1),xn=u(X(),1),zh=u(yt(),1);var ru=u(z(),1);var Cn=u(z(),1);var ou=u(ut(),1),fs=u(X(),1);var su=u(z(),1);var kn=u(z(),1);var _e=u(ut(),1),On=u(X(),1),qh=u(yt(),1);var nu=u(ce(),1);var Wh=u(z(),1),{useSettingsForBlockElement:t6,TypographyPanel:e6}=vt(nu.privateApis);var Yh=u(z(),1);var Tn=u(z(),1),f6={text:{description:(0,_e.__)("Manage the fonts used on the site."),title:(0,_e.__)("Text")},link:{description:(0,_e.__)("Manage the fonts and typography used on the links."),title:(0,_e.__)("Links")},heading:{description:(0,_e.__)("Manage the fonts and typography used on headings."),title:(0,_e.__)("Headings")},caption:{description:(0,_e.__)("Manage the fonts and typography used on captions."),title:(0,_e.__)("Captions")},button:{description:(0,_e.__)("Manage the fonts and typography used on buttons."),title:(0,_e.__)("Buttons")}};var Jh=u(ut(),1),Qh=u(X(),1),iu=u(ce(),1);var Hr=u(X(),1),au=u(ut(),1);var Kh=u(yt(),1);var Zh=u(X(),1),Xh=u(z(),1);var _n=u(z(),1);var Pn=u(z(),1),{useSettingsForBlockElement:O6,ColorPanel:T6}=vt(iu.privateApis);var ng=u(ut(),1),pu=u(X(),1);var eg=u(cr(),1),An=u(X(),1),rg=u(ut(),1);var ds=u(X(),1);var cs=u(X(),1);var lu=u(z(),1);function uu(){let{paletteColors:t}=Lr();return t.slice(0,4).map(({slug:e,color:r},o)=>(0,lu.jsx)("div",{style:{flexGrow:1,height:"100%",background:r}},`${e}-${o}`))}var vo=u(z(),1),$h={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},tg=({label:t,isFocused:e,withHoverView:r})=>(0,vo.jsx)(Vr,{label:t,isFocused:e,withHoverView:r,children:({key:o})=>(0,vo.jsx)(cs.__unstableMotion.div,{variants:$h,style:{height:"100%",overflow:"hidden"},children:(0,vo.jsx)(cs.__experimentalHStack,{spacing:0,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,vo.jsx)(uu,{})})},o)}),fu=tg;var Cr=u(z(),1),cu=["color"];function ms({title:t,gap:e=2}){let r=No(cu);return r?.length<=1?null:(0,Cr.jsxs)(ds.__experimentalVStack,{spacing:3,children:[t&&(0,Cr.jsx)(Se,{level:3,children:t}),(0,Cr.jsx)(ds.__experimentalGrid,{gap:e,children:r.map((o,s)=>(0,Cr.jsx)(zr,{variation:o,isPill:!0,properties:cu,showTooltip:!0,children:()=>(0,Cr.jsx)(fu,{})},s))})]})}var du=u(z(),1);var og=u(cr(),1),ps=u(X(),1),sg=u(ut(),1);var mu=u(z(),1);var Rn=u(z(),1),{Tabs:Q6}=vt(pu.privateApis);var ig=u(ut(),1),gu=u(ce(),1),lg=u(X(),1);var hu=u(ce(),1);var ag=u(z(),1);var{BackgroundPanel:rC}=vt(hu.privateApis);var En=u(z(),1),{useHasBackgroundPanel:uC}=vt(gu.privateApis);var Fr=u(X(),1),In=u(ut(),1);var mg=u(yt(),1);var ug=u(X(),1),fg=u(ut(),1),cg=u(z(),1);var Ln=u(z(),1),{Menu:SC}=vt(Fr.privateApis);var Ut=u(X(),1),bo=u(ut(),1);var hs=u(yt(),1);var Bn=u(z(),1),{Menu:DC}=vt(Ut.privateApis),VC=[{label:(0,bo.__)("Rename"),action:"rename"},{label:(0,bo.__)("Delete"),action:"delete"}],NC=[{label:(0,bo.__)("Reset"),action:"reset"}];var pg=u(z(),1);var yg=u(ut(),1),vu=u(ce(),1);var yu=u(ce(),1),hg=u(yt(),1);var gg=u(z(),1),{useSettingsForBlockElement:qC,DimensionsPanel:ZC}=vt(yu.privateApis);var Dn=u(z(),1),{useHasDimensionsPanel:eF,useSettingsForBlockElement:rF}=vt(vu.privateApis);var Fu=u(X(),1),Sg=u(ut(),1);var bg=u(ut(),1),wg=u(X(),1);var bu=u(be(),1),wu=u(fe(),1),ys=u(yt(),1),Su=u(X(),1),xu=u(ut(),1);var gs=u(z(),1);function vg({gap:t=2}){let{user:e}=(0,ys.useContext)(Xt),r=e?.styles,s=(0,wu.useSelect)(n=>{let l=n(bu.store).__experimentalGetCurrentThemeGlobalStylesVariations();return Array.isArray(l)?l:void 0},[])?.filter(n=>!io(n,["color"])&&!io(n,["typography","spacing"])),a=(0,ys.useMemo)(()=>[...[{title:(0,xu.__)("Default"),settings:{},styles:{}},...s??[]].map(l=>{let m=l?.styles?.blocks?{...l.styles.blocks}:{};r?.blocks&&Object.keys(r.blocks).forEach(g=>{if(r.blocks?.[g]?.css){let h=m[g]||{},v={css:`${m[g]?.css||""} ${r.blocks?.[g]?.css?.trim()||""}`};m[g]={...h,...v}}});let f=r?.css||l.styles?.css?{css:`${l.styles?.css||""} ${r?.css||""}`}:{},c=Object.keys(m).length>0?{blocks:m}:{},d={...l.styles,...f,...c};return{...l,settings:l.settings??{},styles:d}})],[s,r?.blocks,r?.css]);return!s||s.length<1?null:(0,gs.jsx)(Su.__experimentalGrid,{columns:2,className:"global-styles-ui-style-variations-container",gap:t,children:a.map((n,l)=>(0,gs.jsx)(zr,{variation:n,children:m=>(0,gs.jsx)(nn,{label:n?.title,withHoverView:!0,isFocused:m,variation:n})},l))})}var Vn=vg;var Cu=u(z(),1);var Nn=u(z(),1);var xg=u(ut(),1),Cg=u(X(),1),ku=u(ce(),1);var zn=u(z(),1),{AdvancedPanel:wF}=vt(ku.privateApis);var Lu=u(ut(),1),Gn=u(X(),1),jn=u(yt(),1);var Fg=u(fe(),1),kg=u(be(),1),Ou=u(yt(),1);var Pu=u(ut(),1),Au=u(X(),1),vs=u(_u(),1),Og=u(be(),1),Tg=u(fe(),1);var Ru=u(dn(),1),Eu=u(z(),1),kF=3600*1e3*24;var Mn=u(X(),1),wo=u(ut(),1);var Iu=u(z(),1);var Un=u(z(),1);var Hn=u(ut(),1),qe=u(X(),1);var Eg=u(yt(),1);var Pg=u(X(),1),Ag=u(ut(),1),Rg=u(z(),1);var Wn=u(z(),1),{Menu:YF}=vt(qe.privateApis);var Nu=u(ut(),1),ze=u(X(),1);var zu=u(yt(),1);var Ig=u(ce(),1),Lg=u(ut(),1);var Bg=u(z(),1);var Dg=u(X(),1),Bu=u(ut(),1),Vg=u(z(),1);var So=u(X(),1),Ng=u(ut(),1),zg=u(yt(),1),Du=u(z(),1);var Ze=u(X(),1),Vu=u(z(),1);var Yn=u(z(),1),{Menu:f3}=vt(ze.privateApis);var Zn=u(z(),1);var Xn=u(z(),1);function Wr(t){return function({value:r,baseValue:o,onChange:s,...a}){return(0,Xn.jsx)(ao,{value:r,baseValue:o,onChange:s,children:(0,Xn.jsx)(t,{...a})})}}var Ug=Wr(Vn);var Hg=Wr(ms);var Wg=Wr(Wo);var Yr=u(z(),1);function Kn({value:t,baseValue:e,onChange:r,activeTab:o="installed-fonts"}){let s;switch(o){case"upload-fonts":s=(0,Yr.jsx)(ls,{});break;case"installed-fonts":s=(0,Yr.jsx)($o,{});break;default:s=(0,Yr.jsx)(es,{slug:o})}return(0,Yr.jsx)(ao,{value:t,baseValue:e,onChange:r,children:(0,Yr.jsx)(Zo,{children:s})})}var ju=u(Vs()),{unlock:Jn}=(0,ju.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/font-list-route");if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='89af99528f']")){let t=document.createElement("style");t.setAttribute("data-wp-hash","89af99528f"),t.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: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 #0000}.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 #0000;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 #0000;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;height:56px;min-width:100%;padding:12px;position:sticky;z-index:1}.global-styles-ui-variations_item{box-sizing:border-box;cursor:pointer}.global-styles-ui-variations_item .global-styles-ui-variations_item-preview{border-radius:2px;outline:1px solid #0000001a;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:#0000004d}.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{align-items:center;cursor:pointer;display:flex;justify-content:center;line-height:1}.global-styles-ui-preview__wrapper{display:block;max-width:100%;width:100%}.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{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%,#0000 0,#0000 75%,#e0e0e0 0,#e0e0e0),repeating-linear-gradient(45deg,#e0e0e0 25%,#0000 0,#0000 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 .components-v-stack{flex:1 1 auto}.global-styles-ui-screen-css .components-v-stack .block-editor-global-styles-advanced-panel__custom-css-input,.global-styles-ui-screen-css .components-v-stack .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 .components-v-stack .block-editor-global-styles-advanced-panel__custom-css-input .components-base-control__field .components-textarea-control__input{direction:ltr;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}.admin-ui-page:has(.font-library__footer) .font-library-page__tab-panel{max-height:calc(100% - 198px)}')),document.head.appendChild(t)}var{Tabs:bs}=Jn(Uu.privateApis),{useGlobalStyles:Yg}=Jn(Hu.privateApis);function qg(){let{records:t=[]}=(0,ws.useEntityRecords)("root","fontCollection",{_fields:"slug,name,description"}),[e,r]=(0,Yu.useState)("installed-fonts"),{base:o,user:s,setUser:a,isReady:n}=Yg(),l=(0,Wu.useSelect)(f=>f(ws.store).canUser("create",{kind:"postType",name:"wp_font_family"}),[]);if(!n)return null;let m=[{id:"installed-fonts",title:(0,xo.__)("Library")}];return l&&(m.push({id:"upload-fonts",title:(0,xo.__)("Upload")}),m.push(...(t||[]).map(({slug:f,name:c})=>({id:f,title:t&&t.length===1&&f==="google-fonts"?(0,xo.__)("Install Fonts"):c})))),React.createElement(Ns,{title:(0,xo.__)("Fonts")},React.createElement(bs,{selectedTabId:e,onSelect:f=>r(f)},React.createElement("div",{className:"font-library-page__tablist"},React.createElement(bs.TabList,null,m.map(({id:f,title:c})=>React.createElement(bs.Tab,{key:f,tabId:f},c)))),m.map(({id:f})=>React.createElement(bs.TabPanel,{key:f,tabId:f,focusable:!1,className:"font-library-page__tab-panel"},React.createElement(Kn,{value:s,baseValue:o,onChange:a,activeTab:f})))))}function Zg(){return React.createElement(qg,null)}var Xg=Zg;export{Xg as stage}; +}`,globalThis.document.head.appendChild(s),s}var Fd=[0,1,0,0],kd=[79,84,84,79],Od=[119,79,70,70],Td=[119,79,70,50];function is(t,e){if(t.length===e.length){for(let r=0;r(globalThis.document&&!this.options.skipStyleSheet&&await Cd(this.name,t,this.options),this.loadFont(t)))()}async loadFont(t,e){fetch(t).then(r=>Pd(r)&&r.arrayBuffer()).then(r=>this.fromDataBuffer(r,e||t)).catch(r=>{let o=new as("error",r,`Failed to load font at ${e||t}`);this.dispatch(o),this.onerror&&this.onerror(o)})}async fromDataBuffer(t,e){this.fontData=new DataView(t);let r=_d(this.fontData);if(!r)throw new Error(`${e} is either an unsupported font format, or not a font at all.`);await this.parseBasicData(r);let o=new as("load",{font:this});this.dispatch(o),this.onload&&this.onload(o)}async parseBasicData(t){return Sd().then(e=>(t==="SFNT"&&(this.opentype=new cd(this,this.fontData,e)),t==="WOFF"&&(this.opentype=new md(this,this.fontData,e)),t==="WOFF2"&&(this.opentype=new gd(this,this.fontData,e)),this.opentype))}getGlyphId(t){return this.opentype.tables.cmap.getGlyphId(t)}reverse(t){return this.opentype.tables.cmap.reverse(t)}supports(t){return this.getGlyphId(t)!==0}supportsVariation(t){return this.opentype.tables.cmap.supportsVariation(t)!==!1}measureText(t,e=16){if(this.__unloaded)throw new Error("Cannot measure text: font was unloaded. Please reload before calling measureText()");let r=document.createElement("div");r.textContent=t,r.style.fontFamily=this.name,r.style.fontSize=`${e}px`,r.style.color="transparent",r.style.background="transparent",r.style.top="0",r.style.left="0",r.style.position="absolute",document.body.appendChild(r);let o=r.getBoundingClientRect();document.body.removeChild(r);let s=this.opentype.tables["OS/2"];return o.fontSize=e,o.ascender=s.sTypoAscender,o.descender=s.sTypoDescender,o}unload(){if(this.styleElement.parentNode){this.styleElement.parentNode.removeElement(this.styleElement);let t=new as("unload",{font:this});this.dispatch(t),this.onunload&&this.onunload(t)}this._unloaded=!0}load(){if(this.__unloaded){delete this.__unloaded,document.head.appendChild(this.styleElement);let t=new as("load",{font:this});this.dispatch(t),this.onload&&this.onload(t)}}};globalThis.Font=us;var Ye=class extends Bt{constructor(t,e,r){super(t),this.plaformID=e,this.encodingID=r}},Ad=class extends Ye{constructor(t,e,r){super(t,e,r),this.format=0,this.length=t.uint16,this.language=t.uint16,this.glyphIdArray=[...new Array(256)].map(o=>t.uint8)}supports(t){return t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 0. only supports(id) is implemented.")),0<=t&&t<=255}reverse(t){return console.warn("reverse not implemented for cmap subtable format 0"),{}}getSupportedCharCodes(){return[{start:1,end:256}]}},Ed=class extends Ye{constructor(t,e,r){super(t,e,r),this.format=2,this.length=t.uint16,this.language=t.uint16,this.subHeaderKeys=[...new Array(256)].map(n=>t.uint16);let o=Math.max(...this.subHeaderKeys),s=t.currentPosition;Z(this,"subHeaders",()=>(t.currentPosition=s,[...new Array(o)].map(n=>new Rd(t))));let a=s+o*8;Z(this,"glyphIndexArray",()=>(t.currentPosition=a,[...new Array(o)].map(n=>t.uint16)))}supports(t){t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 2. only supports(id) is implemented."));let e=t&&255,r=t&&65280,o=this.subHeaders[r],s=this.subHeaders[o],a=s.firstCode,n=a+s.entryCount;return a<=e&&e<=n}reverse(t){return console.warn("reverse not implemented for cmap subtable format 2"),{}}getSupportedCharCodes(t=!1){return t?this.subHeaders.map(e=>({firstCode:e.firstCode,lastCode:e.lastCode})):this.subHeaders.map(e=>({start:e.firstCode,end:e.lastCode}))}},Rd=class{constructor(t){this.firstCode=t.uint16,this.entryCount=t.uint16,this.lastCode=this.first+this.entryCount,this.idDelta=t.int16,this.idRangeOffset=t.uint16}},Id=class extends Ye{constructor(t,e,r){super(t,e,r),this.format=4,this.length=t.uint16,this.language=t.uint16,this.segCountX2=t.uint16,this.segCount=this.segCountX2/2,this.searchRange=t.uint16,this.entrySelector=t.uint16,this.rangeShift=t.uint16;let o=t.currentPosition;Z(this,"endCode",()=>t.readBytes(this.segCount,o,16));let s=o+2+this.segCountX2;Z(this,"startCode",()=>t.readBytes(this.segCount,s,16));let a=s+this.segCountX2;Z(this,"idDelta",()=>t.readBytes(this.segCount,a,16,!0));let n=a+this.segCountX2;Z(this,"idRangeOffset",()=>t.readBytes(this.segCount,n,16));let l=n+this.segCountX2,h=this.length-(l-this.tableStart);Z(this,"glyphIdArray",()=>t.readBytes(h,l,16)),Z(this,"segments",()=>this.buildSegments(n,l,t))}buildSegments(t,e,r){let o=(s,a)=>{let n=this.startCode[a],l=this.endCode[a],h=this.idDelta[a],f=this.idRangeOffset[a],c=t+2*a,d=[];if(f===0)for(let m=n+h,g=l+h;m<=g;m++)d.push(m);else for(let m=0,g=l-n;m<=g;m++)r.currentPosition=c+f+m*2,d.push(r.uint16);return{startCode:n,endCode:l,idDelta:h,idRangeOffset:f,glyphIDs:d}};return[...new Array(this.segCount)].map(o)}reverse(t){let e=this.segments.find(o=>o.glyphIDs.includes(t));if(!e)return{};let r=e.startCode+e.glyphIDs.indexOf(t);return{code:r,unicode:String.fromCodePoint(r)}}getGlyphId(t){if(t.charCodeAt&&(t=t.charCodeAt(0)),55296<=t&&t<=57343||(t&65534)===65534||(t&65535)===65535)return 0;let e=this.segments.find(r=>r.startCode<=t&&t<=r.endCode);return e?e.glyphIDs[t-e.startCode]:0}supports(t){return this.getGlyphId(t)!==0}getSupportedCharCodes(t=!1){return t?this.segments:this.segments.map(e=>({start:e.startCode,end:e.endCode}))}},Ld=class extends Ye{constructor(t,e,r){super(t,e,r),this.format=6,this.length=t.uint16,this.language=t.uint16,this.firstCode=t.uint16,this.entryCount=t.uint16,this.lastCode=this.firstCode+this.entryCount-1,Z(this,"glyphIdArray",()=>[...new Array(this.entryCount)].map(s=>t.uint16))}supports(t){if(t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 6. only supports(id) is implemented.")),t this.firstCode+this.entryCount)return{};let e=t-this.firstCode;return{code:e,unicode:String.fromCodePoint(e)}}reverse(t){let e=this.glyphIdArray.indexOf(t);if(e>-1)return this.firstCode+e}getSupportedCharCodes(t=!1){return t?[{firstCode:this.firstCode,lastCode:this.lastCode}]:[{start:this.firstCode,end:this.lastCode}]}},Bd=class extends Ye{constructor(t,e,r){super(t,e,r),this.format=8,t.uint16,this.length=t.uint32,this.language=t.uint32,this.is32=[...new Array(8192)].map(s=>t.uint8),this.numGroups=t.uint32,Z(this,"groups",()=>[...new Array(this.numGroups)].map(s=>new Vd(t)))}supports(t){return t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 8. only supports(id) is implemented.")),this.groups.findIndex(e=>e.startcharCode<=t&&t<=e.endcharCode)!==-1}reverse(t){return console.warn("reverse not implemented for cmap subtable format 8"),{}}getSupportedCharCodes(t=!1){return t?this.groups:this.groups.map(e=>({start:e.startcharCode,end:e.endcharCode}))}},Vd=class{constructor(t){this.startcharCode=t.uint32,this.endcharCode=t.uint32,this.startGlyphID=t.uint32}},Dd=class extends Ye{constructor(t,e,r){super(t,e,r),this.format=10,t.uint16,this.length=t.uint32,this.language=t.uint32,this.startCharCode=t.uint32,this.numChars=t.uint32,this.endCharCode=this.startCharCode+this.numChars,Z(this,"glyphs",()=>[...new Array(this.numChars)].map(s=>t.uint16))}supports(t){return t.charCodeAt&&(t=-1,console.warn("supports(character) not implemented for cmap subtable format 10. only supports(id) is implemented.")),t this.startCharCode+this.numChars?!1:t-this.startCharCode}reverse(t){return console.warn("reverse not implemented for cmap subtable format 10"),{}}getSupportedCharCodes(t=!1){return t?[{startCharCode:this.startCharCode,endCharCode:this.endCharCode}]:[{start:this.startCharCode,end:this.endCharCode}]}},Nd=class extends Ye{constructor(t,e,r){super(t,e,r),this.format=12,t.uint16,this.length=t.uint32,this.language=t.uint32,this.numGroups=t.uint32,Z(this,"groups",()=>[...new Array(this.numGroups)].map(s=>new zd(t)))}supports(t){return t.charCodeAt&&(t=t.charCodeAt(0)),55296<=t&&t<=57343||(t&65534)===65534||(t&65535)===65535?0:this.groups.findIndex(e=>e.startCharCode<=t&&t<=e.endCharCode)!==-1}reverse(t){for(let e of this.groups){let r=e.startGlyphID;if(r>t)continue;if(r===t)return e.startCharCode;if(r+(e.endCharCode-e.startCharCode) ({start:e.startCharCode,end:e.endCharCode}))}},zd=class{constructor(t){this.startCharCode=t.uint32,this.endCharCode=t.uint32,this.startGlyphID=t.uint32}},Md=class extends Ye{constructor(t,e,r){super(t,e,r),this.format=13,t.uint16,this.length=t.uint32,this.language=t.uint32,this.numGroups=t.uint32;let o=[...new Array(this.numGroups)].map(s=>new Gd(t));Z(this,"groups",o)}supports(t){return t.charCodeAt&&(t=t.charCodeAt(0)),this.groups.findIndex(e=>e.startCharCode<=t&&t<=e.endCharCode)!==-1}reverse(t){return console.warn("reverse not implemented for cmap subtable format 13"),{}}getSupportedCharCodes(t=!1){return t?this.groups:this.groups.map(e=>({start:e.startCharCode,end:e.endCharCode}))}},Gd=class{constructor(t){this.startCharCode=t.uint32,this.endCharCode=t.uint32,this.glyphID=t.uint32}},jd=class extends Ye{constructor(t,e,r){super(t,e,r),this.subTableStart=t.currentPosition,this.format=14,this.length=t.uint32,this.numVarSelectorRecords=t.uint32,Z(this,"varSelectors",()=>[...new Array(this.numVarSelectorRecords)].map(o=>new Ud(t)))}supports(){return console.warn("supports not implemented for cmap subtable format 14"),0}getSupportedCharCodes(){return console.warn("getSupportedCharCodes not implemented for cmap subtable format 14"),[]}reverse(t){return console.warn("reverse not implemented for cmap subtable format 14"),{}}supportsVariation(t){let e=this.varSelector.find(r=>r.varSelector===t);return e||!1}getSupportedVariations(){return this.varSelectors.map(t=>t.varSelector)}},Ud=class{constructor(t){this.varSelector=t.uint24,this.defaultUVSOffset=t.Offset32,this.nonDefaultUVSOffset=t.Offset32}};function Hd(t,e,r){let o=t.uint16;return o===0?new Ad(t,e,r):o===2?new Ed(t,e,r):o===4?new Id(t,e,r):o===6?new Ld(t,e,r):o===8?new Bd(t,e,r):o===10?new Dd(t,e,r):o===12?new Nd(t,e,r):o===13?new Md(t,e,r):o===14?new jd(t,e,r):{}}var Wd=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numTables=r.uint16,this.encodingRecords=[...new Array(this.numTables)].map(o=>new Yd(r,this.tableStart))}getSubTable(t){return this.encodingRecords[t].table}getSupportedEncodings(){return this.encodingRecords.map(t=>({platformID:t.platformID,encodingId:t.encodingID}))}getSupportedCharCodes(t,e){let r=this.encodingRecords.findIndex(s=>s.platformID===t&&s.encodingID===e);return r===-1?!1:this.getSubTable(r).getSupportedCharCodes()}reverse(t){for(let e=0;e {let s=this.getSubTable(o);return s.getGlyphId?(e=s.getGlyphId(t),e!==0):!1}),e}supports(t){return this.encodingRecords.some((e,r)=>{let o=this.getSubTable(r);return o.supports&&o.supports(t)!==!1})}supportsVariation(t){return this.encodingRecords.some((e,r)=>{let o=this.getSubTable(r);return o.supportsVariation&&o.supportsVariation(t)!==!1})}},Yd=class{constructor(t,e){let r=this.platformID=t.uint16,o=this.encodingID=t.uint16,s=this.offset=t.Offset32;Z(this,"table",()=>(t.currentPosition=e+s,Hd(t,r,o)))}},qd=Object.freeze({__proto__:null,cmap:Wd}),Zd=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.load({majorVersion:r.uint16,minorVersion:r.uint16,fontRevision:r.fixed,checkSumAdjustment:r.uint32,magicNumber:r.uint32,flags:r.flags(16),unitsPerEm:r.uint16,created:r.longdatetime,modified:r.longdatetime,xMin:r.int16,yMin:r.int16,xMax:r.int16,yMax:r.int16,macStyle:r.flags(16),lowestRecPPEM:r.uint16,fontDirectionHint:r.uint16,indexToLocFormat:r.uint16,glyphDataFormat:r.uint16})}},Xd=Object.freeze({__proto__:null,head:Zd}),Kd=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.ascender=r.fword,this.descender=r.fword,this.lineGap=r.fword,this.advanceWidthMax=r.ufword,this.minLeftSideBearing=r.fword,this.minRightSideBearing=r.fword,this.xMaxExtent=r.fword,this.caretSlopeRise=r.int16,this.caretSlopeRun=r.int16,this.caretOffset=r.int16,r.int16,r.int16,r.int16,r.int16,this.metricDataFormat=r.int16,this.numberOfHMetrics=r.uint16,r.verifyLength()}},Jd=Object.freeze({__proto__:null,hhea:Kd}),Qd=class extends mt{constructor(t,e,r){let{p:o}=super(t,e),s=r.hhea.numberOfHMetrics,a=r.maxp.numGlyphs,n=o.currentPosition;if(Z(this,"hMetrics",()=>(o.currentPosition=n,[...new Array(s)].map(l=>new $d(o.uint16,o.int16)))),s(o.currentPosition=l,[...new Array(a-s)].map(h=>o.int16)))}}},$d=class{constructor(t,e){this.advanceWidth=t,this.lsb=e}},tm=Object.freeze({__proto__:null,hmtx:Qd}),em=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.legacyFixed,this.numGlyphs=r.uint16,this.version===1&&(this.maxPoints=r.uint16,this.maxContours=r.uint16,this.maxCompositePoints=r.uint16,this.maxCompositeContours=r.uint16,this.maxZones=r.uint16,this.maxTwilightPoints=r.uint16,this.maxStorage=r.uint16,this.maxFunctionDefs=r.uint16,this.maxInstructionDefs=r.uint16,this.maxStackElements=r.uint16,this.maxSizeOfInstructions=r.uint16,this.maxComponentElements=r.uint16,this.maxComponentDepth=r.uint16),r.verifyLength()}},rm=Object.freeze({__proto__:null,maxp:em}),om=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.format=r.uint16,this.count=r.uint16,this.stringOffset=r.Offset16,this.nameRecords=[...new Array(this.count)].map(o=>new nm(r,this)),this.format===1&&(this.langTagCount=r.uint16,this.langTagRecords=[...new Array(this.langTagCount)].map(o=>new sm(r.uint16,r.Offset16))),this.stringStart=this.tableStart+this.stringOffset}get(t){let e=this.nameRecords.find(r=>r.nameID===t);if(e)return e.string}},sm=class{constructor(t,e){this.length=t,this.offset=e}},nm=class{constructor(t,e){this.platformID=t.uint16,this.encodingID=t.uint16,this.languageID=t.uint16,this.nameID=t.uint16,this.length=t.uint16,this.offset=t.Offset16,Z(this,"string",()=>(t.currentPosition=e.stringStart+this.offset,am(t,this)))}};function am(t,e){let{platformID:r,length:o}=e;if(o===0)return"";if(r===0||r===3){let n=[];for(let l=0,h=o/2;l r.uint8),this.ulUnicodeRange1=r.flags(32),this.ulUnicodeRange2=r.flags(32),this.ulUnicodeRange3=r.flags(32),this.ulUnicodeRange4=r.flags(32),this.achVendID=r.tag,this.fsSelection=r.uint16,this.usFirstCharIndex=r.uint16,this.usLastCharIndex=r.uint16,this.sTypoAscender=r.int16,this.sTypoDescender=r.int16,this.sTypoLineGap=r.int16,this.usWinAscent=r.uint16,this.usWinDescent=r.uint16,this.version===0||(this.ulCodePageRange1=r.flags(32),this.ulCodePageRange2=r.flags(32),this.version===1)||(this.sxHeight=r.int16,this.sCapHeight=r.int16,this.usDefaultChar=r.uint16,this.usBreakChar=r.uint16,this.usMaxContext=r.uint16,this.version<=4)||(this.usLowerOpticalPointSize=r.uint16,this.usUpperOpticalPointSize=r.uint16,this.version===5))return r.verifyLength()}},um=Object.freeze({__proto__:null,OS2:lm}),fm=class extends mt{constructor(t,e){let{p:r}=super(t,e);if(this.version=r.legacyFixed,this.italicAngle=r.fixed,this.underlinePosition=r.fword,this.underlineThickness=r.fword,this.isFixedPitch=r.uint32,this.minMemType42=r.uint32,this.maxMemType42=r.uint32,this.minMemType1=r.uint32,this.maxMemType1=r.uint32,this.version===1||this.version===3)return r.verifyLength();if(this.numGlyphs=r.uint16,this.version===2){this.glyphNameIndex=[...new Array(this.numGlyphs)].map(o=>r.uint16),this.namesOffset=r.currentPosition,this.glyphNameOffsets=[1];for(let o=0;o r.int8))}getGlyphName(t){if(this.version!==2)return console.warn(`post table version ${this.version} does not support glyph name lookups`),"";let e=this.glyphNameIndex[t];if(e<258)return Ul[e];let r=this.glyphNameOffsets[t],s=this.glyphNameOffsets[t+1]-r-1;return s===0?".notdef.":(this.parser.currentPosition=this.namesOffset+r,this.parser.readBytes(s,this.namesOffset+r,8,!0).map(n=>String.fromCharCode(n)).join(""))}},Ul=[".notdef",".null","nonmarkingreturn","space","exclam","quotedbl","numbersign","dollar","percent","ampersand","quotesingle","parenleft","parenright","asterisk","plus","comma","hyphen","period","slash","zero","one","two","three","four","five","six","seven","eight","nine","colon","semicolon","less","equal","greater","question","at","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z","bracketleft","backslash","bracketright","asciicircum","underscore","grave","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","braceleft","bar","braceright","asciitilde","Adieresis","Aring","Ccedilla","Eacute","Ntilde","Odieresis","Udieresis","aacute","agrave","acircumflex","adieresis","atilde","aring","ccedilla","eacute","egrave","ecircumflex","edieresis","iacute","igrave","icircumflex","idieresis","ntilde","oacute","ograve","ocircumflex","odieresis","otilde","uacute","ugrave","ucircumflex","udieresis","dagger","degree","cent","sterling","section","bullet","paragraph","germandbls","registered","copyright","trademark","acute","dieresis","notequal","AE","Oslash","infinity","plusminus","lessequal","greaterequal","yen","mu","partialdiff","summation","product","pi","integral","ordfeminine","ordmasculine","Omega","ae","oslash","questiondown","exclamdown","logicalnot","radical","florin","approxequal","Delta","guillemotleft","guillemotright","ellipsis","nonbreakingspace","Agrave","Atilde","Otilde","OE","oe","endash","emdash","quotedblleft","quotedblright","quoteleft","quoteright","divide","lozenge","ydieresis","Ydieresis","fraction","currency","guilsinglleft","guilsinglright","fi","fl","daggerdbl","periodcentered","quotesinglbase","quotedblbase","perthousand","Acircumflex","Ecircumflex","Aacute","Edieresis","Egrave","Iacute","Icircumflex","Idieresis","Igrave","Oacute","Ocircumflex","apple","Ograve","Uacute","Ucircumflex","Ugrave","dotlessi","circumflex","tilde","macron","breve","dotaccent","ring","cedilla","hungarumlaut","ogonek","caron","Lslash","lslash","Scaron","scaron","Zcaron","zcaron","brokenbar","Eth","eth","Yacute","yacute","Thorn","thorn","minus","multiply","onesuperior","twosuperior","threesuperior","onehalf","onequarter","threequarters","franc","Gbreve","gbreve","Idotaccent","Scedilla","scedilla","Cacute","cacute","Ccaron","ccaron","dcroat"],cm=Object.freeze({__proto__:null,post:fm}),dm=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.horizAxisOffset=r.Offset16,this.vertAxisOffset=r.Offset16,Z(this,"horizAxis",()=>new wn({offset:t.offset+this.horizAxisOffset},e)),Z(this,"vertAxis",()=>new wn({offset:t.offset+this.vertAxisOffset},e)),this.majorVersion===1&&this.minorVersion===1&&(this.itemVarStoreOffset=r.Offset32,Z(this,"itemVarStore",()=>new wn({offset:t.offset+this.itemVarStoreOffset},e)))}},wn=class extends mt{constructor(t,e){let{p:r}=super(t,e,"AxisTable");this.baseTagListOffset=r.Offset16,this.baseScriptListOffset=r.Offset16,Z(this,"baseTagList",()=>new mm({offset:t.offset+this.baseTagListOffset},e)),Z(this,"baseScriptList",()=>new pm({offset:t.offset+this.baseScriptListOffset},e))}},mm=class extends mt{constructor(t,e){let{p:r}=super(t,e,"BaseTagListTable");this.baseTagCount=r.uint16,this.baselineTags=[...new Array(this.baseTagCount)].map(o=>r.tag)}},pm=class extends mt{constructor(t,e){let{p:r}=super(t,e,"BaseScriptListTable");this.baseScriptCount=r.uint16;let o=r.currentPosition;Z(this,"baseScriptRecords",()=>(r.currentPosition=o,[...new Array(this.baseScriptCount)].map(s=>new hm(this.start,r))))}},hm=class{constructor(t,e){this.baseScriptTag=e.tag,this.baseScriptOffset=e.Offset16,Z(this,"baseScriptTable",()=>(e.currentPosition=t+this.baseScriptOffset,new gm(e)))}},gm=class{constructor(t){this.start=t.currentPosition,this.baseValuesOffset=t.Offset16,this.defaultMinMaxOffset=t.Offset16,this.baseLangSysCount=t.uint16,this.baseLangSysRecords=[...new Array(this.baseLangSysCount)].map(e=>new ym(this.start,t)),Z(this,"baseValues",()=>(t.currentPosition=this.start+this.baseValuesOffset,new vm(t))),Z(this,"defaultMinMax",()=>(t.currentPosition=this.start+this.defaultMinMaxOffset,new Jl(t)))}},ym=class{constructor(t,e){this.baseLangSysTag=e.tag,this.minMaxOffset=e.Offset16,Z(this,"minMax",()=>(e.currentPosition=t+this.minMaxOffset,new Jl(e)))}},vm=class{constructor(t){this.parser=t,this.start=t.currentPosition,this.defaultBaselineIndex=t.uint16,this.baseCoordCount=t.uint16,this.baseCoords=[...new Array(this.baseCoordCount)].map(e=>t.Offset16)}getTable(t){return this.parser.currentPosition=this.start+this.baseCoords[t],new wm(this.parser)}},Jl=class{constructor(t){this.minCoord=t.Offset16,this.maxCoord=t.Offset16,this.featMinMaxCount=t.uint16;let e=t.currentPosition;Z(this,"featMinMaxRecords",()=>(t.currentPosition=e,[...new Array(this.featMinMaxCount)].map(r=>new bm(t))))}},bm=class{constructor(t){this.featureTableTag=t.tag,this.minCoord=t.Offset16,this.maxCoord=t.Offset16}},wm=class{constructor(t){this.baseCoordFormat=t.uint16,this.coordinate=t.int16,this.baseCoordFormat===2&&(this.referenceGlyph=t.uint16,this.baseCoordPoint=t.uint16),this.baseCoordFormat===3&&(this.deviceTable=t.Offset16)}},Sm=Object.freeze({__proto__:null,BASE:dm}),Hl=class{constructor(t){this.classFormat=t.uint16,this.classFormat===1&&(this.startGlyphID=t.uint16,this.glyphCount=t.uint16,this.classValueArray=[...new Array(this.glyphCount)].map(e=>t.uint16)),this.classFormat===2&&(this.classRangeCount=t.uint16,this.classRangeRecords=[...new Array(this.classRangeCount)].map(e=>new xm(t)))}},xm=class{constructor(t){this.startGlyphID=t.uint16,this.endGlyphID=t.uint16,this.class=t.uint16}},vo=class extends Bt{constructor(t){super(t),this.coverageFormat=t.uint16,this.coverageFormat===1&&(this.glyphCount=t.uint16,this.glyphArray=[...new Array(this.glyphCount)].map(e=>t.uint16)),this.coverageFormat===2&&(this.rangeCount=t.uint16,this.rangeRecords=[...new Array(this.rangeCount)].map(e=>new Cm(t)))}},Cm=class{constructor(t){this.startGlyphID=t.uint16,this.endGlyphID=t.uint16,this.startCoverageIndex=t.uint16}},Fm=class{constructor(t,e){this.table=t,this.parser=e,this.start=e.currentPosition,this.format=e.uint16,this.variationRegionListOffset=e.Offset32,this.itemVariationDataCount=e.uint16,this.itemVariationDataOffsets=[...new Array(this.itemVariationDataCount)].map(r=>e.Offset32)}},km=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.glyphClassDefOffset=r.Offset16,Z(this,"glyphClassDefs",()=>{if(this.glyphClassDefOffset!==0)return r.currentPosition=this.tableStart+this.glyphClassDefOffset,new Hl(r)}),this.attachListOffset=r.Offset16,Z(this,"attachList",()=>{if(this.attachListOffset!==0)return r.currentPosition=this.tableStart+this.attachListOffset,new Om(r)}),this.ligCaretListOffset=r.Offset16,Z(this,"ligCaretList",()=>{if(this.ligCaretListOffset!==0)return r.currentPosition=this.tableStart+this.ligCaretListOffset,new _m(r)}),this.markAttachClassDefOffset=r.Offset16,Z(this,"markAttachClassDef",()=>{if(this.markAttachClassDefOffset!==0)return r.currentPosition=this.tableStart+this.markAttachClassDefOffset,new Hl(r)}),this.minorVersion>=2&&(this.markGlyphSetsDefOffset=r.Offset16,Z(this,"markGlyphSetsDef",()=>{if(this.markGlyphSetsDefOffset!==0)return r.currentPosition=this.tableStart+this.markGlyphSetsDefOffset,new Em(r)})),this.minorVersion===3&&(this.itemVarStoreOffset=r.Offset32,Z(this,"itemVarStore",()=>{if(this.itemVarStoreOffset!==0)return r.currentPosition=this.tableStart+this.itemVarStoreOffset,new Fm(r)}))}},Om=class extends Bt{constructor(t){super(t),this.coverageOffset=t.Offset16,this.glyphCount=t.uint16,this.attachPointOffsets=[...new Array(this.glyphCount)].map(e=>t.Offset16)}getPoint(t){return this.parser.currentPosition=this.start+this.attachPointOffsets[t],new Tm(this.parser)}},Tm=class{constructor(t){this.pointCount=t.uint16,this.pointIndices=[...new Array(this.pointCount)].map(e=>t.uint16)}},_m=class extends Bt{constructor(t){super(t),this.coverageOffset=t.Offset16,Z(this,"coverage",()=>(t.currentPosition=this.start+this.coverageOffset,new vo(t))),this.ligGlyphCount=t.uint16,this.ligGlyphOffsets=[...new Array(this.ligGlyphCount)].map(e=>t.Offset16)}getLigGlyph(t){return this.parser.currentPosition=this.start+this.ligGlyphOffsets[t],new Pm(this.parser)}},Pm=class extends Bt{constructor(t){super(t),this.caretCount=t.uint16,this.caretValueOffsets=[...new Array(this.caretCount)].map(e=>t.Offset16)}getCaretValue(t){return this.parser.currentPosition=this.start+this.caretValueOffsets[t],new Am(this.parser)}},Am=class{constructor(t){this.caretValueFormat=t.uint16,this.caretValueFormat===1&&(this.coordinate=t.int16),this.caretValueFormat===2&&(this.caretValuePointIndex=t.uint16),this.caretValueFormat===3&&(this.coordinate=t.int16,this.deviceOffset=t.Offset16)}},Em=class extends Bt{constructor(t){super(t),this.markGlyphSetTableFormat=t.uint16,this.markGlyphSetCount=t.uint16,this.coverageOffsets=[...new Array(this.markGlyphSetCount)].map(e=>t.Offset32)}getMarkGlyphSet(t){return this.parser.currentPosition=this.start+this.coverageOffsets[t],new vo(this.parser)}},Rm=Object.freeze({__proto__:null,GDEF:km}),Wl=class extends Bt{static EMPTY={scriptCount:0,scriptRecords:[]};constructor(t){super(t),this.scriptCount=t.uint16,this.scriptRecords=[...new Array(this.scriptCount)].map(e=>new Im(t))}},Im=class{constructor(t){this.scriptTag=t.tag,this.scriptOffset=t.Offset16}},Lm=class extends Bt{constructor(t){super(t),this.defaultLangSys=t.Offset16,this.langSysCount=t.uint16,this.langSysRecords=[...new Array(this.langSysCount)].map(e=>new Bm(t))}},Bm=class{constructor(t){this.langSysTag=t.tag,this.langSysOffset=t.Offset16}},Yl=class{constructor(t){this.lookupOrder=t.Offset16,this.requiredFeatureIndex=t.uint16,this.featureIndexCount=t.uint16,this.featureIndices=[...new Array(this.featureIndexCount)].map(e=>t.uint16)}},ql=class extends Bt{static EMPTY={featureCount:0,featureRecords:[]};constructor(t){super(t),this.featureCount=t.uint16,this.featureRecords=[...new Array(this.featureCount)].map(e=>new Vm(t))}},Vm=class{constructor(t){this.featureTag=t.tag,this.featureOffset=t.Offset16}},Dm=class extends Bt{constructor(t){super(t),this.featureParams=t.Offset16,this.lookupIndexCount=t.uint16,this.lookupListIndices=[...new Array(this.lookupIndexCount)].map(e=>t.uint16)}getFeatureParams(){if(this.featureParams>0){let t=this.parser;t.currentPosition=this.start+this.featureParams;let e=this.featureTag;if(e==="size")return new zm(t);if(e.startsWith("cc"))return new Nm(t);if(e.startsWith("ss"))return new Mm(t)}}},Nm=class{constructor(t){this.format=t.uint16,this.featUiLabelNameId=t.uint16,this.featUiTooltipTextNameId=t.uint16,this.sampleTextNameId=t.uint16,this.numNamedParameters=t.uint16,this.firstParamUiLabelNameId=t.uint16,this.charCount=t.uint16,this.character=[...new Array(this.charCount)].map(e=>t.uint24)}},zm=class{constructor(t){this.designSize=t.uint16,this.subfamilyIdentifier=t.uint16,this.subfamilyNameID=t.uint16,this.smallEnd=t.uint16,this.largeEnd=t.uint16}},Mm=class{constructor(t){this.version=t.uint16,this.UINameID=t.uint16}};function Ql(t){t.parser.currentPosition-=2,delete t.coverageOffset,delete t.getCoverageTable}var Fr=class extends Bt{constructor(t){super(t),this.substFormat=t.uint16,this.coverageOffset=t.Offset16}getCoverageTable(){let t=this.parser;return t.currentPosition=this.start+this.coverageOffset,new vo(t)}},xn=class{constructor(t){this.glyphSequenceIndex=t.uint16,this.lookupListIndex=t.uint16}},Gm=class extends Fr{constructor(t){super(t),this.deltaGlyphID=t.int16}},jm=class extends Fr{constructor(t){super(t),this.sequenceCount=t.uint16,this.sequenceOffsets=[...new Array(this.sequenceCount)].map(e=>t.Offset16)}getSequence(t){let e=this.parser;return e.currentPosition=this.start+this.sequenceOffsets[t],new Um(e)}},Um=class{constructor(t){this.glyphCount=t.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map(e=>t.uint16)}},Hm=class extends Fr{constructor(t){super(t),this.alternateSetCount=t.uint16,this.alternateSetOffsets=[...new Array(this.alternateSetCount)].map(e=>t.Offset16)}getAlternateSet(t){let e=this.parser;return e.currentPosition=this.start+this.alternateSetOffsets[t],new Wm(e)}},Wm=class{constructor(t){this.glyphCount=t.uint16,this.alternateGlyphIDs=[...new Array(this.glyphCount)].map(e=>t.uint16)}},Ym=class extends Fr{constructor(t){super(t),this.ligatureSetCount=t.uint16,this.ligatureSetOffsets=[...new Array(this.ligatureSetCount)].map(e=>t.Offset16)}getLigatureSet(t){let e=this.parser;return e.currentPosition=this.start+this.ligatureSetOffsets[t],new qm(e)}},qm=class extends Bt{constructor(t){super(t),this.ligatureCount=t.uint16,this.ligatureOffsets=[...new Array(this.ligatureCount)].map(e=>t.Offset16)}getLigature(t){let e=this.parser;return e.currentPosition=this.start+this.ligatureOffsets[t],new Zm(e)}},Zm=class{constructor(t){this.ligatureGlyph=t.uint16,this.componentCount=t.uint16,this.componentGlyphIDs=[...new Array(this.componentCount-1)].map(e=>t.uint16)}},Xm=class extends Fr{constructor(t){super(t),this.substFormat===1&&(this.subRuleSetCount=t.uint16,this.subRuleSetOffsets=[...new Array(this.subRuleSetCount)].map(e=>t.Offset16)),this.substFormat===2&&(this.classDefOffset=t.Offset16,this.subClassSetCount=t.uint16,this.subClassSetOffsets=[...new Array(this.subClassSetCount)].map(e=>t.Offset16)),this.substFormat===3&&(Ql(this),this.glyphCount=t.uint16,this.substitutionCount=t.uint16,this.coverageOffsets=[...new Array(this.glyphCount)].map(e=>t.Offset16),this.substLookupRecords=[...new Array(this.substitutionCount)].map(e=>new xn(t)))}getSubRuleSet(t){if(this.substFormat!==1)throw new Error(`lookup type 5.${this.substFormat} has no subrule sets.`);let e=this.parser;return e.currentPosition=this.start+this.subRuleSetOffsets[t],new Km(e)}getSubClassSet(t){if(this.substFormat!==2)throw new Error(`lookup type 5.${this.substFormat} has no subclass sets.`);let e=this.parser;return e.currentPosition=this.start+this.subClassSetOffsets[t],new Jm(e)}getCoverageTable(t){if(this.substFormat!==3&&!t)return super.getCoverageTable();if(!t)throw new Error(`lookup type 5.${this.substFormat} requires an coverage table index.`);let e=this.parser;return e.currentPosition=this.start+this.coverageOffsets[t],new vo(e)}},Km=class extends Bt{constructor(t){super(t),this.subRuleCount=t.uint16,this.subRuleOffsets=[...new Array(this.subRuleCount)].map(e=>t.Offset16)}getSubRule(t){let e=this.parser;return e.currentPosition=this.start+this.subRuleOffsets[t],new $l(e)}},$l=class{constructor(t){this.glyphCount=t.uint16,this.substitutionCount=t.uint16,this.inputSequence=[...new Array(this.glyphCount-1)].map(e=>t.uint16),this.substLookupRecords=[...new Array(this.substitutionCount)].map(e=>new xn(t))}},Jm=class extends Bt{constructor(t){super(t),this.subClassRuleCount=t.uint16,this.subClassRuleOffsets=[...new Array(this.subClassRuleCount)].map(e=>t.Offset16)}getSubClass(t){let e=this.parser;return e.currentPosition=this.start+this.subClassRuleOffsets[t],new Qm(e)}},Qm=class extends $l{constructor(t){super(t)}},$m=class extends Fr{constructor(t){super(t),this.substFormat===1&&(this.chainSubRuleSetCount=t.uint16,this.chainSubRuleSetOffsets=[...new Array(this.chainSubRuleSetCount)].map(e=>t.Offset16)),this.substFormat===2&&(this.backtrackClassDefOffset=t.Offset16,this.inputClassDefOffset=t.Offset16,this.lookaheadClassDefOffset=t.Offset16,this.chainSubClassSetCount=t.uint16,this.chainSubClassSetOffsets=[...new Array(this.chainSubClassSetCount)].map(e=>t.Offset16)),this.substFormat===3&&(Ql(this),this.backtrackGlyphCount=t.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map(e=>t.Offset16),this.inputGlyphCount=t.uint16,this.inputCoverageOffsets=[...new Array(this.inputGlyphCount)].map(e=>t.Offset16),this.lookaheadGlyphCount=t.uint16,this.lookaheadCoverageOffsets=[...new Array(this.lookaheadGlyphCount)].map(e=>t.Offset16),this.seqLookupCount=t.uint16,this.seqLookupRecords=[...new Array(this.substitutionCount)].map(e=>new tu(t)))}getChainSubRuleSet(t){if(this.substFormat!==1)throw new Error(`lookup type 6.${this.substFormat} has no chainsubrule sets.`);let e=this.parser;return e.currentPosition=this.start+this.chainSubRuleSetOffsets[t],new tp(e)}getChainSubClassSet(t){if(this.substFormat!==2)throw new Error(`lookup type 6.${this.substFormat} has no chainsubclass sets.`);let e=this.parser;return e.currentPosition=this.start+this.chainSubClassSetOffsets[t],new rp(e)}getCoverageFromOffset(t){if(this.substFormat!==3)throw new Error(`lookup type 6.${this.substFormat} does not use contextual coverage offsets.`);let e=this.parser;return e.currentPosition=this.start+t,new vo(e)}},tp=class extends Bt{constructor(t){super(t),this.chainSubRuleCount=t.uint16,this.chainSubRuleOffsets=[...new Array(this.chainSubRuleCount)].map(e=>t.Offset16)}getSubRule(t){let e=this.parser;return e.currentPosition=this.start+this.chainSubRuleOffsets[t],new ep(e)}},ep=class{constructor(t){this.backtrackGlyphCount=t.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map(e=>t.uint16),this.inputGlyphCount=t.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map(e=>t.uint16),this.lookaheadGlyphCount=t.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map(e=>t.uint16),this.substitutionCount=t.uint16,this.substLookupRecords=[...new Array(this.SubstCount)].map(e=>new xn(t))}},rp=class extends Bt{constructor(t){super(t),this.chainSubClassRuleCount=t.uint16,this.chainSubClassRuleOffsets=[...new Array(this.chainSubClassRuleCount)].map(e=>t.Offset16)}getSubClass(t){let e=this.parser;return e.currentPosition=this.start+this.chainSubRuleOffsets[t],new op(e)}},op=class{constructor(t){this.backtrackGlyphCount=t.uint16,this.backtrackSequence=[...new Array(this.backtrackGlyphCount)].map(e=>t.uint16),this.inputGlyphCount=t.uint16,this.inputSequence=[...new Array(this.inputGlyphCount-1)].map(e=>t.uint16),this.lookaheadGlyphCount=t.uint16,this.lookAheadSequence=[...new Array(this.lookAheadGlyphCount)].map(e=>t.uint16),this.substitutionCount=t.uint16,this.substLookupRecords=[...new Array(this.substitutionCount)].map(e=>new tu(t))}},tu=class extends Bt{constructor(t){super(t),this.sequenceIndex=t.uint16,this.lookupListIndex=t.uint16}},sp=class extends Bt{constructor(t){super(t),this.substFormat=t.uint16,this.extensionLookupType=t.uint16,this.extensionOffset=t.Offset32}},np=class extends Fr{constructor(t){super(t),this.backtrackGlyphCount=t.uint16,this.backtrackCoverageOffsets=[...new Array(this.backtrackGlyphCount)].map(e=>t.Offset16),this.lookaheadGlyphCount=t.uint16,this.lookaheadCoverageOffsets=[new Array(this.lookaheadGlyphCount)].map(e=>t.Offset16),this.glyphCount=t.uint16,this.substituteGlyphIDs=[...new Array(this.glyphCount)].map(e=>t.uint16)}},ap={buildSubtable:function(t,e){let r=new[void 0,Gm,jm,Hm,Ym,Xm,$m,sp,np][t](e);return r.type=t,r}},qe=class extends Bt{constructor(t){super(t)}},ip=class extends qe{constructor(t){super(t),console.log("lookup type 1")}},lp=class extends qe{constructor(t){super(t),console.log("lookup type 2")}},up=class extends qe{constructor(t){super(t),console.log("lookup type 3")}},fp=class extends qe{constructor(t){super(t),console.log("lookup type 4")}},cp=class extends qe{constructor(t){super(t),console.log("lookup type 5")}},dp=class extends qe{constructor(t){super(t),console.log("lookup type 6")}},mp=class extends qe{constructor(t){super(t),console.log("lookup type 7")}},pp=class extends qe{constructor(t){super(t),console.log("lookup type 8")}},hp=class extends qe{constructor(t){super(t),console.log("lookup type 9")}},gp={buildSubtable:function(t,e){let r=new[void 0,ip,lp,up,fp,cp,dp,mp,pp,hp][t](e);return r.type=t,r}},Zl=class extends Bt{static EMPTY={lookupCount:0,lookups:[]};constructor(t){super(t),this.lookupCount=t.uint16,this.lookups=[...new Array(this.lookupCount)].map(e=>t.Offset16)}},yp=class extends Bt{constructor(t,e){super(t),this.ctType=e,this.lookupType=t.uint16,this.lookupFlag=t.uint16,this.subTableCount=t.uint16,this.subtableOffsets=[...new Array(this.subTableCount)].map(r=>t.Offset16),this.markFilteringSet=t.uint16}get rightToLeft(){return this.lookupFlag&!0}get ignoreBaseGlyphs(){return this.lookupFlag&!0}get ignoreLigatures(){return this.lookupFlag&!0}get ignoreMarks(){return this.lookupFlag&!0}get useMarkFilteringSet(){return this.lookupFlag&!0}get markAttachmentType(){return this.lookupFlag&!0}getSubTable(t){let e=this.ctType==="GSUB"?ap:gp;return this.parser.currentPosition=this.start+this.subtableOffsets[t],e.buildSubtable(this.lookupType,this.parser)}},eu=class extends mt{constructor(t,e,r){let{p:o,tableStart:s}=super(t,e,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.scriptListOffset=o.Offset16,this.featureListOffset=o.Offset16,this.lookupListOffset=o.Offset16,this.majorVersion===1&&this.minorVersion===1&&(this.featureVariationsOffset=o.Offset32);let a=!(this.scriptListOffset||this.featureListOffset||this.lookupListOffset);Z(this,"scriptList",()=>a?Wl.EMPTY:(o.currentPosition=s+this.scriptListOffset,new Wl(o))),Z(this,"featureList",()=>a?ql.EMPTY:(o.currentPosition=s+this.featureListOffset,new ql(o))),Z(this,"lookupList",()=>a?Zl.EMPTY:(o.currentPosition=s+this.lookupListOffset,new Zl(o))),this.featureVariationsOffset&&Z(this,"featureVariations",()=>a?FeatureVariations.EMPTY:(o.currentPosition=s+this.featureVariationsOffset,new FeatureVariations(o)))}getSupportedScripts(){return this.scriptList.scriptRecords.map(t=>t.scriptTag)}getScriptTable(t){let e=this.scriptList.scriptRecords.find(o=>o.scriptTag===t);this.parser.currentPosition=this.scriptList.start+e.scriptOffset;let r=new Lm(this.parser);return r.scriptTag=t,r}ensureScriptTable(t){return typeof t=="string"?this.getScriptTable(t):t}getSupportedLangSys(t){t=this.ensureScriptTable(t);let e=t.defaultLangSys!==0,r=t.langSysRecords.map(o=>o.langSysTag);return e&&r.unshift("dflt"),r}getDefaultLangSysTable(t){t=this.ensureScriptTable(t);let e=t.defaultLangSys;if(e!==0){this.parser.currentPosition=t.start+e;let r=new Yl(this.parser);return r.langSysTag="",r.defaultForScript=t.scriptTag,r}}getLangSysTable(t,e="dflt"){if(e==="dflt")return this.getDefaultLangSysTable(t);t=this.ensureScriptTable(t);let r=t.langSysRecords.find(s=>s.langSysTag===e);this.parser.currentPosition=t.start+r.langSysOffset;let o=new Yl(this.parser);return o.langSysTag=e,o}getFeatures(t){return t.featureIndices.map(e=>this.getFeature(e))}getFeature(t){let e;if(parseInt(t)==t?e=this.featureList.featureRecords[t]:e=this.featureList.featureRecords.find(o=>o.featureTag===t),!e)return;this.parser.currentPosition=this.featureList.start+e.featureOffset;let r=new Dm(this.parser);return r.featureTag=e.featureTag,r}getLookups(t){return t.lookupListIndices.map(e=>this.getLookup(e))}getLookup(t,e){let r=this.lookupList.lookups[t];return this.parser.currentPosition=this.lookupList.start+r,new yp(this.parser,e)}},vp=class extends eu{constructor(t,e){super(t,e,"GSUB")}getLookup(t){return super.getLookup(t,"GSUB")}},bp=Object.freeze({__proto__:null,GSUB:vp}),wp=class extends eu{constructor(t,e){super(t,e,"GPOS")}getLookup(t){return super.getLookup(t,"GPOS")}},Sp=Object.freeze({__proto__:null,GPOS:wp}),xp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.offsetToSVGDocumentList=r.Offset32,r.currentPosition=this.tableStart+this.offsetToSVGDocumentList,this.documentList=new Cp(r)}},Cp=class extends Bt{constructor(t){super(t),this.numEntries=t.uint16,this.documentRecords=[...new Array(this.numEntries)].map(e=>new Fp(t))}getDocument(t){let e=this.documentRecords[t];if(!e)return"";let r=this.start+e.svgDocOffset;return this.parser.currentPosition=r,this.parser.readBytes(e.svgDocLength)}getDocumentForGlyph(t){let e=this.documentRecords.findIndex(r=>r.startGlyphID<=t&&t<=r.endGlyphID);return e===-1?"":this.getDocument(e)}},Fp=class{constructor(t){this.startGlyphID=t.uint16,this.endGlyphID=t.uint16,this.svgDocOffset=t.Offset32,this.svgDocLength=t.uint32}},kp=Object.freeze({__proto__:null,SVG:xp}),Op=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.axesArrayOffset=r.Offset16,r.uint16,this.axisCount=r.uint16,this.axisSize=r.uint16,this.instanceCount=r.uint16,this.instanceSize=r.uint16;let o=this.tableStart+this.axesArrayOffset;Z(this,"axes",()=>(r.currentPosition=o,[...new Array(this.axisCount)].map(a=>new Tp(r))));let s=o+this.axisCount*this.axisSize;Z(this,"instances",()=>{let a=[];for(let n=0;n t.tag)}getAxis(t){return this.axes.find(e=>e.tag===t)}},Tp=class{constructor(t){this.tag=t.tag,this.minValue=t.fixed,this.defaultValue=t.fixed,this.maxValue=t.fixed,this.flags=t.flags(16),this.axisNameID=t.uint16}},_p=class{constructor(t,e,r){let o=t.currentPosition;this.subfamilyNameID=t.uint16,t.uint16,this.coordinates=[...new Array(e)].map(s=>t.fixed),t.currentPosition-o [...new Array(o)].map(s=>r.fword))}},Ep=Object.freeze({__proto__:null,cvt:Ap}),Rp=class extends mt{constructor(t,e){let{p:r}=super(t,e);Z(this,"instructions",()=>[...new Array(t.length)].map(o=>r.uint8))}},Ip=Object.freeze({__proto__:null,fpgm:Rp}),Lp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numRanges=r.uint16,Z(this,"gaspRanges",()=>[...new Array(this.numRanges)].map(s=>new Bp(r)))}},Bp=class{constructor(t){this.rangeMaxPPEM=t.uint16,this.rangeGaspBehavior=t.uint16}},Vp=Object.freeze({__proto__:null,gasp:Lp}),Dp=class extends mt{constructor(t,e){super(t,e)}getGlyphData(t,e){return this.parser.currentPosition=this.tableStart+t,this.parser.readBytes(e)}},Np=Object.freeze({__proto__:null,glyf:Dp}),zp=class extends mt{constructor(t,e,r){let{p:o}=super(t,e),s=r.maxp.numGlyphs+1;r.head.indexToLocFormat===0?(this.x2=!0,Z(this,"offsets",()=>[...new Array(s)].map(a=>o.Offset16))):Z(this,"offsets",()=>[...new Array(s)].map(a=>o.Offset32))}getGlyphDataOffsetAndLength(t){let e=this.offsets[t]*this.x2?2:1,r=this.offsets[t+1]*this.x2?2:1;return{offset:e,length:r-e}}},Mp=Object.freeze({__proto__:null,loca:zp}),Gp=class extends mt{constructor(t,e){let{p:r}=super(t,e);Z(this,"instructions",()=>[...new Array(t.length)].map(o=>r.uint8))}},jp=Object.freeze({__proto__:null,prep:Gp}),Up=class extends mt{constructor(t,e){let{p:r}=super(t,e);Z(this,"data",()=>r.readBytes())}},Hp=Object.freeze({__proto__:null,CFF:Up}),Wp=class extends mt{constructor(t,e){let{p:r}=super(t,e);Z(this,"data",()=>r.readBytes())}},Yp=Object.freeze({__proto__:null,CFF2:Wp}),qp=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.defaultVertOriginY=r.int16,this.numVertOriginYMetrics=r.uint16,Z(this,"vertORiginYMetrics",()=>[...new Array(this.numVertOriginYMetrics)].map(o=>new Zp(r)))}},Zp=class{constructor(t){this.glyphIndex=t.uint16,this.vertOriginY=t.int16}},Xp=Object.freeze({__proto__:null,VORG:qp}),Kp=class{constructor(t){this.indexSubTableArrayOffset=t.Offset32,this.indexTablesSize=t.uint32,this.numberofIndexSubTables=t.uint32,this.colorRef=t.uint32,this.hori=new ls(t),this.vert=new ls(t),this.startGlyphIndex=t.uint16,this.endGlyphIndex=t.uint16,this.ppemX=t.uint8,this.ppemY=t.uint8,this.bitDepth=t.uint8,this.flags=t.int8}},Jp=class{constructor(t){this.hori=new ls(t),this.vert=new ls(t),this.ppemX=t.uint8,this.ppemY=t.uint8,this.substitutePpemX=t.uint8,this.substitutePpemY=t.uint8}},ls=class{constructor(t){this.ascender=t.int8,this.descender=t.int8,this.widthMax=t.uint8,this.caretSlopeNumerator=t.int8,this.caretSlopeDenominator=t.int8,this.caretOffset=t.int8,this.minOriginSB=t.int8,this.minAdvanceSB=t.int8,this.maxBeforeBL=t.int8,this.minAfterBL=t.int8,this.pad1=t.int8,this.pad2=t.int8}},ru=class extends mt{constructor(t,e,r){let{p:o}=super(t,e,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16,this.numSizes=o.uint32,Z(this,"bitMapSizes",()=>[...new Array(this.numSizes)].map(s=>new Kp(o)))}},Qp=Object.freeze({__proto__:null,EBLC:ru}),ou=class extends mt{constructor(t,e,r){let{p:o}=super(t,e,r);this.majorVersion=o.uint16,this.minorVersion=o.uint16}},$p=Object.freeze({__proto__:null,EBDT:ou}),th=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.majorVersion=r.uint16,this.minorVersion=r.uint16,this.numSizes=r.uint32,Z(this,"bitmapScales",()=>[...new Array(this.numSizes)].map(o=>new Jp(r)))}},eh=Object.freeze({__proto__:null,EBSC:th}),rh=class extends ru{constructor(t,e){super(t,e,"CBLC")}},oh=Object.freeze({__proto__:null,CBLC:rh}),sh=class extends ou{constructor(t,e){super(t,e,"CBDT")}},nh=Object.freeze({__proto__:null,CBDT:sh}),ah=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.flags=r.flags(16),this.numStrikes=r.uint32,Z(this,"strikeOffsets",()=>[...new Array(this.numStrikes)].map(o=>r.Offset32))}},ih=Object.freeze({__proto__:null,sbix:ah}),lh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numBaseGlyphRecords=r.uint16,this.baseGlyphRecordsOffset=r.Offset32,this.layerRecordsOffset=r.Offset32,this.numLayerRecords=r.uint16}getBaseGlyphRecord(t){let e=this.tableStart+this.baseGlyphRecordsOffset;this.parser.currentPosition=e;let r=new Sn(this.parser),o=r.gID,s=this.tableStart+this.layerRecordsOffset-6;this.parser.currentPosition=s;let a=new Sn(this.parser),n=a.gID;if(o===t)return r;if(n===t)return a;for(;e!==s;){let l=e+(s-e)/12;this.parser.currentPosition=l;let h=new Sn(this.parser),f=h.gID;if(f===t)return h;f>t?s=l:f new uh(p))}},Sn=class{constructor(t){this.gID=t.uint16,this.firstLayerIndex=t.uint16,this.numLayers=t.uint16}},uh=class{constructor(t){this.gID=t.uint16,this.paletteIndex=t.uint16}},fh=Object.freeze({__proto__:null,COLR:lh}),ch=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numPaletteEntries=r.uint16;let o=this.numPalettes=r.uint16;this.numColorRecords=r.uint16,this.offsetFirstColorRecord=r.Offset32,this.colorRecordIndices=[...new Array(this.numPalettes)].map(s=>r.uint16),Z(this,"colorRecords",()=>(r.currentPosition=this.tableStart+this.offsetFirstColorRecord,[...new Array(this.numColorRecords)].map(s=>new dh(r)))),this.version===1&&(this.offsetPaletteTypeArray=r.Offset32,this.offsetPaletteLabelArray=r.Offset32,this.offsetPaletteEntryLabelArray=r.Offset32,Z(this,"paletteTypeArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteTypeArray,new mh(r,o))),Z(this,"paletteLabelArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteLabelArray,new ph(r,o))),Z(this,"paletteEntryLabelArray",()=>(r.currentPosition=this.tableStart+this.offsetPaletteEntryLabelArray,new hh(r,o))))}},dh=class{constructor(t){this.blue=t.uint8,this.green=t.uint8,this.red=t.uint8,this.alpha=t.uint8}},mh=class{constructor(t,e){this.paletteTypes=[...new Array(e)].map(r=>t.uint32)}},ph=class{constructor(t,e){this.paletteLabels=[...new Array(e)].map(r=>t.uint16)}},hh=class{constructor(t,e){this.paletteEntryLabels=[...new Array(e)].map(r=>t.uint16)}},gh=Object.freeze({__proto__:null,CPAL:ch}),yh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint32,this.numSignatures=r.uint16,this.flags=r.uint16,this.signatureRecords=[...new Array(this.numSignatures)].map(o=>new vh(r))}getData(t){let e=this.signatureRecords[t];return this.parser.currentPosition=this.tableStart+e.offset,new bh(this.parser)}},vh=class{constructor(t){this.format=t.uint32,this.length=t.uint32,this.offset=t.Offset32}},bh=class{constructor(t){t.uint16,t.uint16,this.signatureLength=t.uint32,this.signature=t.readBytes(this.signatureLength)}},wh=Object.freeze({__proto__:null,DSIG:yh}),Sh=class extends mt{constructor(t,e,r){let{p:o}=super(t,e),s=r.hmtx.numGlyphs;this.version=o.uint16,this.numRecords=o.int16,this.sizeDeviceRecord=o.int32,this.records=[...new Array(numRecords)].map(a=>new xh(o,s))}},xh=class{constructor(t,e){this.pixelSize=t.uint8,this.maxWidth=t.uint8,this.widths=t.readBytes(e)}},Ch=Object.freeze({__proto__:null,hdmx:Sh}),Fh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.nTables=r.uint16,Z(this,"tables",()=>{let o=this.tableStart+4,s=[];for(let a=0;a [...new Array(this.nPairs)].map(e=>new Oh(t)))),this.format===2&&console.warn("Kern subtable format 2 is not supported: this parser currently only parses universal table data.")}get horizontal(){return this.coverage[0]}get minimum(){return this.coverage[1]}get crossstream(){return this.coverage[2]}get override(){return this.coverage[3]}},Oh=class{constructor(t){this.left=t.uint16,this.right=t.uint16,this.value=t.fword}},Th=Object.freeze({__proto__:null,kern:Fh}),_h=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numGlyphs=r.uint16,this.yPels=r.readBytes(this.numGlyphs)}},Ph=Object.freeze({__proto__:null,LTSH:_h}),Ah=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.mergeClassCount=r.uint16,this.mergeDataOffset=r.Offset16,this.classDefCount=r.uint16,this.offsetToClassDefOffsets=r.Offset16,Z(this,"mergeEntryMatrix",()=>[...new Array(this.mergeClassCount)].map(o=>r.readBytes(this.mergeClassCount))),console.warn("Full MERG parsing is currently not supported."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}},Eh=Object.freeze({__proto__:null,MERG:Ah}),Rh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint32,this.flags=r.uint32,r.uint32,this.dataMapsCount=r.uint32,this.dataMaps=[...new Array(this.dataMapsCount)].map(o=>new Ih(this.tableStart,r))}},Ih=class{constructor(t,e){this.tableStart=t,this.parser=e,this.tag=e.tag,this.dataOffset=e.Offset32,this.dataLength=e.uint32}getData(){return this.parser.currentField=this.tableStart+this.dataOffset,this.parser.readBytes(this.dataLength)}},Lh=Object.freeze({__proto__:null,meta:Rh}),Bh=class extends mt{constructor(t,e){super(t,e),console.warn("This font uses a PCLT table, which is currently not supported by this parser."),console.warn("If you need this table parsed, please file an issue, or better yet, a PR.")}},Vh=Object.freeze({__proto__:null,PCLT:Bh}),Dh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.uint16,this.numRecs=r.uint16,this.numRatios=r.uint16,this.ratRanges=[...new Array(this.numRatios)].map(o=>new Nh(r)),this.offsets=[...new Array(this.numRatios)].map(o=>r.Offset16),this.VDMXGroups=[...new Array(this.numRecs)].map(o=>new zh(r))}},Nh=class{constructor(t){this.bCharSet=t.uint8,this.xRatio=t.uint8,this.yStartRatio=t.uint8,this.yEndRatio=t.uint8}},zh=class{constructor(t){this.recs=t.uint16,this.startsz=t.uint8,this.endsz=t.uint8,this.records=[...new Array(this.recs)].map(e=>new Mh(t))}},Mh=class{constructor(t){this.yPelHeight=t.uint16,this.yMax=t.int16,this.yMin=t.int16}},Gh=Object.freeze({__proto__:null,VDMX:Dh}),jh=class extends mt{constructor(t,e){let{p:r}=super(t,e);this.version=r.fixed,this.ascent=this.vertTypoAscender=r.int16,this.descent=this.vertTypoDescender=r.int16,this.lineGap=this.vertTypoLineGap=r.int16,this.advanceHeightMax=r.int16,this.minTopSideBearing=r.int16,this.minBottomSideBearing=r.int16,this.yMaxExtent=r.int16,this.caretSlopeRise=r.int16,this.caretSlopeRun=r.int16,this.caretOffset=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.reserved=r.int16,this.metricDataFormat=r.int16,this.numOfLongVerMetrics=r.uint16,r.verifyLength()}},Uh=Object.freeze({__proto__:null,vhea:jh}),Hh=class extends mt{constructor(t,e,r){super(t,e);let o=r.vhea.numOfLongVerMetrics,s=r.maxp.numGlyphs,a=p.currentPosition;if(lazy(this,"vMetrics",()=>(p.currentPosition=a,[...new Array(o)].map(n=>new Wh(p.uint16,p.int16)))),o (p.currentPosition=n,[...new Array(s-o)].map(l=>p.int16)))}}},Wh=class{constructor(t,e){this.advanceHeight=t,this.topSideBearing=e}},Yh=Object.freeze({__proto__:null,vmtx:Hh});var su=u(X(),1);var{kebabCase:qh}=yt(su.privateApis);function nu(t){let e=t.reduce((r,o)=>(r[o.fontFamily]||(r[o.fontFamily]={name:o.fontFamily,fontFamily:o.fontFamily,slug:qh(o.fontFamily.toLowerCase()),fontFace:[]}),r[o.fontFamily].fontFace.push(o),r),{});return Object.values(e)}var he=u(z(),1);function Zh(){let{installFonts:t}=(0,bo.useContext)(ie),[e,r]=(0,bo.useState)(!1),[o,s]=(0,bo.useState)(null),a=g=>{l(g)},n=g=>{l(g.target.files)},l=async g=>{if(!g)return;s(null),r(!0);let y=new Set,_=[...g],A=!1,k=_.map(async b=>{if(!await f(b))return A=!0,null;if(y.has(b.name))return null;let Y=(((b.name??"").split(".")??[]).pop()??"").toLowerCase();return gn.includes(Y)?(y.add(b.name),b):null}),x=(await Promise.all(k)).filter(b=>b!==null);if(x.length>0)h(x);else{let b=A?(0,Wr.__)("Sorry, you are not allowed to upload this file type."):(0,Wr.__)("No fonts found to install.");s({type:"error",message:b}),r(!1)}},h=async g=>{let y=await Promise.all(g.map(async _=>{let A=await d(_);return await er(A,A.file,"all"),A}));m(y)};async function f(g){let y=new us("Uploaded Font");try{let _=await c(g);return await y.fromDataBuffer(_,"font"),!0}catch{return!1}}async function c(g){return new Promise((y,_)=>{let A=new window.FileReader;A.readAsArrayBuffer(g),A.onload=()=>y(A.result),A.onerror=_})}let d=async g=>{let y=await c(g),_=new us("Uploaded Font");_.fromDataBuffer(y,g.name);let k=(await new Promise($=>_.onload=$)).detail.font,{name:x}=k.opentype.tables,b=x.get(16)||x.get(1),T=x.get(2).toLowerCase().includes("italic"),Y=k.opentype.tables["OS/2"].usWeightClass||"normal",D=!!k.opentype.tables.fvar&&k.opentype.tables.fvar.axes.find(({tag:$})=>$==="wght"),H=D?`${D.minValue} ${D.maxValue}`:null;return{file:g,fontFamily:b,fontStyle:T?"italic":"normal",fontWeight:H||Y}},m=async g=>{let y=nu(g);try{await t(y),s({type:"success",message:(0,Wr.__)("Fonts were installed successfully.")})}catch(_){let A=_;s({type:"error",message:A.message,errors:A?.installationErrors})}r(!1)};return(0,he.jsxs)("div",{className:"font-library__tabpanel-layout",children:[(0,he.jsx)(te.DropZone,{onFilesDrop:a}),(0,he.jsxs)(te.__experimentalVStack,{className:"font-library__local-fonts",justify:"start",children:[o&&(0,he.jsxs)(te.Notice,{status:o.type,__unstableHTML:!0,onRemove:()=>s(null),children:[o.message,o.errors&&(0,he.jsx)("ul",{children:o.errors.map((g,y)=>(0,he.jsx)("li",{children:g},y))})]}),e&&(0,he.jsx)(te.FlexItem,{children:(0,he.jsx)("div",{className:"font-library__upload-area",children:(0,he.jsx)(te.ProgressBar,{})})}),!e&&(0,he.jsx)(te.FormFileUpload,{accept:gn.map(g=>`.${g}`).join(","),multiple:!0,onChange:n,render:({openFileDialog:g})=>(0,he.jsx)(te.Button,{__next40pxDefaultSize:!0,className:"font-library__upload-area",onClick:g,children:(0,Wr.__)("Upload font")})}),(0,he.jsx)(te.__experimentalText,{className:"font-library__upload-area__text",children:(0,Wr.__)("Uploaded fonts appear in your library and can be used in your theme. Supported formats: .ttf, .otf, .woff, and .woff2.")})]})]})}var fs=Zh;var iu=u(z(),1),{Tabs:G2}=yt(Cn.privateApis),j2={id:"installed-fonts",title:(0,cs._x)("Library","Font library")},U2={id:"upload-fonts",title:(0,cs._x)("Upload","noun")};var lu=u(it(),1),Fn=u(X(),1),Kh=u(vt(),1);var uu=u(z(),1);var kn=u(z(),1);var fu=u(it(),1),ds=u(X(),1);var cu=u(z(),1);var Tn=u(z(),1);var Pe=u(it(),1),_n=u(X(),1),sg=u(vt(),1);var du=u(ae(),1);var rg=u(z(),1),{useSettingsForBlockElement:bC,TypographyPanel:wC}=yt(du.privateApis);var og=u(z(),1);var Pn=u(z(),1),PC={text:{description:(0,Pe.__)("Manage the fonts used on the site."),title:(0,Pe.__)("Text")},link:{description:(0,Pe.__)("Manage the fonts and typography used on the links."),title:(0,Pe.__)("Links")},heading:{description:(0,Pe.__)("Manage the fonts and typography used on headings."),title:(0,Pe.__)("Headings")},caption:{description:(0,Pe.__)("Manage the fonts and typography used on captions."),title:(0,Pe.__)("Captions")},button:{description:(0,Pe.__)("Manage the fonts and typography used on buttons."),title:(0,Pe.__)("Buttons")}};var lg=u(it(),1),ug=u(X(),1),pu=u(ae(),1);var Yr=u(X(),1),mu=u(it(),1);var ig=u(vt(),1);var ng=u(X(),1),ag=u(z(),1);var An=u(z(),1);var En=u(z(),1),{useSettingsForBlockElement:WC,ColorPanel:YC}=yt(pu.privateApis);var gg=u(it(),1),Su=u(X(),1);var dg=u(mr(),1),Rn=u(X(),1),mg=u(it(),1);var ps=u(X(),1);var ms=u(X(),1);var hu=u(z(),1);function gu(){let{paletteColors:t}=Vr();return t.slice(0,4).map(({slug:e,color:r},o)=>(0,hu.jsx)("div",{style:{flexGrow:1,height:"100%",background:r}},`${e}-${o}`))}var So=u(z(),1),fg={start:{scale:1,opacity:1},hover:{scale:0,opacity:0}},cg=({label:t,isFocused:e,withHoverView:r})=>(0,So.jsx)(zr,{label:t,isFocused:e,withHoverView:r,children:({key:o})=>(0,So.jsx)(ms.__unstableMotion.div,{variants:fg,style:{height:"100%",overflow:"hidden"},children:(0,So.jsx)(ms.__experimentalHStack,{spacing:0,justify:"center",style:{height:"100%",overflow:"hidden"},children:(0,So.jsx)(gu,{})})},o)}),yu=cg;var kr=u(z(),1),vu=["color"];function hs({title:t,gap:e=2}){let r=Mo(vu);return r?.length<=1?null:(0,kr.jsxs)(ps.__experimentalVStack,{spacing:3,children:[t&&(0,kr.jsx)(xe,{level:3,children:t}),(0,kr.jsx)(ps.__experimentalGrid,{gap:e,children:r.map((o,s)=>(0,kr.jsx)(Gr,{variation:o,isPill:!0,properties:vu,showTooltip:!0,children:()=>(0,kr.jsx)(yu,{})},s))})]})}var bu=u(z(),1);var pg=u(mr(),1),gs=u(X(),1),hg=u(it(),1);var wu=u(z(),1);var In=u(z(),1),{Tabs:y6}=yt(Su.privateApis);var vg=u(it(),1),Cu=u(ae(),1),bg=u(X(),1);var xu=u(ae(),1);var yg=u(z(),1);var{BackgroundPanel:S6}=yt(xu.privateApis);var Ln=u(z(),1),{useHasBackgroundPanel:_6}=yt(Cu.privateApis);var Or=u(X(),1),Bn=u(it(),1);var Fg=u(vt(),1);var wg=u(X(),1),Sg=u(it(),1),xg=u(z(),1);var Vn=u(z(),1),{Menu:M6}=yt(Or.privateApis);var Ut=u(X(),1),xo=u(it(),1);var ys=u(vt(),1);var Dn=u(z(),1),{Menu:eF}=yt(Ut.privateApis),rF=[{label:(0,xo.__)("Rename"),action:"rename"},{label:(0,xo.__)("Delete"),action:"delete"}],oF=[{label:(0,xo.__)("Reset"),action:"reset"}];var kg=u(z(),1);var _g=u(it(),1),ku=u(ae(),1);var Fu=u(ae(),1),Og=u(vt(),1);var Tg=u(z(),1),{useSettingsForBlockElement:dF,DimensionsPanel:mF}=yt(Fu.privateApis);var Nn=u(z(),1),{useHasDimensionsPanel:wF,useSettingsForBlockElement:SF}=yt(ku.privateApis);var Eu=u(X(),1),Rg=u(it(),1);var Ag=u(it(),1),Eg=u(X(),1);var Ou=u(we(),1),Tu=u(de(),1),bs=u(vt(),1),_u=u(X(),1),Pu=u(it(),1);var vs=u(z(),1);function Pg({gap:t=2}){let{user:e}=(0,bs.useContext)(Kt),r=e?.styles,s=(0,Tu.useSelect)(n=>{let l=n(Ou.store).__experimentalGetCurrentThemeGlobalStylesVariations();return Array.isArray(l)?l:void 0},[])?.filter(n=>!fo(n,["color"])&&!fo(n,["typography","spacing"])),a=(0,bs.useMemo)(()=>[...[{title:(0,Pu.__)("Default"),settings:{},styles:{}},...s??[]].map(l=>{let h=l?.styles?.blocks?{...l.styles.blocks}:{};r?.blocks&&Object.keys(r.blocks).forEach(m=>{if(r.blocks?.[m]?.css){let g=h[m]||{},y={css:`${h[m]?.css||""} ${r.blocks?.[m]?.css?.trim()||""}`};h[m]={...g,...y}}});let f=r?.css||l.styles?.css?{css:`${l.styles?.css||""} ${r?.css||""}`}:{},c=Object.keys(h).length>0?{blocks:h}:{},d={...l.styles,...f,...c};return{...l,settings:l.settings??{},styles:d}})],[s,r?.blocks,r?.css]);return!s||s.length<1?null:(0,vs.jsx)(_u.__experimentalGrid,{columns:2,className:"global-styles-ui-style-variations-container",gap:t,children:a.map((n,l)=>(0,vs.jsx)(Gr,{variation:n,children:h=>(0,vs.jsx)(an,{label:n?.title,withHoverView:!0,isFocused:h,variation:n})},l))})}var zn=Pg;var Au=u(z(),1);var Mn=u(z(),1);var Ig=u(it(),1),Lg=u(X(),1),Ru=u(ae(),1);var Gn=u(z(),1),{AdvancedPanel:zF}=yt(Ru.privateApis);var Gu=u(it(),1),Un=u(X(),1),Hn=u(vt(),1);var Bg=u(de(),1),Vg=u(we(),1),Iu=u(vt(),1);var Vu=u(it(),1),Du=u(X(),1),ws=u(Bu(),1),Dg=u(we(),1),Ng=u(de(),1);var Nu=u(pn(),1),zu=u(z(),1),HF=3600*1e3*24;var jn=u(X(),1),Co=u(it(),1);var Mu=u(z(),1);var Wn=u(z(),1);var Yn=u(it(),1),Ze=u(X(),1);var Ug=u(vt(),1);var Mg=u(X(),1),Gg=u(it(),1),jg=u(z(),1);var qn=u(z(),1),{Menu:c3}=yt(Ze.privateApis);var Wu=u(it(),1),Me=u(X(),1);var Yu=u(vt(),1);var Hg=u(ae(),1),Wg=u(it(),1);var Yg=u(z(),1);var qg=u(X(),1),ju=u(it(),1),Zg=u(z(),1);var Fo=u(X(),1),Xg=u(it(),1),Kg=u(vt(),1),Uu=u(z(),1);var Xe=u(X(),1),Hu=u(z(),1);var Zn=u(z(),1),{Menu:P3}=yt(Me.privateApis);var Kn=u(z(),1);var Jn=u(z(),1);function qr(t){return function({value:r,baseValue:o,onChange:s,...a}){return(0,Jn.jsx)(uo,{value:r,baseValue:o,onChange:s,children:(0,Jn.jsx)(t,{...a})})}}var ty=qr(zn);var ey=qr(hs);var ry=qr(qo);var Zr=u(z(),1);function Qn({value:t,baseValue:e,onChange:r,activeTab:o="installed-fonts"}){let s;switch(o){case"upload-fonts":s=(0,Zr.jsx)(fs,{});break;case"installed-fonts":s=(0,Zr.jsx)(es,{});break;default:s=(0,Zr.jsx)(os,{slug:o})}return(0,Zr.jsx)(uo,{value:t,baseValue:e,onChange:r,children:(0,Zr.jsx)(Ko,{children:s})})}var Xu=u(zs()),{unlock:$n}=(0,Xu.__dangerousOptInToUnstableAPIsOnlyForCoreModules)("I acknowledge private features are not for use in themes or plugins and doing so will break in the next version of WordPress.","@wordpress/font-list-route");if(typeof document<"u"&&!document.head.querySelector("style[data-wp-hash='eb78745b9d']")){let t=document.createElement("style");t.setAttribute("data-wp-hash","eb78745b9d"),t.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: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 #0000}.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 #0000;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 #0000;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:pointer}.global-styles-ui-variations_item .global-styles-ui-variations_item-preview{border-radius:2px;outline:1px solid #0000001a;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:#0000004d}.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{align-items:center;cursor:pointer;display:flex;justify-content:center;line-height:1}.global-styles-ui-preview__wrapper{display:block;max-width:100%;width:100%}.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{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%,#0000 0,#0000 75%,#e0e0e0 0,#e0e0e0),repeating-linear-gradient(45deg,#e0e0e0 25%,#0000 0,#0000 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 .components-v-stack{flex:1 1 auto}.global-styles-ui-screen-css .components-v-stack .block-editor-global-styles-advanced-panel__custom-css-input,.global-styles-ui-screen-css .components-v-stack .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 .components-v-stack .block-editor-global-styles-advanced-panel__custom-css-input .components-base-control__field .components-textarea-control__input{direction:ltr;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}.admin-ui-page:has(.font-library__footer) .font-library-page__tab-panel{max-height:calc(100% - 198px)}')),document.head.appendChild(t)}var{Tabs:Ss}=$n(Ku.privateApis),{useGlobalStyles:oy}=$n(Ju.privateApis);function sy(){let{records:t=[]}=(0,xs.useEntityRecords)("root","fontCollection",{_fields:"slug,name,description"}),[e,r]=(0,$u.useState)("installed-fonts"),{base:o,user:s,setUser:a,isReady:n}=oy(),l=(0,Qu.useSelect)(f=>f(xs.store).canUser("create",{kind:"postType",name:"wp_font_family"}),[]);if(!n)return null;let h=[{id:"installed-fonts",title:(0,Xr._x)("Library","Font library")}];return l&&(h.push({id:"upload-fonts",title:(0,Xr._x)("Upload","noun")}),h.push(...(t||[]).map(({slug:f,name:c})=>({id:f,title:t&&t.length===1&&f==="google-fonts"?(0,Xr.__)("Install Fonts"):c})))),React.createElement(Ms,{title:(0,Xr.__)("Fonts")},React.createElement(Ss,{selectedTabId:e,onSelect:f=>r(f)},React.createElement("div",{className:"font-library-page__tablist"},React.createElement(Ss.TabList,null,h.map(({id:f,title:c})=>React.createElement(Ss.Tab,{key:f,tabId:f},c)))),h.map(({id:f})=>React.createElement(Ss.TabPanel,{key:f,tabId:f,focusable:!1,className:"font-library-page__tab-panel"},React.createElement(Qn,{value:s,baseValue:o,onChange:a,activeTab:f})))))}function ny(){return React.createElement(sy,null)}var ay=ny;export{ay as stage}; /*! Bundled license information: is-plain-object/dist/is-plain-object.mjs: diff --git a/src/wp-includes/build/routes/guidelines/content.js b/src/wp-includes/build/routes/guidelines/content.js new file mode 100644 index 0000000000000..4af0c1753b930 --- /dev/null +++ b/src/wp-includes/build/routes/guidelines/content.js @@ -0,0 +1,22848 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __commonJS = (cb, mod) => function __require() { + return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __copyProps = (to, from, except, desc) => { + if (from && typeof from === "object" || typeof from === "function") { + for (let key of __getOwnPropNames(from)) + if (!__hasOwnProp.call(to, key) && key !== except) + __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable }); + } + return to; +}; +var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps( + // If the importer is in node compatibility mode or this is not an ESM + // file that has been converted to a CommonJS file using a Babel- + // compatible transform (i.e. "__esModule" has not been set), then set + // "default" to the CommonJS "module.exports" for node compatibility. + isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target, + mod +)); + +// package-external:@wordpress/i18n +var require_i18n = __commonJS({ + "package-external:@wordpress/i18n"(exports, module) { + module.exports = window.wp.i18n; + } +}); + +// package-external:@wordpress/components +var require_components = __commonJS({ + "package-external:@wordpress/components"(exports, module) { + module.exports = window.wp.components; + } +}); + +// vendor-external:react/jsx-runtime +var require_jsx_runtime = __commonJS({ + "vendor-external:react/jsx-runtime"(exports, module) { + module.exports = window.ReactJSXRuntime; + } +}); + +// package-external:@wordpress/element +var require_element = __commonJS({ + "package-external:@wordpress/element"(exports, module) { + module.exports = window.wp.element; + } +}); + +// vendor-external:react +var require_react = __commonJS({ + "vendor-external:react"(exports, module) { + module.exports = window.React; + } +}); + +// vendor-external:react-dom +var require_react_dom = __commonJS({ + "vendor-external:react-dom"(exports, module) { + module.exports = window.ReactDOM; + } +}); + +// node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js +var require_use_sync_external_store_shim_development = __commonJS({ + "node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.development.js"(exports) { + "use strict"; + (function() { + function is(x2, y2) { + return x2 === y2 && (0 !== x2 || 1 / x2 === 1 / y2) || x2 !== x2 && y2 !== y2; + } + function useSyncExternalStore$2(subscribe2, getSnapshot) { + didWarnOld18Alpha || void 0 === React26.startTransition || (didWarnOld18Alpha = true, console.error( + "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." + )); + var value = getSnapshot(); + if (!didWarnUncachedGetSnapshot) { + var cachedValue = getSnapshot(); + objectIs(value, cachedValue) || (console.error( + "The result of getSnapshot should be cached to avoid an infinite loop" + ), didWarnUncachedGetSnapshot = true); + } + cachedValue = useState41({ + inst: { value, getSnapshot } + }); + var inst = cachedValue[0].inst, forceUpdate = cachedValue[1]; + useLayoutEffect5( + function() { + inst.value = value; + inst.getSnapshot = getSnapshot; + checkIfSnapshotChanged(inst) && forceUpdate({ inst }); + }, + [subscribe2, value, getSnapshot] + ); + useEffect36( + function() { + checkIfSnapshotChanged(inst) && forceUpdate({ inst }); + return subscribe2(function() { + checkIfSnapshotChanged(inst) && forceUpdate({ inst }); + }); + }, + [subscribe2] + ); + useDebugValue(value); + return value; + } + function checkIfSnapshotChanged(inst) { + var latestGetSnapshot = inst.getSnapshot; + inst = inst.value; + try { + var nextValue = latestGetSnapshot(); + return !objectIs(inst, nextValue); + } catch (error2) { + return true; + } + } + function useSyncExternalStore$1(subscribe2, getSnapshot) { + return getSnapshot(); + } + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); + var React26 = require_react(), objectIs = "function" === typeof Object.is ? Object.is : is, useState41 = React26.useState, useEffect36 = React26.useEffect, useLayoutEffect5 = React26.useLayoutEffect, useDebugValue = React26.useDebugValue, didWarnOld18Alpha = false, didWarnUncachedGetSnapshot = false, shim = "undefined" === typeof window || "undefined" === typeof window.document || "undefined" === typeof window.document.createElement ? useSyncExternalStore$1 : useSyncExternalStore$2; + exports.useSyncExternalStore = void 0 !== React26.useSyncExternalStore ? React26.useSyncExternalStore : shim; + "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && "function" === typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); + })(); + } +}); + +// node_modules/use-sync-external-store/shim/index.js +var require_shim = __commonJS({ + "node_modules/use-sync-external-store/shim/index.js"(exports, module) { + "use strict"; + if (false) { + module.exports = null; + } else { + module.exports = require_use_sync_external_store_shim_development(); + } + } +}); + +// package-external:@wordpress/primitives +var require_primitives = __commonJS({ + "package-external:@wordpress/primitives"(exports, module) { + module.exports = window.wp.primitives; + } +}); + +// package-external:@wordpress/private-apis +var require_private_apis = __commonJS({ + "package-external:@wordpress/private-apis"(exports, module) { + module.exports = window.wp.privateApis; + } +}); + +// package-external:@wordpress/compose +var require_compose = __commonJS({ + "package-external:@wordpress/compose"(exports, module) { + module.exports = window.wp.compose; + } +}); + +// package-external:@wordpress/keycodes +var require_keycodes = __commonJS({ + "package-external:@wordpress/keycodes"(exports, module) { + module.exports = window.wp.keycodes; + } +}); + +// package-external:@wordpress/data +var require_data = __commonJS({ + "package-external:@wordpress/data"(exports, module) { + module.exports = window.wp.data; + } +}); + +// node_modules/remove-accents/index.js +var require_remove_accents = __commonJS({ + "node_modules/remove-accents/index.js"(exports, module) { + var characterMap = { + "\xC0": "A", + "\xC1": "A", + "\xC2": "A", + "\xC3": "A", + "\xC4": "A", + "\xC5": "A", + "\u1EA4": "A", + "\u1EAE": "A", + "\u1EB2": "A", + "\u1EB4": "A", + "\u1EB6": "A", + "\xC6": "AE", + "\u1EA6": "A", + "\u1EB0": "A", + "\u0202": "A", + "\u1EA2": "A", + "\u1EA0": "A", + "\u1EA8": "A", + "\u1EAA": "A", + "\u1EAC": "A", + "\xC7": "C", + "\u1E08": "C", + "\xC8": "E", + "\xC9": "E", + "\xCA": "E", + "\xCB": "E", + "\u1EBE": "E", + "\u1E16": "E", + "\u1EC0": "E", + "\u1E14": "E", + "\u1E1C": "E", + "\u0206": "E", + "\u1EBA": "E", + "\u1EBC": "E", + "\u1EB8": "E", + "\u1EC2": "E", + "\u1EC4": "E", + "\u1EC6": "E", + "\xCC": "I", + "\xCD": "I", + "\xCE": "I", + "\xCF": "I", + "\u1E2E": "I", + "\u020A": "I", + "\u1EC8": "I", + "\u1ECA": "I", + "\xD0": "D", + "\xD1": "N", + "\xD2": "O", + "\xD3": "O", + "\xD4": "O", + "\xD5": "O", + "\xD6": "O", + "\xD8": "O", + "\u1ED0": "O", + "\u1E4C": "O", + "\u1E52": "O", + "\u020E": "O", + "\u1ECE": "O", + "\u1ECC": "O", + "\u1ED4": "O", + "\u1ED6": "O", + "\u1ED8": "O", + "\u1EDC": "O", + "\u1EDE": "O", + "\u1EE0": "O", + "\u1EDA": "O", + "\u1EE2": "O", + "\xD9": "U", + "\xDA": "U", + "\xDB": "U", + "\xDC": "U", + "\u1EE6": "U", + "\u1EE4": "U", + "\u1EEC": "U", + "\u1EEE": "U", + "\u1EF0": "U", + "\xDD": "Y", + "\xE0": "a", + "\xE1": "a", + "\xE2": "a", + "\xE3": "a", + "\xE4": "a", + "\xE5": "a", + "\u1EA5": "a", + "\u1EAF": "a", + "\u1EB3": "a", + "\u1EB5": "a", + "\u1EB7": "a", + "\xE6": "ae", + "\u1EA7": "a", + "\u1EB1": "a", + "\u0203": "a", + "\u1EA3": "a", + "\u1EA1": "a", + "\u1EA9": "a", + "\u1EAB": "a", + "\u1EAD": "a", + "\xE7": "c", + "\u1E09": "c", + "\xE8": "e", + "\xE9": "e", + "\xEA": "e", + "\xEB": "e", + "\u1EBF": "e", + "\u1E17": "e", + "\u1EC1": "e", + "\u1E15": "e", + "\u1E1D": "e", + "\u0207": "e", + "\u1EBB": "e", + "\u1EBD": "e", + "\u1EB9": "e", + "\u1EC3": "e", + "\u1EC5": "e", + "\u1EC7": "e", + "\xEC": "i", + "\xED": "i", + "\xEE": "i", + "\xEF": "i", + "\u1E2F": "i", + "\u020B": "i", + "\u1EC9": "i", + "\u1ECB": "i", + "\xF0": "d", + "\xF1": "n", + "\xF2": "o", + "\xF3": "o", + "\xF4": "o", + "\xF5": "o", + "\xF6": "o", + "\xF8": "o", + "\u1ED1": "o", + "\u1E4D": "o", + "\u1E53": "o", + "\u020F": "o", + "\u1ECF": "o", + "\u1ECD": "o", + "\u1ED5": "o", + "\u1ED7": "o", + "\u1ED9": "o", + "\u1EDD": "o", + "\u1EDF": "o", + "\u1EE1": "o", + "\u1EDB": "o", + "\u1EE3": "o", + "\xF9": "u", + "\xFA": "u", + "\xFB": "u", + "\xFC": "u", + "\u1EE7": "u", + "\u1EE5": "u", + "\u1EED": "u", + "\u1EEF": "u", + "\u1EF1": "u", + "\xFD": "y", + "\xFF": "y", + "\u0100": "A", + "\u0101": "a", + "\u0102": "A", + "\u0103": "a", + "\u0104": "A", + "\u0105": "a", + "\u0106": "C", + "\u0107": "c", + "\u0108": "C", + "\u0109": "c", + "\u010A": "C", + "\u010B": "c", + "\u010C": "C", + "\u010D": "c", + "C\u0306": "C", + "c\u0306": "c", + "\u010E": "D", + "\u010F": "d", + "\u0110": "D", + "\u0111": "d", + "\u0112": "E", + "\u0113": "e", + "\u0114": "E", + "\u0115": "e", + "\u0116": "E", + "\u0117": "e", + "\u0118": "E", + "\u0119": "e", + "\u011A": "E", + "\u011B": "e", + "\u011C": "G", + "\u01F4": "G", + "\u011D": "g", + "\u01F5": "g", + "\u011E": "G", + "\u011F": "g", + "\u0120": "G", + "\u0121": "g", + "\u0122": "G", + "\u0123": "g", + "\u0124": "H", + "\u0125": "h", + "\u0126": "H", + "\u0127": "h", + "\u1E2A": "H", + "\u1E2B": "h", + "\u0128": "I", + "\u0129": "i", + "\u012A": "I", + "\u012B": "i", + "\u012C": "I", + "\u012D": "i", + "\u012E": "I", + "\u012F": "i", + "\u0130": "I", + "\u0131": "i", + "\u0132": "IJ", + "\u0133": "ij", + "\u0134": "J", + "\u0135": "j", + "\u0136": "K", + "\u0137": "k", + "\u1E30": "K", + "\u1E31": "k", + "K\u0306": "K", + "k\u0306": "k", + "\u0139": "L", + "\u013A": "l", + "\u013B": "L", + "\u013C": "l", + "\u013D": "L", + "\u013E": "l", + "\u013F": "L", + "\u0140": "l", + "\u0141": "l", + "\u0142": "l", + "\u1E3E": "M", + "\u1E3F": "m", + "M\u0306": "M", + "m\u0306": "m", + "\u0143": "N", + "\u0144": "n", + "\u0145": "N", + "\u0146": "n", + "\u0147": "N", + "\u0148": "n", + "\u0149": "n", + "N\u0306": "N", + "n\u0306": "n", + "\u014C": "O", + "\u014D": "o", + "\u014E": "O", + "\u014F": "o", + "\u0150": "O", + "\u0151": "o", + "\u0152": "OE", + "\u0153": "oe", + "P\u0306": "P", + "p\u0306": "p", + "\u0154": "R", + "\u0155": "r", + "\u0156": "R", + "\u0157": "r", + "\u0158": "R", + "\u0159": "r", + "R\u0306": "R", + "r\u0306": "r", + "\u0212": "R", + "\u0213": "r", + "\u015A": "S", + "\u015B": "s", + "\u015C": "S", + "\u015D": "s", + "\u015E": "S", + "\u0218": "S", + "\u0219": "s", + "\u015F": "s", + "\u0160": "S", + "\u0161": "s", + "\u0162": "T", + "\u0163": "t", + "\u021B": "t", + "\u021A": "T", + "\u0164": "T", + "\u0165": "t", + "\u0166": "T", + "\u0167": "t", + "T\u0306": "T", + "t\u0306": "t", + "\u0168": "U", + "\u0169": "u", + "\u016A": "U", + "\u016B": "u", + "\u016C": "U", + "\u016D": "u", + "\u016E": "U", + "\u016F": "u", + "\u0170": "U", + "\u0171": "u", + "\u0172": "U", + "\u0173": "u", + "\u0216": "U", + "\u0217": "u", + "V\u0306": "V", + "v\u0306": "v", + "\u0174": "W", + "\u0175": "w", + "\u1E82": "W", + "\u1E83": "w", + "X\u0306": "X", + "x\u0306": "x", + "\u0176": "Y", + "\u0177": "y", + "\u0178": "Y", + "Y\u0306": "Y", + "y\u0306": "y", + "\u0179": "Z", + "\u017A": "z", + "\u017B": "Z", + "\u017C": "z", + "\u017D": "Z", + "\u017E": "z", + "\u017F": "s", + "\u0192": "f", + "\u01A0": "O", + "\u01A1": "o", + "\u01AF": "U", + "\u01B0": "u", + "\u01CD": "A", + "\u01CE": "a", + "\u01CF": "I", + "\u01D0": "i", + "\u01D1": "O", + "\u01D2": "o", + "\u01D3": "U", + "\u01D4": "u", + "\u01D5": "U", + "\u01D6": "u", + "\u01D7": "U", + "\u01D8": "u", + "\u01D9": "U", + "\u01DA": "u", + "\u01DB": "U", + "\u01DC": "u", + "\u1EE8": "U", + "\u1EE9": "u", + "\u1E78": "U", + "\u1E79": "u", + "\u01FA": "A", + "\u01FB": "a", + "\u01FC": "AE", + "\u01FD": "ae", + "\u01FE": "O", + "\u01FF": "o", + "\xDE": "TH", + "\xFE": "th", + "\u1E54": "P", + "\u1E55": "p", + "\u1E64": "S", + "\u1E65": "s", + "X\u0301": "X", + "x\u0301": "x", + "\u0403": "\u0413", + "\u0453": "\u0433", + "\u040C": "\u041A", + "\u045C": "\u043A", + "A\u030B": "A", + "a\u030B": "a", + "E\u030B": "E", + "e\u030B": "e", + "I\u030B": "I", + "i\u030B": "i", + "\u01F8": "N", + "\u01F9": "n", + "\u1ED2": "O", + "\u1ED3": "o", + "\u1E50": "O", + "\u1E51": "o", + "\u1EEA": "U", + "\u1EEB": "u", + "\u1E80": "W", + "\u1E81": "w", + "\u1EF2": "Y", + "\u1EF3": "y", + "\u0200": "A", + "\u0201": "a", + "\u0204": "E", + "\u0205": "e", + "\u0208": "I", + "\u0209": "i", + "\u020C": "O", + "\u020D": "o", + "\u0210": "R", + "\u0211": "r", + "\u0214": "U", + "\u0215": "u", + "B\u030C": "B", + "b\u030C": "b", + "\u010C\u0323": "C", + "\u010D\u0323": "c", + "\xCA\u030C": "E", + "\xEA\u030C": "e", + "F\u030C": "F", + "f\u030C": "f", + "\u01E6": "G", + "\u01E7": "g", + "\u021E": "H", + "\u021F": "h", + "J\u030C": "J", + "\u01F0": "j", + "\u01E8": "K", + "\u01E9": "k", + "M\u030C": "M", + "m\u030C": "m", + "P\u030C": "P", + "p\u030C": "p", + "Q\u030C": "Q", + "q\u030C": "q", + "\u0158\u0329": "R", + "\u0159\u0329": "r", + "\u1E66": "S", + "\u1E67": "s", + "V\u030C": "V", + "v\u030C": "v", + "W\u030C": "W", + "w\u030C": "w", + "X\u030C": "X", + "x\u030C": "x", + "Y\u030C": "Y", + "y\u030C": "y", + "A\u0327": "A", + "a\u0327": "a", + "B\u0327": "B", + "b\u0327": "b", + "\u1E10": "D", + "\u1E11": "d", + "\u0228": "E", + "\u0229": "e", + "\u0190\u0327": "E", + "\u025B\u0327": "e", + "\u1E28": "H", + "\u1E29": "h", + "I\u0327": "I", + "i\u0327": "i", + "\u0197\u0327": "I", + "\u0268\u0327": "i", + "M\u0327": "M", + "m\u0327": "m", + "O\u0327": "O", + "o\u0327": "o", + "Q\u0327": "Q", + "q\u0327": "q", + "U\u0327": "U", + "u\u0327": "u", + "X\u0327": "X", + "x\u0327": "x", + "Z\u0327": "Z", + "z\u0327": "z", + "\u0439": "\u0438", + "\u0419": "\u0418", + "\u0451": "\u0435", + "\u0401": "\u0415" + }; + var chars = Object.keys(characterMap).join("|"); + var allAccents = new RegExp(chars, "g"); + var firstAccent = new RegExp(chars, ""); + function matcher(match2) { + return characterMap[match2]; + } + var removeAccents3 = function(string) { + return string.replace(allAccents, matcher); + }; + var hasAccents = function(string) { + return !!string.match(firstAccent); + }; + module.exports = removeAccents3; + module.exports.has = hasAccents; + module.exports.remove = removeAccents3; + } +}); + +// node_modules/fast-deep-equal/es6/index.js +var require_es6 = __commonJS({ + "node_modules/fast-deep-equal/es6/index.js"(exports, module) { + "use strict"; + module.exports = function equal(a2, b2) { + if (a2 === b2) return true; + if (a2 && b2 && typeof a2 == "object" && typeof b2 == "object") { + if (a2.constructor !== b2.constructor) return false; + var length, i2, keys; + if (Array.isArray(a2)) { + length = a2.length; + if (length != b2.length) return false; + for (i2 = length; i2-- !== 0; ) + if (!equal(a2[i2], b2[i2])) return false; + return true; + } + if (a2 instanceof Map && b2 instanceof Map) { + if (a2.size !== b2.size) return false; + for (i2 of a2.entries()) + if (!b2.has(i2[0])) return false; + for (i2 of a2.entries()) + if (!equal(i2[1], b2.get(i2[0]))) return false; + return true; + } + if (a2 instanceof Set && b2 instanceof Set) { + if (a2.size !== b2.size) return false; + for (i2 of a2.entries()) + if (!b2.has(i2[0])) return false; + return true; + } + if (ArrayBuffer.isView(a2) && ArrayBuffer.isView(b2)) { + length = a2.length; + if (length != b2.length) return false; + for (i2 = length; i2-- !== 0; ) + if (a2[i2] !== b2[i2]) return false; + return true; + } + if (a2.constructor === RegExp) return a2.source === b2.source && a2.flags === b2.flags; + if (a2.valueOf !== Object.prototype.valueOf) return a2.valueOf() === b2.valueOf(); + if (a2.toString !== Object.prototype.toString) return a2.toString() === b2.toString(); + keys = Object.keys(a2); + length = keys.length; + if (length !== Object.keys(b2).length) return false; + for (i2 = length; i2-- !== 0; ) + if (!Object.prototype.hasOwnProperty.call(b2, keys[i2])) return false; + for (i2 = length; i2-- !== 0; ) { + var key = keys[i2]; + if (!equal(a2[key], b2[key])) return false; + } + return true; + } + return a2 !== a2 && b2 !== b2; + }; + } +}); + +// package-external:@wordpress/date +var require_date = __commonJS({ + "package-external:@wordpress/date"(exports, module) { + module.exports = window.wp.date; + } +}); + +// package-external:@wordpress/warning +var require_warning = __commonJS({ + "package-external:@wordpress/warning"(exports, module) { + module.exports = window.wp.warning; + } +}); + +// node_modules/deepmerge/dist/cjs.js +var require_cjs = __commonJS({ + "node_modules/deepmerge/dist/cjs.js"(exports, module) { + "use strict"; + var isMergeableObject = function isMergeableObject2(value) { + return isNonNullObject(value) && !isSpecial(value); + }; + function isNonNullObject(value) { + return !!value && typeof value === "object"; + } + function isSpecial(value) { + var stringValue = Object.prototype.toString.call(value); + return stringValue === "[object RegExp]" || stringValue === "[object Date]" || isReactElement(value); + } + var canUseSymbol = typeof Symbol === "function" && Symbol.for; + var REACT_ELEMENT_TYPE = canUseSymbol ? /* @__PURE__ */ Symbol.for("react.element") : 60103; + function isReactElement(value) { + return value.$$typeof === REACT_ELEMENT_TYPE; + } + function emptyTarget(val) { + return Array.isArray(val) ? [] : {}; + } + function cloneUnlessOtherwiseSpecified(value, options) { + return options.clone !== false && options.isMergeableObject(value) ? deepmerge(emptyTarget(value), value, options) : value; + } + function defaultArrayMerge(target, source, options) { + return target.concat(source).map(function(element) { + return cloneUnlessOtherwiseSpecified(element, options); + }); + } + function getMergeFunction(key, options) { + if (!options.customMerge) { + return deepmerge; + } + var customMerge = options.customMerge(key); + return typeof customMerge === "function" ? customMerge : deepmerge; + } + function getEnumerableOwnPropertySymbols(target) { + return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(target).filter(function(symbol3) { + return Object.propertyIsEnumerable.call(target, symbol3); + }) : []; + } + function getKeys2(target) { + return Object.keys(target).concat(getEnumerableOwnPropertySymbols(target)); + } + function propertyIsOnObject(object, property) { + try { + return property in object; + } catch (_) { + return false; + } + } + function propertyIsUnsafe(target, key) { + return propertyIsOnObject(target, key) && !(Object.hasOwnProperty.call(target, key) && Object.propertyIsEnumerable.call(target, key)); + } + function mergeObject(target, source, options) { + var destination = {}; + if (options.isMergeableObject(target)) { + getKeys2(target).forEach(function(key) { + destination[key] = cloneUnlessOtherwiseSpecified(target[key], options); + }); + } + getKeys2(source).forEach(function(key) { + if (propertyIsUnsafe(target, key)) { + return; + } + if (propertyIsOnObject(target, key) && options.isMergeableObject(source[key])) { + destination[key] = getMergeFunction(key, options)(target[key], source[key], options); + } else { + destination[key] = cloneUnlessOtherwiseSpecified(source[key], options); + } + }); + return destination; + } + function deepmerge(target, source, options) { + options = options || {}; + options.arrayMerge = options.arrayMerge || defaultArrayMerge; + options.isMergeableObject = options.isMergeableObject || isMergeableObject; + options.cloneUnlessOtherwiseSpecified = cloneUnlessOtherwiseSpecified; + var sourceIsArray = Array.isArray(source); + var targetIsArray = Array.isArray(target); + var sourceAndTargetTypesMatch = sourceIsArray === targetIsArray; + if (!sourceAndTargetTypesMatch) { + return cloneUnlessOtherwiseSpecified(source, options); + } else if (sourceIsArray) { + return options.arrayMerge(target, source, options); + } else { + return mergeObject(target, source, options); + } + } + deepmerge.all = function deepmergeAll(array, options) { + if (!Array.isArray(array)) { + throw new Error("first argument should be an array"); + } + return array.reduce(function(prev, next) { + return deepmerge(prev, next, options); + }, {}); + }; + var deepmerge_1 = deepmerge; + module.exports = deepmerge_1; + } +}); + +// package-external:@wordpress/deprecated +var require_deprecated = __commonJS({ + "package-external:@wordpress/deprecated"(exports, module) { + module.exports = window.wp.deprecated; + } +}); + +// package-external:@wordpress/notices +var require_notices = __commonJS({ + "package-external:@wordpress/notices"(exports, module) { + module.exports = window.wp.notices; + } +}); + +// package-external:@wordpress/api-fetch +var require_api_fetch = __commonJS({ + "package-external:@wordpress/api-fetch"(exports, module) { + module.exports = window.wp.apiFetch; + } +}); + +// package-external:@wordpress/blob +var require_blob = __commonJS({ + "package-external:@wordpress/blob"(exports, module) { + module.exports = window.wp.blob; + } +}); + +// package-external:@wordpress/blocks +var require_blocks = __commonJS({ + "package-external:@wordpress/blocks"(exports, module) { + module.exports = window.wp.blocks; + } +}); + +// node_modules/clsx/dist/clsx.mjs +function r(e2) { + var t2, f2, n2 = ""; + if ("string" == typeof e2 || "number" == typeof e2) n2 += e2; + else if ("object" == typeof e2) if (Array.isArray(e2)) { + var o2 = e2.length; + for (t2 = 0; t2 < o2; t2++) e2[t2] && (f2 = r(e2[t2])) && (n2 && (n2 += " "), n2 += f2); + } else for (f2 in e2) e2[f2] && (n2 && (n2 += " "), n2 += f2); + return n2; +} +function clsx() { + for (var e2, t2, f2 = 0, n2 = "", o2 = arguments.length; f2 < o2; f2++) (e2 = arguments[f2]) && (t2 = r(e2)) && (n2 && (n2 += " "), n2 += t2); + return n2; +} +var clsx_default = clsx; + +// packages/admin-ui/build-module/navigable-region/index.mjs +var import_element = __toESM(require_element(), 1); +var import_jsx_runtime = __toESM(require_jsx_runtime(), 1); +var NavigableRegion = (0, import_element.forwardRef)( + ({ children, className, ariaLabel, as: Tag = "div", ...props }, ref) => { + return /* @__PURE__ */ (0, import_jsx_runtime.jsx)( + Tag, + { + ref, + className: clsx_default("admin-ui-navigable-region", className), + "aria-label": ariaLabel, + role: "region", + tabIndex: "-1", + ...props, + children + } + ); + } +); +NavigableRegion.displayName = "NavigableRegion"; +var navigable_region_default = NavigableRegion; + +// packages/ui/build-module/badge/badge.mjs +var import_element3 = __toESM(require_element(), 1); + +// node_modules/@base-ui/utils/esm/useControlled.js +var React2 = __toESM(require_react(), 1); + +// node_modules/@base-ui/utils/esm/error.js +var set; +if (true) { + set = /* @__PURE__ */ new Set(); +} +function error(...messages) { + if (true) { + const messageKey = messages.join(" "); + if (!set.has(messageKey)) { + set.add(messageKey); + console.error(`Base UI: ${messageKey}`); + } + } +} + +// node_modules/@base-ui/utils/esm/useControlled.js +function useControlled({ + controlled, + default: defaultProp, + name, + state = "value" +}) { + const { + current: isControlled + } = React2.useRef(controlled !== void 0); + const [valueState, setValue] = React2.useState(defaultProp); + const value = isControlled ? controlled : valueState; + if (true) { + React2.useEffect(() => { + if (isControlled !== (controlled !== void 0)) { + error([`A component is changing the ${isControlled ? "" : "un"}controlled ${state} state of ${name} to be ${isControlled ? "un" : ""}controlled.`, "Elements should not switch from uncontrolled to controlled (or vice versa).", `Decide between using a controlled or uncontrolled ${name} element for the lifetime of the component.`, "The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.", "More info: https://fb.me/react-controlled-components"].join("\n")); + } + }, [state, name, controlled]); + const { + current: defaultValue2 + } = React2.useRef(defaultProp); + React2.useEffect(() => { + if (!isControlled && serializeToDevModeString(defaultValue2) !== serializeToDevModeString(defaultProp)) { + error([`A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. To suppress this warning opt to use a controlled ${name}.`].join("\n")); + } + }, [defaultProp]); + } + const setValueIfUncontrolled = React2.useCallback((newValue) => { + if (!isControlled) { + setValue(newValue); + } + }, []); + return [value, setValueIfUncontrolled]; +} +function serializeToDevModeString(input) { + let nextId = 0; + const seen = /* @__PURE__ */ new WeakMap(); + try { + const result = JSON.stringify(input, function replacer(key, value) { + if (key === "_owner" && this != null && typeof this === "object" && "$$typeof" in this) { + return void 0; + } + if (typeof value === "bigint") { + return `__bigint__:${value}`; + } + if (value !== null && typeof value === "object") { + const id = seen.get(value); + if (id !== void 0) { + return `__object__:${id}`; + } + seen.set(value, nextId); + nextId += 1; + } + return value; + }); + return result ?? `__top__:${typeof input}`; + } catch { + return "__unserializable__"; + } +} + +// node_modules/@base-ui/utils/esm/useStableCallback.js +var React4 = __toESM(require_react(), 1); + +// node_modules/@base-ui/utils/esm/useRefWithInit.js +var React3 = __toESM(require_react(), 1); +var UNINITIALIZED = {}; +function useRefWithInit(init2, initArg) { + const ref = React3.useRef(UNINITIALIZED); + if (ref.current === UNINITIALIZED) { + ref.current = init2(initArg); + } + return ref; +} + +// node_modules/@base-ui/utils/esm/useStableCallback.js +var useInsertionEffect = React4[`useInsertionEffect${Math.random().toFixed(1)}`.slice(0, -3)]; +var useSafeInsertionEffect = ( + // React 17 doesn't have useInsertionEffect. + useInsertionEffect && // Preact replaces useInsertionEffect with useLayoutEffect and fires too late. + useInsertionEffect !== React4.useLayoutEffect ? useInsertionEffect : (fn) => fn() +); +function useStableCallback(callback) { + const stable = useRefWithInit(createStableCallback).current; + stable.next = callback; + useSafeInsertionEffect(stable.effect); + return stable.trampoline; +} +function createStableCallback() { + const stable = { + next: void 0, + callback: assertNotCalled, + trampoline: (...args) => stable.callback?.(...args), + effect: () => { + stable.callback = stable.next; + } + }; + return stable; +} +function assertNotCalled() { + if (true) { + throw ( + /* minify-error-disabled */ + new Error("Base UI: Cannot call an event handler while rendering.") + ); + } +} + +// node_modules/@base-ui/utils/esm/useIsoLayoutEffect.js +var React5 = __toESM(require_react(), 1); +var noop = () => { +}; +var useIsoLayoutEffect = typeof document !== "undefined" ? React5.useLayoutEffect : noop; + +// node_modules/@base-ui/utils/esm/warn.js +var set2; +if (true) { + set2 = /* @__PURE__ */ new Set(); +} +function warn(...messages) { + if (true) { + const messageKey = messages.join(" "); + if (!set2.has(messageKey)) { + set2.add(messageKey); + console.warn(`Base UI: ${messageKey}`); + } + } +} + +// node_modules/@base-ui/react/esm/utils/useRenderElement.js +var React8 = __toESM(require_react(), 1); + +// node_modules/@base-ui/utils/esm/useMergedRefs.js +function useMergedRefs(a2, b2, c2, d2) { + const forkRef = useRefWithInit(createForkRef).current; + if (didChange(forkRef, a2, b2, c2, d2)) { + update(forkRef, [a2, b2, c2, d2]); + } + return forkRef.callback; +} +function useMergedRefsN(refs) { + const forkRef = useRefWithInit(createForkRef).current; + if (didChangeN(forkRef, refs)) { + update(forkRef, refs); + } + return forkRef.callback; +} +function createForkRef() { + return { + callback: null, + cleanup: null, + refs: [] + }; +} +function didChange(forkRef, a2, b2, c2, d2) { + return forkRef.refs[0] !== a2 || forkRef.refs[1] !== b2 || forkRef.refs[2] !== c2 || forkRef.refs[3] !== d2; +} +function didChangeN(forkRef, newRefs) { + return forkRef.refs.length !== newRefs.length || forkRef.refs.some((ref, index) => ref !== newRefs[index]); +} +function update(forkRef, refs) { + forkRef.refs = refs; + if (refs.every((ref) => ref == null)) { + forkRef.callback = null; + return; + } + forkRef.callback = (instance) => { + if (forkRef.cleanup) { + forkRef.cleanup(); + forkRef.cleanup = null; + } + if (instance != null) { + const cleanupCallbacks = Array(refs.length).fill(null); + for (let i2 = 0; i2 < refs.length; i2 += 1) { + const ref = refs[i2]; + if (ref == null) { + continue; + } + switch (typeof ref) { + case "function": { + const refCleanup = ref(instance); + if (typeof refCleanup === "function") { + cleanupCallbacks[i2] = refCleanup; + } + break; + } + case "object": { + ref.current = instance; + break; + } + default: + } + } + forkRef.cleanup = () => { + for (let i2 = 0; i2 < refs.length; i2 += 1) { + const ref = refs[i2]; + if (ref == null) { + continue; + } + switch (typeof ref) { + case "function": { + const cleanupCallback = cleanupCallbacks[i2]; + if (typeof cleanupCallback === "function") { + cleanupCallback(); + } else { + ref(null); + } + break; + } + case "object": { + ref.current = null; + break; + } + default: + } + } + }; + } + }; +} + +// node_modules/@base-ui/utils/esm/getReactElementRef.js +var React7 = __toESM(require_react(), 1); + +// node_modules/@base-ui/utils/esm/reactVersion.js +var React6 = __toESM(require_react(), 1); +var majorVersion = parseInt(React6.version, 10); +function isReactVersionAtLeast(reactVersionToCheck) { + return majorVersion >= reactVersionToCheck; +} + +// node_modules/@base-ui/utils/esm/getReactElementRef.js +function getReactElementRef(element) { + if (!/* @__PURE__ */ React7.isValidElement(element)) { + return null; + } + const reactElement = element; + const propsWithRef = reactElement.props; + return (isReactVersionAtLeast(19) ? propsWithRef?.ref : reactElement.ref) ?? null; +} + +// node_modules/@base-ui/utils/esm/mergeObjects.js +function mergeObjects(a2, b2) { + if (a2 && !b2) { + return a2; + } + if (!a2 && b2) { + return b2; + } + if (a2 || b2) { + return { + ...a2, + ...b2 + }; + } + return void 0; +} + +// node_modules/@base-ui/react/esm/utils/getStateAttributesProps.js +function getStateAttributesProps(state, customMapping) { + const props = {}; + for (const key in state) { + const value = state[key]; + if (customMapping?.hasOwnProperty(key)) { + const customProps = customMapping[key](value); + if (customProps != null) { + Object.assign(props, customProps); + } + continue; + } + if (value === true) { + props[`data-${key.toLowerCase()}`] = ""; + } else if (value) { + props[`data-${key.toLowerCase()}`] = value.toString(); + } + } + return props; +} + +// node_modules/@base-ui/react/esm/utils/resolveClassName.js +function resolveClassName(className, state) { + return typeof className === "function" ? className(state) : className; +} + +// node_modules/@base-ui/react/esm/utils/resolveStyle.js +function resolveStyle(style, state) { + return typeof style === "function" ? style(state) : style; +} + +// node_modules/@base-ui/react/esm/merge-props/mergeProps.js +var EMPTY_PROPS = {}; +function mergeProps(a2, b2, c2, d2, e2) { + if (!c2 && !d2 && !e2 && !a2) { + return createInitialMergedProps(b2); + } + let merged = createInitialMergedProps(a2); + if (b2) { + merged = mergeInto(merged, b2); + } + if (c2) { + merged = mergeInto(merged, c2); + } + if (d2) { + merged = mergeInto(merged, d2); + } + if (e2) { + merged = mergeInto(merged, e2); + } + return merged; +} +function mergePropsN(props) { + if (props.length === 0) { + return EMPTY_PROPS; + } + if (props.length === 1) { + return createInitialMergedProps(props[0]); + } + let merged = createInitialMergedProps(props[0]); + for (let i2 = 1; i2 < props.length; i2 += 1) { + merged = mergeInto(merged, props[i2]); + } + return merged; +} +function createInitialMergedProps(inputProps) { + if (isPropsGetter(inputProps)) { + return { + ...resolvePropsGetter(inputProps, EMPTY_PROPS) + }; + } + return copyInitialProps(inputProps); +} +function mergeInto(merged, inputProps) { + if (isPropsGetter(inputProps)) { + return resolvePropsGetter(inputProps, merged); + } + return mutablyMergeInto(merged, inputProps); +} +function copyInitialProps(inputProps) { + const copiedProps = { + ...inputProps + }; + for (const propName in copiedProps) { + const propValue = copiedProps[propName]; + if (isEventHandler(propName, propValue)) { + copiedProps[propName] = wrapEventHandler(propValue); + } + } + return copiedProps; +} +function mutablyMergeInto(mergedProps, externalProps) { + if (!externalProps) { + return mergedProps; + } + for (const propName in externalProps) { + const externalPropValue = externalProps[propName]; + switch (propName) { + case "style": { + mergedProps[propName] = mergeObjects(mergedProps.style, externalPropValue); + break; + } + case "className": { + mergedProps[propName] = mergeClassNames(mergedProps.className, externalPropValue); + break; + } + default: { + if (isEventHandler(propName, externalPropValue)) { + mergedProps[propName] = mergeEventHandlers(mergedProps[propName], externalPropValue); + } else { + mergedProps[propName] = externalPropValue; + } + } + } + } + return mergedProps; +} +function isEventHandler(key, value) { + const code0 = key.charCodeAt(0); + const code1 = key.charCodeAt(1); + const code2 = key.charCodeAt(2); + return code0 === 111 && code1 === 110 && code2 >= 65 && code2 <= 90 && (typeof value === "function" || typeof value === "undefined"); +} +function isPropsGetter(inputProps) { + return typeof inputProps === "function"; +} +function resolvePropsGetter(inputProps, previousProps) { + if (isPropsGetter(inputProps)) { + return inputProps(previousProps); + } + return inputProps ?? EMPTY_PROPS; +} +function mergeEventHandlers(ourHandler, theirHandler) { + if (!theirHandler) { + return ourHandler; + } + if (!ourHandler) { + return wrapEventHandler(theirHandler); + } + return (event) => { + if (isSyntheticEvent(event)) { + const baseUIEvent = event; + makeEventPreventable(baseUIEvent); + const result2 = theirHandler(baseUIEvent); + if (!baseUIEvent.baseUIHandlerPrevented) { + ourHandler?.(baseUIEvent); + } + return result2; + } + const result = theirHandler(event); + ourHandler?.(event); + return result; + }; +} +function wrapEventHandler(handler) { + if (!handler) { + return handler; + } + return (event) => { + if (isSyntheticEvent(event)) { + makeEventPreventable(event); + } + return handler(event); + }; +} +function makeEventPreventable(event) { + event.preventBaseUIHandler = () => { + event.baseUIHandlerPrevented = true; + }; + return event; +} +function mergeClassNames(ourClassName, theirClassName) { + if (theirClassName) { + if (ourClassName) { + return theirClassName + " " + ourClassName; + } + return theirClassName; + } + return ourClassName; +} +function isSyntheticEvent(event) { + return event != null && typeof event === "object" && "nativeEvent" in event; +} + +// node_modules/@base-ui/utils/esm/empty.js +var EMPTY_ARRAY = Object.freeze([]); +var EMPTY_OBJECT = Object.freeze({}); + +// node_modules/@base-ui/react/esm/utils/constants.js +var BASE_UI_SWIPE_IGNORE_ATTRIBUTE = "data-base-ui-swipe-ignore"; +var LEGACY_SWIPE_IGNORE_ATTRIBUTE = "data-swipe-ignore"; +var BASE_UI_SWIPE_IGNORE_SELECTOR = `[${BASE_UI_SWIPE_IGNORE_ATTRIBUTE}]`; +var LEGACY_SWIPE_IGNORE_SELECTOR = `[${LEGACY_SWIPE_IGNORE_ATTRIBUTE}]`; + +// node_modules/@base-ui/react/esm/utils/useRenderElement.js +var import_react = __toESM(require_react(), 1); +function useRenderElement(element, componentProps, params = {}) { + const renderProp = componentProps.render; + const outProps = useRenderElementProps(componentProps, params); + if (params.enabled === false) { + return null; + } + const state = params.state ?? EMPTY_OBJECT; + return evaluateRenderProp(element, renderProp, outProps, state); +} +function useRenderElementProps(componentProps, params = {}) { + const { + className: classNameProp, + style: styleProp, + render: renderProp + } = componentProps; + const { + state = EMPTY_OBJECT, + ref, + props, + stateAttributesMapping: stateAttributesMapping2, + enabled = true + } = params; + const className = enabled ? resolveClassName(classNameProp, state) : void 0; + const style = enabled ? resolveStyle(styleProp, state) : void 0; + const stateProps = enabled ? getStateAttributesProps(state, stateAttributesMapping2) : EMPTY_OBJECT; + const resolvedProps = enabled && props ? resolveRenderFunctionProps(props) : void 0; + const outProps = enabled ? mergeObjects(stateProps, resolvedProps) ?? {} : EMPTY_OBJECT; + if (typeof document !== "undefined") { + if (!enabled) { + useMergedRefs(null, null); + } else if (Array.isArray(ref)) { + outProps.ref = useMergedRefsN([outProps.ref, getReactElementRef(renderProp), ...ref]); + } else { + outProps.ref = useMergedRefs(outProps.ref, getReactElementRef(renderProp), ref); + } + } + if (!enabled) { + return EMPTY_OBJECT; + } + if (className !== void 0) { + outProps.className = mergeClassNames(outProps.className, className); + } + if (style !== void 0) { + outProps.style = mergeObjects(outProps.style, style); + } + return outProps; +} +function resolveRenderFunctionProps(props) { + if (Array.isArray(props)) { + return mergePropsN(props); + } + return mergeProps(void 0, props); +} +var REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"); +var COMPONENT_IDENTIFIER_PATTERN = /^[A-Z][A-Za-z0-9$]*$/; +var LOWERCASE_CHARACTER_PATTERN = /[a-z]/; +function evaluateRenderProp(element, render4, props, state) { + if (render4) { + if (typeof render4 === "function") { + if (true) { + warnIfRenderPropLooksLikeComponent(render4); + } + return render4(props, state); + } + const mergedProps = mergeProps(props, render4.props); + mergedProps.ref = props.ref; + let newElement = render4; + if (newElement?.$$typeof === REACT_LAZY_TYPE) { + const children = React8.Children.toArray(render4); + newElement = children[0]; + } + if (true) { + if (!/* @__PURE__ */ React8.isValidElement(newElement)) { + 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")); + } + } + return /* @__PURE__ */ React8.cloneElement(newElement, mergedProps); + } + if (element) { + if (typeof element === "string") { + return renderTag(element, props); + } + } + throw new Error(true ? "Base UI: Render element or function are not defined." : formatErrorMessage_default(8)); +} +function warnIfRenderPropLooksLikeComponent(renderFn) { + const functionName = renderFn.name; + if (functionName.length === 0) { + return; + } + if (!COMPONENT_IDENTIFIER_PATTERN.test(functionName)) { + return; + } + if (!LOWERCASE_CHARACTER_PATTERN.test(functionName)) { + return; + } + 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={}` or `render={(props) => }` instead.", "https://base-ui.com/r/invalid-render-prop"); +} +function renderTag(Tag, props) { + if (Tag === "button") { + return /* @__PURE__ */ (0, import_react.createElement)("button", { + type: "button", + ...props, + key: props.key + }); + } + if (Tag === "img") { + return /* @__PURE__ */ (0, import_react.createElement)("img", { + alt: "", + ...props, + key: props.key + }); + } + return /* @__PURE__ */ React8.createElement(Tag, props); +} + +// node_modules/@base-ui/react/esm/utils/reason-parts.js +var reason_parts_exports = {}; +__export(reason_parts_exports, { + cancelOpen: () => cancelOpen, + chipRemovePress: () => chipRemovePress, + clearPress: () => clearPress, + closePress: () => closePress, + closeWatcher: () => closeWatcher, + dayPress: () => dayPress, + decrementPress: () => decrementPress, + disabled: () => disabled, + drag: () => drag, + escapeKey: () => escapeKey, + focusOut: () => focusOut, + imperativeAction: () => imperativeAction, + incrementPress: () => incrementPress, + inputBlur: () => inputBlur, + inputChange: () => inputChange, + inputClear: () => inputClear, + inputPaste: () => inputPaste, + inputPress: () => inputPress, + itemPress: () => itemPress, + keyboard: () => keyboard, + linkPress: () => linkPress, + listNavigation: () => listNavigation, + monthChange: () => monthChange, + none: () => none, + outsidePress: () => outsidePress, + pointer: () => pointer, + scrub: () => scrub, + siblingOpen: () => siblingOpen, + swipe: () => swipe, + trackPress: () => trackPress, + triggerFocus: () => triggerFocus, + triggerHover: () => triggerHover, + triggerPress: () => triggerPress, + valuePropChange: () => valuePropChange, + wheel: () => wheel, + windowResize: () => windowResize +}); +var none = "none"; +var triggerPress = "trigger-press"; +var triggerHover = "trigger-hover"; +var triggerFocus = "trigger-focus"; +var outsidePress = "outside-press"; +var itemPress = "item-press"; +var closePress = "close-press"; +var linkPress = "link-press"; +var clearPress = "clear-press"; +var chipRemovePress = "chip-remove-press"; +var trackPress = "track-press"; +var incrementPress = "increment-press"; +var decrementPress = "decrement-press"; +var inputChange = "input-change"; +var inputClear = "input-clear"; +var inputBlur = "input-blur"; +var inputPaste = "input-paste"; +var inputPress = "input-press"; +var focusOut = "focus-out"; +var escapeKey = "escape-key"; +var closeWatcher = "close-watcher"; +var listNavigation = "list-navigation"; +var keyboard = "keyboard"; +var pointer = "pointer"; +var drag = "drag"; +var wheel = "wheel"; +var scrub = "scrub"; +var cancelOpen = "cancel-open"; +var siblingOpen = "sibling-open"; +var disabled = "disabled"; +var imperativeAction = "imperative-action"; +var swipe = "swipe"; +var windowResize = "window-resize"; +var dayPress = "day-press"; +var monthChange = "month-change"; +var valuePropChange = "value-prop-change"; + +// node_modules/@base-ui/react/esm/utils/createBaseUIEventDetails.js +function createChangeEventDetails(reason, event, trigger, customProperties) { + let canceled = false; + let allowPropagation = false; + const custom = customProperties ?? EMPTY_OBJECT; + const details = { + reason, + event: event ?? new Event("base-ui"), + cancel() { + canceled = true; + }, + allowPropagation() { + allowPropagation = true; + }, + get isCanceled() { + return canceled; + }, + get isPropagationAllowed() { + return allowPropagation; + }, + trigger, + ...custom + }; + return details; +} + +// node_modules/@base-ui/utils/esm/useId.js +var React10 = __toESM(require_react(), 1); + +// node_modules/@base-ui/utils/esm/safeReact.js +var React9 = __toESM(require_react(), 1); +var SafeReact = { + ...React9 +}; + +// node_modules/@base-ui/utils/esm/useId.js +var globalId = 0; +function useGlobalId(idOverride, prefix = "mui") { + const [defaultId, setDefaultId] = React10.useState(idOverride); + const id = idOverride || defaultId; + React10.useEffect(() => { + if (defaultId == null) { + globalId += 1; + setDefaultId(`${prefix}-${globalId}`); + } + }, [defaultId, prefix]); + return id; +} +var maybeReactUseId = SafeReact.useId; +function useId(idOverride, prefix) { + if (maybeReactUseId !== void 0) { + const reactId = maybeReactUseId(); + return idOverride ?? (prefix ? `${prefix}-${reactId}` : reactId); + } + return useGlobalId(idOverride, prefix); +} + +// node_modules/@base-ui/react/esm/utils/useBaseUiId.js +function useBaseUiId(idOverride) { + return useId(idOverride, "base-ui"); +} + +// node_modules/@base-ui/react/esm/collapsible/root/useCollapsibleRoot.js +var React13 = __toESM(require_react(), 1); + +// node_modules/@base-ui/react/esm/utils/useAnimationsFinished.js +var ReactDOM = __toESM(require_react_dom(), 1); + +// node_modules/@base-ui/utils/esm/useOnMount.js +var React11 = __toESM(require_react(), 1); +var EMPTY = []; +function useOnMount(fn) { + React11.useEffect(fn, EMPTY); +} + +// node_modules/@base-ui/utils/esm/useAnimationFrame.js +var EMPTY2 = null; +var LAST_RAF = globalThis.requestAnimationFrame; +var Scheduler = class { + /* This implementation uses an array as a backing data-structure for frame callbacks. + * It allows `O(1)` callback cancelling by inserting a `null` in the array, though it + * never calls the native `cancelAnimationFrame` if there are no frames left. This can + * be much more efficient if there is a call pattern that alterns as + * "request-cancel-request-cancel-…". + * But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation + * frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */ + callbacks = []; + callbacksCount = 0; + nextId = 1; + startId = 1; + isScheduled = false; + tick = (timestamp) => { + this.isScheduled = false; + const currentCallbacks = this.callbacks; + const currentCallbacksCount = this.callbacksCount; + this.callbacks = []; + this.callbacksCount = 0; + this.startId = this.nextId; + if (currentCallbacksCount > 0) { + for (let i2 = 0; i2 < currentCallbacks.length; i2 += 1) { + currentCallbacks[i2]?.(timestamp); + } + } + }; + request(fn) { + const id = this.nextId; + this.nextId += 1; + this.callbacks.push(fn); + this.callbacksCount += 1; + const didRAFChange = LAST_RAF !== requestAnimationFrame && (LAST_RAF = requestAnimationFrame, true); + if (!this.isScheduled || didRAFChange) { + requestAnimationFrame(this.tick); + this.isScheduled = true; + } + return id; + } + cancel(id) { + const index = id - this.startId; + if (index < 0 || index >= this.callbacks.length) { + return; + } + this.callbacks[index] = null; + this.callbacksCount -= 1; + } +}; +var scheduler = new Scheduler(); +var AnimationFrame = class _AnimationFrame { + static create() { + return new _AnimationFrame(); + } + static request(fn) { + return scheduler.request(fn); + } + static cancel(id) { + return scheduler.cancel(id); + } + currentId = EMPTY2; + /** + * Executes `fn` after `delay`, clearing any previously scheduled call. + */ + request(fn) { + this.cancel(); + this.currentId = scheduler.request(() => { + this.currentId = EMPTY2; + fn(); + }); + } + cancel = () => { + if (this.currentId !== EMPTY2) { + scheduler.cancel(this.currentId); + this.currentId = EMPTY2; + } + }; + disposeEffect = () => { + return this.cancel; + }; +}; +function useAnimationFrame() { + const timeout = useRefWithInit(AnimationFrame.create).current; + useOnMount(timeout.disposeEffect); + return timeout; +} + +// node_modules/@base-ui/react/esm/utils/resolveRef.js +function resolveRef(maybeRef) { + if (maybeRef == null) { + return maybeRef; + } + return "current" in maybeRef ? maybeRef.current : maybeRef; +} + +// node_modules/@base-ui/react/esm/utils/stateAttributesMapping.js +var TransitionStatusDataAttributes = /* @__PURE__ */ (function(TransitionStatusDataAttributes2) { + TransitionStatusDataAttributes2["startingStyle"] = "data-starting-style"; + TransitionStatusDataAttributes2["endingStyle"] = "data-ending-style"; + return TransitionStatusDataAttributes2; +})({}); +var STARTING_HOOK = { + [TransitionStatusDataAttributes.startingStyle]: "" +}; +var ENDING_HOOK = { + [TransitionStatusDataAttributes.endingStyle]: "" +}; +var transitionStatusMapping = { + transitionStatus(value) { + if (value === "starting") { + return STARTING_HOOK; + } + if (value === "ending") { + return ENDING_HOOK; + } + return null; + } +}; + +// node_modules/@base-ui/react/esm/utils/useAnimationsFinished.js +function useAnimationsFinished(elementOrRef, waitForStartingStyleRemoved = false, treatAbortedAsFinished = true) { + const frame = useAnimationFrame(); + return useStableCallback((fnToExecute, signal = null) => { + frame.cancel(); + const element = resolveRef(elementOrRef); + if (element == null) { + return; + } + const resolvedElement = element; + const done = () => { + ReactDOM.flushSync(fnToExecute); + }; + if (typeof resolvedElement.getAnimations !== "function" || globalThis.BASE_UI_ANIMATIONS_DISABLED) { + fnToExecute(); + return; + } + function exec() { + Promise.all(resolvedElement.getAnimations().map((animation) => animation.finished)).then(() => { + if (!signal?.aborted) { + done(); + } + }).catch(() => { + if (treatAbortedAsFinished) { + if (!signal?.aborted) { + done(); + } + return; + } + const currentAnimations = resolvedElement.getAnimations(); + if (!signal?.aborted && currentAnimations.length > 0 && currentAnimations.some((animation) => animation.pending || animation.playState !== "finished")) { + exec(); + } + }); + } + if (waitForStartingStyleRemoved) { + const startingStyleAttribute = TransitionStatusDataAttributes.startingStyle; + if (!resolvedElement.hasAttribute(startingStyleAttribute)) { + frame.request(exec); + return; + } + const attributeObserver = new MutationObserver(() => { + if (!resolvedElement.hasAttribute(startingStyleAttribute)) { + attributeObserver.disconnect(); + exec(); + } + }); + attributeObserver.observe(resolvedElement, { + attributes: true, + attributeFilter: [startingStyleAttribute] + }); + signal?.addEventListener("abort", () => attributeObserver.disconnect(), { + once: true + }); + return; + } + frame.request(exec); + }); +} + +// node_modules/@base-ui/react/esm/utils/useTransitionStatus.js +var React12 = __toESM(require_react(), 1); +function useTransitionStatus(open, enableIdleState = false, deferEndingState = false) { + const [transitionStatus, setTransitionStatus] = React12.useState(open && enableIdleState ? "idle" : void 0); + const [mounted, setMounted] = React12.useState(open); + if (open && !mounted) { + setMounted(true); + setTransitionStatus("starting"); + } + if (!open && mounted && transitionStatus !== "ending" && !deferEndingState) { + setTransitionStatus("ending"); + } + if (!open && !mounted && transitionStatus === "ending") { + setTransitionStatus(void 0); + } + useIsoLayoutEffect(() => { + if (!open && mounted && transitionStatus !== "ending" && deferEndingState) { + const frame = AnimationFrame.request(() => { + setTransitionStatus("ending"); + }); + return () => { + AnimationFrame.cancel(frame); + }; + } + return void 0; + }, [open, mounted, transitionStatus, deferEndingState]); + useIsoLayoutEffect(() => { + if (!open || enableIdleState) { + return void 0; + } + const frame = AnimationFrame.request(() => { + setTransitionStatus(void 0); + }); + return () => { + AnimationFrame.cancel(frame); + }; + }, [enableIdleState, open]); + useIsoLayoutEffect(() => { + if (!open || !enableIdleState) { + return void 0; + } + if (open && mounted && transitionStatus !== "idle") { + setTransitionStatus("starting"); + } + const frame = AnimationFrame.request(() => { + setTransitionStatus("idle"); + }); + return () => { + AnimationFrame.cancel(frame); + }; + }, [enableIdleState, open, mounted, transitionStatus]); + return { + mounted, + setMounted, + transitionStatus + }; +} + +// node_modules/@base-ui/react/esm/collapsible/root/useCollapsibleRoot.js +function useCollapsibleRoot(parameters) { + const { + open: openParam, + defaultOpen, + onOpenChange, + disabled: disabled2 + } = parameters; + const isControlled = openParam !== void 0; + const [open, setOpen] = useControlled({ + controlled: openParam, + default: defaultOpen, + name: "Collapsible", + state: "open" + }); + const { + mounted, + setMounted, + transitionStatus + } = useTransitionStatus(open, true, true); + const [visible, setVisible] = React13.useState(open); + const [{ + height, + width + }, setDimensions] = React13.useState({ + height: void 0, + width: void 0 + }); + const defaultPanelId = useBaseUiId(); + const [panelIdState, setPanelIdState] = React13.useState(); + const panelId = panelIdState ?? defaultPanelId; + const [hiddenUntilFound, setHiddenUntilFound] = React13.useState(false); + const [keepMounted, setKeepMounted] = React13.useState(false); + const abortControllerRef = React13.useRef(null); + const animationTypeRef = React13.useRef(null); + const transitionDimensionRef = React13.useRef(null); + const panelRef = React13.useRef(null); + const runOnceAnimationsFinish = useAnimationsFinished(panelRef, false); + const handleTrigger = useStableCallback((event) => { + const nextOpen = !open; + const eventDetails = createChangeEventDetails(reason_parts_exports.triggerPress, event.nativeEvent); + onOpenChange(nextOpen, eventDetails); + if (eventDetails.isCanceled) { + return; + } + const panel = panelRef.current; + if (animationTypeRef.current === "css-animation" && panel != null) { + panel.style.removeProperty("animation-name"); + } + if (!hiddenUntilFound && !keepMounted) { + if (animationTypeRef.current != null && animationTypeRef.current !== "css-animation") { + if (!mounted && nextOpen) { + setMounted(true); + } + } + if (animationTypeRef.current === "css-animation") { + if (!visible && nextOpen) { + setVisible(true); + } + if (!mounted && nextOpen) { + setMounted(true); + } + } + } + setOpen(nextOpen); + if (animationTypeRef.current === "none" && mounted && !nextOpen) { + setMounted(false); + } + }); + useIsoLayoutEffect(() => { + if (isControlled && animationTypeRef.current === "none" && !open) { + setMounted(false); + } + }, [isControlled, open, openParam, setMounted]); + return React13.useMemo(() => ({ + abortControllerRef, + animationTypeRef, + disabled: disabled2, + handleTrigger, + height, + mounted, + open, + panelId, + panelRef, + runOnceAnimationsFinish, + setDimensions, + setHiddenUntilFound, + setKeepMounted, + setMounted, + setOpen, + setPanelIdState, + setVisible, + transitionDimensionRef, + transitionStatus, + visible, + width + }), [abortControllerRef, animationTypeRef, disabled2, handleTrigger, height, mounted, open, panelId, panelRef, runOnceAnimationsFinish, setDimensions, setHiddenUntilFound, setKeepMounted, setMounted, setOpen, setVisible, transitionDimensionRef, transitionStatus, visible, width]); +} + +// node_modules/@base-ui/react/esm/collapsible/root/CollapsibleRootContext.js +var React14 = __toESM(require_react(), 1); +var CollapsibleRootContext = /* @__PURE__ */ React14.createContext(void 0); +if (true) CollapsibleRootContext.displayName = "CollapsibleRootContext"; +function useCollapsibleRootContext() { + const context = React14.useContext(CollapsibleRootContext); + if (context === void 0) { + throw new Error(true ? "Base UI: CollapsibleRootContext is missing. Collapsible parts must be placed within ." : formatErrorMessage_default(15)); + } + return context; +} + +// node_modules/@base-ui/react/esm/collapsible/panel/CollapsiblePanelDataAttributes.js +var CollapsiblePanelDataAttributes = (function(CollapsiblePanelDataAttributes2) { + CollapsiblePanelDataAttributes2["open"] = "data-open"; + CollapsiblePanelDataAttributes2["closed"] = "data-closed"; + CollapsiblePanelDataAttributes2[CollapsiblePanelDataAttributes2["startingStyle"] = TransitionStatusDataAttributes.startingStyle] = "startingStyle"; + CollapsiblePanelDataAttributes2[CollapsiblePanelDataAttributes2["endingStyle"] = TransitionStatusDataAttributes.endingStyle] = "endingStyle"; + return CollapsiblePanelDataAttributes2; +})({}); + +// node_modules/@base-ui/react/esm/collapsible/trigger/CollapsibleTriggerDataAttributes.js +var CollapsibleTriggerDataAttributes = /* @__PURE__ */ (function(CollapsibleTriggerDataAttributes2) { + CollapsibleTriggerDataAttributes2["panelOpen"] = "data-panel-open"; + return CollapsibleTriggerDataAttributes2; +})({}); + +// node_modules/@base-ui/react/esm/utils/collapsibleOpenStateMapping.js +var PANEL_OPEN_HOOK = { + [CollapsiblePanelDataAttributes.open]: "" +}; +var PANEL_CLOSED_HOOK = { + [CollapsiblePanelDataAttributes.closed]: "" +}; +var triggerOpenStateMapping = { + open(value) { + if (value) { + return { + [CollapsibleTriggerDataAttributes.panelOpen]: "" + }; + } + return null; + } +}; +var collapsibleOpenStateMapping = { + open(value) { + if (value) { + return PANEL_OPEN_HOOK; + } + return PANEL_CLOSED_HOOK; + } +}; + +// node_modules/@base-ui/react/esm/use-button/useButton.js +var React17 = __toESM(require_react(), 1); + +// node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs +function hasWindow() { + return typeof window !== "undefined"; +} +function getWindow(node) { + var _node$ownerDocument; + return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window; +} +function isHTMLElement(value) { + if (!hasWindow()) { + return false; + } + return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement; +} + +// node_modules/@base-ui/react/esm/composite/root/CompositeRootContext.js +var React15 = __toESM(require_react(), 1); +var CompositeRootContext = /* @__PURE__ */ React15.createContext(void 0); +if (true) CompositeRootContext.displayName = "CompositeRootContext"; +function useCompositeRootContext(optional = false) { + const context = React15.useContext(CompositeRootContext); + if (context === void 0 && !optional) { + throw new Error(true ? "Base UI: CompositeRootContext is missing. Composite parts must be placed within ." : formatErrorMessage_default(16)); + } + return context; +} + +// node_modules/@base-ui/react/esm/utils/useFocusableWhenDisabled.js +var React16 = __toESM(require_react(), 1); +function useFocusableWhenDisabled(parameters) { + const { + focusableWhenDisabled, + disabled: disabled2, + composite = false, + tabIndex: tabIndexProp = 0, + isNativeButton + } = parameters; + const isFocusableComposite = composite && focusableWhenDisabled !== false; + const isNonFocusableComposite = composite && focusableWhenDisabled === false; + const props = React16.useMemo(() => { + const additionalProps = { + // allow Tabbing away from focusableWhenDisabled elements + onKeyDown(event) { + if (disabled2 && focusableWhenDisabled && event.key !== "Tab") { + event.preventDefault(); + } + } + }; + if (!composite) { + additionalProps.tabIndex = tabIndexProp; + if (!isNativeButton && disabled2) { + additionalProps.tabIndex = focusableWhenDisabled ? tabIndexProp : -1; + } + } + if (isNativeButton && (focusableWhenDisabled || isFocusableComposite) || !isNativeButton && disabled2) { + additionalProps["aria-disabled"] = disabled2; + } + if (isNativeButton && (!focusableWhenDisabled || isNonFocusableComposite)) { + additionalProps.disabled = disabled2; + } + return additionalProps; + }, [composite, disabled2, focusableWhenDisabled, isFocusableComposite, isNonFocusableComposite, isNativeButton, tabIndexProp]); + return { + props + }; +} + +// node_modules/@base-ui/react/esm/use-button/useButton.js +function useButton(parameters = {}) { + const { + disabled: disabled2 = false, + focusableWhenDisabled, + tabIndex = 0, + native: isNativeButton = true, + composite: compositeProp + } = parameters; + const elementRef = React17.useRef(null); + const compositeRootContext = useCompositeRootContext(true); + const isCompositeItem = compositeProp ?? compositeRootContext !== void 0; + const { + props: focusableWhenDisabledProps + } = useFocusableWhenDisabled({ + focusableWhenDisabled, + disabled: disabled2, + composite: isCompositeItem, + tabIndex, + isNativeButton + }); + if (true) { + React17.useEffect(() => { + if (!elementRef.current) { + return; + } + const isButtonTag = isButtonElement(elementRef.current); + if (isNativeButton) { + if (!isButtonTag) { + const ownerStackMessage = SafeReact.captureOwnerStack?.() || ""; + const message2 = "A component that acts as a button expected a native